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

11 declarations, 0 contain sorry, 0 declared as axioms

USA Mathematical Olympiad 2001, Problem 5

Let S be a set of integers (not necessarily positive) such that

(a) there exist a, b ∈ S with gcd(a, b) = gcd(a − 2, b − 2) = 1; (b) if x and y are elements of S (possibly equal), then x² − y also belongs to S.

Prove that S is the set of all integers.

Imports (2)
Imported by 1 file
  1. def Usa2001P5.Shifty An integer d is shifty for a set S if shifting by d does not change membership in S line 34 source

    Source documentation

    An integer d is shifty for a set S if shifting by d does not change membership in S. The shifty integers form a subgroup of ℤ, and the proof below shows that 1 is shifty, which forces S = ℤ.

    no axioms what this means

    Statement uses: Set, Int

    Proof uses: Iff, Membership.mem, HAdd.hAdd

    3 instances, coercions and auxiliary constants left out.

    def Shifty (S : Set ℤ) (d : ℤ) : Prop := ∀ x : ℤ, x ∈ S ↔ x + d ∈ S

    Mentions: S

  2. lemma Usa2001P5.shifty_zero line 36 source

    standard axioms: propext what this means

    Statement uses: Set, Int, Usa2001P5.Shifty, OfNat.ofNat

    Proof uses: of_eq_true, Iff, Membership.mem, HAdd.hAdd, Eq.trans, True, congrArg, add_zero, iff_self

    7 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

  3. lemma Usa2001P5.shifty_neg line 38 source

    standard axioms: propext what this means

    Statement uses: Set, Int, Usa2001P5.Shifty, Neg.neg

    Proof uses: Iff, Membership.mem, HAdd.hAdd, Eq, Mathlib.Tactic.Ring.of_eq, HMul.hMul, HPow.hPow, Nat, Nat.rawCast, OfNat.ofNat, Mathlib.Tactic.Ring.Common.add_congr, Int.rawCast, inferInstance, Ring, Int.negOfNat, Mathlib.Tactic.Ring.Common.atom_pf, rfl, Eq.mpr, id, congrArg and 20 more

    30 instances, coercions and auxiliary constants left out.

    Tactic trace: 6 steps

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

  4. lemma Usa2001P5.shifty_add line 45 source

    standard axioms: propext what this means

    Statement uses: Set, Int, Usa2001P5.Shifty, HAdd.hAdd

    Proof uses: Eq, Mathlib.Tactic.Ring.of_eq, HMul.hMul, HPow.hPow, Nat, Nat.rawCast, OfNat.ofNat, Mathlib.Tactic.Ring.Common.add_congr, Mathlib.Tactic.Ring.Common.atom_pf, rfl, Eq.mpr, id, congrArg, Eq.symm, Eq.refl, Mathlib.Tactic.Ring.Common.add_pf_add_lt, Mathlib.Tactic.Ring.Common.add_pf_zero_add, Iff, Membership.mem, Iff.trans

    22 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

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

  5. lemma Usa2001P5.shifty_nsmul line 52 source

    standard axioms: propext what this means

    Statement uses: Set, Int, Usa2001P5.Shifty, Nat, HSMul.hSMul

    Proof uses: Nat.recAux, Eq.mpr, OfNat.ofNat, id, Eq, congrArg, zero_nsmul, Usa2001P5.shifty_zero, HAdd.hAdd, succ_nsmul, Usa2001P5.shifty_add

    16 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

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

  6. lemma Usa2001P5.shifty_zsmul line 60 source

    standard axioms: propext what this means

    Statement uses: Set, Int, Usa2001P5.Shifty, HSMul.hSMul

    Proof uses: Nat, Or, Eq, Neg.neg, Exists, Int.eq_nat_or_neg, id, Usa2001P5.shifty_nsmul, Eq.symm, Eq.mpr, HMul.hMul, congrArg, neg_mul, Usa2001P5.shifty_neg

    26 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

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

  7. lemma Usa2001P5.shifty_sq_sub_sq If u and v belong to S, then v^2 - u^2 is shifty for S line 67 source

    Source documentation

    If u and v belong to S, then v^2 - u^2 is shifty for S.

    standard axioms: propext what this means

    Statement uses: Set, Int, Membership.mem, HSub.hSub, HPow.hPow, Nat, OfNat.ofNat, Usa2001P5.Shifty

    Proof uses: Iff.intro, HAdd.hAdd, Eq, Mathlib.Tactic.Ring.of_eq, HMul.hMul, Nat.rawCast, Int.rawCast, inferInstance, Ring, Int.negOfNat, Mathlib.Tactic.Ring.Common.add_congr, Mathlib.Tactic.Ring.Common.atom_pf, rfl, Eq.mpr, id, congrArg, Eq.symm, Eq.refl, Mathlib.Tactic.Ring.Common.sub_congr, Mathlib.Tactic.Ring.Common.pow_congr and 36 more

    41 instances, coercions and auxiliary constants left out.

    Tactic trace: 16 steps

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

    lemma shifty_sq_sub_sq {S : Set ℤ} (hS : ∀ x ∈ S, ∀ y ∈ S, x^2 - y ∈ S)
        {u v : ℤ} (hu : u ∈ S) (hv : v ∈ S) : Shifty S (v^2 - u^2) := by
    …

    Mentions: S, Usa2001P5.Shifty

  8. lemma Usa2001P5.not_prime_dvd_three The number-theoretic core: no prime divides all three of a^2 - b^2, a^3 * (a - 2) and b^3 * (b - 2) line 84 source

    Source documentation

    The number-theoretic core: no prime divides all three of a^2 - b^2, a^3 * (a - 2) and b^3 * (b - 2).

    standard axioms: Quot.sound, propext what this means

    Statement uses: Int, Eq, Nat, Int.gcd, OfNat.ofNat, HSub.hSub, Prime, Not, And, Dvd.dvd, HPow.hPow, HMul.hMul

    Proof uses: False, Or, Prime.dvd_or_dvd, Or.inl, Prime.dvd_of_dvd_pow, Or.inr, HAdd.hAdd, Mathlib.Tactic.Ring.of_eq, Nat.rawCast, Int.rawCast, inferInstance, Ring, Int.negOfNat, Mathlib.Tactic.Ring.Common.mul_congr, Mathlib.Tactic.Ring.Common.add_congr, Mathlib.Tactic.Ring.Common.atom_pf, rfl, Eq.mpr, id, congrArg and 53 more

    63 instances, coercions and auxiliary constants left out.

    Tactic trace: 49 steps

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

    lemma not_prime_dvd_three {a b : ℤ} (h1 : Int.gcd a b = 1)
        (h2 : Int.gcd (a - 2) (b - 2) = 1) {p : ℤ} (hp : Prime p) :
        ¬ (p ∣ a^2 - b^2 ∧ p ∣ a^3 * (a - 2) ∧ p ∣ b^3 * (b - 2)) := by
    …
  9. lemma Usa2001P5.gcd_gcd_eq_one The gcd of the three shifty integers a^2 - b^2, a^3 * (a - 2), b^3 * (b - 2) is 1 line 122 source

    Source documentation

    The gcd of the three shifty integers a^2 - b^2, a^3 * (a - 2), b^3 * (b - 2) is 1.

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

    Statement uses: Int, Eq, Nat, Int.gcd, OfNat.ofNat, HSub.hSub, HPow.hPow, HMul.hMul

    Proof uses: Decidable.byContradiction, Not, And, Prime, Dvd.dvd, Exists, False, Int.exists_prime_and_dvd, id, Ne, Int.natAbs, dvd_trans, Int.gcd_dvd_left, Int.gcd_dvd_right, Usa2001P5.not_prime_dvd_three, And.intro

    31 instances, coercions and auxiliary constants left out.

    Tactic trace: 7 steps

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

    lemma gcd_gcd_eq_one {a b : ℤ} (h1 : Int.gcd a b = 1)
        (h2 : Int.gcd (a - 2) (b - 2) = 1) :
        Int.gcd (↑(Int.gcd (a^2 - b^2) (a^3 * (a - 2)))) (b^3 * (b - 2)) = 1 := by
    …
  10. lemma Usa2001P5.bezout_three Bézout's identity for three integers whose gcd is 1 line 137 source

    Source documentation

    Bézout's identity for three integers whose gcd is 1.

    standard axioms: Quot.sound, propext what this means

    Statement uses: Int, Eq, Nat, Int.gcd, OfNat.ofNat, Exists, HAdd.hAdd, HMul.hMul

    Proof uses: Int.gcdA, rfl, Int.gcdB, Int.gcd_eq_gcd_ab, Eq.mp, congrFun', congrArg, Nat.cast_one, Eq.symm, Exists.intro, Eq.mpr, id, Mathlib.Tactic.Ring.of_eq, HPow.hPow, Nat.rawCast, Mathlib.Tactic.Ring.Common.add_congr, Mathlib.Tactic.Ring.Common.mul_congr, Mathlib.Tactic.Ring.Common.atom_pf, Eq.refl, Mathlib.Tactic.Ring.Common.add_mul and 11 more

    37 instances, coercions and auxiliary constants left out.

    Tactic trace: 13 steps

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

    lemma bezout_three {A B C : ℤ} (h : Int.gcd (↑(Int.gcd A B)) C = 1) :
        ∃ m n r : ℤ, m * A + n * B + r * C = 1 := by
    …

    Mentions: h

  11. problem Usa2001P5.usa2001_p5 line 153 source

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

    Statement uses: Set, Int, Membership.mem, HSub.hSub, HPow.hPow, Nat, OfNat.ofNat, Eq, Int.gcd, Set.univ

    Proof uses: Usa2001P5.Shifty, Usa2001P5.shifty_sq_sub_sq, HMul.hMul, Mathlib.Tactic.Ring.of_eq, HAdd.hAdd, Nat.rawCast, Int.rawCast, inferInstance, Ring, Int.negOfNat, Mathlib.Tactic.Ring.Common.sub_congr, Mathlib.Tactic.Ring.Common.pow_congr, Mathlib.Tactic.Ring.Common.atom_pf, rfl, Eq.mpr, id, congrArg, Eq.symm, Eq.refl, Mathlib.Tactic.Ring.cast_pos and 56 more

    54 instances, coercions and auxiliary constants left out.

    Tactic trace: 28 steps

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