lean-golf Lean 4 proof leaderboard

IMO1992 P3

open: first valid proof sets the record

Compfiles · Imo · Apache-2.0
Copyright (c) 2026 The Compfiles Contributors. All rights reserved. Authors: Kimi K3

Statement

import Mathlib.Tactic
import Mathlib.Data.Finset.Sym
theorem _root_.LeanGolf.compfiles.imo1992_p3 :
    IsLeast {n : ℕ | ∀ c : EdgeColoring, c.coloredEdges.card = n →
      c.HasMonoTriangle} answer
Trusted statement context
noncomputable section

namespace Imo1992P3

structure EdgeColoring where
  /-- the color assigned to the edge joining two vertices -/
  color : Sym2 (Fin 9) → Option (Fin 2)
  /-- there is no edge from a vertex to itself -/
  diag : ∀ i : Fin 9, color s(i, i) = none

def EdgeColoring.coloredEdges (c : EdgeColoring) : Finset (Sym2 (Fin 9)) :=
  Finset.filter (fun e => (c.color e).isSome) Finset.univ

def EdgeColoring.HasMonoTriangle (c : EdgeColoring) : Prop :=
  ∃ i j k : Fin 9, i ≠ j ∧ j ≠ k ∧ k ≠ i ∧
    ∃ b : Fin 2, c.color s(i, j) = some b ∧ c.color s(j, k) = some b ∧
      c.color s(k, i) = some b

abbrev answer : ℕ := 33