lean-golf Lean 4 proof leaderboard

IMO2010 P5

open: first valid proof sets the record

Compfiles · Imo · Apache-2.0
Copyright (c) 2025 Jeremy Tan. All rights reserved. Authors: Jeremy Tan

Statement

import Mathlib.Algebra.Group.Fin.Basic
import Mathlib.Algebra.Order.Pi
import Mathlib.Algebra.Order.Ring.Nat
import Mathlib.Algebra.Order.Sub.Basic
import Mathlib.Algebra.Order.Sub.Prod
import Mathlib.Data.Fintype.Basic
theorem _root_.LeanGolf.compfiles.imo2010_p5 : Reachable (single 5 (2010 ^ 2010 ^ 2010)) ↔ solution
Trusted statement context
noncomputable section

open Pi Equiv Function

namespace Imo2010P5

inductive Reachable : (Fin 6 → ℕ) → Prop
  /-- The starting position with one coin in each box -/
  | base : Reachable 1
  /-- Remove a coin from $B_j$ and add two coins to $B_{j+1}$ -/
  | move1 {B i} (rB : Reachable B) (hi : i < 5) (pB : 0 < B i) :
      Reachable (B - single i 1 + single (i + 1) 2)
  /-- Remove a coin from $B_k$ and swap $B_{k+1}$ and $B_{k+2}$ -/
  | move2 {B i} (rB : Reachable B) (hi : i < 4) (pB : 0 < B i) :
      Reachable (B ∘ swap (i + 1) (i + 2) - single i 1)

abbrev solution : Bool := true