Putnam 2023 B1
open: first valid proof sets the record
PutnamBench · 2023 B1 · Apache-2.0
PutnamBench contributors (Tsoukalas et al.).
Statement
import Mathlib
theorem LeanGolf.putnambench.putnam_2023_b1
(m n : ℕ)
(initcoins : ℕ → ℕ → Bool)
(hinitcoins : initcoins = (fun i j : ℕ => (i ≤ m - 2 ∧ j ≤ n - 2 : Bool)))
(IsLegalMove : (ℕ → ℕ → Bool) → (ℕ → ℕ → Bool) → Prop)
(IsLegalMove_def : ∀ coins1 coins2,
IsLegalMove coins1 coins2 ↔
∃ i j, i < m - 1 ∧ j < n - 1 ∧
coins1 i j ∧ !coins1 (i + 1) j ∧ !coins1 i (j + 1) ∧ !coins1 (i + 1) (j + 1) ∧
!coins2 i j ∧ !coins2 (i + 1) j ∧ !coins2 i (j + 1) ∧ coins2 (i + 1) (j + 1) ∧
(∀ i' j', ((i', j') ≠ (i, j) ∧ (i', j') ≠ (i + 1, j) ∧ (i', j') ≠ (i, j + 1) ∧ (i', j') ≠ (i + 1, j + 1))
→ coins1 i' j' = coins2 i' j'))
(IsLegalSeq : List (ℕ → ℕ → Bool) → Prop)
(IsLegalSeq_def : ∀ seq, IsLegalSeq seq ↔ seq.length ≥ 1 ∧ seq[0]! = initcoins ∧ (∀ i < seq.length - 1, IsLegalMove seq[i]! seq[i + 1]!))
(mnpos : 1 < m ∧ 1 < n)
: {config : ℕ → ℕ → Bool | ∃ seq : List (ℕ → ℕ → Bool), IsLegalSeq seq ∧ config = seq.getLast!}.encard = putnam_2023_b1_solution m nTrusted statement context
noncomputable section
open Nat
abbrev putnam_2023_b1_solution : ℕ → ℕ → ℕ :=
(fun m n : ℕ => Nat.choose (m + n - 2) (m - 1))