Compfiles/Imo2010P3.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
9 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 2010, Problem 3
Determine all functions g : ℤ>0 → ℤ>0 such that
(g(m) + n)(g(n) + m)
is always a perfect square.
Imports (2)
Imported by 1 file
- abbrev
Imo2010P3.PosIntline 29 sourceno axioms what this means
Proof uses:
Subtype,Int,LT.lt,OfNat.ofNat2 instances, coercions and auxiliary constants left out.
- determine
Imo2010P3.SolutionSetline 33 sourcestandard axioms: propext what this means
Statement uses:
Set, Imo2010P3.PosIntProof uses:
Set.ofPred,Or,Eq,id,Exists,HAdd.hAdd,Int5 instances, coercions and auxiliary constants left out.
- lemma
Imo2010P3.injective_of_sqThe square condition forcesgto be injective line 38 sourceSource documentation
The square condition forces
gto be injective.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Imo2010P3.PosInt,
IsSquare,Int,HMul.hMul,HAdd.hAdd,Function.InjectiveProof uses:
Eq,Nat,And,Nat.Prime,GT.gt,Max.max,LT.lt,OfNat.ofNat,Exists,LE.le,Int.natAbs,Nat.exists_infinite_primes,cast,Eq.trans,congrFun',congrArg,Eq.symm,Nat.cast_zero,Subtype.property,Iff.mprand 120 more153 instances, coercions and auxiliary constants left out.
Tactic trace: 44 steps
Open to load the checked before-and-after goal states.
lemma injective_of_sq (g : ℤ>0 → ℤ>0) (h : ∀ m n : ℤ>0, IsSquare ((g m + n) * (g n + m))) : Function.Injective g := by …Mentions: h
- lemma
Imo2010P3.padicValInt_eq_of_dvd_not_dvdline 88 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,Int,Dvd.dvd,HPow.hPow,Not,HAdd.hAdd,OfNat.ofNat,Eq,padicValIntProof uses:
Mathlib.Tactic.Contrapose.contrapose₂,id,Ne,Fact,Fact.mk,Eq.mpr,Or,LT.lt,Eq.trans,LE.le,congrArg,Eq.mp30 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2010P3.exists_positive_shift_odd_padicline 94 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,Int,LT.lt,OfNat.ofNat,Dvd.dvd,HSub.hSub,Exists,And,Odd,padicValInt,HAdd.hAddProof uses:
Eq,rfl,dite,Exists.intro,HMul.hMul,And.intro,lt_of_not_ge,LE.le,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,Neg.neg,congrArg,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Nat.rawCast,Mathlib.Meta.NormNum.instAddMonoidWithOne,inferInstance,Ring,HPow.hPow,Int.rawCastand 175 more198 instances, coercions and auxiliary constants left out.
Tactic trace: 99 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2010P3.prime_dvd_other_factor_of_squareline 177 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,Int,Ne,OfNat.ofNat,IsSquare,HMul.hMul,Odd,padicValInt,Dvd.dvdProof uses:
Eq,False,Or,Eq.mp,Eq.trans,congrArg,Mathlib.Meta.NormNum.IsNat.to_eq,Mathlib.Meta.NormNum.isNat_mul,Eq.refl,Mathlib.Meta.NormNum.isNat_ofNat,Eq.symm,HAdd.hAdd,Fact,Fact.mk,Eq.mpr,id,padicValInt.mul,Mathlib.Tactic.Contrapose.contrapose₁,Not,of_eq_trueand 7 more51 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2010P3.input_modEq_of_output_modEqline 194 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Imo2010P3.PosInt,
IsSquare,Int,HMul.hMul,HAdd.hAdd,Nat,Nat.Prime,Int.ModEq,LT.lt,OfNat.ofNatProof uses:
Decidable.byContradiction,Not,And,Odd,padicValInt,Exists,False, Imo2010P3.exists_positive_shift_odd_padic,Subtype.property,Int.ModEq.dvd,Int.ModEq.symm,Dvd.dvd,Subtype.mk, Imo2010P3.prime_dvd_other_factor_of_square,ne_of_gt,add_pos,cast,Eq.trans,congrFun',congrArgand 61 more116 instances, coercions and auxiliary constants left out.
Tactic trace: 34 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2010P3.step_oneDocumented declaration: step_one line 232 sourceSource comment
Key lemma: |g(n+1) - g(n)| = 1 From the functional equation with m and varying n, once we know g is injective and the sq condition holds, consecutive values must differ by exactly 1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Imo2010P3.PosInt,
IsSquare,Int,HMul.hMul,HAdd.hAdd,Function.Injective,Or,Eq,LT.lt,OfNat.ofNat,Subtype.mkProof uses:
AddLeftStrictMono,Nat,Int.natAbs,HSub.hSub,lt_of_not_ge,LE.le,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,Neg.neg,congrArg,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Int.rawCast,inferInstance,Ring,Int.negOfNat,HPow.hPow,Nat.rawCast,Mathlib.Tactic.Ring.Common.neg_congr,Mathlib.Tactic.Ring.cast_posand 58 more106 instances, coercions and auxiliary constants left out.
Tactic trace: 19 steps
Open to load the checked before-and-after goal states.
lemma step_one (g : ℤ>0 → ℤ>0) (hsq : ∀ m n : ℤ>0, IsSquare ((g m + n) * (g n + m))) (hinj : Function.Injective g) : ∀ n : ℤ>0, (g ⟨n.val + 1, by linarith [n.prop]⟩).val = g n + 1 ∨ (g ⟨n.val + 1, by linarith [n.prop]⟩).val + 1 = g n := by … - problem
Imo2010P3.imo2010_p3line 262 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Imo2010P3.PosInt,
Iff,Membership.mem,Set, Imo2010P3.SolutionSet,IsSquare,Int,HMul.hMul,HAdd.hAddProof uses:
Iff.intro,Eq,id,Exists,Exists.intro,Eq.mpr,congrArg,id.eq_1,add_comm,Eq.refl,Eq.symm,of_eq_true,Eq.trans,True,congr,congrFun',add_left_comm,eq_self,Function.Injective, Imo2010P3.injective_of_sq and 139 more159 instances, coercions and auxiliary constants left out.
Tactic trace: 62 steps
Open to load the checked before-and-after goal states.