Download data/lean/OAI/NumberTheory/TwoPoint/PretentiousDistance.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.09 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/TwoPoint/PretentiousDistance.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/TwoPoint/PretentiousDistance.lean
-
curl -L -o PretentiousDistance.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/TwoPoint/PretentiousDistance.lean
9.09 kB
| import Mathlib.Analysis.Complex.Trigonometric | |
| import Mathlib.NumberTheory.DirichletCharacter.Bounds | |
| import Mathlib.Tactic | |
| namespace OAI | |
| /-! | |
| # The pretentious distance used in ordinary two-point correlations | |
| These definitions use the prime cutoff and the twist-height cutoff at the same | |
| integer scale. The finite-prime perturbation estimate below is Lemma | |
| `lem:finite-prime-stability` of *Ordinary two-point correlations of | |
| multiplicative functions* (24 September 2026). It is elementary and does not | |
| assume any analytic input. | |
| -/ | |
| namespace TwoPointCorrelations | |
| open scoped ComplexConjugate | |
| open Filter Finset | |
| /-- The primes not exceeding an integer cutoff. -/ | |
| def primesUpTo (N : β) : Finset β := (Finset.range (N + 1)).filter Nat.Prime | |
| /-- The square of the pretentious distance; the second sequence can be any twist. -/ | |
| noncomputable def squaredDistance (f g : β β β) (N : β) : β := | |
| β p β primesUpTo N, (1 - (f p * conj (g p)).re) / (p : β) | |
| /-- The sequence `Ο(n) n^(it)`, with the value at zero immaterial to the prime sum. -/ | |
| noncomputable def characterTwist {q : β} (Ο : DirichletCharacter β q) | |
| (t : β) (n : β) : β := | |
| Ο (n : ZMod q) * Complex.exp (((t * Real.log (n : β) : β) : β) * Complex.I) | |
| /-- Uniform nonpretentiousness against every fixed Dirichlet character. | |
| The quantifier over all real lower bounds expresses divergence of the squared | |
| distance uniformly over `|t| β€ N`. As the distance is nonnegative, this is | |
| exactly the divergence of the distance appearing in the manuscript. | |
| -/ | |
| def UniformlyNonpretentious (f : β β β) : Prop := | |
| β (q : β), 0 < q β β (Ο : DirichletCharacter β q) (K : β), | |
| βαΆ N : β in atTop, β t : β, |t| β€ (N : β) β | |
| K β€ squaredDistance f (characterTwist Ο t) N | |
| lemma characterTwist_norm_le_one {q : β} (Ο : DirichletCharacter β q) | |
| (t : β) (n : β) : βcharacterTwist Ο t nβ β€ 1 := by | |
| simpa only [characterTwist, norm_mul, Complex.norm_exp_ofReal_mul_I, mul_one] using | |
| Ο.norm_le_one (n : ZMod q) | |
| lemma squaredDistance_nonneg (f g : β β β) (N : β) | |
| (hf : β n, βf nβ β€ 1) (hg : β n, βg nβ β€ 1) : | |
| 0 β€ squaredDistance f g N := by | |
| apply Finset.sum_nonneg | |
| intro p hp | |
| apply div_nonneg | |
| Β· have hnorm : βf p * conj (g p)β β€ 1 := by | |
| calc | |
| βf p * conj (g p)β = βf pβ * βg pβ := by simp | |
| _ β€ 1 * 1 := mul_le_mul (hf p) (hg p) (norm_nonneg _) zero_le_one | |
| _ = 1 := by norm_num | |
| exact sub_nonneg.mpr ((Complex.re_le_norm _).trans hnorm) | |
| Β· positivity | |
| lemma squaredDistance_conj (f g : β β β) (N : β) : | |
| squaredDistance (fun n => conj (f n)) (fun n => conj (g n)) N = | |
| squaredDistance f g N := by | |
| unfold squaredDistance | |
| apply Finset.sum_congr rfl | |
| intro p hp | |
| congr 2 | |
| rw [β map_mul] | |
| simp | |
| /-- Conjugating a character and reversing the height conjugates its twist. -/ | |
| lemma characterTwist_conj {q : β} (Ο : DirichletCharacter β q) | |
| (t : β) (n : β) : | |
| characterTwist (Ο.ringHomComp (starRingEnd β)) (-t) n = | |
| conj (characterTwist Ο t n) := by | |
| simp only [characterTwist, MulChar.ringHomComp_apply, map_mul, | |
| β Complex.exp_conj] | |
| congr 2 | |
| simp only [neg_mul, Complex.ofReal_neg, Complex.conj_ofReal, Complex.conj_I, mul_neg] | |
| /-- Uniform nonpretentiousness is invariant under complex conjugation. -/ | |
| lemma UniformlyNonpretentious.conj {f : β β β} | |
| (hf : UniformlyNonpretentious f) : | |
| UniformlyNonpretentious (fun n => conj (f n)) := by | |
| intro q hq Ο K | |
| filter_upwards [hf q hq (Ο.ringHomComp (starRingEnd β)) K] with N hN | |
| intro t ht | |
| have h := hN (-t) (by simpa using ht) | |
| have heq : characterTwist (Ο.ringHomComp (starRingEnd β)) (-t) = | |
| fun n => conj (characterTwist Ο t n) := by | |
| funext n | |
| exact characterTwist_conj Ο t n | |
| rw [heq] at h | |
| simpa only [β squaredDistance_conj f (fun n => conj (characterTwist Ο t n)) N, | |
| Complex.conj_conj] using h | |
| /-- Altering a fixed finite set of prime values changes the square of the | |
| pretentious distance by at most twice their reciprocal sum. -/ | |
| lemma squaredDistance_finite_prime_change (f b g : β β β) (N : β) | |
| (P : Finset β) (hf : β n, 0 < n β βf nβ β€ 1) (hb : β n, 0 < n β βb nβ β€ 1) | |
| (hg : β n, 0 < n β βg nβ β€ 1) | |
| (heq : β p, Nat.Prime p β p β P β b p = f p) : | |
| |squaredDistance b g N - squaredDistance f g N| β€ | |
| 2 * β p β P, (1 : β) / (p : β) := by | |
| let S := primesUpTo N | |
| have hterm (p : β) (hp : 0 < p) : | |
| |(1 - (b p * conj (g p)).re) / (p : β) - | |
| (1 - (f p * conj (g p)).re) / (p : β)| β€ 2 / (p : β) := by | |
| have hdiff : βf p - b pβ β€ 2 := by | |
| exact (norm_sub_le _ _).trans (by linarith [hf p hp, hb p hp]) | |
| have hprod : β(f p - b p) * conj (g p)β β€ 2 := by | |
| calc | |
| β(f p - b p) * conj (g p)β = βf p - b pβ * βg pβ := by simp | |
| _ β€ 2 * 1 := mul_le_mul hdiff (hg p hp) (norm_nonneg _) (by norm_num) | |
| _ = 2 := by norm_num | |
| have hre : |(f p * conj (g p)).re - (b p * conj (g p)).re| β€ 2 := by | |
| calc | |
| |(f p * conj (g p)).re - (b p * conj (g p)).re| = | |
| |((f p - b p) * conj (g p)).re| := by rw [sub_mul, Complex.sub_re] | |
| _ β€ β(f p - b p) * conj (g p)β := Complex.abs_re_le_norm _ | |
| _ β€ 2 := hprod | |
| rw [β sub_div, show (1 - (b p * conj (g p)).re) - | |
| (1 - (f p * conj (g p)).re) = | |
| (f p * conj (g p)).re - (b p * conj (g p)).re by ring, | |
| abs_div, show |(p : β)| = (p : β) from abs_of_nonneg (Nat.cast_nonneg p)] | |
| exact div_le_div_of_nonneg_right hre (Nat.cast_nonneg p) | |
| have htermP (p : β) (hp : p β S) : | |
| |(1 - (b p * conj (g p)).re) / (p : β) - | |
| (1 - (f p * conj (g p)).re) / (p : β)| β€ | |
| if p β P then 2 / (p : β) else 0 := by | |
| split_ifs with hP | |
| Β· exact hterm p ((Finset.mem_filter.mp hp).2.pos) | |
| Β· have hprime : Nat.Prime p := (Finset.mem_filter.mp hp).2 | |
| rw [heq p hprime hP, sub_self, abs_zero] | |
| calc | |
| |squaredDistance b g N - squaredDistance f g N| = | |
| |β p β S, ((1 - (b p * conj (g p)).re) / (p : β) - | |
| (1 - (f p * conj (g p)).re) / (p : β))| := by | |
| rw [Finset.sum_sub_distrib] | |
| rfl | |
| _ β€ β p β S, |(1 - (b p * conj (g p)).re) / (p : β) - | |
| (1 - (f p * conj (g p)).re) / (p : β)| := Finset.abs_sum_le_sum_abs _ _ | |
| _ β€ β p β S, if p β P then 2 / (p : β) else 0 := Finset.sum_le_sum htermP | |
| _ = β p β S.filter (fun p => p β P), 2 / (p : β) := by rw [Finset.sum_filter] | |
| _ β€ β p β P, 2 / (p : β) := by | |
| apply Finset.sum_le_sum_of_subset_of_nonneg | |
| Β· intro p hp | |
| exact (Finset.mem_filter.mp hp).2 | |
| Β· intro p hp hnot | |
| positivity | |
| _ = 2 * β p β P, (1 : β) / (p : β) := by | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro p hp | |
| ring | |
| /-- The bound is uniform over the changing twist and finite modifications. -/ | |
| lemma UniformlyNonpretentious.finite_prime_change {f b : β β β} | |
| (hfnp : UniformlyNonpretentious f) (P : Finset β) | |
| (hf : β n, 0 < n β βf nβ β€ 1) (hb : β n, 0 < n β βb nβ β€ 1) | |
| (heq : β p, Nat.Prime p β p β P β b p = f p) : | |
| UniformlyNonpretentious b := by | |
| intro q hq Ο K | |
| filter_upwards [hfnp q hq Ο (K + 2 * β p β P, (1 : β) / (p : β))] with N hN | |
| intro t ht | |
| have hdist := squaredDistance_finite_prime_change f b (characterTwist Ο t) N | |
| P hf hb (fun n _ => characterTwist_norm_le_one Ο t n) heq | |
| have hlow := hN t ht | |
| have := (abs_le.mp hdist).1 | |
| linarith | |
| /-- One lower bound works for every member of a fixed finite character family, | |
| and for every bounded sequence whose prime values are changed only in `P`. | |
| This is the uniformity needed when taking the short-interval theorem at a fixed | |
| auxiliary graph scale. -/ | |
| lemma UniformlyNonpretentious.finite_family {ΞΉ : Type*} [Finite ΞΉ] | |
| {f : β β β} (hfnp : UniformlyNonpretentious f) (hf : β n, 0 < n β βf nβ β€ 1) | |
| (P : Finset β) (q : ΞΉ β β) (hq : β i, 0 < q i) | |
| (Ο : β i, DirichletCharacter β (q i)) (K : β) : | |
| βαΆ N : β in atTop, β i (b : β β β), | |
| (β n, 0 < n β βb nβ β€ 1) β | |
| (β p, Nat.Prime p β p β P β b p = f p) β | |
| β t : β, |t| β€ (N : β) β K β€ squaredDistance b (characterTwist (Ο i) t) N := by | |
| have hfamily : βαΆ N : β in atTop, β i, | |
| β t : β, |t| β€ (N : β) β | |
| K + 2 * β p β P, (1 : β) / (p : β) β€ | |
| squaredDistance f (characterTwist (Ο i) t) N := by | |
| rw [Filter.eventually_all] | |
| intro i | |
| exact hfnp (q i) (hq i) (Ο i) _ | |
| filter_upwards [hfamily] with N hN | |
| intro i b hb heq t ht | |
| have hdist := squaredDistance_finite_prime_change f b (characterTwist (Ο i) t) N | |
| P hf hb (fun n _ => characterTwist_norm_le_one (Ο i) t n) heq | |
| have hlow := hN i t ht | |
| have := (abs_le.mp hdist).1 | |
| linarith | |
| end TwoPointCorrelations | |
| end OAI | |