Compfiles/Usa2009P6.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
15 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 2009, Problem 6
Let $s_1, s_2, s_3, \ldots$ be an infinite, nonconstant sequence of rational numbers, meaning it is not the case that $s_1 = s_2 = s_3 = \ldots$. Suppose that $t_1, t_2, t_3, \ldots$ is also an infinite, nonconstant sequence of rational numbers with the property that $(s_i - s_j)(t_i - t_j)$ is an integer for all $i$ and $j$. Prove that there exists a rational number $r$ such that $(s_i - s_j) r$ and $(t_i - t_j)/r$ are integers for all $i$ and $j$.
Imports (8)
Imported by 1 file
- def
Usa2009P6.IsIntThe predicate that a rational number is an integer line 37 sourceSource documentation
The predicate that a rational number is an integer.
standard axioms: Quot.sound, propext what this means
Statement uses:
RatProof uses:
Exists,Int,Eq2 instances, coercions and auxiliary constants left out.
def IsInt (x : ℚ) : Prop := ∃ k : ℤ, x = k
- lemma
Usa2009P6.IsInt.of_intline 39 sourcestandard axioms: Quot.sound, propext what this means
Statement uses:
Int, Usa2009P6.IsInt,RatProof uses:
Exists.intro,Eq,rfl4 instances, coercions and auxiliary constants left out.
- lemma
Usa2009P6.IsInt.addline 41 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Rat, Usa2009P6.IsInt,HAdd.hAddProof uses:
Int,Eq,Exists.intro,Eq.mpr,id,congrArg,Int.cast_add,Eq.refl16 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2009P6.IsInt.subline 46 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Rat, Usa2009P6.IsInt,HSub.hSubProof uses:
Int,Eq,Exists.intro,Eq.mpr,id,congrArg,Int.cast_sub,Eq.refl15 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2009P6.IsInt.val_nonnegAn integer has nonnegativep-adic valuation line 52 sourceSource documentation
An integer has nonnegative
p-adic valuation.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Rat, Usa2009P6.IsInt,Nat,LE.le,Int,OfNat.ofNat,padicValRatProof uses:
Eq,Eq.mpr,padicValInt,id,congrArg,padicValRat.of_int,Nat.cast_nonneg,Eq.symm16 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
lemma IsInt.val_nonneg {x : ℚ} (hx : IsInt x) (p : ℕ) : 0 ≤ padicValRat p x := by …Mentions: Usa2009P6.IsInt
- lemma
Usa2009P6.isInt_of_val_nonnegA rational number whosep-adic valuation is nonnegative for every primepis an integer line 59 sourceSource documentation
A rational number whose
p-adic valuation is nonnegative for every primepis an integer.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Rat,Nat,Nat.Prime,LE.le,Int,OfNat.ofNat,padicValRat, Usa2009P6.IsIntProof uses:
Eq,Rat.den,Decidable.byContradiction,Not,And,Dvd.dvd,Exists,False,Nat.exists_prime_and_dvd,padicValInt,Rat.num,Eq.mpr,Or,id,congrArg,propext,padicValInt.eq_zero_iff,Or.inr,Int.natAbs,Iff.mpand 30 more50 instances, coercions and auxiliary constants left out.
Tactic trace: 27 steps
Open to load the checked before-and-after goal states.
lemma isInt_of_val_nonneg {q : ℚ} (h : ∀ p : ℕ, p.Prime → 0 ≤ padicValRat p q) : IsInt q := by …Mentions: h, Usa2009P6.IsInt
- lemma
Usa2009P6.isInt_of_mul_add_intKey integrality step: ifa * bandn * a + bare integers (withna nonzero integer), thenb(and hencen * a) is an integer line 88 sourceSource documentation
Key integrality step: if
a * bandn * a + bare integers (withna nonzero integer), thenb(and hencen * a) is an integer. This is thep-adic heart of the proof that everytᵢis an integer.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Int,Ne,OfNat.ofNat,Rat, Usa2009P6.IsInt,HMul.hMul,HAdd.hAdd,AndProof uses:
Classical.byContradiction,Not,Nat,Nat.Prime,LT.lt,padicValRat,Exists,False, Usa2009P6.isInt_of_val_nonneg,Eq.mp,LE.le,Eq.trans,binderNameHint,forall_congr,Mathlib.Tactic.Push.not_and_eq,implies_congr,Eq.refl,Fact,Fact.mk,Eqand 91 more121 instances, coercions and auxiliary constants left out.
Tactic trace: 57 steps
Open to load the checked before-and-after goal states.
lemma isInt_of_mul_add_int {n : ℤ} (hn : n ≠ 0) {a b : ℚ} (h1 : IsInt (a * b)) (h2 : IsInt ((n : ℚ) * a + b)) : IsInt b ∧ IsInt ((n : ℚ) * a) := by …Mentions: Usa2009P6.IsInt
- def
Usa2009P6.seqGcdThe gcd of|T 0|, |T 1|, ..., |T k|line 142 sourceSource documentation
The gcd of
|T 0|, |T 1|, ..., |T k|.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,IntProof uses:
Finset.gcd,Finset.range,HAdd.hAdd,OfNat.ofNat,Int.natAbs6 instances, coercions and auxiliary constants left out.
def seqGcd (T : ℕ → ℤ) (k : ℕ) : ℕ := (Finset.range (k + 1)).gcd fun i => (T i).natAbs
- lemma
Usa2009P6.seqGcd_dvdline 144 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int,LE.le,Dvd.dvd, Usa2009P6.seqGcd,Int.natAbsProof uses:
Finset.gcd_dvd,Finset.range,HAdd.hAdd,OfNat.ofNat,Iff.mpr,Membership.mem,Finset,LT.lt,Finset.mem_range,Nat.lt_succ_of_le12 instances, coercions and auxiliary constants left out.
- lemma
Usa2009P6.seqGcd_ne_zeroline 147 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int,LE.le,Ne,OfNat.ofNat, Usa2009P6.seqGcdProof uses:
Eq,Iff.mp,Int.natAbs,Int.natAbs_eq_zero,Nat.eq_zero_of_zero_dvd,Eq.rec,Dvd.dvd, Usa2009P6.seqGcd_dvd7 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2009P6.seqGcd_succ_leline 151 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int,LE.le,Ne,OfNat.ofNat, Usa2009P6.seqGcd,HAdd.hAddProof uses:
Nat.le_of_dvd,Nat.pos_of_ne_zero, Usa2009P6.seqGcd_ne_zero,Finset.dvd_gcd,Finset.range,Int.natAbs,Membership.mem,Finset, Usa2009P6.seqGcd_dvd,le_trans,Iff.mp,LT.lt,Nat.succ,Nat.lt_succ_iff,Finset.mem_range,Nat.le_succ17 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2009P6.gcd_seqDocumented declaration: gcd_seq line 161 sourceSource documentation
Any sequence of integers containing a nonzero term has a greatest common divisor: a positive natural
ddividing every term, and such that for every primepthep-adic valuation ofdis attained at some nonzero term of the sequence.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int,Ne,OfNat.ofNat,Exists,And,Dvd.dvd,Nat.Prime,Eq,padicValInt,padicValNatProof uses:
Antitone, Usa2009P6.seqGcd,HAdd.hAdd,antitone_nat_of_succ_le, Usa2009P6.seqGcd_succ_le,Nat.add,Nat.le_add_right,Set.Nonempty,Set.range,Set.range_nonempty,InfSet.sInf,Membership.mem,Set,Nat.sInf_mem,LE.le,le_antisymm,Trans.trans,rfl,Nat.sInf_le,Exists.introand 42 more49 instances, coercions and auxiliary constants left out.
Tactic trace: 45 steps
Open to load the checked before-and-after goal states.
lemma gcd_seq (T : ℕ → ℤ) {b : ℕ} (hb : T b ≠ 0) : ∃ d : ℕ, d ≠ 0 ∧ (∀ i, (d : ℤ) ∣ T i) ∧ ∀ p : ℕ, p.Prime → ∃ j, T j ≠ 0 ∧ padicValInt p (T j) = padicValNat p d := by … - lemma
Usa2009P6.s_val_geThe key valuation bound: iftⱼis a nonzero integer ofp-adic valuatione(the minimum among thet's), then everysᵢhasp-adic valuation at least-eline 219 sourceSource documentation
The key valuation bound: if
tⱼis a nonzero integer ofp-adic valuatione(the minimum among thet's), then everysᵢhasp-adic valuation at least-e.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,Int,LE.le,OfNat.ofNat,Rat, Usa2009P6.IsInt,HMul.hMul,HAdd.hAdd,Ne,Eq,padicValRat,Neg.negProof uses:
Fact,Fact.mk,Or,eq_or_ne,Eq.mpr,id,congrArg,Eq.trans,padicValRat.zero,Iff.mpr,neg_nonpos,Decidable.byContradiction,Not, Usa2009P6.IsInt.val_nonneg,Exists.intro,rfl,padicValRat.mul,le_of_not_gt,LT.lt,Mathlib.Tactic.Linarith.lt_irrefland 73 more118 instances, coercions and auxiliary constants left out.
Tactic trace: 56 steps
Open to load the checked before-and-after goal states.
lemma s_val_ge {p : ℕ} (hp : p.Prime) {e : ℤ} (he : 0 ≤ e) {sj tj si ti : ℚ} (hstj : IsInt (sj * tj)) (hsti : IsInt (si * ti)) (hcross : IsInt (si * tj + sj * ti)) (htj : tj ≠ 0) (htjv : padicValRat p tj = e) : -e ≤ padicValRat p si := by …Mentions: Usa2009P6.IsInt
- lemma
Usa2009P6.normalizedThe heart of the problem, for normalized sequences:s a = t a = 0,s b = 1andt b = nfor a nonzero integernline 280 sourceSource documentation
The heart of the problem, for normalized sequences:
s a = t a = 0,s b = 1andt b = nfor a nonzero integern. Thenr = d, the gcd of all thetᵢ(which are integers), works.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Rat,Int,Ne,OfNat.ofNat,Eq, Usa2009P6.IsInt,HMul.hMul,HSub.hSub,Exists,And,HDiv.hDivProof uses:
Exists.intro,Eq.mp,congrArg,sub_zero,HAdd.hAdd,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,rfl,Eq.mpr,id,Eq.symm,Eq.refl,Mathlib.Tactic.Ring.Common.add_mul,Mathlib.Tactic.Ring.Common.mul_add,Mathlib.Tactic.Ring.Common.mul_pf_left,Mathlib.Tactic.Ring.Common.mul_pf_rightand 83 more120 instances, coercions and auxiliary constants left out.
Tactic trace: 63 steps
Open to load the checked before-and-after goal states.
lemma normalized {s t : ℕ → ℚ} {a b : ℕ} {n : ℤ} (hn : n ≠ 0) (hsa : s a = 0) (hta : t a = 0) (hsb : s b = 1) (htb : t b = n) (h : ∀ i j, IsInt ((s i - s j) * (t i - t j))) : ∃ r : ℚ, r ≠ 0 ∧ (∀ i, IsInt (s i * r)) ∧ (∀ i, IsInt (t i / r)) := by …Mentions: h, Usa2009P6.IsInt
- problem
Usa2009P6.usa2009_p6line 337 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Rat,Not,Eq,Exists,Int,HMul.hMul,HSub.hSub,And,Ne,OfNat.ofNat,HDiv.hDivProof uses:
Classical.byContradiction,False,Eq.mp,Eq.trans,Mathlib.Tactic.Push.not_forall_eq,congrArg,funext,Or,Iff.mp,mul_eq_zero,binderNameHint,forall_congr,absurd,sub_eq_zero,Ne.ne_or_ne,Eq.rec,Eq.mpr,id,sub_self,MulZeroClass.zero_muland 103 more110 instances, coercions and auxiliary constants left out.
Tactic trace: 99 steps
Open to load the checked before-and-after goal states.