Download data/lean/OAI/NumberTheory/CubicGram/GramNormalize.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.82 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/CubicGram/GramNormalize.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/CubicGram/GramNormalize.lean
-
curl -L -o GramNormalize.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/CubicGram/GramNormalize.lean
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 | |