Compfiles/Usa2001P5.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
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.
Imported by 1 file
- def
Usa2001P5.ShiftyAn integerdis shifty for a setSif shifting byddoes not change membership inSline 34 sourceSource documentation
An integer
dis shifty for a setSif shifting byddoes not change membership inS. The shifty integers form a subgroup ofℤ, and the proof below shows that1is shifty, which forcesS = ℤ.no axioms what this means
Statement uses:
Set,IntProof uses:
Iff,Membership.mem,HAdd.hAdd3 instances, coercions and auxiliary constants left out.
def Shifty (S : Set ℤ) (d : ℤ) : Prop := ∀ x : ℤ, x ∈ S ↔ x + d ∈ S
Mentions: S
- lemma
Usa2001P5.shifty_zeroline 36 sourcestandard axioms: propext what this means
Statement uses:
Set,Int, Usa2001P5.Shifty,OfNat.ofNatProof uses:
of_eq_true,Iff,Membership.mem,HAdd.hAdd,Eq.trans,True,congrArg,add_zero,iff_self7 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2001P5.shifty_negline 38 sourcestandard axioms: propext what this means
Statement uses:
Set,Int, Usa2001P5.Shifty,Neg.negProof 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,congrArgand 20 more30 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2001P5.shifty_addline 45 sourcestandard axioms: propext what this means
Statement uses:
Set,Int, Usa2001P5.Shifty,HAdd.hAddProof 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.trans22 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2001P5.shifty_nsmulline 52 sourcestandard axioms: propext what this means
Statement uses:
Set,Int, Usa2001P5.Shifty,Nat,HSMul.hSMulProof uses:
Nat.recAux,Eq.mpr,OfNat.ofNat,id,Eq,congrArg,zero_nsmul, Usa2001P5.shifty_zero,HAdd.hAdd,succ_nsmul, Usa2001P5.shifty_add16 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2001P5.shifty_zsmulline 60 sourcestandard axioms: propext what this means
Statement uses:
Set,Int, Usa2001P5.Shifty,HSMul.hSMulProof 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_neg26 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2001P5.shifty_sq_sub_sqIfuandvbelong toS, thenv^2 - u^2is shifty forSline 67 sourceSource documentation
If
uandvbelong toS, thenv^2 - u^2is shifty forS.standard axioms: propext what this means
Statement uses:
Set,Int,Membership.mem,HSub.hSub,HPow.hPow,Nat,OfNat.ofNat, Usa2001P5.ShiftyProof 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_congrand 36 more41 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
- lemma
Usa2001P5.not_prime_dvd_threeThe number-theoretic core: no prime divides all three ofa^2 - b^2,a^3 * (a - 2)andb^3 * (b - 2)line 84 sourceSource documentation
The number-theoretic core: no prime divides all three of
a^2 - b^2,a^3 * (a - 2)andb^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.hMulProof 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,congrArgand 53 more63 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 … - lemma
Usa2001P5.gcd_gcd_eq_oneThe gcd of the three shifty integersa^2 - b^2,a^3 * (a - 2),b^3 * (b - 2)is1line 122 sourceSource documentation
The gcd of the three shifty integers
a^2 - b^2,a^3 * (a - 2),b^3 * (b - 2)is1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Int,Eq,Nat,Int.gcd,OfNat.ofNat,HSub.hSub,HPow.hPow,HMul.hMulProof 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.intro31 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 … - lemma
Usa2001P5.bezout_threeBézout's identity for three integers whose gcd is1line 137 sourceSource 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.hMulProof 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_muland 11 more37 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
- problem
Usa2001P5.usa2001_p5line 153 sourcestandard 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.univProof 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_posand 56 more54 instances, coercions and auxiliary constants left out.
Tactic trace: 28 steps
Open to load the checked before-and-after goal states.