math / data /lean /OAI /NumberTheory /TwoPoint /AffineDeduction.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
7.79 kB
import OAI.NumberTheory.TwoPoint.Bounds.Dilation
import OAI.NumberTheory.TwoPoint.Bounds.AffineTransfer
import OAI.NumberTheory.TwoPoint.Statements
namespace OAI
open Filter
open scoped BigOperators
namespace TwoPointCorrelations
def ProgressionCorrectedElliott : Prop :=
βˆ€ f g : β„• β†’ β„‚, Multiplicative f β†’ Multiplicative g β†’
OneBounded f β†’ OneBounded g β†’
(UniformlyNonpretentious f ∨ UniformlyNonpretentious g) β†’
βˆ€ h l b : β„•, 0 < h β†’ 0 < l β†’
Tendsto (fun N : β„• => residuePrefix (fun n => f n * g (n + h)) l b N / (N : β„‚))
atTop (nhds 0)
theorem Multiplicative.one_eq_zero_or_one {f : β„• β†’ β„‚} (hf : Multiplicative f) :
f 1 = 0 ∨ f 1 = 1 := by
have heq := hf 1 1 (by decide) (by decide) (by decide)
have hprod : f 1 * (f 1 - 1) = 0 := by
calc
f 1 * (f 1 - 1) = f 1 * f 1 - f 1 := by ring
_ = 0 := by simpa using congrArg (fun z : β„‚ => z - f 1) heq.symm
rcases mul_eq_zero.mp hprod with h | h
Β· exact Or.inl h
Β· exact Or.inr (sub_eq_zero.mp h)
theorem Multiplicative.zero_of_one_eq_zero {f : β„• β†’ β„‚} (hf : Multiplicative f)
(h0 : f 1 = 0) {n : β„•} (hn : 0 < n) : f n = 0 := by
simpa [h0] using hf 1 n (by decide) hn (Nat.coprime_one_left n)
lemma residuePrefix_congr {u v : β„• β†’ β„‚} (h : βˆ€ n, 0 < n β†’ u n = v n)
(l b N : β„•) : residuePrefix u l b N = residuePrefix v l b N := by
unfold residuePrefix
apply Finset.sum_congr rfl
intro n hn
rw [h n (Finset.mem_Ioc.mp hn).1]
lemma residuePrefix_sum {ΞΉ : Type*} (s : Finset ΞΉ) (u : ΞΉ β†’ β„• β†’ β„‚) (l b N : β„•) :
residuePrefix (fun n => βˆ‘ i ∈ s, u i n) l b N =
βˆ‘ i ∈ s, residuePrefix (u i) l b N := by
unfold residuePrefix
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro n hn
split_ifs <;> simp
lemma residuePrefix_const_mul (c : β„‚) (u : β„• β†’ β„‚) (l b N : β„•) :
residuePrefix (fun n => c * u n) l b N = c * residuePrefix u l b N := by
unfold residuePrefix
rw [Finset.mul_sum]
apply Finset.sum_congr rfl
intro n hn
split_ifs <;> simp
/-- Finite signed local expansions preserve an established progression limit. -/
theorem finite_expansion_progression_zero {ΞΉ ΞΊ : Type*}
(s : Finset ΞΉ) (t : Finset ΞΊ) (c : ΞΉ β†’ β„‚) (d : ΞΊ β†’ β„‚)
(F : ΞΉ β†’ β„• β†’ β„‚) (G : ΞΊ β†’ β„• β†’ β„‚) (u v : β„• β†’ β„‚)
(hu : βˆ€ n, 0 < n β†’ u n = βˆ‘ i ∈ s, c i * F i n)
(hv : βˆ€ n, 0 < n β†’ v n = βˆ‘ j ∈ t, d j * G j n)
(h l b : β„•)
(hz : βˆ€ i ∈ s, βˆ€ j ∈ t,
Tendsto (fun N : β„• => residuePrefix (fun n => F i n * G j (n + h)) l b N /
(N : β„‚)) atTop (nhds 0)) :
Tendsto (fun N : β„• => residuePrefix (fun n => u n * v (n + h)) l b N /
(N : β„‚)) atTop (nhds 0) := by
have heq (N : β„•) : residuePrefix (fun n => u n * v (n + h)) l b N / (N : β„‚) =
βˆ‘ i ∈ s, βˆ‘ j ∈ t, (c i * d j) *
(residuePrefix (fun n => F i n * G j (n + h)) l b N / (N : β„‚)) := by
rw [residuePrefix_congr (v := fun n => βˆ‘ i ∈ s, βˆ‘ j ∈ t,
(c i * d j) * (F i n * G j (n + h))) (by
intro n hn
rw [hu n hn, hv (n + h) (by omega)]
rw [Finset.sum_mul]
simp_rw [Finset.mul_sum]
apply Finset.sum_congr rfl
intro i hi
apply Finset.sum_congr rfl
intro j hj
ring)]
simp only [residuePrefix_sum, residuePrefix_const_mul, Finset.sum_div]
apply Finset.sum_congr rfl
intro i hi
apply Finset.sum_congr rfl
intro j hj
ring
simp_rw [heq]
have hout := tendsto_finsetSum s (fun i hi =>
tendsto_finsetSum t (fun j hj =>
(tendsto_const_nhds (x := c i * d j)).mul (hz i hi j hj)))
simpa using hout
theorem ProgressionCorrectedElliott.dilations
(hprog : ProgressionCorrectedElliott) (f g : β„• β†’ β„‚)
(hf : Multiplicative f) (hg : Multiplicative g)
(hf1 : f 1 = 1) (hg1 : g 1 = 1)
(hfb : OneBounded f) (hgb : OneBounded g)
(hnp : UniformlyNonpretentious f ∨ UniformlyNonpretentious g)
(a a' h l b : β„•) (ha : 0 < a) (ha' : 0 < a') (hh : 0 < h) (hl : 0 < l) :
Tendsto (fun N : β„• =>
residuePrefix (fun n => dilate a f n * dilate a' g (n + h)) l b N / (N : β„‚))
atTop (nhds 0) := by
apply finite_expansion_progression_zero a.primeFactors.powerset a'.primeFactors.powerset
(fun E => (-1 : β„‚) ^ E.card) (fun E => (-1 : β„‚) ^ E.card)
(dilationComponent a f) (dilationComponent a' g)
(dilate a f) (dilate a' g)
(fun n hn => dilate_eq_sum_components a f ha hf hf1 hn)
(fun n hn => dilate_eq_sum_components a' g ha' hg hg1 hn)
intro E _ E' _
apply hprog _ _ (dilationComponent_multiplicative a f E)
(dilationComponent_multiplicative a' g E')
(dilationComponent_oneBounded _ _ _ hfb) (dilationComponent_oneBounded _ _ _ hgb)
_ h l b hh hl
exact hnp.imp (dilationComponent_nonpretentious a f E hfb)
(dilationComponent_nonpretentious a' g E' hgb)
private theorem affine_ordered_zero (hprog : ProgressionCorrectedElliott)
(f g : β„• β†’ β„‚) (hf : Multiplicative f) (hg : Multiplicative g)
(hf1 : f 1 = 1) (hg1 : g 1 = 1) (hfb : OneBounded f) (hgb : OneBounded g)
(hnp : UniformlyNonpretentious f ∨ UniformlyNonpretentious g)
(a₁ aβ‚‚ b₁ bβ‚‚ : β„•) (ha₁ : 0 < a₁) (haβ‚‚ : 0 < aβ‚‚)
(horder : aβ‚‚ * b₁ < a₁ * bβ‚‚) :
Tendsto (fun N : β„• => affineSum f g a₁ aβ‚‚ b₁ bβ‚‚ N / (N : β„‚)) atTop (nhds 0) := by
have hp := hprog.dilations f g hf hg hf1 hg1 hfb hgb hnp aβ‚‚ a₁
(a₁ * bβ‚‚ - aβ‚‚ * b₁) (a₁ * aβ‚‚) (aβ‚‚ * b₁) haβ‚‚ ha₁
(Nat.sub_pos_of_lt horder) (Nat.mul_pos ha₁ haβ‚‚)
have ht := affine_mean_tendsto_zero
(fun m => dilate aβ‚‚ f m * dilate a₁ g (m + (a₁ * bβ‚‚ - aβ‚‚ * b₁)))
(a₁ * aβ‚‚) (aβ‚‚ * b₁) (Nat.mul_pos ha₁ haβ‚‚) hp
apply ht.congr'
apply Filter.Eventually.of_forall
intro N
dsimp only
congr 1
unfold affineSum
apply Finset.sum_congr rfl
intro n hn
have hl : a₁ * aβ‚‚ * n + aβ‚‚ * b₁ = aβ‚‚ * (a₁ * n + b₁) := by ring
have hr : a₁ * aβ‚‚ * n + aβ‚‚ * b₁ + (a₁ * bβ‚‚ - aβ‚‚ * b₁) =
a₁ * (aβ‚‚ * n + bβ‚‚) := by
calc
_ = a₁ * aβ‚‚ * n + a₁ * bβ‚‚ := by omega
_ = _ := by ring
rw [hr, hl]
simp [dilate, ha₁.ne', haβ‚‚.ne']
/-- The manuscript's affine reduction, conditional here on its internal
progression theorem. This is not the published-input conditional main result. -/
theorem ProgressionCorrectedElliott.affine (hprog : ProgressionCorrectedElliott) :
AffineCorrectedElliott := by
intro f g hf hg hfb hgb hnp a₁ aβ‚‚ b₁ bβ‚‚ ha₁ haβ‚‚ hneq
rcases hf.one_eq_zero_or_one with hf0 | hf1
Β· have hz (N : β„•) : affineSum f g a₁ aβ‚‚ b₁ bβ‚‚ N = 0 := by
unfold affineSum
apply Finset.sum_eq_zero
intro n hn
have hnpos := (Finset.mem_Icc.mp hn).1
rw [hf.zero_of_one_eq_zero hf0 (by nlinarith : 0 < a₁ * n + b₁), zero_mul]
simpa only [hz, zero_div] using (tendsto_const_nhds (x := (0 : β„‚)) (f := atTop))
rcases hg.one_eq_zero_or_one with hg0 | hg1
Β· have hz (N : β„•) : affineSum f g a₁ aβ‚‚ b₁ bβ‚‚ N = 0 := by
unfold affineSum
apply Finset.sum_eq_zero
intro n hn
have hnpos := (Finset.mem_Icc.mp hn).1
rw [hg.zero_of_one_eq_zero hg0 (by nlinarith : 0 < aβ‚‚ * n + bβ‚‚), mul_zero]
simpa only [hz, zero_div] using (tendsto_const_nhds (x := (0 : β„‚)) (f := atTop))
rcases lt_or_gt_of_ne hneq with hlt | hgt
Β· have h := affine_ordered_zero hprog g f hg hf hg1 hf1 hgb hfb hnp.symm
aβ‚‚ a₁ bβ‚‚ b₁ haβ‚‚ ha₁ hlt
simpa only [affineSum_swap f g] using h
Β· exact affine_ordered_zero hprog f g hf hg hf1 hg1 hfb hgb hnp
a₁ aβ‚‚ b₁ bβ‚‚ ha₁ haβ‚‚ hgt
end TwoPointCorrelations
end OAI