IMO2002 P1
open: first valid proof sets the record
Compfiles · Imo · Apache-2.0
Copyright (c) 2026 David Renshaw. All rights reserved. Authors: David Renshaw
Statement
import Mathlib
theorem _root_.LeanGolf.compfiles.imo2002_p1 (n : ℕ) (_hn : 0 < n) (color : ℕ × ℕ → Color)
(hcolor : ∀ x' y' x y, x' ≤ x → y' ≤ y → x + y < n →
color (x, y) = .red → color (x', y') = .red) :
ChoiceCount n color Prod.fst = ChoiceCount n color Prod.sndTrusted statement context
noncomputable section
namespace Imo2002P1
inductive Color : Type where
| red : Color
| blue : Color
deriving DecidableEq
instance : Fintype Color where
elems := ⟨↑[Color.red, Color.blue], by decide⟩
complete := fun x => by cases x <;> decide
def T (n : ℕ) : Finset (ℕ × ℕ) :=
(Finset.range n ×ˢ Finset.range n).filter fun p ↦ p.1 + p.2 < n
def ChoiceCount (n : ℕ) (color : ℕ × ℕ → Color) (coord : ℕ × ℕ → ℕ) : ℕ :=
(((T n).powersetCard n).filter fun s ↦
(∀ p ∈ s, color p = .blue) ∧
∀ p ∈ s, ∀ q ∈ s, coord p = coord q → p = q).card
variable {n : ℕ} {color : ℕ × ℕ → Color}
(hcolor : ∀ x' y' x y, x' ≤ x → y' ≤ y → x + y < n →
color (x, y) = .red → color (x', y') = .red)
include hcolor
omit hcolor