Compfiles/Imo1979P6.lean
26 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 1979, Problem 6
Let $A$ and $E$ be opposite vertices of an octagon. A frog starts at vertex $A.$ From any vertex except $E$ it jumps to one of the two adjacent vertices. When it reaches $E$ it stops. Let $a_n$ be the number of distinct paths of exactly $n$ jumps ending at $E$. Prove that: \[a_{2n-1}=0, \quad a_{2n}={(2+\sqrt2)^{n-1} - (2-\sqrt2)^{n-1} \over\sqrt2}.\]
Imports (2)
Imported by 1 file
- abbrev
Imo1979P6.Octagonline 30 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
SimpleGraph,Fin,OfNat.ofNat,NatProof uses:
SimpleGraph.cycleGraph2 instances, coercions and auxiliary constants left out.
- abbrev
Imo1979P6.Aline 31 sourcestandard axioms: propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat4 instances, coercions and auxiliary constants left out.
- abbrev
Imo1979P6.Eline 32 sourcestandard axioms: propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat4 instances, coercions and auxiliary constants left out.
- def
Imo1979P6.isTerminalWalkline 34 sourceno axioms what this means
Statement uses:
SimpleGraph,SimpleGraph.WalkProof uses:
Not,Membership.mem,List,List.dropLast,SimpleGraph.Walk.support1 instances, coercions and auxiliary constants left out.
- def
Imo1979P6.aline 36 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
Set.ncard,SimpleGraph.Walk,Fin,OfNat.ofNat, Imo1979P6.Octagon, Imo1979P6.A, Imo1979P6.E,Set.ofPred,And, Imo1979P6.isTerminalWalk,Eq,SimpleGraph.Walk.length1 instances, coercions and auxiliary constants left out.
- instance
Imo1979P6.instFintypeAndline 40 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
DecidableEq,Fintype,Subtype,DecidablePred,AndProof uses:
Fintype.mk,Finset.image,Membership.mem,Finset,Finset.filter,Fintype.elems,Subtype.mk,Finset.attach6 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
- instance
Imo1979P6.Set.instFintypeElemOfSubtypeline 52 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,Subtype,Set.ofPredProof uses:
Fintype.mk,Fintype.elems3 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1979P6.Walk.append_getVertline 62 sourcestandard axioms: propext what this means
Statement uses:
SimpleGraph,SimpleGraph.Walk,Eq,SimpleGraph.Walk.getVert,SimpleGraph.Walk.append,SimpleGraph.Walk.lengthProof uses:
of_eq_true,Eq.trans,True,congrFun',congrArg,ite,LT.lt,Nat,HSub.hSub,SimpleGraph.Walk.getVert_append,ite_eq_right_of_eq_false,OfNat.ofNat,tsub_self,SimpleGraph.Walk.getVert_zero,eq_self15 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1979P6.Walk.take_appendline 67 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
SimpleGraph,SimpleGraph.Walk,Eq,SimpleGraph.Walk.getVert,SimpleGraph.Walk.append,SimpleGraph.Walk.length,SimpleGraph.Walk.take,SimpleGraph.Walk.copy,rflProof uses:
SimpleGraph.Walk.ext_support,Eq.mpr,List,SimpleGraph.Walk.support,List.take,HAdd.hAdd,Nat,OfNat.ofNat,id,congrArg,SimpleGraph.Walk.support_take,HAppend.hAppend,List.tail,SimpleGraph.Walk.support_append,of_eq_true,Eq.trans,True,congr,List.take_left',List.lengthand 4 more8 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1979P6.Walk.drop_append_of_length_eqline 75 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
SimpleGraph,SimpleGraph.Walk,Eq,SimpleGraph.Walk.getVert,SimpleGraph.Walk.append,SimpleGraph.Walk.length,SimpleGraph.Walk.drop,SimpleGraph.Walk.copy,rflProof uses:
SimpleGraph.Walk.ext_support,Eq.mpr,List,SimpleGraph.Walk.support,List.drop,Min.min,Nat,id,congrArg,SimpleGraph.Walk.drop_support_eq_support_drop_min,HAppend.hAppend,List.dropLast,SimpleGraph.Walk.support_append_eq_support_dropLast_append,of_eq_true,Eq.trans,True,congr,congrFun',HAdd.hAdd,SimpleGraph.Walk.length_appendand 11 more44 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1979P6.isTerminalWalk_copyline 83 sourcestandard axioms: propext what this means
Statement uses:
SimpleGraph,Eq,SimpleGraph.Walk, Imo1979P6.isTerminalWalk,SimpleGraph.Walk.copyProof uses:
id,Not,Membership.mem,List,List.dropLast,SimpleGraph.Walk.support,of_eq_true,Eq.trans,False,True,congrArg,congr,SimpleGraph.Walk.support_copy,Eq.symm,eq_false,not_false_eq_true1 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1979P6.isTerminalWalk_mapline 88 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
SimpleGraph,SimpleGraph.Embedding,SimpleGraph.Walk, Imo1979P6.isTerminalWalk,SimpleGraph.Hom,SimpleGraph.Adj,SimpleGraph.Embedding.toHom,SimpleGraph.Walk.mapProof uses:
id,Not,Membership.mem,List,List.dropLast,SimpleGraph.Walk.support,Eq.mpr,List.map,RelEmbedding,Eq,congrArg,congrFun',SimpleGraph.Walk.support_map,Mathlib.Tactic.Contrapose.contrapose₄,List.take,HSub.hSub,Nat,List.length,OfNat.ofNat,List.dropLast_eq_takeand 16 more16 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1979P6.isTerminalWalk_of_isSubwalkline 99 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
SimpleGraph,SimpleGraph.Walk, Imo1979P6.isTerminalWalk,SimpleGraph.Walk.IsSubwalkProof uses:
id,Exists,List,Eq,HAppend.hAppend,SimpleGraph.Walk.support,Not,Membership.mem,List.dropLast,Eq.mp,List.IsInfix,congrArg,List.IsInfix.eq_1,propext,SimpleGraph.Walk.isSubwalk_iff_support_isInfix,Mathlib.Tactic.Contrapose.contrapose₄,ite,Bool,List.isEmpty,Bool.trueand 20 more7 instances, coercions and auxiliary constants left out.
Tactic trace: 13 steps
Open to load the checked before-and-after goal states.
- instance
Imo1979P6.instDecidableIsTerminalWalkline 113 sourcestandard axioms: propext what this means
Statement uses:
DecidableEq,SimpleGraph,DecidablePred,SimpleGraph.Walk, Imo1979P6.isTerminalWalkProof uses:
id,Decidable,inferInstance,Not,Membership.mem,List,List.dropLast,SimpleGraph.Walk.support5 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- abbrev
Imo1979P6.Cline 118 sourcestandard axioms: propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat4 instances, coercions and auxiliary constants left out.
- abbrev
Imo1979P6.Gline 119 sourcestandard axioms: propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat4 instances, coercions and auxiliary constants left out.
- def
Imo1979P6.bline 121 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
Set.ncard,SimpleGraph.Walk,Fin,OfNat.ofNat, Imo1979P6.Octagon, Imo1979P6.C, Imo1979P6.E,Set.ofPred,And, Imo1979P6.isTerminalWalk,Eq,SimpleGraph.Walk.length1 instances, coercions and auxiliary constants left out.
- def
Imo1979P6.Octagon.mirrorline 123 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
SimpleGraph.Iso,Fin,OfNat.ofNat,Nat, Imo1979P6.OctagonProof uses:
RelIso.mk,SimpleGraph.Adj,Equiv.mk,Neg.neg6 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- def
Imo1979P6.C_G_symmline 134 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Equiv,Subtype,SimpleGraph.Walk,Fin,OfNat.ofNat, Imo1979P6.Octagon, Imo1979P6.C, Imo1979P6.E,And, Imo1979P6.isTerminalWalk,Eq,SimpleGraph.Walk.length, Imo1979P6.GProof uses:
Equiv.mk,Imo1979P6.C_G_symm.match_1,Subtype.mk,SimpleGraph.Walk.copy,SimpleGraph.Hom,SimpleGraph.Adj,SimpleGraph.Iso.toHom, Imo1979P6.Octagon.mirror,SimpleGraph.Walk.map,Imo1979P6.C_G_symm.match_211 instances, coercions and auxiliary constants left out.
Tactic trace: 28 steps
Open to load the checked before-and-after goal states.
- def
Imo1979P6.isTerminalWalk_length_cons_equivline 165 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
SimpleGraph,Nat,LT.lt,OfNat.ofNat,Equiv,Subtype,SimpleGraph.Walk,And, Imo1979P6.isTerminalWalk,Eq,SimpleGraph.Walk.length,HAdd.hAdd,Sigma,Prod,Not,Membership.mem,List,SimpleGraph.Walk.supportProof uses:
Equiv.mk,Imo1979P6.isTerminalWalk_length_cons_equiv.match_1,Sigma.mk,SimpleGraph.Walk.getVert,Prod.mk,Subtype.mk,SimpleGraph.Walk.take,SimpleGraph.Walk.drop,Imo1979P6.isTerminalWalk_length_cons_equiv.match_2,SimpleGraph.Walk.append15 instances, coercions and auxiliary constants left out.
Tactic trace: 54 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1979P6.a_b_recurrence_1line 213 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq, Imo1979P6.a,HAdd.hAdd,HMul.hMul, Imo1979P6.bProof uses:
Fin,Fintype.card,Subtype,SimpleGraph.Walk, Imo1979P6.Octagon, Imo1979P6.A,And,Not,Membership.mem,List,SimpleGraph.Walk.support, Imo1979P6.E,SimpleGraph.Walk.length,Set,SimpleGraph.neighborSet,Ord.compare,Unit,of_decide_eq_true,id,Booland 73 more88 instances, coercions and auxiliary constants left out.
Tactic trace: 25 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1979P6.a_b_recurrence_2line 244 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq, Imo1979P6.b,HAdd.hAdd, Imo1979P6.a,HMul.hMulProof uses:
Fin,Fintype.card,Subtype,SimpleGraph.Walk, Imo1979P6.Octagon, Imo1979P6.C,And,Not,Membership.mem,List,SimpleGraph.Walk.support, Imo1979P6.E,SimpleGraph.Walk.length,Set,SimpleGraph.neighborSet,Ord.compare,Unit,of_decide_eq_true,id,Booland 69 more89 instances, coercions and auxiliary constants left out.
Tactic trace: 24 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1979P6.a_evenline 274 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq,Real, Imo1979P6.a,HMul.hMul,HDiv.hDiv,HSub.hSub,HPow.hPow,HAdd.hAdd,Real.sqrtProof uses:
And, Imo1979P6.b,Nat.le_induction,Nat.succ,LE.le,id,Set.ncard,SimpleGraph.Walk,Fin, Imo1979P6.Octagon, Imo1979P6.A, Imo1979P6.E,Set.ofPred, Imo1979P6.isTerminalWalk,SimpleGraph.Walk.length,Eq.mpr, Imo1979P6.C,congr,congrArg,congrFun'and 131 more147 instances, coercions and auxiliary constants left out.
Tactic trace: 32 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1979P6.walk_evenline 302 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
SimpleGraph.Walk,Fin,OfNat.ofNat,Nat, Imo1979P6.Octagon, Imo1979P6.A, Imo1979P6.E,Even,SimpleGraph.Walk.lengthProof uses:
SimpleGraph.Coloring,SimpleGraph.cycleGraph,Bool,SimpleGraph.cycleGraph.bicoloring_of_even,of_eq_true,Eq.trans,Eq,HMod.hMod,True,eq_self,Eq.mpr,Iff,SimpleGraph.Adj,SimpleGraph.completeGraph,Bool.true,id,congrArg,propext,SimpleGraph.Coloring.even_length_iff_congr,of_decide_eq_trueand 2 more11 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1979P6.a_oddline 307 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq, Imo1979P6.a,HSub.hSub,HMul.hMulProof uses:
id,Eq.mpr,Set.ncard,SimpleGraph.Walk,Fin, Imo1979P6.Octagon, Imo1979P6.A, Imo1979P6.E,Set.ofPred,And, Imo1979P6.isTerminalWalk,SimpleGraph.Walk.length,Finset.card,Set.toFinset,Membership.mem,Set,SimpleGraph.neighborSet,congrArg,Set.ncard_eq_toFinset_card',Finsetand 6 more26 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- problem
Imo1979P6.imo1979_p6line 318 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,And,Eq, Imo1979P6.a,HSub.hSub,HMul.hMul,Real,HDiv.hDiv,HPow.hPow,HAdd.hAdd,Real.sqrtProof uses:
And.intro, Imo1979P6.a_odd, Imo1979P6.a_even42 instances, coercions and auxiliary constants left out.