Compfiles/Imo1977P5.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
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
- determine
Imo1977P5.solution_setline 31 sourceno axioms what this means
Statement uses:
Set,Prod,NatProof uses:
Insert.insert,Prod.mk,OfNat.ofNat,Singleton.singleton3 instances, coercions and auxiliary constants left out.
- lemma
Imo1977P5.sq_add_sq_eq1009 is prime and≡ 1 (mod 4), so its representation as a sum of two squares is unique:1009 = 15² + 28²line 38 sourceSource 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,AndProof uses:
of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl21 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 - lemma
Imo1977P5.aux_1line 41 sourcestandard 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.mkProof 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.rawCastand 81 more111 instances, coercions and auxiliary constants left out.
Tactic trace: 21 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1977P5.aux_2line 68 sourcestandard 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.mkProof 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_ofNatand 108 more150 instances, coercions and auxiliary constants left out.
Tactic trace: 49 steps
Open to load the checked before-and-after goal states.
- problem
Imo1977P5.imo1977_p5line 122 sourcestandard 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.mkProof uses:
Iff.intro, Imo1977P5.aux_2,Eq.mpr,Or,id,implies_congr,Insert.insert,Singleton.singleton,Eq.trans,congr,congrArg,Prod.mk.injEq,Eq.refl31 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.