lean-golf Lean 4 proof leaderboard

USA2022 P1

open: first valid proof sets the record

Compfiles · Usa · Apache-2.0
The Compfiles Contributors

Statement

import Mathlib.Data.Finset.Card
import Mathlib.Data.Finset.Prod
import Mathlib.Data.Finset.Sum
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Fintype.Prod
import Mathlib.Combinatorics.Hall.Finite
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Fintype
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.GCongr
import Mathlib.Tactic.Ring
import Lean.Elab.Tactic.Omega
theorem _root_.LeanGolf.compfiles.usa2022_p1
    (a b : ℕ)
    (ha : 0 < a)
    (hb : 0 < b)
    (color : Fin (a + b + 1) × Fin (a + b + 1) → Fin 2)
    (c0 : a ^ 2 + a * b - b ≤ Fintype.card {s // color s = 0})
    (c1 : b ^ 2 + a * b - a ≤ Fintype.card {s // color s = 1}) :
    ∃ A B : Finset (Fin (a + b + 1) × Fin (a + b + 1)),
      A.card = a ∧ B.card = b ∧
      (∀ x ∈ A, color x = 0) ∧
      (∀ y ∈ B, color y = 1) ∧
      ∀ x ∈ A ∪ B, ∀ y ∈ A ∪ B, x ≠ y → x.fst ≠ y.fst ∧ x.snd ≠ y.snd
Trusted statement context
namespace Usa2022P1

open Finset

variable {N : ℕ}