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

5 declarations, 0 contain sorry, 0 declared as axioms

International Mathematical Olympiad 1977, Problem 5

Let $a,b$ be two natural numbers. When we divide $a^2+b^2$ by $a+b$, we get the remainder $r$ and the quotient $q$. Determine all pairs $(a, b)$ for which $q^2 + r = 1977$.

Imports (2)
Imported by 1 file
  1. determine Imo1977P5.solution_set line 31 source

    no axioms what this means

    Statement uses: Set, Prod, Nat

    Proof uses: Insert.insert, Prod.mk, OfNat.ofNat, Singleton.singleton

    3 instances, coercions and auxiliary constants left out.

  2. lemma Imo1977P5.sq_add_sq_eq 1009 is prime and ≡ 1 (mod 4), so its representation as a sum of two squares is unique: 1009 = 15² + 28² line 38 source

    Source documentation

    1009 is prime and ≡ 1 (mod 4), so its representation as a sum of two squares is unique: 1009 = 15² + 28².

    standard axioms: propext what this means

    Statement uses: Nat, LT.lt, OfNat.ofNat, Eq, HAdd.hAdd, HPow.hPow, Or, And

    Proof uses: of_decide_eq_true, id, Bool, Decidable.decide, Bool.true, Eq.refl

    21 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

    lemma sq_add_sq_eq : ∀ m < 32, ∀ n < 32, m ^ 2 + n ^ 2 = 1009 →
        (m = 15 ∧ n = 28) ∨ (m = 28 ∧ n = 15) := by decide
  3. lemma Imo1977P5.aux_1 line 41 source

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

    Statement uses: Nat, And, LT.lt, OfNat.ofNat, Eq, Int, HAdd.hAdd, HPow.hPow, HSub.hSub, Membership.mem, Prod, Set, Imo1977P5.solution_set, Prod.mk

    Proof uses: Int.natAbs, Eq.mpr, id, congrFun', congrArg, Eq.trans, Nat.cast_add, congr, Nat.cast_pow, abs, Int.natCast_natAbs, sq_abs, Mathlib.Tactic.Linarith.eq_of_not_lt_of_not_gt, Not.intro, Mathlib.Tactic.Linarith.lt_irrefl, Eq.mp, Neg.neg, Mathlib.Tactic.Ring.of_eq, Mathlib.Tactic.Ring.Common.add_congr, Nat.rawCast and 81 more

    111 instances, coercions and auxiliary constants left out.

    Tactic trace: 21 steps

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

  4. lemma Imo1977P5.aux_2 line 68 source

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

    Statement uses: Nat, And, LT.lt, OfNat.ofNat, Eq, HMod.hMod, HAdd.hAdd, HPow.hPow, HDiv.hDiv, Membership.mem, Prod, Set, Imo1977P5.solution_set, Prod.mk

    Proof uses: HSub.hSub, Nat.eq_sub_of_add_eq', lt_of_not_ge, LE.le, Mathlib.Tactic.Linarith.lt_irrefl, Int, Eq.mp, HMul.hMul, Neg.neg, congrArg, Mathlib.Tactic.Ring.of_eq, Mathlib.Tactic.Ring.Common.add_congr, Nat.rawCast, Int.rawCast, inferInstance, Ring, Int.negOfNat, Mathlib.Tactic.Ring.Common.mul_congr, Mathlib.Tactic.Ring.cast_pos, Mathlib.Meta.NormNum.isNat_ofNat and 108 more

    150 instances, coercions and auxiliary constants left out.

    Tactic trace: 49 steps

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

  5. problem Imo1977P5.imo1977_p5 line 122 source

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

    Statement uses: Nat, And, LT.lt, OfNat.ofNat, Eq, HMod.hMod, HAdd.hAdd, HPow.hPow, HDiv.hDiv, Iff, Membership.mem, Prod, Set, Imo1977P5.solution_set, Prod.mk

    Proof uses: Iff.intro, Imo1977P5.aux_2, Eq.mpr, Or, id, implies_congr, Insert.insert, Singleton.singleton, Eq.trans, congr, congrArg, Prod.mk.injEq, Eq.refl

    31 instances, coercions and auxiliary constants left out.

    Tactic trace: 7 steps

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