Add lean source and binary files (part 114)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelBlocks.leanAdded+95
- lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelCoordinates.leanAdded+70
- lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelOperator.leanAdded+56
- lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelPolynomial.leanAdded+82
- lean/OAI/NumberTheory/Ostmann/Supply/LocalProjectionBlocks.leanAdded+55
- lean/OAI/NumberTheory/Ostmann/Supply/LocalSparseKernelContraction.leanAdded+85
- lean/OAI/NumberTheory/Ostmann/Supply/LocalSparsePolydisc.leanAdded+75
- lean/OAI/NumberTheory/Ostmann/Supply/LogImbalanceVariance.leanAdded+77
- lean/OAI/NumberTheory/Ostmann/Supply/LogRatioCauchy.leanAdded+56
- lean/OAI/NumberTheory/Ostmann/Supply/MultiplierRatioProduct.leanAdded+56
- lean/OAI/NumberTheory/Ostmann/Supply/MultiplierWeightedBudget.leanAdded+92
- lean/OAI/NumberTheory/Ostmann/Supply/NaturalPrimeSupportSieve.leanAdded+60
- lean/OAI/NumberTheory/Ostmann/Supply/NaturalResidueAverage.leanAdded+35
- lean/OAI/NumberTheory/Ostmann/Supply/NaturalWeight.leanAdded+46
- lean/OAI/NumberTheory/Ostmann/Supply/NonnegativeSparseWeight.leanAdded+57
- lean/OAI/NumberTheory/Ostmann/Supply/NonsparseSupply.leanAdded+90
- lean/OAI/NumberTheory/Ostmann/Supply/PolynomialFunctional.leanAdded+79
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelection.leanAdded+59
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelectionBalance.leanAdded+67
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelectionBudget.leanAdded+60
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelectionFinite.leanAdded+85
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeEnumeration.leanAdded+64
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeMeanBounds.leanAdded+62
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeMeanIdentity.leanAdded+100
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeMeanScale.leanAdded+30
- lean/OAI/NumberTheory/Ostmann/Supply/PrimePowerTransfer.leanAdded+79
- lean/OAI/NumberTheory/Ostmann/Supply/PrimePowerTransferBasic.leanAdded+72
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeSetSupportSieve.leanAdded+79
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetMainTerm.leanAdded+35
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetMass.leanAdded+37
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetProducts.leanAdded+61
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetSieve.leanAdded+70
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeSupportEnergy.leanAdded+52
- lean/OAI/NumberTheory/Ostmann/Supply/PrimeSupportSieve.leanAdded+51
- lean/OAI/NumberTheory/Ostmann/Supply/ProjectionCrossBound.leanAdded+56
- lean/OAI/NumberTheory/Ostmann/Supply/ProjectionScalar.leanAdded+68
- lean/OAI/NumberTheory/Ostmann/Supply/RawBlockBounds.leanAdded+55
- lean/OAI/NumberTheory/Ostmann/Supply/ResidueBudgetScale.leanAdded+72
- lean/OAI/NumberTheory/Ostmann/Supply/ResidueKernel.leanAdded+59
- lean/OAI/NumberTheory/Ostmann/Supply/ResidueKernelNormBounds.leanAdded+73
- lean/OAI/NumberTheory/Ostmann/Supply/ResidueProjectionScalar.leanAdded+105
- lean/OAI/NumberTheory/Ostmann/Supply/ResidueProjectionSides.leanAdded+94
- lean/OAI/NumberTheory/Ostmann/Supply/ResidueRatio.leanAdded+84
- lean/OAI/NumberTheory/Ostmann/Supply/ResidueTensor.leanAdded+62
- lean/OAI/NumberTheory/Ostmann/Supply/ResidueVectorNorm.leanAdded+64
- lean/OAI/NumberTheory/Ostmann/Supply/RestrictedSubsetEnergy.leanAdded+85
- lean/OAI/NumberTheory/Ostmann/Supply/RetainedBandProducts.leanAdded+86
- lean/OAI/NumberTheory/Ostmann/Supply/RetainedBandScales.leanAdded+58
- lean/OAI/NumberTheory/Ostmann/Supply/SieveBudgetParameters.leanAdded+73
- lean/OAI/NumberTheory/Ostmann/Supply/SmoothPrimeWeight.leanAdded+41
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495import OAI.NumberTheory.Ostmann.Supply.BalancedProjectionBlocksimport OAI.NumberTheory.Ostmann.Supply.LocalBlockConstantimport OAI.NumberTheory.Ostmann.Supply.LocalKernelOperatorimport OAI.NumberTheory.Ostmann.Supply.ProjectionScalarimport OAI.NumberTheory.Ostmann.Supply.RawBlockBounds
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators ComplexConjugatevariable {p : ℕ} [NeZero p]local notation "H" => EuclideanSpace ℂ (ZMod p)
def kernelScalar (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) : ℂ := inner ℂ (uniformVector S) (localKernelOperator S t u v (uniformVector Sᶜ))
theorem kernelScalar_expansion (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) (hS : S.Nonempty) (hT : Sᶜ.Nonempty) : kernelScalar S t u v = 1 + ((u+v)*(t:ℂ))* inner ℂ (uniformVector S) (spectralProjection (largeSpectrum S) (uniformVector Sᶜ)) + (u*v)*inner ℂ (uniformVector S) (squaredLocalKernelOperator S t (uniformVector Sᶜ)) := by simp only [kernelScalar,localKernelOperator_decomposition, add_apply,smul_apply, convolution_one_apply,sum_uniformVector_all _ hT,one_smul, inner_add_right,inner_smul_right,uniformVector_oneVector _ hS]
theorem localKernel_row_bound (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) {ε : ℝ} (hlo : (1/3:ℝ) ≤ density S) (hhi : density S ≤ 2/3) (hε : 0 ≤ ε) (hg : gamma S ≤ ε^2) (z : centeredSpace Sᶜ) : ‖inner ℂ (uniformVector S) (localKernelOperator S t u v (z:H))‖ ≤ (‖(u+v)*(t:ℂ)‖*(2*ε/Real.sqrt p) + ‖u*v‖*((2/Real.sqrt p)*‖squaredLocalKernelOperator S t‖))*‖z‖ := by simp only [localKernelOperator_decomposition,add_apply, smul_apply,convolution_one_apply,sum_centered_all,zero_smul, inner_add_right,inner_smul_right,zero_add] have hP := balanced_projection_row_le S hlo hhi hε hg z have hB : ‖inner ℂ (uniformVector S) (squaredLocalKernelOperator S t (z:H))‖ ≤ ((2/Real.sqrt p)*‖squaredLocalKernelOperator S t‖)*‖z‖ := (raw_row_bound S Sᶜ _ z).trans (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (balanced_uniform_norm S hlo) (norm_nonneg _)) (norm_nonneg _)) calc _ ≤ ‖((u+v)*(t:ℂ))*inner ℂ (uniformVector S) (spectralProjection (largeSpectrum S) (z:H))‖ + ‖(u*v)*inner ℂ (uniformVector S) (squaredLocalKernelOperator S t (z:H))‖ := norm_add_le _ _ _ ≤ ‖(u+v)*(t:ℂ)‖*((2*ε/Real.sqrt p)*‖z‖) + ‖u*v‖*(((2/Real.sqrt p)*‖squaredLocalKernelOperator S t‖)*‖z‖) := by simp only [norm_mul] exact add_le_add (mul_le_mul_of_nonneg_left hP (by positivity)) (mul_le_mul_of_nonneg_left hB (by positivity)) _ = _ := by ring
theorem localKernel_column_bound (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) {ε : ℝ} (hlo : (1/3:ℝ) ≤ density S) (hhi : density S ≤ 2/3) (hε : 0 ≤ ε) (hg : gamma S ≤ ε^2) : ‖centeredProjection S (localKernelOperator S t u v (uniformVector Sᶜ))‖ ≤ ‖(u+v)*(t:ℂ)‖*(2*ε/Real.sqrt p) + ‖u*v‖*((2/Real.sqrt p)*‖squaredLocalKernelOperator S t‖) := by simp only [localKernelOperator_decomposition,add_apply, smul_apply,convolution_one_apply, sum_uniformVector_all _ (balanced_nonempty _ (balanced_compl S hlo hhi).1),one_smul, map_add,map_smul,centeredProjection_oneVector,zero_add] have hP := balanced_projection_column_le S hlo hhi hε hg have hB : ‖centeredProjection S (squaredLocalKernelOperator S t (uniformVector Sᶜ))‖ ≤ (2/Real.sqrt p)*‖squaredLocalKernelOperator S t‖ := by calc _ ≤ ‖squaredLocalKernelOperator S t‖*‖uniformVector Sᶜ‖ := raw_column_bound S Sᶜ _ _ ≤ ‖squaredLocalKernelOperator S t‖*(2/Real.sqrt p) := mul_le_mul_of_nonneg_left (balanced_uniform_norm _ (balanced_compl S hlo hhi).1) (norm_nonneg _) _ = _ := by ring exact (norm_add_le _ _).trans (by simp only [norm_smul] exact add_le_add (mul_le_mul_of_nonneg_left hP (by positivity)) (mul_le_mul_of_nonneg_left hB (by positivity)))
theorem localKernel_lower_bound (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) (z : centeredSpace Sᶜ) : ‖centeredProjection S (localKernelOperator S t u v (z:H))‖ ≤ (‖(u+v)*(t:ℂ)‖/2+‖u*v‖*‖squaredLocalKernelOperator S t‖)*‖z‖ := by simp only [localKernelOperator_decomposition,add_apply, smul_apply,convolution_one_apply,sum_centered_all,zero_smul, map_add,map_smul,zero_add] calc _ ≤ ‖((u+v)*(t:ℂ)) • centeredProjection S (spectralProjection (largeSpectrum S) (z:H))‖ + ‖(u*v) • centeredProjection S (squaredLocalKernelOperator S t (z:H))‖ := norm_add_le _ _ _ ≤ ‖(u+v)*(t:ℂ)‖*((1/2:ℝ)*‖z‖)+‖u*v‖*(‖squaredLocalKernelOperator S t‖*‖z‖) := by simp only [norm_smul] exact add_le_add (mul_le_mul_of_nonneg_left (projection_lower_le S z) (norm_nonneg _)) (mul_le_mul_of_nonneg_left (raw_lower_bound S Sᶜ _ z) (norm_nonneg _)) _ = _ := by ring
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970import OAI.NumberTheory.Ostmann.Supply.BivariateTruncationimport OAI.NumberTheory.Ostmann.Supply.LocalBlockConstantimport OAI.NumberTheory.Ostmann.Supply.LocalKernelOperator
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators ComplexConjugatevariable {ι : Type*} [Fintype ι] [DecidableEq ι]local notation "H" => EuclideanSpace ℂ ι
def localPoint (S : Finset ι) (x : ι) : LocalCoordinates S := WithLp.toLp 2 (1,(centeredSpace S).orthogonalProjectionOnto (EuclideanSpace.single x (1:ℂ)))
@[simp] theorem localPoint_fst (S : Finset ι) (x : ι) : (localPoint S x).fst = 1 := rfl@[simp] theorem localPoint_snd (S : Finset ι) (x : ι) : ((localPoint S x).snd:H) = centeredProjection S (EuclideanSpace.single x (1:ℂ)) := rfl
theorem coordinateLift_point (S : Finset ι) (x : ι) (hx : x∈S) : coordinateLift S (localPoint S x) = EuclideanSpace.single x (1:ℂ) := by rw [coordinateLift_apply,localPoint_fst,localPoint_snd,one_smul,centeredProjection_single S x hx] abel
theorem localPoint_extract_pairing (S : Finset ι) (x : ι) (hx : x∈S) (f : H) : inner ℂ (localPoint S x) (coordinateExtract S f) = f x := by rw [WithLp.prod_inner_apply] change inner ℂ (1:ℂ) (inner ℂ (uniformVector S) f) + inner ℂ ((centeredSpace S).orthogonalProjectionOnto (EuclideanSpace.single x (1:ℂ))) ((centeredSpace S).orthogonalProjectionOnto f) = _ rw [Submodule.inner_orthogonalProjectionOnto_eq_of_mem_left] change inner ℂ (1:ℂ) (inner ℂ (uniformVector S) f) + inner ℂ (centeredProjection S (EuclideanSpace.single x (1:ℂ))) f = _ rw [centeredProjection_single S x hx,inner_sub_left,EuclideanSpace.inner_single_left] simp only [RCLike.inner_apply,map_one,mul_one] ring
theorem localPoint_gram (S : Finset ι) (x y : ι) : inner ℂ (localPoint S x) (localPoint S y) = 1+ inner ℂ (centeredProjection S (EuclideanSpace.single x (1:ℂ))) (centeredProjection S (EuclideanSpace.single y (1:ℂ))) := by rw [WithLp.prod_inner_apply] change inner ℂ (1:ℂ) (1:ℂ) + _ = _ simp only [RCLike.inner_apply,map_one,mul_one] rfl
theorem localBlock_point_pairing (S T : Finset ι) (K : H →L[ℂ] H) (x y : ι) (hx : x∈S) (hy : y∈T) : inner ℂ (localPoint S x) (localBlock S T K (localPoint T y)) = K (EuclideanSpace.single y (1:ℂ)) x := by unfold localBlock simp only [ContinuousLinearMap.comp_apply,coordinateLift_point T y hy] exact localPoint_extract_pairing S x hx _
section Cyclicvariable {p : ℕ} [NeZero p]
theorem localKernelBlock_point_pairing (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) (x y : ZMod p) (hx : x∈S) (hy : y∈Sᶜ) : inner ℂ (localPoint S x) (localKernelBlock S t u v (localPoint Sᶜ y)) = (1+u*(localKernel S t (x-y):ℂ))*(1+v*(localKernel S t (x-y):ℂ)) := by rw [localKernelBlock,localBlock_point_pairing S Sᶜ _ x y hx hy] simp [localKernelOperator,convolutionOperator_matrix,PiLp.single_apply]
end Cyclicend Ostmann.Supply
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import OAI.NumberTheory.Ostmann.Supply.KernelMomentsimport OAI.NumberTheory.Ostmann.Supply.LocalBlock
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators ComplexConjugatevariable {p : ℕ} [NeZero p]local notation "H" => EuclideanSpace ℂ (ZMod p)
def localKernelOperator (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) : H →L[ℂ] H := convolutionOperator (fun x => (1+u*(localKernel S t x:ℂ))*(1+v*(localKernel S t x:ℂ)))
def squaredLocalKernelOperator (S : Finset (ZMod p)) (t : ℝ) : H →L[ℂ] H := convolutionOperator (fun x => (localKernel S t x:ℂ)^2)
def localKernelBlock (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) : LocalCoordinates Sᶜ →L[ℂ] LocalCoordinates S := localBlock S Sᶜ (localKernelOperator S t u v)
theorem localKernelOperator_decomposition (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) : localKernelOperator S t u v = convolutionOperator (fun _ : ZMod p => (1:ℂ)) + ((u+v)*(t:ℂ)) • spectralProjection (largeSpectrum S) + (u*v) • squaredLocalKernelOperator S t := by rw [← convolution_fourierKernel] ext f x simp only [localKernelOperator,squaredLocalKernelOperator,convolutionOperator_apply, add_apply,smul_apply, PiLp.add_apply,PiLp.smul_apply,smul_eq_mul,localKernel_cast, Finset.mul_sum,←Finset.sum_add_distrib] apply Finset.sum_congr rfl intro z hz ring
theorem squaredLocalKernelOperator_norm_le (S : Finset (ZMod p)) (t : ℝ) : ‖squaredLocalKernelOperator S t‖ ≤ t^2*((largeSpectrum S).card:ℝ)/p := by unfold squaredLocalKernelOperator simp only [localKernel_cast] simpa only [mul_div_assoc] using squareKernel_norm_le (largeSpectrum S) t
theorem squaredLocalKernelOperator_norm_le_sparse (S : Finset (ZMod p)) (t : ℝ) {ε : ℝ} (hε : 0 ≤ ε) (hε' : ε ≤ 1) (hg : gamma S ≤ ε^2) (hpos : 0 < density S) (hlt : density S < 1) : ‖squaredLocalKernelOperator S t‖ ≤ t^2*ε := by have hp : (0:ℝ) < p := Nat.cast_pos.mpr (Nat.pos_of_ne_zero (NeZero.ne p)) have hc := (sparse_transform_concentration S hpos hlt hε hε' hg).1 have hdiv : ((largeSpectrum S).card:ℝ)/p ≤ ε := (div_le_iff₀ hp).mpr hc exact (squaredLocalKernelOperator_norm_le S t).trans (by simpa only [mul_div_assoc] using mul_le_mul_of_nonneg_left hdiv (sq_nonneg t))
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182import OAI.NumberTheory.Ostmann.Supply.LocalKernelCoordinatesimport OAI.NumberTheory.Ostmann.Supply.TensorOperators
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators ComplexConjugateopen TensorOperatorsvariable {p : ℕ} [NeZero p]
def scalarOnly (S T : Finset (ZMod p)) : LocalCoordinates T →L[ℂ] LocalCoordinates S := (WithLp.prodContinuousLinearEquiv 2 ℂ ℂ (centeredSpace S)).symm.toContinuousLinearMap.comp ((WithLp.fstL 2 ℂ ℂ (centeredSpace T)).prod 0)
omit [NeZero p] in@[simp] theorem scalarOnly_fst (S T : Finset (ZMod p)) (x : LocalCoordinates T) : (scalarOnly S T x).fst = x.fst := rfl
omit [NeZero p] in@[simp] theorem scalarOnly_snd (S T : Finset (ZMod p)) (x : LocalCoordinates T) : (scalarOnly S T x).snd = 0 := rfl
theorem localBlock_constant_eq_scalarOnly (S T : Finset (ZMod p)) (hS : S.Nonempty) (hT : T.Nonempty) : localBlock S T (convolutionOperator (fun _ : ZMod p => (1:ℂ))) = scalarOnly S T := by apply ContinuousLinearMap.ext intro x apply (WithLp.equiv 2 (ℂ × centeredSpace S)).injective apply Prod.ext · exact localBlock_one_fst S T hS hT x · exact localBlock_one_snd S T hT x
theorem eval_four_single {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] (a b c d : E) (u v : ℂ) : BivariateTruncation.eval (Finsupp.single (0,0) a + Finsupp.single (1,0) b + Finsupp.single (0,1) c + Finsupp.single (1,1) d) u v = a+u•b+v•c+(u*v)•d := by change evalLinearMap u v _ = _ rw [map_add,map_add,map_add] simp only [evalLinearMap_apply,TensorOperators.eval_single,pow_zero,pow_one, mul_one,one_mul,one_smul]
theorem collect_scalar_pencil {E : Type*} [AddCommGroup E] [Module ℂ E] (a b c : E) (t u v : ℂ) : a+u•(t•b)+v•(t•b)+(u*v)•c = a+((u+v)*t)•b+(u*v)•c := by module
def localKernelPolynomial (S : Finset (ZMod p)) (t : ℝ) : (ℕ×ℕ) →₀ (LocalCoordinates Sᶜ →L[ℂ] LocalCoordinates S) := Finsupp.single (0,0) (localBlock S Sᶜ (convolutionOperator (fun _ : ZMod p => (1:ℂ)))) + Finsupp.single (1,0) ((t:ℂ) • localBlock S Sᶜ (spectralProjection (largeSpectrum S))) + Finsupp.single (0,1) ((t:ℂ) • localBlock S Sᶜ (spectralProjection (largeSpectrum S))) + Finsupp.single (1,1) (localBlock S Sᶜ (squaredLocalKernelOperator S t))
theorem eval_localKernelPolynomial (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) : @BivariateTruncation.eval (LocalCoordinates Sᶜ →L[ℂ] LocalCoordinates S) (by exact ContinuousLinearMap.toNormedAddCommGroup (𝕜 := ℂ) (𝕜₂ := ℂ) (E := LocalCoordinates Sᶜ) (F := LocalCoordinates S) (σ₁₂ := RingHom.id ℂ)) (by infer_instance) (localKernelPolynomial S t) u v = localKernelBlock S t u v := by let : NormedAddCommGroup (LocalCoordinates Sᶜ →L[ℂ] LocalCoordinates S) := by exact ContinuousLinearMap.toNormedAddCommGroup (𝕜 := ℂ) (𝕜₂ := ℂ) (E := LocalCoordinates Sᶜ) (F := LocalCoordinates S) (σ₁₂ := RingHom.id ℂ) rw [localKernelPolynomial,eval_four_single] rw [localKernelBlock,localKernelOperator_decomposition,localBlock_add,localBlock_add, localBlock_smul,localBlock_smul] apply ContinuousLinearMap.ext intro x simp only [add_apply,smul_apply] exact collect_scalar_pencil _ _ _ (t:ℂ) u v
theorem localKernelPolynomial_zero (S : Finset (ZMod p)) (t : ℝ) (hS : S.Nonempty) (hT : Sᶜ.Nonempty) : localKernelPolynomial S t (0,0) = scalarOnly S Sᶜ := by simp [localKernelPolynomial,localBlock_constant_eq_scalarOnly S Sᶜ hS hT]
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455import OAI.NumberTheory.Ostmann.Supply.ProjectionCrossBoundimport OAI.NumberTheory.Ostmann.Supply.UniformProjection
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators ComplexConjugatevariable {p : ℕ} [NeZero p]local notation "H" => EuclideanSpace ℂ (ZMod p)
theorem inner_centered_projected (S : Finset (ZMod p)) (f : H) (v : centeredSpace S) : inner ℂ f (v:H) = inner ℂ (centeredProjection S f) (v:H) := by change _ = inner ℂ ((centeredSpace S).starProjection f) (v:H) rw [Submodule.inner_starProjection_left_eq_right, Submodule.starProjection_eq_self_iff.mpr v.property]
theorem projection_row_le (S : Finset (ZMod p)) {ε : ℝ} (hpos : 0 < density S) (hlt : density S < 1) (hε : 0 ≤ ε) (hg : gamma S ≤ ε^2) (v : centeredSpace Sᶜ) : ‖inner ℂ (uniformVector S) (spectralProjection (largeSpectrum S) (v:H))‖ ≤ (uniformCoefficient S*(ε*Real.sqrt p))*‖v‖ := by have hi : inner ℂ (uniformVector S) (spectralProjection (largeSpectrum S) (v:H)) = inner ℂ (spectralProjection (largeSpectrum S) (uniformVector S)) (v:H) := ((frequencySpace (largeSpectrum S)).inner_starProjection_left_eq_right _ _).symm rw [hi,inner_centered_projected Sᶜ] exact (norm_inner_le_norm _ _).trans (mul_le_mul_of_nonneg_right (centered_projection_uniform_le S Sᶜ hpos hlt (centeredProjection_compl_normalizedVector S) hε hg) (norm_nonneg _))
theorem projection_column_le (S : Finset (ZMod p)) {ε : ℝ} (hpos : 0 < density S) (hlt : density S < 1) (hε : 0 ≤ ε) (hg : gamma S ≤ ε^2) : ‖centeredProjection S (spectralProjection (largeSpectrum S) (uniformVector Sᶜ))‖ ≤ uniformCoefficient Sᶜ*(ε*Real.sqrt p) := centered_projection_uniform_compl_le S S hpos hlt (centeredProjection_normalizedVector S) hε hg
theorem projection_lower_le (S : Finset (ZMod p)) (v : centeredSpace Sᶜ) : ‖centeredProjection S (spectralProjection (largeSpectrum S) (v:H))‖ ≤ (1/2:ℝ)*‖v‖ := by have hn := centeredProjection_cross_norm_le_half S Sᶜ (Finset.disjoint_left.mpr (fun x hx hxc => (Finset.mem_compl.mp hxc) hx)) (frequencySpace (largeSpectrum S)) have hv : centeredProjection Sᶜ (v:H) = (v:H) := Submodule.starProjection_eq_self_iff.mpr v.property have hb := (centeredProjection S ∘L spectralProjection (largeSpectrum S) ∘L centeredProjection Sᶜ).le_opNorm (v:H) simp only [ContinuousLinearMap.comp_apply,hv] at hb exact hb.trans (mul_le_mul_of_nonneg_right hn (norm_nonneg _))
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485import OAI.NumberTheory.Ostmann.Characters.SparseKernelLocalBlocksimport OAI.NumberTheory.Ostmann.Characters.SparseKernelUnitFactorimport OAI.NumberTheory.Ostmann.Characters.SparseKernelScalarRangeimport OAI.NumberTheory.Ostmann.Characters.SparseScalarNorm
namespace OAI
/-! # The contracting local sparse block at `(u,v)=(1,1)` -/
namespace Ostmannopen scoped Classical BigOperators ComplexConjugate
/-- The finite local contraction in Lemma 5.2, with the actual sparse spectrum,actual residue vectors, and the exact nonzero-residue normalizing factor. -/theorem local_sparse_kernel_contraction {p : ℕ} [Fact p.Prime] (S : Finset (ZMod p)) (hS : S.Nonempty) (hSp : S.card < p) (hp : (100 : ℝ) ≤ p) (hlo : (1 / 3 : ℝ) ≤ residueDensity S) (hhi : residueDensity S ≤ 2 / 3) (ε : ℝ) (hε : 0 ≤ ε) (hεsmall : ε ≤ 1 / 1000000) (hL1 : (p : ℝ)⁻¹ * ∑ b, ‖normalizedResidueTransform S b‖ ≤ ε ^ 2) : let E := largeTransformSpectrum (normalizedResidueTransform S) let T := Finset.univ \ S let U := sparseKernelUnitFactor p ((E.card : ℝ) / p) 0 < U ∧ ((U : ℝ) : ℂ) = ((p : ℂ) - 1)⁻¹ * ∑ x ∈ Finset.univ.erase 0, (1 + localSparseKernel E x) ^ 2 ∧ ∀ (z : ℂ) (f : ZMod p → ℂ), ‖localSparseScalar S E * z + ∑ x, conj (localSparseSide T S E x) * f x‖ ^ 2 + residueVectorNorm (fun x => z * localSparseSide S T E x + localSparseLower S T E f x) ^ 2 ≤ (U * (1 - (8 / 5) / p)) ^ 2 * (‖z‖ ^ 2 + residueVectorNorm f ^ 2) := by intro E T U have hp0 : (0 : ℝ) < p := by linarith have hpNat : 1 < p := by have hh : (1 : ℝ) < p := lt_of_lt_of_le (by norm_num) hp exact_mod_cast hh obtain ⟨hz, hn, hc, _hconst, he, herr⟩ := sparse_residue_projection S hS hSp ε hε (by linarith) hL1 have hratio : (E.card : ℝ) / p ≤ ε := (div_le_iff₀ hp0).mpr hc have hratio0 : 0 ≤ (E.card : ℝ) / p := by positivity have hU := sparseKernelUnitFactor_lower p ((E.card : ℝ) / p) ε (by linarith) hratio0 hratio hε (by linarith) refine ⟨sparseKernelUnitFactor_positive p _ ε hp hratio0 hratio hε hεsmall, ?_, ?_⟩ · exact sparseKernelUnitFactor_mean E hz hn hpNat · intro z f let a₁ := residueKernelScalar S (localSparseKernel E) let a₂ := residueKernelScalar S (localSparseSquare E) have ha0 := residueKernelScalar_sparse_lower S E hS hSp hz (17 / 20) (by norm_num) have ha1 := residueKernelScalar_sparse_re_le S E hS hSp hz (17 / 20) ε (by norm_num) he change a₁.re ≤ -(17 / 20 * (1 - ε ^ 2)) / p at ha1 have ha2 := squareKernel_scalar_norm_le S E hS hSp hlo hhi (17 / 20) ε hε hc change ‖a₂‖ ≤ _ at ha2 norm_num at ha2 have har : a₁ = (a₁.re : ℂ) := by apply Complex.ext · rfl · simpa only [Complex.ofReal_im, a₁, localSparseKernel] using residueKernelScalar_sparse_real S E hS hSp hz (17 / 20) have haeq : localSparseScalar S E = ((1 + 2 * a₁.re : ℝ) : ℂ) + a₂ := by change 1 + 2 * a₁ + a₂ = _ rw [har] push_cast rfl have has := sparse_scalar_norm_bounds p ε a₁.re a₂ hp hε hεsmall ha0 (by convert ha1 using 1 ring) ha2 rw [← haeq] at has obtain ⟨hproj₁, hproj₂⟩ := residueProjection_side_norms S E hS hSp hz hlo hhi ε hε herr obtain ⟨hu₁, hu₂⟩ := balanced_uniform_norms S hS hSp hlo hhi have hrow := localSparseSide_norm_le T S E ε hε hc hproj₁ hu₁ have hcol := localSparseSide_norm_le S T E ε hε hc hproj₂ hu₂ have hST : Disjoint S T := by apply Finset.disjoint_left.mpr intro x hx hxT exact (Finset.mem_sdiff.mp hxT).2 hx have hC := localSparseLower_norm_le S T E hST ε hε hεsmall hc have hblock := residue_block_energy (localSparseScalar S E) (localSparseSide T S E) (localSparseSide S T E) (localSparseLower S T E) ‖localSparseScalar S E‖ (9 / 10) (6 * ε / Real.sqrt (p : ℝ)) (norm_nonneg _) (by norm_num) (by linarith [has.1]) le_rfl hrow hcol hC z f have hM := sparse_kernel_numeric_margin p ε ‖localSparseScalar S E‖ U hp hε hεsmall has.2 hU apply hblock.trans apply mul_le_mul_of_nonneg_right _ (add_nonneg (sq_nonneg _) (sq_nonneg _)) exact pow_le_pow_left₀ (by positivity) hM 2
end Ostmann
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475import OAI.NumberTheory.Ostmann.Characters.SparsePolydiscBlocks
namespace OAI
/-! # Uniform complex-parameter bound for the local sparse block -/
namespace Ostmannopen scoped Classical BigOperators ComplexConjugate
theorem local_sparse_polydisc {p : ℕ} [Fact p.Prime] (S : Finset (ZMod p)) (hS : S.Nonempty) (hSp : S.card < p) (hp : (100 : ℝ) ≤ p) (hlo : (1 / 3 : ℝ) ≤ residueDensity S) (hhi : residueDensity S ≤ 2 / 3) (ε : ℝ) (hε : 0 ≤ ε) (hεsmall : ε ≤ 1 / 1000000) (hL1 : (p : ℝ)⁻¹ * ∑ b, ‖normalizedResidueTransform S b‖ ≤ ε ^ 2) : let E := largeTransformSpectrum (normalizedResidueTransform S) let T := Finset.univ \ S ∀ u v : ℂ, ‖u‖ ≤ 103 / 100 → ‖v‖ ≤ 103 / 100 → ∀ (z : ℂ) (f : ZMod p → ℂ), ‖polydiscSparseScalar S E (u + v) (u * v) * z + ∑ x, conj (polydiscSparseSide T S E (conj (u + v)) (conj (u * v)) x) * f x‖ ^ 2 + residueVectorNorm (fun x => z * polydiscSparseSide S T E (u + v) (u * v) x + polydiscSparseLower S T E (u + v) (u * v) f x) ^ 2 ≤ (1 + 3 / (p : ℝ)) ^ 2 * (‖z‖ ^ 2 + residueVectorNorm f ^ 2) := by intro E T u v hu hv z f have hp0 : (0 : ℝ) < p := by linarith have hc : ‖u + v‖ ≤ (103 / 50 : ℝ) := by linarith [norm_add_le u v] have hd : ‖u * v‖ ≤ (10609 / 10000 : ℝ) := by rw [norm_mul] have hh := mul_le_mul hu hv (norm_nonneg _) (by norm_num : (0 : ℝ) ≤ 103 / 100) norm_num at hh ⊢ exact hh obtain ⟨hz, _hn, hcard, _hconst, he, herr⟩ := sparse_residue_projection S hS hSp ε hε (by linarith) hL1 have ha := residueKernelScalar_sparse_norm_le S E hS hSp hz (17 / 20) (by norm_num) have hb := squareKernel_scalar_norm_le S E hS hSp hlo hhi (17 / 20) ε hε hcard norm_num at hb have hs := polydisc_scalar_norm_bounds p ε (residueKernelScalar S (localSparseKernel E)) (residueKernelScalar S (localSparseSquare E)) (u + v) (u * v) hp hε hεsmall ha hb hc hd change (19 / 20 : ℝ) ≤ ‖polydiscSparseScalar S E (u + v) (u * v)‖ ∧ ‖polydiscSparseScalar S E (u + v) (u * v)‖ ≤ 1 + 2 / (p : ℝ) at hs obtain ⟨hproj₁, hproj₂⟩ := residueProjection_side_norms S E hS hSp hz hlo hhi ε hε herr obtain ⟨hu₁, hu₂⟩ := balanced_uniform_norms S hS hSp hlo hhi have hrow := polydiscSparseSide_norm_le T S E ε hε hcard (conj (u + v)) (conj (u * v)) (by simpa only [Complex.norm_conj] using hc) (by simpa only [Complex.norm_conj] using hd) hproj₁ hu₁ have hcol := polydiscSparseSide_norm_le S T E ε hε hcard (u + v) (u * v) hc hd hproj₂ hu₂ have hST : Disjoint S T := by apply Finset.disjoint_left.mpr intro x hx hxT exact (Finset.mem_sdiff.mp hxT).2 hx have hC := polydiscSparseLower_norm_le S T E hST ε hε hεsmall hcard (u + v) (u * v) hc hd have hblock := residue_block_energy (polydiscSparseScalar S E (u + v) (u * v)) (polydiscSparseSide T S E (conj (u + v)) (conj (u * v))) (polydiscSparseSide S T E (u + v) (u * v)) (polydiscSparseLower S T E (u + v) (u * v)) ‖polydiscSparseScalar S E (u + v) (u * v)‖ (9 / 10) (6 * ε / Real.sqrt (p : ℝ)) (norm_nonneg _) (by norm_num) (by linarith [hs.1]) le_rfl hrow hcol hC z f have hside : 20 * (6 * ε / Real.sqrt (p : ℝ)) ^ 2 ≤ 1 / (p : ℝ) := by rw [div_pow, Real.sq_sqrt hp0.le] have heq : 20 * ((6 * ε) ^ 2 / (p : ℝ)) = (720 * ε ^ 2) / p := by ring rw [heq] apply (div_le_div_iff_of_pos_right hp0).mpr have hsq : ε ^ 2 ≤ ε := by nlinarith nlinarith have hM : ‖polydiscSparseScalar S E (u + v) (u * v)‖ + 20 * (6 * ε / Real.sqrt (p : ℝ)) ^ 2 ≤ 1 + 3 / (p : ℝ) := by have heq : 2 / (p : ℝ) + 1 / p = 3 / p := by ring linarith [hs.2] apply hblock.trans exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (by positivity) hM 2) (add_nonneg (sq_nonneg _) (sq_nonneg _))
end Ostmann
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677import Mathlib.Analysis.SpecialFunctions.Log.Basicimport Mathlib.Analysis.Real.Sqrtimport Mathlib.Algebra.Order.BigOperators.Ring.Finsetimport Mathlib.Tactic
namespace OAI
/-! # Logarithmic imbalance from the collision variance -/
namespace Ostmannopen scoped BigOperators
private theorem log_sq_le_four_variance_of_one_le (t : ℝ) (ht : 1 ≤ t) : (Real.log t) ^ 2 ≤ 4 * (t + t⁻¹ - 2) := by have ht0 : 0 < t := by linarith let s := Real.sqrt t have hs : 1 ≤ s := Real.one_le_sqrt.mpr ht have hs0 : 0 < s := by linarith have hs2 : s ^ 2 = t := Real.sq_sqrt ht0.le have hlog0 : 0 ≤ Real.log t := Real.log_nonneg ht have hlog : Real.log t ≤ 2 * (s - 1) := by have hh := Real.log_le_sub_one_of_pos hs0 have he := Real.log_sqrt ht0.le change Real.log s = Real.log t / 2 at he linarith have hsq : (Real.log t) ^ 2 ≤ 4 * (s - 1) ^ 2 := by nlinarith have hid : t * (t + t⁻¹ - 2 - (s - 1) ^ 2) = (s - 1) ^ 2 * (2 * s + 1) := by calc _ = s ^ 2 * (s ^ 2 + (s ^ 2)⁻¹ - 2 - (s - 1) ^ 2) := by rw [hs2] _ = _ := by field_simp; ring have hvar : (s - 1) ^ 2 ≤ t + t⁻¹ - 2 := by have hp : 0 ≤ t * (t + t⁻¹ - 2 - (s - 1) ^ 2) := by rw [hid] exact mul_nonneg (sq_nonneg _) (by linarith) have hd := nonneg_of_mul_nonneg_right hp ht0 linarith linarith
theorem log_sq_le_four_variance (t : ℝ) (ht : 0 < t) : (Real.log t) ^ 2 ≤ 4 * (t + t⁻¹ - 2) := by by_cases h : 1 ≤ t · exact log_sq_le_four_variance_of_one_le t h · have hinv : 1 ≤ t⁻¹ := by simpa only [one_div, inv_one] using div_le_div_of_nonneg_left (show (0 : ℝ) ≤ 1 by norm_num) ht (le_of_not_ge h) have hh := log_sq_le_four_variance_of_one_le t⁻¹ hinv simpa only [Real.log_inv, neg_sq, inv_inv, add_comm] using hh
/-- A finite Cauchy--Schwarz form ready for the actual prime collision budget.A harmless absolute factor four avoids any additional analytic theorem. -/theorem logarithmic_imbalance_budget (P : Finset ℕ) (κ : ℕ → ℝ) (hP : ∀ p ∈ P, 1 < p) (hκ : ∀ p ∈ P, 0 < κ p) : (∑ p ∈ P, |Real.log (κ p)| / p) ^ 2 ≤ (4 * ∑ p ∈ P, (κ p + (κ p)⁻¹ - 2) * Real.log p / p) * ∑ p ∈ P, 1 / ((p : ℝ) * Real.log p) := by rw [Finset.mul_sum P (fun p => (κ p + (κ p)⁻¹ - 2) * Real.log p / p) 4] apply Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul P · intro p hp have hv : 0 ≤ κ p + (κ p)⁻¹ - 2 := by nlinarith [log_sq_le_four_variance (κ p) (hκ p hp), sq_nonneg (Real.log (κ p))] have hlog : 0 < Real.log (p : ℝ) := Real.log_pos (by exact_mod_cast hP p hp) positivity · intro p hp have hlog : 0 < Real.log (p : ℝ) := Real.log_pos (by exact_mod_cast hP p hp) positivity · intro p hp have hp0 : (0 : ℝ) < p := by exact_mod_cast (lt_trans Nat.zero_lt_one (hP p hp)) have hlog : 0 < Real.log (p : ℝ) := Real.log_pos (by exact_mod_cast hP p hp) have hh := log_sq_le_four_variance (κ p) (hκ p hp) rw [div_pow, sq_abs] apply (div_le_iff₀ (sq_pos_of_pos hp0)).mpr convert hh using 1 field_simp
end Ostmann
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import Mathlib
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators
theorem log_sq_le_ratio_penalty {t : ℝ} (ht : 0<t) : (Real.log t)^2 ≤ t+t⁻¹-2 := by let x := Real.log t/2 have hsq : x^2 ≤ (Real.sinh x)^2 := by by_cases hx : 0≤x · have h1 := Real.self_le_sinh_iff.mpr hx have h2 := Real.sinh_nonneg_iff.mpr hx nlinarith · have h1 := Real.sinh_le_self_iff.mpr (le_of_not_ge hx) have h2 := Real.sinh_nonpos_iff.mpr (le_of_not_ge hx) nlinarith have hc := Real.cosh_two_mul x have hi := Real.cosh_sq_sub_sinh_sq x have hx : 2*x=Real.log t := by dsimp [x]; ring rw [hx,Real.cosh_eq,Real.exp_log ht,Real.exp_neg,Real.exp_log ht] at hc dsimp [x] at hsq nlinarith
theorem ratio_penalty_nonneg {t : ℝ} (ht : 0<t) : 0≤t+t⁻¹-2 := (sq_nonneg (Real.log t)).trans (log_sq_le_ratio_penalty ht)
theorem logRatio_cauchy (P : Finset ℕ) (κ : ℕ→ℝ) (hP : ∀p∈P,p.Prime) (hκ : ∀p∈P,0<κ p) : (∑ p∈P,abs (Real.log (κ p))/(p:ℝ))^2 ≤ (∑ p∈P,(κ p+(κ p)⁻¹-2)*Real.log p/(p:ℝ)) * ∑ p∈P,1/((p:ℝ)*Real.log p) := by apply Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul · intro p hp exact div_nonneg (mul_nonneg (ratio_penalty_nonneg (hκ p hp)) (Real.log_nonneg (by exact_mod_cast (hP p hp).one_le))) (Nat.cast_nonneg _) · intro p hp exact div_nonneg zero_le_one (mul_nonneg (Nat.cast_nonneg _) (Real.log_nonneg (by exact_mod_cast (hP p hp).one_le))) · intro p hp have hp0 : (0:ℝ)<p := by exact_mod_cast (hP p hp).pos have hl : 0<Real.log (p:ℝ) := Real.log_pos (by exact_mod_cast (hP p hp).one_lt) have h := div_le_div_of_nonneg_right (log_sq_le_ratio_penalty (hκ p hp)) (sq_nonneg (p:ℝ)) rw [div_pow,sq_abs] calc _ ≤ (κ p+(κ p)⁻¹-2)/(p:ℝ)^2 := h _ = _ := by field_simp
end Ostmann.Supply
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import Mathlib.Analysis.SpecialFunctions.Log.Basicimport OAI.NumberTheory.Ostmann.Supply.GoodSieveMultipliers
namespace OAI
/-! # Both imbalance products on the retained squarefree multipliers -/
namespace Ostmannopen scoped Classical BigOperators
noncomputable def multiplierRatioProduct (P : Finset ℕ) (κ : ℕ → ℝ) (u : ℕ) : ℝ := ∏ p ∈ P, if p ∣ u then κ p else 1
theorem multiplierRatioProduct_exp_sum (P : Finset ℕ) (κ : ℕ → ℝ) (hκ : ∀ p ∈ P, 0 < κ p) (u : ℕ) : multiplierRatioProduct P κ u = Real.exp (∑ p ∈ P, if p ∣ u then Real.log (κ p) else 0) := by rw [Real.exp_sum] apply Finset.prod_congr rfl intro p hp by_cases h : p ∣ u · simp [h, Real.exp_log (hκ p hp)] · simp [h]
theorem multiplierRatioProduct_bounds (P : Finset ℕ) (κ : ℕ → ℝ) (hκ : ∀ p ∈ P, 0 < κ p) (u : ℕ) (B : ℝ) (hB : multiplierPrimeWeight P (fun p => |Real.log (κ p)|) u ≤ B) : Real.exp (-B) ≤ multiplierRatioProduct P κ u ∧ multiplierRatioProduct P κ u ≤ Real.exp B := by have hsum : |∑ p ∈ P, if p ∣ u then Real.log (κ p) else 0| ≤ B := by apply (Finset.abs_sum_le_sum_abs _ _).trans have he : (∑ p ∈ P, |if p ∣ u then Real.log (κ p) else 0|) = multiplierPrimeWeight P (fun p => |Real.log (κ p)|) u := by unfold multiplierPrimeWeight apply Finset.sum_congr rfl intro p _ by_cases hp : p ∣ u <;> simp [hp] exact he.trans_le hB rw [multiplierRatioProduct_exp_sum P κ hκ u] exact ⟨Real.exp_le_exp.mpr (abs_le.mp hsum).1, Real.exp_le_exp.mpr (abs_le.mp hsum).2⟩
theorem goodSieveMultipliers_ratio_products (U : ℕ) (T P : Finset ℕ) (κ : ℕ → ℝ) (hκ : ∀ p ∈ P, 0 < κ p) (B : ℝ) {u : ℕ} (hu : u ∈ goodSieveMultipliers U T P (fun p => |Real.log (κ p)|) B) : Real.exp (-B) ≤ multiplierRatioProduct P κ u ∧ Real.exp (-B) ≤ multiplierRatioProduct P (fun p => (κ p)⁻¹) u := by have hB := (Finset.mem_filter.mp hu).2.2.2 refine ⟨(multiplierRatioProduct_bounds P κ hκ u B hB).1, ?_⟩ apply (multiplierRatioProduct_bounds P (fun p => (κ p)⁻¹) (fun p hp => inv_pos.mpr (hκ p hp)) u B ?_).1 simpa only [Real.log_inv, abs_neg] using hB
end Ostmann
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192import OAI.NumberTheory.Ostmann.Supply.SquarefreeMultiplierCount
namespace OAI
/-! # Elementary divisor and logarithmic budgets for sieve multipliers -/
namespace Ostmannopen scoped Classical BigOperators
noncomputable def positiveMultipliers (U : ℕ) : Finset ℕ := Finset.Icc 1 U
@[simp] theorem positiveMultipliers_card (U : ℕ) : (positiveMultipliers U).card = U := by simp [positiveMultipliers, Nat.card_Icc]
theorem positiveMultipliers_dvd_card (U d : ℕ) : ((positiveMultipliers U).filter (fun u => d ∣ u)).card = U / d := by have he : (positiveMultipliers U).filter (fun u => d ∣ u) = positiveMultiplesUpTo U d := by ext u simp only [positiveMultipliers, positiveMultiplesUpTo, Finset.mem_filter, Finset.mem_Icc, Finset.mem_range] omega rw [he] exact Nat.card_multiples' U d
noncomputable def multiplierPrimeWeight (P : Finset ℕ) (w : ℕ → ℝ) (u : ℕ) : ℝ := ∑ p ∈ P, if p ∣ u then w p else 0
theorem multiplierPrimeWeight_nonneg (P : Finset ℕ) (w : ℕ → ℝ) (hw : ∀ p ∈ P, 0 ≤ w p) (u : ℕ) : 0 ≤ multiplierPrimeWeight P w u := by apply Finset.sum_nonneg intro p hp split_ifs · exact hw p hp · exact le_rfl
theorem multiplierPrimeWeight_total_le (U : ℕ) (P : Finset ℕ) (w : ℕ → ℝ) (hw : ∀ p ∈ P, 0 ≤ w p) : (∑ u ∈ positiveMultipliers U, multiplierPrimeWeight P w u) ≤ (U : ℝ) * ∑ p ∈ P, w p / p := by unfold multiplierPrimeWeight rw [Finset.sum_comm, Finset.mul_sum] apply Finset.sum_le_sum intro p hp calc (∑ u ∈ positiveMultipliers U, if p ∣ u then w p else 0) = ∑ _u ∈ (positiveMultipliers U).filter (fun u => p ∣ u), w p := by rw [Finset.sum_filter] _ = ((U / p : ℕ) : ℝ) * w p := by simp [positiveMultipliers_dvd_card] _ ≤ ((U : ℝ) / p) * w p := mul_le_mul_of_nonneg_right Nat.cast_div_le (hw p hp) _ = (U : ℝ) * (w p / p) := by ring
noncomputable def badDivisorMultipliers (U : ℕ) (P : Finset ℕ) : Finset ℕ := (positiveMultipliers U).filter (fun u => ∃ p ∈ P, p ∣ u)
theorem badDivisorMultipliers_card_le (U : ℕ) (P : Finset ℕ) : ((badDivisorMultipliers U P).card : ℝ) ≤ (U : ℝ) * ∑ p ∈ P, (p : ℝ)⁻¹ := by have hs : badDivisorMultipliers U P ⊆ P.biUnion (fun p => (positiveMultipliers U).filter (fun u => p ∣ u)) := by intro u hu obtain ⟨hu, p, hp, hpu⟩ := Finset.mem_filter.mp hu exact Finset.mem_biUnion.mpr ⟨p, hp, Finset.mem_filter.mpr ⟨hu, hpu⟩⟩ have hc := (Finset.card_le_card hs).trans (Finset.card_biUnion_le) calc _ ≤ ((∑ p ∈ P, ((positiveMultipliers U).filter (fun u => p ∣ u)).card : ℕ) : ℝ) := by exact_mod_cast hc _ = ∑ p ∈ P, ((U / p : ℕ) : ℝ) := by simp [positiveMultipliers_dvd_card] _ ≤ ∑ p ∈ P, (U : ℝ) / p := Finset.sum_le_sum (fun _ _ => Nat.cast_div_le) _ = _ := by simp only [div_eq_mul_inv, Finset.mul_sum]
noncomputable def largeWeightMultipliers (U : ℕ) (P : Finset ℕ) (w : ℕ → ℝ) (B : ℝ) : Finset ℕ := (positiveMultipliers U).filter (fun u => B < multiplierPrimeWeight P w u)
theorem largeWeightMultipliers_card_budget (U : ℕ) (P : Finset ℕ) (w : ℕ → ℝ) (hw : ∀ p ∈ P, 0 ≤ w p) (B : ℝ) : B * (largeWeightMultipliers U P w B).card ≤ (U : ℝ) * ∑ p ∈ P, w p / p := by calc _ = ∑ _u ∈ largeWeightMultipliers U P w B, B := by simp [mul_comm] _ ≤ ∑ u ∈ largeWeightMultipliers U P w B, multiplierPrimeWeight P w u := by apply Finset.sum_le_sum intro u hu exact (Finset.mem_filter.mp hu).2.le _ ≤ ∑ u ∈ positiveMultipliers U, multiplierPrimeWeight P w u := by apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) intro u _ _ exact multiplierPrimeWeight_nonneg P w hw u _ ≤ _ := multiplierPrimeWeight_total_le U P w hw
end Ostmann
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960import OAI.NumberTheory.Ostmann.Supply.PrimeSupportSieve
namespace OAI
/-! # The support sieve for actual natural-number summand tails -/
namespace Ostmann
open scoped Classical BigOperators
noncomputable def naturalIntervalSet (S : Finset ℕ) (N : ℕ) : Finset (Fin (N + 1)) := Finset.univ.filter fun a => a.val ∈ S
theorem mem_naturalIntervalSet {S : Finset ℕ} {N : ℕ} {a : Fin (N + 1)} : a ∈ naturalIntervalSet S N ↔ a.val ∈ S := by simp [naturalIntervalSet]
theorem naturalIntervalSet_card (S : Finset ℕ) (N : ℕ) (hS : ∀ a ∈ S, a ≤ N) : (naturalIntervalSet S N).card = S.card := by apply Finset.card_bij (fun a _ => a.val) · intro a ha exact mem_naturalIntervalSet.mp ha · intro a _ b _ hab exact Fin.ext hab · intro a ha exact ⟨⟨a, by have := hS a ha; omega⟩, mem_naturalIntervalSet.mpr ha, rfl⟩
theorem natural_full_support_prime_sieve (B : Set ℕ) (S P : Finset ℕ) (N Q : ℕ) (hS : S.Nonempty) (hbound : ∀ a ∈ S, a ≤ N) (hQ : 1 ≤ Q) (hP : ∀ p ∈ P, p.Prime) (hPQ : ∀ p ∈ P, p ≤ Q) (havoid : ∀ p ∈ P, ∀ a ∈ S, (a : ZMod p) ∉ negativeOccupiedResidues B p) : (∑ p ∈ P, ((occupiedResidues B p).card : ℝ) / p) ≤ (((N + 1 : ℕ) : ℝ) + (Q : ℝ) ^ 2) / S.card := by have hcard := naturalIntervalSet_card S N hbound have hU : (naturalIntervalSet S N).Nonempty := by rw [← Finset.card_pos, hcard] exact hS.card_pos have h := full_support_prime_sieve B (naturalIntervalSet S N) hU (by omega) hQ P hP hPQ (fun p hp a ha => havoid p hp a.val (mem_naturalIntervalSet.mp ha)) simpa only [hcard] using h
theorem EventuallyPrimeSumset.tail_full_support_prime_sieve {A B : Set ℕ} (h : EventuallyPrimeSumset A B) : ∃ N₀ : ℕ, ∀ X Q : ℕ, ∀ P : Finset ℕ, 1 ≤ Q → (∀ p ∈ P, p.Prime) → (∀ p ∈ P, p ≤ Q) → (summandTail A (N₀ + Q) X).Nonempty → (∑ p ∈ P, ((occupiedResidues B p).card : ℝ) / p) ≤ (((X + 1 : ℕ) : ℝ) + (Q : ℝ) ^ 2) / (summandTail A (N₀ + Q) X).card := by obtain ⟨N₀, hN⟩ := h.full_residue_avoidance refine ⟨N₀, ?_⟩ intro X Q P hQ hP hPQ hU refine natural_full_support_prime_sieve B (summandTail A (N₀ + Q) X) P X Q hU ?_ hQ hP hPQ ?_ · intro a ha exact (mem_summandTail A (N₀ + Q) X a).mp ha |>.2.2 · intro p hp a ha obtain ⟨haA, hlarge, _⟩ := (mem_summandTail A (N₀ + Q) X a).mp ha exact hN p (hP p hp) a haA (by have := hPQ p hp; omega)
end Ostmann
end OAI1234567891011121314151617181920212223242526272829303132333435import OAI.NumberTheory.Ostmann.Arithmetic.ResidueIntervalsimport OAI.NumberTheory.Ostmann.Arithmetic.CRTLineAverage
namespace OAI
/-! # Natural residue representatives and the Haar unit averages used by CRT -/
namespace Ostmannopen scoped BigOperators Classical
noncomputable def unitReducedResidueEquiv (q : ℕ) [NeZero q] : (ZMod q)ˣ ≃ {a : ℕ // a ∈ reducedResidues q} where toFun u := ⟨(u : ZMod q).val, Finset.mem_filter.mpr ⟨Finset.mem_range.mpr (ZMod.val_lt _), ZMod.val_coe_unit_coprime u⟩⟩ invFun a := ZMod.unitOfCoprime a.val (Finset.mem_filter.mp a.property).2 left_inv u := Units.ext (ZMod.natCast_zmod_val _) right_inv a := by apply Subtype.ext exact ZMod.val_natCast_of_lt (Finset.mem_range.mp (Finset.mem_filter.mp a.property).1)
theorem sum_reducedResidues_eq_units (q : ℕ) [NeZero q] (f : ℕ → ℂ) : (∑ a ∈ reducedResidues q, f a) = ∑ a : (ZMod q)ˣ, f (a : ZMod q).val := by rw [← Finset.sum_coe_sort] exact ((unitReducedResidueEquiv q).sum_comp (fun a => f a.val)).symm
theorem sum_range_eq_zmod (q : ℕ) [NeZero q] (f : ℕ → ℂ) : (∑ a ∈ Finset.range q, f a) = ∑ a : ZMod q, f a.val := by rw [← Fin.sum_univ_eq_sum_range] cases q with | zero => exact (NeZero.ne 0 rfl).elim | succ q => rfl
end Ostmann
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546import OAI.NumberTheory.Ostmann.Supply.KernelEmpiricalimport OAI.NumberTheory.Ostmann.Supply.WeightPointwiseBound
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators
def naturalKernelWeight (p : ℕ→ℕ) [∀i,NeZero (p i)] (S : ∀i,Finset (ZMod (p i))) (n K k : ℕ) : ℝ := truncatedWeight (Finset.range n) (fun i => localKernel (S i) sparseKernelScale (k:ZMod (p i))) K
theorem naturalKernelWeight_nonneg (p : ℕ→ℕ) [∀i,NeZero (p i)] (S : ∀i,Finset (ZMod (p i))) (n K k : ℕ) : 0≤naturalKernelWeight p S n K k := truncatedWeight_nonneg _ _ _
theorem naturalKernelWeight_le (p : ℕ→ℕ) [∀i,NeZero (p i)] (S : ∀i,Finset (ZMod (p i))) (n K k : ℕ) : naturalKernelWeight p S n K k≤(K+1:ℝ)^2*(n+1:ℝ)^(2*K) := by simpa only [naturalKernelWeight,Finset.card_range] using truncatedKernelWeight_pointwise_le (Finset.range n) p S (fun i => (k:ZMod (p i))) K
theorem kernelAverageWeight_natural (p : ℕ→ℕ) [∀i,NeZero (p i)] (S : ∀i,Finset (ZMod (p i))) (A B : Finset ℕ) (n K : ℕ) : kernelAverageWeight p S A B (fun a i => (a:ZMod (p i))) (fun b i => -(b:ZMod (p i))) n K = (A.card:ℝ)⁻¹*(B.card:ℝ)⁻¹*∑a∈A,∑b∈B,naturalKernelWeight p S n K (a+b) := by simp only [kernelAverageWeight,naturalKernelWeight,sub_neg_eq_add,Nat.cast_add]
theorem naturalKernelWeight_pair_sum (p : ℕ→ℕ) [∀i,NeZero (p i)] (S : ∀i,Finset (ZMod (p i))) (A B : Finset ℕ) (n K : ℕ) (hA : A.Nonempty) (hB : B.Nonempty) : (∑a∈A,∑b∈B,naturalKernelWeight p S n K (a+b)) = ((A.card:ℝ)*(B.card:ℝ))*kernelAverageWeight p S A B (fun a i => (a:ZMod (p i))) (fun b i => -(b:ZMod (p i))) n K := by have hA0 : (A.card:ℝ)≠0 := Nat.cast_ne_zero.mpr (Finset.card_ne_zero.mpr hA) have hB0 : (B.card:ℝ)≠0 := Nat.cast_ne_zero.mpr (Finset.card_ne_zero.mpr hB) rw [kernelAverageWeight_natural] field_simp
end Ostmann.Supply
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657import OAI.NumberTheory.Ostmann.Characters.SparseTruncatedWeight
namespace OAI
/-! # The real nonnegative weight represented by the truncated tensor -/
namespace Ostmannopen scoped Classical BigOperators ComplexConjugate
theorem elementaryTruncation_conj {n : ℕ} (b : Fin n → ℂ) (hb : ∀ i, conj (b i) = b i) (K : ℕ) : conj (elementaryTruncation b K) = elementaryTruncation b K := by simp only [elementaryTruncation, map_sum, map_prod, hb]
theorem localSparseKernel_spectrum_real {p : ℕ} [Fact p.Prime] (S : Finset (ZMod p)) (x : ZMod p) : (localSparseKernel (largeTransformSpectrum (normalizedResidueTransform S)) x).im = 0 := by exact sparseAdditiveKernel_real _ (largeTransformSpectrum_neg _ (normalizedResidueTransform_neg S)) (17 / 20) x
noncomputable def sparseSubsetWeight {n : ℕ} (p : Fin n → ℕ) [∀ i, NeZero (p i)] (S : ∀ i, Finset (ZMod (p i))) (K : ℕ) (x : ∀ i, ZMod (p i)) : ℝ := ‖elementaryTruncation (fun i => localSparseKernel (largeTransformSpectrum (normalizedResidueTransform (S i))) (x i)) K‖ ^ 2
theorem sparseSubsetWeight_nonneg {n : ℕ} (p : Fin n → ℕ) [∀ i, NeZero (p i)] (S : ∀ i, Finset (ZMod (p i))) (K : ℕ) (x : ∀ i, ZMod (p i)) : 0 ≤ sparseSubsetWeight p S K x := sq_nonneg _
theorem sparseSubsetWeight_complex {n : ℕ} (p : Fin n → ℕ) [∀ i, Fact (p i).Prime] (S : ∀ i, Finset (ZMod (p i))) (K : ℕ) (x : ∀ i, ZMod (p i)) : (sparseSubsetWeight p S K x : ℂ) = elementaryTruncation (fun i => localSparseKernel (largeTransformSpectrum (normalizedResidueTransform (S i))) (x i)) K ^ 2 := by let b := fun i => localSparseKernel (largeTransformSpectrum (normalizedResidueTransform (S i))) (x i) have hb (i) : conj (b i) = b i := by have hi : (b i).im = 0 := localSparseKernel_spectrum_real (S i) (x i) apply Complex.ext <;> simp [hi] have he := elementaryTruncation_conj b hb K have hh := Complex.mul_conj' (elementaryTruncation b K) rw [he, ← pow_two] at hh simpa only [sparseSubsetWeight, Complex.ofReal_pow, b] using hh.symm
theorem sparseSubsetWeight_point_pairing {n : ℕ} (p : Fin n → ℕ) [∀ i, Fact (p i).Prime] (S : ∀ i, Finset (ZMod (p i))) (K : ℕ) (a b : ∀ i, ZMod (p i)) (ha : ∀ i, a i ∈ S i) (hb : ∀ i, b i ∈ Finset.univ \ S i) : kernelPairingLinearMap (tensorPointCoordinates p S a) (tensorPointCoordinates p (fun i => Finset.univ \ S i) b) (truncatedSparseTensorKernel p S K) = (sparseSubsetWeight p S K (fun i => a i - b i) : ℂ) := by rw [sparseSubsetWeight_complex] exact truncatedSparseTensorKernel_point_pairing p S a b ha hb K
end Ostmann
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990import OAI.NumberTheory.Ostmann.Supply.ActualPrimeLowerimport OAI.NumberTheory.Ostmann.Supply.ActualPrimeUpperimport OAI.NumberTheory.Ostmann.Supply.PrimeBandSelectionimport OAI.NumberTheory.Ostmann.Supply.PrimeEnumeration
namespace OAI
open _root_.Erdos970 _root_.OAI.Erdos970
open Erdos970.Erdos970Dependency.SiegelWalfisz
noncomputable sectionnamespace Ostmann.Supplyopen Filteropen scoped BigOperators
theorem nonsparse_supply : NonsparseSupply := by classical refine ⟨supplyEpsilon^2,by norm_num [supplyEpsilon],?_⟩ intro d have hη : 0<supplyPrimeConstant/2 := div_pos supplyPrimeConstant_pos (by norm_num) filter_upwards [exists_sparse_balanced_prime_set d, eventually_actualPrime_weight_small d hη,eventually_actualPrime_weight_large, eventually_ge_atTop (1:ℝ)] with L hselect hupper hlower hL by_contra hnot obtain ⟨P,hP,hHlo,hHhi⟩ := hselect (supplyEpsilon^2) ∅ (by simp) (lt_of_not_ge hnot) have hpP : ∀q∈P,q.Prime := fun q hq => (hP q hq).1 let : Fact (∀q∈P,q.Prime) := ⟨hpP⟩ let p := enumeratePrimes P let n := P.card have hp : ∀i<n,(p i).Prime := fun i _ => enumeratePrimes_prime P hpP i have hinj : Set.InjOn p (Finset.range n:Set ℕ) := enumeratePrimes_injective P have hband : ∀i<n,(1/20:ℝ)*L<Real.log (Real.log (p i:ℝ)) ∧ Real.log (Real.log (p i:ℝ))≤(9/10:ℝ)*L := by intro i hi have h := hP (p i) (enumeratePrimes_mem P hi) exact ⟨h.2.1,h.2.2.1⟩ have hlo : ∀i<n,(1/3:ℝ)≤density (actualSupport d (p i)) := by intro i hi have h := (hP (p i) (enumeratePrimes_mem P hi)).2.2.2.1 simpa only [residueDensityTotal_eq,actualSupport_eq] using h have hhi : ∀i<n,density (actualSupport d (p i))≤2/3 := by intro i hi have h := (hP (p i) (enumeratePrimes_mem P hi)).2.2.2.2.1 simpa only [residueDensityTotal_eq,actualSupport_eq] using h have hg : ∀i<n,gamma (actualSupport d (p i))≤ supplyEpsilon^2 := by intro i hi have h := (hP (p i) (enumeratePrimes_mem P hi)).2.2.2.2.2.1 simpa only [residueGamma_eq,actualSupport_eq] using h have hHlower : (17/25:ℝ)*L≤reciprocalMass (Finset.range n) p := by simpa only [n,p,reciprocalMass_enumeratePrimes] using hHlo have hHupper : reciprocalMass (Finset.range n) p≤L := by rw [show reciprocalMass (Finset.range n) p=∑q∈P,(1:ℝ)/q from reciprocalMass_enumeratePrimes P] linarith have hn : (n:ℝ)≤Real.exp (Real.exp ((9/10:ℝ)*L)) := primeBand_card_le P (fun q hq => ⟨(hP q hq).1,(hP q hq).2.2.1⟩) have hbound : ∀i<n,p i≤ supplyPrimeCap L := fun i hi => prime_le_supplyPrimeCap (hp i hi) (hband i hi).2 let S := fun i => actualSupport d (p i) let U := kernelUnitProduct (Finset.range n) p S let X := (supplyRadius L)^2 let W := naturalKernelWeight p S n (supplyTruncation L) have hu := hupper p n (fun i => inferInstance) hp hinj hband hlo hhi hg hHlower hHupper hn have hl := hlower p n (fun i => inferInstance) hp hinj hbound S hlo hhi hg hHupper change (∑q∈primesInInterval (X/2) X,W q)≤ (supplyPrimeConstant/2)*U*(X:ℝ)/Real.log (X:ℝ) at hu change supplyPrimeConstant*U*(X:ℝ)/Real.log (X:ℝ)≤ ∑q∈primesInInterval (X/2) X,W q at hl have hUexp := (kernelUnitProduct_exp_bounds (Finset.range n) p S (fun i hi => (hp i (Finset.mem_range.mp hi)).two_le) (fun i hi => hlo i (Finset.mem_range.mp hi)) (fun i hi => hhi i (Finset.mem_range.mp hi)) (fun i hi => hg i (Finset.mem_range.mp hi))).1 have hU : 0<U := (Real.exp_pos _).trans_le hUexp have hX : (0:ℝ)<X := by exact_mod_cast pow_pos (supplyRadius_pos L) 2 have hlog : 0<Real.log (X:ℝ) := (Real.exp_pos L).trans_le (Ostmann.ZeroDensity.log_supplyPrimeSample_lower L) have hpos : 0<supplyPrimeConstant*U*(X:ℝ)/Real.log (X:ℝ) := div_pos (mul_pos (mul_pos supplyPrimeConstant_pos hU) hX) hlog have hhalf : (supplyPrimeConstant/2)*U*(X:ℝ)/Real.log (X:ℝ)= (supplyPrimeConstant*U*(X:ℝ)/Real.log (X:ℝ))/2 := by ring rw [hhalf] at hu linarith
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879import OAI.NumberTheory.Ostmann.Supply.TensorOperators
namespace OAI
noncomputable sectionnamespace Ostmann.Supply.BivariateTruncationopen scoped BigOperatorsopen TensorOperatorsvariable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [NormedAddCommGroup F] [NormedSpace ℂ F]
def mapCoefficients (φ : E→ₗ[ℂ]F) (c : (ℕ×ℕ)→₀E) : (ℕ×ℕ)→₀F := ∑ij∈c.support,Finsupp.single ij (φ (c ij))
@[simp] theorem mapCoefficients_apply (φ : E→ₗ[ℂ]F) (c : (ℕ×ℕ)→₀E) (ij : ℕ×ℕ) : mapCoefficients φ c ij = φ (c ij) := by classical by_cases h : ij∈c.support · simp [mapCoefficients,Finsupp.single_apply,h] · have hz := Finsupp.notMem_support_iff.mp h simp [mapCoefficients,Finsupp.single_apply,h,hz]
theorem eval_mapCoefficients (φ : E→ₗ[ℂ]F) (c : (ℕ×ℕ)→₀E) (u v : ℂ) : eval (mapCoefficients φ c) u v = φ (eval c u v) := by rw [mapCoefficients,eval_sum] simp only [eval_single] simp only [eval,map_sum,map_smul]
def rectangularLinearMap (K : ℕ) : ((ℕ×ℕ)→₀E)→ₗ[ℂ]E := Finsupp.lsum ℂ (fun ij => if ij.1≤K ∧ ij.2≤K then LinearMap.id else 0)
theorem rectangularLinearMap_apply (K : ℕ) (c : (ℕ×ℕ)→₀E) : rectangularLinearMap K c = rectangularTruncation c K := by classical simp only [rectangularLinearMap,Finsupp.lsum_apply,Finsupp.sum,rectangularTruncation, Finset.sum_filter] apply Finset.sum_congr rfl intro ij hij split_ifs <;> rfl
@[simp] theorem rectangularTruncation_single (ij : ℕ×ℕ) (x : E) (K : ℕ) : rectangularTruncation (Finsupp.single ij x) K = if ij.1≤K ∧ ij.2≤K then x else 0 := by rw [←rectangularLinearMap_apply] unfold rectangularLinearMap rw [Finsupp.lsum_single] split_ifs <;> rfl
theorem rectangularTruncation_sum {α : Type*} (s : Finset α) (c : α→(ℕ×ℕ)→₀E) (K : ℕ) : rectangularTruncation (∑a∈s,c a) K = ∑a∈s,rectangularTruncation (c a) K := by simp only [←rectangularLinearMap_apply,map_sum]
theorem rectangularTruncation_mapCoefficients (φ : E→ₗ[ℂ]F) (c : (ℕ×ℕ)→₀E) (K : ℕ) : rectangularTruncation (mapCoefficients φ c) K = φ (rectangularTruncation c K) := by classical rw [mapCoefficients,rectangularTruncation_sum] simp only [rectangularTruncation_single] simp only [rectangularTruncation,Finset.sum_filter,map_sum] apply Finset.sum_congr rfl intro ij hij split_ifs <;> simp
variable [CompleteSpace E]theorem eq_of_eval_eq {c d : (ℕ×ℕ)→₀E} (h : ∀u v : ℂ,eval c u v=eval d u v) : c=d := by ext ij rw [←coefficientIntegral_eval c (by norm_num : (0:ℝ)<1) ij.1 ij.2, ←coefficientIntegral_eval d (by norm_num : (0:ℝ)<1) ij.1 ij.2] congr 1 funext u congr 1 funext v exact h u v
end Ostmann.Supply.BivariateTruncation
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859import OAI.NumberTheory.Ostmann.Supply.PrimeBandSelectionFinite
namespace OAI
open Erdos970
noncomputable sectionnamespace Ostmann.Supplyopen Filter Ostmann.Constructionopen scoped BigOperators
theorem sparseBalancedPrimes_mass_eventually (d : Decomposition) : ∀ᶠ L : ℝ in atTop, ∀ δ : ℝ, ∀ E : Finset ℕ, E.card≤2 → harmonicPrimeMass (nonsparsePrimes d δ L)<(3/20:ℝ)*L → (17/25:ℝ)*L≤harmonicPrimeMass (sparseBalancedPrimes d δ L E) ∧ harmonicPrimeMass (sparseBalancedPrimes d δ L E)≤(43/50:ℝ)*L := by classical obtain ⟨C,hC,hband⟩ := logLogPrimeBand_mass_error have hunbalanced := unbalancedPrimePrefix_mass_small d (by norm_num : (0:ℝ)<1/100) filter_upwards [hunbalanced,eventually_ge_atTop (max 0 (100*C))] with L hu hL have hL0 : 0≤L := (le_max_left _ _).trans hL have hLC : 100*C≤L := (le_max_right _ _).trans hL intro δ E hE hnon have hmass := hband ((1/20:ℝ)*L) ((9/10:ℝ)*L) (by positivity) (by nlinarith) E hE obtain ⟨hlo,hhi⟩ := abs_le.mp hmass have hcover := sparseBalancedPrimes_mass_cover d δ L E constructor · linarith · have hs : sparseBalancedPrimes d δ L E ⊆ logLogPrimeBand ((1/20:ℝ)*L) ((9/10:ℝ)*L) \ E := by intro p hp obtain ⟨hp,hE⟩ := Finset.mem_sdiff.mp hp exact Finset.mem_sdiff.mpr ⟨(Finset.mem_filter.mp hp).1,hE⟩ have hm := harmonicPrimeMass_mono hs linarith
theorem exists_sparse_balanced_prime_set (d : Decomposition) : ∀ᶠ L : ℝ in atTop, ∀ δ : ℝ, ∀ E : Finset ℕ, E.card≤2 → (∑p∈nonsparsePrimes d δ L,(1:ℝ)/p)<(3/20:ℝ)*L → ∃ P : Finset ℕ, (∀p∈P,p.Prime ∧ (1/20:ℝ)*L<Real.log (Real.log p) ∧ Real.log (Real.log p)≤(9/10:ℝ)*L ∧ (1/3:ℝ)≤residueDensityTotal d p ∧ residueDensityTotal d p≤(2/3:ℝ) ∧ residueGamma d p≤δ ∧ p∉E) ∧ (17/25:ℝ)*L≤(∑p∈P,(1:ℝ)/p) ∧ (∑p∈P,(1:ℝ)/p)≤(43/50:ℝ)*L := by filter_upwards [sparseBalancedPrimes_mass_eventually d] with L hL intro δ E hE hnon obtain ⟨hlo,hhi⟩ := hL δ E hE hnon refine ⟨sparseBalancedPrimes d δ L E,?_,hlo,hhi⟩ intro p hp obtain ⟨hprime,hlo,hhi,hbal,hγ,hE⟩ := sparseBalancedPrimes_properties d δ L E hp exact ⟨hprime,hlo,hhi,hbal.1,hbal.2,hγ,hE⟩
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667import OAI.NumberTheory.Ostmann.Construction.SourcePriorsimport OAI.NumberTheory.Ostmann.Supply.ActualLogBudgetimport OAI.NumberTheory.Ostmann.Supply.Statement
namespace OAI
open Erdos970
noncomputable sectionnamespace Ostmann.Supplyopen Filter Ostmann.Constructionopen scoped BigOperators
def balancedDensity (d : Decomposition) (p : ℕ) : Prop := (1/3:ℝ)≤residueDensityTotal d p ∧ residueDensityTotal d p≤(2/3:ℝ)
theorem log_ratio_lower_of_unbalanced (d : Decomposition) {p : ℕ} (hp : p.Prime) (hbal : ¬balancedDensity d p) : Real.log 2≤|Real.log (actualRatio d p)| := by let : NeZero p := ⟨hp.ne_zero⟩ have hσ0 := d.residueDensity_pos p hp have hσ1 := d.residueDensity_lt_one p hp have hr := actualRatio_eq_density d p have hd : residueDensityTotal d p=d.residueDensity p := by simp [residueDensityTotal,NeZero.ne p] change ¬((1/3:ℝ)≤residueDensityTotal d p ∧ residueDensityTotal d p≤(2/3:ℝ)) at hbal rw [hd] at hbal by_cases hlo : d.residueDensity p<(1/3:ℝ) · have htwo : (2:ℝ)≤actualRatio d p := by rw [hr] exact (le_div_iff₀ hσ0).mpr (by linarith) exact (Real.log_le_log (by norm_num) htwo).trans (le_abs_self _) · have hhi : (2/3:ℝ)<d.residueDensity p := by by_contra h exact hbal ⟨le_of_not_gt hlo,le_of_not_gt h⟩ have hhalf : actualRatio d p≤(1/2:ℝ) := by rw [hr] exact (div_le_iff₀ hσ0).mpr (by linarith) have hl := Real.log_le_log (actualRatio_pos d hp) hhalf have he : Real.log (1/2:ℝ) = -Real.log 2 := by rw [one_div,Real.log_inv] rw [he] at hl exact (by linarith : Real.log 2≤ -Real.log (actualRatio d p)).trans (neg_le_abs _)
def unbalancedPrimePrefix (d : Decomposition) (Q : ℕ) : Finset ℕ := by classical exact Q.primesLE.filter (fun p => ¬balancedDensity d p)
theorem unbalancedPrimePrefix_mass_le (d : Decomposition) (Q : ℕ) : Real.log 2*harmonicPrimeMass (unbalancedPrimePrefix d Q)≤actualLogBudget d Q := by classical unfold harmonicPrimeMass rw [Finset.mul_sum] calc _ ≤ ∑p∈unbalancedPrimePrefix d Q, |Real.log (actualRatio d p)|/(p:ℝ) := by apply Finset.sum_le_sum intro p hp obtain ⟨hp,hbad⟩ := Finset.mem_filter.mp hp have hl := log_ratio_lower_of_unbalanced d (Nat.mem_primesLE.mp hp).2 hbad simpa only [mul_one_div] using div_le_div_of_nonneg_right hl (Nat.cast_nonneg p) _ ≤ actualLogBudget d Q := by apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) intro p hp _ exact div_nonneg (abs_nonneg _) (Nat.cast_nonneg p)
end Ostmann.Supply
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960import OAI.NumberTheory.Ostmann.Supply.PrimeBandSelectionBalance
namespace OAI
open Erdos970
noncomputable sectionnamespace Ostmann.Supplyopen Filter Ostmann.Constructionopen scoped BigOperators
def supplyBandCutoff (L : ℝ) : ℕ := ⌊Real.exp (Real.exp ((9/10:ℝ)*L))⌋₊
theorem supplyBandCutoff_tendsto : Tendsto supplyBandCutoff atTop atTop := by have hlin : Tendsto (fun L : ℝ => (9/10:ℝ)*L) atTop atTop := by apply tendsto_atTop.mpr intro b filter_upwards [eventually_ge_atTop (b/(9/10:ℝ))] with L hL linarith exact (tendsto_nat_floor_atTop (α := ℝ)).comp (Real.tendsto_exp_atTop.comp (Real.tendsto_exp_atTop.comp hlin))
theorem unbalancedPrimePrefix_mass_small (d : Decomposition) {η : ℝ} (hη : 0<η) : ∀ᶠ L : ℝ in atTop, harmonicPrimeMass (unbalancedPrimePrefix d (supplyBandCutoff L))≤η*L := by obtain ⟨C,hC,hbudget⟩ := eventually_actualLogBudget_le d have htwo : 0<Real.log (2:ℝ) := Real.log_pos (by norm_num) have hsqrt := Real.tendsto_sqrt_atTop.eventually_ge_atTop (C/(η*Real.log 2)) filter_upwards [supplyBandCutoff_tendsto.eventually hbudget, supplyBandCutoff_tendsto.eventually (eventually_ge_atTop (2:ℕ)), eventually_ge_atTop (0:ℝ),hsqrt] with L hb hQ hL hs have hQR : (2:ℝ)≤ supplyBandCutoff L := by exact_mod_cast hQ have hQ0 : (0:ℝ)<supplyBandCutoff L := by linarith have hlogQ : 0<Real.log (supplyBandCutoff L:ℝ) := Real.log_pos (by linarith) have hfloor : (supplyBandCutoff L:ℝ)≤Real.exp (Real.exp ((9/10:ℝ)*L)) := Nat.floor_le (Real.exp_pos _).le have hl₁ := Real.log_le_log hQ0 hfloor rw [Real.log_exp] at hl₁ have hl₂ := Real.log_le_log hlogQ hl₁ rw [Real.log_exp] at hl₂ have hloglog : Real.log (Real.log (supplyBandCutoff L:ℝ))≤L := by linarith have hroot : Real.sqrt (Real.log (Real.log (supplyBandCutoff L:ℝ)))≤Real.sqrt L := Real.sqrt_le_sqrt hloglog have hscale : C≤η*Real.log 2*Real.sqrt L := by simpa only [mul_comm] using (div_le_iff₀ (mul_pos hη htwo)).mp hs have hscale' := mul_le_mul_of_nonneg_right hscale (Real.sqrt_nonneg L) have he : (η*Real.log 2*Real.sqrt L)*Real.sqrt L=Real.log 2*(η*L) := by rw [mul_assoc,Real.mul_self_sqrt hL] ring rw [he] at hscale' have hbudget' := hb.trans (mul_le_mul_of_nonneg_left hroot hC.le) have hbound := (unbalancedPrimePrefix_mass_le d (supplyBandCutoff L)).trans (hbudget'.trans hscale') nlinarith
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485import OAI.NumberTheory.Ostmann.Construction.LogLogPrimeBandSupportimport OAI.NumberTheory.Ostmann.Supply.PrimeBandSelectionBudget
namespace OAI
open Erdos970
noncomputable sectionnamespace Ostmann.Supplyopen Filter Ostmann.Constructionopen scoped BigOperators
def sparseBalancedPrimes (d : Decomposition) (δ L : ℝ) (E : Finset ℕ) : Finset ℕ := by classical exact (logLogPrimeBand ((1/20:ℝ)*L) ((9/10:ℝ)*L)).filter (fun p => balancedDensity d p ∧ residueGamma d p≤δ) \ E
theorem sparseBalancedPrimes_properties (d : Decomposition) (δ L : ℝ) (E : Finset ℕ) {p : ℕ} (hp : p∈sparseBalancedPrimes d δ L E) : p.Prime ∧ (1/20:ℝ)*L<Real.log (Real.log p) ∧ Real.log (Real.log p)≤(9/10:ℝ)*L ∧ balancedDensity d p ∧ residueGamma d p≤δ ∧ p∉E := by classical obtain ⟨hp,hE⟩ := Finset.mem_sdiff.mp hp obtain ⟨hband,hbal,hγ⟩ := Finset.mem_filter.mp hp obtain ⟨hprime,hlo,hhi⟩ := (logLogPrimeBand_mem_iff _ _ _).mp hband exact ⟨hprime,hlo,hhi,hbal,hγ,hE⟩
lemma harmonicPrimeMass_mono {P R : Finset ℕ} (hPR : P⊆R) : harmonicPrimeMass P≤harmonicPrimeMass R := by apply Finset.sum_le_sum_of_subset_of_nonneg hPR intro p hp _ exact div_nonneg zero_le_one (Nat.cast_nonneg _)
lemma harmonicPrimeMass_union_le (P R : Finset ℕ) : harmonicPrimeMass (P∪R)≤harmonicPrimeMass P+harmonicPrimeMass R := by unfold harmonicPrimeMass have he := Finset.sum_union_inter (s₁ := P) (s₂ := R) (f := fun p : ℕ => (1:ℝ)/p) have hn : 0≤∑p∈P∩R,(1:ℝ)/p := Finset.sum_nonneg (fun p _ => div_nonneg zero_le_one (Nat.cast_nonneg p)) linarith
theorem sparseBalancedPrimes_mass_cover (d : Decomposition) (δ L : ℝ) (E : Finset ℕ) : harmonicPrimeMass (logLogPrimeBand ((1/20:ℝ)*L) ((9/10:ℝ)*L) \ E)≤ harmonicPrimeMass (sparseBalancedPrimes d δ L E)+ harmonicPrimeMass (unbalancedPrimePrefix d (supplyBandCutoff L))+ harmonicPrimeMass (nonsparsePrimes d δ L) := by classical have hsub : logLogPrimeBand ((1/20:ℝ)*L) ((9/10:ℝ)*L) \ E ⊆ (sparseBalancedPrimes d δ L E ∪ unbalancedPrimePrefix d (supplyBandCutoff L)) ∪ nonsparsePrimes d δ L := by intro p hp obtain ⟨hband,hE⟩ := Finset.mem_sdiff.mp hp obtain ⟨hprime,hlo,hhi⟩ := (logLogPrimeBand_mem_iff _ _ _).mp hband have hupper : p≤ supplyBandCutoff L := by exact (Finset.mem_Ioc.mp (Finset.mem_filter.mp (Finset.mem_sdiff.mp hband).1).1).2 by_cases hbal : balancedDensity d p · by_cases hγ : residueGamma d p≤δ · apply Finset.mem_union_left apply Finset.mem_union_left exact Finset.mem_sdiff.mpr ⟨Finset.mem_filter.mpr ⟨hband,hbal,hγ⟩,hE⟩ · apply Finset.mem_union_right apply Finset.mem_filter.mpr exact ⟨Finset.mem_range.mpr (by unfold supplyBandCutoff at hupper; omega),hprime,hlo.le,hhi,hbal.1,hbal.2, (lt_of_not_ge hγ).le⟩ · apply Finset.mem_union_left apply Finset.mem_union_right exact Finset.mem_filter.mpr ⟨Nat.mem_primesLE.mpr ⟨hupper,hprime⟩,hbal⟩ calc _ ≤ harmonicPrimeMass ((sparseBalancedPrimes d δ L E ∪ unbalancedPrimePrefix d (supplyBandCutoff L)) ∪ nonsparsePrimes d δ L) := harmonicPrimeMass_mono hsub _ ≤ harmonicPrimeMass (sparseBalancedPrimes d δ L E ∪ unbalancedPrimePrefix d (supplyBandCutoff L))+harmonicPrimeMass (nonsparsePrimes d δ L) := harmonicPrimeMass_union_le _ _ _ ≤ _ := by have h := harmonicPrimeMass_union_le (sparseBalancedPrimes d δ L E) (unbalancedPrimePrefix d (supplyBandCutoff L)) linarith
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364import OAI.NumberTheory.Ostmann.Supply.KernelProducts
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators
def enumeratePrimes (P : Finset ℕ) (i : ℕ) : ℕ := if hi : i<P.card then P.orderEmbOfFin rfl ⟨i,hi⟩ else 2
@[simp] theorem enumeratePrimes_lt (P : Finset ℕ) {i : ℕ} (hi : i<P.card) : enumeratePrimes P i=P.orderEmbOfFin rfl ⟨i,hi⟩ := dite_eq_left hi
theorem enumeratePrimes_mem (P : Finset ℕ) {i : ℕ} (hi : i<P.card) : enumeratePrimes P i∈P := by rw [enumeratePrimes_lt P hi]; exact P.orderEmbOfFin_mem rfl _
theorem enumeratePrimes_prime (P : Finset ℕ) (hp : ∀p∈P,p.Prime) (i : ℕ) : (enumeratePrimes P i).Prime := by by_cases hi : i<P.card · exact hp _ (enumeratePrimes_mem P hi) · simp only [enumeratePrimes,dite_eq_right hi] norm_num
instance enumeratePrimes_neZero (P : Finset ℕ) [hp : Fact (∀p∈P,p.Prime)] (i : ℕ) : NeZero (enumeratePrimes P i) := ⟨(enumeratePrimes_prime P hp.out i).ne_zero⟩
theorem enumeratePrimes_injective (P : Finset ℕ) : Set.InjOn (enumeratePrimes P) (Finset.range P.card:Set ℕ) := by intro i hi j hj hij have hi' := Finset.mem_range.mp hi have hj' := Finset.mem_range.mp hj rw [enumeratePrimes_lt P hi',enumeratePrimes_lt P hj'] at hij exact congrArg Fin.val ((P.orderEmbOfFin rfl).injective hij)
theorem enumeratePrimes_image (P : Finset ℕ) : (Finset.range P.card).image (enumeratePrimes P)=P := by ext p constructor · intro hp obtain ⟨i,hi,rfl⟩ := Finset.mem_image.mp hp exact enumeratePrimes_mem P (Finset.mem_range.mp hi) · intro hp let i := (P.orderIsoOfFin rfl).symm ⟨p,hp⟩ refine Finset.mem_image.mpr ⟨i,Finset.mem_range.mpr i.isLt,?_⟩ rw [enumeratePrimes_lt P i.isLt] exact congrArg Subtype.val ((P.orderIsoOfFin rfl).apply_symm_apply ⟨p,hp⟩)
theorem sum_enumeratePrimes {M : Type*} [AddCommMonoid M] (P : Finset ℕ) (f : ℕ→M) : (∑i∈Finset.range P.card,f (enumeratePrimes P i))=∑p∈P,f p := by calc _ = ∑q∈(Finset.range P.card).image (enumeratePrimes P),f q := (Finset.sum_image (enumeratePrimes_injective P)).symm _ = _ := by rw [enumeratePrimes_image P]
theorem reciprocalMass_enumeratePrimes (P : Finset ℕ) : reciprocalMass (Finset.range P.card) (enumeratePrimes P)=∑p∈P,(1:ℝ)/p := sum_enumeratePrimes P (fun p => (1:ℝ)/p)
end Ostmann.Supply
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162import OAI.NumberTheory.Ostmann.Supply.FiniteCoverageimport OAI.NumberTheory.Ostmann.Supply.PrimeMeanIdentity
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen Setopen scoped BigOperators
theorem weightedPrimeSum_eq_interval (φ : ℝ→ℝ) (W : ℕ→ℝ) (hs : tsupport φ ⊆ Ioo (1/2:ℝ) 1) (X : ℕ) (hX : 0<X) : weightedPrimeSum φ (X:ℝ) W = ∑n∈primesInInterval (X/2) X, Real.log n*W n*φ ((n:ℝ)/X) := by classical have hXr : (0:ℝ)<X := Nat.cast_pos.mpr hX have hsub : primesInInterval (X/2) X⊆Finset.Ioc 0 X := by intro n hn obtain ⟨hn,hp⟩ := Finset.mem_filter.mp hn exact Finset.mem_Ioc.mpr ⟨hp.pos,(Finset.mem_Icc.mp hn).2⟩ unfold weightedPrimeSum rw [Nat.floor_natCast] have he := Finset.sum_subset hsub (f:=fun n => if n.Prime then Real.log n*W n*φ ((n:ℝ)/X) else 0) (by intro n hn hnP by_cases hp : n.Prime · rw [ite_eq_left hp] have hz : φ ((n:ℝ)/X)=0 := by by_contra hφ have hw := Ostmann.ZeroDensity.principal_weight_nonzero_interval hs hXr hφ have hlo : X/2≤n := by have hx : (X/2:ℕ)≤(X:ℝ)/2 := by simpa using (Nat.cast_div_le (α:=ℝ) (m:=X) (n:=2)) exact_mod_cast hx.trans hw.1.le apply hnP exact Finset.mem_filter.mpr ⟨Finset.mem_Icc.mpr ⟨hlo,(Finset.mem_Ioc.mp hn).2⟩,hp⟩ rw [hz,mul_zero] · rw [ite_eq_right hp]) rw [←he] apply Finset.sum_congr rfl intro n hn rw [ite_eq_left (Finset.mem_filter.mp hn).2]
theorem weightedPrimeSum_le_log_mul (φ : ℝ→ℝ) (W : ℕ→ℝ) (hs : tsupport φ ⊆ Ioo (1/2:ℝ) 1) (_hφ0 : ∀x,0≤φ x) (hφ1 : ∀x,φ x≤1) (hW : ∀n,0≤W n) (X : ℕ) (hX : 0<X) : weightedPrimeSum φ (X:ℝ) W≤Real.log (X:ℝ)*∑n∈primesInInterval (X/2) X,W n := by rw [weightedPrimeSum_eq_interval φ W hs X hX,Finset.mul_sum] apply Finset.sum_le_sum intro n hn obtain ⟨hn,hp⟩ := Finset.mem_filter.mp hn have hnX : (n:ℝ)≤X := by exact_mod_cast (Finset.mem_Icc.mp hn).2 have hn0 : (0:ℝ)<n := Nat.cast_pos.mpr hp.pos have hlogn : 0≤Real.log (n:ℝ) := Real.log_nonneg (by exact_mod_cast hp.one_le) calc _ ≤ Real.log (n:ℝ)*W n := mul_le_of_le_one_right (mul_nonneg hlogn (hW n)) (hφ1 _) _ ≤ _ := mul_le_mul_of_nonneg_right (Real.log_le_log hn0 hnX) (hW n)
end Ostmann.Supply
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100import OAI.NumberTheory.Ostmann.Supply.GroupedCharactersPrimitiveBoundimport OAI.NumberTheory.Ostmann.Supply.PrimePowerTransferBasic
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen Ostmann.ZeroDensity MeasureTheory Setopen scoped BigOperatorslocal instance {q : ℕ} : DecidableEq (DirichletCharacter ℂ q) := Classical.decEq _
def weightedPrimeSum (φ : ℝ→ℝ) (X : ℝ) (W : ℕ→ℝ) : ℝ := ∑n∈Finset.Ioc 0 ⌊X⌋₊,if n.Prime then Real.log n*W n*φ ((n:ℝ)/X) else 0
def principalFamily (Q : ℕ) (hQ : 0<Q) : PrimitiveFamily Q := ⟨⟨0,hQ⟩,1,DirichletCharacter.isPrimitive_one_level_one⟩
theorem primitiveFamily_principal_iff (Q : ℕ) (hQ : 0<Q) (χ : PrimitiveFamily Q) : χ.2.1=1 ↔ χ=principalFamily Q hQ := by constructor · intro hχ rcases χ with ⟨⟨q,hq⟩,χ,hprim⟩ change χ=1 at hχ have hq0 : q=0 := by have hcond : χ.conductor=q+1 := hprim rw [hχ,DirichletCharacter.conductor_one] at hcond omega subst q subst χ rfl · rintro rfl rfl
theorem smoothPrimeError_add_main {q : ℕ} (χ : DirichletCharacter ℂ q) {φ : ℝ→ℝ} (hs : tsupport φ ⊆ Ioo (1/2:ℝ) 1) {X : ℝ} (hX : 0<X) : smoothPrimeError χ φ X+(if χ=1 then ((X*∫t in Ioi (0:ℝ),φ t:ℝ):ℂ) else 0) = ∑n∈Finset.Ioc 0 ⌊X⌋₊,(if n.Prime then (Real.log n:ℂ)*χ n else 0)* (φ ((n:ℝ)/X):ℂ) := by classical unfold smoothPrimeError rw [sub_add_cancel] exact smooth_tsum_eq_finite _ hs hX
theorem weightedPrimeSum_expansion_generic {α : Type*} [Fintype α] (q : α→ℕ) (χ : ∀i,DirichletCharacter ℂ (q i)) (c : α→ℂ) (W : ℕ→ℝ) {φ : ℝ→ℝ} (hs : tsupport φ ⊆ Ioo (1/2:ℝ) 1) {X : ℝ} (hX : 0<X) (hexp : ∀n:ℕ,n.Prime → φ ((n:ℝ)/X)≠0 → (W n:ℂ)=∑i:α,c i*χ i n) : (weightedPrimeSum φ X W:ℂ)=∑i:α,c i* (smoothPrimeError (χ i) φ X+ if χ i=1 then ((X*∫t in Ioi (0:ℝ),φ t:ℝ):ℂ) else 0) := by classical simp_rw [smoothPrimeError_add_main _ hs hX,Finset.mul_sum] rw [Finset.sum_comm] simp only [weightedPrimeSum,Complex.ofReal_sum] apply Finset.sum_congr rfl intro n hn by_cases hp : n.Prime · simp only [hp,ite_true] by_cases hφ : φ ((n:ℝ)/X)=0 · simp only [hφ,Complex.ofReal_zero,mul_zero,Finset.sum_const_zero] · simp only [Complex.ofReal_mul] rw [hexp n hp hφ,Finset.mul_sum,Finset.sum_mul] apply Finset.sum_congr rfl intro χ hχ ring · simp only [hp,ite_false,Complex.ofReal_zero,zero_mul,mul_zero,Finset.sum_const_zero]
theorem weightedPrimeSum_expansion {Q : ℕ} (c : PrimitiveFamily Q→ℂ) (W : ℕ→ℝ) {φ : ℝ→ℝ} (hs : tsupport φ ⊆ Ioo (1/2:ℝ) 1) {X : ℝ} (hX : 0<X) (hexp : ∀n:ℕ,n.Prime → φ ((n:ℝ)/X)≠0 → (W n:ℂ)=∑χ:PrimitiveFamily Q,c χ*χ.2.1 n) : (weightedPrimeSum φ X W:ℂ)=∑χ:PrimitiveFamily Q,c χ* (smoothPrimeError χ.2.1 φ X+ if χ.2.1=1 then ((X*∫t in Ioi (0:ℝ),φ t:ℝ):ℂ) else 0) := weightedPrimeSum_expansion_generic (α:=PrimitiveFamily Q) (fun χ : PrimitiveFamily Q => χ.1.val+1) (fun χ : PrimitiveFamily Q => χ.2.1) c W hs hX hexp
theorem sum_primitive_principal_term {Q : ℕ} (hQ : 0<Q) (c : PrimitiveFamily Q→ℂ) (M : ℂ) : (∑χ:PrimitiveFamily Q,c χ*(if χ.2.1=1 then M else 0))=c (principalFamily Q hQ)*M := by classical simp_rw [primitiveFamily_principal_iff Q hQ,mul_ite,mul_zero] simp
theorem weightedPrimeSum_sub_main {Q : ℕ} (hQ : 0<Q) (c : PrimitiveFamily Q→ℂ) (W : ℕ→ℝ) {φ : ℝ→ℝ} (hs : tsupport φ ⊆ Ioo (1/2:ℝ) 1) {X : ℝ} (hX : 0<X) (hexp : ∀n:ℕ,n.Prime → φ ((n:ℝ)/X)≠0 → (W n:ℂ)=∑χ:PrimitiveFamily Q,c χ*χ.2.1 n) : (weightedPrimeSum φ X W:ℂ)-c (principalFamily Q hQ)* ((X*∫t in Ioi (0:ℝ),φ t:ℝ):ℂ)=∑χ:PrimitiveFamily Q,c χ*smoothPrimeError χ.2.1 φ X := by rw [weightedPrimeSum_expansion c W hs hX hexp] simp only [mul_add,Finset.sum_add_distrib] rw [sum_primitive_principal_term hQ c,add_sub_cancel_right]
end Ostmann.Supply
end
end OAI123456789101112131415161718192021222324252627282930import OAI.NumberTheory.Ostmann.Supply.TruncationMargins
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen Filter
theorem eventually_exp_tail_le_unit_multiple {c : ℝ} (hc : 0<c) : ∀ᶠL:ℝ in atTop,∀H U:ℝ,H≤L → Real.exp (-8*supplyEpsilon*H)≤U → Real.exp (-10*L)≤c*U := by have hd : Tendsto (fun L:ℝ => Real.exp (-9*L)) atTop (nhds 0) := Real.tendsto_exp_atBot.comp (tendsto_id.const_mul_atTop_of_neg (by norm_num)) filter_upwards [hd.eventually_le_const hc,eventually_ge_atTop (0:ℝ)] with L hd hL intro H U hH hU have hh := mul_le_mul_of_nonneg_left hH (by norm_num [supplyEpsilon] : 0≤8*supplyEpsilon) have he : -10*L≤-9*L+(-8*supplyEpsilon*H) := by norm_num only [supplyEpsilon] at hh ⊢ linarith calc _ ≤ Real.exp (-9*L+(-8*supplyEpsilon*H)) := Real.exp_le_exp.mpr he _ = Real.exp (-9*L)*Real.exp (-8*supplyEpsilon*H) := Real.exp_add _ _ _ ≤ _ := mul_le_mul hd hU (Real.exp_pos _).le hc.le
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879import Mathlib.Analysis.Normed.Group.Boundedimport OAI.NumberTheory.Ostmann.Supply.PrimePowerTransferBasic
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen Finset Set Ostmann.ZeroDensityopen scoped BigOperators Topology
def totalPrimitivePrimeError (Q : ℕ) (exception : Option (PrimitiveFamily Q)) (φ : ℝ → ℝ) (X : ℝ) : ℝ := ∑ χ : PrimitiveFamily Q, if some χ = exception then 0 else ‖smoothPrimeError χ.2.1 φ X‖
theorem exists_primePower_transfer_constant (φ : ℝ → ℝ) (hφ : Continuous φ) (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q) (X : ℝ), 0 < X → ‖smoothError χ φ X-smoothPrimeError χ φ X‖ ≤ C*Real.sqrt X := by have hc : HasCompactSupport φ := HasCompactSupport.of_support_subset_isCompact (K := Icc (1/2 : ℝ) 1) isCompact_Icc (fun x hx => ⟨(hs (subset_tsupport φ hx)).1.le, (hs (subset_tsupport φ hx)).2.le⟩) obtain ⟨B, hB⟩ := hc.exists_bound_of_continuous hφ obtain ⟨D, hD⟩ := Chebyshev.psi_sub_theta_le_mul_sqrt refine ⟨(|B|+1)*(|D|+1), by positivity, ?_⟩ intro q _ χ X hX have htest : ∀ x, ‖φ x‖ ≤ |B|+1 := fun x => (hB x).trans (by linarith [le_abs_self B]) calc _ ≤ (|B|+1)*(Chebyshev.psi X-Chebyshev.theta X) := norm_smoothError_sub_smoothPrimeError_le χ hs hX htest _ ≤ (|B|+1)*(D*Real.sqrt X) := mul_le_mul_of_nonneg_left (hD X) (by positivity) _ ≤ (|B|+1)*((|D|+1)*Real.sqrt X) := by apply mul_le_mul_of_nonneg_left _ (by positivity) exact mul_le_mul_of_nonneg_right (by linarith [le_abs_self D]) (Real.sqrt_nonneg _) _ = _ := by ring
theorem totalPrimitivePrimeError_le (Q : ℕ) (exception : Option (PrimitiveFamily Q)) (φ : ℝ → ℝ) (X E : ℝ) (hE : 0 ≤ E) (h : ∀ χ : PrimitiveFamily Q, ‖smoothError χ.2.1 φ X-smoothPrimeError χ.2.1 φ X‖ ≤ E) : totalPrimitivePrimeError Q exception φ X ≤ totalPrimitiveError Q exception φ X+(Q : ℝ)^2*E := by calc _ ≤ ∑ χ : PrimitiveFamily Q, ((if some χ = exception then 0 else ‖smoothError χ.2.1 φ X‖)+E) := by apply sum_le_sum intro χ hχ by_cases he : some χ = exception · simpa only [ite_eq_left he, zero_add] using hE · simp only [ite_eq_right he] calc _ = ‖smoothError χ.2.1 φ X-(smoothError χ.2.1 φ X-smoothPrimeError χ.2.1 φ X)‖ := by rw [sub_sub_cancel] _ ≤ ‖smoothError χ.2.1 φ X‖+‖smoothError χ.2.1 φ X-smoothPrimeError χ.2.1 φ X‖ := norm_sub_le _ _ _ ≤ _ := add_le_add le_rfl (h χ) _ = totalPrimitiveError Q exception φ X+(Fintype.card (PrimitiveFamily Q) : ℝ)*E := by simp only [sum_add_distrib, sum_const, card_univ, nsmul_eq_mul, totalPrimitiveError] _ ≤ _ := by apply add_le_add le_rfl apply mul_le_mul_of_nonneg_right _ hE exact_mod_cast card_primitiveFamily_le Q
theorem exists_totalPrimitivePrimeError_le (φ : ℝ → ℝ) (hφ : Continuous φ) (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) : ∃ C : ℝ, 0 < C ∧ ∀ (Q : ℕ) (exception : Option (PrimitiveFamily Q)) (X : ℝ), 0 < X → totalPrimitivePrimeError Q exception φ X ≤ totalPrimitiveError Q exception φ X+ (Q : ℝ)^2*C*Real.sqrt X := by obtain ⟨C, hC, h⟩ := exists_primePower_transfer_constant φ hφ hs refine ⟨C, hC, ?_⟩ intro Q exception X hX have hb := totalPrimitivePrimeError_le Q exception φ X (C*Real.sqrt X) (mul_nonneg hC.le (Real.sqrt_nonneg _)) (fun χ => h (χ.1.val+1) χ.2.1 X hX) simpa only [mul_assoc] using hb
end Ostmann.Supply
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172import Mathlib.NumberTheory.Chebyshevimport OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalSmoothingAbel
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen Finset Set MeasureTheory Ostmann.ZeroDensityopen scoped BigOperators Topology
def smoothPrimeError {q : ℕ} (χ : DirichletCharacter ℂ q) (φ : ℝ → ℝ) (X : ℝ) : ℂ := by classical exact (∑' n : ℕ, (if n.Prime then (Real.log n : ℂ)*χ n else 0) * (φ ((n : ℝ)/X) : ℂ)) - if χ = 1 then ((X * ∫ t in Set.Ioi (0 : ℝ), φ t : ℝ) : ℂ) else 0
theorem smooth_tsum_eq_finite (c : ℕ → ℂ) {φ : ℝ → ℝ} (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) {X : ℝ} (hX : 0 < X) : (∑' n : ℕ, c n * (φ ((n : ℝ)/X) : ℂ)) = ∑ n ∈ Finset.Ioc 0 ⌊X⌋₊, c n * (φ ((n : ℝ)/X) : ℂ) := by apply tsum_eq_sum intro n hn have hz : φ ((n : ℝ)/X) = 0 := by by_contra h have hi := principal_weight_nonzero_interval hs hX h apply hn apply Finset.mem_Ioc.mpr constructor · exact_mod_cast lt_trans (by positivity : (0 : ℝ) < X/2) hi.1 · exact Nat.le_floor hi.2.le simp only [hz, Complex.ofReal_zero, mul_zero]
theorem smoothError_sub_smoothPrimeError {q : ℕ} (χ : DirichletCharacter ℂ q) {φ : ℝ → ℝ} (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) {X : ℝ} (hX : 0 < X) : smoothError χ φ X - smoothPrimeError χ φ X = ∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter (fun n => ¬n.Prime), (ArithmeticFunction.vonMangoldt n : ℂ)*χ n*(φ ((n : ℝ)/X) : ℂ) := by unfold smoothError smoothPrimeError rw [smooth_tsum_eq_finite _ hs hX, smooth_tsum_eq_finite _ hs hX, sub_sub_sub_cancel_right, ← sum_sub_distrib, sum_filter] apply sum_congr rfl intro n hn by_cases hp : n.Prime · simp only [hp, ite_true, not_true_eq_false, ite_false, ArithmeticFunction.vonMangoldt_apply_prime hp, sub_self] · simp only [hp, ite_false, not_false_eq_true, ite_true, zero_mul, sub_zero]
theorem norm_smoothError_sub_smoothPrimeError_le {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) {φ : ℝ → ℝ} (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) {X B : ℝ} (hX : 0 < X) (hB : ∀ x, ‖φ x‖ ≤ B) : ‖smoothError χ φ X - smoothPrimeError χ φ X‖ ≤ B*(Chebyshev.psi X-Chebyshev.theta X) := by rw [smoothError_sub_smoothPrimeError χ hs hX, Chebyshev.psi_sub_theta_eq_sum_not_prime, mul_sum] apply (norm_sum_le _ _).trans apply sum_le_sum intro n hn simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg ArithmeticFunction.vonMangoldt_nonneg] have hw : |φ ((n : ℝ)/X)| ≤ B := by simpa only [Real.norm_eq_abs] using hB ((n : ℝ)/X) calc _ ≤ ArithmeticFunction.vonMangoldt n * |φ ((n : ℝ)/X)| := mul_le_mul_of_nonneg_right (mul_le_of_le_one_right ArithmeticFunction.vonMangoldt_nonneg (χ.norm_le_one _)) (abs_nonneg _) _ ≤ ArithmeticFunction.vonMangoldt n * B := mul_le_mul_of_nonneg_left hw ArithmeticFunction.vonMangoldt_nonneg _ = _ := mul_comm _ _
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879import OAI.NumberTheory.Ostmann.Supply.PrimeSubsetMainTermimport OAI.NumberTheory.Ostmann.Preliminaries.BoundedSieveSubsetsimport OAI.NumberTheory.Ostmann.Preliminaries.AdditiveSieveProof
namespace OAI
/-! # The support sieve indexed by actual finite sets of primes -/
namespace Ostmann
open scoped Classical BigOperators
theorem prime_set_support_sieve {M Q : ℕ} (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (S : ∀ p : ℕ, Finset (ZMod p)) (hS : ∀ p ∈ P, (S p).Nonempty) (hQ : 1 ≤ Q) (hM : 1 ≤ M) (A : Finset (Fin M)) (hA : A.Nonempty) (J : ℤ) (ha : ∀ x ∈ A, ∀ p ∈ P, ((J + (x.val : ℤ) : ℤ) : ZMod p) ∈ S p) : (∑ U ∈ boundedSieveSubsets P Q, ∏ p ∈ U, ((p : ℝ) / (S p).card - 1)) ≤ ((M : ℝ) + (Q : ℝ) ^ 2) / A.card := by let e : Fin P.card ≃ P := by simpa only [Fintype.card_coe] using (Fintype.equivFin P).symm let p : Fin P.card → ℕ := fun i => (e i).val have hinj : Function.Injective p := fun i j hij => e.injective (Subtype.ext hij) have hmem (i : Fin P.card) : p i ∈ P := (e i).property have hcover : ∀ q ∈ P, ∃ i : Fin P.card, p i = q := by intro q hq refine ⟨e.symm ⟨q, hq⟩, ?_⟩ simp only [p, Equiv.apply_symm_apply] let : ∀ i, Fact (p i).Prime := fun i => ⟨hP _ (hmem i)⟩ have hc : Pairwise (fun i j => (p i).Coprime (p j)) := by intro i j hij exact (Nat.coprime_primes (hP _ (hmem i)) (hP _ (hmem j))).mpr (fun he => hij (hinj he)) let G := (Finset.univ : Finset (Fin P.card)).powerset.filter (fun R => (∏ i ∈ R, p i) ≤ Q) have hGprod : ∀ R ∈ G, (∏ i ∈ R, p i) ≤ Q := fun _ hR => (Finset.mem_filter.mp hR).2 have hbound := prime_subset_main_term publishedAdditiveLargeSieve p hc (fun i => S (p i)) (fun i => hS _ (hmem i)) G hQ hM A hA J hGprod (fun _ _ x hx i _ => ha x hx (p i) (hmem i)) have hsum : (∑ R ∈ G, ∏ i ∈ R, ((p i : ℝ) / (S (p i)).card - 1)) = ∑ U ∈ boundedSieveSubsets P Q, ∏ q ∈ U, ((q : ℝ) / (S q).card - 1) := by apply Finset.sum_bij (fun R _ => R.image p) · intro R hR have hprod : (∏ q ∈ R.image p, q) = ∏ i ∈ R, p i := by rw [Finset.prod_image]; exact fun _ _ _ _ he => hinj he apply Finset.mem_filter.mpr refine ⟨Finset.mem_powerset.mpr ?_, ?_⟩ · intro q hq obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hq exact hmem i · rw [hprod] exact hGprod R hR · intro R _ T _ he exact Finset.image_injective hinj he · intro U hU have hUP := Finset.mem_powerset.mp (Finset.mem_filter.mp hU).1 let R := (Finset.univ : Finset (Fin P.card)).filter fun i => p i ∈ U have himage : R.image p = U := by ext q constructor · intro hq obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hq exact (Finset.mem_filter.mp hi).2 · intro hq obtain ⟨i, hi⟩ := hcover q (hUP hq) exact Finset.mem_image.mpr ⟨i, Finset.mem_filter.mpr ⟨Finset.mem_univ _, by simpa only [hi] using hq⟩, hi⟩ refine ⟨R, Finset.mem_filter.mpr ⟨Finset.mem_powerset.mpr (Finset.subset_univ _), ?_⟩, himage⟩ have he : (∏ q ∈ U, q) = ∏ i ∈ R, p i := by rw [← himage, Finset.prod_image]; exact fun _ _ _ _ hij => hinj hij rw [← he] exact (Finset.mem_filter.mp hU).2 · intro R _ rw [Finset.prod_image]; exact fun _ _ _ _ he => hinj he rwa [hsum] at hbound
end Ostmann
end OAI1234567891011121314151617181920212223242526272829303132333435import OAI.NumberTheory.Ostmann.Supply.PrimeSubsetSieve
namespace OAI
/-! # The positive empty-coordinate term in the subset large sieve -/
namespace Ostmann
open scoped Classical BigOperators
theorem prime_subset_main_term (ls : PublishedAdditiveLargeSieve) {n M Q : ℕ} (p : Fin n → ℕ) [∀ i, Fact (p i).Prime] (hc : Pairwise (fun i j => (p i).Coprime (p j))) (S : ∀ i, Finset (ZMod (p i))) (hS : ∀ i, (S i).Nonempty) (G : Finset (Finset (Fin n))) (hQ : 1 ≤ Q) (hM : 1 ≤ M) (A : Finset (Fin M)) (hA : A.Nonempty) (J : ℤ) (hprod : ∀ R ∈ G, (∏ i ∈ R, p i) ≤ Q) (ha : ∀ R ∈ G, ∀ x ∈ A, ∀ i ∈ R, ((J + (x.val : ℤ) : ℤ) : ZMod (p i)) ∈ S i) : (∑ R ∈ G, ∏ i ∈ R, ((p i : ℝ) / (S i).card - 1)) ≤ ((M : ℝ) + (Q : ℝ) ^ 2) / A.card := by apply le_trans _ (prime_subset_sieve_bound ls p hc S G hQ hM A hA J hprod ha) apply Finset.sum_le_sum intro R hR have hnonneg (T : Finset (Fin n)) (_hT : T ∈ R.powerset) : 0 ≤ subsetSieveCoefficient p S R T * centeredSubsetEnergy p S T A (fun x i => ((J + (x.val : ℤ) : ℤ) : ZMod (p i))) := mul_nonneg (subsetSieveCoefficient_nonneg p S R T (fun i _ => hS i)) (centeredSubsetEnergy_nonneg p S T A _) have h := Finset.single_le_sum hnonneg (show ∅ ∈ R.powerset by simp) rw [centeredSubsetEnergy_empty p S A hA, mul_one] at h simpa only [subsetSieveCoefficient, Finset.prod_empty, one_mul, Finset.sdiff_empty] using h
end Ostmann
end OAI12345678910111213141516171819202122232425262728293031323334353637import OAI.NumberTheory.Ostmann.Construction.PrimeSubsetCellMixtureimport OAI.NumberTheory.Ostmann.Arithmetic.BulkPrimeCellMass
namespace OAI
/-! # Exact mass and normalization of the original atomic prime laws -/
namespace Ostmannopen MeasureTheoryopen scoped Classical BigOperators
theorem primeSubsetLogMeasure_mass (S : Finset ℕ) (Z : ℝ) (hZ : 0 ≤ Z) : (primeSubsetLogMeasure S Z).real Set.univ = Z * ∑ p ∈ S, (p : ℝ)⁻¹ := by have h := (bulkConstant (σ := Unit) 1).average_primeSubset S Z hZ () (fun _ => 0) rw [bulkConstant_average_one] at h simp only [bulkConstant, one_mul, ← Complex.ofReal_inv, ← Complex.ofReal_sum, ← Complex.ofReal_mul] at h exact_mod_cast h
theorem primeSubsetLogMeasure_normalized (S : Finset ℕ) (hS : (∑ p ∈ S, (p : ℝ)⁻¹) ≠ 0) : (primeSubsetLogMeasure S (∑ p ∈ S, (p : ℝ)⁻¹)⁻¹).real Set.univ = 1 := by rw [primeSubsetLogMeasure_mass _ _ (inv_nonneg.mpr (Finset.sum_nonneg fun p _ => by positivity)), inv_mul_cancel₀ hS]
theorem bulkPrimeCells_normalized {C : Type*} [Fintype C] (q : ℕ) (a : C → ℕ) (u v : C → ℝ) (hsep : ∀ c d, c ≠ d → ¬Nat.ModEq q (a c) (a d) ∨ v c ≤ u d ∨ v d ≤ u c) (hS : (∑ p ∈ primeCellSupport q a u v, (p : ℝ)⁻¹) ≠ 0) : (bulkCellMixture (∑ p ∈ primeCellSupport q a u v, (p : ℝ)⁻¹)⁻¹ (fun c => primeLogCellMeasure q (a c) (u c) (v c))).real Set.univ = 1 := by rw [← primeSubsetLogMeasure_cells q a u v _ hsep] exact primeSubsetLogMeasure_normalized _ hS
end Ostmann
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061import Mathlib.Data.Nat.Squarefreeimport Mathlib.Data.Finset.Powersetimport OAI.NumberTheory.Ostmann.QuadraticSieve.PublishedQuadraticSieve
namespace OAI
/-! # Products of distinct primes index the amplified coefficient array -/
namespace Ostmann
open scoped BigOperators Classical
def primeSubsetProducts (P : Finset ℕ) (k : ℕ) : Finset ℕ := (P.powersetCard k).image fun Q => ∏ p ∈ Q, p
theorem primeSubset_product_injective (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) : Set.InjOn (fun Q : Finset ℕ => ∏ p ∈ Q, p) {Q | Q ⊆ P} := by intro Q hQ R hR heq have h := congrArg Nat.primeFactors heq rwa [Nat.primeFactors_prod (fun p hp => hP p (hQ hp)), Nat.primeFactors_prod (fun p hp => hP p (hR hp))] at h
theorem primeSubsetProducts_card (P : Finset ℕ) (k : ℕ) (hP : ∀ p ∈ P, p.Prime) : (primeSubsetProducts P k).card = P.card.choose k := by rw [primeSubsetProducts, Finset.card_image_iff.mpr] · exact Finset.card_powersetCard k P · intro Q hQ R hR h exact primeSubset_product_injective P hP (Finset.mem_powersetCard.mp hQ).1 (Finset.mem_powersetCard.mp hR).1 h
theorem primeSubset_product_squarefree (Q : Finset ℕ) (hQ : ∀ p ∈ Q, p.Prime) : Squarefree (∏ p ∈ Q, p) := by apply Finset.squarefree_prod_of_pairwise_isCoprime · intro p hp q hq hpq exact Nat.coprime_iff_isRelPrime.mp ((Nat.coprime_primes (hQ p hp) (hQ q hq)).mpr hpq) · intro p hp exact (hQ p hp).squarefree
theorem primeSubsetProducts_mem_range (P : Finset ℕ) (k Z : ℕ) (hP : ∀ p ∈ P, p.Prime) (hodd : ∀ p ∈ P, Odd p) (hZ : ∀ p ∈ P, p ≤ Z) : primeSubsetProducts P k ⊆ oddSquarefreeRange (Z ^ k) := by intro s hs obtain ⟨Q, hQ, rfl⟩ := Finset.mem_image.mp hs obtain ⟨hQP, hcard⟩ := Finset.mem_powersetCard.mp hQ have hprime : ∀ p ∈ Q, p.Prime := fun p hp => hP p (hQP hp) have hsf := primeSubset_product_squarefree Q hprime refine Finset.mem_filter.mpr ⟨Finset.mem_Icc.mpr ⟨Nat.pos_of_ne_zero hsf.ne_zero, ?_⟩, ?_, hsf⟩ · simpa only [hcard] using Finset.prod_le_pow_card Q (fun p => p) Z (fun p hp => hZ p (hQP hp)) · have ho : ∀ p ∈ Q, Odd p := fun p hp => hodd p (hQP hp) clear hprime hsf hcard hQP hQ hs induction Q using Finset.induction_on with | empty => simp | @insert p Q hp ih => rw [Finset.prod_insert hp] exact (ho p (Finset.mem_insert_self _ _)).mul (ih (fun q hq => ho q (Finset.mem_insert_of_mem hq)))
end Ostmann
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970import OAI.NumberTheory.Ostmann.Supply.SubsetReducedEnergy
namespace OAI
/-! # Summing the positive subset expansion inside the additive large sieve -/
namespace Ostmannopen scoped Classical BigOperators
theorem prime_subset_product_dvd_iff {n : ℕ} (p : Fin n → ℕ) [∀ i, Fact (p i).Prime] (hc : Pairwise (fun i j => (p i).Coprime (p j))) (R : Finset (Fin n)) (i : Fin n) : (p i ∣ ∏ j ∈ R, p j) ↔ i ∈ R := by rw [(Fact.out : (p i).Prime).prime.dvd_finsetProd_iff] constructor · rintro ⟨j, hj, hd⟩ by_cases hij : i = j · simpa only [hij] using hj · exact ((Fact.out : (p i).Prime).coprime_iff_not_dvd.mp (hc hij) hd).elim · intro hi exact ⟨i, hi, dvd_rfl⟩
theorem prime_subset_product_injective {n : ℕ} (p : Fin n → ℕ) [∀ i, Fact (p i).Prime] (hc : Pairwise (fun i j => (p i).Coprime (p j))) : Function.Injective (fun R : Finset (Fin n) => ∏ i ∈ R, p i) := by intro R T h ext i rw [← prime_subset_product_dvd_iff p hc R i, ← prime_subset_product_dvd_iff p hc T i] exact Iff.of_eq (congrArg (fun q => p i ∣ q) h)
/-- The complete double sum is bounded by the classical additive large sieve.No centered-coordinate energy estimate is postulated in this step. -/theorem prime_subset_sieve_bound (ls : PublishedAdditiveLargeSieve) {n M Q : ℕ} (p : Fin n → ℕ) [∀ i, Fact (p i).Prime] (hc : Pairwise (fun i j => (p i).Coprime (p j))) (S : ∀ i, Finset (ZMod (p i))) (G : Finset (Finset (Fin n))) (hQ : 1 ≤ Q) (hM : 1 ≤ M) (A : Finset (Fin M)) (hA : A.Nonempty) (J : ℤ) (hprod : ∀ R ∈ G, (∏ i ∈ R, p i) ≤ Q) (ha : ∀ R ∈ G, ∀ x ∈ A, ∀ i ∈ R, ((J + (x.val : ℤ) : ℤ) : ZMod (p i)) ∈ S i) : (∑ R ∈ G, ∑ T ∈ R.powerset, subsetSieveCoefficient p S R T * centeredSubsetEnergy p S T A (fun x i => ((J + (x.val : ℤ) : ℤ) : ZMod (p i)))) ≤ ((M : ℝ) + (Q : ℝ) ^ 2) / A.card := by have hpos (R : Finset (Fin n)) : 0 < ∏ i ∈ R, p i := Finset.prod_pos (fun i _ => (Fact.out : (p i).Prime).pos) have he (R) (hR : R ∈ G) : (∑ T ∈ R.powerset, subsetSieveCoefficient p S R T * centeredSubsetEnergy p S T A (fun x i => ((J + (x.val : ℤ) : ℤ) : ZMod (p i)))) = intervalSetReducedEnergy A J (∏ i ∈ R, p i) := by let : NeZero (∏ i ∈ R, p i) := ⟨(hpos R).ne'⟩ rw [intervalSetReducedEnergy_eq_unitFrequencyEnergy] exact (subset_reduced_energy_expansion p S R hc A (fun x => J + (x.val : ℤ)) (ha R hR)).symm calc _ = ∑ R ∈ G, intervalSetReducedEnergy A J (∏ i ∈ R, p i) := Finset.sum_congr rfl he _ = ∑ q ∈ G.image (fun R => ∏ i ∈ R, p i), intervalSetReducedEnergy A J q := by rw [Finset.sum_image] exact fun _ _ _ _ h => prime_subset_product_injective p hc h _ ≤ ∑ q ∈ Finset.Icc 1 Q, intervalSetReducedEnergy A J q := by apply Finset.sum_le_sum_of_subset_of_nonneg · intro q hq obtain ⟨R, hR, rfl⟩ := Finset.mem_image.mp hq exact Finset.mem_Icc.mpr ⟨hpos R, hprod R hR⟩ · intro q _ _ exact intervalSetReducedEnergy_nonneg A J q _ ≤ _ := additiveSieve_probability_bound ls hM hQ A hA J
end Ostmann
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152import OAI.NumberTheory.Ostmann.Supply.PrimeSubsetSieve
namespace OAI
/-! # A missing-residue lower bound for the actual reduced prime energy -/
namespace Ostmann
open scoped Classical BigOperators
theorem unitFrequencyEnergy_int_congr {q r : ℕ} [NeZero q] [NeZero r] (h : q = r) {ι : Type*} (A : Finset ι) (a : ι → ℤ) : unitFrequencyEnergy A (fun x => (a x : ZMod q)) = unitFrequencyEnergy A (fun x => (a x : ZMod r)) := by subst r rfl
theorem prime_support_energy_lower {ι : Type*} (p : ℕ) [Fact p.Prime] (A : Finset ι) (hA : A.Nonempty) (a : ι → ℤ) (S : Finset (ZMod p)) (hS : S.Nonempty) (ha : ∀ x ∈ A, (a x : ZMod p) ∈ S) : (p : ℝ) / S.card - 1 ≤ unitFrequencyEnergy A (fun x => (a x : ZMod p)) := by let ps : Fin 1 → ℕ := fun _ => p let ss : ∀ i, Finset (ZMod (ps i)) := fun _ => S let R : Finset (Fin 1) := {0} have hc : Pairwise (fun i j => (ps i).Coprime (ps j)) := by intro i j hij have he : i = j := Subsingleton.elim i j exact (hij he).elim have hprod : ∏ i ∈ R, ps i = p := by simp [R, ps] let : NeZero (∏ i ∈ R, ps i) := ⟨by rw [hprod]; exact (Fact.out : p.Prime).ne_zero⟩ have hpa : ∀ x ∈ A, ∀ i ∈ R, (a x : ZMod (ps i)) ∈ ss i := by intro x hx i _ exact ha x hx have he := subset_reduced_energy_expansion ps ss R hc A a hpa have hnonneg (T : Finset (Fin 1)) (hT : T ∈ R.powerset) : 0 ≤ subsetSieveCoefficient ps ss R T * centeredSubsetEnergy ps ss T A (fun x i => (a x : ZMod (ps i))) := by apply mul_nonneg · exact subsetSieveCoefficient_nonneg ps ss R T (fun _ _ => hS) · exact centeredSubsetEnergy_nonneg ps ss T A _ have hle := Finset.single_le_sum hnonneg (show ∅ ∈ R.powerset by simp) rw [centeredSubsetEnergy_empty ps ss A hA, mul_one] at hle have hcoeff : subsetSieveCoefficient ps ss R ∅ = (p : ℝ) / S.card - 1 := by simp [subsetSieveCoefficient, R, ps, ss] rw [hcoeff, ← he] at hle rw [unitFrequencyEnergy_int_congr hprod A a] at hle exact hle
end Ostmann
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051import OAI.NumberTheory.Ostmann.Supply.PrimeSupportEnergyimport OAI.NumberTheory.Ostmann.Preliminaries.FullSummandResiduesimport OAI.NumberTheory.Ostmann.Preliminaries.AdditiveSieveProof
namespace OAI
/-! # The prime-support sieve estimate for the summand-size argument -/
namespace Ostmann
open scoped Classical BigOperators
theorem full_support_prime_energy {M : ℕ} (B : Set ℕ) (U : Finset (Fin M)) (hU : U.Nonempty) (p : ℕ) [Fact p.Prime] (havoid : ∀ a ∈ U, (a.val : ZMod p) ∉ negativeOccupiedResidues B p) : ((occupiedResidues B p).card : ℝ) / p ≤ intervalSetReducedEnergy U 0 p := by have hmem : ∀ a ∈ U, ((a.val : ℤ) : ZMod p) ∈ allowedSummandResidues B p := by intro a ha simpa only [allowedSummandResidues, Finset.mem_sdiff, Finset.mem_univ, true_and, Int.cast_natCast] using havoid a ha have hS : (allowedSummandResidues B p).Nonempty := by obtain ⟨a, ha⟩ := hU exact ⟨_, hmem a ha⟩ have hlower := prime_support_energy_lower p U hU (fun a => (a.val : ℤ)) (allowedSummandResidues B p) hS hmem have h := (occupied_to_allowed_ratio B p hS).trans hlower simpa only [intervalSetReducedEnergy_eq_unitFrequencyEnergy, zero_add] using h
theorem full_support_prime_sieve {M Q : ℕ} (B : Set ℕ) (U : Finset (Fin M)) (hU : U.Nonempty) (hM : 1 ≤ M) (hQ : 1 ≤ Q) (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (hPQ : ∀ p ∈ P, p ≤ Q) (havoid : ∀ p ∈ P, ∀ a ∈ U, (a.val : ZMod p) ∉ negativeOccupiedResidues B p) : (∑ p ∈ P, ((occupiedResidues B p).card : ℝ) / p) ≤ ((M : ℝ) + (Q : ℝ) ^ 2) / U.card := by calc _ ≤ ∑ p ∈ P, intervalSetReducedEnergy U 0 p := by apply Finset.sum_le_sum intro p hp let : Fact p.Prime := ⟨hP p hp⟩ exact full_support_prime_energy B U hU p (havoid p hp) _ ≤ ∑ q ∈ Finset.Icc 1 Q, intervalSetReducedEnergy U 0 q := by apply Finset.sum_le_sum_of_subset_of_nonneg · intro p hp exact Finset.mem_Icc.mpr ⟨(hP p hp).one_le, hPQ p hp⟩ · intro q _ _ exact intervalSetReducedEnergy_nonneg U 0 q _ ≤ _ := additiveSieve_probability_bound publishedAdditiveLargeSieve hM hQ U hU 0
end Ostmann
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import OAI.NumberTheory.Ostmann.Supply.CenteredProjection
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators ComplexConjugate
section Hilbertvariable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H]variable (U V W : Submodule ℂ H)variable [U.HasOrthogonalProjection] [V.HasOrthogonalProjection] [W.HasOrthogonalProjection]
theorem projection_cross_norm_le_half (hUV : U ⟂ V) : ‖U.starProjection ∘L W.starProjection ∘L V.starProjection‖ ≤ (1/2 : ℝ) := by refine (U.starProjection ∘L W.starProjection ∘L V.starProjection).opNorm_le_bound (by norm_num) (fun x => ?_) have hz : U.starProjection (V.starProjection x) = 0 := by exact DFunLike.congr_fun hUV.starProjection_comp_starProjection x have he : U.starProjection (W.starProjection (V.starProjection x)) = (1/2 : ℂ) • U.starProjection (W.reflection (V.starProjection x)) := by rw [Submodule.reflection_apply, two_smul, map_sub, map_add, hz, sub_zero] module change ‖U.starProjection (W.starProjection (V.starProjection x))‖ ≤ _ rw [he, norm_smul] have hn : ‖(1/2 : ℂ)‖ = (1/2 : ℝ) := by norm_num rw [hn] apply mul_le_mul_of_nonneg_left _ (by norm_num) exact (U.norm_starProjection_apply_le _).trans ((W.reflection.norm_map _).trans_le (V.norm_starProjection_apply_le x))end Hilbert
section Centeredvariable {ι : Type*} [Fintype ι] [DecidableEq ι]
theorem centeredSpace_isOrtho_of_disjoint (S T : Finset ι) (hST : Disjoint S T) : centeredSpace S ⟂ centeredSpace T := by intro f hf g hg rw [PiLp.inner_apply] apply Finset.sum_eq_zero intro x hx by_cases hxs : x ∈ S · have hxt : x ∉ T := fun hxt => Finset.disjoint_left.mp hST hxs hxt simp [hg.1 x hxt] · simp [hf.1 x hxs]
theorem centeredProjection_cross_norm_le_half (S T : Finset ι) (hST : Disjoint S T) (W : Submodule ℂ (EuclideanSpace ℂ ι)) : ‖centeredProjection S ∘L W.starProjection ∘L centeredProjection T‖ ≤ (1/2 : ℝ) := projection_cross_norm_le_half _ _ _ (centeredSpace_isOrtho_of_disjoint S T hST)end Centeredend Ostmann.Supply
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768import OAI.NumberTheory.Ostmann.Supply.UniformProjection
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators ComplexConjugatevariable {p : ℕ} [NeZero p]local notation "H" => EuclideanSpace ℂ (ZMod p)
theorem spectralProjection_inner_projected (E : Finset (ZMod p)) (f g : H) : inner ℂ f (spectralProjection E g) = inner ℂ (spectralProjection E f) (spectralProjection E g) := by change inner ℂ f ((frequencySpace E).starProjection g) = inner ℂ ((frequencySpace E).starProjection f) ((frequencySpace E).starProjection g) rw [Submodule.inner_starProjection_left_eq_right] rw [Submodule.starProjection_eq_self_iff.mpr ((frequencySpace E).starProjection_apply_mem g)]
theorem spectralProjection_scalar (S : Finset (ZMod p)) (hpos : 0 < density S) (hlt : density S < 1) : inner ℂ (uniformVector S) (spectralProjection (largeSpectrum S) (uniformVector Sᶜ)) = (-((p:ℝ)⁻¹^2 * ‖spectralProjection (largeSpectrum S) (normalizedVector S)‖^2) : ℝ) := by rw [spectralProjection_inner_projected, spectralProjection_uniform S hpos hlt, spectralProjection_uniform_compl S hpos hlt, inner_smul_left, inner_smul_right] have hn (v : H) : inner ℂ v v = (‖v‖^2 : ℝ) := by rw [PiLp.inner_apply, PiLp.norm_sq_eq_of_L2] simp only [RCLike.inner_apply, Complex.mul_conj', Complex.ofReal_sum, Complex.ofReal_pow] rw [hn] have hc := congrArg (fun r : ℝ => (r:ℂ)) (uniformCoefficient_mul_compl S hpos hlt) push_cast at hc ⊢ simp only [Complex.conj_ofReal] calc _ = -((uniformCoefficient S : ℂ)*(uniformCoefficient Sᶜ : ℂ))* ((‖spectralProjection (largeSpectrum S) (normalizedVector S)‖:ℂ)^2) := by ring _ = _ := by rw [hc]; ring
theorem spectralProjection_scalar_re_le (S : Finset (ZMod p)) (hpos : 0 < density S) (hlt : density S < 1) : (inner ℂ (uniformVector S) (spectralProjection (largeSpectrum S) (uniformVector Sᶜ))).re ≤ -(1-gamma S)/(p:ℝ) := by rw [spectralProjection_scalar S hpos hlt, Complex.ofReal_re] have hp : (p:ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p have h := mul_le_mul_of_nonneg_left (sparse_projection_energy_ge S hpos hlt) (sq_nonneg (p:ℝ)⁻¹) have he : (p:ℝ)⁻¹^2*((1-gamma S)*p) = (1-gamma S)/p := by field_simp rw [he] at h simpa only [neg_div] using neg_le_neg h
theorem spectralProjection_scalar_norm_le (S : Finset (ZMod p)) (hpos : 0 < density S) (hlt : density S < 1) : ‖inner ℂ (uniformVector S) (spectralProjection (largeSpectrum S) (uniformVector Sᶜ))‖ ≤ 1/(p:ℝ) := by rw [spectralProjection_scalar S hpos hlt, Complex.norm_real, Real.norm_eq_abs, abs_neg,abs_of_nonneg (mul_nonneg (sq_nonneg _) (sq_nonneg _))] have hp : (p:ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p have hnorm := (frequencySpace (largeSpectrum S)).norm_starProjection_apply_le (normalizedVector S) have hsq := (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mpr hnorm rw [normalizedVector_norm_sq S hpos hlt] at hsq calc _ ≤ (p:ℝ)⁻¹^2*p := mul_le_mul_of_nonneg_left hsq (sq_nonneg _) _ = _ := by field_simp
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455import OAI.NumberTheory.Ostmann.Supply.UniformBalanced
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators ComplexConjugatevariable {p : ℕ} [NeZero p]local notation "H" => EuclideanSpace ℂ (ZMod p)
theorem raw_scalar_bound (S T : Finset (ZMod p)) (K : H →L[ℂ] H) : ‖inner ℂ (uniformVector S) (K (uniformVector T))‖ ≤ ‖uniformVector S‖*‖K‖*‖uniformVector T‖ := by calc _ ≤ ‖uniformVector S‖*‖K (uniformVector T)‖ := norm_inner_le_norm _ _ _ ≤ ‖uniformVector S‖*(‖K‖*‖uniformVector T‖) := mul_le_mul_of_nonneg_left (K.le_opNorm _) (norm_nonneg _) _ = _ := by ring
theorem raw_row_bound (S T : Finset (ZMod p)) (K : H →L[ℂ] H) (v : centeredSpace T) : ‖inner ℂ (uniformVector S) (K (v:H))‖ ≤ ‖uniformVector S‖*‖K‖*‖v‖ := by exact (norm_inner_le_norm _ _).trans (by simpa only [mul_assoc,Submodule.norm_coe] using mul_le_mul_of_nonneg_left (K.le_opNorm (v:H)) (norm_nonneg (uniformVector S)))
theorem raw_column_bound (S T : Finset (ZMod p)) (K : H →L[ℂ] H) : ‖centeredProjection S (K (uniformVector T))‖ ≤ ‖K‖*‖uniformVector T‖ := ((centeredSpace S).norm_starProjection_apply_le _).trans (K.le_opNorm _)
theorem raw_lower_bound (S T : Finset (ZMod p)) (K : H →L[ℂ] H) (v : centeredSpace T) : ‖centeredProjection S (K (v:H))‖ ≤ ‖K‖*‖v‖ := ((centeredSpace S).norm_starProjection_apply_le _).trans (K.le_opNorm _)
theorem balanced_scalar_bound (S : Finset (ZMod p)) (K : H →L[ℂ] H) (hlo : (1/3:ℝ) ≤ density S) (hhi : density S ≤ 2/3) : ‖inner ℂ (uniformVector S) (K (uniformVector Sᶜ))‖ ≤ 4*‖K‖/(p:ℝ) := by have hp : (0:ℝ)<p := Nat.cast_pos.mpr (Nat.pos_of_ne_zero (NeZero.ne p)) have hr : Real.sqrt (p:ℝ) ≠ 0 := (Real.sqrt_pos.mpr hp).ne' have hS := balanced_uniform_norm S hlo have hT := balanced_uniform_norm Sᶜ (balanced_compl S hlo hhi).1 calc _ ≤ ‖uniformVector S‖*‖K‖*‖uniformVector Sᶜ‖ := raw_scalar_bound S Sᶜ K _ ≤ (2/Real.sqrt p)*‖K‖*(2/Real.sqrt p) := mul_le_mul (mul_le_mul_of_nonneg_right hS (norm_nonneg _)) hT (norm_nonneg _) (mul_nonneg (by positivity) (norm_nonneg _)) _ = _ := by have hs := Real.sq_sqrt hp.le field_simp rw [hs] ring
end Ostmann.Supply
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172import OAI.NumberTheory.Ostmann.Supply.ResidueRatio
namespace OAI
open Erdos970
noncomputable sectionnamespace Ostmann.Supplyopen Filter Ostmann.Preliminariesopen scoped BigOperators
theorem eventually_le_collisionScale_fourth : ∀ᶠ Q : ℕ in atTop, Q ≤ collisionScale 4 (Q^4) := by have hx : Tendsto (fun Q : ℕ => (Q:ℝ)) atTop atTop := tendsto_natCast_atTop_atTop have hlittle := isLittleO_log_rpow_rpow_atTop (5:ℕ) (show (0:ℝ)<1 by norm_num) have hbound := hlittle.bound (show (0:ℝ)<1/(4:ℝ)^5 by norm_num) filter_upwards [hx.eventually hbound, (Real.tendsto_log_atTop.comp hx).eventually_ge_atTop 1] with Q hsmall hlog change 1 ≤ Real.log (Q:ℝ) at hlog have hl : 0 < Real.log (Q:ℝ) := by linarith have hqn : 0 ≤ (Q:ℝ) := Nat.cast_nonneg _ simp only [Real.rpow_natCast, Real.rpow_one, Real.norm_eq_abs, abs_of_nonneg (pow_nonneg hl.le _), abs_of_nonneg hqn] at hsmall have hsqrt : Real.sqrt ((Q:ℝ)^4) = (Q:ℝ)^2 := by rw [show (Q:ℝ)^4=((Q:ℝ)^2)^2 by ring,Real.sqrt_sq (sq_nonneg _)] have hden : 0 < (4*Real.log (Q:ℝ))^5 := by positivity have hfrac : (Q:ℝ) ≤ (Q:ℝ)^2/(4*Real.log (Q:ℝ))^5 := by apply (le_div_iff₀ hden).mpr have hh := mul_le_mul_of_nonneg_left hsmall ((by positivity) : 0 ≤ (4:ℝ)^5) have hh' : (4*Real.log (Q:ℝ))^5 ≤ (Q:ℝ) := by nlinarith [hh] simpa [pow_two] using mul_le_mul_of_nonneg_left hh' hqn unfold collisionScale simp only [Nat.cast_pow, hsqrt, Real.log_pow, Nat.cast_ofNat, Nat.reduceAdd] exact (Nat.le_floor_iff (div_nonneg (sq_nonneg _) hden.le)).mpr hfrac
theorem eventually_ratioWeightedSum_le (d : Decomposition) : ∃ C : ℝ, 0 < C ∧ ∀ᶠ Q : ℕ in atTop, ratioWeightedSum d Q ≤ C*Real.log (Real.log (Q:ℝ)) := by let C := collisionConstant 4*(Real.log 4+1) have hC : 0<C := mul_pos (collisionConstant_pos 4) (by positivity : 0<Real.log 4+1) refine ⟨C,hC,?_⟩ have hpow : Tendsto (fun Q : ℕ => Q^4) atTop atTop := tendsto_pow_atTop (by decide) have hx : Tendsto (fun Q : ℕ => (Q:ℝ)) atTop atTop := tendsto_natCast_atTop_atTop have hll := (Real.tendsto_log_atTop.comp (Real.tendsto_log_atTop.comp hx)).eventually_ge_atTop 1 filter_upwards [eventually_le_collisionScale_fourth, hpow.eventually (eventually_upperWindow_collision d),hll, (Real.tendsto_log_atTop.comp hx).eventually_ge_atTop 1] with Q hscale hcollision hloglog hlog change 1 ≤ Real.log (Q:ℝ) at hlog change 1 ≤ Real.log (Real.log (Q:ℝ)) at hloglog have hl : 0<Real.log (Q:ℝ) := by linarith have he : Real.log (Real.log ((Q^4:ℕ):ℝ)) = Real.log 4+Real.log (Real.log (Q:ℝ)) := by rw [Nat.cast_pow,Real.log_pow] norm_num only [Nat.cast_ofNat] exact Real.log_mul (by norm_num) hl.ne' calc ratioWeightedSum d Q ≤ ratioWeightedSum d (collisionScale 4 (Q^4)) := ratioWeightedSum_mono d hscale _ ≤ upperWindowCollision d (Q^4) := ratioWeightedSum_le_collision d _ _ ≤ collisionConstant 4*Real.log (Real.log ((Q^4:ℕ):ℝ)) := hcollision.2.2 _ ≤ C*Real.log (Real.log (Q:ℝ)) := by rw [he] have h4 := Real.log_nonneg (by norm_num : (1:ℝ)≤4) have hh := mul_le_mul_of_nonneg_left hloglog h4 dsimp [C] have hhC := mul_le_mul_of_nonneg_left hh (collisionConstant_pos 4).le nlinarith
end Ostmann.Supply
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859import OAI.NumberTheory.Ostmann.Supply.CenteredProjectionimport OAI.NumberTheory.Ostmann.Supply.Fourier
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators ComplexConjugatevariable {p : ℕ} [NeZero p]
def complementRatio (S : Finset (ZMod p)) : ℝ := (p : ℝ) / S.card - 1
theorem complementRatio_eq_density (S : Finset (ZMod p)) (hS : S.Nonempty) : complementRatio S = (1-density S)/density S := by have hsR : (S.card : ℝ) ≠ 0 := by exact_mod_cast Finset.card_ne_zero.mpr hS have hpR : (p : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p simp only [complementRatio, density, ZMod.card] field_simp
theorem complementRatio_nonneg (S : Finset (ZMod p)) (hS : S.Nonempty) : 0 ≤ complementRatio S := by have hs : (0 : ℝ) < S.card := by exact_mod_cast Finset.card_pos.mpr hS have hcard : (S.card : ℝ) ≤ p := by exact_mod_cast (Finset.card_le_univ S).trans_eq (ZMod.card p) exact sub_nonneg.mpr ((le_div_iff₀ hs).mpr (by simpa using hcard))
theorem primeKernel_centered (S : Finset (ZMod p)) (x y : ZMod p) (hx : x ∈ S) (hy : y ∈ S) : (p : ℂ)*(if x=y then 1 else 0)-1 = (p : ℂ)*inner ℂ (centeredProjection S (EuclideanSpace.single x (1 : ℂ))) (centeredProjection S (EuclideanSpace.single y (1 : ℂ))) + complementRatio S := by rw [centeredProjection_gram S x y hx hy] simp only [complementRatio, Complex.ofReal_sub, Complex.ofReal_div, Complex.ofReal_natCast, Complex.ofReal_one] ring
theorem primeKernel_eq_nonzero_sum (x y : ZMod p) : (∑ h ∈ Finset.univ.erase 0, ZMod.stdAddChar (h*(x-y))) = (p : ℂ)*(if x=y then 1 else 0)-1 := by have hsum : ∑ h : ZMod p, ZMod.stdAddChar (h*(x-y)) = if x=y then (p:ℂ) else 0 := by by_cases hxy : x=y · simp [hxy] · have ht : x-y ≠ 0 := sub_ne_zero.mpr hxy have hh := AddChar.sum_eq_zero_of_ne_one (ZMod.isPrimitive_stdAddChar p ht) simpa only [AddChar.mulShift_apply, mul_comm, hxy, ite_false] using hh have hz : ZMod.stdAddChar ((0:ZMod p)*(x-y)) = 1 := by simp have hh := Finset.sum_erase_add (Finset.univ) (fun h:ZMod p => ZMod.stdAddChar (h*(x-y))) (Finset.mem_univ 0) rw [hsum,hz] at hh split_ifs with hxy <;> simp_all linear_combination hh
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273import OAI.NumberTheory.Ostmann.Supply.ResidueProjectionSidesimport OAI.NumberTheory.Ostmann.Supply.ResidueVectorNorm
namespace OAI
/-! # Dimension-free norms of the concrete residue kernel blocks -/
namespace Ostmannopen scoped Classical BigOperators
theorem uniformResidueVector_energy {p : ℕ} [NeZero p] (S : Finset (ZMod p)) (hS : S.Nonempty) : (∑ x, ‖uniformResidueVector S x‖ ^ 2) = (S.card : ℝ)⁻¹ := by have hs : (S.card : ℝ) ≠ 0 := by exact_mod_cast hS.card_pos.ne' have he (x : ZMod p) : ‖uniformResidueVector S x‖ ^ 2 = if x ∈ S then ((S.card : ℝ)⁻¹) ^ 2 else 0 := by by_cases hx : x ∈ S <;> simp [uniformResidueVector, hx] simp_rw [he] simp only [Finset.sum_ite_mem, Finset.univ_inter, Finset.sum_const, nsmul_eq_mul] field_simp
theorem uniformResidueVector_norm_le {p : ℕ} [NeZero p] (S : Finset (ZMod p)) (hS : S.Nonempty) (hcard : (p : ℝ) / 3 ≤ S.card) : residueVectorNorm (uniformResidueVector S) ≤ 2 / Real.sqrt (p : ℝ) := by have hp : (0 : ℝ) < p := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne p) have hs : (0 : ℝ) < S.card := by exact_mod_cast hS.card_pos apply (residueVectorNorm_le_iff _ _ (by positivity)).mpr rw [uniformResidueVector_energy S hS, div_pow, Real.sq_sqrt hp.le] norm_num rw [inv_eq_one_div] apply (div_le_div_iff₀ hs hp).mpr linarith
theorem residueVectorNorm_cross_projection_le {p : ℕ} [NeZero p] (S T E : Finset (ZMod p)) (hST : Disjoint S T) (f : ZMod p → ℂ) : residueVectorNorm (centeredSupportProjection S (finiteSpectralProjection E (centeredSupportProjection T f))) ≤ (1 / 2 : ℝ) * residueVectorNorm f := by apply (residueVectorNorm_le_iff _ _ (by positivity [residueVectorNorm_nonneg f])).mpr rw [mul_pow, residueVectorNorm_sq] convert centeredSupportProjection_spectral_energy S T E hST f using 1 norm_num
theorem residueVectorNorm_cross_kernel_le {p : ℕ} [NeZero p] (S T E : Finset (ZMod p)) (hST : Disjoint S T) (t : ℝ) (ht : 0 ≤ t) (f : ZMod p → ℂ) : residueVectorNorm (centeredSupportProjection S (rawAdditiveKernelAction (sparseAdditiveKernel E t) (centeredSupportProjection T f))) ≤ (t / 2) * residueVectorNorm f := by have he : rawAdditiveKernelAction (sparseAdditiveKernel E t) (centeredSupportProjection T f) = fun x => (t : ℂ) * finiteSpectralProjection E (centeredSupportProjection T f) x := by funext x exact sparseAdditiveKernel_action E t _ x rw [he, centeredSupportProjection_const_mul, residueVectorNorm_smul] simp only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg ht] have hh := mul_le_mul_of_nonneg_left (residueVectorNorm_cross_projection_le S T E hST f) ht convert hh using 1 ring
theorem residueVectorNorm_square_kernel_le {p : ℕ} [NeZero p] (S T E : Finset (ZMod p)) (t ε : ℝ) (hε : 0 ≤ ε) (hE : (E.card : ℝ) ≤ ε * p) (f : ZMod p → ℂ) : residueVectorNorm (centeredSupportProjection S (rawAdditiveKernelAction (fun x => sparseAdditiveKernel E t x * sparseAdditiveKernel E t x) (centeredSupportProjection T f))) ≤ (t ^ 2 * ε) * residueVectorNorm f := by apply (residueVectorNorm_centered_le _ _).trans apply (residueVectorNorm_raw_le _ _ _ (mul_nonneg (sq_nonneg _) hε) (sparseAdditiveKernel_square_multiplier_le E t ε hE)).trans exact mul_le_mul_of_nonneg_left (residueVectorNorm_centered_le T f) (mul_nonneg (sq_nonneg _) hε)
end Ostmann
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105import OAI.NumberTheory.Ostmann.Supply.SpectralProjectionAffine
namespace OAI
/-! # The negative scalar block between complementary residue supports -/
namespace Ostmannopen scoped Classical BigOperators ComplexConjugate
noncomputable def uniformResidueVector {p : ℕ} (S : Finset (ZMod p)) (x : ZMod p) : ℂ := (((if x ∈ S then 1 else 0) / (S.card : ℝ) : ℝ) : ℂ)
theorem uniformResidueVector_affine {p : ℕ} [NeZero p] (S : Finset (ZMod p)) (hS : S.Nonempty) (hSp : S.card < p) (x : ZMod p) : uniformResidueVector S x = ((Real.sqrt (residueVariance S) / S.card : ℝ) : ℂ) * normalizedResidueIndicator S x + ((1 / (p : ℝ) : ℝ) : ℂ) := by have hs : (S.card : ℝ) ≠ 0 := by exact_mod_cast hS.card_pos.ne' have hp : (p : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p have hv : Real.sqrt (residueVariance S) ≠ 0 := (Real.sqrt_pos.mpr (residueVariance_pos S hS hSp)).ne' unfold uniformResidueVector normalizedResidueIndicator centeredDensity rw [← Complex.ofReal_mul, ← Complex.ofReal_add] apply congrArg Complex.ofReal field_simp ring
theorem uniformResidueVector_compl_affine {p : ℕ} [NeZero p] (S : Finset (ZMod p)) (hS : S.Nonempty) (hSp : S.card < p) (x : ZMod p) : uniformResidueVector (Finset.univ \ S) x = ((-Real.sqrt (residueVariance S) / ((p : ℝ) - S.card) : ℝ) : ℂ) * normalizedResidueIndicator S x + ((1 / (p : ℝ) : ℝ) : ℂ) := by have hp : (p : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p have hd : (p : ℝ) - S.card ≠ 0 := sub_ne_zero.mpr (by exact_mod_cast hSp.ne') have hv : Real.sqrt (residueVariance S) ≠ 0 := (Real.sqrt_pos.mpr (residueVariance_pos S hS hSp)).ne' have hc : ((Finset.univ \ S).card : ℝ) = (p : ℝ) - S.card := by rw [Finset.card_sdiff_of_subset (Finset.subset_univ S), Finset.card_univ, ZMod.card, Nat.cast_sub hSp.le] unfold uniformResidueVector normalizedResidueIndicator centeredDensity rw [hc] have he : (if x ∈ Finset.univ \ S then (1 : ℝ) else 0) = 1 - (if x ∈ S then 1 else 0) := by by_cases hx : x ∈ S <;> simp [hx] rw [he] rw [← Complex.ofReal_mul, ← Complex.ofReal_add] apply congrArg Complex.ofReal field_simp ring
theorem finiteSpectralProjection_affine_pairing {p : ℕ} [NeZero p] (E : Finset (ZMod p)) (hE : 0 ∉ E) (f : ZMod p → ℂ) (a b c d : ℂ) : (∑ x, conj (a * f x + c) * finiteSpectralProjection E (fun x => b * f x + d) x) = conj a * b * ((∑ x, ‖finiteSpectralProjection E f x‖ ^ 2 : ℝ) : ℂ) := by have he := finiteSpectralProjection_selfAdjoint E (fun x => a * f x + c) (finiteSpectralProjection E (fun x => b * f x + d)) rw [finiteSpectralProjection_idempotent] at he rw [he, finiteSpectralProjection_affine E hE, finiteSpectralProjection_affine E hE] rw [Complex.ofReal_sum, Finset.mul_sum] apply Finset.sum_congr rfl intro x _ rw [map_mul] have hn : conj (finiteSpectralProjection E f x) * finiteSpectralProjection E f x = ((‖finiteSpectralProjection E f x‖ ^ 2 : ℝ) : ℂ) := by rw [mul_comm, Complex.mul_conj', Complex.ofReal_pow] calc _ = conj a * b * (conj (finiteSpectralProjection E f x) * finiteSpectralProjection E f x) := by ring _ = _ := by rw [hn]
/-- The raw projection's scalar block is negative with the exact coefficient`-1/p^2` appearing in the proof of Lemma 5.2. -/theorem residueProjection_scalar {p : ℕ} [NeZero p] (S E : Finset (ZMod p)) (hS : S.Nonempty) (hSp : S.card < p) (hE : 0 ∉ E) : (∑ x, conj (uniformResidueVector S x) * finiteSpectralProjection E (uniformResidueVector (Finset.univ \ S)) x) = -((p : ℂ) ^ 2)⁻¹ * ((∑ x, ‖finiteSpectralProjection E (normalizedResidueIndicator S) x‖ ^ 2 : ℝ) : ℂ) := by have hleft : uniformResidueVector S = fun x => ((Real.sqrt (residueVariance S) / S.card : ℝ) : ℂ) * normalizedResidueIndicator S x + ((1 / (p : ℝ) : ℝ) : ℂ) := funext (uniformResidueVector_affine S hS hSp) have hright : uniformResidueVector (Finset.univ \ S) = fun x => ((-Real.sqrt (residueVariance S) / ((p : ℝ) - S.card) : ℝ) : ℂ) * normalizedResidueIndicator S x + ((1 / (p : ℝ) : ℝ) : ℂ) := funext (uniformResidueVector_compl_affine S hS hSp) rw [hleft, hright] rw [finiteSpectralProjection_affine_pairing E hE] congr 1 rw [Complex.conj_ofReal, ← Complex.ofReal_mul] have hp : (p : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p have hs : (S.card : ℝ) ≠ 0 := by exact_mod_cast hS.card_pos.ne' have hd : (p : ℝ) - S.card ≠ 0 := sub_ne_zero.mpr (by exact_mod_cast hSp.ne') have hv := Real.sq_sqrt (residueVariance_pos S hS hSp).le have he : (Real.sqrt (residueVariance S) / S.card) * (-Real.sqrt (residueVariance S) / ((p : ℝ) - S.card)) = -((p : ℝ) ^ 2)⁻¹ := by rw [div_mul_div_comm, mul_neg, ← pow_two, hv] unfold residueVariance residueDensity field_simp rw [he] push_cast rfl
end Ostmann
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394import OAI.NumberTheory.Ostmann.Supply.ResidueProjectionScalarimport OAI.NumberTheory.Ostmann.Supply.CenteredResidueProjection
namespace OAI
/-! # Quantitative side blocks of the sparse residue projection -/
namespace Ostmannopen scoped Classical BigOperators
theorem centered_spectral_affine_energy {p : ℕ} [NeZero p] (E T : Finset (ZMod p)) (hE : 0 ∉ E) (f : ZMod p → ℂ) (a c : ℂ) : (∑ x, ‖centeredSupportProjection T (finiteSpectralProjection E (fun x => a * f x + c)) x‖ ^ 2) = ‖a‖ ^ 2 * ∑ x, ‖centeredSupportProjection T (finiteSpectralProjection E f) x‖ ^ 2 := by rw [finiteSpectralProjection_affine E hE, centeredSupportProjection_const_mul] simp only [norm_mul, mul_pow, Finset.mul_sum]
theorem residue_uniform_coefficient_sq {p : ℕ} [NeZero p] (S : Finset (ZMod p)) (hS : S.Nonempty) (hSp : S.card < p) (hlo : (1 / 3 : ℝ) ≤ residueDensity S) : (Real.sqrt (residueVariance S) / S.card) ^ 2 ≤ 2 / (p : ℝ) ^ 2 := by have hp : (0 : ℝ) < p := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne p) have hs : (0 : ℝ) < S.card := by exact_mod_cast hS.card_pos have hps : (p : ℝ) ≤ 3 * S.card := by rw [residueDensity, le_div_iff₀ hp] at hlo linarith have hv : residueVariance S = (S.card : ℝ) * (p - S.card) / (p : ℝ) ^ 2 := by unfold residueVariance residueDensity field_simp rw [div_pow, Real.sq_sqrt (residueVariance_pos S hS hSp).le, hv] apply (div_le_iff₀ (sq_pos_of_pos hs)).mpr rw [div_mul_eq_mul_div] apply (div_le_div_iff_of_pos_right (sq_pos_of_pos hp)).mpr nlinarith [mul_nonneg hs.le (sub_nonneg.mpr hps)]
theorem residue_compl_coefficient_sq {p : ℕ} [NeZero p] (S : Finset (ZMod p)) (hS : S.Nonempty) (hSp : S.card < p) (hhi : residueDensity S ≤ 2 / 3) : (-Real.sqrt (residueVariance S) / ((p : ℝ) - S.card)) ^ 2 ≤ 2 / (p : ℝ) ^ 2 := by have hp : (0 : ℝ) < p := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne p) have hs : (0 : ℝ) < (p : ℝ) - S.card := sub_pos.mpr (by exact_mod_cast hSp) have hps : 3 * (S.card : ℝ) ≤ 2 * p := by rw [residueDensity, div_le_iff₀ hp] at hhi linarith have hv : residueVariance S = (S.card : ℝ) * (p - S.card) / (p : ℝ) ^ 2 := by unfold residueVariance residueDensity field_simp rw [div_pow, neg_sq, Real.sq_sqrt (residueVariance_pos S hS hSp).le, hv] apply (div_le_iff₀ (sq_pos_of_pos hs)).mpr rw [div_mul_eq_mul_div] apply (div_le_div_iff_of_pos_right (sq_pos_of_pos hp)).mpr nlinarith [mul_nonneg hs.le (sub_nonneg.mpr hps)]
/-- Either uniform-support side of the projection is O(epsilon/sqrt(p)),in the squared-energy form used to bound the local block matrix. -/theorem residueProjection_side_energy {p : ℕ} [NeZero p] (S E : Finset (ZMod p)) (hS : S.Nonempty) (hSp : S.card < p) (hE : 0 ∉ E) (hlo : (1 / 3 : ℝ) ≤ residueDensity S) (hhi : residueDensity S ≤ 2 / 3) (ε : ℝ) (herr : (∑ x, ‖normalizedResidueIndicator S x - finiteSpectralProjection E (normalizedResidueIndicator S) x‖ ^ 2) ≤ ε ^ 2 * p) : (∑ x, ‖centeredSupportProjection (Finset.univ \ S) (finiteSpectralProjection E (uniformResidueVector S)) x‖ ^ 2) ≤ 2 * ε ^ 2 / p ∧ (∑ x, ‖centeredSupportProjection S (finiteSpectralProjection E (uniformResidueVector (Finset.univ \ S))) x‖ ^ 2) ≤ 2 * ε ^ 2 / p := by have hp : (0 : ℝ) < p := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne p) have hbound (T : Finset (ZMod p)) (a c : ℝ) (hT : centeredSupportProjection T (normalizedResidueIndicator S) = fun _ => 0) (ha : a ^ 2 ≤ 2 / (p : ℝ) ^ 2) : (∑ x, ‖centeredSupportProjection T (finiteSpectralProjection E (fun x => (a : ℂ) * normalizedResidueIndicator S x + (c : ℂ))) x‖ ^ 2) ≤ 2 * ε ^ 2 / p := by rw [centered_spectral_affine_energy E T hE] simp only [Complex.norm_real, Real.norm_eq_abs, sq_abs] calc _ ≤ a ^ 2 * (ε ^ 2 * p) := mul_le_mul_of_nonneg_left (centered_residue_projection_energy_le S E T ε hT herr) (sq_nonneg _) _ ≤ (2 / (p : ℝ) ^ 2) * (ε ^ 2 * p) := mul_le_mul_of_nonneg_right ha (mul_nonneg (sq_nonneg _) hp.le) _ = _ := by field_simp constructor · have he := funext (uniformResidueVector_affine S hS hSp) rw [he] exact hbound _ _ _ (centeredSupportProjection_compl_residue_zero S) (residue_uniform_coefficient_sq S hS hSp hlo) · have he := funext (uniformResidueVector_compl_affine S hS hSp) rw [he] exact hbound _ _ _ (centeredSupportProjection_residue_zero S) (residue_compl_coefficient_sq S hS hSp hhi)
end Ostmann
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384import OAI.NumberTheory.Ostmann.Preliminaries.LocalUniformityimport OAI.NumberTheory.Ostmann.Preliminaries.Sizesimport OAI.NumberTheory.Ostmann.Supply.LogRatioCauchy
namespace OAI
open Erdos970
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperatorsopen Ostmann.Preliminaries
def actualSupport (d : Decomposition) (p : ℕ) : Finset (ZMod p) := if hp : p=0 then ∅ else letI : NeZero p := ⟨hp⟩; d.residueSupport p
theorem actualSupport_eq (d : Decomposition) (p : ℕ) [NeZero p] : actualSupport d p = d.residueSupport p := by simp [actualSupport,NeZero.ne p]
def actualRatio (d : Decomposition) (p : ℕ) : ℝ := (p:ℝ)/((actualSupport d p).card:ℝ)-1
theorem actualRatio_eq_density (d : Decomposition) (p : ℕ) [NeZero p] : actualRatio d p = (1-d.residueDensity p)/d.residueDensity p := by have hp : (p:ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p have hs : ((d.residueSupport p).card:ℝ) ≠ 0 := by exact_mod_cast Finset.card_ne_zero.mpr (d.residueSupport_nonempty p) simp only [actualRatio,actualSupport_eq,Decomposition.residueDensity] field_simp
theorem actualRatio_pos (d : Decomposition) {p : ℕ} (hp : p.Prime) : 0<actualRatio d p := by let : NeZero p := ⟨hp.ne_zero⟩ rw [actualRatio_eq_density] exact div_pos (sub_pos.mpr (d.residueDensity_lt_one p hp)) (d.residueDensity_pos p hp)
theorem actualRatio_penalty (d : Decomposition) (p : ℕ) [NeZero p] (hp : p.Prime) : actualRatio d p+(actualRatio d p)⁻¹-2 = (d.residueDensity p)⁻¹+(1-d.residueDensity p)⁻¹-4 := by have h0 := (d.residueDensity_pos p hp).ne' have h1 := (sub_pos.mpr (d.residueDensity_lt_one p hp)).ne' rw [actualRatio_eq_density] field_simp ring
def ratioWeightedSum (d : Decomposition) (Q : ℕ) : ℝ := ∑ p∈Q.primesLE,(actualRatio d p+(actualRatio d p)⁻¹-2)*Real.log p/(p:ℝ)
theorem ratioWeightedSum_nonneg (d : Decomposition) (Q : ℕ) : 0 ≤ ratioWeightedSum d Q := by apply Finset.sum_nonneg intro p hp have hprime := (Nat.mem_primesLE.mp hp).2 exact div_nonneg (mul_nonneg (ratio_penalty_nonneg (actualRatio_pos d hprime)) (Real.log_nonneg (by exact_mod_cast hprime.one_le))) (Nat.cast_nonneg _)
theorem ratioWeightedSum_mono (d : Decomposition) {Q R : ℕ} (hQR : Q≤R) : ratioWeightedSum d Q ≤ ratioWeightedSum d R := by apply Finset.sum_le_sum_of_subset_of_nonneg · intro p hp obtain ⟨hQ,hp'⟩ := Nat.mem_primesLE.mp hp exact Nat.mem_primesLE.mpr ⟨hQ.trans hQR,hp'⟩ · intro p hp _ have hprime := (Nat.mem_primesLE.mp hp).2 exact div_nonneg (mul_nonneg (ratio_penalty_nonneg (actualRatio_pos d hprime)) (Real.log_nonneg (by exact_mod_cast hprime.one_le))) (Nat.cast_nonneg _)
theorem ratioWeightedSum_le_collision (d : Decomposition) (X : ℕ) : ratioWeightedSum d (collisionScale 4 X) ≤ upperWindowCollision d X := by have h := weighted_density_penalty_le d (collisionScale 4 X) (fun i : upperWindow d.A X => i.val) (uniformWindowMass d.A X) (fun i : upperWindow d.B X => i.val) (uniformWindowMass d.B X) apply le_trans (le_of_eq _) h unfold ratioWeightedSum rw [← sum_primeUpTo] apply Finset.sum_congr rfl intro p hp rw [actualRatio_penalty d p.val (primeUpTo_prime p)] ring
end Ostmann.Supply
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162import OAI.NumberTheory.Ostmann.Supply.ResidueKernelimport OAI.NumberTheory.Ostmann.Supply.TensorKernel
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen scoped BigOperators ComplexConjugatevariable {ι : Type*} [Fintype ι] [DecidableEq ι]variable (p : ι → ℕ) [∀ i, NeZero (p i)]
def residueVectors (S : ∀ i, Finset (ZMod (p i))) (a : ℕ) : ∀ i, EuclideanSpace ℂ (ZMod (p i)) := fun i => centeredProjection (S i) (EuclideanSpace.single (a : ZMod (p i)) 1)
theorem residueTensorKernel_eq (A : Finset ℕ) (S : ∀ i, Finset (ZMod (p i))) (hS : ∀ a ∈ A, ∀ i, (a : ZMod (p i)) ∈ S i) : (∑ a ∈ A, ∑ b ∈ A, ∏ i, ((p i : ℂ)*(if (a : ZMod (p i)) = (b : ZMod (p i)) then 1 else 0)-1)) = ∑ t : Finset ι, ((∏ i ∈ t, (p i : ℝ)) * ∏ i ∈ tᶜ, complementRatio (S i) : ℝ) * subsetRawEnergy A (residueVectors p S) t := by rw [← tensorKernel_expansion] apply Finset.sum_congr rfl intro a ha apply Finset.sum_congr rfl intro b hb apply Finset.prod_congr rfl intro i hi exact primeKernel_centered (S i) _ _ (hS a ha i) (hS b hb i)
theorem residueTensorKernel_lower (A : Finset ℕ) (S : ∀ i, Finset (ZMod (p i))) (hSn : ∀ i, (S i).Nonempty) (hS : ∀ a ∈ A, ∀ i, (a : ZMod (p i)) ∈ S i) : (A.card : ℝ)^2 * (∏ i, complementRatio (S i)) ≤ (∑ a ∈ A, ∑ b ∈ A, ∏ i, ((p i : ℂ)*(if (a : ZMod (p i)) = (b : ZMod (p i)) then 1 else 0)-1)).re := by have h := tensorKernel_lower A (residueVectors p S) (fun i => complementRatio (S i)) (fun i => (p i : ℝ)) (fun i => complementRatio_nonneg (S i) (hSn i)) (fun i => Nat.cast_nonneg _) have he : (∑ a ∈ A, ∑ b ∈ A, ∏ i, ((p i : ℂ)*(if (a : ZMod (p i)) = (b : ZMod (p i)) then 1 else 0)-1)) = ∑ a ∈ A, ∑ b ∈ A, ∏ i, ((p i : ℂ)*inner ℂ (residueVectors p S a i) (residueVectors p S b i) + complementRatio (S i)) := by apply Finset.sum_congr rfl intro a ha apply Finset.sum_congr rfl intro b hb apply Finset.prod_congr rfl intro i hi exact primeKernel_centered (S i) _ _ (hS a ha i) (hS b hb i) rw [he] exact h
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364import Mathlib.Analysis.InnerProductSpace.PiL2import OAI.NumberTheory.Ostmann.Characters.SparseKernelEnergyimport OAI.NumberTheory.Ostmann.Supply.CenteredSupportProjection
namespace OAI
/-! # Counting L2 norms for the finite local kernel blocks -/
namespace Ostmannopen WithLpopen scoped Classical BigOperators ComplexConjugate
noncomputable def residueVectorNorm {p : ℕ} [NeZero p] (f : ZMod p → ℂ) : ℝ := ‖(toLp 2 f : EuclideanSpace ℂ (ZMod p))‖
theorem residueVectorNorm_nonneg {p : ℕ} [NeZero p] (f : ZMod p → ℂ) : 0 ≤ residueVectorNorm f := norm_nonneg _
theorem residueVectorNorm_sq {p : ℕ} [NeZero p] (f : ZMod p → ℂ) : residueVectorNorm f ^ 2 = ∑ x, ‖f x‖ ^ 2 := EuclideanSpace.norm_sq_eq _
theorem residueVectorNorm_add_le {p : ℕ} [NeZero p] (f g : ZMod p → ℂ) : residueVectorNorm (fun x => f x + g x) ≤ residueVectorNorm f + residueVectorNorm g := by change ‖(toLp 2 f : EuclideanSpace ℂ (ZMod p)) + toLp 2 g‖ ≤ _ exact norm_add_le _ _
theorem residueVectorNorm_smul {p : ℕ} [NeZero p] (a : ℂ) (f : ZMod p → ℂ) : residueVectorNorm (fun x => a * f x) = ‖a‖ * residueVectorNorm f := by change ‖a • (toLp 2 f : EuclideanSpace ℂ (ZMod p))‖ = _ exact norm_smul _ _
theorem residueVectorNorm_le_iff {p : ℕ} [NeZero p] (f : ZMod p → ℂ) (B : ℝ) (hB : 0 ≤ B) : residueVectorNorm f ≤ B ↔ (∑ x, ‖f x‖ ^ 2) ≤ B ^ 2 := by rw [← residueVectorNorm_sq] exact (sq_le_sq₀ (residueVectorNorm_nonneg f) hB).symm
theorem residueVectorNorm_inner_le {p : ℕ} [NeZero p] (f g : ZMod p → ℂ) : ‖∑ x, conj (f x) * g x‖ ≤ residueVectorNorm f * residueVectorNorm g := by calc _ ≤ ∑ x, ‖conj (f x) * g x‖ := norm_sum_le _ _ _ = ∑ x, ‖f x‖ * ‖g x‖ := by simp only [norm_mul, Complex.norm_conj] _ ≤ _ := by simpa only [residueVectorNorm, EuclideanSpace.norm_eq] using Real.sum_mul_le_sqrt_mul_sqrt Finset.univ (fun x => ‖f x‖) (fun x => ‖g x‖)
theorem residueVectorNorm_raw_le {p : ℕ} [NeZero p] (k f : ZMod p → ℂ) (B : ℝ) (hB : 0 ≤ B) (hk : ∀ a, ‖(p : ℂ) * additiveFourier k a‖ ≤ B) : residueVectorNorm (rawAdditiveKernelAction k f) ≤ B * residueVectorNorm f := by apply (residueVectorNorm_le_iff _ _ (mul_nonneg hB (residueVectorNorm_nonneg _))).mpr rw [mul_pow, residueVectorNorm_sq] exact rawAdditiveKernelAction_energy_le k f B hk
theorem residueVectorNorm_centered_le {p : ℕ} [NeZero p] (S : Finset (ZMod p)) (f : ZMod p → ℂ) : residueVectorNorm (centeredSupportProjection S f) ≤ residueVectorNorm f := by apply (residueVectorNorm_le_iff _ _ (residueVectorNorm_nonneg _)).mpr rw [residueVectorNorm_sq] exact centeredSupportProjection_energy_le S f
end Ostmann
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485import OAI.NumberTheory.Ostmann.Supply.ConcreteSubsetEnergyBudgetimport OAI.NumberTheory.Ostmann.Supply.CenteredCoordinateSupport
namespace OAI
/-! # Restricting the centered-energy budget to the selected sparse primes -/
namespace Ostmannopen scoped Classical BigOperators
theorem centeredSubsetEnergy_embedding {n m : ℕ} (p : Fin n → ℕ) [∀ i, NeZero (p i)] (S : ∀ i, Finset (ZMod (p i))) (e : Fin m ↪ Fin n) (T : Finset (Fin m)) {ι : Type*} (A : Finset ι) (a : ι → ∀ i, ZMod (p i)) : centeredSubsetEnergy (fun i => p (e i)) (fun i => S (e i)) T A (fun x i => a x (e i)) = centeredSubsetEnergy p S (T.image e) A a := by apply Complex.ofReal_injective rw [centeredSubsetEnergy_formula, centeredSubsetEnergy_formula] congr 1 apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ symm exact Finset.prod_image (fun i _ j _ hij => e.injective hij)
theorem lowMode_energy_embedding {n m : ℕ} (p : Fin n → ℕ) [∀ i, NeZero (p i)] (S : ∀ i, Finset (ZMod (p i))) (e : Fin m ↪ Fin n) {ι : Type*} (A : Finset ι) (a : ι → ∀ i, ZMod (p i)) (K : ℕ) : countingVectorNorm (lowModeVector K (averagedCoordinates A (fun x => tensorPointCoordinates (fun i => p (e i)) (fun i => S (e i)) (fun i => a x (e i))))) ^ 2 = ∑ T ∈ (Finset.univ.filter (fun T : Finset (Fin m) => T.card ≤ K)).image (fun T => T.image e), centeredSubsetEnergy p S T A a := by rw [lowMode_tensor_energy, Finset.sum_image] · rw [Finset.sum_filter] apply Finset.sum_congr rfl intro T _ split_ifs · exact centeredSubsetEnergy_embedding p S e T A a · rfl · intro T _ U _ h exact Finset.image_injective e.injective h
/-- The sparse tensor uses only its selected prime coordinates. Its low-modeenergy is bounded by the sieve on the full prime family, with no factor forthe number of unused coordinates. -/theorem restricted_lowMode_energy_budget (ls : PublishedAdditiveLargeSieve) {n m M Q : ℕ} (p : Fin n → ℕ) [∀ i, Fact (p i).Prime] (hc : Pairwise (fun i j => (p i).Coprime (p j))) (S : ∀ i, Finset (ZMod (p i))) (hS : ∀ i, (S i).Nonempty) (κ : ℕ → ℝ) (hκ : ∀ q ∈ Finset.univ.image p, 0 < κ q) (hκS : ∀ i, κ (p i) = (p i : ℝ) / (S i).card - 1) (hQ : 1 ≤ Q) (hM : 1 ≤ M) (hcover : ∀ q, Nat.Prime q → q ≤ Q → ∃ i, p i = q) (A : Finset (Fin M)) (hA : A.Nonempty) (J : ℤ) (ha : ∀ x ∈ A, ∀ i, ((J + (x.val : ℤ) : ℤ) : ZMod (p i)) ∈ S i) (e : Fin m ↪ Fin n) (K : ℕ) (hprod : ∀ T : Finset (Fin m), T.card ≤ K → (∏ i ∈ T, p (e i)) ≤ Q) (hsmall : ∀ T : Finset (Fin m), T.card ≤ K → (∑ q ∈ T.image (fun i => p (e i)), (q : ℝ)⁻¹) ≤ 1 / 16) (B : ℝ) (hB : 0 < B) (hP : (∑ q ∈ Finset.univ.image p, |Real.log (κ q)| / q) ≤ B / 16) : ((Q : ℝ) / 16 * Real.exp (-B)) * countingVectorNorm (lowModeVector K (averagedCoordinates A (fun x => tensorPointCoordinates (fun i => p (e i)) (fun i => S (e i)) (fun i => ((J + (x.val : ℤ) : ℤ) : ZMod (p (e i))))))) ^ 2 ≤ ((M : ℝ) + (Q : ℝ) ^ 2) / A.card := by rw [lowMode_energy_embedding p S e A (fun x i => ((J + (x.val : ℤ) : ℤ) : ZMod (p i))) K] apply concrete_subset_energy_budget ls p hc S hS κ hκ hκS hQ hM hcover A hA J ha · intro U hU obtain ⟨T, hT, rfl⟩ := Finset.mem_image.mp hU rw [Finset.prod_image (fun i _ j _ hij => e.injective hij)] exact hprod T (Finset.mem_filter.mp hT).2 · intro U hU obtain ⟨T, hT, rfl⟩ := Finset.mem_image.mp hU rw [Finset.image_image] exact hsmall T (Finset.mem_filter.mp hT).2 · exact hB · exact hP
end Ostmann
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586import OAI.NumberTheory.Ostmann.Supply.RetainedBandScales
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen Filter TensorModesopen scoped BigOperators
theorem retainedBandProducts_conditions {L : ℝ} (_hL : 0≤L) (hupper : (2*supplyTruncation L:ℕ)*Real.exp ((9/10:ℝ)*L)≤Real.exp L/2) (hlower : (2*supplyTruncation L:ℕ)/Real.exp ((1/20:ℝ)*L)≤1/16) (p : ℕ→ℕ) (n : ℕ) (hp : ∀i<n,(p i).Prime) (hinj : Set.InjOn p (Finset.range n:Set ℕ)) (hband : ∀i<n,(1/20:ℝ)*L<Real.log (Real.log (p i:ℝ)) ∧ Real.log (Real.log (p i:ℝ))≤(9/10:ℝ)*L) : ∀t∈retainedProducts p n (2*supplyTruncation L), Squarefree t ∧ t≤ supplyRadius L ∧ ∑q∈t.primeFactors,(1:ℝ)/q≤1/16 := by classical intro t ht obtain ⟨s,hs,rfl⟩ := Finset.mem_image.mp ht have hsub : s⊆Finset.range n := Finset.mem_powerset.mp (Finset.mem_filter.mp hs).1 have hcard : s.card≤2*supplyTruncation L := (Finset.mem_filter.mp hs).2 have hprime : ∀i∈s,(p i).Prime := fun i hi => hp i (Finset.mem_range.mp (hsub hi)) have hinjs : Set.InjOn p (s:Set ℕ) := hinj.mono hsub have himage : (∏q∈s.image p,q)=∏i∈s,p i := Finset.prod_image (fun i hi j hj hij => hinjs hi hj hij) have hprimes : ∀q∈s.image p,q.Prime := by intro q hq obtain ⟨i,hi,rfl⟩ := Finset.mem_image.mp hq exact hprime i hi have hpf : (∏i∈s,p i).primeFactors=s.image p := by rw [←himage] exact Nat.primeFactors_prod hprimes have hsq : Squarefree (∏i∈s,p i) := by rw [←himage] refine Finset.squarefree_prod_of_pairwise_isCoprime (fun q hq r hr hqr => ?_) (fun q hq => (hprimes q hq).squarefree) change IsRelPrime q r rw [←Nat.coprime_iff_isRelPrime] exact (Nat.coprime_primes (hprimes q hq) (hprimes r hr)).mpr hqr have hmin (i : ℕ) (hi : i∈s) : Real.exp ((1/20:ℝ)*L)≤(p i:ℝ) := by have hp0 : (0:ℝ)<p i := by exact_mod_cast (hprime i hi).pos have hlog : 0<Real.log (p i:ℝ) := Real.log_pos (by exact_mod_cast (hprime i hi).one_lt) have h := Real.exp_lt_exp.mpr (hband i (Finset.mem_range.mp (hsub hi))).1 rw [Real.exp_log hlog] at h exact h.le.trans (Real.log_le_self hp0.le) have hmax (i : ℕ) (hi : i∈s) : (p i:ℝ)≤Real.exp (Real.exp ((9/10:ℝ)*L)) := by have hp0 : (0:ℝ)<p i := by exact_mod_cast (hprime i hi).pos have hlog : 0<Real.log (p i:ℝ) := Real.log_pos (by exact_mod_cast (hprime i hi).one_lt) exact (Real.log_le_iff_le_exp hp0).mp ((Real.log_le_iff_le_exp hlog).mp (hband i (Finset.mem_range.mp (hsub hi))).2) have hprod : ((∏i∈s,p i:ℕ):ℝ)≤Real.exp ((s.card:ℝ)*Real.exp ((9/10:ℝ)*L)) := by rw [Nat.cast_prod,Real.exp_nat_mul,←Finset.prod_const] exact Finset.prod_le_prod₀ (fun i hi => Nat.cast_nonneg _) hmax have hcut : (s.card:ℝ)*Real.exp ((9/10:ℝ)*L)≤Real.exp L/2 := by apply le_trans _ hupper exact mul_le_mul_of_nonneg_right (by exact_mod_cast hcard) (Real.exp_pos _).le have htR : (∏i∈s,p i)≤ supplyRadius L := by exact_mod_cast (hprod.trans (Real.exp_le_exp.mpr hcut)).trans (Nat.le_ceil (Real.exp (Real.exp L/2))) refine ⟨hsq,htR,?_⟩ rw [hpf,Finset.sum_image (fun i hi j hj hij => hinjs hi hj hij)] calc (∑i∈s,(1:ℝ)/(p i:ℝ))≤∑i∈s,(1:ℝ)/Real.exp ((1/20:ℝ)*L) := Finset.sum_le_sum (fun i hi => one_div_le_one_div_of_le (Real.exp_pos _) (hmin i hi)) _ = (s.card:ℝ)/Real.exp ((1/20:ℝ)*L) := by simp [div_eq_mul_inv] _ ≤ (2*supplyTruncation L:ℕ)/Real.exp ((1/20:ℝ)*L) := div_le_div_of_nonneg_right (by exact_mod_cast hcard) (Real.exp_pos _).le _ ≤ 1/16 := hlower
theorem eventually_retainedBandProducts : ∀ᶠL:ℝ in atTop, ∀p:ℕ→ℕ,∀n:ℕ, (∀i<n,(p i).Prime) → Set.InjOn p (Finset.range n:Set ℕ) → (∀i<n,(1/20:ℝ)*L<Real.log (Real.log (p i:ℝ)) ∧ Real.log (Real.log (p i:ℝ))≤(9/10:ℝ)*L) → ∀t∈retainedProducts p n (2*supplyTruncation L), Squarefree t ∧ t≤ supplyRadius L ∧ ∑q∈t.primeFactors,(1:ℝ)/q≤1/16 := by filter_upwards [eventually_retainedBand_numeric] with L hL exact retainedBandProducts_conditions hL.1 hL.2.1 hL.2.2
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758import OAI.NumberTheory.Ostmann.Supply.TensorModeBudget
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen Filteropen scoped BigOperators
def supplyRadius (L : ℝ) : ℕ := ⌈Real.exp (Real.exp L/2)⌉₊def supplyTruncation (L : ℝ) : ℕ := ⌈10000*L⌉₊
theorem supplyRadius_tendsto : Tendsto supplyRadius atTop atTop := by exact tendsto_nat_ceil_atTop.comp (Real.tendsto_exp_atTop.comp (Real.tendsto_exp_atTop.atTop_div_const (by norm_num)))
theorem supplyRadius_pos (L : ℝ) : 0<supplyRadius L := Nat.ceil_pos.mpr (Real.exp_pos _)
theorem eventually_supplyTruncation_le_exp {r c : ℝ} (hr : 0<r) (hc : 0<c) : ∀ᶠL:ℝ in atTop, (2*supplyTruncation L:ℕ)≤c*Real.exp (r*L) := by have hb := (isLittleO_pow_exp_pos_mul_atTop 1 hr).bound (div_pos hc (by norm_num : (0:ℝ)<20002)) filter_upwards [hb,eventually_ge_atTop (1:ℝ)] with L hb hL have hceil := Nat.ceil_lt_add_one (show 0≤10000*L by positivity) have hk : (supplyTruncation L:ℝ)≤10001*L := by unfold supplyTruncation linarith simp only [pow_one,Real.norm_eq_abs,abs_of_nonneg (by linarith : 0≤L), abs_of_pos (Real.exp_pos _)] at hb have hh := mul_le_mul_of_nonneg_left hb (by norm_num : (0:ℝ)≤20002) push_cast nlinarith
theorem eventually_retainedBand_numeric : ∀ᶠL:ℝ in atTop, 0≤L ∧ (2*supplyTruncation L:ℕ)*Real.exp ((9/10:ℝ)*L)≤Real.exp L/2 ∧ (2*supplyTruncation L:ℕ)/Real.exp ((1/20:ℝ)*L)≤1/16 := by filter_upwards [eventually_supplyTruncation_le_exp (by norm_num : (0:ℝ)<1/10) (by norm_num : (0:ℝ)<1/2), eventually_supplyTruncation_le_exp (by norm_num : (0:ℝ)<1/20) (by norm_num : (0:ℝ)<1/16),eventually_ge_atTop (0:ℝ)] with L h1 h2 hL refine ⟨hL,?_,?_⟩ · have h := mul_le_mul_of_nonneg_right h1 (Real.exp_pos ((9/10:ℝ)*L)).le have he : Real.exp ((1/10:ℝ)*L)*Real.exp ((9/10:ℝ)*L)=Real.exp L := by rw [←Real.exp_add] congr 1 ring calc _ ≤ ((1/2:ℝ)*Real.exp ((1/10:ℝ)*L))*Real.exp ((9/10:ℝ)*L) := h _ = Real.exp L/2 := by rw [mul_assoc,he]; ring · exact (div_le_iff₀ (Real.exp_pos _)).mpr h2
end Ostmann.Supply
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273import OAI.NumberTheory.Ostmann.Supply.CollisionLogImbalanceimport OAI.NumberTheory.Ostmann.Construction.TailBudgetNegligible
namespace OAI
/-! # Numerical specialization of the subset-sieve budgets -/
namespace Ostmannopen Filteropen scoped Classical BigOperators
theorem rpow_three_quarters_sq {L : ℝ} (hL : 0 < L) : (L ^ (3 / 4 : ℝ)) ^ 2 = L * Real.sqrt L := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL.le] norm_num only [Nat.cast_ofNat, mul_div_cancel_right₀] rw [show (3 / 2 : ℝ) = 1 + 1 / 2 by norm_num, Real.rpow_add hL, Real.rpow_one, ← Real.sqrt_eq_rpow]
theorem eventual_square_budget_le_three_quarters (K : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ W : ℝ, W ^ 2 ≤ K * L → W ≤ L ^ (3 / 4 : ℝ) / 16 := by have hlarge := (tendsto_rpow_atTop (show (0 : ℝ) < 1 / 2 by norm_num)).eventually_ge_atTop (256 * max K 0) filter_upwards [hlarge, eventually_ge_atTop (1 : ℝ)] with L hlarge hL W hW have hLp : 0 < L := by linarith rw [← Real.sqrt_eq_rpow] at hlarge have hs : K * L ≤ (L ^ (3 / 4 : ℝ) / 16) ^ 2 := by rw [div_pow, rpow_three_quarters_sq hLp] norm_num only [show (16 : ℝ) ^ 2 = 256 by norm_num] apply (le_div_iff₀ (by norm_num : (0 : ℝ) < 256)).mpr nlinarith [mul_le_mul_of_nonneg_right hlarge hLp.le, le_max_left K 0] exact le_of_sq_le_sq (hW.trans hs) (by positivity)
theorem finite_prime_reciprocal_mass_le (P : Finset ℕ) (L a : ℝ) (hP : ∀ p ∈ P, 0 < p ∧ a * L ≤ Real.log (p : ℝ)) : (∑ p ∈ P, (p : ℝ)⁻¹) ≤ (P.card : ℝ) * Real.exp (-a * L) := by calc _ ≤ ∑ _p ∈ P, Real.exp (-a * L) := by apply Finset.sum_le_sum intro p hp have hp0 : (0 : ℝ) < p := by exact_mod_cast (hP p hp).1 have he : (p : ℝ)⁻¹ = Real.exp (-Real.log (p : ℝ)) := by rw [Real.exp_neg, Real.exp_log hp0] rw [he] apply Real.exp_le_exp.mpr linarith [(hP p hp).2] _ = _ := by simp
theorem eventual_small_subset_reciprocal (a c : ℝ) (ha : 0 < a) (hc : 0 ≤ c) : ∀ᶠ L : ℝ in atTop, ∀ P : Finset ℕ, (P.card : ℝ) ≤ c * L → (∀ p ∈ P, 0 < p ∧ a * L ≤ Real.log (p : ℝ)) → (∑ p ∈ P, (p : ℝ)⁻¹) ≤ 1 / 16 := by have hsmall := ((isLittleO_pow_exp_pos_mul_atTop 1 ha).const_mul_left c).bound (show (0 : ℝ) < 1 / 16 by norm_num) filter_upwards [hsmall, eventually_ge_atTop (1 : ℝ)] with L hsmall hL P hcard hP have hLp : 0 < L := by linarith have hbound : c * L ≤ (1 / 16 : ℝ) * Real.exp (a * L) := by simpa only [pow_one, Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hc hLp.le), abs_of_pos (Real.exp_pos _)] using hsmall calc _ ≤ (P.card : ℝ) * Real.exp (-a * L) := finite_prime_reciprocal_mass_le P L a hP _ ≤ (c * L) * Real.exp (-a * L) := mul_le_mul_of_nonneg_right hcard (Real.exp_pos _).le _ ≤ ((1 / 16 : ℝ) * Real.exp (a * L)) * Real.exp (-a * L) := mul_le_mul_of_nonneg_right hbound (Real.exp_pos _).le _ = 1 / 16 := by rw [mul_assoc, ← Real.exp_add] simp
end Ostmann
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041import Mathlib
namespace OAI
noncomputable sectionnamespace Ostmann.Supplyopen MeasureTheory Setopen scoped Topology ContDiff
def primeBump : ContDiffBump (3/4:ℝ) := ⟨1/16,1/8,by norm_num,by norm_num⟩def primeWeight : ℝ→ℝ := primeBump
theorem primeWeight_contDiff : ContDiff ℝ ∞ primeWeight := primeBump.contDifftheorem primeWeight_nonneg (x : ℝ) : 0≤primeWeight x := primeBump.nonnegtheorem primeWeight_le_one (x : ℝ) : primeWeight x≤1 := primeBump.le_onetheorem primeWeight_compact : HasCompactSupport primeWeight := primeBump.hasCompactSupport
theorem primeWeight_support : tsupport primeWeight ⊆ Ioo (1/2:ℝ) 1 := by rw [primeWeight,primeBump.tsupport_eq] intro x hx change dist x (3/4:ℝ)≤(1/8:ℝ) at hx rw [Real.dist_eq] at hx obtain ⟨ha,hb⟩ := abs_le.mp hx constructor <;> linarith
theorem primeWeight_integral_pos : 0<∫x in Ioi (0:ℝ),primeWeight x := by have he : (∫x in Ioi (0:ℝ),primeWeight x) = ∫x,primeWeight x := by apply setIntegral_eq_integral_of_forall_compl_eq_zero intro x hx by_contra hh have hm : x∈tsupport primeWeight := subset_closure hh have hp := (primeWeight_support hm).1 exact hx (by change 0<x; linarith) rw [he] exact primeBump.integral_pos
end Ostmann.Supply
end
end OAIlean/OAI/NumberTheory/Ostmann/Supply/LocalKernelBlocks.leanAdded+95
lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelCoordinates.leanAdded+70
lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelOperator.leanAdded+56
lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelPolynomial.leanAdded+82
lean/OAI/NumberTheory/Ostmann/Supply/LocalProjectionBlocks.leanAdded+55
lean/OAI/NumberTheory/Ostmann/Supply/LocalSparseKernelContraction.leanAdded+85
lean/OAI/NumberTheory/Ostmann/Supply/LocalSparsePolydisc.leanAdded+75
lean/OAI/NumberTheory/Ostmann/Supply/LogImbalanceVariance.leanAdded+77
lean/OAI/NumberTheory/Ostmann/Supply/LogRatioCauchy.leanAdded+56
lean/OAI/NumberTheory/Ostmann/Supply/MultiplierRatioProduct.leanAdded+56
lean/OAI/NumberTheory/Ostmann/Supply/MultiplierWeightedBudget.leanAdded+92
lean/OAI/NumberTheory/Ostmann/Supply/NaturalPrimeSupportSieve.leanAdded+60
lean/OAI/NumberTheory/Ostmann/Supply/NaturalResidueAverage.leanAdded+35
lean/OAI/NumberTheory/Ostmann/Supply/NaturalWeight.leanAdded+46
lean/OAI/NumberTheory/Ostmann/Supply/NonnegativeSparseWeight.leanAdded+57
lean/OAI/NumberTheory/Ostmann/Supply/NonsparseSupply.leanAdded+90
lean/OAI/NumberTheory/Ostmann/Supply/PolynomialFunctional.leanAdded+79
lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelection.leanAdded+59
lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelectionBalance.leanAdded+67
lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelectionBudget.leanAdded+60
lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelectionFinite.leanAdded+85
lean/OAI/NumberTheory/Ostmann/Supply/PrimeEnumeration.leanAdded+64
lean/OAI/NumberTheory/Ostmann/Supply/PrimeMeanBounds.leanAdded+62
lean/OAI/NumberTheory/Ostmann/Supply/PrimeMeanIdentity.leanAdded+100
lean/OAI/NumberTheory/Ostmann/Supply/PrimeMeanScale.leanAdded+30
lean/OAI/NumberTheory/Ostmann/Supply/PrimePowerTransfer.leanAdded+79
lean/OAI/NumberTheory/Ostmann/Supply/PrimePowerTransferBasic.leanAdded+72
lean/OAI/NumberTheory/Ostmann/Supply/PrimeSetSupportSieve.leanAdded+79
lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetMainTerm.leanAdded+35
lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetMass.leanAdded+37
lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetProducts.leanAdded+61
lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetSieve.leanAdded+70
lean/OAI/NumberTheory/Ostmann/Supply/PrimeSupportEnergy.leanAdded+52
lean/OAI/NumberTheory/Ostmann/Supply/PrimeSupportSieve.leanAdded+51
lean/OAI/NumberTheory/Ostmann/Supply/ProjectionCrossBound.leanAdded+56
lean/OAI/NumberTheory/Ostmann/Supply/ProjectionScalar.leanAdded+68
lean/OAI/NumberTheory/Ostmann/Supply/RawBlockBounds.leanAdded+55
lean/OAI/NumberTheory/Ostmann/Supply/ResidueBudgetScale.leanAdded+72
lean/OAI/NumberTheory/Ostmann/Supply/ResidueKernel.leanAdded+59
lean/OAI/NumberTheory/Ostmann/Supply/ResidueKernelNormBounds.leanAdded+73
lean/OAI/NumberTheory/Ostmann/Supply/ResidueProjectionScalar.leanAdded+105
lean/OAI/NumberTheory/Ostmann/Supply/ResidueProjectionSides.leanAdded+94
lean/OAI/NumberTheory/Ostmann/Supply/ResidueRatio.leanAdded+84
lean/OAI/NumberTheory/Ostmann/Supply/ResidueTensor.leanAdded+62
lean/OAI/NumberTheory/Ostmann/Supply/ResidueVectorNorm.leanAdded+64
lean/OAI/NumberTheory/Ostmann/Supply/RestrictedSubsetEnergy.leanAdded+85
lean/OAI/NumberTheory/Ostmann/Supply/RetainedBandProducts.leanAdded+86
lean/OAI/NumberTheory/Ostmann/Supply/RetainedBandScales.leanAdded+58
lean/OAI/NumberTheory/Ostmann/Supply/SieveBudgetParameters.leanAdded+73
lean/OAI/NumberTheory/Ostmann/Supply/SmoothPrimeWeight.leanAdded+41