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

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
  1. abbrev Imo2010P3.PosInt line 29 source

    no axioms what this means

    Proof uses: Subtype, Int, LT.lt, OfNat.ofNat

    2 instances, coercions and auxiliary constants left out.

  2. determine Imo2010P3.SolutionSet line 33 source

    standard axioms: propext what this means

    Statement uses: Set, Imo2010P3.PosInt

    Proof uses: Set.ofPred, Or, Eq, id, Exists, HAdd.hAdd, Int

    5 instances, coercions and auxiliary constants left out.

  3. lemma Imo2010P3.injective_of_sq The square condition forces g to be injective line 38 source

    Source documentation

    The square condition forces g to be injective.

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

    Statement uses: Imo2010P3.PosInt, IsSquare, Int, HMul.hMul, HAdd.hAdd, Function.Injective

    Proof 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.mpr and 120 more

    153 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

  4. lemma Imo2010P3.padicValInt_eq_of_dvd_not_dvd line 88 source

    standard 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, padicValInt

    Proof uses: Mathlib.Tactic.Contrapose.contrapose₂, id, Ne, Fact, Fact.mk, Eq.mpr, Or, LT.lt, Eq.trans, LE.le, congrArg, Eq.mp

    30 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

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

  5. lemma Imo2010P3.exists_positive_shift_odd_padic line 94 source

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

    Proof 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.rawCast and 175 more

    198 instances, coercions and auxiliary constants left out.

    Tactic trace: 99 steps

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

  6. lemma Imo2010P3.prime_dvd_other_factor_of_square line 177 source

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

    Statement uses: Nat, Nat.Prime, Int, Ne, OfNat.ofNat, IsSquare, HMul.hMul, Odd, padicValInt, Dvd.dvd

    Proof 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_true and 7 more

    51 instances, coercions and auxiliary constants left out.

    Tactic trace: 15 steps

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

  7. lemma Imo2010P3.input_modEq_of_output_modEq line 194 source

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

    Proof 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', congrArg and 61 more

    116 instances, coercions and auxiliary constants left out.

    Tactic trace: 34 steps

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

  8. lemma Imo2010P3.step_one Documented declaration: step_one line 232 source

    Source 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.mk

    Proof 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_pos and 58 more

    106 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
    …
  9. problem Imo2010P3.imo2010_p3 line 262 source

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

    Statement uses: Imo2010P3.PosInt, Iff, Membership.mem, Set, Imo2010P3.SolutionSet, IsSquare, Int, HMul.hMul, HAdd.hAdd

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

    159 instances, coercions and auxiliary constants left out.

    Tactic trace: 62 steps

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