Download data/lean/OAI/NumberTheory/Jacobsthal/Analysis/JointModelDensity.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.54 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Jacobsthal/Analysis/JointModelDensity.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/Jacobsthal/Analysis/JointModelDensity.lean
-
curl -L -o JointModelDensity.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Jacobsthal/Analysis/JointModelDensity.lean
6.54 kB
| import OAI.NumberTheory.Jacobsthal.Estimates.JointModelCount | |
| import OAI.NumberTheory.Jacobsthal.Sieve.OddEulerCorrection | |
| namespace OAI | |
| namespace Erdos970 | |
| open scoped _root_.Erdos970 | |
| section | |
| namespace ErdosVarianceMoments | |
| open ErdosRandomVariance | |
| attribute [local instance] Classical.propDecidable | |
| attribute [local instance] Classical.decEq | |
| theorem jointDensity_nonneg (P S : Finset β) (hP : β t β P,t.Prime) : | |
| 0 β€ jointDensity P S := by | |
| apply Finset.prod_nonneg | |
| intro t ht | |
| let : NeZero t := β¨(hP t ht).ne_zeroβ© | |
| exact sub_nonneg.mpr (positionDensity_bounds S t).2 | |
| theorem odd_position_density_lower (P S : Finset β) (hP : β t β P,3 β€ t) (hS : S.card β€ 2) : | |
| (1 : β)/2*(sieveProduct P)^2 β€ jointDensity P S := by | |
| have hh := ErdosOddEulerCorrection.odd_two_class_product_lower P hP | |
| apply hh.trans | |
| apply Finset.prod_le_prodβ | |
| Β· intro t ht | |
| have ht3 : (3 : β) β€ t := by exact_mod_cast hP t ht | |
| exact sub_nonneg.mpr ((div_le_one (by linarith)).mpr (by linarith)) | |
| Β· intro t ht | |
| let : NeZero t := β¨by have := hP t ht;omegaβ© | |
| exact sub_le_sub_left (positionDensity_le_two S hS t) 1 | |
| theorem nonzero_jointDensity_lower (P S : Finset β) (hP : β t β P,t.Prime) | |
| (hS : S.card β€ 2) (hne : jointDensity P S β 0) : | |
| (1 : β)/2*(sieveProduct P)^2 β€ jointDensity P S := by | |
| by_cases h2 : 2 β P | |
| Β· have hodd (t : β) (ht : t β P.erase 2) : 3 β€ t := by | |
| have hh := Finset.mem_erase.mp ht | |
| have hp := (hP t hh.2).two_le | |
| omega | |
| have hO := odd_position_density_lower (P.erase 2) S hodd hS | |
| have hO0 := jointDensity_nonneg (P.erase 2) S (fun t ht => hP t (Finset.mem_erase.mp ht).2) | |
| have hT := nonzero_positionDensity_two P S hS hne h2 | |
| have hK : jointDensity P S = (1-positionDensity S 2)*jointDensity (P.erase 2) S := | |
| (Finset.mul_prod_erase P (fun t => 1-positionDensity S t) h2).symm | |
| have hV : sieveProduct P = (1/2 : β)*sieveProduct (P.erase 2) := by | |
| rw [sieveProduct,β Finset.mul_prod_erase P (fun t => 1-1/(t : β)) h2] | |
| norm_num [sieveProduct] | |
| have hmul := mul_le_mul_of_nonneg_right (show (1 : β)/2 β€ 1-positionDensity S 2 by linarith) hO0 | |
| rw [hV,hK] | |
| nlinarith [sq_nonneg (sieveProduct (P.erase 2))] | |
| Β· exact odd_position_density_lower P S (fun t ht => by | |
| have hp := (hP t ht).two_le | |
| have hn : t β 2 := fun he => h2 (he βΈ ht) | |
| omega) hS | |
| end ErdosVarianceMoments | |
| end | |
| section | |
| open _root_.Filter | |
| namespace ErdosVarianceUniformMoments | |
| open NumberTheoryLean ErdosVarianceMoments ErdosRandomVariance ErdosInverseEuler | |
| attribute [local instance] Classical.propDecidable | |
| attribute [local instance] Classical.decEq | |
| noncomputable def densityInverseConstant : β := 8*(Real.exp Real.eulerMascheroniConstant)^2 | |
| theorem densityInverseConstant_pos : 0 < densityInverseConstant := by | |
| dsimp [densityInverseConstant] | |
| positivity | |
| theorem actual_sieveProduct (w : β) : | |
| sieveProduct (LargePrimeDeletion.cutoffPrimes βwββ) = SmallSieveFinite.smallEuler βwββ := by | |
| simp only [sieveProduct,SmallSieveFinite.smallEuler,one_div] | |
| theorem uniform_density_inverse : βαΆ w : β in atTop,2 β€ w β§ | |
| β S : Finset β,S.card β€ 2 β jointDensity (LargePrimeDeletion.cutoffPrimes βwββ) S β 0 β | |
| (jointDensity (LargePrimeDeletion.cutoffPrimes βwββ) S)β»ΒΉ β€ | |
| densityInverseConstant*(Real.log w)^2 := by | |
| filter_upwards [smallEuler_log_bounds] with w hw | |
| refine β¨hw.1,?_β© | |
| intro S hS hne | |
| let P := LargePrimeDeletion.cutoffPrimes βwββ | |
| let V := SmallSieveFinite.smallEuler βwββ | |
| let K := jointDensity P S | |
| let B := 2*Real.exp Real.eulerMascheroniConstant*Real.log w | |
| have hP (t : β) (ht : t β P) : t.Prime := (LargePrimeDeletion.mem_cutoffPrimes.mp ht).1 | |
| have hlow := nonzero_jointDensity_lower P S hP hS hne | |
| rw [actual_sieveProduct] at hlow | |
| have hV : 0 < V := hw.2.1 | |
| have hVB : 1 β€ V*B := by | |
| have hh := mul_le_mul_of_nonneg_left hw.2.2.2 hV.le | |
| change V*Vβ»ΒΉ β€ V*B at hh | |
| simpa only [mul_inv_cancelβ hV.ne'] using hh | |
| have hsq : (1 : β) β€ V^2*B^2 := by | |
| have hh := pow_le_pow_leftβ (by norm_num : (0 : β) β€ 1) hVB 2 | |
| simpa only [one_pow,mul_pow] using hh | |
| have hm := mul_le_mul_of_nonneg_right hlow (sq_nonneg B) | |
| have hKpos : 0 < K := (by dsimp [K,V] at *;positivity : 0 < (1 : β)/2*V^2).trans_le hlow | |
| have hb : 2*B^2 = densityInverseConstant*(Real.log w)^2 := by | |
| dsimp [B,densityInverseConstant] | |
| ring | |
| have hmain : 1 β€ (densityInverseConstant*(Real.log w)^2)*K := by | |
| rw [β hb] | |
| dsimp [K,V] at * | |
| nlinarith | |
| rw [β one_div] | |
| exact (div_le_iffβ hKpos).mpr hmain | |
| end ErdosVarianceUniformMoments | |
| end | |
| section | |
| namespace ErdosVarianceMoments | |
| open NumberTheoryLean ErdosVarianceSmallModel | |
| attribute [local instance] Classical.propDecidable | |
| attribute [local instance] Classical.decEq | |
| theorem jointDensity_le_one (P S : Finset β) (hP : β t β P,t.Prime) : jointDensity P S β€ 1 := by | |
| apply Finset.prod_le_oneβ | |
| Β· intro t ht | |
| let : NeZero t := β¨(hP t ht).ne_zeroβ© | |
| exact sub_nonneg.mpr (positionDensity_bounds S t).2 | |
| Β· intro t ht | |
| let : NeZero t := β¨(hP t ht).ne_zeroβ© | |
| have hh := (positionDensity_bounds S t).1 | |
| linarith | |
| theorem jointDensity_split (w : β) (H : β) (S : Finset β) : | |
| jointDensity (divisorPrimes w H) S*jointDensity (coprimePrimes w H) S = | |
| jointDensity (LargePrimeDeletion.cutoffPrimes βwββ) S := by | |
| unfold jointDensity divisorPrimes coprimePrimes | |
| exact Finset.prod_filter_mul_prod_filter_not _ _ _ | |
| theorem model_normalization_identity (R xi w : β) (H : β) (C0 : β€) | |
| (hR : 0 < R) (hxi : 0 β€ xi) (hH : 0 < H) : | |
| atomWeight R xi w H C0*(divisorModulus w H : β)* | |
| ((coprimeModulus w H).totient : β)* | |
| (modelLength R xi (H : β) (C0 : β)*((H.totient : β)/(H : β))) = 1 := by | |
| have hHN : (H : β) β 0 := by exact_mod_cast hH.ne' | |
| have hphi : (H.totient : β) β 0 := by exact_mod_cast (Nat.totient_pos.mpr hH).ne' | |
| have hT0 : (divisorModulus w H : β) β 0 := by exact_mod_cast (divisorModulus_pos w H).ne' | |
| have hT1 : ((coprimeModulus w H).totient : β) β 0 := by | |
| exact_mod_cast (Nat.totient_pos.mpr (coprimeModulus_pos w H)).ne' | |
| have hY : 0 < modelLength R xi (H : β) (C0 : β) := by | |
| have hHR : (0 : β) < H := by exact_mod_cast hH | |
| dsimp [modelLength,interceptScale] | |
| positivity | |
| unfold atomWeight | |
| field_simp | |
| end ErdosVarianceMoments | |
| end | |
| end Erdos970 | |
| end OAI | |