Compfiles/Usa2021P3.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned compfiles documentation, Pinned compfiles corpus index

27 declarations, 0 contain sorry, 0 declared as axioms

USA Mathematical Olympiad 2021, Problem 3

Let n ≥ 2 be an integer. An n × n board is initially empty. Each minute, you may perform one of three moves:

• If there is an L-shaped tromino region of three cells without stones on the board (see figure; rotations not allowed), you may place a stone in each of those cells. • If all cells in a column have a stone, you may remove all stones from that column. • If all cells in a row have a stone, you may remove all stones from that row.

For which n is it possible that, after some non-zero number of moves, the board has no stones?

Imports (4)
Imported by 1 file
  1. determine Usa2021P3.answer line 37 source

    no axioms what this means

    Statement uses: Nat

    Proof uses: Dvd.dvd, OfNat.ofNat

    2 instances, coercions and auxiliary constants left out.

  2. abbrev Usa2021P3.Board A board state: the set of cells that currently hold a stone line 59 source

    Source documentation

    A board state: the set of cells that currently hold a stone.

    standard axioms: Quot.sound, propext what this means

    Proof uses: Finset, Prod, Nat

    abbrev Board := Finset (ℕ × ℕ)
  3. def Usa2021P3.trominoCells The three cells of the L-tromino with anchor (i, j), as in the figure of the problem statement: (i, j), (i + 1, j) and (i + 1, j + 1) line 63 source

    Source documentation

    The three cells of the L-tromino with anchor (i, j), as in the figure of the problem statement: (i, j), (i + 1, j) and (i + 1, j + 1).

    standard axioms: Quot.sound, propext what this means

    Statement uses: Nat, Finset, Prod

    Proof uses: Insert.insert, Prod.mk, HAdd.hAdd, OfNat.ofNat, Singleton.singleton

    7 instances, coercions and auxiliary constants left out.

    def trominoCells (i j : ℕ) : Finset (ℕ × ℕ) := {(i, j), (i + 1, j), (i + 1, j + 1)}
  4. inductive Usa2021P3.Step One legal move of the game: either place a stone on each cell of an empty L-tromino, or clear a full row, or clear a full column line 67 source

    Source documentation

    One legal move of the game: either place a stone on each cell of an empty L-tromino, or clear a full row, or clear a full column.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Usa2021P3.Board

    inductive Step (n : ℕ) : Board → Board → Prop
      | tromino {b : Board} {i j : ℕ} (hi : i + 1 < n) (hj : j + 1 < n)
          (h₁ : (i, j) ∉ b) (h₂ : (i + 1, j) ∉ b) (h₃ : (i + 1, j + 1) ∉ b) :
          Step n b (b ∪ trominoCells i j)
      | clearRow {b : Board} (r : ℕ) (hfull : Finset.range n ×ˢ {r} ⊆ b) :
          Step n b (b \ Finset.range n ×ˢ {r})
      | clearCol {b : Board} (c : ℕ) (hfull : {c} ×ˢ Finset.range n ⊆ b) :
          Step n b (b \ {c} ×ˢ Finset.range n)
    
    /-- A sequence of legal moves. -/

    Mentions: Usa2021P3.Board, Usa2021P3.trominoCells

  5. inductive Usa2021P3.Reach A sequence of legal moves line 77 source

    Source documentation

    A sequence of legal moves.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Usa2021P3.Board

    inductive Reach (n : ℕ) : Board → Board → Prop
      | refl (b : Board) : Reach n b b
      | tail {b b' b'' : Board} : Reach n b b' → Step n b' b'' → Reach n b b''
    
    /-- The goal of the game: the board can be emptied after a non-zero number of
    moves. -/

    Mentions: Usa2021P3.Board, Usa2021P3.Step

  6. def Usa2021P3.Solvable The goal of the game: the board can be emptied after a non-zero number of moves line 83 source

    Source documentation

    The goal of the game: the board can be emptied after a non-zero number of moves.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat

    Proof uses: Exists, Usa2021P3.Board, And, Usa2021P3.Step, EmptyCollection.emptyCollection, Prod, Usa2021P3.Reach

    1 instances, coercions and auxiliary constants left out.

    def Solvable (n : ℕ) : Prop := ∃ b, Step n ∅ b ∧ Reach n b ∅

    Mentions: Usa2021P3.Step, Usa2021P3.Reach

  7. lemma Usa2021P3.Reach.trans line 85 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Usa2021P3.Board, Usa2021P3.Reach

    Proof uses: Usa2021P3.Reach.rec, Usa2021P3.Step, Usa2021P3.Reach.tail

    Tactic trace: 3 steps

    Open to load the checked before-and-after goal states.

  8. lemma Usa2021P3.Reach.single line 91 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Usa2021P3.Board, Usa2021P3.Step, Usa2021P3.Reach

    Proof uses: Usa2021P3.Reach.tail, Usa2021P3.Reach.refl

  9. def Usa2021P3.gains gains a n r c counts how many times cell (r, c) receives a stone, given that a tromino was placed with anchor (i, j) exactly a i j times line 110 source

    Source documentation

    gains a n r c counts how many times cell (r, c) receives a stone, given that a tromino was placed with anchor (i, j) exactly a i j times. The cell (r, c) is covered by the trominoes anchored at (r, c), (r - 1, c) and (r - 1, c - 1).

    no axioms what this means

    Statement uses: Nat

    Proof uses: HAdd.hAdd, ite, And, LT.lt, OfNat.ofNat, LE.le, HSub.hSub

    10 instances, coercions and auxiliary constants left out.

    def gains (a : ℕ → ℕ → ℕ) (n r c : ℕ) : ℕ :=
    …
  10. def Usa2021P3.Support Trominoes may only be placed at anchors (i, j) with i + 1 < n and j + 1 < n; counts at other anchors vanish line 117 source

    Source documentation

    Trominoes may only be placed at anchors (i, j) with i + 1 < n and j + 1 < n; counts at other anchors vanish.

    no axioms what this means

    Statement uses: Nat

    Proof uses: Or, LE.le, HAdd.hAdd, OfNat.ofNat, Eq

    4 instances, coercions and auxiliary constants left out.

    def Support (a : ℕ → ℕ → ℕ) (n : ℕ) : Prop :=
    …
  11. lemma Usa2021P3.gains_zero line 121 source

    standard axioms: propext what this means

    Statement uses: Nat, Eq, Usa2021P3.gains, OfNat.ofNat

    Proof uses: of_eq_true, Eq.trans, True, congrFun', congrArg, HAdd.hAdd, ite, And, LT.lt, LE.le, HSub.hSub, congr, ite_congr, Eq.refl, Not, ite_self, add_zero, eq_self

    13 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

  12. lemma Usa2021P3.gains_add line 124 source

    standard axioms: propext what this means

    Statement uses: Nat, Eq, Usa2021P3.gains, HAdd.hAdd

    Proof uses: id, dite, ite, And, LT.lt, OfNat.ofNat, LE.le, HSub.hSub, Eq.mpr, congr, congrArg, congrFun', ite_eq_left, Mathlib.Tactic.Ring.of_eq, HMul.hMul, HPow.hPow, Nat.rawCast, Mathlib.Tactic.Ring.Common.add_congr, Mathlib.Tactic.Ring.Common.atom_pf, rfl and 10 more

    29 instances, coercions and auxiliary constants left out.

    Tactic trace: 3 steps

    Open to load the checked before-and-after goal states.

  13. lemma Usa2021P3.Support.add line 129 source

    standard axioms: propext what this means

    Statement uses: Nat, Usa2021P3.Support, HAdd.hAdd

    Proof uses: Or, LE.le, OfNat.ofNat, of_eq_true, Eq, Eq.trans, True, congrFun', congrArg, congr, add_zero, eq_self

    8 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

    Open to load the checked before-and-after goal states.

  14. lemma Usa2021P3.gains_single The gains coming from a single tromino placed at the legal anchor (i, j) are exactly the indicator function of its three cells line 136 source

    Source documentation

    The gains coming from a single tromino placed at the legal anchor (i, j) are exactly the indicator function of its three cells.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, LT.lt, HAdd.hAdd, OfNat.ofNat, Eq, Usa2021P3.gains, ite, And, Membership.mem, Prod, Finset, Usa2021P3.trominoCells, Prod.mk

    Proof uses: dite, of_eq_true, Eq.trans, True, congr, congrArg, ite_eq_left_of_eq_true, eq_true, and_self, eq_self, Not, ite_congr, Eq.refl, ite_eq_right_of_eq_false, eq_false, ite_self, LE.le, HSub.hSub, Function.swap, congrFun' and 17 more

    83 instances, coercions and auxiliary constants left out.

    Tactic trace: 43 steps

    Open to load the checked before-and-after goal states.

    lemma gains_single {n i j : ℕ} (hi : i + 1 < n) (hj : j + 1 < n) (r c : ℕ) :
        gains (fun x y ↦ if x = i ∧ y = j then 1 else 0) n r c =
          if (r, c) ∈ trominoCells i j then 1 else 0 := by
    …

    Mentions: Usa2021P3.gains, Usa2021P3.trominoCells

  15. lemma Usa2021P3.extract_step A single move, seen through the counting functions: the gains and losses of every cell can be expressed with suitable counts line 171 source

    Source documentation

    A single move, seen through the counting functions: the gains and losses of every cell can be expressed with suitable counts.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Usa2021P3.Board, Usa2021P3.Step, Exists, And, Usa2021P3.Support, LT.lt, Eq, HAdd.hAdd, Usa2021P3.gains, ite, Membership.mem, Prod, Prod.mk, OfNat.ofNat

    Proof uses: HEq, Not, Union.union, Usa2021P3.trominoCells, Usa2021P3.Step.tromino, Exists.intro, And.intro, Or, LE.le, id, dite, Eq.mpr, False, Eq.trans, congrFun', congrArg, ite_eq_left, eq_false', False.elim, noConfusion_of_Nat and 46 more

    42 instances, coercions and auxiliary constants left out.

    Tactic trace: 86 steps

    Open to load the checked before-and-after goal states.

    lemma extract_step {n : ℕ} {b b' : Board} (h : Step n b b') :
        ∃ (a : ℕ → ℕ → ℕ) (ρ γ : ℕ → ℕ), Support a n ∧ ∀ r c, r < n → c < n →
          gains a n r c + (if (r, c) ∈ b then 1 else 0) =
            ρ r + γ c + (if (r, c) ∈ b' then 1 else 0) := by
    …

    Mentions: Usa2021P3.Board, h, Usa2021P3.Step, Usa2021P3.Support, Usa2021P3.gains

  16. lemma Usa2021P3.extract A whole sequence of moves, seen through the counting functions line 246 source

    Source documentation

    A whole sequence of moves, seen through the counting functions.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Usa2021P3.Board, Usa2021P3.Reach, Exists, And, Usa2021P3.Support, LT.lt, Eq, HAdd.hAdd, Usa2021P3.gains, ite, Membership.mem, Prod, Prod.mk, OfNat.ofNat

    Proof uses: Usa2021P3.Reach.rec, Exists.intro, And.intro, of_eq_true, Or, LE.le, Eq.trans, True, forall_congr, implies_congr, Eq.refl, eq_self, implies_true, congr, congrArg, congrFun', Usa2021P3.gains_zero, zero_add, add_zero, Usa2021P3.Step and 5 more

    24 instances, coercions and auxiliary constants left out.

    Tactic trace: 13 steps

    Open to load the checked before-and-after goal states.

    lemma extract {n : ℕ} {b b' : Board} (h : Reach n b b') :
        ∃ (a : ℕ → ℕ → ℕ) (ρ γ : ℕ → ℕ), Support a n ∧ ∀ r c, r < n → c < n →
          gains a n r c + (if (r, c) ∈ b then 1 else 0) =
            ρ r + γ c + (if (r, c) ∈ b' then 1 else 0) := by
    …

    Mentions: Usa2021P3.Board, h, Usa2021P3.Reach, Usa2021P3.Support, Usa2021P3.gains

  17. lemma Usa2021P3.extract_solvable In particular, a successful game yields the cell equations together with at least one tromino that was actually placed line 267 source

    Source documentation

    In particular, a successful game yields the cell equations together with at least one tromino that was actually placed.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, LE.le, OfNat.ofNat, Usa2021P3.Solvable, Exists, And, Usa2021P3.Support, LT.lt, Eq, Usa2021P3.gains, HAdd.hAdd

    Proof uses: Usa2021P3.Board, Usa2021P3.Step, EmptyCollection.emptyCollection, Prod, Usa2021P3.Reach, ite, Membership.mem, Prod.mk, Usa2021P3.extract, HEq, Not, Union.union, Usa2021P3.trominoCells, Usa2021P3.Step.tromino, Exists.intro, And.intro, Usa2021P3.Support.add, Or, id, dite and 43 more

    63 instances, coercions and auxiliary constants left out.

    Tactic trace: 36 steps

    Open to load the checked before-and-after goal states.

    lemma extract_solvable {n : ℕ} (hn : 1 ≤ n) (h : Solvable n) :
        ∃ (a : ℕ → ℕ → ℕ) (ρ γ : ℕ → ℕ), Support a n ∧
          (∀ r c, r < n → c < n → gains a n r c = ρ r + γ c) ∧ ∃ i j : ℕ, 1 ≤ a i j := by
    …

    Mentions: h, Usa2021P3.Solvable, Usa2021P3.Support, Usa2021P3.gains

  18. lemma Usa2021P3.sum_range_shift Shifting a sum by one, provided the boundary terms vanish line 315 source

    Source documentation

    Shifting a sum by one, provided the boundary terms vanish.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Complex, Eq, OfNat.ofNat, Finset.sum, Finset.range, HAdd.hAdd

    Proof uses: Finset.sum_range_succ', Finset.sum_range_succ, Eq.mpr, id, congrArg, Eq.symm, Eq.mp, add_zero, Eq.refl

    20 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

    Open to load the checked before-and-after goal states.

    lemma sum_range_shift (f : ℕ → ℂ) (n : ℕ) (hf0 : f 0 = 0) (hfn : f n = 0) :
        ∑ i ∈ Finset.range n, f (i + 1) = ∑ r ∈ Finset.range n, f r := by
    …

    Mentions: f

  19. lemma Usa2021P3.key_identity The key identity: evaluated at n-th roots of unity ζ, η ≠ 1, the cell equations imply that (1 + ζ + ζ * η) times the tromino generating function vanishes line 326 source

    Source documentation

    The key identity: evaluated at n-th roots of unity ζ, η ≠ 1, the cell equations imply that (1 + ζ + ζ * η) times the tromino generating function vanishes.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, LE.le, OfNat.ofNat, Usa2021P3.Support, LT.lt, Eq, Usa2021P3.gains, HAdd.hAdd, Complex, HPow.hPow, Ne, HMul.hMul, Finset.sum, Finset.range

    Proof uses: Eq.mpr, HDiv.hDiv, HSub.hSub, id, congrArg, geom_sum_eq, sub_self, zero_div, Eq.refl, Finset.mul_sum, Finset.sum_congr, rfl, Finset, Membership.mem, pow_succ, Mathlib.Tactic.Ring.of_eq, Nat.rawCast, Mathlib.Tactic.Ring.Common.mul_congr, Mathlib.Tactic.Ring.Common.atom_pf, Eq.symm and 64 more

    146 instances, coercions and auxiliary constants left out.

    Tactic trace: 184 steps

    Open to load the checked before-and-after goal states.

    lemma key_identity {n : ℕ} (hn : 2 ≤ n) {a : ℕ → ℕ → ℕ} {ρ γ : ℕ → ℕ}
        (hsupp : Support a n)
        (hcell : ∀ r c, r < n → c < n → gains a n r c = ρ r + γ c)
        {ζ η : ℂ} (hζ : ζ ^ n = 1) (hζ1 : ζ ≠ 1) (hη : η ^ n = 1) (hη1 : η ≠ 1) :
        (1 + ζ + ζ * η) * ∑ i ∈ Finset.range n, ∑ j ∈ Finset.range n,
          (a i j : ℂ) * ζ ^ i * η ^ j = 0 := by
    …

    Mentions: Usa2021P3.Support, Usa2021P3.gains

  20. lemma Usa2021P3.one_add_ne_zero If 3 ∤ n and ζ, η are n-th roots of unity with ζ ≠ 1, then 1 + ζ + ζ * η ≠ 0 line 547 source

    Source documentation

    If 3 ∤ n and ζ, η are n-th roots of unity with ζ ≠ 1, then 1 + ζ + ζ * η ≠ 0.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, LE.le, OfNat.ofNat, Not, Dvd.dvd, Complex, Eq, HPow.hPow, Ne, HAdd.hAdd, HMul.hMul

    Proof uses: False.elim, False, Eq.mp, Eq.trans, congrFun', congrArg, zero_pow, of_eq_true, True, eq_false, not_false_eq_true, Real, MonoidWithZeroHom, Complex.normSq, Eq.mpr, id, Eq.symm, map_pow, Complex.normSq_one, Iff.mp and 132 more

    161 instances, coercions and auxiliary constants left out.

    Tactic trace: 65 steps

    Open to load the checked before-and-after goal states.

    lemma one_add_ne_zero {n : ℕ} (hn : 2 ≤ n) (h3 : ¬ 3 ∣ n) {ζ η : ℂ}
        (hζ : ζ ^ n = 1) (hζ1 : ζ ≠ 1) (hη : η ^ n = 1) :
        1 + ζ + ζ * η ≠ 0 := by
    …
  21. lemma Usa2021P3.count_eq_zero A polynomial of degree < m with coefficients coming from the tromino counts vanishes on the m points of the grid, hence is zero line 613 source

    Source documentation

    A polynomial of degree < m with coefficients coming from the tromino counts vanishes on the m points of the grid, hence is zero. Applied twice, this shows that all tromino counts vanish.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, LE.le, OfNat.ofNat, Usa2021P3.Support, Complex, Eq, HPow.hPow, Ne, Finset.sum, Finset.range, HMul.hMul

    Proof uses: HAdd.hAdd, Exists, Exists.intro, HSub.hSub, Complex.exp, HDiv.hDiv, Real.pi, Complex.I, rfl, IsPrimitiveRoot, Eq.mpr, id, congrArg, Complex.isPrimitiveRoot_exp, Nat.succ_ne_zero, IsPrimitiveRoot.pow_eq_one, Finset, Finset.image, Set.InjOn, Membership.mem and 85 more

    119 instances, coercions and auxiliary constants left out.

    Tactic trace: 117 steps

    Open to load the checked before-and-after goal states.

    lemma count_eq_zero {n : ℕ} (hn : 2 ≤ n) {a : ℕ → ℕ → ℕ}
        (hsupp : Support a n)
        (hP : ∀ ζ η : ℂ, ζ ^ n = 1 → ζ ≠ 1 → η ^ n = 1 → η ≠ 1 →
          ∑ i ∈ Finset.range n, ∑ j ∈ Finset.range n, (a i j : ℂ) * ζ ^ i * η ^ j = 0) :
        ∀ i j, a i j = 0 := by
    …

    Mentions: Usa2021P3.Support

  22. lemma Usa2021P3.not_solvable_of_not_three_dvd The obstruction: the board cannot be emptied when 3 ∤ n line 725 source

    Source documentation

    The obstruction: the board cannot be emptied when 3 ∤ n.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, LE.le, OfNat.ofNat, Not, Dvd.dvd, Usa2021P3.Solvable, False

    Proof uses: Exists, And, Usa2021P3.Support, LT.lt, Eq, Usa2021P3.gains, HAdd.hAdd, Usa2021P3.extract_solvable, Complex, HPow.hPow, Ne, Finset.sum, Finset.range, HMul.hMul, Usa2021P3.key_identity, Or, Iff.mp, mul_eq_zero, absurd, Usa2021P3.one_add_ne_zero and 1 more

    39 instances, coercions and auxiliary constants left out.

    Tactic trace: 13 steps

    Open to load the checked before-and-after goal states.

    lemma not_solvable_of_not_three_dvd {n : ℕ} (hn : 2 ≤ n) (h3 : ¬ 3 ∣ n) (h : Solvable n) :
        False := by
    …

    Mentions: h, Usa2021P3.Solvable

  23. lemma Usa2021P3.reach_place Documented declaration: reach_place line 761 source

    Source documentation

    Placing trominoes at a finset of anchors, one at a time: if every anchor is legal, the trominoes are pairwise disjoint, and all their cells are currently empty, then all of them can be placed in succession.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, DecidableEq, Finset, Prod, Usa2021P3.Board, Membership.mem, And, LT.lt, HAdd.hAdd, Prod.fst, OfNat.ofNat, Prod.snd, Ne, Disjoint, Usa2021P3.trominoCells, Not, Usa2021P3.Reach, Union.union, Finset.biUnion

    Proof uses: Finset.induction, EmptyCollection.emptyCollection, Eq.mpr, id, Eq, congrArg, Finset.biUnion_empty, Finset.union_empty, Usa2021P3.Reach.refl, Insert.insert, Finset.biUnion_insert, Usa2021P3.Step, Finset.mem_insert_self, Usa2021P3.Step.tromino, Prod.mk, of_eq_true, Eq.trans, Or, Singleton.singleton, True and 20 more

    36 instances, coercions and auxiliary constants left out.

    Tactic trace: 24 steps

    Open to load the checked before-and-after goal states.

    lemma reach_place {n : ℕ} {ι : Type*} [DecidableEq ι] (s : Finset ι) (f : ι → ℕ × ℕ) :
        ∀ b : Board,
        (∀ i ∈ s, (f i).1 + 1 < n ∧ (f i).2 + 1 < n) →
        (∀ i ∈ s, ∀ j ∈ s, i ≠ j →
          Disjoint (trominoCells (f i).1 (f i).2) (trominoCells (f j).1 (f j).2)) →
        (∀ i ∈ s, ∀ c ∈ trominoCells (f i).1 (f i).2, c ∉ b) →
        Reach n b (b ∪ s.biUnion (fun i ↦ trominoCells (f i).1 (f i).2)) := by
    …

    Mentions: f, Usa2021P3.Board, Usa2021P3.trominoCells, Usa2021P3.Reach

  24. lemma Usa2021P3.reach_clearRows Clearing full rows, one at a time line 796 source

    Source documentation

    Clearing full rows, one at a time.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Finset, Usa2021P3.Board, Membership.mem, LE.le, Prod, SProd.sprod, Finset.range, Singleton.singleton, Usa2021P3.Reach, SDiff.sdiff

    Proof uses: Finset.induction, EmptyCollection.emptyCollection, Eq.mpr, id, Eq, congrArg, Finset.product_empty, Finset.sdiff_empty, Usa2021P3.Reach.refl, Not, Insert.insert, Usa2021P3.Step, Usa2021P3.Step.clearRow, Finset.mem_insert_self, Usa2021P3.Reach.trans, Usa2021P3.Reach.single, Union.union, Finset.ext, Iff, Prod.mk and 24 more

    31 instances, coercions and auxiliary constants left out.

    Tactic trace: 24 steps

    Open to load the checked before-and-after goal states.

    lemma reach_clearRows {n : ℕ} (s : Finset ℕ) :
        ∀ b : Board, (∀ r ∈ s, Finset.range n ×ˢ {r} ⊆ b) →
          Reach n b (b \ (Finset.range n ×ˢ s)) := by
    …

    Mentions: Usa2021P3.Board, Usa2021P3.Reach

  25. lemma Usa2021P3.reach_clearCols Clearing full columns, one at a time line 830 source

    Source documentation

    Clearing full columns, one at a time.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Finset, Usa2021P3.Board, Membership.mem, LE.le, Prod, SProd.sprod, Singleton.singleton, Finset.range, Usa2021P3.Reach, SDiff.sdiff

    Proof uses: Finset.induction, EmptyCollection.emptyCollection, Eq.mpr, id, Eq, congrArg, Finset.empty_product, Finset.sdiff_empty, Usa2021P3.Reach.refl, Not, Insert.insert, Usa2021P3.Step, Usa2021P3.Step.clearCol, Finset.mem_insert_self, Usa2021P3.Reach.trans, Usa2021P3.Reach.single, Union.union, Finset.ext, Iff, Prod.mk and 24 more

    32 instances, coercions and auxiliary constants left out.

    Tactic trace: 24 steps

    Open to load the checked before-and-after goal states.

    lemma reach_clearCols {n : ℕ} (s : Finset ℕ) :
        ∀ b : Board, (∀ c ∈ s, {c} ×ˢ Finset.range n ⊆ b) →
          Reach n b (b \ (s ×ˢ Finset.range n)) := by
    …

    Mentions: Usa2021P3.Board, Usa2021P3.Reach

  26. lemma Usa2021P3.solvable_of_three_dvd The construction: the board can be emptied whenever 3 ∣ n line 864 source

    Source documentation

    The construction: the board can be emptied whenever 3 ∣ n.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, LE.le, OfNat.ofNat, Dvd.dvd, Usa2021P3.Solvable

    Proof uses: Eq, HMul.hMul, Finset, Prod, SProd.sprod, Finset.range, rfl, Iff, Membership.mem, And, LT.lt, Prod.fst, Prod.snd, Eq.mpr, id, congrArg, propext, Finset.mem_product, Finset.mem_range, Iff.rfl and 74 more

    118 instances, coercions and auxiliary constants left out.

    Tactic trace: 438 steps (first 200 of 438)

    Open to load the checked before-and-after goal states.

    lemma solvable_of_three_dvd {n : ℕ} (hn : 2 ≤ n) (h3 : 3 ∣ n) : Solvable n := by
    …

    Mentions: Usa2021P3.Solvable

  27. problem Usa2021P3.usa2021_p3 USAMO 2021 Problem 3: the board can be emptied after a non-zero number of moves if and only if 3 ∣ n line 1215 source

    Source documentation

    USAMO 2021 Problem 3: the board can be emptied after a non-zero number of moves if and only if 3 ∣ n.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, LE.le, OfNat.ofNat, Iff, Usa2021P3.Solvable, Usa2021P3.answer

    Proof uses: Iff.intro, Decidable.byContradiction, Not, Usa2021P3.not_solvable_of_not_three_dvd, Usa2021P3.solvable_of_three_dvd

    5 instances, coercions and auxiliary constants left out.

    Tactic trace: 7 steps

    Open to load the checked before-and-after goal states.

    problem usa2021_p3 (n : ℕ) (hn : 2 ≤ n) : Solvable n ↔ answer n := by
    …

    Mentions: Usa2021P3.Solvable, Usa2021P3.answer