Compfiles/Imo1993P6.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
62 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 1993, Problem 6
There are n > 1 lamps L₀, L₁, ..., Lₙ₋₁ in a circle. We use L_{n+k} to mean L_k. A lamp is at all times either on or off. Initially they are all on. Perform steps s₀, s₁, ... as follows: at step sᵢ, if L_{i-1} is lit, then switch Lᵢ from on to off or vice versa, otherwise do nothing. Show that:
(a) There is a positive integer M(n) such that after M(n) steps all the lamps are on again; (b) If n = 2ᵏ, then we can take M(n) = n² - 1. (c) If n = 2ᵏ + 1, then we can take M(n) = n² - n + 1.
Imports (2)
Imported by 1 file
- abbrev
Imo1993P6.StateThe state of the system: the on/off states of the lamps (true= on), together with the position of the lamp that may be switched at the next step line 37 sourceSource documentation
The state of the system: the on/off states of the lamps (
true= on), together with the position of the lamp that may be switched at the next step. Positions are taken modulon, i.e. inFin n.no axioms what this means
Statement uses:
NatProof uses:
Prod,Fin,Boolabbrev State (n : ℕ) := (Fin n → Bool) × Fin n
- def
Imo1993P6.stepDocumented declaration: step line 42 sourceSource documentation
One step of the process, performed at the current position
s.2: if lamps.2 - 1is on then lamps.2is switched, otherwise nothing happens to the lamps; in any case the position advances by one (modulon).standard axioms: propext what this means
Statement uses:
Nat,NeZero, Imo1993P6.StateProof uses:
Prod.mk,Fin,Bool,Function.update,Prod.fst,Prod.snd,ite,Eq,HSub.hSub,OfNat.ofNat,Bool.true,Bool.not,HAdd.hAdd11 instances, coercions and auxiliary constants left out.
def step {n : ℕ} [NeZero n] (s : State n) : State n := …Mentions: Imo1993P6.State
- abbrev
Imo1993P6.initialThe initial state: all lamps on, and the next step happens at lamp0line 46 sourceSource documentation
The initial state: all lamps on, and the next step happens at lamp
0.standard axioms: propext what this means
Statement uses:
Nat,NeZero, Imo1993P6.StateProof uses:
Prod.mk,Fin,Bool,Bool.true,OfNat.ofNat5 instances, coercions and auxiliary constants left out.
abbrev initial (n : ℕ) [NeZero n] : State n := (fun _ => true, 0)
Mentions: Imo1993P6.State
- abbrev
Imo1993P6.lampsAfterThe lamp states aftertsteps of the process line 49 sourceSource documentation
The lamp states after
tsteps of the process.standard axioms: propext what this means
Statement uses:
Nat,NeZero,Fin,BoolProof uses:
Prod.fst,Nat.iterate, Imo1993P6.State, Imo1993P6.step, Imo1993P6.initial4 instances, coercions and auxiliary constants left out.
abbrev lampsAfter (n : ℕ) [NeZero n] (t : ℕ) : Fin n → Bool := …
- lemma
Imo1993P6.toggle_injFor a fixed conditionc, the mapv ↦ (if c then !v else v)is injective line 55 sourceSource documentation
For a fixed condition
c, the mapv ↦ (if c then !v else v)is injective.standard axioms: propext what this means
Statement uses:
Bool,Function.Injective,ite,Eq,Bool.true,Bool.notProof uses:
Bool.false,of_eq_true,eq_self,Eq.symm,False.elim,Eq.mp,False,Eq.trans,congr,congrArg,ite_eq_right_of_eq_false,Bool.false_eq_true,Eq.refl,Bool.true_eq_false,ite_eq_left_of_eq_true,Bool.not_false,Bool.not_true4 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
lemma toggle_inj (c : Bool) : Function.Injective (fun v : Bool => if c then !v else v) := by … - lemma
Imo1993P6.bool_toggleToggling a lamp according to conditioncis xor withcline 61 sourceSource documentation
Toggling a lamp according to condition
cis xor withc.standard axioms: propext what this means
Statement uses:
Bool,Eq,ite,Bool.true,Bool.not,Bool.xorProof uses:
Bool.false,of_eq_true,Eq.trans,True,congr,congrArg,ite_eq_right_of_eq_false,Bool.false_eq_true,Bool.false_bne,eq_self,Eq.symm,ite_eq_left_of_eq_true,Bool.true_bne,Eq.refl4 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma bool_toggle (c v : Bool) : (if c then !v else v) = (c ^^ v) := by …
- lemma
Imo1993P6.step_lampsThe lamp component of one step line 65 sourceSource documentation
The lamp component of one step.
standard axioms: propext what this means
Statement uses:
Nat,NeZero, Imo1993P6.State,Eq,Fin,Bool,Prod.fst, Imo1993P6.step,Function.update,Prod.snd,ite,HSub.hSub,OfNat.ofNat,Bool.true,Bool.notProof uses:
rfl9 instances, coercions and auxiliary constants left out.
lemma step_lamps {n : ℕ} [NeZero n] (s : State n) : (step s).1 = Function.update s.1 s.2 (if s.1 (s.2 - 1) then !s.1 s.2 else s.1 s.2) := …Mentions: Imo1993P6.State, Imo1993P6.step
- lemma
Imo1993P6.step_posThe position component of one step line 70 sourceSource documentation
The position component of one step.
standard axioms: propext what this means
Statement uses:
Nat,NeZero, Imo1993P6.State,Eq,Fin,Prod.snd,Bool, Imo1993P6.step,HAdd.hAdd,OfNat.ofNatProof uses:
rfl7 instances, coercions and auxiliary constants left out.
lemma step_pos {n : ℕ} [NeZero n] (s : State n) : (step s).2 = s.2 + 1 := rflMentions: Imo1993P6.State, Imo1993P6.step
- lemma
Imo1993P6.pos_afterAftertsteps the position ist(modulon) line 73 sourceSource documentation
After
tsteps the position ist(modulon).standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq,Fin,Prod.snd,Bool,Nat.iterate, Imo1993P6.State, Imo1993P6.step, Imo1993P6.initial,Fin.NatCast.instNatCastProof uses:
Nat.recAux,id,OfNat.ofNat,Eq.mpr,congrArg,Fin.natCast_zero,Eq.refl,HAdd.hAdd,Nat.succ,Function.iterate_succ_apply', Imo1993P6.step_pos,Eq.symm,Fin.instAddMonoidWithOne,Nat.cast_add_one17 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
lemma pos_after (n : ℕ) [NeZero n] (t : ℕ) : (step^[t] (initial n)).2 = ((t : ℕ) : Fin n) := by …Mentions: Imo1993P6.step, Imo1993P6.initial
- lemma
Imo1993P6.step_injectiveThe step map is injective: a state has exactly one precursor line 86 sourceSource documentation
The step map is injective: a state has exactly one precursor. Indeed, the new position tells us which lamp was just considered, and whether it was toggled is recorded in the (unchanged) previous lamp.
standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,NeZero,LT.lt,OfNat.ofNat,Function.Injective, Imo1993P6.State, Imo1993P6.stepProof uses:
Fin,Bool,Eq,Prod.mk,Function.update,ite,HSub.hSub,Bool.true,Bool.not,HAdd.hAdd,And,Prod.mk.inj,Eq.mp,congr,congrArg,congrFun',Prod,Prod.fst,Prod.snd,ite_congrand 28 more38 instances, coercions and auxiliary constants left out.
Tactic trace: 36 steps
Open to load the checked before-and-after goal states.
lemma step_injective {n : ℕ} [NeZero n] (hn : 1 < n) : Function.Injective (step : State n → State n) := by …Mentions: Imo1993P6.step, Imo1993P6.State
- lemma
Imo1993P6.step_periodicThe process is periodic: some positive iterate ofstepfixes the initial state line 128 sourceSource documentation
The process is periodic: some positive iterate of
stepfixes the initial state. This is becausestepis an injective (hence bijective) self-map of a finite set, so it has finite order as a permutation.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,LT.lt,OfNat.ofNat,Exists,And,Eq, Imo1993P6.State,Nat.iterate, Imo1993P6.step, Imo1993P6.initialProof uses:
Function.Injective, Imo1993P6.step_injective,Function.Bijective,Function.Injective.bijective_of_finite,Fin,Bool,Equiv.Perm,Equiv.ofBijective,Exists.intro,orderOf,And.intro,orderOf_pos,HPow.hPow,Eq.mpr,id,congrArg,pow_orderOf_eq_one,Eq.refl,Eq.mp,Equiv.Perm.coe_pow30 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
lemma step_periodic (n : ℕ) [NeZero n] (hn : 1 < n) : ∃ M : ℕ, 0 < M ∧ step^[M] (initial n) = initial n := by …Mentions: Imo1993P6.step, Imo1993P6.initial
- lemma
Imo1993P6.all_on_of_last_onlyGeneric final phase: if aftern * (n - 1)steps only the last lampL_{n-1}is on, then the lamps are turned on one by one and aftern² - 1steps they are all on again line 143 sourceSource documentation
Generic final phase: if after
n * (n - 1)steps only the last lampL_{n-1}is on, then the lamps are turned on one by one and aftern² - 1steps they are all on again.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,LT.lt,OfNat.ofNat,Fin,Eq,Bool, Imo1993P6.lampsAfter,HMul.hMul,HSub.hSub,Decidable.decide,HPow.hPow,Bool.trueProof uses:
Fin.NatCast.instNatCast,Fin.ext,Eq.mpr,HMod.hMod,id,congrArg,Fin.coe_natCast_eq_mod,Nat.mul_mod_right,of_eq_true,eq_self,Prod.fst,Nat.iterate, Imo1993P6.State, Imo1993P6.step, Imo1993P6.initial,LE.le,HAdd.hAdd,Or,Nat.recAux,Nat.add_zeroand 56 more84 instances, coercions and auxiliary constants left out.
Tactic trace: 79 steps
Open to load the checked before-and-after goal states.
lemma all_on_of_last_only {n : ℕ} [NeZero n] (hn : 1 < n) (h : ∀ i : Fin n, lampsAfter n (n * (n - 1)) i = decide (i.val = n - 1)) : ∀ i : Fin n, lampsAfter n (n ^ 2 - 1) i = true := by …Mentions: h, Imo1993P6.lampsAfter
- lemma
Imo1993P6.step_lamps_eq_of_pred_offIf the lamp checked at a step is off, the step leaves all lamps unchanged line 228 sourceSource documentation
If the lamp checked at a step is off, the step leaves all lamps unchanged.
standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,NeZero, Imo1993P6.State,Eq,Bool,Prod.fst,Fin,HSub.hSub,Prod.snd,OfNat.ofNat,Bool.false, Imo1993P6.stepProof uses:
Eq.mpr,Function.update,ite,Bool.true,Bool.not,id,congrArg, Imo1993P6.step_lamps,funext,dite,Function.update_self,of_eq_true,Eq.trans,True,congrFun',ite_eq_right_of_eq_false,Bool.false_eq_true,eq_self,Eq.symm,Notand 2 more13 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
lemma step_lamps_eq_of_pred_off {n : ℕ} [NeZero n] {s : State n} (h : s.1 (s.2 - 1) = false) : (step s).1 = s.1 := by …Mentions: Imo1993P6.State, h, Imo1993P6.step
- lemma
Imo1993P6.step_lamps_toggleIf the lamp checked at a step is on, the step flips the current lamp line 239 sourceSource documentation
If the lamp checked at a step is on, the step flips the current lamp.
standard axioms: propext what this means
Statement uses:
Nat,NeZero, Imo1993P6.State,Eq,Bool,Prod.fst,Fin,HSub.hSub,Prod.snd,OfNat.ofNat,Bool.true, Imo1993P6.step,ite,Bool.notProof uses:
Eq.mpr,Function.update,id,congrArg, Imo1993P6.step_lamps,dite,Function.update_self,of_eq_true,Eq.trans,True,congr,ite_eq_left_of_eq_true,eq_self,Eq.symm,Not,Function.update_of_ne,ite_eq_right,Eq.refl14 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
lemma step_lamps_toggle {n : ℕ} [NeZero n] {s : State n} (h : s.1 (s.2 - 1) = true) (i : Fin n) : (step s).1 i = (if i = s.2 then !s.1 i else s.1 i) := by …Mentions: Imo1993P6.State, h, Imo1993P6.step
- lemma
Imo1993P6.all_on_of_lamp1_onlyDocumented declaration: all_on_of_lamp1_only line 252 sourceSource documentation
Generic final phase for the
n = 2ᵏ + 1case: if aftern * (n - 2)steps only lampL₁is on, then after two idle steps the lampsL₂, L₃, …, L_{n-1}, L₀are turned on one by one, and aftern² - n + 1steps they are all on again.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,LT.lt,OfNat.ofNat,Fin,Eq,Bool, Imo1993P6.lampsAfter,HMul.hMul,HSub.hSub,Decidable.decide,HAdd.hAdd,HPow.hPow,Bool.trueProof uses:
Prod.fst,Nat.iterate, Imo1993P6.State, Imo1993P6.step, Imo1993P6.initial,Fin.NatCast.instNatCast,Fin.ext,Eq.mpr,HMod.hMod,id,congrArg,Fin.coe_natCast_eq_mod,Nat.mul_mod_right,of_eq_true,eq_self,Prod.snd,Bool.false, Imo1993P6.pos_after,Not,propextand 67 more104 instances, coercions and auxiliary constants left out.
Tactic trace: 116 steps
Open to load the checked before-and-after goal states.
lemma all_on_of_lamp1_only {n : ℕ} [NeZero n] (hn : 2 < n) (h : ∀ i : Fin n, lampsAfter n (n * (n - 2)) i = decide (i.val = 1)) : ∀ i : Fin n, lampsAfter n (n ^ 2 - n + 1) i = true := by …Mentions: h, Imo1993P6.lampsAfter
- def
Imo1993P6.zstepThe same process with lamp values inZMod 2: toggling is adding the predecessor line 372 sourceSource documentation
The same process with lamp values in
ZMod 2: toggling is adding the predecessor.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Prod,Fin,ZMod,OfNat.ofNatProof uses:
Prod.mk,Function.update,Prod.fst,Prod.snd,HAdd.hAdd,HSub.hSub19 instances, coercions and auxiliary constants left out.
def zstep {n : ℕ} [NeZero n] (s : (Fin n → ZMod 2) × Fin n) : (Fin n → ZMod 2) × Fin n := … - def
Imo1993P6.zinitline 375 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Prod,Fin,ZMod,OfNat.ofNatProof uses:
Prod.mk15 instances, coercions and auxiliary constants left out.
- def
Imo1993P6.z2bline 377 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
ZMod,OfNat.ofNat,Nat,BoolProof uses:
Decidable.decide,Eq11 instances, coercions and auxiliary constants left out.
- lemma
Imo1993P6.z2b_oneline 379 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Bool, Imo1993P6.z2b,OfNat.ofNat,ZMod,Nat,Bool.trueProof uses:
rfl18 instances, coercions and auxiliary constants left out.
- lemma
Imo1993P6.z2b_zeroline 381 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Bool, Imo1993P6.z2b,OfNat.ofNat,ZMod,Nat,Bool.falseProof uses:
rfl18 instances, coercions and auxiliary constants left out.
- lemma
Imo1993P6.z2b_addline 383 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
ZMod,OfNat.ofNat,Nat,Eq,Bool,ite, Imo1993P6.z2b,Bool.true,Bool.not,HAdd.hAddProof uses:
of_decide_eq_true,id,Decidable.decide,Eq.refl23 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.zadd_selfline 385 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
ZMod,OfNat.ofNat,Nat,Eq,HAdd.hAddProof uses:
of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl28 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.one_add_one_zmodline 387 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,ZMod,OfNat.ofNat,Nat,HAdd.hAddProof uses:
of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl37 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.one_add_one_cancelline 389 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
ZMod,OfNat.ofNat,Nat,Eq,HAdd.hAddProof uses:
Eq.mpr,id,congrArg,add_assoc,Eq.symm,add_left_comm, Imo1993P6.one_add_one_zmod,add_zero,Eq.refl44 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.pos_lemmaThe position aftertsteps line 393 sourceSource documentation
The position after
tsteps.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,ZMod,OfNat.ofNat,Eq,Prod.snd,Nat.iterate,Prod, Imo1993P6.zstep,Prod.mk,HAdd.hAdd,Fin.NatCast.instNatCastProof uses:
LT.lt,NeZero.pos,Nat.recAux,id,of_eq_true,Eq.trans,True,congrArg,Fin.instAddMonoidWithOne,Nat.cast_zero,add_zero,eq_self,Eq.mpr,Nat.succ,Function.iterate_succ_apply',Nat.cast_succ,Eq.symm,add_assoc,Eq.refl28 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma pos_lemma {n : ℕ} [NeZero n] (x : Fin n → ZMod 2) (p : Fin n) (t : ℕ) : (zstep^[t] (x, p)).2 = p + (t : Fin n) := by …Mentions: Imo1993P6.zstep
- lemma
Imo1993P6.glueCorrespondence between the Bool process and the ZMod 2 process line 406 sourceSource documentation
Correspondence between the Bool process and the ZMod 2 process.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq, Imo1993P6.State,Nat.iterate, Imo1993P6.step, Imo1993P6.initial,Prod.mk,Fin,Bool, Imo1993P6.z2b,Prod.fst,ZMod,OfNat.ofNat,Prod, Imo1993P6.zstep, Imo1993P6.zinit,Prod.sndProof uses:
Nat.recAux,Prod.ext,funext,Eq.refl,congrArg,Eq.mpr,HAdd.hAdd,id,Nat.succ,Function.iterate_succ_apply',Function.update,ite,HSub.hSub,Bool.true,Bool.not,dite,Function.update_self, Imo1993P6.z2b_add,Eq.symm,Notand 1 more22 instances, coercions and auxiliary constants left out.
Tactic trace: 25 steps
Open to load the checked before-and-after goal states.
lemma glue {n : ℕ} [NeZero n] (t : ℕ) : (step^[t] (initial n)) = (fun i => z2b ((zstep^[t] (zinit n)).1 i), (zstep^[t] (zinit n)).2) := by …Mentions: Imo1993P6.step, Imo1993P6.initial, Imo1993P6.z2b, Imo1993P6.zstep, Imo1993P6.zinit
- def
Imo1993P6.lastiThe last index ofFin nline 441 sourceSource documentation
The last index of
Fin n.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,FinProof uses:
Fin.mk,HSub.hSub,OfNat.ofNat8 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
def lasti (n : ℕ) [NeZero n] : Fin n := ⟨n - 1, by have := NeZero.pos n; lia⟩
- lemma
Imo1993P6.lasti_valline 443 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq, Imo1993P6.lasti,HSub.hSub,OfNat.ofNatProof uses:
rfl9 instances, coercions and auxiliary constants left out.
- lemma
Imo1993P6.zero_sub_one_eq_lastiline 445 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq,Fin,HSub.hSub,OfNat.ofNat, Imo1993P6.lastiProof uses:
LT.lt,NeZero.pos,Fin.NatCast.instNatCast,Fin.ext,id,Eq.mpr,HMod.hMod,congrArg,Fin.val_natCast,Nat.mod_eq_of_lt,Eq.refl,HAdd.hAdd,propext,sub_eq_iff_eq_add,Fin.instAddMonoidWithOne,Eq.symm,Nat.cast_add_one,Fin.natCast_self41 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
- def
Imo1993P6.LOne full round of the process:L x p = x last + ∑_{i ≤ p} x iinZMod 2line 458 sourceSource documentation
One full round of the process:
L x p = x last + ∑_{i ≤ p} x iinZMod 2.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,ZMod,OfNat.ofNatProof uses:
HAdd.hAdd, Imo1993P6.lasti,Finset.sum,Finset.range,Fin.mk,HMod.hMod20 instances, coercions and auxiliary constants left out.
def L {n : ℕ} [NeZero n] (x : Fin n → ZMod 2) : Fin n → ZMod 2 := … - def
Imo1993P6.totTotal parity of a lamp vector line 462 sourceSource documentation
Total parity of a lamp vector.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,ZMod,OfNat.ofNatProof uses:
Finset.sum,Finset.univ9 instances, coercions and auxiliary constants left out.
def tot {n : ℕ} (x : Fin n → ZMod 2) : ZMod 2 := ∑ i, x i - def
Imo1993P6.eFnThe vector with only the last lamp on line 465 sourceSource documentation
The vector with only the last lamp on.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,ZMod,OfNat.ofNatProof uses:
ite,Eq, Imo1993P6.lasti20 instances, coercions and auxiliary constants left out.
def eFn (n : ℕ) [NeZero n] : Fin n → ZMod 2 := fun j => if j = lasti n then 1 else 0
Mentions: Imo1993P6.lasti
- lemma
Imo1993P6.L_applyline 467 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,ZMod,OfNat.ofNat,Eq, Imo1993P6.L,HAdd.hAdd, Imo1993P6.lasti,Finset.sum,Finset.range,Fin.mk,HMod.hMod,Nat.mod_lt,NeZero.posProof uses:
rfl22 instances, coercions and auxiliary constants left out.
- lemma
Imo1993P6.L_addline 471 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,ZMod,OfNat.ofNat,Eq, Imo1993P6.L,HAdd.hAddProof uses:
funext,Eq.mpr, Imo1993P6.lasti,Finset.sum,Finset.range,Fin.mk,HMod.hMod,Nat.mod_lt,NeZero.pos,id,congrFun',congrArg,Eq.trans,Finset.sum_congr,Eq.refl,Finset,Membership.mem,Finset.sum_add_distrib,Mathlib.Tactic.Ring.of_eq,HMul.hMuland 9 more50 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.tot_addline 477 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,ZMod,OfNat.ofNat,Eq, Imo1993P6.tot,HAdd.hAddProof uses:
of_eq_true,Finset.sum,Finset.univ,Eq.trans,True,congrFun',congrArg,Finset.sum_congr,Eq.refl,Finset,Membership.mem,Finset.sum_add_distrib,eq_self28 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.tot_eqline 480 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,ZMod,OfNat.ofNat,Eq, Imo1993P6.tot,Finset.sum,Finset.range,Fin.mk,HMod.hMod,Nat.mod_lt,NeZero.posProof uses:
Finset.univ,Fin.sum_univ_eq_sum_range,Eq.mpr,id,congrArg,Imo1993P6.tot.eq_1,Eq.symm,Finset.sum_congr,rfl,Finset,Membership.mem,Eq.rec,Eq.refl,Fin.ext,Nat.mod_eq_of_lt,Fin.isLt32 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.eFn_lastiline 489 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq,ZMod,OfNat.ofNat, Imo1993P6.eFn, Imo1993P6.lastiProof uses:
of_eq_true,Eq.trans,True,congrFun',congrArg,ite_eq_left_of_eq_true,Fin,eq_self28 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.tot_eFnline 492 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq,ZMod,OfNat.ofNat, Imo1993P6.tot, Imo1993P6.eFnProof uses:
id,Eq.mpr,Finset.sum,Fin,Finset.univ,ite, Imo1993P6.lasti,Membership.mem,Finset,congrArg,Finset.sum_ite_eq',of_eq_true,Eq.trans,True,congrFun',ite_eq_left_of_eq_true,eq_self38 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.L_eFnline 497 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq,Fin,ZMod,OfNat.ofNat, Imo1993P6.L, Imo1993P6.eFn,HAdd.hAddProof uses:
funext,Eq.mpr, Imo1993P6.lasti,Finset.sum,Finset.range,Fin.mk,HMod.hMod,Nat.mod_lt,NeZero.pos,id,congrArg, Imo1993P6.L_apply, Imo1993P6.eFn_lasti,ite,HSub.hSub,Membership.mem,Finset,LT.lt,Fin.isLt,Eq.mpand 15 more61 instances, coercions and auxiliary constants left out.
Tactic trace: 36 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.roundInvline 530 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,ZMod,OfNat.ofNat,LE.le,Eq,Prod.fst,Nat.iterate,Prod, Imo1993P6.zstep,Prod.mk,ite,LT.lt, Imo1993P6.LProof uses:
Nat.recAux,funext,id,Eq.mpr,congrArg,ite_eq_right,Nat.not_lt_zero,Eq.refl,HAdd.hAdd,Nat.succ,Function.iterate_succ_apply',Prod.snd,Fin.NatCast.instNatCast, Imo1993P6.pos_lemma,Function.update,HSub.hSub,congrFun',congr,zero_add,Fin.instAddMonoidWithOneand 47 more67 instances, coercions and auxiliary constants left out.
Tactic trace: 67 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.roundOne full round of the process appliesLand returns to position0line 591 sourceSource documentation
One full round of the process applies
Land returns to position0.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,ZMod,OfNat.ofNat,Eq,Prod,Nat.iterate, Imo1993P6.zstep,Prod.mk, Imo1993P6.LProof uses:
Prod.ext,Eq.mpr,Prod.fst,ite,LT.lt,id,congrArg, Imo1993P6.roundInv,le_refl,funext,ite_eq_left,Fin.isLt,Eq.refl,Prod.snd,HAdd.hAdd,Fin.NatCast.instNatCast, Imo1993P6.pos_lemma,Fin.natCast_self,Fin.instAddMonoidWithOne,add_zero21 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
lemma round {n : ℕ} [NeZero n] (x : Fin n → ZMod 2) : zstep^[n] (x, 0) = (L x, (0 : Fin n)) := by …Mentions: Imo1993P6.zstep, Imo1993P6.L
- lemma
Imo1993P6.auxline 600 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq,Prod,Fin,ZMod,OfNat.ofNat,Nat.iterate, Imo1993P6.zstep, Imo1993P6.zinit,Prod.mk, Imo1993P6.LProof uses:
Nat.recAux,Eq.refl,Eq.mpr,HAdd.hAdd,id,congrArg,Nat.succ,Function.iterate_succ_apply', Imo1993P6.round26 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- def
Imo1993P6.catConcatenation of two lamp vectors line 610 sourceSource documentation
Concatenation of two lamp vectors.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,ZMod,OfNat.ofNat,HAdd.hAddProof uses:
dite,LT.lt,Fin.mk,Not,HSub.hSub12 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
def cat {n : ℕ} (y z : Fin n → ZMod 2) : Fin (n + n) → ZMod 2 := … - lemma
Imo1993P6.tot_catline 613 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,ZMod,OfNat.ofNat,Eq, Imo1993P6.tot,HAdd.hAdd, Imo1993P6.catProof uses:
NeZero.mk,Ne,NeZero.ne,Eq.mpr,Finset.sum,Finset.range,Fin.mk,HMod.hMod,Nat.mod_lt,NeZero.pos,id,congrArg, Imo1993P6.tot_eq,Finset.sum_range_add,Finset.sum_congr,rfl,Finset,Membership.mem,Eq.mp,LT.ltand 12 more46 instances, coercions and auxiliary constants left out.
Tactic trace: 39 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.catLline 658 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,ZMod,OfNat.ofNat,Eq,HAdd.hAdd, Imo1993P6.L, Imo1993P6.cat, Imo1993P6.lasti, Imo1993P6.totProof uses:
NeZero.mk,Ne,NeZero.ne,funext,Eq.mpr,Finset.sum,Finset.range,Fin.mk,HMod.hMod,Nat.mod_lt,NeZero.pos,id,congrArg, Imo1993P6.L_apply,dite,LT.lt,Not,HSub.hSub,dite_eq_right, Imo1993P6.lasti_val and 26 more78 instances, coercions and auxiliary constants left out.
Tactic trace: 100 steps
Open to load the checked before-and-after goal states.
- def
Imo1993P6.Aline 761 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZeroProof uses:
Eq,Fin,ZMod,OfNat.ofNat,Nat.iterate, Imo1993P6.L,HSub.hSub, Imo1993P6.eFn15 instances, coercions and auxiliary constants left out.
- def
Imo1993P6.Bline 763 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZeroProof uses:
LE.le,HSub.hSub,OfNat.ofNat,Eq,ZMod, Imo1993P6.tot,Nat.iterate,Fin, Imo1993P6.L21 instances, coercions and auxiliary constants left out.
- def
Imo1993P6.Cline 766 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZeroProof uses:
LE.le,HSub.hSub,OfNat.ofNat,Eq,ZMod,Nat.iterate,Fin, Imo1993P6.L, Imo1993P6.lasti16 instances, coercions and auxiliary constants left out.
- def
Imo1993P6.DLampn-2is off at every positive roundm ≤ n-1line 770 sourceSource documentation
Lamp
n-2is off at every positive roundm ≤ n-1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZeroProof uses:
LE.le,OfNat.ofNat,HSub.hSub,Eq,ZMod,Nat.iterate,Fin, Imo1993P6.L,Fin.mk22 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
def D (n : ℕ) [NeZero n] : Prop := …
- lemma
Imo1993P6.base_caseline 773 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
And, Imo1993P6.A,OfNat.ofNat,Nat, Imo1993P6.B, Imo1993P6.C, Imo1993P6.DProof uses:
And.intro,id,of_decide_eq_true,Eq,Fin,ZMod,Nat.iterate, Imo1993P6.L,HSub.hSub, Imo1993P6.eFn,Bool,Decidable.decide,Bool.true,Eq.refl,LE.le, Imo1993P6.tot,Eq.symm,dite, Imo1993P6.lasti,le_antisymmand 10 more30 instances, coercions and auxiliary constants left out.
Tactic trace: 23 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1993P6.stepLemmaline 791 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,LE.le,OfNat.ofNat, Imo1993P6.A, Imo1993P6.B, Imo1993P6.C, Imo1993P6.D,And,HAdd.hAddProof uses:
NeZero.mk,Ne,NeZero.ne,HSub.hSub,Eq,Fin,ZMod,Nat.iterate, Imo1993P6.L, Imo1993P6.cat,Nat.recAux,funext,id,dite,LT.lt,Fin.mk,Not,Eq.mpr,congrArg,dite_eq_leftand 38 more95 instances, coercions and auxiliary constants left out.
Tactic trace: 237 steps (first 200 of 237)
Open to load the checked before-and-after goal states.
- theorem
Imo1993P6.coreline 983 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,NeZero,Eq,HPow.hPow,And, Imo1993P6.A, Imo1993P6.B, Imo1993P6.C, Imo1993P6.DProof uses:
Nat.recAux,absurd,of_decide_eq_true,Not,id,Bool,Decidable.decide,Bool.true,Eq.refl,HAdd.hAdd,Nat.casesAuxOn, Imo1993P6.base_case,Eq.symm,Eq.mp,congrArg,pow_one,NeZero.mk,pow_ne_zero,Ne,rfland 9 more54 instances, coercions and auxiliary constants left out.
Tactic trace: 20 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1993P6.last_lamp_only_of_two_powline 1002 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,LT.lt,OfNat.ofNat,Eq,HPow.hPow,Fin,Bool, Imo1993P6.lampsAfter,HMul.hMul,HSub.hSub,Decidable.decideProof uses: Imo1993P6.A,
And.left,And, Imo1993P6.B, Imo1993P6.C, Imo1993P6.D, Imo1993P6.core,rfl,id,Prod.fst,Nat.iterate, Imo1993P6.State, Imo1993P6.step, Imo1993P6.initial, Imo1993P6.z2b,ZMod,Prod, Imo1993P6.zstep, Imo1993P6.zinit,congrFunand 36 more46 instances, coercions and auxiliary constants left out.
Tactic trace: 20 steps
Open to load the checked before-and-after goal states.
- def
Imo1993P6.cStateVecState of then'+1-lamp process of "shifted" form: lamp 0 off, lamp 1 on, and lamps2..n'given by the vectorxonFin n'line 1029 sourceSource documentation
State of the
n'+1-lamp process of "shifted" form: lamp 0 off, lamp 1 on, and lamps2..n'given by the vectorxonFin n'.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,ZMod,OfNat.ofNat,HAdd.hAddProof uses:
ite,Eq,dite,LE.le,Fin.mk,HSub.hSub,Not30 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
def cStateVec {n' : ℕ} [NeZero n'] (x : Fin n' → ZMod 2) : Fin (n' + 1) → ZMod 2 := … - lemma
Imo1993P6.LcStateDocumented declaration: LcState line 1036 sourceSource documentation
One round of the
n'+1-process maps a shifted state to the shifted state ofL x, providedx's last-but-one lamp is off (so lamp 0 stays off) andx's last lamp is on (so lamp 2's wrap-around toggle matches lamp 0 of then'-process).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,HAdd.hAdd,OfNat.ofNat,LE.le,Fin,ZMod,Eq,Fin.mk,HSub.hSub, Imo1993P6.lasti, Imo1993P6.L, Imo1993P6.cStateVecProof uses:
funext,Eq.mpr,Finset.sum,Finset.range,HMod.hMod,Nat.mod_lt,NeZero.pos,id,congrArg, Imo1993P6.L_apply,ite,dite,Not,ite_eq_right,dite_eq_left,LT.lt,Fin.ext,Eq.refl,zero_add,Nat.zero_modand 23 more90 instances, coercions and auxiliary constants left out.
Tactic trace: 92 steps
Open to load the checked before-and-after goal states.
lemma LcState {n' : ℕ} [NeZero n'] [NeZero (n' + 1)] (h2 : 2 ≤ n') (x : Fin n' → ZMod 2) (hα : x ⟨n' - 2, by have := NeZero.pos n'; lia⟩ = 0) (hβ : x (lasti n') = 1) : …Mentions: Imo1993P6.lasti
- lemma
Imo1993P6.L_oneOne round from the all-on state gives the alternating vector line 1116 sourceSource documentation
One round from the all-on state gives the alternating vector.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq,Fin,ZMod,OfNat.ofNat, Imo1993P6.LProof uses:
funext,Eq.mpr,HAdd.hAdd,Finset.sum,Finset.range,id,congrArg, Imo1993P6.L_apply,Membership.mem,Finset,Fin.mk,HMod.hMod,Nat.mod_lt,NeZero.pos,rfl,Finset.sum_congr,HSMul.hSMul,Finset.card,Finset.sum_const,Finset.card_rangeand 9 more62 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
lemma L_one {n : ℕ} [NeZero n] : L ((fun _ => (1 : ZMod 2)) : Fin n → ZMod 2) = fun p => (p.val : ZMod 2) := by …Mentions: Imo1993P6.L
- lemma
Imo1993P6.invCThe round-level invariant of part (c): aftermrounds (1 ≤ m ≤ 2^k - 1), the(2^k+1)-process is in shifted form line 1129 sourceSource documentation
The round-level invariant of part (c): after
mrounds (1 ≤ m ≤ 2^k - 1), the(2^k+1)-process is in shifted form.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,HSub.hSub,HPow.hPow,Eq,Fin,HAdd.hAdd,ZMod,Nat.iterate, Imo1993P6.L, Imo1993P6.cStateVecProof uses:
NeZero,NeZero.mk,pow_ne_zero,of_decide_eq_true,Ne,id,Bool,Decidable.decide,Bool.true,Eq.refl,ne_of_gt,add_pos',pow_pos,Mathlib.Meta.Positivity.pos_of_isNat,Mathlib.Meta.NormNum.isNat_ofNat,Nat.ble,And, Imo1993P6.A, Imo1993P6.B, Imo1993P6.C and 33 more103 instances, coercions and auxiliary constants left out.
Tactic trace: 51 steps
Open to load the checked before-and-after goal states.
lemma invC (k : ℕ) (hk : 1 ≤ k) : ∀ m, 1 ≤ m → m ≤ 2 ^ k - 1 → L^[m] ((fun _ => (1 : ZMod 2)) : Fin (2 ^ k + 1) → ZMod 2) = cStateVec (L^[m] ((fun _ => (1 : ZMod 2)) : Fin (2 ^ k) → ZMod 2)) := by …Mentions: Imo1993P6.L, Imo1993P6.cStateVec
- lemma
Imo1993P6.cState_eFnThe shifted state ofeFn (2^k)is exactly "only lamp 1 on" line 1178 sourceSource documentation
The shifted state of
eFn (2^k)is exactly "only lamp 1 on".standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Eq,Fin,HAdd.hAdd,HPow.hPow,ZMod, Imo1993P6.cStateVec, Imo1993P6.eFn,iteProof uses:
NeZero,NeZero.mk,pow_ne_zero,of_decide_eq_true,Ne,id,Bool,Decidable.decide,Bool.true,Eq.refl,ne_of_gt,add_pos',pow_pos,Mathlib.Meta.Positivity.pos_of_isNat,Mathlib.Meta.NormNum.isNat_ofNat,Nat.ble,Nat.le_pow,funext,dite,Fin.mkand 13 more87 instances, coercions and auxiliary constants left out.
Tactic trace: 25 steps
Open to load the checked before-and-after goal states.
lemma cState_eFn (k : ℕ) (hk : 1 ≤ k) : cStateVec (eFn (2 ^ k)) = fun i => if i.val = 1 then (1 : ZMod 2) else 0 := by …Mentions: Imo1993P6.cStateVec, Imo1993P6.eFn
- theorem
Imo1993P6.lamp1_only_of_two_pow_add_oneline 1200 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,LT.lt,OfNat.ofNat,Eq,HAdd.hAdd,HPow.hPow,Fin,Bool, Imo1993P6.lampsAfter,HMul.hMul,HSub.hSub,Decidable.decideProof uses:
LE.le,And, Imo1993P6.A, Imo1993P6.B, Imo1993P6.C, Imo1993P6.D, Imo1993P6.core,rfl,Nat.le_pow,ZMod,Nat.iterate, Imo1993P6.L, Imo1993P6.cStateVec, Imo1993P6.invC,le_refl,id,Prod.fst, Imo1993P6.State, Imo1993P6.step, Imo1993P6.initial and 36 more56 instances, coercions and auxiliary constants left out.
Tactic trace: 22 steps
Open to load the checked before-and-after goal states.
- problem
Imo1993P6.imo1993_p6_aline 1226 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,LT.lt,OfNat.ofNat,Exists,And,Fin,Eq,Bool, Imo1993P6.lampsAfter,Bool.trueProof uses: Imo1993P6.State,
Nat.iterate, Imo1993P6.step, Imo1993P6.initial, Imo1993P6.step_periodic,Exists.intro,And.intro,id,Eq.mpr,Prod.fst,congrArg,Eq.refl10 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- problem
Imo1993P6.imo1993_p6_bline 1233 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq,HPow.hPow,OfNat.ofNat,LT.lt,Fin,Bool, Imo1993P6.lampsAfter,HSub.hSub,Bool.trueProof uses:
LE.le,Trans.trans,Eq.symm,pow_one,Nat.pow_le_pow_right,Mathlib.Meta.NormNum.isNat_lt_true,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refl,Bool.false, Imo1993P6.all_on_of_last_only, Imo1993P6.last_lamp_only_of_two_pow27 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- problem
Imo1993P6.imo1993_p6_cline 1242 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq,HAdd.hAdd,HPow.hPow,OfNat.ofNat,LT.lt,Fin,Bool, Imo1993P6.lampsAfter,HSub.hSub,Bool.trueProof uses:
LE.le,Trans.trans,Eq.symm,pow_one,Nat.pow_le_pow_right,Mathlib.Meta.NormNum.isNat_lt_true,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refl,Bool.false, Imo1993P6.all_on_of_lamp1_only, Imo1993P6.lamp1_only_of_two_pow_add_one31 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.