Compfiles/Imo1962P1.lean

GitHub source file

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$.

Imports (2)
Imported by 1 file
  1. def Imo1962P1.ProblemPredicate line 36 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat

    Proof uses: And, Eq, List.headI, Nat.digits, OfNat.ofNat, Nat.ofDigits, List.concat, List.tail, HMul.hMul

    5 instances, coercions and auxiliary constants left out.

  2. abbrev Imo1962P1.ProblemPredicate' line 44 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat

    Proof uses: And, Eq, HAdd.hAdd, HMul.hMul, OfNat.ofNat, HPow.hPow, List.length, Nat.digits

    9 instances, coercions and auxiliary constants left out.

  3. theorem Imo1962P1.without_digits line 47 source

    standard 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 more

    36 instances, coercions and auxiliary constants left out.

    Tactic trace: 12 steps

    Open to load the checked before-and-after goal states.

  4. theorem Imo1962P1.case_0_digit line 64 source

    standard 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.refl

    11 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

    Open to load the checked before-and-after goal states.

  5. theorem Imo1962P1.case_1_digit line 69 source

    standard 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.refl

    11 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

    Open to load the checked before-and-after goal states.

  6. theorem Imo1962P1.case_2_digit line 74 source

    standard 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.refl

    11 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

    Open to load the checked before-and-after goal states.

  7. theorem Imo1962P1.case_3_digit line 79 source

    standard 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.refl

    11 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

    Open to load the checked before-and-after goal states.

  8. theorem Imo1962P1.case_4_digit line 84 source

    standard 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.refl

    11 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

    Open to load the checked before-and-after goal states.

  9. theorem Imo1962P1.helper_5_digit Putting this inline causes a deep recursion error, so we separate it out line 90 source

    Source 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, Nat

    Proof 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.refl and 64 more

    80 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 linarith

    Mentions: h

  10. theorem Imo1962P1.case_5_digit line 92 source

    standard 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.refl

    11 instances, coercions and auxiliary constants left out.

    Tactic trace: 3 steps

    Open to load the checked before-and-after goal states.

  11. theorem Imo1962P1.case_more_digits linarith fails on numbers this large, so this lemma spells out some of the arithmetic that normally would be automated line 100 source

    Source documentation

    linarith fails 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_le and 17 more

    32 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'

  12. theorem Imo1962P1.satisfied_by_153846 line 116 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Imo1962P1.ProblemPredicate, OfNat.ofNat, Nat

    Proof 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.hDiv and 21 more

    20 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

    Open to load the checked before-and-after goal states.

  13. theorem Imo1962P1.no_smaller_solutions line 120 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Imo1962P1.ProblemPredicate, GE.ge, OfNat.ofNat

    Proof 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.symm and 17 more

    20 instances, coercions and auxiliary constants left out.

    Tactic trace: 25 steps

    Open to load the checked before-and-after goal states.

  14. determine Imo1962P1.solution line 138 source

    no axioms what this means

    Statement uses: Nat

    Proof uses: OfNat.ofNat

    1 instances, coercions and auxiliary constants left out.

  15. problem Imo1962P1.imo1962_p1 IMO 1962 Problem 1: moving the last digit 6 to the front line 140 source

    L4DEL explanation

    The smallest natural number ending in 6 whose value becomes four times larger when that 6 is moved to the front is 153846.

    1. 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.
    2. Solution (complete, no sorry): write n = 10c + 6 so the condition becomes 6 * 10^(number of digits of c) + c = 4n.
    3. 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.solution

    Proof uses: And.intro, Membership.mem, Set, lowerBounds, Imo1962P1.satisfied_by_153846, Imo1962P1.no_smaller_solutions

    3 instances, coercions and auxiliary constants left out.

    problem imo1962_p1 : IsLeast {n | ProblemPredicate n} solution :=
    …

    Mentions: Imo1962P1.ProblemPredicate, Imo1962P1.solution