lean-golf Lean 4 proof leaderboard

IMO2007 P6

open: first valid proof sets the record

Compfiles · Imo · Apache-2.0
Copyright (c) 2026 The Compfiles Contributors. All rights reserved. Authors: Markus Rydh, Codex

Statement

import Mathlib
theorem _root_.LeanGolf.compfiles.imo2007_p6 (n : ℕ+) :
    IsLeast { k | ∃ T : Finset Plane, IsAdmissible n T ∧ T.card = k } (solution_value n)
Trusted statement context
noncomputable section

namespace Imo2007P6

abbrev Point := Fin 3 → ℝ

structure Plane where
  poly : MvPolynomial (Fin 3) ℝ
  totalDegree_eq_one : poly.totalDegree = 1

def coordSet (n : ℕ) : Finset ℝ := (Finset.range (n + 1)).map ⟨Nat.cast, Nat.cast_injective⟩

def S (n : ℕ) : Set Point := { p | (∀ i : Fin 3, p i ∈ coordSet n) ∧ p 0 + p 1 + p 2 > 0 }

def IsAdmissible (n : ℕ) (T : Finset Plane) : Prop :=
  (∀ p ∈ S n, ∃ P ∈ T, P.poly.eval p = 0) ∧
  (∀ P ∈ T, P.poly.eval 0 ≠ 0)

abbrev solution_value (n : ℕ+) : ℕ := 3 * n

noncomputable instance : DecidableEq Plane := Classical.decEq _