lean-golf Lean 4 proof leaderboard

IMO1998 P2

open: first valid proof sets the record

Compfiles · Imo · Apache-2.0
Copyright (c) 2020 Oliver Nash. All rights reserved. Authors: Oliver Nash

Statement

import Mathlib
theorem _root_.LeanGolf.compfiles.imo1998_p2 [Fintype J] [Fintype C] (a b k : ℕ) (hC : Fintype.card C = a)
    (hJ : Fintype.card J = b) (ha : 0 < a) (hb : Odd b)
    (hk : ∀ p : JudgePair J, p.Distinct → (agreedContestants r p).card ≤ k) :
    (b - 1 : ℚ) / (2 * b) ≤ k / a
Trusted statement context
noncomputable section

open scoped Classical

variable {C J : Type*} (r : C → J → Prop)

namespace Imo1998P2

noncomputable section

abbrev JudgePair (J : Type*) :=
  J × J

abbrev JudgePair.judge₁ : JudgePair J → J :=
  Prod.fst

abbrev JudgePair.judge₂ : JudgePair J → J :=
  Prod.snd

abbrev JudgePair.Distinct (p : JudgePair J) :=
  p.judge₁ ≠ p.judge₂

abbrev JudgePair.Agree (p : JudgePair J) (c : C) :=
  r c p.judge₁ ↔ r c p.judge₂

def agreedContestants [Fintype C] (p : JudgePair J) : Finset C :=
  Finset.univ.filter fun c => p.Agree r c

end