Lean / Reader
Lean readerErdos824Marked.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports Erdos824.Final, Erdos821.P7.Support, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import Erdos824.Finalimport Erdos821.P7.Support/- The cardinal estimates below adapt Yao Xu's Count/Count.lean (Apache-2.0)to count the literal support before its projection to smooth successor primes. -/noncomputable sectionopen scoped BigOperatorsopen Filter Erdos821.Blueprint Erdos821.Blueprint.Analyticattribute [local instance] Classical.propDecidablenamespace Erdos824Markeddef supported (C : CandidateData) (x : ℝ) (j : ℕ) : Finset ℕ :=((Finset.Icc 1 ⌊2*x⌋₊).filter (fun u => Nat.Prime (2*u-1))).filter(fun u => C.weighted x j u ≠ 0)theorem row_factors (C : CandidateData) {δ x : ℝ} (hG : C.Geometry δ){j u : ℕ} (hj : C.j₀ ≤ j) (hu : 0 < u) (hw : C.weighted x j u ≠ 0) :3 ≤ C.bands.r₀ ∧ ∃ f : Fin C.bands.r₀ → ℕ,(∀ i, f i ∈ C.bands.band x 0) ∧ (∏ i, f i) ∣ u := byhave hcnt := hG.1.2.2.2.2.2.2.1rw [hG.2.1, hG.2.2.1, hG.2.2.2.1] at hcnthave hreal : (3 : ℝ) ≤ C.bands.r₀ := by linarithhave h0 : 0 < j := lt_of_lt_of_le (Nat.zero_lt_of_lt hG.2.2.2.2.2.2.2.1) hjhave hcoef : C.bands.aQ x j (groupFreePart (C.bands.groups x) u) ≠ 0 :=(mul_ne_zero_iff.mp (mul_ne_zero_iff.mp hw).1).1obtain ⟨z, hz⟩ := Erdos821.P7Core.exists_list_of_coefficient_ne_zero C.bands x j _ hcoeflet zrow : Fin (C.bands.last x + 1) := 0refine ⟨by exact_mod_cast hreal, fun i => (z (zrow,i)).val, ?_, ?_⟩· intro ihave hm := (z (zrow,i)).propertysimpa [BandData.slotValues, zrow, Nat.ne_of_gt h0, Ne.symm (Nat.ne_of_gt h0)] using hm· have hd : (∏ i, (z (zrow,i)).val) ∣ C.bands.listProduct z := byunfold BandData.listProductrw [Fintype.prod_prod_type]exact Finset.dvd_prod_of_mem (fun j' => ∏ i, (z (j',i)).val) (Finset.mem_univ zrow)rw [hz] at hdexact hd.trans (Erdos821.S56Core.groupFreePart_dvd _ _ hu)theorem support_mass {x : ℝ} {C : CandidateData} {jstar : ℕ} {K : ℝ}(hup : ∀ u : ℕ, C.weighted x jstar u ≤ Real.exp (K * Real.sqrt (L x))) :C.succPrimeMass x jstar ≤ ((supported C x jstar).card : ℝ) *Real.exp (K * Real.sqrt (L x)) := byset F : Finset ℕ :=(Finset.Icc 1 ⌊2 * x⌋₊).filter (fun u => Nat.Prime (2 * u - 1)) with hFdefset S : Finset ℕ :=F.filter (fun u => C.weighted x jstar u ≠ 0) with hSdefset W : ℝ := Real.exp (K * Real.sqrt (Erdos821.Blueprint.Analytic.L x)) with hWdefhave hprime_eq : C.succPrimeMass x jstar = ∑ u ∈ F, C.weighted x jstar u := rflhave hSF : S ⊆ F := Finset.filter_subset _ _have hsum_eq : ∑ u ∈ F, C.weighted x jstar u = ∑ u ∈ S, C.weighted x jstar u := bysymmapply Finset.sum_subset hSFintro u huF huShave hne : ¬ (C.weighted x jstar u ≠ 0) := byintro hneexact huS (Finset.mem_filter.mpr ⟨huF, hne⟩)exact not_ne_iff.mp hnehave hsum_le : ∑ u ∈ S, C.weighted x jstar u ≤ (S.card : ℝ) * W := byhave h := Finset.sum_le_card_nsmul S (fun u => C.weighted x jstar u) W(fun u _ => hup u)rw [nsmul_eq_mul] at hexact hexact hprime_eq.le.trans (hsum_eq.le.trans hsum_le)theorem supply (δ : ℝ) (hδ : 0 < δ) (hδ' : δ < 1 / 4) :∃ C : CandidateData, C.Geometry δ ∧ C.Bounds δ ∧ ∃ j : ℕ, C.j₀ ≤ j ∧∀ σ : ℝ, 0 < σ → ∀ᶠ x : ℝ in atTop, x ^ (1-σ) ≤ ((supported C x j).card : ℝ) := byhave h := Erdos824.Final.packageInterfaceshave hc := h.classicalhave hs := h.sieve hchave hii := h.typeII hc (h.shift hc hs (h.transference hc) (h.ideal hc))obtain ⟨C, hC⟩ := h.candidateGeometry δ hδ hδ'have hb := h.candidateBounds δ C hChave hp := h.extraction hc hs hii (h.proxies hc hs) δ C hC hb(h.candidateTypeI δ C hC hb) (h.balanced δ C hC hb)refine ⟨C, hC, hb, ?_⟩rcases hb with ⟨K, CA, cmin, cmax, hK, _, _, hBounds⟩rcases hp with ⟨jstar, hjstar, c, hc, hPrime⟩refine ⟨jstar, hjstar, ?_⟩intro σ hσhave hBj := hBounds jstar hjstarhave hAbs := Erdos824.Succ.Count.absorb K (CA + 1) σ c hK hσ hchave hGe5 : ∀ᶠ x : ℝ in atTop, (5 : ℝ) ≤ x := Filter.eventually_ge_atTop 5filter_upwards [hBj, hPrime, hAbs, hGe5] with x hB hP hA h5rcases hB with ⟨hmass_lo, _, _, _, hup, hsupp_full⟩have hxpos : 0 < x := by linarithhave hxnn : 0 ≤ x := le_of_lt hxposhave hLpos : 0 < Erdos821.Blueprint.Analytic.L x :=Real.log_pos (by linarith : (1 : ℝ) < x)have hLnn : 0 ≤ Erdos821.Blueprint.Analytic.L x := le_of_lt hLposhave hWpos : 0 < Real.exp (K * Real.sqrt (Erdos821.Blueprint.Analytic.L x)) :=Real.exp_pos _have hWnn : 0 ≤ Real.exp (K * Real.sqrt (Erdos821.Blueprint.Analytic.L x)) :=le_of_lt hWpos-- Upper bound: prime mass by smooth count times maximal weight.have hle1 : C.succPrimeMass x jstar ≤((supported C x jstar).card : ℝ) *Real.exp (K * Real.sqrt (Erdos821.Blueprint.Analytic.L x)) :=support_mass hup-- Lower bound chain: `c * (x * L ^ (-CA)) / L ≤ card * W`.have hLneg : Erdos821.Blueprint.Analytic.L x ^ (-CA) =(Erdos821.Blueprint.Analytic.L x ^ CA)⁻¹ :=Real.rpow_neg hLnn CAhave hLrpow_pos : 0 < Erdos821.Blueprint.Analytic.L x ^ CA :=Real.rpow_pos_of_pos hLpos CAhave hLneg_pos : 0 < Erdos821.Blueprint.Analytic.L x ^ (-CA) :=Real.rpow_pos_of_pos hLpos (-CA)have hlow : c * (x * Erdos821.Blueprint.Analytic.L x ^ (-CA)) /Erdos821.Blueprint.Analytic.L x ≤((supported C x jstar).card : ℝ) *Real.exp (K * Real.sqrt (Erdos821.Blueprint.Analytic.L x)) := byhave h1 : c * (x * Erdos821.Blueprint.Analytic.L x ^ (-CA)) ≤c * C.mass x jstar := byapply mul_le_mul_of_nonneg_left _ (le_of_lt hc)exact hmass_lohave h3 : c * (x * Erdos821.Blueprint.Analytic.L x ^ (-CA)) /Erdos821.Blueprint.Analytic.L x ≤c * C.mass x jstar / Erdos821.Blueprint.Analytic.L x := byhave hLinvnn : 0 ≤ (Erdos821.Blueprint.Analytic.L x)⁻¹ :=inv_nonneg.mpr (le_of_lt hLpos)calc c * (x * Erdos821.Blueprint.Analytic.L x ^ (-CA)) /Erdos821.Blueprint.Analytic.L x= (c * (x * Erdos821.Blueprint.Analytic.L x ^ (-CA))) *(Erdos821.Blueprint.Analytic.L x)⁻¹ := by rw [div_eq_mul_inv]_ ≤ (c * C.mass x jstar) * (Erdos821.Blueprint.Analytic.L x)⁻¹ :=mul_le_mul_of_nonneg_right h1 hLinvnn_ = c * C.mass x jstar / Erdos821.Blueprint.Analytic.L x := byrw [div_eq_mul_inv]exact le_trans h3 (le_trans hP hle1)-- Combine with absorption to get `x ^ (1 - σ) ≤ card`.have hLadd : Erdos821.Blueprint.Analytic.L x ^ (CA + 1) =Erdos821.Blueprint.Analytic.L x ^ CA *Erdos821.Blueprint.Analytic.L x := byhave h := Real.rpow_add hLpos CA (1 : ℝ)rwa [Real.rpow_one] at hhave hLadd_pos : 0 < Erdos821.Blueprint.Analytic.L x ^ (CA + 1) :=Real.rpow_pos_of_pos hLpos (CA + 1)set D : ℝ := Erdos821.Blueprint.Analytic.L x ^ (CA + 1) *Real.exp (K * Real.sqrt (Erdos821.Blueprint.Analytic.L x)) * c⁻¹ with hDdefhave hDpos : 0 < D := byrw [hDdef]exact mul_pos (mul_pos hLadd_pos hWpos) (inv_pos.mpr hc)have hDnn : 0 ≤ D := le_of_lt hDposhave hAle : D ≤ x ^ σ := hA-- `x / D ≤ card`: from `hlow` via `x / D = (c * (x * L ^ (-CA)) / L) / W`.have hEq : x / D =(c * (x * Erdos821.Blueprint.Analytic.L x ^ (-CA)) /Erdos821.Blueprint.Analytic.L x) /Real.exp (K * Real.sqrt (Erdos821.Blueprint.Analytic.L x)) := byrw [hDdef, hLadd, hLneg]field_simphave hxD : x / D ≤ ((supported C x jstar).card : ℝ) := byrw [hEq]exact (div_le_iff₀ hWpos).mpr hlow-- `x ^ (1 - σ) = x / x ^ σ ≤ x / D`.have hxσpos : 0 < x ^ σ := Real.rpow_pos_of_pos hxpos σhave hrw : x ^ (1 - σ) = x / x ^ σ := byhave h1 : x ^ (1 - σ) = x ^ (1 : ℝ) / x ^ σ := Real.rpow_sub hxpos 1 σrwa [Real.rpow_one] at h1calc x ^ (1 - σ) = x / x ^ σ := hrw_ ≤ x / D :=div_le_div_of_nonneg_left hxnn hDpos hAle_ ≤ ((supported C x jstar).card : ℝ) := hxD#print axioms row_factors#print axioms supplyend Erdos824Marked