Compfiles/Imo2024P5.lean
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
88 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 2024, Problem 5
Turbo the snail plays a game on a board with $2024$ rows and $2023$ columns. There are hidden monsters in $2022$ of the cells. Initially, Turbo does not know where any of the monsters are, but he knows that there is exactly one monster in each row except the first row and the last row, and that each column contains at most one monster.
Turbo makes a series of attempts to go from the first row to the last row. On each attempt, he chooses to start on any cell in the first row, then repeatedly moves to an adjacent cell sharing a common side. (He is allowed to return to a previously visited cell.) If he reaches a cell with a monster, his attempt ends and he is transported back to the first row to start a new attempt. The monsters do not move, and Turbo remembers whether or not each cell he has visited contains a monster. If he reaches any cell in the last row, his attempt ends and the game is over.
Determine the minimum value of $n$ for which Turbo has a strategy that guarantees reaching the last row on the $n$th attempt or earlier, regardless of the locations of the monsters.
Imports (8)
Imported by 1 file
- abbrev
Imo2024P5.CellA cell on the board for the game line 55 sourceSource documentation
A cell on the board for the game.
no axioms what this means
Statement uses:
NatProof uses:
Prod,Fin,HAdd.hAdd,OfNat.ofNat3 instances, coercions and auxiliary constants left out.
abbrev Cell (N : ℕ) : Type := Fin (N + 2) × Fin (N + 1)
- abbrev
Imo2024P5.InteriorRowA row that is neither the first nor the last (and thus contains a monster) line 58 sourceSource documentation
A row that is neither the first nor the last (and thus contains a monster).
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
Fin,HAdd.hAdd,OfNat.ofNat,Set.Icc,Fin.mk9 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
abbrev InteriorRow (N : ℕ) : Type := (Set.Icc 1 ⟨N, by lia⟩ : Set (Fin (N + 2)))
- abbrev
Imo2024P5.MonsterDataData for valid positions of the monsters line 61 sourceSource documentation
Data for valid positions of the monsters.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
Function.Embedding, Imo2024P5.InteriorRow,Fin,HAdd.hAdd,OfNat.ofNat3 instances, coercions and auxiliary constants left out.
abbrev MonsterData (N : ℕ) : Type := InteriorRow N ↪ Fin (N + 1)
Mentions: Imo2024P5.InteriorRow
- def
Imo2024P5.MonsterData.monsterCellsThe cells with monsters as a Set, given an injection from rows to columns line 64 sourceSource documentation
The cells with monsters as a Set, given an injection from rows to columns.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.MonsterData,Set, Imo2024P5.CellProof uses:
Set.range, Imo2024P5.InteriorRow,Prod.mk,Fin,HAdd.hAdd,OfNat.ofNat,Membership.mem,Set.Icc,Fin.mk12 instances, coercions and auxiliary constants left out.
def MonsterData.monsterCells (m : MonsterData N) : Set (Cell N) := …Mentions: Imo2024P5.MonsterData, Imo2024P5.Cell
- def
Imo2024P5.AdjacentWhether two cells are adjacent line 69 sourceSource documentation
Whether two cells are adjacent.
no axioms what this means
Statement uses:
Nat, Imo2024P5.CellProof uses:
Eq,HAdd.hAdd,Nat.dist,OfNat.ofNat,Prod.fst,Fin,Prod.snd4 instances, coercions and auxiliary constants left out.
def Adjacent (x y : Cell N) : Prop := …
Mentions: Imo2024P5.Cell
- structure
Imo2024P5.PathA valid path from the first to the last row line 73 sourceSource documentation
A valid path from the first to the last row.
standard axioms: propext what this means
Statement uses:
Natstructure Path (N : ℕ) where …
- def
Imo2024P5.Path.firstMonsterThe first monster on a path, ornoneline 82 sourceSource documentation
The first monster on a path, or
none.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path, Imo2024P5.MonsterData,Option, Imo2024P5.CellProof uses:
Decidable,Classical.propDecidable,List.find?,Decidable.decide,Membership.mem,Set, Imo2024P5.MonsterData.monsterCells,Imo2024P5.Path.cells1 instances, coercions and auxiliary constants left out.
noncomputable def Path.firstMonster (p : Path N) (m : MonsterData N) : Option (Cell N) := …
Mentions: Imo2024P5.Path, Imo2024P5.MonsterData, Imo2024P5.Cell
- abbrev
Imo2024P5.StrategyA strategy, given the results of initial attempts, returns a path for the next attempt line 87 sourceSource documentation
A strategy, given the results of initial attempts, returns a path for the next attempt.
standard axioms: propext what this means
Statement uses:
NatProof uses:
Fin,Option, Imo2024P5.Cell, Imo2024P5.Pathabbrev Strategy (N : ℕ) : Type := ⦃k : ℕ⦄ → (Fin k → Option (Cell N)) → Path N
Mentions: Imo2024P5.Cell, Imo2024P5.Path
- def
Imo2024P5.Strategy.playPlaying a strategy, k attempts line 90 sourceSource documentation
Playing a strategy, k attempts.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.MonsterData,Fin,Option, Imo2024P5.Cell2 instances, coercions and auxiliary constants left out.
noncomputable def Strategy.play (s : Strategy N) (m : MonsterData N) : (k : ℕ) → Fin k → Option (Cell N) | 0 => Fin.elim0 | k + 1 => Fin.snoc (s.play m k) ((s (s.play m k)).firstMonster m) /-- The predicate for a strategy winning within the given number of attempts. -/Mentions: Imo2024P5.Strategy, Imo2024P5.MonsterData, Imo2024P5.Cell
- def
Imo2024P5.Strategy.WinsInThe predicate for a strategy winning within the given number of attempts line 96 sourceSource documentation
The predicate for a strategy winning within the given number of attempts.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.MonsterDataProof uses:
Membership.mem,Option, Imo2024P5.Cell,Set,Set.range,Fin, Imo2024P5.Strategy.play,Option.none1 instances, coercions and auxiliary constants left out.
def Strategy.WinsIn (s : Strategy N) (m : MonsterData N) (k : ℕ) : Prop := …
Mentions: Imo2024P5.Strategy, Imo2024P5.MonsterData
- def
Imo2024P5.Strategy.ForcesWinInWhether a strategy forces a win within the given number of attempts line 100 sourceSource documentation
Whether a strategy forces a win within the given number of attempts.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.StrategyProof uses: Imo2024P5.MonsterData, Imo2024P5.Strategy.WinsIn
def Strategy.ForcesWinIn (s : Strategy N) (k : ℕ) : Prop := …
Mentions: Imo2024P5.Strategy
- def
Imo2024P5.Cell.reflectReflecting a cell of the board (swapping left and right sides of the board) line 120 sourceSource documentation
Reflecting a cell of the board (swapping left and right sides of the board).
no axioms what this means
Statement uses:
Nat, Imo2024P5.CellProof uses:
Prod.mk,Fin,HAdd.hAdd,OfNat.ofNat,Prod.fst,Fin.rev,Prod.snd3 instances, coercions and auxiliary constants left out.
def Cell.reflect (c : Cell N) : Cell N := (c.1, c.2.rev)
Mentions: Imo2024P5.Cell
- def
Imo2024P5.row1The row 1, in the form required for MonsterData line 125 sourceSource documentation
The row 1, in the form required for MonsterData.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.InteriorRowProof uses:
Subtype.mk,Fin,HAdd.hAdd,Membership.mem,Set,Set.Icc,Fin.mk13 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
@[expose] def row1 (hN : 2 ≤ N) : InteriorRow N := …
Mentions: Imo2024P5.InteriorRow
- lemma
Imo2024P5.coe_coe_row1line 131 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Eq,HAdd.hAdd,Fin,Membership.mem,Set,Set.Icc,Fin.mk, Imo2024P5.row1Proof uses:
rfl24 instances, coercions and auxiliary constants left out.
- def
Imo2024P5.row2The row 2, in the form required for MonsterData line 135 sourceSource documentation
The row 2, in the form required for MonsterData.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.InteriorRowProof uses:
Subtype.mk,Fin,HAdd.hAdd,Membership.mem,Set,Set.Icc,Fin.mk14 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
def row2 (hN : 2 ≤ N) : InteriorRow N := …
Mentions: Imo2024P5.InteriorRow
- def
Imo2024P5.MonsterData.reflectReflecting monster data line 141 sourceSource documentation
Reflecting monster data.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.MonsterDataProof uses:
Function.Embedding.mk, Imo2024P5.InteriorRow,Fin,HAdd.hAdd,OfNat.ofNat,Function.comp,Fin.rev6 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
def MonsterData.reflect (m : MonsterData N) : MonsterData N where …
Mentions: Imo2024P5.MonsterData
- lemma
Imo2024P5.MonsterData.reflect_reflectline 145 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.MonsterData,Eq, Imo2024P5.MonsterData.reflectProof uses:
Function.Embedding.ext, Imo2024P5.InteriorRow,Fin,HAdd.hAdd,OfNat.ofNat,Fin.rev_rev5 instances, coercions and auxiliary constants left out.
- lemma
Imo2024P5.MonsterData.apply_row1_ne_zero_of_apply_row1_eq_Nline 148 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Eq,HAdd.hAdd, Imo2024P5.InteriorRow,Fin, Imo2024P5.row1,NeProof uses:
Eq.mpr,id,congrArg,Eq.symm,propext,Fin.val_ne_iff,Fin.val_zero21 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.MonsterData.reflect_apply_row1_eq_zero_of_apply_row1_eq_Nline 153 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Eq,HAdd.hAdd, Imo2024P5.InteriorRow,Fin, Imo2024P5.row1, Imo2024P5.MonsterData.reflectProof uses:
Fin.rev,rfl,Eq.mpr,id,congrArg,Fin.last,Eq.symm,Fin.rev_last,propext,Fin.rev_inj,Fin.ext_iff,Fin.val_last20 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.MonsterData.not_mem_monsterCells_of_fst_eq_zeroline 159 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.MonsterData, Imo2024P5.Cell,Eq,Fin,HAdd.hAdd,OfNat.ofNat,Prod.fst,Not,Membership.mem,Set, Imo2024P5.MonsterData.monsterCellsProof uses:
of_eq_true,Eq.trans,False,True,congrArg,Set.range, Imo2024P5.InteriorRow,Prod.mk,Set.Icc,Fin.mk,Exists,And,Subtype.mk,Prod.snd,funext,Prod,congrFun',Subtype,LE.le,Iff.mprand 7 more38 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.MonsterData.le_N_of_mem_monsterCellsline 163 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.MonsterData, Imo2024P5.Cell,Membership.mem,Set, Imo2024P5.MonsterData.monsterCells,LE.le,HAdd.hAdd,OfNat.ofNat,Prod.fst,FinProof uses:
Exists,And,Fin.mk,Eq,Prod.mk, Imo2024P5.InteriorRow,Subtype.mk,Set.Icc,Iff.mpr,Iff.of_eq,Eq.mp,Eq.trans,Set.range,Subtype,congrArg,funext,propext,exists_prop_congr,Eq.refl,And.introand 1 more28 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.MonsterData.mk_mem_monsterCells_iff_of_leline 170 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.MonsterData,Fin,HAdd.hAdd,OfNat.ofNat,LE.le,Fin.mk,Iff,Membership.mem,Prod,Set, Imo2024P5.Cell, Imo2024P5.MonsterData.monsterCells,Prod.mk,Eq, Imo2024P5.InteriorRow,Subtype.mk,Set.Icc,And.introProof uses:
Eq.mpr,Exists,And,id,congrFun',congrArg,Eq.trans,Set.range,funext,Prod.mk.injEq,Iff.intro,Eq.refl,Exists.intro,rfl35 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.MonsterData.mem_monsterCells_iff_of_leline 180 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.MonsterData, Imo2024P5.Cell,LE.le,Fin,HAdd.hAdd,OfNat.ofNat,Prod.fst,Fin.mk,Iff,Membership.mem,Set, Imo2024P5.MonsterData.monsterCells,Eq, Imo2024P5.InteriorRow,Subtype.mk,Set.Icc,And.intro,Prod.sndProof uses: Imo2024P5.MonsterData.mk_mem_monsterCells_iff_of_le
23 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.MonsterData.mk_mem_monsterCells_iffline 185 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.MonsterData,Fin,HAdd.hAdd,OfNat.ofNat,Iff,Membership.mem,Prod,Set, Imo2024P5.Cell, Imo2024P5.MonsterData.monsterCells,Prod.mk,Exists,LE.le,Fin.mk,Eq, Imo2024P5.InteriorRow,Subtype.mk,Set.Icc,And.introProof uses:
Iff.intro,And,Eq.mp,Prod.mk.injEq,Exists.intro,rfl,Iff.mpr,Prod.fst,Prod.snd, Imo2024P5.MonsterData.mem_monsterCells_iff_of_le36 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Path.exists_mem_le_fstline 196 sourcestandard axioms: propext what this means
Statement uses:
Nat, Imo2024P5.Path,Fin,HAdd.hAdd,OfNat.ofNat,Exists, Imo2024P5.Cell,And,Membership.mem,List,Imo2024P5.Path.cells,LE.le,Prod.fstProof uses:
Exists.intro,List.getLast,Imo2024P5.Path.nonempty,And.intro,List.getLast_mem,Eq.mpr,Fin.last,id,Eq,congrArg,Imo2024P5.Path.last_last_row,Fin.le_last10 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- def
Imo2024P5.Path.findFstEqThe first path element whose row is at leastrline 202 sourceSource documentation
The first path element whose row is at least
r. Since rows change by at most one on each move and the path starts in row0, this is in fact on rowr: seePath.findFstEq_fst.standard axioms: Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path,Fin,HAdd.hAdd,OfNat.ofNat, Imo2024P5.CellProof uses:
Option.get,List.find?,Decidable.decide,LE.le,Prod.fst,Imo2024P5.Path.cells9 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
def Path.findFstEq (p : Path N) (r : Fin (N + 2)) : Cell N := …
Mentions: Imo2024P5.Path, Imo2024P5.Cell
- lemma
Imo2024P5.Path.find_eq_some_findFstEqline 206 sourcestandard axioms: Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path,Fin,HAdd.hAdd,OfNat.ofNat,Eq,Option, Imo2024P5.Cell,List.find?,Decidable.decide,LE.le,Prod.fst,Imo2024P5.Path.cells,Option.some, Imo2024P5.Path.findFstEqProof uses:
Eq.mpr,Exists,Bool,Option.isSome,Bool.true,Option.get,id,congrArg,propext,Option.eq_some_iff_get_eq,Exists.intro,rfl11 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Path.findFstEq_mem_cellsline 211 sourcestandard axioms: Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path,Fin,HAdd.hAdd,OfNat.ofNat,Membership.mem, Imo2024P5.Cell,List,Imo2024P5.Path.cells, Imo2024P5.Path.findFstEqProof uses:
List.mem_of_find?_eq_some,Decidable.decide,LE.le,Prod.fst, Imo2024P5.Path.find_eq_some_findFstEq9 instances, coercions and auxiliary constants left out.
- lemma
Imo2024P5.Path.findFstEq_fst_and_sub_one_memDocumented declaration: findFstEq_fst_and_sub_one_mem line 217 sourceSource documentation
findFstEq rlies on rowrexactly, and the cell just before it on the path lies on rowr - 1in the same column: the cell before the first row-≥ rcell has row< r, and adjacency forces both rows.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path,Fin,HAdd.hAdd,OfNat.ofNat,Ne,And,Eq,Prod.fst, Imo2024P5.Path.findFstEq,Membership.mem,Prod,List, Imo2024P5.Cell,Imo2024P5.Path.cells,Prod.mk,Fin.mk,HSub.hSub,Prod.sndProof uses:
id,LE.le,Exists,Option.get,List.find?,Decidable.decide, Imo2024P5.Path.exists_mem_le_fst,List.nil,List.head,List.getLast,Fin.last,List.IsChain, Imo2024P5.Adjacent,Imo2024P5.Path.mk,Bool,Bool.true,Exists.intro,And.intro,Eq.mpr,decide_eq_true_eqand 59 more64 instances, coercions and auxiliary constants left out.
Tactic trace: 33 steps
Open to load the checked before-and-after goal states.
lemma Path.findFstEq_fst_and_sub_one_mem (p : Path N) {r : Fin (N + 2)} (hr : r ≠ 0) : (p.findFstEq r).1 = r ∧ (⟨(r : ℕ) - 1, by lia⟩, (p.findFstEq r).2) ∈ p.cells := by …Mentions: Imo2024P5.Path
- lemma
Imo2024P5.Path.findFstEq_fstline 249 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path,Fin,HAdd.hAdd,OfNat.ofNat,Eq,Prod.fst, Imo2024P5.Path.findFstEqProof uses:
Ne,Or,eq_or_ne, Imo2024P5.Cell,Exists,List,Imo2024P5.Path.cells,List.cons,List.exists_cons_of_ne_nil,Imo2024P5.Path.nonempty,List.head,Imo2024P5.Path.head_first_row,Eq.mp,congrFun',congrArg,List.head.congr_simp,Eq.symm,Option,List.find?,Decidable.decideand 22 more23 instances, coercions and auxiliary constants left out.
Tactic trace: 11 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Path.findFstEq_fst_sub_one_memline 260 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path,Fin,HAdd.hAdd,OfNat.ofNat,Ne,Membership.mem,Prod,List, Imo2024P5.Cell,Imo2024P5.Path.cells,Prod.mk,Fin.mk,HSub.hSub,Prod.snd, Imo2024P5.Path.findFstEqProof uses:
And.right,Eq,Prod.fst, Imo2024P5.Path.findFstEq_fst_and_sub_one_mem22 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Path.firstMonster_isSomeline 264 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path, Imo2024P5.MonsterData,Iff,Eq,Bool,Option.isSome, Imo2024P5.Cell, Imo2024P5.Path.firstMonster,Bool.true,Exists,And,Membership.mem,List,Imo2024P5.Path.cells,Set, Imo2024P5.MonsterData.monsterCellsProof uses:
Eq.mpr,List.find?,Decidable.decide,Classical.propDecidable,eq_of_heq,HEq,Eq.refl,HEq.refl,Eq.symm,Option,funext,propext,of_eq_true,Eq.trans,True,congrArg,decide_eq_true_eq,iff_self,List.find?_isSome6 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Path.firstMonster_none_or_someline 269 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path, Imo2024P5.MonsterData, Imo2024P5.Cell,Membership.mem,List,Imo2024P5.Path.cells,Or,Not,Set, Imo2024P5.MonsterData.monsterCells,Eq,Option, Imo2024P5.Path.firstMonster,Option.none,Option.someProof uses:
dite,Or.inl,Exists,Eq.mp,Ne,congrArg,propext,Option.ne_none_iff_exists',Eq.symm,ne_eq,List.mem_of_find?_eq_some,Decidable.decide,Classical.propDecidable,Bool,Bool.true,List.find?_some,Or.resolve_left,Iff.mpr,Classical.not_not,decide_eq_true_eqand 3 more6 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Path.firstMonster_eq_of_findFstEq_memline 284 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path, Imo2024P5.MonsterData,Membership.mem, Imo2024P5.Cell,Set, Imo2024P5.MonsterData.monsterCells, Imo2024P5.Path.findFstEq,OfNat.ofNat,Fin,HAdd.hAdd,Eq,Option, Imo2024P5.Path.firstMonster,Option.someProof uses:
Exists,And,List,Imo2024P5.Path.cells,Bool,Decidable.decide,LE.le,Prod.fst,Bool.true,Eq.mpr,Prod.mk,id,Eq.trans,congrArg,funext,decide_eq_true_eq,Prod,Eq.mp, Imo2024P5.Path.exists_mem_le_fst,Neand 37 more43 instances, coercions and auxiliary constants left out.
Tactic trace: 20 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Path.mem_of_firstMonster_eq_someline 309 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path, Imo2024P5.MonsterData, Imo2024P5.Cell,Eq,Option, Imo2024P5.Path.firstMonster,Option.some,And,Membership.mem,List,Imo2024P5.Path.cells,Set, Imo2024P5.MonsterData.monsterCellsProof uses:
List.mem_of_find?_eq_some,Decidable.decide,Classical.propDecidable,Bool,Bool.true,List.find?_some,And.intro,Eq.mp,decide_eq_true_eq4 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- def
Imo2024P5.Path.ofFnConvert a function giving the cells of a path to aPathline 318 sourceSource documentation
Convert a function giving the cells of a path to a
Path.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin, Imo2024P5.Cell,Ne,OfNat.ofNat,Eq,HAdd.hAdd,Prod.fst,Fin.mk,Nat.pos_of_ne_zero,HSub.hSub,Nat.sub_one_lt,Nat.lt_add_one,LT.lt, Imo2024P5.Adjacent,Nat.lt_of_succ_lt, Imo2024P5.PathProof uses:
Imo2024P5.Path.mk,List.ofFn22 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
@[expose] def Path.ofFn {m : ℕ} (f : Fin m → Cell N) (hm : m ≠ 0) (hf : (f ⟨0, Nat.pos_of_ne_zero hm⟩).1 = 0) (hl : (f ⟨m - 1, Nat.sub_one_lt hm⟩).1 = ⟨N + 1, Nat.lt_add_one _⟩) (ha : ∀ (i : ℕ) (hi : i + 1 < m), Adjacent (f ⟨i, Nat.lt_of_succ_lt hi⟩) (f ⟨i + 1, hi⟩)) : Path N where …Mentions: f, Imo2024P5.Cell, Imo2024P5.Adjacent, Imo2024P5.Path
- lemma
Imo2024P5.Path.ofFn_cellsline 332 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin, Imo2024P5.Cell,Ne,OfNat.ofNat,Eq,HAdd.hAdd,Prod.fst,Fin.mk,Nat.pos_of_ne_zero,HSub.hSub,Nat.sub_one_lt,Nat.lt_add_one,LT.lt, Imo2024P5.Adjacent,Nat.lt_of_succ_lt,List,Imo2024P5.Path.cells, Imo2024P5.Path.ofFn,List.ofFnProof uses:
rfl18 instances, coercions and auxiliary constants left out.
- lemma
Imo2024P5.Path.ofFn_firstMonster_eq_noneline 339 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin, Imo2024P5.Cell,Ne,OfNat.ofNat,Eq,HAdd.hAdd,Prod.fst,Fin.mk,Nat.pos_of_ne_zero,HSub.hSub,Nat.sub_one_lt,Nat.lt_add_one,LT.lt, Imo2024P5.Adjacent,Nat.lt_of_succ_lt, Imo2024P5.MonsterData,Iff,Option, Imo2024P5.Path.firstMonster and 6 moreProof uses:
of_eq_true,Eq.trans,True,congrFun',congrArg,List.find?,Decidable.decide,Classical.propDecidable,List.ofFn,List,Bool,Bool.true,forall_congr,Exists,implies_congr,decide_eq_true_eq,iff_self25 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- def
Imo2024P5.Path.reflectReflecting a path line 345 sourceSource documentation
Reflecting a path.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.PathProof uses:
Imo2024P5.Path.mk,List.map, Imo2024P5.Cell, Imo2024P5.Cell.reflect,Imo2024P5.Path.cells4 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
def Path.reflect (p : Path N) : Path N where …
Mentions: Imo2024P5.Path
- lemma
Imo2024P5.Path.firstMonster_reflectline 360 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Path, Imo2024P5.MonsterData,Eq,Option, Imo2024P5.Cell, Imo2024P5.Path.firstMonster, Imo2024P5.Path.reflect, Imo2024P5.MonsterData.reflect,Option.map, Imo2024P5.Cell.reflectProof uses: Imo2024P5.InteriorRow,
Fin,HAdd.hAdd,OfNat.ofNat,Fin.rev,rfl,id,List.find?,Decidable.decide,Membership.mem,Set, Imo2024P5.MonsterData.monsterCells,Classical.propDecidable,Imo2024P5.Path.cells,Eq.mpr,List.map,Function.comp,Bool,congrFun',congrArgand 15 more16 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Strategy.play_comp_castLEline 377 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.MonsterData,LE.le,Eq,Fin,Option, Imo2024P5.Cell,Function.comp, Imo2024P5.Strategy.play,Fin.castLEProof uses:
Nat.le.rec,Eq.refl,Nat.le.refl,Nat.le,Eq.mpr,Nat.succ,Nat.le.step,id,congrArg,Eq.symm,Nat.le_succ,Nat.le_trans,Fin.castLE_comp_castLE,Function.comp_assoc,eq_of_heq,HEq,HEq.refl,HAdd.hAdd,OfNat.ofNat,Fin.snocand 4 more7 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Strategy.play_apply_of_leline 386 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.MonsterData,LT.lt,LE.le,Eq,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play,Fin.mk,LT.lt.trans_leProof uses:
Eq.mpr,Function.comp,Fin,Fin.castLE,id,congrArg,Eq.symm, Imo2024P5.Strategy.play_comp_castLE,Eq.refl6 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Strategy.play_zeroline 391 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.MonsterData,LT.lt,OfNat.ofNat,Eq,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play,Fin.mk, Imo2024P5.Path.firstMonster,Fin.elim0Proof uses:
LE.le,Eq.mpr,zero_lt_one,id,congrArg,LT.lt.trans_le, Imo2024P5.Strategy.play_apply_of_le,Eq.refl15 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Strategy.play_one_eqline 397 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.MonsterData,Eq,Fin,OfNat.ofNat,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play,Matrix.vecCons, Imo2024P5.Path.firstMonster,Fin.elim0,Matrix.vecEmptyProof uses:
funext,List,List.Mem,List.finRange,HEq,Membership.mem,Finset,Fintype.elems,Fintype.complete,List.cons,List.Mem.head,Fin.mk,Nat.le_refl,List.nil,Eq.refl,eq_of_heq,List.Mem.tail,False.elim,noConfusion_of_Nat,List.ctorIdxand 1 more8 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Strategy.play_oneline 403 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.MonsterData,LT.lt,OfNat.ofNat,Eq,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play,Fin.mk, Imo2024P5.Path.firstMonster,Nat.succ,Matrix.vecCons,Fin.elim0,Matrix.vecEmptyProof uses:
Eq.mpr,one_lt_two,id,congrArg,LT.lt.trans_le, Imo2024P5.Strategy.play_apply_of_le,Fin,Eq.symm, Imo2024P5.Strategy.play_one_eq,Eq.refl24 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Strategy.play_two_eqline 408 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.MonsterData,Eq,Fin,OfNat.ofNat,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play,Matrix.vecCons,Nat.succ, Imo2024P5.Path.firstMonster,Fin.elim0,Matrix.vecEmptyProof uses:
funext,List,List.Mem,List.finRange,HEq,Membership.mem,Finset,Fintype.elems,Fintype.complete,List.cons,List.Mem.head,Fin.mk,Nat.le_of_lt,Nat.le_refl,List.nil,Eq.refl,eq_of_heq,List.Mem.tail,id,Eq.mprand 6 more8 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Strategy.play_twoline 418 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.MonsterData,LT.lt,OfNat.ofNat,Eq,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play,Fin.mk, Imo2024P5.Path.firstMonster,Nat.succ,Matrix.vecCons,Fin.elim0,Matrix.vecEmptyProof uses:
Eq.mpr,Mathlib.Meta.NormNum.isNat_lt_true,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refl,Bool,Bool.false,id,congrArg,LT.lt.trans_le, Imo2024P5.Strategy.play_apply_of_le,Fin,Eq.symm, Imo2024P5.Strategy.play_two_eq11 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Strategy.WinsIn.monoline 424 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.MonsterData, Imo2024P5.Strategy.WinsIn,LE.leProof uses:
Set.mem_of_mem_of_subset,Option, Imo2024P5.Cell,Option.none,Set.range,Fin, Imo2024P5.Strategy.play,Eq.mpr,Set,Exists,Eq,Function.comp,id,congrArg,propext,Set.range_subset_range_iff_exists_comp,Exists.intro,Fin.castLE,Eq.symm, Imo2024P5.Strategy.play_comp_castLE3 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Strategy.ForcesWinIn.monoline 430 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.Strategy.ForcesWinIn,LE.leProof uses: Imo2024P5.MonsterData, Imo2024P5.Strategy.WinsIn.mono
2 instances, coercions and auxiliary constants left out.
- def
Imo2024P5.baseMonsterDataAn arbitrary choice of monster positions, which is modified to put selected monsters in desired places line 438 sourceSource documentation
An arbitrary choice of monster positions, which is modified to put selected monsters in desired places.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.MonsterDataProof uses:
Function.Embedding.mk, Imo2024P5.InteriorRow,Fin,HAdd.hAdd,OfNat.ofNat,LE.le,Fin.mk13 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
def baseMonsterData (N : ℕ) : MonsterData N where …
Mentions: Imo2024P5.MonsterData
- def
Imo2024P5.monsterData12Positions for monsters with specified columns in the second and third rows (rows 1 and 2) line 447 sourceSource documentation
Positions for monsters with specified columns in the second and third rows (rows 1 and 2).
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Fin,HAdd.hAdd, Imo2024P5.MonsterDataProof uses:
Function.Embedding.setValue, Imo2024P5.InteriorRow, Imo2024P5.baseMonsterData, Imo2024P5.row2,Membership.mem,Set,Set.Icc,Fin.mk,Function.Embedding, Imo2024P5.row118 instances, coercions and auxiliary constants left out.
def monsterData12 (hN : 2 ≤ N) (c₁ c₂ : Fin (N + 1)) : MonsterData N := …
Mentions: Imo2024P5.MonsterData
- lemma
Imo2024P5.monsterData12_apply_row2line 450 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Fin,HAdd.hAdd,Ne,Eq, Imo2024P5.MonsterData, Imo2024P5.InteriorRow, Imo2024P5.monsterData12, Imo2024P5.row2Proof uses:
Eq.mpr,Function.Embedding.setValue, Imo2024P5.baseMonsterData,Membership.mem,Set,Set.Icc,Fin.mk,Function.Embedding, Imo2024P5.row1,id,congrArg,Function.Embedding.setValue_eq_of_ne,Function.Embedding.setValue_eq,Ne.symm24 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.row1_mem_monsterCells_monsterData12line 461 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Fin,HAdd.hAdd,Membership.mem,Prod,Set, Imo2024P5.Cell, Imo2024P5.MonsterData.monsterCells, Imo2024P5.monsterData12,Prod.mkProof uses:
Set.mem_range_self, Imo2024P5.InteriorRow,Set.Icc,Fin.mk, Imo2024P5.MonsterData, Imo2024P5.row121 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.row2_mem_monsterCells_monsterData12line 465 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Fin,HAdd.hAdd,Ne,Membership.mem,Prod,Set, Imo2024P5.Cell, Imo2024P5.MonsterData.monsterCells, Imo2024P5.monsterData12,Prod.mk,Fin.mkProof uses:
Eq.mpr,Set.range, Imo2024P5.InteriorRow,Set.Icc, Imo2024P5.MonsterData, Imo2024P5.row2,eq_of_heq,outParam,Membership,Eq,HEq,Eq.refl,HEq.refl,Eq.symm,LT.lt,Subtype,Fin.isLt, Imo2024P5.monsterData12_apply_row2,Set.mem_range_self25 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Strategy.not_forcesWinIn_twoline 470 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy,LE.le,OfNat.ofNat,Not, Imo2024P5.Strategy.ForcesWinInProof uses:
NeZero,NeZero.mk,LT.lt,Nat.pos_of_neZero,Eq.mpr,Exists, Imo2024P5.MonsterData,Fin,Eq,Bool,Option.isSome, Imo2024P5.Cell, Imo2024P5.Strategy.play,Bool.true,id,Eq.trans,Option,Option.none,congrArg,forall_congrand 68 more70 instances, coercions and auxiliary constants left out.
Tactic trace: 35 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.Strategy.ForcesWinIn.three_leline 501 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2024P5.Strategy, Imo2024P5.Strategy.ForcesWinIn,LE.le,OfNat.ofNatProof uses:
Decidable.byContradiction,Not, Imo2024P5.Strategy.not_forcesWinIn_two, Imo2024P5.Strategy.ForcesWinIn.mono6 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- def
Imo2024P5.fn0The first attempt in a winning strategy, as a function: first pass along the second row to locate the monster there line 510 sourceSource documentation
The first attempt in a winning strategy, as a function: first pass along the second row to locate the monster there.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,HMul.hMul,OfNat.ofNat, Imo2024P5.CellProof uses:
ite,Eq,Prod.mk,dite,LT.lt,Fin.mk,HSub.hSub,Not23 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
def fn0 (N : ℕ) : Fin (2 * N + 2) → Cell N := …
Mentions: Imo2024P5.Cell
- lemma
Imo2024P5.injective_fn0line 515 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Function.Injective,Fin,HAdd.hAdd,HMul.hMul,OfNat.ofNat, Imo2024P5.Cell, Imo2024P5.fn0Proof uses:
Eq,LT.lt,Fin.mk,Eq.mpr,ite,Prod.mk,dite,HSub.hSub,Eq.mpr_prop,Eq.refl,Not,Eq.mpr_not,id,implies_congr,congr,congrArg,ite_congr,Prod,dite_congr,congrFun'and 17 more49 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- def
Imo2024P5.path0The first attempt in a winning strategy, as aPathline 521 sourceSource documentation
The first attempt in a winning strategy, as a
Path.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.PathProof uses: Imo2024P5.Path.ofFn,
HAdd.hAdd,HMul.hMul, Imo2024P5.fn012 instances, coercions and auxiliary constants left out.
Tactic trace: 11 steps
Open to load the checked before-and-after goal states.
def path0 (hN : 2 ≤ N) : Path N := Path.ofFn (fn0 N) (by lia) (by simp [fn0]) …
Mentions: Imo2024P5.Path, Imo2024P5.Path.ofFn, Imo2024P5.fn0
- def
Imo2024P5.fn1OfNotEdgeThe second attempt in a winning strategy, as a function, if the monster in the second row is not at an edge: pass to the left of that monster then along its column line 530 sourceSource documentation
The second attempt in a winning strategy, as a function, if the monster in the second row is not at an edge: pass to the left of that monster then along its column.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Ne, Imo2024P5.CellProof uses:
dite,LE.le,Prod.mk,Fin.mk,HSub.hSub,Not19 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
def fn1OfNotEdge {c₁ : Fin (N + 1)} (hc₁ : c₁ ≠ 0) : Fin (N + 3) → Cell N := …Mentions: Imo2024P5.Cell
- def
Imo2024P5.path1OfNotEdgeThe second attempt in a winning strategy, as a function, if the monster in the second row is not at an edge line 536 sourceSource documentation
The second attempt in a winning strategy, as a function, if the monster in the second row is not at an edge.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Ne, Imo2024P5.PathProof uses: Imo2024P5.Path.ofFn, Imo2024P5.fn1OfNotEdge
15 instances, coercions and auxiliary constants left out.
Tactic trace: 13 steps
Open to load the checked before-and-after goal states.
def path1OfNotEdge {c₁ : Fin (N + 1)} (hc₁ : c₁ ≠ 0) : Path N := Path.ofFn (fn1OfNotEdge hc₁) …Mentions: Imo2024P5.Path, Imo2024P5.Path.ofFn, Imo2024P5.fn1OfNotEdge
- def
Imo2024P5.fn2OfNotEdgeThe third attempt in a winning strategy, as a function, if the monster in the second row is not at an edge: pass to the right of that monster then along its column line 548 sourceSource documentation
The third attempt in a winning strategy, as a function, if the monster in the second row is not at an edge: pass to the right of that monster then along its column.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Ne, Imo2024P5.CellProof uses:
dite,LE.le,Prod.mk,Fin.mk,Not,HSub.hSub15 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
def fn2OfNotEdge {c₁ : Fin (N + 1)} (hc₁ : (c₁ : ℕ) ≠ N) : Fin (N + 3) → Cell N := …Mentions: Imo2024P5.Cell
- def
Imo2024P5.path2OfNotEdgeThe third attempt in a winning strategy, as a function, if the monster in the second row is not at an edge line 554 sourceSource documentation
The third attempt in a winning strategy, as a function, if the monster in the second row is not at an edge.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Ne, Imo2024P5.PathProof uses: Imo2024P5.Path.ofFn, Imo2024P5.fn2OfNotEdge
12 instances, coercions and auxiliary constants left out.
Tactic trace: 11 steps
Open to load the checked before-and-after goal states.
def path2OfNotEdge {c₁ : Fin (N + 1)} (hc₁ : (c₁ : ℕ) ≠ N) : Path N := Path.ofFn (fn2OfNotEdge hc₁) …Mentions: Imo2024P5.Path, Imo2024P5.Path.ofFn, Imo2024P5.fn2OfNotEdge
- def
Imo2024P5.fn1OfEdge0Documented declaration: fn1OfEdge0 line 565 sourceSource documentation
The second attempt in a winning strategy, as a function, if the monster in the second row is at the left edge: zigzag across the board so that, if we encounter a monster, we have a third path we know will not encounter a monster.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,HMul.hMul,OfNat.ofNat, Imo2024P5.CellProof uses:
dite,Eq,Prod.mk,Fin.mk,Not,HDiv.hDiv18 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
def fn1OfEdge0 (N : ℕ) : Fin (2 * N + 1) → Cell N := …
Mentions: Imo2024P5.Cell
- def
Imo2024P5.path1OfEdge0The second attempt in a winning strategy, as aPath, if the monster in the second row is at the left edge line 571 sourceSource documentation
The second attempt in a winning strategy, as a
Path, if the monster in the second row is at the left edge.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.PathProof uses: Imo2024P5.Path.ofFn,
HAdd.hAdd,HMul.hMul, Imo2024P5.fn1OfEdge012 instances, coercions and auxiliary constants left out.
Tactic trace: 11 steps
Open to load the checked before-and-after goal states.
def path1OfEdge0 (hN : 2 ≤ N) : Path N := Path.ofFn (fn1OfEdge0 N) (by lia) …
Mentions: Imo2024P5.Path, Imo2024P5.Path.ofFn, Imo2024P5.fn1OfEdge0
- def
Imo2024P5.path1OfEdgeNThe second attempt in a winning strategy, as aPath, if the monster in the second row is at the right edge line 581 sourceSource documentation
The second attempt in a winning strategy, as a
Path, if the monster in the second row is at the right edge.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.PathProof uses: Imo2024P5.Path.reflect, Imo2024P5.path1OfEdge0
4 instances, coercions and auxiliary constants left out.
def path1OfEdgeN (hN : 2 ≤ N) : Path N := (path1OfEdge0 hN).reflect
Mentions: Imo2024P5.Path, Imo2024P5.path1OfEdge0
- def
Imo2024P5.fn2OfEdge0Documented declaration: fn2OfEdge0 line 587 sourceSource documentation
The third attempt in a winning strategy, as a function, if the monster in the second row is at the left edge and the second (zigzag) attempt encountered a monster: on the row before the monster was encountered, move to the following row one place earlier, proceed to the left edge and then along that column.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,LE.le,HSub.hSub,HMul.hMul, Imo2024P5.CellProof uses:
dite,LT.lt,Prod.mk,Fin.mk,HDiv.hDiv,Not28 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
def fn2OfEdge0 {r : Fin (N + 2)} (hr : (r : ℕ) ≤ N) : Fin (N + 2 * r - 1) → Cell N := …Mentions: Imo2024P5.Cell
- lemma
Imo2024P5.fn2OfEdge0_apply_eq_fn1OfEdge0_apply_of_ltline 593 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,LE.le,LT.lt,HMul.hMul,Eq, Imo2024P5.Cell, Imo2024P5.fn2OfEdge0,Fin.mk,HSub.hSub, Imo2024P5.fn1OfEdge0Proof uses:
Eq.mpr,dite,Prod.mk,Not,HDiv.hDiv,id,congrArg,congrFun',dite_eq_left,And,Eq.trans,Prod,Prod.fst,Prod.snd,congr,dite_eq_right,of_eq_true,eq_self43 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- def
Imo2024P5.path2OfEdge0The third attempt in a winning strategy, as aPath, if the monster in the second row is at the left edge and the second (zigzag) attempt encountered a monster line 600 sourceSource documentation
The third attempt in a winning strategy, as a
Path, if the monster in the second row is at the left edge and the second (zigzag) attempt encountered a monster.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Fin,HAdd.hAdd, Imo2024P5.PathProof uses: Imo2024P5.Path.ofFn,
HSub.hSub,HMul.hMul, Imo2024P5.fn2OfEdge018 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
def path2OfEdge0 (hN : 2 ≤ N) {r : Fin (N + 2)} (hr2 : 2 ≤ (r : ℕ)) (hrN : (r : ℕ) ≤ N) : Path N := …Mentions: Imo2024P5.Path
- def
Imo2024P5.path2OfEdge0DefDocumented declaration: path2OfEdge0Def line 613 sourceSource documentation
The third attempt in a winning strategy, as a
Path, if the monster in the second row is at the left edge and the second (zigzag) attempt encountered a monster, version that works with junk values ofrfor convenience in defining the strategy before needing to prove things about exactly where it can encounter monsters.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Fin,HAdd.hAdd, Imo2024P5.PathProof uses:
dite,And, Imo2024P5.path2OfEdge0,Not,Fin.mk15 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
def path2OfEdge0Def (hN : 2 ≤ N) (r : Fin (N + 2)) : Path N := …
Mentions: Imo2024P5.Path
- def
Imo2024P5.path2OfEdgeNDefThe third attempt in a winning strategy, as aPath, if the monster in the second row is at the right edge and the second (zigzag) attempt encountered a monster line 619 sourceSource documentation
The third attempt in a winning strategy, as a
Path, if the monster in the second row is at the right edge and the second (zigzag) attempt encountered a monster.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Fin,HAdd.hAdd, Imo2024P5.PathProof uses: Imo2024P5.Path.reflect, Imo2024P5.path2OfEdge0Def
8 instances, coercions and auxiliary constants left out.
def path2OfEdgeNDef (hN : 2 ≤ N) (r : Fin (N + 2)) : Path N := …
Mentions: Imo2024P5.Path
- def
Imo2024P5.path1The second attempt in a winning strategy, given the column of the monster in the second row, as aPathline 624 sourceSource documentation
The second attempt in a winning strategy, given the column of the monster in the second row, as a
Path.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Fin,HAdd.hAdd, Imo2024P5.PathProof uses:
dite,Eq, Imo2024P5.path1OfEdge0,Not,ite, Imo2024P5.path1OfEdgeN, Imo2024P5.path1OfNotEdge13 instances, coercions and auxiliary constants left out.
def path1 (hN : 2 ≤ N) (c₁ : Fin (N + 1)) : Path N := …
Mentions: Imo2024P5.Path
- def
Imo2024P5.path2The third attempt in a winning strategy, given the column of the monster in the second row and the row of the monster (if any) found in the second attempt, as aPathline 631 sourceSource documentation
The third attempt in a winning strategy, given the column of the monster in the second row and the row of the monster (if any) found in the second attempt, as a
Path.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Fin,HAdd.hAdd, Imo2024P5.PathProof uses:
ite,Eq, Imo2024P5.path2OfEdge0Def,dite, Imo2024P5.path2OfEdgeNDef,Not, Imo2024P5.path2OfNotEdge13 instances, coercions and auxiliary constants left out.
def path2 (hN : 2 ≤ N) (c₁ : Fin (N + 1)) (r : Fin (N + 2)) : Path N := …
Mentions: Imo2024P5.Path
- def
Imo2024P5.winningStrategyA strategy that wins in three attempts line 637 sourceSource documentation
A strategy that wins in three attempts.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.StrategyProof uses:
Fin,Option, Imo2024P5.Cell, Imo2024P5.Path,Unit, Imo2024P5.path0, Imo2024P5.path1,Prod.snd,HAdd.hAdd,Option.getD, Imo2024P5.path2,Prod.fst14 instances, coercions and auxiliary constants left out.
def winningStrategy (hN : 2 ≤ N) : Strategy N | 0 => fun _ ↦ path0 hN | 1 => fun r => path1 hN ((r 0).getD 0).2 | _ + 2 => fun r => path2 hN ((r 0).getD 0).2 ((r 1).getD 0).1
Mentions: Imo2024P5.Strategy, Imo2024P5.path0, Imo2024P5.path1, Imo2024P5.path2
- lemma
Imo2024P5.path0_firstMonster_eq_apply_row1line 642 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Eq,Option, Imo2024P5.Cell, Imo2024P5.Path.firstMonster, Imo2024P5.path0,Option.some,Prod,Fin,HAdd.hAdd,Prod.mk, Imo2024P5.InteriorRow, Imo2024P5.row1Proof uses:
id, Imo2024P5.Path.ofFn,HMul.hMul, Imo2024P5.fn0,List.find?,Decidable.decide,Membership.mem,Set, Imo2024P5.MonsterData.monsterCells,Classical.propDecidable,Imo2024P5.Path.cells,Fin.mk,Eq.mpr,ite,dite,LT.lt,HSub.hSub,Eq.mpr_prop,Eq.refl,Notand 64 more107 instances, coercions and auxiliary constants left out.
Tactic trace: 32 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.winningStrategy_play_oneline 671 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Eq,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play, Imo2024P5.winningStrategy,Fin.mk, Imo2024P5.Path.firstMonster, Imo2024P5.path1, Imo2024P5.InteriorRow,Fin,HAdd.hAdd, Imo2024P5.row1Proof uses:
Eq.mpr,Nat.succ,Matrix.vecCons,Fin.elim0,Matrix.vecEmpty,id,congrFun',congrArg, Imo2024P5.Strategy.play_one,Prod.snd,Option.getD, Imo2024P5.path0,Option.some,Prod,Prod.mk, Imo2024P5.Path,Imo2024P5.path1.congr_simp, Imo2024P5.path0_firstMonster_eq_apply_row1,Eq.refl23 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.winningStrategy_play_twoline 677 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Eq,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play, Imo2024P5.winningStrategy,Fin.mk, Imo2024P5.Path.firstMonster, Imo2024P5.path2, Imo2024P5.InteriorRow,Fin,HAdd.hAdd, Imo2024P5.row1,Prod.fst,Option.getD, Imo2024P5.path1Proof uses:
Eq.mpr,Nat.succ,Matrix.vecCons,Fin.elim0,Matrix.vecEmpty,id,congrFun',congrArg, Imo2024P5.Strategy.play_two,Prod.snd, Imo2024P5.path0,Option.some,Prod,Prod.mk, Imo2024P5.Path,Imo2024P5.path2.congr_simp,congr, Imo2024P5.path0_firstMonster_eq_apply_row1,Imo2024P5.path1.congr_simp,Eq.refl29 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.path1_firstMonster_of_not_edgeline 684 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Ne,Fin,HAdd.hAdd, Imo2024P5.InteriorRow, Imo2024P5.row1,Or,Eq,Option, Imo2024P5.Cell, Imo2024P5.Path.firstMonster, Imo2024P5.path1,Option.none,Option.some,Prod,Prod.mk,Fin.mkand 1 moreProof uses: Imo2024P5.Path.firstMonster_none_or_some,
Membership.mem,List,Imo2024P5.Path.cells, Imo2024P5.fn1OfNotEdge,of_eq_false,eq_false,Exists,Not,Set, Imo2024P5.MonsterData.monsterCells,Eq.mp,Eq.trans,List.ofFn,congrFun',congrArg, Imo2024P5.Path, Imo2024P5.Path.ofFn,dite, Imo2024P5.path1OfEdge0 and 44 more65 instances, coercions and auxiliary constants left out.
Tactic trace: 26 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.path2_firstMonster_of_not_edgeline 711 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Ne,Fin,HAdd.hAdd, Imo2024P5.InteriorRow, Imo2024P5.row1,Or,Eq,Option, Imo2024P5.Cell, Imo2024P5.Path.firstMonster, Imo2024P5.path2,Option.none,Option.some,Prod,Prod.mk,Fin.mkProof uses: Imo2024P5.Path.firstMonster_none_or_some,
Membership.mem,List,Imo2024P5.Path.cells, Imo2024P5.fn2OfNotEdge,of_eq_false,eq_false,Exists,Not,Set, Imo2024P5.MonsterData.monsterCells,Eq.mp,Eq.trans,List.ofFn,congrFun',congrArg, Imo2024P5.Path, Imo2024P5.Path.ofFn,ite, Imo2024P5.path2OfEdge0Def and 44 more62 instances, coercions and auxiliary constants left out.
Tactic trace: 25 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.winningStrategy_play_one_eq_none_or_play_two_eq_none_of_not_edgeline 737 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Ne,Fin,HAdd.hAdd, Imo2024P5.InteriorRow, Imo2024P5.row1,Or,Eq,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play, Imo2024P5.winningStrategy,Fin.mk,Option.noneProof uses:
Eq.mpr, Imo2024P5.Path.firstMonster, Imo2024P5.path1,id,congrArg, Imo2024P5.winningStrategy_play_one, Imo2024P5.path2,Prod.fst,Option.getD, Imo2024P5.winningStrategy_play_two,Option.some,Prod,Prod.mk,HSub.hSub, Imo2024P5.path1_firstMonster_of_not_edge,Or.inl,Or.inr, Imo2024P5.path2_firstMonster_of_not_edge,Membership.mem,Setand 25 more55 instances, coercions and auxiliary constants left out.
Tactic trace: 23 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.path2OfEdge0_firstMonster_eq_none_of_path1OfEdge0_firstMonster_eq_someline 758 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.Cell,HAdd.hAdd,Prod.fst,Fin, Imo2024P5.MonsterData,Eq, Imo2024P5.InteriorRow, Imo2024P5.row1,Option, Imo2024P5.Path.firstMonster, Imo2024P5.path1OfEdge0,Option.some, Imo2024P5.path2OfEdge0,Option.noneProof uses:
Eq.mpr, Imo2024P5.Path.ofFn,HSub.hSub,HMul.hMul, Imo2024P5.fn2OfEdge0,id,congrArg, Imo2024P5.Path,Not,Membership.mem,Set, Imo2024P5.MonsterData.monsterCells,propext, Imo2024P5.Path.ofFn_firstMonster_eq_none,Exists,And, Imo2024P5.fn1OfEdge0,LT.lt,Eq.mp,Booland 48 more99 instances, coercions and auxiliary constants left out.
Tactic trace: 44 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.winningStrategy_play_one_eq_none_or_play_two_eq_none_of_edge_zeroline 799 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Eq,Fin,HAdd.hAdd, Imo2024P5.InteriorRow, Imo2024P5.row1,Or,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play, Imo2024P5.winningStrategy,Fin.mk,Option.noneProof uses:
Eq.mpr,Not,id,congrArg,propext,Classical.or_iff_not_imp_left,Option.some,Exists,Eq.mp,Ne,Option.ne_none_iff_exists,Eq.symm,ne_eq, Imo2024P5.Path.firstMonster, Imo2024P5.path2,Prod.fst,Option.getD, Imo2024P5.path1, Imo2024P5.winningStrategy_play_two, Imo2024P5.winningStrategy_play_one and 55 more76 instances, coercions and auxiliary constants left out.
Tactic trace: 35 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.winningStrategy_play_one_two_of_edge_Nline 838 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Eq,HAdd.hAdd, Imo2024P5.InteriorRow,Fin, Imo2024P5.row1,And,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play, Imo2024P5.winningStrategy,Fin.mk,Option.map, Imo2024P5.Cell.reflect, Imo2024P5.MonsterData.reflectProof uses:
Ne, Imo2024P5.MonsterData.apply_row1_ne_zero_of_apply_row1_eq_N, Imo2024P5.MonsterData.reflect_apply_row1_eq_zero_of_apply_row1_eq_N,And.intro,Eq.mpr, Imo2024P5.Path.firstMonster, Imo2024P5.path1,id,congr,congrArg, Imo2024P5.winningStrategy_play_one,dite, Imo2024P5.Path, Imo2024P5.path1OfEdge0,Not,ite, Imo2024P5.path1OfEdgeN, Imo2024P5.path1OfNotEdge, Imo2024P5.Path.reflect,congrFun'and 35 more32 instances, coercions and auxiliary constants left out.
Tactic trace: 20 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.winningStrategy_play_one_eq_none_or_play_two_eq_none_of_edge_Nline 861 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Eq,HAdd.hAdd, Imo2024P5.InteriorRow,Fin, Imo2024P5.row1,Or,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play, Imo2024P5.winningStrategy,Fin.mk,Option.noneProof uses:
Option.map, Imo2024P5.Cell.reflect, Imo2024P5.MonsterData.reflect,And, Imo2024P5.winningStrategy_play_one_two_of_edge_N,Eq.mpr,id,congrFun',congrArg,congr, Imo2024P5.MonsterData.reflect_apply_row1_eq_zero_of_apply_row1_eq_N, Imo2024P5.winningStrategy_play_one_eq_none_or_play_two_eq_none_of_edge_zero23 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.winningStrategy_play_one_eq_none_or_play_two_eq_noneline 871 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.MonsterData,Or,Eq,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play, Imo2024P5.winningStrategy,Fin.mk,Option.noneProof uses:
dite,Fin,HAdd.hAdd, Imo2024P5.InteriorRow, Imo2024P5.row1, Imo2024P5.winningStrategy_play_one_eq_none_or_play_two_eq_none_of_edge_zero,Not, Imo2024P5.winningStrategy_play_one_eq_none_or_play_two_eq_none_of_edge_N, Imo2024P5.winningStrategy_play_one_eq_none_or_play_two_eq_none_of_not_edge18 instances, coercions and auxiliary constants left out.
Tactic trace: 11 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2024P5.winningStrategy_forcesWinIn_threeline 880 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat, Imo2024P5.Strategy.ForcesWinIn, Imo2024P5.winningStrategyProof uses: Imo2024P5.MonsterData,
Eq,Option, Imo2024P5.Cell, Imo2024P5.Strategy.play,Fin.mk,Option.none,Or, Imo2024P5.Strategy.WinsIn, Imo2024P5.winningStrategy_play_one_eq_none_or_play_two_eq_none,Exists.intro,Fin,Mathlib.Meta.NormNum.isNat_lt_true,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refl,Bool,Bool.false13 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
- determine
Imo2024P5.answerline 889 sourceno axioms what this means
Statement uses:
NatProof uses:
OfNat.ofNat1 instances, coercions and auxiliary constants left out.
- problem
Imo2024P5.imo2024_p5line 891 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
IsLeast,Nat,Set.ofPred,Exists, Imo2024P5.Strategy,OfNat.ofNat, Imo2024P5.Strategy.ForcesWinIn, Imo2024P5.answerProof uses:
id,Eq.mpr,And,Membership.mem,Set,lowerBounds,LE.le,Eq,congrArg,congr,forall_congr,implies_congr,Eq.refl,And.intro,Exists.intro, Imo2024P5.winningStrategy,Mathlib.Meta.NormNum.isNat_le_true,Mathlib.Meta.NormNum.isNat_ofNat,Bool,Bool.trueand 2 more15 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.