math / data /lean /OAI /NumberTheory /CubicGram /GramNormalize.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
6.82 kB
import Mathlib
import OAI.NumberTheory.CubicGram.GramDyad
namespace OAI
/-! Scale-normalized coprime envelopes and divisor losses. -/
section
noncomputable section
open scoped BigOperators ContDiff
open Set Filter MeasureTheory Topology
attribute [local instance] Classical.propDecidable
namespace CubicFirstMoment
lemma gram_coprime_envelope {N a Z Ξ΅ : ℝ} (hN : 0 < N) (ha : 0 < a)
(haN : a ≀ 2*N) (hZ : 0 < Z) (hΞ΅ : 0 < Ξ΅) :
let c := Z/(27*a*N)
(Z^2/(81*a*N))*(((2*N)^Ξ΅/c)*((2*N)*gramDyadConstant Ξ΅*c^(-Ξ΅) +
gramDyadConstant (1+Ξ΅)*c^(-(1+Ξ΅)) +
(2*N)^(2/3 : ℝ)*gramDyadConstant (2/3+Ξ΅)*c^(-(2/3+Ξ΅)))) ≀
(108*(gramDyadConstant Ξ΅+gramDyadConstant (1+Ξ΅)+gramDyadConstant (2/3+Ξ΅))*(108 : ℝ)^Ξ΅) *
(N^3/Z)^Ξ΅*(Z*N+N^2+N^2*Z^(1/3 : ℝ)) := by
let q : ℝ := 27*a*N/Z
have hq : 0 < q := by dsimp [q]; positivity
have hi : Z/(27*a*N) = q⁻¹ := by dsimp [q]; rw [inv_div]
dsimp only
rw [hi]
have hp (p : ℝ) : (q⁻¹)^(-p) = q^p := by
rw [Real.inv_rpow hq.le,Real.rpow_neg hq.le,inv_inv]
rw [hp,hp,hp,Real.rpow_add hq,Real.rpow_add hq,Real.rpow_one]
let D := gramDyadConstant Ξ΅+gramDyadConstant (1+Ξ΅)+gramDyadConstant (2/3+Ξ΅)
have hk0 := gramDyadConstant_pos hΞ΅
have hk1 := gramDyadConstant_pos (by linarith : 0 < 1+Ξ΅)
have hk2 := gramDyadConstant_pos (by linarith : 0 < 2/3+Ξ΅)
have hD : 0 < D := by dsimp [D]; positivity
have he : Z^2/(81*a*N)*((2*N)^Ρ/q⁻¹*(2*N*gramDyadConstant Ρ*q^Ρ +
gramDyadConstant (1+Ξ΅)*(q*q^Ξ΅)+(2*N)^(2/3 : ℝ)*gramDyadConstant (2/3+Ξ΅)*(q^(2/3 : ℝ)*q^Ξ΅))) =
(1/3 : ℝ)*(2*N*q)^Ξ΅*(2*N*gramDyadConstant Ξ΅*Z+
gramDyadConstant (1+Ξ΅)*(Z*q)+gramDyadConstant (2/3+Ξ΅)*Z*(2*N*q)^(2/3 : ℝ)) := by
rw [Real.mul_rpow (by positivity : 0 ≀ 2*N) hq.le,
Real.mul_rpow (by positivity : 0 ≀ 2*N) hq.le]
dsimp [q]
field_simp
ring
rw [he]
have hB : 2*N*q ≀ 108*(N^3/Z) := by
dsimp [q]
calc
2*N*(27*a*N/Z) = (54*a*N^2)/Z := by ring
_ ≀ (108*N^3)/Z := div_le_div_of_nonneg_right (by
nlinarith [mul_nonneg (by linarith : 0 ≀ 2*N-a) (sq_nonneg N)]) hZ.le
_ = _ := by ring
have heps := Real.rpow_le_rpow (by positivity : 0 ≀ 2*N*q) hB hΞ΅.le
rw [Real.mul_rpow (by norm_num : (0 : ℝ) ≀ 108) (by positivity : 0 ≀ N^3/Z)] at heps
have hqbound : Z*q ≀ 54*N^2 := by dsimp [q]; field_simp; nlinarith
have hthird : Z*(2*N*q)^(2/3 : ℝ) ≀ 108*N^2*Z^(1/3 : ℝ) := by
have h := mul_le_mul_of_nonneg_left
(Real.rpow_le_rpow (by positivity : 0 ≀ 2*N*q) hB (by norm_num : (0 : ℝ) ≀ 2/3)) hZ.le
have hr : Z*(108*(N^3/Z))^(2/3 : ℝ) = (108 : ℝ)^(2/3 : ℝ)*N^2*Z^(1/3 : ℝ) := by
rw [Real.mul_rpow (by norm_num : (0 : ℝ) ≀ 108) (by positivity : 0 ≀ N^3/Z),
Real.div_rpow (by positivity : 0 ≀ N^3) hZ.le,← Real.rpow_natCast,
← Real.rpow_mul hN.le]
norm_num
have heZ : Z/(Z^(2/3 : ℝ)) = Z^(1/3 : ℝ) := by
nth_rw 1 [← Real.rpow_one Z]
rw [← Real.rpow_sub hZ]
norm_num
rw [show Z*((108 : ℝ)^(2/3 : ℝ)*(N^2/Z^(2/3 : ℝ))) =
(108 : ℝ)^(2/3 : ℝ)*N^2*(Z/Z^(2/3 : ℝ)) by ring,heZ]
rw [hr] at h
apply h.trans
gcongr
exact (Real.rpow_le_rpow_of_exponent_le (by norm_num : (1 : ℝ) ≀ 108)
(by norm_num : (2/3 : ℝ) ≀ 1)).trans_eq (Real.rpow_one _)
have hb : 2*N*gramDyadConstant Ξ΅*Z+gramDyadConstant (1+Ξ΅)*(Z*q)+
gramDyadConstant (2/3+Ξ΅)*Z*(2*N*q)^(2/3 : ℝ) ≀
108*D*(Z*N+N^2+N^2*Z^(1/3 : ℝ)) := by
have hk0D : gramDyadConstant Ξ΅ ≀ D := by dsimp [D]; linarith
have hk1D : gramDyadConstant (1+Ξ΅) ≀ D := by dsimp [D]; linarith
have hk2D : gramDyadConstant (2/3+Ξ΅) ≀ D := by dsimp [D]; linarith
calc
_ ≀ D*(2*N*Z+(54*N^2)+(108*N^2*Z^(1/3 : ℝ))) := by
have h0 := mul_le_mul_of_nonneg_right hk0D (by positivity : 0 ≀ 2*N*Z)
have h1 := mul_le_mul hk1D hqbound (by positivity) hD.le
have h2 := mul_le_mul hk2D hthird (by positivity) hD.le
nlinarith
_ ≀ _ := by nlinarith [mul_nonneg (hD.le) (by positivity : 0 ≀ Z*N),
mul_nonneg hD.le (sq_nonneg N)]
have h := mul_le_mul heps hb (by positivity) (by positivity)
have hL : 0 ≀ (2*N*q)^Ξ΅*(2*N*gramDyadConstant Ξ΅*Z+gramDyadConstant (1+Ξ΅)*(Z*q)+
gramDyadConstant (2/3+Ξ΅)*Z*(2*N*q)^(2/3 : ℝ)) := by positivity
dsimp [D] at h
nlinarith
theorem primaryCharacterGram_coprime_normalized (W : ℝ β†’ β„‚) (hW : HasCompactSupport W)
(hW' : ContDiff ℝ ∞ W) {Ξ΅ : ℝ} (hΞ΅ : 0 < Ξ΅) (hΞ΅1 : Ξ΅ ≀ 1) :
βˆƒ C : ℝ, 0 < C ∧ βˆ€ (S : Finset Eisenstein) (N : ℝ), 1 ≀ 2*N β†’
(βˆ€ b ∈ S, primary b ∧ Squarefree b ∧ N ≀ norm b ∧ norm b ≀ 2*N) β†’
βˆ€ (a : Eisenstein), primary a β†’ Squarefree a β†’ norm a ≀ 2*N β†’
(βˆ€ b ∈ S, IsCoprime a b ∧ a β‰  b) β†’ βˆ€ (Z : ℝ), 0 < Z β†’
(βˆ‘ b ∈ S, β€–primaryCharacterGram a b W Zβ€–^2) ≀
C*(N^3/Z)^Ξ΅*(Z*N+N^2+N^2*Z^(1/3 : ℝ)) := by
obtain ⟨C,hC,hc⟩ := primaryCharacterGram_coprime_explicit W hW hW' hΡ hΡ1
have hk0 := gramDyadConstant_pos hΞ΅
have hk1 := gramDyadConstant_pos (by linarith : 0 < 1+Ξ΅)
have hk2 := gramDyadConstant_pos (by linarith : 0 < 2/3+Ξ΅)
refine ⟨C*(108*(gramDyadConstant Ρ+gramDyadConstant (1+Ρ)+
gramDyadConstant (2/3+Ξ΅))*(108 : ℝ)^Ξ΅),by positivity,?_⟩
intro S N hN hS a ha hsa han hab Z hZ
have hNa : 0 < norm a := norm_pos_of_ne_zero (primary_ne_zero ha)
have h := mul_le_mul_of_nonneg_left (gram_coprime_envelope (by linarith) hNa han hZ hΞ΅) hC.le
have hh := hc S N hN hS a ha hsa hab Z hZ
dsimp only at h hh
nlinarith
lemma gram_scaled_loss {P Z K M Ξ΅ : ℝ} (hP : 1 ≀ P) (hZ : 1 ≀ Z)
(hK : 1 ≀ K) (hM : 1 ≀ M) (hMP : M ≀ 2*P) (hΞ΅ : 0 < Ξ΅) :
((P/K)^3/(Z/M))^Ξ΅ * ((Z/M)*(P/K)+(P/K)^2+(P/K)^2*(Z/M)^(1/3 : ℝ)) ≀
(2 : ℝ)^Ξ΅ * P^(4*Ξ΅) * (Z*P+P^2+P^2*Z^(1/3 : ℝ)) := by
have hP0 : 0 < P := by linarith
have hZ0 : 0 < Z := by linarith
have hK0 : 0 < K := by linarith
have hM0 : 0 < M := by linarith
have hnP : P/K ≀ P := div_le_self hP0.le hK
have hzZ : Z/M ≀ Z := div_le_self hZ0.le hM
have hx : (P/K)^3/(Z/M) ≀ 2*P^4 := by
rw [div_div_eq_mul_div]
calc
_ ≀ (P^3*(2*P))/1 := by gcongr
_ = _ := by ring
have hxpow := Real.rpow_le_rpow (by positivity : 0 ≀ (P/K)^3/(Z/M)) hx hΞ΅.le
rw [Real.mul_rpow (by norm_num : (0 : ℝ) ≀ 2) (by positivity : 0 ≀ P^4),
← Real.rpow_natCast P 4,← Real.rpow_mul hP0.le] at hxpow
have hshape : (Z/M)*(P/K)+(P/K)^2+(P/K)^2*(Z/M)^(1/3 : ℝ) ≀
Z*P+P^2+P^2*Z^(1/3 : ℝ) := by gcongr
exact mul_le_mul hxpow hshape (by positivity) (by positivity)
end CubicFirstMoment
end
end
end OAI