Compfiles/Imo1960P1.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

13 declarations, 0 contain sorry, 0 declared as axioms

International Mathematical Olympiad 1960, Problem 1

Determine all three-digit numbers N having the property that N is divisible by 11, and N/11 is equal to the sum of the squares of the digits of N.

Imports (2)
Imported by 1 file
  1. def Imo1960P1.sumOfSquares line 31 source

    standard axioms: propext what this means

    Statement uses: List, Nat

    Proof uses: List.sum, List.map, HMul.hMul

    5 instances, coercions and auxiliary constants left out.

  2. def Imo1960P1.ProblemPredicate line 34 source

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

    Statement uses: Nat

    Proof uses: And, Eq, List.length, Nat.digits, OfNat.ofNat, Dvd.dvd, HDiv.hDiv, Imo1960P1.sumOfSquares

    4 instances, coercions and auxiliary constants left out.

  3. determine Imo1960P1.SolutionPredicate line 37 source

    no axioms what this means

    Statement uses: Nat

    Proof uses: Or, Eq, OfNat.ofNat

    1 instances, coercions and auxiliary constants left out.

  4. theorem Imo1960P1.not_zero Proving that three digit numbers are the ones in [100, 1000) line 45 source

    Source comment

    Proving that three digit numbers are the ones in [100, 1000).

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

    Statement uses: Nat, Imo1960P1.ProblemPredicate, Ne, OfNat.ofNat

    Proof uses: List, Nat.digits, List.nil, List.ne_nil_of_length_eq_add_one, And.left, Eq, List.length, And, Dvd.dvd, HDiv.hDiv, Imo1960P1.sumOfSquares, Iff.mp, Nat.digits_ne_nil_iff_ne_zero

    5 instances, coercions and auxiliary constants left out.

    theorem not_zero {n : ℕ} (h1 : ProblemPredicate n) : n ≠ 0 :=
    …

    Mentions: Imo1960P1.ProblemPredicate

  5. theorem Imo1960P1.ge_100 line 49 source

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

    Statement uses: Nat, Imo1960P1.ProblemPredicate, LE.le, OfNat.ofNat

    Proof uses: HPow.hPow, HMul.hMul, Eq.mpr, List.length, Nat.digits, id, Eq, congrArg, Eq.symm, And.left, And, Dvd.dvd, HDiv.hDiv, Imo1960P1.sumOfSquares, Nat.base_pow_length_digits_le, of_eq_true, LT.lt, Imo1960P1.not_zero, le_of_not_gt, Mathlib.Tactic.Linarith.lt_irrefl and 73 more

    86 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

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

  6. theorem Imo1960P1.lt_1000 line 56 source

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

    Statement uses: Nat, Imo1960P1.ProblemPredicate, LT.lt, OfNat.ofNat

    Proof uses: HPow.hPow, Eq.mpr, List.length, Nat.digits, id, Eq, congrArg, Eq.symm, And.left, And, Dvd.dvd, HDiv.hDiv, Imo1960P1.sumOfSquares, Nat.lt_base_pow_length_digits', lt_of_not_ge, LE.le, Mathlib.Tactic.Linarith.lt_irrefl, Int, Eq.mp, HAdd.hAdd and 60 more

    73 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

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

  7. def Imo1960P1.SearchUpTo We do an exhaustive search to show that all results are covered by SolutionPredicate line 65 source

    Source comment

    We do an exhaustive search to show that all results are covered by `SolutionPredicate`.

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

    Statement uses: Nat

    Proof uses: And, Eq, HMul.hMul, OfNat.ofNat, LT.lt, Imo1960P1.ProblemPredicate, Imo1960P1.SolutionPredicate

    4 instances, coercions and auxiliary constants left out.

    def SearchUpTo (c n : ℕ) : Prop :=
    …
  8. theorem Imo1960P1.searchUpTo_start line 68 source

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

    Statement uses: Imo1960P1.SearchUpTo, OfNat.ofNat, Nat

    Proof uses: And.intro, Eq, HMul.hMul, LT.lt, Imo1960P1.ProblemPredicate, Imo1960P1.SolutionPredicate, rfl, False.elim, Mathlib.Tactic.Linarith.lt_irrefl, Int, Eq.mp, HAdd.hAdd, Neg.neg, HSub.hSub, congrArg, Mathlib.Tactic.Ring.of_eq, Mathlib.Tactic.Ring.Common.add_congr, Int.rawCast, inferInstance, Ring and 50 more

    68 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

  9. theorem Imo1960P1.searchUpTo_step line 71 source

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

    Statement uses: Nat, Imo1960P1.SearchUpTo, Eq, HAdd.hAdd, OfNat.ofNat, List, Nat.digits, Imo1960P1.sumOfSquares, Or

    Proof uses: HMul.hMul, LT.lt, Imo1960P1.ProblemPredicate, Imo1960P1.SolutionPredicate, And.intro, Mathlib.Tactic.Ring.of_eq, Nat.rawCast, HPow.hPow, Mathlib.Tactic.Ring.Common.add_congr, Mathlib.Tactic.Ring.Common.mul_congr, Mathlib.Tactic.Ring.Common.atom_pf, rfl, Eq.mpr, id, congrArg, Eq.symm, Eq.refl, Mathlib.Tactic.Ring.cast_pos, Mathlib.Meta.NormNum.isNat_ofNat, Mathlib.Tactic.Ring.Common.add_mul and 32 more

    44 instances, coercions and auxiliary constants left out.

    Tactic trace: 17 steps

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

  10. theorem Imo1960P1.searchUpTo_end line 83 source

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

    Statement uses: Nat, Imo1960P1.SearchUpTo, OfNat.ofNat, Imo1960P1.ProblemPredicate, Imo1960P1.SolutionPredicate

    Proof uses: And.right, Eq, HMul.hMul, LT.lt, lt_of_not_ge, LE.le, Mathlib.Tactic.Linarith.lt_irrefl, Int, Eq.mp, HAdd.hAdd, Neg.neg, HSub.hSub, congrArg, Mathlib.Tactic.Ring.of_eq, Mathlib.Tactic.Ring.Common.add_congr, Nat.rawCast, Mathlib.Meta.NormNum.instAddMonoidWithOne, inferInstance, Ring, HPow.hPow and 50 more

    71 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

  11. theorem Imo1960P1.right_direction line 87 source

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

    Statement uses: Nat, Imo1960P1.ProblemPredicate, Imo1960P1.SolutionPredicate

    Proof uses: Imo1960P1.SearchUpTo, OfNat.ofNat, Imo1960P1.searchUpTo_start, Imo1960P1.searchUpTo_step, Eq.mpr, Eq, HAdd.hAdd, id, congrFun', congrArg, Mathlib.Meta.NormNum.IsNat.to_eq, Mathlib.Meta.NormNum.isNat_add, Eq.refl, Mathlib.Meta.NormNum.isNat_ofNat, Nat.digits, rfl, List, Imo1960P1.sumOfSquares, Or, Not and 32 more

    19 instances, coercions and auxiliary constants left out.

    Tactic trace: 10 steps

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

  12. theorem Imo1960P1.left_direction Now we just need to prove the equivalence, for the precise problem statement line 98 source

    Source comment

    Now we just need to prove the equivalence, for the precise problem statement.

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

    Statement uses: Nat, Imo1960P1.SolutionPredicate, Imo1960P1.ProblemPredicate

    Proof uses: Eq, OfNat.ofNat, And.intro, List.length, Nat.digits, And, Dvd.dvd, HDiv.hDiv, Imo1960P1.sumOfSquares, of_eq_true, Eq.trans, True, congrFun', congrArg, List.cons, List.nil, HAdd.hAdd, List, HMod.hMod, Nat.digits_of_two_le_of_pos and 21 more

    19 instances, coercions and auxiliary constants left out.

    Tactic trace: 6 steps

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

    theorem left_direction (n : ℕ) (spn : SolutionPredicate n) : ProblemPredicate n := by
    …

    Mentions: Imo1960P1.SolutionPredicate, Imo1960P1.ProblemPredicate

  13. problem Imo1960P1.imo1960_p1 line 103 source

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

    Statement uses: Nat, Iff, Imo1960P1.ProblemPredicate, Imo1960P1.SolutionPredicate

    Proof uses: Iff.intro, Imo1960P1.right_direction, Imo1960P1.left_direction