Compfiles/Imo1962P1.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
15 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 1962, Problem 1
Find the smallest natural number $n$ which has the following properties:
(a) Its decimal representation has 6 as the last digit.
(b) If the last digit 6 is erased and placed in front of the remaining digits, the resulting number is four times as large as the original number $n$.
Imported by 1 file
- def
Imo1962P1.ProblemPredicateline 36 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
And,Eq,List.headI,Nat.digits,OfNat.ofNat,Nat.ofDigits,List.concat,List.tail,HMul.hMul5 instances, coercions and auxiliary constants left out.
- abbrev
Imo1962P1.ProblemPredicate'line 44 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
And,Eq,HAdd.hAdd,HMul.hMul,OfNat.ofNat,HPow.hPow,List.length,Nat.digits9 instances, coercions and auxiliary constants left out.
- theorem
Imo1962P1.without_digitsline 47 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo1962P1.ProblemPredicate,Exists, Imo1962P1.ProblemPredicate'Proof uses:
Exists.intro,HDiv.hDiv,OfNat.ofNat,Nat.casesAuxOn,Eq,Not,of_eq_true,Eq.trans,True,False,congrArg,And,List.headI,Nat.digits,Nat.ofDigits,List.concat,List.tail,HMul.hMul,congr,congrFun'and 45 more36 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1962P1.case_0_digitline 64 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,List.length,Nat.digits,OfNat.ofNat,Not, Imo1962P1.ProblemPredicate'Proof uses:
HAdd.hAdd,HMul.hMul,HPow.hPow,Eq.mpr,id,congrArg,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1962P1.case_1_digitline 69 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,List.length,Nat.digits,OfNat.ofNat,Not, Imo1962P1.ProblemPredicate'Proof uses:
HAdd.hAdd,HMul.hMul,HPow.hPow,Eq.mpr,id,congrArg,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1962P1.case_2_digitline 74 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,List.length,Nat.digits,OfNat.ofNat,Not, Imo1962P1.ProblemPredicate'Proof uses:
HAdd.hAdd,HMul.hMul,HPow.hPow,Eq.mpr,id,congrArg,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1962P1.case_3_digitline 79 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,List.length,Nat.digits,OfNat.ofNat,Not, Imo1962P1.ProblemPredicate'Proof uses:
HAdd.hAdd,HMul.hMul,HPow.hPow,Eq.mpr,id,congrArg,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1962P1.case_4_digitline 84 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,List.length,Nat.digits,OfNat.ofNat,Not, Imo1962P1.ProblemPredicate'Proof uses:
HAdd.hAdd,HMul.hMul,HPow.hPow,Eq.mpr,id,congrArg,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1962P1.helper_5_digitPutting this inline causes a deep recursion error, so we separate it out line 90 sourceSource documentation
Putting this inline causes a deep recursion error, so we separate it out.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Int,Eq,HAdd.hAdd,HMul.hMul,OfNat.ofNat,HPow.hPow,NatProof uses:
Mathlib.Tactic.Linarith.eq_of_not_lt_of_not_gt,Not.intro,LT.lt,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,Neg.neg,HSub.hSub,congrArg,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Nat.rawCast,Mathlib.Meta.NormNum.instAddMonoidWithOne,inferInstance,Ring,Int.rawCast,Int.negOfNat,Mathlib.Tactic.Ring.Common.mul_congr,Mathlib.Tactic.Ring.cast_pos,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refland 64 more80 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
theorem helper_5_digit {c : ℤ} (h : 6 * 10 ^ 5 + c = 4 * (10 * c + 6)) : c = 15384 := by linarithMentions: h
- theorem
Imo1962P1.case_5_digitline 92 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,List.length,Nat.digits,OfNat.ofNat, Imo1962P1.ProblemPredicate'Proof uses:
HAdd.hAdd,HMul.hMul,HPow.hPow,Eq.mpr,id,congrArg,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1962P1.case_more_digitslinarithfails on numbers this large, so this lemma spells out some of the arithmetic that normally would be automated line 100 sourceSource documentation
linarithfails on numbers this large, so this lemma spells out some of the arithmetic that normally would be automated.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,GE.ge,List.length,Nat.digits,OfNat.ofNat, Imo1962P1.ProblemPredicate'Proof uses:
Ne,Eq,of_eq_true,Eq.trans,True,congrFun',congrArg,List,List.nil,Nat.digits_zero,eq_self, Imo1962P1.case_0_digit,Trans.trans,HPow.hPow,HMul.hMul,Nat.le.intro,Eq.symm,HAdd.hAdd,And.left,Nat.base_pow_length_digits_leand 17 more32 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
theorem case_more_digits {c n : ℕ} (h1 : (digits 10 c).length ≥ 6) (h2 : ProblemPredicate' c n) : n ≥ 153846 := by …Mentions: Imo1962P1.ProblemPredicate'
- theorem
Imo1962P1.satisfied_by_153846line 116 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Imo1962P1.ProblemPredicate,
OfNat.ofNat,NatProof uses:
Eq.mpr,Eq,Nat.ofDigits,List.cons,List.nil,id,Eq.trans,And,List.headI,Nat.digits,List.concat,List.tail,HMul.hMul,True,congr,congrArg,congrFun',List,HMod.hMod,HDiv.hDivand 21 more20 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1962P1.no_smaller_solutionsline 120 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Imo1962P1.ProblemPredicate,GE.ge,OfNat.ofNatProof uses:
Exists, Imo1962P1.ProblemPredicate', Imo1962P1.without_digits,Or,LT.lt,List.length,Nat.digits,lt_or_ge,Eq,Or.inl,dite,LE.le, Imo1962P1.case_5_digit,HAdd.hAdd,HMul.hMul,Eq.rec,And.left,HPow.hPow,Nat.le_of_eq,Eq.symmand 17 more20 instances, coercions and auxiliary constants left out.
Tactic trace: 25 steps
Open to load the checked before-and-after goal states.
- determine
Imo1962P1.solutionline 138 sourceno axioms what this means
Statement uses:
NatProof uses:
OfNat.ofNat1 instances, coercions and auxiliary constants left out.
- problem
Imo1962P1.imo1962_p1IMO 1962 Problem 1: moving the last digit 6 to the front line 140 sourceL4DEL explanation
The smallest natural number ending in 6 whose value becomes four times larger when that 6 is moved to the front is 153846.
- Problem: find the smallest natural n whose last digit is 6 and such that moving that 6 to the front gives 4n. The statement is IsLeast {n | ProblemPredicate n} solution, where the answer solution is declared as 153846.
- Solution (complete, no sorry): write n = 10c + 6 so the condition becomes 6 * 10^(number of digits of c) + c = 4n.
- Cases on the digit count of c: zero to four digits are impossible, five digits forces c = 15384, and six or more digits give nothing smaller. A separate lemma checks that 153846 satisfies the condition.
See also: Imo1960P1.imo1960_p1
Sources and attribution: Pinned Lean source (47b19bbfe5f3)
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
IsLeast,Nat,Set.ofPred, Imo1962P1.ProblemPredicate, Imo1962P1.solutionProof uses:
And.intro,Membership.mem,Set,lowerBounds, Imo1962P1.satisfied_by_153846, Imo1962P1.no_smaller_solutions3 instances, coercions and auxiliary constants left out.
problem imo1962_p1 : IsLeast {n | ProblemPredicate n} solution := …Mentions: Imo1962P1.ProblemPredicate, Imo1962P1.solution