Download data/lean/OAI/NumberTheory/CubicGauss/GaussianKernel.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.05 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/CubicGauss/GaussianKernel.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/CubicGauss/GaussianKernel.lean
-
curl -L -o GaussianKernel.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/CubicGauss/GaussianKernel.lean
9.05 kB
Lean 4 Β· 14
declarations statementsfull
| import Mathlib | |
| namespace OAI | |
| /-! Gaussian lattice decay, shell bounds and integral estimates. -/ | |
| noncomputable section | |
| open scoped BigOperators | |
| open Module Complex UniqueFactorizationMonoid | |
| Classical.propDecidable | |
| namespace CubicFirstMoment.SieveKernel | |
| lemma norm_weighted_pair_sum {ΞΉ : Type*} (s : Finset ΞΉ) (f g w : ΞΉ β β) | |
| {C P Q : β} (hC : 0 β€ C) (hP : 0 β€ P) (hQ : 0 β€ Q) | |
| (hw : β i β s, βw iβ β€ C) | |
| (hf : β i β s, βf iβ^2 β€ P^2) (hg : β i β s, βg iβ^2 β€ Q^2) : | |
| ββ i β s, w i * f i * star (g i)β β€ C * P * Q := by | |
| have hc := Finset.sum_mul_sq_le_sq_mul_sq s (fun i => βf iβ) (fun i => βg iβ) | |
| have hc' : (β i β s, βf iβ * βg iβ)^2 β€ (P*Q)^2 := by | |
| apply hc.trans | |
| calc | |
| _ β€ P^2 * Q^2 := mul_le_mul hf hg (Finset.sum_nonneg fun _ _ => sq_nonneg _) (sq_nonneg P) | |
| _ = _ := by ring | |
| have hn : 0 β€ β i β s, βf iβ * βg iβ := | |
| Finset.sum_nonneg fun i _ => mul_nonneg (_root_.norm_nonneg (f i)) (_root_.norm_nonneg (g i)) | |
| have hc'' := (sq_le_sqβ hn (mul_nonneg hP hQ)).mp hc' | |
| calc | |
| _ β€ β i β s, βw i * f i * star (g i)β := norm_sum_le _ _ | |
| _ β€ β i β s, C * (βf iβ * βg iβ) := by | |
| apply Finset.sum_le_sum | |
| intro i hi | |
| simp only [norm_mul, norm_star] | |
| nlinarith [mul_le_mul_of_nonneg_right (hw i hi) (mul_nonneg (_root_.norm_nonneg (f i)) (_root_.norm_nonneg (g i)))] | |
| _ = C * β i β s, βf iβ * βg iβ := (Finset.mul_sum ..).symm | |
| _ β€ C * P * Q := by simpa [mul_assoc] using mul_le_mul_of_nonneg_left hc'' hC | |
| abbrev Index := β Γ (β Γ β) | |
| def coefficient (r : β) (v : Index) : β := | |
| Complex.exp (-(r : β)) * ((r : β)^v.1 / v.1.factorial) * | |
| ((r : β)^v.2.1 / v.2.1.factorial) * ((-(r : β))^v.2.2 / v.2.2.factorial) | |
| def majorant (L R Ξ΄ : β) (v : Index) : β := | |
| Real.exp (-L) * ((R*Ξ΄)^v.1 / v.1.factorial) * | |
| ((R*Ξ΄)^v.2.1 / v.2.1.factorial) * ((R*Ξ΄^2)^v.2.2 / v.2.2.factorial) | |
| lemma exp_series_complex (z : β) : HasSum (fun n : β => z^n / n.factorial) (Complex.exp z) := by | |
| simpa only [Complex.exp_eq_exp_β] using NormedSpace.expSeries_div_hasSum_exp z | |
| lemma exp_series_real (z : β) : HasSum (fun n : β => z^n / n.factorial) (Real.exp z) := by | |
| simpa only [Real.exp_eq_exp_β] using NormedSpace.expSeries_div_hasSum_exp z | |
| lemma hasSum_mul_complex {ΞΉ ΞΊ : Type*} {f : ΞΉ β β} {g : ΞΊ β β} {a b : β} | |
| (hf : HasSum f a) (hg : HasSum g b) : | |
| HasSum (fun v : ΞΉ Γ ΞΊ => f v.1 * g v.2) (a*b) := by | |
| apply hf.mul hg | |
| exact summable_mul_of_summable_norm (f := f) (g := g) hf.summable.norm hg.summable.norm | |
| lemma hasSum_mul_real {ΞΉ ΞΊ : Type*} {f : ΞΉ β β} {g : ΞΊ β β} {a b : β} | |
| (hf : HasSum f a) (hg : HasSum g b) : | |
| HasSum (fun v : ΞΉ Γ ΞΊ => f v.1 * g v.2) (a*b) := by | |
| apply hf.mul hg | |
| exact summable_mul_of_summable_norm (f := f) (g := g) hf.summable.norm hg.summable.norm | |
| lemma kernel_hasSum (r x y : β) : | |
| HasSum (fun v : Index => coefficient r v * (x : β)^(v.1+v.2.2) * | |
| (y : β)^(v.2.1+v.2.2)) | |
| (Complex.exp (-(r : β)*(1-x)*(1-y))) := by | |
| have hy := exp_series_complex ((r : β)*y) | |
| have hxy := exp_series_complex (-(r : β)*x*y) | |
| have h2 := hasSum_mul_complex hy hxy | |
| have hx := exp_series_complex ((r : β)*x) | |
| have h3 := hasSum_mul_complex hx h2 | |
| have h4 := h3.mul_left (Complex.exp (-(r : β))) | |
| have he : Complex.exp (-(r : β)) * | |
| (Complex.exp ((r : β)*x) * (Complex.exp ((r : β)*y) * Complex.exp (-(r : β)*x*y))) = | |
| Complex.exp (-(r : β)*(1-x)*(1-y)) := by | |
| rw [β Complex.exp_add, β Complex.exp_add, β Complex.exp_add] | |
| congr 1 | |
| ring | |
| rw [he] at h4 | |
| exact h4.congr_fun fun v => by simp only [coefficient, pow_add, mul_pow]; ring | |
| lemma majorant_hasSum (L R Ξ΄ : β) : | |
| HasSum (majorant L R Ξ΄) (Real.exp (-L+(2*Ξ΄+Ξ΄^2)*R)) := by | |
| have h1 := exp_series_real (R*Ξ΄) | |
| have h2 := exp_series_real (R*Ξ΄^2) | |
| have h3 := hasSum_mul_real h1 h2 | |
| have h4 := hasSum_mul_real h1 h3 | |
| have h5 := h4.mul_left (Real.exp (-L)) | |
| have he : Real.exp (-L)*(Real.exp (R*Ξ΄)*(Real.exp (R*Ξ΄)*Real.exp (R*Ξ΄^2))) = | |
| Real.exp (-L+(2*Ξ΄+Ξ΄^2)*R) := by | |
| rw [β Real.exp_add, β Real.exp_add, β Real.exp_add] | |
| congr 1 | |
| ring | |
| rw [he] at h5 | |
| exact h5.congr_fun fun v => by unfold majorant; ring | |
| lemma coefficient_norm_le {L R r : β} (hr : 0 β€ r) (hL : L β€ r) (hR : r β€ R) (v : Index) : | |
| βcoefficient r vβ β€ Real.exp (-L) * (R^v.1 / v.1.factorial) * | |
| (R^v.2.1 / v.2.1.factorial) * (R^v.2.2 / v.2.2.factorial) := by | |
| simp only [coefficient, norm_mul, norm_div, norm_pow, norm_neg, Complex.norm_real, | |
| Real.norm_eq_abs, abs_of_nonneg hr, Complex.norm_natCast, Complex.norm_exp, | |
| Complex.neg_re, Complex.ofReal_re] | |
| have hR0 : 0 β€ R := hr.trans hR | |
| gcongr | |
| lemma power_coefficient_energy {ΞΉ ΞΈ : Type*} (H : Finset ΞΉ) (S : Finset ΞΈ) | |
| (Ο : ΞΉ β ΞΈ β β) (u : ΞΈ β β) (x : ΞΈ β β) {Ξ΄ K : β} | |
| (hΞ΄ : 0 β€ Ξ΄) (hK : 0 β€ K) (hx : β a β S, |x a| β€ Ξ΄) | |
| (hop : β v : ΞΈ β β, β h β H, ββ a β S, v a * Ο h aβ^2 β€ K * β a β S, βv aβ^2) | |
| (j : β) : | |
| β h β H, ββ a β S, (u a * (x a : β)^j) * Ο h aβ^2 β€ | |
| (Real.sqrt (K * β a β S, βu aβ^2) * Ξ΄^j)^2 := by | |
| apply (hop _).trans | |
| have he : β a β S, βu a * (x a : β)^jβ^2 β€ | |
| (β a β S, βu aβ^2) * (Ξ΄^j)^2 := by | |
| rw [Finset.sum_mul] | |
| apply Finset.sum_le_sum | |
| intro a ha | |
| simp only [norm_mul, norm_pow, Complex.norm_real, Real.norm_eq_abs, mul_pow] | |
| exact mul_le_mul_of_nonneg_left | |
| ((sq_le_sqβ (pow_nonneg (abs_nonneg _) _) (pow_nonneg hΞ΄ _)).2 | |
| (pow_le_pow_leftβ (abs_nonneg _) (hx a ha) j)) (sq_nonneg _) | |
| calc | |
| _ β€ K * ((β a β S, βu aβ^2) * (Ξ΄^j)^2) := mul_le_mul_of_nonneg_left he hK | |
| _ = _ := by | |
| rw [mul_pow, Real.sq_sqrt (mul_nonneg hK (Finset.sum_nonneg fun _ _ => sq_nonneg _))] | |
| ring | |
| theorem gaussian_gram_bound {ΞΉ ΞΈ : Type*} (H : Finset ΞΉ) (S : Finset ΞΈ) | |
| (Ο : ΞΉ β ΞΈ β β) (u : ΞΈ β β) (x : ΞΈ β β) (r : ΞΉ β β) | |
| {L R Ξ΄ K : β} (hΞ΄ : 0 β€ Ξ΄) (hK : 0 β€ K) | |
| (hx : β a β S, |x a| β€ Ξ΄) | |
| (hr : β h β H, 0 β€ r h β§ L β€ r h β§ r h β€ R) (hR : 0 β€ R) | |
| (hop : β v : ΞΈ β β, β h β H, ββ a β S, v a * Ο h aβ^2 β€ K * β a β S, βv aβ^2) : | |
| ββ h β H, β a β S, β b β S, | |
| (u a * Ο h a) * star (u b * Ο h b) * | |
| Complex.exp (-(r h : β)*(1-x a)*(1-x b))β β€ | |
| Real.exp (-L+(2*Ξ΄+Ξ΄^2)*R) * K * β a β S, βu aβ^2 := by | |
| let D := K * β a β S, βu aβ^2 | |
| have hD : 0 β€ D := mul_nonneg hK (Finset.sum_nonneg fun _ _ => sq_nonneg _) | |
| let F : Index β β := fun v => β h β H, coefficient (r h) v * | |
| (β a β S, (u a * (x a : β)^(v.1+v.2.2)) * Ο h a) * | |
| star (β a β S, (u a * (x a : β)^(v.2.1+v.2.2)) * Ο h a) | |
| have hs : HasSum F (β h β H, β a β S, β b β S, | |
| (u a * Ο h a) * star (u b * Ο h b) * | |
| Complex.exp (-(r h : β)*(1-x a)*(1-x b))) := by | |
| have hs := hasSum_sum (s := H) fun h _ => hasSum_sum (s := S) fun a _ => | |
| hasSum_sum (s := S) fun b _ => | |
| (kernel_hasSum (r h) (x a) (x b)).mul_left ((u a * Ο h a) * star (u b * Ο h b)) | |
| apply hs.congr_fun | |
| intro v | |
| unfold F | |
| apply Finset.sum_congr rfl | |
| intro h hh | |
| rw [star_sum, mul_assoc, Finset.sum_mul_sum] | |
| simp only [Finset.mul_sum, star_mul, star_pow, Complex.star_def, Complex.conj_ofReal] | |
| apply Finset.sum_congr rfl | |
| intro a ha | |
| apply Finset.sum_congr rfl | |
| intro b hb | |
| ring | |
| have hf (v : Index) : βF vβ β€ majorant L R Ξ΄ v * D := by | |
| let C := Real.exp (-L) * (R^v.1 / v.1.factorial) * | |
| (R^v.2.1 / v.2.1.factorial) * (R^v.2.2 / v.2.2.factorial) | |
| have hC : 0 β€ C := by dsimp [C]; positivity | |
| have hb := norm_weighted_pair_sum H | |
| (fun h => β a β S, (u a * (x a : β)^(v.1+v.2.2)) * Ο h a) | |
| (fun h => β a β S, (u a * (x a : β)^(v.2.1+v.2.2)) * Ο h a) | |
| (fun h => coefficient (r h) v) hC | |
| (show 0 β€ Real.sqrt D * Ξ΄^(v.1+v.2.2) by positivity) | |
| (show 0 β€ Real.sqrt D * Ξ΄^(v.2.1+v.2.2) by positivity) | |
| (fun h hh => coefficient_norm_le (hr h hh).1 (hr h hh).2.1 (hr h hh).2.2 v) | |
| (power_coefficient_energy H S Ο u x hΞ΄ hK hx hop _) | |
| (power_coefficient_energy H S Ο u x hΞ΄ hK hx hop _) | |
| apply hb.trans_eq | |
| calc | |
| _ = (Real.sqrt D)^2 * C * Ξ΄^(v.1+v.2.2) * Ξ΄^(v.2.1+v.2.2) := by ring | |
| _ = _ := by | |
| rw [Real.sq_sqrt hD] | |
| simp only [C, majorant, pow_add, mul_pow] | |
| ring | |
| have hb := hs.norm_le_of_bounded ((majorant_hasSum L R Ξ΄).mul_right D) hf | |
| simpa only [D, mul_assoc] using hb | |
| lemma gaussian_gram_envelope (T : β) : | |
| Real.exp (-T+(2*(1/10 : β)+(1/10 : β)^2)*(2*T)) = Real.exp (-(29/50 : β)*T) := by | |
| congr 1 | |
| ring | |
| end CubicFirstMoment.SieveKernel | |
| end | |
| end OAI | |
Outline
- lemma
norm_weighted_pair_sum14 - abbrev
Index38 - def
coefficient39 - def
majorant43 - lemma
exp_series_complex47 - lemma
exp_series_real50 - lemma
hasSum_mul_complex53 - lemma
hasSum_mul_real59 - lemma
kernel_hasSum65 - lemma
majorant_hasSum84 - lemma
coefficient_norm_le99 - lemma
power_coefficient_energy108 - theorem
gaussian_gram_bound133 - lemma
gaussian_gram_envelope191