Compfiles/Usa2007P4.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
76 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 2007, Problem 4
An animal with n cells is a connected figure consisting of n equal-sized square cells (equivalently, a polyomino with n cells). A dinosaur is an animal with at least 2007 cells. It is said to be primitive if its cells cannot be partitioned into two or more dinosaurs. Find with proof the maximum number of cells in a primitive dinosaur.
Imports (10)
- Mathlib.Algebra.Order.BigOperators.Group.Finset
- Mathlib.Algebra.Order.Ring.Star
- Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected
- Mathlib.Data.Int.ConditionallyCompleteOrder
- Mathlib.Data.Int.Interval
- Mathlib.Order.ConditionallyCompleteLattice.Basic
- Mathlib.Tactic.NormNum.Ineq
- Mathlib.Tactic.Ring
- Mathlib.Tactic.Ring.Basic
- ProblemExtraction
Imported by 1 file
- def
Usa2007P4.gridAdjTwo cells of the integer lattice are adjacent when they share an edge, i.e. their Manhattan distance is1line 38 sourceSource documentation
Two cells of the integer lattice are adjacent when they share an edge, i.e. their Manhattan distance is
1.no axioms what this means
Statement uses:
Prod,IntProof uses:
Eq,Nat,HAdd.hAdd,Int.natAbs,HSub.hSub,Prod.fst,Prod.snd,OfNat.ofNat5 instances, coercions and auxiliary constants left out.
def gridAdj (a b : ℤ × ℤ) : Prop := (a.1 - b.1).natAbs + (a.2 - b.2).natAbs = 1
- def
Usa2007P4.gridGraphThe infinite grid graph onℤ × ℤ: vertices are cells, edges join edge-adjacent cells line 42 sourceSource documentation
The infinite grid graph on
ℤ × ℤ: vertices are cells, edges join edge-adjacent cells.standard axioms: propext what this means
Statement uses:
SimpleGraph,Prod,IntProof uses:
SimpleGraph.mk, Usa2007P4.gridAdj2 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
def gridGraph : SimpleGraph (ℤ × ℤ) where …
- structure
Usa2007P4.IsAnimalAn animal is a nonempty finite set of cells whose induced subgraph of the grid graph is connected line 54 sourceSource documentation
An animal is a nonempty finite set of cells whose induced subgraph of the grid graph is connected.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Intstructure IsAnimal (s : Finset (ℤ × ℤ)) : Prop where …
- def
Usa2007P4.IsDinosaurA dinosaur is an animal with at least2007cells line 59 sourceSource documentation
A dinosaur is an animal with at least
2007cells.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,IntProof uses:
And, Usa2007P4.IsAnimal,LE.le,Nat,OfNat.ofNat,Finset.card2 instances, coercions and auxiliary constants left out.
def IsDinosaur (s : Finset (ℤ × ℤ)) : Prop := IsAnimal s ∧ 2007 ≤ s.card
Mentions: Usa2007P4.IsAnimal
- def
Usa2007P4.IsDinoPartitionpartsis a partition of the animaldinto two or more dinosaurs: at least two pairwise disjoint dinosaurs whose union isdline 63 sourceSource documentation
partsis a partition of the animaldinto two or more dinosaurs: at least two pairwise disjoint dinosaurs whose union isd.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,IntProof uses:
And,LE.le,Nat,OfNat.ofNat,Finset.card,Membership.mem, Usa2007P4.IsDinosaur,Ne,Disjoint,Eq,Finset.biUnion,id8 instances, coercions and auxiliary constants left out.
def IsDinoPartition (d : Finset (ℤ × ℤ)) (parts : Finset (Finset (ℤ × ℤ))) : Prop := …
- def
Usa2007P4.IsPrimitiveA dinosaur is primitive if its cells cannot be partitioned into two or more dinosaurs line 71 sourceSource documentation
A dinosaur is primitive if its cells cannot be partitioned into two or more dinosaurs.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,IntProof uses:
And, Usa2007P4.IsDinosaur,Not,Exists, Usa2007P4.IsDinoPartitiondef IsPrimitive (d : Finset (ℤ × ℤ)) : Prop := …
- lemma
Usa2007P4.gridAdj_iffline 78 sourceno axioms what this means
Statement uses:
Prod,Int,Iff, Usa2007P4.gridAdj,Eq,Nat,HAdd.hAdd,Int.natAbs,HSub.hSub,Prod.fst,Prod.snd,OfNat.ofNatProof uses:
Iff.rfl5 instances, coercions and auxiliary constants left out.
- lemma
Usa2007P4.gridAdj_of_gridAdjline 81 sourcestandard axioms: propext what this means
Statement uses:
Prod,Int, Usa2007P4.gridAdjProof uses:
SimpleGraph.adj_symm, Usa2007P4.gridGraph - lemma
Usa2007P4.ne_of_gridAdjline 84 sourcestandard axioms: propext what this means
Statement uses:
Prod,Int, Usa2007P4.gridAdj,NeProof uses:
SimpleGraph.ne_of_adj, Usa2007P4.gridGraph - lemma
Usa2007P4.gridAdj_casesA cell adjacent toais one of its four neighbours line 87 sourceSource documentation
A cell adjacent to
ais one of its four neighbours.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Prod,Int, Usa2007P4.gridAdj,Or,And,Eq,Prod.fst,HAdd.hAdd,OfNat.ofNat,Prod.snd,HSub.hSub6 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma gridAdj_cases {a b : ℤ × ℤ} (h : gridAdj a b) : (b.1 = a.1 + 1 ∧ b.2 = a.2) ∨ (b.1 = a.1 - 1 ∧ b.2 = a.2) ∨ (b.1 = a.1 ∧ b.2 = a.2 + 1) ∨ (b.1 = a.1 ∧ b.2 = a.2 - 1) := by …Mentions: h, Usa2007P4.gridAdj
- def
Usa2007P4.neighbors4The explicit four-element finset of neighbours of a cell line 94 sourceSource documentation
The explicit four-element finset of neighbours of a cell.
standard axioms: Quot.sound, propext what this means
Statement uses:
Prod,Int,FinsetProof uses:
Insert.insert,Prod.mk,HAdd.hAdd,Prod.fst,OfNat.ofNat,Prod.snd,HSub.hSub,Singleton.singleton9 instances, coercions and auxiliary constants left out.
def neighbors4 (a : ℤ × ℤ) : Finset (ℤ × ℤ) := …
- lemma
Usa2007P4.mem_neighbors4_of_gridAdjline 97 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Prod,Int, Usa2007P4.gridAdj,Membership.mem,Finset, Usa2007P4.neighbors4Proof uses:
And,Eq,Prod.fst,HAdd.hAdd,OfNat.ofNat,Prod.snd,Or,HSub.hSub, Usa2007P4.gridAdj_cases,of_eq_true,Insert.insert,Prod.mk,Singleton.singleton,Eq.trans,True,congr,congrArg,congrFun',eq_self,and_selfand 10 more46 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.card_neighbors4_leline 101 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Prod,Int,LE.le,Nat,Finset.card, Usa2007P4.neighbors4,OfNat.ofNatProof uses:
Insert.insert,Finset,Prod.mk,HAdd.hAdd,Prod.fst,Prod.snd,HSub.hSub,Singleton.singleton,Finset.card_insert_le,Eq,Finset.card_singleton,id15 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.card_erase_neighbors4_leline 112 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Prod,Int,Membership.mem,Finset, Usa2007P4.neighbors4,LE.le,Nat,Finset.card,Finset.erase,OfNat.ofNatProof uses:
Eq.mpr,HSub.hSub,id,Eq,congrArg,Finset.card_erase_of_mem, Usa2007P4.card_neighbors4_le15 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.preconnected_of_forall_reachableIf every cell ofTreaches a fixed cellv ∈ Tin the induced subgraph onT, then that subgraph is preconnected line 120 sourceSource documentation
If every cell of
Treaches a fixed cellv ∈ Tin the induced subgraph onT, then that subgraph is preconnected.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Reachable,SimpleGraph.induce, Usa2007P4.gridGraph,Subtype.mk,Set,SimpleGraph.PreconnectedProof uses:
SimpleGraph.Reachable.trans,Subtype.property,SimpleGraph.Reachable.symm11 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma preconnected_of_forall_reachable (T : Finset (ℤ × ℤ)) {v : ℤ × ℤ} (hv : v ∈ T) (h : ∀ c : ℤ × ℤ, ∀ hc : c ∈ T, (gridGraph.induce (T : Set (ℤ × ℤ))).Reachable ⟨c, hc⟩ ⟨v, hv⟩) : (gridGraph.induce (T : Set (ℤ × ℤ))).Preconnected := by …Mentions: h
- lemma
Usa2007P4.exists_walk_lengthline 144 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Exists,Nat,SimpleGraph.Walk,Subtype.mk,Set,Eq,SimpleGraph.Walk.lengthProof uses:
SimpleGraph.Reachable,Exists.intro,rfl11 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- def
Usa2007P4.dwThe depth of a cell: length of a shortest walk from the rootrinsideD(defined to be0outsideD) line 152 sourceSource documentation
The depth of a cell: length of a shortest walk from the root
rinsideD(defined to be0outsideD).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,NatProof uses:
dite,Nat.find,Exists,SimpleGraph.Walk,Subtype.mk,Set,Eq,SimpleGraph.Walk.length,Classical.propDecidable, Usa2007P4.exists_walk_length,Not,OfNat.ofNat13 instances, coercions and auxiliary constants left out.
noncomputable def dw (c : ℤ × ℤ) : ℕ := …
- lemma
Usa2007P4.dw_specline 155 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Exists,SimpleGraph.Walk,Subtype.mk,Set,Eq,Nat,SimpleGraph.Walk.length, Usa2007P4.dwProof uses:
Eq.mpr,Nat.find,Classical.propDecidable, Usa2007P4.exists_walk_length,id,congrArg,funext,Decidable,Not,dite_eq_left,OfNat.ofNat,Nat.find_spec14 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.dw_leline 161 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,SimpleGraph.Walk,Subtype.mk,Set,LE.le,Nat, Usa2007P4.dw,SimpleGraph.Walk.lengthProof uses:
Eq.mpr,Nat.find,Exists,Eq,Classical.propDecidable, Usa2007P4.exists_walk_length,id,congrFun',congrArg,Decidable,Not,dite_eq_left,OfNat.ofNat,Nat.find_le,Exists.intro,rfl16 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.dw_rootline 167 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Eq,Nat, Usa2007P4.dw,OfNat.ofNatProof uses:
Eq.mpr,Nat.find,Exists,SimpleGraph.Walk,Subtype.mk,Set,SimpleGraph.Walk.length,Classical.propDecidable, Usa2007P4.exists_walk_length,id,congrFun',congrArg,Decidable,Not,dite_eq_left,Nat.eq_zero_of_le_zero,Nat.find_le,Exists.intro,SimpleGraph.Walk.nil,rfl14 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.eq_of_dw_eq_zeroline 171 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Eq,Nat, Usa2007P4.dw,OfNat.ofNatProof uses:
SimpleGraph.Walk,Subtype.mk,Set,SimpleGraph.Walk.length,Nat.find,Exists,Classical.propDecidable, Usa2007P4.exists_walk_length,Nat.find_spec,Iff.mp,SimpleGraph.Walk.exists_length_eq_zero_iff,Exists.intro,Eq.mp,congrArg,congrFun',Decidable,Not,dite_eq_left,Eq.symm,Subtype16 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.parent_existsAny cellc ≠ rofDhas a neighbour of strictly smaller depth: the penultimate cell of a shortest walk fromrtocline 181 sourceSource documentation
Any cell
c ≠ rofDhas a neighbour of strictly smaller depth: the penultimate cell of a shortest walk fromrtoc.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Ne,Exists,And, Usa2007P4.gridAdj,LT.lt,Nat, Usa2007P4.dwProof uses:
SimpleGraph.Walk,Subtype.mk,Set,Eq,SimpleGraph.Walk.length, Usa2007P4.dw_spec,OfNat.ofNat,GT.gt,Or,Nat.eq_zero_or_pos,False.elim,Iff.mp,SimpleGraph.Walk.exists_length_eq_zero_iff,Exists.intro,Eq.symm,congrArg,Subtype,SimpleGraph.Walk.getVert,HSub.hSub,And.introand 18 more25 instances, coercions and auxiliary constants left out.
Tactic trace: 23 steps
Open to load the checked before-and-after goal states.
lemma parent_exists {c : ℤ × ℤ} (hc : c ∈ D) (hcr : c ≠ r) : ∃ u ∈ D, gridAdj c u ∧ dw D r hr hpre u < dw D r hr hpre c := by …Mentions: Usa2007P4.gridAdj, Usa2007P4.dw
- def
Usa2007P4.parentThe parent map: forc ∈ D,c ≠ ra chosen neighbour ofcof smaller depth; anything else is mapped to itself line 202 sourceSource documentation
The parent map: for
c ∈ D,c ≠ ra chosen neighbour ofcof smaller depth; anything else is mapped to itself.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraphProof uses:
dite,And,Ne,Eq,Exists.choose, Usa2007P4.gridAdj,LT.lt,Nat, Usa2007P4.dw,Not15 instances, coercions and auxiliary constants left out.
noncomputable def parent (c : ℤ × ℤ) : ℤ × ℤ := …
- lemma
Usa2007P4.parent_memline 205 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph, Usa2007P4.parentProof uses:
id,dite,And,Ne,Eq,Exists.choose, Usa2007P4.gridAdj,LT.lt,Nat, Usa2007P4.dw,Not,Eq.mpr,congrArg,dite_eq_left,And.left, Usa2007P4.parent_exists,And.right,Exists.choose_spec,dite_eq_right15 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.gridAdj_parentline 213 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Ne, Usa2007P4.gridAdj, Usa2007P4.parentProof uses:
id,Eq.mpr,dite,And,Eq,Exists.choose,LT.lt,Nat, Usa2007P4.dw,Not,And.intro,congrArg,dite_eq_left,And.left, Usa2007P4.parent_exists,And.right,Exists.choose_spec15 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.dw_parent_ltline 219 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Ne,LT.lt,Nat, Usa2007P4.dw, Usa2007P4.parentProof uses:
id,Eq.mpr,dite,And,Eq,Exists.choose, Usa2007P4.gridAdj,Not,And.intro,congrArg,dite_eq_left,And.right, Usa2007P4.parent_exists,Exists.choose_spec16 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.parent_rootline 225 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Eq, Usa2007P4.parentProof uses:
id,Eq.mpr,dite,And,Ne,Exists.choose, Usa2007P4.gridAdj,LT.lt,Nat, Usa2007P4.dw,Not,congrArg,dite_eq_right,And.right,rfl,Eq.refl15 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.parent_ne_selfline 229 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Ne, Usa2007P4.parentProof uses:
Ne.symm, Usa2007P4.ne_of_gridAdj, Usa2007P4.gridAdj_parent8 instances, coercions and auxiliary constants left out.
- lemma
Usa2007P4.iterate_parent_memline 233 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Nat,Nat.iterate, Usa2007P4.parentProof uses:
Nat.recAux,Eq.mpr,HAdd.hAdd,OfNat.ofNat,id,Eq,congrArg,Nat.succ,Function.iterate_succ_apply', Usa2007P4.parent_mem11 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.iterate_parent_rootline 241 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Nat,Eq,Nat.iterate, Usa2007P4.parentProof uses:
Nat.recAux,Eq.refl,OfNat.ofNat,Eq.mpr,HAdd.hAdd,id,congrArg,Nat.succ,Function.iterate_succ_apply', Usa2007P4.parent_root11 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.dw_iterate_parent_ltline 246 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Ne,Nat,LE.le,OfNat.ofNat,LT.lt, Usa2007P4.dw,Nat.iterate, Usa2007P4.parentProof uses:
Nat.recAux,absurd,HAdd.hAdd,dite,Eq, Usa2007P4.dw_parent_lt,Eq.symm,Not,Eq.mpr,id,congrArg,Nat.succ,Function.iterate_succ_apply', Usa2007P4.parent_root, Usa2007P4.dw_root,Nat.zero_lt_of_lt, Usa2007P4.iterate_parent_mem,lt_trans23 instances, coercions and auxiliary constants left out.
Tactic trace: 18 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.exists_iterate_parent_eq_rootFollowing parents from any cell ofDeventually reaches the root line 264 sourceSource documentation
Following parents from any cell of
Deventually reaches the root.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Exists,Nat,Eq,Nat.iterate, Usa2007P4.parentProof uses:
LE.le, Usa2007P4.dw,Nat.recAux,OfNat.ofNat,Exists.intro, Usa2007P4.eq_of_dw_eq_zero,HAdd.hAdd,dite,Not,Ne,False,Eq.mp,congrArg, Usa2007P4.dw_root,Nat.zero_le, Usa2007P4.parent_mem,LT.lt, Usa2007P4.dw_parent_lt,Eq.mpr,idand 3 more19 instances, coercions and auxiliary constants left out.
Tactic trace: 24 steps
Open to load the checked before-and-after goal states.
lemma exists_iterate_parent_eq_root {c : ℤ × ℤ} (hc : c ∈ D) : ∃ i, (parent D r hr hpre)^[i] c = r := by …Mentions: Usa2007P4.parent
- def
Usa2007P4.subtreeThe subtree rooted atv: all cells ofDwhose parent chain hitsvline 290 sourceSource documentation
The subtree rooted at
v: all cells ofDwhose parent chain hitsv.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraphProof uses:
Finset.filter,Exists,Nat,Eq,Nat.iterate, Usa2007P4.parent,Classical.propDecidable8 instances, coercions and auxiliary constants left out.
noncomputable def subtree (v : ℤ × ℤ) : Finset (ℤ × ℤ) := …
- lemma
Usa2007P4.mem_subtreeline 293 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Iff, Usa2007P4.subtree,And,Exists,Nat,Eq,Nat.iterate, Usa2007P4.parentProof uses:
Finset.mem_filter,Classical.propDecidable8 instances, coercions and auxiliary constants left out.
- lemma
Usa2007P4.mem_subtree_selfline 297 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph, Usa2007P4.subtreeProof uses:
Eq.mpr,And,Exists,Nat,Eq,Nat.iterate, Usa2007P4.parent,id,congrArg,propext, Usa2007P4.mem_subtree,And.intro,Exists.intro,OfNat.ofNat,rfl9 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.iterate_parent_mem_subtree_of_leline 301 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph, Usa2007P4.subtree,Nat,Eq,Nat.iterate, Usa2007P4.parent,LE.leProof uses:
Eq.mpr,And,Exists,id,congrArg,propext, Usa2007P4.mem_subtree,And.intro, Usa2007P4.iterate_parent_mem,And.left,Eq.mp,Exists.intro,HSub.hSub,HAdd.hAdd,Eq.symm,Function.iterate_add_apply,Nat.sub_add_cancel14 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.not_mem_subtree_iterateline 310 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Not, Usa2007P4.subtree,Nat,Nat.iterate, Usa2007P4.parentProof uses:
Exists,Eq,And,False,Eq.mp,congrArg,propext, Usa2007P4.mem_subtree,Eq.mpr,id,And.intro,Exists.intro,HAdd.hAdd,Function.iterate_add_apply12 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.subtree_rootline 320 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Eq, Usa2007P4.subtreeProof uses:
Finset.ext,Eq.mpr,Iff,And,Exists,Nat,Nat.iterate, Usa2007P4.parent,id,congrArg,propext, Usa2007P4.mem_subtree,Iff.intro,And.left,And.intro, Usa2007P4.exists_iterate_parent_eq_root8 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
- def
Usa2007P4.childrenThe children ofv: cells ofDwhose parent isvline 329 sourceSource documentation
The children of
v: cells ofDwhose parent isv.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraphProof uses:
Finset.filter,And,Eq, Usa2007P4.parent,Ne12 instances, coercions and auxiliary constants left out.
noncomputable def children (v : ℤ × ℤ) : Finset (ℤ × ℤ) := …
- lemma
Usa2007P4.mem_childrenline 332 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Iff, Usa2007P4.children,And,Eq, Usa2007P4.parent,NeProof uses:
Finset.mem_filter12 instances, coercions and auxiliary constants left out.
- lemma
Usa2007P4.children_ne_rootline 336 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph, Usa2007P4.children,NeProof uses:
Eq,And, Usa2007P4.parent,False,And.right,Eq.mp,congrArg, Usa2007P4.parent_root,And.left,propext, Usa2007P4.mem_children9 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.dw_childline 343 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph, Usa2007P4.children,LT.lt,Nat, Usa2007P4.dwProof uses:
Ne, Usa2007P4.children_ne_root, Usa2007P4.parent, Usa2007P4.dw_parent_lt,And.left,And,Eq,Iff.mp, Usa2007P4.mem_children,Eq.mp,congrArg,And.right10 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.children_subset_neighborsline 349 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph, Usa2007P4.children, Usa2007P4.neighbors4Proof uses:
Ne, Usa2007P4.children_ne_root, Usa2007P4.gridAdj, Usa2007P4.parent, Usa2007P4.gridAdj_parent,And.left,And,Eq,Iff.mp, Usa2007P4.mem_children, Usa2007P4.mem_neighbors4_of_gridAdj, Usa2007P4.gridAdj_of_gridAdj,Eq.mp,congrArg,And.right8 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.child_ne_parentline 356 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Ne, Usa2007P4.children, Usa2007P4.parentProof uses:
And,Eq,Iff.mp, Usa2007P4.mem_children,LT.lt,Nat, Usa2007P4.dw, Usa2007P4.dw_child, Usa2007P4.dw_parent_lt,absurd,False,lt_trans,Eq.mp,congrArg,lt_irrefl12 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.card_children_le_threeline 366 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Ne,LE.le,Nat,Finset.card, Usa2007P4.children,OfNat.ofNatProof uses:
Finset.erase, Usa2007P4.neighbors4, Usa2007P4.parent,Eq.mpr,And,id,Eq,congrArg,propext,Finset.mem_erase,And.intro, Usa2007P4.child_ne_parent, Usa2007P4.children_subset_neighbors,le_trans,Finset.card_le_card, Usa2007P4.card_erase_neighbors4_le, Usa2007P4.mem_neighbors4_of_gridAdj, Usa2007P4.gridAdj_parent17 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.card_children_le_fourline 376 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,LE.le,Nat,Finset.card, Usa2007P4.children,OfNat.ofNatProof uses:
le_trans, Usa2007P4.neighbors4,Finset.card_le_card, Usa2007P4.children_subset_neighbors, Usa2007P4.card_neighbors4_le12 instances, coercions and auxiliary constants left out.
- lemma
Usa2007P4.subtree_eqThe subtree ofvdecomposes asvtogether with the subtrees of its children line 382 sourceSource documentation
The subtree of
vdecomposes asvtogether with the subtrees of its children.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Eq, Usa2007P4.subtree,Insert.insert,Finset.biUnion, Usa2007P4.childrenProof uses:
Finset.ext,Eq.mpr,Iff,And,Exists,Nat,Nat.iterate, Usa2007P4.parent,Or,Ne,id,congr,congrArg,Eq.trans,funext,Iff.intro,dite,Or.inl,Not,Or.inrand 16 more27 instances, coercions and auxiliary constants left out.
Tactic trace: 29 steps
Open to load the checked before-and-after goal states.
lemma subtree_eq {v : ℤ × ℤ} (hv : v ∈ D) : subtree D r hr hpre v = insert v ((children D r hr hpre v).biUnion (subtree D r hr hpre)) := by …Mentions: Usa2007P4.subtree, Usa2007P4.children
- lemma
Usa2007P4.disjoint_subtree_childrenThe subtrees of distinct children ofvare disjoint line 410 sourceSource documentation
The subtrees of distinct children of
vare disjoint.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Set.PairwiseDisjoint, Usa2007P4.children, Usa2007P4.subtreeProof uses:
Set,Ne,id,Function.onFun,Disjoint,Eq.mpr,Not,Eq,congrArg,propext,Finset.disjoint_left,Exists,Nat,Nat.iterate, Usa2007P4.parent,And,False,Iff.mp, Usa2007P4.mem_subtree,LT.ltand 22 more33 instances, coercions and auxiliary constants left out.
Tactic trace: 43 steps
Open to load the checked before-and-after goal states.
lemma disjoint_subtree_children {v : ℤ × ℤ} (hv : v ∈ D) : ((children D r hr hpre v) : Set (ℤ × ℤ)).PairwiseDisjoint (subtree D r hr hpre) := by …Mentions: Usa2007P4.children, Usa2007P4.subtree
- lemma
Usa2007P4.card_subtreeThe size of a subtree is one more than the sum of the sizes of the subtrees of its children line 453 sourceSource documentation
The size of a subtree is one more than the sum of the sizes of the subtrees of its children.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Eq,Nat,Finset.card, Usa2007P4.subtree,HAdd.hAdd,OfNat.ofNat,Finset.sum, Usa2007P4.childrenProof uses:
Not,Finset.biUnion,And,Exists,False,Eq.mp,congrArg,propext,Finset.mem_biUnion,Nat.iterate, Usa2007P4.parent,Iff.mp, Usa2007P4.mem_subtree,Ne, Usa2007P4.mem_children,GT.gt,Or,Nat.eq_zero_or_pos,Eq.symm,diteand 12 more26 instances, coercions and auxiliary constants left out.
Tactic trace: 24 steps
Open to load the checked before-and-after goal states.
lemma card_subtree {v : ℤ × ℤ} (hv : v ∈ D) : (subtree D r hr hpre v).card = 1 + ∑ u ∈ children D r hr hpre v, (subtree D r hr hpre u).card := by …Mentions: Usa2007P4.subtree, Usa2007P4.children
- lemma
Usa2007P4.reachable_of_chainIf the parent chain fromcstays insideTand reachesv, thencreachesvin the induced subgraph onTline 480 sourceSource documentation
If the parent chain from
cstays insideTand reachesv, thencreachesvin the induced subgraph onT.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,LE.le,Nat,Nat.iterate, Usa2007P4.parent,Eq,SimpleGraph.Reachable,Subtype.mk,SetProof uses:
Nat.recAux,OfNat.ofNat,SimpleGraph.Reachable.refl,HAdd.hAdd,dite,Not,Ne,False,Eq.mp,congrArg, Usa2007P4.iterate_parent_root, Usa2007P4.gridAdj, Usa2007P4.gridAdj_parent,Nat.succ,Function.iterate_succ_apply,SimpleGraph.Adj,Iff.mpr,SimpleGraph.induce_adj,Nonempty.map,SimpleGraph.Walkand 1 more27 instances, coercions and auxiliary constants left out.
Tactic trace: 28 steps
Open to load the checked before-and-after goal states.
lemma reachable_of_chain (T : Finset (ℤ × ℤ)) (hTD : T ⊆ D) {c v : ℤ × ℤ} (hc : c ∈ T) (hv : v ∈ T) (i : ℕ) (hchain : ∀ j ≤ i, (parent D r hr hpre)^[j] c ∈ T) (hiv : (parent D r hr hpre)^[i] c = v) : (gridGraph.induce (T : Set (ℤ × ℤ))).Reachable ⟨c, hc⟩ ⟨v, hv⟩ := by …Mentions: Usa2007P4.parent
- lemma
Usa2007P4.isAnimal_subtreeThe subtree rooted at any cell ofDis an animal line 515 sourceSource documentation
The subtree rooted at any cell of
Dis an animal.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph, Usa2007P4.IsAnimal, Usa2007P4.subtreeProof uses:
Usa2007P4.IsAnimal.mk,Exists.intro, Usa2007P4.mem_subtree_self, Usa2007P4.preconnected_of_forall_reachable,Exists,Nat,Eq,Nat.iterate, Usa2007P4.parent,And,SimpleGraph.Reachable,Subtype.mk,Set,Iff.mp, Usa2007P4.mem_subtree, Usa2007P4.reachable_of_chain,Finset.filter_subset,Classical.propDecidable,LE.le, Usa2007P4.iterate_parent_mem_subtree_of_le12 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma isAnimal_subtree {v : ℤ × ℤ} (hv : v ∈ D) : IsAnimal (subtree D r hr hpre v) := by …Mentions: Usa2007P4.IsAnimal, Usa2007P4.subtree
- lemma
Usa2007P4.isAnimal_sdiff_subtreeRemoving a rooted subtree (withv ≠ r) fromDleaves an animal line 526 sourceSource documentation
Removing a rooted subtree (with
v ≠ r) fromDleaves an animal.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,Ne, Usa2007P4.IsAnimal,SDiff.sdiff, Usa2007P4.subtreeProof uses:
Eq.mpr,And,Not,id,Eq,congrArg,propext,Finset.mem_sdiff,And.intro,Exists,Nat,Nat.iterate, Usa2007P4.parent,False,Iff.mp, Usa2007P4.mem_subtree,Eq.symm,Eq.mp, Usa2007P4.iterate_parent_root,Usa2007P4.IsAnimal.mkand 13 more18 instances, coercions and auxiliary constants left out.
Tactic trace: 13 steps
Open to load the checked before-and-after goal states.
lemma isAnimal_sdiff_subtree {v : ℤ × ℤ} (_hv : v ∈ D) (hvr : v ≠ r) : IsAnimal (D \ subtree D r hr hpre v) := by …Mentions: Usa2007P4.IsAnimal, Usa2007P4.subtree
- lemma
Usa2007P4.exists_splitSplitting lemma line 548 sourceSource documentation
Splitting lemma. Any animal with at least
4 * 2007 - 2cells can be partitioned into two dinosaurs; in particular it is not primitive.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,Membership.mem,SimpleGraph.Preconnected,SimpleGraph.induce, Usa2007P4.gridGraph,LE.le,Nat,HSub.hSub,HMul.hMul,OfNat.ofNat,Finset.card,Exists,And, Usa2007P4.IsDinosaur,Disjoint,Eq,Union.unionProof uses:
Finset.filter, Usa2007P4.subtree,rfl,Eq.mpr,id,congrArg,propext,Finset.mem_filter,And.intro, Usa2007P4.subtree_root, Usa2007P4.dw,Finset.exists_max_image,Exists.intro,Eq.mp, Usa2007P4.children,Decidable.byContradiction,Not,LT.lt,Nat.lt_of_not_le,And.leftand 32 more69 instances, coercions and auxiliary constants left out.
Tactic trace: 49 steps
Open to load the checked before-and-after goal states.
lemma exists_split (hcard : 4 * 2007 - 2 ≤ D.card) : ∃ A B : Finset (ℤ × ℤ), IsDinosaur A ∧ IsDinosaur B ∧ Disjoint A B ∧ A ∪ B = D := by …Mentions: Usa2007P4.IsDinosaur
- def
Usa2007P4.crossAuxThe body ofcross, kept reducible so that membership and cardinality can be unfolded in the auxiliary lemmasmem_auxandcard_auxline 606 sourceSource documentation
The body of
cross, kept reducible so that membership and cardinality can be unfolded in the auxiliary lemmasmem_auxandcard_aux. (In this environment,Finset.Icconℤrecords aPreorder ℤinstance whose term contains the noncomputableInt.instConditionallyCompleteLinearOrder, hence thenoncomputablekeyword.)standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,IntProof uses:
Union.union,Finset.product,Finset.Icc,Neg.neg,OfNat.ofNat,Singleton.singleton8 instances, coercions and auxiliary constants left out.
noncomputable def crossAux : Finset (ℤ × ℤ) := …
- def
Usa2007P4.crossThe cross with center(0,0)and four arms of length2006line 619 sourceSource documentation
The cross with center
(0,0)and four arms of length2006.Marked
irreducible: thePreorder ℤinstance recorded in theFinset.Iccterms of the body is a very large term, and any definitional unfolding ofcross(as happens when checkingx ∈ crossagainstx ∈ ↑crossfor the coercion toSet, e.g. when building elements of↥(↑cross)) exceeds the elaborator's recursion depth limit. Unfold instead viacross_def,mem_auxandcard_auxwhere needed.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,IntProof uses: Usa2007P4.crossAux
noncomputable def cross : Finset (ℤ × ℤ) := crossAux
Mentions: Usa2007P4.crossAux
- lemma
Usa2007P4.cross_defUnfolding lemma forcrossline 624 sourceSource documentation
Unfolding lemma for
cross. Do not usesimp only [cross]orcross.eq_unfold: re-elaborating the auto-generated equation lemma hits the recursion depth limit.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Finset,Prod,Int, Usa2007P4.cross, Usa2007P4.crossAuxProof uses:
Eq.reflTactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma cross_def : cross = crossAux := by …
Mentions: Usa2007P4.cross, Usa2007P4.crossAux
- lemma
Usa2007P4.mem_auxCoordinate characterization of membership incrossAuxline 628 sourceSource documentation
Coordinate characterization of membership in
crossAux.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Prod,Int,Iff,Membership.mem,Finset, Usa2007P4.crossAux,Or,And,Eq,Prod.snd,OfNat.ofNat,LE.le,Neg.neg,Prod.fstProof uses:
Eq.mpr,id,congrFun',congrArg,Eq.trans,Union.union,SProd.sprod,Finset.Icc,Singleton.singleton,congr,Iff.intro,Or.inl,And.intro,Or.inr24 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
lemma mem_aux {c : ℤ × ℤ} : c ∈ crossAux ↔ (c.2 = 0 ∧ -2006 ≤ c.1 ∧ c.1 ≤ 2006) ∨ (c.1 = 0 ∧ -2006 ≤ c.2 ∧ c.2 ≤ 2006) := by …Mentions: Usa2007P4.crossAux
- lemma
Usa2007P4.mem_cross_iffCoordinate characterization of membership incrossline 642 sourceSource documentation
Coordinate characterization of membership in
cross.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Prod,Int,Iff,Membership.mem,Finset, Usa2007P4.cross,Or,And,Eq,Prod.snd,OfNat.ofNat,LE.le,Neg.neg,Prod.fstProof uses:
Eq.mpr, Usa2007P4.crossAux,id,congrArg, Usa2007P4.cross_def, Usa2007P4.mem_aux10 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma mem_cross_iff {c : ℤ × ℤ} : c ∈ cross ↔ (c.2 = 0 ∧ -2006 ≤ c.1 ∧ c.1 ≤ 2006) ∨ (c.1 = 0 ∧ -2006 ≤ c.2 ∧ c.2 ≤ 2006) := by …Mentions: Usa2007P4.cross
- lemma
Usa2007P4.mem_center_crossline 648 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Membership.mem,Prod,Int,Finset, Usa2007P4.cross,Prod.mk,OfNat.ofNatProof uses:
Eq.mpr,Or,And,Eq,Prod.snd,LE.le,Neg.neg,Prod.fst,id,congrArg,propext, Usa2007P4.mem_cross_iff,Or.inl,And.intro,rfl,of_decide_eq_true,Bool,Decidable.decide,Bool.true,Eq.refl9 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.mem_cross_of_natThe four arm points at distancenfrom the center lie incrosswhenn ≤ 2006line 654 sourceSource documentation
The four arm points at distance
nfrom the center lie incrosswhenn ≤ 2006.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,And,Membership.mem,Prod,Int,Finset, Usa2007P4.cross,Prod.mk,Neg.negProof uses:
Int.natCast_nonneg,cast,Eq.symm,And.intro,Eq.mpr,Or,Eq,Prod.snd,Prod.fst,id,congrArg,propext, Usa2007P4.mem_cross_iff32 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma mem_cross_of_nat {n : ℕ} (hn : n ≤ 2006) : (((n : ℤ), 0) ∈ cross) ∧ ((-((n : ℤ)), 0) ∈ cross) ∧ (((0 : ℤ), (n : ℤ)) ∈ cross) ∧ (((0 : ℤ), -((n : ℤ))) ∈ cross) := by …Mentions: Usa2007P4.cross
- lemma
Usa2007P4.card_auxline 661 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Nat,Finset.card,Prod,Int, Usa2007P4.crossAux,OfNat.ofNatProof uses:
Finset,Finset.product,HMul.hMul,Finset.card_product,Finset.Icc,Neg.neg,Singleton.singleton,Eq.mpr,id,congrArg,Int.toNat,HSub.hSub,HAdd.hAdd,Int.card_Icc,Finset.card_singleton,of_decide_eq_true,Bool,Decidable.decide,Bool.true,Eq.refland 20 more32 instances, coercions and auxiliary constants left out.
Tactic trace: 26 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.card_crossline 688 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Nat,Finset.card,Prod,Int, Usa2007P4.cross,OfNat.ofNatProof uses:
Eq.mpr, Usa2007P4.crossAux,id,congrArg,Finset, Usa2007P4.cross_def, Usa2007P4.card_aux2 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.reach_rightWalking down the positive x-arm:((n,0))reaches the center line 693 sourceSource documentation
Walking down the positive x-arm:
((n,0))reaches the center.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Membership.mem,Prod,Int,Finset, Usa2007P4.cross,Prod.mk,SimpleGraph.Reachable,SimpleGraph.induce, Usa2007P4.gridGraph,Subtype.mk,Set, Usa2007P4.mem_center_crossProof uses:
Nat.recAux,SimpleGraph.Reachable.refl,HAdd.hAdd,And.left,And,Neg.neg, Usa2007P4.mem_cross_of_nat, Usa2007P4.gridAdj,id,Eq,Int.natAbs,HSub.hSub,Prod.fst,Prod.snd,Eq.mpr,congrArg,Nat.cast_add,Nat.cast_one,Mathlib.Tactic.Ring.of_eq,Nat.rawCastand 41 more62 instances, coercions and auxiliary constants left out.
Tactic trace: 18 steps
Open to load the checked before-and-after goal states.
lemma reach_right : ∀ n : ℕ, n ≤ 2006 → ∀ h : (((n : ℤ), 0) ∈ cross), (gridGraph.induce (cross : Set (ℤ × ℤ))).Reachable ⟨((n : ℤ), 0), h⟩ ⟨(0, 0), mem_center_cross⟩ := by …Mentions: h, Usa2007P4.cross, Usa2007P4.mem_center_cross
- lemma
Usa2007P4.reach_leftWalking down the negative x-arm:((-n,0))reaches the center line 718 sourceSource documentation
Walking down the negative x-arm:
((-n,0))reaches the center.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Membership.mem,Prod,Int,Finset, Usa2007P4.cross,Prod.mk,Neg.neg,SimpleGraph.Reachable,SimpleGraph.induce, Usa2007P4.gridGraph,Subtype.mk,Set, Usa2007P4.mem_center_crossProof uses:
Nat.recAux,SimpleGraph.Reachable.refl,HAdd.hAdd,And.left,And,And.right, Usa2007P4.mem_cross_of_nat, Usa2007P4.gridAdj,id,Eq,Int.natAbs,HSub.hSub,Prod.fst,Prod.snd,Eq.mpr,congrArg,Nat.cast_add,Nat.cast_one,Mathlib.Tactic.Ring.of_eq,Int.rawCastand 44 more63 instances, coercions and auxiliary constants left out.
Tactic trace: 18 steps
Open to load the checked before-and-after goal states.
lemma reach_left : ∀ n : ℕ, n ≤ 2006 → ∀ h : ((-((n : ℤ)), 0) ∈ cross), (gridGraph.induce (cross : Set (ℤ × ℤ))).Reachable ⟨(-((n : ℤ)), 0), h⟩ ⟨(0, 0), mem_center_cross⟩ := by …Mentions: h, Usa2007P4.cross, Usa2007P4.mem_center_cross
- lemma
Usa2007P4.reach_upWalking down the positive y-arm:((0,n))reaches the center line 743 sourceSource documentation
Walking down the positive y-arm:
((0,n))reaches the center.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Membership.mem,Prod,Int,Finset, Usa2007P4.cross,Prod.mk,SimpleGraph.Reachable,SimpleGraph.induce, Usa2007P4.gridGraph,Subtype.mk,Set, Usa2007P4.mem_center_crossProof uses:
Nat.recAux,SimpleGraph.Reachable.refl,HAdd.hAdd,And.left,Neg.neg,And.right,And, Usa2007P4.mem_cross_of_nat, Usa2007P4.gridAdj,id,Eq,Int.natAbs,HSub.hSub,Prod.fst,Prod.snd,Eq.mpr,congrArg,Nat.cast_add,Nat.cast_one,Mathlib.Tactic.Ring.of_eqand 42 more62 instances, coercions and auxiliary constants left out.
Tactic trace: 18 steps
Open to load the checked before-and-after goal states.
lemma reach_up : ∀ n : ℕ, n ≤ 2006 → ∀ h : (((0 : ℤ), (n : ℤ)) ∈ cross), (gridGraph.induce (cross : Set (ℤ × ℤ))).Reachable ⟨((0 : ℤ), (n : ℤ)), h⟩ ⟨(0, 0), mem_center_cross⟩ := by …Mentions: h, Usa2007P4.cross, Usa2007P4.mem_center_cross
- lemma
Usa2007P4.reach_downWalking down the negative y-arm:((0,-n))reaches the center line 768 sourceSource documentation
Walking down the negative y-arm:
((0,-n))reaches the center.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Membership.mem,Prod,Int,Finset, Usa2007P4.cross,Prod.mk,Neg.neg,SimpleGraph.Reachable,SimpleGraph.induce, Usa2007P4.gridGraph,Subtype.mk,Set, Usa2007P4.mem_center_crossProof uses:
Nat.recAux,SimpleGraph.Reachable.refl,HAdd.hAdd,And.right,And, Usa2007P4.mem_cross_of_nat, Usa2007P4.gridAdj,id,Eq,Int.natAbs,HSub.hSub,Prod.fst,Prod.snd,Eq.mpr,congrArg,Nat.cast_add,Nat.cast_one,Mathlib.Tactic.Ring.of_eq,Int.rawCast,inferInstanceand 43 more63 instances, coercions and auxiliary constants left out.
Tactic trace: 18 steps
Open to load the checked before-and-after goal states.
lemma reach_down : ∀ n : ℕ, n ≤ 2006 → ∀ h : (((0 : ℤ), -((n : ℤ))) ∈ cross), (gridGraph.induce (cross : Set (ℤ × ℤ))).Reachable ⟨((0 : ℤ), -((n : ℤ))), h⟩ ⟨(0, 0), mem_center_cross⟩ := by …Mentions: h, Usa2007P4.cross, Usa2007P4.mem_center_cross
- lemma
Usa2007P4.isAnimal_crossline 792 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Usa2007P4.IsAnimal, Usa2007P4.cross
Proof uses:
Usa2007P4.IsAnimal.mk,Exists.intro,Prod,Int,Membership.mem,Finset,Prod.mk,OfNat.ofNat, Usa2007P4.mem_center_cross,SimpleGraph.Reachable,SimpleGraph.induce, Usa2007P4.gridGraph,Subtype.mk,Set,Or,And,Eq,Prod.snd,LE.le,Neg.negand 16 more19 instances, coercions and auxiliary constants left out.
Tactic trace: 42 steps
Open to load the checked before-and-after goal states.
- def
Usa2007P4.InSameArmblies in the same arm of the cross asa(meaningful whenais not the center) line 829 sourceSource documentation
blies in the same arm of the cross asa(meaningful whenais not the center).no axioms what this means
Statement uses:
Prod,IntProof uses:
And,LT.lt,OfNat.ofNat,Prod.snd,Eq,Prod.fst2 instances, coercions and auxiliary constants left out.
def InSameArm (a b : ℤ × ℤ) : Prop := …
- lemma
Usa2007P4.inSameArm_reflline 833 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Prod,Int,Membership.mem,Finset, Usa2007P4.cross, Usa2007P4.InSameArmProof uses:
Or,And,Eq,Prod.snd,OfNat.ofNat,LE.le,Neg.neg,Prod.fst,Iff.mp, Usa2007P4.mem_cross_iff,And.intro,LT.lt18 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.inSameArm_transline 838 sourceno axioms what this means
Statement uses:
Prod,Int, Usa2007P4.InSameArmProof uses:
LT.lt,OfNat.ofNat,Prod.snd,And,Eq,Prod.fst,And.intro,And.right3 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.inSameArm_of_gridAdjA step along the cross between two cells, the target not being the center, stays in the same arm line 847 sourceSource documentation
A step along the cross between two cells, the target not being the center, stays in the same arm.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Prod,Int,Membership.mem,Finset, Usa2007P4.cross,Ne,Prod.mk,OfNat.ofNat, Usa2007P4.gridAdj, Usa2007P4.InSameArmProof uses:
Or,And,Eq,Prod.snd,LE.le,Neg.neg,Prod.fst,Iff.mp, Usa2007P4.mem_cross_iff,Not,Prod.ext,And.left,And.right,HAdd.hAdd,HSub.hSub, Usa2007P4.gridAdj_cases,And.intro,LT.lt63 instances, coercions and auxiliary constants left out.
Tactic trace: 11 steps
Open to load the checked before-and-after goal states.
lemma inSameArm_of_gridAdj {a b : ℤ × ℤ} (ha : a ∈ cross) (hb : b ∈ cross) (hb0 : b ≠ (0, 0)) (h : gridAdj a b) : InSameArm a b := by …Mentions: Usa2007P4.cross, h, Usa2007P4.gridAdj, Usa2007P4.InSameArm
- lemma
Usa2007P4.inSameArm_walkAny walk inside a center-free subset of the cross stays in one arm line 858 sourceSource documentation
Any walk inside a center-free subset of the cross stays in one arm.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int,LE.le, Usa2007P4.cross,Not,Membership.mem,Prod.mk,OfNat.ofNat,SimpleGraph.Walk,SimpleGraph.induce, Usa2007P4.gridGraph, Usa2007P4.InSameArm,SetProof uses:
SimpleGraph.Walk.rec, Usa2007P4.inSameArm_refl,Iff.mp,Finset.mem_coe,Subtype.property,SimpleGraph.Adj, Usa2007P4.inSameArm_trans, Usa2007P4.inSameArm_of_gridAdj,Eq,Eq.rec,SimpleGraph.induce_adj20 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
lemma inSameArm_walk {T : Finset (ℤ × ℤ)} (hsub : T ⊆ cross) (h0 : ((0, 0) : ℤ × ℤ) ∉ T) {u v : (T : Set (ℤ × ℤ))} (w : (gridGraph.induce (T : Set (ℤ × ℤ))).Walk u v) : InSameArm (u : ℤ × ℤ) (v : ℤ × ℤ) := by …Mentions: Usa2007P4.cross, Usa2007P4.InSameArm
- lemma
Usa2007P4.mem_center_of_dinosaur_subsetline 872 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Prod,Int, Usa2007P4.IsDinosaur,LE.le, Usa2007P4.cross,Membership.mem,Prod.mk,OfNat.ofNatProof uses:
Decidable.byContradiction,Not,Nat,Finset.card,And.right, Usa2007P4.IsAnimal,Finset.Nonempty,False,Usa2007P4.IsAnimal.nonempty,And.left,Ne,Eq,Eq.rec, Usa2007P4.InSameArm, Usa2007P4.inSameArm_walk,Subtype.mk,Set,Iff.mpr,Finset.mem_coe,Nonempty.someand 39 more51 instances, coercions and auxiliary constants left out.
Tactic trace: 75 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2007P4.isPrimitive_crossline 946 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Usa2007P4.IsPrimitive, Usa2007P4.cross
Proof uses:
And.intro, Usa2007P4.IsDinosaur,Not,Exists,Finset,Prod,Int, Usa2007P4.IsDinoPartition, Usa2007P4.IsAnimal,LE.le,Nat,OfNat.ofNat,Finset.card, Usa2007P4.isAnimal_cross,Eq.mpr,id,Eq,congrArg, Usa2007P4.card_cross,Mathlib.Meta.NormNum.isNat_le_trueand 20 more21 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.
- determine
Usa2007P4.answerThe answer to USAMO 2007 Problem 4 line 966 sourceSource documentation
The answer to USAMO 2007 Problem 4.
no axioms what this means
Statement uses:
NatProof uses:
OfNat.ofNat1 instances, coercions and auxiliary constants left out.
determine answer : ℕ := 8025
- problem
Usa2007P4.usa2007_p4line 968 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
IsGreatest,Nat,Set.ofPred,Exists,Finset,Prod,Int,And, Usa2007P4.IsPrimitive,Eq,Finset.card, Usa2007P4.answerProof uses:
And.intro,Membership.mem,Set,upperBounds,Exists.intro, Usa2007P4.cross, Usa2007P4.isPrimitive_cross, Usa2007P4.card_cross,LE.le, Usa2007P4.IsDinosaur,Not, Usa2007P4.IsDinoPartition, Usa2007P4.IsAnimal,OfNat.ofNat,Decidable.byContradiction,LT.lt,Nat.lt_of_not_le,HSub.hSub,HMul.hMul,Finset.Nonemptyand 37 more28 instances, coercions and auxiliary constants left out.
Tactic trace: 48 steps
Open to load the checked before-and-after goal states.