math / data /lean /OAI /NumberTheory /Jacobsthal /Analysis /CompactSmallCountErrors.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
2.9 kB
import OAI.NumberTheory.Jacobsthal.Estimates.LargeGapCountErrors
namespace OAI
namespace Erdos970
open scoped _root_.Erdos970
namespace NumberTheoryLean.CompactSmallCountErrors
open FinitePathGeometry PrimeHistories PrimeBinMembership ReferenceAdmission StrongSourceFamilies
open ActualCountErrorEdges ActualCountErrorMass SourcePrimeProductData
open LogarithmicBinPartition ErdosInverseCounts
open ErdosPrimeInputs.PrimePrefixMass ErdosPrimeInputs.PrimePrefixTail
theorem uniform_compact_small_count_errors (K d : ℝ) (hK : 3 ≀ K) (hd : 0 < d) :
βˆƒ C Bβ‚€ wβ‚€ : ℝ,0 < C ∧ 3 ≀ Bβ‚€ ∧ 1 < wβ‚€ ∧ βˆ€ B w top : ℝ,Bβ‚€ ≀ B β†’ wβ‚€ ≀ w β†’
w < top β†’ Real.log B ≀ d*Real.log w β†’ βˆ€ z : Node,
z.side=.even β†’ 199/100 ≀ z.ratio β†’ z.ratio ≀ 23/10 β†’ Consistent z β†’ z.cutoff=B β†’ z.closed=true β†’ w^B=top β†’
βˆ€ Y : β„•,0 < Y β†’ βˆ€ residue : β„• β†’ β„•,βˆ€ eps : ℝ,0 ≀ eps β†’ βˆ€ F : Finset (List β„•),
F βŠ† referencePrefixes w (sourcePrimeSet w top) z.side z.gap β†’
(βˆ€ ps∈F,(terminal w z ps).gap ≀ K ∧
|wordCountError Y (LargePrimeDeletion.cutoffPrimes ⌊wβŒ‹β‚Š) residue (SmallSieveFinite.smallEuler ⌊wβŒ‹β‚Š) ps| ≀ eps) β†’
(B^2/((Y:ℝ)*SmallSieveFinite.smallEuler ⌊wβŒ‹β‚Š))*(βˆ‘ ps∈F,
|(modulusCount Y (LargePrimeDeletion.cutoffPrimes ⌊wβŒ‹β‚Š) residue ps.prod:ℝ)-
((Y:ℝ)/(ps.prod:ℝ))*SmallSieveFinite.smallEuler ⌊wβŒ‹β‚Š|) ≀ C*eps := by
obtain ⟨C,Bβ‚€,W,hC,hBβ‚€,hW,hMass⟩ := uniform_source_family_mass K d hK hd
refine ⟨C,Bβ‚€,max W 2,hC,hBβ‚€,hW.trans_le (le_max_left _ _),?_⟩
intro B w top hB hwβ‚€ htop hcomp z hi h199 h23 hz hcut hclosed hpower Y hY residue eps heps F hF hGood
have hw : 1 < w := hW.trans_le ((le_max_left _ _).trans hwβ‚€)
have hw2 : 2 ≀ w := (le_max_right _ _).trans hwβ‚€
have hV : 0 < SmallSieveFinite.smallEuler ⌊wβŒ‹β‚Š :=
(inv_pos.mpr (zero_lt_one.trans hw)).trans_le (SmallSieveFinite.smallEuler_floor_ge_inv w hw2)
have hp : βˆ€ ps∈F,0 < ps.prod := fun ps hps => (reference_word_product_data hw htop z.side z.gap ps (hF hps)).1
rw [finite_count_error_weight B Y _ residue _ hY hV F hp]
have he : (βˆ‘ ps∈F,prefixWeight ps*|wordCountError Y (LargePrimeDeletion.cutoffPrimes ⌊wβŒ‹β‚Š) residue
(SmallSieveFinite.smallEuler ⌊wβŒ‹β‚Š) ps|) ≀ (βˆ‘ ps∈F,prefixWeight ps)*eps := by
rw [Finset.sum_mul]
apply Finset.sum_le_sum
intro ps hps
exact mul_le_mul_of_nonneg_left (hGood ps hps).2 (prefixWeight_nonneg ps)
have hsum := hMass B w top hB ((le_max_left _ _).trans hwβ‚€) htop hcomp z hi h199 h23 hz hcut hclosed hpower F hF
(fun ps hps => (hGood ps hps).1)
have hh := mul_le_mul_of_nonneg_left he (sq_nonneg B)
have hc := mul_le_mul_of_nonneg_right hsum heps
nlinarith
end NumberTheoryLean.CompactSmallCountErrors
end Erdos970
end OAI