Compfiles/Imo2008P5.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
11 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 2008, Problem 5
Let n and k be positive integers with k ≥ n and k - n an even number. There are 2n lamps labelled 1, 2, ..., 2n each of which can be either on or off. Initially all the lamps are off. We consider sequences of steps: at each step one of the lamps is switched (from on to off or from off to on). Let N be the number of such sequences consisting of k steps and resulting in the state where lamps 1 through n are all on, and lamps n + 1 through 2n are all off. Let M be the number of such sequences consisting of k steps, resulting in the state where lamps 1 through n are all on, and lamps n + 1 through 2n are all off, but where none of the lamps n + 1 through 2n is ever switched on.
Determine N/M.
Imported by 1 file
- abbrev
Imo2008P5.Sequenceline 37 sourceno axioms what this means
Statement uses:
NatProof uses:
Fin,HMul.hMul,OfNat.ofNat3 instances, coercions and auxiliary constants left out.
- abbrev
Imo2008P5.NSequenceline 39 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2008P5.SequenceProof uses:
And,LT.lt,Odd,Nat.card,Fin,Set.ofPred,Eq,HMul.hMul,OfNat.ofNat,LE.le,Even9 instances, coercions and auxiliary constants left out.
- abbrev
Imo2008P5.MSequenceline 43 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo2008P5.SequenceProof uses:
And, Imo2008P5.NSequence,Fin,HMul.hMul,OfNat.ofNat,LE.le,Ne5 instances, coercions and auxiliary constants left out.
- lemma
Imo2008P5.fiber_ncard_of_mod_nIf g reduces f mod n (mapping [0,n) to itself and [n,2n) to [0,n) by subtracting n), then the fiber of g at i < n is the disjoint union of the fibers of f at i and n+i line 59 sourceSource documentation
If g reduces f mod n (mapping [0,n) to itself and [n,2n) to [0,n) by subtracting n), then the fiber of g at i < n is the disjoint union of the fibers of f at i and n+i.
private lemma fiber_ncard_of_mod_n {n k : ℕ} {f g : Fin k → Fin (2 * n)} (hg : ∀ j, (g j).val = if (f j).val < n then (f j).val else (f j).val - n) (i : ℕ) (hi : i < n) : Set.ncard {j | (g j).val = i} = Set.ncard {j | (f j).val = i} + Set.ncard {j | (f j).val = n + i} := by …Mentions: f
- def
Imo2008P5.ψline 71 source - lemma
Imo2008P5.symmDiff_singleton_card_parityline 106 source - lemma
Imo2008P5.even_subsets_cardline 120 source - lemma
Imo2008P5.claimline 155 source - lemma
Imo2008P5.lemma1line 398 source - determine
Imo2008P5.solutionline 425 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,RatProof uses:
HPow.hPow,OfNat.ofNat,HSub.hSub5 instances, coercions and auxiliary constants left out.
- problem
Imo2008P5.imo2008_p5line 427 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,LE.le,Even,HSub.hSub,Eq,Rat,HMul.hMul,Set.ncard, Imo2008P5.Sequence, Imo2008P5.MSequence, Imo2008P5.solution, Imo2008P5.NSequenceProof uses:
Set.Finite,Set.ofPred,Set.toFinite,Fin,Membership.mem,Set,HPow.hPow,Eq.mpr,id,congrArg,Eq.symm,Eq.trans,Nat.cast_mul,Nat.cast_pow,Eq.refl45 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.