diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelBlocks.lean b/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce9294822911d9cf7c76e4b56e98f9ff340ba732 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelBlocks.lean @@ -0,0 +1,95 @@ +import OAI.NumberTheory.Ostmann.Supply.BalancedProjectionBlocks +import OAI.NumberTheory.Ostmann.Supply.LocalBlockConstant +import OAI.NumberTheory.Ostmann.Supply.LocalKernelOperator +import OAI.NumberTheory.Ostmann.Supply.ProjectionScalar +import OAI.NumberTheory.Ostmann.Supply.RawBlockBounds + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelCoordinates.lean b/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..e4639cc34788ff08ab2f88809c8dc457add8f55f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelCoordinates.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.Supply.BivariateTruncation +import OAI.NumberTheory.Ostmann.Supply.LocalBlockConstant +import OAI.NumberTheory.Ostmann.Supply.LocalKernelOperator + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {ι : 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 Cyclic +variable {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 Cyclic +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelOperator.lean b/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..c742576167b94af64f2ab76ff16264c398e5aec8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelOperator.lean @@ -0,0 +1,56 @@ +import OAI.NumberTheory.Ostmann.Supply.KernelMoments +import OAI.NumberTheory.Ostmann.Supply.LocalBlock + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelPolynomial.lean b/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..871fdaf03a571b05defa175b113c0ac28c773782 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/LocalKernelPolynomial.lean @@ -0,0 +1,82 @@ +import OAI.NumberTheory.Ostmann.Supply.LocalKernelCoordinates +import OAI.NumberTheory.Ostmann.Supply.TensorOperators + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +open TensorOperators +variable {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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/LocalProjectionBlocks.lean b/lean/OAI/NumberTheory/Ostmann/Supply/LocalProjectionBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..48fc6544e0be475ed912a588c48f825a0df49cdb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/LocalProjectionBlocks.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.Supply.ProjectionCrossBound +import OAI.NumberTheory.Ostmann.Supply.UniformProjection + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/LocalSparseKernelContraction.lean b/lean/OAI/NumberTheory/Ostmann/Supply/LocalSparseKernelContraction.lean new file mode 100644 index 0000000000000000000000000000000000000000..4ff3bb0497dc111acd4fe2f0f4a8c66e4574006f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/LocalSparseKernelContraction.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.Characters.SparseKernelLocalBlocks +import OAI.NumberTheory.Ostmann.Characters.SparseKernelUnitFactor +import OAI.NumberTheory.Ostmann.Characters.SparseKernelScalarRange +import OAI.NumberTheory.Ostmann.Characters.SparseScalarNorm + +namespace OAI + +/-! # The contracting local sparse block at `(u,v)=(1,1)` -/ + +namespace Ostmann +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/LocalSparsePolydisc.lean b/lean/OAI/NumberTheory/Ostmann/Supply/LocalSparsePolydisc.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d123b2314b33f12bd98399366afad868f6f90f2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/LocalSparsePolydisc.lean @@ -0,0 +1,75 @@ +import OAI.NumberTheory.Ostmann.Characters.SparsePolydiscBlocks + +namespace OAI + +/-! # Uniform complex-parameter bound for the local sparse block -/ + +namespace Ostmann +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/LogImbalanceVariance.lean b/lean/OAI/NumberTheory/Ostmann/Supply/LogImbalanceVariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..f881c9171f07aee9af9a98cb3e8943f2a84815f1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/LogImbalanceVariance.lean @@ -0,0 +1,77 @@ +import Mathlib.Analysis.SpecialFunctions.Log.Basic +import Mathlib.Analysis.Real.Sqrt +import Mathlib.Algebra.Order.BigOperators.Ring.Finset +import Mathlib.Tactic + +namespace OAI + +/-! # Logarithmic imbalance from the collision variance -/ + +namespace Ostmann +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/LogRatioCauchy.lean b/lean/OAI/NumberTheory/Ostmann/Supply/LogRatioCauchy.lean new file mode 100644 index 0000000000000000000000000000000000000000..20ef59b97fda28d1bd3db2a9377c4f602e329d13 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/LogRatioCauchy.lean @@ -0,0 +1,56 @@ +import Mathlib + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators + +theorem log_sq_le_ratio_penalty {t : ℝ} (ht : 0 |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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/MultiplierWeightedBudget.lean b/lean/OAI/NumberTheory/Ostmann/Supply/MultiplierWeightedBudget.lean new file mode 100644 index 0000000000000000000000000000000000000000..76e4508156eae1799ce7610953bbe09a0e9ef4ac --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/MultiplierWeightedBudget.lean @@ -0,0 +1,92 @@ +import OAI.NumberTheory.Ostmann.Supply.SquarefreeMultiplierCount + +namespace OAI + +/-! # Elementary divisor and logarithmic budgets for sieve multipliers -/ + +namespace Ostmann +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/NaturalPrimeSupportSieve.lean b/lean/OAI/NumberTheory/Ostmann/Supply/NaturalPrimeSupportSieve.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1bccb0737868c752f27a49222ddeffd4dc7adb9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/NaturalPrimeSupportSieve.lean @@ -0,0 +1,60 @@ +import 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/NaturalResidueAverage.lean b/lean/OAI/NumberTheory/Ostmann/Supply/NaturalResidueAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..7653b8081c830c605430a7d9d651130f274eec48 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/NaturalResidueAverage.lean @@ -0,0 +1,35 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.ResidueIntervals +import OAI.NumberTheory.Ostmann.Arithmetic.CRTLineAverage + +namespace OAI + +/-! # Natural residue representatives and the Haar unit averages used by CRT -/ + +namespace Ostmann +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/NaturalWeight.lean b/lean/OAI/NumberTheory/Ostmann/Supply/NaturalWeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..db4122194abc090213814b17f9ea0207bf17e1ff --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/NaturalWeight.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.Ostmann.Supply.KernelEmpirical +import OAI.NumberTheory.Ostmann.Supply.WeightPointwiseBound + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/NonnegativeSparseWeight.lean b/lean/OAI/NumberTheory/Ostmann/Supply/NonnegativeSparseWeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..20a93d68a52afed2d5a2791f4c169fe24bbdb21d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/NonnegativeSparseWeight.lean @@ -0,0 +1,57 @@ +import OAI.NumberTheory.Ostmann.Characters.SparseTruncatedWeight + +namespace OAI + +/-! # The real nonnegative weight represented by the truncated tensor -/ + +namespace Ostmann +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/NonsparseSupply.lean b/lean/OAI/NumberTheory/Ostmann/Supply/NonsparseSupply.lean new file mode 100644 index 0000000000000000000000000000000000000000..64c724424dc648761dfcc8063150775cf5b8d643 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/NonsparseSupply.lean @@ -0,0 +1,90 @@ +import OAI.NumberTheory.Ostmann.Supply.ActualPrimeLower +import OAI.NumberTheory.Ostmann.Supply.ActualPrimeUpper +import OAI.NumberTheory.Ostmann.Supply.PrimeBandSelection +import OAI.NumberTheory.Ostmann.Supply.PrimeEnumeration + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +namespace Ostmann.Supply +open Filter +open scoped BigOperators + +theorem nonsparse_supply : NonsparseSupply := by + classical + refine ⟨supplyEpsilon^2,by norm_num [supplyEpsilon],?_⟩ + intro d + have hη : 0 (hP q hq).1 + let : Fact (∀q∈P,q.Prime) := ⟨hpP⟩ + let p := enumeratePrimes P + let n := P.card + have hp : ∀i enumeratePrimes_prime P hpP i + have hinj : Set.InjOn p (Finset.range n:Set ℕ) := enumeratePrimes_injective P + have hband : ∀i ⟨(hP q hq).1,(hP q hq).2.2.1⟩) + have hbound : ∀i + 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 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelection.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0a6f61c1101a5273eb4797e0efbe31ff2077cd7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelection.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.Ostmann.Supply.PrimeBandSelectionFinite + +namespace OAI + +open Erdos970 + +noncomputable section +namespace Ostmann.Supply +open Filter Ostmann.Construction +open 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 ¬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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelectionBudget.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelectionBudget.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d15879b35a332cc6a234c3fcd29641107340162 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeBandSelectionBudget.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.Supply.PrimeBandSelectionBalance + +namespace OAI + +open Erdos970 + +noncomputable section +namespace Ostmann.Supply +open Filter Ostmann.Construction +open 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 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 (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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimeEnumeration.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeEnumeration.lean new file mode 100644 index 0000000000000000000000000000000000000000..7cfdac064ca3fe9c060ef1b787752dd039b37454 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeEnumeration.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.Supply.KernelProducts + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators + +def enumeratePrimes (P : Finset ℕ) (i : ℕ) : ℕ := + if hi : i (1:ℝ)/p) + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimeMeanBounds.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeMeanBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..88485559b57144448167f27fa44494c3230a3465 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeMeanBounds.lean @@ -0,0 +1,62 @@ +import OAI.NumberTheory.Ostmann.Supply.FiniteCoverage +import OAI.NumberTheory.Ostmann.Supply.PrimeMeanIdentity + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open Set +open scoped BigOperators + +theorem weightedPrimeSum_eq_interval (φ : ℝ→ℝ) (W : ℕ→ℝ) + (hs : tsupport φ ⊆ Ioo (1/2:ℝ) 1) (X : ℕ) (hX : 0 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 χ.1.val+1) + (fun χ : PrimitiveFamily Q => χ.2.1) c W hs hX hexp + +theorem sum_primitive_principal_term {Q : ℕ} (hQ : 0 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimePowerTransfer.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimePowerTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b2837b18f37a2933de14cd364e1c8e6dacbabfa --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimePowerTransfer.lean @@ -0,0 +1,79 @@ +import Mathlib.Analysis.Normed.Group.Bounded +import OAI.NumberTheory.Ostmann.Supply.PrimePowerTransferBasic + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open Finset Set Ostmann.ZeroDensity +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimePowerTransferBasic.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimePowerTransferBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..760f32e1d0f68de40e4d318110c98a09163acfe8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimePowerTransferBasic.lean @@ -0,0 +1,72 @@ +import Mathlib.NumberTheory.Chebyshev +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalSmoothingAbel + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open Finset Set MeasureTheory Ostmann.ZeroDensity +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSetSupportSieve.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSetSupportSieve.lean new file mode 100644 index 0000000000000000000000000000000000000000..30b131d619a1675a9286c3189000d673227f13e1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSetSupportSieve.lean @@ -0,0 +1,79 @@ +import OAI.NumberTheory.Ostmann.Supply.PrimeSubsetMainTerm +import OAI.NumberTheory.Ostmann.Preliminaries.BoundedSieveSubsets +import 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetMainTerm.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetMainTerm.lean new file mode 100644 index 0000000000000000000000000000000000000000..73bdde454c8b8f15be2fc7922bc152dae5a3109e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetMainTerm.lean @@ -0,0 +1,35 @@ +import 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetMass.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..3eec9157606a44bbaea4b9f4d093f57843185af2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetMass.lean @@ -0,0 +1,37 @@ +import OAI.NumberTheory.Ostmann.Construction.PrimeSubsetCellMixture +import OAI.NumberTheory.Ostmann.Arithmetic.BulkPrimeCellMass + +namespace OAI + +/-! # Exact mass and normalization of the original atomic prime laws -/ + +namespace Ostmann +open MeasureTheory +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetProducts.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3bdb7e43e1cec1d5a537dff3b721d809824ce4d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetProducts.lean @@ -0,0 +1,61 @@ +import Mathlib.Data.Nat.Squarefree +import Mathlib.Data.Finset.Powerset +import 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetSieve.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetSieve.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f253fee856693f985c8b73b2fc0bcfd131e4fa6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSubsetSieve.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.Supply.SubsetReducedEnergy + +namespace OAI + +/-! # Summing the positive subset expansion inside the additive large sieve -/ + +namespace Ostmann +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSupportEnergy.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSupportEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..2a77710212771b0ad57c77fa4e1ca824db43e703 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSupportEnergy.lean @@ -0,0 +1,52 @@ +import 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSupportSieve.lean b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSupportSieve.lean new file mode 100644 index 0000000000000000000000000000000000000000..07c631bc3d2eee4a60bc6e299f6b1286b079055c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/PrimeSupportSieve.lean @@ -0,0 +1,51 @@ +import OAI.NumberTheory.Ostmann.Supply.PrimeSupportEnergy +import OAI.NumberTheory.Ostmann.Preliminaries.FullSummandResidues +import 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/ProjectionCrossBound.lean b/lean/OAI/NumberTheory/Ostmann/Supply/ProjectionCrossBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..79146c1fb92a61728d6767a6159658f534af0da8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/ProjectionCrossBound.lean @@ -0,0 +1,56 @@ +import OAI.NumberTheory.Ostmann.Supply.CenteredProjection + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate + +section Hilbert +variable {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 Centered +variable {ι : 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 Centered +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/ProjectionScalar.lean b/lean/OAI/NumberTheory/Ostmann/Supply/ProjectionScalar.lean new file mode 100644 index 0000000000000000000000000000000000000000..484a9438d44f4fee05a095856d20902d235d2b81 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/ProjectionScalar.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.Ostmann.Supply.UniformProjection + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/RawBlockBounds.lean b/lean/OAI/NumberTheory/Ostmann/Supply/RawBlockBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..2bb2e7e9130607620356bbfdd374e319a73f3daa --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/RawBlockBounds.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.Supply.UniformBalanced + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {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:ℝ)

(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 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 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/ResidueKernelNormBounds.lean b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueKernelNormBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..1011884877951beccd9f9abfc16813c99160cdab --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueKernelNormBounds.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.Supply.ResidueProjectionSides +import OAI.NumberTheory.Ostmann.Supply.ResidueVectorNorm + +namespace OAI + +/-! # Dimension-free norms of the concrete residue kernel blocks -/ + +namespace Ostmann +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/ResidueProjectionScalar.lean b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueProjectionScalar.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f8d68e5e6d6d74ab1522d87c0a3c9e0c389280d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueProjectionScalar.lean @@ -0,0 +1,105 @@ +import OAI.NumberTheory.Ostmann.Supply.SpectralProjectionAffine + +namespace OAI + +/-! # The negative scalar block between complementary residue supports -/ + +namespace Ostmann +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/ResidueProjectionSides.lean b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueProjectionSides.lean new file mode 100644 index 0000000000000000000000000000000000000000..66636c2573108920e8cda10e331aa61659fc79f7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueProjectionSides.lean @@ -0,0 +1,94 @@ +import OAI.NumberTheory.Ostmann.Supply.ResidueProjectionScalar +import OAI.NumberTheory.Ostmann.Supply.CenteredResidueProjection + +namespace OAI + +/-! # Quantitative side blocks of the sparse residue projection -/ + +namespace Ostmann +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/ResidueRatio.lean b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueRatio.lean new file mode 100644 index 0000000000000000000000000000000000000000..27d4a6afeaf72575eba2a2d43926fc3fc6fecde1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueRatio.lean @@ -0,0 +1,84 @@ +import OAI.NumberTheory.Ostmann.Preliminaries.LocalUniformity +import OAI.NumberTheory.Ostmann.Preliminaries.Sizes +import OAI.NumberTheory.Ostmann.Supply.LogRatioCauchy + +namespace OAI + +open Erdos970 + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators +open 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 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/ResidueTensor.lean b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueTensor.lean new file mode 100644 index 0000000000000000000000000000000000000000..e93ddddcb55c5334f659a744bcd703f62d449275 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueTensor.lean @@ -0,0 +1,62 @@ +import OAI.NumberTheory.Ostmann.Supply.ResidueKernel +import OAI.NumberTheory.Ostmann.Supply.TensorKernel + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {ι : 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/ResidueVectorNorm.lean b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueVectorNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f9d584d17d401086f3767926ea755431c75599d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/ResidueVectorNorm.lean @@ -0,0 +1,64 @@ +import Mathlib.Analysis.InnerProductSpace.PiL2 +import OAI.NumberTheory.Ostmann.Characters.SparseKernelEnergy +import OAI.NumberTheory.Ostmann.Supply.CenteredSupportProjection + +namespace OAI + +/-! # Counting L2 norms for the finite local kernel blocks -/ + +namespace Ostmann +open WithLp +open 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/RestrictedSubsetEnergy.lean b/lean/OAI/NumberTheory/Ostmann/Supply/RestrictedSubsetEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..39817dbccc81c2f9e7101ecbc5591882341aaffc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/RestrictedSubsetEnergy.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.Supply.ConcreteSubsetEnergyBudget +import OAI.NumberTheory.Ostmann.Supply.CenteredCoordinateSupport + +namespace OAI + +/-! # Restricting the centered-energy budget to the selected sparse primes -/ + +namespace Ostmann +open 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-mode +energy is bounded by the sieve on the full prime family, with no factor for +the 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 OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/RetainedBandProducts.lean b/lean/OAI/NumberTheory/Ostmann/Supply/RetainedBandProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..5a5790df510b22c0f70fd678edbd64ea6c823308 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/RetainedBandProducts.lean @@ -0,0 +1,86 @@ +import OAI.NumberTheory.Ostmann.Supply.RetainedBandScales + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open Filter TensorModes +open 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 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:ℝ)

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 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 EuclideanSpace ℂ (ZMod p) + +def normalizedVector (S : Finset (ZMod p)) : H := + WithLp.toLp 2 (fun x => (normalizedIndicator S x : ℂ)) + +@[simp] theorem normalizedVector_apply (S : Finset (ZMod p)) (x : ZMod p) : + normalizedVector S x = (normalizedIndicator S x : ℂ) := rfl + +theorem spectralProjection_norm_sq (E : Finset (ZMod p)) (f : H) : + ‖spectralProjection E f‖^2 = ∑ v ∈ E, ‖unitaryDFT f v‖^2 := by + rw [← fourierEquiv.norm_map (spectralProjection E f), PiLp.norm_sq_eq_of_L2] + simp only [fourierEquiv_apply, spectralProjection_fourier, + apply_ite, norm_zero, ite_pow, zero_pow (by decide : 2 ≠ 0), + Finset.sum_ite_mem, Finset.univ_inter] + +theorem spectralProjection_error_sq (E : Finset (ZMod p)) (f : H) : + ‖spectralProjection E f-f‖^2 = ∑ v ∈ Eᶜ, ‖unitaryDFT f v‖^2 := by + rw [← fourierEquiv.norm_map (spectralProjection E f-f), PiLp.norm_sq_eq_of_L2] + simp only [map_sub, PiLp.sub_apply, fourierEquiv_apply, spectralProjection_fourier] + calc + _ = ∑ v : ZMod p, if v ∈ Eᶜ then ‖unitaryDFT f v‖^2 else 0 := by + apply Finset.sum_congr rfl + intro v hv + by_cases hh : v ∈ E <;> simp [hh] + _ = _ := by rw [Finset.sum_ite_mem, Finset.univ_inter] + +theorem normalizedVector_norm_sq (S : Finset (ZMod p)) + (hpos : 0 < density S) (hlt : density S < 1) : + ‖normalizedVector S‖^2 = p := by + rw [PiLp.norm_sq_eq_of_L2] + simp only [normalizedVector_apply, Complex.norm_real, Real.norm_eq_abs, sq_abs] + simpa only [ZMod.card] using sum_normalizedIndicator_sq S hpos hlt + +theorem sparse_projection_error_sq_le (S : Finset (ZMod p)) : + ‖spectralProjection (largeSpectrum S) (normalizedVector S)-normalizedVector S‖^2 ≤ + gamma S*p := by + rw [spectralProjection_error_sq] + exact largeSpectrum_energy_le_complement S + +theorem sparse_projection_error_le (S : Finset (ZMod p)) {ε : ℝ} + (hε : 0 ≤ ε) (hg : gamma S ≤ ε^2) : + ‖spectralProjection (largeSpectrum S) (normalizedVector S)-normalizedVector S‖ ≤ + ε*Real.sqrt p := by + have hs := Real.sq_sqrt (Nat.cast_nonneg p : (0:ℝ)≤p) + have h := (sparse_projection_error_sq_le S).trans + (mul_le_mul_of_nonneg_right hg (Nat.cast_nonneg _)) + have hn := norm_nonneg (spectralProjection (largeSpectrum S) (normalizedVector S)-normalizedVector S) + have hprod := mul_nonneg hε (Real.sqrt_nonneg (p:ℝ)) + nlinarith + +theorem sparse_projection_energy_ge (S : Finset (ZMod p)) + (hpos : 0 < density S) (hlt : density S < 1) : + (1-gamma S)*p ≤ ‖spectralProjection (largeSpectrum S) (normalizedVector S)‖^2 := by + rw [spectralProjection_norm_sq] + exact largeSpectrum_energy_ge S hpos hlt + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/SpectralConcentration.lean b/lean/OAI/NumberTheory/Ostmann/Supply/SpectralConcentration.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8917061ddc7ab1fc3cae1097d0e7bb6c53fe5cc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/SpectralConcentration.lean @@ -0,0 +1,81 @@ +import OAI.NumberTheory.Ostmann.Supply.FiniteParseval + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [NeZero p] + +def largeSpectrum (S : Finset (ZMod p)) : Finset (ZMod p) := + Finset.univ.filter (fun v => 1 < ‖additiveTransform S v‖) + +@[simp] theorem mem_largeSpectrum (S : Finset (ZMod p)) (v : ZMod p) : + v ∈ largeSpectrum S ↔ 1 < ‖additiveTransform S v‖ := by + simp [largeSpectrum] + +@[simp] theorem zero_not_mem_largeSpectrum (S : Finset (ZMod p)) : + 0 ∉ largeSpectrum S := by simp [additiveTransform_zero] + +@[simp] theorem neg_mem_largeSpectrum (S : Finset (ZMod p)) (v : ZMod p) : + -v ∈ largeSpectrum S ↔ v ∈ largeSpectrum S := by + simp [additiveTransform_neg] + +theorem sum_norm_additiveTransform (S : Finset (ZMod p)) : + ∑ v, ‖additiveTransform S v‖ = gamma S * p := by + have hp : (p : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p + exact (div_mul_cancel₀ _ hp).symm + +theorem largeSpectrum_card_le (S : Finset (ZMod p)) : + ((largeSpectrum S).card : ℝ) ≤ gamma S * p := by + rw [← sum_norm_additiveTransform] + calc + ((largeSpectrum S).card : ℝ) = ∑ v ∈ largeSpectrum S, (1 : ℝ) := by simp + _ ≤ ∑ v ∈ largeSpectrum S, ‖additiveTransform S v‖ := + Finset.sum_le_sum fun v hv => (mem_largeSpectrum S v |>.mp hv).le + _ ≤ ∑ v, ‖additiveTransform S v‖ := + Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ _) (fun _ _ _ => norm_nonneg _) + +theorem largeSpectrum_energy_le_complement (S : Finset (ZMod p)) : + ∑ v ∈ (largeSpectrum S)ᶜ, ‖additiveTransform S v‖^2 ≤ gamma S * p := by + rw [← sum_norm_additiveTransform] + calc + (∑ v ∈ (largeSpectrum S)ᶜ, ‖additiveTransform S v‖^2) ≤ + ∑ v ∈ (largeSpectrum S)ᶜ, ‖additiveTransform S v‖ := by + apply Finset.sum_le_sum + intro v hv + have hh : ‖additiveTransform S v‖ ≤ 1 := by + simpa only [Finset.mem_compl, mem_largeSpectrum, not_lt] using hv + nlinarith [norm_nonneg (additiveTransform S v)] + _ ≤ ∑ v, ‖additiveTransform S v‖ := + Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ _) (fun _ _ _ => norm_nonneg _) + +theorem largeSpectrum_energy_ge (S : Finset (ZMod p)) + (hpos : 0 < density S) (hlt : density S < 1) : + (1 - gamma S) * p ≤ ∑ v ∈ largeSpectrum S, ‖additiveTransform S v‖^2 := by + have hsplit := Finset.sum_add_sum_compl (largeSpectrum S) + (fun v => ‖additiveTransform S v‖^2) + rw [additiveTransform_parseval S hpos hlt] at hsplit + have hrem := largeSpectrum_energy_le_complement S + nlinarith + +theorem sparse_transform_concentration (S : Finset (ZMod p)) + (hpos : 0 < density S) (hlt : density S < 1) + {ε : ℝ} (hε : 0 ≤ ε) (hε1 : ε ≤ 1) (hg : gamma S ≤ ε^2) : + ((largeSpectrum S).card : ℝ) ≤ ε * p ∧ + (1 - ε^2) * p ≤ ∑ v ∈ largeSpectrum S, ‖additiveTransform S v‖^2 := by + have hp : (0 : ℝ) ≤ p := Nat.cast_nonneg _ + constructor + · calc + _ ≤ gamma S * p := largeSpectrum_card_le S + _ ≤ ε^2 * p := mul_le_mul_of_nonneg_right hg hp + _ ≤ ε * p := mul_le_mul_of_nonneg_right (by nlinarith) hp + · calc + _ ≤ (1-gamma S)*p := mul_le_mul_of_nonneg_right (by linarith) hp + _ ≤ _ := largeSpectrum_energy_ge S hpos hlt + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/SpectralProjection.lean b/lean/OAI/NumberTheory/Ostmann/Supply/SpectralProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b98f83e334721fe90d204f0df3a5f3dd75488ae --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/SpectralProjection.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.Ostmann.Supply.FourierIsometry +import OAI.NumberTheory.Ostmann.Supply.SpectralConcentration + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [NeZero p] +local notation "H" => EuclideanSpace ℂ (ZMod p) + +def coordinateSpace (E : Finset (ZMod p)) : Submodule ℂ H where + carrier := {f | ∀ v, v ∉ E → f v = 0} + zero_mem' := by simp + add_mem' := by intro f g hf hg v hv; simp [hf v hv,hg v hv] + smul_mem' := by intro c f hf v hv; simp [hf v hv] + +def frequencySpace (E : Finset (ZMod p)) : Submodule ℂ H := + (coordinateSpace E).comap unitaryDFTLinear + +def spectralProjection (E : Finset (ZMod p)) : H →L[ℂ] H := + (frequencySpace E).starProjection + +def maskedFourier (E : Finset (ZMod p)) (f : H) : H := + fourierEquiv.symm (WithLp.toLp 2 (fun v => if v ∈ E then unitaryDFT f v else 0)) + +theorem fourier_maskedFourier (E : Finset (ZMod p)) (f : H) (v : ZMod p) : + unitaryDFT (maskedFourier E f) v = if v ∈ E then unitaryDFT f v else 0 := by + rw [← fourierEquiv_apply] + simp only [maskedFourier, LinearIsometryEquiv.apply_symm_apply, PiLp.toLp_apply] + +theorem maskedFourier_mem (E : Finset (ZMod p)) (f : H) : + maskedFourier E f ∈ frequencySpace E := by + intro v hv + change unitaryDFT (maskedFourier E f) v = 0 + rw [fourier_maskedFourier, ite_eq_right hv] + +theorem spectralProjection_eq_maskedFourier (E : Finset (ZMod p)) (f : H) : + spectralProjection E f = maskedFourier E f := by + apply Submodule.eq_starProjection_of_mem_of_inner_eq_zero (maskedFourier_mem E f) + intro w hw + rw [← fourierEquiv_inner, PiLp.inner_apply] + apply Finset.sum_eq_zero + intro v hv + have he : fourierEquiv (f-maskedFourier E f) v = + unitaryDFT f v - (if v ∈ E then unitaryDFT f v else 0) := by + rw [map_sub, PiLp.sub_apply, fourierEquiv_apply, fourierEquiv_apply, + fourier_maskedFourier] + rw [he] + by_cases hvE : v ∈ E + · simp [hvE] + · have hwv : fourierEquiv w v = 0 := hw v hvE + simp [hwv] + +theorem spectralProjection_norm_le (E : Finset (ZMod p)) : + ‖spectralProjection E‖ ≤ 1 := (frequencySpace E).starProjection_norm_le + +theorem spectralProjection_fourier (E : Finset (ZMod p)) (f : H) (v : ZMod p) : + unitaryDFT (spectralProjection E f) v = + if v ∈ E then unitaryDFT f v else 0 := by + rw [spectralProjection_eq_maskedFourier, fourier_maskedFourier] + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/SpectralProjectionAffine.lean b/lean/OAI/NumberTheory/Ostmann/Supply/SpectralProjectionAffine.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e6a5c1da4d405261d5589723a7e7d9404297361 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/SpectralProjectionAffine.lean @@ -0,0 +1,37 @@ +import OAI.NumberTheory.Ostmann.Supply.SpectralProjectionPairing + +namespace OAI + +/-! # Affine identities for the constant-killing local projection -/ + +namespace Ostmann +open scoped Classical BigOperators + +theorem densityFourier_affine {p : ℕ} [NeZero p] + (f : ZMod p → ℂ) (a c : ℂ) (b : ZMod p) : + densityFourier (fun x => a * f x + c) b = + a * densityFourier f b + densityFourier (fun _ => c) b := by + simp only [densityFourier, additiveFourier_apply, add_mul, Finset.sum_add_distrib, + ← Finset.mul_sum, mul_assoc] + ring + +theorem finiteSpectralProjection_affine {p : ℕ} [NeZero p] + (E : Finset (ZMod p)) (hE : 0 ∉ E) (f : ZMod p → ℂ) (a c : ℂ) : + finiteSpectralProjection E (fun x => a * f x + c) = + fun x => a * finiteSpectralProjection E f x := by + have he : densityFourier (finiteSpectralProjection E (fun x => a * f x + c)) = + densityFourier (fun x => a * finiteSpectralProjection E f x) := by + funext b + rw [finiteSpectralProjection_fourier, densityFourier_affine, + densityFourier_const_mul, finiteSpectralProjection_fourier] + by_cases hb : b ∈ E + · have hb0 : b ≠ 0 := by intro h; subst b; exact hE hb + simp only [ite_eq_left hb, densityFourier, additiveFourier_const, + ite_eq_right hb0, mul_zero, add_zero] + · simp only [ite_eq_right hb, mul_zero] + have hh := congrArg (fun g => fun x => densityFourierInverse g x) he + simpa only [densityFourierInverse_fourier] using hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/SpectralProjectionPairing.lean b/lean/OAI/NumberTheory/Ostmann/Supply/SpectralProjectionPairing.lean new file mode 100644 index 0000000000000000000000000000000000000000..47ad4d120c0e8099867060a2b58dc8822d27274a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/SpectralProjectionPairing.lean @@ -0,0 +1,47 @@ +import OAI.NumberTheory.Ostmann.Supply.FiniteSpectralProjection + +namespace OAI + +/-! # The exact pairing of the local spectral projection -/ + +namespace Ostmann +open scoped Classical BigOperators ComplexConjugate + +theorem densityFourier_conj_reflect {p : ℕ} [NeZero p] + (f : ZMod p → ℂ) (b : ZMod p) : + densityFourier (fun x => conj (f x)) b = conj (densityFourier f (-b)) := by + simp only [densityFourier, additiveFourier_conj, map_mul, Complex.conj_ofReal] + +theorem densityFourier_inner {p : ℕ} [NeZero p] (f g : ZMod p → ℂ) : + (∑ x, conj (f x) * g x) = ∑ b, conj (densityFourier f b) * densityFourier g b := by + have he := densityFourier_pairing (fun x => conj (f x)) (densityFourier g) + simpa only [densityFourierInverse_fourier, densityFourier_conj_reflect, neg_neg] using he + +theorem finiteSpectralProjection_pairing {p : ℕ} [NeZero p] + (E : Finset (ZMod p)) (f g : ZMod p → ℂ) : + (∑ x, conj (f x) * finiteSpectralProjection E g x) = + ∑ b ∈ E, conj (densityFourier f b) * densityFourier g b := by + rw [densityFourier_inner] + simp only [finiteSpectralProjection_fourier, mul_ite, mul_zero, + Finset.sum_ite_mem, Finset.univ_inter] + +theorem finiteSpectralProjection_selfAdjoint {p : ℕ} [NeZero p] + (E : Finset (ZMod p)) (f g : ZMod p → ℂ) : + (∑ x, conj (f x) * finiteSpectralProjection E g x) = + ∑ x, conj (finiteSpectralProjection E f x) * g x := by + rw [finiteSpectralProjection_pairing, densityFourier_inner] + simp only [finiteSpectralProjection_fourier, apply_ite, map_zero, ite_mul, + zero_mul, Finset.sum_ite_mem, Finset.univ_inter] + +theorem finiteSpectralProjection_self_pairing {p : ℕ} [NeZero p] + (E : Finset (ZMod p)) (f : ZMod p → ℂ) : + (∑ x, conj (f x) * finiteSpectralProjection E f x) = + ((∑ x, ‖finiteSpectralProjection E f x‖ ^ 2 : ℝ) : ℂ) := by + rw [finiteSpectralProjection_pairing, finiteSpectralProjection_energy, Complex.ofReal_sum] + apply Finset.sum_congr rfl + intro b _ + rw [mul_comm, Complex.mul_conj', Complex.ofReal_pow] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/SquarefreeEulerBound.lean b/lean/OAI/NumberTheory/Ostmann/Supply/SquarefreeEulerBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7836f7c7a33602b2b0b93f0d58c6fe32a36b588 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/SquarefreeEulerBound.lean @@ -0,0 +1,61 @@ +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Algebra.BigOperators.Ring.Finset +import OAI.NumberTheory.Ostmann.Characters.SquarefreeBonami + +namespace OAI + +/-! # The weighted reciprocal squarefree sum in the coefficient estimate -/ + +namespace Ostmann + +open scoped BigOperators + +theorem squarefree_weighted_reciprocal_le_product (S P : Finset ℕ) + (hS : ∀ s ∈ S, Squarefree s) (hP : ∀ s ∈ S, s.primeFactors ⊆ P) + (u : ℝ) (hu : 0 ≤ u) : + (∑ s ∈ S, u ^ s.primeFactors.card / (s : ℝ)) ≤ + ∏ p ∈ P, (1 + u / (p : ℝ)) := by + classical + have hinj : Set.InjOn Nat.primeFactors (↑S : Set ℕ) := by + intro a ha b hb he + calc + a = ∏ p ∈ a.primeFactors, p := (Nat.prod_primeFactors_of_squarefree (hS a ha)).symm + _ = ∏ p ∈ b.primeFactors, p := by rw [he] + _ = b := Nat.prod_primeFactors_of_squarefree (hS b hb) + have hterm (s : ℕ) (hs : s ∈ S) : + u ^ s.primeFactors.card / (s : ℝ) = ∏ p ∈ s.primeFactors, u / (p : ℝ) := by + rw [Finset.prod_div_distrib, Finset.prod_const, ← Nat.cast_prod, + Nat.prod_primeFactors_of_squarefree (hS s hs)] + calc + _ = ∑ s ∈ S, ∏ p ∈ s.primeFactors, u / (p : ℝ) := + Finset.sum_congr rfl hterm + _ = ∑ Q ∈ S.image Nat.primeFactors, ∏ p ∈ Q, u / (p : ℝ) := + (Finset.sum_image (f := fun Q : Finset ℕ => ∏ p ∈ Q, u / (p : ℝ)) hinj).symm + _ ≤ ∑ Q ∈ P.powerset, ∏ p ∈ Q, u / (p : ℝ) := by + apply Finset.sum_le_sum_of_subset_of_nonneg + · intro Q hQ + obtain ⟨s, hs, rfl⟩ := Finset.mem_image.mp hQ + exact Finset.mem_powerset.mpr (hP s hs) + · intro Q hQ hnot + exact Finset.prod_nonneg (fun p hp => div_nonneg hu (Nat.cast_nonneg _)) + _ = _ := (Finset.prod_one_add P).symm + +theorem squarefree_weighted_reciprocal_le_exp (S P : Finset ℕ) + (hS : ∀ s ∈ S, Squarefree s) (hP : ∀ s ∈ S, s.primeFactors ⊆ P) + (u : ℝ) (hu : 0 ≤ u) : + (∑ s ∈ S, u ^ s.primeFactors.card / (s : ℝ)) ≤ + Real.exp (u * ∑ p ∈ P, (p : ℝ)⁻¹) := by + apply (squarefree_weighted_reciprocal_le_product S P hS hP u hu).trans + calc + _ ≤ ∏ p ∈ P, Real.exp (u / (p : ℝ)) := by + apply Finset.prod_le_prod₀ + · intro p hp + positivity + · intro p hp + simpa only [add_comm] using Real.add_one_le_exp (u / (p : ℝ)) + _ = Real.exp (∑ p ∈ P, u / (p : ℝ)) := (Real.exp_sum P _).symm + _ = _ := by simp only [div_eq_mul_inv, Finset.mul_sum] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/SquarefreeMultiplierCount.lean b/lean/OAI/NumberTheory/Ostmann/Supply/SquarefreeMultiplierCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..2959b64d76566b8c519c2924ce83a62752704d3c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/SquarefreeMultiplierCount.lean @@ -0,0 +1,92 @@ +import Mathlib.Data.Nat.Squarefree +import Mathlib.Data.Nat.Factorization.Basic +import Mathlib.Algebra.BigOperators.Intervals +import Mathlib.Tactic + +namespace OAI + +/-! # An elementary positive-density supply of squarefree multipliers -/ + +namespace Ostmann +open scoped Classical BigOperators + +private theorem reciprocal_square_step (x : ℝ) (hx : 0 < x) : + (x + 1)⁻¹ ^ 2 ≤ x⁻¹ - (x + 1)⁻¹ := by + have hx1 : 0 < x + 1 := by linarith + have h : (x + 1)⁻¹ ^ 2 ≤ (x * (x + 1))⁻¹ := by + rw [inv_pow, inv_le_inv₀ (sq_pos_of_pos hx1) (mul_pos hx hx1)] + nlinarith + calc + _ ≤ (x * (x + 1))⁻¹ := h + _ = x⁻¹ - (x + 1)⁻¹ := by field_simp; ring + +theorem sum_reciprocal_squares_le_three_quarters (N : ℕ) : + (∑ d ∈ Finset.Icc 2 N, (d : ℝ)⁻¹ ^ 2) ≤ 3 / 4 := by + by_cases hN : 2 ≤ N + · have hh : ∀ N : ℕ, N ≥ 2 → (∑ d ∈ Finset.Icc 2 N, (d : ℝ)⁻¹ ^ 2) ≤ + 3 / 4 - (N : ℝ)⁻¹ := by + intro N hN + induction N, hN using Nat.le_induction with + | base => norm_num + | succ N hN ih => + rw [Finset.sum_Icc_succ_top (by omega)] + have hp : (0 : ℝ) < N := by exact_mod_cast (by omega : 0 < N) + have hs := reciprocal_square_step (N : ℝ) hp + push_cast + linarith + exact (hh N hN).trans (sub_le_self _ (by positivity)) + · have he : Finset.Icc 2 N = ∅ := Finset.Icc_eq_empty_of_lt (by omega) + norm_num [he] + +noncomputable def nonSquarefreeMultipliers (U : ℕ) : Finset ℕ := + (Finset.range (U + 1)).filter (fun u => u ≠ 0 ∧ ¬ Squarefree u) + +noncomputable def positiveMultiplesUpTo (U d : ℕ) : Finset ℕ := + (Finset.range (U + 1)).filter (fun u => u ≠ 0 ∧ d ∣ u) + +theorem nonSquarefreeMultipliers_subset (U : ℕ) : + nonSquarefreeMultipliers U ⊆ (Finset.Icc 2 U).biUnion + (fun d => positiveMultiplesUpTo U (d * d)) := by + intro u hu + obtain ⟨huU, hu0, hsq⟩ := Finset.mem_filter.mp hu + have hex : ∃ p, Nat.Prime p ∧ p * p ∣ u := by + by_contra h + apply hsq + apply Nat.squarefree_iff_prime_squarefree.mpr + intro p hp hd + exact h ⟨p, hp, hd⟩ + obtain ⟨p, hp, hd⟩ := hex + have hpu : p ≤ u := Nat.le_of_dvd (Nat.pos_of_ne_zero hu0) + (dvd_trans (dvd_mul_right p p) hd) + refine Finset.mem_biUnion.mpr ⟨p, Finset.mem_Icc.mpr ⟨hp.two_le, ?_⟩, ?_⟩ + · have := Finset.mem_range.mp huU + omega + · exact Finset.mem_filter.mpr ⟨huU, hu0, hd⟩ + +theorem nonSquarefreeMultipliers_card_le (U : ℕ) : + (nonSquarefreeMultipliers U).card ≤ ∑ d ∈ Finset.Icc 2 U, U / (d * d) := by + apply (Finset.card_le_card (nonSquarefreeMultipliers_subset U)).trans + apply Finset.card_biUnion_le.trans + apply Finset.sum_le_sum + intro d _ + exact (Nat.card_multiples' U (d * d)).le + +theorem nonSquarefreeMultipliers_real_card_le (U : ℕ) : + ((nonSquarefreeMultipliers U).card : ℝ) ≤ (3 / 4) * U := by + calc + _ ≤ ((∑ d ∈ Finset.Icc 2 U, U / (d * d) : ℕ) : ℝ) := by + exact_mod_cast nonSquarefreeMultipliers_card_le U + _ ≤ ∑ d ∈ Finset.Icc 2 U, (U : ℝ) * (d : ℝ)⁻¹ ^ 2 := by + rw [Nat.cast_sum] + apply Finset.sum_le_sum + intro d _ + simpa only [Nat.cast_mul, mul_inv_rev, div_eq_mul_inv, pow_two] using + (Nat.cast_div_le (m := U) (n := d * d) (α := ℝ)) + _ = (U : ℝ) * ∑ d ∈ Finset.Icc 2 U, (d : ℝ)⁻¹ ^ 2 := (Finset.mul_sum ..).symm + _ ≤ (U : ℝ) * (3 / 4) := mul_le_mul_of_nonneg_left + (sum_reciprocal_squares_le_three_quarters U) (Nat.cast_nonneg U) + _ = _ := mul_comm _ _ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/Statement.lean b/lean/OAI/NumberTheory/Ostmann/Supply/Statement.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ec254ac1cbede5c7833ec3aaf319344df66d641 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/Statement.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.Ostmann.Preliminaries.ResidueSupports +import OAI.NumberTheory.Ostmann.Supply.FiniteParseval + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators +open Filter + +def residueGamma (d : Decomposition) (p : ℕ) : ℝ := + if hp : p = 0 then 0 else + letI : NeZero p := ⟨hp⟩ + gamma (d.residueSupport p) + +theorem residueGamma_eq (d : Decomposition) (p : ℕ) [NeZero p] : + residueGamma d p = gamma (d.residueSupport p) := by + simp [residueGamma, NeZero.ne p] + +def residueDensityTotal (d : Decomposition) (p : ℕ) : ℝ := + if hp : p = 0 then 0 else + letI : NeZero p := ⟨hp⟩ + d.residueDensity p + +theorem residueDensityTotal_eq (d : Decomposition) (p : ℕ) [NeZero p] : + residueDensityTotal d p = density (d.residueSupport p) := by + simp [residueDensityTotal, NeZero.ne p, density, Decomposition.residueDensity] + +def nonsparsePrimes (d : Decomposition) (δ L : ℝ) : Finset ℕ := + (Finset.range (⌊Real.exp (Real.exp ((9/10:ℝ)*L))⌋₊ + 1)).filter (fun 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) + +def NonsparseSupply : Prop := + ∃ δ : ℝ, 0 < δ ∧ ∀ d : Decomposition, ∀ᶠ L : ℝ in atTop, + (3/20:ℝ)*L ≤ ∑ p ∈ nonsparsePrimes d δ L, (1:ℝ)/p + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/SubsetEnergyAmplification.lean b/lean/OAI/NumberTheory/Ostmann/Supply/SubsetEnergyAmplification.lean new file mode 100644 index 0000000000000000000000000000000000000000..878e73960cbe442a8a768d28235fa852cb07f317 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/SubsetEnergyAmplification.lean @@ -0,0 +1,63 @@ +import OAI.NumberTheory.Ostmann.Supply.PrimeSubsetSieve + +namespace OAI + +/-! # Amplifying the positive centered-energy expansion by extensions -/ + +namespace Ostmann +open scoped Classical BigOperators + +theorem subset_energy_amplification {n : ℕ} (p : Fin n → ℕ) [∀ i, NeZero (p i)] + (S : ∀ i, Finset (ZMod (p i))) (hS : ∀ i, (S i).Nonempty) + (F G : Finset (Finset (Fin n))) (E : Finset (Fin n) → ℝ) + (hE : ∀ T, 0 ≤ E T) (α C : ℝ) + (hweight : ∀ T ∈ F, α ≤ ∑ R ∈ G, + if T ⊆ R then subsetSieveCoefficient p S R T else 0) + (hsieve : (∑ R ∈ G, ∑ T ∈ R.powerset, subsetSieveCoefficient p S R T * E T) ≤ C) : + α * (∑ T ∈ F, E T) ≤ C := by + have hsmall (R : Finset (Fin n)) : + (∑ T ∈ F, if T ⊆ R then subsetSieveCoefficient p S R T * E T else 0) ≤ + ∑ T ∈ R.powerset, subsetSieveCoefficient p S R T * E T := by + rw [← Finset.sum_filter] + apply Finset.sum_le_sum_of_subset_of_nonneg + · intro T hT + exact Finset.mem_powerset.mpr (Finset.mem_filter.mp hT).2 + · intro T _ _ + exact mul_nonneg (subsetSieveCoefficient_nonneg p S R T (fun i _ => hS i)) (hE T) + calc + _ = ∑ T ∈ F, α * E T := Finset.mul_sum .. + _ ≤ ∑ T ∈ F, (∑ R ∈ G, + if T ⊆ R then subsetSieveCoefficient p S R T else 0) * E T := by + apply Finset.sum_le_sum + intro T hT + exact mul_le_mul_of_nonneg_right (hweight T hT) (hE T) + _ = ∑ R ∈ G, ∑ T ∈ F, + if T ⊆ R then subsetSieveCoefficient p S R T * E T else 0 := by + simp only [Finset.sum_mul, ite_mul, zero_mul] + exact Finset.sum_comm + _ ≤ ∑ R ∈ G, ∑ T ∈ R.powerset, subsetSieveCoefficient p S R T * E T := + Finset.sum_le_sum (fun R _ => hsmall R) + _ ≤ C := hsieve + +/-- Once the concrete extension weights are supplied, the actual centered +subset energies inherit the classical additive-sieve budget. -/ +theorem prime_subset_energy_budget (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) + (F 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) + (α : ℝ) (hweight : ∀ T ∈ F, α ≤ ∑ R ∈ G, + if T ⊆ R then subsetSieveCoefficient p S R T else 0) : + α * (∑ T ∈ F, centeredSubsetEnergy p S T A + (fun x i => ((J + (x.val : ℤ) : ℤ) : ZMod (p i)))) ≤ + ((M : ℝ) + (Q : ℝ) ^ 2) / A.card := by + exact subset_energy_amplification p S hS F G _ + (fun T => centeredSubsetEnergy_nonneg p S T A _) α _ hweight + (prime_subset_sieve_bound ls p hc S G hQ hM A hA J hprod ha) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/SubsetReducedEnergy.lean b/lean/OAI/NumberTheory/Ostmann/Supply/SubsetReducedEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..5164932d04ad75d50666cf995a47d51a68ec6fec --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/SubsetReducedEnergy.lean @@ -0,0 +1,74 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.ReducedFrequencyEnergy + +namespace OAI + +/-! # Exact positive subset expansion of the classical reduced energy -/ + +namespace Ostmann +open scoped Classical BigOperators + +theorem unitRamanujanKernel_subset {n : ℕ} (p : Fin n → ℕ) + [∀ i, Fact (p i).Prime] (R : Finset (Fin n)) [NeZero (∏ i ∈ R, p i)] + (hc : Pairwise (fun i j => (p i).Coprime (p j))) (z : ℤ) : + unitRamanujanKernel (∏ i ∈ R, p i) (z : ZMod (∏ i ∈ R, p i)) = + ∏ i ∈ R, ∑ h ∈ Finset.univ.erase (0 : ZMod (p i)), + ZMod.stdAddChar (h * (z : ZMod (p i))) := by + let : NeZero (∏ i : R, p i) := ⟨by + rw [Finset.prod_coe_sort] + exact NeZero.ne _⟩ + have hcR : Pairwise (fun i j : R => (p i).Coprime (p j)) := by + intro i j hij + exact hc (fun he => hij (Subtype.ext he)) + have hh := unitRamanujanKernel_product (fun i : R => p i) hcR z + simp_rw [unitRamanujanKernel_prime] at hh + have hq := Finset.prod_coe_sort R p + have hr := Finset.prod_coe_sort R (fun i => + ∑ h ∈ Finset.univ.erase (0 : ZMod (p i)), ZMod.stdAddChar (h * (z : ZMod (p i)))) + rw [unitRamanujanKernel_int_congr hq z, hr] at hh + exact hh + +noncomputable def subsetSieveCoefficient {n : ℕ} (p : Fin n → ℕ) + (S : ∀ i, Finset (ZMod (p i))) (R T : Finset (Fin n)) : ℝ := + (∏ i ∈ T, (p i : ℝ)) * (∏ i ∈ R \ T, ((p i : ℝ) / (S i).card - 1)) + +theorem subsetSieveCoefficient_nonneg {n : ℕ} (p : Fin n → ℕ) + [∀ i, NeZero (p i)] + (S : ∀ i, Finset (ZMod (p i))) (R T : Finset (Fin n)) + (hS : ∀ i ∈ R, (S i).Nonempty) : + 0 ≤ subsetSieveCoefficient p S R T := by + apply mul_nonneg + · exact Finset.prod_nonneg (fun i _ => Nat.cast_nonneg _) + · apply Finset.prod_nonneg + intro i hi + have hcard : (0 : ℝ) < (S i).card := by + exact_mod_cast Finset.card_pos.mpr (hS i (Finset.mem_sdiff.mp hi).1) + have hle : ((S i).card : ℝ) ≤ p i := by + exact_mod_cast (Finset.card_le_univ (S i)).trans_eq (ZMod.card (p i)) + exact sub_nonneg.mpr ((le_div_iff₀ hcard).mpr (by simpa using hle)) + +theorem subset_reduced_energy_expansion {n : ℕ} (p : Fin n → ℕ) + [∀ i, Fact (p i).Prime] (S : ∀ i, Finset (ZMod (p i))) + (R : Finset (Fin n)) [NeZero (∏ i ∈ R, p i)] + (hc : Pairwise (fun i j => (p i).Coprime (p j))) {ι : Type*} + (A : Finset ι) (a : ι → ℤ) + (ha : ∀ x ∈ A, ∀ i ∈ R, (a x : ZMod (p i)) ∈ S i) : + unitFrequencyEnergy A (fun x => (a x : ZMod (∏ i ∈ R, p i))) = + ∑ T ∈ R.powerset, subsetSieveCoefficient p S R T * + centeredSubsetEnergy p S T A (fun x i => (a x : ZMod (p i))) := by + apply Complex.ofReal_injective + rw [unitFrequencyEnergy_kernel] + have hk (x y : ι) : + unitRamanujanKernel (∏ i ∈ R, p i) + ((a x : ZMod (∏ i ∈ R, p i)) - (a y : ZMod (∏ i ∈ R, p i))) = + ∏ i ∈ R, ∑ h ∈ Finset.univ.erase (0 : ZMod (p i)), + ZMod.stdAddChar (h * ((a x : ZMod (p i)) - (a y : ZMod (p i)))) := by + simpa only [Int.cast_sub] using unitRamanujanKernel_subset p R hc (a x - a y) + simp_rw [hk] + rw [tensorRamanujan_energy_expansion p S R A (fun x i => (a x : ZMod (p i))) ha] + simp only [subsetSieveCoefficient, Complex.ofReal_sum, Complex.ofReal_mul, + Complex.ofReal_prod, Complex.ofReal_sub, Complex.ofReal_div, Complex.ofReal_natCast, + Complex.ofReal_one, mul_assoc] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/SupplyRadiusBounds.lean b/lean/OAI/NumberTheory/Ostmann/Supply/SupplyRadiusBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..a88df3de0f8b8108db415ee315186e10ccbde2b1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/SupplyRadiusBounds.lean @@ -0,0 +1,57 @@ +import OAI.NumberTheory.Ostmann.Supply.RetainedBandScales + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open Filter + +theorem supplyRadius_loglog_le {L : ℝ} (hL : 1≤L) : + Real.log (Real.log (supplyRadius L:ℝ))≤L := by + have he : (2:ℝ)≤Real.exp L := by have := Real.add_one_le_exp L; linarith + have ha : (1:ℝ)≤Real.exp L/2 := by linarith + have hexp : (2:ℝ)≤Real.exp (Real.exp L/2) := by + have := Real.add_one_le_exp (Real.exp L/2) + linarith + have hceil := Nat.ceil_lt_add_one (Real.exp_pos (Real.exp L/2)).le + have hR : (supplyRadius L:ℝ)≤Real.exp (Real.exp L) := by + unfold supplyRadius + have hpow : Real.exp (Real.exp L/2)^2=Real.exp (Real.exp L) := by + rw [←Real.exp_nat_mul] + congr 1 + push_cast + ring + rw [←hpow] + nlinarith + have hR0 : (0:ℝ) (p i).Coprime (p j))) (hpQ : ∀ i, p i ≤ Q) + (hcover : ∀ q, q.Prime → q ≤ Q → ∃ i, p i = q) + (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) + (R : ℝ) (hR : 0 < R) + (hP : (∑ q ∈ Finset.univ.image p, + |Real.log (((Finset.range q \ tailSupport A N q).card : ℝ) / + (tailSupport A N q).card)| / q) ≤ R / 16) : + let S := fun i => tailDensityMask A N (p (e i)) + let α := (Q : ℝ) / 16 * Real.exp (-R) + let D := (X + 1 : ℝ) + (Q : ℝ) ^ 2 + (α * countingVectorNorm (lowModeVector K + (averagedCoordinates (positiveSummandTail A lo X) + (fun x => tensorPointCoordinates (fun i => p (e i)) S + (fun i => (x : ZMod (p (e i))))))) ^ 2 ≤ D / (summandTail A lo X).card) ∧ + (α * countingVectorNorm (lowModeVector K + (averagedCoordinates (negativeSummandTail B lo X) + (fun x => tensorPointCoordinates (fun i => p (e i)) (fun i => Finset.univ \ S i) + (fun i => (x : ZMod (p (e i))))))) ^ 2 ≤ D / (summandTail B lo X).card) := by + have hp (i : Fin n) : (p i).Prime := Fact.out + have hk : ∀ q ∈ Finset.univ.image p, + 0 < ((Finset.range q \ tailSupport A N q).card : ℝ) / (tailSupport A N q).card := by + intro q hq + obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hq + have ht := Finset.card_pos.mpr + (tailSupport_complement_nonempty hB (hp i).pos (hdis _ (hp i))) + have hs := Finset.card_pos.mpr (tailSupport_nonempty hA N _ (hp i).pos) + exact div_pos (by exact_mod_cast ht) (by exact_mod_cast hs) + have hb := integer_complementary_energy_budgets ls p hc + (fun i => tailDensityMask A N (p i)) + (fun i => tailDensityMask_nonempty hA N _ (hp i).pos) + (fun i => tailDensityMask_card_lt hB N _ (hp i).pos (hdis _ (hp i))) + (fun q => ((Finset.range q \ tailSupport A N q).card : ℝ) / (tailSupport A N q).card) + hk (fun i => (tailDensityMask_ratio hA N _ (hp i).pos).symm) + hQ (show 1 ≤ X + 1 by omega) hcover + (positiveSummandTail A lo X) (negativeSummandTail B lo X) hAt hBt 0 (-(X : ℤ)) + (fun a ha => ?_) (fun b hb => ?_) + (fun a ha i => positiveSummandTail_mem_mask A N lo X _ (hp i).pos (by have := hpQ i; omega) ha) + (fun b hb i => negativeSummandTail_mem_mask_complement N lo X _ (hp i).pos + (hdis _ (hp i)) (by have := hpQ i; omega) hb) + e K hprod hsmall R hR hP + · simpa only [positiveSummandTail_card, negativeSummandTail_card, Nat.cast_add, + Nat.cast_one] using hb + · have hh := positiveSummandTail_bounds A lo X ha + push_cast + omega + · have hh := negativeSummandTail_bounds B lo X hb + push_cast + omega + +theorem summandTail_pair_sum (A B : Set ℕ) (lo X : ℕ) (W : ℤ → ℝ) : + (∑ a ∈ positiveSummandTail A lo X, ∑ b ∈ negativeSummandTail B lo X, W (a - b)) = + ∑ a ∈ summandTail A lo X, ∑ b ∈ summandTail B lo X, W ((a + b : ℕ) : ℤ) := by + unfold positiveSummandTail negativeSummandTail + rw [Finset.sum_image] + · apply Finset.sum_congr rfl + intro a ha + rw [Finset.sum_image] + · apply Finset.sum_congr rfl + intro b hb + congr 1 + push_cast + ring + · intro a ha b hb hab + exact_mod_cast neg_injective hab + · intro a ha b hb hab + change (a : ℤ) = (b : ℤ) at hab + exact_mod_cast hab + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TailSieveParameters.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TailSieveParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..152a9208f448d150a362ecac32df82b9bf411124 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TailSieveParameters.lean @@ -0,0 +1,149 @@ +import OAI.NumberTheory.Ostmann.Preliminaries.TailLogImbalance +import OAI.NumberTheory.Ostmann.Supply.SieveBudgetParameters +import OAI.NumberTheory.Ostmann.Characters.SparseBandMass + +namespace OAI + +/-! # The actual tail budget at the square-root sieve scale + +The auxiliary collision estimate may be applied at `Y = X²`: its supports +are the same fixed infinite-tail residue sets. This choice keeps the endpoint +integral when `X` is integral and covers every prime up to `sqrt X`. +-/ + +namespace Ostmann +open Filter +open scoped Classical BigOperators + +theorem tailDefectBudget_doubled_exp (a C L : ℝ) : + tailDefectBudget a C (2 * Real.exp L) = + 20 * L + (24 * Real.log 2 + 4 * C + 2 * Real.log 4 / a) := by + unfold tailDefectBudget + rw [Real.log_mul (by norm_num) (Real.exp_ne_zero _), Real.log_exp] + ring + +theorem eventual_sqrt_cutoff_le_tail : + ∀ᶠ L : ℝ in atTop, + ⌊Real.exp (Real.exp L / 2)⌋₊ ≤ tailCollisionCutoff (2 * Real.exp L) := by + have hsmall := eventual_affine_log_le_rpow 5 (Real.log 2) (1 / 6) 1 + (by norm_num) (by norm_num) (by norm_num) + simp only [Real.rpow_one] at hsmall + have hlim : Tendsto (fun L : ℝ => 2 * Real.exp L) atTop atTop := + Real.tendsto_exp_atTop.const_mul_atTop (by norm_num) + filter_upwards [hlim.eventually (eventual_tailCollisionCutoff 0), + hlim.eventually hsmall] with L hcut hsmall + have hb := tailCollisionCutoff_bounds (2 * Real.exp L) hcut.1 hcut.2.1 + have hQ : (0 : ℝ) < tailCollisionCutoff (2 * Real.exp L) := by + exact_mod_cast hb.1 + have hlog : Real.exp L / 2 ≤ Real.log (tailCollisionCutoff (2 * Real.exp L) : ℝ) := by + linarith [hb.2.2, Real.exp_pos L] + have he := (Real.exp_le_exp.mpr hlog) + rw [Real.exp_log hQ] at he + exact (Nat.floor_le_floor he).trans_eq (Nat.floor_natCast _) + +theorem logLogPrimeBand_subset_sqrt_cutoff (L : ℝ) (hL : 10 ≤ L) : + logLogPrimeBand L ⊆ Nat.primesLE ⌊Real.exp (Real.exp L / 2)⌋₊ := by + intro p hp + obtain ⟨hpp, _, hlog⟩ := logLogPrimeBand_mem hp + have hhalf : Real.exp ((9 / 10 : ℝ) * L) ≤ Real.exp L / 2 := by + have htwo : (2 : ℝ) ≤ Real.exp ((1 / 10 : ℝ) * L) := by + linarith [Real.add_one_le_exp ((1 / 10 : ℝ) * L)] + have hm := mul_le_mul_of_nonneg_left htwo (Real.exp_nonneg ((9 / 10 : ℝ) * L)) + rw [← Real.exp_add] at hm + have hid : (9 / 10 : ℝ) * L + (1 / 10 : ℝ) * L = L := by ring + rw [hid] at hm + linarith + refine Nat.mem_primesLE.mpr ⟨Nat.le_floor ?_, hpp⟩ + exact (Real.log_le_iff_le_exp (by exact_mod_cast hpp.pos)).mp (hlog.trans hhalf) + +theorem EventuallyPrimeSumset.sqrt_scale_logarithmic_imbalance_with_disjoint + (hsize : PublishedSummandSizeBound) {A B : Set ℕ} + (h : EventuallyPrimeSumset A B) (hA : A.Infinite) (hB : B.Infinite) + (C : ℝ) (hM : MertensEstimate C) : + ∃ N : ℕ, (∀ p, p.Prime → Disjoint (tailResidues A N p) (negTailResidues B N p)) ∧ + ∃ a : ℝ, 0 < a ∧ ∀ᶠ L : ℝ in atTop, + ∀ X : ℕ, (X : ℝ) = Real.exp (Real.exp L) → + ∀ P : Finset ℕ, P ⊆ Nat.primesLE ⌊Real.exp (Real.exp L / 2)⌋₊ → + (∑ p ∈ P, |Real.log + (((Finset.range p \ tailSupport A N p).card : ℝ) / (tailSupport A N p).card)| / p) ^ 2 ≤ + 4 * (20 * L + (24 * Real.log 2 + 4 * C + 2 * Real.log 4 / a)) * + primeReciprocalLogConstant C := by + obtain ⟨N, hN, a, ha, hbudget⟩ := h.tail_logarithmic_imbalance_with_disjoint hsize hA hB C hM + refine ⟨N, hN, a, ha, ?_⟩ + have hlim : Tendsto (fun L : ℝ => 2 * Real.exp L) atTop atTop := + Real.tendsto_exp_atTop.const_mul_atTop (by norm_num) + filter_upwards [hlim.eventually hbudget, eventual_sqrt_cutoff_le_tail] with L hb hcut + intro X hX P hP + have hXsq : ((X ^ 2 : ℕ) : ℝ) = Real.exp (2 * Real.exp L) := by + rw [Nat.cast_pow, hX, ← Real.exp_nat_mul] + norm_num + have hsub : P ⊆ Nat.primesLE (tailCollisionCutoff (2 * Real.exp L)) := by + intro p hp + exact Nat.mem_primesLE.mpr ⟨(Nat.le_of_mem_primesLE (hP hp)).trans hcut, + Nat.prime_of_mem_primesLE (hP hp)⟩ + simpa only [tailDefectBudget_doubled_exp] using hb (X ^ 2) hXsq P hsub + +theorem eventual_affine_square_budget (d e : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ W : ℝ, W ^ 2 ≤ d * L + e → + W ≤ L ^ (3 / 4 : ℝ) / 16 := by + filter_upwards [eventual_square_budget_le_three_quarters (|d| + |e|), + eventually_ge_atTop (1 : ℝ)] with L hnum hL W hW + apply hnum W + have hd := mul_le_mul_of_nonneg_right (le_abs_self d) (by linarith : 0 ≤ L) + have he := mul_le_mul_of_nonneg_left hL (abs_nonneg e) + linarith [le_abs_self e] + +/-- The exact `L^(3/4)/16` budget for the multiplier count +on the infinite-tail residue supports. -/ +theorem EventuallyPrimeSumset.sqrt_scale_sieve_log_budget_with_disjoint + (hsize : PublishedSummandSizeBound) {A B : Set ℕ} + (h : EventuallyPrimeSumset A B) (hA : A.Infinite) (hB : B.Infinite) + (C : ℝ) (hM : MertensEstimate C) : + ∃ N : ℕ, (∀ p, p.Prime → Disjoint (tailResidues A N p) (negTailResidues B N p)) ∧ + ∀ᶠ L : ℝ in atTop, + ∀ X : ℕ, (X : ℝ) = Real.exp (Real.exp L) → + ∀ P : Finset ℕ, P ⊆ Nat.primesLE ⌊Real.exp (Real.exp L / 2)⌋₊ → + (∑ p ∈ P, |Real.log + (((Finset.range p \ tailSupport A N p).card : ℝ) / (tailSupport A N p).card)| / p) ≤ + L ^ (3 / 4 : ℝ) / 16 := by + obtain ⟨N, hN, a, _, hb⟩ := h.sqrt_scale_logarithmic_imbalance_with_disjoint hsize hA hB C hM + let d := 80 * primeReciprocalLogConstant C + let e := 4 * (24 * Real.log 2 + 4 * C + 2 * Real.log 4 / a) * + primeReciprocalLogConstant C + refine ⟨N, hN, ?_⟩ + filter_upwards [hb, eventual_affine_square_budget d e] with L hb hnum X hX P hP + apply hnum + convert hb X hX P hP using 1 + dsimp [d, e] + ring + +theorem EventuallyPrimeSumset.sqrt_scale_logarithmic_imbalance + (hsize : PublishedSummandSizeBound) {A B : Set ℕ} + (h : EventuallyPrimeSumset A B) (hA : A.Infinite) (hB : B.Infinite) + (C : ℝ) (hM : MertensEstimate C) : + ∃ N : ℕ, ∃ a : ℝ, 0 < a ∧ ∀ᶠ L : ℝ in atTop, + ∀ X : ℕ, (X : ℝ) = Real.exp (Real.exp L) → + ∀ P : Finset ℕ, P ⊆ Nat.primesLE ⌊Real.exp (Real.exp L / 2)⌋₊ → + (∑ p ∈ P, |Real.log + (((Finset.range p \ tailSupport A N p).card : ℝ) / (tailSupport A N p).card)| / p) ^ 2 ≤ + 4 * (20 * L + (24 * Real.log 2 + 4 * C + 2 * Real.log 4 / a)) * + primeReciprocalLogConstant C := by + obtain ⟨N, _, a, ha, hb⟩ := h.sqrt_scale_logarithmic_imbalance_with_disjoint hsize hA hB C hM + exact ⟨N, a, ha, hb⟩ + +theorem EventuallyPrimeSumset.sqrt_scale_sieve_log_budget + (hsize : PublishedSummandSizeBound) {A B : Set ℕ} + (h : EventuallyPrimeSumset A B) (hA : A.Infinite) (hB : B.Infinite) + (C : ℝ) (hM : MertensEstimate C) : + ∃ N : ℕ, ∀ᶠ L : ℝ in atTop, + ∀ X : ℕ, (X : ℝ) = Real.exp (Real.exp L) → + ∀ P : Finset ℕ, P ⊆ Nat.primesLE ⌊Real.exp (Real.exp L / 2)⌋₊ → + (∑ p ∈ P, |Real.log + (((Finset.range p \ tailSupport A N p).card : ℝ) / (tailSupport A N p).card)| / p) ≤ + L ^ (3 / 4 : ℝ) / 16 := by + obtain ⟨N, _, hb⟩ := h.sqrt_scale_sieve_log_budget_with_disjoint hsize hA hB C hM + exact ⟨N, hb⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TailSparsePairSum.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TailSparsePairSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..a60532916c6da75d87351c1d0128bdb5834c108d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TailSparsePairSum.lean @@ -0,0 +1,32 @@ +import OAI.NumberTheory.Ostmann.Supply.TailSieveEnergy + +namespace OAI + +/-! # The natural-sum and reflected-integer forms of the same sparse weight -/ +namespace Ostmann +open scoped Classical BigOperators + +theorem summandTail_sparse_pair_sum {n : ℕ} (p : Fin n → ℕ) [∀ i, NeZero (p i)] + (S : ∀ i, Finset (ZMod (p i))) (K : ℕ) (A B : Set ℕ) (lo X : ℕ) : + (∑ a ∈ positiveSummandTail A lo X, ∑ b ∈ negativeSummandTail B lo X, + sparseSubsetWeight p S K (fun i => (a : ZMod (p i)) - (b : ZMod (p i)))) = + ∑ a ∈ summandTail A lo X, ∑ b ∈ summandTail B lo X, + sparseSubsetWeight p S K (fun i => ((a + b : ℕ) : ZMod (p i))) := by + have hh := summandTail_pair_sum A B lo X + (fun z => sparseSubsetWeight p S K (fun i => (z : ZMod (p i)))) + simpa only [Int.cast_sub, Int.cast_natCast] using hh + +theorem summandTail_sparse_coverage {n : ℕ} (p : Fin n → ℕ) [∀ i, NeZero (p i)] + (S : ∀ i, Finset (ZMod (p i))) (K : ℕ) (A B : Set ℕ) (lo X : ℕ) (c L : ℝ) + (hlog : Real.log (X : ℝ) = L) + (hc : c ≤ Real.log X * ∑ a ∈ summandTail A lo X, ∑ b ∈ summandTail B lo X, + sparseSubsetWeight p S K (fun i => ((a + b : ℕ) : ZMod (p i)))) : + c ≤ L * ∑ a ∈ positiveSummandTail A lo X, ∑ b ∈ negativeSummandTail B lo X, + sparseSubsetWeight p S K (fun i => (a : ZMod (p i)) - (b : ZMod (p i))) := by + have he := congrArg (fun x : ℝ => L * x) (summandTail_sparse_pair_sum p S K A B lo X) + rw [hlog] at hc + exact hc.trans_eq he.symm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TensorCoordinates.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TensorCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..291a4a5c8a87c0ab82bf1b4f363c65e9f0581545 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TensorCoordinates.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.Supply.CenteredProjection + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {ι : Type*} [Fintype ι] [DecidableEq ι] +variable {β : ι → Type*} [∀ i, Fintype (β i)] + +def tensorVector (v : ∀ i, EuclideanSpace ℂ (β i)) : + EuclideanSpace ℂ (∀ i, β i) := + WithLp.toLp 2 (fun x => ∏ i, v i (x i)) + +omit [DecidableEq ι] [∀ i, Fintype (β i)] in +@[simp] theorem tensorVector_apply (v : ∀ i, EuclideanSpace ℂ (β i)) (x : ∀ i, β i) : + tensorVector v x = ∏ i, v i (x i) := rfl + +theorem tensorVector_inner (v w : ∀ i, EuclideanSpace ℂ (β i)) : + inner ℂ (tensorVector v) (tensorVector w) = ∏ i, inner ℂ (v i) (w i) := by + simp only [PiLp.inner_apply, RCLike.inner_apply, tensorVector_apply, map_prod, + ← Finset.prod_mul_distrib] + exact (Fintype.prod_sum (fun i j => w i j * conj (v i j))).symm + +variable {α : Type*} + +def meanTensor (A : Finset α) (v : α → ∀ i, EuclideanSpace ℂ (β i)) : + EuclideanSpace ℂ (∀ i, β i) := + (A.card : ℂ)⁻¹ • ∑ a ∈ A, tensorVector (v a) + +def tensorEnergy (A : Finset α) (v : α → ∀ i, EuclideanSpace ℂ (β i)) : ℝ := + ‖meanTensor A v‖^2 + +theorem tensorEnergy_nonneg (A : Finset α) (v : α → ∀ i, EuclideanSpace ℂ (β i)) : + 0 ≤ tensorEnergy A v := sq_nonneg _ + +theorem tensorGram_sum (A : Finset α) (v : α → ∀ i, EuclideanSpace ℂ (β i)) : + (∑ a ∈ A, ∑ b ∈ A, ∏ i, inner ℂ (v a i) (v b i)) = + (‖∑ a ∈ A, tensorVector (v a)‖^2 : ℝ) := by + simp_rw [← tensorVector_inner] + simp_rw [← inner_sum] + rw [← sum_inner] + rw [PiLp.inner_apply, PiLp.norm_sq_eq_of_L2] + simp only [RCLike.inner_apply, Complex.mul_conj', Complex.ofReal_sum, Complex.ofReal_pow] + +theorem tensorGram_nonneg (A : Finset α) (v : α → ∀ i, EuclideanSpace ℂ (β i)) : + 0 ≤ (∑ a ∈ A, ∑ b ∈ A, ∏ i, inner ℂ (v a i) (v b i)).re := by + rw [tensorGram_sum] + exact sq_nonneg _ + +theorem tensorEnergy_eq_gram (A : Finset α) + (v : α → ∀ i, EuclideanSpace ℂ (β i)) : + (tensorEnergy A v : ℂ) = + (A.card : ℂ)⁻¹^2 * ∑ a ∈ A, ∑ b ∈ A, ∏ i, inner ℂ (v a i) (v b i) := by + rw [tensorGram_sum] + simp only [tensorEnergy, meanTensor, norm_smul, mul_pow, norm_inv, + Complex.norm_natCast, inv_pow, Complex.ofReal_mul, Complex.ofReal_pow, + Complex.ofReal_inv, Complex.ofReal_natCast] + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TensorKernel.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TensorKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..251833f384d04b37d2f7e75cc6a18fff2727ac96 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TensorKernel.lean @@ -0,0 +1,84 @@ +import OAI.NumberTheory.Ostmann.Supply.TensorCoordinates + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {ι : Type*} [DecidableEq ι] +variable {β : ι → Type*} [∀ i, Fintype (β i)] +variable {α : Type*} + +def subsetRawEnergy (A : Finset α) (v : α → ∀ i, EuclideanSpace ℂ (β i)) + (t : Finset ι) : ℝ := + ‖∑ a ∈ A, tensorVector (fun i : t => v a i)‖^2 + +theorem subsetRawEnergy_nonneg (A : Finset α) + (v : α → ∀ i, EuclideanSpace ℂ (β i)) (t : Finset ι) : + 0 ≤ subsetRawEnergy A v t := sq_nonneg _ + +theorem subsetRawEnergy_eq (A : Finset α) + (v : α → ∀ i, EuclideanSpace ℂ (β i)) (t : Finset ι) : + (subsetRawEnergy A v t : ℂ) = + ∑ a ∈ A, ∑ b ∈ A, ∏ i ∈ t, inner ℂ (v a i) (v b i) := by + calc + (subsetRawEnergy A v t : ℂ) = + ∑ a ∈ A, ∑ b ∈ A, ∏ i : t, inner ℂ (v a i) (v b i) := + (tensorGram_sum A (fun a => fun i : t => v a i)).symm + _ = _ := by + apply Finset.sum_congr rfl + intro a ha + apply Finset.sum_congr rfl + intro b hb + exact Finset.prod_coe_sort t (fun i => inner ℂ (v a i) (v b i)) + +theorem subsetRawEnergy_empty (A : Finset α) + (v : α → ∀ i, EuclideanSpace ℂ (β i)) : + subsetRawEnergy A v ∅ = (A.card : ℝ)^2 := by + apply Complex.ofReal_injective + rw [subsetRawEnergy_eq] + simp + ring + +variable [Fintype ι] + +theorem tensorKernel_expansion (A : Finset α) + (v : α → ∀ i, EuclideanSpace ℂ (β i)) (κ w : ι → ℝ) : + (∑ a ∈ A, ∑ b ∈ A, + ∏ i, ((w i : ℂ) * inner ℂ (v a i) (v b i) + κ i)) = + ∑ t : Finset ι, ((∏ i ∈ t, w i) * ∏ i ∈ tᶜ, κ i : ℝ) * subsetRawEnergy A v t := by + push_cast + simp_rw [Fintype.prod_add] + simp_rw [Finset.sum_comm (s := A) (t := Finset.univ)] + apply Finset.sum_congr rfl + intro t ht + simp only [subsetRawEnergy_eq, Finset.mul_sum, Finset.prod_mul_distrib] + apply Finset.sum_congr rfl + intro a ha + apply Finset.sum_congr rfl + intro b hb + ring + +theorem tensorKernel_lower (A : Finset α) + (v : α → ∀ i, EuclideanSpace ℂ (β i)) (κ w : ι → ℝ) + (hκ : ∀ i, 0 ≤ κ i) (hw : ∀ i, 0 ≤ w i) : + (A.card : ℝ)^2 * (∏ i, κ i) ≤ + (∑ a ∈ A, ∑ b ∈ A, + ∏ i, ((w i : ℂ) * inner ℂ (v a i) (v b i) + κ i)).re := by + rw [tensorKernel_expansion] + simp only [Complex.ofReal_re] + have hn (t : Finset ι) : + 0 ≤ ((∏ i ∈ t, w i) * ∏ i ∈ tᶜ, κ i) * subsetRawEnergy A v t := by + exact mul_nonneg (mul_nonneg (Finset.prod_nonneg fun i _ => hw i) + (Finset.prod_nonneg fun i _ => hκ i)) (subsetRawEnergy_nonneg A v t) + have h := Finset.single_le_sum (s := Finset.univ) + (f := fun t : Finset ι => ((∏ i ∈ t, w i) * ∏ i ∈ tᶜ, κ i) * subsetRawEnergy A v t) + (fun t _ => hn t) (Finset.mem_univ (∅ : Finset ι)) + simpa only [Finset.prod_empty, one_mul, Finset.compl_empty, + subsetRawEnergy_empty, mul_one, mul_comm] using h + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeBudget.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeBudget.lean new file mode 100644 index 0000000000000000000000000000000000000000..db5eb067d1ab8c9de1b80549c63f1e04f951b5d6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeBudget.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.Supply.CenteredBudget +import OAI.NumberTheory.Ostmann.Supply.TensorModeEnergy + +namespace OAI + +noncomputable section +namespace Ostmann.Supply.TensorModes +open TensorOperators +open Finset +open scoped BigOperators + +theorem indexPrimeProduct_injOn (p : ℕ → ℕ) (n : ℕ) + (hp : ∀ i < n, (p i).Prime) (hinj : Set.InjOn p (range n : Set ℕ)) : + Set.InjOn (fun s : Finset ℕ => ∏ i ∈ s, p i) ((range n).powerset : Set (Finset ℕ)) := by + have hpf (s : Finset ℕ) (hs : s ⊆ range n) : + (∏ i ∈ s, p i).primeFactors = s.image p := by + have hprod : (∏ q ∈ s.image p, q) = ∏ i ∈ s, p i := + prod_image (f := fun q : ℕ => q) (fun i hi j hj hij => hinj (hs hi) (hs hj) hij) + rw [← hprod] + apply Nat.primeFactors_prod + intro q hq + obtain ⟨i, hi, rfl⟩ := mem_image.mp hq + exact hp i (mem_range.mp (hs hi)) + intro s hs t ht hprod + change (∏ i ∈ s, p i) = (∏ i ∈ t, p i) at hprod + have hss := mem_powerset.mp hs + have htt := mem_powerset.mp ht + have himage : s.image p = t.image p := by rw [← hpf s hss, ← hpf t htt, hprod] + apply Finset.Subset.antisymm + · intro i hi + have hip : p i ∈ t.image p := by rw [← himage]; exact mem_image_of_mem p hi + obtain ⟨j, hj, hji⟩ := mem_image.mp hip + have he : j = i := hinj (htt hj) (hss hi) hji + simpa only [he] using hj + · intro i hi + have hip : p i ∈ s.image p := by rw [himage]; exact mem_image_of_mem p hi + obtain ⟨j, hj, hji⟩ := mem_image.mp hip + have he : j = i := hinj (hss hj) (htt hi) hji + simpa only [he] using hj + +def retainedProducts (p : ℕ → ℕ) (n K : ℕ) : Finset ℕ := + (retainedModes n K).image (fun s => ∏ i ∈ s, p i) + +theorem norm_residue_lowModes_sq_eq_product_sum (A : Finset ℕ) (p : ℕ → ℕ) + [∀ i, NeZero (p i)] (S : ∀ p : ℕ, Finset (ZMod p)) (n K : ℕ) + (hp : ∀ i < n, (p i).Prime) (hinj : Set.InjOn p (range n : Set ℕ)) : + ‖lowModes (residueCenteredFamily p S) n K + (empiricalTensor A (residueCenteredVector p S) n)‖^2 = + ∑ t ∈ retainedProducts p n K, centeredEnergy A S t := by + rw [norm_residue_lowModes_sq A p S n K hp hinj] + symm + exact sum_image (fun s hs t ht h => indexPrimeProduct_injOn p n hp hinj + (mem_filter.mp hs).1 (mem_filter.mp ht).1 h) + +theorem norm_residue_lowModes_sq_le_sum (A : Finset ℕ) (p : ℕ → ℕ) + [∀ i, NeZero (p i)] (S : ∀ p : ℕ, Finset (ZMod p)) (n K : ℕ) + (hp : ∀ i < n, (p i).Prime) (hinj : Set.InjOn p (range n : Set ℕ)) + (T : Finset ℕ) (hT : retainedProducts p n K ⊆ T) : + ‖lowModes (residueCenteredFamily p S) n K + (empiricalTensor A (residueCenteredVector p S) n)‖^2 ≤ + ∑ t ∈ T, centeredEnergy A S t := by + rw [norm_residue_lowModes_sq_eq_product_sum A p S n K hp hinj] + exact sum_le_sum_of_subset_of_nonneg hT (fun t ht hnot => centeredEnergy_nonneg A S t) + +theorem norm_residue_lowModes_sq_le_budget (A : Finset ℕ) (hAn : A.Nonempty) + (p : ℕ → ℕ) [∀ i, NeZero (p i)] (S : ∀ p : ℕ, Finset (ZMod p)) (n K R : ℕ) + (hp : ∀ i < n, (p i).Prime) (hinj : Set.InjOn p (range n : Set ℕ)) + (hR : 0 < R) (hA : ∀ a ∈ A, a ≤ R^2) + (hS : ∀ a ∈ A, ∀ p, p.Prime → p ≤ R → (a : ZMod p) ∈ S p) + (hpos : ∀ p, p.Prime → p ≤ R → 0 < supportRatio S p) + (T : Finset ℕ) (hcontain : retainedProducts p n K ⊆ T) + (hT : ∀ t ∈ T, Squarefree t ∧ t ≤ R) {B : ℝ} (hB : 0 < B) + (hcop : ∀ t ∈ T, ∑ p ∈ t.primeFactors, (1 : ℝ)/p ≤ 1/16) + (hmean : ∑ p ∈ CompletionCounting.primesUpTo R, |Real.log (supportRatio S p)|/p ≤ B/16) : + ‖lowModes (residueCenteredFamily p S) n K + (empiricalTensor A (residueCenteredVector p S) n)‖^2 ≤ + 1536 * (R : ℝ)/(A.card : ℝ)*Real.exp B := + (norm_residue_lowModes_sq_le_sum A p S n K hp hinj T hcontain).trans + (centered_energy_sum_le A hAn S R hR hA hS hpos T hT hB hcop hmean) + +end Ostmann.Supply.TensorModes + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeDecomposition.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeDecomposition.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8a866bacff49136c63d97b12f8839b05d9537e8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeDecomposition.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.Supply.TensorModes + +namespace OAI + +noncomputable section +namespace Ostmann.Supply.TensorModes +open TensorOperators +open Finset +open scoped TensorProduct BigOperators + +@[simp] theorem exactMode_succ (E : ℕ → FiniteHilbertSpace) (n : ℕ) (s : Finset ℕ) : + exactMode E (n+1) s = TensorProduct.mapL (exactMode E n s) + (if n ∈ s then centeredPart (E n) else scalarPart (E n)) := rfl + +@[simp] theorem exactMode_insert_top (E : ℕ → FiniteHilbertSpace) (n : ℕ) (s : Finset ℕ) : + exactMode E n (insert n s) = exactMode E n s := by + apply tensorOp_congr + intro i hi + simp [show i ≠ n by omega] + +@[simp] theorem exactMode_erase_top (E : ℕ → FiniteHilbertSpace) (n : ℕ) (s : Finset ℕ) : + exactMode E n (s.erase n) = exactMode E n s := by + apply tensorOp_congr + intro i hi + simp [show i ≠ n by omega] + +theorem sum_all_exactModes (E : ℕ → FiniteHilbertSpace) (n : ℕ) : + (∑ s ∈ (range n).powerset, exactMode E n s) = 1 := by + induction n with + | zero => + change (∑ s ∈ ({∅} : Finset (Finset ℕ)), (1 : ℂ →L[ℂ] ℂ)) = 1 + rw [sum_singleton] + | succ n ih => + rw [range_add_one, sum_powerset_insert (by simp : n ∉ range n)] + have hfirst : (∑ s ∈ (range n).powerset, exactMode E (n+1) s) = + TensorProduct.mapL (∑ s ∈ (range n).powerset, exactMode E n s) (scalarPart (E n)) := by + rw [mapL_sum_left] + apply sum_congr rfl + intro s hs + have hns : n ∉ s := fun hn => (by have := mem_range.mp (mem_powerset.mp hs hn); omega) + simp only [exactMode_succ, ite_eq_right hns] + rfl + have hsecond : (∑ s ∈ (range n).powerset, exactMode E (n+1) (insert n s)) = + TensorProduct.mapL (∑ s ∈ (range n).powerset, exactMode E n s) (centeredPart (E n)) := by + rw [mapL_sum_left] + apply sum_congr rfl + intro s hs + simp only [exactMode_succ, exactMode_insert_top, mem_insert_self, ite_true] + rfl + rw [hfirst, hsecond] + change TensorProduct.mapL (∑ s ∈ (range n).powerset, exactMode E n s) (scalarPart (E n)) + + TensorProduct.mapL (∑ s ∈ (range n).powerset, exactMode E n s) (centeredPart (E n)) = + (ContinuousLinearMap.id ℂ + (tensorSpace (fun i => augmentedSpace (E i)) n ⊗[ℂ] augmentedSpace (E n))) + rw [← TensorProduct.mapL_add_right, ih, scalar_add_centered] + exact TensorProduct.mapL_id_id + +theorem lowModes_comp_of_high_zero {E F : ℕ → FiniteHilbertSpace} (n K : ℕ) + (T : tensorSpace (fun i => augmentedSpace (E i)) n →L[ℂ] + tensorSpace (fun i => augmentedSpace (F i)) n) + (hhigh : ∀ s ⊆ range n, K < s.card → (exactMode F n s).comp T = 0) : + (lowModes F n K).comp T = T := by + ext x + change lowModes F n K (T x) = T x + have hfull : (∑ s ∈ (range n).powerset, exactMode F n s (T x)) = T x := by + rw [← _root_.sum_apply, sum_all_exactModes] + rfl + calc + _ = ∑ s ∈ retainedModes n K, exactMode F n s (T x) := by simp [lowModes] + _ = ∑ s ∈ (range n).powerset, exactMode F n s (T x) := by + apply sum_subset (filter_subset _ _) + intro s hs hnot + have hcard : K < s.card := by + by_contra h + exact hnot (mem_filter.mpr ⟨hs, by omega⟩) + exact congrArg (fun f => f x) (hhigh s (mem_powerset.mp hs) hcard) + _ = _ := hfull + +theorem comp_lowModes_of_high_zero {E F : ℕ → FiniteHilbertSpace} (n K : ℕ) + (T : tensorSpace (fun i => augmentedSpace (E i)) n →L[ℂ] + tensorSpace (fun i => augmentedSpace (F i)) n) + (hhigh : ∀ s ⊆ range n, K < s.card → T.comp (exactMode E n s) = 0) : + T.comp (lowModes E n K) = T := by + ext x + change T (lowModes E n K x) = T x + have hfull : (∑ s ∈ (range n).powerset, T (exactMode E n s x)) = T x := by + rw [← map_sum, ← _root_.sum_apply, sum_all_exactModes] + rfl + calc + _ = ∑ s ∈ retainedModes n K, T (exactMode E n s x) := by simp [lowModes, map_sum] + _ = ∑ s ∈ (range n).powerset, T (exactMode E n s x) := by + apply sum_subset (filter_subset _ _) + intro s hs hnot + have hcard : K < s.card := by + by_contra h + exact hnot (mem_filter.mpr ⟨hs, by omega⟩) + exact congrArg (fun f => f x) (hhigh s (mem_powerset.mp hs) hcard) + _ = _ := hfull + +end Ostmann.Supply.TensorModes + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeEnergy.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..4847f7efe98d84aa9a0ab941e47990523412714e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeEnergy.lean @@ -0,0 +1,144 @@ +import OAI.NumberTheory.Ostmann.Supply.TensorModes + +namespace OAI + +noncomputable section +namespace Ostmann.Supply.TensorModes +open TensorOperators +open Finset +open scoped TensorProduct BigOperators ComplexConjugate + +private theorem norm_sq_complex {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + (x : H) : ((‖x‖^2 : ℝ) : ℂ) = inner ℂ x x := by + apply Complex.ext + · exact norm_sq_eq_re_inner (𝕜 := ℂ) x + · exact (inner_self_im (𝕜 := ℂ) x).symm + +theorem exactMode_inner_eq_zero (E : ℕ → FiniteHilbertSpace) (n : ℕ) + {s t : Finset ℕ} (hs : s ⊆ range n) (ht : t ⊆ range n) (hst : s ≠ t) + (x y : tensorSpace (fun i => augmentedSpace (E i)) n) : + inner ℂ (exactMode E n s x) (exactMode E n t y) = 0 := by + have hh := (exactMode_star E n s).isSelfAdjoint.isSymmetric x (exactMode E n t y) + change inner ℂ (exactMode E n s x) (exactMode E n t y) = + inner ℂ x (exactMode E n s (exactMode E n t y)) at hh + rw [hh] + change inner ℂ x ((exactMode E n s * exactMode E n t) y) = 0 + rw [exactMode_mul_eq_zero E n hs ht hst] + simp + +theorem norm_lowModes_sq (E : ℕ → FiniteHilbertSpace) (n K : ℕ) + (x : tensorSpace (fun i => augmentedSpace (E i)) n) : + ‖lowModes E n K x‖^2 = ∑ s ∈ retainedModes n K, ‖exactMode E n s x‖^2 := by + have hinner : inner ℂ (lowModes E n K x) (lowModes E n K x) = + ∑ s ∈ retainedModes n K, inner ℂ (exactMode E n s x) (exactMode E n s x) := by + simp only [lowModes, _root_.sum_apply, sum_inner, inner_sum] + apply sum_congr rfl + intro s hs + apply sum_eq_single s + · intro t ht hts + exact exactMode_inner_eq_zero E n (mem_powerset.mp (mem_filter.mp ht).1) + (mem_powerset.mp (mem_filter.mp hs).1) hts x x + · intro hnot + exact False.elim (hnot hs) + apply Complex.ofReal_injective + rw [norm_sq_complex, Complex.ofReal_sum] + simp_rw [norm_sq_complex] + exact hinner + +def augmentedPoint (E : FiniteHilbertSpace) (v : E) : augmentedSpace E := + WithLp.toLp 2 ((1 : ℂ), v) + +def empiricalTensor {α : Type*} (A : Finset α) {E : ℕ → FiniteHilbertSpace} + (v : α → ∀ i, E i) (n : ℕ) : tensorSpace (fun i => augmentedSpace (E i)) n := + (A.card : ℂ)⁻¹ • ∑ a ∈ A, pureTensor (fun i => augmentedPoint (E i) (v a i)) n + +theorem exactMode_pureTensor_inner {E : ℕ → FiniteHilbertSpace} (n : ℕ) + (s : Finset ℕ) (hs : s ⊆ range n) (v w : ∀ i, E i) : + inner ℂ + (exactMode E n s (pureTensor (fun i => augmentedPoint (E i) (v i)) n)) + (exactMode E n s (pureTensor (fun i => augmentedPoint (E i) (w i)) n)) = + ∏ i ∈ s, inner ℂ (v i) (w i) := by + simp only [exactMode, tensorOp_pureTensor, pureTensor_inner] + have hlocal (i : ℕ) : + inner ℂ + ((if i ∈ s then centeredPart (E i) else scalarPart (E i)) (augmentedPoint (E i) (v i))) + ((if i ∈ s then centeredPart (E i) else scalarPart (E i)) (augmentedPoint (E i) (w i))) = + if i ∈ s then inner ℂ (v i) (w i) else 1 := by + by_cases hi : i ∈ s + · simp only [ite_eq_left hi] + rw [centeredPart_apply, centeredPart_apply] + change inner ℂ (0 : ℂ) 0 + inner ℂ (v i) (w i) = inner ℂ (v i) (w i) + simp + · simp only [ite_eq_right hi] + rw [scalarPart_apply, scalarPart_apply] + change inner ℂ (1 : ℂ) 1 + inner ℂ (0 : E i) 0 = 1 + simp + simp_rw [hlocal] + calc + _ = ∏ i ∈ s, (if i ∈ s then inner ℂ (v i) (w i) else 1) := + (prod_subset hs (fun i hi hnot => ite_eq_right hnot)).symm + _ = _ := prod_congr rfl (fun i hi => ite_eq_left hi) + +theorem norm_exactMode_empirical_eq_gram {α : Type*} (A : Finset α) + {E : ℕ → FiniteHilbertSpace} (v : α → ∀ i, E i) (n : ℕ) + (s : Finset ℕ) (hs : s ⊆ range n) : + ((‖exactMode E n s (empiricalTensor A v n)‖^2 : ℝ) : ℂ) = + (A.card : ℂ)⁻¹^2 * ∑ a ∈ A, ∑ b ∈ A, ∏ i ∈ s, inner ℂ (v a i) (v b i) := by + rw [norm_sq_complex] + simp only [empiricalTensor, map_smul, map_sum, inner_smul_left, inner_smul_right, + map_inv₀, map_natCast, sum_inner, inner_sum] + simp_rw [exactMode_pureTensor_inner n s hs] + rw [← mul_sum, sum_comm (s := A) (t := A)] + ring + +def residueCenteredFamily (p : ℕ → ℕ) [∀ i, NeZero (p i)] + (S : ∀ p : ℕ, Finset (ZMod p)) (i : ℕ) : FiniteHilbertSpace := + FiniteHilbertSpace.of (centeredSpace (S (p i))) + +def residueCenteredVector (p : ℕ → ℕ) [∀ i, NeZero (p i)] + (S : ∀ p : ℕ, Finset (ZMod p)) (a i : ℕ) : residueCenteredFamily p S i := + (centeredSpace (S (p i))).orthogonalProjectionOnto (EuclideanSpace.single (a : ZMod (p i)) 1) + +theorem norm_residue_exactMode_sq (A : Finset ℕ) (p : ℕ → ℕ) [∀ i, NeZero (p i)] + (S : ∀ p : ℕ, Finset (ZMod p)) (n : ℕ) (s : Finset ℕ) (hs : s ⊆ range n) + (hp : ∀ i ∈ s, (p i).Prime) (hinj : Set.InjOn p (s : Set ℕ)) : + ‖exactMode (residueCenteredFamily p S) n s + (empiricalTensor A (residueCenteredVector p S) n)‖^2 = + centeredEnergy A S (∏ i ∈ s, p i) := by + have hpf : (∏ i ∈ s, p i).primeFactors = s.image p := by + have hprod : (∏ q ∈ s.image p, q) = ∏ i ∈ s, p i := + prod_image (f := fun q : ℕ => q) (fun i hi j hj hij => hinj hi hj hij) + rw [← hprod] + exact Nat.primeFactors_prod (fun q hq => by obtain ⟨i, hi, rfl⟩ := mem_image.mp hq; exact hp i hi) + apply Complex.ofReal_injective + rw [norm_exactMode_empirical_eq_gram A (residueCenteredVector p S) n s hs, + centeredEnergy_eq_gram, hpf] + congr 1 + apply sum_congr rfl + intro a ha + apply sum_congr rfl + intro b hb + rw [prod_image (fun i hi j hj hij => hinj hi hj hij)] + apply prod_congr rfl + intro i hi + rw [centeredInner_eq] + rfl + +theorem norm_residue_lowModes_sq (A : Finset ℕ) (p : ℕ → ℕ) [∀ i, NeZero (p i)] + (S : ∀ p : ℕ, Finset (ZMod p)) (n K : ℕ) + (hp : ∀ i < n, (p i).Prime) (hinj : Set.InjOn p (range n : Set ℕ)) : + ‖lowModes (residueCenteredFamily p S) n K + (empiricalTensor A (residueCenteredVector p S) n)‖^2 = + ∑ s ∈ retainedModes n K, centeredEnergy A S (∏ i ∈ s, p i) := by + rw [norm_lowModes_sq] + apply sum_congr rfl + intro s hs + have hsub := mem_powerset.mp (mem_filter.mp hs).1 + exact norm_residue_exactMode_sq A p S n s hsub + (fun i hi => hp i (mem_range.mp (hsub hi))) (hinj.mono hsub) + +end Ostmann.Supply.TensorModes + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeLocalKernel.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeLocalKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..64e3637e9d6101e2c43589ab09bbf909f36e8f78 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeLocalKernel.lean @@ -0,0 +1,47 @@ +import OAI.NumberTheory.Ostmann.Supply.LocalKernelPolynomial +import OAI.NumberTheory.Ostmann.Supply.TensorModePairing + +namespace OAI + +noncomputable section +namespace Ostmann.Supply.TensorModes +open TensorOperators + +variable {p : ℕ} [NeZero p] + +theorem centeredPart_scalarOnly (S T : Finset (ZMod p)) : + (centeredPart (FiniteHilbertSpace.of (centeredSpace S))).comp (scalarOnly S T) = 0 := by + apply ContinuousLinearMap.ext + intro x + change centeredPart (FiniteHilbertSpace.of (centeredSpace S)) (scalarOnly S T x) = 0 + erw [centeredPart_apply] + change WithLp.toLp 2 ((0 : ℂ), (0 : centeredSpace S)) = 0 + rfl + +theorem scalarOnly_centeredPart (S T : Finset (ZMod p)) : + (scalarOnly S T).comp (centeredPart (FiniteHilbertSpace.of (centeredSpace T))) = 0 := by + apply ContinuousLinearMap.ext + intro x + change scalarOnly S T (centeredPart (FiniteHilbertSpace.of (centeredSpace T)) x) = 0 + rw [centeredPart_apply] + rfl + +theorem localKernelPolynomial_zero_output (S : Finset (ZMod p)) (t : ℝ) + (hS : S.Nonempty) (hT : Sᶜ.Nonempty) : + (centeredPart (FiniteHilbertSpace.of (centeredSpace S))).comp + (localKernelPolynomial S t (0,0)) = 0 := by + rw [localKernelPolynomial_zero S t hS hT] + exact centeredPart_scalarOnly S Sᶜ + +theorem localKernelPolynomial_zero_input (S : Finset (ZMod p)) (t : ℝ) + (hS : S.Nonempty) (hT : Sᶜ.Nonempty) : + (localKernelPolynomial S t (0,0)).comp + (centeredPart (FiniteHilbertSpace.of (centeredSpace Sᶜ))) = 0 := by + rw [localKernelPolynomial_zero S t hS hT] + exact scalarOnly_centeredPart S Sᶜ + +end Ostmann.Supply.TensorModes + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TensorModePairing.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModePairing.lean new file mode 100644 index 0000000000000000000000000000000000000000..654b22eea761c84e028a6948c29a606c6ac7d76c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModePairing.lean @@ -0,0 +1,49 @@ +import OAI.NumberTheory.Ostmann.Supply.TensorModeEnergy +import OAI.NumberTheory.Ostmann.Supply.TensorModePolynomial + +namespace OAI + +noncomputable section +namespace Ostmann.Supply.TensorModes +open TensorOperators +open scoped TensorProduct BigOperators + +theorem norm_inner_of_lowModes_support {E F : ℕ → FiniteHilbertSpace} (n K : ℕ) + (T : tensorSpace (fun i => augmentedSpace (E i)) n →L[ℂ] + tensorSpace (fun i => augmentedSpace (F i)) n) + (hT : T = ((lowModes F n K).comp T).comp (lowModes E n K)) + (v : tensorSpace (fun i => augmentedSpace (F i)) n) + (w : tensorSpace (fun i => augmentedSpace (E i)) n) : + ‖inner ℂ v (T w)‖ ≤ ‖T‖ * ‖lowModes F n K v‖ * ‖lowModes E n K w‖ := by + have he : inner ℂ v (T w) = + inner ℂ (lowModes F n K v) (T (lowModes E n K w)) := by + calc + _ = inner ℂ v (lowModes F n K (T (lowModes E n K w))) := + congrArg (fun L => inner ℂ v (L w)) hT + _ = _ := by + have h := (lowModes_star F n K).isSelfAdjoint.isSymmetric v (T (lowModes E n K w)) + exact h.symm + rw [he] + calc + _ ≤ ‖lowModes F n K v‖ * ‖T (lowModes E n K w)‖ := norm_inner_le_norm _ _ + _ ≤ ‖lowModes F n K v‖ * (‖T‖ * ‖lowModes E n K w‖) := + mul_le_mul_of_nonneg_left (T.le_opNorm _) (norm_nonneg _) + _ = _ := by ring + +theorem norm_inner_rectangularTruncation {E F : ℕ → FiniteHilbertSpace} + (c : ∀ i, (ℕ × ℕ) →₀ (augmentedSpace (E i) →L[ℂ] augmentedSpace (F i))) (n K : ℕ) + (hout : ∀ i < n, (centeredPart (F i)).comp (c i (0,0)) = 0) + (hin : ∀ i < n, (c i (0,0)).comp (centeredPart (E i)) = 0) + (v : tensorSpace (fun i => augmentedSpace (F i)) n) + (w : tensorSpace (fun i => augmentedSpace (E i)) n) : + ‖inner ℂ v (BivariateTruncation.rectangularTruncation (tensorFamilyPolynomial c n) K w)‖ ≤ + ‖BivariateTruncation.rectangularTruncation (tensorFamilyPolynomial c n) K‖ * + ‖lowModes F n (2*K) v‖ * ‖lowModes E n (2*K) w‖ := + norm_inner_of_lowModes_support n (2*K) _ + (rectangularTruncation_lowModes c n K hout hin) v w + +end Ostmann.Supply.TensorModes + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TensorModePolynomial.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModePolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..189ee5cba228a806d3c244ca06bae7f9ada5b8fd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModePolynomial.lean @@ -0,0 +1,172 @@ +import OAI.NumberTheory.Ostmann.Supply.TensorModeDecomposition + +namespace OAI + +noncomputable section +namespace Ostmann.Supply.TensorModes +open TensorOperators +open Finset +open scoped TensorProduct BigOperators + +section Coefficients +variable {E F G H : Type*} + [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [NormedAddCommGroup F] [InnerProductSpace ℂ F] + [NormedAddCommGroup G] [InnerProductSpace ℂ G] + [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem tensorPolynomial_apply (c : (ℕ × ℕ) →₀ (E →L[ℂ] F)) + (d : (ℕ × ℕ) →₀ (G →L[ℂ] H)) (ij : ℕ × ℕ) : + tensorPolynomial c d ij = ∑ ab ∈ c.support, ∑ kl ∈ d.support, + if (ab.1+kl.1, ab.2+kl.2) = ij then TensorProduct.mapL (c ab) (d kl) else 0 := by + simp only [tensorPolynomial, Finsupp.coe_finsetSum, Finset.sum_apply, Finsupp.single_apply] + +end Coefficients + +section Family +variable {E F : ℕ → FiniteHilbertSpace} +variable (c : ∀ i, (ℕ × ℕ) →₀ (augmentedSpace (E i) →L[ℂ] augmentedSpace (F i))) + +theorem coefficient_high_output_zero (n : ℕ) + (hzero : ∀ i < n, (centeredPart (F i)).comp (c i (0,0)) = 0) + (ij : ℕ × ℕ) (s : Finset ℕ) (hs : s ⊆ range n) (hcard : ij.1+ij.2 < s.card) : + (exactMode F n s).comp (tensorFamilyPolynomial c n ij) = 0 := by + induction n generalizing ij s with + | zero => + have hs0 : s = ∅ := by simpa using hs + subst s + simp at hcard + | succ n ih => + have hzerop : ∀ i < n, (centeredPart (F i)).comp (c i (0,0)) = 0 := + fun i hi => hzero i (by omega) + change (TensorProduct.mapL (exactMode F n s) + (if n ∈ s then centeredPart (F n) else scalarPart (F n))).comp + (tensorPolynomial (tensorFamilyPolynomial c n) (c n) ij) = 0 + rw [tensorPolynomial_apply, ContinuousLinearMap.comp_finsetSum] + apply sum_eq_zero + intro ab hab + rw [ContinuousLinearMap.comp_finsetSum] + apply sum_eq_zero + intro kl hkl + by_cases hij : (ab.1+kl.1, ab.2+kl.2) = ij + · rw [ite_eq_left hij] + have hfst := congrArg Prod.fst hij + have hsnd := congrArg Prod.snd hij + dsimp at hfst hsnd + rw [← TensorProduct.mapL_comp] + by_cases hn : n ∈ s + · rw [ite_eq_left hn] + by_cases hk0 : kl = (0,0) + · subst kl + rw [hzero n (by omega), TensorProduct.mapL_zero_right] + · have hkpos : 1 ≤ kl.1+kl.2 := by rcases kl with ⟨k,l⟩; simp only [Prod.mk.injEq] at hk0; omega + have hsub : s.erase n ⊆ range n := by + intro i hi + obtain ⟨hin, his⟩ := mem_erase.mp hi + have hir := mem_range.mp (hs his) + exact mem_range.mpr (by omega) + have hc := card_erase_add_one hn + have hprev : ab.1+ab.2 < (s.erase n).card := by omega + rw [← exactMode_erase_top F n s, ih hzerop ab (s.erase n) hsub hprev, + TensorProduct.mapL_zero_left] + · rw [ite_eq_right hn] + have hsub : s ⊆ range n := by + intro i hi + have hir := mem_range.mp (hs hi) + have hin : i ≠ n := fun h => hn (h ▸ hi) + exact mem_range.mpr (by omega) + have hprev : ab.1+ab.2 < s.card := by omega + rw [ih hzerop ab s hsub hprev, TensorProduct.mapL_zero_left] + · rw [ite_eq_right hij] + simp + +theorem coefficient_high_input_zero (n : ℕ) + (hzero : ∀ i < n, (c i (0,0)).comp (centeredPart (E i)) = 0) + (ij : ℕ × ℕ) (s : Finset ℕ) (hs : s ⊆ range n) (hcard : ij.1+ij.2 < s.card) : + (tensorFamilyPolynomial c n ij).comp (exactMode E n s) = 0 := by + induction n generalizing ij s with + | zero => + have hs0 : s = ∅ := by simpa using hs + subst s + simp at hcard + | succ n ih => + have hzerop : ∀ i < n, (c i (0,0)).comp (centeredPart (E i)) = 0 := + fun i hi => hzero i (by omega) + change (tensorPolynomial (tensorFamilyPolynomial c n) (c n) ij).comp + (TensorProduct.mapL (exactMode E n s) + (if n ∈ s then centeredPart (E n) else scalarPart (E n))) = 0 + rw [tensorPolynomial_apply, ContinuousLinearMap.finsetSum_comp] + apply sum_eq_zero + intro ab hab + rw [ContinuousLinearMap.finsetSum_comp] + apply sum_eq_zero + intro kl hkl + by_cases hij : (ab.1+kl.1, ab.2+kl.2) = ij + · rw [ite_eq_left hij] + have hfst := congrArg Prod.fst hij + have hsnd := congrArg Prod.snd hij + dsimp at hfst hsnd + rw [← TensorProduct.mapL_comp] + by_cases hn : n ∈ s + · rw [ite_eq_left hn] + by_cases hk0 : kl = (0,0) + · subst kl + rw [hzero n (by omega), TensorProduct.mapL_zero_right] + · have hkpos : 1 ≤ kl.1+kl.2 := by rcases kl with ⟨k,l⟩; simp only [Prod.mk.injEq] at hk0; omega + have hsub : s.erase n ⊆ range n := by + intro i hi + obtain ⟨hin, his⟩ := mem_erase.mp hi + have hir := mem_range.mp (hs his) + exact mem_range.mpr (by omega) + have hc := card_erase_add_one hn + have hprev : ab.1+ab.2 < (s.erase n).card := by omega + rw [← exactMode_erase_top E n s, ih hzerop ab (s.erase n) hsub hprev, + TensorProduct.mapL_zero_left] + · rw [ite_eq_right hn] + have hsub : s ⊆ range n := by + intro i hi + have hir := mem_range.mp (hs hi) + have hin : i ≠ n := fun h => hn (h ▸ hi) + exact mem_range.mpr (by omega) + have hprev : ab.1+ab.2 < s.card := by omega + rw [ih hzerop ab s hsub hprev, TensorProduct.mapL_zero_left] + · rw [ite_eq_right hij] + simp + +theorem rectangularTruncation_lowModes (n K : ℕ) + (hout : ∀ i < n, (centeredPart (F i)).comp (c i (0,0)) = 0) + (hin : ∀ i < n, (c i (0,0)).comp (centeredPart (E i)) = 0) : + BivariateTruncation.rectangularTruncation (tensorFamilyPolynomial c n) K = + ((lowModes F n (2*K)).comp + (BivariateTruncation.rectangularTruncation (tensorFamilyPolynomial c n) K)).comp + (lowModes E n (2*K)) := by + have hleft : (lowModes F n (2*K)).comp + (BivariateTruncation.rectangularTruncation (tensorFamilyPolynomial c n) K) = + BivariateTruncation.rectangularTruncation (tensorFamilyPolynomial c n) K := by + apply lowModes_comp_of_high_zero + intro s hs hcard + rw [BivariateTruncation.rectangularTruncation, ContinuousLinearMap.comp_finsetSum] + apply sum_eq_zero + intro ij hij + have hi := (mem_filter.mp hij).2.1 + have hj := (mem_filter.mp hij).2.2 + exact coefficient_high_output_zero c n hout ij s hs (by omega) + have hright : (BivariateTruncation.rectangularTruncation (tensorFamilyPolynomial c n) K).comp + (lowModes E n (2*K)) = + BivariateTruncation.rectangularTruncation (tensorFamilyPolynomial c n) K := by + apply comp_lowModes_of_high_zero + intro s hs hcard + rw [BivariateTruncation.rectangularTruncation, ContinuousLinearMap.finsetSum_comp] + apply sum_eq_zero + intro ij hij + have hi := (mem_filter.mp hij).2.1 + have hj := (mem_filter.mp hij).2.2 + exact coefficient_high_input_zero c n hin ij s hs (by omega) + rw [hleft, hright] + +end Family +end Ostmann.Supply.TensorModes + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeReflection.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeReflection.lean new file mode 100644 index 0000000000000000000000000000000000000000..55ba46cb8821a404286c0af00f448cbef8aac2e5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModeReflection.lean @@ -0,0 +1,113 @@ +import OAI.NumberTheory.Ostmann.Supply.TensorModeBudget + +namespace OAI + +noncomputable section +namespace Ostmann.Supply.TensorModes +open TensorOperators +open Finset +open scoped BigOperators + +def reflectedSupport (S : ∀ p : ℕ, Finset (ZMod p)) (p : ℕ) : Finset (ZMod p) := + (S p).image Neg.neg + +@[simp] theorem mem_reflectedSupport (S : ∀ p : ℕ, Finset (ZMod p)) + (p : ℕ) (x : ZMod p) : x ∈ reflectedSupport S p ↔ -x ∈ S p := by + constructor + · intro hx + obtain ⟨y, hy, rfl⟩ := mem_image.mp hx + simpa only [neg_neg] using hy + · intro hx + exact mem_image.mpr ⟨-x, hx, neg_neg x⟩ + +@[simp] theorem card_reflectedSupport (S : ∀ p : ℕ, Finset (ZMod p)) (p : ℕ) : + (reflectedSupport S p).card = (S p).card := card_image_of_injective _ neg_injective + +@[simp] theorem supportRatio_reflectedSupport (S : ∀ p : ℕ, Finset (ZMod p)) (p : ℕ) : + supportRatio (reflectedSupport S) p = supportRatio S p := by + simp only [supportRatio, card_reflectedSupport] + +theorem centeredProjection_reflection_gram (S : ∀ p : ℕ, Finset (ZMod p)) + (p : ℕ) [NeZero p] (x y : ZMod p) (hx : -x ∈ S p) (hy : -y ∈ S p) : + inner ℂ (centeredProjection (S p) (EuclideanSpace.single (-x) (1 : ℂ))) + (centeredProjection (S p) (EuclideanSpace.single (-y) (1 : ℂ))) = + inner ℂ (centeredProjection (reflectedSupport S p) (EuclideanSpace.single x (1 : ℂ))) + (centeredProjection (reflectedSupport S p) (EuclideanSpace.single y (1 : ℂ))) := by + rw [centeredProjection_gram (S p) _ _ hx hy, + centeredProjection_gram (reflectedSupport S p) _ _ + ((mem_reflectedSupport S p x).mpr hx) ((mem_reflectedSupport S p y).mpr hy)] + simp only [neg_inj, card_reflectedSupport] + +def negResidueCenteredVector (p : ℕ → ℕ) [∀ i, NeZero (p i)] + (S : ∀ p : ℕ, Finset (ZMod p)) (a i : ℕ) : residueCenteredFamily p S i := + (centeredSpace (S (p i))).orthogonalProjectionOnto + (EuclideanSpace.single (-(a : ZMod (p i))) 1) + +theorem norm_negResidue_exactMode_sq (A : Finset ℕ) (p : ℕ → ℕ) [∀ i, NeZero (p i)] + (S : ∀ p : ℕ, Finset (ZMod p)) (n : ℕ) (s : Finset ℕ) (hs : s ⊆ range n) + (hp : ∀ i ∈ s, (p i).Prime) (hinj : Set.InjOn p (s : Set ℕ)) + (hS : ∀ a ∈ A, ∀ i ∈ s, -(a : ZMod (p i)) ∈ S (p i)) : + ‖exactMode (residueCenteredFamily p S) n s + (empiricalTensor A (negResidueCenteredVector p S) n)‖^2 = + centeredEnergy A (reflectedSupport S) (∏ i ∈ s, p i) := by + have hpf : (∏ i ∈ s, p i).primeFactors = s.image p := by + have hprod : (∏ q ∈ s.image p, q) = ∏ i ∈ s, p i := + prod_image (f := fun q : ℕ => q) (fun i hi j hj hij => hinj hi hj hij) + rw [← hprod] + exact Nat.primeFactors_prod (fun q hq => by obtain ⟨i, hi, rfl⟩ := mem_image.mp hq; exact hp i hi) + apply Complex.ofReal_injective + rw [norm_exactMode_empirical_eq_gram A (negResidueCenteredVector p S) n s hs, + centeredEnergy_eq_gram, hpf] + congr 1 + apply sum_congr rfl + intro a ha + apply sum_congr rfl + intro b hb + rw [prod_image (fun i hi j hj hij => hinj hi hj hij)] + apply prod_congr rfl + intro i hi + rw [centeredInner_eq] + change inner ℂ + (centeredProjection (S (p i)) (EuclideanSpace.single (-(a : ZMod (p i))) 1)) + (centeredProjection (S (p i)) (EuclideanSpace.single (-(b : ZMod (p i))) 1)) = _ + exact centeredProjection_reflection_gram S (p i) _ _ (hS a ha i hi) (hS b hb i hi) + +theorem norm_negResidue_lowModes_sq (A : Finset ℕ) (p : ℕ → ℕ) [∀ i, NeZero (p i)] + (S : ∀ p : ℕ, Finset (ZMod p)) (n K : ℕ) + (hp : ∀ i < n, (p i).Prime) (hinj : Set.InjOn p (range n : Set ℕ)) + (hS : ∀ a ∈ A, ∀ i < n, -(a : ZMod (p i)) ∈ S (p i)) : + ‖lowModes (residueCenteredFamily p S) n K + (empiricalTensor A (negResidueCenteredVector p S) n)‖^2 = + ∑ t ∈ retainedProducts p n K, centeredEnergy A (reflectedSupport S) t := by + rw [norm_lowModes_sq] + have he : (∑ s ∈ retainedModes n K, + ‖exactMode (residueCenteredFamily p S) n s + (empiricalTensor A (negResidueCenteredVector p S) n)‖^2) = + ∑ s ∈ retainedModes n K, centeredEnergy A (reflectedSupport S) (∏ i ∈ s, p i) := by + apply sum_congr rfl + intro s hs + have hsub := mem_powerset.mp (mem_filter.mp hs).1 + exact norm_negResidue_exactMode_sq A p S n s hsub + (fun i hi => hp i (mem_range.mp (hsub hi))) (hinj.mono hsub) + (fun a ha i hi => hS a ha i (mem_range.mp (hsub hi))) + rw [he] + symm + exact sum_image (fun s hs t ht h => indexPrimeProduct_injOn p n hp hinj + (mem_filter.mp hs).1 (mem_filter.mp ht).1 h) + +theorem norm_negResidue_lowModes_sq_le_sum (A : Finset ℕ) (p : ℕ → ℕ) [∀ i, NeZero (p i)] + (S : ∀ p : ℕ, Finset (ZMod p)) (n K : ℕ) + (hp : ∀ i < n, (p i).Prime) (hinj : Set.InjOn p (range n : Set ℕ)) + (hS : ∀ a ∈ A, ∀ i < n, -(a : ZMod (p i)) ∈ S (p i)) + (T : Finset ℕ) (hT : retainedProducts p n K ⊆ T) : + ‖lowModes (residueCenteredFamily p S) n K + (empiricalTensor A (negResidueCenteredVector p S) n)‖^2 ≤ + ∑ t ∈ T, centeredEnergy A (reflectedSupport S) t := by + rw [norm_negResidue_lowModes_sq A p S n K hp hinj hS] + exact sum_le_sum_of_subset_of_nonneg hT (fun t ht hnot => centeredEnergy_nonneg A _ t) + +end Ostmann.Supply.TensorModes + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TensorModes.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModes.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb9f0878b37cd653c622b96c49eabe5a47743982 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TensorModes.lean @@ -0,0 +1,168 @@ +import OAI.NumberTheory.Ostmann.Supply.CenteredPrimitiveEnergy +import OAI.NumberTheory.Ostmann.Supply.TensorOperators + +namespace OAI + +noncomputable section +namespace Ostmann.Supply.TensorModes +open TensorOperators +open Finset +open scoped TensorProduct BigOperators + +def augmentedSpace (E : FiniteHilbertSpace) : FiniteHilbertSpace := + FiniteHilbertSpace.of (WithLp 2 (ℂ × E)) + +def scalarPart (E : FiniteHilbertSpace) : augmentedSpace E →L[ℂ] augmentedSpace E := + (WithLp.prodContinuousLinearEquiv 2 ℂ ℂ E).symm.toContinuousLinearMap.comp + ((WithLp.fstL 2 ℂ ℂ E).prod 0) + +def centeredPart (E : FiniteHilbertSpace) : augmentedSpace E →L[ℂ] augmentedSpace E := + 1 - scalarPart E + +@[simp] theorem scalarPart_apply (E : FiniteHilbertSpace) (x : augmentedSpace E) : + scalarPart E x = WithLp.toLp 2 (x.fst, (0 : E)) := rfl + +@[simp] theorem centeredPart_apply (E : FiniteHilbertSpace) (x : augmentedSpace E) : + centeredPart E x = WithLp.toLp 2 ((0 : ℂ), x.snd) := by + apply WithLp.ofLp_injective 2 + change (x.fst - x.fst, x.snd - (0 : E)) = ((0 : ℂ), x.snd) + simp + +@[simp] theorem scalarPart_star (E : FiniteHilbertSpace) : IsStarProjection (scalarPart E) := by + constructor + · change scalarPart E * scalarPart E = scalarPart E + ext x + rfl + · apply ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric.mpr + intro x y + change inner ℂ x.fst y.fst + inner ℂ (0 : E) y.snd = + inner ℂ x.fst y.fst + inner ℂ x.snd (0 : E) + simp + +@[simp] theorem centeredPart_star (E : FiniteHilbertSpace) : IsStarProjection (centeredPart E) := + (scalarPart_star E).one_sub + +@[simp] theorem scalar_centered_mul (E : FiniteHilbertSpace) : + scalarPart E * centeredPart E = 0 := (scalarPart_star E).mul_one_sub_self + +@[simp] theorem centered_scalar_mul (E : FiniteHilbertSpace) : + centeredPart E * scalarPart E = 0 := (scalarPart_star E).one_sub_mul_self + +@[simp] theorem scalar_add_centered (E : FiniteHilbertSpace) : + scalarPart E + centeredPart E = 1 := by simp [centeredPart] + +theorem tensorOp_congr {E F : ℕ → FiniteHilbertSpace} (n : ℕ) + (f g : ∀ i, E i →L[ℂ] F i) (h : ∀ i < n, f i = g i) : + tensorOp f n = tensorOp g n := by + induction n with + | zero => rfl + | succ n ih => + change TensorProduct.mapL (tensorOp f n) (f n) = TensorProduct.mapL (tensorOp g n) (g n) + rw [ih (fun i hi => h i (by omega)), h n (by omega)] + +theorem tensorOp_mul {E : ℕ → FiniteHilbertSpace} + (f g : ∀ i, E i →L[ℂ] E i) (n : ℕ) : + tensorOp (fun i => f i * g i) n = tensorOp f n * tensorOp g n := by + induction n with + | zero => change (1 : ℂ →L[ℂ] ℂ) = 1 * 1; simp + | succ n ih => + change TensorProduct.mapL (tensorOp (fun i => f i * g i) n) (f n * g n) = _ + rw [ih, TensorProduct.mapL_mul] + rfl + +@[simp] theorem tensorOp_one (E : ℕ → FiniteHilbertSpace) (n : ℕ) : + tensorOp (fun i => (1 : E i →L[ℂ] E i)) n = 1 := by + induction n with + | zero => rfl + | succ n ih => + change TensorProduct.mapL (tensorOp (fun i => (1 : E i →L[ℂ] E i)) n) 1 = 1 + rw [ih] + exact TensorProduct.mapL_id_id + +theorem tensorOp_adjoint {E : ℕ → FiniteHilbertSpace} + (f : ∀ i, E i →L[ℂ] E i) (n : ℕ) : + (tensorOp f n).adjoint = tensorOp (fun i => (f i).adjoint) n := by + induction n with + | zero => exact ContinuousLinearMap.adjoint_id + | succ n ih => + change (TensorProduct.mapL (tensorOp f n) (f n)).adjoint = _ + rw [TensorProduct.adjoint_mapL, ih] + rfl + +theorem tensorOp_zero_of_factor {E F : ℕ → FiniteHilbertSpace} + (f : ∀ i, E i →L[ℂ] F i) (n : ℕ) (h : ∃ i < n, f i = 0) : tensorOp f n = 0 := by + induction n with + | zero => obtain ⟨i, hi, hzero⟩ := h; omega + | succ n ih => + obtain ⟨i, hi, hz⟩ := h + change TensorProduct.mapL (tensorOp f n) (f n) = 0 + by_cases hin : i = n + · subst i + rw [hz, TensorProduct.mapL_zero_right] + · rw [ih ⟨i, by omega, hz⟩, TensorProduct.mapL_zero_left] + +def exactMode (E : ℕ → FiniteHilbertSpace) (n : ℕ) (s : Finset ℕ) : + tensorSpace (fun i => augmentedSpace (E i)) n →L[ℂ] + tensorSpace (fun i => augmentedSpace (E i)) n := + tensorOp (fun i => if i ∈ s then centeredPart (E i) else scalarPart (E i)) n + +theorem exactMode_star (E : ℕ → FiniteHilbertSpace) (n : ℕ) (s : Finset ℕ) : + IsStarProjection (exactMode E n s) := by + have hloc (i : ℕ) : IsStarProjection (if i ∈ s then centeredPart (E i) else scalarPart (E i)) := by + split_ifs <;> simp + constructor + · change exactMode E n s * exactMode E n s = exactMode E n s + rw [exactMode, ← tensorOp_mul] + apply tensorOp_congr + intro i hi + exact (hloc i).isIdempotentElem + · change (exactMode E n s).adjoint = exactMode E n s + rw [exactMode, tensorOp_adjoint] + apply tensorOp_congr + intro i hi + exact (hloc i).isSelfAdjoint.adjoint_eq + +theorem exactMode_mul_eq_zero (E : ℕ → FiniteHilbertSpace) (n : ℕ) + {s t : Finset ℕ} (hs : s ⊆ range n) (ht : t ⊆ range n) (hst : s ≠ t) : + exactMode E n s * exactMode E n t = 0 := by + rw [exactMode, exactMode, ← tensorOp_mul] + apply tensorOp_zero_of_factor + have hdiff : ∃ i, ¬(i ∈ s ↔ i ∈ t) := by + exact not_forall.mp (fun h => hst (Finset.ext h)) + obtain ⟨i, hi⟩ := hdiff + by_cases his : i ∈ s + · have hit : i ∉ t := fun hit => hi ⟨fun _ => hit, fun _ => his⟩ + exact ⟨i, mem_range.mp (hs his), by simp [his, hit]⟩ + · have hit : i ∈ t := by tauto + exact ⟨i, mem_range.mp (ht hit), by simp [his, hit]⟩ + +def retainedModes (n K : ℕ) : Finset (Finset ℕ) := + (range n).powerset.filter (fun s => s.card ≤ K) + +def lowModes (E : ℕ → FiniteHilbertSpace) (n K : ℕ) : + tensorSpace (fun i => augmentedSpace (E i)) n →L[ℂ] + tensorSpace (fun i => augmentedSpace (E i)) n := + ∑ s ∈ retainedModes n K, exactMode E n s + +theorem sum_exactMode_star (E : ℕ → FiniteHilbertSpace) (n : ℕ) (M : Finset (Finset ℕ)) + (hM : ∀ s ∈ M, s ⊆ range n) : IsStarProjection (∑ s ∈ M, exactMode E n s) := by + induction M using Finset.induction_on with + | empty => simp + | @insert s M hs ih => + rw [sum_insert hs] + apply (exactMode_star E n s).add (ih (fun t ht => hM t (mem_insert_of_mem ht))) + rw [mul_sum] + apply sum_eq_zero + intro t ht + exact exactMode_mul_eq_zero E n (hM s (mem_insert_self _ _)) + (hM t (mem_insert_of_mem ht)) (by intro h; subst t; exact hs ht) + +theorem lowModes_star (E : ℕ → FiniteHilbertSpace) (n K : ℕ) : + IsStarProjection (lowModes E n K) := + sum_exactMode_star E n _ (fun _ hs => mem_powerset.mp (mem_filter.mp hs).1) + +end Ostmann.Supply.TensorModes + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TensorOperators.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TensorOperators.lean new file mode 100644 index 0000000000000000000000000000000000000000..9402533756b01b0009c918679f6724b72edaeb5b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TensorOperators.lean @@ -0,0 +1,294 @@ +import OAI.NumberTheory.Ostmann.Supply.BivariateTruncation + +namespace OAI + +noncomputable section +namespace Ostmann.Supply.TensorOperators +open scoped BigOperators TensorProduct + +structure FiniteHilbertSpace where + carrier : Type + [normedAddCommGroup : NormedAddCommGroup carrier] + [innerProductSpace : InnerProductSpace ℂ carrier] + [finiteDimensional : FiniteDimensional ℂ carrier] + +attribute [instance] FiniteHilbertSpace.normedAddCommGroup + FiniteHilbertSpace.innerProductSpace FiniteHilbertSpace.finiteDimensional + +instance : CoeSort FiniteHilbertSpace Type := ⟨FiniteHilbertSpace.carrier⟩ + +namespace FiniteHilbertSpace + +def of (E : Type) [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [FiniteDimensional ℂ E] : FiniteHilbertSpace := ⟨E⟩ + +def tensor (E F : FiniteHilbertSpace) : FiniteHilbertSpace := + of (E ⊗[ℂ] F) + +instance (E : FiniteHilbertSpace) : CompleteSpace E := + FiniteDimensional.complete ℂ E + +end FiniteHilbertSpace + +def tensorSpace (E : ℕ → FiniteHilbertSpace) : ℕ → FiniteHilbertSpace + | 0 => FiniteHilbertSpace.of ℂ + | n + 1 => FiniteHilbertSpace.tensor (tensorSpace E n) (E n) + +def tensorOp {E F : ℕ → FiniteHilbertSpace} (T : ∀ i, E i →L[ℂ] F i) : + (n : ℕ) → tensorSpace E n →L[ℂ] tensorSpace F n + | 0 => ContinuousLinearMap.id ℂ ℂ + | n + 1 => TensorProduct.mapL (tensorOp T n) (T n) + +def pureTensor {E : ℕ → FiniteHilbertSpace} (v : ∀ i, E i) : + (n : ℕ) → tensorSpace E n + | 0 => (1 : ℂ) + | n + 1 => pureTensor v n ⊗ₜ[ℂ] v n + +theorem tensorOp_pureTensor {E F : ℕ → FiniteHilbertSpace} + (T : ∀ i, E i →L[ℂ] F i) (v : ∀ i, E i) (n : ℕ) : + tensorOp T n (pureTensor v n) = pureTensor (fun i => T i (v i)) n := by + induction n with + | zero => rfl + | succ n ih => + change TensorProduct.mapL (tensorOp T n) (T n) (pureTensor v n ⊗ₜ[ℂ] v n) = _ + rw [TensorProduct.mapL_tmul, ih] + rfl + +theorem norm_tensorOp_le {E F : ℕ → FiniteHilbertSpace} + (T : ∀ i, E i →L[ℂ] F i) (n : ℕ) : + ‖tensorOp T n‖ ≤ ∏ i ∈ Finset.range n, ‖T i‖ := by + induction n with + | zero => + change ‖ContinuousLinearMap.id ℂ ℂ‖ ≤ 1 + exact ContinuousLinearMap.norm_id_le + | succ n ih => + rw [Finset.prod_range_succ] + exact (TensorProduct.norm_mapL_le (tensorOp T n) (T n)).trans + (mul_le_mul_of_nonneg_right ih (norm_nonneg _)) + +theorem norm_tensorOp_le_of_local {E F : ℕ → FiniteHilbertSpace} + (T : ∀ i, E i →L[ℂ] F i) (M : ℕ → ℝ) (n : ℕ) + (hM : ∀ i < n, ‖T i‖ ≤ M i) : + ‖tensorOp T n‖ ≤ ∏ i ∈ Finset.range n, M i := by + apply (norm_tensorOp_le T n).trans + exact Finset.prod_le_prod₀ (fun i hi => norm_nonneg _) (fun i hi => hM i (Finset.mem_range.mp hi)) + +theorem norm_pureTensor {E : ℕ → FiniteHilbertSpace} (v : ∀ i, E i) (n : ℕ) : + ‖pureTensor v n‖ = ∏ i ∈ Finset.range n, ‖v i‖ := by + induction n with + | zero => + change ‖(1 : ℂ)‖ = 1 + exact norm_one + | succ n ih => + change ‖pureTensor v n ⊗ₜ[ℂ] v n‖ = _ + rw [TensorProduct.norm_tmul, ih, Finset.prod_range_succ] + +theorem pureTensor_inner {E : ℕ → FiniteHilbertSpace} + (v w : ∀ i, E i) (n : ℕ) : + inner ℂ (pureTensor v n) (pureTensor w n) = + ∏ i ∈ Finset.range n, inner ℂ (v i) (w i) := by + induction n with + | zero => + change inner ℂ (1 : ℂ) 1 = 1 + simp + | succ n ih => + change inner ℂ (pureTensor v n ⊗ₜ[ℂ] v n) (pureTensor w n ⊗ₜ[ℂ] w n) = _ + rw [TensorProduct.inner_tmul, ih, Finset.prod_range_succ] + +open scoped BigOperators TensorProduct +open BivariateTruncation + +section Evaluation +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] + +def evalLinearMap (u v : ℂ) : ((ℕ × ℕ) →₀ E) →ₗ[ℂ] E := + Finsupp.lsum ℂ (fun ij => (u ^ ij.1 * v ^ ij.2) • LinearMap.id) + +@[simp] lemma evalLinearMap_apply (u v : ℂ) (c : (ℕ × ℕ) →₀ E) : + evalLinearMap u v c = eval c u v := rfl + +@[simp] lemma eval_single (ij : ℕ × ℕ) (a : E) (u v : ℂ) : + eval (Finsupp.single ij a) u v = (u ^ ij.1 * v ^ ij.2) • a := by + change evalLinearMap (E := E) u v (Finsupp.single ij a) = _ + unfold evalLinearMap + rw [Finsupp.lsum_single] + rfl + +lemma eval_sum {α : Type*} (s : Finset α) (c : α → (ℕ × ℕ) →₀ E) (u v : ℂ) : + eval (∑ x ∈ s, c x) u v = ∑ x ∈ s, eval (c x) u v := by + exact map_sum (evalLinearMap (E := E) u v) c s + +end Evaluation + +section Binary +variable {E F G H : Type*} + [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [NormedAddCommGroup F] [InnerProductSpace ℂ F] + [NormedAddCommGroup G] [InnerProductSpace ℂ G] + [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +lemma mapL_sum_left {α : Type*} (s : Finset α) (f : α → E →L[ℂ] F) (g : G →L[ℂ] H) : + TensorProduct.mapL (∑ x ∈ s, f x) g = ∑ x ∈ s, TensorProduct.mapL (f x) g := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert a s ha ih => simp only [Finset.sum_insert ha, TensorProduct.mapL_add_left, ih] + +lemma mapL_sum_right {α : Type*} (s : Finset α) (f : E →L[ℂ] F) (g : α → G →L[ℂ] H) : + TensorProduct.mapL f (∑ x ∈ s, g x) = ∑ x ∈ s, TensorProduct.mapL f (g x) := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert a s ha ih => simp only [Finset.sum_insert ha, TensorProduct.mapL_add_right, ih] + +def tensorPolynomial (c : (ℕ × ℕ) →₀ (E →L[ℂ] F)) + (d : (ℕ × ℕ) →₀ (G →L[ℂ] H)) : + (ℕ × ℕ) →₀ ((E ⊗[ℂ] G) →L[ℂ] (F ⊗[ℂ] H)) := + ∑ ij ∈ c.support, ∑ kl ∈ d.support, + Finsupp.single (ij.1 + kl.1, ij.2 + kl.2) (TensorProduct.mapL (c ij) (d kl)) + +theorem eval_tensorPolynomial (c : (ℕ × ℕ) →₀ (E →L[ℂ] F)) + (d : (ℕ × ℕ) →₀ (G →L[ℂ] H)) (u v : ℂ) : + eval (tensorPolynomial c d) u v = TensorProduct.mapL (eval c u v) (eval d u v) := by + simp only [tensorPolynomial, eval_sum, eval_single] + rw [eval, mapL_sum_left] + apply Finset.sum_congr rfl + intro ij hij + rw [eval, mapL_sum_right] + apply Finset.sum_congr rfl + intro kl hkl + rw [TensorProduct.mapL_smul_left] + rw [TensorProduct.mapL_smul_right] + apply ContinuousLinearMap.ext + intro z + simp only [smul_apply] + rw [smul_smul] + congr 1 + simp only [pow_add] + ring + +end Binary + +def tensorFamilyPolynomial {E F : ℕ → FiniteHilbertSpace} + (c : ∀ i, (ℕ × ℕ) →₀ (E i →L[ℂ] F i)) : + (n : ℕ) → (ℕ × ℕ) →₀ (tensorSpace E n →L[ℂ] tensorSpace F n) + | 0 => Finsupp.single (0,0) (ContinuousLinearMap.id ℂ ℂ) + | n + 1 => tensorPolynomial (tensorFamilyPolynomial c n) (c n) + +theorem eval_tensorFamilyPolynomial {E F : ℕ → FiniteHilbertSpace} + (c : ∀ i, (ℕ × ℕ) →₀ (E i →L[ℂ] F i)) (n : ℕ) (u v : ℂ) : + BivariateTruncation.eval (tensorFamilyPolynomial c n) u v = + tensorOp (fun i => BivariateTruncation.eval (c i) u v) n := by + induction n with + | zero => + change BivariateTruncation.eval + (Finsupp.single (0,0) (ContinuousLinearMap.id ℂ ℂ)) u v = ContinuousLinearMap.id ℂ ℂ + simp only [eval_single, pow_zero, one_mul, one_smul] + | succ n ih => + change BivariateTruncation.eval (tensorPolynomial (tensorFamilyPolynomial c n) (c n)) u v = + TensorProduct.mapL (tensorOp (fun i => BivariateTruncation.eval (c i) u v) n) + (BivariateTruncation.eval (c n) u v) + rw [eval_tensorPolynomial, ih] + +theorem norm_eval_tensorFamilyPolynomial_le {E F : ℕ → FiniteHilbertSpace} + (c : ∀ i, (ℕ × ℕ) →₀ (E i →L[ℂ] F i)) (n : ℕ) (u v : ℂ) : + ‖BivariateTruncation.eval (tensorFamilyPolynomial c n) u v‖ ≤ + ∏ i ∈ Finset.range n, ‖BivariateTruncation.eval (c i) u v‖ := by + rw [eval_tensorFamilyPolynomial] + exact norm_tensorOp_le _ _ + +theorem norm_eval_tensorFamilyPolynomial_le_of_local {E F : ℕ → FiniteHilbertSpace} + (c : ∀ i, (ℕ × ℕ) →₀ (E i →L[ℂ] F i)) (M : ℕ → ℝ) (n : ℕ) (u v : ℂ) + (hM : ∀ i < n, ‖BivariateTruncation.eval (c i) u v‖ ≤ M i) : + ‖BivariateTruncation.eval (tensorFamilyPolynomial c n) u v‖ ≤ + ∏ i ∈ Finset.range n, M i := by + rw [eval_tensorFamilyPolynomial] + exact norm_tensorOp_le_of_local _ M n hM + +theorem tensorFamily_coefficient_norm_le {E F : ℕ → FiniteHilbertSpace} + (c : ∀ i, (ℕ × ℕ) →₀ (E i →L[ℂ] F i)) (M : ℕ → ℝ) (n : ℕ) + {r : ℝ} (hr : 0 < r) + (hM : ∀ k < n, ∀ u v : ℂ, ‖u‖ = r → ‖v‖ = r → + ‖BivariateTruncation.eval (c k) u v‖ ≤ M k) (i j : ℕ) : + ‖tensorFamilyPolynomial c n (i,j)‖ ≤ (∏ k ∈ Finset.range n, M k) / r ^ (i + j) := by + apply BivariateTruncation.coefficient_norm_le _ hr + intro u v hu hv + exact norm_eval_tensorFamilyPolynomial_le_of_local c M n u v + (fun k hk => hM k hk u v hu hv) + +theorem tensorFamily_rectangular_error_le {E F : ℕ → FiniteHilbertSpace} + (c : ∀ i, (ℕ × ℕ) →₀ (E i →L[ℂ] F i)) (M : ℕ → ℝ) (n : ℕ) + {r : ℝ} (hr : 1 < r) + (hM : ∀ k < n, ∀ u v : ℂ, ‖u‖ = r → ‖v‖ = r → + ‖BivariateTruncation.eval (c k) u v‖ ≤ M k) (K : ℕ) : + ‖BivariateTruncation.rectangularTruncation (tensorFamilyPolynomial c n) K - + tensorOp (fun k => BivariateTruncation.eval (c k) 1 1) n‖ ≤ + 2 * (∏ k ∈ Finset.range n, M k) * (r⁻¹) ^ K / (1 - r⁻¹) ^ 2 := by + rw [← eval_tensorFamilyPolynomial c n 1 1] + apply BivariateTruncation.rectangularTruncation_error_le _ hr + intro u v hu hv + exact norm_eval_tensorFamilyPolynomial_le_of_local c M n u v + (fun k hk => hM k hk u v hu hv) + +section LocalProjection +variable {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [NormedAddCommGroup F] [InnerProductSpace ℂ F] + +lemma eval_add (c d : (ℕ × ℕ) →₀ (E →L[ℂ] F)) (u v : ℂ) : + BivariateTruncation.eval (c + d) u v = + BivariateTruncation.eval c u v + BivariateTruncation.eval d u v := by + exact map_add (evalLinearMap (E := E →L[ℂ] F) u v) c d + +def projectionPolynomial (P : E →L[ℂ] E) (Q : F →L[ℂ] F) (L : E →L[ℂ] F) : + (ℕ × ℕ) →₀ (E →L[ℂ] F) := + Finsupp.single (0,0) (((ContinuousLinearMap.id ℂ F - Q) ∘L L) ∘L (ContinuousLinearMap.id ℂ E - P)) + + Finsupp.single (1,0) (((ContinuousLinearMap.id ℂ F - Q) ∘L L) ∘L P) + + Finsupp.single (0,1) ((Q ∘L L) ∘L (ContinuousLinearMap.id ℂ E - P)) + + Finsupp.single (1,1) ((Q ∘L L) ∘L P) + +theorem eval_projectionPolynomial (P : E →L[ℂ] E) (Q : F →L[ℂ] F) + (L : E →L[ℂ] F) (u v : ℂ) : + BivariateTruncation.eval (projectionPolynomial P Q L) u v = + ((ContinuousLinearMap.id ℂ F - Q + v • Q) ∘L L) ∘L + (ContinuousLinearMap.id ℂ E - P + u • P) := by + simp only [projectionPolynomial, eval_add, eval_single, pow_zero, pow_one, + one_mul, mul_one, one_smul] + ext x + simp only [add_apply, smul_apply, + ContinuousLinearMap.comp_apply, map_add, map_smul, smul_add, smul_smul] + rw [mul_comm u v] + abel + +lemma eval_projectionPolynomial_one (P : E →L[ℂ] E) (Q : F →L[ℂ] F) + (L : E →L[ℂ] F) : BivariateTruncation.eval (projectionPolynomial P Q L) 1 1 = L := by + rw [eval_projectionPolynomial] + simp + +theorem norm_eval_projectionPolynomial_le (P : E →L[ℂ] E) (Q : F →L[ℂ] F) + (L : E →L[ℂ] F) (u v : ℂ) : + ‖BivariateTruncation.eval (projectionPolynomial P Q L) u v‖ ≤ + (‖ContinuousLinearMap.id ℂ F - Q‖ + ‖v‖ * ‖Q‖) * ‖L‖ * + (‖ContinuousLinearMap.id ℂ E - P‖ + ‖u‖ * ‖P‖) := by + rw [eval_projectionPolynomial] + have hQ : ‖ContinuousLinearMap.id ℂ F - Q + v • Q‖ ≤ + ‖ContinuousLinearMap.id ℂ F - Q‖ + ‖v‖ * ‖Q‖ := by + simpa only [norm_smul] using norm_add_le (ContinuousLinearMap.id ℂ F - Q) (v • Q) + have hP : ‖ContinuousLinearMap.id ℂ E - P + u • P‖ ≤ + ‖ContinuousLinearMap.id ℂ E - P‖ + ‖u‖ * ‖P‖ := by + simpa only [norm_smul] using norm_add_le (ContinuousLinearMap.id ℂ E - P) (u • P) + calc + _ ≤ ‖(ContinuousLinearMap.id ℂ F - Q + v • Q) ∘L L‖ * + ‖ContinuousLinearMap.id ℂ E - P + u • P‖ := ContinuousLinearMap.opNorm_comp_le _ _ + _ ≤ (‖ContinuousLinearMap.id ℂ F - Q + v • Q‖ * ‖L‖) * + ‖ContinuousLinearMap.id ℂ E - P + u • P‖ := + mul_le_mul_of_nonneg_right (ContinuousLinearMap.opNorm_comp_le _ _) (norm_nonneg _) + _ ≤ _ := mul_le_mul + (mul_le_mul_of_nonneg_right hQ (norm_nonneg _)) hP (norm_nonneg _) (by positivity) + +end LocalProjection + +end Ostmann.Supply.TensorOperators + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TernaryProductPolynomial.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TernaryProductPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..970bfb42b6947b7a788226e69ee8ee416044b37f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TernaryProductPolynomial.lean @@ -0,0 +1,125 @@ +import Mathlib.Algebra.Polynomial.Derivative +import Mathlib.Algebra.Polynomial.BigOperators +import Mathlib.Tactic.LinearCombination +import OAI.NumberTheory.Ostmann.Construction.DistinctTupleProducts + +namespace OAI + +/-! # The generating polynomial for a finite ternary population + +The differential equation below yields an elementary repeat-removal bound. +It uses only `y^3 = y`, the identity satisfied by the oriented quadratic +characters, and does not invoke partition inversion as an additional input. +-/ + +namespace Ostmann + +open scoped BigOperators Classical +open Polynomial + +noncomputable def ternaryProduct {A : Type*} (S : Finset A) (y : A → ℝ) : ℝ[X] := + ∏ i ∈ S, (1 + C (y i) * X) + +theorem ternaryProduct_coeff {A : Type*} [DecidableEq A] + (S : Finset A) (y : A → ℝ) (k : ℕ) : + (ternaryProduct S y).coeff k = ∑ T ∈ S.powersetCard k, ∏ i ∈ T, y i := by + have hexp : ternaryProduct S y = + ∑ T ∈ S.powerset, C (∏ i ∈ T, y i) * X ^ T.card := by + unfold ternaryProduct + simp_rw [add_comm (1 : ℝ[X])] + rw [Finset.prod_add_one] + apply Finset.sum_congr rfl + intro T _ + simp only [Finset.prod_mul_distrib, ← map_prod, Finset.prod_const] + rw [hexp, finsetSum_coeff] + simp only [coeff_C_mul_X_pow] + rw [Finset.powersetCard_eq_filter, Finset.sum_filter] + apply Finset.sum_congr rfl + intro T _ + simp only [eq_comm] + +theorem distinct_tuple_product_coeff {A : Type*} [Fintype A] [DecidableEq A] + (y : A → ℝ) (k : ℕ) : + (∑ e : Fin k ↪ A, ∏ i, y (e i)) = + (k.factorial : ℝ) * (ternaryProduct Finset.univ y).coeff k := by + rw [ternaryProduct_coeff, distinct_tuple_sum] + +theorem ternaryProduct_differential {A : Type*} [DecidableEq A] + (S : Finset A) (y : A → ℝ) (hy : ∀ i ∈ S, (y i) ^ 3 = y i) : + (1 - X ^ 2) * derivative (ternaryProduct S y) = + (C (∑ i ∈ S, y i) - C (∑ i ∈ S, (y i) ^ 2) * X) * ternaryProduct S y := by + have hterm (i : A) (hi : i ∈ S) : + (1 - X ^ 2) * C (y i) = + (C (y i) - C ((y i) ^ 2) * X) * (1 + C (y i) * X) := by + have hc : C (y i) ^ 3 = (C (y i) : ℝ[X]) := by rw [← map_pow, hy i hi] + simp only [map_pow] + linear_combination X ^ 2 * hc + unfold ternaryProduct + rw [derivative_prod_finset, Finset.mul_sum] + calc + _ = ∑ i ∈ S, (C (y i) - C ((y i) ^ 2) * X) * + ∏ j ∈ S, (1 + C (y j) * X) := by + apply Finset.sum_congr rfl + intro i hi + simp only [derivative_add, derivative_one, derivative_mul, derivative_C, + zero_mul, derivative_X, mul_one, zero_add] + rw [show (1 - X ^ 2) * ((∏ j ∈ S.erase i, (1 + C (y j) * X)) * C (y i)) = + ((1 - X ^ 2) * C (y i)) * ∏ j ∈ S.erase i, (1 + C (y j) * X) by ring, + hterm i hi, mul_assoc, Finset.mul_prod_erase S (fun j => (1 + C (y j) * X : ℝ[X])) hi] + _ = _ := by + rw [← Finset.sum_mul, Finset.sum_sub_distrib, ← Finset.sum_mul, ← map_sum, ← map_sum] + +theorem ternaryProduct_coeff_recurrence {A : Type*} [DecidableEq A] + (S : Finset A) (y : A → ℝ) (hy : ∀ i ∈ S, (y i) ^ 3 = y i) (n : ℕ) : + ((n + 2 : ℕ) : ℝ) * (ternaryProduct S y).coeff (n + 2) = + (∑ i ∈ S, y i) * (ternaryProduct S y).coeff (n + 1) - + ((∑ i ∈ S, (y i) ^ 2) - n) * (ternaryProduct S y).coeff n := by + have h := congrArg (fun p : ℝ[X] => p.coeff (n + 1)) + (ternaryProduct_differential S y hy) + simp only [sub_mul, one_mul, coeff_sub, coeff_derivative, coeff_C_mul] at h + have hx : (X ^ 2 * derivative (ternaryProduct S y)).coeff (n + 1) = + n * (ternaryProduct S y).coeff n := by + cases n with + | zero => simp [coeff_X_pow_mul'] + | succ n => + rw [show n + 1 + 1 = n + 2 by omega, coeff_X_pow_mul] + simp only [coeff_derivative] + push_cast + ring + have hx' : (C (∑ i ∈ S, (y i) ^ 2) * X * ternaryProduct S y).coeff (n + 1) = + (∑ i ∈ S, (y i) ^ 2) * (ternaryProduct S y).coeff n := by + rw [mul_assoc, coeff_C_mul, coeff_X_mul] + rw [hx, hx'] at h + push_cast at h ⊢ + nlinarith only [h] + +noncomputable def ternaryDistinct {A : Type*} (S : Finset A) (y : A → ℝ) (k : ℕ) : ℝ := + (k.factorial : ℝ) * (ternaryProduct S y).coeff k + +@[simp] theorem ternaryDistinct_zero {A : Type*} (S : Finset A) (y : A → ℝ) : + ternaryDistinct S y 0 = 1 := by + simp [ternaryDistinct, ternaryProduct, coeff_zero_prod] + +@[simp] theorem ternaryDistinct_one {A : Type*} [DecidableEq A] + (S : Finset A) (y : A → ℝ) : + ternaryDistinct S y 1 = ∑ i ∈ S, y i := by + rw [ternaryDistinct, ternaryProduct_coeff] + simp [Finset.powersetCard_one] + +theorem ternaryDistinct_recurrence {A : Type*} [DecidableEq A] + (S : Finset A) (y : A → ℝ) (hy : ∀ i ∈ S, (y i) ^ 3 = y i) (n : ℕ) : + ternaryDistinct S y (n + 2) = + (∑ i ∈ S, y i) * ternaryDistinct S y (n + 1) - + (n + 1) * ((∑ i ∈ S, (y i) ^ 2) - n) * ternaryDistinct S y n := by + have h := ternaryProduct_coeff_recurrence S y hy n + push_cast at h + unfold ternaryDistinct + rw [show (n + 2).factorial = (n + 2) * (n + 1).factorial from Nat.factorial_succ (n + 1)] + push_cast + rw [mul_assoc, mul_left_comm ((n : ℝ) + 2), h, Nat.factorial_succ] + push_cast + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TruncatedBilinearCube.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TruncatedBilinearCube.lean new file mode 100644 index 0000000000000000000000000000000000000000..a6a9f9b103be0a276e06f3ec5936e496601b7d47 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TruncatedBilinearCube.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.Supply.BilinearCube +import OAI.NumberTheory.Ostmann.Supply.ElementaryPolynomial + +namespace OAI + +/-! # Exact truncation of the two subset choices -/ +namespace Ostmann +open scoped Classical BigOperators + +theorem cubeCoefficient_truncation {n : ℕ} (A : BilinearCube n → ℂ) (K : ℕ) : + rectangularPolynomialSum (cubeCoefficient A) (n + 1) K = + ∑ v ∈ (Finset.univ : Finset (BilinearCube n)).filter + (fun v => cubeDegree v false ≤ K ∧ cubeDegree v true ≤ K), A v := by + let B : BilinearCube n → ℂ := fun v => + if cubeDegree v false ≤ K ∧ cubeDegree v true ≤ K then A v else 0 + have hc (j k : ℕ) : cubeCoefficient B j k = + if j ≤ K ∧ k ≤ K then cubeCoefficient A j k else 0 := by + unfold cubeCoefficient + calc + _ = ∑ v ∈ (Finset.univ : Finset (BilinearCube n)).filter + (fun v => (cubeDegree v false, cubeDegree v true) = (j, k)), + if j ≤ K ∧ k ≤ K then A v else 0 := by + apply Finset.sum_congr rfl + intro v hv + have he := (Finset.mem_filter.mp hv).2 + have hj : cubeDegree v false = j := congrArg Prod.fst he + have hk : cubeDegree v true = k := congrArg Prod.snd he + dsimp only [B] + simp only [hj, hk] + _ = _ := by by_cases h : j ≤ K ∧ k ≤ K <;> simp [h] + have hh := cubeCoefficient_polynomial B 1 1 + simp only [finitePolynomial₂, finitePolynomial, hc, one_pow, one_mul, + smul_eq_mul] at hh + simpa only [rectangularPolynomialSum, B, Finset.sum_filter] using hh + +noncomputable def subsetPairFactor (b : ℂ) : Bool × Bool → ℂ + | (false, false) => 1 + | (true, false) => b + | (false, true) => b + | (true, true) => b ^ 2 + +theorem subsetPair_cubeCoefficient {n : ℕ} (b : Fin n → ℂ) + (j k : ℕ) (hj : j < n + 1) (hk : k < n + 1) : + cubeCoefficient (fun v => ∏ i, subsetPairFactor (b i) (v i)) j k = + elementaryCoefficient b j * elementaryCoefficient b k := by + apply finitePolynomial₂_coefficient_unique (N := n + 1) _ _ _ j k hj hk + intro u v + rw [← bilinear_product_expansion, elementaryCoefficient_product, ← Finset.prod_mul_distrib] + apply Finset.prod_congr rfl + intro i _ + simp only [subsetPairFactor] + ring + +theorem elementaryTruncation_square_cube {n : ℕ} (b : Fin n → ℂ) (K : ℕ) : + elementaryTruncation b K ^ 2 = + ∑ v ∈ (Finset.univ : Finset (BilinearCube n)).filter + (fun v => cubeDegree v false ≤ K ∧ cubeDegree v true ≤ K), + ∏ i, subsetPairFactor (b i) (v i) := by + rw [← cubeCoefficient_truncation, ← elementaryTruncation_square] + unfold rectangularPolynomialSum + apply Finset.sum_congr rfl + intro j hj + apply Finset.sum_congr rfl + intro k hk + by_cases h : j ≤ K ∧ k ≤ K + · simp only [h] + exact (subsetPair_cubeCoefficient b j k (Finset.mem_range.mp hj) + (Finset.mem_range.mp hk)).symm + · simp only [h, ite_false] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TruncatedWeight.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TruncatedWeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..33652a871b448814fb50db8df302bffe9d8760b3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TruncatedWeight.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.Ostmann.Supply.PolynomialFunctional + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators +open TensorOperators BivariateTruncation + +variable {ι : Type*} + +def truncatedSubsetSum {R : Type*} [CommSemiring R] (P : Finset ι) (b : ι→R) (K : ℕ) : R := + ∑s∈P.powerset.filter (fun s => s.card≤K),∏i∈s,b i + +def truncatedWeight (P : Finset ι) (b : ι→ℝ) (K : ℕ) : ℝ := + (truncatedSubsetSum P b K)^2 + +theorem truncatedWeight_nonneg (P : Finset ι) (b : ι→ℝ) (K : ℕ) : + 0≤truncatedWeight P b K := sq_nonneg _ + +def subsetPairPolynomial (P : Finset ι) (b : ι→ℂ) : (ℕ×ℕ)→₀ℂ := + ∑s∈P.powerset,∑t∈P.powerset, + Finsupp.single (s.card,t.card) ((∏i∈s,b i)*(∏i∈t,b i)) + +theorem eval_subsetPairPolynomial (P : Finset ι) (b : ι→ℂ) (u v : ℂ) : + eval (subsetPairPolynomial P b) u v = ∏i∈P,(1+u*b i)*(1+v*b i) := by + classical + simp only [subsetPairPolynomial,eval_sum,eval_single,smul_eq_mul] + rw [Finset.prod_mul_distrib,Finset.prod_one_add,Finset.prod_one_add, + Finset.sum_mul] + apply Finset.sum_congr rfl + intro s hs + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro t ht + simp only [Finset.prod_mul_distrib,Finset.prod_const] + ring + +theorem rectangularTruncation_subsetPairPolynomial (P : Finset ι) (b : ι→ℂ) (K : ℕ) : + rectangularTruncation (subsetPairPolynomial P b) K = (truncatedSubsetSum P b K)^2 := by + classical + simp only [subsetPairPolynomial,rectangularTruncation_sum,rectangularTruncation_single, + truncatedSubsetSum,Finset.sum_filter,pow_two,Finset.sum_mul,Finset.mul_sum] + apply Finset.sum_congr rfl + intro s hs + apply Finset.sum_congr rfl + intro t ht + by_cases hsK : s.card≤K <;> by_cases htK : t.card≤K <;> simp [hsK,htK,mul_comm] + +theorem rectangularTruncation_real_subsetPairPolynomial (P : Finset ι) (b : ι→ℝ) (K : ℕ) : + rectangularTruncation (subsetPairPolynomial P (fun i => (b i:ℂ))) K = + (truncatedWeight P b K:ℂ) := by + rw [rectangularTruncation_subsetPairPolynomial] + simp [truncatedWeight,truncatedSubsetSum] + +theorem rectangularTruncation_eq_weight {c : (ℕ×ℕ)→₀ℂ} (P : Finset ι) (b : ι→ℝ) + (h : ∀u v : ℂ,eval c u v=∏i∈P,(1+u*(b i:ℂ))*(1+v*(b i:ℂ))) (K : ℕ) : + rectangularTruncation c K=(truncatedWeight P b K:ℂ) := by + have he : c=subsetPairPolynomial P (fun i => (b i:ℂ)) := + eq_of_eval_eq (fun u v => (h u v).trans (eval_subsetPairPolynomial P _ u v).symm) + rw [he,rectangularTruncation_real_subsetPairPolynomial] + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TruncationMargins.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TruncationMargins.lean new file mode 100644 index 0000000000000000000000000000000000000000..e84167d595ef438fd40fabd7855062db4e912097 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TruncationMargins.lean @@ -0,0 +1,90 @@ +import OAI.NumberTheory.Ostmann.Supply.KernelTruncatedWeight +import OAI.NumberTheory.Ostmann.Supply.TruncationScale + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open Filter +open scoped BigOperators + +theorem supply_tail_le_contracted_unit {L H U : ℝ} (hL : 0≤L) (hH : H≤L) + (hU : Real.exp (-8*supplyEpsilon*H)≤U) : + Real.exp (-10*L)≤U*Real.exp (-(8/5:ℝ)*H) := by + have hc : 0≤8*supplyEpsilon+(8/5:ℝ) := by norm_num [supplyEpsilon] + have hh := mul_le_mul_of_nonneg_left hH hc + have he : -10*L≤-8*supplyEpsilon*H-(8/5:ℝ)*H := by + norm_num only [supplyEpsilon] at hh ⊢ + linarith + calc + _ ≤ Real.exp (-8*supplyEpsilon*H-(8/5:ℝ)*H) := Real.exp_le_exp.mpr he + _ = Real.exp (-8*supplyEpsilon*H)*Real.exp (-(8/5:ℝ)*H) := by rw [←Real.exp_add]; congr 1; ring + _ ≤ _ := mul_le_mul_of_nonneg_right hU (Real.exp_pos _).le + +theorem supply_tail_le_half_unit {L H U : ℝ} (hL : 1≤L) (hH : H≤L) + (hU : Real.exp (-8*supplyEpsilon*H)≤U) : + Real.exp (-10*L)≤U/2 := by + have hh := mul_le_mul_of_nonneg_left hH + (by norm_num [supplyEpsilon] : 0≤8*supplyEpsilon) + have he : -10*L≤-8*supplyEpsilon*H-1 := by + norm_num only [supplyEpsilon] at hh ⊢ + linarith + have he1 : (2:ℝ)≤Real.exp 1 := by have := Real.add_one_le_exp (1:ℝ); linarith + calc + _ ≤ Real.exp (-8*supplyEpsilon*H-1) := Real.exp_le_exp.mpr he + _ = Real.exp (-8*supplyEpsilon*H)/Real.exp 1 := Real.exp_sub _ _ + _ ≤ Real.exp (-8*supplyEpsilon*H)/2 := + div_le_div_of_nonneg_left (Real.exp_pos _).le (by norm_num) he1 + _ ≤ U/2 := div_le_div_of_nonneg_right hU (by norm_num) + +theorem eventually_kernelTruncation_norm_contracted : + ∀ᶠL:ℝ in atTop, ∀p:ℕ→ℕ,∀ _hzero:∀i,NeZero (p i), + ∀S:∀i,Finset (ZMod (p i)),∀n:ℕ, + (∀i by have := hp i (Finset.mem_range.mp hi); omega) + (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 hsmall := (htail _ 3 hH (by norm_num) (by norm_num)).trans + (supply_tail_le_contracted_unit hL hH hU) + have hk := kernelTruncation_norm p S n (supplyTruncation L) hp hlo hhi hg + linarith + +theorem eventually_unitWeightMean_comparable {ι : Type*} [Fintype ι] [DecidableEq ι] : + ∀ᶠL:ℝ in atTop, ∀p:ι→ℕ,∀ _hp:∀i,Fact (p i).Prime, + ∀S:∀i,Finset (ZMod (p i)), + (∀i,(1/3:ℝ)≤density (S i)) → (∀i,density (S i)≤2/3) → + (∀i,gamma (S i)≤ supplyEpsilon^2) → (∑i,1/(p i:ℝ))≤L → + (∏i,unitKernelMean (S i) sparseKernelScale)/2≤unitWeightMean p S (supplyTruncation L) ∧ + unitWeightMean p S (supplyTruncation L)≤2*(∏i,unitKernelMean (S i) sparseKernelScale) := by + filter_upwards [eventually_supply_tail_small,eventually_ge_atTop (1:ℝ)] with L htail hL + intro p hp S hlo hhi hg hH + let : ∀i,Fact (p i).Prime := hp + have hU := (kernelUnitProduct_exp_bounds Finset.univ p S + (fun i _ => (Fact.out : (p i).Prime).two_le) + (fun i _ => hlo i) (fun i _ => hhi i) (fun i _ => hg i)).1 + have hsmall := (htail _ (8*supplyEpsilon) hH + (by norm_num [supplyEpsilon]) (by norm_num [supplyEpsilon])).trans + (supply_tail_le_half_unit hL hH hU) + have herror := (unitWeightMean_error p S (supplyTruncation L) hlo hhi hg).trans hsmall + obtain ⟨ha,hb⟩ := abs_le.mp herror + have hpos : 0≤(∏i,unitKernelMean (S i) sparseKernelScale) := + (Real.exp_pos _).le.trans hU + change _≤(∏i,unitKernelMean (S i) sparseKernelScale)/2 at hb + change -((∏i,unitKernelMean (S i) sparseKernelScale)/2)≤_ at ha + constructor <;> linarith + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/TruncationScale.lean b/lean/OAI/NumberTheory/Ostmann/Supply/TruncationScale.lean new file mode 100644 index 0000000000000000000000000000000000000000..8cf9968a38686f7857ee96900d52df350f41019b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/TruncationScale.lean @@ -0,0 +1,66 @@ +import OAI.NumberTheory.Ostmann.Supply.RetainedBandScales +import OAI.NumberTheory.Ostmann.Supply.UnitWeightTruncation + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open Filter +open scoped BigOperators + +theorem supplyTruncation_ge (L : ℝ) : 10000*L≤(supplyTruncation L:ℝ) := + Nat.le_ceil _ + +theorem supply_inverse_radius_power_le {L : ℝ} (_hL : 0≤L) : + ((103/100:ℝ)⁻¹)^(supplyTruncation L)≤Real.exp (-100*L) := by + have hlog : (1/100:ℝ)≤Real.log (103/100) := by + have h := Real.one_sub_inv_le_log_of_pos (by norm_num : (0:ℝ)<103/100) + norm_num at h ⊢ + linarith + have hk := supplyTruncation_ge L + have hk0 : (0:ℝ)≤ supplyTruncation L := Nat.cast_nonneg _ + rw [←Real.exp_log (by norm_num : (0:ℝ)<(103/100:ℝ)⁻¹),←Real.exp_nat_mul, + Real.log_inv] + apply Real.exp_le_exp.mpr + nlinarith + +theorem supply_tail_le {L H C : ℝ} (hL : 0≤L) (hH : H≤L) + (hC : 0≤C) (hC3 : C≤3) : + 2*Real.exp (C*H)*((103/100:ℝ)⁻¹)^(supplyTruncation L)/ + (1-(103/100:ℝ)⁻¹)^2≤2400*Real.exp (-97*L) := by + have hCH : C*H≤3*L := (mul_le_mul_of_nonneg_left hH hC).trans + (mul_le_mul_of_nonneg_right hC3 hL) + have hmul := mul_le_mul (Real.exp_le_exp.mpr hCH) + (supply_inverse_radius_power_le hL) (by positivity) (Real.exp_pos _).le + have he : Real.exp (3*L)*Real.exp (-100*L)=Real.exp (-97*L) := by + rw [←Real.exp_add] + congr 1 + ring + rw [he] at hmul + have hh := mul_le_mul_of_nonneg_left hmul + (by norm_num : (0:ℝ)≤2/(1-(103/100:ℝ)⁻¹)^2) + calc + _ ≤ (2/(1-(103/100:ℝ)⁻¹)^2)*Real.exp (-97*L) := by + convert hh using 1 + ring + _ ≤ 2400*Real.exp (-97*L) := by gcongr; norm_num + +theorem eventually_supply_tail_small : + ∀ᶠL:ℝ in atTop, ∀H C:ℝ, H≤L → 0≤C → C≤3 → + 2*Real.exp (C*H)*((103/100:ℝ)⁻¹)^(supplyTruncation L)/ + (1-(103/100:ℝ)⁻¹)^2≤Real.exp (-10*L) := by + have hh : ∀ᶠL:ℝ in atTop, (2400:ℝ)≤Real.exp (87*L) := + (Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop (by norm_num))).eventually + (eventually_ge_atTop _) + filter_upwards [hh,eventually_ge_atTop (0:ℝ)] with L hh hL + intro H C hH hC hC3 + apply (supply_tail_le hL hH hC hC3).trans + calc + _ ≤ Real.exp (87*L)*Real.exp (-97*L) := mul_le_mul_of_nonneg_right hh (Real.exp_pos _).le + _ = Real.exp (-10*L) := by rw [←Real.exp_add]; congr 1; ring + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/UniformBalanced.lean b/lean/OAI/NumberTheory/Ostmann/Supply/UniformBalanced.lean new file mode 100644 index 0000000000000000000000000000000000000000..66b714e9533d8c928b69238a4dba54c8c7357b5d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/UniformBalanced.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.Ostmann.Supply.UniformNorms + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [NeZero p] + +theorem balanced_nonempty (S : Finset (ZMod p)) (hlo : (1/3:ℝ) ≤ density S) : + S.Nonempty := by + by_contra h + have hz : S.card = 0 := Finset.card_eq_zero.mpr (Finset.not_nonempty_iff_eq_empty.mp h) + norm_num [density,hz] at hlo + +theorem balanced_compl (S : Finset (ZMod p)) + (hlo : (1/3:ℝ) ≤ density S) (hhi : density S ≤ 2/3) : + (1/3:ℝ) ≤ density Sᶜ ∧ density Sᶜ ≤ 2/3 := by + rw [density_compl] + constructor <;> linarith + +theorem balanced_uniform_norm_sq (S : Finset (ZMod p)) + (hlo : (1/3:ℝ) ≤ density S) : ‖uniformVector S‖^2 ≤ 3/(p:ℝ) := by + have hp : (0:ℝ)

EuclideanSpace ℂ (ZMod p) + +def oneVector : H := WithLp.toLp 2 (fun _ => 1) + +omit [NeZero p] in +@[simp] theorem oneVector_apply (x : ZMod p) : oneVector x = 1 := rfl + +def uniformCoefficient (S : Finset (ZMod p)) : ℝ := + Real.sqrt (density S*(1-density S))/(S.card:ℝ) + +theorem uniformVector_decomposition (S : Finset (ZMod p)) + (hpos : 0 < density S) (hlt : density S < 1) : + uniformVector S = (p : ℂ)⁻¹ • oneVector + + (uniformCoefficient S : ℂ) • normalizedVector S := by + have hp : (p:ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p + have hs : (S.card:ℝ) ≠ 0 := by + intro hh + simp [density, hh] at hpos + have hv : 0 < density S*(1-density S) := mul_pos hpos (sub_pos.mpr hlt) + have hr : Real.sqrt (density S*(1-density S)) ≠ 0 := (Real.sqrt_pos.mpr hv).ne' + have hid (a : ℝ) : a/(S.card:ℝ) = (p:ℝ)⁻¹ + + uniformCoefficient S * ((a-density S)/Real.sqrt (density S*(1-density S))) := by + unfold uniformCoefficient + have hcancel : Real.sqrt (density S*(1-density S))/(S.card:ℝ) * + ((a-density S)/Real.sqrt (density S*(1-density S))) = (a-density S)/(S.card:ℝ) := by + field_simp + rw [hcancel] + simp only [density, ZMod.card] + field_simp + ring + ext x + simp only [PiLp.add_apply, PiLp.smul_apply, oneVector_apply, normalizedVector_apply, + uniformVector_apply, smul_eq_mul, mul_one, + normalizedIndicator, centeredIndicator] + have hh := congrArg (fun r : ℝ => (r:ℂ)) (hid (if x ∈ S then 1 else 0)) + push_cast at hh + split_ifs at hh ⊢ with hx <;> simpa using hh + +theorem uniformVector_compl_decomposition (S : Finset (ZMod p)) + (hpos : 0 < density S) (hlt : density S < 1) : + uniformVector Sᶜ = (p : ℂ)⁻¹ • oneVector - + (uniformCoefficient Sᶜ : ℂ) • normalizedVector S := by + have hd : density Sᶜ = 1-density S := by + have hc := Finset.card_add_card_compl S + rw [ZMod.card p] at hc + have hp : (p:ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p + simp only [density,ZMod.card] + have hcr : (S.card:ℝ)+(Sᶜ.card:ℝ) = p := by exact_mod_cast hc + field_simp + linarith + have hn : normalizedVector Sᶜ = -normalizedVector S := by + ext x + simp only [normalizedVector_apply, PiLp.neg_apply, normalizedIndicator, + centeredIndicator, hd] + push_cast + have hh : (1-density S)*(1-(1-density S)) = density S*(1-density S) := by ring + rw [hh] + by_cases hx : x∈S <;> simp [hx] <;> ring + rw [uniformVector_decomposition Sᶜ (by rw [hd]; linarith) (by rw [hd]; linarith), hn, + smul_neg, sub_eq_add_neg] + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/UniformNorms.lean b/lean/OAI/NumberTheory/Ostmann/Supply/UniformNorms.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce4da8b51c6364d8cd7de63b1f8251e00f4d845f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/UniformNorms.lean @@ -0,0 +1,78 @@ +import OAI.NumberTheory.Ostmann.Supply.UniformDecomposition + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [NeZero p] + +theorem uniformVector_norm_sq (S : Finset (ZMod p)) (hS : S.Nonempty) : + ‖uniformVector S‖^2 = (S.card:ℝ)⁻¹ := by + have hs : (S.card:ℝ) ≠ 0 := by exact_mod_cast Finset.card_ne_zero.mpr hS + rw [PiLp.norm_sq_eq_of_L2] + simp only [uniformVector_apply, apply_ite, norm_zero, ite_pow, + zero_pow (by decide : 2 ≠ 0), norm_inv, Complex.norm_natCast, + Finset.sum_ite_mem, Finset.univ_inter, Finset.sum_const, nsmul_eq_mul] + field_simp + +theorem uniformCoefficient_nonneg (S : Finset (ZMod p)) : + 0 ≤ uniformCoefficient S := div_nonneg (Real.sqrt_nonneg _) (Nat.cast_nonneg _) + +theorem density_compl (S : Finset (ZMod p)) : density Sᶜ = 1-density S := by + have hc := Finset.card_add_card_compl S + rw [ZMod.card p] at hc + have hp : (p:ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p + have hcr : (S.card:ℝ)+(Sᶜ.card:ℝ) = p := by exact_mod_cast hc + simp only [density,ZMod.card] + field_simp + linarith + +theorem uniformCoefficient_mul_compl (S : Finset (ZMod p)) + (hpos : 0 < density S) (hlt : density S < 1) : + uniformCoefficient S * uniformCoefficient Sᶜ = (p:ℝ)⁻¹^2 := by + have hp : (p:ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p + have hs : (S.card:ℝ) ≠ 0 := by + intro hh + simp [density,hh] at hpos + have ht : (Sᶜ.card:ℝ) ≠ 0 := by + intro hh + have hd := density_compl S + simp [density,hh] at hd + simp only [density,ZMod.card] at hlt + linarith + have hv : 0 ≤ density S*(1-density S) := by positivity + have he : (1-density S)*(1-(1-density S)) = density S*(1-density S) := by ring + simp only [uniformCoefficient,density_compl,he] + rw [div_mul_div_comm, ← pow_two,Real.sq_sqrt hv] + have hc := Finset.card_add_card_compl S + rw [ZMod.card p] at hc + have hcr : (S.card:ℝ)+(Sᶜ.card:ℝ) = p := by exact_mod_cast hc + simp only [density,ZMod.card] + field_simp + nlinarith + +theorem uniformCoefficient_le (S : Finset (ZMod p)) + (hlo : (1/3:ℝ) ≤ density S) (hhi : density S ≤ 2/3) : + uniformCoefficient S ≤ 2/(p:ℝ) := by + have hp : (0:ℝ) < p := Nat.cast_pos.mpr (Nat.pos_of_ne_zero (NeZero.ne p)) + have hs : (0:ℝ) < S.card := by + have hh : 0 < density S := by linarith + exact (div_pos_iff_of_pos_right hp).mp (by simpa [density,ZMod.card] using hh) + have hvar : 0 ≤ density S*(1-density S) := + mul_nonneg (by linarith) (by linarith) + have hroot : Real.sqrt (density S*(1-density S)) ≤ 2*density S := by + have hsq := Real.sq_sqrt hvar + have hd0 : 0 ≤ density S := by linarith + nlinarith [mul_nonneg hd0 (by linarith : 0 ≤ 5*density S-1), Real.sqrt_nonneg (density S*(1-density S))] + have hh := (div_le_div_of_nonneg_right hroot hs.le) + have he : (2*density S)/(S.card:ℝ) = 2/(p:ℝ) := by + simp only [density,ZMod.card] + field_simp + simpa only [uniformCoefficient,he] using hh + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/UniformProjection.lean b/lean/OAI/NumberTheory/Ostmann/Supply/UniformProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..45c4c18c37c0e0d81a955547097fb16666647c5e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/UniformProjection.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.Supply.CenteredOrthogonality +import OAI.NumberTheory.Ostmann.Supply.KernelMoments +import OAI.NumberTheory.Ostmann.Supply.UniformNorms + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [NeZero p] +local notation "H" => EuclideanSpace ℂ (ZMod p) + +theorem spectralProjection_oneVector (E : Finset (ZMod p)) (hE : 0 ∉ E) : + spectralProjection E oneVector = 0 := by + rw [← convolution_fourierKernel] + ext x + simp only [convolutionOperator_apply, oneVector_apply, mul_one, fourierKernel_sum E hE, + PiLp.zero_apply] + +theorem spectralProjection_uniform (S : Finset (ZMod p)) + (hpos : 0 < density S) (hlt : density S < 1) : + spectralProjection (largeSpectrum S) (uniformVector S) = + (uniformCoefficient S : ℂ) • spectralProjection (largeSpectrum S) (normalizedVector S) := by + rw [uniformVector_decomposition S hpos hlt, map_add, map_smul, map_smul, + spectralProjection_oneVector _ (zero_not_mem_largeSpectrum S), smul_zero, zero_add] + +theorem spectralProjection_uniform_compl (S : Finset (ZMod p)) + (hpos : 0 < density S) (hlt : density S < 1) : + spectralProjection (largeSpectrum S) (uniformVector Sᶜ) = + -(uniformCoefficient Sᶜ : ℂ) • spectralProjection (largeSpectrum S) (normalizedVector S) := by + rw [uniformVector_compl_decomposition S hpos hlt, map_sub, map_smul, map_smul, + spectralProjection_oneVector _ (zero_not_mem_largeSpectrum S), smul_zero, zero_sub, + neg_smul] + +theorem centered_sparse_projection_le (S T : Finset (ZMod p)) {ε : ℝ} + (hT : centeredProjection T (normalizedVector S) = 0) + (hε : 0 ≤ ε) (hg : gamma S ≤ ε^2) : + ‖centeredProjection T (spectralProjection (largeSpectrum S) (normalizedVector S))‖ ≤ + ε*Real.sqrt p := by + have he : centeredProjection T (spectralProjection (largeSpectrum S) (normalizedVector S)) = + centeredProjection T (spectralProjection (largeSpectrum S) (normalizedVector S)-normalizedVector S) := by + rw [map_sub,hT,sub_zero] + rw [he] + exact ((centeredSpace T).norm_starProjection_apply_le _).trans + (sparse_projection_error_le S hε hg) + +theorem centered_projection_uniform_le (S T : Finset (ZMod p)) {ε : ℝ} + (hpos : 0 < density S) (hlt : density S < 1) + (hT : centeredProjection T (normalizedVector S) = 0) + (hε : 0 ≤ ε) (hg : gamma S ≤ ε^2) : + ‖centeredProjection T (spectralProjection (largeSpectrum S) (uniformVector S))‖ ≤ + uniformCoefficient S * (ε*Real.sqrt p) := by + rw [spectralProjection_uniform S hpos hlt,map_smul,norm_smul, + Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (uniformCoefficient_nonneg S)] + exact mul_le_mul_of_nonneg_left (centered_sparse_projection_le S T hT hε hg) + (uniformCoefficient_nonneg S) + +theorem centered_projection_uniform_compl_le (S T : Finset (ZMod p)) {ε : ℝ} + (hpos : 0 < density S) (hlt : density S < 1) + (hT : centeredProjection T (normalizedVector S) = 0) + (hε : 0 ≤ ε) (hg : gamma S ≤ ε^2) : + ‖centeredProjection T (spectralProjection (largeSpectrum S) (uniformVector Sᶜ))‖ ≤ + uniformCoefficient Sᶜ * (ε*Real.sqrt p) := by + rw [spectralProjection_uniform_compl S hpos hlt,map_smul,norm_smul,norm_neg, + Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (uniformCoefficient_nonneg Sᶜ)] + exact mul_le_mul_of_nonneg_left (centered_sparse_projection_le S T hT hε hg) + (uniformCoefficient_nonneg Sᶜ) + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/UnitKernelGenerating.lean b/lean/OAI/NumberTheory/Ostmann/Supply/UnitKernelGenerating.lean new file mode 100644 index 0000000000000000000000000000000000000000..17fc5a424b013f96b5d798991c2c739c3d59823a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/UnitKernelGenerating.lean @@ -0,0 +1,111 @@ +import OAI.NumberTheory.Ostmann.Supply.ContractingKernel + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators +variable {p : ℕ} [NeZero p] + +def unitKernelGenerating (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) : ℂ := + (∑x∈Finset.univ.erase 0,(1+u*(localKernel S t x:ℂ))*(1+v*(localKernel S t x:ℂ)))/((p:ℂ)-1) + +theorem unitKernelGenerating_expansion (S : Finset (ZMod p)) (t : ℝ) (u v : ℂ) + (hp : 2≤p) : + unitKernelGenerating S t u v = 1+(u+v)* + ((-(t*((largeSpectrum S).card:ℝ)/p)/((p:ℝ)-1):ℝ):ℂ)+ + (u*v)*((t^2*(((largeSpectrum S).card:ℝ)/p-(((largeSpectrum S).card:ℝ)/p)^2)/ + ((p:ℝ)-1):ℝ):ℂ) := by + have hcard : ((Finset.univ.erase (0:ZMod p)).card:ℂ) = (p:ℂ)-1 := by + simp [Finset.card_erase_of_mem,ZMod.card,Nat.cast_sub (show 1≤p by omega)] + have hpn : (p:ℂ)-1≠0 := by + have hpr : (2:ℝ)≤p := by exact_mod_cast hp + exact_mod_cast (show (p:ℝ)-1≠0 by linarith) + have hex (b : ℂ) : (1+u*b)*(1+v*b)=1+(u+v)*b+(u*v)*b^2 := by ring + unfold unitKernelGenerating + simp only [hex,Finset.sum_add_distrib,Finset.sum_const,nsmul_eq_mul,mul_one, + ←Finset.mul_sum,←Complex.ofReal_pow,←Complex.ofReal_sum,hcard, + localKernel_nonzero_sum,localKernel_nonzero_sum_sq] + push_cast + field_simp + +theorem unitKernelGenerating_one (S : Finset (ZMod p)) (t : ℝ) : + unitKernelGenerating S t 1 1=(unitKernelMean S t:ℂ) := by + unfold unitKernelGenerating unitKernelMean + push_cast + congr 1 + apply Finset.sum_congr rfl + intro x hx + ring + +theorem sparse_unit_moment_bounds (S : Finset (ZMod p)) {ε t : ℝ} + (hp : 2≤p) (ht : 0≤t) (ht1 : t≤1) (heps : 0≤ε) + (hE : ((largeSpectrum S).card:ℝ)/p≤ε) : + |-(t*((largeSpectrum S).card:ℝ)/p)/((p:ℝ)-1)| ≤ 2*ε/(p:ℝ) ∧ + |t^2*(((largeSpectrum S).card:ℝ)/p-(((largeSpectrum S).card:ℝ)/p)^2)/ + ((p:ℝ)-1)| ≤ 2*ε/(p:ℝ) := by + have hp2 : (2:ℝ)≤p := by exact_mod_cast hp + have hp0 : (0:ℝ)

ring + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/UnitKernelMean.lean b/lean/OAI/NumberTheory/Ostmann/Supply/UnitKernelMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..f925f897954bf97aa1f4cb9f7577638270416ded --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/UnitKernelMean.lean @@ -0,0 +1,71 @@ +import OAI.NumberTheory.Ostmann.Supply.ContractionConstants +import OAI.NumberTheory.Ostmann.Supply.KernelMoments + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [NeZero p] + +def unitKernelMean (S : Finset (ZMod p)) (t : ℝ) : ℝ := + (∑ x ∈ Finset.univ.erase 0, (1+localKernel S t x)^2)/((p:ℝ)-1) + +theorem unitKernelMean_lower (S : Finset (ZMod p)) {t ε : ℝ} + (hp : 2 ≤ p) (_ht : 0 ≤ t) (ht' : t ≤ 1) (hε : 0 ≤ ε) + (hc : ((largeSpectrum S).card:ℝ)/p ≤ ε) : + 1-4*ε/(p:ℝ) ≤ unitKernelMean S t := by + have hp0 : (0:ℝ)

sq_nonneg _) + have hsmall : 2*t*(((largeSpectrum S).card:ℝ)/p) ≤ 2*ε := by + have htE : t*(((largeSpectrum S).card:ℝ)/p) ≤ ε := + (mul_le_mul_of_nonneg_right ht' he).trans (by simpa using hc) + linarith + have hsmall' : 2*ε/((p:ℝ)-1) ≤ 4*ε/(p:ℝ) := by + apply (div_le_div_iff₀ hpm hp0).mpr + nlinarith [mul_nonneg hε (show 0 ≤ (p:ℝ)-2 by linarith)] + have hsmall'' := (div_le_div_of_nonneg_right hsmall hpm.le).trans hsmall' + unfold unitKernelMean + rw [hsum,localKernel_nonzero_sum] + apply (le_div_iff₀ hpm).mpr + have hh := (div_le_iff₀ hpm).mp hsmall'' + simp only [mul_div_assoc] at hh ⊢ + nlinarith + +theorem sparse_unitKernelMean_lower (S : Finset (ZMod p)) {t : ℝ} + (hp : 2 ≤ p) (ht : 0 ≤ t) (ht' : t ≤ 1) + (hpos : 0 (Real.exp_pos _).le) + (fun i hi => sparse_unitKernelMean_exp_lower (S i) (hp i hi) (hlo i hi) (hhi i hi) (hg i hi)) + · rw [←he (8*supplyEpsilon)] + exact Finset.prod_le_prod₀ + (fun i hi => (sparse_unitKernelMean_pos (S i) (hp i hi) + sparseKernelScale_nonneg sparseKernelScale_le_one + (by linarith [hlo i hi]) (by linarith [hhi i hi]) (hg i hi)).le) + (fun i hi => sparse_unitKernelMean_exp_upper (S i) (hp i hi) (hlo i hi) (hhi i hi) (hg i hi)) + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/UnitWeightPolynomial.lean b/lean/OAI/NumberTheory/Ostmann/Supply/UnitWeightPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..5539f8e7edba01e15160e67187691547853a7d28 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/UnitWeightPolynomial.lean @@ -0,0 +1,92 @@ +import OAI.NumberTheory.Ostmann.Supply.KernelProducts +import OAI.NumberTheory.Ostmann.Supply.TruncatedWeight +import OAI.NumberTheory.Ostmann.Supply.UnitKernelGenerating +import OAI.NumberTheory.Ostmann.Tree.UnitSums + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators +open TensorOperators BivariateTruncation + +theorem independent_unit_average {ι : Type*} [Fintype ι] [DecidableEq ι] (α : ι→Type*) [∀i,Fintype (α i)] + (f : ∀i,α i→ℂ) : + (Fintype.card (∀i,α i):ℂ)⁻¹*(∑x:∀i,α i,∏i,f i (x i)) = + ∏i,(Fintype.card (α i):ℂ)⁻¹*(∑x:α i,f i x) := by + rw [Finset.prod_mul_distrib,←Fintype.prod_sum,Fintype.card_pi,Nat.cast_prod, + Finset.prod_inv_distrib] + +theorem sum_units_eq_nonzero {F A : Type*} [Field F] [Fintype F] [DecidableEq F] + [AddCommGroup A] (f : F→A) : + (∑u:Fˣ,f u)=∑x∈Finset.univ.erase (0:F),f x := by + apply add_right_cancel (b:=f 0) + exact (Ostmann.FiniteField.sum_units_add_zero f).trans + (Finset.sum_erase_add Finset.univ f (Finset.mem_univ 0)).symm + +variable {ι : Type*} [Fintype ι] [DecidableEq ι] (p : ι→ℕ) [∀i,Fact (p i).Prime] + (S : ∀i,Finset (ZMod (p i))) + +def unitWeightPolynomial : (ℕ×ℕ)→₀ℂ := + (Fintype.card (∀i,(ZMod (p i))ˣ):ℂ)⁻¹ • + ∑x:∀i,(ZMod (p i))ˣ,subsetPairPolynomial Finset.univ + (fun i => (localKernel (S i) sparseKernelScale (x i):ℂ)) + +theorem eval_unitWeightPolynomial (u v : ℂ) : + eval (unitWeightPolynomial p S) u v = ∏i,unitKernelGenerating (S i) sparseKernelScale u v := by + change evalLinearMap u v _ = _ + rw [unitWeightPolynomial,map_smul,map_sum] + simp only [evalLinearMap_apply,eval_subsetPairPolynomial,smul_eq_mul] + rw [independent_unit_average (fun i => (ZMod (p i))ˣ) + (fun i x => (1+u*(localKernel (S i) sparseKernelScale x:ℂ))* + (1+v*(localKernel (S i) sparseKernelScale x:ℂ)))] + apply Finset.prod_congr rfl + intro i hi + have hcard : (Fintype.card (ZMod (p i))ˣ:ℂ)=(p i:ℂ)-1 := by + rw [ZMod.card_units,Nat.cast_sub (Fact.out : (p i).Prime).one_lt.le,Nat.cast_one] + rw [hcard,sum_units_eq_nonzero (fun x : ZMod (p i) => + (1+u*(localKernel (S i) sparseKernelScale x:ℂ))* + (1+v*(localKernel (S i) sparseKernelScale x:ℂ)))] + exact (div_eq_inv_mul _ _).symm + +theorem eval_unitWeightPolynomial_one : eval (unitWeightPolynomial p S) 1 1 = + ((∏i,unitKernelMean (S i) sparseKernelScale:ℝ):ℂ) := by + rw [eval_unitWeightPolynomial] + simp only [unitKernelGenerating_one,Complex.ofReal_prod] + +theorem truncation_unitWeightPolynomial : + ∀K:ℕ,rectangularTruncation (unitWeightPolynomial p S) K = + ((Fintype.card (∀i,(ZMod (p i))ˣ):ℝ)⁻¹* + ∑x:∀i,(ZMod (p i))ˣ,truncatedWeight Finset.univ + (fun i => localKernel (S i) sparseKernelScale (x i)) K:ℝ) := by + intro K + rw [←rectangularLinearMap_apply] + rw [unitWeightPolynomial,map_smul,map_sum] + simp only [rectangularLinearMap_apply,rectangularTruncation_real_subsetPairPolynomial] + push_cast + rfl + +theorem unitWeightPolynomial_norm_uniform (u v : ℂ) + (hlo : ∀i,(1/3:ℝ)≤density (S i)) (hhi : ∀i,density (S i)≤2/3) + (hg : ∀i,gamma (S i) ≤ supplyEpsilon^2) (hu : ‖u‖≤103/100) (hv : ‖v‖≤103/100) : + ‖eval (unitWeightPolynomial p S) u v‖ ≤ + Real.exp (8*supplyEpsilon*(∑i,1/(p i:ℝ))) := by + rw [eval_unitWeightPolynomial,norm_prod] + have h := real_prod_uniform Finset.univ + (fun i => ‖unitKernelGenerating (S i) sparseKernelScale u v‖) + (fun i => 8*supplyEpsilon/(p i:ℝ)) + (fun i _ => norm_nonneg _) + (fun i _ => sparse_unitKernelGenerating_norm (S i) u v + (Fact.out : (p i).Prime).two_le (hlo i) (hhi i) (hg i) hu hv) + convert h using 1 + congr 1 + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + ring + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/UnitWeightTruncation.lean b/lean/OAI/NumberTheory/Ostmann/Supply/UnitWeightTruncation.lean new file mode 100644 index 0000000000000000000000000000000000000000..c255917ce1302e0f6c9a30db9e1a964b71703116 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/UnitWeightTruncation.lean @@ -0,0 +1,43 @@ +import OAI.NumberTheory.Ostmann.Supply.UnitProductSize +import OAI.NumberTheory.Ostmann.Supply.UnitWeightPolynomial + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators +open BivariateTruncation +variable {ι : Type*} [Fintype ι] [DecidableEq ι] (p : ι→ℕ) [∀i,Fact (p i).Prime] + (S : ∀i,Finset (ZMod (p i))) + +def unitWeightMean (K : ℕ) : ℝ := + (Fintype.card (∀i,(ZMod (p i))ˣ):ℝ)⁻¹* + ∑x:∀i,(ZMod (p i))ˣ,truncatedWeight Finset.univ + (fun i => localKernel (S i) sparseKernelScale (x i)) K + +theorem unitWeightMean_nonneg (K : ℕ) : 0≤unitWeightMean p S K := by + exact mul_nonneg (by positivity) + (Finset.sum_nonneg (fun x _ => truncatedWeight_nonneg _ _ _)) + +theorem unitWeightMean_eq_truncation (K : ℕ) : + (unitWeightMean p S K:ℂ)=rectangularTruncation (unitWeightPolynomial p S) K := + (truncation_unitWeightPolynomial p S K).symm + +theorem unitWeightMean_error (K : ℕ) + (hlo : ∀i,(1/3:ℝ)≤density (S i)) (hhi : ∀i,density (S i)≤2/3) + (hg : ∀i,gamma (S i) ≤ supplyEpsilon^2) : + |unitWeightMean p S K-(∏i,unitKernelMean (S i) sparseKernelScale)| ≤ + 2*Real.exp (8*supplyEpsilon*(∑i,1/(p i:ℝ)))*((103/100:ℝ)⁻¹)^K/ + (1-(103/100:ℝ)⁻¹)^2 := by + have h := rectangularTruncation_error_le (unitWeightPolynomial p S) + (by norm_num : (1:ℝ)<103/100) + (fun u v hu hv => unitWeightPolynomial_norm_uniform p S u v hlo hhi hg hu.le hv.le) K + rw [←unitWeightMean_eq_truncation,eval_unitWeightPolynomial_one,←Complex.ofReal_sub, + Complex.norm_real,Real.norm_eq_abs] at h + exact h + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/WeightFiniteIndex.lean b/lean/OAI/NumberTheory/Ostmann/Supply/WeightFiniteIndex.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a696ab8c17d9a0fa55479484043c55c5cd38663 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/WeightFiniteIndex.lean @@ -0,0 +1,42 @@ +import OAI.NumberTheory.Ostmann.Supply.NaturalWeight +import OAI.NumberTheory.Ostmann.Supply.PrimeEnumeration + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators +open BivariateTruncation + +theorem truncatedWeight_fin_univ (b : ℕ→ℝ) (n K : ℕ) : + truncatedWeight Finset.univ (fun i:Fin n => b i) K=truncatedWeight (Finset.range n) b K := by + apply Complex.ofReal_injective + have hf := rectangularTruncation_eq_weight + (c:=subsetPairPolynomial (Finset.range n) (fun i => (b i:ℂ))) + Finset.univ (fun i:Fin n => b i) + (fun u v => by + rw [eval_subsetPairPolynomial] + exact (Fin.prod_univ_eq_prod_range (fun i => (1+u*(b i:ℂ))*(1+v*(b i:ℂ))) n).symm) K + exact hf.symm.trans (rectangularTruncation_real_subsetPairPolynomial (Finset.range n) b K) + +theorem naturalKernelWeight_fin_univ (p : ℕ→ℕ) [∀i,NeZero (p i)] + (S : ∀i,Finset (ZMod (p i))) (n K k : ℕ) : + truncatedWeight Finset.univ + (fun i:Fin n => localKernel (S i.val) sparseKernelScale (k:ZMod (p i.val))) K = + naturalKernelWeight p S n K k := + truncatedWeight_fin_univ (fun i => localKernel (S i) sparseKernelScale (k:ZMod (p i))) n K + +theorem unitKernelProduct_fin_univ (p : ℕ→ℕ) [∀i,NeZero (p i)] + (S : ∀i,Finset (ZMod (p i))) (n : ℕ) : + (∏i:Fin n,unitKernelMean (S i) sparseKernelScale)=kernelUnitProduct (Finset.range n) p S := + Fin.prod_univ_eq_prod_range (fun i => unitKernelMean (S i) sparseKernelScale) n + +theorem reciprocalMass_fin_univ (p : ℕ→ℕ) (n : ℕ) : + (∑i:Fin n,(1:ℝ)/(p i:ℝ))=reciprocalMass (Finset.range n) p := + Fin.sum_univ_eq_sum_range (fun i => (1:ℝ)/(p i:ℝ)) n + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/WeightPointwiseBound.lean b/lean/OAI/NumberTheory/Ostmann/Supply/WeightPointwiseBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9325711aa8734d7f24fbe9db4e29f8d5a28e460 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/WeightPointwiseBound.lean @@ -0,0 +1,83 @@ +import OAI.NumberTheory.Ostmann.Supply.ContractingKernel +import OAI.NumberTheory.Ostmann.Supply.TruncatedWeight + +namespace OAI + +noncomputable section +namespace Ostmann.Supply +open scoped BigOperators + +theorem card_retained_subsets_le {ι : Type*} (P : Finset ι) (K : ℕ) : + (P.powerset.filter (fun s => s.card≤K)).card ≤ (K+1)*(P.card+1)^K := by + classical + have hsub : P.powerset.filter (fun s => s.card≤K) ⊆ + (Finset.range (K+1)).biUnion (fun j => P.powersetCard j) := by + intro s hs + obtain ⟨hsp,hcard⟩ := Finset.mem_filter.mp hs + exact Finset.mem_biUnion.mpr ⟨s.card,Finset.mem_range.mpr (by omega), + Finset.mem_powersetCard.mpr ⟨Finset.mem_powerset.mp hsp,rfl⟩⟩ + calc + _ ≤ ((Finset.range (K+1)).biUnion (fun j => P.powersetCard j)).card := Finset.card_le_card hsub + _ ≤ ∑j∈Finset.range (K+1),(P.powersetCard j).card := Finset.card_biUnion_le + _ ≤ ∑_j∈Finset.range (K+1),(P.card+1)^K := by + apply Finset.sum_le_sum + intro j hj + rw [Finset.card_powersetCard] + apply (Nat.choose_le_pow P.card j).trans + have hjK : j≤K := by have := Finset.mem_range.mp hj; omega + gcongr <;> omega + _ = _ := by simp + +theorem truncatedWeight_le_card_bound {ι : Type*} (P : Finset ι) (b : ι→ℝ) (K : ℕ) + (hb : ∀i∈P,|b i|≤1) : + truncatedWeight P b K ≤ (K+1:ℝ)^2*(P.card+1:ℝ)^(2*K) := by + classical + have hnorm : |truncatedSubsetSum P b K|≤((K+1)*(P.card+1)^K:ℕ) := by + calc + _ ≤ ∑s∈P.powerset.filter (fun s => s.card≤K),|∏i∈s,b i| := + by simpa only [truncatedSubsetSum,Real.norm_eq_abs] using + (norm_sum_le (P.powerset.filter (fun s => s.card≤K)) (fun s => ∏i∈s,b i)) + _ ≤ ∑_s∈P.powerset.filter (fun s => s.card≤K),(1:ℝ) := by + apply Finset.sum_le_sum + intro s hs + rw [Finset.abs_prod] + calc + _ ≤ ∏_i∈s,(1:ℝ) := Finset.prod_le_prod₀ (fun i hi => abs_nonneg _) + (fun i hi => hb i (Finset.mem_powerset.mp (Finset.mem_filter.mp hs).1 hi)) + _ = 1 := by simp + _ = ((P.powerset.filter (fun s => s.card≤K)).card:ℝ) := by simp + _ ≤ ((K+1)*(P.card+1)^K:ℕ) := by exact_mod_cast card_retained_subsets_le P K + have hsq := pow_le_pow_left₀ (abs_nonneg (truncatedSubsetSum P b K)) hnorm 2 + unfold truncatedWeight + rw [sq_abs] at hsq + convert hsq using 1 + push_cast + ring + +theorem sparseKernel_pointwise_le_one {p : ℕ} [NeZero p] + (S : Finset (ZMod p)) (x : ZMod p) : + |localKernel S sparseKernelScale x|≤1 := by + have hp0 : (0:ℝ)

localKernel (S i) sparseKernelScale (x i)) K ≤ + (K+1:ℝ)^2*(P.card+1:ℝ)^(2*K) := + truncatedWeight_le_card_bound P _ K (fun i _ => sparseKernel_pointwise_le_one (S i) (x i)) + +end Ostmann.Supply + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Supply/WeightedMultiplierSupply.lean b/lean/OAI/NumberTheory/Ostmann/Supply/WeightedMultiplierSupply.lean new file mode 100644 index 0000000000000000000000000000000000000000..08a857825c164902641f9230da7dcd30809cc2b7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Supply/WeightedMultiplierSupply.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.Supply.MultiplierRatioProduct + +namespace OAI + +/-! # The weighted positive-density supply used in the sieve amplification -/ + +namespace Ostmann +open scoped Classical BigOperators + +theorem goodSieveMultipliers_coprime (U : ℕ) (T P : Finset ℕ) (w : ℕ → ℝ) + (B : ℝ) (hT : ∀ p ∈ T, Nat.Prime p) {u : ℕ} + (hu : u ∈ goodSieveMultipliers U T P w B) : u.Coprime (∏ p ∈ T, p) := by + apply Nat.coprime_prod_right_iff.mpr + intro p hp + apply Nat.Coprime.symm + apply (hT p hp).coprime_iff_not_dvd.mpr + intro hd + exact (Finset.mem_filter.mp hu).2.2.1 ⟨p, hp, hd⟩ + +theorem weighted_multiplier_supply (U : ℕ) (T P : Finset ℕ) (κ : ℕ → ℝ) + (hκ : ∀ p ∈ P, 0 < κ p) (hTprime : ∀ p ∈ T, Nat.Prime p) + (B : ℝ) (hB : 0 < B) + (hT : (∑ p ∈ T, (p : ℝ)⁻¹) ≤ 1 / 16) + (hP : (∑ p ∈ P, |Real.log (κ p)| / p) ≤ B / 16) : + (U : ℝ) / 8 * Real.exp (-B) ≤ + ∑ u ∈ (positiveMultipliers U).filter + (fun u => Squarefree u ∧ u.Coprime (∏ p ∈ T, p)), multiplierRatioProduct P κ u := by + let G := goodSieveMultipliers U T P (fun p => |Real.log (κ p)|) B + have hcard := goodSieveMultipliers_card_lower U T P (fun p => |Real.log (κ p)|) + (fun _ _ => abs_nonneg _) B hB hT hP + have hsubset : G ⊆ (positiveMultipliers U).filter + (fun u => Squarefree u ∧ u.Coprime (∏ p ∈ T, p)) := by + intro u hu + exact Finset.mem_filter.mpr ⟨(Finset.mem_filter.mp hu).1, + (Finset.mem_filter.mp hu).2.1, goodSieveMultipliers_coprime U T P _ B hTprime hu⟩ + calc + _ ≤ (G.card : ℝ) * Real.exp (-B) := + mul_le_mul_of_nonneg_right hcard (Real.exp_pos _).le + _ = ∑ _u ∈ G, Real.exp (-B) := by simp + _ ≤ ∑ u ∈ G, multiplierRatioProduct P κ u := by + apply Finset.sum_le_sum + intro u hu + exact (goodSieveMultipliers_ratio_products U T P κ hκ B hu).1 + _ ≤ _ := by + apply Finset.sum_le_sum_of_subset_of_nonneg hsubset + intro u _ _ + unfold multiplierRatioProduct + apply Finset.prod_nonneg + intro p hp + split_ifs + · exact (hκ p hp).le + · exact zero_le_one + +/-- The same supply is available for the reciprocal imbalance factors. -/ +theorem weighted_multiplier_supply_inv (U : ℕ) (T P : Finset ℕ) (κ : ℕ → ℝ) + (hκ : ∀ p ∈ P, 0 < κ p) (hTprime : ∀ p ∈ T, Nat.Prime p) + (B : ℝ) (hB : 0 < B) + (hT : (∑ p ∈ T, (p : ℝ)⁻¹) ≤ 1 / 16) + (hP : (∑ p ∈ P, |Real.log (κ p)| / p) ≤ B / 16) : + (U : ℝ) / 8 * Real.exp (-B) ≤ + ∑ u ∈ (positiveMultipliers U).filter + (fun u => Squarefree u ∧ u.Coprime (∏ p ∈ T, p)), + multiplierRatioProduct P (fun p => (κ p)⁻¹) u := by + apply weighted_multiplier_supply U T P (fun p => (κ p)⁻¹) + (fun p hp => inv_pos.mpr (hκ p hp)) hTprime B hB hT + simpa only [Real.log_inv, abs_neg] using hP + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/AffineEnergy.lean b/lean/OAI/NumberTheory/Ostmann/Tree/AffineEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..f06d657ce4609882fc6748d47a15a1c76c5e156c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/AffineEnergy.lean @@ -0,0 +1,102 @@ +import OAI.NumberTheory.Ostmann.Tree.AffineFibers + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate + +theorem norm_sum_sq_le_card {ι : Type*} (S : Finset ι) (v : ι → ℂ) : + ‖∑ i ∈ S, v i‖ ^ 2 ≤ (S.card : ℝ) * ∑ i ∈ S, ‖v i‖ ^ 2 := by + calc + _ ≤ (∑ i ∈ S, ‖v i‖)^2 := by + exact pow_le_pow_left₀ (norm_nonneg _) (norm_sum_le _ _) 2 + _ ≤ _ := by + simpa using Finset.sum_mul_sq_le_sq_mul_sq S (fun _ => (1:ℝ)) (fun i => ‖v i‖) + +variable {F : Type*} [Field F] [Fintype F] +variable [DecidableEq F] + +def affineCoefficient (G : Fˣ → ℂ) (K : F × F) : ℂ := + ∑ rs : Fˣ × Fˣ with affinePair rs.1 rs.2 = K, conj (G rs.1) * G rs.2 + +theorem affineCoefficient_nonidentity (G : Fˣ → ℂ) (K : F × F) (hK : K ≠ (1,0)) : + ‖affineCoefficient G K‖^2 ≤ + 2 * ∑ rs : Fˣ × Fˣ with affinePair rs.1 rs.2 = K, + ‖G rs.1‖^2 * ‖G rs.2‖^2 := by + let S : Finset (Fˣ × Fˣ) := Finset.univ.filter (fun rs => affinePair rs.1 rs.2 = K) + have hc : S.card ≤ 2 := affinePair_fiber_card_le_two S K hK + (fun rs hrs => (Finset.mem_filter.mp hrs).2) + have he := norm_sum_sq_le_card S (fun rs => conj (G rs.1)*G rs.2) + simp only [norm_mul, Complex.norm_conj, mul_pow] at he + have hcR : (S.card : ℝ) ≤ 2 := by exact_mod_cast hc + exact he.trans (mul_le_mul_of_nonneg_right hcR + (Finset.sum_nonneg (fun _ _ => mul_nonneg (sq_nonneg _) (sq_nonneg _)))) + +omit [Fintype F] [DecidableEq F] in +theorem affinePair_eq_identity_iff (r s : Fˣ) : affinePair r s = (1,0) ↔ r=s := by + constructor + · intro h + have hs := congrArg Prod.snd h + change (s:F) - (s:F)^2/(r:F)=0 at hs + have hh : (s:F)*(r:F)=(s:F)*(s:F) := by + have := (eq_div_iff (Units.ne_zero r)).mp (sub_eq_zero.mp hs) + simpa only [pow_two] using this + exact Units.ext (mul_left_cancel₀ (Units.ne_zero s) hh) + · rintro rfl + apply affinePair_eq_identity_of_ratio_one + exact div_self (Units.ne_zero r) + +theorem affineCoefficient_identity (G : Fˣ → ℂ) : + affineCoefficient G (1,0) = ∑ r : Fˣ, conj (G r)*G r := by + simp only [affineCoefficient, affinePair_eq_identity_iff] + rw [Finset.sum_filter, Fintype.sum_prod_type] + simp + +theorem norm_affineCoefficient_identity (G : Fˣ → ℂ) : + ‖affineCoefficient G (1,0)‖ = ∑ r : Fˣ, ‖G r‖^2 := by + rw [affineCoefficient_identity] + simp only [Complex.conj_mul', ← Complex.ofReal_pow] + rw [← Complex.ofReal_sum, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (Finset.sum_nonneg (fun _ _ => sq_nonneg _))] + +theorem affineFiberEnergy_sum (G : Fˣ → ℂ) : + (∑ K : F × F, ∑ rs : Fˣ × Fˣ with affinePair rs.1 rs.2 = K, + ‖G rs.1‖^2 * ‖G rs.2‖^2) = (∑ r : Fˣ, ‖G r‖^2)^2 := by + simp only [Finset.sum_filter] + rw [Finset.sum_comm] + simp only [Finset.sum_ite_eq, Finset.mem_univ, ite_true] + rw [Fintype.sum_prod_type] + simp only [← Finset.mul_sum, ← Finset.sum_mul, pow_two] + +theorem affineCoefficient_energy (G : Fˣ → ℂ) : + ∑ K : F × F, ‖affineCoefficient G K‖^2 ≤ 3 * (∑ r : Fˣ, ‖G r‖^2)^2 := by + let A := (∑ r : Fˣ, ‖G r‖^2)^2 + let E := fun K : F × F => ∑ rs : Fˣ × Fˣ with affinePair rs.1 rs.2 = K, + ‖G rs.1‖^2 * ‖G rs.2‖^2 + have hE : ∀ K, 0 ≤ E K := fun K => + Finset.sum_nonneg (fun _ _ => mul_nonneg (sq_nonneg _) (sq_nonneg _)) + have hn : ∑ K ∈ Finset.univ.erase (1,0), ‖affineCoefficient G K‖^2 ≤ 2*A := by + calc + _ ≤ ∑ K ∈ Finset.univ.erase (1,0), 2*E K := by + apply Finset.sum_le_sum + intro K hK + exact affineCoefficient_nonidentity G K (Finset.ne_of_mem_erase hK) + _ = 2 * ∑ K ∈ Finset.univ.erase (1,0), E K := by rw [Finset.mul_sum] + _ ≤ 2 * ∑ K : F × F, E K := by + apply mul_le_mul_of_nonneg_left _ (by norm_num) + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.erase_subset _ _) + (fun K _ _ => hE K) + _ = 2*A := by rw [affineFiberEnergy_sum] + have hid : ‖affineCoefficient G (1,0)‖^2 = A := by + rw [norm_affineCoefficient_identity] + have hsplit := Finset.sum_erase_add Finset.univ + (fun K : F × F => ‖affineCoefficient G K‖^2) (Finset.mem_univ (1,0)) + rw [← hsplit, hid] + change _ ≤ 3*A + linarith + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/AffineFibers.lean b/lean/OAI/NumberTheory/Ostmann/Tree/AffineFibers.lean new file mode 100644 index 0000000000000000000000000000000000000000..c385af5d01005ee60e2d6a7dd557811a75d0c06d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/AffineFibers.lean @@ -0,0 +1,104 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +variable {F : Type*} [Field F] + +def affinePair (r s : Fˣ) : F × F := + (((s : F) / r)^2, (s : F) - (s : F)^2 / r) + +def affineRatio (rs : Fˣ × Fˣ) : F := (rs.2 : F) / rs.1 + +theorem affinePair_shift (r s : Fˣ) : + (affinePair r s).2 = (r : F) * (affineRatio (r,s) - affineRatio (r,s)^2) := by + dsimp [affinePair, affineRatio] + field_simp + +theorem affineRatio_ne_zero (rs : Fˣ × Fˣ) : affineRatio rs ≠ 0 := + div_ne_zero (Units.ne_zero _) (Units.ne_zero _) + +theorem affinePair_eq_identity_of_ratio_one {r s : Fˣ} + (h : affineRatio (r,s) = 1) : affinePair r s = (1,0) := by + apply Prod.ext + · change affineRatio (r,s)^2 = 1 + rw [h, one_pow] + · rw [affinePair_shift, h] + ring + +theorem affinePair_ratio_injective {K : F × F} (hK : K ≠ (1,0)) + {rs rt : Fˣ × Fˣ} (hs : affinePair rs.1 rs.2 = K) + (ht : affinePair rt.1 rt.2 = K) (hz : affineRatio rs = affineRatio rt) : rs = rt := by + have hone : affineRatio rs ≠ 1 := by + intro h + exact hK (hs.symm.trans (affinePair_eq_identity_of_ratio_one h)) + have hz0 := affineRatio_ne_zero rs + have hfactor : affineRatio rs - affineRatio rs ^ 2 ≠ 0 := by + intro h + have : affineRatio rs * (1 - affineRatio rs) = 0 := by + calc + affineRatio rs * (1 - affineRatio rs) = affineRatio rs - affineRatio rs ^ 2 := by ring + _ = 0 := h + rcases mul_eq_zero.mp this with he | he + · exact hz0 he + · exact hone (sub_eq_zero.mp he).symm + have hshift := congrArg Prod.snd (hs.trans ht.symm) + rw [affinePair_shift, affinePair_shift, ← hz] at hshift + have hr : (rs.1 : F) = rt.1 := (mul_right_cancel₀ hfactor) hshift + have hsval : (rs.2 : F) = rt.2 := by + dsimp [affineRatio] at hz + rw [hr] at hz + exact (div_left_inj' (Units.ne_zero rt.1)).mp hz + exact Prod.ext (Units.ext hr) (Units.ext hsval) + +theorem affinePair_fiber_card_le_two (S : Finset (Fˣ × Fˣ)) (K : F × F) + (hK : K ≠ (1,0)) (hS : ∀ rs ∈ S, affinePair rs.1 rs.2 = K) : S.card ≤ 2 := by + classical + by_cases he : S.Nonempty + · obtain ⟨rs, hrs⟩ := he + have hi : Set.InjOn affineRatio (↑S : Set (Fˣ × Fˣ)) := by + intro x hx y hy hxy + exact affinePair_ratio_injective hK (hS x hx) (hS y hy) hxy + have hc : S.card = (S.image affineRatio).card := (Finset.card_image_of_injOn hi).symm + rw [hc] + calc + (S.image affineRatio).card ≤ ({affineRatio rs, -affineRatio rs} : Finset F).card := by + apply Finset.card_le_card + intro z hz + obtain ⟨rt, hrt, rfl⟩ := Finset.mem_image.mp hz + have hh := congrArg Prod.fst ((hS rt hrt).trans (hS rs hrs).symm) + change affineRatio rt ^ 2 = affineRatio rs ^ 2 at hh + rcases sq_eq_sq_iff_eq_or_eq_neg.mp hh with h | h <;> simp [h] + _ ≤ 2 := Finset.card_le_two + · simp [Finset.not_nonempty_iff_eq_empty.mp he] + +def affineUnitSubstitution (r : Fˣ) (x : F) : F := (r : F) - (r : F)^2*x + +def inverseAffineUnitSubstitution (r : Fˣ) (x : F) : F := + ((r : F) - x) / (r : F)^2 + +theorem affineUnitSubstitution_inverse (r : Fˣ) (x : F) : + affineUnitSubstitution r (inverseAffineUnitSubstitution r x) = x := by + dsimp [affineUnitSubstitution, inverseAffineUnitSubstitution] + field_simp + ring + +theorem inverseAffineUnitSubstitution_affine (r : Fˣ) (x : F) : + inverseAffineUnitSubstitution r (affineUnitSubstitution r x) = x := by + dsimp [affineUnitSubstitution, inverseAffineUnitSubstitution] + field_simp + ring + +theorem affineUnitSubstitution_composition (r s : Fˣ) (x : F) : + affineUnitSubstitution s (inverseAffineUnitSubstitution r x) = + (affinePair r s).1*x + (affinePair r s).2 := by + dsimp [affineUnitSubstitution, inverseAffineUnitSubstitution, affinePair] + field_simp + ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/AffineFourier.lean b/lean/OAI/NumberTheory/Ostmann/Tree/AffineFourier.lean new file mode 100644 index 0000000000000000000000000000000000000000..0be73d94b9909ac1412dbbb1ab292d86d283a314 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/AffineFourier.lean @@ -0,0 +1,69 @@ +import OAI.NumberTheory.Ostmann.Tree.AffineEnergy +import OAI.NumberTheory.Ostmann.Tree.Parseval + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [NeZero p] + +theorem fourier_sum {ι : Type*} (S : Finset ι) (f : ι → ZMod p → ℂ) (a : ZMod p) : + fourier (fun x => ∑ i ∈ S, f i x) a = ∑ i ∈ S, fourier (f i) a := by + have hf : (fun x => ∑ i ∈ S, f i x) = ∑ i ∈ S, f i := by ext; simp + rw [hf] + simp only [fourier, map_sum, Finset.sum_apply, Finset.mul_sum] + +theorem fourier_const_mul (f : ZMod p → ℂ) (c : ℂ) (a : ZMod p) : + fourier (fun x => c*f x) a = c*fourier f a := by + rw [fourier, ZMod.dft_const_mul] + dsimp [fourier] + ring + +theorem fourier_unitMul (f : ZMod p → ℂ) (u : (ZMod p)ˣ) (a : ZMod p) : + fourier (fun x => f ((u:ZMod p)*x)) a = fourier f ((u⁻¹: (ZMod p)ˣ)*a) := by + simp only [fourier, ZMod.dft_comp_unitMul] + +theorem fourier_translate (f : ZMod p → ℂ) (b a : ZMod p) : + fourier (fun x => f (x+b)) a = ZMod.stdAddChar (a*b)*fourier f a := by + have hs := (Equiv.addRight b).bijective.sum_comp + (fun y : ZMod p => f y * ZMod.stdAddChar (-(a*(y-b)))) + change (∑ y : ZMod p, f (y+b) * ZMod.stdAddChar (-(a*((y+b)-b)))) = + ∑ y : ZMod p, f y * ZMod.stdAddChar (-(a*(y-b))) at hs + simp only [add_sub_cancel_right] at hs + rw [fourier_apply, hs, fourier_apply] + simp_rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro y _ + have he : -(a*(y-b)) = a*b + -(a*y) := by ring + rw [he, AddChar.map_add_eq_mul] + ring + +theorem fourier_affine (f : ZMod p → ℂ) (u : (ZMod p)ˣ) (b a : ZMod p) : + fourier (fun x => f ((u:ZMod p)*x+b)) a = + ZMod.stdAddChar (((u⁻¹:(ZMod p)ˣ):ZMod p)*a*b) * + fourier f (((u⁻¹:(ZMod p)ˣ):ZMod p)*a) := by + rw [fourier_unitMul (fun x => f (x+b)), fourier_translate] + +def affineAction (c : (ZMod p)ˣ → ZMod p → ℂ) (f : ZMod p → ℂ) (t : ZMod p) : ℂ := + ∑ u, ∑ b, c u b * f ((u:ZMod p)*t+b) + +theorem fourier_affineAction (c : (ZMod p)ˣ → ZMod p → ℂ) (f : ZMod p → ℂ) + (a : ZMod p) : + fourier (affineAction c f) a = ∑ u : (ZMod p)ˣ, + (∑ b, c u b * ZMod.stdAddChar (((u⁻¹:(ZMod p)ˣ):ZMod p)*a*b)) * + fourier f (((u⁻¹:(ZMod p)ˣ):ZMod p)*a) := by + unfold affineAction + rw [fourier_sum] + apply Finset.sum_congr rfl + intro u _ + rw [fourier_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro b _ + rw [fourier_const_mul, fourier_affine] + ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/AffineHilbertSchmidt.lean b/lean/OAI/NumberTheory/Ostmann/Tree/AffineHilbertSchmidt.lean new file mode 100644 index 0000000000000000000000000000000000000000..e41a2c28b8b90f9cbd33b9dc817f2f9bb783c093 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/AffineHilbertSchmidt.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.Tree.AffineFourier + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate + +theorem norm_sum_mul_sq_le {ι : Type*} (S : Finset ι) (v w : ι → ℂ) : + ‖∑ i ∈ S, v i*w i‖^2 ≤ (∑ i ∈ S, ‖v i‖^2)*(∑ i ∈ S, ‖w i‖^2) := by + calc + _ ≤ (∑ i ∈ S, ‖v i*w i‖)^2 := + pow_le_pow_left₀ (norm_nonneg _) (norm_sum_le _ _) 2 + _ = (∑ i ∈ S, ‖v i‖*‖w i‖)^2 := by simp only [norm_mul] + _ ≤ _ := Finset.sum_mul_sq_le_sq_mul_sq S (fun i => ‖v i‖) (fun i => ‖w i‖) + +variable {p : ℕ} [Fact p.Prime] + +def affineFrequencyCoefficient (c : (ZMod p)ˣ → ZMod p → ℂ) + (u : (ZMod p)ˣ) (a : ZMod p) : ℂ := + ∑ b, c u b * ZMod.stdAddChar (((u⁻¹:(ZMod p)ˣ):ZMod p)*a*b) + +theorem affineFrequencyCoefficient_eq_dft (c : (ZMod p)ˣ → ZMod p → ℂ) + (u : (ZMod p)ˣ) (a : ZMod p) : + affineFrequencyCoefficient c u a = ZMod.dft (c u) (-(((u⁻¹:(ZMod p)ˣ):ZMod p)*a)) := by + simp only [affineFrequencyCoefficient, ZMod.dft_apply, smul_eq_mul, mul_neg, neg_neg] + apply Finset.sum_congr rfl + intro b _ + have he : (((u⁻¹:(ZMod p)ˣ):ZMod p)*a)*b = b*(((u⁻¹:(ZMod p)ˣ):ZMod p)*a) := by ring + rw [he, mul_comm] + +theorem affineFrequencyCoefficient_energy (c : (ZMod p)ˣ → ZMod p → ℂ) + (u : (ZMod p)ˣ) : + ∑ a : ZMod p, ‖affineFrequencyCoefficient c u a‖^2 = + (p:ℝ) * ∑ b, ‖c u b‖^2 := by + simp only [affineFrequencyCoefficient_eq_dft] + have hi : Function.Bijective (fun a : ZMod p => -(((u⁻¹:(ZMod p)ˣ):ZMod p)*a)) := + (Equiv.neg (ZMod p)).bijective.comp (u⁻¹).mulLeft_bijective + rw [hi.sum_comp (fun a => ‖ZMod.dft (c u) a‖^2), Supply.dft_parseval] + +theorem unit_frequency_energy_le (f : ZMod p → ℂ) (a : ZMod p) (ha : a ≠ 0) : + (∑ u : (ZMod p)ˣ, ‖fourier f (((u⁻¹:(ZMod p)ˣ):ZMod p)*a)‖^2) ≤ l2Sq f := by + rw [← fourier_parseval] + apply Finset.sum_le_sum_of_injOn + (fun u : (ZMod p)ˣ => (((u⁻¹:(ZMod p)ˣ):ZMod p)*a)) + · intro u _ v _ h + apply inv_injective + exact Units.ext (mul_right_cancel₀ ha h) + · exact Finset.subset_univ _ + · intro u _ + exact le_rfl + · intro b _ _ + exact sq_nonneg _ + +theorem affineAction_l2Sq_le (c : (ZMod p)ˣ → ZMod p → ℂ) (f : ZMod p → ℂ) + (hf : mean f = 0) : + l2Sq (affineAction c f) ≤ + ((p:ℝ) * ∑ u, ∑ b, ‖c u b‖^2) * l2Sq f := by + rw [← fourier_parseval] + have hpoint (a : ZMod p) : + ‖fourier (affineAction c f) a‖^2 ≤ + (∑ u, ‖affineFrequencyCoefficient c u a‖^2) * l2Sq f := by + by_cases ha : a=0 + · subst a + rw [fourier_affineAction] + simp only [mul_zero, fourier_zero, hf, + Finset.sum_const_zero, norm_zero, zero_pow (by decide : 2 ≠ 0)] + exact mul_nonneg (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) (l2Sq_nonneg f) + · rw [fourier_affineAction] + have hc := norm_sum_mul_sq_le Finset.univ + (fun u => affineFrequencyCoefficient c u a) + (fun u => fourier f (((u⁻¹:(ZMod p)ˣ):ZMod p)*a)) + exact hc.trans (mul_le_mul_of_nonneg_left (unit_frequency_energy_le f a ha) + (Finset.sum_nonneg (fun _ _ => sq_nonneg _))) + calc + _ ≤ ∑ a : ZMod p, (∑ u, ‖affineFrequencyCoefficient c u a‖^2) * l2Sq f := + Finset.sum_le_sum (fun a _ => hpoint a) + _ = ((p:ℝ) * ∑ u, ∑ b, ‖c u b‖^2) * l2Sq f := by + rw [← Finset.sum_mul, Finset.sum_comm] + simp only [affineFrequencyCoefficient_energy, Finset.mul_sum] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/AffinePairAlgebra.lean b/lean/OAI/NumberTheory/Ostmann/Tree/AffinePairAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..2bfc37869ec3f2f11020392eb7f51cf24583ab8c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/AffinePairAlgebra.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.Ostmann.Tree.PairCoordinates +import OAI.NumberTheory.Ostmann.Tree.PairMobius + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +variable {F : Type*} [Field F] + +def affinePairParameter (σ lam : Fˣ) (d : F) : F := + pairMobiusValue (lam/σ) (1-(lam:F)*d) + +theorem affinePairParameter_formula (σ lam : Fˣ) (d : F) : + affinePairParameter σ lam d = ((lam:F)*d-1)/((σ:F)*d) := by + by_cases hd : d=0 + · simp [affinePairParameter,pairMobiusValue,hd] + · dsimp [affinePairParameter,pairMobiusValue] + rw [Units.val_div_eq_div_val] + field_simp + ring + +theorem affinePairParameter_inv (σ lam : Fˣ) (d : F) : + (affinePairParameter σ lam d)⁻¹=pairSecond σ d ((lam:F)*d) := by + rw [affinePairParameter_formula, inv_div] + rfl + +theorem affinePairParameter_transformed (σ lam : Fˣ) (d : F) : + affinePairParameter σ lam d-(affinePairParameter σ lam d)^2*((σ:F)/(lam:F)) = + ((lam:F)*d-1)/((σ:F)*(lam:F)*d^2) := by + rw [affinePairParameter_formula] + by_cases hd : d=0 + · simp [hd] + · field_simp + ring + +theorem affinePairParameter_transformed_inv (σ lam : Fˣ) (d : F) : + (affinePairParameter σ lam d-(affinePairParameter σ lam d)^2*((σ:F)/(lam:F)))⁻¹ = + pairFirst σ d ((lam:F)*d) := by + rw [affinePairParameter_transformed, inv_div] + dsimp [pairFirst] + ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/AffinePairIdentity.lean b/lean/OAI/NumberTheory/Ostmann/Tree/AffinePairIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..053a30c738c1785ad5ee21b94b2d4aaff8e740d0 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/AffinePairIdentity.lean @@ -0,0 +1,105 @@ +import OAI.NumberTheory.Ostmann.Tree.AffinePairAlgebra +import OAI.NumberTheory.Ostmann.Tree.PairMellin +import OAI.NumberTheory.Ostmann.Tree.ReciprocalTwist + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def pairTest (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) (d t : ZMod p) : ℂ := + g (pairFirst σ d t)*conj (g (pairSecond σ d t)) + +def diagonalPairValue (g : ZMod p → ℂ) (η : MulChar (ZMod p) ℂ) (a : ZMod p) + (σ lam : (ZMod p)ˣ) (d : ZMod p) : ℂ := + pairTest g σ d ((lam:ZMod p)*d)*η d*ZMod.stdAddChar (-(a*d)) + +theorem diagonalPair_affine_point (g : ZMod p → ℂ) (η : MulChar (ZMod p) ℂ) + (a : ZMod p) (σ lam : (ZMod p)ˣ) (hσ : (σ:ZMod p)^2=1) (hg0 : g 0=0) + (d : ZMod p) : + let G := reciprocalTwist g η (-a*(σ:ZMod p)) + let r := affinePairParameter σ lam d + conj (G r)*G (r-r^2*((σ:ZMod p)/(lam:ZMod p))) = + η lam*diagonalPairValue g η a σ lam d := by + dsimp + simp only [reciprocalTwist, affinePairParameter_inv, affinePairParameter_transformed_inv] + by_cases hd : d=0 + · subst d + simp [diagonalPairValue,pairTest,pairFirst,pairSecond,hg0] + by_cases ht : (lam:ZMod p)*d=1 + · simp only [ht, pairFirst, pairSecond, sub_self, div_zero, hg0, zero_mul, map_zero, mul_zero] + simp [diagonalPairValue,pairTest,ht,pairFirst,pairSecond,hg0] + let x := pairFirst σ d ((lam:ZMod p)*d) + let z := pairSecond σ d ((lam:ZMod p)*d) + have hz : z≠0 := div_ne_zero (mul_ne_zero (Units.ne_zero σ) hd) (sub_ne_zero.mpr ht) + have hx : x=((lam:ZMod p)*d)*z := by dsimp [x,z,pairFirst,pairSecond]; ring + have hdiff : x-z=(σ:ZMod p)*d := pair_difference σ d _ ht + have hchar : conj (η z)*η x=η lam*η d := by + rw [hx, map_mul, map_mul] + calc + _ = (η lam*η d)*(conj (η z)*η z) := by ring + _ = _ := by rw [conjugate_character_cancel η z hz, mul_one] + have hphase : conj (ZMod.stdAddChar ((-a*(σ:ZMod p))*z))* + ZMod.stdAddChar ((-a*(σ:ZMod p))*x)=ZMod.stdAddChar (-(a*d)) := by + rw [Supply.conj_stdAddChar, ← AddChar.map_add_eq_mul] + congr 1 + calc + _ = (-a*(σ:ZMod p))*(x-z) := by ring + _ = (-a*(σ:ZMod p))*((σ:ZMod p)*d) := by rw [hdiff] + _ = (-(a*d))*(σ:ZMod p)^2 := by ring + _ = _ := by rw [hσ,mul_one] + change conj (g z*η z*ZMod.stdAddChar ((-a*(σ:ZMod p))*z))* + (g x*η x*ZMod.stdAddChar ((-a*(σ:ZMod p))*x)) = + η lam*((g x*conj (g z))*η d*ZMod.stdAddChar (-(a*d))) + simp only [map_mul] + calc + _ = (g x*conj (g z))*(conj (η z)*η x)* + (conj (ZMod.stdAddChar ((-a*(σ:ZMod p))*z))*ZMod.stdAddChar ((-a*(σ:ZMod p))*x)) := by ring + _ = _ := by rw [hchar,hphase]; ring + +theorem diagonalPair_affine_mean (g : ZMod p → ℂ) (η : MulChar (ZMod p) ℂ) + (a : ZMod p) (σ lam : (ZMod p)ˣ) (hσ : (σ:ZMod p)^2=1) (hg0 : g 0=0) : + mean (diagonalPairValue g η a σ lam) = + conj (η lam) * weightedAffine (fun r => conj (reciprocalTwist g η (-a*(σ:ZMod p)) r)) + (reciprocalTwist g η (-a*(σ:ZMod p))) ((σ:ZMod p)/(lam:ZMod p)) := by + let G := reciprocalTwist g η (-a*(σ:ZMod p)) + let φ : ZMod p → ℂ := fun r => conj (G r)*G (r-r^2*((σ:ZMod p)/(lam:ZMod p))) + have hG : G 0=0 := reciprocalTwist_zero g η _ hg0 + have hφ0 : φ 0=0 := by simp [φ,hG] + have hφc : φ ((lam/σ:(ZMod p)ˣ):ZMod p)=0 := by + have hr : (((lam/σ:(ZMod p)ˣ):ZMod p))-(((lam/σ:(ZMod p)ˣ):ZMod p))^2* + ((σ:ZMod p)/(lam:ZMod p))=0 := by + simp only [Units.val_div_eq_div_val] + field_simp + ring + simp only [φ,hr,hG,mul_zero] + have hi : Function.Bijective (fun d : ZMod p => 1-(lam:ZMod p)*d) := by + constructor + · intro d e h + exact mul_left_cancel₀ (Units.ne_zero lam) (sub_right_injective h) + · intro y + refine ⟨(1-y)/(lam:ZMod p), ?_⟩ + field_simp + ring + have hs : (∑ d : ZMod p, φ (affinePairParameter σ lam d)) = ∑ r : (ZMod p)ˣ, φ r := by + dsimp [affinePairParameter] + rw [hi.sum_comp (fun t => φ (pairMobiusValue (lam/σ) t)), + pairMobius_sum (lam/σ) φ hφ0 hφc, ← sum_units_of_zero φ hφ0] + have hv : weightedAffine (fun r => conj (G r)) G ((σ:ZMod p)/(lam:ZMod p)) = + η lam*mean (diagonalPairValue g η a σ lam) := by + change (p:ℂ)⁻¹*(∑ r : (ZMod p)ˣ, φ r) = _ + rw [← hs] + simp_rw [show ∀ d, φ (affinePairParameter σ lam d)=η lam*diagonalPairValue g η a σ lam d from + fun d => diagonalPair_affine_point g η a σ lam hσ hg0 d] + rw [← Finset.mul_sum] + dsimp [mean] + ring + change _ = conj (η lam)*weightedAffine (fun r => conj (G r)) G _ + rw [hv, ← mul_assoc, conjugate_character_cancel η lam (Units.ne_zero lam), one_mul] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/AffineSelfBound.lean b/lean/OAI/NumberTheory/Ostmann/Tree/AffineSelfBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..3df1374dff3b234a3f99ff1a22a9bfe545811935 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/AffineSelfBound.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.Tree.UnitSums +import OAI.NumberTheory.Ostmann.Tree.WeightedAffineBound + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem weightedAffine_add_const (w : (ZMod p)ˣ → ℂ) (f : ZMod p → ℂ) (c : ℂ) : + weightedAffine w (fun t => f t+c) = + fun t => weightedAffine w f t + c*((p:ℂ)⁻¹ * ∑ r, w r) := by + funext t + simp only [weightedAffine, mul_add, Finset.sum_add_distrib, ← Finset.sum_mul] + ring + +theorem weightedAffine_self_bound (g : ZMod p → ℂ) (hg0 : g 0=0) (hg : l2Sq g ≤ 1) : + l2Sq (weightedAffine (fun r => conj (g r)) g) ≤ + ‖mean g‖^4 + Real.sqrt (3/(p:ℝ)) := by + have hp : 0 < (p:ℝ) := by exact_mod_cast (Fact.out : p.Prime).pos + let f : ZMod p → ℂ := fun t => g t-mean g + let w : (ZMod p)ˣ → ℂ := fun r => conj (g r) + have hf : mean f=0 := mean_sub_mean g + have he : (fun t => f t+mean g) = g := by funext t; dsimp [f]; ring + have hsplit : l2Sq g=l2Sq f+‖mean g‖^2 := by + simpa only [he] using l2Sq_add_const f (mean g) hf + have hfn : l2Sq f ≤ 1 := by nlinarith [sq_nonneg ‖mean g‖] + have hsum : (∑ t : ZMod p, ‖g t‖^2) ≤ (p:ℝ) := by + have hh : (∑ t : ZMod p, ‖g t‖^2)/(p:ℝ) ≤ 1 := by + simpa only [l2Sq, div_eq_mul_inv, mul_comm] using hg + simpa only [one_mul] using (div_le_iff₀ hp).mp hh + have hw : ∑ r : (ZMod p)ˣ, ‖w r‖^2 ≤ (p:ℝ) := by + dsimp [w] + simp only [Complex.norm_conj] + rw [sum_units_of_zero (fun t => ‖g t‖^2) (by simp [hg0])] + exact hsum + have hwm : (p:ℂ)⁻¹*∑ r : (ZMod p)ˣ, w r = conj (mean g) := by + dsimp [w] + rw [sum_units_of_zero (fun t => conj (g t)) (by simp [hg0])] + exact mean_conj g + have hTf : mean (weightedAffine w f)=0 := by rw [weightedAffine_mean, hf, mul_zero] + have hbound := weightedAffine_meanzero_bound w f hw hf hfn + have hdecomp : weightedAffine w g = + fun t => weightedAffine w f t + mean g*conj (mean g) := by + calc + weightedAffine w g = weightedAffine w (fun t => f t+mean g) := congrArg (weightedAffine w) he.symm + _ = _ := by rw [weightedAffine_add_const, hwm] + change l2Sq (weightedAffine w g) ≤ _ + rw [hdecomp, l2Sq_add_const _ _ hTf] + have hn : ‖mean g*conj (mean g)‖^2=‖mean g‖^4 := by + rw [norm_mul, Complex.norm_conj] + ring + rw [hn] + linarith + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/AffineUnitEnergy.lean b/lean/OAI/NumberTheory/Ostmann/Tree/AffineUnitEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..b6bd7f98f3acbde3709777c05d68f03f41e6fb7b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/AffineUnitEnergy.lean @@ -0,0 +1,76 @@ +import OAI.NumberTheory.Ostmann.Tree.AffineEnergy + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F : Type*} [Field F] [Fintype F] +variable [DecidableEq F] + +def affineUnitPair (r s : Fˣ) : Fˣ × F := + ((s/r)^2, (s:F)-(s:F)^2/(r:F)) + +omit [Fintype F] [DecidableEq F] in +theorem affineUnitPair_coe (r s : Fˣ) : + (((affineUnitPair r s).1:F), (affineUnitPair r s).2) = affinePair r s := by + simp only [affineUnitPair, affinePair, Units.val_pow_eq_pow_val, Units.val_div_eq_div_val] + +def affineUnitCoefficient (G : Fˣ → ℂ) (u : Fˣ) (b : F) : ℂ := + ∑ rs : Fˣ × Fˣ with affineUnitPair rs.1 rs.2 = (u,b), conj (G rs.1)*G rs.2 + +theorem affineUnitCoefficient_eq (G : Fˣ → ℂ) (u : Fˣ) (b : F) : + affineUnitCoefficient G u b = affineCoefficient G ((u:F),b) := by + unfold affineUnitCoefficient affineCoefficient + apply Finset.sum_congr + · apply Finset.filter_congr + intro rs _ + constructor + · intro h + exact (affineUnitPair_coe rs.1 rs.2).symm.trans (congrArg (fun z : Fˣ × F => ((z.1:F),z.2)) h) + · intro h + apply Prod.ext + · apply Units.ext + exact congrArg Prod.fst ((affineUnitPair_coe rs.1 rs.2).trans h) + · exact congrArg (fun z : F × F => z.2) ((affineUnitPair_coe rs.1 rs.2).trans h) + · intro _ _ + rfl + +theorem affineUnitCoefficient_energy (G : Fˣ → ℂ) : + ∑ u : Fˣ, ∑ b : F, ‖affineUnitCoefficient G u b‖^2 ≤ + 3*(∑ r : Fˣ, ‖G r‖^2)^2 := by + simp only [affineUnitCoefficient_eq] + rw [← Fintype.sum_prod_type (f := fun z : Fˣ × F => ‖affineCoefficient G ((z.1:F),z.2)‖^2)] + apply le_trans _ (affineCoefficient_energy G) + apply Finset.sum_le_sum_of_injOn (fun z : Fˣ × F => ((z.1:F),z.2)) + · intro x _ y _ h + exact Prod.ext (Units.ext (congrArg Prod.fst h)) (congrArg (fun z : F × F => z.2) h) + · exact Finset.subset_univ _ + · intro _ _ + exact le_rfl + · intro _ _ _ + exact sq_nonneg _ + +theorem affineUnitCoefficient_action (G : Fˣ → ℂ) (f : F → ℂ) (t : F) : + (∑ u : Fˣ, ∑ b : F, affineUnitCoefficient G u b * f ((u:F)*t+b)) = + ∑ r : Fˣ, ∑ s : Fˣ, conj (G r)*G s * + f (affineUnitSubstitution s (inverseAffineUnitSubstitution r t)) := by + rw [← Fintype.sum_prod_type (f := fun z : Fˣ × F => affineUnitCoefficient G z.1 z.2 * f ((z.1:F)*t+z.2))] + simp only [affineUnitCoefficient, Finset.sum_mul, Finset.sum_filter] + rw [Finset.sum_comm] + simp only [ite_mul, zero_mul] + have hsum (rs : Fˣ × Fˣ) : + (∑ z : Fˣ × F, if affineUnitPair rs.1 rs.2=z then + conj (G rs.1)*G rs.2 * f ((z.1:F)*t+z.2) else 0) = + conj (G rs.1)*G rs.2 * + f (affineUnitSubstitution rs.2 (inverseAffineUnitSubstitution rs.1 t)) := by + rw [Finset.sum_ite_eq, ite_eq_left (Finset.mem_univ _), affineUnitSubstitution_composition] + have h := affineUnitPair_coe rs.1 rs.2 + rw [← congrArg Prod.fst h, ← congrArg Prod.snd h] + simp_rw [hsum] + rw [Fintype.sum_prod_type] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ArrangementGraph.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ArrangementGraph.lean new file mode 100644 index 0000000000000000000000000000000000000000..8917151067c8037e01364f17d3e5d746dece5dd8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ArrangementGraph.lean @@ -0,0 +1,83 @@ +import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected +import OAI.NumberTheory.Ostmann.Tree.PartitionMatching + +namespace OAI + +/-! # The bipartite overlap graph of an actual bulk permutation -/ + +namespace Ostmann + +open scoped Classical + +def arrangementGraph {L : Type*} (m : ℕ) (e : Equiv.Perm (L × Fin m)) : + SimpleGraph (L ⊕ L) where + Adj x y := match x, y with + | .inl a, .inr b => ∃ i j, e (a, i) = (b, j) + | .inr b, .inl a => ∃ i j, e (a, i) = (b, j) + | _, _ => False + symm := ⟨by intro x y; cases x <;> cases y <;> exact id⟩ + loopless := ⟨by intro x; cases x <;> exact not_false⟩ + +noncomputable instance {L : Type*} [Fintype L] (m : ℕ) + (e : Equiv.Perm (L × Fin m)) : Fintype (arrangementGraph m e).ConnectedComponent := + Fintype.ofFinite _ + +def arrangementLeft {L : Type*} {m : ℕ} (e : Equiv.Perm (L × Fin m)) + (l : L) : (arrangementGraph m e).ConnectedComponent := + (arrangementGraph m e).connectedComponentMk (.inl l) + +def arrangementRight {L : Type*} {m : ℕ} (e : Equiv.Perm (L × Fin m)) + (l : L) : (arrangementGraph m e).ConnectedComponent := + (arrangementGraph m e).connectedComponentMk (.inr l) + +theorem arrangement_components_match {L : Type*} {m : ℕ} + (e : Equiv.Perm (L × Fin m)) (x : L × Fin m) : + arrangementRight e (e x).1 = arrangementLeft e x.1 := by + apply Eq.symm + apply SimpleGraph.ConnectedComponent.connectedComponentMk_eq_of_adj + exact ⟨x.2, (e x).2, rfl⟩ + +def arrangementMatching {L : Type*} {m : ℕ} + (e : Equiv.Perm (L × Fin m)) : + PartitionMatching (fun x : L × Fin m => arrangementLeft e x.1) + (fun x : L × Fin m => arrangementRight e x.1) := + ⟨e, arrangement_components_match e⟩ + +theorem arrangementLeft_surjective {L : Type*} {m : ℕ} (hm : 0 < m) + (e : Equiv.Perm (L × Fin m)) : Function.Surjective (arrangementLeft e) := by + intro c + induction c using SimpleGraph.ConnectedComponent.ind with + | h v => + cases v with + | inl l => exact ⟨l, rfl⟩ + | inr l => + let x := e.symm (l, ⟨0, hm⟩) + refine ⟨x.1, ?_⟩ + have h := arrangement_components_match e x + simpa only [x, Equiv.apply_symm_apply, arrangementRight] using h.symm + +theorem arrangementRight_surjective {L : Type*} {m : ℕ} (hm : 0 < m) + (e : Equiv.Perm (L × Fin m)) : Function.Surjective (arrangementRight e) := by + intro c + obtain ⟨l, rfl⟩ := arrangementLeft_surjective hm e c + exact ⟨(e (l, ⟨0, hm⟩)).1, arrangement_components_match e (l, ⟨0, hm⟩)⟩ + +/-- Counting the slots in a component from the two sides gives equal +leaf counts, because every leaf has exactly m slots. -/ +theorem arrangement_component_balance {L : Type*} [Fintype L] {m : ℕ} + (hm : 0 < m) (e : Equiv.Perm (L × Fin m)) + (c : (arrangementGraph m e).ConnectedComponent) : + Fintype.card {l : L // arrangementLeft e l = c} = + Fintype.card {l : L // arrangementRight e l = c} := by + have h := Fintype.card_congr ((arrangementMatching e).restrict c) + simp only [card_slotFiber] at h + exact Nat.eq_of_mul_eq_mul_right hm h + +theorem arrangement_component_count_le {L : Type*} [Fintype L] {m : ℕ} + (hm : 0 < m) (e : Equiv.Perm (L × Fin m)) : + Fintype.card (arrangementGraph m e).ConnectedComponent ≤ Fintype.card L := + Fintype.card_le_of_surjective _ (arrangementLeft_surjective hm e) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ArrangementReindex.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ArrangementReindex.lean new file mode 100644 index 0000000000000000000000000000000000000000..cba0171edf796c79a51f5c34efc3b852556c0737 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ArrangementReindex.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.Ostmann.Tree.ArrangementGraph + +namespace OAI + +/-! # Transporting actual overlap graphs along a leaf enumeration -/ + +namespace Ostmann + +noncomputable def reindexArrangement {L L' : Type*} (f : L ≃ L') {m : ℕ} + (e : Equiv.Perm (L × Fin m)) : Equiv.Perm (L' × Fin m) := + ((f.symm.prodCongr (Equiv.refl _)).trans e).trans (f.prodCongr (Equiv.refl _)) + +@[simp] theorem reindexArrangement_eq_iff {L L' : Type*} (f : L ≃ L') {m : ℕ} + (e : Equiv.Perm (L × Fin m)) (a b : L) (i j : Fin m) : + reindexArrangement f e (f a, i) = (f b, j) ↔ e (a, i) = (b, j) := by + change (f.prodCongr (Equiv.refl _)) (e (f.symm (f a), i)) = + (f.prodCongr (Equiv.refl _)) (b, j) ↔ _ + rw [f.symm_apply_apply, Equiv.apply_eq_iff_eq] + +noncomputable def arrangementGraphReindex {L L' : Type*} (f : L ≃ L') {m : ℕ} + (e : Equiv.Perm (L × Fin m)) : + arrangementGraph m e ≃g arrangementGraph m (reindexArrangement f e) where + toEquiv := f.sumCongr f + map_rel_iff' := by + intro x y + cases x with + | inl a => + cases y with + | inl b => rfl + | inr b => + change (∃ i j, reindexArrangement f e (f a, i) = (f b, j)) ↔ + ∃ i j, e (a, i) = (b, j) + simp only [reindexArrangement_eq_iff] + | inr b => + cases y with + | inl a => + change (∃ i j, reindexArrangement f e (f a, i) = (f b, j)) ↔ + ∃ i j, e (a, i) = (b, j) + simp only [reindexArrangement_eq_iff] + | inr a => rfl + +theorem arrangement_component_count_reindex {L L' : Type*} [Fintype L] [Fintype L'] + (f : L ≃ L') {m : ℕ} (e : Equiv.Perm (L × Fin m)) : + Fintype.card (arrangementGraph m (reindexArrangement f e)).ConnectedComponent = + Fintype.card (arrangementGraph m e).ConnectedComponent := + (Fintype.card_congr (arrangementGraphReindex f e).connectedComponentEquiv).symm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ArrangementTreeComparison.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ArrangementTreeComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..4b92d96415ad08492abf66d2c8b83f1c4d288621 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ArrangementTreeComparison.lean @@ -0,0 +1,52 @@ +import OAI.NumberTheory.Ostmann.Construction.ArrangementProducts +import OAI.NumberTheory.Ostmann.Characters.TreeComparison + +namespace OAI + +/-! # Applying the quartet comparison to actual overlap components -/ + +namespace Ostmann + +open scoped BigOperators Classical + +theorem arrangement_tree_component_count {n m : ℕ} + (e : Equiv.Perm (TreeLeafIndex (n + 2) × Fin m)) + (hgood : 4 * Fintype.card (arrangementGraph m e).ConnectedComponent ≤ + 3 * Fintype.card (TreeLeafIndex (n + 2))) : + Fintype.card (arrangementGraph m e).ConnectedComponent ≤ 3 * 2 ^ n := by + rw [card_treeLeafIndex, pow_add] at hgood + norm_num at hgood + omega + +/-- All component maps and their nonempty fibers are obtained from the +actual bulk permutation; only the local Fourier bound is supplied. -/ +theorem arrangement_tree_comparison {p : ℕ} [Fact p.Prime] + (hp : 3 ≤ p) (g : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) + (ε : ℝ) (hε : 0 ≤ ε) (hflat : MixedFourierBound g ε) + (n m : ℕ) (hm : 0 < m) + (e : Equiv.Perm (TreeLeafIndex (n + 2) × Fin m)) + (hgood : 4 * Fintype.card (arrangementGraph m e).ConnectedComponent ≤ + 3 * Fintype.card (TreeLeafIndex (n + 2))) + (D₁ D₂ : (ZMod p)ˣ) {K₁ K₂ : (ZMod p)ˣ} + (T₁ : RationalTreeData (ZMod p)ˣ (n + 2) K₁) + (T₂ : RationalTreeData (ZMod p)ˣ (n + 2) K₂) + (XL₁ XR₁ XL₂ XR₂ : (ZMod p)ˣ) (c₁ c₂ : TreeLeafTuple Bool (n + 2)) + (cL cR : TreeLeafIndex n → Bool) + (hconj : ∀ q, quartetBlockEquiv Bool n c₁ q = ((cL q, !(cL q)), (cR q, !(cR q)))) : + ‖pairedPartitionCorrelation (arrangementLeft e) (arrangementRight e) + (indexedRationalAmplitude g D₁ T₁ XL₁ XR₁ c₁) + (indexedRationalAmplitude g D₂ T₂ XL₂ XR₂ c₂)‖ ^ 2 ≤ + (3 : ℝ) ^ (2 ^ (n + 2)) * ((2 : ℝ) ^ (2 ^ n - 1) * (quartetLocalMeanError p ε * + (8 * ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 4) ^ (2 ^ n - 1))) := by + choose pivot₁ hpivot₁ using arrangementLeft_surjective hm e + choose pivot₂ hpivot₂ using arrangementRight_surjective hm e + exact pairedRationalTree_comparison hp g hg henergy ε hε hflat n + (arrangementLeft e) (arrangementRight e) + (fun c => ⟨pivot₁ c, hpivot₁ c⟩) (fun c => ⟨pivot₂ c, hpivot₂ c⟩) + (arrangement_tree_component_count e hgood) + D₁ D₂ T₁ T₂ XL₁ XR₁ XL₂ XR₂ c₁ c₂ cL cR hconj + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/Autocorrelation.lean b/lean/OAI/NumberTheory/Ostmann/Tree/Autocorrelation.lean new file mode 100644 index 0000000000000000000000000000000000000000..84a4bd759bd672e0904827418e9f8bd4be62623c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/Autocorrelation.lean @@ -0,0 +1,51 @@ +import OAI.NumberTheory.Ostmann.Tree.AffineFourier + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [NeZero p] + +def autocorrelation (f : ZMod p → ℂ) (d : ZMod p) : ℂ := + mean (fun x => f x*conj (f (x-d))) + +theorem fourier_conj_sub (f : ZMod p → ℂ) (x a : ZMod p) : + fourier (fun d => conj (f (x-d))) a = + ZMod.stdAddChar (-(a*x))*conj (fourier f a) := by + have h := fourier_affine (fun d => conj (f d)) (-1 : (ZMod p)ˣ) x a + simp only [inv_neg, inv_one, Units.val_neg, Units.val_one, + neg_mul, one_mul, ← conj_fourier] at h + convert h using 1 + congr 1 + funext d + congr 2 + ring + +theorem fourier_autocorrelation (f : ZMod p → ℂ) (a : ZMod p) : + fourier (autocorrelation f) a = (‖fourier f a‖^2 : ℂ) := by + unfold autocorrelation mean + rw [fourier_const_mul, fourier_sum] + simp_rw [fourier_const_mul, fourier_conj_sub] + calc + _ = ((p:ℂ)⁻¹ * ∑ x, f x*ZMod.stdAddChar (-(a*x))) * conj (fourier f a) := by + simp only [Finset.sum_mul, Finset.mul_sum] + apply Finset.sum_congr rfl + intro x _ + ring + _ = fourier f a * conj (fourier f a) := by rw [fourier_apply] + _ = _ := Complex.mul_conj' _ + +@[simp] theorem autocorrelation_zero (f : ZMod p → ℂ) : + autocorrelation f 0 = (l2Sq f : ℂ) := by + simp only [autocorrelation, sub_zero, mean, l2Sq, Complex.mul_conj'] + push_cast + rfl + +theorem autocorrelation_spectral_mass (f : ZMod p → ℂ) : + ∑ a : ZMod p, ‖fourier f a‖^2 = l2Sq f := fourier_parseval f + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/BadArrangementCount.lean b/lean/OAI/NumberTheory/Ostmann/Tree/BadArrangementCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..bfebbd9da0bb2208f7da95075977a959d4694be1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/BadArrangementCount.lean @@ -0,0 +1,71 @@ +import OAI.NumberTheory.Ostmann.Tree.ArrangementGraph +import OAI.NumberTheory.Ostmann.Tree.BadPartitionCounts + +namespace OAI + +/-! # Counting bad permutations through their actual overlap components -/ + +namespace Ostmann + +open scoped BigOperators Classical + +def BadBulkArrangement {r m : ℕ} (e : Equiv.Perm (Fin r × Fin m)) : Prop := + 3 * r < 4 * Fintype.card (arrangementGraph m e).ConnectedComponent + +theorem badBulkArrangement_witness {r m : ℕ} (hm : 0 < m) + (e : Equiv.Perm (Fin r × Fin m)) (he : BadBulkArrangement e) : + ∃ w : BadPartitionWitness r, + ∀ x : Fin r × Fin m, w.2.1.2 (e x).1 = w.2.1.1 x.1 := by + let C := (arrangementGraph m e).ConnectedComponent + let t := Fintype.card C + let E : C ≃ Fin t := Fintype.equivFin C + let f : Fin r → Fin t := E ∘ arrangementLeft e + let g : Fin r → Fin t := E ∘ arrangementRight e + have ht : t ≤ r := by + simpa only [Fintype.card_fin] using arrangement_component_count_le hm e + have hf : Function.Surjective f := E.surjective.comp (arrangementLeft_surjective hm e) + have hg : Function.Surjective g := E.surjective.comp (arrangementRight_surjective hm e) + have hb (c : Fin t) : Fintype.card {l : Fin r // f l = c} = + Fintype.card {l : Fin r // g l = c} := by + have hleft : {l : Fin r // f l = c} ≃ + {l : Fin r // arrangementLeft e l = E.symm c} := + Equiv.subtypeEquivRight (fun _ => E.eq_symm_apply.symm) + have hright : {l : Fin r // g l = c} ≃ + {l : Fin r // arrangementRight e l = E.symm c} := + Equiv.subtypeEquivRight (fun _ => E.eq_symm_apply.symm) + rw [Fintype.card_congr hleft, Fintype.card_congr hright] + exact arrangement_component_balance hm e _ + have hd : 4 * (r - t) ≤ r := by + change 3 * r < 4 * t at he + omega + refine ⟨⟨⟨t, Nat.lt_succ_of_le ht⟩, ⟨(f, g), hf, hg, hb, hd⟩⟩, ?_⟩ + intro x + exact congrArg E (arrangement_components_match e x) + +theorem card_badBulkArrangement_le {r m : ℕ} (hm : 0 < m) : + Fintype.card {e : Equiv.Perm (Fin r × Fin m) // BadBulkArrangement e} ≤ + Fintype.card (Σ w : BadPartitionWitness r, w.Matching m) := by + choose w hw using fun e : {e : Equiv.Perm (Fin r × Fin m) // BadBulkArrangement e} => + badBulkArrangement_witness hm e.1 e.2 + let f : {e : Equiv.Perm (Fin r × Fin m) // BadBulkArrangement e} → + Σ w : BadPartitionWitness r, w.Matching m := fun e => ⟨w e, ⟨e.1, hw e⟩⟩ + apply Fintype.card_le_of_injective f + intro e e' h + apply Subtype.ext + exact congrArg (fun z : Σ w : BadPartitionWitness r, w.Matching m => z.2.1) h + +/-- The arrangement count used in Section 9. The prefactor depends only +on the number of leaves r; all m-dependence is explicit. -/ +theorem badBulkArrangement_count_bound {r m : ℕ} (hr : 1 ≤ r) (hm : 0 < m) : + (Fintype.card {e : Equiv.Perm (Fin r × Fin m) // BadBulkArrangement e} : ℝ) ≤ + ((r + 1) * r ^ (2 * r) : ℕ) * (m.factorial : ℝ) ^ r * + Real.exp ((m : ℝ) * r * (Real.log r + 1) / 4) := by + have hc : (Fintype.card {e : Equiv.Perm (Fin r × Fin m) // BadBulkArrangement e} : ℝ) ≤ + Fintype.card (Σ w : BadPartitionWitness r, w.Matching m) := by + exact_mod_cast card_badBulkArrangement_le hm + apply hc.trans + simpa only [badPartitionCost, mul_assoc] using badPartition_total_bound hr m + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/BadArrangementFraction.lean b/lean/OAI/NumberTheory/Ostmann/Tree/BadArrangementFraction.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd34cc96a053a81d539d306ed80a1f182bda7a0b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/BadArrangementFraction.lean @@ -0,0 +1,42 @@ +import OAI.NumberTheory.Ostmann.Tree.BadArrangementCount +import OAI.NumberTheory.Ostmann.Construction.FactorialExponential + +namespace OAI + +/-! # The exponentially small proportion of bad bulk arrangements -/ + +namespace Ostmann + +open scoped Classical + +theorem badBulkArrangement_fraction_bound {r m : ℕ} (hr : 1 ≤ r) (hm : 1 ≤ m) : + (Fintype.card {e : Equiv.Perm (Fin r × Fin m) // BadBulkArrangement e} : ℝ) / + ((r * m).factorial : ℝ) ≤ + ((r + 1) * r ^ (2 * r) : ℕ) * + Real.exp ((r : ℝ) * m * (-(3 / 4 : ℝ) * Real.log r + 5 / 4)) := by + let C : ℝ := ((r + 1) * r ^ (2 * r) : ℕ) + let q : ℝ := (m : ℝ) * r * (Real.log r + 1) / 4 + have hc := badBulkArrangement_count_bound hr (show 0 < m by omega) + change (Fintype.card {e : Equiv.Perm (Fin r × Fin m) // BadBulkArrangement e} : ℝ) ≤ + C * (m.factorial : ℝ) ^ r * Real.exp q at hc + calc + _ ≤ C * (m.factorial : ℝ) ^ r * Real.exp q / ((r * m).factorial : ℝ) := + div_le_div_of_nonneg_right hc (by positivity) + _ = (C * Real.exp q) * ((m.factorial : ℝ) ^ r / ((r * m).factorial : ℝ)) := by ring + _ ≤ (C * Real.exp q) * Real.exp ((r : ℝ) * m * (1 - Real.log r)) := + mul_le_mul_of_nonneg_left (block_factorial_ratio hr hm) (by dsimp [C]; positivity) + _ = _ := by + rw [mul_assoc, ← Real.exp_add] + congr 2 + dsimp [q] + ring + +/-- The total number of labeled arrangements is (rm)!, including when +different slots happen to contain the same prime value. -/ +theorem card_bulkPerm (r m : ℕ) : + Fintype.card (Equiv.Perm (Fin r × Fin m)) = (r * m).factorial := by + rw [Fintype.card_perm, Fintype.card_prod, Fintype.card_fin, Fintype.card_fin] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/BadConvolution.lean b/lean/OAI/NumberTheory/Ostmann/Tree/BadConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..583ac64420fce26813d1210c2da271ddc7c1ae5b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/BadConvolution.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.Tree.BadNonprincipalConvolution +import OAI.NumberTheory.Ostmann.Tree.BadPrincipalConvolution +import OAI.NumberTheory.Ostmann.Tree.CorrelationSymmetry + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem bad_convolution_precise (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (ν : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) + (hh0 : h 0=0) (hh : l2Sq h≤1) : + (∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + ‖twistedPairFourier g σ χ (ν*ψ⁻¹) a‖^2* + ‖twistedPairFourier h τ ψ (ν⁻¹*χ⁻¹) (-a)‖^2) ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^3* + (2*(correlationBound g:ℝ)^2+2*(correlationBound h:ℝ)^2+7/(p:ℝ))+ + (((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))*(correlationBound g:ℝ)^2+ + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹)^2 * + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2 := by + have hn := bad_nonprincipal_convolution_bound g h σ τ ν hg0 hg hh0 hh + have hl := bad_mixed_left_bound g h σ τ ν hg0 hg hh0 hh + have hr := bad_mixed_right_bound g h σ τ ν hg0 hg hh0 hh + have hp := bad_principal_bound g h σ τ ν hg0 hg hh0 hh + simp_rw [spectralEnergy_decomposition,add_mul,mul_add,Finset.sum_add_distrib] + simp only [div_eq_mul_inv] at hn hl hr hp ⊢ + nlinarith only [hn,hl,hr,hp] + +theorem prime_unit_ratio_le_two : (p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ)≤2 := by + have hp : (2:ℝ)≤p := by exact_mod_cast (Fact.out : p.Prime).two_le + have hN : 0<(Fintype.card (ZMod p)ˣ:ℝ) := by exact_mod_cast Fintype.card_pos + have he : (Fintype.card (ZMod p)ˣ:ℝ)=(p:ℝ)-1 := by + rw [ZMod.card_units,Nat.cast_sub (Fact.out : p.Prime).one_lt.le,Nat.cast_one] + apply (div_le_iff₀ hN).mpr + rw [he] + linarith + +theorem bad_convolution_bound (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (ν : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) + (hh0 : h 0=0) (hh : l2Sq h≤1) : + (∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + ‖twistedPairFourier g σ χ (ν*ψ⁻¹) a‖^2* + ‖twistedPairFourier h τ ψ (ν⁻¹*χ⁻¹) (-a)‖^2) ≤ + 100*((correlationBound g:ℝ)^2+(correlationBound h:ℝ)^2+(p:ℝ)⁻¹) := by + let C : ℝ := (p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ) + let x : ℝ := (correlationBound g:ℝ)^2 + let y : ℝ := (correlationBound h:ℝ)^2 + let t : ℝ := (p:ℝ)⁻¹ + have hC0 : 0≤C := by dsimp [C]; positivity + have hC2 : C≤2 := prime_unit_ratio_le_two + have hx0 : 0≤x := sq_nonneg _ + have hy0 : 0≤y := sq_nonneg _ + have hx1 : x≤1 := by + exact (pow_le_pow_left₀ (NNReal.coe_nonneg _) (correlationBound_le_one g hg) 2).trans_eq (by norm_num) + have ht0 : 0≤t := by dsimp [t]; positivity + have ht1 : t≤1 := by + dsimp [t] + exact inv_le_one_of_one_le₀ (by exact_mod_cast (Fact.out : p.Prime).one_lt.le) + have hC3 : C^3≤8 := (pow_le_pow_left₀ hC0 hC2 3).trans_eq (by norm_num) + have hC4 : C^4≤16 := (pow_le_pow_left₀ hC0 hC2 4).trans_eq (by norm_num) + have hs : (x+t)^2≤2*x+2*t := by + have hx := mul_le_mul_of_nonneg_left hx1 hx0 + have ht := mul_le_mul_of_nonneg_left ht1 ht0 + nlinarith only [hx,ht,sq_nonneg (x-t)] + have hprec := bad_convolution_precise g h σ τ ν hg0 hg hh0 hh + have hp : (p:ℝ)≠0 := by exact_mod_cast (Fact.out : p.Prime).ne_zero + have hform : + C^3*(2*x+2*y+7/(p:ℝ))+ + (C*x+(Fintype.card (ZMod p)ˣ:ℝ)⁻¹)^2*C^2 = + C^3*(2*x+2*y+7*t)+C^4*(x+t)^2 := by + dsimp [C,t] + field_simp + change _≤C^3*(2*x+2*y+7/(p:ℝ))+(C*x+(Fintype.card (ZMod p)ˣ:ℝ)⁻¹)^2*C^2 at hprec + rw [hform] at hprec + have hfirst := mul_le_mul_of_nonneg_right hC3 (show 0≤2*x+2*y+7*t by positivity) + have hsecond := mul_le_mul hC4 hs (sq_nonneg _) (by norm_num : (0:ℝ)≤16) + change _≤100*(x+y+t) + nlinarith only [hprec,hfirst,hsecond,hx0,hy0,ht0] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/BadNonprincipalConvolution.lean b/lean/OAI/NumberTheory/Ostmann/Tree/BadNonprincipalConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..34509701ec2fdbca550b1eeaa54b30203a446ad4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/BadNonprincipalConvolution.lean @@ -0,0 +1,30 @@ +import OAI.NumberTheory.Ostmann.Tree.CrossedMoments +import OAI.NumberTheory.Ostmann.Tree.SpectralParts + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem bad_nonprincipal_convolution_bound (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (ν : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) + (hh0 : h 0=0) (hh : l2Sq h≤1) : + (∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + nonprincipalEnergy g σ χ (ν*ψ⁻¹) a* + nonprincipalEnergy h τ ψ (ν⁻¹*χ⁻¹) (-a)) ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^3* + (2*(correlationBound g:ℝ)^2+2*(correlationBound h:ℝ)^2+3/(p:ℝ)) := by + have hc := crossed_moment_bound (nonprincipalEnergy g σ) (nonprincipalEnergy h τ) + ν (Equiv.neg (ZMod p)) + change 2*(∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + nonprincipalEnergy g σ χ (ν*ψ⁻¹) a*nonprincipalEnergy h τ ψ (ν⁻¹*χ⁻¹) (-a)) ≤ _ at hc + have hL := nonprincipalEnergy_fourth g σ hg0 hg + have hR := nonprincipalEnergy_fourth h τ hh0 hh + nlinarith only [hc,hL,hR] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/BadPartitionCounts.lean b/lean/OAI/NumberTheory/Ostmann/Tree/BadPartitionCounts.lean new file mode 100644 index 0000000000000000000000000000000000000000..094a6aa5cd2c2ef2ffd91353a7c98ef4356f72c9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/BadPartitionCounts.lean @@ -0,0 +1,100 @@ +import OAI.NumberTheory.Ostmann.Tree.PartitionMatching +import OAI.NumberTheory.Ostmann.Tree.ComponentFactorial +import OAI.NumberTheory.Ostmann.Tree.PartitionProducts + +namespace OAI + +/-! # Uniform counting bound for paired leaf partitions -/ + +namespace Ostmann + +open scoped BigOperators Classical + +abbrev BadPartitionPair (r t : ℕ) := + {fg : (Fin r → Fin t) × (Fin r → Fin t) // + Function.Surjective fg.1 ∧ Function.Surjective fg.2 ∧ + (∀ c, Fintype.card {l : Fin r // fg.1 l = c} = + Fintype.card {l : Fin r // fg.2 l = c}) ∧ 4 * (r - t) ≤ r} + +abbrev BadPartitionWitness (r : ℕ) := Σ t : Fin (r + 1), BadPartitionPair r t + +abbrev BadPartitionWitness.Matching {r : ℕ} (w : BadPartitionWitness r) (m : ℕ) := + PartitionMatching (fun x : Fin r × Fin m => w.2.1.1 x.1) + (fun x : Fin r × Fin m => w.2.1.2 x.1) + +theorem card_badPartitionPair_le (r t : ℕ) : + Fintype.card (BadPartitionPair r t) ≤ t ^ (2 * r) := by + calc + _ ≤ Fintype.card ((Fin r → Fin t) × (Fin r → Fin t)) := + Fintype.card_le_of_injective Subtype.val Subtype.val_injective + _ = _ := by simp [Fintype.card_prod, pow_mul, pow_two, mul_pow] + +theorem card_badPartitionWitness_le (r : ℕ) : + Fintype.card (BadPartitionWitness r) ≤ (r + 1) * r ^ (2 * r) := by + rw [Fintype.card_sigma] + calc + _ ≤ ∑ t : Fin (r + 1), r ^ (2 * r) := by + apply Finset.sum_le_sum + intro t _ + exact (card_badPartitionPair_le r t).trans + (Nat.pow_le_pow_left (Nat.le_of_lt_succ t.isLt) _) + _ = _ := by simp + +noncomputable def badPartitionCost (r m : ℕ) : ℝ := + (m.factorial : ℝ) ^ r * Real.exp ((m : ℝ) * r * (Real.log r + 1) / 4) + +theorem badPartitionCost_nonneg (r m : ℕ) : 0 ≤ badPartitionCost r m := by + unfold badPartitionCost + positivity + +theorem badPartition_matching_bound {r : ℕ} (hr : 1 ≤ r) + (w : BadPartitionWitness r) (m : ℕ) : + (Fintype.card (w.Matching m) : ℝ) ≤ badPartitionCost r m := by + let a : Fin w.1 → ℕ := fun c => Fintype.card {l : Fin r // w.2.1.1 l = c} + have ha (c : Fin w.1) : 1 ≤ a c := by + obtain ⟨l, hl⟩ := w.2.2.1 c + exact Fintype.card_pos_iff.mpr ⟨⟨l, hl⟩⟩ + have hs : ∑ c, a c = r := by + simpa only [Fintype.card_fin] using sum_card_partition w.2.1.1 + have hc : (Fintype.card (w.Matching m) : ℝ) ≤ + ∏ c, ((a c * m).factorial : ℝ) := by + have hbal := fun c => w.2.2.2.2.1 c + have h := card_slotMatching_le w.2.1.1 w.2.1.2 m + (fun c => by simpa only [Fintype.card_eq_nat_card] using hbal c) + have hnat : Fintype.card (w.Matching m) ≤ ∏ c, (a c * m).factorial := by + simpa only [a, Fintype.card_eq_nat_card] using h + exact_mod_cast hnat + have ht : (w.1 : ℕ) ≤ r := Nat.le_of_lt_succ w.1.isLt + have hd : 4 * ((r : ℝ) - (w.1 : ℕ)) ≤ r := by + have h := w.2.2.2.2.2 + have h' : (4 : ℝ) * ((r - (w.1 : ℕ) : ℕ) : ℝ) ≤ r := by exact_mod_cast h + simpa only [Nat.cast_sub ht] using h' + have hl : 0 ≤ Real.log (r : ℝ) + 1 := by + have := Real.log_nonneg (show (1 : ℝ) ≤ r by exact_mod_cast hr) + linarith + apply hc.trans + apply (component_factorial_product_bound a r m ha hs).trans + unfold badPartitionCost + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Real.exp_le_exp.mpr + simp only [Fintype.card_fin] + have hh := mul_le_mul_of_nonneg_left hd + (mul_nonneg (show (0 : ℝ) ≤ m by positivity) hl) + nlinarith + +/-- Sum over every possible pair of component partitions. The prefactor +depends only on r, and not on the number m of slots at a leaf. -/ +theorem badPartition_total_bound {r : ℕ} (hr : 1 ≤ r) (m : ℕ) : + (Fintype.card (Σ w : BadPartitionWitness r, w.Matching m) : ℝ) ≤ + ((r + 1) * r ^ (2 * r) : ℕ) * badPartitionCost r m := by + rw [Fintype.card_sigma, Nat.cast_sum] + calc + _ ≤ ∑ _w : BadPartitionWitness r, badPartitionCost r m := + Finset.sum_le_sum fun w _ => badPartition_matching_bound hr w m + _ = (Fintype.card (BadPartitionWitness r) : ℝ) * badPartitionCost r m := by simp + _ ≤ _ := mul_le_mul_of_nonneg_right + (by exact_mod_cast card_badPartitionWitness_le r) (badPartitionCost_nonneg r m) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/BadPrincipalConvolution.lean b/lean/OAI/NumberTheory/Ostmann/Tree/BadPrincipalConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..03bdc79f1840c358bc2c2424bbacfdaffafe36d7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/BadPrincipalConvolution.lean @@ -0,0 +1,122 @@ +import OAI.NumberTheory.Ostmann.Tree.DoubleMellinEnergy +import OAI.NumberTheory.Ostmann.Tree.SpectralParts + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem principalEnergy_mulInv (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ ν ψ : MulChar (ZMod p) ℂ) (a : ZMod p) : + principalEnergy g σ χ (ν*ψ⁻¹) a= + if ψ=ν then ‖twistedPairFourier g σ χ 1 a‖^2 else 0 := by + classical + by_cases he : ψ=ν + · subst ψ + simp [principalEnergy] + · have hα : (ν*ψ⁻¹ : MulChar (ZMod p) ℂ)≠1 := by + intro hmul + exact he (mul_inv_eq_one.mp hmul).symm + simp [principalEnergy,he,hα] + +theorem principalEnergy_total (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (ν : MulChar (ZMod p) ℂ) (e : ZMod p ≃ ZMod p) (hg0 : g 0=0) (hg : l2Sq g≤1) : + (∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + principalEnergy g σ ψ (ν*χ⁻¹) (e a)) ≤ 2*(p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ) := by + classical + rw [Finset.sum_comm] + have he (ψ : MulChar (ZMod p) ℂ) : + (∑ χ : MulChar (ZMod p) ℂ,∑ a : ZMod p,principalEnergy g σ ψ (ν*χ⁻¹) (e a)) = + ∑ a : ZMod p,‖twistedPairFourier g σ ψ 1 a‖^2 := by + rw [Finset.sum_comm] + simp_rw [principalEnergy_mulInv] + simp only [Finset.sum_ite_eq',Finset.mem_univ,ite_true] + exact e.sum_comp (fun a => ‖twistedPairFourier g σ ψ 1 a‖^2) + simp_rw [he] + exact (Finset.sum_le_sum (fun ψ _ => twistedPairFourier_energy g σ ψ 1)).trans + (pairFourthMass_total g hg0 hg) + +theorem bad_mixed_left_bound (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (ν : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) + (hh0 : h 0=0) (hh : l2Sq h≤1) : + (∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + nonprincipalEnergy g σ χ (ν*ψ⁻¹) a*principalEnergy h τ ψ (ν⁻¹*χ⁻¹) (-a)) ≤ + 2*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^3/(p:ℝ) := by + let B : ℝ := (p:ℝ)⁻¹*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2 + calc + _ ≤ ∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + B*principalEnergy h τ ψ (ν⁻¹*χ⁻¹) (-a) := by + apply Finset.sum_le_sum + intro χ _ + apply Finset.sum_le_sum + intro ψ _ + apply Finset.sum_le_sum + intro a _ + exact mul_le_mul_of_nonneg_right (nonprincipalEnergy_le g σ χ _ a hg0 hg) + (principalEnergy_nonneg h τ ψ _ (-a)) + _ = B*(∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + principalEnergy h τ ψ (ν⁻¹*χ⁻¹) (-a)) := by simp only [Finset.mul_sum] + _ ≤ B*(2*(p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ)) := + mul_le_mul_of_nonneg_left (principalEnergy_total h τ ν⁻¹ (Equiv.neg _) hh0 hh) (by dsimp [B]; positivity) + _ = _ := by dsimp [B]; ring + +theorem bad_mixed_right_bound (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (ν : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) + (hh0 : h 0=0) (hh : l2Sq h≤1) : + (∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + principalEnergy g σ χ (ν*ψ⁻¹) a*nonprincipalEnergy h τ ψ (ν⁻¹*χ⁻¹) (-a)) ≤ + 2*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^3/(p:ℝ) := by + have he : (∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + principalEnergy g σ χ (ν*ψ⁻¹) a*nonprincipalEnergy h τ ψ (ν⁻¹*χ⁻¹) (-a)) = + ∑ ψ : MulChar (ZMod p) ℂ,∑ χ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + nonprincipalEnergy h τ ψ (ν⁻¹*χ⁻¹) a*principalEnergy g σ χ (ν*ψ⁻¹) (-a) := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro ψ _ + apply Finset.sum_congr rfl + intro χ _ + have hi := (Equiv.neg (ZMod p)).bijective.sum_comp + (fun a => nonprincipalEnergy h τ ψ (ν⁻¹*χ⁻¹) a*principalEnergy g σ χ (ν*ψ⁻¹) (-a)) + simpa only [Equiv.neg_apply,neg_neg,mul_comm] using hi + rw [he] + simpa only [inv_inv] using bad_mixed_left_bound h g τ σ ν⁻¹ hh0 hh hg0 hg + +theorem bad_principal_bound (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (ν : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) + (hh0 : h 0=0) (hh : l2Sq h≤1) : + (∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + principalEnergy g σ χ (ν*ψ⁻¹) a*principalEnergy h τ ψ (ν⁻¹*χ⁻¹) (-a)) ≤ + (((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))*(correlationBound g:ℝ)^2+ + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹)^2 * + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2 := by + classical + let B : ℝ := ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))*(correlationBound g:ℝ)^2+ + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹ + have he : (∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + principalEnergy g σ χ (ν*ψ⁻¹) a*principalEnergy h τ ψ (ν⁻¹*χ⁻¹) (-a)) = + ∑ a : ZMod p, ‖twistedPairFourier g σ ν⁻¹ 1 a‖^2*‖twistedPairFourier h τ ν 1 (-a)‖^2 := by + rw [sum_three_rotate] + apply Finset.sum_congr rfl + intro a _ + simp only [principalEnergy_mulInv,ite_mul,mul_ite,zero_mul,mul_zero] + simp + rw [he] + calc + _ ≤ ∑ a : ZMod p,B^2*‖twistedPairFourier h τ ν 1 (-a)‖^2 := by + apply Finset.sum_le_sum + intro a _ + exact mul_le_mul_of_nonneg_right + (pow_le_pow_left₀ (norm_nonneg _) (norm_twistedPairFourier_principal_le g σ ν⁻¹ a hg0 hg) 2) (sq_nonneg _) + _ = B^2*(∑ a : ZMod p, ‖twistedPairFourier h τ ν 1 a‖^2) := by + rw [← Finset.mul_sum] + congr 1 + exact (Equiv.neg (ZMod p)).bijective.sum_comp (fun a => ‖twistedPairFourier h τ ν 1 a‖^2) + _ ≤ B^2*pairFourthMass h ν := mul_le_mul_of_nonneg_left (twistedPairFourier_energy h τ ν 1) (sq_nonneg _) + _ ≤ _ := mul_le_mul_of_nonneg_left (pairFourthMass_basic_le h ν hh0 hh) (sq_nonneg _) + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/BottomPairCoordinates.lean b/lean/OAI/NumberTheory/Ostmann/Tree/BottomPairCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..d57847a16a8336aed740e593881f6a78966aefd1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/BottomPairCoordinates.lean @@ -0,0 +1,74 @@ +import Mathlib.Algebra.Field.Basic +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# Coordinates for a bottom pair of the finite-field tree + +The change of variables in §6 sends `(d,t)` to `(dt/(t-1),d/(t-1))`. +On its valid domain this is a bijection with the ordered distinct nonzero +pairs. It is the change of variables used in the bottom-pair second moment. +-/ + +namespace Ostmann + +variable {K : Type*} [Field K] + +def ValidPairCoordinates (K : Type*) [Field K] := + {dt : K × K // dt.1 ≠ 0 ∧ dt.2 ≠ 0 ∧ dt.2 ≠ 1} + +def DistinctNonzeroPair (K : Type*) [Field K] := + {xz : K × K // xz.1 ≠ 0 ∧ xz.2 ≠ 0 ∧ xz.1 ≠ xz.2} + +theorem pair_coordinate_difference (d t : K) (ht : t ≠ 1) : + d * t / (t - 1) - d / (t - 1) = d := by + have hden : t - 1 ≠ 0 := sub_ne_zero.mpr ht + field_simp + +theorem pair_coordinate_ratio (d t : K) (hd : d ≠ 0) (ht : t ≠ 1) : + (d * t / (t - 1)) / (d / (t - 1)) = t := by + have hden : t - 1 ≠ 0 := sub_ne_zero.mpr ht + field_simp + +theorem pair_coordinates_reconstruct (x z : K) (hz : z ≠ 0) (hxz : x ≠ z) : + ((x - z) * (x / z) / (x / z - 1), (x - z) / (x / z - 1)) = (x, z) := by + have hden : x / z - 1 ≠ 0 := by + intro h + have : x / z = 1 := sub_eq_zero.mp h + exact hxz ((div_eq_one_iff_eq hz).mp this) + have hsub : x - z ≠ 0 := sub_ne_zero.mpr hxz + apply Prod.ext <;> dsimp + · field_simp [hsub] + · field_simp [hsub] + +/-- The difference and ratio coordinates parametrize exactly the ordered +distinct nonzero pairs. -/ +noncomputable def pairCoordinatesEquiv (K : Type*) [Field K] : + ValidPairCoordinates K ≃ DistinctNonzeroPair K where + toFun dt := ⟨(dt.1.1 * dt.1.2 / (dt.1.2 - 1), dt.1.1 / (dt.1.2 - 1)), by + have hd := dt.2.1 + have ht := dt.2.2.1 + have hden := sub_ne_zero.mpr dt.2.2.2 + refine ⟨div_ne_zero (mul_ne_zero hd ht) hden, div_ne_zero hd hden, ?_⟩ + intro heq + dsimp only at heq + have hdifference := pair_coordinate_difference dt.1.1 dt.1.2 dt.2.2.2 + rw [heq, sub_self] at hdifference + exact hd hdifference.symm⟩ + invFun xz := ⟨(xz.1.1 - xz.1.2, xz.1.1 / xz.1.2), by + refine ⟨sub_ne_zero.mpr xz.2.2.2, div_ne_zero xz.2.1 xz.2.2.1, ?_⟩ + intro heq + exact xz.2.2.2 ((div_eq_one_iff_eq xz.2.2.1).mp heq)⟩ + left_inv dt := by + apply Subtype.ext + exact Prod.ext (pair_coordinate_difference dt.1.1 dt.1.2 dt.2.2.2) + (pair_coordinate_ratio dt.1.1 dt.1.2 dt.2.1 dt.2.2.2) + right_inv xz := by + apply Subtype.ext + exact pair_coordinates_reconstruct xz.1.1 xz.1.2 xz.2.2.1 xz.2.2.2 + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CellGroupExponentialCost.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CellGroupExponentialCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b07f97addbdab06f8fe2e71e8321cbf147c0cbf --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CellGroupExponentialCost.lean @@ -0,0 +1,81 @@ +import Mathlib.Analysis.SpecialFunctions.Log.Basic +import OAI.NumberTheory.Ostmann.Tree.CellGroupPigeonhole + +namespace OAI + +/-! # The exact cell-list pigeonhole costs only a fixed exponential in m -/ +namespace Ostmann +open Filter +open scoped Classical BigOperators + +theorem eventual_cell_group_cost (N r : ℕ) (C z : ℝ) + (hC : 0 ≤ C) (hz : 1 ≤ z) (hsize : (N + r : ℕ) ≤ z) : + ∀ᶠ L : ℝ in atTop, ∀ (B : ℕ) (m : ℝ), + (B + 1 : ℕ) ≤ Real.exp (C * L) → z * L ≤ 2 * m → + (((N + r + 1) * (max N B + 1) ^ (N + r) : ℕ) : ℝ) ≤ + Real.exp (2 * (C + 2) * m) := by + filter_upwards [eventually_ge_atTop (max 0 (max (Real.log (N + r + 1 : ℕ)) + (Real.log (N + 1 : ℕ))))] with L hL + intro B m hB hm + have hL0 : 0 ≤ L := (le_max_left _ _).trans hL + have hLr : Real.log (N + r + 1 : ℕ) ≤ L := + (le_max_left _ _).trans ((le_max_right _ _).trans hL) + have hLN : Real.log (N + 1 : ℕ) ≤ L := + (le_max_right _ _).trans ((le_max_right _ _).trans hL) + have hpref : (N + r + 1 : ℕ) ≤ Real.exp L := by + rw [← Real.exp_log (by positivity : (0 : ℝ) < (N + r + 1 : ℕ))] + exact Real.exp_le_exp.mpr hLr + have hN : (N + 1 : ℕ) ≤ Real.exp L := by + rw [← Real.exp_log (by positivity : (0 : ℝ) < (N + 1 : ℕ))] + exact Real.exp_le_exp.mpr hLN + have hmax : (max N B + 1 : ℕ) ≤ Real.exp ((C + 1) * L) := by + rw [Nat.cast_add, Nat.cast_one, Nat.cast_max, ← max_add_add_right] + apply max_le + · exact (show (N : ℝ) + 1 ≤ Real.exp L from by simpa only [Nat.cast_add, Nat.cast_one] using hN).trans + (Real.exp_le_exp.mpr (by nlinarith only [mul_nonneg hC hL0])) + · exact (show (B : ℝ) + 1 ≤ Real.exp (C * L) from by simpa only [Nat.cast_add, Nat.cast_one] using hB).trans + (Real.exp_le_exp.mpr (by nlinarith only [hL0])) + calc + _ ≤ Real.exp L * (Real.exp ((C + 1) * L)) ^ (N + r) := by + rw [Nat.cast_mul, Nat.cast_pow] + exact mul_le_mul hpref (pow_le_pow_left₀ (Nat.cast_nonneg _) hmax _) + (by positivity) (Real.exp_nonneg _) + _ = Real.exp ((1 + (C + 1) * (N + r : ℕ)) * L) := by + rw [← Real.exp_nat_mul, ← Real.exp_add] + congr 1 + ring + _ ≤ Real.exp ((C + 2) * z * L) := by + apply Real.exp_le_exp.mpr + have hh := mul_le_mul_of_nonneg_left hsize (by linarith : 0 ≤ C + 1) + have hcoef : 1 + (C + 1) * (N + r : ℕ) ≤ (C + 2) * z := by nlinarith only [hh, hz] + exact mul_le_mul_of_nonneg_right hcoef hL0 + _ ≤ _ := Real.exp_le_exp.mpr (by + have hh := mul_le_mul_of_nonneg_left hm (by linarith : 0 ≤ C + 2) + nlinarith only [hh]) + +/-- The endpoint count after fixing all cell lists keeps an explicit +exponential rate, with no dependence on the number of fixed labels in it. -/ +theorem cell_group_endpoint_rate (e s : ℕ) (F X A B m : ℝ) + (hcount : (e : ℝ) ≤ F * s) (hF : F ≤ Real.exp (B * m)) + (he : Real.sqrt X * Real.exp (-A * m) ≤ e) : + Real.sqrt X * Real.exp (-(A + B) * m) ≤ s := by + have hb : Real.sqrt X * Real.exp (-A * m) ≤ Real.exp (B * m) * s := + he.trans (hcount.trans (mul_le_mul_of_nonneg_right hF (Nat.cast_nonneg s))) + have hh := mul_le_mul_of_nonneg_left hb (Real.exp_nonneg (-B * m)) + have hid : Real.exp (-B * m) * (Real.exp (B * m) * (s : ℝ)) = s := by + rw [← mul_assoc, ← Real.exp_add, show -B * m + B * m = 0 by ring, Real.exp_zero, one_mul] + rw [hid] at hh + calc + _ = Real.exp (-B * m) * (Real.sqrt X * Real.exp (-A * m)) := by + calc + _ = Real.sqrt X * (Real.exp (-B * m) * Real.exp (-A * m)) := by + rw [← Real.exp_add] + congr 1 + congr 1 + ring + _ = _ := by ring + _ ≤ _ := hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CellGroupPigeonhole.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CellGroupPigeonhole.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f831d3ed1c5522eb5e253b828f2be9c31e7a3e4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CellGroupPigeonhole.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.Ostmann.Tree.CellListPigeonhole + +namespace OAI + +/-! # Fixing every cell group at the cost of the total number of labels -/ + +namespace Ostmann + +def encodeCellGroups : List (List ℕ) → List ℕ + | [] => [] + | w :: ws => w.length :: (w ++ encodeCellGroups ws) + +def decodeCellGroups : ℕ → List ℕ → List (List ℕ) + | 0, _ => [] + | _ + 1, [] => [] + | r + 1, n :: xs => xs.take n :: decodeCellGroups r (xs.drop n) + +theorem decode_encodeCellGroups (ws : List (List ℕ)) : + decodeCellGroups ws.length (encodeCellGroups ws) = ws := by + induction ws with + | nil => rfl + | cons w ws ih => simp [encodeCellGroups, decodeCellGroups, ih] + +theorem encodeCellGroups_injective_of_length {ws vs : List (List ℕ)} + (hlen : ws.length = vs.length) (he : encodeCellGroups ws = encodeCellGroups vs) : ws = vs := by + calc + ws = decodeCellGroups ws.length (encodeCellGroups ws) := (decode_encodeCellGroups ws).symm + _ = decodeCellGroups vs.length (encodeCellGroups vs) := by rw [hlen, he] + _ = vs := decode_encodeCellGroups vs + +theorem encodeCellGroups_length (ws : List (List ℕ)) : + (encodeCellGroups ws).length = (ws.map List.length).sum + ws.length := by + induction ws with + | nil => rfl + | cons w ws ih => simp only [encodeCellGroups, List.length_cons, List.length_append, + List.map_cons, List.sum_cons, ih]; omega + +theorem encodeCellGroups_entries (ws : List (List ℕ)) (N B : ℕ) + (hl : ∀ w ∈ ws, w.length ≤ N) (he : ∀ w ∈ ws, ∀ h ∈ w, h ≤ B) : + ∀ h ∈ encodeCellGroups ws, h ≤ max N B := by + induction ws with + | nil => simp [encodeCellGroups] + | cons w ws ih => + intro h hh + simp only [encodeCellGroups, List.mem_cons, List.mem_append] at hh + rcases hh with rfl | hw | hws + · exact (hl w (by simp)).trans (le_max_left _ _) + · exact (he w (by simp) h hw).trans (le_max_right _ _) + · exact ih (fun v hv => hl v (by simp [hv])) + (fun v hv => he v (by simp [hv])) h hws + +/-- Length-prefix coding retains the group boundaries while using only one +extra entry per group. Thus the pigeonhole cost depends on the total label +count, rather than the product of the separate group-length bounds. -/ +theorem common_cell_groups (E : Finset ℕ) (hE : E.Nonempty) (r N B : ℕ) + (ws : ℕ → List (List ℕ)) + (hr : ∀ a ∈ E, (ws a).length = r) + (hlen : ∀ a ∈ E, ((ws a).map List.length).sum ≤ N) + (hentry : ∀ a ∈ E, ∀ w ∈ ws a, ∀ h ∈ w, h ≤ B) : + ∃ v : List (List ℕ), ∃ S : Finset ℕ, S ⊆ E ∧ S.Nonempty ∧ + E.card ≤ ((N + r + 1) * (max N B + 1) ^ (N + r)) * S.card ∧ + ∀ a ∈ S, ws a = v := by + have hlength (a : ℕ) (ha : a ∈ E) : (encodeCellGroups (ws a)).length ≤ N + r := by + rw [encodeCellGroups_length, hr a ha] + exact Nat.add_le_add_right (hlen a ha) r + have hbound (a : ℕ) (ha : a ∈ E) : + ∀ h ∈ encodeCellGroups (ws a), h ≤ max N B := by + apply encodeCellGroups_entries + · intro w hw + apply le_trans _ (hlen a ha) + exact List.single_le_sum (fun _ _ => Nat.zero_le _) w.length (List.mem_map.mpr ⟨w, hw, rfl⟩) + · exact hentry a ha + obtain ⟨code, S, hSE, hcard, hsame⟩ := common_cell_list E (N + r) (max N B) + (fun a => encodeCellGroups (ws a)) hlength hbound + have hS : S.Nonempty := by + by_contra hn + have hz : S.card = 0 := Finset.card_eq_zero.mpr (Finset.not_nonempty_iff_eq_empty.mp hn) + rw [hz, Nat.mul_zero] at hcard + exact (Nat.not_le_of_gt hE.card_pos) hcard + obtain ⟨a₀, ha₀⟩ := hS + refine ⟨ws a₀, S, hSE, ⟨a₀, ha₀⟩, hcard, ?_⟩ + intro a ha + exact encodeCellGroups_injective_of_length ((hr a (hSE ha)).trans (hr a₀ (hSE ha₀)).symm) + ((hsame a ha).trans (hsame a₀ ha₀).symm) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CellListPigeonhole.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CellListPigeonhole.lean new file mode 100644 index 0000000000000000000000000000000000000000..26ba66eca138e2cab2d8afb98418f7fc918a4db2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CellListPigeonhole.lean @@ -0,0 +1,71 @@ +import Mathlib.Data.List.OfFn +import Mathlib.Combinatorics.Pigeonhole +import OAI.NumberTheory.Ostmann.Construction.GoodCellSelection + +namespace OAI + +/-! # Fixing the ordered cell lists across endpoints -/ + +namespace Ostmann + +open scoped BigOperators Classical + +noncomputable def boundedCellLists (N B : ℕ) : Finset (List ℕ) := + (Finset.range (N + 1)).biUnion (fun n => + (Finset.univ : Finset (Fin n → Fin (B + 1))).image + (fun f => List.ofFn (fun i => (f i : ℕ)))) + +theorem mem_boundedCellLists (N B : ℕ) (w : List ℕ) + (hlen : w.length ≤ N) (hw : ∀ a ∈ w, a ≤ B) : w ∈ boundedCellLists N B := by + apply Finset.mem_biUnion.mpr + refine ⟨w.length, Finset.mem_range.mpr (by omega), ?_⟩ + let f : Fin w.length → Fin (B + 1) := fun i => + ⟨w.get i, Nat.lt_succ_of_le (hw _ (List.get_mem _ _))⟩ + exact Finset.mem_image.mpr ⟨f, Finset.mem_univ _, List.ofFn_get w⟩ + +theorem boundedCellLists_nonempty (N B : ℕ) : (boundedCellLists N B).Nonempty := + ⟨[], mem_boundedCellLists N B [] (by simp) (by simp)⟩ + +theorem boundedCellLists_card_le (N B : ℕ) : + (boundedCellLists N B).card ≤ (N + 1) * (B + 1) ^ N := by + calc + (boundedCellLists N B).card ≤ ∑ n ∈ Finset.range (N + 1), + ((Finset.univ : Finset (Fin n → Fin (B + 1))).image + (fun f => List.ofFn (fun i => (f i : ℕ)))).card := Finset.card_biUnion_le + _ ≤ ∑ n ∈ Finset.range (N + 1), (B + 1) ^ n := by + apply Finset.sum_le_sum + intro n _ + simpa using (Finset.card_image_le (s := (Finset.univ : Finset (Fin n → Fin (B + 1)))) + (f := fun f => List.ofFn (fun i => (f i : ℕ)))) + _ ≤ ∑ _n ∈ Finset.range (N + 1), (B + 1) ^ N := by + apply Finset.sum_le_sum + intro n hn + have : n ≤ N := by have := Finset.mem_range.mp hn; omega + gcongr + _ = _ := by simp + +/-- Simultaneously fixing all list lengths and ordered cell labels costs +at most the explicit finite number of bounded lists. -/ +theorem common_cell_list (E : Finset ℕ) (N B : ℕ) (w : ℕ → List ℕ) + (hlen : ∀ a ∈ E, (w a).length ≤ N) + (hentry : ∀ a ∈ E, ∀ h ∈ w a, h ≤ B) : + ∃ v : List ℕ, ∃ S : Finset ℕ, S ⊆ E ∧ + E.card ≤ ((N + 1) * (B + 1) ^ N) * S.card ∧ ∀ a ∈ S, w a = v := by + let V := boundedCellLists N B + have hmap : ∀ a ∈ E, w a ∈ V := fun a ha => mem_boundedCellLists N B (w a) (hlen a ha) (hentry a ha) + obtain ⟨v, _, hv⟩ := Finset.exists_max_image V + (fun v => (E.filter (fun a => w a = v)).card) (boundedCellLists_nonempty N B) + refine ⟨v, E.filter (fun a => w a = v), Finset.filter_subset _ _, ?_, ?_⟩ + · calc + E.card = ∑ v ∈ V, (E.filter (fun a => w a = v)).card := + Finset.card_eq_sum_card_fiberwise hmap + _ ≤ ∑ _v ∈ V, (E.filter (fun a => w a = v)).card := + Finset.sum_le_sum (fun u hu => hv u hu) + _ = V.card * (E.filter (fun a => w a = v)).card := by simp + _ ≤ _ := Nat.mul_le_mul_right _ (boundedCellLists_card_le N B) + · intro a ha + exact (Finset.mem_filter.mp ha).2 + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CharacterFourth.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CharacterFourth.lean new file mode 100644 index 0000000000000000000000000000000000000000..2747c61cca3885e06b897836a78b02e86b035dd0 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CharacterFourth.lean @@ -0,0 +1,92 @@ +import OAI.NumberTheory.Ostmann.Tree.Mellin +import OAI.NumberTheory.Ostmann.Tree.QuarticWeighted + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] +local instance characterFourthFintype : Fintype (MulChar F ℂ) := Fintype.ofFinite _ + +theorem sum_mulChar_field_kernel (x y : F) : + (∑ χ : MulChar F ℂ, χ x*conj (χ y)) = + if x=y ∧ x≠0 then (Fintype.card Fˣ:ℂ) else 0 := by + classical + by_cases hx : x=0 + · simp [hx,MulChar.map_zero] + by_cases hy : y=0 + · simp [hy,MulChar.map_zero] + let u : Fˣ := Units.mk0 y hy + let v : Fˣ := Units.mk0 x hx + calc + _ = ∑ χ : MulChar F ℂ, conj (χ u)*χ v := by + apply Finset.sum_congr rfl + intro χ _ + exact mul_comm _ _ + _ = if u=v then (Fintype.card Fˣ:ℂ) else 0 := sum_mulChar_kernel u v + _ = _ := by + by_cases he : x=y + · have huv : u=v := Units.ext he.symm + simp [he,huv,hy] + · have huv : u≠v := fun h => he (congrArg (fun t : Fˣ => (t:F)) h).symm + simp [he,huv] + +omit [Field F] [DecidableEq F] in +theorem norm_sum_fourth_expansion (z : F → ℂ) : + (‖∑ b, z b‖^4:ℂ) = ∑ b : Quartet F, z b.1.1*z b.1.2*conj (z b.2.1)*conj (z b.2.2) := by + calc + _ = ((‖∑ b,z b‖:ℂ)^2)^2 := by ring + _ = ((∑ b,z b)*conj (∑ b,z b))^2 := by rw [Complex.mul_conj'] + _ = _ := by + simp only [Fintype.sum_prod_type,map_sum,← Finset.mul_sum,← Finset.sum_mul] + ring + +def weightedCharacterSum (w : F → ℝ) (χ : MulChar F ℂ) (a : F) : ℂ := + ∑ b, (w b:ℂ)*χ (a-b) + +theorem weightedCharacterSum_fourth_identity (w : F → ℝ) (a : F) : + (∑ χ : MulChar F ℂ, ‖weightedCharacterSum w χ a‖^4) = + (Fintype.card Fˣ:ℝ) * ∑ b : Quartet F, + if quartetCollision a b ∧ (a-b.1.1)*(a-b.1.2)≠0 then quartetWeight w b else 0 := by + classical + apply Complex.ofReal_injective + push_cast + have he (χ : MulChar F ℂ) : + (‖weightedCharacterSum w χ a‖:ℂ)^4 = ∑ b : Quartet F, + (quartetWeight w b:ℂ) * (χ ((a-b.1.1)*(a-b.1.2))*conj (χ ((a-b.2.1)*(a-b.2.2)))) := by + rw [weightedCharacterSum,norm_sum_fourth_expansion] + apply Finset.sum_congr rfl + intro b _ + simp only [quartetWeight,map_mul,Complex.conj_ofReal] + push_cast + ring + simp_rw [he] + rw [Finset.sum_comm,Finset.mul_sum] + apply Finset.sum_congr rfl + intro b _ + rw [← Finset.mul_sum,sum_mulChar_field_kernel] + split_ifs <;> simp_all + ring + +theorem weightedCharacterSum_fourth_bound (w : F → ℝ) (hw : ∀ x,0≤w x) : + (∑ χ : MulChar F ℂ, ∑ a : F, ‖weightedCharacterSum w χ a‖^4) ≤ + (Fintype.card Fˣ:ℝ) * + (2*(Fintype.card F:ℝ)*(∑ x,w x^2)^2+(∑ x,w x)^4) := by + classical + rw [Finset.sum_comm] + simp_rw [weightedCharacterSum_fourth_identity] + rw [← Finset.mul_sum] + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply le_trans _ (quartetCollision_weighted_bound w hw) + apply Finset.sum_le_sum + intro a _ + apply Finset.sum_le_sum + intro b _ + have hW := quartetWeight_nonneg w hw b + split_ifs <;> simp_all + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CharacterFourthNonprincipal.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CharacterFourthNonprincipal.lean new file mode 100644 index 0000000000000000000000000000000000000000..62b57fd8e7d035d354fee25c425b2559ce8b2b7b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CharacterFourthNonprincipal.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.Tree.CharacterFourth + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] +local instance nonprincipalFourthFintype : Fintype (MulChar F ℂ) := Fintype.ofFinite _ + +theorem weightedCharacterSum_principal (w : F → ℝ) (a : F) : + weightedCharacterSum w 1 a = ((∑ b,w b)-w a:ℝ) := by + classical + have he (b : F) : (w b:ℂ)*(1:MulChar F ℂ) (a-b) = + if b=a then 0 else (w b:ℂ) := by + by_cases h : b=a + · simp [h,MulChar.map_zero] + · have hn : a-b≠0 := sub_ne_zero.mpr (Ne.symm h) + rw [MulChar.one_apply (isUnit_iff_ne_zero.mpr hn)] + simp [h] + simp only [weightedCharacterSum,he] + rw [Finset.sum_ite, Finset.sum_const_zero,zero_add] + have hs := Finset.sum_erase_add (Finset.univ : Finset F) (fun b => (w b:ℂ)) (Finset.mem_univ a) + have hf : Finset.univ.filter (fun b : F => ¬ b=a)=Finset.univ.erase a := by ext b; simp [ne_eq,eq_comm] + rw [hf] + push_cast + exact eq_sub_iff_add_eq.mpr hs + +omit [Field F] [DecidableEq F] in +theorem principal_fourth_lower (w : F → ℝ) : + ((Fintype.card F:ℝ)-4)*(∑ b,w b)^4 ≤ ∑ a, ((∑ b,w b)-w a)^4 := by + let J := ∑ b,w b + have hp (a : F) : J^4-4*J^3*w a ≤ (J-w a)^4 := by + have h : 0≤(w a)^2*((w a-2*J)^2+2*J^2) := by positivity + nlinarith only [h] + have hs := Finset.sum_le_sum (s:=Finset.univ) (fun a _ => hp a) + simp only [Finset.sum_sub_distrib,Finset.sum_const,Finset.card_univ,nsmul_eq_mul, + ← Finset.mul_sum] at hs + change _ ≤ ∑ a,(J-w a)^4 + change (Fintype.card F:ℝ)*J^4-4*J^3*J ≤ _ at hs + nlinarith only [hs] + +theorem weightedCharacterSum_nonprincipal_fourth_bound (w : F → ℝ) + (hw : ∀ x,0≤w x) : + (∑ χ : MulChar F ℂ, if χ=1 then 0 else ∑ a : F, ‖weightedCharacterSum w χ a‖^4) ≤ + 2*(Fintype.card Fˣ:ℝ)*(Fintype.card F:ℝ)*(∑ x,w x^2)^2+3*(∑ x,w x)^4 := by + classical + have hall := weightedCharacterSum_fourth_bound w hw + have hp := principal_fourth_lower w + have hprincipal : (∑ a : F, ‖weightedCharacterSum w (1:MulChar F ℂ) a‖^4) = + ∑ a,((∑ b,w b)-w a)^4 := by + simp only [weightedCharacterSum_principal,Complex.norm_real,Real.norm_eq_abs, + show ∀ x : ℝ, |x|^4=x^4 from fun x => by rw [show 4=2*2 from rfl,pow_mul,sq_abs,pow_mul]] + have hsplit : + (∑ χ : MulChar F ℂ, if χ=1 then 0 else ∑ a : F, ‖weightedCharacterSum w χ a‖^4) + + (∑ a : F, ‖weightedCharacterSum w (1:MulChar F ℂ) a‖^4) = + ∑ χ : MulChar F ℂ, ∑ a : F, ‖weightedCharacterSum w χ a‖^4 := by + have he : (∑ χ : MulChar F ℂ, if χ=1 then ∑ a : F, ‖weightedCharacterSum w χ a‖^4 else 0) = + ∑ a : F, ‖weightedCharacterSum w (1:MulChar F ℂ) a‖^4 := by simp + rw [← he, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro χ _ + split_ifs <;> simp_all + have hcard : (Fintype.card Fˣ:ℝ)=(Fintype.card F:ℝ)-1 := by + rw [Fintype.card_units,Nat.cast_sub (Nat.succ_le_of_lt Fintype.card_pos),Nat.cast_one] + rw [hprincipal] at hsplit + rw [hcard] at hall ⊢ + nlinarith only [hall,hp,hsplit] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ComponentFactorial.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ComponentFactorial.lean new file mode 100644 index 0000000000000000000000000000000000000000..6404191372ad44ce93c267c306f15fdd88e31b7d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ComponentFactorial.lean @@ -0,0 +1,91 @@ +import Mathlib.Data.Nat.Choose.Multinomial +import Mathlib.Analysis.SpecialFunctions.Log.Basic +import Mathlib.Tactic.Linarith + +namespace OAI + +/-! # Factorial costs of components in the arrangement graph -/ + +namespace Ostmann + +open scoped BigOperators + +/-- Assigning a*m labeled positions to a blocks gives the factorial +inequality used in the count of bad arrangements. -/ +theorem component_factorial_le (a m : ℕ) : + (a * m).factorial ≤ m.factorial ^ a * a ^ (a * m) := by + classical + let s : Finset (Fin a) := Finset.univ + let f : Fin a → ℕ := fun _ => m + have hmem : f ∈ Finset.piAntidiag s (a * m) := by + simp [Finset.mem_piAntidiag, s, f] + have hsum : a ^ (a * m) = + ∑ k ∈ s.piAntidiag (a * m), Nat.multinomial s k := by + simpa [s] using + (Finset.sum_pow_eq_sum_piAntidiag (R := ℕ) s (fun _ => (1 : ℕ)) (a * m)) + have hb := Finset.single_le_sum (fun k (_ : k ∈ Finset.piAntidiag s (a * m)) => + Nat.zero_le (Nat.multinomial s k)) hmem + rw [← hsum] at hb + have hs := Nat.multinomial_spec s f + simp only [s, f, Finset.prod_const, Finset.card_univ, Fintype.card_fin, + Finset.sum_const, smul_eq_mul] at hs + rw [← hs] + exact Nat.mul_le_mul_left _ hb + +theorem component_log_cost (a r : ℝ) (ha : 1 ≤ a) (har : a ≤ r) : + a * Real.log a ≤ (a - 1) * (Real.log r + 1) := by + have ha0 : 0 < a := by linarith + have hlog : Real.log a ≤ Real.log r := Real.log_le_log ha0 har + have hlog' : Real.log a ≤ a - 1 := Real.log_le_sub_one_of_pos ha0 + have hm := mul_le_mul_of_nonneg_left hlog (sub_nonneg.mpr ha) + nlinarith + +/-- The sum of a-1 is exactly the number of leaves minus the number +of components, so the entropy cost is controlled by this deficit. -/ +theorem component_entropy_bound {I : Type*} [Fintype I] + (a : I → ℕ) (r : ℕ) (ha : ∀ i, 1 ≤ a i) (hsum : ∑ i, a i = r) : + (∑ i, (a i : ℝ) * Real.log (a i)) ≤ + ((r : ℝ) - Fintype.card I) * (Real.log r + 1) := by + have hle (i : I) : a i ≤ r := by + rw [← hsum] + exact Finset.single_le_sum (fun _ _ => Nat.zero_le _) (Finset.mem_univ i) + have hcost (i : I) := component_log_cost (a i) r + (by exact_mod_cast ha i) (by exact_mod_cast hle i) + calc + _ ≤ ∑ i, ((a i : ℝ) - 1) * (Real.log r + 1) := Finset.sum_le_sum fun i _ => hcost i + _ = ((∑ i, (a i : ℝ)) - Fintype.card I) * (Real.log r + 1) := by + rw [← Finset.sum_mul, Finset.sum_sub_distrib] + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one] + _ = _ := by rw [← Nat.cast_sum, hsum] + +/-- Product of the component assignment counts, with the cost expressed +through the deficit in the number of components. -/ +theorem component_factorial_product_bound {I : Type*} [Fintype I] + (a : I → ℕ) (r m : ℕ) (ha : ∀ i, 1 ≤ a i) (hsum : ∑ i, a i = r) : + (∏ i, ((a i * m).factorial : ℝ)) ≤ + (m.factorial : ℝ) ^ r * + Real.exp ((m : ℝ) * ((r : ℝ) - Fintype.card I) * (Real.log r + 1)) := by + classical + have hp (i : I) : (a i : ℝ) ^ (a i * m) = + Real.exp ((m : ℝ) * ((a i : ℝ) * Real.log (a i))) := by + have hi : 0 < (a i : ℝ) := by exact_mod_cast lt_of_lt_of_le Nat.zero_lt_one (ha i) + rw [show (m : ℝ) * ((a i : ℝ) * Real.log (a i)) = + ((a i * m : ℕ) : ℝ) * Real.log (a i) by push_cast; ring, + Real.exp_nat_mul, Real.exp_log hi] + calc + _ ≤ ∏ i, (m.factorial : ℝ) ^ a i * (a i : ℝ) ^ (a i * m) := by + exact_mod_cast (Finset.prod_le_prod (fun i (_ : i ∈ (Finset.univ : Finset I)) => + component_factorial_le (a i) m)) + _ = (m.factorial : ℝ) ^ r * Real.exp ((m : ℝ) * ∑ i, (a i : ℝ) * Real.log (a i)) := by + simp_rw [hp] + rw [Finset.prod_mul_distrib, Finset.prod_pow_eq_pow_sum, hsum, + ← Real.exp_sum, ← Finset.mul_sum] + _ ≤ _ := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Real.exp_le_exp.mpr + simpa only [mul_assoc] using mul_le_mul_of_nonneg_left + (component_entropy_bound a r ha hsum) (show 0 ≤ (m : ℝ) by positivity) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ComponentFibers.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ComponentFibers.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a182dee272daf4b13b860f05c14c40c28c4e052 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ComponentFibers.lean @@ -0,0 +1,78 @@ +import Mathlib.Data.Fintype.Pi +import OAI.NumberTheory.Ostmann.Tree.ProductFibers + +namespace OAI + +/-! +# Uniform product fibers for a nonempty component + +Fixing one distinguished leaf identifies every component-product fiber +with independent values on the remaining leaves. The fiber cardinality +therefore does not depend on its total. +-/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable def completeComponentProduct {I G : Type*} [Fintype I] [DecidableEq I] + [CommGroup G] (i₀ : I) (P : G) (v : {i : I // i ≠ i₀} → G) (i : I) : G := + if h : i = i₀ then P / ∏ j, v j else v ⟨i, h⟩ + +theorem completeComponentProduct_pivot {I G : Type*} [Fintype I] [DecidableEq I] + [CommGroup G] (i₀ : I) (P : G) (v : {i : I // i ≠ i₀} → G) : + completeComponentProduct i₀ P v i₀ = P / ∏ j, v j := by + simp [completeComponentProduct] + +theorem completeComponentProduct_other {I G : Type*} [Fintype I] [DecidableEq I] + [CommGroup G] (i₀ : I) (P : G) (v : {i : I // i ≠ i₀} → G) + (j : {i : I // i ≠ i₀}) : completeComponentProduct i₀ P v j = v j := by + simp [completeComponentProduct, j.property] + +theorem completeComponentProduct_total {I G : Type*} [Fintype I] [DecidableEq I] + [CommGroup G] (i₀ : I) (P : G) (v : {i : I // i ≠ i₀} → G) : + (∏ i : I, completeComponentProduct i₀ P v i) = P := by + rw [Fintype.prod_eq_mul_prod_subtype_ne _ i₀] + simp only [completeComponentProduct_pivot, completeComponentProduct_other, div_mul_cancel] + +/-- All but one coordinate can be chosen freely in a fixed product fiber. -/ +noncomputable def componentProductEquiv {I G : Type*} [Fintype I] [DecidableEq I] + [CommGroup G] (i₀ : I) (P : G) : + {m : I → G // ∏ i, m i = P} ≃ ({i : I // i ≠ i₀} → G) where + toFun m j := m.1 j + invFun v := ⟨completeComponentProduct i₀ P v, completeComponentProduct_total i₀ P v⟩ + left_inv m := by + apply Subtype.ext + funext i + change completeComponentProduct i₀ P (fun j => m.1 j) i = m.1 i + by_cases hi : i = i₀ + · subst i + rw [completeComponentProduct_pivot] + have h := m.property + rw [Fintype.prod_eq_mul_prod_subtype_ne _ i₀] at h + calc + _ = (m.1 i₀ * ∏ j : {i : I // i ≠ i₀}, m.1 j) / + (∏ j : {i : I // i ≠ i₀}, m.1 j) := + congrArg (fun x => x / (∏ j : {i : I // i ≠ i₀}, m.1 j)) h.symm + _ = _ := by simp + · exact completeComponentProduct_other i₀ P (fun j => m.1 j) ⟨i, hi⟩ + right_inv v := by + funext j + exact completeComponentProduct_other i₀ P v j + +theorem card_componentProduct {I G : Type*} [Fintype I] [DecidableEq I] + [CommGroup G] [Fintype G] [DecidableEq G] (i₀ : I) (P : G) : + Fintype.card {m : I → G // ∏ i, m i = P} = + (Fintype.card G) ^ Fintype.card {i : I // i ≠ i₀} := by + rw [Fintype.card_congr (componentProductEquiv i₀ P), Fintype.card_fun] + +theorem sum_componentProduct {I G R : Type*} [Fintype I] [DecidableEq I] + [CommGroup G] [Fintype G] [DecidableEq G] [AddCommMonoid R] + (i₀ : I) (P : G) (f : (I → G) → R) : + (∑ m : {m : I → G // ∏ i, m i = P}, f m.1) = + ∑ v : {i : I // i ≠ i₀} → G, f (completeComponentProduct i₀ P v) := by + exact ((componentProductEquiv i₀ P).symm.bijective.sum_comp (fun m => f m.1)).symm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ConstrainedCharacterSum.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ConstrainedCharacterSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..08ac14fccd0291c331b538cc8ef0e51c490cf398 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ConstrainedCharacterSum.lean @@ -0,0 +1,62 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +variable {I C : Type*} [Fintype I] [DecidableEq I] [CommGroup C] [Fintype C] [DecidableEq C] + +theorem product_split_coordinate {M : Type*} [CommMonoid M] (j : I) (f : I → M) : + (∏ i,f i)=f j*∏ i : {i : I // i≠j},f i := by + have he : (∏ i : {i : I // i≠j},f i)=∏ i ∈ Finset.univ.erase j,f i := by + exact (Finset.prod_subtype (Finset.univ.erase j) (fun i => by simp) f).symm + rw [he] + exact (Finset.mul_prod_erase Finset.univ f (Finset.mem_univ j)).symm + +theorem constrained_character_sum_bound (j : I) (e : I → C ≃ C) + (w : I → C → ℝ) (hw : ∀ i χ,0≤w i χ) (δ : ℝ) (hδ : ∀ χ,w j χ≤δ) : + (∑ ρ : I → C, if (∏ i,e i (ρ i))=1 then ∏ i,w i (ρ i) else 0) ≤ + δ*∏ i : {i : I // i≠j},∑ χ : C,w i χ := by + classical + let E := Equiv.funSplitAt j C + let rest (t : ({i : I // i≠j} → C)) : C := ∏ i : {i : I // i≠j},e i (t i) + let sol (t : ({i : I // i≠j} → C)) : C := (e j).symm ((rest t)⁻¹) + let W (t : ({i : I // i≠j} → C)) : ℝ := ∏ i : {i : I // i≠j},w i (t i) + have hE0 (z : C) (t : ({i : I // i≠j} → C)) : E.symm (z,t) j=z := by simp [E] + have hEi (z : C) (t : ({i : I // i≠j} → C)) (i : {i : I // i≠j}) : E.symm (z,t) i=t i := by simp [E,i.property] + have hp (z : C) (t : ({i : I // i≠j} → C)) : + (∏ i,e i (E.symm (z,t) i))=(e j z)*rest t := by + rw [product_split_coordinate j] + simp only [hE0,hEi,rest] + have hwprod (z : C) (t : ({i : I // i≠j} → C)) : + (∏ i,w i (E.symm (z,t) i))=w j z*W t := by + rw [product_split_coordinate j] + simp only [hE0,hEi,W] + have hconstraint (z : C) (t : ({i : I // i≠j} → C)) : (e j z)*rest t=1 ↔ z=sol t := by + rw [mul_eq_one_iff_eq_inv] + exact (e j).eq_symm_apply.symm + have hs : + (∑ ρ : I → C, if (∏ i,e i (ρ i))=1 then ∏ i,w i (ρ i) else 0) = + ∑ t : ({i : I // i≠j} → C),w j (sol t)*W t := by + rw [← E.symm.sum_comp (fun ρ : I → C => if (∏ i,e i (ρ i))=1 then ∏ i,w i (ρ i) else 0),Fintype.sum_prod_type] + simp_rw [hp,hwprod] + have hh (z : C) (t : ({i : I // i≠j} → C)) : + (if (e j z)*rest t=1 then w j z*W t else 0)= + if z=sol t then w j z*W t else 0 := by simp only [hconstraint] + simp_rw [hh] + rw [Finset.sum_comm] + simp + rw [hs] + calc + _ ≤ ∑ t : ({i : I // i≠j} → C),δ*W t := by + apply Finset.sum_le_sum + intro t _ + exact mul_le_mul_of_nonneg_right (hδ _) (Finset.prod_nonneg (fun i _ => hw i (t i))) + _ = δ*(∑ t : ({i : I // i≠j} → C),∏ i : {i : I // i≠j},w i (t i)) := by rw [Finset.mul_sum] + _ = _ := by rw [← Fintype.prod_sum] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CoordinateAverages.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CoordinateAverages.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b92e7cc3deaf8f15d0bcc72548b6c31ee848fd1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CoordinateAverages.lean @@ -0,0 +1,159 @@ +import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction +import Mathlib.MeasureTheory.Integral.Prod + +namespace OAI + +/-! # Successive averages in the real bulk coordinates + +Finite measures act on bounded continuous functions by replacing one +coordinate and integrating it. The operators commute at distinct coordinates, +so a uniform one-coordinate error may be used before or after other replacements. +-/ + +namespace Ostmann +open MeasureTheory +open scoped Classical BoundedContinuousFunction + +noncomputable def coordinateSlice {σ : Type*} [Fintype σ] (f : (σ → ℝ) →ᵇ ℂ) + (i : σ) (x : σ → ℝ) : ℝ →ᵇ ℂ := + f.compContinuous ⟨fun t => Function.update x i t, + continuous_const.update i continuous_id⟩ + +noncomputable def coordinateAverage {σ : Type*} [Fintype σ] (μ : Measure ℝ) [IsFiniteMeasure μ] + (i : σ) (f : (σ → ℝ) →ᵇ ℂ) : (σ → ℝ) →ᵇ ℂ := + BoundedContinuousFunction.ofNormedAddCommGroup + (fun x => ∫ t, f (Function.update x i t) ∂μ) + (continuous_of_dominated + (fun x => (coordinateSlice f i x).continuous.aestronglyMeasurable) + (fun _x => Filter.Eventually.of_forall fun _t => f.norm_coe_le_norm _) + (integrable_const ‖f‖) + (Filter.Eventually.of_forall fun _t => + f.continuous.comp (continuous_id.update i continuous_const))) + (μ.real Set.univ * ‖f‖) + (fun x => (coordinateSlice f i x).norm_integral_le_mul_norm μ |>.trans + (mul_le_mul_of_nonneg_left + (BoundedContinuousFunction.norm_compContinuous_le _ _) (measureReal_nonneg))) + +@[simp] theorem coordinateAverage_apply {σ : Type*} [Fintype σ] (μ : Measure ℝ) [IsFiniteMeasure μ] + (i : σ) (f : (σ → ℝ) →ᵇ ℂ) (x : σ → ℝ) : + coordinateAverage μ i f x = ∫ t, f (Function.update x i t) ∂μ := rfl + +theorem coordinateAverage_norm {σ : Type*} [Fintype σ] (μ : Measure ℝ) [IsFiniteMeasure μ] + (i : σ) (f : (σ → ℝ) →ᵇ ℂ) : + ‖coordinateAverage μ i f‖ ≤ μ.real Set.univ * ‖f‖ := + BoundedContinuousFunction.norm_ofNormedAddCommGroup_le _ + (mul_nonneg measureReal_nonneg (norm_nonneg _)) _ + +theorem coordinateAverage_sub {σ : Type*} [Fintype σ] (μ : Measure ℝ) [IsFiniteMeasure μ] + (i : σ) (f g : (σ → ℝ) →ᵇ ℂ) : + coordinateAverage μ i (f - g) = coordinateAverage μ i f - coordinateAverage μ i g := by + ext x + exact integral_sub ((coordinateSlice f i x).integrable μ) + ((coordinateSlice g i x).integrable μ) + +theorem coordinateAverage_commute {σ : Type*} [Fintype σ] (μ ν : Measure ℝ) + [IsFiniteMeasure μ] [IsFiniteMeasure ν] (i j : σ) (hij : i ≠ j) + (f : (σ → ℝ) →ᵇ ℂ) : + coordinateAverage μ i (coordinateAverage ν j f) = + coordinateAverage ν j (coordinateAverage μ i f) := by + ext x + simp only [coordinateAverage_apply] + let g : (ℝ × ℝ) →ᵇ ℂ := f.compContinuous + ⟨fun z => Function.update (Function.update x i z.1) j z.2, + ((show Continuous (fun _ : ℝ × ℝ => x) from continuous_const).update i continuous_fst).update j continuous_snd⟩ + have h := integral_integral_swap (μ := μ) (ν := ν) + (f := fun t s => f (Function.update (Function.update x i t) j s)) (g.integrable (μ.prod ν)) + change (∫ t, ∫ s, f (Function.update (Function.update x i t) j s) ∂ν ∂μ) = _ at h + rw [h] + apply integral_congr_ae + exact Filter.Eventually.of_forall fun s => integral_congr_ae + (Filter.Eventually.of_forall fun t => by dsimp only; rw [Function.update_comm hij]) + +noncomputable def coordinateAverages {σ : Type*} [Fintype σ] (μ : σ → Measure ℝ) + [∀ i, IsFiniteMeasure (μ i)] : List σ → ((σ → ℝ) →ᵇ ℂ) → ((σ → ℝ) →ᵇ ℂ) + | [], f => f + | i :: l, f => coordinateAverage (μ i) i (coordinateAverages μ l f) + +theorem coordinateAverages_sub {σ : Type*} [Fintype σ] (μ : σ → Measure ℝ) + [∀ i, IsFiniteMeasure (μ i)] (l : List σ) (f g : (σ → ℝ) →ᵇ ℂ) : + coordinateAverages μ l (f - g) = coordinateAverages μ l f - coordinateAverages μ l g := by + induction l with + | nil => rfl + | cons i l ih => simp only [coordinateAverages, ih, coordinateAverage_sub] + +theorem coordinateAverages_norm {σ : Type*} [Fintype σ] (μ : σ → Measure ℝ) + [∀ i, IsFiniteMeasure (μ i)] (l : List σ) + (hμ : ∀ i ∈ l, (μ i).real Set.univ ≤ 2) (f : (σ → ℝ) →ᵇ ℂ) : + ‖coordinateAverages μ l f‖ ≤ 2 ^ l.length * ‖f‖ := by + induction l with + | nil => simp [coordinateAverages] + | cons i l ih => + calc + _ ≤ (μ i).real Set.univ * ‖coordinateAverages μ l f‖ := coordinateAverage_norm _ _ _ + _ ≤ 2 * (2 ^ l.length * ‖f‖) := mul_le_mul (hμ i (by simp)) + (ih (fun j hj => hμ j (by simp [hj]))) (norm_nonneg _) (by norm_num) + _ = _ := by simp only [List.length_cons, pow_succ]; ring + +theorem coordinateAverages_commute {σ : Type*} [Fintype σ] (μ : σ → Measure ℝ) + [∀ i, IsFiniteMeasure (μ i)] (ν : Measure ℝ) [IsFiniteMeasure ν] + (l : List σ) (i : σ) (hi : i ∉ l) (f : (σ → ℝ) →ᵇ ℂ) : + coordinateAverage ν i (coordinateAverages μ l f) = + coordinateAverages μ l (coordinateAverage ν i f) := by + induction l with + | nil => rfl + | cons j l ih => + have hij : i ≠ j := fun h => hi (by simp [h]) + have hil : i ∉ l := fun h => hi (by simp [h]) + simp only [coordinateAverages, coordinateAverage_commute ν (μ j) i j hij, ih hil] + +/-- A uniform slice comparison accumulates only the masses of the other +coordinates. It is applied to the original function, not assumed for functions +which have already been averaged. -/ +theorem coordinateAverages_comparison {σ : Type*} [Fintype σ] (μ ν : σ → Measure ℝ) + [∀ i, IsFiniteMeasure (μ i)] [∀ i, IsFiniteMeasure (ν i)] + (l : List σ) (hl : l.Nodup) + (hμ : ∀ i ∈ l, (μ i).real Set.univ ≤ 2) + (hν : ∀ i ∈ l, (ν i).real Set.univ ≤ 2) + (f : (σ → ℝ) →ᵇ ℂ) (ε : σ → ℝ) (hε : ∀ i ∈ l, 0 ≤ ε i) + (herr : ∀ i ∈ l, ‖coordinateAverage (μ i) i f - coordinateAverage (ν i) i f‖ ≤ ε i) : + ‖coordinateAverages μ l f - coordinateAverages ν l f‖ ≤ + 2 ^ l.length * (l.map ε).sum := by + induction l with + | nil => simp [coordinateAverages] + | cons i l ih => + obtain ⟨hi, hl⟩ := List.nodup_cons.mp hl + have hμl : ∀ j ∈ l, (μ j).real Set.univ ≤ 2 := fun j hj => hμ j (by simp [hj]) + have hνl : ∀ j ∈ l, (ν j).real Set.univ ≤ 2 := fun j hj => hν j (by simp [hj]) + have he0 := hε i (by simp) + have heSum : 0 ≤ (l.map ε).sum := List.sum_nonneg (by + intro a ha + obtain ⟨j, hj, rfl⟩ := List.mem_map.mp ha + exact hε j (by simp [hj])) + have htail := ih hl hμl hνl (fun j hj => hε j (by simp [hj])) + (fun j hj => herr j (by simp [hj])) + have hfirst : + ‖coordinateAverage (μ i) i (coordinateAverages ν l f) - + coordinateAverage (ν i) i (coordinateAverages ν l f)‖ ≤ 2 ^ l.length * ε i := by + rw [coordinateAverages_commute ν (μ i) l i hi, + coordinateAverages_commute ν (ν i) l i hi, ← coordinateAverages_sub] + exact (coordinateAverages_norm ν l hνl _).trans + (mul_le_mul_of_nonneg_left (herr i (by simp)) (by positivity)) + change ‖coordinateAverage (μ i) i (coordinateAverages μ l f) - + coordinateAverage (ν i) i (coordinateAverages ν l f)‖ ≤ _ + calc + _ ≤ ‖coordinateAverage (μ i) i (coordinateAverages μ l f) - + coordinateAverage (μ i) i (coordinateAverages ν l f)‖ + + ‖coordinateAverage (μ i) i (coordinateAverages ν l f) - + coordinateAverage (ν i) i (coordinateAverages ν l f)‖ := norm_sub_le_norm_sub_add_norm_sub _ _ _ + _ ≤ 2 * (2 ^ l.length * (l.map ε).sum) + 2 ^ l.length * ε i := by + apply add_le_add _ hfirst + rw [← coordinateAverage_sub] + exact (coordinateAverage_norm _ _ _).trans + (mul_le_mul (hμ i (by simp)) htail (norm_nonneg _) (by norm_num)) + _ ≤ 2 ^ (i :: l).length * ((i :: l).map ε).sum := by + simp only [List.length_cons, List.map_cons, List.sum_cons, pow_succ] + nlinarith [pow_nonneg (by norm_num : (0 : ℝ) ≤ 2) l.length] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CorrelationSymmetry.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CorrelationSymmetry.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad8ea95b9f16cb4d91b899cd58ef16fb0f70f1de --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CorrelationSymmetry.lean @@ -0,0 +1,66 @@ +import OAI.NumberTheory.Ostmann.Tree.TwistedPairSpectrum + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem mixedCorrelation_conj (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (a : ZMod p) : + mixedCorrelation (fun x => conj (g x)) χ a= + conj (mixedCorrelation g (star χ) (-a)) := by + unfold mixedCorrelation + rw [← mean_conj] + congr 1 + funext x + simp only [map_mul,MulChar.star_apply,RCLike.star_def,Supply.conj_stdAddChar, + neg_mul,neg_neg] + simp + +theorem correlationBound_conj_le (g : ZMod p → ℂ) : + correlationBound (fun x => conj (g x))≤correlationBound g := by + unfold correlationBound + apply Finset.sup_le + intro z _ + have h := norm_mixedCorrelation_le g (star z.1) (-z.2) + rw [mixedCorrelation_conj] + have hh : ‖conj (mixedCorrelation g (star z.1) (-z.2))‖≤(correlationBound g:ℝ) := by + simpa only [Complex.norm_conj] using h + exact_mod_cast hh + +theorem correlationBound_conj (g : ZMod p → ℂ) : + correlationBound (fun x => conj (g x))=correlationBound g := by + apply le_antisymm (correlationBound_conj_le g) + simpa only [starRingEnd_apply,star_star] using correlationBound_conj_le (fun x => conj (g x)) + +theorem norm_mixedCorrelation_le_one (g : ZMod p → ℂ) (hg : l2Sq g≤1) + (χ : MulChar (ZMod p) ℂ) (a : ZMod p) : ‖mixedCorrelation g χ a‖≤1 := by + let H : ZMod p → ℂ := fun x => g x*χ x*ZMod.stdAddChar (a*x) + have hnorm (x : ZMod p) : ‖H x‖≤‖g x‖ := by + simp only [H,norm_mul,(ZMod.stdAddChar : AddChar (ZMod p) ℂ).norm_apply,mul_one] + exact (mul_le_mul_of_nonneg_left (mulChar_norm_le_one χ x) (norm_nonneg _)).trans_eq (mul_one _) + have hH : l2Sq H≤l2Sq g := by + unfold l2Sq + apply mul_le_mul_of_nonneg_left _ (by positivity) + exact Finset.sum_le_sum (fun x _ => pow_le_pow_left₀ (norm_nonneg _) (hnorm x) 2) + have hc := meanInner_norm_sq_le (fun _ => (1:ℂ)) H + have he : meanInner (fun _ => (1:ℂ)) H=mixedCorrelation g χ a := by simp [meanInner,mixedCorrelation,H] + rw [he,l2Sq_const] at hc + norm_num at hc + have h := hc.trans (hH.trans hg) + nlinarith only [h,norm_nonneg (mixedCorrelation g χ a)] + +theorem correlationBound_le_one (g : ZMod p → ℂ) (hg : l2Sq g≤1) : + (correlationBound g:ℝ)≤1 := by + have h : correlationBound g≤1 := by + unfold correlationBound + apply Finset.sup_le + intro z _ + exact_mod_cast norm_mixedCorrelation_le_one g hg z.1 z.2 + exact_mod_cast h + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CoupledDiagramCorrelation.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CoupledDiagramCorrelation.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e4a7b122dbdbc61e1080c34c73f568c12b2d469 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CoupledDiagramCorrelation.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleProjection +import OAI.NumberTheory.Ostmann.Tree.CycleQuartets + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators ComplexConjugate +open Ostmann.FiniteField Ostmann.Arithmetic.ResidueHaar +variable {p : ℕ} [Fact p.Prime] + +abbrev CoupledLeaves {d b : ℕ} (P Q : LeafPartition d b) := + {x : (Leaves d → (ZMod p)ˣ) × (Leaves d → (ZMod p)ˣ) // P.coupled Q x} + +instance coupledLeavesFintype {d b : ℕ} (P Q : LeafPartition d b) : + Fintype (CoupledLeaves (p:=p) P Q) := Fintype.ofFinite _ + +def diagramCorrelation {d b : ℕ} (P Q : LeafPartition d b) + (T1 T2 : Diagram (ZMod p) d) (g : ZMod p → ℂ) : ℂ := + average (fun x : CoupledLeaves (p:=p) P Q => T1.value g x.val.1*conj (T2.value g x.val.2)) + +def coupledLeavesEquiv {d b : ℕ} (P Q : LeafPartition d b) : + coupledGroup (labelProducts (U:=(ZMod p)ˣ) P.label) (labelProducts Q.label) ≃ + CoupledLeaves (p:=p) P Q where + toFun x := ⟨x.val,fun i => congrFun x.property i⟩ + invFun x := ⟨x.val,funext x.property⟩ + left_inv _ := rfl + right_inv _ := rfl + +theorem diagramCorrelation_projection_sq {k b : ℕ} (P Q : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + (T1 T2 : Diagram (ZMod p) (k+2)) (g : ZMod p → ℂ) : + ‖diagramCorrelation P Q T1 T2 g‖^2≤ + Density.average (fun M => ‖c.projection (T1.value g) M‖^2)* + Density.average (fun M => ‖T2.value g M‖^2) := by + classical + have hc := cycle_projection_reduction Q.label P.onto Q.onto c (T1.value g) (T2.value g) + have he := average_equiv (coupledLeavesEquiv (p:=p) P Q) + (fun x : CoupledLeaves (p:=p) P Q => T1.value g x.val.1*conj (T2.value g x.val.2)) + change average (fun x : coupledGroup (labelProducts P.label) (labelProducts Q.label) => + T1.value g x.val.1*conj (T2.value g x.val.2))=diagramCorrelation P Q T1 T2 g at he + rw [he] at hc + simp only [real_average_fintype_congr _ + (inferInstance : Fintype (Leaves (k+2) → (ZMod p)ˣ))] at hc + exact hc + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CoupledHaar.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CoupledHaar.lean new file mode 100644 index 0000000000000000000000000000000000000000..e0d619207d4a917e7b3ffaf7b13dbbfe4494a2cf --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CoupledHaar.lean @@ -0,0 +1,102 @@ +import OAI.NumberTheory.Ostmann.Tree.DensityHorizontal + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators ComplexConjugate +open Ostmann.Arithmetic.ResidueHaar + +def coupledGroup {A B C : Type*} [CommGroup A] [CommGroup B] [CommGroup C] + (f : A →* C) (g : B →* C) : Subgroup (A × B) where + carrier := {x | f x.1=g x.2} + one_mem' := by simp + mul_mem' := by + intro x y hx hy + change f x.1=g x.2 at hx + change f y.1=g y.2 at hy + change f (x.1*y.1)=g (x.2*y.2) + rw [map_mul,map_mul,hx,hy] + inv_mem' := by + intro x hx + change f x.1=g x.2 at hx + change f x.1⁻¹=g x.2⁻¹ + rw [map_inv,map_inv,hx] + +namespace coupledGroup +variable {A B C : Type*} [CommGroup A] [CommGroup B] [CommGroup C] + (f : A →* C) (g : B →* C) + +instance coupledFintype [Fintype A] [Fintype B] : Fintype (coupledGroup f g) := Fintype.ofFinite _ + +def fstHom : coupledGroup f g →* A := (MonoidHom.fst A B).comp (coupledGroup f g).subtype +def sndHom : coupledGroup f g →* B := (MonoidHom.snd A B).comp (coupledGroup f g).subtype + +theorem fst_surjective (hg : Function.Surjective g) : Function.Surjective (fstHom f g) := by + intro a + obtain ⟨b,hb⟩ := hg (f a) + exact ⟨⟨(a,b),hb.symm⟩,rfl⟩ +theorem snd_surjective (hf : Function.Surjective f) : Function.Surjective (sndHom f g) := by + intro b + obtain ⟨a,ha⟩ := hf (g b) + exact ⟨⟨(a,b),ha⟩,rfl⟩ + +def liftEquiv (e : A ≃ A) (he : ∀a,f (e a)=f a) : coupledGroup f g ≃ coupledGroup f g where + toFun x := ⟨(e x.val.1,x.val.2),(he _).trans x.property⟩ + invFun x := ⟨(e.symm x.val.1,x.val.2),by + have h := he (e.symm x.val.1) + rw [e.apply_symm_apply] at h + exact h.symm.trans x.property⟩ + left_inv x := by apply Subtype.ext; simp + right_inv x := by apply Subtype.ext; simp + +theorem average_change_first [Fintype A] [Fintype B] + (e : A ≃ A) (he : ∀a,f (e a)=f a) (F : A → ℂ) (G : B → ℂ) : + average (fun x : coupledGroup f g => F (e x.val.1)*conj (G x.val.2)) = + average (fun x : coupledGroup f g => F x.val.1*conj (G x.val.2)) := + average_equiv (liftEquiv f g e he) (fun x => F x.val.1*conj (G x.val.2)) + +end coupledGroup + +theorem average_cauchy_sq {I : Type*} [Fintype I] (f g : I → ℂ) : + ‖average (fun i => f i*conj (g i))‖^2 ≤ + Density.average (fun i => ‖f i‖^2)*Density.average (fun i => ‖g i‖^2) := by + classical + let c : ℝ := (Fintype.card I:ℝ)⁻¹ + have hc : 0 ≤ c := by dsimp [c]; positivity + have hn : ‖average (fun i => f i*conj (g i))‖ ≤ c*∑ i,‖f i‖*‖g i‖ := by + unfold average + rw [norm_mul] + simp only [norm_inv,Complex.norm_natCast] + apply mul_le_mul_of_nonneg_left _ hc + simpa only [norm_mul,Complex.norm_conj] using + norm_sum_le (Finset.univ) (fun i => f i*conj (g i)) + calc + _ ≤ (c*∑ i,‖f i‖*‖g i‖)^2 := pow_le_pow_left₀ (norm_nonneg _) hn 2 + _ = c^2*(∑ i,‖f i‖*‖g i‖)^2 := mul_pow _ _ _ + _ ≤ c^2*((∑ i,‖f i‖^2)*(∑ i,‖g i‖^2)) := + mul_le_mul_of_nonneg_left (Finset.sum_mul_sq_le_sq_mul_sq Finset.univ + (fun i => ‖f i‖) (fun i => ‖g i‖)) (sq_nonneg c) + _ = _ := by simp only [Density.average]; dsimp [c]; ring + +theorem coupled_cauchy_sq {A B C : Type*} [CommGroup A] [CommGroup B] [CommGroup C] + [Fintype A] [Fintype B] (f : A →* C) (g : B →* C) + (hf : Function.Surjective f) (hg : Function.Surjective g) + (F : A → ℂ) (G : B → ℂ) : + ‖average (fun x : coupledGroup f g => F x.val.1*conj (G x.val.2))‖^2 ≤ + Density.average (fun a => ‖F a‖^2)*Density.average (fun b => ‖G b‖^2) := by + classical + have h := average_cauchy_sq (fun x : coupledGroup f g => F x.val.1) + (fun x : coupledGroup f g => G x.val.2) + have hfst := Density.average_surjective (coupledGroup.fstHom f g) + (coupledGroup.fst_surjective f g hg) (fun a => ‖F a‖^2) + have hsnd := Density.average_surjective (coupledGroup.sndHom f g) + (coupledGroup.snd_surjective f g hf) (fun b => ‖G b‖^2) + change Density.average (fun x : coupledGroup f g => ‖F x.val.1‖^2) = _ at hfst + change Density.average (fun x : coupledGroup f g => ‖G x.val.2‖^2) = _ at hsnd + rwa [hfst,hsnd] at h + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CrossMajorantBounds.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CrossMajorantBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..29ae7be1b1d06020a5c144b6e3848ac250b86ca5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CrossMajorantBounds.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.Ostmann.Tree.TwoPairModeBounds +import OAI.NumberTheory.Ostmann.Tree.TwoPairRatioEnergy + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def unitMean (f : ZMod p → ℝ) : ℝ := + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹*∑ y : (ZMod p)ˣ,f y + +theorem crossMajorant_mean_small (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (ν : MulChar (ZMod p) ℂ) + (hσ : (σ:ZMod p)^2=1) (hτ : (τ:ZMod p)^2=1) + (hg0 : g 0=0) (hg : l2Sq g≤1) (hh0 : h 0=0) (hh : l2Sq h≤1) : + unitMean (crossMajorant g h σ τ L R ν) ≤ + 100*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))* + ((correlationBound g:ℝ)^2+(correlationBound h:ℝ)^2+Real.sqrt (3/(p:ℝ))) := by + have hp : (p:ℝ)≠0 := by exact_mod_cast (Fact.out : p.Prime).ne_zero + have he : (Fintype.card (ZMod p)ˣ:ℝ)⁻¹*(∑ y : ZMod p,crossMajorant g h σ τ L R ν y)= + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))* + ((Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2* + ∑ lam : (ZMod p)ˣ,∑ mu : (ZMod p)ˣ,l2Sq (twoPairConvolution g h σ τ L R ν lam mu)) := by + simp only [crossMajorant,l2Sq,← Finset.mul_sum] + rw [← sum_three_rotate (fun lam mu y => ‖twoPairConvolution g h σ τ L R ν lam mu y‖^2)] + field_simp + have hb : ((Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2* + ∑ lam : (ZMod p)ˣ,∑ mu : (ZMod p)ˣ,l2Sq (twoPairConvolution g h σ τ L R ν lam mu)) ≤ + 100*((correlationBound g:ℝ)^2+(correlationBound h:ℝ)^2+Real.sqrt (3/(p:ℝ))) := by + rw [twoPairConvolution_energy g h σ τ L R ν hg0 hh0] + exact twoPair_mode_convolution_bound g h σ τ L R ν hσ hτ hg0 hg hh0 hh + unfold unitMean + calc + _ ≤ (Fintype.card (ZMod p)ˣ:ℝ)⁻¹*(∑ y : ZMod p,crossMajorant g h σ τ L R ν y) := + mul_le_mul_of_nonneg_left (sum_units_le _ (crossMajorant_nonneg g h σ τ L R ν)) (by positivity) + _ = _ := he + _ ≤ ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))* + (100*((correlationBound g:ℝ)^2+(correlationBound h:ℝ)^2+Real.sqrt (3/(p:ℝ)))) := + mul_le_mul_of_nonneg_left hb (by positivity) + _ = _ := by ring + +theorem sum_difference_products (A B : ZMod p → ℝ) : + (∑ y : ZMod p,∑ d : ZMod p,A d*B (d-y))=(∑ d,A d)*(∑ e,B e) := by + rw [Finset.sum_comm,Finset.sum_mul] + apply Finset.sum_congr rfl + intro d _ + rw [← Finset.mul_sum] + congr 1 + have hi : Function.Bijective (fun y : ZMod p => d-y) := by + constructor + · exact sub_right_injective + · intro e + exact ⟨d-e,by ring⟩ + exact hi.sum_comp B + +theorem crossMajorant_mean_total (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (hg0 : g 0=0) (hg : l2Sq g≤1) (hh0 : h 0=0) (hh : l2Sq h≤1) : + (∑ ν : MulChar (ZMod p) ℂ,unitMean (crossMajorant g h σ τ L R ν)) ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2 := by + have hp : (p:ℝ)≠0 := by exact_mod_cast (Fact.out : p.Prime).ne_zero + have hN : (Fintype.card (ZMod p)ˣ:ℝ)≠0 := by exact_mod_cast Fintype.card_ne_zero + let A := pairSecondMoment g σ + let B := pairSecondMoment h τ + have hA : ∀ d,0≤A d := pairSecondMoment_nonneg g σ + have hB : ∀ d,0≤B d := pairSecondMoment_nonneg h τ + have hconv (y : ZMod p) : 0≤∑ d : ZMod p,A d*B (d-y) := + Finset.sum_nonneg (fun d _ => mul_nonneg (hA d) (hB _)) + unfold unitMean + rw [← Finset.mul_sum,Finset.sum_comm] + simp_rw [crossMajorant_sum g h σ τ L R _ hg0 hh0] + rw [← Finset.mul_sum] + calc + _ = (p:ℝ)⁻¹^2*∑ y : (ZMod p)ˣ,∑ d : ZMod p,A d*B (d-y) := by dsimp [A,B]; field_simp + _ ≤ (p:ℝ)⁻¹^2*∑ y : ZMod p,∑ d : ZMod p,A d*B (d-y) := + mul_le_mul_of_nonneg_left (sum_units_le _ hconv) (sq_nonneg _) + _ = (p:ℝ)⁻¹^2*((∑ d,A d)*(∑ e,B e)) := by rw [sum_difference_products] + _ ≤ (p:ℝ)⁻¹^2*(((p:ℝ)^2/(Fintype.card (ZMod p)ˣ:ℝ))*((p:ℝ)^2/(Fintype.card (ZMod p)ˣ:ℝ))) := by + apply mul_le_mul_of_nonneg_left _ (sq_nonneg _) + exact mul_le_mul (pairSecondMoment_total g σ hg0 hg) (pairSecondMoment_total h τ hh0 hh) + (Finset.sum_nonneg (fun _ _ => hB _)) (by positivity) + _ = _ := by field_simp + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CrossPairHeldAverage.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CrossPairHeldAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c43f4593cc4c440bb035386f410f9a3ef951c7d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CrossPairHeldAverage.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.Ostmann.Characters.SquareRatioCoefficient + +namespace OAI + +/-! # Averaging the two held leaves in a cross-pair quartet -/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable local instance crossHeldFintype {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +theorem sum_square_coset_pair_le_four {p : ℕ} [Fact p.Prime] + (K L : (ZMod p)ˣ) (f : (ZMod p)ˣ → (ZMod p)ˣ → ℝ) + (hf : ∀ z t, 0 ≤ f z t) : + (∑ a : (ZMod p)ˣ, ∑ b : (ZMod p)ˣ, f (K * a ^ 2) (L * b ^ 2)) ≤ + 4 * ∑ z : (ZMod p)ˣ, ∑ t : (ZMod p)ˣ, f z t := by + calc + _ ≤ ∑ a : (ZMod p)ˣ, 2 * ∑ t : (ZMod p)ˣ, f (K * a ^ 2) t := + Finset.sum_le_sum fun a _ => sum_square_coset_le_twice L _ (hf _) + _ = 2 * ∑ a : (ZMod p)ˣ, ∑ t : (ZMod p)ˣ, f (K * a ^ 2) t := by + rw [Finset.mul_sum] + _ ≤ 2 * (2 * ∑ z : (ZMod p)ˣ, ∑ t : (ZMod p)ˣ, f z t) := + mul_le_mul_of_nonneg_left + (sum_square_coset_le_twice K _ (fun z => Finset.sum_nonneg fun t _ => hf z t)) + (by norm_num) + _ = _ := by ring + +theorem crossPairMajorant_parameter_average {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (left right : Bool) (y : ZMod p) (ρ : MulChar (ZMod p) ℂ) : + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * (∑ z : (ZMod p)ˣ, + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * ∑ t : (ZMod p)ˣ, + squareCharacterMass (fun ν => ‖quartetParameterValue g h left right ν y z t‖ ^ 2) ρ) = + crossPairMajorant g h left right ρ y := by + classical + unfold crossPairMajorant squareCharacterMass quartetParameterMoment + simp only [Finset.mul_sum] + simp_rw [Finset.sum_comm (s := (Finset.univ : Finset (ZMod p)ˣ)) + (t := Finset.univ.filter (fun ν : MulChar (ZMod p) ℂ => ν ^ 2 = ρ))] + +/-- Both held leaves may have any fixed square-coset multipliers. The moving +coordinate multiplier may depend on both held leaves. -/ +theorem crossPair_held_coefficient_le {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (left right : Bool) (y : (ZMod p)ˣ) + (K L : (ZMod p)ˣ) (M : (ZMod p)ˣ → (ZMod p)ˣ → (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) : + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * (∑ a : (ZMod p)ˣ, + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * ∑ b : (ZMod p)ˣ, + ‖mellinCoefficient (fun r => quartetRatioValue g h left right y + (K * a ^ 2) (L * b ^ 2) (M a b * r ^ 2)) ρ‖ ^ 2) ≤ + 8 * ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2 * + crossPairMajorant g h left right ρ⁻¹ y := by + let U : ℝ := Fintype.card (ZMod p)ˣ + let C : ℝ := 2 * ((p : ℝ) / U) ^ 2 + let f (z t : (ZMod p)ˣ) := + squareCharacterMass (fun ν => ‖quartetParameterValue g h left right ν y z t‖ ^ 2) ρ⁻¹ + have hC : 0 ≤ C := by positivity + have hU : 0 ≤ U⁻¹ := by positivity + have hf (z t : (ZMod p)ˣ) : 0 ≤ f z t := + squareCharacterMass_nonneg _ (fun ν => sq_nonneg _) _ + have hpoint (a b : (ZMod p)ˣ) : + ‖mellinCoefficient (fun r => quartetRatioValue g h left right y + (K * a ^ 2) (L * b ^ 2) (M a b * r ^ 2)) ρ‖ ^ 2 ≤ C * f (K * a ^ 2) (L * b ^ 2) := + quartetRatioValue_square_mellin_bound g h left right y _ _ _ ρ + calc + _ ≤ U⁻¹ * (∑ a : (ZMod p)ˣ, U⁻¹ * ∑ b : (ZMod p)ˣ, + C * f (K * a ^ 2) (L * b ^ 2)) := by + apply mul_le_mul_of_nonneg_left _ hU + apply Finset.sum_le_sum + intro a _ + exact mul_le_mul_of_nonneg_left (Finset.sum_le_sum fun b _ => hpoint a b) hU + _ = U⁻¹ * U⁻¹ * C * (∑ a : (ZMod p)ˣ, ∑ b : (ZMod p)ˣ, + f (K * a ^ 2) (L * b ^ 2)) := by + simp only [← Finset.mul_sum] + ring + _ ≤ U⁻¹ * U⁻¹ * C * (4 * ∑ z : (ZMod p)ˣ, ∑ t : (ZMod p)ˣ, f z t) := + mul_le_mul_of_nonneg_left (sum_square_coset_pair_le_four K L f hf) + (mul_nonneg (mul_nonneg hU hU) hC) + _ = 8 * ((p : ℝ) / U) ^ 2 * + (U⁻¹ * ∑ z : (ZMod p)ˣ, U⁻¹ * ∑ t : (ZMod p)ˣ, f z t) := by + simp only [← Finset.mul_sum, C] + ring + _ = _ := by rw [crossPairMajorant_parameter_average] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CrossPairMajorant.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CrossPairMajorant.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b055ced1de1820b7dfaf4f9301de33fcdbce4e2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CrossPairMajorant.lean @@ -0,0 +1,84 @@ +import OAI.NumberTheory.Ostmann.Characters.QuartetTotalMoment +import OAI.NumberTheory.Ostmann.Characters.QuartetSymmetry + +namespace OAI + +/-! # Square-pullback majorants for the two moving leaves in different pairs -/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable local instance crossPairFintype {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +theorem quartetParameterMoment_mean_le_fourier {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (left right : Bool) (ν : MulChar (ZMod p) ℂ) : + (∑ y : (ZMod p)ˣ, quartetParameterMoment g h left right ν y) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ + ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) * + quartetFourierEnergy (pairAutocorrelation g) (pairAutocorrelation h) left right ν := by + have hparse : (p : ℝ)⁻¹ * + (∑ y : ZMod p, quartetParameterMoment g h left right ν y) = + quartetFourierEnergy (pairAutocorrelation g) (pairAutocorrelation h) left right ν := + quartetParameterValue_parseval g h left right ν + have hsum : (∑ y : (ZMod p)ˣ, quartetParameterMoment g h left right ν y) ≤ + ∑ y : ZMod p, quartetParameterMoment g h left right ν y := by + apply Finset.sum_le_sum_of_injOn (fun y : (ZMod p)ˣ => (y : ZMod p)) + Units.val_injective.injOn (Finset.subset_univ _) + · intro _ _ + exact le_rfl + · intro y _ _ + exact quartetParameterMoment_nonneg g h left right ν y + apply (div_le_div_of_nonneg_right hsum (Nat.cast_nonneg _)).trans_eq + rw [← hparse] + have hp : (p : ℝ) ≠ 0 := by exact_mod_cast (Fact.out : p.Prime).ne_zero + field_simp + +noncomputable def crossPairMajorant {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (left right : Bool) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : ℝ := + squareCharacterMass (fun ν => quartetParameterMoment g h left right ν y) ρ + +theorem crossPairMajorant_nonneg {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (left right : Bool) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : + 0 ≤ crossPairMajorant g h left right ρ y := + squareCharacterMass_nonneg _ (fun ν => quartetParameterMoment_nonneg g h left right ν y) ρ + +theorem crossPairMajorant_mean_eq {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (left right : Bool) (ρ : MulChar (ZMod p) ℂ) : + (∑ y : (ZMod p)ˣ, crossPairMajorant g h left right ρ y) / + (Fintype.card (ZMod p)ˣ : ℝ) = + squareCharacterMass (fun ν => + (∑ y : (ZMod p)ˣ, quartetParameterMoment g h left right ν y) / + (Fintype.card (ZMod p)ˣ : ℝ)) ρ := by + unfold crossPairMajorant squareCharacterMass + rw [Finset.sum_comm, Finset.sum_div] + +theorem crossPairMajorant_mean_le {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (left right : Bool) (δ : ℝ) (hδ : 0 ≤ δ) + (hsmall : ∀ ν : MulChar (ZMod p) ℂ, + quartetFourierEnergy (pairAutocorrelation g) (pairAutocorrelation h) left right ν ≤ δ) + (ρ : MulChar (ZMod p) ℂ) : + (∑ y : (ZMod p)ˣ, crossPairMajorant g h left right ρ y) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ + 2 * (((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) * δ) := by + rw [crossPairMajorant_mean_eq] + apply squareCharacterMass_le_twice _ _ (by positivity) + intro ν + exact (quartetParameterMoment_mean_le_fourier g h left right ν).trans + (mul_le_mul_of_nonneg_left (hsmall ν) (by positivity)) + +theorem crossPairMajorant_total_mean_le {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (hg : g 0 = 0) (hh : h 0 = 0) + (heg : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) + (heh : (∑ x : ZMod p, ‖h x‖ ^ 2) ≤ (p : ℝ)) (left right : Bool) : + (∑ ρ : MulChar (ZMod p) ℂ, (∑ y : (ZMod p)ˣ, + crossPairMajorant g h left right ρ y) / (Fintype.card (ZMod p)ˣ : ℝ)) ≤ + ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2 := by + simp_rw [crossPairMajorant_mean_eq] + rw [sum_squareCharacterMass] + exact quartetParameterMoment_total_mean_le g h hg hh heg heh left right + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CrossQuartetFiber.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CrossQuartetFiber.lean new file mode 100644 index 0000000000000000000000000000000000000000..aad8cfab3ff990b4311f3f0d40320a4f580ac87e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CrossQuartetFiber.lean @@ -0,0 +1,102 @@ +import OAI.NumberTheory.Ostmann.Characters.QuartetCrossBound + +namespace OAI + +/-! # Exact product-fiber coordinates for the cross-pair coefficient bounds -/ + +namespace Ostmann + +open scoped BigOperators + +local instance zeroTupleCommGroup {U : Type*} [CommGroup U] : + CommGroup (TreeLeafTuple U 0) := inferInstanceAs (CommGroup U) + +def pairOrient {U : Type*} (friendly : Bool) (xy : U × U) : U × U := + if friendly then xy else (xy.2, xy.1) + +def quartetOrient {U : Type*} (left right : Bool) (m : (U × U) × (U × U)) : + (U × U) × (U × U) := (pairOrient left m.1, pairOrient right m.2) + +theorem pairOrient_product {U : Type*} [CommGroup U] (friendly : Bool) (xy : U × U) : + (pairOrient friendly xy).1 * (pairOrient friendly xy).2 = xy.1 * xy.2 := by + cases friendly <;> simp [pairOrient, mul_comm] + +def quartetOrientFiberEquiv {U : Type*} [CommGroup U] (left right : Bool) (P : U) : + TreeLeafFiber U 2 P ≃ TreeLeafFiber U 2 P where + toFun m := ⟨quartetOrient left right m.1, by + change (pairOrient left m.1.1).1 * (pairOrient left m.1.1).2 * + ((pairOrient right m.1.2).1 * (pairOrient right m.1.2).2) = P + rw [pairOrient_product, pairOrient_product] + exact m.property⟩ + invFun m := ⟨quartetOrient left right m.1, by + change (pairOrient left m.1.1).1 * (pairOrient left m.1.1).2 * + ((pairOrient right m.1.2).1 * (pairOrient right m.1.2).2) = P + rw [pairOrient_product, pairOrient_product] + exact m.property⟩ + left_inv m := by + apply Subtype.ext + cases left <;> cases right <;> rfl + right_inv m := by + apply Subtype.ext + cases left <;> cases right <;> rfl + +private theorem fourth_of_product {U : Type*} [CommGroup U] (a b c d P : U) + (h : (a * b) * (c * d) = P) : P * a⁻¹ / (b * d) = c := by + apply (div_eq_iff_eq_mul).2 + apply (mul_inv_eq_iff_eq_mul).2 + calc + P = (a * b) * (c * d) := h.symm + _ = (c * (b * d)) * a := by ac_rfl + +/-- The held coordinates and the inverse first free coordinate parametrize +one quartet product fiber without changing its uniform measure. -/ +noncomputable def friendlyQuartetFiberEquiv {U : Type*} [CommGroup U] (P : U) : + TreeLeafFiber U 2 P ≃ U × (U × U) where + toFun m := (m.1.1.2, m.1.2.2, m.1.1.1⁻¹) + invFun x := ⟨((x.2.2⁻¹, x.1), (P * x.2.2 / (x.1 * x.2.1), x.2.1)), + quartet_friendly_product P x.1 x.2.1 x.2.2⟩ + left_inv m := by + apply Subtype.ext + apply Prod.ext + · exact Prod.ext (inv_inv _) rfl + · apply Prod.ext + · exact fourth_of_product m.1.1.1 m.1.1.2 m.1.2.1 m.1.2.2 P m.property + · rfl + right_inv x := by + change (x.1, x.2.1, (x.2.2⁻¹)⁻¹) = x + simp only [inv_inv] + +noncomputable def crossQuartetFiberEquiv {U : Type*} [CommGroup U] + (left right : Bool) (P : U) : TreeLeafFiber U 2 P ≃ U × (U × U) := + (quartetOrientFiberEquiv left right P).trans (friendlyQuartetFiberEquiv P) + +theorem crossQuartetFiberEquiv_symm {U : Type*} [CommGroup U] + (left right : Bool) (P a b r : U) : + ((crossQuartetFiberEquiv left right P).symm (a, b, r)).1 = + crossQuartetLeaves left right P a b r := by + cases left <;> cases right <;> rfl + +/-- This is the actual uniform product-fiber measure used by the cycle proof. -/ +theorem sum_crossQuartetFiber {U R : Type*} [CommGroup U] [Fintype U] [DecidableEq U] + [AddCommMonoid R] (left right : Bool) (P : U) (f : TreeLeafTuple U 2 → R) : + (∑ m : TreeLeafFiber U 2 P, f m.1) = + ∑ a : U, ∑ b : U, ∑ r : U, f (crossQuartetLeaves left right P a b r) := by + have h := (crossQuartetFiberEquiv left right P).symm.bijective.sum_comp + (fun m : TreeLeafFiber U 2 P => f m.1) + simp only [crossQuartetFiberEquiv_symm, Fintype.sum_prod_type] at h + exact h.symm + +theorem mean_crossQuartetFiber {U : Type*} [CommGroup U] [Fintype U] [DecidableEq U] + (left right : Bool) (P : U) (f : TreeLeafTuple U 2 → ℝ) : + (Fintype.card (TreeLeafFiber U 2 P) : ℝ)⁻¹ * (∑ m : TreeLeafFiber U 2 P, f m.1) = + (Fintype.card U : ℝ)⁻¹ * (∑ a : U, (Fintype.card U : ℝ)⁻¹ * + (∑ b : U, (Fintype.card U : ℝ)⁻¹ * + ∑ r : U, f (crossQuartetLeaves left right P a b r))) := by + rw [sum_crossQuartetFiber left right P f, card_treeLeafFiber] + norm_num only [Nat.reducePow, Nat.reduceSub, Nat.cast_pow] + simp only [← Finset.mul_sum] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CrossedMoments.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CrossedMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..0a9c7409ae0173cae36e9e04d252dafc6821e5f5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CrossedMoments.lean @@ -0,0 +1,46 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +variable {C A : Type*} [CommGroup C] [Fintype C] [Fintype A] + +theorem crossed_moment_bound (F H : C → C → A → ℝ) (ν : C) (e : A ≃ A) : + 2*(∑ χ : C,∑ ψ : C,∑ a : A, F χ (ν*ψ⁻¹) a*H ψ (ν⁻¹*χ⁻¹) (e a)) ≤ + (∑ χ : C,∑ α : C,∑ a : A,F χ α a^2)+ + (∑ ψ : C,∑ β : C,∑ a : A,H ψ β a^2) := by + have hL (χ : C) : (∑ ψ : C,∑ a : A,F χ (ν*ψ⁻¹) a^2)= + ∑ α : C,∑ a : A,F χ α a^2 := by + exact ((Equiv.mulLeft ν).bijective.comp inv_involutive.bijective).sum_comp + (fun α => ∑ a : A,F χ α a^2) + have hR (ψ : C) : (∑ χ : C,∑ a : A,H ψ (ν⁻¹*χ⁻¹) (e a)^2)= + ∑ β : C,∑ a : A,H ψ β a^2 := by + have he (β : C) : (∑ a : A,H ψ β (e a)^2)=∑ a : A,H ψ β a^2 := e.sum_comp (fun a => H ψ β a^2) + simp_rw [he] + exact ((Equiv.mulLeft ν⁻¹).bijective.comp inv_involutive.bijective).sum_comp + (fun β => ∑ a : A,H ψ β a^2) + calc + _ = ∑ χ : C,∑ ψ : C,∑ a : A,2*(F χ (ν*ψ⁻¹) a*H ψ (ν⁻¹*χ⁻¹) (e a)) := by + simp only [Finset.mul_sum] + _ ≤ ∑ χ : C,∑ ψ : C,∑ a : A, + (F χ (ν*ψ⁻¹) a^2+H ψ (ν⁻¹*χ⁻¹) (e a)^2) := by + apply Finset.sum_le_sum + intro χ _ + apply Finset.sum_le_sum + intro ψ _ + apply Finset.sum_le_sum + intro a _ + nlinarith only [sq_nonneg (F χ (ν*ψ⁻¹) a-H ψ (ν⁻¹*χ⁻¹) (e a))] + _ = _ := by + simp only [Finset.sum_add_distrib] + congr 1 + · simp_rw [hL] + · rw [Finset.sum_comm] + simp_rw [hR] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CutFiberAverage.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CutFiberAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..682a062b03e4e89fd9073444d46af65ea3348d80 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CutFiberAverage.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleCut +import OAI.NumberTheory.Ostmann.Tree.DensityHorizontal + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators +open Ostmann.Arithmetic.ResidueHaar +open Ostmann.Arithmetic.GroupHaarImage + +local instance fieldDecidableEq {F : Type*} [Field F] : DecidableEq F := Classical.decEq F + +local instance subgroupFintype {G : Type*} [Group G] [Fintype G] (S : Subgroup G) : + Fintype S := Fintype.ofFinite _ +local instance fiberFintype {A B : Type*} [Fintype A] (f : A → B) (y : B) : + Fintype {x : A // f x=y} := Fintype.ofFinite _ + +def fiberAverage {A B : Type*} [Fintype A] (f : A → B) (F : A → ℂ) (y : B) : ℂ := + average (fun x : {x : A // f x=y} => F x.val) + +def kernelFiberEquiv {A B : Type*} [Group A] [Group B] + (f : A →* B) (hf : Function.Surjective f) (y : B) : f.ker ≃ {x : A // f x=y} where + toFun k := ⟨Classical.choose (hf y)*k.val,by + rw [map_mul,Classical.choose_spec (hf y),show f k.val=1 from k.property,mul_one]⟩ + invFun x := ⟨(Classical.choose (hf y))⁻¹*x.val,by + change f ((Classical.choose (hf y))⁻¹*x.val)=1 + rw [map_mul,map_inv,Classical.choose_spec (hf y),x.property,inv_mul_cancel]⟩ + left_inv k := by apply Subtype.ext; simp + right_inv x := by apply Subtype.ext; simp + +theorem average_product_nested {I J : Type*} [Fintype I] [Fintype J] + (F : I × J → ℂ) : average F=average (fun i => average (fun j => F (i,j))) := by + simp only [average,Fintype.card_prod,Nat.cast_mul,mul_inv_rev,Fintype.sum_prod_type, + ← Finset.mul_sum] + ring + +theorem average_fiberAverage {A B : Type*} [Group A] [Group B] [Fintype A] [Fintype B] + (f : A →* B) (hf : Function.Surjective f) (F : A → ℂ) : + average F=average (fiberAverage f F) := by + have he := average_equiv (homProductEquiv f hf).symm F + calc + average F = average (fun z : B × f.ker => F (Classical.choose (hf z.1)*z.2.val)) := he.symm + _ = average (fun y : B => average (fun k : f.ker => F (Classical.choose (hf y)*k.val))) := + average_product_nested _ + _ = average (fiberAverage f F) := by + congr 1 + funext y + exact average_equiv (kernelFiberEquiv f hf y) (fun x => F x.val) + +theorem cut_fiber_average {F : Type*} [Field F] [Fintype F] {d k : ℕ} + (C : Density.Cut d k) (W : (Leaves d → Fˣ) → ℂ) : + average W = average (fiberAverage C.project W) := + average_fiberAverage (C.projectHom) C.project_surjective W + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleCut.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleCut.lean new file mode 100644 index 0000000000000000000000000000000000000000..50eb0620203cb9586215eb3d43e46affe66dbc4b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleCut.lean @@ -0,0 +1,63 @@ +import OAI.NumberTheory.Ostmann.Tree.DensityCut + +namespace OAI + +namespace Ostmann.Tree.Density.Cut +open scoped BigOperators + +def label : {d k : ℕ} → Cut d k → Leaves d → Leaves k + | _,_,.stop _,_ => fun i => Fin.elim0 i + | _,_,.split L R,v => if v 0 then Fin.cons true (label R (Fin.tail v)) + else Fin.cons false (label L (Fin.tail v)) + +@[simp] theorem label_cons_false {d k : ℕ} (L R : Cut d k) (v : Leaves d) : + label (.split L R) (Fin.cons false v)=Fin.cons false (label L v) := by simp [label] +@[simp] theorem label_cons_true {d k : ℕ} (L R : Cut d k) (v : Leaves d) : + label (.split L R) (Fin.cons true v)=Fin.cons true (label R v) := by simp [label] + +theorem label_surjective {d k : ℕ} (C : Cut d k) : Function.Surjective (label C) := by + induction C with + | stop d => + intro v + exact ⟨fun _ => false,Subsingleton.elim _ _⟩ + | @split d k L R ihl ihr => + intro v + obtain ⟨⟨b,w⟩,rfl⟩ := (Density.pathEquiv k).surjective v + cases b with + | false => + obtain ⟨e,he⟩ := ihl w + refine ⟨Fin.cons false e, ?_⟩ + change label (.split L R) (Fin.cons false e)=Fin.cons false w + rw [label_cons_false,he] + | true => + obtain ⟨e,he⟩ := ihr w + refine ⟨Fin.cons true e, ?_⟩ + change label (.split L R) (Fin.cons true e)=Fin.cons true w + rw [label_cons_true,he] + +theorem project_eq_label_product {F : Type*} [Field F] {d k : ℕ} (C : Cut d k) + (M : Leaves d → Fˣ) (v : Leaves k) : + project C M v = ∏ e with label C e=v, M e := by + classical + induction C with + | stop d => + have hv : ∀e : Leaves d,label (.stop d) e=v := fun _ => Subsingleton.elim _ _ + simp [project,Parameters.leafProduct,hv] + | @split d k L R ihl ihr => + obtain ⟨⟨b,w⟩,rfl⟩ := (Density.pathEquiv k).surjective v + change project (.split L R) M (Fin.cons b w) = + ∏ e with label (.split L R) e=Fin.cons b w, M e + cases b <;> + simp only [project,Density.join,Fin.cons_zero,Fin.tail_cons, + Bool.false_eq_true,↓reduceIte] <;> + rw [Finset.prod_filter,Density.prod_split] <;> + simp only [Density.left,Density.right,label_cons_false,label_cons_true, + Fin.cons_inj, Bool.false_eq_true, Bool.true_eq_false, false_and, true_and, + ↓reduceIte,Finset.prod_const_one,mul_one,one_mul] <;> + rw [← Finset.prod_filter] + · exact ihl _ _ + · exact ihr _ _ + +end Ostmann.Tree.Density.Cut + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleExistence.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleExistence.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c30056ef8c6f34c0d0e17bb4377ff41615bc5ad --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleExistence.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleSelection + +namespace OAI + +namespace Ostmann.Tree + +theorem graph_cycle_of_edges_ge_vertices {V : Type*} [Fintype V] [Nonempty V] + (G : SimpleGraph V) [Fintype G.edgeSet] + (hcard : Fintype.card V ≤ Fintype.card G.edgeSet) : + ∃ v : V, ∃ p : G.Walk v v, p.IsCycle := by + classical + by_contra! hn + have hacyclic : G.IsAcyclic := fun v p => hn v p + obtain ⟨T,hGT,_,hT⟩ := SimpleGraph.connected_top.exists_isTree_le_of_le_of_isAcyclic + (G := (⊤ : SimpleGraph V)) (H := G) le_top hacyclic + have htcard := hT.card_edgeFinset + have hle := Finset.card_le_card (SimpleGraph.edgeFinset_mono hGT) + rw [SimpleGraph.edgeFinset_card] at hle + omega + +def incidenceGraph {E V W : Type*} (left : E → V) (right : E → W) : SimpleGraph (V ⊕ W) where + Adj x y := match x,y with + | .inl v, .inr w => ∃ e, left e=v ∧ right e=w + | .inr w, .inl v => ∃ e, left e=v ∧ right e=w + | _,_ => False + symm := ⟨by rintro (v|w) (v'|w') h <;> exact h⟩ + loopless := ⟨by rintro (v|w) h <;> exact h⟩ + +noncomputable def incidenceEdgeEmbedding {E V W : Type*} (left : E → V) (right : E → W) + (hinj : Function.Injective (fun e => (left e,right e))) : + E ↪ (incidenceGraph left right).edgeSet where + toFun e := ⟨s(Sum.inl (left e),Sum.inr (right e)), ⟨e,rfl,rfl⟩⟩ + inj' := by + intro e f h + have he : s(Sum.inl (left e),Sum.inr (right e)) = + s(Sum.inl (left f),Sum.inr (right f)) := congrArg Subtype.val h + apply hinj + rcases Sym2.eq_iff.mp he with he | he + · exact Prod.ext (Sum.inl.inj he.1) (Sum.inr.inj he.2) + · cases he.1 + +theorem incidence_cycle_or_parallel {E V W : Type*} + [Fintype E] [Fintype V] [Fintype W] [Nonempty E] + (left : E → V) (right : E → W) + (hcard : Fintype.card V+Fintype.card W ≤ Fintype.card E) : + (∃ e f : E, e ≠ f ∧ left e=left f ∧ right e=right f) ∨ + ∃ v : V ⊕ W, ∃ p : (incidenceGraph left right).Walk v v, p.IsCycle := by + classical + by_cases hinj : Function.Injective (fun e => (left e,right e)) + · right + let : Nonempty (V ⊕ W) := ⟨Sum.inl (left (Classical.choice (inferInstance : Nonempty E)))⟩ + apply graph_cycle_of_edges_ge_vertices + have hle := Fintype.card_le_of_injective _ (incidenceEdgeEmbedding left right hinj).injective + rw [Fintype.card_sum] + exact hcard.trans hle + · left + unfold Function.Injective at hinj + push Not at hinj + obtain ⟨e,f,he,hef⟩ := hinj + exact ⟨e,f,hef,congrArg Prod.fst he,congrArg Prod.snd he⟩ + +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleFiberProjection.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleFiberProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..767db2d8e4b1b27a77c6838671d0e5282bc923bc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleFiberProjection.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleProjection +import OAI.NumberTheory.Ostmann.Tree.CycleQuartetActions +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorization +import OAI.NumberTheory.Ostmann.Tree.TensorActionProjection + +namespace OAI + +namespace Ostmann.Tree.CycleFiberProjection +noncomputable section +open scoped BigOperators +open QuartetFactorization CycleQuartet +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] +variable {k b : ℕ} (P : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + +local instance productFiberFintype {m : Fˣ} : Fintype (ProductFiber m) := Fintype.ofFinite _ +local instance cutFiberFintype (totals : Leaves k → Fˣ) : + Fintype {M : Leaves (k+2) → Fˣ // (bottomCut k).project M=totals} := Fintype.ofFinite _ + +omit [Fintype F] [DecidableEq F] in +theorem bottom_project_act (z : Fˣ) (M : Leaves (k+2) → Fˣ) : + (bottomCut k).project (c.act z M)=(bottomCut k).project M := by + have h := quartet_cycle_project P c z M + have he : Density.Cut.project (F := F) (quartetCut k)= + Density.Cut.project (F := F) (bottomCut k) := + congrArg (fun C : Density.Cut (k+2) k => Density.Cut.project (F := F) C) (cut_unique _ _) + simpa only [he] using h + +def fiberProjection (totals : Leaves k → Fˣ) (fs : Leaves k → Frame F) + (g : F → ℂ) (D : Fˣ) (m : ∀ v, ProductFiber (totals v)) : ℂ := + letI : ∀ v, MulAction Fˣ (ProductFiber (totals v)) := fun v => fiberMulAction P c v (totals v) + Ostmann.FiniteField.actionProjection (F := F) + (fun v (a : ProductFiber (totals v)) => (fs v).value g D a.val) m + +theorem projection_zero_of_invalid (T : Diagram F (k+2)) (g : F → ℂ) + (totals : Leaves k → Fˣ) + (h : propagate k T.parameters T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) totals = none) + (M : {M : Leaves (k+2) → Fˣ // (bottomCut k).project M=totals}) : + c.projection (T.value g) M.val = 0 := by + unfold BalancedSelection.projection Arithmetic.ResidueHaar.average + have he (z : Fˣ) : T.value g (c.act z M.val)=0 := by + apply diagram_value_zero_of_invalid + unfold ancestorFrames + rw [bottom_project_act P c,M.property,h] + simp only [he,Finset.sum_const_zero,mul_zero] + +theorem projection_eq_fiberProjection (T : Diagram F (k+2)) (g : F → ℂ) + (totals : Leaves k → Fˣ) (fs : Leaves k → Frame F) + (h : propagate k T.parameters T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) totals = some fs) + (M : {M : Leaves (k+2) → Fˣ // (bottomCut k).project M=totals}) : + c.projection (T.value g) M.val = + fiberProjection P c totals fs g T.denominator (productFiberEquiv k totals M) := by + unfold BalancedSelection.projection Arithmetic.ResidueHaar.average + fiberProjection Ostmann.FiniteField.actionProjection + congr 1 + apply Finset.sum_congr rfl + intro z _ + change T.value g (c.act z M.val) = _ + rw [diagram_factorization] + have he : ancestorFrames T (c.act z M.val)=some fs := by + unfold ancestorFrames + rw [bottom_project_act P c,M.property,h] + rw [he] + change (∏ v,(fs v).value g T.denominator (bottomLeaves k (c.act z M.val) v)) = _ + apply Finset.prod_congr rfl + intro v _ + rw [bottomLeaves_act P c] + rfl + +theorem real_average_equiv {A B : Type*} [Fintype A] [Fintype B] + (e : A ≃ B) (f : B → ℝ) : + Density.average (fun x => f (e x))=Density.average f := by + unfold Density.average + rw [Fintype.card_congr e,e.sum_comp] + +theorem projection_energy_on_fiber (T : Diagram F (k+2)) (g : F → ℂ) + (totals : Leaves k → Fˣ) (fs : Leaves k → Frame F) + (h : propagate k T.parameters T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) totals = some fs) : + Density.average (fun M : {M : Leaves (k+2) → Fˣ // (bottomCut k).project M=totals} => + ‖c.projection (T.value g) M.val‖^2) = + Density.average (fun m : ∀ v, ProductFiber (totals v) => + ‖fiberProjection P c totals fs g T.denominator m‖^2) := by + simp_rw [projection_eq_fiberProjection P c T g totals fs h] + have he := real_average_equiv (productFiberEquiv k totals) + (fun m => ‖fiberProjection P c totals fs g T.denominator m‖^2) + simpa only [real_average_fintype_congr _ + (inferInstance : Fintype (∀ v, ProductFiber (totals v)))] using he + +theorem projection_energy_zero_of_invalid (T : Diagram F (k+2)) (g : F → ℂ) + (totals : Leaves k → Fˣ) + (h : propagate k T.parameters T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) totals = none) : + Density.average (fun M : {M : Leaves (k+2) → Fˣ // (bottomCut k).project M=totals} => + ‖c.projection (T.value g) M.val‖^2) = 0 := by + simp only [projection_zero_of_invalid P c T g totals h,norm_zero,zero_pow (by decide : 2 ≠ 0), + Density.average,Finset.sum_const_zero,mul_zero] + +end +end Ostmann.Tree.CycleFiberProjection + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsBasic.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c838a2be01d988ff7605ed9386720775494e47a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsBasic.lean @@ -0,0 +1,114 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleQuartetActionsClassification +import OAI.NumberTheory.Ostmann.Tree.QuartetLocal +import OAI.NumberTheory.Ostmann.Tree.QuartetRemainingMeans + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.Tree.CycleQuartet +open Quartet Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] +local instance cycleLocalMajorantCharDecEq : DecidableEq (MulChar (ZMod p) ℂ) := Classical.decEq _ + +def bottomSign (P : Parameters (ZMod p) 2) (side freeRight : Bool) : Bool := + match P with + | .branch _ _ _ _ L R => parameterSign (if side then R else L) freeRight + +def orientedCharacter (inverse : Bool) (ρ : MulChar (ZMod p) ℂ) : MulChar (ZMod p) ℂ := + if inverse then ρ⁻¹ else ρ + +def selectedMajorant (P : Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (κ : Kind) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : ℝ := + match κ with + | .same side inverse => FiniteField.sameLocalMajorant g + (bottomSign P side false) (bottomSign P (!side) false) side (orientedCharacter inverse ρ) y + | .cross a b inverse => FiniteField.crossLocalMajorant g + (bottomSign P false a) (bottomSign P true b) a b (orientedCharacter inverse ρ) y + +def unselectedMajorant (P : Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : ℝ := + if ρ=1 then FiniteField.untouchedLocalMajorant g (bottomSign P false false) + (bottomSign P true false) y else 0 + +theorem selectedMajorant_nonneg (P : Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (κ : Kind) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : + 0≤ selectedMajorant P g κ ρ y := by + cases κ with + | same side inverse => exact FiniteField.sameLocalMajorant_nonneg _ _ _ _ _ _ + | cross a b inverse => exact FiniteField.crossLocalMajorant_nonneg _ _ _ _ _ _ _ + +theorem unselectedMajorant_nonneg (P : Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : 0≤ unselectedMajorant P g ρ y := by + unfold unselectedMajorant + split_ifs + · exact FiniteField.untouchedLocalMajorant_nonneg _ _ _ _ + · exact le_rfl + +theorem selectedMajorant_mean_small (P : Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (κ : Kind) (ρ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) : + unitMean (selectedMajorant P g κ ρ)≤25600*treeError g := by + cases κ with + | same side inverse => + exact (FiniteField.sameLocalMajorant_mean_small _ _ _ _ _ hg0 hg).trans + (mul_le_mul_of_nonneg_right (by norm_num) (treeError_nonneg g)) + | cross a b inverse => exact FiniteField.crossLocalMajorant_mean_small _ _ _ _ _ _ hg0 hg + +omit [Fact p.Prime] in +theorem sum_orientedCharacter (inverse : Bool) (H : MulChar (ZMod p) ℂ → ℝ) : + (∑ ρ : MulChar (ZMod p) ℂ,H (orientedCharacter inverse ρ)) = ∑ ρ : MulChar (ZMod p) ℂ,H ρ := by + cases inverse + · rfl + · exact (Equiv.inv (MulChar (ZMod p) ℂ)).bijective.sum_comp H + +theorem selectedMajorant_mean_total (P : Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (κ : Kind) (hg0 : g 0=0) (hg : l2Sq g≤1) : + (∑ ρ : MulChar (ZMod p) ℂ,unitMean (selectedMajorant P g κ ρ))≤256 := by + cases κ with + | same side inverse => + change (∑ ρ : MulChar (ZMod p) ℂ,unitMean (FiniteField.sameLocalMajorant g + (bottomSign P side false) (bottomSign P (!side) false) side (orientedCharacter inverse ρ)))≤256 + rw [sum_orientedCharacter inverse (fun ρ => unitMean (FiniteField.sameLocalMajorant g + (bottomSign P side false) (bottomSign P (!side) false) side ρ))] + exact FiniteField.sameLocalMajorant_mean_total _ _ _ _ hg0 hg + | cross a b inverse => + change (∑ ρ : MulChar (ZMod p) ℂ,unitMean (FiniteField.crossLocalMajorant g + (bottomSign P false a) (bottomSign P true b) a b (orientedCharacter inverse ρ)))≤256 + rw [sum_orientedCharacter inverse (fun ρ => unitMean (FiniteField.crossLocalMajorant g + (bottomSign P false a) (bottomSign P true b) a b ρ))] + exact (FiniteField.crossLocalMajorant_mean_total _ _ _ _ _ hg0 hg).trans (by norm_num) + +theorem unselectedMajorant_mean_total (P : Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (hg0 : g 0=0) (hg : l2Sq g≤1) : + (∑ ρ : MulChar (ZMod p) ℂ,unitMean (unselectedMajorant P g ρ))≤256 := by + classical + have he (ρ : MulChar (ZMod p) ℂ) : unitMean (unselectedMajorant P g ρ) = + if ρ=1 then unitMean (FiniteField.untouchedLocalMajorant g (bottomSign P false false) + (bottomSign P true false)) else 0 := by + by_cases hρ : ρ=1 <;> simp [unselectedMajorant,hρ,unitMean] + simp_rw [he] + simp only [Finset.sum_ite_eq',Finset.mem_univ,ite_true] + exact (FiniteField.untouchedLocalMajorant_mean _ _ _ hg0 hg).trans (by norm_num) + +theorem selectedMajorant_same_node (N : NodeInput (ZMod p) 1) (g : ZMod p → ℂ) + (side inverse : Bool) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : + selectedMajorant N.parameters g (.same side inverse) ρ y = + N.sameLocalMajorant g side (orientedCharacter inverse ρ) y := by + cases side <;> rfl + +theorem selectedMajorant_cross_node (N : NodeInput (ZMod p) 1) (g : ZMod p → ℂ) + (a b inverse : Bool) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : + selectedMajorant N.parameters g (.cross a b inverse) ρ y = + N.crossLocalMajorant g a b (orientedCharacter inverse ρ) y := by + simp only [selectedMajorant, bottomSign, NodeInput.parameters, Bool.false_eq_true, + ↓reduceIte, FiniteField.crossLocalMajorant, NodeInput.crossLocalMajorant, + norm_div, Complex.norm_natCast] + +theorem unselectedMajorant_node (N : NodeInput (ZMod p) 1) (g : ZMod p → ℂ) + (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : + unselectedMajorant N.parameters g ρ y = if ρ=1 then N.untouchedLocalMajorant g y else 0 := rfl + +end Ostmann.Tree.CycleQuartet +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsCoefficients.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsCoefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..65e15fbb92b895f2335b5abffb95b21fb09b0563 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsCoefficients.lean @@ -0,0 +1,140 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleLocalMajorantsBasic +import OAI.NumberTheory.Ostmann.Tree.TensorActionProjection + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.FiniteField +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] +local instance cycleCoefficientCharDecEq : DecidableEq (MulChar F ℂ) := Classical.decEq _ + +theorem mellin_const_value (c : ℂ) (ρ : MulChar F ℂ) : + mellin (fun _ : Fˣ => c) ρ = if ρ=1 then c else 0 := by + classical + unfold mellin + rw [← Finset.mul_sum, ← map_sum, sum_units_mulChar] + by_cases hρ : ρ=1 <;> simp [hρ] + have hN : (Fintype.card Fˣ:ℂ)≠0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero + field_simp + +end Ostmann.FiniteField +namespace Ostmann.Tree.CycleQuartet +open Quartet Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] + +theorem kind_fiber_bound (T : Diagram (ZMod p) 2) (g : ZMod p → ℂ) (hg0 : g 0=0) + (κ : Kind) (m : (ZMod p)ˣ) (ρ : MulChar (ZMod p) ℂ) : + Density.average (fun M : ProductFiber m => + ‖mellin (fun z : (ZMod p)ˣ => T.value g (κ.act z M.val)) ρ‖^2) ≤ + selectedMajorant T.parameters g κ ρ (T.localNode.familyRoot m) := by + cases κ with + | same side inverse => + have hm : selectedMajorant T.parameters g (.same side inverse) ρ (T.localNode.familyRoot m) = + T.localNode.sameLocalMajorant g side (orientedCharacter inverse ρ) (T.localNode.familyRoot m) := by + rw [← T.localNode_parameters, selectedMajorant_same_node] + rw [hm] + cases inverse + · exact T.sameAction_fiber_bound g hg0 side m ρ + · exact T.sameAction_inverse_fiber_bound g hg0 side m ρ + | cross a b inverse => + have hm : selectedMajorant T.parameters g (.cross a b inverse) ρ (T.localNode.familyRoot m) = + T.localNode.crossLocalMajorant g a b (orientedCharacter inverse ρ) (T.localNode.familyRoot m) := by + rw [← T.localNode_parameters, selectedMajorant_cross_node] + rw [hm] + cases inverse + · exact T.crossAction_fiber_bound g hg0 a b m ρ + · exact T.crossAction_inverse_fiber_bound g hg0 a b m ρ + +variable {k b : ℕ} (P : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + +def localMajorant (Qs : Leaves k → Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (v : Leaves k) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : ℝ := by + classical + exact if hv : v∈cycleQuartets P c then selectedMajorant (Qs v) g (kind P c ⟨v,hv⟩) ρ y + else unselectedMajorant (Qs v) g ρ y + +theorem localMajorant_selected (Qs : Leaves k → Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (v : Leaves k) (hv : v∈cycleQuartets P c) : + localMajorant P c Qs g v = selectedMajorant (Qs v) g (kind P c ⟨v,hv⟩) := by + funext ρ y + simp only [localMajorant,hv,↓reduceDIte] + +theorem localMajorant_unselected (Qs : Leaves k → Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (v : Leaves k) (hv : v∉cycleQuartets P c) : + localMajorant P c Qs g v = unselectedMajorant (Qs v) g := by + funext ρ y + simp only [localMajorant,hv,↓reduceDIte] + +theorem localMajorant_nonneg (Qs : Leaves k → Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (v : Leaves k) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : + 0≤ localMajorant P c Qs g v ρ y := by + classical + unfold localMajorant + split_ifs + · exact selectedMajorant_nonneg _ _ _ _ _ + · exact unselectedMajorant_nonneg _ _ _ _ + +theorem localMajorant_mean_small (Qs : Leaves k → Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (v : Leaves k) (hv : v∈cycleQuartets P c) (ρ : MulChar (ZMod p) ℂ) + (hg0 : g 0=0) (hg : l2Sq g≤1) : + unitMean (localMajorant P c Qs g v ρ)≤25600*treeError g := by + classical + rw [localMajorant_selected P c Qs g v hv] + exact selectedMajorant_mean_small _ _ _ _ hg0 hg + +theorem localMajorant_mean_total (Qs : Leaves k → Parameters (ZMod p) 2) (g : ZMod p → ℂ) + (v : Leaves k) (hg0 : g 0=0) (hg : l2Sq g≤1) : + (∑ ρ : MulChar (ZMod p) ℂ,unitMean (localMajorant P c Qs g v ρ))≤256 := by + classical + by_cases hv : v∈cycleQuartets P c + · rw [localMajorant_selected P c Qs g v hv] + exact selectedMajorant_mean_total _ _ _ hg0 hg + · rw [localMajorant_unselected P c Qs g v hv] + exact unselectedMajorant_mean_total _ _ hg0 hg + +theorem localAct_fiber_bound (Qs : Leaves k → Parameters (ZMod p) 2) + (T : Diagram (ZMod p) 2) (v : Leaves k) (hparams : T.parameters=Qs v) + (g : ZMod p → ℂ) (hg0 : g 0=0) (m : (ZMod p)ˣ) (ρ : MulChar (ZMod p) ℂ) : + Density.average (fun M : ProductFiber m => + ‖mellin (fun z : (ZMod p)ˣ => T.value g (localAct P c v z M.val)) ρ‖^2) ≤ + localMajorant P c Qs g v ρ (T.localNode.familyRoot m) := by + classical + by_cases hv : v∈cycleQuartets P c + · simp only [localMajorant,hv,↓reduceDIte,← hparams] + have ha (z : (ZMod p)ˣ) (M : Leaves 2 → (ZMod p)ˣ) : + localAct P c v z M=(kind P c ⟨v,hv⟩).act z M := localAct_eq_kind P c ⟨v,hv⟩ z M + simp_rw [ha] + exact kind_fiber_bound T g hg0 _ m ρ + · simp only [localMajorant,hv,↓reduceDIte,← hparams] + simp_rw [localAct_untouched P c hv, mellin_const_value] + have hm := unselectedMajorant_node T.localNode g ρ (T.localNode.familyRoot m) + rw [T.localNode_parameters] at hm + rw [hm] + by_cases hρ : ρ=1 + · simp only [hρ,ite_true] + exact T.untouched_fiber_bound g hg0 m + · simp [hρ,Density.average] + +def fiberValues (Ts : Leaves k → Diagram (ZMod p) 2) (g : ZMod p → ℂ) + (totals : Leaves k → (ZMod p)ˣ) : (v : Leaves k) → ProductFiber (totals v) → ℂ := + fun v M => (Ts v).value g M.val + +theorem actionCoefficient_fiber_bound (Qs : Leaves k → Parameters (ZMod p) 2) + (Ts : Leaves k → Diagram (ZMod p) 2) (hparams : ∀v,(Ts v).parameters=Qs v) + (g : ZMod p → ℂ) (hg0 : g 0=0) (totals : Leaves k → (ZMod p)ˣ) + (v : Leaves k) (ρ : MulChar (ZMod p) ℂ) : + letI : ∀v,MulAction (ZMod p)ˣ (ProductFiber (totals v)) := fun v => fiberMulAction P c v (totals v) + Density.average (fun M : ProductFiber (totals v) => + ‖actionCoefficient (fiberValues Ts g totals) v ρ M‖^2) ≤ + localMajorant P c Qs g v ρ ((Ts v).localNode.familyRoot (totals v)) := by + let : ∀v,MulAction (ZMod p)ˣ (ProductFiber (totals v)) := fun v => fiberMulAction P c v (totals v) + change Density.average (fun M : ProductFiber (totals v) => + ‖mellin (fun z : (ZMod p)ˣ => (Ts v).value g (localAct P c v z M.val)) ρ‖^2) ≤ _ + exact localAct_fiber_bound P c Qs (Ts v) v (hparams v) g hg0 (totals v) ρ + +end Ostmann.Tree.CycleQuartet +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsFrames.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsFrames.lean new file mode 100644 index 0000000000000000000000000000000000000000..28fa890ca10f1c9996043256ba940dfaf9b219d3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleLocalMajorantsFrames.lean @@ -0,0 +1,56 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleLocalMajorantsCoefficients +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorization + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.Tree.CycleQuartet +open QuartetFactorization Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] {k b : ℕ} + +theorem frame_parameters_fixed (T : Diagram (ZMod p) (k+2)) + (M : Leaves (k+2) → (ZMod p)ˣ) (fs : Leaves k → Frame (ZMod p)) + (hf : ancestorFrames T M = some fs) (v : Leaves k) : + (frameDiagram T M fs hf v).parameters = bottomParameters k T.parameters v := + (propagate_validity k T.parameters T.consistent T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) (Density.rootCoefficient_consistent _) + ((bottomCut k).project M) fs hf v).1 + +theorem frame_familyRoot (T : Diagram (ZMod p) (k+2)) + (M : Leaves (k+2) → (ZMod p)ˣ) (fs : Leaves k → Frame (ZMod p)) + (hf : ancestorFrames T M = some fs) (v : Leaves k) : + (frameDiagram T M fs hf v).localNode.familyRoot ((bottomCut k).project M v) = + (fs v).argument T.denominator ((bottomCut k).project M v) := by + have he := Diagram.localNode_rootArgument (frameDiagram T M fs hf v) (bottomLeaves k M v) + rw [bottomLeaves_product k M v] at he + exact he.trans (frameDiagram_rootArgument T M fs hf v) + +variable (P : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + +theorem frame_actionCoefficient_bound (T : Diagram (ZMod p) (k+2)) + (M : Leaves (k+2) → (ZMod p)ˣ) (fs : Leaves k → Frame (ZMod p)) + (hf : ancestorFrames T M = some fs) (g : ZMod p → ℂ) (hg0 : g 0=0) + (v : Leaves k) (ρ : MulChar (ZMod p) ℂ) : + let totals := (bottomCut k).project M + let Ts := frameDiagram T M fs hf + letI : ∀v,MulAction (ZMod p)ˣ (ProductFiber (totals v)) := fun v => fiberMulAction P c v (totals v) + Density.average (fun m : ProductFiber (totals v) => + ‖actionCoefficient (fiberValues Ts g totals) v ρ m‖^2) ≤ + localMajorant P c (bottomParameters k T.parameters) g v ρ + ((fs v).argument T.denominator (totals v)) := by + let totals := (bottomCut k).project M + let Ts := frameDiagram T M fs hf + let : ∀v,MulAction (ZMod p)ˣ (ProductFiber (totals v)) := fun v => fiberMulAction P c v (totals v) + have hb := actionCoefficient_fiber_bound P c (bottomParameters k T.parameters) Ts + (frame_parameters_fixed T M fs hf) g hg0 totals v ρ + have hy : (Ts v).localNode.familyRoot (totals v) = + (fs v).argument T.denominator (totals v) := frame_familyRoot T M fs hf v + rw [hy] at hb + exact hb + +end Ostmann.Tree.CycleQuartet +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleProducts.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a44387d4ce2af2b9cd665c8b186fcb12d6f315e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleProducts.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleSelection +import OAI.NumberTheory.Ostmann.Tree.Diagram + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators + +def labelProducts {E V U : Type*} [Fintype E] [DecidableEq V] [CommGroup U] + (label : E → V) : (E → U) →* (V → U) where + toFun M v := ∏ e with label e=v, M e + map_one' := by funext v; simp + map_mul' M N := by funext v; simp [Finset.prod_mul_distrib] + +theorem labelProducts_surjective {E V U : Type*} [Fintype E] [DecidableEq V] [CommGroup U] + (label : E → V) (hl : Function.Surjective label) : + Function.Surjective (labelProducts (U:=U) label) := by + classical + let s : V → E := fun v => Classical.choose (hl v) + have hs : ∀v,label (s v)=v := fun v => Classical.choose_spec (hl v) + intro t + let M : E → U := fun e => if e=s (label e) then t (label e) else 1 + refine ⟨M,?_⟩ + funext v + change (∏ e with label e=v, M e)=t v + rw [Finset.prod_eq_single (s v)] + · simp [M,hs] + · intro e he hne + have hv := (Finset.mem_filter.mp he).2 + simp [M,hv,hne] + · intro hn + exact False.elim (hn (by simp [hs])) + +theorem BalancedSelection.labelProducts_act {E V W U : Type*} [Fintype E] + [DecidableEq E] [DecidableEq V] [DecidableEq W] [CommGroup U] + {left : E → V} {right : E → W} (c : BalancedSelection left right) + (z : U) (M : E → U) : labelProducts left (c.act z M)=labelProducts left M := by + funext v + exact c.left_product z M v + +def BalancedSelection.actEquiv {E V W U : Type*} + [DecidableEq E] [DecidableEq V] [DecidableEq W] [CommGroup U] + {left : E → V} {right : E → W} (c : BalancedSelection left right) + (z : U) : (E → U) ≃ (E → U) where + toFun := c.act z + invFun := c.act z⁻¹ + left_inv M := by rw [← c.act_mul,inv_mul_cancel,c.act_one] + right_inv M := by rw [← c.act_mul,mul_inv_cancel,c.act_one] + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleProjection.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..0279ac3791ff17c20ae01cba082deb031f9bfa7a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleProjection.lean @@ -0,0 +1,91 @@ +import OAI.NumberTheory.Ostmann.Tree.CoupledHaar +import OAI.NumberTheory.Ostmann.Tree.CycleProducts + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators ComplexConjugate +open Ostmann.Arithmetic.ResidueHaar + +lemma average_fintype_congr {I : Type*} (i j : Fintype I) (f : I → ℂ) : + @average I i f = @average I j f := by + cases Subsingleton.elim i j + rfl +lemma real_average_fintype_congr {I : Type*} (i j : Fintype I) (f : I → ℝ) : + @Density.average I i f = @Density.average I j f := by + cases Subsingleton.elim i j + rfl + +lemma average_mul_const {I : Type*} [Fintype I] (f : I → ℂ) (c : ℂ) : + average (fun i => f i*c)=average f*c := by + simp only [average,← Finset.sum_mul] + ring +lemma average_const {I : Type*} [Fintype I] [Nonempty I] (c : ℂ) : + average (fun _ : I => c)=c := by + have hn : (Fintype.card I:ℂ) ≠ 0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero + simp only [average,Finset.sum_const,Finset.card_univ,nsmul_eq_mul] + exact inv_mul_cancel_left₀ hn c +lemma average_comm {I J : Type*} [Fintype I] [Fintype J] (f : I → J → ℂ) : + average (fun i => average (f i)) = average (fun j => average (fun i => f i j)) := by + simp only [average,← Finset.mul_sum] + rw [Finset.sum_comm] + ring + +def BalancedSelection.projection {E V W U : Type*} + [DecidableEq E] [DecidableEq V] [DecidableEq W] [CommGroup U] [Fintype U] + {left : E → V} {right : E → W} (c : BalancedSelection left right) + (F : (E → U) → ℂ) (M : E → U) : ℂ := average (fun z : U => F (c.act z M)) + +theorem cycle_projection_correlation {E E' V W U : Type*} + [Fintype E] [Fintype E'] [Fintype U] [CommGroup U] + [DecidableEq E] [DecidableEq E'] [DecidableEq V] [DecidableEq W] + {left : E → V} {right : E → W} (other : E' → V) + (c : BalancedSelection left right) (F : (E → U) → ℂ) (G : (E' → U) → ℂ) : + average (fun x : coupledGroup (labelProducts left) (labelProducts other) => + c.projection F x.val.1*conj (G x.val.2)) = + average (fun x : coupledGroup (labelProducts left) (labelProducts other) => + F x.val.1*conj (G x.val.2)) := by + classical + let S := coupledGroup (labelProducts (U:=U) left) (labelProducts other) + calc + _ = average (fun x : S => average (fun z : U => F (c.act z x.val.1)*conj (G x.val.2))) := by + congr 1 + funext x + exact (average_mul_const _ _).symm + _ = average (fun z : U => average (fun x : S => F (c.act z x.val.1)*conj (G x.val.2))) := + average_comm _ + _ = average (fun _z : U => average (fun x : S => F x.val.1*conj (G x.val.2))) := by + congr 1 + funext z + have h := coupledGroup.average_change_first (labelProducts left) (labelProducts other) + (c.actEquiv z) (c.labelProducts_act z) F G + simp only [average_fintype_congr _ (inferInstance : Fintype S)] at h + change average (fun x : S => F (c.act z x.val.1)*conj (G x.val.2)) = _ at h + exact h + _ = _ := average_const _ + +theorem cycle_projection_reduction {E E' V W U : Type*} + [Fintype E] [Fintype E'] [Fintype U] [CommGroup U] + [DecidableEq E] [DecidableEq E'] [DecidableEq V] [DecidableEq W] + {left : E → V} {right : E → W} (other : E' → V) + (hl : Function.Surjective left) (ho : Function.Surjective other) + (c : BalancedSelection left right) (F : (E → U) → ℂ) (G : (E' → U) → ℂ) : + ‖average (fun x : coupledGroup (labelProducts left) (labelProducts other) => + F x.val.1*conj (G x.val.2))‖^2 ≤ + Density.average (fun M => ‖c.projection F M‖^2)*Density.average (fun N => ‖G N‖^2) := by + classical + let S := coupledGroup (labelProducts (U:=U) left) (labelProducts other) + have hi := cycle_projection_correlation other c F G + have h := coupled_cauchy_sq (labelProducts left) (labelProducts other) + (labelProducts_surjective left hl) (labelProducts_surjective other ho) (c.projection F) G + simp only [average_fintype_congr _ (inferInstance : Fintype S)] at hi h + simp only [real_average_fintype_congr _ (inferInstance : Fintype (E → U)), + real_average_fintype_congr _ (inferInstance : Fintype (E' → U))] at h + rw [hi] at h + exact h + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActions.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a2daf6b34a9b639dc0b420355ccb057268612cc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActions.lean @@ -0,0 +1,65 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleQuartetActionsCoordinates + +namespace OAI + +noncomputable section +namespace Ostmann.Tree.CycleQuartet +open QuartetFactorization +variable {k b : ℕ} (P : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + +def cycleQuartets : Finset (Leaves k) := c.positive.image (quartetCut k).label + +theorem cycleQuartets_nonempty : (cycleQuartets P c).Nonempty := + c.nonempty.image _ + +def localAct {U : Type*} [CommGroup U] (v : Leaves k) (z : U) + (M : Leaves 2 → U) : Leaves 2 → U := fun w => c.twist z (leaf k v w)*M w + +@[simp] theorem localAct_one {U : Type*} [CommGroup U] (v : Leaves k) + (M : Leaves 2 → U) : localAct P c v 1 M=M := by + funext w + simp [localAct,BalancedSelection.twist] + +theorem localAct_mul {U : Type*} [CommGroup U] (v : Leaves k) (z t : U) + (M : Leaves 2 → U) : localAct P c v (z*t) M=localAct P c v z (localAct P c v t M) := by + funext w + simp only [localAct,c.twist_mul,mul_assoc] + +theorem bottomLeaves_act {F : Type*} [Field F] (v : Leaves k) (z : Fˣ) + (M : Leaves (k+2) → Fˣ) : + bottomLeaves k (c.act z M) v=localAct P c v z (bottomLeaves k M v) := by + funext w + simp only [bottomLeaves_apply,localAct,BalancedSelection.act] + +theorem localAct_product {F : Type*} [Field F] (v : Leaves k) (z : Fˣ) + (M : Leaves 2 → Fˣ) : + Parameters.leafProduct (localAct P c v z M)=Parameters.leafProduct M := by + let A := assembleBottom k (fun _ => M) + have hA : bottomLeaves k A v=M := congrFun (bottomLeaves_assemble k (fun _ => M)) v + have hproj := quartet_cycle_project P c z A + have hcut : Density.Cut.project (F := F) (quartetCut k) = + Density.Cut.project (F := F) (bottomCut k) := + congrArg (fun C : Density.Cut (k+2) k => Density.Cut.project (F := F) C) (cut_unique _ _) + rw [hcut] at hproj + rw [←hA,←bottomLeaves_act,bottomLeaves_product,bottomLeaves_product] + exact congrFun hproj v + +abbrev ProductFiber {F : Type*} [Field F] (m : Fˣ) := + {M : Leaves 2 → Fˣ // Parameters.leafProduct M=m} + +def fiberAct {F : Type*} [Field F] (v : Leaves k) (m : Fˣ) (z : Fˣ) + (M : ProductFiber m) : ProductFiber m := + ⟨localAct P c v z M.val,(localAct_product P c v z M.val).trans M.property⟩ + +@[instance_reducible] def fiberMulAction {F : Type*} [Field F] (v : Leaves k) (m : Fˣ) : + MulAction Fˣ (ProductFiber m) where + smul := fiberAct P c v m + one_smul M := Subtype.ext (localAct_one P c v M.val) + mul_smul z t M := Subtype.ext (localAct_mul P c v z t M.val) + +end Ostmann.Tree.CycleQuartet + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActionsClassification.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActionsClassification.lean new file mode 100644 index 0000000000000000000000000000000000000000..776b22110e8a0b74f2a75959ef9b3b8c63815858 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActionsClassification.lean @@ -0,0 +1,97 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleQuartetActionsSelected + +namespace OAI + +noncomputable section +namespace Ostmann.Tree.CycleQuartet + +def position (a b : Bool) : Leaves 2 := Fin.cons a (Fin.cons b Fin.elim0) + +@[simp] theorem position_zero (a b : Bool) : position a b 0=a := rfl +@[simp] theorem position_one (a b : Bool) : position a b 1=b := rfl + +@[simp] theorem position_eq_iff (a b x y : Bool) : position a b=position x y ↔ a=x ∧ b=y := by + constructor + · intro h + exact ⟨congrFun h 0,congrFun h 1⟩ + · rintro ⟨rfl,rfl⟩ + rfl + +theorem position_eta (w : Leaves 2) : position (w 0) (w 1)=w := by + funext i + fin_cases i <;> rfl + +theorem exists_position (w : Leaves 2) : ∃a b,w=position a b := + ⟨w 0,w 1,(position_eta w).symm⟩ + +variable {F : Type*} [Field F] + +theorem twoLeafAct_swap (u v : Leaves 2) (z : Fˣ) (M : Leaves 2 → Fˣ) : + twoLeafAct v u z M=twoLeafAct u v z⁻¹ M := by + funext w + simp only [twoLeafAct,inv_inv] + rw [mul_comm (if w=v then z else 1) (if w=u then z⁻¹ else 1)] + +theorem twoLeafAct_cross (a b : Bool) (z : Fˣ) (M : Leaves 2 → Fˣ) : + twoLeafAct (position false a) (position true b) z M=Quartet.moveCross M a b z := by + funext w + obtain ⟨x,y,rfl⟩ := exists_position w + cases a <;> cases b <;> cases x <;> cases y <;> + simp [twoLeafAct,Quartet.moveCross,Quartet.scalePair,Quartet.scaleLeaf, + Density.join,Density.left,Density.right,position,mul_comm] + +theorem twoLeafAct_same (a : Bool) (z : Fˣ) (M : Leaves 2 → Fˣ) : + twoLeafAct (position a false) (position a true) z M=Quartet.NodeInput.moveSame M a z := by + funext w + obtain ⟨x,y,rfl⟩ := exists_position w + cases a <;> cases x <;> cases y <;> + simp [twoLeafAct,Quartet.NodeInput.moveSame,Quartet.movePair,Quartet.scaleLeaf, + Density.join,Density.left,Density.right,position,mul_comm] + +inductive Kind where + | same (side inverse : Bool) + | cross (leftLeaf rightLeaf inverse : Bool) + deriving DecidableEq + +def Kind.act (kind : Kind) (z : Fˣ) (M : Leaves 2 → Fˣ) : Leaves 2 → Fˣ := + match kind with + | .same side inverse => Quartet.NodeInput.moveSame M side (if inverse then z⁻¹ else z) + | .cross a b inverse => Quartet.moveCross M a b (if inverse then z⁻¹ else z) + +def classifyPositions (u v : Leaves 2) : Kind := + match u 0,v 0 with + | false,false => .same false (u 1) + | true,true => .same true (u 1) + | false,true => .cross (u 1) (v 1) false + | true,false => .cross (v 1) (u 1) true + +theorem twoLeafAct_classify (u v : Leaves 2) (huv : u≠v) (z : Fˣ) (M : Leaves 2 → Fˣ) : + twoLeafAct u v z M=(classifyPositions u v).act z M := by + obtain ⟨a,b,rfl⟩ := exists_position u + obtain ⟨x,y,rfl⟩ := exists_position v + cases a <;> cases b <;> cases x <;> cases y + all_goals try exact False.elim (huv rfl) + all_goals simp only [classifyPositions,position_zero,position_one,Kind.act, + Bool.false_eq_true,ite_false,ite_true] + all_goals first + | exact twoLeafAct_same _ _ _ + | exact twoLeafAct_cross _ _ _ _ + | rw [twoLeafAct_swap,twoLeafAct_same] + | rw [twoLeafAct_swap,twoLeafAct_cross] + +variable {k b : ℕ} (P : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + +def kind (v : cycleQuartets P c) : Kind := + classifyPositions (positivePosition P c v) (negativePosition P c v) + +theorem localAct_eq_kind (v : cycleQuartets P c) (z : Fˣ) (M : Leaves 2 → Fˣ) : + localAct P c v.val z M=(kind P c v).act z M := by + rw [localAct_eq_twoLeafAct] + exact twoLeafAct_classify _ _ (positions_distinct P c v) z M + +end Ostmann.Tree.CycleQuartet + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActionsCoordinates.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActionsCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..92334ddd406a1a1e7ee6fc69668a6a8d727fe292 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActionsCoordinates.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleQuartets +import OAI.NumberTheory.Ostmann.Tree.QuartetActions +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorizationLeaves + +namespace OAI + +noncomputable section +namespace Ostmann.Tree.CycleQuartet +open QuartetFactorization Density + +def leaf : (k : ℕ) → Leaves k → Leaves 2 → Leaves (k+2) + | 0,_,w => w + | k+1,v,w => Fin.cons (v 0) (leaf k (Fin.tail v) w) + +def tail : (k : ℕ) → Leaves (k+2) → Leaves 2 + | 0,e => e + | k+1,e => tail k (Fin.tail e) + +@[simp] theorem tail_leaf (k : ℕ) (v : Leaves k) (w : Leaves 2) : + tail k (leaf k v w)=w := by + induction k with + | zero => rfl + | succ k ih => simp only [tail,leaf,Fin.tail_cons,ih] + +@[simp] theorem label_leaf (k : ℕ) (v : Leaves k) (w : Leaves 2) : + (bottomCut k).label (leaf k v w)=v := by + induction k with + | zero => exact Subsingleton.elim _ _ + | succ k ih => + cases hv : v 0 <;> + simp only [bottomCut,leaf,hv,Cut.label_cons_false,Cut.label_cons_true,ih] + · simpa only [hv] using Fin.cons_self_tail v + · simpa only [hv] using Fin.cons_self_tail v + +@[simp] theorem leaf_label_tail (k : ℕ) (e : Leaves (k+2)) : + leaf k ((bottomCut k).label e) (tail k e)=e := by + induction k with + | zero => rfl + | succ k ih => + cases he : e 0 <;> + simp only [bottomCut,Cut.label,he,Bool.false_eq_true,↓reduceIte,leaf, + Fin.cons_zero,Fin.tail_cons,tail,ih] + · simpa only [he] using Fin.cons_self_tail e + · simpa only [he] using Fin.cons_self_tail e + +theorem leaf_injective (k : ℕ) (v : Leaves k) : Function.Injective (leaf k v) := by + intro a b h + simpa only [tail_leaf] using congrArg (tail k) h + +@[simp] theorem quartetCut_label_leaf (k : ℕ) (v : Leaves k) (w : Leaves 2) : + (quartetCut k).label (leaf k v w)=v := by + rw [show quartetCut k=bottomCut k from cut_unique _ _] + exact label_leaf k v w + +@[simp] theorem leaf_quartetCut_label_tail (k : ℕ) (e : Leaves (k+2)) : + leaf k ((quartetCut k).label e) (tail k e)=e := by + rw [show quartetCut k=bottomCut k from cut_unique _ _] + exact leaf_label_tail k e + +theorem bottomLeaves_apply {F : Type*} [Field F] (k : ℕ) + (M : Leaves (k+2) → Fˣ) (v : Leaves k) (w : Leaves 2) : + bottomLeaves k M v w=M (leaf k v w) := by + induction k with + | zero => rfl + | succ k ih => + cases hv : v 0 <;> + simp only [bottomLeaves,join,hv,Bool.false_eq_true,↓reduceIte,leaf,ih,left,right] + +end Ostmann.Tree.CycleQuartet + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActionsSelected.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActionsSelected.lean new file mode 100644 index 0000000000000000000000000000000000000000..41eeeb25f851522dd784e8661920fe5e9e21bee6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartetActionsSelected.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleQuartetActions + +namespace OAI + +noncomputable section +namespace Ostmann.Tree.CycleQuartet +open Finset +variable {k b : ℕ} (P : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + +instance selectedQuartets_nonempty : Nonempty (cycleQuartets P c) := + (cycleQuartets_nonempty P c).coe_sort + +theorem positive_fiber_card {v : Leaves k} (hv : v∈cycleQuartets P c) : + (c.positive.filter (fun e => (quartetCut k).label e=v)).card=1 := by + obtain ⟨e,he,hv'⟩ := mem_image.mp hv + apply Nat.le_antisymm (c.right_bound v) + exact Nat.succ_le_of_lt (card_pos.mpr ⟨e,mem_filter.mpr ⟨he,hv'⟩⟩) + +theorem negative_fiber_card {v : Leaves k} (hv : v∈cycleQuartets P c) : + (c.negative.filter (fun e => (quartetCut k).label e=v)).card=1 := by + rw [←c.right_balance,positive_fiber_card P c hv] + +theorem local_positive_existsUnique {v : Leaves k} (hv : v∈cycleQuartets P c) : + ∃! w : Leaves 2,leaf k v w∈c.positive := by + obtain ⟨e,he,huniq⟩ := card_eq_one_iff_existsUnique.mp (positive_fiber_card P c hv) + obtain ⟨hep,hev⟩ := mem_filter.mp he + have hleaf : leaf k v (tail k e)=e := by rw [←hev,leaf_quartetCut_label_tail] + refine ⟨tail k e,by simpa only [hleaf] using hep,?_⟩ + intro w hw + have heq := huniq (leaf k v w) (mem_filter.mpr ⟨hw,quartetCut_label_leaf k v w⟩) + simpa only [tail_leaf] using congrArg (tail k) heq + +theorem local_negative_existsUnique {v : Leaves k} (hv : v∈cycleQuartets P c) : + ∃! w : Leaves 2,leaf k v w∈c.negative := by + obtain ⟨e,he,huniq⟩ := card_eq_one_iff_existsUnique.mp (negative_fiber_card P c hv) + obtain ⟨hep,hev⟩ := mem_filter.mp he + have hleaf : leaf k v (tail k e)=e := by rw [←hev,leaf_quartetCut_label_tail] + refine ⟨tail k e,by simpa only [hleaf] using hep,?_⟩ + intro w hw + have heq := huniq (leaf k v w) (mem_filter.mpr ⟨hw,quartetCut_label_leaf k v w⟩) + simpa only [tail_leaf] using congrArg (tail k) heq + +def positivePosition (v : cycleQuartets P c) : Leaves 2 := + Classical.choose (local_positive_existsUnique P c v.property) + +def negativePosition (v : cycleQuartets P c) : Leaves 2 := + Classical.choose (local_negative_existsUnique P c v.property) + +theorem positive_mem_iff (v : cycleQuartets P c) (w : Leaves 2) : + leaf k v.val w∈c.positive ↔ w=positivePosition P c v := by + have h := Classical.choose_spec (local_positive_existsUnique P c v.property) + exact ⟨fun hw => h.2 w hw,fun hw => hw ▸ h.1⟩ + +theorem negative_mem_iff (v : cycleQuartets P c) (w : Leaves 2) : + leaf k v.val w∈c.negative ↔ w=negativePosition P c v := by + have h := Classical.choose_spec (local_negative_existsUnique P c v.property) + exact ⟨fun hw => h.2 w hw,fun hw => hw ▸ h.1⟩ + +theorem positions_distinct (v : cycleQuartets P c) : + positivePosition P c v≠negativePosition P c v := by + intro h + have hp := (positive_mem_iff P c v (positivePosition P c v)).mpr rfl + have hn := (negative_mem_iff P c v (negativePosition P c v)).mpr rfl + rw [h] at hp + exact disjoint_left.mp c.disjoint hp hn + +def twoLeafAct {U : Type*} [CommGroup U] (u v : Leaves 2) (z : U) + (M : Leaves 2 → U) : Leaves 2 → U := fun w => + (if w=u then z else 1)*(if w=v then z⁻¹ else 1)*M w + +theorem localAct_eq_twoLeafAct {U : Type*} [CommGroup U] + (v : cycleQuartets P c) (z : U) (M : Leaves 2 → U) : + localAct P c v.val z M=twoLeafAct (positivePosition P c v) (negativePosition P c v) z M := by + funext w + simp only [localAct,twoLeafAct,BalancedSelection.twist,positive_mem_iff,negative_mem_iff] + +theorem negative_label_mem {e : Leaves (k+2)} (he : e∈c.negative) : + (quartetCut k).label e∈cycleQuartets P c := by + have hn : 0<(c.negative.filter (fun x => (quartetCut k).label x=(quartetCut k).label e)).card := + card_pos.mpr ⟨e,mem_filter.mpr ⟨he,rfl⟩⟩ + rw [←c.right_balance] at hn + obtain ⟨f,hf⟩ := card_pos.mp hn + exact mem_image.mpr ⟨f,(mem_filter.mp hf).1,(mem_filter.mp hf).2⟩ + +theorem localAct_untouched {U : Type*} [CommGroup U] {v : Leaves k} + (hv : v∉cycleQuartets P c) (z : U) (M : Leaves 2 → U) : localAct P c v z M=M := by + funext w + have hp : leaf k v w∉c.positive := by + intro he + apply hv + exact mem_image.mpr ⟨leaf k v w,he,quartetCut_label_leaf k v w⟩ + have hn : leaf k v w∉c.negative := by + intro he + have hh := negative_label_mem P c he + simp only [quartetCut_label_leaf] at hh + exact hv hh + simp [localAct,BalancedSelection.twist,hp,hn] + +end Ostmann.Tree.CycleQuartet + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartets.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartets.lean new file mode 100644 index 0000000000000000000000000000000000000000..ba7fc025a35db4f4928a367e52a6a4618424b01e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleQuartets.lean @@ -0,0 +1,40 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleCut +import OAI.NumberTheory.Ostmann.Tree.CycleWalk + +namespace OAI + +namespace Ostmann.Tree +open scoped BigOperators + +def quartetCut (d : ℕ) : Density.Cut (d+2) d := Density.Cut.ofLE (by omega) + +theorem exists_quartet_cycle {d b : ℕ} (P : LeafPartition (d+2) b) + (hb : 4*b ≤ 3*2^(d+2)) : + Nonempty (BalancedSelection P.label (quartetCut d).label) := by + apply exists_balanced_selection + have hr : 2^(d+2)=4*2^d := by rw [pow_add]; ring + simp only [Leaves,Fintype.card_fin,Fintype.card_fun,Fintype.card_bool] + omega + +theorem quartet_cycle_project {F : Type*} [Field F] {d b : ℕ} + (P : LeafPartition (d+2) b) + (c : BalancedSelection P.label (quartetCut d).label) + (z : Fˣ) (M : Leaves (d+2) → Fˣ) : + (quartetCut d).project (c.act z M) = (quartetCut d).project M := by + classical + funext v + rw [Density.Cut.project_eq_label_product,Density.Cut.project_eq_label_product] + exact c.right_product z M v + +theorem quartet_cycle_components {F : Type*} [Field F] {d b : ℕ} + (P : LeafPartition (d+2) b) + (c : BalancedSelection P.label (quartetCut d).label) + (z : Fˣ) (M : Leaves (d+2) → Fˣ) : + P.componentProduct (c.act z M) = P.componentProduct M := by + classical + funext v + exact c.left_product z M v + +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleSelection.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..6122c5552f4433f012b1f24d5991362e664d2054 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleSelection.lean @@ -0,0 +1,110 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.Tree + +structure BalancedSelection {E V W : Type*} [DecidableEq V] [DecidableEq W] + (left : E → V) (right : E → W) where + positive : Finset E + negative : Finset E + disjoint : Disjoint positive negative + nonempty : positive.Nonempty + left_balance : ∀ v, (positive.filter (fun e => left e=v)).card = + (negative.filter (fun e => left e=v)).card + left_bound : ∀ v, (positive.filter (fun e => left e=v)).card ≤ 1 + right_balance : ∀ w, (positive.filter (fun e => right e=w)).card = + (negative.filter (fun e => right e=w)).card + right_bound : ∀ w, (positive.filter (fun e => right e=w)).card ≤ 1 + +namespace BalancedSelection +variable {E V W : Type*} [DecidableEq E] [DecidableEq V] [DecidableEq W] + {left : E → V} {right : E → W} + +noncomputable def of_parallel (e f : E) (hef : e ≠ f) + (hl : left e=left f) (hr : right e=right f) : BalancedSelection left right where + positive := {e} + negative := {f} + disjoint := by simpa using hef + nonempty := Finset.singleton_nonempty e + left_balance := by + intro v + change (Finset.filter (fun a => left a=v) {e}).card = + (Finset.filter (fun a => left a=v) {f}).card + simp only [Finset.filter_singleton,hl] + split_ifs <;> simp + left_bound := by + intro v + exact (Finset.card_le_card (Finset.filter_subset _ {e})).trans (by simp) + right_balance := by + intro w + change (Finset.filter (fun a => right a=w) {e}).card = + (Finset.filter (fun a => right a=w) {f}).card + simp only [Finset.filter_singleton,hr] + split_ifs <;> simp + right_bound := by + intro w + exact (Finset.card_le_card (Finset.filter_subset _ {e})).trans (by simp) + +variable {U : Type*} [CommGroup U] + +noncomputable def twist (c : BalancedSelection left right) (z : U) (e : E) : U := + (if e ∈ c.positive then z else 1)*(if e ∈ c.negative then z⁻¹ else 1) +noncomputable def act (c : BalancedSelection left right) (z : U) (M : E → U) : E → U := + fun e => c.twist z e*M e + +theorem twist_mul (c : BalancedSelection left right) (z w : U) (e : E) : + c.twist (z*w) e = c.twist z e*c.twist w e := by + unfold twist + split_ifs <;> simp [mul_inv_rev, mul_comm, mul_assoc] + +@[simp] theorem act_one (c : BalancedSelection left right) (M : E → U) : c.act 1 M=M := by + funext e + simp [act,twist] + +theorem act_mul (c : BalancedSelection left right) (z w : U) (M : E → U) : + c.act (z*w) M=c.act z (c.act w M) := by + funext e + simp only [act,twist_mul,mul_assoc] + +theorem act_positive (c : BalancedSelection left right) (z : U) (M : E → U) + {e : E} (he : e ∈ c.positive) : c.act z M e=z*M e := by + have hn : e ∉ c.negative := fun hn => Finset.disjoint_left.mp c.disjoint he hn + simp [act,twist,he,hn] + +theorem act_negative (c : BalancedSelection left right) (z : U) (M : E → U) + {e : E} (he : e ∈ c.negative) : c.act z M e=z⁻¹*M e := by + have hp : e ∉ c.positive := fun hp => Finset.disjoint_left.mp c.disjoint hp he + simp [act,twist,he,hp] + +theorem prod_act (c : BalancedSelection left right) (z : U) (M : E → U) + (s : Finset E) (hbal : (s.filter (fun e => e ∈ c.positive)).card = + (s.filter (fun e => e ∈ c.negative)).card) : + ∏ e ∈ s, c.act z M e = ∏ e ∈ s, M e := by + simp only [act, twist, Finset.prod_mul_distrib] + rw [Finset.prod_ite, Finset.prod_ite] + simp only [Finset.prod_const, one_pow, mul_one] + rw [hbal, inv_pow, mul_inv_cancel, one_mul] + +theorem left_product [Fintype E] (c : BalancedSelection left right) (z : U) (M : E → U) + (v : V) : (∏ e with left e=v, c.act z M e) = ∏ e with left e=v, M e := by + apply c.prod_act + have hp : (Finset.univ.filter (fun e => left e=v)).filter (fun e => e∈c.positive) = + c.positive.filter (fun e => left e=v) := by ext e; simp [and_comm] + have hn : (Finset.univ.filter (fun e => left e=v)).filter (fun e => e∈c.negative) = + c.negative.filter (fun e => left e=v) := by ext e; simp [and_comm] + rw [hp,hn,c.left_balance] + +theorem right_product [Fintype E] (c : BalancedSelection left right) (z : U) (M : E → U) + (v : W) : (∏ e with right e=v, c.act z M e) = ∏ e with right e=v, M e := by + apply c.prod_act + have hp : (Finset.univ.filter (fun e => right e=v)).filter (fun e => e∈c.positive) = + c.positive.filter (fun e => right e=v) := by ext e; simp [and_comm] + have hn : (Finset.univ.filter (fun e => right e=v)).filter (fun e => e∈c.negative) = + c.negative.filter (fun e => right e=v) := by ext e; simp [and_comm] + rw [hp,hn,c.right_balance] + +end BalancedSelection +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleSigned.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleSigned.lean new file mode 100644 index 0000000000000000000000000000000000000000..2365a2fc08183dacb014954d4286402c71537c7b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleSigned.lean @@ -0,0 +1,148 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleSelection + +namespace OAI + +namespace Ostmann.Tree +open Finset + +structure CyclicIncidence {E V W I : Type*} (left : E → V) (right : E → W) where + next : Equiv.Perm I + vertex : I → V ⊕ W + vertex_injective : Function.Injective vertex + edge : I → E + edge_injective : Function.Injective edge + incidence : ∀ i, + (vertex i=Sum.inl (left (edge i)) ∧ vertex (next i)=Sum.inr (right (edge i))) ∨ + (vertex i=Sum.inr (right (edge i)) ∧ vertex (next i)=Sum.inl (left (edge i))) + +namespace CyclicIncidence +variable {E V W I : Type*} [Fintype I] [Nonempty I] + [DecidableEq E] [DecidableEq V] [DecidableEq W] + {left : E → V} {right : E → W} +variable (c : CyclicIncidence (I := I) left right) + +noncomputable def positive : Finset E := + (univ.filter (fun i => (c.vertex i).isLeft)).image c.edge +noncomputable def negative : Finset E := + (univ.filter (fun i => (c.vertex i).isRight)).image c.edge + +omit [Fintype I] [Nonempty I] [DecidableEq E] [DecidableEq V] [DecidableEq W] in +lemma left_positive_iff (i : I) (v : V) : + ((c.vertex i).isLeft ∧ left (c.edge i)=v) ↔ c.vertex i=Sum.inl v := by + rcases c.incidence i with h | h <;> simp [h.1] +omit [Fintype I] [Nonempty I] [DecidableEq E] [DecidableEq V] [DecidableEq W] in +lemma left_negative_iff (i : I) (v : V) : + ((c.vertex i).isRight ∧ left (c.edge i)=v) ↔ c.vertex (c.next i)=Sum.inl v := by + rcases c.incidence i with h | h <;> simp [h.1,h.2] +omit [Fintype I] [Nonempty I] [DecidableEq E] [DecidableEq V] [DecidableEq W] in +lemma right_positive_iff (i : I) (w : W) : + ((c.vertex i).isLeft ∧ right (c.edge i)=w) ↔ c.vertex (c.next i)=Sum.inr w := by + rcases c.incidence i with h | h <;> simp [h.1,h.2] +omit [Fintype I] [Nonempty I] [DecidableEq E] [DecidableEq V] [DecidableEq W] in +lemma right_negative_iff (i : I) (w : W) : + ((c.vertex i).isRight ∧ right (c.edge i)=w) ↔ c.vertex i=Sum.inr w := by + rcases c.incidence i with h | h <;> simp [h.1] + +omit [Fintype I] [Nonempty I] [DecidableEq V] [DecidableEq W] in +lemma filter_image_card (s : Finset I) (p : E → Prop) [DecidablePred p] : + ((s.image c.edge).filter p).card = (s.filter (fun i => p (c.edge i))).card := by + rw [filter_image, card_image_of_injective _ c.edge_injective] + +omit [Nonempty I] in +lemma left_positive_card (v : V) : + (c.positive.filter (fun e => left e=v)).card = + (univ.filter (fun i => c.vertex i=Sum.inl v)).card := by + classical + rw [positive,c.filter_image_card,filter_filter] + congr 1 + ext i + simp only [mem_filter,mem_univ,true_and,c.left_positive_iff] + +omit [Nonempty I] in +lemma left_negative_card (v : V) : + (c.negative.filter (fun e => left e=v)).card = + (univ.filter (fun i => c.vertex (c.next i)=Sum.inl v)).card := by + classical + rw [negative,c.filter_image_card,filter_filter] + congr 1 + ext i + simp only [mem_filter,mem_univ,true_and,c.left_negative_iff] + +omit [Nonempty I] in +lemma right_positive_card (w : W) : + (c.positive.filter (fun e => right e=w)).card = + (univ.filter (fun i => c.vertex (c.next i)=Sum.inr w)).card := by + classical + rw [positive,c.filter_image_card,filter_filter] + congr 1 + ext i + simp only [mem_filter,mem_univ,true_and,c.right_positive_iff] + +omit [Nonempty I] in +lemma right_negative_card (w : W) : + (c.negative.filter (fun e => right e=w)).card = + (univ.filter (fun i => c.vertex i=Sum.inr w)).card := by + classical + rw [negative,c.filter_image_card,filter_filter] + congr 1 + ext i + simp only [mem_filter,mem_univ,true_and,c.right_negative_iff] + +omit [Nonempty I] [DecidableEq E] in +lemma next_vertex_card (v : V ⊕ W) : + (univ.filter (fun i => c.vertex (c.next i)=v)).card = + (univ.filter (fun i => c.vertex i=v)).card := by + classical + apply card_bij (fun i _ => c.next i) + · intro i hi + simpa only [mem_filter,mem_univ,true_and] using hi + · intro i hi j hj he + exact c.next.injective he + · intro j hj + refine ⟨c.next.symm j, ?_, by simp⟩ + simpa only [mem_filter,mem_univ,true_and,Equiv.apply_symm_apply] using hj + +omit [Nonempty I] [DecidableEq E] in +lemma vertex_fiber_card (v : V ⊕ W) : + (univ.filter (fun i => c.vertex i=v)).card ≤ 1 := by + classical + apply card_le_one.mpr + intro i hi j hj + exact c.vertex_injective ((mem_filter.mp hi).2.trans (mem_filter.mp hj).2.symm) + +omit [Nonempty I] [DecidableEq V] [DecidableEq W] in +lemma signs_disjoint : Disjoint c.positive c.negative := by + classical + apply disjoint_left.mpr + intro e he hn + obtain ⟨i,hi,hie⟩ := mem_image.mp he + obtain ⟨j,hj,hje⟩ := mem_image.mp hn + have hij := c.edge_injective (hie.trans hje.symm) + subst j + have hleft := (mem_filter.mp hi).2 + have hright := (mem_filter.mp hj).2 + cases h : c.vertex i <;> simp [h] at hleft hright + +omit [DecidableEq V] [DecidableEq W] in +lemma positive_nonempty : c.positive.Nonempty := by + classical + let i : I := Classical.choice (inferInstance : Nonempty I) + rcases c.incidence i with h | h + · exact ⟨c.edge i,mem_image.mpr ⟨i,mem_filter.mpr ⟨mem_univ _,by simp [h.1]⟩,rfl⟩⟩ + · exact ⟨c.edge (c.next i),mem_image.mpr + ⟨c.next i,mem_filter.mpr ⟨mem_univ _,by simp [h.2]⟩,rfl⟩⟩ + +noncomputable def toBalanced : BalancedSelection left right where + positive := c.positive + negative := c.negative + disjoint := c.signs_disjoint + nonempty := c.positive_nonempty + left_balance := by intro v; rw [c.left_positive_card,c.left_negative_card,c.next_vertex_card] + left_bound := by intro v; rw [c.left_positive_card]; exact c.vertex_fiber_card _ + right_balance := by intro w; rw [c.right_positive_card,c.right_negative_card,c.next_vertex_card] + right_bound := by intro w; rw [c.right_positive_card,c.next_vertex_card]; exact c.vertex_fiber_card _ + +end CyclicIncidence +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/CycleWalk.lean b/lean/OAI/NumberTheory/Ostmann/Tree/CycleWalk.lean new file mode 100644 index 0000000000000000000000000000000000000000..f60d06e7d033cfeac88e2994d053e7646ad8e29c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/CycleWalk.lean @@ -0,0 +1,115 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleExistence +import OAI.NumberTheory.Ostmann.Tree.CycleSigned + +namespace OAI + +namespace Ostmann.Tree + +lemma cyclic_edge_injective {E V W I : Type*} (left : E → V) (right : E → W) + (next : Equiv.Perm I) (vertex : I → V ⊕ W) (edge : I → E) + (hv : Function.Injective vertex) (hn : ∀ i, next (next i) ≠ i) + (hi : ∀ i, + (vertex i=Sum.inl (left (edge i)) ∧ vertex (next i)=Sum.inr (right (edge i))) ∨ + (vertex i=Sum.inr (right (edge i)) ∧ vertex (next i)=Sum.inl (left (edge i)))) : + Function.Injective edge := by + intro i j he + rcases hi i with h | h <;> rcases hi j with h' | h' + · apply hv + rw [h.1,h'.1,he] + · have hij : i=next j := hv (by rw [h.1,h'.2,he]) + have hji : next i=j := hv (by rw [h.2,h'.1,he]) + exact False.elim (hn i (by rw [hji,← hij])) + · have hij : i=next j := hv (by rw [h.1,h'.2,he]) + have hji : next i=j := hv (by rw [h.2,h'.1,he]) + exact False.elim (hn i (by rw [hji,← hij])) + · apply hv + rw [h.1,h'.1,he] + +lemma zmod_add_one_twice_ne {n : ℕ} (hn : 3 ≤ n) (i : ZMod n) : + i+1+1 ≠ i := by + intro he + have hz : (2:ZMod n)=0 := by linear_combination he + have hv := congrArg ZMod.val hz + rw [ZMod.val_two_eq_two_mod,Nat.mod_eq_of_lt (by omega : 2 p.getVert i.val + have hv : Function.Injective vertex := by + intro i j h + apply ZMod.val_injective p.length + apply hp.getVert_injOn' _ _ h + · have := ZMod.val_lt i + simp only [Set.mem_ofPred_eq] + omega + · have := ZMod.val_lt j + simp only [Set.mem_ofPred_eq] + omega + have hex : ∀ i : ZMod p.length, ∃ e : E, + (vertex i=Sum.inl (left e) ∧ vertex (i+1)=Sum.inr (right e)) ∨ + (vertex i=Sum.inr (right e) ∧ vertex (i+1)=Sum.inl (left e)) := by + intro i + have ha := cycle_adj_next p hp i + change (incidenceGraph left right).Adj (vertex i) (vertex (i+1)) at ha + cases h : vertex i with + | inl a => + cases h' : vertex (i+1) with + | inl b => + rw [h,h'] at ha + exact False.elim ha + | inr b => + rw [h,h'] at ha + obtain ⟨e,he,he'⟩ : ∃e,left e=a ∧ right e=b := ha + exact ⟨e,Or.inl ⟨by simp [he],by simp [he']⟩⟩ + | inr b => + cases h' : vertex (i+1) with + | inl a => + rw [h,h'] at ha + obtain ⟨e,he,he'⟩ : ∃e,left e=a ∧ right e=b := ha + exact ⟨e,Or.inr ⟨by simp [he'],by simp [he]⟩⟩ + | inr a => + rw [h,h'] at ha + exact False.elim ha + let edge := fun i => Classical.choose (hex i) + have hi := fun i => Classical.choose_spec (hex i) + refine ⟨Equiv.addRight 1,vertex,hv,edge,?_,hi⟩ + apply cyclic_edge_injective left right (Equiv.addRight 1) vertex edge hv + · exact zmod_add_one_twice_ne hp.three_le_length + · exact hi + +theorem exists_balanced_selection {E V W : Type*} + [Fintype E] [Fintype V] [Fintype W] [Nonempty E] + [DecidableEq E] [DecidableEq V] [DecidableEq W] + (left : E → V) (right : E → W) + (hcard : Fintype.card V+Fintype.card W ≤ Fintype.card E) : + Nonempty (BalancedSelection left right) := by + classical + rcases incidence_cycle_or_parallel left right hcard with h | ⟨v,p,hp⟩ + · obtain ⟨e,f,hef,hl,hr⟩ := h + exact ⟨BalancedSelection.of_parallel e f hef hl hr⟩ + · let : NeZero p.length := ⟨by have := hp.three_le_length; omega⟩ + exact ⟨(CyclicIncidence.ofWalk left right p hp).toBalanced⟩ + +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DeletedPairEnergy.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DeletedPairEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..8abfffcd8994812bf535682dd09aaafb41c0abe7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DeletedPairEnergy.lean @@ -0,0 +1,77 @@ +import OAI.NumberTheory.Ostmann.Tree.NonnegativeDifference + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +variable {p : ℕ} [Fact p.Prime] + +def deletedPairEnergy (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ : MulChar (ZMod p) ℂ) (d : ZMod p) : ℝ := + if d=0 then 0 else ‖pairSpectrum g χ ((σ:ZMod p)*d)‖^2 + +theorem deletedPairEnergy_nonneg (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ : MulChar (ZMod p) ℂ) (d : ZMod p) : 0≤deletedPairEnergy g σ χ d := by + unfold deletedPairEnergy + split_ifs <;> positivity + +theorem deletedPairEnergy_total (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ : MulChar (ZMod p) ℂ) : + (∑ d : ZMod p,deletedPairEnergy g σ χ d)≤(p:ℝ)*pairFourthMass g χ := by + have hp : (p:ℝ)≠0 := by exact_mod_cast (Fact.out : p.Prime).ne_zero + calc + _ ≤ ∑ d : ZMod p,‖pairSpectrum g χ ((σ:ZMod p)*d)‖^2 := by + apply Finset.sum_le_sum + intro d _ + unfold deletedPairEnergy + split_ifs + · exact sq_nonneg _ + · exact le_rfl + _ = _ := by + rw [pairFourthMass_eq_l2Sq,← l2Sq_unitMul (pairSpectrum g χ) σ] + unfold l2Sq + field_simp + +def pairSquareEnergy (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) (d : ZMod p) : ℝ := by + classical + exact ∑ χ : MulChar (ZMod p) ℂ with χ^2=ρ,deletedPairEnergy g σ χ d + +theorem pairSquareEnergy_nonneg (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) (d : ZMod p) : 0≤pairSquareEnergy g σ ρ d := by + classical + exact Finset.sum_nonneg (fun χ _ => deletedPairEnergy_nonneg g σ χ d) + +theorem pairSquareEnergy_total (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) : + (∑ d : ZMod p,pairSquareEnergy g σ ρ d) ≤ + (p:ℝ)*∑ χ : MulChar (ZMod p) ℂ with χ^2=ρ,pairFourthMass g χ := by + classical + unfold pairSquareEnergy + rw [Finset.sum_comm,Finset.mul_sum] + exact Finset.sum_le_sum (fun χ _ => deletedPairEnergy_total g σ χ) + +theorem pairFourthMass_square_fiber (g : ZMod p → ℂ) (ρ : MulChar (ZMod p) ℂ) + (hg0 : g 0=0) (hg : l2Sq g≤1) : + (∑ χ : MulChar (ZMod p) ℂ with χ^2=ρ,pairFourthMass g χ) ≤ + 2*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2*(correlationBound g:ℝ)^2 := by + classical + let B : ℝ := ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2*(correlationBound g:ℝ)^2 + have hB : 0≤B := by dsimp [B]; positivity + have hχ (χ : MulChar (ZMod p) ℂ) : pairFourthMass g χ≤B := by + exact (pairFourthMass_le g χ hg0).trans + ((mul_le_mul_of_nonneg_left hg hB).trans_eq (mul_one _)) + calc + _ ≤ ∑ χ : MulChar (ZMod p) ℂ with χ^2=ρ,B := Finset.sum_le_sum (fun χ _ => hχ χ) + _ ≤ 2*B := by + rw [Finset.sum_const,nsmul_eq_mul] + apply mul_le_mul_of_nonneg_right _ hB + exact_mod_cast character_square_fiber_card (Finset.univ.filter (fun χ : MulChar (ZMod p) ℂ => χ^2=ρ)) ρ + (fun χ hχ => (Finset.mem_filter.mp hχ).2) + _ = _ := by dsimp [B]; ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DensityAlgebra.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DensityAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..be2a69c206da3c48c92a343e9dcd67cf3a56d344 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DensityAlgebra.lean @@ -0,0 +1,81 @@ +import OAI.NumberTheory.Ostmann.Tree.DensityReconstruction + +namespace OAI + +namespace Ostmann.Tree.Density +noncomputable section +open scoped BigOperators +variable {F : Type*} [Field F] + +theorem split_difference (s sl sr D u Hl Hr : Fˣ) (p : F) + (hp : p ≠ 0) (he : p*((s : F)*u) = (sl : F)*Hr-(sr : F)*Hl) : + (sl : F)/((D : F)*p*u*Hl) - (sr : F)/((D : F)*p*u*Hr) = + (s : F)/((D : F)*Hl*Hr) := by + field_simp + linear_combination -he + +theorem child_rootArgument {d : ℕ} (L : Parameters F d) (D p X u a : Fˣ) + (M : Leaves d → Fˣ) : + (rootArgument L D p X (u*a) M : F) = + (L.frequency : F) / ((D : F)*p*u*(X*a*Parameters.leafProduct M)) := by + simp only [rootArgument, Units.val_div_eq_div_val, Units.val_mul] + congr 1 + ring + +theorem branch_rootArgument {d : ℕ} (s a b u D Xl Xr : Fˣ) + (L R : Parameters F d) (M : Leaves (d+1) → Fˣ) : + (rootArgument (.branch s a b u L R) D Xl Xr (a*b) M : F) = + (s : F) / ((D : F)*(Xl*a*Parameters.leafProduct (left M))* + (Xr*b*Parameters.leafProduct (right M))) := by + simp only [rootArgument, Parameters.frequency, leafProduct_split, + Units.val_div_eq_div_val, Units.val_mul] + congr 1 + ring + +theorem rootArgument_difference {d : ℕ} (s a b u D Xl Xr : Fˣ) + (L R : Parameters F d) (M : Leaves (d+1) → Fˣ) + (hp : pivot s a b u L R Xl Xr M ≠ 0) : + (rootArgument L D (Units.mk0 _ hp) Xl (u*a) (left M) : F) - + (rootArgument R D (Units.mk0 _ hp) Xr (u*b) (right M) : F) = + (rootArgument (.branch s a b u L R) D Xl Xr (a*b) M : F) := by + rw [child_rootArgument, child_rootArgument, branch_rootArgument] + apply split_difference s L.frequency R.frequency D u + (Xl*a*Parameters.leafProduct (left M)) (Xr*b*Parameters.leafProduct (right M)) + _ hp + simp only [pivot] + exact div_mul_cancel₀ _ (mul_ne_zero (Units.ne_zero s) (Units.ne_zero u)) + +theorem reconstruct_difference {d : ℕ} (P : Parameters F d) + (hP : P.consistent) (D Xl Xr c : Fˣ) (hc : P.childConsistent c) + (M y : Leaves d → Fˣ) (h : reconstruct D P Xl Xr c M = some y) : + difference y = (rootArgument P D Xl Xr c M : F) := by + induction P generalizing D Xl Xr c with + | leaf s sign => + simp only [reconstruct] at h + rw [← Option.some.inj h] + rfl + | @branch d s a b u L R ihl ihr => + obtain ⟨hL, hR, hLc, hRc⟩ := hP + obtain ⟨hp, hl, hr⟩ := reconstruct_branch_some s a b u D Xl Xr c L R M y h + have hleft := ihl hLc D (Units.mk0 _ hp) Xl (u*a) hL (left M) (left y) hl + have hright := ihr hRc D (Units.mk0 _ hp) Xr (u*b) hR (right M) (right y) hr + change a*b=c at hc + subst c + exact (congrArg₂ (· - ·) hleft hright).trans + (rootArgument_difference s a b u D Xl Xr L R M hp) + +theorem leafProduct_eq_of_reconstruct_eq {d : ℕ} (P : Parameters F d) + (hP : P.consistent) (D Xl Xr c : Fˣ) (hc : P.childConsistent c) + (M N y : Leaves d → Fˣ) + (hM : reconstruct D P Xl Xr c M = some y) + (hN : reconstruct D P Xl Xr c N = some y) : + Parameters.leafProduct M = Parameters.leafProduct N := by + have he := (reconstruct_difference P hP D Xl Xr c hc M y hM).symm.trans + (reconstruct_difference P hP D Xl Xr c hc N y hN) + have hu : rootArgument P D Xl Xr c M = rootArgument P D Xl Xr c N := Units.ext he + simpa only [rootArgument, div_right_inj, mul_right_inj] using hu + +end +end Ostmann.Tree.Density + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DensityCut.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DensityCut.lean new file mode 100644 index 0000000000000000000000000000000000000000..f5786d025ab3cfcdbcc762a5a7b42a1f613093cd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DensityCut.lean @@ -0,0 +1,116 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.GroupHaarImage +import OAI.NumberTheory.Ostmann.Tree.DensityAlgebra + +namespace OAI + +namespace Ostmann.Tree.Density +noncomputable section +open scoped BigOperators +variable {F : Type*} [Field F] + +inductive Cut : ℕ → ℕ → Type + | stop (d : ℕ) : Cut d 0 + | split {d k : ℕ} (left right : Cut d k) : Cut (d+1) (k+1) + +namespace Cut + +def ofLE {d k : ℕ} (h : k ≤ d) : Cut d k := by + induction k generalizing d with + | zero => exact .stop d + | succ k ih => + cases d with + | zero => omega + | succ d => exact .split (ih (by omega)) (ih (by omega)) + +def project : {d k : ℕ} → Cut d k → (Leaves d → Fˣ) → (Leaves k → Fˣ) + | _, _, .stop _, M => fun _ => Parameters.leafProduct M + | _, _, .split L R, M => join (project L (left M)) (project R (right M)) + +def parameters : {d k : ℕ} → Cut d k → Parameters F d → Parameters F k + | _, _, .stop _, P => .leaf P.frequency false + | _, _, .split L R, .branch s a b u PL PR => + .branch s a b u (parameters L PL) (parameters R PR) + +@[simp] theorem parameters_frequency {d k : ℕ} (C : Cut d k) (P : Parameters F d) : + (parameters C P).frequency = P.frequency := by + cases C with + | stop => rfl + | split L R => cases P; rfl + +theorem parameters_childConsistent {d k : ℕ} (C : Cut d k) (P : Parameters F d) + (c : Fˣ) (h : P.childConsistent c) : (parameters C P).childConsistent c := by + cases C with + | stop => trivial + | split L R => cases P; exact h + +theorem parameters_consistent {d k : ℕ} (C : Cut d k) (P : Parameters F d) + (h : P.consistent) : (parameters C P).consistent := by + induction C with + | stop => trivial + | split L R ihl ihr => + cases P with + | branch s a b u PL PR => + exact ⟨parameters_childConsistent L PL (u*a) h.1, + parameters_childConsistent R PR (u*b) h.2.1, ihl PL h.2.2.1, ihr PR h.2.2.2⟩ + +theorem project_product {d k : ℕ} (C : Cut d k) (M : Leaves d → Fˣ) : + Parameters.leafProduct (project C M) = Parameters.leafProduct M := by + induction C with + | stop => simp [project, Parameters.leafProduct] + | split L R ihl ihr => + rw [project, leafProduct_split, left_join, right_join, ihl, ihr, leafProduct_split] + +theorem project_one {d k : ℕ} (C : Cut d k) : project C (1 : Leaves d → Fˣ) = 1 := by + induction C with + | stop => funext v; simp [project, Parameters.leafProduct] + | split L R ihl ihr => + change join (project L 1) (project R 1) = 1 + rw [ihl, ihr] + funext v + simp [join] + +theorem project_mul {d k : ℕ} (C : Cut d k) (M N : Leaves d → Fˣ) : + project C (M*N) = project C M * project C N := by + induction C with + | stop => + funext v + simp [project, Parameters.leafProduct, Finset.prod_mul_distrib] + | split L R ihl ihr => + change join (project L (left M * left N)) (project R (right M * right N)) = _ + rw [ihl, ihr] + funext v + cases hv : v 0 <;> simp [project, join, Pi.mul_apply, hv] + +def projectHom {d k : ℕ} (C : Cut d k) : (Leaves d → Fˣ) →* (Leaves k → Fˣ) where + toFun := project C + map_one' := project_one C + map_mul' := project_mul C + +theorem project_surjective {d k : ℕ} (C : Cut d k) : Function.Surjective (project (F:=F) C) := by + classical + induction C with + | stop d => + intro y + let v : Leaves d := fun _ => false + refine ⟨Pi.mulSingle v (y (fun i => Fin.elim0 i)), ?_⟩ + funext w + have hw : w = (fun i : Fin 0 => Fin.elim0 i) := Subsingleton.elim _ _ + simp [project, Parameters.leafProduct, hw] + | split L R ihl ihr => + intro y + obtain ⟨Ml, hMl⟩ := ihl (left y) + obtain ⟨Mr, hMr⟩ := ihr (right y) + refine ⟨join Ml Mr, ?_⟩ + simp only [project, left_join, right_join, hMl, hMr, join_left_right] + +theorem project_pivot {d k : ℕ} (L R : Cut d k) (s a b u Xl Xr : Fˣ) + (PL PR : Parameters F d) (M : Leaves (d+1) → Fˣ) : + pivot s a b u (parameters L PL) (parameters R PR) Xl Xr + (project (.split L R) M) = pivot s a b u PL PR Xl Xr M := by + simp only [pivot, project, left_join, right_join, parameters_frequency, project_product] + +end Cut +end +end Ostmann.Tree.Density + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DensityDomination.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DensityDomination.lean new file mode 100644 index 0000000000000000000000000000000000000000..9738cf05d1e60157a613baaf096df81daff86bde --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DensityDomination.lean @@ -0,0 +1,91 @@ +import OAI.NumberTheory.Ostmann.Tree.DensityFibers +import OAI.NumberTheory.Ostmann.Tree.DensityValues + +namespace OAI + +namespace Ostmann.Tree.Density +noncomputable section +open scoped BigOperators + +def average {A : Type*} [Fintype A] (f : A → ℝ) : ℝ := + (Fintype.card A : ℝ)⁻¹ * ∑ x, f x + +def integrate {A : Type*} (f : A → ℝ) (x : Option A) : ℝ := + match x with | none => 0 | some y => f y + +theorem sum_integrate_le {A B : Type*} [Fintype A] [Fintype B] [DecidableEq B] + (f : A → Option B) (C : ℕ) (hC : ∀ y, (Finset.univ.filter (fun x => f x = some y)).card ≤ C) + (H : B → ℝ) (hH : ∀ y, 0 ≤ H y) : + (∑ x, integrate H (f x)) ≤ (C : ℝ) * ∑ y, H y := by + classical + have hp (x : A) : integrate H (f x) = ∑ y, if f x = some y then H y else 0 := by + cases f x <;> simp [integrate] + simp_rw [hp] + rw [Finset.sum_comm] + calc + (∑ y, ∑ x, if f x = some y then H y else 0) = + ∑ y, ((Finset.univ.filter (fun x => f x = some y)).card : ℝ)*H y := by + simp only [← Finset.sum_filter, Finset.sum_const, nsmul_eq_mul] + _ ≤ ∑ y, (C : ℝ)*H y := by + apply Finset.sum_le_sum + intro y _ + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hC y) (hH y) + _ = _ := (Finset.mul_sum _ _ _).symm + +variable {F : Type*} [Field F] [Fintype F] +local instance : DecidableEq F := Classical.decEq F + +theorem reconstruct_domination {d : ℕ} (P : Parameters F d) (hP : P.consistent) + (D Xl Xr c : Fˣ) (hc : P.childConsistent c) + (H : (Leaves d → Fˣ) → ℝ) (hH : ∀ y, 0 ≤ H y) : + average (fun M => integrate H (reconstruct D P Xl Xr c M)) ≤ + (2^(2^d-1) : ℕ) * average H := by + have hf : ∀ y, (Finset.univ.filter + (fun M => reconstruct D P Xl Xr c M = some y)).card ≤ 2^(2^d-1) := by + intro y + apply reconstruct_fiber_card_bound P hP D Xl Xr c hc _ y + intro M hM + exact (Finset.mem_filter.mp hM).2 + unfold average + calc + _ ≤ (Fintype.card (Leaves d → Fˣ) : ℝ)⁻¹ * ((2^(2^d-1) : ℕ) * ∑ y, H y) := + mul_le_mul_of_nonneg_left (sum_integrate_le _ _ hf H hH) (inv_nonneg.mpr (Nat.cast_nonneg _)) + _ = _ := by ring + +omit [Fintype F] in +theorem diagram_fiber_card_bound {d : ℕ} (T : Diagram F d) + (S : Finset (Leaves d → Fˣ)) (y : Leaves d → Fˣ) + (hS : ∀ M ∈ S, diagramArguments T M = some y) : S.card ≤ 2^(2^d-1) := by + cases d with + | zero => + exact reconstruct_fiber_card_bound T.parameters T.consistent 1 1 1 1 + (by cases T.parameters; trivial) S y hS + | succ d => + exact reconstruct_fiber_card_bound T.parameters T.consistent T.denominator T.rootLeft T.rootRight + (rootCoefficient T.parameters) (rootCoefficient_consistent _) S y hS + +theorem diagram_domination {d : ℕ} (T : Diagram F d) + (H : (Leaves d → Fˣ) → ℝ) (hH : ∀ y, 0 ≤ H y) : + average (fun M => integrate H (diagramArguments T M)) ≤ + (2^(2^d-1) : ℕ) * average H := by + cases d with + | zero => + exact reconstruct_domination T.parameters T.consistent 1 1 1 1 + (by cases T.parameters; trivial) H hH + | succ d => + exact reconstruct_domination T.parameters T.consistent T.denominator T.rootLeft T.rootRight + (rootCoefficient T.parameters) (rootCoefficient_consistent _) H hH + +theorem average_weight (d : ℕ) (g : F → ℂ) : + average (weight (d:=d) g) = (average (fun u : Fˣ => ‖g u‖^2))^(2^d) := by + classical + have hc : Fintype.card (Leaves d) = 2^d := by simp [Leaves] + unfold average weight + rw [← Fintype.prod_sum (fun (_ : Leaves d) (u : Fˣ) => ‖g u‖^2)] + simp only [Finset.prod_const, Finset.card_univ, hc, Fintype.card_fun, Nat.cast_pow, + inv_pow, mul_pow] + +end +end Ostmann.Tree.Density + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DensityFibers.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DensityFibers.lean new file mode 100644 index 0000000000000000000000000000000000000000..4264d9e594c5fad38e246624b56e9ecb0a1446e6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DensityFibers.lean @@ -0,0 +1,99 @@ +import OAI.NumberTheory.Ostmann.Tree.DensitySplit + +namespace OAI + +namespace Ostmann.Tree.Density +noncomputable section +open scoped BigOperators +variable {F : Type*} [Field F] +local instance : DecidableEq F := Classical.decEq F + +def multiplicity : ℕ → ℕ + | 0 => 1 + | d+1 => 2 * multiplicity d ^ 2 + +theorem multiplicity_eq (d : ℕ) : multiplicity d = 2^(2^d-1) := by + induction d with + | zero => simp [multiplicity] + | succ d ih => + rw [multiplicity, ih, ← pow_mul] + have hp : 0 < 2^d := pow_pos (by decide) d + have he : (2^d-1)*2+1 = 2^(d+1)-1 := by rw [pow_succ]; omega + rw [← he, pow_succ, mul_comm] + +theorem card_le_child_images {d : ℕ} (S : Finset (Leaves (d+1) → Fˣ)) : + S.card ≤ (S.image left).card * (S.image right).card := by + classical + rw [← Finset.card_product] + apply le_trans (le_of_eq (Finset.card_image_of_injective S assignment_injective).symm) + apply Finset.card_le_card + intro x hx + obtain ⟨M, hM, rfl⟩ := Finset.mem_image.mp hx + exact Finset.mem_product.mpr ⟨Finset.mem_image_of_mem _ hM, Finset.mem_image_of_mem _ hM⟩ + +theorem reconstruct_fiber_card_le {d : ℕ} (P : Parameters F d) (hP : P.consistent) + (D Xl Xr c : Fˣ) (hc : P.childConsistent c) + (S : Finset (Leaves d → Fˣ)) (y : Leaves d → Fˣ) + (hS : ∀ M ∈ S, reconstruct D P Xl Xr c M = some y) : + S.card ≤ multiplicity d := by + classical + induction P generalizing D Xl Xr c with + | leaf s sign => + apply Finset.card_le_one.mpr + intro M hM N hN + have he := leafProduct_eq_of_reconstruct_eq (.leaf s sign) hP D Xl Xr c hc + M N y (hS M hM) (hS N hN) + have hprod (V : Leaves 0 → Fˣ) : Parameters.leafProduct V = V (fun i => Fin.elim0 i) := by + simp only [Parameters.leafProduct, Finset.univ_unique, Finset.prod_singleton] + exact congrArg V (Subsingleton.elim _ _) + rw [hprod, hprod] at he + funext v + have hv : v = (fun i : Fin 0 => Fin.elim0 i) := Subsingleton.elim _ _ + simpa only [hv] using he + | @branch d s a b u L R ihl ihr => + let f : (Leaves (d+1) → Fˣ) → Fˣ := fun M => Parameters.leafProduct (left M) + have hfib : ∀ z ∈ S.image f, (S.filter (fun M => f M=z)).card ≤ multiplicity d ^ 2 := by + intro z hz + obtain ⟨N, hN, hNz⟩ := Finset.mem_image.mp hz + obtain ⟨hpN, hNl, hNr⟩ := reconstruct_branch_some s a b u D Xl Xr c L R N y (hS N hN) + let pN := Units.mk0 _ hpN + let S' := S.filter (fun M => f M=z) + have hchild : ∀ M ∈ S', + reconstruct D L pN Xl (u*a) (left M) = some (left y) ∧ + reconstruct D R pN Xr (u*b) (right M) = some (right y) := by + intro M hM + obtain ⟨hMS, hMz⟩ := Finset.mem_filter.mp hM + obtain ⟨hpM, hMl, hMr⟩ := reconstruct_branch_some s a b u D Xl Xr c L R M y (hS M hMS) + have he := pivot_eq_of_left_product_eq s a b u D Xl Xr c L R hP hc M N y + (hS M hMS) (hS N hN) (hMz.trans hNz.symm) + have hp : Units.mk0 _ hpM = pN := Units.ext he + exact ⟨hp ▸ hMl, hp ▸ hMr⟩ + have hl : (S'.image left).card ≤ multiplicity d := by + apply ihl hP.2.2.1 D pN Xl (u*a) hP.1 (S'.image left) (left y) + intro V hV + obtain ⟨M, hM, rfl⟩ := Finset.mem_image.mp hV + exact (hchild M hM).1 + have hr : (S'.image right).card ≤ multiplicity d := by + apply ihr hP.2.2.2 D pN Xr (u*b) hP.2.1 (S'.image right) (right y) + intro V hV + obtain ⟨M, hM, rfl⟩ := Finset.mem_image.mp hV + exact (hchild M hM).2 + exact (card_le_child_images S').trans (by simpa only [pow_two] using Nat.mul_le_mul hl hr) + calc + S.card ≤ multiplicity d ^ 2 * (S.image f).card := Finset.card_le_mul_card_image S _ hfib + _ ≤ multiplicity d ^ 2 * 2 := Nat.mul_le_mul_left _ + (left_product_image_card_le_two s a b u D Xl Xr c L R hP hc S y hS) + _ = multiplicity (d+1) := by simp only [multiplicity, mul_comm] + +theorem reconstruct_fiber_card_bound {d : ℕ} (P : Parameters F d) (hP : P.consistent) + (D Xl Xr c : Fˣ) (hc : P.childConsistent c) + (S : Finset (Leaves d → Fˣ)) (y : Leaves d → Fˣ) + (hS : ∀ M ∈ S, reconstruct D P Xl Xr c M = some y) : + S.card ≤ 2^(2^d-1) := by + rw [← multiplicity_eq] + exact reconstruct_fiber_card_le P hP D Xl Xr c hc S y hS + +end +end Ostmann.Tree.Density + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DensityHorizontal.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DensityHorizontal.lean new file mode 100644 index 0000000000000000000000000000000000000000..3cd3a968530fe754116bfbe0f2cec568c92498d0 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DensityHorizontal.lean @@ -0,0 +1,83 @@ +import OAI.NumberTheory.Ostmann.Tree.DensityCut +import OAI.NumberTheory.Ostmann.Tree.DensityDomination + +namespace OAI + +namespace Ostmann.Tree.Density +noncomputable section +open scoped BigOperators + +theorem average_surjective {G H : Type*} [Group G] [Group H] [Fintype G] [Fintype H] + (f : G →* H) (hf : Function.Surjective f) (w : H → ℝ) : + average (fun x => w (f x)) = average w := by + have he := Ostmann.Arithmetic.GroupHaarImage.average_surjective f hf (fun y => (w y : ℂ)) + apply Complex.ofReal_injective + simpa only [average, Ostmann.Arithmetic.ResidueHaar.average, + Complex.ofReal_mul, Complex.ofReal_inv, Complex.ofReal_sum, Complex.ofReal_natCast] using he + +variable {F : Type*} [Field F] +local instance : DecidableEq F := Classical.decEq F + +namespace Cut + +def arguments {d k : ℕ} (C : Cut d k) (P : Parameters F d) (D Xl Xr c : Fˣ) + (M : Leaves d → Fˣ) : Option (Leaves k → Fˣ) := + reconstruct D (parameters C P) Xl Xr c (project C M) + +theorem arguments_stop {d : ℕ} (P : Parameters F d) (D Xl Xr c : Fˣ) + (M : Leaves d → Fˣ) : + arguments (.stop d) P D Xl Xr c M = some (fun _ => rootArgument P D Xl Xr c M) := by + simp only [arguments, parameters, reconstruct, rootArgument, + Parameters.frequency, project_product] + +theorem arguments_split {d k : ℕ} (L R : Cut d k) (s a b u D Xl Xr c : Fˣ) + (PL PR : Parameters F d) (M : Leaves (d+1) → Fˣ) : + arguments (.split L R) (.branch s a b u PL PR) D Xl Xr c M = + if hp : pivot s a b u PL PR Xl Xr M = 0 then none else + match arguments L PL D (Units.mk0 _ hp) Xl (u*a) (left M), + arguments R PR D (Units.mk0 _ hp) Xr (u*b) (right M) with + | some yl, some yr => some (join yl yr) + | _, _ => none := by + classical + simp only [arguments, parameters, reconstruct, project, left_join, right_join, + pivot, parameters_frequency, project_product] + rfl + +variable [Fintype F] + +theorem horizontal_domination {d k : ℕ} (C : Cut d k) (P : Parameters F d) + (hP : P.consistent) (D Xl Xr c : Fˣ) (hc : P.childConsistent c) + (H : (Leaves k → Fˣ) → ℝ) (hH : ∀ y, 0 ≤ H y) : + average (fun M => integrate H (arguments C P D Xl Xr c M)) ≤ + (2^(2^k-1) : ℕ) * average H := by + have he := average_surjective (projectHom C) (project_surjective C) + (fun N => integrate H (reconstruct D (parameters C P) Xl Xr c N)) + change average (fun M => integrate H (arguments C P D Xl Xr c M)) = _ at he + rw [he] + exact reconstruct_domination (parameters C P) (parameters_consistent C P hP) + D Xl Xr c (parameters_childConsistent C P c hc) H hH +end Cut + +def diagramLevelArguments {d k : ℕ} (C : Cut d k) (T : Diagram F d) + (M : Leaves d → Fˣ) : Option (Leaves k → Fˣ) := + match d, T with + | 0, T => C.arguments T.parameters 1 1 1 1 M + | _+1, T => C.arguments T.parameters T.denominator T.rootLeft T.rootRight + (rootCoefficient T.parameters) M + +theorem diagram_horizontal_domination [Fintype F] {d k : ℕ} (C : Cut d k) + (T : Diagram F d) (H : (Leaves k → Fˣ) → ℝ) (hH : ∀ y, 0 ≤ H y) : + average (fun M => integrate H (diagramLevelArguments C T M)) ≤ + (2^(2^k-1) : ℕ) * average H := by + cases d with + | zero => + exact C.horizontal_domination T.parameters T.consistent 1 1 1 1 + (by cases T.parameters; trivial) H hH + | succ d => + exact C.horizontal_domination T.parameters T.consistent T.denominator T.rootLeft T.rootRight + (rootCoefficient T.parameters) (rootCoefficient_consistent _) H hH + +end +end Ostmann.Tree.Density + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DensityL2.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DensityL2.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6623bf8e5d7ec2e686e78fcb2878e29d4ed97a6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DensityL2.lean @@ -0,0 +1,89 @@ +import OAI.NumberTheory.Ostmann.Tree.DensityDomination +import OAI.NumberTheory.Ostmann.Tree.UnitSums + +namespace OAI + +namespace Ostmann.Tree.Density +noncomputable section +open scoped BigOperators +local instance {F : Type*} [Field F] : DecidableEq F := Classical.decEq F +variable {p : ℕ} [Fact p.Prime] + +theorem unit_second_moment_le (hp : 3 ≤ p) (g : ZMod p → ℂ) + (hg : Ostmann.FiniteField.l2Sq g ≤ 1) : + average (fun u : (ZMod p)ˣ => ‖g u‖^2) ≤ 3/2 := by + have hp0 : (0:ℝ) < p := by exact_mod_cast (lt_of_lt_of_le (by decide : 0<3) hp) + have hs : (∑ x, ‖g x‖^2) ≤ (p : ℝ) := by + calc + _ = (p : ℝ) * Ostmann.FiniteField.l2Sq g := by + unfold Ostmann.FiniteField.l2Sq + rw [← mul_assoc, mul_inv_cancel₀ hp0.ne', one_mul] + _ ≤ (p : ℝ) * 1 := mul_le_mul_of_nonneg_left hg hp0.le + _ = _ := mul_one _ + have hu := (Ostmann.FiniteField.sum_units_le (fun x : ZMod p => ‖g x‖^2) + (fun x => sq_nonneg _)).trans hs + have hcard : (Fintype.card (ZMod p)ˣ : ℝ) = (p : ℝ)-1 := by + rw [ZMod.card_units, Nat.cast_sub (by omega), Nat.cast_one] + unfold average + rw [hcard] + have hp3 : (3:ℝ) ≤ p := by exact_mod_cast hp + have hden : 0 < (p:ℝ)-1 := by linarith + calc + _ ≤ ((p:ℝ)-1)⁻¹ * p := mul_le_mul_of_nonneg_left hu (inv_nonneg.mpr hden.le) + _ ≤ 3/2 := by rw [inv_mul_eq_div]; apply (div_le_iff₀ hden).mpr; linarith + +theorem diagram_average_norm_sq {F : Type*} [Field F] [Fintype F] + {d : ℕ} (T : Diagram F d) (g : F → ℂ) : + average (fun M => ‖T.value g M‖^2) = + average (fun M => integrate (weight g) (diagramArguments T M)) := by + congr 1 + funext M + rw [diagram_value_norm_sq] + cases diagramArguments T M <;> rfl + +theorem diagram_moment_domination {F : Type*} [Field F] [Fintype F] + {d : ℕ} (T : Diagram F d) (g : F → ℂ) : + average (fun M => ‖T.value g M‖^2) ≤ + ((2^(2^d-1) : ℕ) : ℝ) * (average (fun u : Fˣ => ‖g u‖^2))^(2^d) := by + rw [diagram_average_norm_sq] + have hweight : ∀ y : Leaves d → Fˣ, 0 ≤ weight g y := by + intro y + exact Finset.prod_nonneg (fun _ _ => sq_nonneg _) + have hdom := diagram_domination T (weight g) hweight + rw [average_weight] at hdom + exact hdom + +theorem density_power_bound (d : ℕ) (a : ℝ) (ha0 : 0 ≤ a) (ha : a ≤ 3/2) : + ((2^(2^d-1) : ℕ) : ℝ) * a^(2^d) ≤ (3:ℝ)^(2^d) := by + have hmult : ((2^(2^d-1) : ℕ) : ℝ) ≤ (2:ℝ)^(2^d) := by + norm_cast + exact Nat.pow_le_pow_right (by decide : 0<2) (Nat.sub_le _ _) + calc + _ ≤ (2:ℝ)^(2^d) * (3/2)^(2^d) := + mul_le_mul hmult (pow_le_pow_left₀ ha0 ha _) (pow_nonneg ha0 _) (by positivity) + _ = (3:ℝ)^(2^d) := by rw [← mul_pow]; norm_num + + +theorem diagram_l2_bound {d : ℕ} (T : Diagram (ZMod p) d) (hp : 3 ≤ p) + (g : ZMod p → ℂ) (hg : Ostmann.FiniteField.l2Sq g ≤ 1) : + average (fun M => ‖T.value g M‖^2) ≤ (3:ℝ)^(2^d) := by + have hu := unit_second_moment_le hp g hg + have hu0 : 0 ≤ average (fun u : (ZMod p)ˣ => ‖g u‖^2) := by + unfold average + positivity + have h₁ := diagram_moment_domination (F := ZMod p) (d := d) T g + have h₂ : ((2^(2^d-1) : ℕ) : ℝ) * + (average (fun u : (ZMod p)ˣ => ‖g u‖^2))^(2^d) ≤ (3:ℝ)^(2^d) := + density_power_bound d (average (fun u : (ZMod p)ˣ => ‖g u‖^2)) hu0 hu + have havg {A : Type} (i j : Fintype A) (f : A → ℝ) : + @average A i f = @average A j f := by + congr + exact Subsingleton.elim _ _ + simp only [havg _ (inferInstance : Fintype (Leaves d → (ZMod p)ˣ)), + havg _ (inferInstance : Fintype (ZMod p)ˣ)] at h₁ + exact le_trans h₁ h₂ + +end +end Ostmann.Tree.Density + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DensityReconstruction.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DensityReconstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..beaf844fd2057543dc46d7551cbde6933d4068f3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DensityReconstruction.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.Tree.Diagram + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F : Type*} [Field F] + +namespace Density + +def left {d : ℕ} {A : Type*} (M : Leaves (d+1) → A) : Leaves d → A := + fun v => M (Fin.cons false v) +def right {d : ℕ} {A : Type*} (M : Leaves (d+1) → A) : Leaves d → A := + fun v => M (Fin.cons true v) +def join {d : ℕ} {A : Type*} (L R : Leaves d → A) : Leaves (d+1) → A := + fun v => if v 0 then R (Fin.tail v) else L (Fin.tail v) + +@[simp] theorem left_join {d : ℕ} {A : Type*} (L R : Leaves d → A) : + left (join L R) = L := by funext v; simp [left, join] +@[simp] theorem right_join {d : ℕ} {A : Type*} (L R : Leaves d → A) : + right (join L R) = R := by funext v; simp [right, join] +@[simp] theorem join_left_right {d : ℕ} {A : Type*} (M : Leaves (d+1) → A) : + join (left M) (right M) = M := by + funext v + simp only [join, left, right] + have hv := Fin.cons_self_tail v + cases h : v 0 <;> rw [h] at hv <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> + exact congrArg M hv + +theorem assignment_injective {d : ℕ} {A : Type*} : + Function.Injective (fun M : Leaves (d+1) → A => (left M, right M)) := by + intro M N h + rw [← join_left_right M, ← join_left_right N, Prod.mk.inj h |>.1, Prod.mk.inj h |>.2] + +def pathEquiv (d : ℕ) : Bool × Leaves d ≃ Leaves (d+1) where + toFun v := Fin.cons v.1 v.2 + invFun v := (v 0, Fin.tail v) + left_inv v := by cases v; simp + right_inv v := Fin.cons_self_tail v + +theorem prod_split {d : ℕ} {A : Type*} [CommMonoid A] (M : Leaves (d+1) → A) : + (∏ v, M v) = (∏ v, left M v) * ∏ v, right M v := by + rw [← (pathEquiv d).prod_comp] + rw [Fintype.prod_prod_type] + simp [left, right, pathEquiv, mul_comm] + +theorem leafProduct_split {d : ℕ} (M : Leaves (d+1) → Fˣ) : + Parameters.leafProduct M = Parameters.leafProduct (left M) * + Parameters.leafProduct (right M) := prod_split M + +def rootArgument {d : ℕ} (P : Parameters F d) (D Xl Xr c : Fˣ) + (M : Leaves d → Fˣ) : Fˣ := + P.frequency / (D*Xl*Xr*c*Parameters.leafProduct M) + +def pivot {d : ℕ} (s a b u : Fˣ) (L R : Parameters F d) + (Xl Xr : Fˣ) (M : Leaves (d+1) → Fˣ) : F := + ((L.frequency : F)*(Xr*b*Parameters.leafProduct (right M)) - + (R.frequency : F)*(Xl*a*Parameters.leafProduct (left M))) / ((s : F)*u) + +local instance : DecidableEq F := Classical.decEq F + +def reconstruct (D : Fˣ) : {d : ℕ} → Parameters F d → Fˣ → Fˣ → Fˣ → + (Leaves d → Fˣ) → Option (Leaves d → Fˣ) + | _, P@(.leaf _ _), Xl, Xr, c, M => some (fun _ => rootArgument P D Xl Xr c M) + | _, .branch s a b u L R, Xl, Xr, _, M => + if hp : pivot s a b u L R Xl Xr M = 0 then none else + let p := Units.mk0 _ hp + match reconstruct D L p Xl (u*a) (left M), + reconstruct D R p Xr (u*b) (right M) with + | some yl, some yr => some (join yl yr) + | _, _ => none + +def difference : {d : ℕ} → (Leaves d → Fˣ) → F + | 0, y => y (fun i => Fin.elim0 i) + | _+1, y => difference (left y) - difference (right y) + +@[simp] theorem difference_join {d : ℕ} (yl yr : Leaves d → Fˣ) : + difference (join yl yr) = difference yl - difference yr := by + simp [difference] + +theorem reconstruct_branch_some {d : ℕ} (s a b u D Xl Xr c : Fˣ) + (L R : Parameters F d) (M y : Leaves (d+1) → Fˣ) + (h : reconstruct D (.branch s a b u L R) Xl Xr c M = some y) : + ∃ hp : pivot s a b u L R Xl Xr M ≠ 0, + reconstruct D L (Units.mk0 _ hp) Xl (u*a) (left M) = some (left y) ∧ + reconstruct D R (Units.mk0 _ hp) Xr (u*b) (right M) = some (right y) := by + classical + simp only [reconstruct] at h + split at h + · contradiction + · rename_i hp + refine ⟨hp, ?_⟩ + split at h <;> try contradiction + rename_i yl yr hl hr + have hy : join yl yr = y := Option.some.inj h + rw [← hy, left_join, right_join] + exact ⟨hl, hr⟩ + +end Density +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DensitySplit.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DensitySplit.lean new file mode 100644 index 0000000000000000000000000000000000000000..62f199f25d476ab788a379d2ccbf77bad0bc7950 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DensitySplit.lean @@ -0,0 +1,89 @@ +import OAI.NumberTheory.Ostmann.Tree.DensityAlgebra + +namespace OAI + +namespace Ostmann.Tree.Density +noncomputable section +open scoped BigOperators +variable {F : Type*} [Field F] +local instance : DecidableEq F := Classical.decEq F + +theorem rootArgument_eq_cancel {d : ℕ} (P : Parameters F d) (D X c p q : Fˣ) + (M N : Leaves d → Fˣ) + (h : rootArgument P D p X c M = rootArgument P D q X c N) : + p * Parameters.leafProduct M = q * Parameters.leafProduct N := by + have he : D*p*X*c*Parameters.leafProduct M = D*q*X*c*Parameters.leafProduct N := + div_right_inj.mp h + apply mul_left_cancel (a := D*X*c) + calc + (D*X*c)*(p*Parameters.leafProduct M) = D*p*X*c*Parameters.leafProduct M := by simp [mul_assoc, mul_left_comm, mul_comm] + _ = D*q*X*c*Parameters.leafProduct N := he + _ = (D*X*c)*(q*Parameters.leafProduct N) := by simp [mul_assoc, mul_left_comm, mul_comm] + +theorem left_product_sq_eq {d : ℕ} (s a b u D Xl Xr c : Fˣ) + (L R : Parameters F d) (hP : (Parameters.branch s a b u L R).consistent) + (hc : (Parameters.branch s a b u L R).childConsistent c) + (M N y : Leaves (d+1) → Fˣ) + (hM : reconstruct D (.branch s a b u L R) Xl Xr c M = some y) + (hN : reconstruct D (.branch s a b u L R) Xl Xr c N = some y) : + Parameters.leafProduct (left M)^2 = Parameters.leafProduct (left N)^2 := by + obtain ⟨hpM, hMl, hMr⟩ := reconstruct_branch_some s a b u D Xl Xr c L R M y hM + obtain ⟨hpN, hNl, hNr⟩ := reconstruct_branch_some s a b u D Xl Xr c L R N y hN + let pM := Units.mk0 _ hpM + let pN := Units.mk0 _ hpN + have hL : rootArgument L D pM Xl (u*a) (left M) = + rootArgument L D pN Xl (u*a) (left N) := by + apply Units.ext + exact (reconstruct_difference L hP.2.2.1 D pM Xl (u*a) hP.1 _ _ hMl).symm.trans + (reconstruct_difference L hP.2.2.1 D pN Xl (u*a) hP.1 _ _ hNl) + have hR : rootArgument R D pM Xr (u*b) (right M) = + rootArgument R D pN Xr (u*b) (right N) := by + apply Units.ext + exact (reconstruct_difference R hP.2.2.2 D pM Xr (u*b) hP.2.1 _ _ hMr).symm.trans + (reconstruct_difference R hP.2.2.2 D pN Xr (u*b) hP.2.1 _ _ hNr) + have hl := rootArgument_eq_cancel L D Xl (u*a) pM pN _ _ hL + have hr := rootArgument_eq_cancel R D Xr (u*b) pM pN _ _ hR + have ht := leafProduct_eq_of_reconstruct_eq (.branch s a b u L R) hP D Xl Xr c hc M N y hM hN + rw [leafProduct_split, leafProduct_split] at ht + calc + Parameters.leafProduct (left M)^2 = + ((pM*Parameters.leafProduct (left M))/(pM*Parameters.leafProduct (right M)))* + (Parameters.leafProduct (left M)*Parameters.leafProduct (right M)) := by simp [div_eq_mul_inv, pow_two, mul_assoc, mul_left_comm, mul_comm] + _ = ((pN*Parameters.leafProduct (left N))/(pN*Parameters.leafProduct (right N)))* + (Parameters.leafProduct (left N)*Parameters.leafProduct (right N)) := by rw [hl, hr, ht] + _ = Parameters.leafProduct (left N)^2 := by simp [div_eq_mul_inv, pow_two, mul_assoc, mul_left_comm, mul_comm] + +theorem left_product_image_card_le_two {d : ℕ} (s a b u D Xl Xr c : Fˣ) + (L R : Parameters F d) (hP : (Parameters.branch s a b u L R).consistent) + (hc : (Parameters.branch s a b u L R).childConsistent c) + (S : Finset (Leaves (d+1) → Fˣ)) (y : Leaves (d+1) → Fˣ) + (hS : ∀ M ∈ S, reconstruct D (.branch s a b u L R) Xl Xr c M = some y) : + (S.image (fun M => Parameters.leafProduct (left M))).card ≤ 2 := by + classical + by_cases hs : S.Nonempty + · obtain ⟨M, hM⟩ := hs + apply le_trans (Finset.card_le_card (t := + {Parameters.leafProduct (left M), -Parameters.leafProduct (left M)}) ?_) Finset.card_le_two + intro x hx + obtain ⟨N, hN, rfl⟩ := Finset.mem_image.mp hx + have he := left_product_sq_eq s a b u D Xl Xr c L R hP hc N M y (hS N hN) (hS M hM) + rcases Units.sq_eq_sq_iff_eq_or_eq_neg.mp he with h | h <;> simp [h] + · simp [Finset.not_nonempty_iff_eq_empty.mp hs] + +theorem pivot_eq_of_left_product_eq {d : ℕ} (s a b u D Xl Xr c : Fˣ) + (L R : Parameters F d) (hP : (Parameters.branch s a b u L R).consistent) + (hc : (Parameters.branch s a b u L R).childConsistent c) + (M N y : Leaves (d+1) → Fˣ) + (hM : reconstruct D (.branch s a b u L R) Xl Xr c M = some y) + (hN : reconstruct D (.branch s a b u L R) Xl Xr c N = some y) + (hl : Parameters.leafProduct (left M) = Parameters.leafProduct (left N)) : + pivot s a b u L R Xl Xr M = pivot s a b u L R Xl Xr N := by + have ht := leafProduct_eq_of_reconstruct_eq (.branch s a b u L R) hP D Xl Xr c hc M N y hM hN + rw [leafProduct_split, leafProduct_split, hl] at ht + have hr := mul_left_cancel ht + simp only [pivot, hl, hr] + +end +end Ostmann.Tree.Density + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DensityValues.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DensityValues.lean new file mode 100644 index 0000000000000000000000000000000000000000..976a0eec061507b839e38261adb79403d4996412 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DensityValues.lean @@ -0,0 +1,87 @@ +import OAI.NumberTheory.Ostmann.Tree.DensityAlgebra + +namespace OAI + +namespace Ostmann.Tree.Density +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F : Type*} [Field F] + +def weight {d : ℕ} (g : F → ℂ) (y : Leaves d → Fˣ) : ℝ := ∏ v, ‖g (y v)‖^2 + +def mass {d : ℕ} (g : F → ℂ) (y : Option (Leaves d → Fˣ)) : ℝ := + match y with | none => 0 | some z => weight g z + +theorem weight_join {d : ℕ} (g : F → ℂ) (yl yr : Leaves d → Fˣ) : + weight g (join yl yr) = weight g yl * weight g yr := by + unfold weight + rw [prod_split] + simp only [left, right, join, Fin.cons_zero, Bool.false_eq_true, ↓reduceIte, Fin.tail_cons] + +theorem mass_join {d : ℕ} (g : F → ℂ) (yl yr : Option (Leaves d → Fˣ)) : + mass g (match yl, yr with | some l, some r => some (join l r) | _, _ => none) = + mass g yl * mass g yr := by + cases yl <;> cases yr <;> simp [mass, weight_join] + +theorem evaluate_norm_sq {d : ℕ} (P : Parameters F d) (g : F → ℂ) + (D Xl Xr c : Fˣ) (M : Leaves d → Fˣ) : + ‖P.evaluate g D Xl Xr (rootArgument P D Xl Xr c M : F) M‖^2 = + mass g (reconstruct D P Xl Xr c M) := by + classical + induction P generalizing D Xl Xr c with + | leaf s sign => + cases sign <;> simp [Parameters.evaluate, reconstruct, mass, weight] + | @branch d s a b u L R ihl ihr => + change ‖(if hp : pivot s a b u L R Xl Xr M = 0 then 0 else + L.evaluate g D (Units.mk0 _ hp) Xl + ((L.frequency : F) / ((D : F)*(Units.mk0 _ hp : Fˣ)*u* + (Xl*a*Parameters.leafProduct (left M)))) (left M) * + R.evaluate g D (Units.mk0 _ hp) Xr + ((R.frequency : F) / ((D : F)*(Units.mk0 _ hp : Fˣ)*u* + (Xr*b*Parameters.leafProduct (right M)))) (right M))‖^2 = _ + by_cases hp : pivot s a b u L R Xl Xr M = 0 + · simp [hp, reconstruct, mass] + · simp only [dite_eq_right hp, norm_mul, mul_pow, reconstruct] + rw [← child_rootArgument, ← child_rootArgument] + rw [ihl, ihr] + exact (mass_join g + (reconstruct D L (Units.mk0 _ hp) Xl (u*a) (left M)) + (reconstruct D R (Units.mk0 _ hp) Xr (u*b) (right M))).symm + +def rootCoefficient : {d : ℕ} → Parameters F d → Fˣ + | _, .leaf _ _ => 1 + | _, .branch _ a b _ _ _ => a*b + +theorem rootCoefficient_consistent {d : ℕ} (P : Parameters F d) : + P.childConsistent (rootCoefficient P) := by cases P <;> simp [Parameters.childConsistent, rootCoefficient] + +def diagramArguments {d : ℕ} (T : Diagram F d) (M : Leaves d → Fˣ) : + Option (Leaves d → Fˣ) := + match d, T with + | 0, T => reconstruct 1 T.parameters 1 1 1 M + | _+1, T => reconstruct T.denominator T.parameters T.rootLeft T.rootRight + (rootCoefficient T.parameters) M + +theorem diagram_value_norm_sq {d : ℕ} (T : Diagram F d) (g : F → ℂ) + (M : Leaves d → Fˣ) : + ‖T.value g M‖^2 = mass g (diagramArguments T M) := by + cases d with + | zero => + cases hp : T.parameters with + | leaf s sign => + cases sign <;> simp [Diagram.value, Parameters.value, diagramArguments, hp, + reconstruct, rootArgument, Parameters.frequency, Parameters.leafProduct, + mass, weight] + all_goals exact congrArg (fun v : Leaves 0 => ‖g ((s:F) / (M v:F))‖) (Subsingleton.elim _ _) + | succ d => + cases hp : T.parameters with + | branch s a b u L R => + have he := evaluate_norm_sq (.branch s a b u L R) g + T.denominator T.rootLeft T.rootRight (a*b) M + simpa only [Diagram.value, Parameters.value, diagramArguments, hp, + rootCoefficient, Parameters.evaluate] using he + +end +end Ostmann.Tree.Density + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DiagonalMellin.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DiagonalMellin.lean new file mode 100644 index 0000000000000000000000000000000000000000..a0a3bbe179593375afa4c2dedaebf827d72a096b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DiagonalMellin.lean @@ -0,0 +1,42 @@ +import OAI.NumberTheory.Ostmann.Tree.AffinePairIdentity +import OAI.NumberTheory.Ostmann.Tree.MellinTransform +import OAI.NumberTheory.Ostmann.Tree.PairSpectrum + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem diagonalPair_mellin_inner (g : ZMod p → ℂ) (χ η : MulChar (ZMod p) ℂ) + (a : ZMod p) (σ : (ZMod p)ˣ) (d : ZMod p) (hg0 : g 0=0) : + mellin (fun lam : (ZMod p)ˣ => diagonalPairValue g η a σ lam d) χ = + pairSpectrum g χ ((σ:ZMod p)*d)*χ d*η d*ZMod.stdAddChar (-(a*d)) := by + by_cases hd : d=0 + · subst d + simp [diagonalPairValue,η.map_zero,χ.map_zero,mellin] + let D : (ZMod p)ˣ := Units.mk0 d hd + have he : (fun lam : (ZMod p)ˣ => diagonalPairValue g η a σ lam d) = + (fun lam : (ZMod p)ˣ => (η d*ZMod.stdAddChar (-(a*d)))*bottomPair g (σ*D) (lam*D)) := by + funext lam + dsimp [diagonalPairValue,pairTest,bottomPair,pairMobiusValue,pairFirst,pairSecond,D] + ring + have hm := mellin_mulRight (fun t : (ZMod p)ˣ => bottomPair g (σ*D) t) D χ + simp only [Units.val_mul] at hm + rw [he,mellin_const_mul,hm,← pairSpectrum_unit g χ (σ*D) hg0] + change (η d*ZMod.stdAddChar (-(a*d)))*(χ d*pairSpectrum g χ ((σ:ZMod p)*d)) = _ + ring + +theorem diagonalPair_mellin (g : ZMod p → ℂ) (χ η : MulChar (ZMod p) ℂ) + (a : ZMod p) (σ : (ZMod p)ˣ) (hg0 : g 0=0) : + mellin (fun lam : (ZMod p)ˣ => mean (diagonalPairValue g η a σ lam)) χ = + fourier (fun d => pairSpectrum g χ ((σ:ZMod p)*d)*χ d*η d) a := by + unfold mean + rw [mellin_const_mul,mellin_sum,fourier_apply] + simp_rw [diagonalPair_mellin_inner g χ η a σ _ hg0] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/Diagram.lean b/lean/OAI/NumberTheory/Ostmann/Tree/Diagram.lean new file mode 100644 index 0000000000000000000000000000000000000000..68e6aabd4c1b51c4491934d96d0b36fd3480a6a7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/Diagram.lean @@ -0,0 +1,99 @@ +import OAI.NumberTheory.Ostmann.Tree.Fourier + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators ComplexConjugate + +abbrev Leaves (depth : ℕ) := Fin depth → Bool + +inductive Parameters (F : Type*) [Field F] : ℕ → Type _ + | leaf (frequency : Fˣ) (conjugated : Bool) : Parameters F 0 + | branch {depth : ℕ} (frequency leftConstant rightConstant splitConstant : Fˣ) + (left right : Parameters F depth) : Parameters F (depth+1) + +namespace Parameters +variable {F : Type*} [Field F] +local instance : DecidableEq F := Classical.decEq F + +def frequency : {depth : ℕ} → Parameters F depth → Fˣ + | _, .leaf s _ => s + | _, .branch s _ _ _ _ _ => s + +def childConsistent (target : Fˣ) : {depth : ℕ} → Parameters F depth → Prop + | _, .leaf _ _ => True + | _, .branch _ a b _ _ _ => a*b=target + +def consistent : {depth : ℕ} → Parameters F depth → Prop + | _, .leaf _ _ => True + | _, .branch _ a b u left right => + childConsistent (u*a) left ∧ childConsistent (u*b) right ∧ + consistent left ∧ consistent right + +def bottomOpposite : {depth : ℕ} → Parameters F depth → Prop + | _, .leaf _ _ => True + | 1, .branch _ _ _ _ (.leaf _ a) (.leaf _ b) => a ≠ b + | _+2, .branch _ _ _ _ left right => bottomOpposite left ∧ bottomOpposite right + +def childLeaves {depth : ℕ} (M : Leaves (depth+1) → Fˣ) (side : Bool) : + Leaves depth → Fˣ := fun v => M (Fin.cons side v) + +def leafProduct {depth : ℕ} (M : Leaves depth → Fˣ) : Fˣ := ∏ v, M v + +def evaluate (g : F → ℂ) (D : Fˣ) : {depth : ℕ} → Parameters F depth → + Fˣ → Fˣ → F → (Leaves depth → Fˣ) → ℂ + | _, .leaf _ c, _, _, incoming, _ => if c then conj (g incoming) else g incoming + | _, .branch s a b u left right, Xleft, Xright, _, M => + let Ml := childLeaves M false + let Mr := childLeaves M true + let Hl := Xleft*a*leafProduct Ml + let Hr := Xright*b*leafProduct Mr + let pivot : F := ((left.frequency : F)*Hr-(right.frequency : F)*Hl) / ((s : F)*u) + if hp : pivot=0 then 0 else + let P : Fˣ := Units.mk0 pivot hp + let yl : F := (left.frequency : F)/((D : F)*P*u*Hl) + let yr : F := (right.frequency : F)/((D : F)*P*u*Hr) + evaluate g D left P Xleft yl Ml * evaluate g D right P Xright yr Mr + +def value (g : F → ℂ) (D Xleft Xright : Fˣ) : + {depth : ℕ} → Parameters F depth → (Leaves depth → Fˣ) → ℂ + | 0, .leaf s c, M => + let y : F := (s : F) / M (fun i => Fin.elim0 i) + if c then conj (g y) else g y + | _+1, P, M => evaluate g D P Xleft Xright 0 M + +end Parameters + +structure Diagram (F : Type*) [Field F] (depth : ℕ) where + parameters : Parameters F depth + denominator : Fˣ + rootLeft : Fˣ + rootRight : Fˣ + consistent : parameters.consistent + bottomOpposite : parameters.bottomOpposite + +namespace Diagram +variable {F : Type*} [Field F] {depth : ℕ} +def value (T : Diagram F depth) (g : F → ℂ) (M : Leaves depth → Fˣ) : ℂ := + T.parameters.value g T.denominator T.rootLeft T.rootRight M +end Diagram + +structure LeafPartition (depth blocks : ℕ) where + label : Leaves depth → Fin blocks + onto : Function.Surjective label + +namespace LeafPartition +variable {F : Type*} [Field F] {depth blocks : ℕ} +def componentProduct (P : LeafPartition depth blocks) (M : Leaves depth → Fˣ) + (b : Fin blocks) : Fˣ := ∏ i with P.label i = b, M i + +def coupled (P Q : LeafPartition depth blocks) + (M : (Leaves depth → Fˣ) × (Leaves depth → Fˣ)) : Prop := + ∀ b, P.componentProduct M.1 b = Q.componentProduct M.2 b + +end LeafPartition +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DifferenceConvolution.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DifferenceConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..6bc6e281d38409b31ef2b5c2f747dfb4c0459a3c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DifferenceConvolution.lean @@ -0,0 +1,57 @@ +import OAI.NumberTheory.Ostmann.Tree.AffineFourier +import OAI.NumberTheory.Ostmann.Tree.MellinTransform + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def differenceConvolution (f h : ZMod p → ℂ) (y : ZMod p) : ℂ := + mean (fun d => f d*h (d-y)) + +theorem fourier_subRight (h : ZMod p → ℂ) (d a : ZMod p) : + fourier (fun y => h (d-y)) a=ZMod.stdAddChar (-(a*d))*fourier h (-a) := by + have he : (fun y => h (d-y))=(fun y => (fun x => h (x+d)) ((-1:(ZMod p)ˣ)*y)) := by + funext y + congr 1 + simp only [Units.val_neg,Units.val_one] + ring + rw [he,fourier_unitMul (fun x => h (x+d)) (-1:(ZMod p)ˣ) a,fourier_translate] + simp + +theorem fourier_differenceConvolution (f h : ZMod p → ℂ) (a : ZMod p) : + fourier (differenceConvolution f h) a=fourier f a*fourier h (-a) := by + unfold differenceConvolution mean + rw [fourier_const_mul,fourier_sum] + simp_rw [fourier_const_mul,fourier_subRight] + rw [fourier_apply f a] + simp only [Finset.sum_mul,Finset.mul_sum] + apply Finset.sum_congr rfl + intro d _ + ring + +theorem differenceConvolution_parseval (f h : ZMod p → ℂ) : + l2Sq (differenceConvolution f h)= + ∑ a : ZMod p, ‖fourier f a‖^2*‖fourier h (-a)‖^2 := by + rw [← fourier_parseval] + simp only [fourier_differenceConvolution,norm_mul,mul_pow] + +def doubleMellin (f : (ZMod p)ˣ → (ZMod p)ˣ → ℂ) + (χ ψ : MulChar (ZMod p) ℂ) : ℂ := + mellin (fun t => mellin (fun s => f s t) χ) ψ + +theorem doubleMellin_parseval (f : (ZMod p)ˣ → (ZMod p)ˣ → ℂ) : + (∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ, ‖doubleMellin f χ ψ‖^2) = + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2*∑ s : (ZMod p)ˣ,∑ t : (ZMod p)ˣ, ‖f s t‖^2 := by + simp only [doubleMellin,mellin_parseval] + rw [← Finset.mul_sum,Finset.sum_comm] + simp_rw [mellin_parseval] + rw [← Finset.mul_sum,Finset.sum_comm] + ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/DoubleMellinEnergy.lean b/lean/OAI/NumberTheory/Ostmann/Tree/DoubleMellinEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..38d213654683835d5267e85dcf3c6c5e0a2ea021 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/DoubleMellinEnergy.lean @@ -0,0 +1,43 @@ +import OAI.NumberTheory.Ostmann.Tree.DifferenceConvolution + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem sum_three_rotate {I J K R : Type*} [Fintype I] [Fintype J] [Fintype K] + [AddCommMonoid R] (f : I → J → K → R) : + (∑ i,∑ j,∑ k,f i j k)=∑ k,∑ i,∑ j,f i j k := by + calc + _ = ∑ i,∑ k,∑ j,f i j k := by + apply Finset.sum_congr rfl + intro i _ + rw [Finset.sum_comm] + _ = _ := by rw [Finset.sum_comm] + +theorem doubleMellin_mean (f : ZMod p → (ZMod p)ˣ → (ZMod p)ˣ → ℂ) + (χ ψ : MulChar (ZMod p) ℂ) : + doubleMellin (fun lam mu => mean (fun d => f d lam mu)) χ ψ= + mean (fun d => doubleMellin (f d) χ ψ) := by + simp only [doubleMellin,mean,mellin_const_mul,mellin_sum] + +theorem doubleMellin_mean_energy (f : (ZMod p)ˣ → (ZMod p)ˣ → ZMod p → ℂ) : + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2* + (∑ lam : (ZMod p)ˣ,∑ mu : (ZMod p)ˣ,l2Sq (f lam mu)) = + ∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ, + l2Sq (fun y => doubleMellin (fun lam mu => f lam mu y) χ ψ) := by + symm + simp only [l2Sq,← Finset.mul_sum] + rw [sum_three_rotate] + simp_rw [doubleMellin_parseval] + rw [← Finset.mul_sum] + have hs := sum_three_rotate (fun lam mu y => ‖f lam mu y‖^2) + rw [← hs] + ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/FiberProjection.lean b/lean/OAI/NumberTheory/Ostmann/Tree/FiberProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5dbc2456dba2cbc3538bc4bdc8f7ea343d09d8f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/FiberProjection.lean @@ -0,0 +1,122 @@ +import OAI.NumberTheory.Ostmann.Tree.FiniteActionAverage + +namespace OAI + +/-! +# Correlation over paired finite fibers + +The component totals determine equal-cardinality fibers. Cauchy--Schwarz +on their sums, together with invariance under a cycle action, gives the +finite projection reduction before the local quartet bounds are applied. +-/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +noncomputable def fiberSum {Ω T : Type*} [Fintype Ω] [DecidableEq T] + (τ : Ω → T) (f : Ω → ℂ) (t : T) : ℂ := + ∑ x ∈ Finset.univ.filter (fun x => τ x = t), f x + +theorem complex_correlation_sq_le {Ω : Type*} [Fintype Ω] (f g : Ω → ℂ) : + ‖∑ x : Ω, f x * conj (g x)‖ ^ 2 ≤ + (∑ x : Ω, ‖f x‖ ^ 2) * ∑ x : Ω, ‖g x‖ ^ 2 := by + have hn : ‖∑ x : Ω, f x * conj (g x)‖ ≤ ∑ x : Ω, ‖f x‖ * ‖g x‖ := by + simpa only [norm_mul, Complex.norm_conj] using + norm_sum_le (Finset.univ : Finset Ω) (fun x => f x * conj (g x)) + have hs := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ (fun x : Ω => ‖f x‖) (fun x => ‖g x‖) + have hnn : 0 ≤ ∑ x : Ω, ‖f x‖ * ‖g x‖ := + Finset.sum_nonneg fun _ _ => mul_nonneg (norm_nonneg _) (norm_nonneg _) + exact (pow_le_pow_left₀ (norm_nonneg _) hn 2).trans hs + +/-- A common fiber-size bound controls the energy of the fiber sums. -/ +theorem fiberSum_energy_le {Ω T : Type*} [Fintype Ω] [Fintype T] [DecidableEq T] + (τ : Ω → T) (f : Ω → ℂ) (N : ℕ) + (hN : ∀ t, (Finset.univ.filter (fun x => τ x = t)).card ≤ N) : + (∑ t : T, ‖fiberSum τ f t‖ ^ 2) ≤ (N : ℝ) * ∑ x : Ω, ‖f x‖ ^ 2 := by + have ht (t : T) : ‖fiberSum τ f t‖ ^ 2 ≤ + (N : ℝ) * ∑ x ∈ Finset.univ.filter (fun x => τ x = t), ‖f x‖ ^ 2 := by + have h := complex_weighted_sum_sq (Finset.univ.filter (fun x => τ x = t)) + (fun _ => 1) f + simp only [Complex.ofReal_one, one_mul, one_pow, Finset.sum_const, nsmul_eq_mul, + mul_one] at h + apply h.trans + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hN t) + (Finset.sum_nonneg fun _ _ => sq_nonneg _) + calc + _ ≤ ∑ t : T, (N : ℝ) * + ∑ x ∈ Finset.univ.filter (fun x => τ x = t), ‖f x‖ ^ 2 := Finset.sum_le_sum fun t _ => ht t + _ = _ := by + rw [← Finset.mul_sum] + congr 1 + exact Finset.sum_fiberwise_of_maps_to (fun _ _ => Finset.mem_univ _) (fun x => ‖f x‖ ^ 2) + +/-- A fiber-preserving finite action does not change the fiber sums. -/ +theorem fiberSum_actionAverage {G Ω T : Type*} [Group G] [Fintype G] + [Fintype Ω] [DecidableEq T] [MulAction G Ω] + (τ : Ω → T) (hτ : ∀ (g : G) x, τ (g • x) = τ x) (f : Ω → ℂ) (t : T) : + fiberSum τ (finiteActionAverage (G := G) f) t = fiberSum τ f t := by + have h := finiteActionAverage_correlation (G := G) f + (fun x => if τ x = t then 1 else 0) (by intro g x; rw [hτ]) + simpa only [apply_ite, map_one, map_zero, mul_ite, mul_one, mul_zero, + fiberSum, Finset.sum_filter] using h + +/-- The squared projection reduction; normalization can be applied afterward. -/ +theorem pairedFiber_correlation_sq_le {G Ω T : Type*} [Group G] [Fintype G] + [Fintype Ω] [Fintype T] [DecidableEq T] [MulAction G Ω] + (τ : Ω → T) (hτ : ∀ (g : G) x, τ (g • x) = τ x) + (f g : Ω → ℂ) (N : ℕ) + (hN : ∀ t, (Finset.univ.filter (fun x => τ x = t)).card ≤ N) : + ‖∑ t : T, fiberSum τ f t * conj (fiberSum τ g t)‖ ^ 2 ≤ + (N : ℝ) ^ 2 * (∑ x : Ω, ‖finiteActionAverage (G := G) f x‖ ^ 2) * + ∑ x : Ω, ‖g x‖ ^ 2 := by + have hF := fiberSum_energy_le τ (finiteActionAverage (G := G) f) N hN + have hG := fiberSum_energy_le τ g N hN + have h := complex_correlation_sq_le + (fiberSum τ (finiteActionAverage (G := G) f)) (fiberSum τ g) + simp_rw [fiberSum_actionAverage τ hτ f] at h hF + apply h.trans + have hb := mul_le_mul hF hG (by positivity) (by positivity) + convert hb using 1 + ring + +/-- Expanding the two fiber sums gives the equal-total paired correlation. -/ +theorem pairedFiber_correlation_eq {Ω T : Type*} [Fintype Ω] [Fintype T] [DecidableEq T] + (τ : Ω → T) (f g : Ω → ℂ) : + (∑ t : T, fiberSum τ f t * conj (fiberSum τ g t)) = + ∑ x : Ω, ∑ y : Ω, if τ x = τ y then f x * conj (g y) else 0 := by + unfold fiberSum + simp only [Finset.sum_filter, Finset.sum_mul, ite_mul, zero_mul] + rw [Finset.sum_comm] + simp only [Finset.sum_ite_eq, Finset.mem_univ, ite_true] + simp only [map_sum, apply_ite, map_zero, Finset.mul_sum, mul_zero] + apply Finset.sum_congr rfl + intro x _ + apply Finset.sum_congr rfl + intro y _ + by_cases hxy : τ x = τ y + · simp [hxy] + · simp [hxy, Ne.symm hxy] + +/-- Probability-normalized form of the finite cycle projection reduction. -/ +theorem pairedFiber_normalized_projection {G Ω T : Type*} [Group G] [Fintype G] + [Fintype Ω] [Nonempty Ω] [Fintype T] [DecidableEq T] [MulAction G Ω] + (τ : Ω → T) (hτ : ∀ (g : G) x, τ (g • x) = τ x) + (f g : Ω → ℂ) (N : ℕ) (hNpos : 0 < N) + (hN : ∀ t, (Finset.univ.filter (fun x => τ x = t)).card ≤ N) : + ‖((Fintype.card Ω : ℂ) * (N : ℂ))⁻¹ * + (∑ x : Ω, ∑ y : Ω, if τ x = τ y then f x * conj (g y) else 0)‖ ^ 2 ≤ + ((∑ x : Ω, ‖finiteActionAverage (G := G) f x‖ ^ 2) / (Fintype.card Ω : ℝ)) * + ((∑ x : Ω, ‖g x‖ ^ 2) / (Fintype.card Ω : ℝ)) := by + have hΩ : (Fintype.card Ω : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero + have hN' : (N : ℝ) ≠ 0 := by exact_mod_cast Nat.ne_of_gt hNpos + rw [← pairedFiber_correlation_eq, norm_mul, norm_inv, norm_mul, + Complex.norm_natCast, Complex.norm_natCast, mul_pow] + have h := mul_le_mul_of_nonneg_left (pairedFiber_correlation_sq_le τ hτ f g N hN) + (sq_nonneg (((Fintype.card Ω : ℝ) * (N : ℝ))⁻¹)) + convert h using 1 + field_simp + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/FiniteActionAverage.lean b/lean/OAI/NumberTheory/Ostmann/Tree/FiniteActionAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb6aa01df347622720a1a18a66ba3f64d453928f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/FiniteActionAverage.lean @@ -0,0 +1,99 @@ +import Mathlib.GroupTheory.GroupAction.Basic +import OAI.NumberTheory.Ostmann.Preliminaries.TestFunctions + +namespace OAI + +/-! +# Averaging over the finite cycle action + +These are the finite-sum projection identities used in the tree cycle +reduction. The action will be reciprocal multiplication on cycle leaves. +-/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +private def actionPermutation {G Ω : Type*} [Group G] [MulAction G Ω] (g : G) : Ω ≃ Ω where + toFun x := g • x + invFun x := g⁻¹ • x + left_inv x := inv_smul_smul g x + right_inv x := smul_inv_smul g x + +noncomputable def finiteActionAverage {G Ω : Type*} [Group G] [Fintype G] [MulAction G Ω] + (f : Ω → ℂ) (x : Ω) : ℂ := + (Fintype.card G : ℂ)⁻¹ * ∑ g : G, f (g • x) + +theorem finiteActionAverage_invariant {G Ω : Type*} [Group G] [Fintype G] [MulAction G Ω] + (f : Ω → ℂ) (g : G) (x : Ω) : + finiteActionAverage (G := G) f (g • x) = finiteActionAverage (G := G) f x := by + unfold finiteActionAverage + simp only [← mul_smul] + congr 1 + exact (Equiv.mulRight g).bijective.sum_comp (fun h : G => f (h • x)) + +theorem finiteActionAverage_of_invariant {G Ω : Type*} [Group G] [Fintype G] [MulAction G Ω] + (f : Ω → ℂ) (hf : ∀ (g : G) x, f (g • x) = f x) (x : Ω) : + finiteActionAverage (G := G) f x = f x := by + have hcard : (Fintype.card G : ℂ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero + simp only [finiteActionAverage, hf, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + field_simp + +theorem finiteActionAverage_idempotent {G Ω : Type*} [Group G] [Fintype G] [MulAction G Ω] + (f : Ω → ℂ) (x : Ω) : + finiteActionAverage (G := G) (finiteActionAverage (G := G) f) x = finiteActionAverage (G := G) f x := + finiteActionAverage_of_invariant (G := G) _ (finiteActionAverage_invariant (G := G) f) x + +/-- Averaging does not change correlation against an action-invariant test. -/ +theorem finiteActionAverage_correlation {G Ω : Type*} [Group G] [Fintype G] + [Fintype Ω] [MulAction G Ω] (f h : Ω → ℂ) + (hh : ∀ (g : G) x, h (g • x) = h x) : + (∑ x : Ω, finiteActionAverage (G := G) f x * conj (h x)) = + ∑ x : Ω, f x * conj (h x) := by + have hcard : (Fintype.card G : ℂ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero + have hs (g : G) : (∑ x : Ω, f (g • x) * conj (h x)) = + ∑ x : Ω, f x * conj (h x) := by + calc + _ = ∑ x : Ω, f (g • x) * conj (h (g • x)) := by simp only [hh] + _ = _ := (actionPermutation g).bijective.sum_comp (fun x => f x * conj (h x)) + simp only [finiteActionAverage, Finset.sum_mul, mul_assoc] + rw [← Finset.mul_sum, Finset.sum_comm] + simp only [hs, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + field_simp + +/-- Jensen's inequality for the finite average, written as a counting sum. -/ +theorem finiteActionAverage_norm_sq_le {G Ω : Type*} [Group G] [Fintype G] [MulAction G Ω] + (f : Ω → ℂ) (x : Ω) : + ‖finiteActionAverage (G := G) f x‖ ^ 2 ≤ + (Fintype.card G : ℝ)⁻¹ * ∑ g : G, ‖f (g • x)‖ ^ 2 := by + have hcard : (Fintype.card G : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero + have hcs := complex_weighted_sum_sq (Finset.univ : Finset G) + (fun _ => 1) (fun g => f (g • x)) + simp only [Complex.ofReal_one, one_mul, one_pow, Finset.sum_const, + Finset.card_univ, nsmul_eq_mul, mul_one] at hcs + unfold finiteActionAverage + rw [norm_mul, norm_inv, Complex.norm_natCast, mul_pow] + calc + _ ≤ ((Fintype.card G : ℝ)⁻¹) ^ 2 * + ((Fintype.card G : ℝ) * ∑ g : G, ‖f (g • x)‖ ^ 2) := + mul_le_mul_of_nonneg_left hcs (sq_nonneg _) + _ = _ := by field_simp + +/-- The cycle average is an `L²` contraction. -/ +theorem finiteActionAverage_energy_le {G Ω : Type*} [Group G] [Fintype G] + [Fintype Ω] [MulAction G Ω] (f : Ω → ℂ) : + (∑ x : Ω, ‖finiteActionAverage (G := G) f x‖ ^ 2) ≤ ∑ x : Ω, ‖f x‖ ^ 2 := by + have hcard : (Fintype.card G : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero + have hs (g : G) : (∑ x : Ω, ‖f (g • x)‖ ^ 2) = ∑ x : Ω, ‖f x‖ ^ 2 := + (actionPermutation g).bijective.sum_comp (fun x => ‖f x‖ ^ 2) + calc + _ ≤ ∑ x : Ω, (Fintype.card G : ℝ)⁻¹ * ∑ g : G, ‖f (g • x)‖ ^ 2 := + Finset.sum_le_sum fun x _ => finiteActionAverage_norm_sq_le (G := G) f x + _ = _ := by + rw [← Finset.mul_sum, Finset.sum_comm] + simp only [hs, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + field_simp + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/Fourier.lean b/lean/OAI/NumberTheory/Ostmann/Tree/Fourier.lean new file mode 100644 index 0000000000000000000000000000000000000000..6cc94103d2c9bc843dcd5545b59237d306bdd613 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/Fourier.lean @@ -0,0 +1,64 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [NeZero p] + +def mean (f : ZMod p → ℂ) : ℂ := (p : ℂ)⁻¹ * ∑ x, f x + +def fourier (f : ZMod p → ℂ) (a : ZMod p) : ℂ := + (p : ℂ)⁻¹ * ZMod.dft f a + +def l2Sq (f : ZMod p → ℂ) : ℝ := (p : ℝ)⁻¹ * ∑ x, ‖f x‖ ^ 2 + +noncomputable instance characterFintype : Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +def mixedCorrelation (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (a : ZMod p) : ℂ := + mean (fun x => g x * χ x * ZMod.stdAddChar (a * x)) + +def correlationBound (g : ZMod p → ℂ) : NNReal := + Finset.univ.sup (fun z : MulChar (ZMod p) ℂ × ZMod p => ‖mixedCorrelation g z.1 z.2‖₊) + +@[simp] theorem fourier_zero (f : ZMod p → ℂ) : fourier f 0 = mean f := by + simp only [fourier, ZMod.dft_apply_zero, mean] + +theorem fourier_apply (f : ZMod p → ℂ) (a : ZMod p) : + fourier f a = (p : ℂ)⁻¹ * ∑ x, f x * ZMod.stdAddChar (-(a*x)) := by + simp only [fourier, ZMod.dft_apply, smul_eq_mul] + congr 1 + apply Finset.sum_congr rfl + intro x _ + rw [mul_comm x a, mul_comm] + +theorem mixedCorrelation_eq_fourier (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (a : ZMod p) : mixedCorrelation g χ a = fourier (fun x => g x * χ x) (-a) := by + simp only [mixedCorrelation, mean, fourier_apply, neg_mul, neg_neg] + +theorem norm_mixedCorrelation_le (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (a : ZMod p) : ‖mixedCorrelation g χ a‖ ≤ (correlationBound g : ℝ) := by + exact_mod_cast (Finset.le_sup (s := Finset.univ) + (f := fun z : MulChar (ZMod p) ℂ × ZMod p => ‖mixedCorrelation g z.1 z.2‖₊) + (Finset.mem_univ (χ,a))) + +theorem l2Sq_nonneg (f : ZMod p → ℂ) : 0 ≤ l2Sq f := by + unfold l2Sq + positivity + +theorem fourier_inversion (f : ZMod p → ℂ) (x : ZMod p) : + f x = ∑ a, fourier f a * ZMod.stdAddChar (a*x) := by + have h := congrFun (ZMod.dft.symm_apply_apply f) x + rw [ZMod.invDFT_apply] at h + change (p : ℂ)⁻¹ * (∑ a, ZMod.stdAddChar (a*x) * ZMod.dft f a) = f x at h + rw [← h, Finset.mul_sum] + apply Finset.sum_congr rfl + intro a _ + dsimp [fourier] + ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/FriendlyConvolution.lean b/lean/OAI/NumberTheory/Ostmann/Tree/FriendlyConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..8832fc02da96d74dbf41b70ac5462606b0a04732 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/FriendlyConvolution.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.Ostmann.Tree.TwistedPairSpectrum + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem friendly_convolution_bound (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (hσ : (σ:ZMod p)^2=1) (hg0 : g 0=0) (hg : l2Sq g≤1) + (hh0 : h 0=0) (hh : l2Sq h≤1) + (η β : MulChar (ZMod p) ℂ → MulChar (ZMod p) ℂ) : + (∑ ψ : MulChar (ZMod p) ℂ, ∑ a : ZMod p, ∑ χ : MulChar (ZMod p) ℂ, + ‖twistedPairFourier g σ χ (χ*η ψ) a‖^2 * + ‖twistedPairFourier h τ ψ (β ψ) (-a)‖^2) ≤ + (2*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2)* + ((correlationBound g:ℝ)^4+Real.sqrt (3/(p:ℝ))) := by + let C : ℝ := ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))* + ((correlationBound g:ℝ)^4+Real.sqrt (3/(p:ℝ))) + have hC : 0≤C := by dsimp [C]; positivity + have hψ (ψ : MulChar (ZMod p) ℂ) : + (∑ a : ZMod p, ∑ χ : MulChar (ZMod p) ℂ, + ‖twistedPairFourier g σ χ (χ*η ψ) a‖^2 * + ‖twistedPairFourier h τ ψ (β ψ) (-a)‖^2) ≤ C*pairFourthMass h ψ := by + calc + _ ≤ ∑ a : ZMod p, C*‖twistedPairFourier h τ ψ (β ψ) (-a)‖^2 := by + apply Finset.sum_le_sum + intro a _ + rw [← Finset.sum_mul] + exact mul_le_mul_of_nonneg_right (twistedPairFourier_uniform g σ hσ hg0 hg (η ψ) a) (sq_nonneg _) + _ = C*(∑ a : ZMod p, ‖twistedPairFourier h τ ψ (β ψ) a‖^2) := by + rw [← Finset.mul_sum] + congr 1 + exact (Equiv.neg (ZMod p)).bijective.sum_comp (fun a => ‖twistedPairFourier h τ ψ (β ψ) a‖^2) + _ ≤ _ := mul_le_mul_of_nonneg_left (twistedPairFourier_energy h τ ψ (β ψ)) hC + calc + _ ≤ ∑ ψ : MulChar (ZMod p) ℂ, C*pairFourthMass h ψ := Finset.sum_le_sum (fun ψ _ => hψ ψ) + _ = C*(∑ ψ : MulChar (ZMod p) ℂ,pairFourthMass h ψ) := by rw [Finset.mul_sum] + _ ≤ C*(2*(p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ)) := mul_le_mul_of_nonneg_left (pairFourthMass_total h hh0 hh) hC + _ = _ := by dsimp [C]; ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/FriendlyQuartet.lean b/lean/OAI/NumberTheory/Ostmann/Tree/FriendlyQuartet.lean new file mode 100644 index 0000000000000000000000000000000000000000..d32f899626a4889162123deb7a52007ce11869f2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/FriendlyQuartet.lean @@ -0,0 +1,79 @@ +import OAI.NumberTheory.Ostmann.Characters.QuartetOrientations +import OAI.NumberTheory.Ostmann.Characters.QuartetFourier + +namespace OAI + +/-! +# The friendly quartet estimate + +The exact held-parameter average is bounded by the uniform Mellin estimate +on one side and total Fourier energy on the other side. +-/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable local instance friendlyQuartetFintype {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +theorem left_friendly_fourier_sum_le {p : ℕ} [Fact p.Prime] + (P Q : MulChar (ZMod p) ℂ → ZMod p → ℂ) + (δ S : ℝ) (hδ : 0 ≤ δ) + (hP : ∀ (η : MulChar (ZMod p) ℂ) (a : ZMod p), + (∑ χ : MulChar (ZMod p) ℂ, + ‖additiveFourier (fun x => P χ x * χ x * η x) a‖ ^ 2) ≤ δ) + (hQ : (∑ ψ : MulChar (ZMod p) ℂ, ∑ a : ZMod p, + ‖additiveFourier (Q ψ) a‖ ^ 2) ≤ S) + (right : Bool) (ν : MulChar (ZMod p) ℂ) : + (∑ χ : MulChar (ZMod p) ℂ, ∑ ψ : MulChar (ZMod p) ℂ, ∑ a : ZMod p, + ‖additiveFourier (fun x => P χ x * quartetLeftTwist true right ν χ ψ x) a‖ ^ 2 * + ‖additiveFourier (fun x => Q ψ x * quartetRightTwist true right ν χ ψ x) (-a)‖ ^ 2) ≤ + δ * S := by + let η : MulChar (ZMod p) ℂ → MulChar (ZMod p) ℂ := + fun ψ => ν * (if right then 1 else ψ⁻¹) + let Q' : MulChar (ZMod p) ℂ → ZMod p → ℂ := + fun ψ x => Q ψ x * (ν⁻¹ * (if right then ψ else 1)) x + have hQ' : (∑ ψ : MulChar (ZMod p) ℂ, ∑ a : ZMod p, + ‖additiveFourier (Q' ψ) a‖ ^ 2) ≤ S := by + apply le_trans _ hQ + exact Finset.sum_le_sum fun ψ _ => + additiveFourier_character_energy_le (Q ψ) (ν⁻¹ * (if right then ψ else 1)) + have hleft (χ ψ : MulChar (ZMod p) ℂ) : + (fun x => P χ x * quartetLeftTwist true right ν χ ψ x) = + (fun x => P χ x * χ x * η ψ x) := by + funext x + simp only [quartetLeftTwist, ite_true, η, MulChar.coeToFun_mul, Pi.mul_apply] + ring + have hright (χ ψ : MulChar (ZMod p) ℂ) : + (fun x => Q ψ x * quartetRightTwist true right ν χ ψ x) = Q' ψ := by + simp only [quartetRightTwist, ite_true, mul_one, Q'] + simp_rw [hleft, hright] + rw [Finset.sum_comm] + simp_rw [Finset.sum_comm (s := (Finset.univ : Finset (MulChar (ZMod p) ℂ))) + (t := (Finset.univ : Finset (ZMod p)))] + exact friendly_fourier_sum_le P Q' δ S hδ hP hQ' η + +/-- A left-friendly source quartet has the quantitative `src42` bound. -/ +theorem quartetParameterValue_left_friendly_bound {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) + (ε : ℝ) (hmixed : MixedFourierBound g ε) (S : ℝ) + (hS : (∑ ψ : MulChar (ZMod p) ℂ, ∑ a : ZMod p, + ‖additiveFourier (pairAutocorrelation h ψ) a‖ ^ 2) ≤ S) + (right : Bool) (ν : MulChar (ZMod p) ℂ) : + (p : ℝ)⁻¹ * (∑ y : ZMod p, + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * (∑ z : (ZMod p)ˣ, + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * + ∑ t : (ZMod p)ˣ, ‖quartetParameterValue g h true right ν y z t‖ ^ 2)) ≤ + (((p : ℝ) / ((p : ℝ) - 1)) * (ε ^ 4 + Real.sqrt (3 / (p : ℝ)))) * S := by + rw [quartetParameterValue_parseval] + apply left_friendly_fourier_sum_le _ _ _ _ _ _ hS right ν + · have hp : (1 : ℝ) < p := by exact_mod_cast (Fact.out : p.Prime).one_lt + positivity + · intro η a + exact uniform_mellin_bound_of_fourier_bound g hg henergy ε hmixed η a + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/FriendlyRightConvolution.lean b/lean/OAI/NumberTheory/Ostmann/Tree/FriendlyRightConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce2553c7e0c4275c1d3ebdb2868711f9f62435c8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/FriendlyRightConvolution.lean @@ -0,0 +1,37 @@ +import OAI.NumberTheory.Ostmann.Tree.FriendlyConvolution + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem friendly_convolution_right_bound (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (hτ : (τ:ZMod p)^2=1) (hg0 : g 0=0) (hg : l2Sq g≤1) + (hh0 : h 0=0) (hh : l2Sq h≤1) + (α η : MulChar (ZMod p) ℂ → MulChar (ZMod p) ℂ) : + (∑ χ : MulChar (ZMod p) ℂ, ∑ a : ZMod p, ∑ ψ : MulChar (ZMod p) ℂ, + ‖twistedPairFourier g σ χ (α χ) a‖^2 * + ‖twistedPairFourier h τ ψ (ψ*η χ) (-a)‖^2) ≤ + (2*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2)* + ((correlationBound h:ℝ)^4+Real.sqrt (3/(p:ℝ))) := by + have he : (∑ χ : MulChar (ZMod p) ℂ, ∑ a : ZMod p, ∑ ψ : MulChar (ZMod p) ℂ, + ‖twistedPairFourier g σ χ (α χ) a‖^2 * + ‖twistedPairFourier h τ ψ (ψ*η χ) (-a)‖^2) = + ∑ χ : MulChar (ZMod p) ℂ, ∑ a : ZMod p, ∑ ψ : MulChar (ZMod p) ℂ, + ‖twistedPairFourier h τ ψ (ψ*η χ) a‖^2 * + ‖twistedPairFourier g σ χ (α χ) (-a)‖^2 := by + apply Finset.sum_congr rfl + intro χ _ + have hi := (Equiv.neg (ZMod p)).bijective.sum_comp + (fun a => ∑ ψ : MulChar (ZMod p) ℂ, + ‖twistedPairFourier h τ ψ (ψ*η χ) a‖^2 *‖twistedPairFourier g σ χ (α χ) (-a)‖^2) + simpa only [Equiv.neg_apply,neg_neg,mul_comm] using hi + rw [he] + exact friendly_convolution_bound h g τ σ hτ hh0 hh hg0 hg η α + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/HorizontalProjectionBound.lean b/lean/OAI/NumberTheory/Ostmann/Tree/HorizontalProjectionBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..2589c31a04f37d7040c534c160ac72bcbeb3ee34 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/HorizontalProjectionBound.lean @@ -0,0 +1,63 @@ +import OAI.NumberTheory.Ostmann.Tree.CutFiberAverage + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators +open Density +local instance horizontalFiberFintype {A B : Type*} [Fintype A] (f : A → B) (y : B) : + Fintype {x : A // f x=y} := Fintype.ofFinite _ + +def realFiberAverage {A B : Type*} [Fintype A] (f : A → B) (W : A → ℝ) (y : B) : ℝ := + Density.average (fun x : {x : A // f x=y} => W x.val) + +theorem real_average_fiberAverage {A B : Type*} [Group A] [Group B] + [Fintype A] [Fintype B] (f : A →* B) (hf : Function.Surjective f) (W : A → ℝ) : + Density.average W=Density.average (realFiberAverage f W) := by + apply Complex.ofReal_injective + have h := average_fiberAverage f hf (fun x => (W x:ℂ)) + simpa only [Ostmann.Arithmetic.ResidueHaar.average,Density.average,realFiberAverage, + fiberAverage,Complex.ofReal_mul,Complex.ofReal_inv,Complex.ofReal_sum, + Complex.ofReal_natCast] using h + +theorem real_average_surjective {A B : Type*} [Group A] [Group B] + [Fintype A] [Fintype B] (f : A →* B) (hf : Function.Surjective f) (W : B → ℝ) : + Density.average (fun x => W (f x))=Density.average W := by + apply Complex.ofReal_injective + have h := Ostmann.Arithmetic.GroupHaarImage.average_surjective f hf (fun x => (W x:ℂ)) + simpa only [Ostmann.Arithmetic.ResidueHaar.average,Density.average, + Complex.ofReal_mul,Complex.ofReal_inv,Complex.ofReal_sum,Complex.ofReal_natCast] using h + +theorem real_average_pull_fiberAverage {A B : Type*} [Group A] [Group B] + [Fintype A] [Fintype B] (f : A →* B) (hf : Function.Surjective f) (W : A → ℝ) : + Density.average (fun x => realFiberAverage f W (f x))=Density.average W := by + rw [real_average_surjective f hf,←real_average_fiberAverage f hf] + +lemma horizontal_average_fintype_congr {A : Type*} (i j : Fintype A) (f : A → ℝ) : + @Density.average A i f = @Density.average A j f := by + cases Subsingleton.elim i j + rfl + +theorem horizontal_fiber_bound {F : Type*} [Field F] [Fintype F] [DecidableEq F] + {d k : ℕ} (C : Cut d k) (T : Diagram F d) + (W : (Leaves d → Fˣ) → ℝ) (H : (Leaves k → Fˣ) → ℝ) + (hH : ∀ y,0≤H y) + (hW : ∀ M,realFiberAverage C.project W (C.project M)≤ + integrate H (diagramLevelArguments C T M)) : + Density.average W≤((2^(2^k-1):ℕ):ℝ)*Density.average H := by + classical + have he := real_average_pull_fiberAverage C.projectHom C.project_surjective W + have hd := diagram_horizontal_domination C T H hH + simp only [horizontal_average_fintype_congr _ (inferInstance : Fintype (Leaves d → Fˣ)), + horizontal_average_fintype_congr _ (inferInstance : Fintype (Leaves k → Fˣ))] at hd + calc + _ = Density.average (fun M => realFiberAverage C.project W (C.project M)) := he.symm + _ ≤ Density.average (fun M => integrate H (diagramLevelArguments C T M)) := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun M _ => hW M)) (by positivity) + _ ≤ _ := hd + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/IncidenceCirculation.lean b/lean/OAI/NumberTheory/Ostmann/Tree/IncidenceCirculation.lean new file mode 100644 index 0000000000000000000000000000000000000000..6002dd203b83b46237a7880be26c96d68d3f6cef --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/IncidenceCirculation.lean @@ -0,0 +1,134 @@ +import Mathlib.Algebra.BigOperators.Group.List.Basic +import OAI.NumberTheory.Ostmann.Tree.IncidenceCycle +import OAI.NumberTheory.Ostmann.Characters.CycleAction + +namespace OAI + +/-! # A balanced leaf action from an incidence-graph cycle -/ + +namespace Ostmann + +open scoped BigOperators + +theorem list_sum_finset_sum {X I R : Type*} [AddCommMonoid R] + (xs : List X) (s : Finset I) (f : I → X → R) : + (∑ i ∈ s, (xs.map (f i)).sum) = (xs.map fun x => ∑ i ∈ s, f i x).sum := by + induction xs with + | nil => simp + | cons x xs ih => simp only [List.map_cons, List.sum_cons, Finset.sum_add_distrib, ih] + +theorem walk_dart_difference {V R : Type*} [AddCommGroup R] {G : SimpleGraph V} + {u v : V} (w : G.Walk u v) (f : V → R) : + (w.darts.map fun d => f d.fst - f d.snd).sum = f u - f v := by + induction w with + | nil => simp + | cons h w ih => + simp only [SimpleGraph.Walk.darts_cons, List.map_cons, List.sum_cons, ih] + abel + +theorem walk_dart_reverse_difference {V R : Type*} [AddCommGroup R] {G : SimpleGraph V} + {u v : V} (w : G.Walk u v) (f : V → R) : + (w.darts.map fun d => f d.snd - f d.fst).sum = f v - f u := by + induction w with + | nil => simp + | cons h w ih => + simp only [SimpleGraph.Walk.darts_cons, List.map_cons, List.sum_cons, ih] + abel + +theorem incidenceDart_exists {L C Q : Type*} (component : L → C) (quartet : L → Q) + (d : (incidenceGraph component quartet).Dart) : + ∃ i : L, + (d.fst = Sum.inl (component i) ∧ d.snd = Sum.inr (quartet i)) ∨ + (d.fst = Sum.inr (quartet i) ∧ d.snd = Sum.inl (component i)) := by + rcases d with ⟨⟨x, y⟩, h⟩ + cases x with + | inl c => + cases y with + | inl c' => exact False.elim h + | inr q => + obtain ⟨i, hc, hq⟩ := h + exact ⟨i, Or.inl ⟨congrArg Sum.inl hc.symm, congrArg Sum.inr hq.symm⟩⟩ + | inr q => + cases y with + | inr q' => exact False.elim h + | inl c => + obtain ⟨i, hc, hq⟩ := h + exact ⟨i, Or.inr ⟨congrArg Sum.inr hq.symm, congrArg Sum.inl hc.symm⟩⟩ + +noncomputable def incidenceDartLabel {L C Q : Type*} (component : L → C) (quartet : L → Q) + (d : (incidenceGraph component quartet).Dart) : L := + Classical.choose (incidenceDart_exists component quartet d) + +theorem incidenceDartLabel_spec {L C Q : Type*} (component : L → C) (quartet : L → Q) + (d : (incidenceGraph component quartet).Dart) : + (d.fst = Sum.inl (component (incidenceDartLabel component quartet d)) ∧ + d.snd = Sum.inr (quartet (incidenceDartLabel component quartet d))) ∨ + (d.fst = Sum.inr (quartet (incidenceDartLabel component quartet d)) ∧ + d.snd = Sum.inl (component (incidenceDartLabel component quartet d))) := + Classical.choose_spec (incidenceDart_exists component quartet d) + +def incidenceDartSign {L C Q : Type*} {component : L → C} {quartet : L → Q} + (d : (incidenceGraph component quartet).Dart) : ℤ := + match d.fst with + | Sum.inl _ => 1 + | Sum.inr _ => -1 + +noncomputable def incidenceWalkSign {L C Q : Type*} [DecidableEq L] + (component : L → C) (quartet : L → Q) {u v : C ⊕ Q} + (w : (incidenceGraph component quartet).Walk u v) (i : L) : ℤ := + (w.darts.map fun d => if incidenceDartLabel component quartet d = i then incidenceDartSign d else 0).sum + +theorem incidenceWalkSign_block_sum {L C Q B : Type*} [Fintype L] [DecidableEq L] + [DecidableEq B] (component : L → C) (quartet : L → Q) {u v : C ⊕ Q} + (w : (incidenceGraph component quartet).Walk u v) (block : L → B) (b : B) : + (∑ i ∈ Finset.univ.filter (fun i => block i = b), incidenceWalkSign component quartet w i) = + (w.darts.map fun d => if block (incidenceDartLabel component quartet d) = b + then incidenceDartSign d else 0).sum := by + unfold incidenceWalkSign + rw [list_sum_finset_sum] + congr 1 + apply List.map_congr_left + intro d _ + simp + +theorem incidenceDart_component_difference {L C Q : Type*} [DecidableEq C] [DecidableEq Q] + (component : L → C) (quartet : L → Q) (d : (incidenceGraph component quartet).Dart) (c : C) : + (if component (incidenceDartLabel component quartet d) = c then incidenceDartSign d else 0) = + (if d.fst = Sum.inl c then (1 : ℤ) else 0) - (if d.snd = Sum.inl c then 1 else 0) := by + rcases incidenceDartLabel_spec component quartet d with ⟨hfst, hsnd⟩ | ⟨hfst, hsnd⟩ + · simp [incidenceDartSign, hfst, hsnd] + · simp only [incidenceDartSign, hfst, hsnd, Sum.inl.injEq, + Sum.inr_ne_inl, ite_false, zero_sub] + split_ifs <;> rfl + +theorem incidenceDart_quartet_difference {L C Q : Type*} [DecidableEq C] [DecidableEq Q] + (component : L → C) (quartet : L → Q) (d : (incidenceGraph component quartet).Dart) (q : Q) : + (if quartet (incidenceDartLabel component quartet d) = q then incidenceDartSign d else 0) = + (if d.snd = Sum.inr q then (1 : ℤ) else 0) - (if d.fst = Sum.inr q then 1 else 0) := by + rcases incidenceDartLabel_spec component quartet d with ⟨hfst, hsnd⟩ | ⟨hfst, hsnd⟩ + · simp [incidenceDartSign, hfst, hsnd] + · simp only [incidenceDartSign, hfst, hsnd, Sum.inr.injEq, + Sum.inl_ne_inr, ite_false, zero_sub] + split_ifs <;> rfl + +theorem incidenceWalkSign_component_balanced {L C Q : Type*} [Fintype L] [DecidableEq L] + [DecidableEq C] [DecidableEq Q] (component : L → C) (quartet : L → Q) {v : C ⊕ Q} + (w : (incidenceGraph component quartet).Walk v v) (c : C) : + (∑ i ∈ Finset.univ.filter (fun i => component i = c), incidenceWalkSign component quartet w i) = 0 := by + rw [incidenceWalkSign_block_sum] + simp_rw [incidenceDart_component_difference] + simpa only [sub_self] using walk_dart_difference w + (fun x : C ⊕ Q => if x = Sum.inl c then (1 : ℤ) else 0) + +theorem incidenceWalkSign_quartet_balanced {L C Q : Type*} [Fintype L] [DecidableEq L] + [DecidableEq C] [DecidableEq Q] (component : L → C) (quartet : L → Q) {v : C ⊕ Q} + (w : (incidenceGraph component quartet).Walk v v) (q : Q) : + (∑ i ∈ Finset.univ.filter (fun i => quartet i = q), incidenceWalkSign component quartet w i) = 0 := by + rw [incidenceWalkSign_block_sum] + simp_rw [incidenceDart_quartet_difference] + simpa only [sub_self] using walk_dart_reverse_difference w + (fun x : C ⊕ Q => if x = Sum.inr q then (1 : ℤ) else 0) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/IncidenceCycle.lean b/lean/OAI/NumberTheory/Ostmann/Tree/IncidenceCycle.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6ee05bb873f802861ac29d54de94b0f747f602d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/IncidenceCycle.lean @@ -0,0 +1,79 @@ +import Mathlib.Combinatorics.SimpleGraph.Acyclic + +namespace OAI + +/-! +# A cycle in the component--quartet incidence diagram + +There is one edge per leaf. Parallel edges already give the two-edge +cycle used in the manuscript; otherwise the incidence graph is simple, +and at least as many edges as vertices force a cycle. +-/ + +namespace Ostmann + +/-- A finite forest on a nonempty vertex set has fewer edges than vertices. -/ +theorem forest_card_edges_lt {V : Type*} [Fintype V] [Nonempty V] + (G : SimpleGraph V) [Fintype G.edgeSet] (hG : G.IsAcyclic) : + G.edgeFinset.card < Fintype.card V := by + classical + obtain ⟨T, hGT, _, hT⟩ := + (SimpleGraph.connected_top (V := V)).exists_isTree_le_of_le_of_isAcyclic + (show G ≤ ⊤ from le_top) hG + have hcard := hT.card_edgeFinset + have hle := Finset.card_le_card (SimpleGraph.edgeFinset_mono hGT) + omega + +theorem exists_cycle_of_card_edges_ge {V : Type*} [Fintype V] [Nonempty V] + (G : SimpleGraph V) [Fintype G.edgeSet] + (hcard : Fintype.card V ≤ G.edgeFinset.card) : + ∃ v : V, ∃ c : G.Walk v v, c.IsCycle := by + classical + have h : ¬G.IsAcyclic := fun hG => (not_lt_of_ge hcard) (forest_card_edges_lt G hG) + unfold SimpleGraph.IsAcyclic at h + push Not at h + exact h + +def incidenceGraph {L C Q : Type*} (component : L → C) (quartet : L → Q) : + SimpleGraph (C ⊕ Q) where + Adj x y := match x, y with + | .inl c, .inr q => ∃ i, component i = c ∧ quartet i = q + | .inr q, .inl c => ∃ i, component i = c ∧ quartet i = q + | _, _ => False + symm := ⟨by intro x y; cases x <;> cases y <;> exact id⟩ + loopless := ⟨by intro x; cases x <;> exact not_false⟩ + +/-- The incidence diagram has either parallel leaves or a genuine simple cycle. -/ +theorem incidence_parallel_or_cycle {L C Q : Type*} [Fintype L] [Fintype C] [Fintype Q] + [Nonempty L] (component : L → C) (quartet : L → Q) + (hcard : Fintype.card C + Fintype.card Q ≤ Fintype.card L) : + (∃ i j : L, i ≠ j ∧ component i = component j ∧ quartet i = quartet j) ∨ + ∃ v : C ⊕ Q, ∃ c : (incidenceGraph component quartet).Walk v v, c.IsCycle := by + classical + by_cases hinj : Function.Injective (fun i => (component i, quartet i)) + · right + let : Nonempty (C ⊕ Q) := ⟨.inl (component (Classical.choice ‹Nonempty L›))⟩ + let G := incidenceGraph component quartet + let edge : L → G.edgeFinset := fun i => + ⟨s(Sum.inl (component i), Sum.inr (quartet i)), by + simp only [SimpleGraph.mem_edgeFinset, SimpleGraph.mem_edgeSet] + exact ⟨i, rfl, rfl⟩⟩ + have hedge : Function.Injective edge := by + intro i j hij + have he := congrArg (fun e : G.edgeFinset => e.1) hij + rcases Sym2.eq_iff.mp he with h | h + · apply hinj + exact Prod.ext (Sum.inl.inj h.1) (Sum.inr.inj h.2) + · cases h.1 + have hle := Fintype.card_le_of_injective edge hedge + have hV : Fintype.card (C ⊕ Q) ≤ G.edgeFinset.card := by + simpa only [Fintype.card_sum, Fintype.card_coe] using hcard.trans hle + exact exists_cycle_of_card_edges_ge G hV + · left + simp only [Function.Injective, Prod.mk.injEq, not_forall] at hinj + obtain ⟨i, j, ⟨hc, hq⟩, hne⟩ := hinj + exact ⟨i, j, hne, hc, hq⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/IncidenceCycleSigns.lean b/lean/OAI/NumberTheory/Ostmann/Tree/IncidenceCycleSigns.lean new file mode 100644 index 0000000000000000000000000000000000000000..1739fe21951a6f52087c71de4b6e116cc9ebb00c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/IncidenceCycleSigns.lean @@ -0,0 +1,114 @@ +import OAI.NumberTheory.Ostmann.Tree.IncidenceCirculation +import OAI.NumberTheory.Ostmann.Tree.ParallelCycle + +namespace OAI + +/-! # The nonzero balanced sign vector supplied by an incidence cycle -/ + +namespace Ostmann + +open scoped BigOperators + +theorem list_label_sum_eq_zero {X L R : Type*} [DecidableEq L] [AddCommMonoid R] + (xs : List X) (label : X → L) (f : X → R) (i : L) (hi : i ∉ xs.map label) : + (xs.map fun x => if label x = i then f x else 0).sum = 0 := by + apply List.sum_eq_zero + intro r hr + obtain ⟨x, hx, rfl⟩ := List.mem_map.mp hr + have hne : label x ≠ i := fun h => hi (List.mem_map.mpr ⟨x, hx, h⟩) + simp only [hne, ite_false] + +theorem list_label_sum_of_mem {X L R : Type*} [DecidableEq L] [AddCommMonoid R] + (xs : List X) (label : X → L) (f : X → R) (h : (xs.map label).Nodup) + (x : X) (hx : x ∈ xs) : + (xs.map fun y => if label y = label x then f y else 0).sum = f x := by + induction xs with + | nil => simp at hx + | cons y ys ih => + simp only [List.map_cons, List.nodup_cons] at h + rcases List.mem_cons.mp hx with hxy | hx + · subst x + simp only [List.map_cons, List.sum_cons, ite_true] + rw [list_label_sum_eq_zero ys label f (label y) h.1, add_zero] + · have hne : label y ≠ label x := fun heq => h.1 (List.mem_map.mpr ⟨x, hx, heq.symm⟩) + simp only [List.map_cons, List.sum_cons, hne, ite_false, zero_add] + exact ih h.2 hx + +theorem incidenceDart_edge_of_label {L C Q : Type*} + (component : L → C) (quartet : L → Q) (d : (incidenceGraph component quartet).Dart) : + d.edge = s(Sum.inl (component (incidenceDartLabel component quartet d)), + Sum.inr (quartet (incidenceDartLabel component quartet d))) := by + rcases incidenceDartLabel_spec component quartet d with ⟨hfst, hsnd⟩ | ⟨hfst, hsnd⟩ + · simp only [SimpleGraph.Dart.edge, hfst, hsnd] + · simp only [SimpleGraph.Dart.edge, hfst, hsnd, Sym2.eq_swap] + +theorem incidenceWalk_labels_nodup {L C Q : Type*} + (component : L → C) (quartet : L → Q) {u v : C ⊕ Q} + (w : (incidenceGraph component quartet).Walk u v) (hw : w.IsTrail) : + (w.darts.map (incidenceDartLabel component quartet)).Nodup := by + let edge : L → Sym2 (C ⊕ Q) := fun i => s(Sum.inl (component i), Sum.inr (quartet i)) + have hmap : (w.darts.map (incidenceDartLabel component quartet)).map edge = w.edges := by + rw [List.map_map, SimpleGraph.Walk.edges] + apply List.map_congr_left + intro d _ + exact (incidenceDart_edge_of_label component quartet d).symm + exact List.Nodup.of_map edge (hmap.symm ▸ hw.edges_nodup) + +theorem incidenceDartSign_eq_one_or_neg_one {L C Q : Type*} + {component : L → C} {quartet : L → Q} (d : (incidenceGraph component quartet).Dart) : + incidenceDartSign d = 1 ∨ incidenceDartSign d = -1 := by + unfold incidenceDartSign + cases d.fst <;> simp + +theorem incidenceWalkSign_values {L C Q : Type*} [DecidableEq L] + (component : L → C) (quartet : L → Q) {u v : C ⊕ Q} + (w : (incidenceGraph component quartet).Walk u v) (hw : w.IsTrail) (i : L) : + incidenceWalkSign component quartet w i = 0 ∨ + incidenceWalkSign component quartet w i = 1 ∨ incidenceWalkSign component quartet w i = -1 := by + by_cases hi : i ∈ w.darts.map (incidenceDartLabel component quartet) + · obtain ⟨d, hd, rfl⟩ := List.mem_map.mp hi + right + rw [incidenceWalkSign, list_label_sum_of_mem _ _ _ (incidenceWalk_labels_nodup component quartet w hw) d hd] + exact incidenceDartSign_eq_one_or_neg_one d + · left + exact list_label_sum_eq_zero _ _ _ i hi + +theorem incidenceCycleSign_nonzero {L C Q : Type*} [DecidableEq L] + (component : L → C) (quartet : L → Q) {v : C ⊕ Q} + (w : (incidenceGraph component quartet).Walk v v) (hw : w.IsCycle) : + ∃ i : L, incidenceWalkSign component quartet w i = 1 ∨ incidenceWalkSign component quartet w i = -1 := by + have hne : w.darts ≠ [] := fun h => hw.not_nil (SimpleGraph.Walk.darts_eq_nil.mp h) + obtain ⟨d, hd⟩ := List.exists_mem_of_ne_nil w.darts hne + refine ⟨incidenceDartLabel component quartet d, ?_⟩ + rw [incidenceWalkSign, list_label_sum_of_mem _ _ _ + (incidenceWalk_labels_nodup component quartet w hw.isTrail) d hd] + exact incidenceDartSign_eq_one_or_neg_one d + +/-- The edge/vertex count produces an actual nontrivial, balanced reciprocal leaf action. -/ +theorem exists_balanced_incidence_sign {L C Q : Type*} + [Fintype L] [Fintype C] [Fintype Q] [Nonempty L] + [DecidableEq L] [DecidableEq C] [DecidableEq Q] + (component : L → C) (quartet : L → Q) + (hcard : Fintype.card C + Fintype.card Q ≤ Fintype.card L) : + ∃ sign : L → ℤ, + (∃ i, sign i = 1 ∨ sign i = -1) ∧ + (∀ i, sign i = 0 ∨ sign i = 1 ∨ sign i = -1) ∧ + (∀ c, (∑ i ∈ Finset.univ.filter (fun i => component i = c), sign i) = 0) ∧ + (∀ q, (∑ i ∈ Finset.univ.filter (fun i => quartet i = q), sign i) = 0) := by + rcases incidence_parallel_or_cycle component quartet hcard with ⟨i, j, hij, hc, hq⟩ | ⟨v, w, hw⟩ + · refine ⟨parallelCycleSign i j, ⟨i, Or.inl (parallelCycleSign_left i j hij)⟩, ?_, + parallelCycleSign_balanced component i j hc, parallelCycleSign_balanced quartet i j hq⟩ + intro k + by_cases hki : k = i + · subst k; exact Or.inr (Or.inl (parallelCycleSign_left i j hij)) + by_cases hkj : k = j + · subst k; exact Or.inr (Or.inr (parallelCycleSign_right i j hij)) + exact Or.inl (parallelCycleSign_other i j k hki hkj) + · exact ⟨incidenceWalkSign component quartet w, incidenceCycleSign_nonzero component quartet w hw, + incidenceWalkSign_values component quartet w hw.isTrail, + incidenceWalkSign_component_balanced component quartet w, + incidenceWalkSign_quartet_balanced component quartet w⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/IndependentCoordinate.lean b/lean/OAI/NumberTheory/Ostmann/Tree/IndependentCoordinate.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a6dbc14830c897d92e2b7b6106b3bf39f084c1f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/IndependentCoordinate.lean @@ -0,0 +1,37 @@ +import OAI.NumberTheory.Ostmann.Construction.FiniteProductPrior + +namespace OAI + +/-! # Separating an internal-prime representative from the other samples -/ + +namespace Ostmann + +open scoped BigOperators + +theorem productPrior_insertNth {A : Type*} {n : ℕ} + (μ : Fin (n + 1) → A → ℝ) (i : Fin (n + 1)) (a : A) (x : Fin n → A) : + productPrior μ (i.insertNth a x) = μ i a * productPrior (fun j => μ (i.succAbove j)) x := by + unfold productPrior + rw [Fin.prod_univ_succAbove _ i] + simp only [Fin.insertNth_apply_same, Fin.insertNth_apply_succAbove] + +theorem sum_productPrior_insertNth {A : Type*} [Fintype A] {n : ℕ} + (μ : Fin (n + 1) → A → ℝ) (i : Fin (n + 1)) (f : (Fin (n + 1) → A) → ℝ) : + (∑ v, productPrior μ v * f v) = + ∑ x : Fin n → A, productPrior (fun j => μ (i.succAbove j)) x * + ∑ a : A, μ i a * f (i.insertNth a x) := by + have h := (Fin.insertNthEquiv (fun _ : Fin (n + 1) => A) i).sum_comp + (fun v => productPrior μ v * f v) + rw [← h, Fintype.sum_prod_type, Finset.sum_comm] + apply Finset.sum_congr rfl + intro x _ + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro a _ + change productPrior μ (i.insertNth a x) * f (i.insertNth a x) = _ + rw [productPrior_insertNth] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/IndependentMajorants.lean b/lean/OAI/NumberTheory/Ostmann/Tree/IndependentMajorants.lean new file mode 100644 index 0000000000000000000000000000000000000000..5947d14430ae09643dbec280c0aabeb96c27c524 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/IndependentMajorants.lean @@ -0,0 +1,58 @@ +import OAI.NumberTheory.Ostmann.Tree.ConstrainedCharacterSum +import OAI.NumberTheory.Ostmann.Tree.QuartetFiberIndependence + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators +open Density + +theorem average_pi_product_real {I : Type*} [Fintype I] [DecidableEq I] + {A : I → Type*} [∀ i,Fintype (A i)] (f : ∀ i,A i → ℝ) : + average (fun x : ∀ i,A i => ∏ i,f i (x i)) = ∏ i,average (f i) := by + classical + simp only [average,Fintype.card_pi,Nat.cast_prod,Finset.prod_inv_distrib, + Finset.prod_mul_distrib,← Fintype.prod_sum] + +variable {I C : Type*} [Fintype I] [DecidableEq I] [CommGroup C] [Fintype C] [DecidableEq C] +variable {A : I → Type*} [∀ i,Fintype (A i)] + +def constrainedMajorant (e : I → C ≃ C) (B : ∀ i,C → A i → ℝ) (x : ∀ i,A i) : ℝ := + ∑ ρ : I → C,if (∏ i,e i (ρ i))=1 then ∏ i,B i (ρ i) (x i) else 0 + +omit [∀ i,Fintype (A i)] in +theorem constrainedMajorant_nonneg (e : I → C ≃ C) (B : ∀ i,C → A i → ℝ) + (hB : ∀ i χ x,0≤B i χ x) (x : ∀ i,A i) : 0≤constrainedMajorant e B x := by + apply Finset.sum_nonneg + intro ρ _ + split_ifs + · exact Finset.prod_nonneg (fun i _ => hB i (ρ i) (x i)) + · exact le_rfl + +theorem constrainedMajorant_average (e : I → C ≃ C) (B : ∀ i,C → A i → ℝ) : + average (constrainedMajorant e B) = + ∑ ρ : I → C,if (∏ i,e i (ρ i))=1 then ∏ i,average (B i (ρ i)) else 0 := by + conv_lhs => unfold average constrainedMajorant + rw [Finset.sum_comm,Finset.mul_sum] + apply Finset.sum_congr rfl + intro ρ _ + split_ifs with h + · simpa only [average,h,ite_true] using average_pi_product_real (fun i => B i (ρ i)) + · simp + +theorem constrainedMajorant_average_bound (e : I → C ≃ C) (B : ∀ i,C → A i → ℝ) + (hB : ∀ i χ x,0≤B i χ x) (j : I) (δ : ℝ) + (hδ : ∀ χ,average (B j χ)≤δ) : + average (constrainedMajorant e B) ≤ + δ*∏ i : {i : I // i≠j},∑ χ : C,average (B i χ) := by + rw [constrainedMajorant_average] + apply Ostmann.FiniteField.constrained_character_sum_bound j e + (fun i χ => average (B i χ)) _ δ hδ + intro i χ + exact mul_nonneg (by positivity) (Finset.sum_nonneg (fun x _ => hB i χ x)) + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/IndependentUniformBound.lean b/lean/OAI/NumberTheory/Ostmann/Tree/IndependentUniformBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..88d9cf4bff104c82c11355507240cfceefb2ea76 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/IndependentUniformBound.lean @@ -0,0 +1,34 @@ +import OAI.NumberTheory.Ostmann.Tree.IndependentMajorants + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators +open Density +variable {I C : Type*} [Fintype I] [DecidableEq I] [CommGroup C] [Fintype C] [DecidableEq C] +variable {A : I → Type*} [∀ i,Fintype (A i)] + +theorem constrainedMajorant_average_uniform (e : I → C ≃ C) (B : ∀ i,C → A i → ℝ) + (hB : ∀ i χ x,0≤B i χ x) (j : I) (δ M : ℝ) (hδ0 : 0≤δ) (hM : 1≤M) + (hδ : ∀ χ,average (B j χ)≤δ) + (hmass : ∀ i,(∑ χ : C,average (B i χ))≤M) : + average (constrainedMajorant e B)≤δ*M^(Fintype.card I) := by + apply (constrainedMajorant_average_bound e B hB j δ hδ).trans + apply mul_le_mul_of_nonneg_left _ hδ0 + calc + _ ≤ ∏ _i : {i : I // i≠j},M := by + apply Finset.prod_le_prod₀ + · intro i _ + apply Finset.sum_nonneg + intro χ _ + exact mul_nonneg (by positivity) (Finset.sum_nonneg (fun x _ => hB i χ x)) + · intro i _ + exact hmass i + _ = M^(Fintype.card {i : I // i≠j}) := by simp + _ ≤ M^(Fintype.card I) := pow_le_pow_right₀ hM (Fintype.card_subtype_le _) + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/MeanInner.lean b/lean/OAI/NumberTheory/Ostmann/Tree/MeanInner.lean new file mode 100644 index 0000000000000000000000000000000000000000..26cc2aee8910da503ce1bcb06898e37492e9689f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/MeanInner.lean @@ -0,0 +1,82 @@ +import OAI.NumberTheory.Ostmann.Tree.AffineHilbertSchmidt +import OAI.NumberTheory.Ostmann.Tree.Parseval + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [NeZero p] + +def meanInner (f h : ZMod p → ℂ) : ℂ := mean (fun t => conj (f t)*h t) + +theorem meanInner_self (f : ZMod p → ℂ) : meanInner f f = (l2Sq f : ℂ) := by + simp only [meanInner, mean, l2Sq, Complex.conj_mul'] + push_cast + rfl + +theorem mean_add (f h : ZMod p → ℂ) : mean (fun t => f t+h t) = mean f+mean h := by + simp only [mean, Finset.sum_add_distrib, mul_add] + +theorem mean_const_mul (c : ℂ) (f : ZMod p → ℂ) : + mean (fun t => c*f t) = c*mean f := by + simp only [mean, ← Finset.mul_sum] + ring + +theorem mean_const (c : ℂ) : mean (fun _ : ZMod p => c) = c := by + have hp : (p:ℂ) ≠ 0 := by exact_mod_cast NeZero.ne p + simp only [mean, Finset.sum_const, Finset.card_univ, ZMod.card, nsmul_eq_mul] + exact inv_mul_cancel_left₀ hp c + +theorem mean_conj (f : ZMod p → ℂ) : mean (fun t => conj (f t)) = conj (mean f) := by + simp only [mean, map_mul, map_inv₀, map_natCast, map_sum] + +theorem l2Sq_const_mul (c : ℂ) (f : ZMod p → ℂ) : + l2Sq (fun t => c*f t) = ‖c‖^2*l2Sq f := by + simp only [l2Sq, norm_mul, mul_pow, ← Finset.mul_sum] + ring + +theorem l2Sq_const (c : ℂ) : l2Sq (fun _ : ZMod p => c) = ‖c‖^2 := by + have hp : (p:ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p + simp only [l2Sq, Finset.sum_const, Finset.card_univ, ZMod.card, nsmul_eq_mul] + exact inv_mul_cancel_left₀ hp _ + +theorem l2Sq_conj (f : ZMod p → ℂ) : l2Sq (fun t => conj (f t)) = l2Sq f := by + simp only [l2Sq, Complex.norm_conj] + +theorem mean_sub_mean (f : ZMod p → ℂ) : mean (fun t => f t-mean f) = 0 := by + simp only [mean, Finset.sum_sub_distrib, Finset.sum_const, Finset.card_univ, ZMod.card, + nsmul_eq_mul, mul_sub] + have hp : (p:ℂ) ≠ 0 := by exact_mod_cast NeZero.ne p + field_simp + ring + +theorem meanInner_norm_sq_le (f h : ZMod p → ℂ) : + ‖meanInner f h‖^2 ≤ l2Sq f*l2Sq h := by + have hc := norm_sum_mul_sq_le Finset.univ (fun t => conj (f t)) h + simp only [Complex.norm_conj] at hc + simp only [meanInner, mean, norm_mul, norm_inv, Complex.norm_natCast, mul_pow] + calc + _ ≤ ((p:ℝ)⁻¹)^2 * ((∑ t, ‖f t‖^2)*(∑ t, ‖h t‖^2)) := + mul_le_mul_of_nonneg_left hc (sq_nonneg _) + _ = _ := by dsimp [l2Sq]; ring + +theorem l2Sq_add_const (f : ZMod p → ℂ) (c : ℂ) (hf : mean f=0) : + l2Sq (fun t => f t+c) = l2Sq f+‖c‖^2 := by + apply Complex.ofReal_injective + rw [Complex.ofReal_add, ← meanInner_self, ← meanInner_self, Complex.ofReal_pow] + rw [← Complex.conj_mul' c] + unfold meanInner + have he : (fun t => conj (f t+c)*(f t+c)) = + (fun t => ((conj (f t)*f t + conj c*f t) + c*conj (f t)) + conj c*c) := by + funext t + rw [map_add] + ring + rw [he, mean_add, mean_add, mean_add, mean_const_mul, mean_const_mul, + mean_conj, mean_const, hf] + simp + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/Mellin.lean b/lean/OAI/NumberTheory/Ostmann/Tree/Mellin.lean new file mode 100644 index 0000000000000000000000000000000000000000..995e1e03ce72ceaaf2d5fbb7b5390e48ebc48e04 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/Mellin.lean @@ -0,0 +1,91 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F : Type*} [Field F] [Fintype F] +variable [DecidableEq F] +local instance : Fintype (MulChar F ℂ) := Fintype.ofFinite _ + +def mellin (f : Fˣ → ℂ) (χ : MulChar F ℂ) : ℂ := + (Fintype.card Fˣ : ℂ)⁻¹ * ∑ u, f u * conj (χ u) + +theorem mulChar_card : Fintype.card (MulChar F ℂ) = Fintype.card Fˣ := by + simpa only [Nat.card_eq_fintype_card] using + MulChar.card_eq_card_units_of_hasEnoughRootsOfUnity F ℂ + +theorem sum_mulChar_apply (u : Fˣ) : + ∑ χ : MulChar F ℂ, χ u = if u=1 then (Fintype.card Fˣ : ℂ) else 0 := by + classical + by_cases hu : u=1 + · simp [hu, mulChar_card] + · simp only [hu, ite_false] + have huv : (u : F) ≠ 1 := by + intro h + exact hu (Units.ext h) + obtain ⟨ψ,hψ⟩ := MulChar.exists_apply_ne_one_of_hasEnoughRootsOfUnity F ℂ huv + apply eq_zero_of_mul_eq_self_left hψ + rw [Finset.mul_sum] + simp_rw [← MulChar.mul_apply] + exact (Equiv.mulLeft ψ).bijective.sum_comp (fun χ : MulChar F ℂ => χ u) + +omit [DecidableEq F] in +theorem conj_mulChar_apply (χ : MulChar F ℂ) (u : Fˣ) : + conj (χ u) = χ (u⁻¹ : Fˣ) := by + change star (χ (u : F)) = χ (u⁻¹ : Fˣ) + rw [MulChar.star_apply', MulChar.inv_apply'] + rw [Units.val_inv_eq_inv_val] + +theorem sum_mulChar_kernel (u v : Fˣ) : + ∑ χ : MulChar F ℂ, conj (χ u) * χ v = + if u=v then (Fintype.card Fˣ : ℂ) else 0 := by + classical + simp_rw [conj_mulChar_apply, ← map_mul, ← Units.val_mul] + rw [sum_mulChar_apply] + simp only [inv_mul_eq_one] + +theorem mellin_inversion (f : Fˣ → ℂ) (v : Fˣ) : + ∑ χ : MulChar F ℂ, mellin f χ * χ v = f v := by + classical + simp only [mellin, Finset.sum_mul, mul_assoc, Finset.mul_sum] + rw [Finset.sum_comm] + conv_lhs => arg 2; ext u; rw [← Finset.mul_sum, ← Finset.mul_sum, sum_mulChar_kernel] + simp only [mul_ite, mul_zero, Finset.sum_ite_eq', Finset.mem_univ, ite_true] + have hN : (Fintype.card Fˣ : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero + field_simp + +theorem mellin_parseval_complex (f : Fˣ → ℂ) : + ∑ χ : MulChar F ℂ, conj (mellin f χ) * mellin f χ = + (Fintype.card Fˣ : ℂ)⁻¹ * ∑ u, conj (f u) * f u := by + calc + _ = ∑ χ : MulChar F ℂ, ∑ u : Fˣ, + (Fintype.card Fˣ : ℂ)⁻¹ * conj (f u) * (mellin f χ * χ u) := by + apply Finset.sum_congr rfl + intro χ _ + have hm : conj (mellin f χ) = + (Fintype.card Fˣ : ℂ)⁻¹ * ∑ u, conj (f u) * χ u := by + simp [mellin] + rw [hm, Finset.mul_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro u _ + ring + _ = (Fintype.card Fˣ : ℂ)⁻¹ * ∑ u, conj (f u) * f u := by + rw [Finset.sum_comm, Finset.mul_sum] + apply Finset.sum_congr rfl + intro u _ + rw [← Finset.mul_sum, mellin_inversion] + ring + +theorem mellin_parseval (f : Fˣ → ℂ) : + ∑ χ : MulChar F ℂ, ‖mellin f χ‖ ^ 2 = + (Fintype.card Fˣ : ℝ)⁻¹ * ∑ u, ‖f u‖ ^ 2 := by + apply Complex.ofReal_injective + push_cast + simpa only [Complex.conj_mul', Complex.ofReal_pow] using mellin_parseval_complex f + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/MellinSquare.lean b/lean/OAI/NumberTheory/Ostmann/Tree/MellinSquare.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c9665f834a55a569455976c2263e4fee080f7b7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/MellinSquare.lean @@ -0,0 +1,95 @@ +import OAI.NumberTheory.Ostmann.Tree.AffineEnergy +import OAI.NumberTheory.Ostmann.Tree.Mellin +import OAI.NumberTheory.Ostmann.Tree.UnitSums + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] +local instance : Fintype (MulChar F ℂ) := Fintype.ofFinite _ + +theorem sum_units_mulChar (χ : MulChar F ℂ) : + ∑ u : Fˣ, χ u = if χ=1 then (Fintype.card Fˣ:ℂ) else 0 := by + classical + by_cases hχ : χ=1 + · simp [hχ] + · rw [sum_units_of_zero χ χ.map_zero] + simpa only [hχ, ite_false] using MulChar.sum_eq_zero_of_ne_one hχ + +theorem sum_units_character_kernel (χ ρ : MulChar F ℂ) : + ∑ u : Fˣ, χ u*conj (ρ u) = if χ=ρ then (Fintype.card Fˣ:ℂ) else 0 := by + classical + have hs (u : Fˣ) : χ u*conj (ρ u)=(χ*ρ⁻¹) u := by + rw [MulChar.mul_apply] + congr 1 + exact MulChar.star_apply' ρ u + simp_rw [hs] + rw [sum_units_mulChar] + simp only [mul_inv_eq_one] + +theorem character_square_fiber_card (S : Finset (MulChar F ℂ)) (ρ : MulChar F ℂ) + (hS : ∀ χ ∈ S, χ^2=ρ) : S.card ≤ 2 := by + classical + let e : MulChar F ℂ ≃* Fˣ := (MulChar.mulEquiv_units F ℂ).some + by_cases he : S.Nonempty + · obtain ⟨χ0,hχ0⟩ := he + have hi : Set.InjOn e (↑S : Set (MulChar F ℂ)) := e.injective.injOn + rw [← Finset.card_image_of_injOn hi] + calc + (S.image e).card ≤ ({e χ0,-e χ0} : Finset Fˣ).card := by + apply Finset.card_le_card + intro z hz + obtain ⟨χ,hχ,rfl⟩ := Finset.mem_image.mp hz + have hp : (e χ)^2=(e χ0)^2 := by + rw [← map_pow, ← map_pow, hS χ hχ, hS χ0 hχ0] + rcases Units.sq_eq_sq_iff_eq_or_eq_neg.mp hp with h | h <;> simp [h] + _ ≤ 2 := Finset.card_le_two + · simp [Finset.not_nonempty_iff_eq_empty.mp he] + +theorem mulChar_norm_unit (χ : MulChar F ℂ) (u : Fˣ) : ‖χ u‖=1 := by + simpa only [MulChar.coe_equivToUnitHom] using + Complex.norm_eq_one_of_mem_rootsOfUnity (MulChar.apply_mem_rootsOfUnity (χ := χ) u) + +theorem mellin_square_expansion (c : MulChar F ℂ → ℂ) (K : Fˣ) (ρ : MulChar F ℂ) : + mellin (fun z : Fˣ => ∑ χ : MulChar F ℂ, c χ*χ (K*z^2)) ρ = + ∑ χ : MulChar F ℂ with χ^2=ρ, c χ*χ K := by + classical + unfold mellin + simp only [Finset.sum_mul] + rw [Finset.sum_comm, Finset.mul_sum] + rw [Finset.sum_filter] + apply Finset.sum_congr rfl + intro χ _ + have hval (z : Fˣ) : c χ*χ (K*z^2)*conj (ρ z) = + (c χ*χ K)*((χ^2) z*conj (ρ z)) := by + rw [map_mul, map_pow, MulChar.pow_apply_coe] + ring + simp_rw [hval] + rw [← Finset.mul_sum, sum_units_character_kernel] + have hN : (Fintype.card Fˣ:ℂ) ≠ 0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero + split_ifs <;> simp_all + field_simp + +theorem mellin_square_pullback (f : Fˣ → ℂ) (K : Fˣ) (ρ : MulChar F ℂ) : + ‖mellin (fun z : Fˣ => f (K*z^2)) ρ‖^2 ≤ + 2*∑ χ : MulChar F ℂ with χ^2=ρ, ‖mellin f χ‖^2 := by + classical + have he : (fun z : Fˣ => f (K*z^2)) = + (fun z : Fˣ => ∑ χ : MulChar F ℂ, mellin f χ*χ (K*z^2)) := by + funext z + exact (mellin_inversion f (K*z^2)).symm + rw [he, mellin_square_expansion] + let S : Finset (MulChar F ℂ) := Finset.univ.filter (fun χ => χ^2=ρ) + have hc : S.card ≤ 2 := character_square_fiber_card S ρ + (fun χ hχ => (Finset.mem_filter.mp hχ).2) + have hs := norm_sum_sq_le_card S (fun χ => mellin f χ*χ K) + simp only [norm_mul, mulChar_norm_unit, mul_one] at hs + have hcR : (S.card:ℝ)≤2 := by exact_mod_cast hc + exact hs.trans (mul_le_mul_of_nonneg_right hcR (Finset.sum_nonneg (fun _ _ => sq_nonneg _))) + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/MellinTransform.lean b/lean/OAI/NumberTheory/Ostmann/Tree/MellinTransform.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce810ff75f2d5e42a05f3b8e0e8ca047b6da162c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/MellinTransform.lean @@ -0,0 +1,43 @@ +import OAI.NumberTheory.Ostmann.Tree.MellinSquare + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] + +theorem mellin_const_mul (f : Fˣ → ℂ) (c : ℂ) (χ : MulChar F ℂ) : + mellin (fun t => c*f t) χ=c*mellin f χ := by + simp only [mellin, Finset.mul_sum] + apply Finset.sum_congr rfl + intro t _ + ring + +theorem mellin_sum {ι : Type*} (S : Finset ι) (f : ι → Fˣ → ℂ) (χ : MulChar F ℂ) : + mellin (fun t => ∑ i ∈ S, f i t) χ=∑ i ∈ S, mellin (f i) χ := by + simp only [mellin, Finset.sum_mul, Finset.mul_sum] + rw [Finset.sum_comm] + +theorem mellin_mulRight (f : Fˣ → ℂ) (u : Fˣ) (χ : MulChar F ℂ) : + mellin (fun t => f (t*u)) χ=χ u*mellin f χ := by + have hc : χ u*conj (χ u)=1 := by + rw [Complex.mul_conj', mulChar_norm_unit] + norm_num + have he (t : Fˣ) : f (t*u)*conj (χ t)=χ u*(f (t*u)*conj (χ (t*u))) := by + rw [map_mul,map_mul] + calc + _ = (f (t*u)*conj (χ t))*(χ u*conj (χ u)) := by rw [hc]; ring + _ = _ := by ring + unfold mellin + simp_rw [he] + rw [← Finset.mul_sum] + have hs := (Equiv.mulRight u).bijective.sum_comp (fun t : Fˣ => f t*conj (χ t)) + change (∑ t : Fˣ, f (t*u)*conj (χ (t*u)))=∑ t : Fˣ, f t*conj (χ t) at hs + rw [hs] + ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/NonnegativeDifference.lean b/lean/OAI/NumberTheory/Ostmann/Tree/NonnegativeDifference.lean new file mode 100644 index 0000000000000000000000000000000000000000..6c559247f25c0b9fd4372d01747d0068a556db57 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/NonnegativeDifference.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.Ostmann.Tree.CrossMajorantBounds + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +variable {p : ℕ} [Fact p.Prime] + +theorem unitMean_nonneg (f : ZMod p → ℝ) (hf : ∀ x,0≤f x) : 0≤unitMean f := by + unfold unitMean + exact mul_nonneg (by positivity) (Finset.sum_nonneg (fun x _ => hf x)) + +theorem unitMean_sum {I : Type*} (S : Finset I) (f : I → ZMod p → ℝ) : + unitMean (fun y => ∑ i ∈ S,f i y)=∑ i ∈ S,unitMean (f i) := by + unfold unitMean + rw [Finset.sum_comm,Finset.mul_sum] + +def nonnegativeDifference (A B : ZMod p → ℝ) (y : ZMod p) : ℝ := + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹*∑ d : ZMod p,A d*B (d-y) + +theorem nonnegativeDifference_nonneg (A B : ZMod p → ℝ) + (hA : ∀ d,0≤A d) (hB : ∀ d,0≤B d) (y : ZMod p) : + 0≤nonnegativeDifference A B y := by + exact mul_nonneg (by positivity) (Finset.sum_nonneg (fun d _ => mul_nonneg (hA d) (hB _))) + +theorem nonnegativeDifference_mean (A B : ZMod p → ℝ) + (hA : ∀ d,0≤A d) (hB : ∀ d,0≤B d) : + unitMean (nonnegativeDifference A B) ≤ + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2*((∑ d,A d)*(∑ e,B e)) := by + unfold unitMean nonnegativeDifference + rw [← Finset.mul_sum] + calc + _ = (Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2*(∑ y : (ZMod p)ˣ,∑ d : ZMod p,A d*B (d-y)) := by ring + _ ≤ (Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2*(∑ y : ZMod p,∑ d : ZMod p,A d*B (d-y)) := by + apply mul_le_mul_of_nonneg_left _ (sq_nonneg _) + exact sum_units_le (fun y : ZMod p => ∑ d : ZMod p,A d*B (d-y)) + (fun y => Finset.sum_nonneg (fun d _ => mul_nonneg (hA d) (hB _))) + _ = _ := by rw [sum_difference_products] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/OmittedCoordinate.lean b/lean/OAI/NumberTheory/Ostmann/Tree/OmittedCoordinate.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c24f52cf9bfa7bbb5df967088b5e82f2a048cb8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/OmittedCoordinate.lean @@ -0,0 +1,36 @@ +import OAI.NumberTheory.Ostmann.Tree.IndependentCoordinate +import OAI.NumberTheory.Ostmann.Characters.PolynomialLineBounds + +namespace OAI + +/-! # Independence supplied by an absent compensation coordinate -/ + +namespace Ostmann + +theorem polynomial_eval_insertNth_independent {A R : Type*} [CommRing R] {n : ℕ} + (value : A → R) (P : MvPolynomial (Fin (n + 1)) ℤ) (i : Fin (n + 1)) + (hi : i ∉ P.vars) (x : Fin n → A) (a b : A) : + MvPolynomial.eval₂Hom (Int.castRingHom R) + (fun j => value ((i.insertNth a x : Fin (n + 1) → A) j)) P = + MvPolynomial.eval₂Hom (Int.castRingHom R) + (fun j => value ((i.insertNth b x : Fin (n + 1) → A) j)) P := by + apply MvPolynomial.eval₂Hom_congr' rfl _ rfl + intro j hj _ + have hji : j ≠ i := by + intro heq + exact hi (heq ▸ hj) + have hjrange : j ∈ Set.range i.succAbove := by + rw [Fin.range_succAbove] + exact hji + obtain ⟨q, rfl⟩ := hjrange + simp only [Fin.insertNth_apply_succAbove] + +theorem integerTestValue_insertNth_independent {A : Type*} {n : ℕ} + (value : A → ℤ) (P : MvPolynomial (Fin (n + 1)) ℤ) (i : Fin (n + 1)) + (hi : i ∉ P.vars) (x : Fin n → A) (a b : A) : + integerTestValue value P (i.insertNth a x) = integerTestValue value P (i.insertNth b x) := + polynomial_eval_insertNth_independent value P i hi x a b + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairCoefficientMeans.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairCoefficientMeans.lean new file mode 100644 index 0000000000000000000000000000000000000000..b83d2690bf1db96a15db815c767cf3ec176d20d7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairCoefficientMeans.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.Ostmann.Tree.PairSquareMoment + +namespace OAI + +/-! # Small individual and bounded total means of pair coefficients -/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable local instance pairCoefficientMeansFintype {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +theorem autocorrelation_energy_le_fourier_sup {p : ℕ} [Fact p.Prime] + (f : ZMod p → ℂ) (ε : ℝ) (hε : 0 ≤ ε) + (hflat : ∀ a, ‖additiveFourier f a‖ ≤ ε) : + (∑ d : ZMod p, ‖additiveAutocorrelation f d‖ ^ 2) ≤ + ε ^ 2 * ∑ x : ZMod p, ‖f x‖ ^ 2 := by + rw [additiveFourier_energy (additiveAutocorrelation f)] + simp only [additiveFourier_autocorrelation, Complex.norm_real, Real.norm_eq_abs, sq_abs] + calc + _ ≤ (p : ℝ) * ∑ a : ZMod p, ε ^ 2 * ‖additiveFourier f a‖ ^ 2 := by + apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) + apply Finset.sum_le_sum + intro a _ + rw [pow_two (‖additiveFourier f a‖ ^ 2)] + exact mul_le_mul_of_nonneg_right + ((sq_le_sq₀ (norm_nonneg _) hε).mpr (hflat a)) (sq_nonneg _) + _ = _ := by + rw [← Finset.mul_sum, mul_left_comm, ← additiveFourier_energy f] + +theorem fieldPairCoefficientMoment_le_autocorrelation {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (d : ZMod p) : + fieldPairCoefficientMoment g χ d ≤ + ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2 * + ‖additiveAutocorrelation (characterTwist g χ) d‖ ^ 2 := by + by_cases hd : d = 0 + · rw [hd, fieldPairCoefficientMoment_zero] + positivity + · let du : (ZMod p)ˣ := Units.mk0 d hd + have he : (fun t : (ZMod p)ˣ => fieldBottomPairValue g d t) = bottomPairValue g du := by + funext t + simp only [fieldBottomPairValue, hd, Units.ne_zero, dite_false, Units.mk0_val, du] + unfold fieldPairCoefficientMoment + rw [he, bottomPair_mellin_autocorrelation] + simp only [norm_mul, norm_div, Complex.norm_natCast, mul_pow, du, Units.val_mk0] + exact le_rfl + +theorem fieldPairCoefficientMoment_mean_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (hg : g 0 = 0) (χ : MulChar (ZMod p) ℂ) + (ε : ℝ) (hε : 0 ≤ ε) (hflat : ∀ a, ‖additiveFourier (characterTwist g χ) a‖ ≤ ε) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) : + (∑ d : ZMod p, fieldPairCoefficientMoment g χ d) / (Fintype.card (ZMod p)ˣ : ℝ) ≤ + ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 3 * ε ^ 2 := by + have hnorm (x : ZMod p) : ‖characterTwist g χ x‖ = ‖g x‖ := by + by_cases hx : x = 0 + · simp [hx, characterTwist, hg] + · have hn := norm_mulChar_unit χ (Units.mk0 x hx) + simpa only [characterTwist, norm_mul, Complex.norm_conj, Units.val_mk0, hn, mul_one] + using congrArg (fun t : ℝ => ‖g x‖ * t) hn + have hauto := autocorrelation_energy_le_fourier_sup (characterTwist g χ) ε hε hflat + simp_rw [hnorm] at hauto + have hsum := (Finset.sum_le_sum fun d (_ : d ∈ (Finset.univ : Finset (ZMod p))) => + fieldPairCoefficientMoment_le_autocorrelation g χ d) + rw [← Finset.mul_sum] at hsum + have hU : 0 ≤ (Fintype.card (ZMod p)ˣ : ℝ) := Nat.cast_nonneg _ + calc + _ ≤ (((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2 * (ε ^ 2 * p)) / + (Fintype.card (ZMod p)ˣ : ℝ) := by + apply div_le_div_of_nonneg_right _ hU + exact hsum.trans (mul_le_mul_of_nonneg_left + (hauto.trans (mul_le_mul_of_nonneg_left henergy (sq_nonneg _))) (sq_nonneg _)) + _ = _ := by ring + +theorem fieldPairCoefficientMoment_total_mean_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) : + (∑ χ : MulChar (ZMod p) ℂ, + (∑ d : ZMod p, fieldPairCoefficientMoment g χ d) / + (Fintype.card (ZMod p)ˣ : ℝ)) ≤ + ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2 := by + rw [← Finset.sum_div, Finset.sum_comm] + simp_rw [sum_fieldPairCoefficientMoment] + exact fieldPairMoment_mean_le g hg henergy + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairCoordinates.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..1eba3b0e0da6ed627550925af9e0390c10ec57cb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairCoordinates.lean @@ -0,0 +1,65 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +variable {F : Type*} [Field F] + +def PairInput (F : Type*) [Field F] := {v : F × F // v.1 ≠ 0 ∧ v.2 ≠ 0 ∧ v.2 ≠ 1} + +def PairOutput (F : Type*) [Field F] := {v : F × F // v.1 ≠ 0 ∧ v.2 ≠ 0 ∧ v.1 ≠ v.2} + +def pairFirst (σ : Fˣ) (d t : F) : F := (σ:F)*d*t/(t-1) +def pairSecond (σ : Fˣ) (d t : F) : F := (σ:F)*d/(t-1) + +theorem pair_difference (σ : Fˣ) (d t : F) (ht : t ≠ 1) : + pairFirst σ d t-pairSecond σ d t = (σ:F)*d := by + dsimp [pairFirst, pairSecond] + field_simp + +theorem pair_ratio (σ : Fˣ) (d t : F) (hd : d ≠ 0) (ht : t ≠ 1) : + pairFirst σ d t/pairSecond σ d t = t := by + dsimp [pairFirst, pairSecond] + field_simp + +def pairCoordinates (σ : Fˣ) : PairInput F ≃ PairOutput F where + toFun v := ⟨(pairFirst σ v.1.1 v.1.2, pairSecond σ v.1.1 v.1.2), by + have hd := v.property.1 + have ht0 := v.property.2.1 + have ht1 := v.property.2.2 + refine ⟨div_ne_zero (mul_ne_zero (mul_ne_zero (Units.ne_zero σ) hd) ht0) + (sub_ne_zero.mpr ht1), + div_ne_zero (mul_ne_zero (Units.ne_zero σ) hd) (sub_ne_zero.mpr ht1), ?_⟩ + intro h + change pairFirst σ v.1.1 v.1.2 = pairSecond σ v.1.1 v.1.2 at h + have hh := pair_difference σ v.1.1 v.1.2 ht1 + rw [h, sub_self] at hh + exact mul_ne_zero (Units.ne_zero σ) hd hh.symm⟩ + invFun v := ⟨((v.1.1-v.1.2)/(σ:F), v.1.1/v.1.2), by + refine ⟨div_ne_zero (sub_ne_zero.mpr v.property.2.2) (Units.ne_zero σ), + div_ne_zero v.property.1 v.property.2.1, ?_⟩ + exact fun h => v.property.2.2 ((div_eq_one_iff_eq v.property.2.1).mp h)⟩ + left_inv v := by + apply Subtype.ext + apply Prod.ext + · dsimp + rw [pair_difference σ v.1.1 v.1.2 v.property.2.2] + exact mul_div_cancel_left₀ _ (Units.ne_zero σ) + · exact pair_ratio σ v.1.1 v.1.2 v.property.1 v.property.2.2 + right_inv v := by + apply Subtype.ext + apply Prod.ext + · dsimp [pairFirst] + have hz := v.property.2.1 + have hdiff := sub_ne_zero.mpr v.property.2.2 + field_simp + · dsimp [pairSecond] + have hz := v.property.2.1 + have hdiff := sub_ne_zero.mpr v.property.2.2 + field_simp + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairEnergy.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..090599315cee0e711de0766eebc866d65551fa8f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairEnergy.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.Ostmann.Tree.PairCoordinates +import OAI.NumberTheory.Ostmann.Tree.PairMellin + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +abbrev ValidUnitPair (p : ℕ) := {dt : (ZMod p)ˣ × (ZMod p)ˣ // dt.2 ≠ 1} + +def unitPairArguments (v : ValidUnitPair p) : ZMod p × ZMod p := + (pairMobiusValue v.1.1 v.1.2, (v.1.1:ZMod p)/((v.1.2:ZMod p)-1)) + +theorem unitPairArguments_difference (v : ValidUnitPair p) : + (unitPairArguments v).1-(unitPairArguments v).2=(v.1.1:ZMod p) := by + have ht : (v.1.2:ZMod p) ≠ 1 := fun h => v.property (Units.ext h) + have hh := pair_difference (1:(ZMod p)ˣ) (v.1.1:ZMod p) (v.1.2:ZMod p) ht + simpa only [unitPairArguments, pairMobiusValue, pairFirst, pairSecond, Units.val_one, one_mul] using hh + +theorem unitPairArguments_ratio (v : ValidUnitPair p) : + (unitPairArguments v).1/(unitPairArguments v).2=(v.1.2:ZMod p) := by + have ht : (v.1.2:ZMod p) ≠ 1 := fun h => v.property (Units.ext h) + have hh := pair_ratio (1:(ZMod p)ˣ) (v.1.1:ZMod p) (v.1.2:ZMod p) (Units.ne_zero _) ht + simpa only [unitPairArguments, pairMobiusValue, pairFirst, pairSecond, Units.val_one, one_mul] using hh + +theorem unitPairArguments_injective : Function.Injective (unitPairArguments (p := p)) := by + intro v w h + apply Subtype.ext + apply Prod.ext + · apply Units.ext + rw [← unitPairArguments_difference v, ← unitPairArguments_difference w, h] + · apply Units.ext + rw [← unitPairArguments_ratio v, ← unitPairArguments_ratio w, h] + +theorem bottomPair_total_energy (g : ZMod p → ℂ) (hg0 : g 0=0) : + (∑ d : (ZMod p)ˣ, ∑ t : (ZMod p)ˣ, ‖bottomPair g d t‖^2) ≤ + (∑ x : ZMod p, ‖g x‖^2)^2 := by + classical + have hs : (∑ v : ValidUnitPair p, ‖bottomPair g v.1.1 v.1.2‖^2) = + ∑ dt : (ZMod p)ˣ × (ZMod p)ˣ, ‖bottomPair g dt.1 dt.2‖^2 := by + apply Fintype.sum_of_injective (fun v : ValidUnitPair p => v.1) Subtype.val_injective + · intro dt hdt + have ht : dt.2=1 := by + by_contra h + exact hdt ⟨⟨dt,h⟩,rfl⟩ + simp [bottomPair,pairMobiusValue,ht,hg0] + · intro _ + rfl + rw [← Fintype.sum_prod_type (f := fun dt : (ZMod p)ˣ × (ZMod p)ˣ => ‖bottomPair g dt.1 dt.2‖^2), ← hs] + calc + _ ≤ ∑ xy : ZMod p × ZMod p, ‖g xy.1‖^2*‖g xy.2‖^2 := by + apply Finset.sum_le_sum_of_injOn unitPairArguments unitPairArguments_injective.injOn + · exact Finset.subset_univ _ + · intro v _ + simp only [bottomPair, unitPairArguments, norm_mul, Complex.norm_conj, mul_pow, le_refl] + · intro _ _ _ + exact mul_nonneg (sq_nonneg _) (sq_nonneg _) + _ = _ := by + rw [Fintype.sum_prod_type] + simp only [← Finset.mul_sum, ← Finset.sum_mul, pow_two] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairFourierMass.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairFourierMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..875dc21c2dc0e7b0b11e0eef4a17af9d2eb0cb2b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairFourierMass.lean @@ -0,0 +1,144 @@ +import OAI.NumberTheory.Ostmann.Characters.ConjugatedPairMeans +import OAI.NumberTheory.Ostmann.Characters.QuartetSpectrumBound + +namespace OAI + +/-! # Concrete Fourier mass bounds needed in the cross-pair application -/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +noncomputable local instance pairFourierMassFintype {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +theorem norm_characterTwist_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (x : ZMod p) : + ‖characterTwist g χ x‖ ≤ ‖g x‖ := by + by_cases hx : x = 0 + · simp [hx, characterTwist, MulChar.map_zero] + · have hn := norm_mulChar_unit χ (Units.mk0 x hx) + simp only [characterTwist, norm_mul, Complex.norm_conj, Units.val_mk0] at hn ⊢ + rw [hn, mul_one] + +theorem characterTwist_energy_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) : + (∑ x : ZMod p, ‖characterTwist g χ x‖ ^ 2) ≤ ∑ x : ZMod p, ‖g x‖ ^ 2 := by + exact Finset.sum_le_sum fun x _ => + pow_le_pow_left₀ (norm_nonneg _) (norm_characterTwist_le g χ x) 2 + +theorem pairAutocorrelation_fourier_formula {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (a : ZMod p) : + additiveFourier (pairAutocorrelation g χ) a = + (((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ) * + ‖additiveFourier (characterTwist g χ) a‖ ^ 2 : ℝ) : ℂ) := by + change additiveFourier (fun d => (p : ℂ) / (Fintype.card (ZMod p)ˣ : ℂ) * + additiveAutocorrelation (characterTwist g χ) d) a = _ + rw [additiveFourier_const_mul, additiveFourier_autocorrelation] + push_cast + rfl + +theorem pairAutocorrelation_weight_mass_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) : + (∑ a : ZMod p, (p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ) * + ‖additiveFourier (characterTwist g χ) a‖ ^ 2) ≤ + (p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ) := by + rw [← Finset.mul_sum, additiveFourier_parseval] + have hp : (p : ℝ) ≠ 0 := by exact_mod_cast (Fact.out : p.Prime).ne_zero + have h := (characterTwist_energy_le g χ).trans henergy + calc + _ ≤ (p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ) * ((p : ℝ)⁻¹ * p) := + mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left h (by positivity)) (by positivity) + _ = _ := by rw [inv_mul_cancel₀ hp, mul_one] + +theorem pairAutocorrelation_zero_norm_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) : + ‖pairAutocorrelation g χ 0‖ ≤ (p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ) := by + exact (norm_at_zero_le_spectrum_mass _ _ (pairAutocorrelation_fourier_formula g χ) + (fun _ => by positivity)).trans (pairAutocorrelation_weight_mass_le g χ henergy) + +theorem fieldPairCoefficientMoment_eq_pairAutocorrelation {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (d : ZMod p) (hd : d ≠ 0) : + fieldPairCoefficientMoment g χ d = ‖pairAutocorrelation g χ d‖ ^ 2 := by + let du : (ZMod p)ˣ := Units.mk0 d hd + have he : (fun t : (ZMod p)ˣ => fieldBottomPairValue g d t) = bottomPairValue g du := by + funext t + simp only [fieldBottomPairValue, hd, Units.ne_zero, dite_false, Units.mk0_val, du] + unfold fieldPairCoefficientMoment + rw [he, bottomPair_mellin_autocorrelation] + rfl + +theorem pairAutocorrelation_point_energy_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) (d : ZMod p) : + ‖pairAutocorrelation g χ d‖ ^ 2 ≤ fieldPairCoefficientMoment g χ d + + if d = 0 then ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2 else 0 := by + by_cases hd : d = 0 + · simp only [hd, fieldPairCoefficientMoment_zero, ite_true, zero_add] + exact pow_le_pow_left₀ (norm_nonneg _) (pairAutocorrelation_zero_norm_le g χ henergy) 2 + · rw [fieldPairCoefficientMoment_eq_pairAutocorrelation g χ d hd, ite_eq_right hd, add_zero] + +theorem pairAutocorrelation_fourier_energy_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (ε : ℝ) (hε : 0 ≤ ε) + (hflat : MixedFourierBound g ε) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) : + (∑ a : ZMod p, ‖additiveFourier (pairAutocorrelation g χ) a‖ ^ 2) ≤ + ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2 * ε ^ 2 := by + have hauto := autocorrelation_energy_le_fourier_sup (characterTwist g χ) ε hε + (hflat.characterTwist χ) + have he := (characterTwist_energy_le g χ).trans henergy + rw [additiveFourier_parseval] + have hP (d : ZMod p) : ‖pairAutocorrelation g χ d‖ ^ 2 = + ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2 * + ‖additiveAutocorrelation (characterTwist g χ) d‖ ^ 2 := by + simp only [pairAutocorrelation, norm_mul, norm_div, Complex.norm_natCast, mul_pow] + simp_rw [hP] + rw [← Finset.mul_sum] + calc + _ ≤ (p : ℝ)⁻¹ * (((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2 * (ε ^ 2 * p)) := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + exact mul_le_mul_of_nonneg_left + (hauto.trans (mul_le_mul_of_nonneg_left he (sq_nonneg _))) (sq_nonneg _) + _ = _ := by + have hp : (p : ℝ) ≠ 0 := by exact_mod_cast (Fact.out : p.Prime).ne_zero + field_simp + +theorem pairAutocorrelation_total_point_energy_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) : + (∑ χ : MulChar (ZMod p) ℂ, ∑ d : ZMod p, ‖pairAutocorrelation g χ d‖ ^ 2) ≤ + 2 * (Fintype.card (ZMod p)ˣ : ℝ) * + ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2 := by + have h := Finset.sum_le_sum (s := (Finset.univ : Finset (MulChar (ZMod p) ℂ))) + (fun χ _ => Finset.sum_le_sum (s := (Finset.univ : Finset (ZMod p))) + (fun d _ => pairAutocorrelation_point_energy_le g χ henergy d)) + simp only [Finset.sum_add_distrib, Finset.sum_ite_eq', Finset.mem_univ, ite_true, + Finset.sum_const, Finset.card_univ, nsmul_eq_mul, card_mulChar_eq_card_units] at h + have hF : (∑ χ : MulChar (ZMod p) ℂ, ∑ d : ZMod p, fieldPairCoefficientMoment g χ d) = + ∑ d : ZMod p, fieldPairMoment g d := by + rw [Finset.sum_comm] + simp_rw [sum_fieldPairCoefficientMoment] + rw [hF] at h + have hU : 0 < (Fintype.card (ZMod p)ˣ : ℝ) := by exact_mod_cast Fintype.card_pos + have hR := (div_le_iff₀ hU).mp (fieldPairMoment_mean_le g hg henergy) + nlinarith + +theorem pairAutocorrelation_total_fourier_energy_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) : + (∑ χ : MulChar (ZMod p) ℂ, ∑ a : ZMod p, + ‖additiveFourier (pairAutocorrelation g χ) a‖ ^ 2) ≤ + 2 * ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) := by + simp_rw [additiveFourier_parseval] + rw [← Finset.mul_sum] + apply (mul_le_mul_of_nonneg_left (pairAutocorrelation_total_point_energy_le g hg henergy) + (show 0 ≤ (p : ℝ)⁻¹ by positivity)).trans_eq + have hp : (p : ℝ) ≠ 0 := by exact_mod_cast (Fact.out : p.Prime).ne_zero + have hU : (Fintype.card (ZMod p)ˣ : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero + field_simp + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairMellin.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairMellin.lean new file mode 100644 index 0000000000000000000000000000000000000000..84dc5e626539c726d3fc606ed914820d34c8445f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairMellin.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.Tree.Autocorrelation +import OAI.NumberTheory.Ostmann.Tree.Mellin +import OAI.NumberTheory.Ostmann.Tree.PairMobius +import OAI.NumberTheory.Ostmann.Tree.UnitSums + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def bottomPair (g : ZMod p → ℂ) (c : (ZMod p)ˣ) (t : ZMod p) : ℂ := + g (pairMobiusValue c t) * conj (g ((c:ZMod p)/(t-1))) + +def characterTwist (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (x : ZMod p) : ℂ := + g x*conj (χ x) + +theorem conjugate_character_cancel (χ : MulChar (ZMod p) ℂ) (x : ZMod p) (hx : x≠0) : + conj (χ x)*χ x=1 := by + change star (χ x)*χ x=1 + rw [MulChar.star_apply', ← MulChar.mul_apply, inv_mul_cancel] + exact MulChar.one_apply_coe (Units.mk0 x hx) + +theorem bottomPair_twisted_value (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (c : (ZMod p)ˣ) (t : ZMod p) (hg0 : g 0=0) : + bottomPair g c t*conj (χ t) = + characterTwist g χ (pairMobiusValue c t) * + conj (characterTwist g χ (pairMobiusValue c t-c)) := by + by_cases ht0 : t=0 + · subst t + simp [bottomPair, pairMobiusValue, characterTwist, hg0] + by_cases ht1 : t=1 + · subst t + simp [bottomPair, pairMobiusValue, characterTwist, hg0] + let z : ZMod p := (c:ZMod p)/(t-1) + have hz : z≠0 := div_ne_zero (Units.ne_zero c) (sub_ne_zero.mpr ht1) + have hx : pairMobiusValue c t=t*z := by dsimp [pairMobiusValue,z]; ring + have hc := conjugate_character_cancel χ z hz + rw [pairMobiusValue_sub c t ht1] + change (g (pairMobiusValue c t)*conj (g z))*conj (χ t) = + (g (pairMobiusValue c t)*conj (χ (pairMobiusValue c t))) * conj (g z*conj (χ z)) + rw [hx, map_mul χ, map_mul, map_mul, starRingEnd_self_apply] + calc + _ = (g (t*z)*conj (g z)*conj (χ t))*(conj (χ z)*χ z) := by rw [hc]; ring + _ = _ := by ring + +theorem bottomPair_mellin (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (c : (ZMod p)ˣ) (hg0 : g 0=0) : + mellin (fun t : (ZMod p)ˣ => bottomPair g c t) χ = + ((p:ℂ)/(Fintype.card (ZMod p)ˣ:ℂ)) * autocorrelation (characterTwist g χ) c := by + have hzero : characterTwist g χ 0=0 := by simp [characterTwist,hg0] + let A : ZMod p → ℂ := fun x => characterTwist g χ x*conj (characterTwist g χ (x-c)) + have hA0 : A 0=0 := by simp [A,hzero] + have hAc : A c=0 := by simp [A,hzero] + have hT0 : bottomPair g c 0*conj (χ 0)=0 := by + simp [bottomPair, pairMobiusValue,hg0] + unfold mellin + rw [sum_units_of_zero (fun t => bottomPair g c t*conj (χ t)) hT0] + simp_rw [bottomPair_twisted_value g χ c _ hg0] + change (Fintype.card (ZMod p)ˣ:ℂ)⁻¹ * (∑ t, A (pairMobiusValue c t)) = _ + rw [pairMobius_sum c A hA0 hAc] + dsimp [A, autocorrelation, mean] + have hp : (p:ℂ) ≠ 0 := by exact_mod_cast NeZero.ne p + field_simp + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairMellinVariables.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairMellinVariables.lean new file mode 100644 index 0000000000000000000000000000000000000000..1fa925dc413c9237ea087029f5a5987b611c394e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairMellinVariables.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.Tree.DiagonalMellin +import OAI.NumberTheory.Ostmann.Tree.DifferenceConvolution + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +inductive PairMode + | friendly + | bad + deriving DecidableEq + +def PairMode.multiplier : PairMode → ZMod p → ZMod p → ZMod p + | .friendly,d,_ => d + | .bad,_,e => e⁻¹ + +def PairMode.unitMultiplier : PairMode → (ZMod p)ˣ → (ZMod p)ˣ → (ZMod p)ˣ + | .friendly,d,_ => d + | .bad,_,e => e⁻¹ + +theorem PairMode.coe_unitMultiplier (m : PairMode) (d e : (ZMod p)ˣ) : + ((m.unitMultiplier d e:(ZMod p)ˣ):ZMod p)=m.multiplier d e := by + cases m with + | friendly => rfl + | bad => exact Units.val_inv_eq_inv_val e + +def leftPairTwist (L R : PairMode) (ν χ ψ : MulChar (ZMod p) ℂ) : MulChar (ZMod p) ℂ := + ν*(match L with | .friendly => χ | .bad => 1)*(match R with | .friendly => 1 | .bad => ψ⁻¹) + +def rightPairTwist (L R : PairMode) (ν χ ψ : MulChar (ZMod p) ℂ) : MulChar (ZMod p) ℂ := + ν⁻¹*(match R with | .friendly => ψ | .bad => 1)*(match L with | .friendly => 1 | .bad => χ⁻¹) + +theorem pairTest_mellin_mul (g : ZMod p → ℂ) (σ k : (ZMod p)ˣ) + (χ : MulChar (ZMod p) ℂ) (d : ZMod p) (hd : d≠0) (hg0 : g 0=0) : + mellin (fun lam : (ZMod p)ˣ => pairTest g σ d ((lam:ZMod p)*k)) χ = + χ k*pairSpectrum g χ ((σ:ZMod p)*d) := by + let D : (ZMod p)ˣ := Units.mk0 d hd + have he : (fun lam : (ZMod p)ˣ => pairTest g σ d ((lam:ZMod p)*k)) = + fun lam : (ZMod p)ˣ => bottomPair g (σ*D) (lam*k) := by + funext lam + dsimp [pairTest,bottomPair,pairMobiusValue,pairFirst,pairSecond,D] + rw [he] + have hm := mellin_mulRight (fun t : (ZMod p)ˣ => bottomPair g (σ*D) t) k χ + simp only [Units.val_mul] at hm + rw [hm,← pairSpectrum_unit g χ (σ*D) hg0] + rfl + +theorem doubleMellin_product (f h : (ZMod p)ˣ → ℂ) (c : ℂ) + (χ ψ : MulChar (ZMod p) ℂ) : + doubleMellin (fun lam mu => (f lam*h mu)*c) χ ψ=mellin f χ*mellin h ψ*c := by + have hi (mu : (ZMod p)ˣ) : + mellin (fun lam => (f lam*h mu)*c) χ=(h mu*c)*mellin f χ := by + have he : (fun lam => (f lam*h mu)*c)=fun lam => (h mu*c)*f lam := by funext lam; ring + rw [he,mellin_const_mul] + unfold doubleMellin + simp_rw [hi] + have he : (fun mu => (h mu*c)*mellin f χ)=fun mu => (mellin f χ*c)*h mu := by funext mu; ring + rw [he,mellin_const_mul] + ring + +def twoPairValue (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (ν : MulChar (ZMod p) ℂ) + (d e : ZMod p) (lam mu : (ZMod p)ˣ) : ℂ := + (pairTest g σ d ((lam:ZMod p)*L.multiplier d e)* + pairTest h τ e ((mu:ZMod p)*R.multiplier e d))*(ν d*ν⁻¹ e) + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairMobius.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairMobius.lean new file mode 100644 index 0000000000000000000000000000000000000000..5398c41ba0984b211da58f5c6633156b053376b7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairMobius.lean @@ -0,0 +1,80 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +variable {F : Type*} [Field F] + +abbrev NonzeroExcept (F : Type*) [Field F] (c : F) := {x : F // x ≠ 0 ∧ x ≠ c} + +def pairMobiusValue (c : Fˣ) (t : F) : F := (c:F)*t/(t-1) + +theorem pairMobiusValue_sub (c : Fˣ) (t : F) (ht : t ≠ 1) : + pairMobiusValue c t-(c:F) = (c:F)/(t-1) := by + dsimp [pairMobiusValue] + field_simp + ring + +def pairMobius (c : Fˣ) : NonzeroExcept F 1 ≃ NonzeroExcept F (c:F) where + toFun t := ⟨pairMobiusValue c t, by + refine ⟨div_ne_zero (mul_ne_zero (Units.ne_zero c) t.property.1) + (sub_ne_zero.mpr t.property.2), ?_⟩ + intro h + have he := pairMobiusValue_sub c t t.property.2 + rw [h, sub_self] at he + exact div_ne_zero (Units.ne_zero c) (sub_ne_zero.mpr t.property.2) he.symm⟩ + invFun x := ⟨(x:F)/((x:F)-(c:F)), by + have hx := sub_ne_zero.mpr x.property.2 + refine ⟨div_ne_zero x.property.1 hx, ?_⟩ + intro h + have he := (div_eq_one_iff_eq hx).mp h + exact Units.ne_zero c (by linear_combination he)⟩ + left_inv t := by + apply Subtype.ext + dsimp + rw [pairMobiusValue_sub c t t.property.2] + dsimp [pairMobiusValue] + have ht := sub_ne_zero.mpr t.property.2 + field_simp + right_inv x := by + apply Subtype.ext + dsimp [pairMobiusValue] + have hx := sub_ne_zero.mpr x.property.2 + field_simp + ring + +section Sums +open scoped BigOperators +variable [Fintype F] [DecidableEq F] + +theorem sum_nonzeroExcept_of_zero (c : F) (g : F → ℂ) (h0 : g 0=0) (hc : g c=0) : + ∑ x : NonzeroExcept F c, g x = ∑ x : F, g x := by + apply Fintype.sum_of_injective (fun x : NonzeroExcept F c => (x:F)) Subtype.val_injective + · intro x hx + by_cases hzero : x=0 + · simpa only [hzero] using h0 + by_cases heq : x=c + · simpa only [heq] using hc + exact False.elim (hx ⟨⟨x,hzero,heq⟩,rfl⟩) + · intro _ + rfl + +theorem pairMobius_sum (c : Fˣ) (g : F → ℂ) (h0 : g 0=0) (hc : g c=0) : + ∑ t : F, g (pairMobiusValue c t) = ∑ x : F, g x := by + have hs : (∑ t : F, g (pairMobiusValue c t)) = + ∑ t : NonzeroExcept F 1, g (pairMobiusValue c t) := by + apply (sum_nonzeroExcept_of_zero 1 _ _ _).symm + · simpa only [pairMobiusValue, mul_zero, zero_div] using h0 + · simpa only [pairMobiusValue, sub_self, div_zero] using h0 + rw [hs] + calc + _ = ∑ x : NonzeroExcept F (c:F), g x := + (pairMobius c).bijective.sum_comp (fun x : NonzeroExcept F (c:F) => g x) + _ = _ := sum_nonzeroExcept_of_zero (c:F) g h0 hc + +end Sums +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairMoment.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1f64e5c46aec4bc384d138f3e5fb07cc19821dd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairMoment.lean @@ -0,0 +1,85 @@ +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Algebra.Order.Chebyshev +import Mathlib.Analysis.Complex.Basic +import Mathlib.Algebra.Field.ZMod +import OAI.NumberTheory.Ostmann.Tree.BottomPairCoordinates + +namespace OAI + +/-! +# The bottom-pair second moment + +The valid difference/ratio coordinates identify the bottom-pair moment +with the contribution of ordered distinct nonzero pairs. In particular, +an `L²` bound suffices; no pointwise bound on the test is used. +-/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +noncomputable local instance {K : Type*} [Field K] [Fintype K] : + Fintype (ValidPairCoordinates K) := by + classical + unfold ValidPairCoordinates + infer_instance + +noncomputable local instance {K : Type*} [Field K] [Fintype K] : + Fintype (DistinctNonzeroPair K) := by + classical + unfold DistinctNonzeroPair + infer_instance + +theorem pairCoordinate_sum_eq {K : Type*} [Field K] [Fintype K] (w : K → ℝ) : + (∑ dt : ValidPairCoordinates K, + w (dt.1.1 * dt.1.2 / (dt.1.2 - 1)) * w (dt.1.1 / (dt.1.2 - 1))) = + ∑ xz : DistinctNonzeroPair K, w xz.1.1 * w xz.1.2 := by + exact (pairCoordinatesEquiv K).bijective.sum_comp + (fun xz : DistinctNonzeroPair K => w xz.1.1 * w xz.1.2) + +theorem pairCoordinate_sum_le_square {K : Type*} [Field K] [Fintype K] + (w : K → ℝ) (hw : ∀ x, 0 ≤ w x) : + (∑ dt : ValidPairCoordinates K, + w (dt.1.1 * dt.1.2 / (dt.1.2 - 1)) * w (dt.1.1 / (dt.1.2 - 1))) ≤ + (∑ x : K, w x) ^ 2 := by + classical + rw [pairCoordinate_sum_eq] + have hsum := Fintype.sum_subtype_add_sum_subtype + (fun xz : K × K => xz.1 ≠ 0 ∧ xz.2 ≠ 0 ∧ xz.1 ≠ xz.2) + (fun xz : K × K => w xz.1 * w xz.2) + have hcomplement : 0 ≤ ∑ xz : {xz : K × K // ¬(xz.1 ≠ 0 ∧ xz.2 ≠ 0 ∧ xz.1 ≠ xz.2)}, + w xz.1.1 * w xz.1.2 := + Finset.sum_nonneg (fun _ _ => mul_nonneg (hw _) (hw _)) + have hfull : (∑ xz : K × K, w xz.1 * w xz.2) = (∑ x : K, w x) ^ 2 := by + rw [Fintype.sum_prod_type] + simp_rw [← Finset.mul_sum] + rw [← Finset.sum_mul] + ring + rw [hfull] at hsum + change (∑ xz : {xz : K × K // xz.1 ≠ 0 ∧ xz.2 ≠ 0 ∧ xz.1 ≠ xz.2}, + w xz.1.1 * w xz.1.2) ≤ _ + linarith + +/-- The unnormalized bottom-pair `L²` estimate. -/ +theorem bottomPair_sum_norm_sq_le {K : Type*} [Field K] [Fintype K] (g : K → ℂ) : + (∑ dt : ValidPairCoordinates K, + ‖g (dt.1.1 * dt.1.2 / (dt.1.2 - 1)) * conj (g (dt.1.1 / (dt.1.2 - 1)))‖ ^ 2) ≤ + (∑ x : K, ‖g x‖ ^ 2) ^ 2 := by + simpa only [norm_mul, Complex.norm_conj, mul_pow] using + pairCoordinate_sum_le_square (fun x => ‖g x‖ ^ 2) (fun _ => sq_nonneg _) + +/-- Equation `tree-R-mean`: the valid bottom-pair moment is bounded by +`(p/(p-1))²` when the field-probability squared norm is at most one. -/ +theorem bottomPair_mean_norm_sq_le {p : ℕ} [Fact p.Prime] (g : ZMod p → ℂ) + (hg : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) : + (∑ dt : ValidPairCoordinates (ZMod p), + ‖g (dt.1.1 * dt.1.2 / (dt.1.2 - 1)) * conj (g (dt.1.1 / (dt.1.2 - 1)))‖ ^ 2) / + ((p : ℝ) - 1) ^ 2 ≤ ((p : ℝ) / ((p : ℝ) - 1)) ^ 2 := by + have hnorm : 0 ≤ ∑ x : ZMod p, ‖g x‖ ^ 2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + have hp : 0 ≤ (p : ℝ) := Nat.cast_nonneg p + have hnum := (bottomPair_sum_norm_sq_le g).trans (sq_le_sq₀ hnorm hp |>.mpr hg) + simpa only [div_pow] using div_le_div_of_nonneg_right hnum (sq_nonneg ((p : ℝ) - 1)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairOrientationValue.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairOrientationValue.lean new file mode 100644 index 0000000000000000000000000000000000000000..583836f9d3b05b3ef44b6d0bcee96db79cd2d067 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairOrientationValue.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.Ostmann.Tree.RationalPairValue + +namespace OAI + +/-! # Reversing the free and held leaves of a bottom pair -/ + +namespace Ostmann + +open scoped ComplexConjugate + +theorem fieldBottomPairValue_formula {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (d t : ZMod p) (hd : d ≠ 0) (ht : t ≠ 0) : + fieldBottomPairValue g d t = if t = 1 then 0 else + g (d * t / (t - 1)) * conj (g (d / (t - 1))) := by + have hi : (Units.mk0 t ht : (ZMod p)ˣ) = 1 ↔ t = 1 := by + constructor + · exact fun h => congrArg (fun u : (ZMod p)ˣ => (u : ZMod p)) h + · exact fun h => Units.ext h + simp only [fieldBottomPairValue, hd, ht, dite_false, bottomPairValue, hi, Units.val_mk0] + +/-- Reversing a pair negates its difference, inverts its ratio and conjugates +its base function. The two leaf factors themselves remain unchanged. -/ +theorem fieldBottomPairValue_reverse {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (d t : ZMod p) : + fieldBottomPairValue (fun x => conj (g x)) (-d) t⁻¹ = fieldBottomPairValue g d t := by + by_cases hd : d = 0 + · simp [hd] + by_cases ht : t = 0 + · simp [ht] + rw [fieldBottomPairValue_formula _ _ _ (neg_ne_zero.mpr hd) (inv_ne_zero ht), + fieldBottomPairValue_formula g d t hd ht] + by_cases ht1 : t = 1 + · simp [ht1] + have hi1 : t⁻¹ ≠ 1 := by + intro h + apply ht1 + simpa only [inv_inv, inv_one] using congrArg (fun x : ZMod p => x⁻¹) h + simp only [ht1, hi1, ite_false, starRingEnd_apply, star_star] + have hden : t - 1 ≠ 0 := sub_ne_zero.mpr ht1 + have ha : -d * t⁻¹ / (t⁻¹ - 1) = d / (t - 1) := by field_simp; ring + have hb : -d / (t⁻¹ - 1) = d * t / (t - 1) := by field_simp; ring + rw [ha, hb] + exact mul_comm _ _ + +theorem fieldBottomPairValue_negate {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (d t : ZMod p) : + fieldBottomPairValue (fun x => g (-x)) d t = fieldBottomPairValue g (-d) t := by + by_cases hd : d = 0 + · simp [hd] + by_cases ht : t = 0 + · simp [ht] + rw [fieldBottomPairValue_formula _ _ _ hd ht, + fieldBottomPairValue_formula _ _ _ (neg_ne_zero.mpr hd) ht] + split_ifs + · rfl + · simp only [neg_mul, neg_div] + +/-- Reversing the pair while keeping its difference positive reflects and +conjugates the base function. -/ +theorem fieldBottomPairValue_reflect_reverse {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (d t : ZMod p) : + fieldBottomPairValue (fun x => conj (g (-x))) d t⁻¹ = fieldBottomPairValue g d t := by + rw [fieldBottomPairValue_negate (fun x => conj (g x)), fieldBottomPairValue_reverse] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairPopulationFibers.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairPopulationFibers.lean new file mode 100644 index 0000000000000000000000000000000000000000..ae42a43b458e3e87605be769f6d2a1860b56a182 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairPopulationFibers.lean @@ -0,0 +1,88 @@ +import Mathlib.Data.Fintype.Card +import Mathlib.Data.Fintype.Prod +import Mathlib.Data.Fintype.Sigma +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Basic.Real.Basic +import Mathlib.Algebra.BigOperators.Ring.Finset +import Mathlib.Algebra.Order.BigOperators.Group.Finset +import Mathlib.Algebra.BigOperators.Group.Finset.Basic + +namespace OAI + +/-! # Exact pair counting by the two population labels -/ + +namespace Ostmann + +open scoped BigOperators Classical + +def filteredPairFiberEquiv {A B C D : Type*} (f : A → C) (g : B → D) + (R : C → D → Prop) : + {z : A × B // R (f z.1) (g z.2)} ≃ + Σ q : {z : C × D // R z.1 z.2}, + {x : A // f x = q.1.1} × {y : B // g y = q.1.2} where + toFun z := ⟨⟨(f z.1.1, g z.1.2), z.2⟩, ⟨z.1.1, rfl⟩, ⟨z.1.2, rfl⟩⟩ + invFun z := ⟨(z.2.1.1, z.2.2.1), by rw [z.2.1.2, z.2.2.2]; exact z.1.2⟩ + left_inv _ := rfl + right_inv z := by + rcases z with ⟨⟨⟨c, d⟩, h⟩, ⟨x, hx⟩, ⟨y, hy⟩⟩ + dsimp only at hx hy + subst c d + rfl + +theorem filteredPair_card {A B C D : Type*} + [Fintype A] [Fintype B] [Fintype C] [Fintype D] + (f : A → C) (g : B → D) (R : C → D → Prop) : + Fintype.card {z : A × B // R (f z.1) (g z.2)} = + ∑ q : {z : C × D // R z.1 z.2}, + Fintype.card {x : A // f x = q.1.1} * Fintype.card {y : B // g y = q.1.2} := by + rw [Fintype.card_congr (filteredPairFiberEquiv f g R), Fintype.card_sigma] + apply Finset.sum_congr rfl + intro q _ + exact Fintype.card_prod _ _ + +theorem filteredPair_card_le {A B C D : Type*} + [Fintype A] [Fintype B] [Fintype C] [Fintype D] + (f : A → C) (g : B → D) (R : C → D → Prop) (K H : ℝ) + (hK : 0 ≤ K) + (hlabels : (Fintype.card {z : C × D // R z.1 z.2} : ℝ) ≤ H) + (hpop : ∀ q : {z : C × D // R z.1 z.2}, + (Fintype.card {x : A // f x = q.1.1} : ℝ) * + Fintype.card {y : B // g y = q.1.2} ≤ K) : + (Fintype.card {z : A × B // R (f z.1) (g z.2)} : ℝ) ≤ H * K := by + rw [filteredPair_card f g R, Nat.cast_sum] + calc + _ ≤ ∑ _q : {z : C × D // R z.1 z.2}, K := by + apply Finset.sum_le_sum + intro q _ + simpa only [Nat.cast_mul] using hpop q + _ = (Fintype.card {z : C × D // R z.1 z.2} : ℝ) * K := by simp + _ ≤ _ := mul_le_mul_of_nonneg_right hlabels hK + +/-- If the total pair count exceeds the label count times K, a compatible +pair of labels has population product greater than K. -/ +theorem exists_large_pair_fiber {A B C D : Type*} + [Fintype A] [Fintype B] [Fintype C] [Fintype D] + (f : A → C) (g : B → D) (R : C → D → Prop) (K : ℝ) (hK : 0 ≤ K) + (hlarge : (Fintype.card {z : C × D // R z.1 z.2} : ℝ) * K < + (Fintype.card {z : A × B // R (f z.1) (g z.2)} : ℝ)) : + ∃ q : {z : C × D // R z.1 z.2}, K < + (Fintype.card {x : A // f x = q.1.1} : ℝ) * Fintype.card {y : B // g y = q.1.2} := by + by_contra! hn + have hb := filteredPair_card_le f g R K _ hK le_rfl hn + exact (not_lt_of_ge hb) hlarge + +def finsetFiberEquiv {A B : Type*} [DecidableEq A] [DecidableEq B] (S : Finset A) (f : A → B) (b : B) : + {x : S // f x = b} ≃ {x : A // x ∈ S.filter (fun x => f x = b)} where + toFun x := ⟨x.1, Finset.mem_filter.mpr ⟨x.1.property, x.2⟩⟩ + invFun x := ⟨⟨x.1, (Finset.mem_filter.mp x.2).1⟩, (Finset.mem_filter.mp x.2).2⟩ + left_inv _ := rfl + right_inv _ := rfl + +theorem finset_fiber_card {A B : Type*} [DecidableEq A] [DecidableEq B] + (S : Finset A) (f : A → B) (b : B) : + Fintype.card {x : S // f x = b} = (S.filter fun x => f x = b).card := by + simpa only [Fintype.card_coe] using Fintype.card_congr (finsetFiberEquiv S f b) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairSecondMoment.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairSecondMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc9635e36a0ba1dac7512cbf9cc503fa16aa04c2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairSecondMoment.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.Ostmann.Tree.PairEnergy +import OAI.NumberTheory.Ostmann.Tree.PairMellinVariables + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def pairSecondMoment (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) (d : ZMod p) : ℝ := + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹*∑ t : (ZMod p)ˣ,‖pairTest g σ d t‖^2 + +theorem pairSecondMoment_nonneg (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) (d : ZMod p) : + 0≤pairSecondMoment g σ d := by unfold pairSecondMoment; positivity + +theorem pairTest_zero (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) (hg0 : g 0=0) (t : ZMod p) : + pairTest g σ 0 t=0 := by simp [pairTest,pairFirst,pairSecond,hg0] + +theorem pairSecondMoment_zero (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) (hg0 : g 0=0) : + pairSecondMoment g σ 0=0 := by simp [pairSecondMoment,pairTest_zero g σ hg0] + +theorem pairTest_unit (g : ZMod p → ℂ) (σ d : (ZMod p)ˣ) (t : ZMod p) : + pairTest g σ d t=bottomPair g (σ*d) t := by + dsimp [pairTest,pairFirst,pairSecond,bottomPair,pairMobiusValue] + +theorem pairSecondMoment_total (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (hg0 : g 0=0) (hg : l2Sq g≤1) : + (∑ d : ZMod p,pairSecondMoment g σ d) ≤ (p:ℝ)^2/(Fintype.card (ZMod p)ˣ:ℝ) := by + have hp : 0<(p:ℝ) := by exact_mod_cast (Fact.out : p.Prime).pos + have henergy : (∑ x : ZMod p,‖g x‖^2)≤(p:ℝ) := by + have hh : (∑ x : ZMod p,‖g x‖^2)/(p:ℝ)≤1 := by simpa only [l2Sq,div_eq_mul_inv,mul_comm] using hg + simpa only [one_mul] using (div_le_iff₀ hp).mp hh + rw [← sum_units_of_zero (pairSecondMoment g σ) (pairSecondMoment_zero g σ hg0)] + simp only [pairSecondMoment,pairTest_unit,← Finset.mul_sum] + have he := (Equiv.mulLeft σ).bijective.sum_comp (fun d : (ZMod p)ˣ => ∑ t : (ZMod p)ˣ,‖bottomPair g d t‖^2) + change (∑ d : (ZMod p)ˣ,∑ t : (ZMod p)ˣ,‖bottomPair g (σ*d) t‖^2)= + ∑ d : (ZMod p)ˣ,∑ t : (ZMod p)ˣ,‖bottomPair g d t‖^2 at he + rw [he] + calc + _ ≤ (Fintype.card (ZMod p)ˣ:ℝ)⁻¹*(∑ x : ZMod p,‖g x‖^2)^2 := + mul_le_mul_of_nonneg_left (bottomPair_total_energy g hg0) (by positivity) + _ ≤ (Fintype.card (ZMod p)ˣ:ℝ)⁻¹*(p:ℝ)^2 := + mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) henergy 2) (by positivity) + _ = _ := by ring + +theorem pairSecondMoment_parameter_average (g : ZMod p → ℂ) (σ k : (ZMod p)ˣ) (d : ZMod p) : + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹*(∑ lam : (ZMod p)ˣ,‖pairTest g σ d ((lam:ZMod p)*k)‖^2)= + pairSecondMoment g σ d := by + unfold pairSecondMoment + congr 1 + have he := (Equiv.mulRight k).bijective.sum_comp (fun t : (ZMod p)ˣ => ‖pairTest g σ d t‖^2) + change (∑ t : (ZMod p)ˣ,‖pairTest g σ d (t*k)‖^2)=∑ t : (ZMod p)ˣ,‖pairTest g σ d t‖^2 at he + simpa only [Units.val_mul] using he + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairSpectrum.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairSpectrum.lean new file mode 100644 index 0000000000000000000000000000000000000000..c608eef8df1d5e75424d34a34da55f4cc00f97e3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairSpectrum.lean @@ -0,0 +1,94 @@ +import OAI.NumberTheory.Ostmann.Tree.MellinSquare +import OAI.NumberTheory.Ostmann.Tree.PairEnergy +import OAI.NumberTheory.Ostmann.Tree.ReciprocalTwist + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def pairSpectrum (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (d : ZMod p) : ℂ := + ((p:ℂ)/(Fintype.card (ZMod p)ˣ:ℂ))*autocorrelation (characterTwist g χ) d + +def pairWeight (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (a : ZMod p) : ℝ := + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))*‖fourier (characterTwist g χ) a‖^2 + +def pairFourthMass (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) : ℝ := + ∑ a : ZMod p, pairWeight g χ a ^ 2 + +theorem characterTwist_norm (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (hg0 : g 0=0) (x : ZMod p) : ‖characterTwist g χ x‖=‖g x‖ := by + by_cases hx : x=0 + · simp [characterTwist,hx,hg0] + · have hχ := mulChar_norm_unit χ (Units.mk0 x hx) + change ‖χ x‖=1 at hχ + simp only [characterTwist, norm_mul, Complex.norm_conj, hχ, mul_one] + +theorem characterTwist_l2Sq (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (hg0 : g 0=0) : l2Sq (characterTwist g χ)=l2Sq g := by + simp only [l2Sq, characterTwist_norm g χ hg0] + +theorem pairSpectrum_unit (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (d : (ZMod p)ˣ) (hg0 : g 0=0) : + pairSpectrum g χ d=mellin (fun t : (ZMod p)ˣ => bottomPair g d t) χ := + (bottomPair_mellin g χ d hg0).symm + +theorem pairSpectrum_zero (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) : + pairSpectrum g χ 0 = + ((((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))*l2Sq g : ℝ):ℂ) := by + rw [pairSpectrum, autocorrelation_zero, characterTwist_l2Sq g χ hg0] + push_cast + rfl + +theorem fourier_pairSpectrum (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (a : ZMod p) : + fourier (pairSpectrum g χ) a = (pairWeight g χ a : ℂ) := by + unfold pairSpectrum + rw [fourier_const_mul, fourier_autocorrelation] + simp only [pairWeight] + push_cast + rfl + +theorem pairWeight_nonneg (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (a : ZMod p) : + 0 ≤ pairWeight g χ a := by unfold pairWeight; positivity + +theorem pairWeight_mass (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) : + ∑ a : ZMod p, pairWeight g χ a = + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))*l2Sq g := by + simp only [pairWeight, ← Finset.mul_sum, fourier_parseval, characterTwist_l2Sq g χ hg0] + +theorem norm_fourier_characterTwist_le (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (a : ZMod p) : ‖fourier (characterTwist g χ) a‖ ≤ (correlationBound g:ℝ) := by + change ‖fourier (fun x => g x*conj (χ x)) a‖ ≤ _ + have h := norm_mixedCorrelation_le g (star χ) (-a) + rw [mixedCorrelation_eq_fourier] at h + simpa only [neg_neg, MulChar.star_apply, RCLike.star_def] using h + +theorem pairWeight_le (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (a : ZMod p) : + pairWeight g χ a ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))*(correlationBound g:ℝ)^2 := by + apply mul_le_mul_of_nonneg_left + (pow_le_pow_left₀ (norm_nonneg _) (norm_fourier_characterTwist_le g χ a) 2) + positivity + +theorem pairFourthMass_le (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) : + pairFourthMass g χ ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2 * (correlationBound g:ℝ)^2 * l2Sq g := by + have hpoint (a : ZMod p) : pairWeight g χ a ^2 ≤ + (((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))*(correlationBound g:ℝ)^2)*pairWeight g χ a := by + have h := mul_le_mul_of_nonneg_right (pairWeight_le g χ a) (pairWeight_nonneg g χ a) + simpa only [pow_two] using h + apply (Finset.sum_le_sum (fun a _ => hpoint a)).trans + rw [← Finset.mul_sum, pairWeight_mass g χ hg0] + exact le_of_eq (by ring) + +theorem pairFourthMass_eq_l2Sq (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) : + pairFourthMass g χ = l2Sq (pairSpectrum g χ) := by + rw [← fourier_parseval] + simp only [pairFourthMass, fourier_pairSpectrum, Complex.norm_real, Real.norm_eq_abs, sq_abs] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairSquareMoment.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairSquareMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..1fe3ba2b56eeff2262b462feee65f74545d4b26d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairSquareMoment.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.Characters.FieldPairMoment + +namespace OAI + +/-! # Square-coordinate estimates for one moving bottom pair -/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +noncomputable local instance pairSquareFintype {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +noncomputable def fieldPairCoefficientMoment {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) (d : ZMod p) : ℝ := + ‖mellinCoefficient (fun t => fieldBottomPairValue g d t) χ‖ ^ 2 + +@[simp] theorem fieldPairCoefficientMoment_zero {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) : + fieldPairCoefficientMoment g χ 0 = 0 := by + simp [fieldPairCoefficientMoment, mellinCoefficient] + +theorem sum_fieldPairCoefficientMoment {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (d : ZMod p) : + (∑ χ : MulChar (ZMod p) ℂ, fieldPairCoefficientMoment g χ d) = fieldPairMoment g d := by + unfold fieldPairCoefficientMoment fieldPairMoment + exact mellin_parseval (fun t : (ZMod p)ˣ => fieldBottomPairValue g d t) + +theorem mellinCoefficient_mul_const {p : ℕ} [Fact p.Prime] + (f : (ZMod p)ˣ → ℂ) (c : ℂ) (χ : MulChar (ZMod p) ℂ) : + mellinCoefficient (fun t => f t * c) χ = mellinCoefficient f χ * c := by + unfold mellinCoefficient + have ht (t : (ZMod p)ˣ) : f t * c * conj (χ t) = (f t * conj (χ t)) * c := by ring + simp_rw [ht] + rw [← Finset.sum_mul] + ring + +/-- Multiplication by the difference can be absorbed into the fixed square +coset; the zero difference is handled by the zero extension. -/ +theorem fieldPair_scaled_square_coefficient_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (d : ZMod p) (K : (ZMod p)ˣ) (ρ : MulChar (ZMod p) ℂ) : + ‖mellinCoefficient (fun r : (ZMod p)ˣ => + fieldBottomPairValue g d ((K : ZMod p) * d * (r : ZMod p) ^ 2)) ρ‖ ^ 2 ≤ + 2 * squareCharacterMass (fun χ => fieldPairCoefficientMoment g χ d) ρ := by + classical + by_cases hd : d = 0 + · simp [hd, mellinCoefficient, squareCharacterMass] + · let k : (ZMod p)ˣ := K * Units.mk0 d hd + have h := mellinCoefficient_square_pullback_bound Finset.univ + (mellinCoefficient (fun t => fieldBottomPairValue g d t)) + (fun t => fieldBottomPairValue g d t) + (fun t => (mellin_inversion (fun t => fieldBottomPairValue g d t) t).symm) k ρ + simpa only [k, Units.val_mul, Units.val_pow_eq_pow_val, Units.val_mk0, + fieldPairCoefficientMoment, squareCharacterMass] using h + +theorem fieldPair_scaled_square_mean_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (d : ZMod p) (K : (ZMod p)ˣ) : + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * + (∑ b : (ZMod p)ˣ, ‖fieldBottomPairValue g d + ((K : ZMod p) * d * (b : ZMod p) ^ 2)‖ ^ 2) ≤ 2 * fieldPairMoment g d := by + by_cases hd : d = 0 + · simp [hd] + · let k : (ZMod p)ˣ := K * Units.mk0 d hd + have h := sum_square_coset_le_twice k + (fun t => ‖fieldBottomPairValue g d t‖ ^ 2) (fun _ => sq_nonneg _) + have h' := mul_le_mul_of_nonneg_left h + (show 0 ≤ (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ by positivity) + simpa only [k, Units.val_mul, Units.val_pow_eq_pow_val, Units.val_mk0, + fieldPairMoment, mul_left_comm] using h' + +/-- First average the held pair's split, while the two pair differences +remain fixed. This costs two square fibers and the moving-pair coefficient. -/ +theorem samePair_fixed_arguments_le {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (d e : ZMod p) (K L : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) : + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * (∑ b : (ZMod p)ˣ, + ‖mellinCoefficient (fun r : (ZMod p)ˣ => + fieldBottomPairValue g d ((K : ZMod p) * d * (r : ZMod p) ^ 2) * + fieldBottomPairValue h e ((L : ZMod p) * e * (b : ZMod p) ^ 2)) ρ‖ ^ 2) ≤ + 4 * squareCharacterMass (fun χ => fieldPairCoefficientMoment g χ d) ρ * + fieldPairMoment h e := by + let A := squareCharacterMass (fun χ => fieldPairCoefficientMoment g χ d) ρ + have hA : 0 ≤ A := squareCharacterMass_nonneg _ (fun _ => sq_nonneg _) _ + simp_rw [mellinCoefficient_mul_const, norm_mul, mul_pow] + calc + _ ≤ (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * (∑ b : (ZMod p)ˣ, + (2 * A) * ‖fieldBottomPairValue h e + ((L : ZMod p) * e * (b : ZMod p) ^ 2)‖ ^ 2) := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + exact Finset.sum_le_sum fun b _ => + mul_le_mul_of_nonneg_right (fieldPair_scaled_square_coefficient_le g d K ρ) + (sq_nonneg _) + _ = (2 * A) * ((Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * + ∑ b : (ZMod p)ˣ, ‖fieldBottomPairValue h e + ((L : ZMod p) * e * (b : ZMod p) ^ 2)‖ ^ 2) := by + rw [← Finset.mul_sum] + ring + _ ≤ (2 * A) * (2 * fieldPairMoment h e) := + mul_le_mul_of_nonneg_left (fieldPair_scaled_square_mean_le h e L) (by positivity) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairTotalMass.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairTotalMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..f8f78ca1367190e769f90302e175f6136f3d4903 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairTotalMass.lean @@ -0,0 +1,58 @@ +import OAI.NumberTheory.Ostmann.Tree.PairSpectrum + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem pairFourthMass_total (g : ZMod p → ℂ) (hg0 : g 0=0) (hg : l2Sq g ≤ 1) : + (∑ χ : MulChar (ZMod p) ℂ, pairFourthMass g χ) ≤ + 2*(p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ) := by + have hp : 0 < (p:ℝ) := by exact_mod_cast (Fact.out : p.Prime).pos + have hN : 0 < (Fintype.card (ZMod p)ˣ:ℝ) := by exact_mod_cast Fintype.card_pos + have henergy : (∑ x : ZMod p, ‖g x‖^2) ≤ (p:ℝ) := by + have hh : (∑ x : ZMod p, ‖g x‖^2)/(p:ℝ) ≤ 1 := by + simpa only [l2Sq, div_eq_mul_inv, mul_comm] using hg + simpa only [one_mul] using (div_le_iff₀ hp).mp hh + have hpair : (∑ d : (ZMod p)ˣ, ∑ t : (ZMod p)ˣ, ‖bottomPair g d t‖^2) ≤ (p:ℝ)^2 := + (bottomPair_total_energy g hg0).trans + (pow_le_pow_left₀ (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) henergy 2) + have hunit (d : (ZMod p)ˣ) : + (∑ χ : MulChar (ZMod p) ℂ, ‖pairSpectrum g χ d‖^2) = + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹ * ∑ t : (ZMod p)ˣ, ‖bottomPair g d t‖^2 := by + simp only [pairSpectrum_unit g _ d hg0] + exact mellin_parseval _ + have hnonzero : (∑ d : (ZMod p)ˣ, ∑ χ : MulChar (ZMod p) ℂ, ‖pairSpectrum g χ d‖^2) ≤ + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹*(p:ℝ)^2 := by + simp_rw [hunit] + rw [← Finset.mul_sum] + exact mul_le_mul_of_nonneg_left hpair (inv_nonneg.mpr hN.le) + have hzero : (∑ χ : MulChar (ZMod p) ℂ, ‖pairSpectrum g χ 0‖^2) ≤ + (p:ℝ)^2/(Fintype.card (ZMod p)ˣ:ℝ) := by + simp only [pairSpectrum_zero g _ hg0, Complex.norm_real, Real.norm_eq_abs, sq_abs, + Finset.sum_const, Finset.card_univ, mulChar_card, nsmul_eq_mul] + have hm : ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))*l2Sq g ≤ + (p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ) := by + exact (mul_le_mul_of_nonneg_left hg (by positivity)).trans_eq (mul_one _) + calc + _ ≤ (Fintype.card (ZMod p)ˣ:ℝ)*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2 := + mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (mul_nonneg (div_nonneg hp.le hN.le) (l2Sq_nonneg g)) hm 2) hN.le + _ = _ := by field_simp + have hsplit : (∑ χ : MulChar (ZMod p) ℂ, pairFourthMass g χ) = + (p:ℝ)⁻¹ * ((∑ d : (ZMod p)ˣ, ∑ χ : MulChar (ZMod p) ℂ, ‖pairSpectrum g χ d‖^2) + + ∑ χ : MulChar (ZMod p) ℂ, ‖pairSpectrum g χ 0‖^2) := by + simp_rw [pairFourthMass_eq_l2Sq, l2Sq] + rw [← Finset.mul_sum, Finset.sum_comm, ← sum_units_add_zero] + rw [hsplit] + calc + _ ≤ (p:ℝ)⁻¹*((Fintype.card (ZMod p)ˣ:ℝ)⁻¹*(p:ℝ)^2+ + (p:ℝ)^2/(Fintype.card (ZMod p)ˣ:ℝ)) := + mul_le_mul_of_nonneg_left (add_le_add hnonzero hzero) (inv_nonneg.mpr hp.le) + _ = _ := by field_simp; ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairedFrequencyProjection.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairedFrequencyProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..65ce4cb8c5f34972158609819836921f2cdcd0e2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairedFrequencyProjection.lean @@ -0,0 +1,41 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.RecursiveFrequencySupport + +namespace OAI + +/-! # The two actual frequency histories inside a paired tree -/ + +namespace Ostmann +open scoped Classical + +def frequencyPairProjection (S : Finset ℤ) (n : ℕ) (b : Bool) + (t : FrequencyTree (S × S) n) : FrequencyTree S n := + frequencyTreeMap (fun p => if b then p.2 else p.1) n t + +theorem frequencySplitList_projection (S : Finset ℤ) (n : ℕ) (b : Bool) + (t : FrequencyTree (S × S) n) : + singleFrequencySplitList S n (frequencyPairProjection S n b t) = + (frequencySplitList S n t).map (fun p => if b then p.2 else p.1) := by + induction n with + | zero => rfl + | succ n ih => + have hl := ih t.2.1 + have hr := ih t.2.2 + dsimp only [frequencyPairProjection] at hl hr + simp only [frequencyPairProjection, frequencyTreeMap, singleFrequencySplitList, + frequencySplitList, List.map_cons, List.map_append, frequencyRoot_map, + hl, hr] + cases b <;> rfl + +theorem treeNodeFrequencies_projection (S : Finset ℤ) (n : ℕ) (b : Bool) + (t : FrequencyTree (S × S) n) (j : ℕ) : + singleTreeNodeFrequencies S n (frequencyPairProjection S n b t) j = + if b then (treeNodeFrequencies S n t j).2 else (treeNodeFrequencies S n t j).1 := by + unfold singleTreeNodeFrequencies treeNodeFrequencies + rw [frequencySplitList_projection] + have h := List.getD_map (frequencySplitList S n t) + (emptyNodeFrequencies, emptyNodeFrequencies) (fun p => if b then p.2 else p.1) (n := j) + cases b <;> simpa only [Bool.false_eq_true, ite_false, ite_true] using h + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairedPartitions.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairedPartitions.lean new file mode 100644 index 0000000000000000000000000000000000000000..bc61646115b59a98cf654d4435f8ed028ed2f5b2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairedPartitions.lean @@ -0,0 +1,118 @@ +import OAI.NumberTheory.Ostmann.Tree.PartitionProducts +import OAI.NumberTheory.Ostmann.Tree.FiberProjection +import OAI.NumberTheory.Ostmann.Characters.CycleMovingPair + +namespace OAI + +/-! # Projection reduction for two different partitions of the leaves -/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +theorem card_pairedMaps {Ω₁ Ω₂ T : Type*} + [Fintype Ω₁] [Fintype Ω₂] [DecidableEq T] + (τ₁ : Ω₁ → T) (τ₂ : Ω₂ → T) (N : ℕ) + (hN : ∀ t, (Finset.univ.filter (fun y => τ₂ y = t)).card = N) : + (Finset.univ.filter fun xy : Ω₁ × Ω₂ => τ₁ xy.1 = τ₂ xy.2).card = + Fintype.card Ω₁ * N := by + classical + simp only [Finset.card_eq_sum_ones, Finset.sum_filter] + rw [Fintype.sum_prod_type] + have hy (x : Ω₁) : (∑ y : Ω₂, if τ₁ x = τ₂ y then 1 else 0) = N := by + simpa only [Finset.card_eq_sum_ones, Finset.sum_filter, eq_comm] using hN (τ₁ x) + simp only [hy, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, Nat.cast_id] + +theorem pairedMaps_correlation_eq {Ω₁ Ω₂ T : Type*} + [Fintype Ω₁] [Fintype Ω₂] [Fintype T] [DecidableEq T] + (τ₁ : Ω₁ → T) (τ₂ : Ω₂ → T) (f : Ω₁ → ℂ) (g : Ω₂ → ℂ) : + (∑ t : T, fiberSum τ₁ f t * conj (fiberSum τ₂ g t)) = + ∑ x : Ω₁, ∑ y : Ω₂, if τ₁ x = τ₂ y then f x * conj (g y) else 0 := by + unfold fiberSum + simp only [Finset.sum_filter, Finset.sum_mul, ite_mul, zero_mul] + rw [Finset.sum_comm] + simp only [Finset.sum_ite_eq, Finset.mem_univ, ite_true] + simp only [map_sum, apply_ite, map_zero, Finset.mul_sum, mul_zero] + apply Finset.sum_congr rfl + intro x _ + apply Finset.sum_congr rfl + intro y _ + by_cases hxy : τ₁ x = τ₂ y + · simp [hxy] + · simp [hxy, Ne.symm hxy] + +theorem pairedMaps_correlation_sq_le {G Ω₁ Ω₂ T : Type*} + [Group G] [Fintype G] [Fintype Ω₁] [Fintype Ω₂] [Fintype T] + [DecidableEq T] [MulAction G Ω₁] + (τ₁ : Ω₁ → T) (τ₂ : Ω₂ → T) (hτ : ∀ (z : G) x, τ₁ (z • x) = τ₁ x) + (f : Ω₁ → ℂ) (g : Ω₂ → ℂ) (N : ℕ) + (hN₁ : ∀ t, (Finset.univ.filter (fun x => τ₁ x = t)).card ≤ N) + (hN₂ : ∀ t, (Finset.univ.filter (fun x => τ₂ x = t)).card ≤ N) : + ‖∑ x : Ω₁, ∑ y : Ω₂, if τ₁ x = τ₂ y then f x * conj (g y) else 0‖ ^ 2 ≤ + (N : ℝ) ^ 2 * (∑ x : Ω₁, ‖finiteActionAverage (G := G) f x‖ ^ 2) * + ∑ y : Ω₂, ‖g y‖ ^ 2 := by + rw [← pairedMaps_correlation_eq] + have hF := fiberSum_energy_le τ₁ (finiteActionAverage (G := G) f) N hN₁ + have hG := fiberSum_energy_le τ₂ g N hN₂ + have h := complex_correlation_sq_le + (fiberSum τ₁ (finiteActionAverage (G := G) f)) (fiberSum τ₂ g) + simp_rw [fiberSum_actionAverage τ₁ hτ f] at h hF + apply h.trans + have hb := mul_le_mul hF hG (by positivity) (by positivity) + convert hb using 1 + ring + +theorem partitionProduct_cycleMultiply {L C G : Type*} + [Fintype L] [DecidableEq C] [CommGroup G] + (component : L → C) (sign : L → ℤ) + (hs : ∀ c, ∑ i ∈ Finset.univ.filter (fun i => component i = c), sign i = 0) + (z : G) (m : L → G) : + partitionProduct component (cycleMultiply sign z m) = partitionProduct component m := by + classical + funext c + unfold partitionProduct + have hprod (f : L → G) : (∏ i : {i : L // component i = c}, f i.1) = + ∏ i ∈ Finset.univ.filter (fun i => component i = c), f i := + (Finset.prod_subtype _ (by simp) f).symm + rw [hprod, hprod] + exact cycleMultiply_preserves_product _ sign (hs c) z m + +/-- Exact counting normalization of the paired-component projection step. -/ +theorem pairedPartitions_projection {L C G : Type*} + [Fintype L] [Fintype C] [DecidableEq L] [DecidableEq C] + [CommGroup G] [Fintype G] [DecidableEq G] + (component₁ component₂ : L → C) + (pivot₁ : ∀ c, {i : L // component₁ i = c}) + (pivot₂ : ∀ c, {i : L // component₂ i = c}) + (sign : L → ℤ) + (hs : ∀ c, ∑ i ∈ Finset.univ.filter (fun i => component₁ i = c), sign i = 0) + (f g : (L → G) → ℂ) : + ‖((Fintype.card (L → G) : ℂ) * + (Fintype.card G ^ (Fintype.card L - Fintype.card C) : ℕ))⁻¹ * + (∑ x : L → G, ∑ y : L → G, + if partitionProduct component₁ x = partitionProduct component₂ y + then f x * conj (g y) else 0)‖ ^ 2 ≤ + ((∑ x : L → G, ‖cycleAverage sign f x‖ ^ 2) / (Fintype.card (L → G) : ℝ)) * + ((∑ y : L → G, ‖g y‖ ^ 2) / (Fintype.card (L → G) : ℝ)) := by + let := leafCycleAction (G := G) sign + let N := Fintype.card G ^ (Fintype.card L - Fintype.card C) + have hN : 0 < N := pow_pos Fintype.card_pos _ + have hL : (Fintype.card (L → G) : ℝ) ≠ 0 := by + exact_mod_cast Fintype.card_ne_zero + have hN' : (N : ℝ) ≠ 0 := by exact_mod_cast Nat.ne_of_gt hN + have h := pairedMaps_correlation_sq_le (G := G) + (partitionProduct component₁) (partitionProduct component₂) + (partitionProduct_cycleMultiply component₁ sign hs) f g N + (fun P => (card_partitionProduct_filter component₁ pivot₁ P).le) + (fun P => (card_partitionProduct_filter component₂ pivot₂ P).le) + change ‖((Fintype.card (L → G) : ℂ) * (N : ℂ))⁻¹ * _‖ ^ 2 ≤ _ + rw [norm_mul, norm_inv, norm_mul, Complex.norm_natCast, Complex.norm_natCast, mul_pow] + have hscaled := mul_le_mul_of_nonneg_left h + (sq_nonneg (((Fintype.card (L → G) : ℝ) * (N : ℝ))⁻¹)) + change _ ≤ _ * ((↑N ^ 2 * ∑ x, ‖cycleAverage sign f x‖ ^ 2) * ∑ y, ‖g y‖ ^ 2) at hscaled + convert hscaled using 1 + field_simp + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PairedRationalReduction.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PairedRationalReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..01411f8214298065873d524493f54a533553b462 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PairedRationalReduction.lean @@ -0,0 +1,75 @@ +import OAI.NumberTheory.Ostmann.Tree.PairedPartitions +import OAI.NumberTheory.Ostmann.Characters.TreeLeafIndex + +namespace OAI + +/-! # Cycle projection for two actual rational diagrams -/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +noncomputable def pairedPartitionCorrelation {L C G : Type*} + [Fintype L] [Fintype C] [DecidableEq L] [DecidableEq C] + [CommGroup G] [Fintype G] [DecidableEq G] + (component₁ component₂ : L → C) (f g : (L → G) → ℂ) : ℂ := + ((Fintype.card (L → G) : ℂ) * + (Fintype.card G ^ (Fintype.card L - Fintype.card C) : ℕ))⁻¹ * + ∑ x : L → G, ∑ y : L → G, + if partitionProduct component₁ x = partitionProduct component₂ y + then f x * conj (g y) else 0 + +/-- The counting denominator is exactly the size of the equal-total sample space. -/ +theorem card_pairedPartitions {L C G : Type*} + [Fintype L] [Fintype C] [DecidableEq L] [DecidableEq C] + [CommGroup G] [Fintype G] [DecidableEq G] + (component₁ component₂ : L → C) + (pivot₂ : ∀ c, {i : L // component₂ i = c}) : + (Finset.univ.filter fun xy : (L → G) × (L → G) => + partitionProduct component₁ xy.1 = partitionProduct component₂ xy.2).card = + Fintype.card (L → G) * Fintype.card G ^ (Fintype.card L - Fintype.card C) := + card_pairedMaps _ _ _ (card_partitionProduct_filter component₂ pivot₂) + +/-- The projection reduction in `tree-projection-reduction`, for the actual diagram values. -/ +theorem pairedRationalTree_projection {p : ℕ} [Fact p.Prime] + (hp : 3 ≤ p) (g : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) + (n : ℕ) {C : Type*} [Fintype C] [DecidableEq C] + (component₁ component₂ : TreeLeafIndex (n + 2) → C) + (pivot₁ : ∀ c, {i : TreeLeafIndex (n + 2) // component₁ i = c}) + (pivot₂ : ∀ c, {i : TreeLeafIndex (n + 2) // component₂ i = c}) + (hc : Fintype.card C ≤ 3 * 2 ^ n) + (D₁ D₂ : (ZMod p)ˣ) {K₁ K₂ : (ZMod p)ˣ} + (T₁ : RationalTreeData (ZMod p)ˣ (n + 2) K₁) + (T₂ : RationalTreeData (ZMod p)ˣ (n + 2) K₂) + (XL₁ XR₁ XL₂ XR₂ : (ZMod p)ˣ) (c₁ c₂ : TreeLeafTuple Bool (n + 2)) : + let W₁ := indexedRationalAmplitude g D₁ T₁ XL₁ XR₁ c₁ + let W₂ := indexedRationalAmplitude g D₂ T₂ XL₂ XR₂ c₂ + ∃ cycle : BalancedIncidenceCycle component₁ (bottomQuartet n), + ‖pairedPartitionCorrelation component₁ component₂ W₁ W₂‖ ^ 2 ≤ + (3 : ℝ) ^ (2 ^ (n + 2)) * + ((∑ m : TreeLeafIndex (n + 2) → (ZMod p)ˣ, + ‖cycleAverage cycle.sign W₁ m‖ ^ 2) / + (Fintype.card (TreeLeafIndex (n + 2) → (ZMod p)ˣ) : ℝ)) := by + dsimp only + have hcard : Fintype.card C + Fintype.card (TreeLeafIndex n) ≤ + Fintype.card (TreeLeafIndex (n + 2)) := by + rw [card_treeLeafIndex, card_treeLeafIndex, pow_add] + norm_num + omega + obtain ⟨cycle⟩ := exists_balancedIncidenceCycle component₁ (bottomQuartet n) hcard + refine ⟨cycle, ?_⟩ + have h := pairedPartitions_projection component₁ component₂ pivot₁ pivot₂ cycle.sign + cycle.component_balanced (indexedRationalAmplitude g D₁ T₁ XL₁ XR₁ c₁) + (indexedRationalAmplitude g D₂ T₂ XL₂ XR₂ c₂) + apply h.trans + have hsecond := indexedRationalAmplitude_l2_bound hp g hg henergy D₂ T₂ XL₂ XR₂ c₂ + have hfirst : 0 ≤ + (∑ m : TreeLeafIndex (n + 2) → (ZMod p)ˣ, + ‖cycleAverage cycle.sign (indexedRationalAmplitude g D₁ T₁ XL₁ XR₁ c₁) m‖ ^ 2) / + (Fintype.card (TreeLeafIndex (n + 2) → (ZMod p)ˣ) : ℝ) := by positivity + exact (mul_le_mul_of_nonneg_left hsecond hfirst).trans_eq (mul_comm _ _) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ParallelCycle.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ParallelCycle.lean new file mode 100644 index 0000000000000000000000000000000000000000..0476c3512483030adc4ede606c864e4f2fa6b9da --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ParallelCycle.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.Ostmann.Characters.CycleAction +import OAI.NumberTheory.Ostmann.Tree.IncidenceCycle + +namespace OAI + +/-! +# The two-edge cycle + +Two leaves in the same component and the same quartet give a balanced +sign vector supported on precisely those two leaves. No additional +assumption is needed for this degenerate cycle. +-/ + +namespace Ostmann + +open scoped BigOperators + +def parallelCycleSign {I : Type*} [DecidableEq I] (i j k : I) : ℤ := + (if k = i then 1 else 0) - (if k = j then 1 else 0) + +theorem parallelCycleSign_left {I : Type*} [DecidableEq I] (i j : I) (hij : i ≠ j) : + parallelCycleSign i j i = 1 := by simp [parallelCycleSign, hij] + +theorem parallelCycleSign_right {I : Type*} [DecidableEq I] (i j : I) (hij : i ≠ j) : + parallelCycleSign i j j = -1 := by simp [parallelCycleSign, Ne.symm hij] + +theorem parallelCycleSign_other {I : Type*} [DecidableEq I] (i j k : I) + (hki : k ≠ i) (hkj : k ≠ j) : parallelCycleSign i j k = 0 := by + simp [parallelCycleSign, hki, hkj] + +theorem sum_parallelCycleSign {I : Type*} [DecidableEq I] (s : Finset I) (i j : I) : + (∑ k ∈ s, parallelCycleSign i j k) = + (if i ∈ s then 1 else 0) - (if j ∈ s then 1 else 0) := by + simp [parallelCycleSign, Finset.sum_sub_distrib] + +/-- The same block membership cancels the two signs. -/ +theorem parallelCycleSign_balanced {I J : Type*} [Fintype I] [DecidableEq I] [DecidableEq J] + (block : I → J) (i j : I) (hij : block i = block j) (b : J) : + (∑ k ∈ Finset.univ.filter (fun k => block k = b), parallelCycleSign i j k) = 0 := by + rw [sum_parallelCycleSign] + simp only [Finset.mem_filter, Finset.mem_univ, true_and, hij, sub_self] + +/-- Reciprocal multiplication on parallel leaves preserves every component product. -/ +theorem parallelCycle_preserves_blocks {I J G : Type*} [Fintype I] [DecidableEq I] + [DecidableEq J] [CommGroup G] (block : I → J) (i j : I) + (hij : block i = block j) (b : J) (z : G) (m : I → G) : + (∏ k ∈ Finset.univ.filter (fun k => block k = b), + cycleMultiply (parallelCycleSign i j) z m k) = + ∏ k ∈ Finset.univ.filter (fun k => block k = b), m k := by + exact cycleMultiply_preserves_product _ _ (parallelCycleSign_balanced block i j hij b) z m + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/Parseval.lean b/lean/OAI/NumberTheory/Ostmann/Tree/Parseval.lean new file mode 100644 index 0000000000000000000000000000000000000000..4b688d79946140baa12e392e7c471b328287f04f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/Parseval.lean @@ -0,0 +1,26 @@ +import OAI.NumberTheory.Ostmann.Supply.FiniteParseval +import OAI.NumberTheory.Ostmann.Tree.Fourier + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [NeZero p] + +theorem fourier_parseval (f : ZMod p → ℂ) : + ∑ a, ‖fourier f a‖ ^ 2 = l2Sq f := by + have hp : (p : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p + simp only [fourier, norm_mul, norm_inv, Complex.norm_natCast, mul_pow] + rw [← Finset.mul_sum, Supply.dft_parseval] + dsimp [l2Sq] + field_simp + +@[simp] theorem conj_fourier (f : ZMod p → ℂ) (a : ZMod p) : + conj (fourier f a) = fourier (fun x => conj (f x)) (-a) := by + simp only [fourier, map_mul, map_inv₀, map_natCast, Supply.conj_dft] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PartitionMatching.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PartitionMatching.lean new file mode 100644 index 0000000000000000000000000000000000000000..4aecf5d3ad9dbb511adf496f6b869a5d7fa7b422 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PartitionMatching.lean @@ -0,0 +1,85 @@ +import Mathlib.Data.Fintype.Perm +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Logic.Equiv.Basic + +namespace OAI + +/-! # Counting labeled arrangements that respect paired partitions -/ + +namespace Ostmann + +open scoped BigOperators Classical + +def PartitionMatching {A B C : Type*} (f : A → C) (g : B → C) := + {e : A ≃ B // ∀ a, g (e a) = f a} + +noncomputable instance {A B C : Type*} [Fintype A] [Fintype B] + (f : A → C) (g : B → C) : Fintype (PartitionMatching f g) := + inferInstanceAs (Fintype {e : A ≃ B // ∀ a, g (e a) = f a}) + +def PartitionMatching.restrict {A B C : Type*} {f : A → C} {g : B → C} + (e : PartitionMatching f g) (c : C) : + {a : A // f a = c} ≃ {b : B // g b = c} where + toFun a := ⟨e.1 a, (e.2 a).trans a.2⟩ + invFun b := ⟨e.1.symm b, by rw [← e.2]; simpa using b.2⟩ + left_inv a := Subtype.ext (e.1.symm_apply_apply a) + right_inv b := Subtype.ext (e.1.apply_symm_apply b) + +theorem PartitionMatching.restrict_injective {A B C : Type*} + {f : A → C} {g : B → C} : + Function.Injective (fun e : PartitionMatching f g => e.restrict) := by + intro e e' h + apply Subtype.ext + apply Equiv.ext + intro a + exact congrArg Subtype.val (Equiv.congr_fun (congrFun h (f a)) ⟨a, rfl⟩) + +/-- Each label can be matched independently; an upper bound suffices even +without constructing the inverse assembly map. -/ +theorem card_partitionMatching_le {A B C : Type*} + [Fintype A] [Fintype B] [Fintype C] (f : A → C) (g : B → C) + (hcard : ∀ c, Fintype.card {a : A // f a = c} = + Fintype.card {b : B // g b = c}) : + Fintype.card (PartitionMatching f g) ≤ + ∏ c, (Fintype.card {a : A // f a = c}).factorial := by + classical + calc + _ ≤ Fintype.card (∀ c, {a : A // f a = c} ≃ {b : B // g b = c}) := + Fintype.card_le_of_injective _ PartitionMatching.restrict_injective + _ = _ := by + rw [Fintype.card_pi] + apply Finset.prod_congr rfl + intro c _ + exact Fintype.card_equiv (Fintype.equivOfCardEq (hcard c)) + +def slotFiberEquiv {L C : Type*} (f : L → C) (m : ℕ) (c : C) : + {x : L × Fin m // f x.1 = c} ≃ ({l : L // f l = c} × Fin m) where + toFun x := (⟨x.1.1, x.2⟩, x.1.2) + invFun x := ⟨(x.1.1, x.2), x.1.2⟩ + left_inv _ := rfl + right_inv _ := rfl + +theorem card_slotFiber {L C : Type*} [Fintype L] + (f : L → C) (m : ℕ) (c : C) : + Fintype.card {x : L × Fin m // f x.1 = c} = + Fintype.card {l : L // f l = c} * m := by + classical + rw [Fintype.card_congr (slotFiberEquiv f m c), Fintype.card_prod, Fintype.card_fin] + +/-- Slots and sampled variables remain labeled, so every arrangement is +an actual permutation of all rm positions. -/ +theorem card_slotMatching_le {L C : Type*} [Fintype L] [Fintype C] + (f g : L → C) (m : ℕ) + (hcard : ∀ c, Fintype.card {l : L // f l = c} = + Fintype.card {l : L // g l = c}) : + Fintype.card (PartitionMatching (fun x : L × Fin m => f x.1) + (fun x : L × Fin m => g x.1)) ≤ + ∏ c, (Fintype.card {l : L // f l = c} * m).factorial := by + simpa only [card_slotFiber] using + card_partitionMatching_le (fun x : L × Fin m => f x.1) + (fun x : L × Fin m => g x.1) + (fun c => by rw [card_slotFiber, card_slotFiber, hcard c]) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PartitionProducts.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PartitionProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..5774431a77fa81faac23f5bd06e341cbf0b64522 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PartitionProducts.lean @@ -0,0 +1,85 @@ +import Mathlib.Logic.Equiv.Basic +import Mathlib.Algebra.Order.BigOperators.Group.Finset +import OAI.NumberTheory.Ostmann.Tree.ComponentFibers + +namespace OAI + +/-! # Simultaneous product fibers for an arbitrary partition of the leaves -/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable def partitionProduct {L C G : Type*} [Fintype L] [DecidableEq C] + [CommGroup G] (component : L → C) (m : L → G) (c : C) : G := + ∏ i : {i : L // component i = c}, m i.1 + +noncomputable def partitionCoordinates {L C G : Type*} + (component : L → C) : (L → G) ≃ (∀ c : C, {i : L // component i = c} → G) := + Equiv.piCongrFiberwise (fun _ => Equiv.refl _) + +/-- Fixing all component totals is the product of the individual product fibers. -/ +noncomputable def partitionProductFiberEquiv {L C G : Type*} + [Fintype L] [DecidableEq C] [CommGroup G] + (component : L → C) (P : C → G) : + {m : L → G // partitionProduct component m = P} ≃ + (∀ c : C, {v : ({i : L // component i = c} → G) // ∏ i, v i = P c}) where + toFun m c := ⟨fun i => m.1 i.1, congrFun m.property c⟩ + invFun v := ⟨(partitionCoordinates component).symm (fun c => (v c).1), by + funext c + change (∏ i : {i : L // component i = c}, + ((partitionCoordinates component).symm (fun d => (v d).1)) i.1) = P c + have h := congrFun ((partitionCoordinates component).apply_symm_apply + (fun d => (v d).1)) c + change (fun i : {i : L // component i = c} => + ((partitionCoordinates component).symm (fun d => (v d).1)) i.1) = (v c).1 at h + rw [h] + exact (v c).property⟩ + left_inv m := by + apply Subtype.ext + exact (partitionCoordinates component).symm_apply_apply m.1 + right_inv v := by + funext c + apply Subtype.ext + exact congrFun ((partitionCoordinates component).apply_symm_apply + (fun d => (v d).1)) c + +theorem sum_card_partition {L C : Type*} [Fintype L] [Fintype C] + [DecidableEq C] (component : L → C) : + (∑ c : C, Fintype.card {i : L // component i = c}) = Fintype.card L := by + rw [← Fintype.card_sigma] + exact Fintype.card_congr (Equiv.sigmaFiberEquiv component) + +theorem card_partitionProductFiber {L C G : Type*} + [Fintype L] [Fintype C] [DecidableEq L] [DecidableEq C] + [CommGroup G] [Fintype G] [DecidableEq G] + (component : L → C) (pivot : ∀ c, {i : L // component i = c}) (P : C → G) : + Fintype.card {m : L → G // partitionProduct component m = P} = + Fintype.card G ^ (Fintype.card L - Fintype.card C) := by + classical + rw [Fintype.card_congr (partitionProductFiberEquiv component P), Fintype.card_pi] + have hcard (c : C) : + Fintype.card {i : {i : L // component i = c} // i ≠ pivot c} = + Fintype.card {i : L // component i = c} - 1 := by + simp only [Fintype.card_subtype_compl, Fintype.card_subtype_eq] + simp_rw [card_componentProduct (pivot _), hcard] + rw [Finset.prod_pow_eq_pow_sum] + congr 1 + rw [Finset.sum_tsub_distrib] + · simp only [sum_card_partition, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, + mul_one, Nat.cast_id] + · intro c _ + exact Fintype.card_pos_iff.mpr ⟨pivot c⟩ + +theorem card_partitionProduct_filter {L C G : Type*} + [Fintype L] [Fintype C] [DecidableEq L] [DecidableEq C] + [CommGroup G] [Fintype G] [DecidableEq G] + (component : L → C) (pivot : ∀ c, {i : L // component i = c}) (P : C → G) : + (Finset.univ.filter fun m : L → G => partitionProduct component m = P).card = + Fintype.card G ^ (Fintype.card L - Fintype.card C) := by + rw [← Fintype.card_subtype] + exact card_partitionProductFiber component pivot P + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PreorderNodePaths.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PreorderNodePaths.lean new file mode 100644 index 0000000000000000000000000000000000000000..a06621a7973bd7d985609a646ed7bfe52731489c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PreorderNodePaths.lean @@ -0,0 +1,123 @@ +import OAI.NumberTheory.Ostmann.Construction.AncestorPivotPrecision +import OAI.NumberTheory.Ostmann.Arithmetic.SingleFrequencyTree + +namespace OAI + +/-! # Explicit preorder indices for internal nodes and their ancestors -/ + +namespace Ostmann + +/-- `false` descends left, `true` descends right. -/ +def nodePathIndex : ℕ → List Bool → ℕ + | 0, _ => 0 + | _ + 1, [] => 0 + | n + 1, b :: p => (if b then 2 ^ n else 1) + nodePathIndex n p + +theorem nodePathIndex_lt (n : ℕ) (p : List Bool) (hp : p.length < n) : + nodePathIndex n p < 2 ^ n - 1 := by + induction n generalizing p with + | zero => simp at hp + | succ n ih => + cases p with + | nil => + simp only [nodePathIndex] + have := Nat.one_le_two_pow (n := n) + rw [pow_succ] + omega + | cons b p => + have hp' : p.length < n := by simpa using hp + have hi := ih p hp' + have := Nat.one_le_two_pow (n := n) + cases b <;> simp only [nodePathIndex, Bool.false_eq_true, ite_false, ite_true] + all_goals rw [pow_succ]; omega + +def preorderNodePath : (n : ℕ) → Fin (2 ^ n - 1) → List Bool + | 0, j => Fin.elim0 j + | n + 1, j => + if h0 : j.val = 0 then [] + else if hL : j.val < 2 ^ n then + false :: preorderNodePath n ⟨j.val - 1, by omega⟩ + else true :: preorderNodePath n ⟨j.val - 2 ^ n, by + have hj : j.val < 2 ^ n * 2 - 1 := by + calc + j.val < 2 ^ (n + 1) - 1 := j.isLt + _ = 2 ^ n * 2 - 1 := by rw [pow_succ] + have := Nat.one_le_two_pow (n := n) + omega⟩ + +theorem preorderNodePath_length (n : ℕ) (j : Fin (2 ^ n - 1)) : + (preorderNodePath n j).length < n := by + induction n with + | zero => exact Fin.elim0 j + | succ n ih => + simp only [preorderNodePath] + split_ifs + · simp + · simpa only [List.length_cons, Nat.add_lt_add_iff_right] using ih _ + · simpa only [List.length_cons, Nat.add_lt_add_iff_right] using ih _ + +theorem nodePathIndex_preorderNodePath (n : ℕ) (j : Fin (2 ^ n - 1)) : + nodePathIndex n (preorderNodePath n j) = j.val := by + induction n with + | zero => exact Fin.elim0 j + | succ n ih => + simp only [preorderNodePath] + split_ifs with h0 hL + · exact h0.symm + · simp only [nodePathIndex, Bool.false_eq_true, ite_false, ih] + omega + · simp only [nodePathIndex, ite_true, ih] + omega + +theorem preorderNodePath_nodePathIndex (n : ℕ) (p : List Bool) (hp : p.length < n) : + preorderNodePath n ⟨nodePathIndex n p, nodePathIndex_lt n p hp⟩ = p := by + induction n generalizing p with + | zero => simp at hp + | succ n ih => + cases p with + | nil => simp [nodePathIndex, preorderNodePath] + | cons b p => + have hp' : p.length < n := by simpa using hp + have hi := nodePathIndex_lt n p hp' + have hpow := Nat.one_le_two_pow (n := n) + cases b + · have hzero : 1 + nodePathIndex n p ≠ 0 := by omega + have hleft : 1 + nodePathIndex n p < 2 ^ n := by omega + simp only [nodePathIndex, Bool.false_eq_true, ite_false, preorderNodePath, + hzero, dite_false, hleft, dite_true] + congr 1 + simpa only [Nat.add_sub_cancel_left] using ih p hp' + · have hzero : 2 ^ n + nodePathIndex n p ≠ 0 := by positivity + have hleft : ¬2 ^ n + nodePathIndex n p < 2 ^ n := by omega + simp only [nodePathIndex, ite_true, preorderNodePath, hzero, dite_false, hleft] + congr 1 + simpa only [Nat.add_sub_cancel_left] using ih p hp' + +theorem nodePathIndex_nonempty_pos (n : ℕ) (p : List Bool) + (hp : p.length < n) (hne : p ≠ []) : 0 < nodePathIndex n p := by + cases n with + | zero => simp at hp + | succ n => + cases p with + | nil => exact False.elim (hne rfl) + | cons b p => + have := Nat.one_le_two_pow (n := n) + cases b <;> simp only [nodePathIndex, Bool.false_eq_true, ite_false, ite_true] <;> omega + +theorem nodePathIndex_proper_prefix (n : ℕ) (p s : List Bool) + (hps : (p ++ s).length < n) (hs : s ≠ []) : + nodePathIndex n p < nodePathIndex n (p ++ s) := by + induction n generalizing p with + | zero => simp at hps + | succ n ih => + cases p with + | nil => + simpa only [List.nil_append, nodePathIndex] using nodePathIndex_nonempty_pos (n + 1) s hps hs + | cons b p => + have hi := ih p (by simpa only [List.cons_append, List.length_cons, Nat.add_lt_add_iff_right] using hps) + simp only [List.cons_append, nodePathIndex] + exact Nat.add_lt_add_left hi _ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/PrincipalSpectrum.lean b/lean/OAI/NumberTheory/Ostmann/Tree/PrincipalSpectrum.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd73037cc09f9ee7b7d66d7f0df638a89e225fb3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/PrincipalSpectrum.lean @@ -0,0 +1,76 @@ +import OAI.NumberTheory.Ostmann.Tree.TwistedPairSpectrum + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem fourier_mul_principal (f : ZMod p → ℂ) (a : ZMod p) : + fourier (fun d => f d*(1:MulChar (ZMod p) ℂ) d) a = + fourier f a-(p:ℂ)⁻¹*f 0 := by + classical + have he (d : ZMod p) : f d*(1:MulChar (ZMod p) ℂ) d*ZMod.stdAddChar (-(a*d)) = + f d*ZMod.stdAddChar (-(a*d))-(if d=0 then f 0 else 0) := by + by_cases hd : d=0 + · simp [hd,MulChar.map_zero] + · rw [MulChar.one_apply (isUnit_iff_ne_zero.mpr hd)] + simp [hd] + simp only [fourier_apply,he,Finset.sum_sub_distrib] + simp only [Finset.sum_ite_eq',Finset.mem_univ,ite_true] + ring + +theorem twistedPairFourier_scale (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ α : MulChar (ZMod p) ℂ) (a : ZMod p) : + twistedPairFourier g σ χ α a = α (σ⁻¹:(ZMod p)ˣ) * + fourier (fun d => pairSpectrum g χ d*α d) ((σ⁻¹:(ZMod p)ˣ)*a) := by + have hunit : α (σ⁻¹:(ZMod p)ˣ)*α σ=1 := by rw [← map_mul,← Units.val_mul,inv_mul_cancel,Units.val_one,map_one] + have he : (fun d => pairSpectrum g χ ((σ:ZMod p)*d)*α d) = + (fun d => α (σ⁻¹:(ZMod p)ˣ)*((pairSpectrum g χ ((σ:ZMod p)*d))*α ((σ:ZMod p)*d))) := by + funext d + rw [map_mul] + calc + _ = (α (σ⁻¹:(ZMod p)ˣ)*α σ)*(pairSpectrum g χ ((σ:ZMod p)*d)*α d) := by rw [hunit,one_mul] + _ = _ := by ring + unfold twistedPairFourier + rw [he,fourier_const_mul] + congr 1 + exact fourier_unitMul (fun d => pairSpectrum g χ d*α d) σ a + +theorem norm_twistedPairFourier_scale (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ α : MulChar (ZMod p) ℂ) (a : ZMod p) : + ‖twistedPairFourier g σ χ α a‖ = + ‖fourier (fun d => pairSpectrum g χ d*α d) ((σ⁻¹:(ZMod p)ˣ)*a)‖ := by + rw [twistedPairFourier_scale,norm_mul,mulChar_norm_unit,one_mul] + +theorem twistedPairFourier_principal (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ : MulChar (ZMod p) ℂ) (a : ZMod p) (hg0 : g 0=0) : + twistedPairFourier g σ χ 1 a = + ((pairWeight g χ ((σ⁻¹:(ZMod p)ˣ)*a)- + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹*l2Sq g : ℝ):ℂ) := by + rw [twistedPairFourier_scale,MulChar.one_apply_coe,one_mul,fourier_mul_principal, + fourier_pairSpectrum,pairSpectrum_zero g χ hg0] + have hp : (p:ℂ)≠0 := Nat.cast_ne_zero.mpr (Fact.out : p.Prime).ne_zero + push_cast + field_simp + +theorem norm_twistedPairFourier_principal_le (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ : MulChar (ZMod p) ℂ) (a : ZMod p) (hg0 : g 0=0) (hg : l2Sq g≤1) : + ‖twistedPairFourier g σ χ 1 a‖ ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))*(correlationBound g:ℝ)^2+ + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹ := by + rw [twistedPairFourier_principal g σ χ a hg0,Complex.norm_real,Real.norm_eq_abs] + have hw := pairWeight_nonneg g χ ((σ⁻¹:(ZMod p)ˣ)*a) + have hz : 0≤(Fintype.card (ZMod p)ˣ:ℝ)⁻¹*l2Sq g := mul_nonneg (by positivity) (l2Sq_nonneg g) + calc + _ ≤ |pairWeight g χ ((σ⁻¹:(ZMod p)ˣ)*a)|+ + |(Fintype.card (ZMod p)ˣ:ℝ)⁻¹*l2Sq g| := abs_sub _ _ + _ = pairWeight g χ ((σ⁻¹:(ZMod p)ˣ)*a)+(Fintype.card (ZMod p)ˣ:ℝ)⁻¹*l2Sq g := by rw [abs_of_nonneg hw,abs_of_nonneg hz] + _ ≤ _ := add_le_add (pairWeight_le g χ _) + ((mul_le_mul_of_nonneg_left hg (by positivity)).trans_eq (mul_one _)) + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ProductFibers.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ProductFibers.lean new file mode 100644 index 0000000000000000000000000000000000000000..87dc2a4ffa0861ad216b365f76c0e21997c33b2e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ProductFibers.lean @@ -0,0 +1,85 @@ +import Mathlib.Algebra.Group.Basic +import Mathlib.Data.Fintype.Prod +import Mathlib.Data.Fintype.EquivFin +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Tactic.Group +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# Uniform product fibers for pairs and quartets + +These explicit bijections justify exposing a component product and then +using independent coordinates on its fiber in the tree comparison. +-/ + +namespace Ostmann + +open scoped BigOperators + +def fixedProductPairEquiv {G : Type*} [CommGroup G] (P : G) : + {xy : G × G // xy.1 * xy.2 = P} ≃ G where + toFun xy := xy.1.1 + invFun x := ⟨(x, P / x), by simp⟩ + left_inv xy := by + apply Subtype.ext + apply Prod.ext + · rfl + · change P / xy.1.1 = xy.1.2 + calc + _ = (xy.1.1 * xy.1.2) / xy.1.1 := congrArg (fun t => t / xy.1.1) xy.property.symm + _ = _ := mul_div_cancel_left _ _ + right_inv x := rfl + +def fixedProductQuartetEquiv {G : Type*} [CommGroup G] (P : G) : + {m : G × (G × (G × G)) // m.1 * m.2.1 * m.2.2.1 * m.2.2.2 = P} ≃ G × (G × G) where + toFun m := (m.1.1, m.1.2.1, m.1.2.2.1) + invFun xyz := ⟨(xyz.1, xyz.2.1, xyz.2.2, P / (xyz.1 * xyz.2.1 * xyz.2.2)), by + dsimp + exact mul_div_cancel _ _⟩ + left_inv m := by + apply Subtype.ext + apply Prod.ext + · rfl + · apply Prod.ext + · rfl + · apply Prod.ext + · rfl + · change P / (m.1.1 * m.1.2.1 * m.1.2.2.1) = m.1.2.2.2 + calc + _ = (m.1.1 * m.1.2.1 * m.1.2.2.1 * m.1.2.2.2) / + (m.1.1 * m.1.2.1 * m.1.2.2.1) := + congrArg (fun t => t / (m.1.1 * m.1.2.1 * m.1.2.2.1)) m.property.symm + _ = _ := mul_div_cancel_left _ _ + right_inv xyz := rfl + +theorem card_fixedProductPair {G : Type*} [CommGroup G] [Fintype G] [DecidableEq G] (P : G) : + Fintype.card {xy : G × G // xy.1 * xy.2 = P} = Fintype.card G := + Fintype.card_congr (fixedProductPairEquiv P) + +theorem card_fixedProductQuartet {G : Type*} [CommGroup G] [Fintype G] [DecidableEq G] (P : G) : + Fintype.card {m : G × (G × (G × G)) // m.1 * m.2.1 * m.2.2.1 * m.2.2.2 = P} = + (Fintype.card G) ^ 3 := by + rw [Fintype.card_congr (fixedProductQuartetEquiv P), Fintype.card_prod, Fintype.card_prod] + ring + +/-- Uniform sampling of a fixed pair product leaves one free group coordinate. -/ +theorem sum_fixedProductPair {G R : Type*} [CommGroup G] [Fintype G] [DecidableEq G] + [AddCommMonoid R] (P : G) (f : G × G → R) : + (∑ xy : {xy : G × G // xy.1 * xy.2 = P}, f xy.1) = ∑ x : G, f (x, P / x) := by + exact ((fixedProductPairEquiv P).symm.bijective.sum_comp (fun xy => f xy.1)).symm + +/-- A fixed quartet product leaves three independent free coordinates. -/ +theorem sum_fixedProductQuartet {G R : Type*} [CommGroup G] [Fintype G] [DecidableEq G] + [AddCommMonoid R] (P : G) (f : G × (G × (G × G)) → R) : + (∑ m : {m : G × (G × (G × G)) // m.1 * m.2.1 * m.2.2.1 * m.2.2.2 = P}, f m.1) = + ∑ x : G, ∑ y : G, ∑ z : G, f (x, y, z, P / (x * y * z)) := by + have h := (fixedProductQuartetEquiv P).symm.bijective.sum_comp (fun m => f m.1) + change (∑ xyz : G × (G × G), f (xyz.1, xyz.2.1, xyz.2.2, + P / (xyz.1 * xyz.2.1 * xyz.2.2))) = _ at h + simpa only [Fintype.sum_prod_type] using h.symm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuarterPowerBound.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuarterPowerBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..198c8d66a3ad1954c7ac2c83f25b6e3a2cb948a0 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuarterPowerBound.lean @@ -0,0 +1,51 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.FiniteField + +theorem nested_sqrt_prime_bound (x : ℝ) (hx : 0 M i*z + +theorem leafProduct_scaleLeaf (M : Leaves 0 → Fˣ) (z : Fˣ) : + Parameters.leafProduct (scaleLeaf M z) = Parameters.leafProduct M*z := by + simp [Parameters.leafProduct, scaleLeaf, Finset.prod_mul_distrib, Leaves] + +def scalePair (M : Leaves 1 → Fˣ) (freeRight : Bool) (z : Fˣ) : Leaves 1 → Fˣ := + if freeRight then Density.join (Density.left M) (scaleLeaf (Density.right M) z) + else Density.join (scaleLeaf (Density.left M) z) (Density.right M) + +theorem leafProduct_scalePair (M : Leaves 1 → Fˣ) (side : Bool) (z : Fˣ) : + Parameters.leafProduct (scalePair M side z) = Parameters.leafProduct M*z := by + cases side <;> + simp [scalePair, Density.leafProduct_split, Density.left_join, Density.right_join, + leafProduct_scaleLeaf, mul_assoc, mul_left_comm, mul_comm] + +def movePair (M : Leaves 1 → Fˣ) (z : Fˣ) : Leaves 1 → Fˣ := + Density.join (scaleLeaf (Density.left M) z) (scaleLeaf (Density.right M) z⁻¹) + +theorem leafProduct_movePair (M : Leaves 1 → Fˣ) (z : Fˣ) : + Parameters.leafProduct (movePair M z) = Parameters.leafProduct M := by + simp [movePair, Density.leafProduct_split, Density.left_join, Density.right_join, + leafProduct_scaleLeaf, mul_assoc, mul_left_comm, mul_comm] + +def moveCross (M : Leaves 2 → Fˣ) (leftFreeRight rightFreeRight : Bool) (z : Fˣ) : + Leaves 2 → Fˣ := + Density.join (scalePair (Density.left M) leftFreeRight z) + (scalePair (Density.right M) rightFreeRight z⁻¹) + +theorem leafProduct_moveCross (M : Leaves 2 → Fˣ) (a b : Bool) (z : Fˣ) : + Parameters.leafProduct (moveCross M a b z) = Parameters.leafProduct M := by + rw [moveCross, Density.leafProduct_split, Density.left_join, Density.right_join, + leafProduct_scalePair, leafProduct_scalePair, Density.leafProduct_split M] + simp [mul_assoc, mul_left_comm, mul_comm] + +namespace NodeInput + +def withLeaves {d : ℕ} (N : NodeInput F d) (M : Leaves (d+1) → Fˣ) : NodeInput F d := + { N with leaves := M } + +theorem argument_withLeaves {d : ℕ} (N : NodeInput F d) (M : Leaves (d+1) → Fˣ) + (hM : Parameters.leafProduct M = Parameters.leafProduct N.leaves) : + (N.withLeaves M).argument = N.argument := by + simp only [argument, parameters, withLeaves, Density.rootArgument, Parameters.frequency, hM] + +theorem movePair_leftFactor (N : NodeInput F 0) (z : Fˣ) : + (N.withLeaves (movePair N.leaves z)).leftFactor = N.leftFactor*z := by + simp only [withLeaves, leftFactor, movePair, Density.left_join, leafProduct_scaleLeaf] + simp only [mul_assoc] + +theorem movePair_rightFactor (N : NodeInput F 0) (z : Fˣ) : + (N.withLeaves (movePair N.leaves z)).rightFactor = N.rightFactor/z := by + simp only [withLeaves, rightFactor, movePair, Density.right_join, leafProduct_scaleLeaf] + simp only [div_eq_mul_inv, mul_assoc] + +theorem movePair_ratio (N : NodeInput F 0) (z : Fˣ) (hp : N.pivot ≠ 0) + (hq : (N.withLeaves (movePair N.leaves z)).pivot ≠ 0) : + (N.withLeaves (movePair N.leaves z)).leftArgument hq / + (N.withLeaves (movePair N.leaves z)).rightArgument hq = + (N.leftArgument hp/N.rightArgument hp)/z^2 := by + rw [actual_child_ratio, movePair_leftFactor, movePair_rightFactor, + ratio_reciprocal_action, actual_child_ratio]; rfl + +theorem moveCross_leftFactor (N : NodeInput F 1) (a b : Bool) (z : Fˣ) : + (N.withLeaves (moveCross N.leaves a b z)).leftFactor = N.leftFactor*z := by + simp only [withLeaves, leftFactor, moveCross, Density.left_join, leafProduct_scalePair] + simp only [mul_assoc] + +theorem moveCross_rightFactor (N : NodeInput F 1) (a b : Bool) (z : Fˣ) : + (N.withLeaves (moveCross N.leaves a b z)).rightFactor = N.rightFactor/z := by + simp only [withLeaves, rightFactor, moveCross, Density.right_join, leafProduct_scalePair] + simp only [div_eq_mul_inv, mul_assoc] + +theorem moveCross_ratio (N : NodeInput F 1) (a b : Bool) (z : Fˣ) + (hp : N.pivot ≠ 0) (hq : (N.withLeaves (moveCross N.leaves a b z)).pivot ≠ 0) : + (N.withLeaves (moveCross N.leaves a b z)).leftArgument hq / + (N.withLeaves (moveCross N.leaves a b z)).rightArgument hq = + (N.leftArgument hp/N.rightArgument hp)/z^2 := by + rw [actual_child_ratio, moveCross_leftFactor, moveCross_rightFactor, + ratio_reciprocal_action, actual_child_ratio]; rfl + +def moveSame (M : Leaves 2 → Fˣ) (rightPair : Bool) (z : Fˣ) : Leaves 2 → Fˣ := + if rightPair then Density.join (Density.left M) (movePair (Density.right M) z) + else Density.join (movePair (Density.left M) z) (Density.right M) + +theorem moveSame_factors (N : NodeInput F 1) (side : Bool) (z : Fˣ) : + (N.withLeaves (moveSame N.leaves side z)).leftFactor = N.leftFactor ∧ + (N.withLeaves (moveSame N.leaves side z)).rightFactor = N.rightFactor := by + cases side <;> simp [moveSame, withLeaves, leftFactor, rightFactor, + Density.left_join, Density.right_join, leafProduct_movePair] + +theorem moveSame_pivot (N : NodeInput F 1) (side : Bool) (z : Fˣ) : + (N.withLeaves (moveSame N.leaves side z)).pivot = N.pivot := by + change ((N.left.frequency:F)*((N.withLeaves (moveSame N.leaves side z)).rightFactor:F)- + (N.right.frequency:F)*((N.withLeaves (moveSame N.leaves side z)).leftFactor:F)) / + ((N.s:F)*N.u) = _ + rw [(moveSame_factors N side z).1, (moveSame_factors N side z).2]; rfl + +end NodeInput +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetAverage.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..e49690f86bd39d0390a7929f183b4cfe8acfedf8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetAverage.lean @@ -0,0 +1,102 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetCoefficient +import OAI.NumberTheory.Ostmann.Tree.QuartetSquareMeasure +import OAI.NumberTheory.Ostmann.Tree.TwoPairRatioEnergy + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Ostmann.Tree.Quartet +open Density + +theorem average_sum {A B : Type*} [Fintype A] (s : Finset B) (f : B → A → ℝ) : + average (fun x => ∑ b ∈ s, f b x) = ∑ b ∈ s, average (f b) := by + unfold average + rw [Finset.sum_comm, Finset.mul_sum] + +theorem sum_inverse_square {G : Type*} [CommGroup G] [Fintype G] [DecidableEq G] + (ρ : G) (B : G → ℝ) : + (∑ χ : G with χ^2=ρ⁻¹, B χ⁻¹) = ∑ ν : G with ν^2=ρ, B ν := by + classical + have hs := (Equiv.inv G).bijective.sum_comp (fun ν : G => if ν^2=ρ then B ν else 0) + simp only [Equiv.inv_apply, inv_pow, inv_eq_iff_eq_inv] at hs + simpa only [Finset.sum_filter] using hs + +end Ostmann.Tree.Quartet + +namespace Ostmann.FiniteField +open Ostmann.Tree.Density Ostmann.Tree.Quartet +variable {p : ℕ} [Fact p.Prime] + +theorem crossMajorant_average_sum (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (ρ : MulChar (ZMod p) ℂ) (y : (ZMod p)ˣ) : + average (fun lam : (ZMod p)ˣ => average (fun mu : (ZMod p)ˣ => + ∑ χ : MulChar (ZMod p) ℂ with χ^2=ρ⁻¹, + ‖twoPairConvolution g h σ τ L R χ⁻¹ lam mu y‖^2)) = + ∑ ν : MulChar (ZMod p) ℂ with ν^2=ρ, crossMajorant g h σ τ L R ν y := by + classical + simp_rw [average_sum] + rw [sum_inverse_square ρ (fun ν => average (fun lam : (ZMod p)ˣ => + average (fun mu : (ZMod p)ˣ => ‖twoPairConvolution g h σ τ L R ν lam mu y‖^2)))] + apply Finset.sum_congr rfl + intro ν _ + unfold average crossMajorant + rw [← Finset.mul_sum] + ring + +end Ostmann.FiniteField + +namespace Ostmann.Tree.Quartet.NodeInput +open Density Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] + +theorem crossFamily_average_coefficient (N : NodeInput (ZMod p) 1) + (hcons : N.parameters.consistent) (hopp : N.parameters.bottomOpposite) + (g : ZMod p → ℂ) (hg0 : g 0=0) (a b : Bool) (m : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) : + average (fun h : (ZMod p)ˣ => average (fun k : (ZMod p)ˣ => + ‖mellin (N.crossFamilyFunction g a b m h k) ρ‖^2)) ≤ + 8*‖(p:ℂ)/(Fintype.card (ZMod p)ˣ:ℂ)‖^2 * + ∑ ν : MulChar (ZMod p) ℂ with ν^2=ρ, + crossMajorant (signedFunction g (parameterSign N.left a)) + (signedFunction g (parameterSign N.right b)) (orientation a) (orientation b) + (pairMode a) (pairMode b) ν (N.familyRoot m) := by + classical + let C : ℝ := 2*‖(p:ℂ)/(Fintype.card (ZMod p)ˣ:ℂ)‖^2 + let H : (ZMod p)ˣ → (ZMod p)ˣ → ℝ := fun lam mu => + ∑ χ : MulChar (ZMod p) ℂ with χ^2=ρ⁻¹, + ‖twoPairConvolution (signedFunction g (parameterSign N.left a)) + (signedFunction g (parameterSign N.right b)) (orientation a) (orientation b) + (pairMode a) (pairMode b) χ⁻¹ lam mu (N.familyRoot m)‖^2 + have hH : ∀ lam mu, 0 ≤ H lam mu := by + intro lam mu + exact Finset.sum_nonneg (fun χ _ => sq_nonneg _) + calc + _ ≤ average (fun h : (ZMod p)ˣ => average (fun k : (ZMod p)ˣ => + C*H (N.leftLambda m a*h^2) (N.rightLambda m b*k^2))) := by + apply average_mono + intro h + apply average_mono + intro k + exact crossFamily_coefficient_bound N hcons hopp g hg0 a b m h k ρ + _ = C*average (fun h : (ZMod p)ˣ => average (fun k : (ZMod p)ˣ => + H (N.leftLambda m a*h^2) (N.rightLambda m b*k^2))) := by + simp_rw [average_const_mul] + _ ≤ C*(4*average (fun lam : (ZMod p)ˣ => average (H lam))) := by + have hs := independent_square_domination (N.leftLambda m a) (N.rightLambda m b) H hH + have havg {A : Type} (i j : Fintype A) (f : A → ℝ) : + @average A i f = @average A j f := by + congr + exact Subsingleton.elim _ _ + simp only [havg _ (inferInstance : Fintype (ZMod p)ˣ)] at hs + exact mul_le_mul_of_nonneg_left hs (by dsimp [C]; positivity) + _ = _ := by + dsimp [H, C] + rw [crossMajorant_average_sum] + ring + +end Ostmann.Tree.Quartet.NodeInput +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetBlockFamily.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetBlockFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..619ebd8e4579285fbf1fa0a3da7e734cf2a07088 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetBlockFamily.lean @@ -0,0 +1,90 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetFamilyPullback +import OAI.NumberTheory.Ostmann.Tree.QuartetProductFiber + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.Tree.Quartet +variable {F : Type*} [Field F] + +def blockAssignment (m B h k : Fˣ) : Leaves 2 → Fˣ := + crossAssignment false false m h k (B/h) + +def blockCoordinatesEquiv : (Fˣ × Fˣ × Fˣ) ≃ (Fˣ × Fˣ × Fˣ) where + toFun x := (x.2.1, x.2.2, x.1/x.2.1) + invFun x := (x.2.2*x.1, x.1, x.2.1) + left_inv x := by rcases x with ⟨B,h,k⟩; simp + right_inv x := by rcases x with ⟨h,k,z⟩; simp + +def blockFiberEquiv (m : Fˣ) : + (Fˣ × Fˣ × Fˣ) ≃ {M : Leaves 2 → Fˣ // Parameters.leafProduct M=m} := + blockCoordinatesEquiv.trans (crossFiberEquiv false false m) + +theorem blockFiberEquiv_apply (m B h k : Fˣ) : + (blockFiberEquiv m (B,h,k)).val = blockAssignment m B h k := rfl + +theorem blockAssignment_eq (m B h k : Fˣ) : + blockAssignment m B h k = + Density.join (pairAssignment false (B/h) h) (pairAssignment false ((m/B)/k) k) := by + unfold blockAssignment crossAssignment + have he : m/(B/h*h*k) = (m/B)/k := by simp [div_div] + rw [he] + +theorem movePair_assignment (free held z : Fˣ) : + movePair (pairAssignment false free held) z = pairAssignment false (free*z) (held/z) := by + simp only [movePair, pairAssignment, Bool.false_eq_true, ↓reduceIte, + Density.left_join, Density.right_join, div_eq_mul_inv] + rfl + +theorem moveSame_block_left (m B h k z : Fˣ) : + NodeInput.moveSame (blockAssignment m B h k) false z = blockAssignment m B (h/z) k := by + simp only [NodeInput.moveSame, Bool.false_eq_true, ↓reduceIte, blockAssignment_eq, + Density.left_join, Density.right_join, movePair_assignment] + have he : B/h*z = B/(h/z) := by simp [div_eq_mul_inv, mul_comm, mul_left_comm] + rw [he] + +theorem moveSame_block_right (m B h k z : Fˣ) : + NodeInput.moveSame (blockAssignment m B h k) true z = blockAssignment m B h (k/z) := by + simp only [NodeInput.moveSame, ↓reduceIte, blockAssignment_eq, + Density.left_join, Density.right_join, movePair_assignment] + have he : (m/B)/k*z = (m/B)/(k/z) := by simp [div_eq_mul_inv, mul_assoc, mul_comm, mul_left_comm] + rw [he] + +namespace NodeInput + +theorem block_ratio_constant (N : NodeInput F 1) (m B h : Fˣ) : + N.familyRatioConstant m h/(B/h)^2 = N.familyRatioConstant m 1/B^2 := by + apply Units.ext + simp only [familyRatioConstant, Units.val_div_eq_div_val, Units.val_mul, + Units.val_pow_eq_pow_val, Units.val_one] + field_simp + +open Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] + +def blockLeftArgument (N : NodeInput (ZMod p) 1) (m B : (ZMod p)ˣ) : ZMod p := + pairMobiusValue (N.familyRoot m) (N.familyRatioConstant m 1/B^2 : (ZMod p)ˣ) + +def blockRightArgument (N : NodeInput (ZMod p) 1) (m B : (ZMod p)ˣ) : ZMod p := + N.blockLeftArgument m B-(N.familyRoot m:ZMod p) + +theorem blockFamily_value (N : NodeInput (ZMod p) 1) + (hcons : N.parameters.consistent) (hopp : N.parameters.bottomOpposite) + (g : ZMod p → ℂ) (hg0 : g 0=0) (m B h k : (ZMod p)ˣ) : + N.parameters.evaluate g N.D N.Xleft N.Xright 0 (blockAssignment m B h k) = + pairTest (signedFunction g (parameterSign N.left false)) 1 (N.blockLeftArgument m B) + (((N.leftLambda m false*h^2:(ZMod p)ˣ):ZMod p)*N.blockLeftArgument m B) * + pairTest (signedFunction g (parameterSign N.right false)) 1 (N.blockRightArgument m B) + (((N.rightLambda m false*k^2:(ZMod p)ˣ):ZMod p)*N.blockRightArgument m B) := by + have he := crossFamily_pullback_point N hcons hopp g hg0 false false m h k (B/h) + rw [block_ratio_constant] at he + simpa only [crossFamilyFunction, crossFamily, withLeaves, parameters, blockAssignment, + twoPairRatioValue, blockLeftArgument, blockRightArgument, orientation, pairMode, + Bool.false_eq_true, ↓reduceIte, PairMode.multiplier] using he + +end NodeInput +end Ostmann.Tree.Quartet +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetBlockMoments.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetBlockMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..42d313896fe8406804ed0a65cca4e58a3535e512 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetBlockMoments.lean @@ -0,0 +1,95 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetCrossBound +import OAI.NumberTheory.Ostmann.Tree.QuartetPairMeasure + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.Tree.Quartet +open Density + +theorem real_average_comm {A B : Type*} [Fintype A] [Fintype B] + (f : A → B → ℝ) : + average (fun a => average (f a)) = average (fun b => average (fun a => f a b)) := by + unfold average + simp only [← Finset.mul_sum] + rw [Finset.sum_comm] + ring + +end Ostmann.Tree.Quartet +namespace Ostmann.FiniteField +open Ostmann.Tree.Density Ostmann.Tree.Quartet +variable {p : ℕ} [Fact p.Prime] + +def heldPairValue (g : ZMod p → ℂ) (σ K : (ZMod p)ˣ) (d : ZMod p) (h : (ZMod p)ˣ) : ℂ := + pairTest g σ d (((K*h^2:(ZMod p)ˣ):ZMod p)*d) + +theorem heldPair_moving_bound (g : ZMod p → ℂ) (σ K h : (ZMod p)ˣ) + (d : ZMod p) (ρ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) : + ‖mellin (fun z : (ZMod p)ˣ => heldPairValue g σ K d (h/z)) ρ‖^2 ≤ + 2*pairSquareEnergy g σ ρ⁻¹ d := by + have he (z : (ZMod p)ˣ) : K*(h/z)^2 = (K*h^2)/z^2 := by rw [div_pow, mul_div_assoc] + simpa only [heldPairValue, he] using pairTest_inverse_square_bound g σ (K*h^2) d ρ hg0 + +theorem mellin_mul_const_norm_sq (f : (ZMod p)ˣ → ℂ) (c : ℂ) (ρ : MulChar (ZMod p) ℂ) : + ‖mellin (fun z => f z*c) ρ‖^2 = ‖mellin f ρ‖^2*‖c‖^2 := by + have he : (fun z => f z*c) = fun z => c*f z := by funext z; ring + rw [he, mellin_const_mul, norm_mul, mul_pow, mul_comm] + +theorem twoPair_same_left_mean (g h : ZMod p → ℂ) (σ τ K L : (ZMod p)ˣ) + (d e : ZMod p) (ρ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hh0 : h 0=0) : + average (fun x : (ZMod p)ˣ => average (fun y : (ZMod p)ˣ => + ‖mellin (fun z : (ZMod p)ˣ => heldPairValue g σ K d (x/z)*heldPairValue h τ L e y) ρ‖^2)) ≤ + 4*pairSquareEnergy g σ ρ⁻¹ d*pairSecondMoment h τ e := by + calc + _ ≤ average (fun _x : (ZMod p)ˣ => average (fun y : (ZMod p)ˣ => + (2*pairSquareEnergy g σ ρ⁻¹ d)*‖heldPairValue h τ L e y‖^2)) := by + apply average_mono + intro x + apply average_mono + intro y + rw [mellin_mul_const_norm_sq] + exact mul_le_mul_of_nonneg_right (heldPair_moving_bound g σ K x d ρ hg0) (sq_nonneg _) + _ = (2*pairSquareEnergy g σ ρ⁻¹ d)*average (fun y : (ZMod p)ˣ => ‖heldPairValue h τ L e y‖^2) := by + simp_rw [average_const_mul, real_average_const] + _ ≤ (2*pairSquareEnergy g σ ρ⁻¹ d)*(2*pairSecondMoment h τ e) := by + exact mul_le_mul_of_nonneg_left (pairTest_square_mean h τ L e hh0) + (mul_nonneg (by norm_num) (pairSquareEnergy_nonneg _ _ _ _)) + _ = _ := by ring + +theorem twoPair_same_right_mean (g h : ZMod p → ℂ) (σ τ K L : (ZMod p)ˣ) + (d e : ZMod p) (ρ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hh0 : h 0=0) : + average (fun x : (ZMod p)ˣ => average (fun y : (ZMod p)ˣ => + ‖mellin (fun z : (ZMod p)ˣ => heldPairValue g σ K d x*heldPairValue h τ L e (y/z)) ρ‖^2)) ≤ + 4*pairSquareEnergy h τ ρ⁻¹ e*pairSecondMoment g σ d := by + rw [real_average_comm] + have he (x y z : (ZMod p)ˣ) : + heldPairValue g σ K d x*heldPairValue h τ L e (y/z) = + heldPairValue h τ L e (y/z)*heldPairValue g σ K d x := mul_comm _ _ + simp_rw [he] + exact twoPair_same_left_mean h g τ σ L K e d ρ hh0 hg0 + +theorem twoPair_untouched_mean (g h : ZMod p → ℂ) (σ τ K L : (ZMod p)ˣ) + (d e : ZMod p) (hg0 : g 0=0) (hh0 : h 0=0) : + average (fun x : (ZMod p)ˣ => average (fun y : (ZMod p)ˣ => + ‖heldPairValue g σ K d x*heldPairValue h τ L e y‖^2)) ≤ + 4*pairSecondMoment g σ d*pairSecondMoment h τ e := by + simp only [norm_mul, mul_pow] + simp_rw [average_const_mul] + have he : (fun x : (ZMod p)ˣ => ‖heldPairValue g σ K d x‖^2* + average (fun y : (ZMod p)ˣ => ‖heldPairValue h τ L e y‖^2)) = + fun x => average (fun y : (ZMod p)ˣ => ‖heldPairValue h τ L e y‖^2)*‖heldPairValue g σ K d x‖^2 := by + funext x + ring + rw [he, average_const_mul] + calc + _ ≤ (2*pairSecondMoment h τ e)*(2*pairSecondMoment g σ d) := + mul_le_mul (pairTest_square_mean h τ L e hh0) (pairTest_square_mean g σ K d hg0) + (average_nonneg _ (fun _ => sq_nonneg _)) + (mul_nonneg (by norm_num) (pairSecondMoment_nonneg _ _ _)) + _ = _ := by ring + +end Ostmann.FiniteField +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetBlockRoot.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetBlockRoot.lean new file mode 100644 index 0000000000000000000000000000000000000000..04724356779fb487865598f35d2e5a2a187b32fb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetBlockRoot.lean @@ -0,0 +1,107 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetBlockMoments + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.FiniteField +open Ostmann.Tree.Density Ostmann.Tree.Quartet +variable {p : ℕ} [Fact p.Prime] + +theorem pairSquareEnergy_zero (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) : pairSquareEnergy g σ ρ 0=0 := by + classical + simp [pairSquareEnergy, deletedPairEnergy] + +theorem block_difference_mean (A B : ZMod p → ℝ) (y K : (ZMod p)ˣ) + (hA : ∀ d,0≤A d) (hB : ∀ d,0≤B d) (hA0 : A 0=0) (hB0 : B 0=0) : + average (fun t : (ZMod p)ˣ => A (pairMobiusValue y (K/t^2 : (ZMod p)ˣ))* + B (pairMobiusValue y (K/t^2 : (ZMod p)ˣ)-(y:ZMod p))) ≤ + 2*nonnegativeDifference A B y := by + exact mobius_inverse_square_mean y K (fun d => A d*B (d-(y:ZMod p))) + (fun d => mul_nonneg (hA d) (hB _)) (by simp only [hA0,zero_mul]) + (by simp only [sub_self,hB0,mul_zero]) + +theorem nonnegativeDifference_swap (A B : ZMod p → ℝ) (y : ZMod p) : + nonnegativeDifference A B y = nonnegativeDifference B A (-y) := by + unfold nonnegativeDifference + congr 1 + have he := (Equiv.subRight y).bijective.sum_comp (fun e : ZMod p => B e*A (e+y)) + change (∑ d : ZMod p,B (d-y)*A ((d-y)+y)) = _ at he + simpa only [sub_add_cancel,sub_neg_eq_add,mul_comm] using he + +theorem twoPair_same_left_root (g h : ZMod p → ℂ) (σ τ K L y R : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hh0 : h 0=0) : + average (fun B : (ZMod p)ˣ => average (fun x : (ZMod p)ˣ => average (fun w : (ZMod p)ˣ => + ‖mellin (fun z : (ZMod p)ˣ => + heldPairValue g σ K (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)) (x/z)* + heldPairValue h τ L (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)-(y:ZMod p)) w) ρ‖^2))) ≤ + 8*samePairMajorant g h σ τ ρ⁻¹ y := by + calc + _ ≤ average (fun B : (ZMod p)ˣ => 4*(pairSquareEnergy g σ ρ⁻¹ + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ))*pairSecondMoment h τ + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)-(y:ZMod p)))) := by + apply average_mono + intro B + simpa only [mul_assoc] using twoPair_same_left_mean g h σ τ K L + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)) + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)-(y:ZMod p)) ρ hg0 hh0 + _ ≤ 4*(2*samePairMajorant g h σ τ ρ⁻¹ y) := by + rw [average_const_mul] + exact mul_le_mul_of_nonneg_left + (block_difference_mean _ _ y R (pairSquareEnergy_nonneg _ _ _) + (pairSecondMoment_nonneg _ _) (pairSquareEnergy_zero _ _ _) + (pairSecondMoment_zero _ _ hh0)) (by norm_num) + _ = _ := by ring + +theorem twoPair_same_right_root (g h : ZMod p → ℂ) (σ τ K L y R : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hh0 : h 0=0) : + average (fun B : (ZMod p)ˣ => average (fun x : (ZMod p)ˣ => average (fun w : (ZMod p)ˣ => + ‖mellin (fun z : (ZMod p)ˣ => + heldPairValue g σ K (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)) x* + heldPairValue h τ L (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)-(y:ZMod p)) (w/z)) ρ‖^2))) ≤ + 8*samePairMajorant h g τ σ ρ⁻¹ (-(y:ZMod p)) := by + calc + _ ≤ average (fun B : (ZMod p)ˣ => 4*(pairSecondMoment g σ + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ))*pairSquareEnergy h τ ρ⁻¹ + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)-(y:ZMod p)))) := by + apply average_mono + intro B + simpa only [mul_assoc,mul_comm,mul_left_comm] using twoPair_same_right_mean g h σ τ K L + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)) + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)-(y:ZMod p)) ρ hg0 hh0 + _ ≤ 4*(2*nonnegativeDifference (pairSecondMoment g σ) (pairSquareEnergy h τ ρ⁻¹) y) := by + rw [average_const_mul] + exact mul_le_mul_of_nonneg_left + (block_difference_mean _ _ y R (pairSecondMoment_nonneg _ _) + (pairSquareEnergy_nonneg _ _ _) (pairSecondMoment_zero _ _ hg0) + (pairSquareEnergy_zero _ _ _)) (by norm_num) + _ = _ := by rw [nonnegativeDifference_swap]; unfold samePairMajorant; ring + +theorem twoPair_untouched_root (g h : ZMod p → ℂ) (σ τ K L y R : (ZMod p)ˣ) + (hg0 : g 0=0) (hh0 : h 0=0) : + average (fun B : (ZMod p)ˣ => average (fun x : (ZMod p)ˣ => average (fun w : (ZMod p)ˣ => + ‖heldPairValue g σ K (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)) x* + heldPairValue h τ L (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)-(y:ZMod p)) w‖^2))) ≤ + 8*untouchedMajorant g h σ τ y := by + calc + _ ≤ average (fun B : (ZMod p)ˣ => 4*(pairSecondMoment g σ + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ))*pairSecondMoment h τ + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)-(y:ZMod p)))) := by + apply average_mono + intro B + simpa only [mul_assoc] using twoPair_untouched_mean g h σ τ K L + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)) + (pairMobiusValue y (R/B^2 : (ZMod p)ˣ)-(y:ZMod p)) hg0 hh0 + _ ≤ 4*(2*untouchedMajorant g h σ τ y) := by + rw [average_const_mul] + exact mul_le_mul_of_nonneg_left + (block_difference_mean _ _ y R (pairSecondMoment_nonneg _ _) + (pairSecondMoment_nonneg _ _) (pairSecondMoment_zero _ _ hg0) + (pairSecondMoment_zero _ _ hh0)) (by norm_num) + _ = _ := by ring + +end Ostmann.FiniteField +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCoefficient.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCoefficient.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8b5c928df3d926593066aefb455628ace82f803 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCoefficient.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetFamilyPullback +import OAI.NumberTheory.Ostmann.Tree.QuartetMellinPullback + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] + +theorem twoPairRatio_inverse_square_bound (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (lam mu y K : (ZMod p)ˣ) (ρ : MulChar (ZMod p) ℂ) + (hg0 : g 0=0) : + ‖mellin (fun z : (ZMod p)ˣ => twoPairRatioValue g h σ τ L R lam mu y (K/z^2)) ρ‖^2 ≤ + 2*‖(p:ℂ)/(Fintype.card (ZMod p)ˣ:ℂ)‖^2 * + ∑ χ : MulChar (ZMod p) ℂ with χ^2=ρ⁻¹, + ‖twoPairConvolution g h σ τ L R χ⁻¹ lam mu y‖^2 := by + classical + have hb := mellin_inverse_square_pullback (twoPairRatioValue g h σ τ L R lam mu y) K ρ + simp_rw [twoPairRatio_mellin g h σ τ L R lam mu y _ hg0, norm_mul, mul_pow] at hb + rw [← Finset.mul_sum] at hb + simpa only [mul_assoc] using hb + +end Ostmann.FiniteField + +namespace Ostmann.Tree.Quartet.NodeInput +open Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] + +theorem crossFamily_coefficient_bound (N : NodeInput (ZMod p) 1) + (hcons : N.parameters.consistent) (hopp : N.parameters.bottomOpposite) + (g : ZMod p → ℂ) (hg0 : g 0=0) (a b : Bool) (m h k : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) : + ‖mellin (N.crossFamilyFunction g a b m h k) ρ‖^2 ≤ + 2*‖(p:ℂ)/(Fintype.card (ZMod p)ˣ:ℂ)‖^2 * + ∑ χ : MulChar (ZMod p) ℂ with χ^2=ρ⁻¹, + ‖twoPairConvolution (signedFunction g (parameterSign N.left a)) + (signedFunction g (parameterSign N.right b)) (orientation a) (orientation b) + (pairMode a) (pairMode b) χ⁻¹ (N.leftLambda m a*h^2) (N.rightLambda m b*k^2) + (N.familyRoot m)‖^2 := by + classical + have he : N.crossFamilyFunction g a b m h k = fun z : (ZMod p)ˣ => + twoPairRatioValue (signedFunction g (parameterSign N.left a)) + (signedFunction g (parameterSign N.right b)) (orientation a) (orientation b) + (pairMode a) (pairMode b) (N.leftLambda m a*h^2) (N.rightLambda m b*k^2) + (N.familyRoot m) (N.familyRatioConstant m h/z^2) := by + funext z + exact crossFamily_pullback_point N hcons hopp g hg0 a b m h k z + rw [he] + exact twoPairRatio_inverse_square_bound _ _ _ _ _ _ _ _ _ _ ρ (signedFunction_zero g hg0 _) + +end Ostmann.Tree.Quartet.NodeInput +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCoordinates.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..e141c11155dcc813b18d3868117d2cc8d5ce5a03 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCoordinates.lean @@ -0,0 +1,148 @@ +import OAI.NumberTheory.Ostmann.Tree.DensityAlgebra +import OAI.NumberTheory.Ostmann.Tree.PairCoordinates + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +variable {F : Type*} [Field F] + +def root (s D Hl Hr : Fˣ) : Fˣ := s/(D*Hl*Hr) + +def child (s D p u H : Fˣ) : Fˣ := s/(D*p*u*H) + +def ratio (sf sh Hf Hh : Fˣ) : Fˣ := sf*Hh/(sh*Hf) + +theorem child_ratio (sl sr D p u Hl Hr : Fˣ) : + child sl D p u Hl / child sr D p u Hr = ratio sl sr Hl Hr := by + apply Units.ext + simp only [child, ratio, Units.val_div_eq_div_val, Units.val_mul] + field_simp + +theorem shared_pivot_square (s sl sr D p u Hl Hr : Fˣ) : + p^2 = (sl*sr/(s*D*u^2)) * root s D Hl Hr / + (child sl D p u Hl * child sr D p u Hr) := by + apply Units.ext + simp only [child, root, Units.val_div_eq_div_val, Units.val_mul, Units.val_pow_eq_pow_val] + field_simp + +theorem held_square (s sf sh D Hf Hh : Fˣ) : + ratio sf sh Hf Hh / root s D Hf Hh = (D*sf/(sh*s))*Hh^2 := by + apply Units.ext + simp only [ratio, root, Units.val_div_eq_div_val, Units.val_mul, Units.val_pow_eq_pow_val] + field_simp + +theorem root_swap (s D Hl Hr : Fˣ) : root s D Hr Hl = root s D Hl Hr := by + simp [root, mul_comm, mul_left_comm] + +theorem ratio_reciprocal_action (sf sh Hf Hh z : Fˣ) : + ratio sf sh (Hf*z) (Hh/z) = ratio sf sh Hf Hh / z^2 := by + simp [ratio, div_eq_mul_inv, pow_two, mul_assoc, mul_left_comm, mul_comm] + +theorem root_reciprocal_action (s D Hl Hr z : Fˣ) : + root s D (Hl*z) (Hr/z) = root s D Hl Hr := by + simp [root, div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] + +structure NodeInput (F : Type*) [Field F] (depth : ℕ) where + s : Fˣ + a : Fˣ + b : Fˣ + u : Fˣ + D : Fˣ + Xleft : Fˣ + Xright : Fˣ + left : Parameters F depth + right : Parameters F depth + leaves : Leaves (depth+1) → Fˣ + +namespace NodeInput +variable {d : ℕ} + +def parameters (N : NodeInput F d) : Parameters F (d+1) := + .branch N.s N.a N.b N.u N.left N.right + +def leftFactor (N : NodeInput F d) : Fˣ := + N.Xleft*N.a*Parameters.leafProduct (Density.left N.leaves) + +def rightFactor (N : NodeInput F d) : Fˣ := + N.Xright*N.b*Parameters.leafProduct (Density.right N.leaves) + +def pivot (N : NodeInput F d) : F := + Density.pivot N.s N.a N.b N.u N.left N.right N.Xleft N.Xright N.leaves + +def pivotUnit (N : NodeInput F d) (hp : N.pivot ≠ 0) : Fˣ := Units.mk0 _ hp + +def argument (N : NodeInput F d) : Fˣ := + Density.rootArgument N.parameters N.D N.Xleft N.Xright (N.a*N.b) N.leaves + +def leftArgument (N : NodeInput F d) (hp : N.pivot ≠ 0) : Fˣ := + Density.rootArgument N.left N.D (N.pivotUnit hp) N.Xleft (N.u*N.a) + (Density.left N.leaves) + +def rightArgument (N : NodeInput F d) (hp : N.pivot ≠ 0) : Fˣ := + Density.rootArgument N.right N.D (N.pivotUnit hp) N.Xright (N.u*N.b) + (Density.right N.leaves) + +theorem argument_eq (N : NodeInput F d) : + N.argument = root N.s N.D N.leftFactor N.rightFactor := by + apply Units.ext + simpa only [argument, parameters, root, leftFactor, rightFactor, + Units.val_div_eq_div_val, Units.val_mul] using + Density.branch_rootArgument N.s N.a N.b N.u N.D N.Xleft N.Xright + N.left N.right N.leaves + +theorem leftArgument_eq (N : NodeInput F d) (hp : N.pivot ≠ 0) : + N.leftArgument hp = child N.left.frequency N.D (N.pivotUnit hp) N.u N.leftFactor := by + apply Units.ext + simpa only [leftArgument, child, leftFactor, Units.val_div_eq_div_val, Units.val_mul] using + Density.child_rootArgument N.left N.D (N.pivotUnit hp) N.Xleft N.u N.a + (Density.left N.leaves) + +theorem rightArgument_eq (N : NodeInput F d) (hp : N.pivot ≠ 0) : + N.rightArgument hp = child N.right.frequency N.D (N.pivotUnit hp) N.u N.rightFactor := by + apply Units.ext + simpa only [rightArgument, child, rightFactor, Units.val_div_eq_div_val, Units.val_mul] using + Density.child_rootArgument N.right N.D (N.pivotUnit hp) N.Xright N.u N.b + (Density.right N.leaves) + +theorem argument_difference (N : NodeInput F d) (hp : N.pivot ≠ 0) : + (N.leftArgument hp : F) - (N.rightArgument hp : F) = (N.argument : F) := by + exact Density.rootArgument_difference N.s N.a N.b N.u N.D N.Xleft N.Xright + N.left N.right N.leaves hp + +theorem actual_shared_pivot_square (N : NodeInput F d) (hp : N.pivot ≠ 0) : + (N.pivotUnit hp)^2 = + (N.left.frequency*N.right.frequency/(N.s*N.D*N.u^2)) * N.argument / + (N.leftArgument hp*N.rightArgument hp) := by + rw [argument_eq, leftArgument_eq, rightArgument_eq] + exact shared_pivot_square _ _ _ _ _ _ _ _ + +theorem actual_child_ratio (N : NodeInput F d) (hp : N.pivot ≠ 0) : + N.leftArgument hp / N.rightArgument hp = + ratio N.left.frequency N.right.frequency N.leftFactor N.rightFactor := by + rw [leftArgument_eq, rightArgument_eq] + exact child_ratio _ _ _ _ _ _ _ + +theorem evaluate_eq (N : NodeInput F d) (hp : N.pivot ≠ 0) (g : F → ℂ) (incoming : F) : + N.parameters.evaluate g N.D N.Xleft N.Xright incoming N.leaves = + N.left.evaluate g N.D (N.pivotUnit hp) N.Xleft (N.leftArgument hp : F) + (Density.left N.leaves) * + N.right.evaluate g N.D (N.pivotUnit hp) N.Xright (N.rightArgument hp : F) + (Density.right N.leaves) := by + classical + rw [leftArgument_eq, rightArgument_eq] + change (if h : N.pivot=0 then 0 else + N.left.evaluate g N.D (Units.mk0 N.pivot h) N.Xleft + ((N.left.frequency:F)/((N.D:F)*(Units.mk0 N.pivot h:Fˣ)*N.u*N.leftFactor)) + (Density.left N.leaves) * + N.right.evaluate g N.D (Units.mk0 N.pivot h) N.Xright + ((N.right.frequency:F)/((N.D:F)*(Units.mk0 N.pivot h:Fˣ)*N.u*N.rightFactor)) + (Density.right N.leaves)) = _ + rw [dite_eq_right hp] + simp only [pivotUnit, child, Units.val_div_eq_div_val, Units.val_mul] + +end NodeInput +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCrossAction.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCrossAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..a69924be8bb7581793c9e4948f7af322390d93d6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCrossAction.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.Tree.MellinTransform +import OAI.NumberTheory.Ostmann.Tree.QuartetFamilyPullback +import OAI.NumberTheory.Ostmann.Tree.QuartetProductFiber + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexConjugate +namespace Ostmann.FiniteField +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] + +theorem mellin_mul_coordinate (f : Fˣ → ℂ) (w : Fˣ) (ρ : MulChar F ℂ) : + mellin (fun z : Fˣ => f (w*z)) ρ = ρ w*mellin f ρ := by + simpa only [mul_comm] using mellin_mulRight f w ρ + +theorem norm_mellin_mul_coordinate (f : Fˣ → ℂ) (w : Fˣ) (ρ : MulChar F ℂ) : + ‖mellin (fun z : Fˣ => f (w*z)) ρ‖ = ‖mellin f ρ‖ := by + rw [mellin_mul_coordinate, norm_mul, mulChar_norm_unit, one_mul] + +end Ostmann.FiniteField +namespace Ostmann.Tree.Quartet +variable {F : Type*} [Field F] + +theorem scalePair_assignment (a : Bool) (free held z : Fˣ) : + scalePair (pairAssignment a free held) a z = pairAssignment a (free*z) held := by + cases a <;> simp [scalePair, pairAssignment, Density.left_join, Density.right_join] <;> rfl + +theorem moveCross_assignment (a b : Bool) (m h k w z : Fˣ) : + moveCross (crossAssignment a b m h k w) a b z = crossAssignment a b m h k (w*z) := by + simp only [moveCross, crossAssignment, Density.left_join, Density.right_join, + scalePair_assignment] + have he : m/(w*h*k)*z⁻¹ = m/((w*z)*h*k) := by + apply Units.ext + simp only [Units.val_div_eq_div_val, Units.val_mul, Units.val_inv_eq_inv_val] + field_simp + rw [he] + +namespace NodeInput +open Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] + +theorem crossAction_coefficient_norm (N : NodeInput (ZMod p) 1) + (g : ZMod p → ℂ) (a b : Bool) (m h k w : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) : + ‖mellin (fun z : (ZMod p)ˣ => N.parameters.evaluate g N.D N.Xleft N.Xright 0 + (moveCross (crossAssignment a b m h k w) a b z)) ρ‖ = + ‖mellin (N.crossFamilyFunction g a b m h k) ρ‖ := by + simp_rw [moveCross_assignment] + exact norm_mellin_mul_coordinate (N.crossFamilyFunction g a b m h k) w ρ + +end NodeInput +end Ostmann.Tree.Quartet +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCrossBound.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCrossBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f58587c95a592b4a7d47096a18bcabbc7f5f35a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetCrossBound.lean @@ -0,0 +1,78 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetAverage +import OAI.NumberTheory.Ostmann.Tree.QuartetCrossAction +import OAI.NumberTheory.Ostmann.Tree.SquareMajorant + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.Tree.Quartet +open Density + +theorem real_average_equiv {A B : Type*} [Fintype A] [Fintype B] + (e : A ≃ B) (f : B → ℝ) : average (fun x => f (e x)) = average f := by + unfold average + rw [Fintype.card_congr e, e.bijective.sum_comp f] + +theorem real_average_prod {A B : Type*} [Fintype A] [Fintype B] + (f : A → B → ℝ) : + average (fun x : A × B => f x.1 x.2) = average (fun a => average (f a)) := by + simp only [average, Fintype.card_prod, Nat.cast_mul, mul_inv_rev, + Fintype.sum_prod_type, ← Finset.mul_sum] + ring + +theorem real_average_const {A : Type*} [Fintype A] [Nonempty A] (c : ℝ) : + average (fun _ : A => c) = c := by + simp [average, Fintype.card_ne_zero] + +namespace NodeInput +open Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] + +def crossLocalMajorant (N : NodeInput (ZMod p) 1) (g : ZMod p → ℂ) + (a b : Bool) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : ℝ := + 8*‖(p:ℂ)/(Fintype.card (ZMod p)ˣ:ℂ)‖^2 * + crossSquareMajorant (signedFunction g (parameterSign N.left a)) + (signedFunction g (parameterSign N.right b)) (orientation a) (orientation b) + (pairMode a) (pairMode b) ρ y + +theorem crossLocalMajorant_nonneg (N : NodeInput (ZMod p) 1) (g : ZMod p → ℂ) + (a b : Bool) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : + 0 ≤ N.crossLocalMajorant g a b ρ y := by + unfold crossLocalMajorant + exact mul_nonneg (by positivity) (crossSquareMajorant_nonneg _ _ _ _ _ _ _ _) + +theorem crossAction_fiber_bound (N : NodeInput (ZMod p) 1) + (hcons : N.parameters.consistent) (hopp : N.parameters.bottomOpposite) + (g : ZMod p → ℂ) (hg0 : g 0=0) (a b : Bool) (m : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) : + average (fun M : {M : Leaves 2 → (ZMod p)ˣ // Parameters.leafProduct M=m} => + ‖mellin (fun z : (ZMod p)ˣ => N.parameters.evaluate g N.D N.Xleft N.Xright 0 + (moveCross M.val a b z)) ρ‖^2) ≤ N.crossLocalMajorant g a b ρ (N.familyRoot m) := by + classical + have he := real_average_equiv (crossFiberEquiv a b m) + (fun M : {M : Leaves 2 → (ZMod p)ˣ // Parameters.leafProduct M=m} => + ‖mellin (fun z : (ZMod p)ˣ => N.parameters.evaluate g N.D N.Xleft N.Xright 0 + (moveCross M.val a b z)) ρ‖^2) + rw [← he] + change average (fun x : (ZMod p)ˣ × (ZMod p)ˣ × (ZMod p)ˣ => + ‖mellin (fun z : (ZMod p)ˣ => N.parameters.evaluate g N.D N.Xleft N.Xright 0 + (moveCross (crossAssignment a b m x.1 x.2.1 x.2.2) a b z)) ρ‖^2) ≤ _ + simp_rw [crossAction_coefficient_norm] + rw [real_average_prod (fun h (t : (ZMod p)ˣ × (ZMod p)ˣ) => + ‖mellin (N.crossFamilyFunction g a b m h t.1) ρ‖^2)] + have ht (h : (ZMod p)ˣ) : + average (fun t : (ZMod p)ˣ × (ZMod p)ˣ => + ‖mellin (N.crossFamilyFunction g a b m h t.1) ρ‖^2) = + average (fun k : (ZMod p)ˣ => ‖mellin (N.crossFamilyFunction g a b m h k) ρ‖^2) := by + rw [real_average_prod (fun k (_ : (ZMod p)ˣ) => + ‖mellin (N.crossFamilyFunction g a b m h k) ρ‖^2)] + simp_rw [real_average_const] + simp_rw [ht] + exact crossFamily_average_coefficient N hcons hopp g hg0 a b m ρ + +end NodeInput +end Ostmann.Tree.Quartet +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetDiagram.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetDiagram.lean new file mode 100644 index 0000000000000000000000000000000000000000..073d3949b775f9a9ccddb0086fa52dfc5eb71dc2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetDiagram.lean @@ -0,0 +1,102 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetHeld +import OAI.NumberTheory.Ostmann.Tree.QuartetPairValues + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +variable {F : Type*} [Field F] + +namespace NodeInput +variable {d : ℕ} + +theorem evaluate_eq_zero (N : NodeInput F d) (hp : N.pivot = 0) + (g : F → ℂ) (incoming : F) : + N.parameters.evaluate g N.D N.Xleft N.Xright incoming N.leaves = 0 := by + classical + simp only [parameters, Parameters.evaluate] + split_ifs with h + · rfl + · exact False.elim (h hp) + +def ofParameters (P : Parameters F (d+1)) (D Xleft Xright : Fˣ) + (M : Leaves (d+1) → Fˣ) : NodeInput F d := + match P with | .branch s a b u L R => ⟨s,a,b,u,D,Xleft,Xright,L,R,M⟩ + +def ofDiagram (T : Diagram F (d+1)) (M : Leaves (d+1) → Fˣ) : NodeInput F d := + ofParameters T.parameters T.denominator T.rootLeft T.rootRight M + +theorem ofDiagram_parameters (T : Diagram F (d+1)) (M : Leaves (d+1) → Fˣ) : + (ofDiagram T M).parameters = T.parameters := by + cases he : T.parameters; simp only [ofDiagram, ofParameters, he, parameters] + +theorem diagram_value (T : Diagram F (d+1)) (M : Leaves (d+1) → Fˣ) (g : F → ℂ) : + T.value g M = + (ofDiagram T M).parameters.evaluate g (ofDiagram T M).D + (ofDiagram T M).Xleft (ofDiagram T M).Xright 0 (ofDiagram T M).leaves := by + cases he : T.parameters + simp only [ofDiagram, ofParameters, Diagram.value, Parameters.value, he, parameters] + +theorem descend_evaluate (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) + (g : F → ℂ) (incoming : F) : + N.parameters.evaluate g N.D N.Xleft N.Xright incoming N.leaves = + (N.leftNode hp).parameters.evaluate g (N.leftNode hp).D + (N.leftNode hp).Xleft (N.leftNode hp).Xright (N.leftArgument hp:F) + (N.leftNode hp).leaves * + (N.rightNode hp).parameters.evaluate g (N.rightNode hp).D + (N.rightNode hp).Xleft (N.rightNode hp).Xright (N.rightArgument hp:F) + (N.rightNode hp).leaves := by + rw [evaluate_eq N hp g incoming] + cases hl : N.left with + | branch sl al bl ul LL LR => + cases hr : N.right with + | branch sr ar br ur RL RR => + simp only [leftNode, rightNode, hl, hr, parameters] + +def orientation (freeRight : Bool) : Fˣ := if freeRight then -1 else 1 + +def orientedSign (N : NodeInput F 0) (freeRight : Bool) : Bool := + if freeRight then leafSign N.right else leafSign N.left + +def orientedRatio (N : NodeInput F 0) (hp : N.pivot ≠ 0) (freeRight : Bool) : Fˣ := + if freeRight then N.rightArgument hp/N.leftArgument hp + else N.leftArgument hp/N.rightArgument hp + +theorem bottom_evaluate_oriented (N : NodeInput F 0) (hp : N.pivot ≠ 0) + (hopp : N.parameters.bottomOpposite) (g : F → ℂ) (incoming : F) + (freeRight : Bool) : + N.parameters.evaluate g N.D N.Xleft N.Xright incoming N.leaves = + pairValue g (N.orientedSign freeRight) (orientation freeRight) (N.argument:F) + (N.orientedRatio hp freeRight:F) := by + cases freeRight + · exact bottom_evaluate_left N hp hopp g incoming + · exact bottom_evaluate_right N hp hopp g incoming + +theorem quartet_evaluate_oriented (N : NodeInput F 1) (hp : N.pivot ≠ 0) + (hcons : N.parameters.consistent) (hopp : N.parameters.bottomOpposite) + (hl : (N.leftNode hp).pivot ≠ 0) (hr : (N.rightNode hp).pivot ≠ 0) + (g : F → ℂ) (incoming : F) (leftFreeRight rightFreeRight : Bool) : + N.parameters.evaluate g N.D N.Xleft N.Xright incoming N.leaves = + pairValue g ((N.leftNode hp).orientedSign leftFreeRight) (orientation leftFreeRight) + (N.leftArgument hp:F) ((N.leftNode hp).orientedRatio hl leftFreeRight:F) * + pairValue g ((N.rightNode hp).orientedSign rightFreeRight) (orientation rightFreeRight) + (N.rightArgument hp:F) ((N.rightNode hp).orientedRatio hr rightFreeRight:F) := by + have hop : N.left.bottomOpposite ∧ N.right.bottomOpposite := hopp + have hopL : (N.leftNode hp).parameters.bottomOpposite := by + cases he : N.left with + | branch s a b u L R => simpa only [leftNode, he, parameters] using hop.1 + have hopR : (N.rightNode hp).parameters.bottomOpposite := by + cases he : N.right with + | branch s a b u L R => simpa only [rightNode, he, parameters] using hop.2 + have hc : N.left.childConsistent (N.u*N.a) ∧ N.right.childConsistent (N.u*N.b) ∧ + N.left.consistent ∧ N.right.consistent := hcons + rw [descend_evaluate N hp g incoming, + bottom_evaluate_oriented _ hl hopL g _ leftFreeRight, + bottom_evaluate_oriented _ hr hopR g _ rightFreeRight, + leftNode_argument N hp hc.1, rightNode_argument N hp hc.2.1] + +end NodeInput +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorRatios.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorRatios.lean new file mode 100644 index 0000000000000000000000000000000000000000..13cbd3bed25065628e475dd161cc334bd863328d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorRatios.lean @@ -0,0 +1,106 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetZero + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +variable {F : Type*} [Field F] + +def residualCoefficient {d : ℕ} (P : Parameters F (d+1)) (D X : Fˣ) : Fˣ := + match P with | .branch s _ b _ L R => (D*L.frequency/(R.frequency*s))*(X*b)^2 + +def sharedCoefficient {d : ℕ} (P : Parameters F (d+1)) (D : Fˣ) : Fˣ := + match P with | .branch s a _ _ L R => (D*R.frequency/(L.frequency*s))*a^2 + +namespace NodeInput +variable {d : ℕ} + +theorem factor_residual_ratio (N : NodeInput F d) : + N.factorRatio false = residualCoefficient N.parameters N.D N.Xright * + (Parameters.leafProduct (Density.right N.leaves))^2*N.argument := by + change ratio N.left.frequency N.right.frequency N.leftFactor N.rightFactor = _ + rw [argument_eq] + apply Units.ext + simp only [ratio, root, residualCoefficient, + parameters, leftFactor, rightFactor, Units.val_div_eq_div_val, Units.val_mul, + Units.val_pow_eq_pow_val] + field_simp + +theorem factor_shared_ratio (N : NodeInput F d) : + N.factorRatio true = sharedCoefficient N.parameters N.D * + (Parameters.leafProduct (Density.left N.leaves))^2*N.Xleft^2*N.argument := by + change ratio N.right.frequency N.left.frequency N.rightFactor N.leftFactor = _ + rw [argument_eq] + apply Units.ext + simp only [ratio, root, sharedCoefficient, + parameters, leftFactor, rightFactor, Units.val_div_eq_div_val, Units.val_mul, + Units.val_pow_eq_pow_val] + field_simp + +theorem leftNode_parameters (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : + (N.leftNode hp).parameters = N.left := by + cases he : N.left + simp only [leftNode, he, parameters] + +theorem rightNode_parameters (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : + (N.rightNode hp).parameters = N.right := by + cases he : N.right + simp only [rightNode, he, parameters] + +theorem leftNode_D (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : + (N.leftNode hp).D = N.D := by + cases he : N.left + simp only [leftNode, he] + +theorem rightNode_D (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : + (N.rightNode hp).D = N.D := by + cases he : N.right + simp only [rightNode, he] + +theorem leftNode_residual (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : + (N.leftNode hp).Xright = N.Xleft := by + cases he : N.left + simp only [leftNode, he] + +theorem rightNode_residual (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : + (N.rightNode hp).Xright = N.Xright := by + cases he : N.right + simp only [rightNode, he] + +theorem left_friendly_factor (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) + (hc : N.left.childConsistent (N.u*N.a)) : + (N.leftNode hp).factorRatio false = residualCoefficient N.left N.D N.Xleft * + (Parameters.leafProduct (Density.right (N.leftNode hp).leaves))^2*N.leftArgument hp := by + rw [factor_residual_ratio, leftNode_parameters, leftNode_D, leftNode_residual, + leftNode_argument N hp hc] + +theorem right_friendly_factor (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) + (hc : N.right.childConsistent (N.u*N.b)) : + (N.rightNode hp).factorRatio false = residualCoefficient N.right N.D N.Xright * + (Parameters.leafProduct (Density.right (N.rightNode hp).leaves))^2*N.rightArgument hp := by + rw [factor_residual_ratio, rightNode_parameters, rightNode_D, rightNode_residual, + rightNode_argument N hp hc] + +theorem left_bad_factor (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) + (hc : N.left.childConsistent (N.u*N.a)) : + (N.leftNode hp).factorRatio true = sharedCoefficient N.left N.D * + (Parameters.leafProduct (Density.left (N.leftNode hp).leaves))^2 * + (N.left.frequency*N.right.frequency/(N.s*N.D*N.u^2))*N.argument/N.rightArgument hp := by + rw [factor_shared_ratio, leftNode_parameters, leftNode_D, leftNode_shared, + actual_shared_pivot_square, leftNode_argument N hp hc] + simp [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] + +theorem right_bad_factor (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) + (hc : N.right.childConsistent (N.u*N.b)) : + (N.rightNode hp).factorRatio true = sharedCoefficient N.right N.D * + (Parameters.leafProduct (Density.left (N.rightNode hp).leaves))^2 * + (N.left.frequency*N.right.frequency/(N.s*N.D*N.u^2))*N.argument/N.leftArgument hp := by + rw [factor_shared_ratio, rightNode_parameters, rightNode_D, rightNode_shared, + actual_shared_pivot_square, rightNode_argument N hp hc] + simp [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] + +end NodeInput +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorization.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorization.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6d5ac1b12b3344c44d9dc1fb5f004e932b40919 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorization.lean @@ -0,0 +1,113 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorizationArguments +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorizationFibers +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorizationValidity + +namespace OAI + +namespace Ostmann.Tree.QuartetFactorization +noncomputable section +open scoped BigOperators +open Density +variable {F : Type*} [Field F] + +def ancestorFrames {k : ℕ} (T : Diagram F (k+2)) (M : Leaves (k+2) → Fˣ) : + Option (Leaves k → Frame F) := + propagate k T.parameters T.rootLeft T.rootRight (Density.rootCoefficient T.parameters) + ((bottomCut k).project M) + +theorem ancestorFrames_eq_of_project_eq {k : ℕ} (T : Diagram F (k+2)) + (M N : Leaves (k+2) → Fˣ) + (h : (bottomCut k).project M = (bottomCut k).project N) : + ancestorFrames T M = ancestorFrames T N := by + unfold ancestorFrames + rw [h] + +theorem diagram_factorization {k : ℕ} (T : Diagram F (k+2)) + (g : F → ℂ) (M : Leaves (k+2) → Fˣ) : + T.value g M = frameProduct g T.denominator (bottomLeaves k M) (ancestorFrames T M) := by + exact evaluate_factorization k T.parameters g T.denominator T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) 0 M + +theorem diagram_value_zero_of_invalid {k : ℕ} (T : Diagram F (k+2)) + (g : F → ℂ) (M : Leaves (k+2) → Fˣ) (h : ancestorFrames T M = none) : + T.value g M = 0 := by + rw [diagram_factorization, h] + rfl + +def frameDiagram {k : ℕ} (T : Diagram F (k+2)) (M : Leaves (k+2) → Fˣ) + (fs : Leaves k → Frame F) (h : ancestorFrames T M = some fs) (v : Leaves k) : + Diagram F 2 where + parameters := (fs v).parameters + denominator := T.denominator + rootLeft := (fs v).leftCurrent + rootRight := (fs v).rightCurrent + consistent := by + have hp := (propagate_validity k T.parameters T.consistent T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) (Density.rootCoefficient_consistent _) + ((bottomCut k).project M) fs h v).1 + rw [hp] + exact bottomParameters_consistent k T.parameters T.consistent v + bottomOpposite := by + have hp := (propagate_validity k T.parameters T.consistent T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) (Density.rootCoefficient_consistent _) + ((bottomCut k).project M) fs h v).1 + rw [hp] + exact bottomParameters_bottomOpposite k T.parameters T.bottomOpposite v + +theorem diagram_value_eq_product {k : ℕ} (T : Diagram F (k+2)) + (g : F → ℂ) (M : Leaves (k+2) → Fˣ) (fs : Leaves k → Frame F) + (h : ancestorFrames T M = some fs) : + T.value g M = ∏ v, (frameDiagram T M fs h v).value g (bottomLeaves k M v) := by + rw [diagram_factorization, h] + rfl + +theorem diagramLevelArguments_eq_frameArguments {k : ℕ} (T : Diagram F (k+2)) + (M : Leaves (k+2) → Fˣ) : + Density.diagramLevelArguments (bottomCut k) T M = + frameArguments T.denominator ((bottomCut k).project M) (ancestorFrames T M) := by + exact (propagate_arguments k T.parameters T.denominator T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) ((bottomCut k).project M)).symm + +theorem ancestorFrames_isSome {k : ℕ} (T : Diagram F (k+2)) + (M : Leaves (k+2) → Fˣ) : + (ancestorFrames T M).isSome = + (Density.diagramLevelArguments (bottomCut k) T M).isSome := by + rw [diagramLevelArguments_eq_frameArguments] + cases ancestorFrames T M <;> rfl + +theorem frameDiagram_rootArgument {k : ℕ} (T : Diagram F (k+2)) + (M : Leaves (k+2) → Fˣ) (fs : Leaves k → Frame F) + (h : ancestorFrames T M = some fs) (v : Leaves k) : + Density.rootArgument (frameDiagram T M fs h v).parameters T.denominator + (fs v).leftCurrent (fs v).rightCurrent + (Density.rootCoefficient (frameDiagram T M fs h v).parameters) + (bottomLeaves k M v) = (fs v).argument T.denominator ((bottomCut k).project M v) := by + have hc := (propagate_validity k T.parameters T.consistent T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) (Density.rootCoefficient_consistent _) + ((bottomCut k).project M) fs h v).2 + change Density.rootArgument (fs v).parameters T.denominator + (fs v).leftCurrent (fs v).rightCurrent (Density.rootCoefficient (fs v).parameters) + (bottomLeaves k M v) = _ + rw [← Frame.coefficient_eq_rootCoefficient (fs v) hc] + exact (frame_argument_actual_leaves k T.denominator M fs v).symm + +theorem diagram_value_on_productFiber {k : ℕ} (T : Diagram F (k+2)) + (g : F → ℂ) (totals : Leaves k → Fˣ) + (m : (v : Leaves k) → {z : Leaves 2 → Fˣ // Parameters.leafProduct z = totals v}) : + T.value g ((productFiberEquiv k totals).symm m).val = + match propagate k T.parameters T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) totals with + | none => 0 + | some fs => ∏ v, (fs v).value g T.denominator (m v).val := by + rw [diagram_factorization] + unfold ancestorFrames + rw [((productFiberEquiv k totals).symm m).property] + have hLeaves : bottomLeaves k ((productFiberEquiv k totals).symm m).val = + (fun v => (m v).val) := bottomLeaves_assemble k _ + rw [hLeaves] + rfl + +end +end Ostmann.Tree.QuartetFactorization + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationArguments.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationArguments.lean new file mode 100644 index 0000000000000000000000000000000000000000..edb41fde15d07bb07f2f0079b3c8328805ade40d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationArguments.lean @@ -0,0 +1,63 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorizationFrames + +namespace OAI + +namespace Ostmann.Tree.QuartetFactorization +noncomputable section +open scoped BigOperators +open Density +variable {F : Type*} [Field F] +local instance quartetFactorizationArgumentsDecidableEq : DecidableEq F := Classical.decEq F + +def frameArguments {k : ℕ} (D : Fˣ) (totals : Leaves k → Fˣ) + (frames : Option (Leaves k → Frame F)) : Option (Leaves k → Fˣ) := + frames.map (fun fs v => (fs v).argument D (totals v)) + +theorem frameArguments_split {k : ℕ} (D : Fˣ) (totals : Leaves (k+1) → Fˣ) + (fl fr : Option (Leaves k → Frame F)) : + frameArguments D totals + (match fl, fr with | some l, some r => some (join l r) | _, _ => none) = + match frameArguments D (left totals) fl, frameArguments D (right totals) fr with + | some yl, some yr => some (join yl yr) + | _, _ => none := by + cases fl <;> cases fr <;> simp only [frameArguments, Option.map_none, Option.map_some] + congr 1 + funext v + have he := congrArg (fun x => x v) (join_left_right totals) + cases hv : v 0 <;> simp only [join, hv, Bool.false_eq_true, ↓reduceIte] at he ⊢ <;> rw [he] + +theorem propagate_arguments (k : ℕ) (P : Parameters F (k+2)) + (D Xl Xr c : Fˣ) (totals : Leaves k → Fˣ) : + frameArguments D totals (propagate k P Xl Xr c totals) = + Density.reconstruct D ((bottomCut k).parameters P) Xl Xr c totals := by + induction k generalizing Xl Xr c with + | zero => + simp [frameArguments, propagate, bottomCut, Density.Cut.parameters, + Density.reconstruct, Frame.argument, rootArgument, Parameters.frequency, + Parameters.leafProduct] + funext v + apply congrArg (fun z : Fˣ => P.frequency / (D*Xl*Xr*c*z)) + exact congrArg totals (Subsingleton.elim _ _) + | succ k ih => + cases P with + | branch s a b u L R => + simp only [propagate, bottomCut, Density.Cut.parameters, Density.reconstruct] + by_cases hp : Density.pivot s a b u ((bottomCut k).parameters L) + ((bottomCut k).parameters R) Xl Xr totals = 0 + · simp [hp, frameArguments] + · simp only [dite_eq_right hp] + rw [← ih L _ _ (u*a), ← ih R _ _ (u*b)] + exact frameArguments_split D totals _ _ + +theorem frame_argument_actual_leaves (k : ℕ) (D : Fˣ) (M : Leaves (k+2) → Fˣ) + (fs : Leaves k → Frame F) (v : Leaves k) : + (fs v).argument D ((bottomCut k).project M v) = + Density.rootArgument (fs v).parameters D (fs v).leftCurrent (fs v).rightCurrent + (fs v).coefficient (bottomLeaves k M v) := by + unfold Frame.argument Density.rootArgument + rw [bottomLeaves_product] + +end +end Ostmann.Tree.QuartetFactorization + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationFibers.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationFibers.lean new file mode 100644 index 0000000000000000000000000000000000000000..d948fea0d889d50a35307e50021f8d520350b48f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationFibers.lean @@ -0,0 +1,27 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorizationLeaves + +namespace OAI + +namespace Ostmann.Tree.QuartetFactorization +noncomputable section +variable {F : Type*} [Field F] + +def productFiberEquiv (k : ℕ) (totals : Leaves k → Fˣ) : + {M : Leaves (k+2) → Fˣ // (bottomCut k).project M = totals} ≃ + ((v : Leaves k) → {m : Leaves 2 → Fˣ // Parameters.leafProduct m = totals v}) where + toFun M v := ⟨bottomLeaves k M.val v, + (bottomLeaves_product k M.val v).trans (congrFun M.property v)⟩ + invFun m := ⟨assembleBottom k (fun v => (m v).val), by + funext v + rw [← bottomLeaves_product, bottomLeaves_assemble] + exact (m v).property⟩ + left_inv M := Subtype.ext (assemble_bottomLeaves k M.val) + right_inv m := by + funext v + apply Subtype.ext + exact congrFun (bottomLeaves_assemble k (fun v => (m v).val)) v + +end +end Ostmann.Tree.QuartetFactorization + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationFrames.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationFrames.lean new file mode 100644 index 0000000000000000000000000000000000000000..118c9a0131b23c8ca1c1ef07b1fec2daf6160fb7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationFrames.lean @@ -0,0 +1,102 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorizationLeaves + +namespace OAI + +namespace Ostmann.Tree.QuartetFactorization +noncomputable section +open scoped BigOperators +open Density +variable {F : Type*} [Field F] +local instance : DecidableEq F := Classical.decEq F + +structure Frame (F : Type*) [Field F] where + parameters : Parameters F 2 + leftCurrent : Fˣ + rightCurrent : Fˣ + coefficient : Fˣ + +namespace Frame + +def value (f : Frame F) (g : F → ℂ) (D : Fˣ) (M : Leaves 2 → Fˣ) : ℂ := + f.parameters.evaluate g D f.leftCurrent f.rightCurrent 0 M + +def argument (f : Frame F) (D total : Fˣ) : Fˣ := + f.parameters.frequency / (D*f.leftCurrent*f.rightCurrent*f.coefficient*total) + +end Frame + +def propagate : (k : ℕ) → Parameters F (k+2) → Fˣ → Fˣ → Fˣ → + (Leaves k → Fˣ) → Option (Leaves k → Frame F) + | 0, P, Xl, Xr, c, _ => some (fun _ => ⟨P, Xl, Xr, c⟩) + | k+1, .branch s a b u L R, Xl, Xr, _, totals => + if hp : Density.pivot s a b u ((bottomCut k).parameters L) + ((bottomCut k).parameters R) Xl Xr totals = 0 then none else + let p := Units.mk0 _ hp + match propagate k L p Xl (u*a) (left totals), + propagate k R p Xr (u*b) (right totals) with + | some fl, some fr => some (join fl fr) + | _, _ => none + +theorem propagate_project_split (k : ℕ) (s a b u Xl Xr c : Fˣ) + (L R : Parameters F (k+2)) (M : Leaves (k+3) → Fˣ) : + propagate (k+1) (.branch s a b u L R) Xl Xr c + ((bottomCut (k+1)).project M) = + if hp : Density.pivot s a b u L R Xl Xr M = 0 then none else + match propagate k L (Units.mk0 _ hp) Xl (u*a) ((bottomCut k).project (left M)), + propagate k R (Units.mk0 _ hp) Xr (u*b) ((bottomCut k).project (right M)) with + | some fl, some fr => some (join fl fr) + | _, _ => none := by + simp only [propagate, bottomCut, Density.Cut.project_pivot] + simp only [Density.Cut.project, left_join, right_join] + +def frameProduct {k : ℕ} (g : F → ℂ) (D : Fˣ) (M : Leaves k → Leaves 2 → Fˣ) + (frames : Option (Leaves k → Frame F)) : ℂ := + match frames with + | none => 0 + | some fs => ∏ v, (fs v).value g D (M v) + +theorem frameProduct_join {k : ℕ} (g : F → ℂ) (D : Fˣ) + (Ml Mr : Leaves k → Leaves 2 → Fˣ) (fl fr : Option (Leaves k → Frame F)) : + frameProduct g D (join Ml Mr) + (match fl, fr with | some l, some r => some (join l r) | _, _ => none) = + frameProduct g D Ml fl * frameProduct g D Mr fr := by + cases fl <;> cases fr <;> simp only [frameProduct, zero_mul, mul_zero] + rw [Density.prod_split] + congr 1 + +theorem evaluate_incoming_irrelevant {d : ℕ} (P : Parameters F (d+1)) + (g : F → ℂ) (D Xl Xr : Fˣ) (incoming : F) (M : Leaves (d+1) → Fˣ) : + P.evaluate g D Xl Xr incoming M = P.evaluate g D Xl Xr 0 M := by + cases P + rfl + +theorem evaluate_factorization (k : ℕ) (P : Parameters F (k+2)) + (g : F → ℂ) (D Xl Xr c : Fˣ) (incoming : F) (M : Leaves (k+2) → Fˣ) : + P.evaluate g D Xl Xr incoming M = + frameProduct g D (bottomLeaves k M) + (propagate k P Xl Xr c ((bottomCut k).project M)) := by + induction k generalizing Xl Xr c incoming with + | zero => + simp only [propagate, frameProduct, bottomLeaves, Frame.value] + simpa using evaluate_incoming_irrelevant P g D Xl Xr incoming M + | succ k ih => + cases P with + | branch s a b u L R => + rw [propagate_project_split] + change (if hp : Density.pivot s a b u L R Xl Xr M = 0 then 0 else + L.evaluate g D (Units.mk0 _ hp) Xl + ((L.frequency : F) / ((D:F)*(Units.mk0 _ hp:Fˣ)*u* + (Xl*a*Parameters.leafProduct (left M)))) (left M) * + R.evaluate g D (Units.mk0 _ hp) Xr + ((R.frequency : F) / ((D:F)*(Units.mk0 _ hp:Fˣ)*u* + (Xr*b*Parameters.leafProduct (right M)))) (right M)) = _ + by_cases hp : Density.pivot s a b u L R Xl Xr M = 0 + · simp [hp, frameProduct] + · simp only [dite_eq_right hp, bottomLeaves] + rw [ih L _ _ (u*a), ih R _ _ (u*b)] + exact (frameProduct_join g D _ _ _ _).symm + +end +end Ostmann.Tree.QuartetFactorization + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationLeaves.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationLeaves.lean new file mode 100644 index 0000000000000000000000000000000000000000..8cffbe56cf36667c7d1743189a3ade647134fb07 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationLeaves.lean @@ -0,0 +1,93 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleCut +import OAI.NumberTheory.Ostmann.Tree.DensityHorizontal + +namespace OAI + +namespace Ostmann.Tree.QuartetFactorization +noncomputable section +open scoped BigOperators +open Density +variable {F : Type*} [Field F] + +def bottomCut : (k : ℕ) → Density.Cut (k+2) k + | 0 => .stop 2 + | k+1 => .split (bottomCut k) (bottomCut k) + +theorem cut_unique {d k : ℕ} (C C' : Density.Cut d k) : C = C' := by + induction C with + | stop d => cases C'; rfl + | split L R ihl ihr => + cases C' with + | split L' R' => rw [ihl L', ihr R'] + +theorem bottomCut_eq_ofLE (k : ℕ) : + bottomCut k = Density.Cut.ofLE (by omega : k ≤ k+2) := cut_unique _ _ + +def bottomLeaves : (k : ℕ) → (Leaves (k+2) → Fˣ) → (Leaves k → Leaves 2 → Fˣ) + | 0, M => fun _ => M + | k+1, M => join (bottomLeaves k (left M)) (bottomLeaves k (right M)) + +def assembleBottom : (k : ℕ) → (Leaves k → Leaves 2 → Fˣ) → (Leaves (k+2) → Fˣ) + | 0, M => M (fun i => Fin.elim0 i) + | k+1, M => join (assembleBottom k (left M)) (assembleBottom k (right M)) + +theorem bottomLeaves_assemble (k : ℕ) (M : Leaves k → Leaves 2 → Fˣ) : + bottomLeaves k (assembleBottom k M) = M := by + induction k with + | zero => funext v; exact congrArg M (Subsingleton.elim _ _) + | succ k ih => + simp only [assembleBottom, bottomLeaves, left_join, right_join, ih, join_left_right] + +theorem assemble_bottomLeaves (k : ℕ) (M : Leaves (k+2) → Fˣ) : + assembleBottom k (bottomLeaves k M) = M := by + induction k with + | zero => rfl + | succ k ih => + simp only [assembleBottom, bottomLeaves, left_join, right_join, ih, join_left_right] + +def bottomLeavesEquiv (k : ℕ) : + (Leaves (k+2) → Fˣ) ≃ (Leaves k → Leaves 2 → Fˣ) where + toFun := bottomLeaves k + invFun := assembleBottom k + left_inv := assemble_bottomLeaves k + right_inv := bottomLeaves_assemble k + +theorem bottomLeaves_product (k : ℕ) (M : Leaves (k+2) → Fˣ) (v : Leaves k) : + Parameters.leafProduct (bottomLeaves k M v) = Density.Cut.project (bottomCut k) M v := by + induction k with + | zero => rfl + | succ k ih => + cases hv : v 0 <;> + simp only [bottomLeaves, bottomCut, Density.Cut.project, join, hv, + Bool.false_eq_true, ↓reduceIte] <;> exact ih _ _ + +def bottomParameters : (k : ℕ) → Parameters F (k+2) → Leaves k → Parameters F 2 + | 0, P => fun _ => P + | k+1, .branch _ _ _ _ L R => join (bottomParameters k L) (bottomParameters k R) + +theorem bottomParameters_consistent (k : ℕ) (P : Parameters F (k+2)) + (hP : P.consistent) (v : Leaves k) : (bottomParameters k P v).consistent := by + induction k with + | zero => exact hP + | succ k ih => + cases P with + | branch s a b u L R => + cases hv : v 0 <;> simp only [bottomParameters, join, hv, Bool.false_eq_true, ↓reduceIte] + · exact ih L hP.2.2.1 _ + · exact ih R hP.2.2.2 _ + +theorem bottomParameters_bottomOpposite (k : ℕ) (P : Parameters F (k+2)) + (hP : P.bottomOpposite) (v : Leaves k) : (bottomParameters k P v).bottomOpposite := by + induction k with + | zero => exact hP + | succ k ih => + cases P with + | branch s a b u L R => + cases hv : v 0 <;> simp only [bottomParameters, join, hv, Bool.false_eq_true, ↓reduceIte] + · exact ih L hP.1 _ + · exact ih R hP.2 _ + +end +end Ostmann.Tree.QuartetFactorization + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationValidity.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationValidity.lean new file mode 100644 index 0000000000000000000000000000000000000000..1fe7e6bd4976da87f534b6eefe2349c984e28901 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFactorizationValidity.lean @@ -0,0 +1,48 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorizationFrames + +namespace OAI + +namespace Ostmann.Tree.QuartetFactorization +noncomputable section +open Density +variable {F : Type*} [Field F] +local instance quartetFactorizationValidityDecidableEq : DecidableEq F := Classical.decEq F + +theorem propagate_validity (k : ℕ) (P : Parameters F (k+2)) + (hP : P.consistent) (Xl Xr c : Fˣ) (hc : P.childConsistent c) + (totals : Leaves k → Fˣ) (fs : Leaves k → Frame F) + (h : propagate k P Xl Xr c totals = some fs) (v : Leaves k) : + (fs v).parameters = bottomParameters k P v ∧ + (fs v).parameters.childConsistent (fs v).coefficient := by + induction k generalizing Xl Xr c with + | zero => + simp only [propagate, Option.some.injEq] at h + rw [← h] + exact ⟨rfl, hc⟩ + | succ k ih => + cases P with + | branch s a b u L R => + simp only [propagate] at h + split at h + · contradiction + · split at h <;> try contradiction + rename_i fl fr hfl hfr + have hfs := Option.some.inj h + rw [← hfs] + cases hv : v 0 <;> + simp only [join, bottomParameters, hv, Bool.false_eq_true, ↓reduceIte] + · exact ih L hP.2.2.1 _ Xl (u*a) hP.1 _ fl hfl _ + · exact ih R hP.2.2.2 _ Xr (u*b) hP.2.1 _ fr hfr _ + +theorem Frame.coefficient_eq_rootCoefficient (f : Frame F) + (hc : f.parameters.childConsistent f.coefficient) : + f.coefficient = Density.rootCoefficient f.parameters := by + cases hp : f.parameters with + | branch s a b u L R => + rw [hp] at hc + exact hc.symm + +end +end Ostmann.Tree.QuartetFactorization + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamily.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c47e2f3c4d047a2b4d27ff706f9d70d3d5d4599 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamily.lean @@ -0,0 +1,91 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetActions +import OAI.NumberTheory.Ostmann.Tree.QuartetHeld + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +open scoped BigOperators +variable {F : Type*} [Field F] + +def pairAssignment (freeRight : Bool) (free held : Fˣ) : Leaves 1 → Fˣ := + if freeRight then Density.join (fun _ => held) (fun _ => free) + else Density.join (fun _ => free) (fun _ => held) + +theorem leafProduct_const_zero (x : Fˣ) : + Parameters.leafProduct (fun _ : Leaves 0 => x) = x := by + simp [Parameters.leafProduct, Leaves] + +theorem leafProduct_pairAssignment (side : Bool) (free held : Fˣ) : + Parameters.leafProduct (pairAssignment side free held) = free*held := by + cases side <;> + simp [pairAssignment, Density.leafProduct_split, Density.left_join, Density.right_join, + leafProduct_const_zero, mul_comm] + +def crossAssignment (leftFreeRight rightFreeRight : Bool) + (total heldLeft heldRight coordinate : Fˣ) : Leaves 2 → Fˣ := + Density.join (pairAssignment leftFreeRight coordinate heldLeft) + (pairAssignment rightFreeRight (total/(coordinate*heldLeft*heldRight)) heldRight) + +theorem leftProduct_crossAssignment (a b : Bool) (m h k z : Fˣ) : + Parameters.leafProduct (Density.left (crossAssignment a b m h k z)) = z*h := by + simp only [crossAssignment, Density.left_join, leafProduct_pairAssignment] + +theorem rightProduct_crossAssignment (a b : Bool) (m h k z : Fˣ) : + Parameters.leafProduct (Density.right (crossAssignment a b m h k z)) = m/(z*h) := by + simp only [crossAssignment, Density.right_join, leafProduct_pairAssignment] + apply Units.ext + simp only [Units.val_div_eq_div_val, Units.val_mul] + field_simp + +theorem product_crossAssignment (a b : Bool) (m h k z : Fˣ) : + Parameters.leafProduct (crossAssignment a b m h k z) = m := by + rw [Density.leafProduct_split, leftProduct_crossAssignment, rightProduct_crossAssignment] + simp [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] + +namespace NodeInput + +def familyRoot (N : NodeInput F 1) (total : Fˣ) : Fˣ := + N.s/(N.D*N.Xleft*N.Xright*(N.a*N.b)*total) + +def familyRatioConstant (N : NodeInput F 1) (total heldLeft : Fˣ) : Fˣ := + N.left.frequency*(N.Xright*N.b)*total / + (N.right.frequency*(N.Xleft*N.a)*heldLeft^2) + +def crossFamily (N : NodeInput F 1) (a b : Bool) (m h k z : Fˣ) : NodeInput F 1 := + N.withLeaves (crossAssignment a b m h k z) + +theorem crossFamily_argument (N : NodeInput F 1) (a b : Bool) (m h k z : Fˣ) : + (N.crossFamily a b m h k z).argument = N.familyRoot m := by + simp only [crossFamily, withLeaves, argument, parameters, Density.rootArgument, + Parameters.frequency, product_crossAssignment, familyRoot] + +theorem crossFamily_leftFactor (N : NodeInput F 1) (a b : Bool) (m h k z : Fˣ) : + (N.crossFamily a b m h k z).leftFactor = N.Xleft*N.a*(z*h) := by + simp only [crossFamily, withLeaves, leftFactor, leftProduct_crossAssignment] + +theorem crossFamily_rightFactor (N : NodeInput F 1) (a b : Bool) (m h k z : Fˣ) : + (N.crossFamily a b m h k z).rightFactor = N.Xright*N.b*(m/(z*h)) := by + simp only [crossFamily, withLeaves, rightFactor, rightProduct_crossAssignment] + +theorem crossFamily_ratio (N : NodeInput F 1) (a b : Bool) (m h k z : Fˣ) + (hp : (N.crossFamily a b m h k z).pivot ≠ 0) : + (N.crossFamily a b m h k z).leftArgument hp / + (N.crossFamily a b m h k z).rightArgument hp = N.familyRatioConstant m h/z^2 := by + rw [actual_child_ratio, crossFamily_leftFactor, crossFamily_rightFactor] + apply Units.ext + simp only [crossFamily, withLeaves, ratio, familyRatioConstant, Units.val_div_eq_div_val, + Units.val_mul, Units.val_pow_eq_pow_val] + field_simp + +theorem crossFamily_difference (N : NodeInput F 1) (a b : Bool) (m h k z : Fˣ) + (hp : (N.crossFamily a b m h k z).pivot ≠ 0) : + ((N.crossFamily a b m h k z).leftArgument hp:F) - + ((N.crossFamily a b m h k z).rightArgument hp:F) = (N.familyRoot m:F) := by + rw [argument_difference, crossFamily_argument] + +end NodeInput +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamilyParameters.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamilyParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..69a0b4880eef5e4423557a8d991ad05a76f9bd30 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamilyParameters.lean @@ -0,0 +1,93 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorRatios +import OAI.NumberTheory.Ostmann.Tree.QuartetFamily + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +variable {F : Type*} [Field F] + +def modeMultiplier (bad : Bool) (d e : Fˣ) : Fˣ := if bad then e⁻¹ else d + +namespace NodeInput +variable {d : ℕ} + +theorem leftNode_leaves (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : + (N.leftNode hp).leaves = Density.left N.leaves := by + cases he : N.left + simp only [leftNode, he] + +theorem rightNode_leaves (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : + (N.rightNode hp).leaves = Density.right N.leaves := by + cases he : N.right + simp only [rightNode, he] + +def leftLambda (N : NodeInput F 1) (m : Fˣ) (bad : Bool) : Fˣ := + if bad then sharedCoefficient N.left N.D * + (N.left.frequency*N.right.frequency/(N.s*N.D*N.u^2))*N.familyRoot m + else residualCoefficient N.left N.D N.Xleft + +def rightLambda (N : NodeInput F 1) (m : Fˣ) (bad : Bool) : Fˣ := + if bad then sharedCoefficient N.right N.D * + (N.left.frequency*N.right.frequency/(N.s*N.D*N.u^2))*N.familyRoot m + else residualCoefficient N.right N.D N.Xright + +theorem crossFamily_left_parameter (N : NodeInput F 1) (hcons : N.parameters.consistent) + (a b : Bool) (m h k z : Fˣ) (hp : (N.crossFamily a b m h k z).pivot ≠ 0) : + ((N.crossFamily a b m h k z).leftNode hp).factorRatio a = + (N.leftLambda m a*h^2) * modeMultiplier a + ((N.crossFamily a b m h k z).leftArgument hp) + ((N.crossFamily a b m h k z).rightArgument hp) := by + have hc : N.left.childConsistent (N.u*N.a) := hcons.1 + cases a + · let Q := N.crossFamily false b m h k z + have hheld : Parameters.leafProduct (Density.right (Q.leftNode hp).leaves)=h := by + rw [leftNode_leaves] + simp only [Q, crossFamily, withLeaves, crossAssignment, Density.left_join, + pairAssignment, Bool.false_eq_true, ↓reduceIte, Density.right_join, leafProduct_const_zero] + have he := left_friendly_factor Q hp hc + rw [hheld] at he + exact he + · let Q := N.crossFamily true b m h k z + have hheld : Parameters.leafProduct (Density.left (Q.leftNode hp).leaves)=h := by + rw [leftNode_leaves] + simp only [Q, crossFamily, withLeaves, crossAssignment, Density.left_join, + pairAssignment, ↓reduceIte, Density.left_join, leafProduct_const_zero] + have he := left_bad_factor Q hp hc + rw [hheld, show Q.argument=N.familyRoot m from crossFamily_argument N true b m h k z] at he + rw [he] + simp only [Q, crossFamily, withLeaves, leftLambda, modeMultiplier, ↓reduceIte] + simp [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] + +theorem crossFamily_right_parameter (N : NodeInput F 1) (hcons : N.parameters.consistent) + (a b : Bool) (m h k z : Fˣ) (hp : (N.crossFamily a b m h k z).pivot ≠ 0) : + ((N.crossFamily a b m h k z).rightNode hp).factorRatio b = + (N.rightLambda m b*k^2) * modeMultiplier b + ((N.crossFamily a b m h k z).rightArgument hp) + ((N.crossFamily a b m h k z).leftArgument hp) := by + have hc : N.right.childConsistent (N.u*N.b) := hcons.2.1 + cases b + · let Q := N.crossFamily a false m h k z + have hheld : Parameters.leafProduct (Density.right (Q.rightNode hp).leaves)=k := by + rw [rightNode_leaves] + simp only [Q, crossFamily, withLeaves, crossAssignment, Density.right_join, + pairAssignment, Bool.false_eq_true, ↓reduceIte, Density.right_join, leafProduct_const_zero] + have he := right_friendly_factor Q hp hc + rw [hheld] at he + exact he + · let Q := N.crossFamily a true m h k z + have hheld : Parameters.leafProduct (Density.left (Q.rightNode hp).leaves)=k := by + rw [rightNode_leaves] + simp only [Q, crossFamily, withLeaves, crossAssignment, Density.right_join, + pairAssignment, ↓reduceIte, Density.left_join, leafProduct_const_zero] + have he := right_bad_factor Q hp hc + rw [hheld, show Q.argument=N.familyRoot m from crossFamily_argument N a true m h k z] at he + rw [he] + simp only [Q, crossFamily, withLeaves, rightLambda, modeMultiplier, ↓reduceIte] + simp [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] + +end NodeInput +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamilyPullback.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamilyPullback.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a82ea44ac4eec29e5f9409ac8701016b6bb34de --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamilyPullback.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetFamilyValue +import OAI.NumberTheory.Ostmann.Tree.QuartetRatioConvolution + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +open Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] + +def pairMode (bad : Bool) : PairMode := if bad then .bad else .friendly + +theorem modeMultiplier_cast (bad : Bool) (d e : (ZMod p)ˣ) : + (modeMultiplier bad d e:ZMod p) = (pairMode bad).multiplier d e := by + cases bad + · rfl + · exact Units.val_inv_eq_inv_val e + +theorem pairTest_zero_difference (g : ZMod p → ℂ) (hg0 : g 0=0) + (σ : (ZMod p)ˣ) (t : ZMod p) : pairTest g σ 0 t=0 := by + simp [pairTest,pairFirst,pairSecond,hg0] + +namespace NodeInput + +def crossFamilyFunction (N : NodeInput (ZMod p) 1) (g : ZMod p → ℂ) + (a b : Bool) (m h k z : (ZMod p)ˣ) : ℂ := + let Q := N.crossFamily a b m h k z + Q.parameters.evaluate g Q.D Q.Xleft Q.Xright 0 Q.leaves + +theorem crossFamily_pullback_point (N : NodeInput (ZMod p) 1) + (hcons : N.parameters.consistent) (hopp : N.parameters.bottomOpposite) + (g : ZMod p → ℂ) (hg0 : g 0=0) (a b : Bool) (m h k z : (ZMod p)ˣ) : + N.crossFamilyFunction g a b m h k z = + twoPairRatioValue (signedFunction g (parameterSign N.left a)) + (signedFunction g (parameterSign N.right b)) (orientation a) (orientation b) + (pairMode a) (pairMode b) (N.leftLambda m a*h^2) (N.rightLambda m b*k^2) + (N.familyRoot m) (N.familyRatioConstant m h/z^2) := by + let Q := N.crossFamily a b m h k z + by_cases hp : Q.pivot=0 + · change Q.parameters.evaluate g Q.D Q.Xleft Q.Xright 0 Q.leaves = _ + rw [evaluate_eq_zero Q hp g 0] + have hr : N.familyRatioConstant m h/z^2 = 1 := by + have he := factorRatio_zero Q hp false + rw [crossFamily_factorRatio N a b m h k z] at he + exact he + rw [hr] + simp only [twoPairRatioValue, pairMobiusValue, Units.val_one, sub_self, div_zero] + rw [pairTest_zero_difference _ (signedFunction_zero g hg0 _)]; simp + · change Q.parameters.evaluate g Q.D Q.Xleft Q.Xright 0 Q.leaves = _ + rw [crossFamily_value_valid N hcons hopp g hg0 a b m h k z hp 0] + have hd : pairMobiusValue (N.familyRoot m) + ((N.familyRatioConstant m h/z^2:(ZMod p)ˣ):ZMod p) = (Q.leftArgument hp:ZMod p) := by + simpa only [Units.val_div_eq_div_val, Units.val_pow_eq_pow_val] using + crossFamily_left_chart N a b m h k z hp + have he : (Q.leftArgument hp:ZMod p)-(N.familyRoot m:ZMod p) = (Q.rightArgument hp:ZMod p) := by + rw [← hd] + simpa only [Units.val_div_eq_div_val, Units.val_pow_eq_pow_val] using + crossFamily_right_chart N a b m h k z hp + simp only [twoPairRatioValue, hd, he, pairValue_eq_pairTest, Units.val_mul, + modeMultiplier_cast] + rfl + +end NodeInput +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamilyValue.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamilyValue.lean new file mode 100644 index 0000000000000000000000000000000000000000..3bb6648e09beca63bc5a02cf6fc23e97fec06600 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFamilyValue.lean @@ -0,0 +1,87 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetFamilyParameters + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +variable {F : Type*} [Field F] + +def parameterSign (P : Parameters F 1) (freeRight : Bool) : Bool := + match P with + | .branch _ _ _ _ L R => + if freeRight then NodeInput.leafSign R else NodeInput.leafSign L + +namespace NodeInput + +theorem leftNode_sign (N : NodeInput F 1) (hp : N.pivot ≠ 0) (a : Bool) : + (N.leftNode hp).orientedSign a = parameterSign N.left a := by + cases he : N.left + simp only [leftNode, he, orientedSign, parameterSign] + +theorem rightNode_sign (N : NodeInput F 1) (hp : N.pivot ≠ 0) (b : Bool) : + (N.rightNode hp).orientedSign b = parameterSign N.right b := by + cases he : N.right + simp only [rightNode, he, orientedSign, parameterSign] + +theorem crossFamily_value_valid (N : NodeInput F 1) (hcons : N.parameters.consistent) + (hopp : N.parameters.bottomOpposite) (g : F → ℂ) (hg0 : g 0=0) + (a b : Bool) (m h k z : Fˣ) (hp : (N.crossFamily a b m h k z).pivot ≠ 0) + (incoming : F) : + let Q := N.crossFamily a b m h k z + Q.parameters.evaluate g Q.D Q.Xleft Q.Xright incoming Q.leaves = + pairValue g (parameterSign N.left a) (orientation a) (Q.leftArgument hp:F) + (((N.leftLambda m a*h^2)*modeMultiplier a (Q.leftArgument hp) (Q.rightArgument hp):Fˣ):F) * + pairValue g (parameterSign N.right b) (orientation b) (Q.rightArgument hp:F) + (((N.rightLambda m b*k^2)*modeMultiplier b (Q.rightArgument hp) (Q.leftArgument hp):Fˣ):F) := by + dsimp only + let Q := N.crossFamily a b m h k z + have hc : N.left.childConsistent (N.u*N.a) ∧ N.right.childConsistent (N.u*N.b) ∧ + N.left.consistent ∧ N.right.consistent := hcons + have hs : N.left.bottomOpposite ∧ N.right.bottomOpposite := hopp + have hsL : (Q.leftNode hp).parameters.bottomOpposite := by + rw [leftNode_parameters] + exact hs.1 + have hsR : (Q.rightNode hp).parameters.bottomOpposite := by + rw [rightNode_parameters] + exact hs.2 + have he := descend_evaluate Q hp g incoming + rw [bottom_evaluate_all _ hsL g hg0 _ a, bottom_evaluate_all _ hsR g hg0 _ b, + leftNode_argument Q hp hc.1, rightNode_argument Q hp hc.2.1, + leftNode_sign, rightNode_sign, + crossFamily_left_parameter N hcons a b m h k z hp, + crossFamily_right_parameter N hcons a b m h k z hp] at he + exact he + +theorem crossFamily_factorRatio (N : NodeInput F 1) (a b : Bool) (m h k z : Fˣ) : + (N.crossFamily a b m h k z).factorRatio false = N.familyRatioConstant m h/z^2 := by + change ratio (N.crossFamily a b m h k z).left.frequency + (N.crossFamily a b m h k z).right.frequency + (N.crossFamily a b m h k z).leftFactor (N.crossFamily a b m h k z).rightFactor = _ + rw [crossFamily_leftFactor, crossFamily_rightFactor] + apply Units.ext + simp only [crossFamily, withLeaves, ratio, familyRatioConstant, Units.val_div_eq_div_val, + Units.val_mul, Units.val_pow_eq_pow_val] + field_simp + +theorem crossFamily_left_chart (N : NodeInput F 1) (a b : Bool) (m h k z : Fˣ) + (hp : (N.crossFamily a b m h k z).pivot ≠ 0) : + Ostmann.FiniteField.pairMobiusValue (N.familyRoot m) (N.familyRatioConstant m h/z^2) = + ((N.crossFamily a b m h k z).leftArgument hp:F) := by + have he := (pair_coordinates_left (N.crossFamily a b m h k z) hp).1 + rw [crossFamily_argument, crossFamily_ratio] at he + simpa only [Ostmann.FiniteField.pairFirst, Ostmann.FiniteField.pairMobiusValue, + Units.val_one, one_mul, Units.val_div_eq_div_val, Units.val_pow_eq_pow_val] using he + +theorem crossFamily_right_chart (N : NodeInput F 1) (a b : Bool) (m h k z : Fˣ) + (hp : (N.crossFamily a b m h k z).pivot ≠ 0) : + Ostmann.FiniteField.pairMobiusValue (N.familyRoot m) (N.familyRatioConstant m h/z^2) - + (N.familyRoot m:F) = ((N.crossFamily a b m h k z).rightArgument hp:F) := by + rw [crossFamily_left_chart N a b m h k z hp] + have he := crossFamily_difference N a b m h k z hp + linear_combination he + +end NodeInput +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFiberIndependence.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFiberIndependence.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea8eae30148704e7bec2b86d9128e2a6c1598a12 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetFiberIndependence.lean @@ -0,0 +1,49 @@ +import OAI.NumberTheory.Ostmann.Tree.CutFiberAverage +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorizationFibers + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators +open Ostmann.Arithmetic.ResidueHaar +open QuartetFactorization + +local instance fiberIndependenceDecEq {F : Type*} [Field F] : DecidableEq F := Classical.decEq F +local instance fiberIndependenceFintype {A B : Type*} [Fintype A] (f : A → B) (y : B) : + Fintype {x : A // f x=y} := Fintype.ofFinite _ + +theorem average_pi_product {I : Type*} [Fintype I] [DecidableEq I] + {A : I → Type*} [∀i,Fintype (A i)] (f : ∀i,A i → ℂ) : + average (fun x : ∀i,A i => ∏i,f i (x i)) = ∏i,average (f i) := by + classical + simp only [average,Fintype.card_pi,Nat.cast_prod,Finset.prod_inv_distrib, + Finset.prod_mul_distrib,← Fintype.prod_sum] + +theorem quartet_fiber_product {F : Type*} [Field F] [Fintype F] + (k : ℕ) (totals : Leaves k → Fˣ) + (w : Leaves k → (Leaves 2 → Fˣ) → ℂ) : + fiberAverage (bottomCut k).project + (fun M => ∏v,w v (bottomLeaves k M v)) totals = + ∏v,fiberAverage Parameters.leafProduct (w v) (totals v) := by + classical + have he := average_equiv (productFiberEquiv k totals) + (fun x => ∏v,w v (x v).val) + have hp := average_pi_product (fun v (x : {m : Leaves 2 → Fˣ // Parameters.leafProduct m=totals v}) => w v x.val) + exact he.trans hp + +theorem quartet_fiber_product_real {F : Type*} [Field F] [Fintype F] + (k : ℕ) (totals : Leaves k → Fˣ) + (w : Leaves k → (Leaves 2 → Fˣ) → ℝ) : + Density.average (fun M : {M : Leaves (k+2) → Fˣ // (bottomCut k).project M=totals} => + ∏v,w v (bottomLeaves k M.val v)) = + ∏v,Density.average (fun m : {m : Leaves 2 → Fˣ // Parameters.leafProduct m=totals v} => w v m.val) := by + apply Complex.ofReal_injective + have h := quartet_fiber_product k totals (fun v m => (w v m:ℂ)) + simpa only [fiberAverage,average,Density.average,Complex.ofReal_mul,Complex.ofReal_inv, + Complex.ofReal_sum,Complex.ofReal_prod,Complex.ofReal_natCast] using h + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetHeld.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetHeld.lean new file mode 100644 index 0000000000000000000000000000000000000000..ebad99f9c79655d218cbc21f92a56ed51ada64c4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetHeld.lean @@ -0,0 +1,110 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetCoordinates + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +variable {F : Type*} [Field F] + +namespace NodeInput +variable {d : ℕ} + +theorem actual_held_square_left (N : NodeInput F d) (hp : N.pivot ≠ 0) : + (N.leftArgument hp/N.rightArgument hp)/N.argument = + (N.D*N.left.frequency/(N.right.frequency*N.s))*N.rightFactor^2 := by + rw [actual_child_ratio, argument_eq] + exact held_square _ _ _ _ _ _ + +theorem actual_held_square_right (N : NodeInput F d) (hp : N.pivot ≠ 0) : + (N.rightArgument hp/N.leftArgument hp)/N.argument = + (N.D*N.right.frequency/(N.left.frequency*N.s))*N.leftFactor^2 := by + rw [leftArgument_eq, rightArgument_eq, child_ratio, argument_eq, ← root_swap] + exact held_square _ _ _ _ _ _ + +theorem residual_held_ratio (N : NodeInput F d) (hp : N.pivot ≠ 0) : + N.leftArgument hp/N.rightArgument hp = + ((N.D*N.left.frequency/(N.right.frequency*N.s))*(N.Xright*N.b)^2) * + (Parameters.leafProduct (Density.right N.leaves))^2 * N.argument := by + have h := actual_held_square_left N hp + apply div_eq_iff_eq_mul.mp at h + rw [h] + simp only [rightFactor, mul_pow] + simp only [mul_assoc, mul_left_comm, mul_comm] + +theorem shared_held_ratio (N : NodeInput F d) (hp : N.pivot ≠ 0) : + N.rightArgument hp/N.leftArgument hp = + ((N.D*N.right.frequency/(N.left.frequency*N.s))*N.a^2) * + (Parameters.leafProduct (Density.left N.leaves))^2 * N.Xleft^2 * N.argument := by + have h := actual_held_square_right N hp + apply div_eq_iff_eq_mul.mp at h + rw [h] + simp only [leftFactor, mul_pow] + ac_rfl + +def leftNode (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : NodeInput F d := + match N.left with + | .branch s a b u L R => + ⟨s, a, b, u, N.D, N.pivotUnit hp, N.Xleft, L, R, Density.left N.leaves⟩ + +def rightNode (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : NodeInput F d := + match N.right with + | .branch s a b u L R => + ⟨s, a, b, u, N.D, N.pivotUnit hp, N.Xright, L, R, Density.right N.leaves⟩ + +theorem leftNode_argument (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) + (hc : N.left.childConsistent (N.u*N.a)) : + (N.leftNode hp).argument = N.leftArgument hp := by + cases he : N.left with + | branch s a b u L R => + simp only [he, Parameters.childConsistent] at hc + simp only [leftNode, he, argument, parameters, leftArgument] + rw [hc] + +theorem rightNode_argument (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) + (hc : N.right.childConsistent (N.u*N.b)) : + (N.rightNode hp).argument = N.rightArgument hp := by + cases he : N.right with + | branch s a b u L R => + simp only [he, Parameters.childConsistent] at hc + simp only [rightNode, he, argument, parameters, rightArgument] + rw [hc] + +theorem leftNode_shared (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : + (N.leftNode hp).Xleft = N.pivotUnit hp := by + cases he : N.left; simp only [leftNode, he] + +theorem rightNode_shared (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) : + (N.rightNode hp).Xleft = N.pivotUnit hp := by + cases he : N.right; simp only [rightNode, he] + +theorem left_bad_ratio (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) + (hc : N.left.childConsistent (N.u*N.a)) + (hl : (N.leftNode hp).pivot ≠ 0) : + (N.leftNode hp).rightArgument hl/(N.leftNode hp).leftArgument hl = + (((N.leftNode hp).D*(N.leftNode hp).right.frequency / + ((N.leftNode hp).left.frequency*(N.leftNode hp).s)) * (N.leftNode hp).a^2) * + (Parameters.leafProduct (Density.left (N.leftNode hp).leaves))^2 * + (N.left.frequency*N.right.frequency/(N.s*N.D*N.u^2)) * N.argument / + N.rightArgument hp := by + rw [shared_held_ratio, leftNode_shared, actual_shared_pivot_square, + leftNode_argument N hp hc] + simp [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] + +theorem right_bad_ratio (N : NodeInput F (d+1)) (hp : N.pivot ≠ 0) + (hc : N.right.childConsistent (N.u*N.b)) + (hr : (N.rightNode hp).pivot ≠ 0) : + (N.rightNode hp).rightArgument hr/(N.rightNode hp).leftArgument hr = + (((N.rightNode hp).D*(N.rightNode hp).right.frequency / + ((N.rightNode hp).left.frequency*(N.rightNode hp).s)) * (N.rightNode hp).a^2) * + (Parameters.leafProduct (Density.left (N.rightNode hp).leaves))^2 * + (N.left.frequency*N.right.frequency/(N.s*N.D*N.u^2)) * N.argument / + N.leftArgument hp := by + rw [shared_held_ratio, rightNode_shared, actual_shared_pivot_square, + rightNode_argument N hp hc] + simp [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] + +end NodeInput +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetLocal.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetLocal.lean new file mode 100644 index 0000000000000000000000000000000000000000..5603548d7531d3ef96b63e4bbac93d2f3b8d6751 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetLocal.lean @@ -0,0 +1,91 @@ +import OAI.NumberTheory.Ostmann.Tree.DensityValues +import OAI.NumberTheory.Ostmann.Tree.QuartetSameBound + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.Tree.Diagram +open Quartet Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] + +def localNode (T : Diagram (ZMod p) 2) : NodeInput (ZMod p) 1 := + NodeInput.ofDiagram T (fun _ => 1) + +theorem localNode_parameters (T : Diagram (ZMod p) 2) : + T.localNode.parameters = T.parameters := NodeInput.ofDiagram_parameters T _ + +theorem localNode_value (T : Diagram (ZMod p) 2) (g : ZMod p → ℂ) + (M : Leaves 2 → (ZMod p)ˣ) : + T.value g M = T.localNode.parameters.evaluate g T.localNode.D + T.localNode.Xleft T.localNode.Xright 0 M := by + cases he : T.parameters + simp only [localNode, NodeInput.ofDiagram, NodeInput.ofParameters, he, + NodeInput.parameters, Diagram.value, Parameters.value] + +theorem localNode_rootArgument (T : Diagram (ZMod p) 2) + (M : Leaves 2 → (ZMod p)ˣ) : + T.localNode.familyRoot (Parameters.leafProduct M) = + Density.rootArgument T.parameters T.denominator T.rootLeft T.rootRight + (Density.rootCoefficient T.parameters) M := by + cases he : T.parameters + simp only [localNode, NodeInput.ofDiagram, NodeInput.ofParameters, he, + NodeInput.familyRoot, Density.rootArgument, Density.rootCoefficient, Parameters.frequency] + +theorem crossAction_fiber_bound (T : Diagram (ZMod p) 2) (g : ZMod p → ℂ) + (hg0 : g 0=0) (a b : Bool) (m : (ZMod p)ˣ) (ρ : MulChar (ZMod p) ℂ) : + Density.average (fun M : {M : Leaves 2 → (ZMod p)ˣ // Parameters.leafProduct M=m} => + ‖mellin (fun z : (ZMod p)ˣ => T.value g (moveCross M.val a b z)) ρ‖^2) ≤ + T.localNode.crossLocalMajorant g a b ρ (T.localNode.familyRoot m) := by + simp_rw [localNode_value] + exact NodeInput.crossAction_fiber_bound T.localNode + (by rw [localNode_parameters]; exact T.consistent) + (by rw [localNode_parameters]; exact T.bottomOpposite) g hg0 a b m ρ + +theorem sameAction_fiber_bound (T : Diagram (ZMod p) 2) (g : ZMod p → ℂ) + (hg0 : g 0=0) (side : Bool) (m : (ZMod p)ˣ) (ρ : MulChar (ZMod p) ℂ) : + Density.average (fun M : {M : Leaves 2 → (ZMod p)ˣ // Parameters.leafProduct M=m} => + ‖mellin (fun z : (ZMod p)ˣ => T.value g (NodeInput.moveSame M.val side z)) ρ‖^2) ≤ + T.localNode.sameLocalMajorant g side ρ (T.localNode.familyRoot m) := by + simp_rw [localNode_value] + exact NodeInput.sameAction_fiber_bound T.localNode + (by rw [localNode_parameters]; exact T.consistent) + (by rw [localNode_parameters]; exact T.bottomOpposite) g hg0 side m ρ + +theorem crossAction_inverse_fiber_bound (T : Diagram (ZMod p) 2) (g : ZMod p → ℂ) + (hg0 : g 0=0) (a b : Bool) (m : (ZMod p)ˣ) (ρ : MulChar (ZMod p) ℂ) : + Density.average (fun M : {M : Leaves 2 → (ZMod p)ˣ // Parameters.leafProduct M=m} => + ‖mellin (fun z : (ZMod p)ˣ => T.value g (moveCross M.val a b z⁻¹)) ρ‖^2) ≤ + T.localNode.crossLocalMajorant g a b ρ⁻¹ (T.localNode.familyRoot m) := by + have he (M : Leaves 2 → (ZMod p)ˣ) : + mellin (fun z : (ZMod p)ˣ => T.value g (moveCross M a b z⁻¹)) ρ = + mellin (fun z : (ZMod p)ˣ => T.value g (moveCross M a b z)) ρ⁻¹ := + mellin_inverse_coordinate (fun z : (ZMod p)ˣ => T.value g (moveCross M a b z)) ρ + simp_rw [he] + exact crossAction_fiber_bound T g hg0 a b m ρ⁻¹ + +theorem sameAction_inverse_fiber_bound (T : Diagram (ZMod p) 2) (g : ZMod p → ℂ) + (hg0 : g 0=0) (side : Bool) (m : (ZMod p)ˣ) (ρ : MulChar (ZMod p) ℂ) : + Density.average (fun M : {M : Leaves 2 → (ZMod p)ˣ // Parameters.leafProduct M=m} => + ‖mellin (fun z : (ZMod p)ˣ => T.value g (NodeInput.moveSame M.val side z⁻¹)) ρ‖^2) ≤ + T.localNode.sameLocalMajorant g side ρ⁻¹ (T.localNode.familyRoot m) := by + have he (M : Leaves 2 → (ZMod p)ˣ) : + mellin (fun z : (ZMod p)ˣ => T.value g (NodeInput.moveSame M side z⁻¹)) ρ = + mellin (fun z : (ZMod p)ˣ => T.value g (NodeInput.moveSame M side z)) ρ⁻¹ := + mellin_inverse_coordinate (fun z : (ZMod p)ˣ => T.value g (NodeInput.moveSame M side z)) ρ + simp_rw [he] + exact sameAction_fiber_bound T g hg0 side m ρ⁻¹ + +theorem untouched_fiber_bound (T : Diagram (ZMod p) 2) (g : ZMod p → ℂ) + (hg0 : g 0=0) (m : (ZMod p)ˣ) : + Density.average (fun M : {M : Leaves 2 → (ZMod p)ˣ // Parameters.leafProduct M=m} => + ‖T.value g M.val‖^2) ≤ T.localNode.untouchedLocalMajorant g (T.localNode.familyRoot m) := by + simp_rw [localNode_value] + exact NodeInput.untouched_fiber_bound T.localNode + (by rw [localNode_parameters]; exact T.consistent) + (by rw [localNode_parameters]; exact T.bottomOpposite) g hg0 m + +end Ostmann.Tree.Diagram +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetMellinPullback.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetMellinPullback.lean new file mode 100644 index 0000000000000000000000000000000000000000..d07ceb0edd171c0f13bc189eeea2158c47ea7eca --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetMellinPullback.lean @@ -0,0 +1,31 @@ +import OAI.NumberTheory.Ostmann.Tree.MellinSquare + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] +local instance : Fintype (MulChar F ℂ) := Fintype.ofFinite _ + +theorem mellin_inverse_coordinate (f : Fˣ → ℂ) (ρ : MulChar F ℂ) : + mellin (fun z : Fˣ => f z⁻¹) ρ = mellin f ρ⁻¹ := by + unfold mellin + congr 1 + have hs := (Equiv.inv Fˣ).bijective.sum_comp (fun z : Fˣ => f z*conj (ρ⁻¹ z)) + change (∑ z : Fˣ, f z⁻¹*conj (ρ⁻¹ (z⁻¹:Fˣ))) = ∑ z : Fˣ, f z*conj (ρ⁻¹ z) at hs + simpa only [MulChar.inv_apply', Units.val_inv_eq_inv_val, inv_inv] using hs + +theorem mellin_inverse_square_pullback (f : Fˣ → ℂ) (K : Fˣ) (ρ : MulChar F ℂ) : + ‖mellin (fun z : Fˣ => f (K/z^2)) ρ‖^2 ≤ + 2*∑ χ : MulChar F ℂ with χ^2=ρ⁻¹, ‖mellin f χ‖^2 := by + have he : (fun z : Fˣ => f (K/z^2)) = fun z : Fˣ => (fun w : Fˣ => f (K*w^2)) z⁻¹ := by + funext z + simp [div_eq_mul_inv, inv_pow] + rw [he, mellin_inverse_coordinate (fun w : Fˣ => f (K*w^2)) ρ] + exact mellin_square_pullback f K ρ⁻¹ + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetMobiusMellin.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetMobiusMellin.lean new file mode 100644 index 0000000000000000000000000000000000000000..55466ca354749052651d1f892ea93c91b5683575 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetMobiusMellin.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.Ostmann.Tree.MellinSquare +import OAI.NumberTheory.Ostmann.Tree.PairMobius + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] + +omit [DecidableEq F] in +theorem mobius_character_weight (c r : Fˣ) (χ : MulChar F ℂ) (hr : (r:F) ≠ 1) : + χ⁻¹ (pairMobiusValue c r)*χ (pairMobiusValue c r-c) = conj (χ r) := by + let e : F := (c:F)/((r:F)-1) + have he : e ≠ 0 := div_ne_zero (Units.ne_zero c) (sub_ne_zero.mpr hr) + have hdiff : pairMobiusValue c r-(c:F)=e := pairMobiusValue_sub c r hr + have hd : pairMobiusValue c r=(r:F)*e := by + dsimp [pairMobiusValue,e] + ring + have hχ : χ⁻¹ e*χ e=1 := by + rw [← MulChar.mul_apply, inv_mul_cancel] + exact MulChar.one_apply_coe (Units.mk0 e he) + rw [hdiff,hd,map_mul] + calc + _ = χ⁻¹ r*(χ⁻¹ e*χ e) := by ring + _ = χ⁻¹ r := by rw [hχ,mul_one] + _ = conj (χ r) := (MulChar.star_apply' χ r).symm + +theorem mellin_mobius_pullback (H : F → ℂ) (c : Fˣ) (χ : MulChar F ℂ) + (hH0 : H 0=0) : + mellin (fun r : Fˣ => H (pairMobiusValue c r)) χ = + (Fintype.card Fˣ:ℂ)⁻¹ * ∑ d : F, H d*(χ⁻¹ d*χ (d-c)) := by + let Ψ : F → ℂ := fun d => H d*(χ⁻¹ d*χ (d-c)) + have hp (r : Fˣ) : H (pairMobiusValue c r)*conj (χ r) = Ψ (pairMobiusValue c r) := by + by_cases hr : (r:F)=1 + · simp [Ψ,pairMobiusValue,hr,hH0] + · dsimp [Ψ] + rw [mobius_character_weight c r χ hr] + have hΨ0 : Ψ 0=0 := by simp [Ψ,hH0] + have hΨc : Ψ c=0 := by simp [Ψ, χ.map_zero] + have hcomp0 : Ψ (pairMobiusValue c 0)=0 := by simpa [pairMobiusValue] using hΨ0 + unfold mellin + simp_rw [hp] + rw [sum_units_of_zero (fun r => Ψ (pairMobiusValue c r)) hcomp0, + pairMobius_sum c Ψ hΨ0 hΨc] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetPairMajorant.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetPairMajorant.lean new file mode 100644 index 0000000000000000000000000000000000000000..7f07ad73f4cc70298682f4f04a4e3b1b616a1d44 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetPairMajorant.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.Characters.SquareCharacterMass +import OAI.NumberTheory.Ostmann.Characters.DifferenceMoment + +namespace OAI + +/-! +# Mean bounds for same-pair quartet majorants + +The square-fiber factor costs two for one index and costs nothing when +summed over all indices. Difference convolution then multiplies masses. +-/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable local instance samePairFintype {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +noncomputable def differenceMajorant {p : ℕ} [Fact p.Prime] + (f g : ZMod p → ℝ) (y : ZMod p) : ℝ := + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * differenceMoment f g y + +theorem mean_differenceMajorant_le {p : ℕ} [Fact p.Prime] + (f g : ZMod p → ℝ) (hf : ∀ x, 0 ≤ f x) (hg : ∀ x, 0 ≤ g x) : + (∑ y : (ZMod p)ˣ, differenceMajorant f g y) / (Fintype.card (ZMod p)ˣ : ℝ) ≤ + ((∑ x : ZMod p, f x) / (Fintype.card (ZMod p)ˣ : ℝ)) * + ((∑ x : ZMod p, g x) / (Fintype.card (ZMod p)ˣ : ℝ)) := by + have hU : (Fintype.card (ZMod p)ˣ : ℝ) = (p : ℝ) - 1 := by + rw [ZMod.card_units, Nat.cast_sub (Fact.out : p.Prime).one_lt.le, Nat.cast_one] + have h := mean_units_differenceMoment_le f g hf hg + simp only [differenceMajorant, ← Finset.mul_sum, hU] + convert h using 1 + ring + +noncomputable def samePairMajorant {p : ℕ} [Fact p.Prime] + (F : MulChar (ZMod p) ℂ → ZMod p → ℝ) (R : ZMod p → ℝ) + (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : ℝ := + differenceMajorant (fun d => squareCharacterMass (fun χ => F χ d) ρ) R y + +theorem samePairMajorant_nonneg {p : ℕ} [Fact p.Prime] + (F : MulChar (ZMod p) ℂ → ZMod p → ℝ) (R : ZMod p → ℝ) + (hF : ∀ χ d, 0 ≤ F χ d) (hR : ∀ d, 0 ≤ R d) + (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : 0 ≤ samePairMajorant F R ρ y := by + exact mul_nonneg (by positivity) (differenceMoment_nonneg _ _ + (fun d => squareCharacterMass_nonneg _ (fun χ => hF χ d) ρ) hR y) + +theorem squareCharacterMass_normalized_sum {p : ℕ} [Fact p.Prime] + (F : MulChar (ZMod p) ℂ → ZMod p → ℝ) (ρ : MulChar (ZMod p) ℂ) : + (∑ d : ZMod p, squareCharacterMass (fun χ => F χ d) ρ) / + (Fintype.card (ZMod p)ˣ : ℝ) = + squareCharacterMass (fun χ => (∑ d : ZMod p, F χ d) / + (Fintype.card (ZMod p)ˣ : ℝ)) ρ := by + unfold squareCharacterMass + rw [Finset.sum_comm, Finset.sum_div] + +/-- Small supremum for the same-pair majorant. -/ +theorem samePairMajorant_mean_le {p : ℕ} [Fact p.Prime] + (F : MulChar (ZMod p) ℂ → ZMod p → ℝ) (R : ZMod p → ℝ) + (hF : ∀ χ d, 0 ≤ F χ d) (hR : ∀ d, 0 ≤ R d) + (M H : ℝ) (hM : 0 ≤ M) + (hFm : ∀ χ, (∑ d : ZMod p, F χ d) / (Fintype.card (ZMod p)ˣ : ℝ) ≤ M) + (hRm : (∑ d : ZMod p, R d) / (Fintype.card (ZMod p)ˣ : ℝ) ≤ H) + (ρ : MulChar (ZMod p) ℂ) : + (∑ y : (ZMod p)ˣ, samePairMajorant F R ρ y) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ 2 * M * H := by + have h := mean_differenceMajorant_le (fun d => squareCharacterMass (fun χ => F χ d) ρ) R + (fun d => squareCharacterMass_nonneg _ (fun χ => hF χ d) ρ) hR + rw [squareCharacterMass_normalized_sum] at h + apply h.trans + apply mul_le_mul (squareCharacterMass_le_twice _ M hM hFm ρ) hRm + · exact div_nonneg (Finset.sum_nonneg fun d _ => hR d) (Nat.cast_nonneg _) + · positivity + +/-- Bounded sum over all indices for the same-pair majorant. -/ +theorem samePairMajorant_total_mean_le {p : ℕ} [Fact p.Prime] + (F : MulChar (ZMod p) ℂ → ZMod p → ℝ) (R : ZMod p → ℝ) + (hF : ∀ χ d, 0 ≤ F χ d) (hR : ∀ d, 0 ≤ R d) + (S H : ℝ) (hS : 0 ≤ S) + (hFs : (∑ χ : MulChar (ZMod p) ℂ, + (∑ d : ZMod p, F χ d) / (Fintype.card (ZMod p)ˣ : ℝ)) ≤ S) + (hRm : (∑ d : ZMod p, R d) / (Fintype.card (ZMod p)ˣ : ℝ) ≤ H) : + (∑ ρ : MulChar (ZMod p) ℂ, (∑ y : (ZMod p)ˣ, samePairMajorant F R ρ y) / + (Fintype.card (ZMod p)ˣ : ℝ)) ≤ S * H := by + calc + _ ≤ ∑ ρ : MulChar (ZMod p) ℂ, + squareCharacterMass (fun χ => (∑ d : ZMod p, F χ d) / + (Fintype.card (ZMod p)ˣ : ℝ)) ρ * + ((∑ d : ZMod p, R d) / (Fintype.card (ZMod p)ˣ : ℝ)) := by + apply Finset.sum_le_sum + intro ρ _ + have h := mean_differenceMajorant_le (fun d => squareCharacterMass (fun χ => F χ d) ρ) R + (fun d => squareCharacterMass_nonneg _ (fun χ => hF χ d) ρ) hR + rwa [squareCharacterMass_normalized_sum] at h + _ = (∑ χ : MulChar (ZMod p) ℂ, (∑ d : ZMod p, F χ d) / + (Fintype.card (ZMod p)ˣ : ℝ)) * + ((∑ d : ZMod p, R d) / (Fintype.card (ZMod p)ˣ : ℝ)) := by + rw [← Finset.sum_mul, sum_squareCharacterMass] + _ ≤ S * H := mul_le_mul hFs hRm + (div_nonneg (Finset.sum_nonneg fun d _ => hR d) (Nat.cast_nonneg _)) hS + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetPairMeasure.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetPairMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..908d7e06c241f364e2ac10dc6bd226def3461fb9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetPairMeasure.lean @@ -0,0 +1,90 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetAverage +import OAI.NumberTheory.Ostmann.Tree.SamePairMajorant + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.Tree.Quartet +open Density + +theorem average_fintype_eq {A : Type*} (i j : Fintype A) (f : A → ℝ) : + @average A i f = @average A j f := by + congr + exact Subsingleton.elim _ _ + +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] + +theorem inverse_square_average_domination (K : Fˣ) (H : Fˣ → ℝ) (hH : ∀ x, 0≤H x) : + average (fun z : Fˣ => H (K/z^2)) ≤ 2*average H := by + have he := (Equiv.inv Fˣ).bijective.sum_comp (fun z : Fˣ => H (K*z^2)) + have hh : average (fun z : Fˣ => H (K/z^2)) = average (fun z : Fˣ => H (K*z^2)) := by + unfold average + congr 1 + rw [hh] + have hs := square_average_domination K H hH + simp only [average_fintype_eq _ (inferInstance : Fintype Fˣ)] at hs + exact hs + +end Ostmann.Tree.Quartet +namespace Ostmann.FiniteField +open Ostmann.Tree.Density Ostmann.Tree.Quartet +variable {p : ℕ} [Fact p.Prime] + +theorem pairTest_square_mean (g : ZMod p → ℂ) (σ K : (ZMod p)ˣ) + (d : ZMod p) (hg0 : g 0=0) : + average (fun h : (ZMod p)ˣ => ‖pairTest g σ d (((K*h^2:(ZMod p)ˣ):ZMod p)*d)‖^2) ≤ + 2*pairSecondMoment g σ d := by + by_cases hd : d=0 + · subst d + simp [pairTest_zero g σ hg0, pairSecondMoment_zero g σ hg0, average] + let D : (ZMod p)ˣ := Units.mk0 d hd + have he (h : (ZMod p)ˣ) : (((K*h^2:(ZMod p)ˣ):ZMod p)*d) = (K*D*h^2:(ZMod p)ˣ) := by + simp only [Units.val_mul, Units.val_pow_eq_pow_val, D, Units.val_mk0] + ring + simp_rw [he] + have hs := square_average_domination (K*D) (fun t : (ZMod p)ˣ => ‖pairTest g σ d t‖^2) + (fun _ => sq_nonneg _) + simp only [average_fintype_eq _ (inferInstance : Fintype (ZMod p)ˣ)] at hs + exact hs + +theorem pairTest_inverse_square_bound (g : ZMod p → ℂ) (σ K : (ZMod p)ˣ) + (d : ZMod p) (ρ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) : + ‖mellin (fun z : (ZMod p)ˣ => pairTest g σ d (((K/z^2:(ZMod p)ˣ):ZMod p)*d)) ρ‖^2 ≤ + 2*pairSquareEnergy g σ ρ⁻¹ d := by + classical + by_cases hd : d=0 + · subst d + simp [pairTest_zero g σ hg0, mellin, pairSquareEnergy, deletedPairEnergy] + let D : (ZMod p)ˣ := Units.mk0 d hd + have he (z : (ZMod p)ˣ) : (((K/z^2:(ZMod p)ˣ):ZMod p)*d) = (K*D/z^2:(ZMod p)ˣ) := by + simp only [Units.val_div_eq_div_val, Units.val_mul, Units.val_pow_eq_pow_val, D, Units.val_mk0] + ring + simp_rw [he] + have hb := mellin_inverse_square_pullback (fun t : (ZMod p)ˣ => pairTest g σ d t) (K*D) ρ + have hm (χ : MulChar (ZMod p) ℂ) : + mellin (fun t : (ZMod p)ˣ => pairTest g σ d t) χ = pairSpectrum g χ ((σ:ZMod p)*d) := by + simpa only [Units.val_one, mul_one, map_one, one_mul] using pairTest_mellin_mul g σ 1 χ d hd hg0 + simp_rw [hm] at hb + simpa only [pairSquareEnergy, deletedPairEnergy, hd, ↓reduceIte] using hb + +theorem pairMobius_sum_real (y : (ZMod p)ˣ) (H : ZMod p → ℝ) + (h0 : H 0=0) (hy : H y=0) : + (∑ t : ZMod p,H (pairMobiusValue y t)) = ∑ d : ZMod p,H d := by + have he := pairMobius_sum y (fun d => (H d:ℂ)) (by simp only [h0, Complex.ofReal_zero]) + (by simp only [hy, Complex.ofReal_zero]) + exact_mod_cast he + +theorem mobius_inverse_square_mean (y K : (ZMod p)ˣ) (H : ZMod p → ℝ) + (hH : ∀ d,0≤H d) (h0 : H 0=0) (hy : H y=0) : + average (fun B : (ZMod p)ˣ => H (pairMobiusValue y (K/B^2 : (ZMod p)ˣ))) ≤ + 2*((Fintype.card (ZMod p)ˣ:ℝ)⁻¹*∑ d : ZMod p,H d) := by + have hs := inverse_square_average_domination K (fun r => H (pairMobiusValue y r)) + (fun r => hH _) + have hz : H (pairMobiusValue y 0)=0 := by simpa only [pairMobiusValue,mul_zero,zero_div] using h0 + simpa only [average, sum_units_of_zero (fun t : ZMod p => H (pairMobiusValue y t)) hz, pairMobius_sum_real y H h0 hy] using hs + +end Ostmann.FiniteField +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetPairValues.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetPairValues.lean new file mode 100644 index 0000000000000000000000000000000000000000..15506387fb955333d7dca0d1cc0c4fe84023b834 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetPairValues.lean @@ -0,0 +1,93 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetCoordinates + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +open scoped ComplexConjugate +variable {F : Type*} [Field F] + +theorem pair_coordinates_of_difference (σ d x z : Fˣ) + (hd : (x:F)-(z:F)=(σ:F)*d) : + Ostmann.FiniteField.pairFirst σ (d:F) ((x/z:Fˣ):F) = (x:F) ∧ + Ostmann.FiniteField.pairSecond σ (d:F) ((x/z:Fˣ):F) = (z:F) := by + have hdiff : (x:F)-(z:F) ≠ 0 := by + rw [hd] + exact mul_ne_zero (Units.ne_zero σ) (Units.ne_zero d) + have hratio : (x:F)/(z:F)-1 = ((x:F)-(z:F))/(z:F) := by + field_simp + constructor + · simp only [Ostmann.FiniteField.pairFirst, Units.val_div_eq_div_val] + rw [← hd, hratio] + field_simp + · simp only [Ostmann.FiniteField.pairSecond, Units.val_div_eq_div_val] + rw [← hd, hratio] + field_simp + +def signedFunction (g : F → ℂ) (sign : Bool) : F → ℂ := + if sign then fun x => conj (g x) else g + +def pairValue (g : F → ℂ) (sign : Bool) (σ : Fˣ) (d t : F) : ℂ := + signedFunction g sign (Ostmann.FiniteField.pairFirst σ d t) * + conj (signedFunction g sign (Ostmann.FiniteField.pairSecond σ d t)) + +namespace NodeInput +variable {d : ℕ} + +theorem pair_coordinates_left (N : NodeInput F d) (hp : N.pivot ≠ 0) : + Ostmann.FiniteField.pairFirst (1:Fˣ) (N.argument:F) + ((N.leftArgument hp/N.rightArgument hp:Fˣ):F) = (N.leftArgument hp:F) ∧ + Ostmann.FiniteField.pairSecond (1:Fˣ) (N.argument:F) + ((N.leftArgument hp/N.rightArgument hp:Fˣ):F) = (N.rightArgument hp:F) := by + apply pair_coordinates_of_difference + simpa only [Units.val_one, one_mul] using argument_difference N hp + +theorem pair_coordinates_right (N : NodeInput F d) (hp : N.pivot ≠ 0) : + Ostmann.FiniteField.pairFirst (-1:Fˣ) (N.argument:F) + ((N.rightArgument hp/N.leftArgument hp:Fˣ):F) = (N.rightArgument hp:F) ∧ + Ostmann.FiniteField.pairSecond (-1:Fˣ) (N.argument:F) + ((N.rightArgument hp/N.leftArgument hp:Fˣ):F) = (N.leftArgument hp:F) := by + apply pair_coordinates_of_difference + have h := argument_difference N hp + simpa only [Units.val_neg, Units.val_one, neg_one_mul, neg_sub] using congrArg Neg.neg h + +def leafSign (P : Parameters F 0) : Bool := + match P with | .leaf _ c => c + +theorem bottom_evaluate_left (N : NodeInput F 0) (hp : N.pivot ≠ 0) + (hopp : N.parameters.bottomOpposite) (g : F → ℂ) (incoming : F) : + N.parameters.evaluate g N.D N.Xleft N.Xright incoming N.leaves = + pairValue g (leafSign N.left) 1 (N.argument:F) + ((N.leftArgument hp/N.rightArgument hp:Fˣ):F) := by + rw [evaluate_eq N hp g incoming] + unfold pairValue + rw [(pair_coordinates_left N hp).1, (pair_coordinates_left N hp).2] + cases hl : N.left with + | leaf sl cl => + cases hr : N.right with + | leaf sr cr => + simp only [parameters, hl, hr, Parameters.bottomOpposite] at hopp + simp only [Parameters.evaluate, leafSign] + cases cl <;> cases cr <;> simp_all [signedFunction] + +theorem bottom_evaluate_right (N : NodeInput F 0) (hp : N.pivot ≠ 0) + (hopp : N.parameters.bottomOpposite) (g : F → ℂ) (incoming : F) : + N.parameters.evaluate g N.D N.Xleft N.Xright incoming N.leaves = + pairValue g (leafSign N.right) (-1) (N.argument:F) + ((N.rightArgument hp/N.leftArgument hp:Fˣ):F) := by + rw [evaluate_eq N hp g incoming] + unfold pairValue + rw [(pair_coordinates_right N hp).1, (pair_coordinates_right N hp).2] + cases hl : N.left with + | leaf sl cl => + cases hr : N.right with + | leaf sr cr => + simp only [parameters, hl, hr, Parameters.bottomOpposite] at hopp + simp only [Parameters.evaluate, leafSign] + cases cl <;> cases cr <;> simp_all [signedFunction, mul_comm] + +end NodeInput +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetProductFiber.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetProductFiber.lean new file mode 100644 index 0000000000000000000000000000000000000000..5cc091208c048b1b33666e56c6eeae491f2cbcaa --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetProductFiber.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetFamily + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +open scoped BigOperators +variable {F : Type*} [Field F] + +def pairLeaf (M : Leaves 1 → Fˣ) (side : Bool) : Fˣ := M (fun _ => side) + +theorem pairLeaf_free (a : Bool) (free held : Fˣ) : + pairLeaf (pairAssignment a free held) a = free := by + cases a <;> simp [pairLeaf, pairAssignment, Density.join] + +theorem pairLeaf_held (a : Bool) (free held : Fˣ) : + pairLeaf (pairAssignment a free held) (!a) = held := by + cases a <;> simp [pairLeaf, pairAssignment, Density.join] + +theorem pairAssignment_recover (a : Bool) (M : Leaves 1 → Fˣ) : + pairAssignment a (pairLeaf M a) (pairLeaf M (!a)) = M := by + funext v + have hv : v = fun _ => v 0 := by + funext i + exact congrArg v (Subsingleton.elim i 0) + cases a <;> cases h : v 0 <;> + simp only [pairAssignment, Bool.false_eq_true, ↓reduceIte, Density.join, + h, Bool.not_false, Bool.not_true, pairLeaf] <;> + apply congrArg M <;> simpa only [h] using hv.symm + +theorem leafProduct_pairLeaf (a : Bool) (M : Leaves 1 → Fˣ) : + Parameters.leafProduct M = pairLeaf M a * pairLeaf M (!a) := by + rw [← leafProduct_pairAssignment, pairAssignment_recover] + +def crossFiberEquiv (a b : Bool) (m : Fˣ) : + (Fˣ × Fˣ × Fˣ) ≃ {M : Leaves 2 → Fˣ // Parameters.leafProduct M = m} where + toFun x := ⟨crossAssignment a b m x.1 x.2.1 x.2.2, + product_crossAssignment a b m x.1 x.2.1 x.2.2⟩ + invFun M := (pairLeaf (Density.left M.val) (!a), + pairLeaf (Density.right M.val) (!b), pairLeaf (Density.left M.val) a) + left_inv x := by + rcases x with ⟨h,k,z⟩ + simp only [crossAssignment, Density.left_join, Density.right_join, + pairLeaf_free, pairLeaf_held] + right_inv M := by + apply Subtype.ext + have hm := M.property + rw [Density.leafProduct_split, leafProduct_pairLeaf a, leafProduct_pairLeaf b] at hm + have hf : m / (pairLeaf (Density.left M.val) a * pairLeaf (Density.left M.val) (!a) * + pairLeaf (Density.right M.val) (!b)) = pairLeaf (Density.right M.val) b := by + apply (div_eq_iff_eq_mul).2 + exact hm.symm.trans (by ac_rfl) + change Density.join + (pairAssignment a (pairLeaf (Density.left M.val) a) (pairLeaf (Density.left M.val) (!a))) + (pairAssignment b _ (pairLeaf (Density.right M.val) (!b))) = M.val + rw [hf, pairAssignment_recover, pairAssignment_recover, Density.join_left_right] + +theorem crossFiberEquiv_apply (a b : Bool) (m h k z : Fˣ) : + ((crossFiberEquiv a b m) (h,k,z)).val = crossAssignment a b m h k z := rfl + +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetRatioConvolution.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetRatioConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..315c72fbb1c5e64176c1cba737296f72425b1f35 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetRatioConvolution.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetMobiusMellin +import OAI.NumberTheory.Ostmann.Tree.TwoPairConvolution + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def twoPairRatioValue (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (lam mu y r : (ZMod p)ˣ) : ℂ := + let d := pairMobiusValue y r + let e := d-(y:ZMod p) + pairTest g σ d ((lam:ZMod p)*L.multiplier d e) * + pairTest h τ e ((mu:ZMod p)*R.multiplier e d) + +theorem twoPairRatio_mellin (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (lam mu y : (ZMod p)ˣ) (χ : MulChar (ZMod p) ℂ) + (hg0 : g 0=0) : + mellin (twoPairRatioValue g h σ τ L R lam mu y) χ = + ((p:ℂ)/(Fintype.card (ZMod p)ˣ:ℂ)) * + twoPairConvolution g h σ τ L R χ⁻¹ lam mu y := by + let H : ZMod p → ℂ := fun d => + pairTest g σ d ((lam:ZMod p)*L.multiplier d (d-(y:ZMod p))) * + pairTest h τ (d-(y:ZMod p)) ((mu:ZMod p)*R.multiplier (d-(y:ZMod p)) d) + have hH0 : H 0=0 := by + simp [H,pairTest,pairFirst,pairSecond,hg0] + have hm := mellin_mobius_pullback H y χ hH0 + change mellin (twoPairRatioValue g h σ τ L R lam mu y) χ = + (Fintype.card (ZMod p)ˣ:ℂ)⁻¹ * ∑ d : ZMod p, H d*(χ⁻¹ d*χ (d-(y:ZMod p))) at hm + rw [hm] + have hp0 : (p:ℂ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.Prime.ne_zero (Fact.out : p.Prime)) + have hN0 : (Fintype.card (ZMod p)ˣ:ℂ) ≠ 0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero + simp only [twoPairConvolution, mean, twoPairValue, inv_inv] + change (Fintype.card (ZMod p)ˣ:ℂ)⁻¹ * ∑ d : ZMod p, H d*(χ⁻¹ d*χ (d-(y:ZMod p))) = + ((p:ℂ)/(Fintype.card (ZMod p)ˣ:ℂ)) * + ((p:ℂ)⁻¹ * ∑ d : ZMod p, H d*(χ⁻¹ d*χ (d-(y:ZMod p)))) + field_simp + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetRemainingMeans.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetRemainingMeans.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc1b3a6833fa3f056b35b7560276d5c6a48d3e49 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetRemainingMeans.lean @@ -0,0 +1,95 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetUniformMeans + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +open Ostmann.Tree.Quartet Ostmann.Tree.Quartet.NodeInput +variable {p : ℕ} [Fact p.Prime] + +def sameLocalMajorant (g : ZMod p → ℂ) (c d neg : Bool) + (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : ℝ := + 8*samePairMajorant (signedFunction g c) (signedFunction g d) 1 1 ρ⁻¹ + (if neg then -y else y) + +def untouchedLocalMajorant (g : ZMod p → ℂ) (c d : Bool) (y : ZMod p) : ℝ := + 8*untouchedMajorant (signedFunction g c) (signedFunction g d) 1 1 y + +theorem sameLocalMajorant_nonneg (g : ZMod p → ℂ) (c d neg : Bool) + (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : 0 ≤ sameLocalMajorant g c d neg ρ y := + mul_nonneg (by positivity) (samePairMajorant_nonneg _ _ _ _ _ _) + +theorem untouchedLocalMajorant_nonneg (g : ZMod p → ℂ) (c d : Bool) + (y : ZMod p) : 0≤untouchedLocalMajorant g c d y := + mul_nonneg (by positivity) (untouchedMajorant_nonneg _ _ _ _ _) + +theorem sameLocalMajorant_mean_eq (g : ZMod p → ℂ) (c d neg : Bool) + (ρ : MulChar (ZMod p) ℂ) : + unitMean (sameLocalMajorant g c d neg ρ)= + 8*unitMean (samePairMajorant (signedFunction g c) (signedFunction g d) 1 1 ρ⁻¹) := by + unfold sameLocalMajorant + rw [unitMean_const_mul] + cases neg + · rfl + · simp only [ite_true] + rw [unitMean_neg] + +theorem sameLocalMajorant_mean_small (g : ZMod p → ℂ) (c d neg : Bool) + (ρ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) : + unitMean (sameLocalMajorant g c d neg ρ)≤512*treeError g := by + let C : ℝ := (p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ) + have hC0 : 0≤C := by dsimp [C]; positivity + have hC2 : C≤2 := unitRatio_le_two + have hc5 : C^5≤32 := by nlinarith [pow_le_pow_left₀ hC0 hC2 5] + have hs := samePairMajorant_mean_small (signedFunction g c) (signedFunction g d) + 1 1 ρ⁻¹ (signedFunction_zero g hg0 c) (by simpa only [l2Sq_signedFunction] using hg) + (signedFunction_zero g hg0 d) (by simpa only [l2Sq_signedFunction] using hg) + simp only [correlationBound_signedFunction] at hs + rw [sameLocalMajorant_mean_eq] + calc + _ ≤ 8*(2*C^5*(correlationBound g:ℝ)^2) := mul_le_mul_of_nonneg_left hs (by norm_num) + _ ≤ 512*(correlationBound g:ℝ)^2 := by + nlinarith [mul_le_mul_of_nonneg_right hc5 (sq_nonneg (correlationBound g:ℝ))] + _ ≤ 512*treeError g := by unfold treeError; nlinarith [Real.sqrt_nonneg (3/(p:ℝ))] + +theorem sameLocalMajorant_mean_total (g : ZMod p → ℂ) (c d neg : Bool) + (hg0 : g 0=0) (hg : l2Sq g≤1) : + (∑ ρ : MulChar (ZMod p) ℂ,unitMean (sameLocalMajorant g c d neg ρ))≤256 := by + classical + let C : ℝ := (p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ) + have hC0 : 0≤C := by dsimp [C]; positivity + have hC2 : C≤2 := unitRatio_le_two + have hc4 : C^4≤16 := by nlinarith [pow_le_pow_left₀ hC0 hC2 4] + have hs := samePairMajorant_mean_total (signedFunction g c) (signedFunction g d) + 1 1 (signedFunction_zero g hg0 c) (by simpa only [l2Sq_signedFunction] using hg) + (signedFunction_zero g hg0 d) (by simpa only [l2Sq_signedFunction] using hg) + simp_rw [sameLocalMajorant_mean_eq] + rw [← Finset.mul_sum] + have he := (Equiv.inv (MulChar (ZMod p) ℂ)).bijective.sum_comp + (fun ρ => unitMean (samePairMajorant (signedFunction g c) (signedFunction g d) 1 1 ρ)) + simp only [Equiv.inv_apply] at he + rw [he] + calc + _ ≤ 8*(2*C^4) := mul_le_mul_of_nonneg_left hs (by norm_num) + _ ≤ 256 := by nlinarith + +theorem untouchedLocalMajorant_mean (g : ZMod p → ℂ) (c d : Bool) + (hg0 : g 0=0) (hg : l2Sq g≤1) : unitMean (untouchedLocalMajorant g c d)≤128 := by + let C : ℝ := (p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ) + have hC0 : 0≤C := by dsimp [C]; positivity + have hC2 : C≤2 := unitRatio_le_two + have hc4 : C^4≤16 := by nlinarith [pow_le_pow_left₀ hC0 hC2 4] + have hs := untouchedMajorant_mean (signedFunction g c) (signedFunction g d) + 1 1 (signedFunction_zero g hg0 c) (by simpa only [l2Sq_signedFunction] using hg) + (signedFunction_zero g hg0 d) (by simpa only [l2Sq_signedFunction] using hg) + unfold untouchedLocalMajorant + rw [unitMean_const_mul] + calc + _ ≤ 8*C^4 := mul_le_mul_of_nonneg_left hs (by norm_num) + _ ≤ 128 := by nlinarith + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetSameBound.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetSameBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..f129f2da96bb21a22be3a5e014abb26f6436092d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetSameBound.lean @@ -0,0 +1,101 @@ +import OAI.NumberTheory.Ostmann.Tree.QuartetBlockFamily +import OAI.NumberTheory.Ostmann.Tree.QuartetBlockRoot + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.Tree.Quartet +open Density +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] + +theorem block_fiber_average (m : Fˣ) (f : (Leaves 2 → Fˣ) → ℝ) : + average (fun M : {M : Leaves 2 → Fˣ // Parameters.leafProduct M=m} => f M.val) = + average (fun B : Fˣ => average (fun h : Fˣ => average (fun k : Fˣ => + f (blockAssignment m B h k)))) := by + classical + rw [← real_average_equiv (blockFiberEquiv m) (fun M => f M.val)] + change average (fun x : Fˣ × Fˣ × Fˣ => f (blockAssignment m x.1 x.2.1 x.2.2)) = _ + rw [real_average_prod (fun B (t : Fˣ × Fˣ) => f (blockAssignment m B t.1 t.2))] + have ht (B : Fˣ) : + average (fun t : Fˣ × Fˣ => f (blockAssignment m B t.1 t.2)) = + average (fun h : Fˣ => average (fun k : Fˣ => f (blockAssignment m B h k))) := + real_average_prod (fun h k => f (blockAssignment m B h k)) + simp_rw [ht] + +namespace NodeInput +open Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] + +def sameLocalMajorant (N : NodeInput (ZMod p) 1) (g : ZMod p → ℂ) + (side : Bool) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : ℝ := + if side then + 8*samePairMajorant (signedFunction g (parameterSign N.right false)) + (signedFunction g (parameterSign N.left false)) 1 1 ρ⁻¹ (-y) + else + 8*samePairMajorant (signedFunction g (parameterSign N.left false)) + (signedFunction g (parameterSign N.right false)) 1 1 ρ⁻¹ y + +def untouchedLocalMajorant (N : NodeInput (ZMod p) 1) (g : ZMod p → ℂ) + (y : ZMod p) : ℝ := + 8*untouchedMajorant (signedFunction g (parameterSign N.left false)) + (signedFunction g (parameterSign N.right false)) 1 1 y + +theorem sameLocalMajorant_nonneg (N : NodeInput (ZMod p) 1) (g : ZMod p → ℂ) + (side : Bool) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : + 0 ≤ N.sameLocalMajorant g side ρ y := by + cases side <;> exact mul_nonneg (by norm_num) (samePairMajorant_nonneg _ _ _ _ _ _) + +theorem untouchedLocalMajorant_nonneg (N : NodeInput (ZMod p) 1) (g : ZMod p → ℂ) + (y : ZMod p) : 0 ≤ N.untouchedLocalMajorant g y := + mul_nonneg (by norm_num) (untouchedMajorant_nonneg _ _ _ _ _) + +theorem sameAction_fiber_bound (N : NodeInput (ZMod p) 1) + (hcons : N.parameters.consistent) (hopp : N.parameters.bottomOpposite) + (g : ZMod p → ℂ) (hg0 : g 0=0) (side : Bool) (m : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) : + average (fun M : {M : Leaves 2 → (ZMod p)ˣ // Parameters.leafProduct M=m} => + ‖mellin (fun z : (ZMod p)ˣ => N.parameters.evaluate g N.D N.Xleft N.Xright 0 + (moveSame M.val side z)) ρ‖^2) ≤ N.sameLocalMajorant g side ρ (N.familyRoot m) := by + classical + rw [block_fiber_average m (fun M => + ‖mellin (fun z : (ZMod p)ˣ => N.parameters.evaluate g N.D N.Xleft N.Xright 0 + (moveSame M side z)) ρ‖^2)] + cases side with + | false => + simp_rw [moveSame_block_left, blockFamily_value N hcons hopp g hg0] + simpa only [sameLocalMajorant, Bool.false_eq_true, ↓reduceIte, heldPairValue, + blockLeftArgument, blockRightArgument] using + twoPair_same_left_root (signedFunction g (parameterSign N.left false)) + (signedFunction g (parameterSign N.right false)) 1 1 + (N.leftLambda m false) (N.rightLambda m false) (N.familyRoot m) + (N.familyRatioConstant m 1) ρ (signedFunction_zero g hg0 _) (signedFunction_zero g hg0 _) + | true => + simp_rw [moveSame_block_right, blockFamily_value N hcons hopp g hg0] + simpa only [sameLocalMajorant, ↓reduceIte, heldPairValue, + blockLeftArgument, blockRightArgument] using + twoPair_same_right_root (signedFunction g (parameterSign N.left false)) + (signedFunction g (parameterSign N.right false)) 1 1 + (N.leftLambda m false) (N.rightLambda m false) (N.familyRoot m) + (N.familyRatioConstant m 1) ρ (signedFunction_zero g hg0 _) (signedFunction_zero g hg0 _) + +theorem untouched_fiber_bound (N : NodeInput (ZMod p) 1) + (hcons : N.parameters.consistent) (hopp : N.parameters.bottomOpposite) + (g : ZMod p → ℂ) (hg0 : g 0=0) (m : (ZMod p)ˣ) : + average (fun M : {M : Leaves 2 → (ZMod p)ˣ // Parameters.leafProduct M=m} => + ‖N.parameters.evaluate g N.D N.Xleft N.Xright 0 M.val‖^2) ≤ + N.untouchedLocalMajorant g (N.familyRoot m) := by + classical + rw [block_fiber_average m (fun M => ‖N.parameters.evaluate g N.D N.Xleft N.Xright 0 M‖^2)] + simp_rw [blockFamily_value N hcons hopp g hg0] + simpa only [untouchedLocalMajorant, heldPairValue, blockLeftArgument, blockRightArgument] using + twoPair_untouched_root (signedFunction g (parameterSign N.left false)) + (signedFunction g (parameterSign N.right false)) 1 1 + (N.leftLambda m false) (N.rightLambda m false) (N.familyRoot m) + (N.familyRatioConstant m 1) (signedFunction_zero g hg0 _) (signedFunction_zero g hg0 _) + +end NodeInput +end Ostmann.Tree.Quartet +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetSquareMeasure.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetSquareMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e8b694a8817fe9802edc090d2342836535934cd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetSquareMeasure.lean @@ -0,0 +1,74 @@ +import OAI.NumberTheory.Ostmann.Tree.DensityDomination + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +open scoped BigOperators +open Density +variable {F : Type*} [Field F] [Fintype F] +local instance : DecidableEq F := Classical.decEq F + +theorem square_coset_fiber_card (K y : Fˣ) : + (Finset.univ.filter (fun z : Fˣ => K*z^2=y)).card ≤ 2 := by + classical + let S := Finset.univ.filter (fun z : Fˣ => K*z^2=y) + by_cases hs : S.Nonempty + · obtain ⟨x,hx⟩ := hs + have hx' : K*x^2=y := (Finset.mem_filter.mp hx).2 + apply le_trans (Finset.card_le_card (t := {x,-x}) ?_) Finset.card_le_two + intro z hz + have hz' : K*z^2=y := (Finset.mem_filter.mp hz).2 + have he : z^2=x^2 := mul_left_cancel (hz'.trans hx'.symm) + rcases Units.sq_eq_sq_iff_eq_or_eq_neg.mp he with h | h <;> simp [h] + · exact (show S.card ≤ 2 by simp [Finset.not_nonempty_iff_eq_empty.mp hs]) + +theorem square_average_domination (K : Fˣ) (H : Fˣ → ℝ) (hH : ∀ y, 0 ≤ H y) : + average (fun z : Fˣ => H (K*z^2)) ≤ 2*average H := by + have hf : ∀ y, (Finset.univ.filter (fun z : Fˣ => some (K*z^2)=some y)).card ≤ 2 := by + intro y + simpa only [Option.some.injEq] using square_coset_fiber_card K y + have hsum := sum_integrate_le (fun z : Fˣ => some (K*z^2)) 2 hf H hH + simp only [integrate, Nat.cast_ofNat] at hsum + unfold average + calc + _ ≤ (Fintype.card Fˣ:ℝ)⁻¹*(2*∑ y,H y) := + mul_le_mul_of_nonneg_left hsum (inv_nonneg.mpr (Nat.cast_nonneg _)) + _ = _ := by ring + +theorem average_mono {A : Type*} [Fintype A] (f g : A → ℝ) + (h : ∀ x, f x ≤ g x) : average f ≤ average g := by + exact mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun x _ => h x)) + (inv_nonneg.mpr (Nat.cast_nonneg _)) + +theorem average_nonneg {A : Type*} [Fintype A] (f : A → ℝ) (h : ∀ x, 0 ≤ f x) : + 0 ≤ average f := by + exact mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg _)) (Finset.sum_nonneg (fun x _ => h x)) + +theorem average_const_mul {A : Type*} [Fintype A] (c : ℝ) (f : A → ℝ) : + average (fun x => c*f x) = c*average f := by + unfold average + rw [← Finset.mul_sum] + ring + +theorem independent_square_domination (K L : Fˣ) (H : Fˣ → Fˣ → ℝ) + (hH : ∀ x y, 0 ≤ H x y) : + average (fun x : Fˣ => average (fun y : Fˣ => H (K*x^2) (L*y^2))) ≤ + 4*average (fun x : Fˣ => average (fun y : Fˣ => H x y)) := by + calc + _ ≤ average (fun x : Fˣ => 2*average (fun y : Fˣ => H (K*x^2) y)) := by + apply average_mono + intro x + exact square_average_domination L (H (K*x^2)) (hH (K*x^2)) + _ = 2*average (fun x : Fˣ => average (fun y : Fˣ => H (K*x^2) y)) := + average_const_mul _ _ + _ ≤ 2*(2*average (fun x : Fˣ => average (fun y : Fˣ => H x y))) := by + apply mul_le_mul_of_nonneg_left _ (by norm_num) + exact square_average_domination K (fun x => average (H x)) + (fun x => average_nonneg (H x) (hH x)) + _ = _ := by ring + +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetUniformMeans.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetUniformMeans.lean new file mode 100644 index 0000000000000000000000000000000000000000..9a3859d3d09c29ff91eeabd4f1850c4acfbeb746 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetUniformMeans.lean @@ -0,0 +1,109 @@ +import OAI.NumberTheory.Ostmann.Tree.CorrelationSymmetry +import OAI.NumberTheory.Ostmann.Tree.QuartetFamilyPullback +import OAI.NumberTheory.Ostmann.Tree.SamePairMajorant +import OAI.NumberTheory.Ostmann.Tree.SquareMajorant + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +open Ostmann.Tree.Quartet Ostmann.Tree.Quartet.NodeInput +variable {p : ℕ} [Fact p.Prime] + +def treeError (g : ZMod p → ℂ) : ℝ := + (correlationBound g:ℝ)^2+Real.sqrt (3/(p:ℝ)) + +theorem treeError_nonneg (g : ZMod p → ℂ) : 0≤treeError g := by unfold treeError; positivity + +theorem unitRatio_le_two : (p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ)≤2 := by + have hp := (Fact.out : p.Prime).two_le + have hcard : (Fintype.card (ZMod p)ˣ:ℝ)=(p:ℝ)-1 := by + rw [ZMod.card_units,Nat.cast_sub (by omega),Nat.cast_one] + rw [hcard] + have hpR : (2:ℝ)≤p := by exact_mod_cast hp + apply (div_le_iff₀ (by linarith : 0<(p:ℝ)-1)).mpr + linarith + +theorem unitMean_const_mul (c : ℝ) (f : ZMod p → ℝ) : + unitMean (fun y => c*f y)=c*unitMean f := by + simp only [unitMean,Finset.mul_sum] + apply Finset.sum_congr rfl + intro y _ + ring + +theorem unitMean_neg (f : ZMod p → ℝ) : unitMean (fun y => f (-y))=unitMean f := by + unfold unitMean + congr 1 + simpa only [Equiv.neg_apply,Units.val_neg] using + (Equiv.neg (ZMod p)ˣ).bijective.sum_comp (fun y : (ZMod p)ˣ => f y) + +theorem l2Sq_signedFunction (g : ZMod p → ℂ) (c : Bool) : l2Sq (signedFunction g c)=l2Sq g := by + cases c <;> simp [signedFunction,l2Sq] + +theorem correlationBound_signedFunction (g : ZMod p → ℂ) (c : Bool) : + correlationBound (signedFunction g c)=correlationBound g := by + cases c + · rfl + · exact correlationBound_conj g + +theorem orientation_sq (a : Bool) : ((orientation a : (ZMod p)ˣ):ZMod p)^2=1 := by + cases a <;> simp [orientation] + +def crossLocalMajorant (g : ZMod p → ℂ) (c d a b : Bool) + (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : ℝ := + 8*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2* + crossSquareMajorant (signedFunction g c) (signedFunction g d) + (orientation a) (orientation b) (pairMode a) (pairMode b) ρ y + +theorem crossLocalMajorant_nonneg (g : ZMod p → ℂ) (c d a b : Bool) + (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : 0≤crossLocalMajorant g c d a b ρ y := + mul_nonneg (by positivity) (crossSquareMajorant_nonneg _ _ _ _ _ _ _ _) + +theorem crossLocalMajorant_mean_small (g : ZMod p → ℂ) (c d a b : Bool) + (ρ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) : + unitMean (crossLocalMajorant g c d a b ρ)≤25600*treeError g := by + let C : ℝ := (p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ) + have hC0 : 0≤C := by dsimp [C]; positivity + have hC2 : C≤2 := unitRatio_le_two + have hc3 : C^3≤8 := by nlinarith [pow_le_pow_left₀ hC0 hC2 3] + have hE := treeError_nonneg g + have hs := crossSquareMajorant_mean_small (signedFunction g c) (signedFunction g d) + (orientation a) (orientation b) (pairMode a) (pairMode b) ρ + (orientation_sq a) (orientation_sq b) (signedFunction_zero g hg0 c) + (by simpa only [l2Sq_signedFunction] using hg) (signedFunction_zero g hg0 d) + (by simpa only [l2Sq_signedFunction] using hg) + simp only [correlationBound_signedFunction] at hs + unfold crossLocalMajorant + rw [unitMean_const_mul] + calc + _ ≤ 8*C^2*(200*C*((correlationBound g:ℝ)^2+(correlationBound g:ℝ)^2+ + Real.sqrt (3/(p:ℝ)))) := mul_le_mul_of_nonneg_left hs (by positivity) + _ ≤ 3200*C^3*treeError g := by + dsimp [treeError] + nlinarith [mul_nonneg (pow_nonneg hC0 3) (Real.sqrt_nonneg (3/(p:ℝ)))] + _ ≤ 25600*treeError g := by nlinarith [mul_le_mul_of_nonneg_right hc3 hE] + +theorem crossLocalMajorant_mean_total (g : ZMod p → ℂ) (c d a b : Bool) + (hg0 : g 0=0) (hg : l2Sq g≤1) : + (∑ ρ : MulChar (ZMod p) ℂ,unitMean (crossLocalMajorant g c d a b ρ))≤128 := by + classical + let C : ℝ := (p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ) + have hC0 : 0≤C := by dsimp [C]; positivity + have hC2 : C≤2 := unitRatio_le_two + have hc4 : C^4≤16 := by nlinarith [pow_le_pow_left₀ hC0 hC2 4] + have hs := crossSquareMajorant_mean_total (signedFunction g c) (signedFunction g d) + (orientation a) (orientation b) (pairMode a) (pairMode b) + (signedFunction_zero g hg0 c) (by simpa only [l2Sq_signedFunction] using hg) + (signedFunction_zero g hg0 d) (by simpa only [l2Sq_signedFunction] using hg) + unfold crossLocalMajorant + simp_rw [unitMean_const_mul] + rw [← Finset.mul_sum] + calc + _ ≤ 8*C^2*C^2 := mul_le_mul_of_nonneg_left hs (by positivity) + _ ≤ 128 := by nlinarith + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuartetZero.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..56f3fad4d2e8e628d4daaf8e0629bbdde24c7f4b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuartetZero.lean @@ -0,0 +1,74 @@ +import OAI.NumberTheory.Ostmann.Tree.AffinePairIdentity +import OAI.NumberTheory.Ostmann.Tree.QuartetDiagram + +namespace OAI + +namespace Ostmann.Tree.Quartet +noncomputable section +variable {F : Type*} [Field F] + +namespace NodeInput +variable {d : ℕ} + +theorem ratio_eq_one_of_pivot_zero (N : NodeInput F d) (hp : N.pivot=0) : + ratio N.left.frequency N.right.frequency N.leftFactor N.rightFactor = 1 := by + have hd : (N.s:F)*N.u ≠ 0 := mul_ne_zero (Units.ne_zero _) (Units.ne_zero _) + have he := congrArg (fun x : F => x*((N.s:F)*N.u)) hp + change (((N.left.frequency:F)*N.rightFactor-(N.right.frequency:F)*N.leftFactor)/ + ((N.s:F)*N.u))*((N.s:F)*N.u) = 0*((N.s:F)*N.u) at he + rw [div_mul_cancel₀ _ hd, zero_mul] at he + have hn : (N.left.frequency:F)*N.rightFactor=(N.right.frequency:F)*N.leftFactor := sub_eq_zero.mp he + apply Units.ext + simp only [ratio, Units.val_div_eq_div_val, Units.val_mul, Units.val_one] + exact (div_eq_one_iff_eq (mul_ne_zero (Units.ne_zero _) (Units.ne_zero _))).mpr hn + +def factorRatio (N : NodeInput F d) (freeRight : Bool) : Fˣ := + if freeRight then ratio N.right.frequency N.left.frequency N.rightFactor N.leftFactor + else ratio N.left.frequency N.right.frequency N.leftFactor N.rightFactor + +theorem reversed_ratio (sf sh Hf Hh : Fˣ) : + ratio sh sf Hh Hf = (ratio sf sh Hf Hh)⁻¹ := by + simp [ratio, div_eq_mul_inv, mul_comm] + +theorem factorRatio_zero (N : NodeInput F d) (hp : N.pivot=0) (freeRight : Bool) : + N.factorRatio freeRight = 1 := by + cases freeRight + · exact ratio_eq_one_of_pivot_zero N hp + · change ratio N.right.frequency N.left.frequency N.rightFactor N.leftFactor = 1 + rw [reversed_ratio, ratio_eq_one_of_pivot_zero N hp, inv_one] + +theorem orientedRatio_eq_factorRatio (N : NodeInput F 0) (hp : N.pivot ≠ 0) + (freeRight : Bool) : N.orientedRatio hp freeRight = N.factorRatio freeRight := by + cases freeRight + · exact actual_child_ratio N hp + · change N.rightArgument hp/N.leftArgument hp = + ratio N.right.frequency N.left.frequency N.rightFactor N.leftFactor + rw [leftArgument_eq, rightArgument_eq, child_ratio] + +theorem signedFunction_zero (g : F → ℂ) (hg0 : g 0=0) (sign : Bool) : + signedFunction g sign 0=0 := by + cases sign <;> simp [signedFunction, hg0] + +theorem bottom_evaluate_all (N : NodeInput F 0) (hopp : N.parameters.bottomOpposite) + (g : F → ℂ) (hg0 : g 0=0) (incoming : F) (freeRight : Bool) : + N.parameters.evaluate g N.D N.Xleft N.Xright incoming N.leaves = + pairValue g (N.orientedSign freeRight) (orientation freeRight) (N.argument:F) + (N.factorRatio freeRight:F) := by + classical + by_cases hp : N.pivot=0 + · rw [evaluate_eq_zero N hp g incoming, factorRatio_zero N hp freeRight] + simp [pairValue, Ostmann.FiniteField.pairFirst, Ostmann.FiniteField.pairSecond, + signedFunction_zero g hg0] + · rw [bottom_evaluate_oriented N hp hopp g incoming freeRight, + orientedRatio_eq_factorRatio] + +end NodeInput + +theorem pairValue_eq_pairTest {p : ℕ} [Fact p.Prime] (g : ZMod p → ℂ) (sign : Bool) + (σ : (ZMod p)ˣ) (d t : ZMod p) : + pairValue g sign σ d t = Ostmann.FiniteField.pairTest (signedFunction g sign) σ d t := rfl + +end +end Ostmann.Tree.Quartet + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuarticCollision.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuarticCollision.lean new file mode 100644 index 0000000000000000000000000000000000000000..3762f8e32a9103c0b4823aa063a5d447c0c7b354 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuarticCollision.lean @@ -0,0 +1,45 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +variable {F : Type*} [Field F] + +theorem pair_sum_product_identifies {b₁ b₂ b₃ b₄ : F} + (hs : b₁+b₂=b₃+b₄) (hp : b₁*b₂=b₃*b₄) : + (b₁=b₃ ∧ b₂=b₄) ∨ (b₁=b₄ ∧ b₂=b₃) := by + have hz : (b₁-b₃)*(b₁-b₄)=0 := by + linear_combination b₁*hs-hp + rcases mul_eq_zero.mp hz with h | h + · left + have h13 := sub_eq_zero.mp h + exact ⟨h13, by linear_combination hs-h13⟩ + · right + have h14 := sub_eq_zero.mp h + exact ⟨h14, by linear_combination hs-h14⟩ + +theorem quartet_collision_two_roots {b₁ b₂ b₃ b₄ a a' : F} + (ha : (a-b₁)*(a-b₂)=(a-b₃)*(a-b₄)) + (ha' : (a'-b₁)*(a'-b₂)=(a'-b₃)*(a'-b₄)) (hne : a ≠ a') : + (b₁=b₃ ∧ b₂=b₄) ∨ (b₁=b₄ ∧ b₂=b₃) := by + have hm : (a-a')*((b₁+b₂)-(b₃+b₄))=0 := by linear_combination ha'-ha + have hs : b₁+b₂=b₃+b₄ := sub_eq_zero.mp + ((mul_eq_zero.mp hm).resolve_left (sub_ne_zero.mpr hne)) + have hp : b₁*b₂=b₃*b₄ := by linear_combination ha+a*hs + exact pair_sum_product_identifies hs hp + +theorem quartet_collision_card_le_one [Fintype F] [DecidableEq F] + (b₁ b₂ b₃ b₄ : F) + (hdiag : ¬((b₁=b₃ ∧ b₂=b₄) ∨ (b₁=b₄ ∧ b₂=b₃))) : + (Finset.univ.filter (fun a : F => (a-b₁)*(a-b₂)=(a-b₃)*(a-b₄))).card ≤ 1 := by + apply Finset.card_le_one.mpr + intro a ha a' ha' + by_contra hne + exact hdiag (quartet_collision_two_roots (Finset.mem_filter.mp ha).2 + (Finset.mem_filter.mp ha').2 hne) + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/QuarticWeighted.lean b/lean/OAI/NumberTheory/Ostmann/Tree/QuarticWeighted.lean new file mode 100644 index 0000000000000000000000000000000000000000..a6cd5a958572f3187be715d96904d536e7c9505b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/QuarticWeighted.lean @@ -0,0 +1,100 @@ +import OAI.NumberTheory.Ostmann.Tree.QuarticCollision + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] + +abbrev Quartet (F : Type*) := (F × F) × (F × F) +def quartetWeight (w : F → ℝ) (b : Quartet F) : ℝ := + w b.1.1*w b.1.2*w b.2.1*w b.2.2 + +abbrev quartetDiagonal (b : Quartet F) : Prop := + (b.1.1=b.2.1 ∧ b.1.2=b.2.2) ∨ (b.1.1=b.2.2 ∧ b.1.2=b.2.1) + +abbrev quartetCollision (a : F) (b : Quartet F) : Prop := + (a-b.1.1)*(a-b.1.2)=(a-b.2.1)*(a-b.2.2) + +omit [Field F] [Fintype F] [DecidableEq F] in +theorem quartetWeight_nonneg (w : F → ℝ) (hw : ∀ x, 0 ≤ w x) (b : Quartet F) : + 0 ≤ quartetWeight w b := by + exact mul_nonneg (mul_nonneg (mul_nonneg (hw _) (hw _)) (hw _)) (hw _) + +omit [Field F] [DecidableEq F] in +theorem quartetWeight_sum (w : F → ℝ) : + (∑ b : Quartet F, quartetWeight w b) = (∑ x, w x)^4 := by + simp only [quartetWeight,Fintype.sum_prod_type] + simp only [← Finset.mul_sum, ← Finset.sum_mul] + ring + +omit [Field F] in +theorem quartetWeight_diagonal_sum (w : F → ℝ) (hw : ∀ x, 0 ≤ w x) : + (∑ b : Quartet F, if quartetDiagonal b then quartetWeight w b else 0) ≤ + 2*(∑ x, w x^2)^2 := by + classical + have hpoint (b : Quartet F) : + (if quartetDiagonal b then quartetWeight w b else 0) ≤ + (if b.1=b.2 then quartetWeight w b else 0)+ + (if b.1=b.2.swap then quartetWeight w b else 0) := by + have h1 : b.1=b.2 ↔ b.1.1=b.2.1 ∧ b.1.2=b.2.2 := Prod.ext_iff + have h2 : b.1=b.2.swap ↔ b.1.1=b.2.2 ∧ b.1.2=b.2.1 := Prod.ext_iff + have hW := quartetWeight_nonneg w hw b + simp only [h1,h2,quartetDiagonal] + split_ifs <;> simp_all + have hfirst : (∑ b : Quartet F, if b.1=b.2 then quartetWeight w b else 0) = + (∑ x, w x^2)^2 := by + rw [Fintype.sum_prod_type] + simp only [Finset.sum_ite_eq, Finset.mem_univ, ite_true, quartetWeight] + rw [Fintype.sum_prod_type] + have he (x y : F) : w x*w y*w x*w y = w x^2*w y^2 := by ring + simp_rw [he] + simp only [← Finset.mul_sum,← Finset.sum_mul,pow_two] + have hsecond : (∑ b : Quartet F, if b.1=b.2.swap then quartetWeight w b else 0) = + (∑ x, w x^2)^2 := by + rw [Fintype.sum_prod_type,Finset.sum_comm] + simp only [Finset.sum_ite_eq', Finset.mem_univ, ite_true, quartetWeight, Prod.fst_swap,Prod.snd_swap] + rw [Fintype.sum_prod_type] + have he (x y : F) : w y*w x*w x*w y = w x^2*w y^2 := by ring + simp_rw [he] + simp only [← Finset.mul_sum,← Finset.sum_mul,pow_two] + calc + _ ≤ ∑ b : Quartet F, ((if b.1=b.2 then quartetWeight w b else 0)+ + (if b.1=b.2.swap then quartetWeight w b else 0)) := Finset.sum_le_sum (fun b _ => hpoint b) + _ = 2*(∑ x, w x^2)^2 := by rw [Finset.sum_add_distrib,hfirst,hsecond]; ring + +theorem quartetCollision_weighted_bound (w : F → ℝ) (hw : ∀ x, 0 ≤ w x) : + (∑ a : F, ∑ b : Quartet F, if quartetCollision a b then quartetWeight w b else 0) ≤ + 2*(Fintype.card F:ℝ)*(∑ x, w x^2)^2+(∑ x, w x)^4 := by + classical + have hpoint (b : Quartet F) : + (∑ a : F, if quartetCollision a b then quartetWeight w b else 0) ≤ + (Fintype.card F:ℝ)*(if quartetDiagonal b then quartetWeight w b else 0)+quartetWeight w b := by + have hw0 := quartetWeight_nonneg w hw b + rw [← Finset.sum_filter,Finset.sum_const,nsmul_eq_mul] + by_cases hd : quartetDiagonal b + · simp only [hd,ite_true] + have hc : (Finset.univ.filter (fun a : F => quartetCollision a b)).card ≤ Fintype.card F := + (Finset.card_le_card (Finset.filter_subset _ _)).trans_eq (Finset.card_univ) + have hcR : ((Finset.univ.filter (fun a : F => quartetCollision a b)).card:ℝ) ≤ Fintype.card F := by exact_mod_cast hc + have hh := mul_le_mul_of_nonneg_right hcR hw0 + linarith + · simp only [hd,ite_false,mul_zero,zero_add] + have hc := quartet_collision_card_le_one b.1.1 b.1.2 b.2.1 b.2.2 hd + have hcR : ((Finset.univ.filter (fun a : F => quartetCollision a b)).card:ℝ) ≤ 1 := by exact_mod_cast hc + exact (mul_le_mul_of_nonneg_right hcR hw0).trans_eq (one_mul _) + rw [Finset.sum_comm] + calc + _ ≤ ∑ b : Quartet F, ((Fintype.card F:ℝ)*(if quartetDiagonal b then quartetWeight w b else 0)+quartetWeight w b) := + Finset.sum_le_sum (fun b _ => hpoint b) + _ = (Fintype.card F:ℝ)*(∑ b : Quartet F, if quartetDiagonal b then quartetWeight w b else 0)+(∑ x,w x)^4 := by + rw [Finset.sum_add_distrib,← Finset.mul_sum,quartetWeight_sum] + _ ≤ (Fintype.card F:ℝ)*(2*(∑ x,w x^2)^2)+(∑ x,w x)^4 := by + exact add_le_add (mul_le_mul_of_nonneg_left (quartetWeight_diagonal_sum w hw) (by positivity)) le_rfl + _ = 2*(Fintype.card F:ℝ)*(∑ x, w x^2)^2+(∑ x, w x)^4 := by ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/RatioOrthogonality.lean b/lean/OAI/NumberTheory/Ostmann/Tree/RatioOrthogonality.lean new file mode 100644 index 0000000000000000000000000000000000000000..107a774a5ad359b4c43f6299775b37676e41d5cb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/RatioOrthogonality.lean @@ -0,0 +1,95 @@ +import OAI.NumberTheory.Ostmann.Tree.CharacterFourth +import OAI.NumberTheory.Ostmann.Tree.DoubleMellinEnergy + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] +local instance ratioOrthogonalityFintype : Fintype (MulChar F ℂ) := Fintype.ofFinite _ + +def ratioArgument (y d : F) : F := d/(d-y) + +omit [Fintype F] [DecidableEq F] in +theorem ratioArgument_eq_zero (y d : F) : ratioArgument y d=0 ↔ d=0 ∨ d=y := by + simp only [ratioArgument,div_eq_zero_iff,sub_eq_zero] + +omit [Fintype F] [DecidableEq F] in +theorem ratioArgument_injective (y : F) (hy : y≠0) {d e : F} + (hd : ratioArgument y d≠0) (heq : ratioArgument y d=ratioArgument y e) : d=e := by + have hdy : d-y≠0 := by intro h; apply hd; simp [ratioArgument,h] + have hey : e-y≠0 := by intro h; apply hd; rw [heq]; simp [ratioArgument,h] + have hc := (div_eq_div_iff hdy hey).mp heq + apply mul_left_cancel₀ hy + linear_combination -hc + +omit [Fintype F] [DecidableEq F] in +theorem ratioArgument_kernel (y : F) (hy : y≠0) (d e : F) : + (ratioArgument y d=ratioArgument y e ∧ ratioArgument y d≠0) ↔ + (d=e ∧ d≠0 ∧ d≠y) := by + constructor + · rintro ⟨hde,hd⟩ + exact ⟨ratioArgument_injective y hy hd hde, + fun h => hd ((ratioArgument_eq_zero y d).mpr (Or.inl h)), + fun h => hd ((ratioArgument_eq_zero y d).mpr (Or.inr h))⟩ + · rintro ⟨rfl,hd,hy⟩ + exact ⟨rfl,fun h => (ratioArgument_eq_zero y d).mp h |>.elim hd hy⟩ + +omit [Fintype F] [DecidableEq F] in +theorem ratioCharacter (χ : MulChar F ℂ) (y d : F) : + χ d*χ⁻¹ (d-y)=χ (ratioArgument y d) := by + rw [MulChar.inv_apply',← map_mul] + rw [ratioArgument,div_eq_mul_inv] + +omit [Field F] [DecidableEq F] in +theorem norm_sum_sq_expansion (z : F → ℂ) : + (‖∑ d,z d‖^2:ℂ)=∑ d,∑ e,z d*conj (z e) := by + rw [← Complex.mul_conj'] + simp only [map_sum,Finset.sum_mul,Finset.mul_sum] + rw [Finset.sum_comm] + +theorem ratio_character_energy (f : F → ℂ) (y : F) (hy : y≠0) : + (∑ χ : MulChar F ℂ, ‖∑ d : F,f d*χ d*χ⁻¹ (d-y)‖^2) = + (Fintype.card Fˣ:ℝ)*∑ d : F,if d=0 ∨ d=y then 0 else ‖f d‖^2 := by + classical + have hpoint (χ : MulChar F ℂ) (d : F) : f d*χ d*χ⁻¹ (d-y)=f d*χ (ratioArgument y d) := by + rw [mul_assoc,ratioCharacter] + simp_rw [hpoint] + apply Complex.ofReal_injective + push_cast + simp_rw [norm_sum_sq_expansion] + have hs : (∑ χ : MulChar F ℂ,∑ d : F,∑ e : F, + (f d*χ (ratioArgument y d))*conj (f e*χ (ratioArgument y e))) = + ∑ d : F,∑ e : F,∑ χ : MulChar F ℂ, + (f d*χ (ratioArgument y d))*conj (f e*χ (ratioArgument y e)) := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro d _ + rw [Finset.sum_comm] + rw [hs,Finset.mul_sum] + apply Finset.sum_congr rfl + intro d _ + have he (e : F) : (∑ χ : MulChar F ℂ, + (f d*χ (ratioArgument y d))*conj (f e*χ (ratioArgument y e))) = + (f d*conj (f e))*(if d=e ∧ d≠0 ∧ d≠y then (Fintype.card Fˣ:ℂ) else 0) := by + calc + _ = (f d*conj (f e))*(∑ χ : MulChar F ℂ, + χ (ratioArgument y d)*conj (χ (ratioArgument y e))) := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro χ _ + rw [map_mul] + ring + _ = _ := by simp only [sum_mulChar_field_kernel,ratioArgument_kernel y hy] + simp_rw [he] + by_cases hd : d=0 ∨ d=y + · rcases hd with hd | hd <;> simp [hd] + · have hd0 : d≠0 := fun h => hd (Or.inl h) + have hdy : d≠y := fun h => hd (Or.inr h) + simp [hd0,hdy,Complex.mul_conj',mul_comm] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/RationalPairValue.lean b/lean/OAI/NumberTheory/Ostmann/Tree/RationalPairValue.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef5118ce6516e18564e38393b020e8dfacdb3375 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/RationalPairValue.lean @@ -0,0 +1,74 @@ +import OAI.NumberTheory.Ostmann.Tree.RationalTreeLeaves +import OAI.NumberTheory.Ostmann.Characters.FieldPairMoment + +namespace OAI + +/-! # Exact bottom-pair identification in a reconstructed rational tree -/ + +namespace Ostmann + +open scoped ComplexConjugate + +/-- A bottom node with the usual alternating conjugation is exactly the pair +function used in the Fourier and Mellin estimates, including invalid nodes. -/ +theorem rationalTreeAmplitude_pair {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (D s sL sR CL CR u XL XR mL mR : (ZMod p)ˣ) : + rationalTreeAmplitude g D + (.node s CL CR u (.leaf sL (u * CL)) (.leaf sR (u * CR))) + XL XR (false, true) (mL, mR) = + fieldBottomPairValue g + (rationalTreeArgument s (CL * CR) D XL XR (mL * mR)) + (((sL / sR) * ((XR * CR * mR) / (XL * CL * mL)) : (ZMod p)ˣ) : ZMod p) := by + let HL := XL * CL * mL + let HR := XR * CR * mR + let v := reconstructedEntry (s : ZMod p) sL sR u HL HR + let d := rationalTreeArgument s (CL * CR) D XL XR (mL * mR) + let t := (sL / sR) * (HR / HL) + have hdiff : parentArgument (s : ZMod p) D HL HR = (d : ZMod p) := by + simp only [parentArgument, d, rationalTreeArgument, HL, HR, + Units.val_div_eq_div_val, Units.val_mul] + congr 1 + ring + have ht : ((sL : ZMod p) / sR) * ((HR : ZMod p) / HL) = (t : ZMod p) := by + simp only [t, Units.val_mul, Units.val_div_eq_div_val] + have hzero : v = 0 ↔ t = 1 := by + have hz := reconstructedEntry_zero_iff_ratio_one (s : ZMod p) sL sR u HL HR + (Units.ne_zero s) (Units.ne_zero sR) (Units.ne_zero u) (Units.ne_zero HL) + rw [ht] at hz + constructor + · intro h + exact Units.ext (hz.mp h) + · intro h + exact hz.mpr (congrArg (fun a : (ZMod p)ˣ => (a : ZMod p)) h) + change (if hv : v = 0 then 0 else + g (rationalTreeArgument sL (u * CL) D (Units.mk0 v hv) XL mL) * + star (g (rationalTreeArgument sR (u * CR) D (Units.mk0 v hv) XR mR))) = + fieldBottomPairValue g d t + rw [fieldBottomPairValue_units] + by_cases hv : v = 0 + · simp [hv, bottomPairValue, hzero.mp hv] + · have ht1 : t ≠ 1 := fun h => hv (hzero.mpr h) + simp only [hv, dite_false, bottomPairValue, ht1, ite_false] + let V : (ZMod p)ˣ := Units.mk0 v hv + have hc := tree_children_eq_pair_coordinates (s : ZMod p) sL sR D u HL HR V + (Units.ne_zero s) (Units.ne_zero sR) (Units.ne_zero D) (Units.ne_zero u) + (Units.ne_zero HL) (Units.ne_zero HR) (Units.ne_zero V) + (reconstructedEntry_relation (s : ZMod p) sL sR u HL HR + (Units.ne_zero s) (Units.ne_zero u)) + rw [hdiff, ht] at hc + have hL : (rationalTreeArgument sL (u * CL) D V XL mL : ZMod p) = + (d : ZMod p) * (t : ZMod p) / ((t : ZMod p) - 1) := by + rw [rationalTreeArgument_child] + exact congrArg Prod.fst hc + have hR : (rationalTreeArgument sR (u * CR) D V XR mR : ZMod p) = + (d : ZMod p) / ((t : ZMod p) - 1) := by + rw [rationalTreeArgument_child] + exact congrArg Prod.snd hc + change g (rationalTreeArgument sL (u * CL) D V XL mL) * + star (g (rationalTreeArgument sR (u * CR) D V XR mR)) = _ + rw [hL, hR] + rfl + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/RationalProfileLeaves.lean b/lean/OAI/NumberTheory/Ostmann/Tree/RationalProfileLeaves.lean new file mode 100644 index 0000000000000000000000000000000000000000..8fba42cace40b2a251a8e8ed0f08b99d9c3b32c2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/RationalProfileLeaves.lean @@ -0,0 +1,98 @@ +import OAI.NumberTheory.Ostmann.Tree.RationalTreeProfile + +namespace OAI + +/-! # Weighted horizontal-level averages with actual independent leaf products -/ + +namespace Ostmann + +open scoped BigOperators + +theorem rationalProfileLeafValue_fiber_sum {p : ℕ} [Fact p.Prime] + (D : (ZMod p)ˣ) {n : ℕ} {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ n C) + (w : TreeLeafTuple (ZMod p → ℝ) n) (XL XR P : (ZMod p)ˣ) : + (∑ x : TreeLeafFiber (ZMod p)ˣ n P, rationalProfileLeafValue D T w XL XR x.1) = + (Fintype.card (ZMod p)ˣ : ℝ) ^ (2 ^ n - 1) * rationalProfileMoment D T w XL XR P := by + induction T generalizing XL XR P with + | leaf s C => + have he : ∀ x : TreeLeafFiber (ZMod p)ˣ 0 P, (x.1 : (ZMod p)ˣ) = P := + fun x => x.property + simp only [rationalProfileLeafValue, he, Finset.sum_const, Finset.card_univ, + card_treeLeafFiber, pow_zero, Nat.sub_self, pow_zero, one_smul, one_mul, + rationalProfileMoment] + | @node n s CL CR u left right ihL ihR => + rw [sum_treeLeafFiber_succ] + have hterm (m : (ZMod p)ˣ) : + (∑ a : TreeLeafFiber (ZMod p)ˣ n m, + ∑ b : TreeLeafFiber (ZMod p)ˣ n (P / m), + rationalProfileLeafValue D (.node s CL CR u left right) w XL XR (a.1, b.1)) = + ((Fintype.card (ZMod p)ˣ : ℝ) ^ (2 ^ n - 1)) ^ 2 * + (let HL : (ZMod p)ˣ := XL * CL * m + let HR : (ZMod p)ˣ := XR * CR * (P / m) + let v := reconstructedEntry (s : ZMod p) left.frequency right.frequency u HL HR + if hv : v = 0 then 0 else + rationalProfileMoment D left w.1 (Units.mk0 v hv) XL m * + rationalProfileMoment D right w.2 (Units.mk0 v hv) XR (P / m)) := by + have hfib {Q : (ZMod p)ˣ} (x : TreeLeafFiber (ZMod p)ˣ n Q) : + treeLeafProduct n x.1 = Q := x.property + simp only [rationalProfileLeafValue, hfib] + dsimp + split_ifs with hv + · simp + · let v := reconstructedEntry (s : ZMod p) left.frequency right.frequency u + ((XL : ZMod p) * CL * m) ((XR : ZMod p) * CR * (P / m : (ZMod p)ˣ)) + let V : (ZMod p)ˣ := Units.mk0 v hv + change (∑ a : TreeLeafFiber (ZMod p)ˣ n m, + ∑ b : TreeLeafFiber (ZMod p)ˣ n (P / m), + rationalProfileLeafValue D left w.1 V XL a.1 * + rationalProfileLeafValue D right w.2 V XR b.1) = _ + rw [← Fintype.sum_mul_sum + (fun a : TreeLeafFiber (ZMod p)ˣ n m => rationalProfileLeafValue D left w.1 V XL a.1) + (fun b : TreeLeafFiber (ZMod p)ˣ n (P / m) => rationalProfileLeafValue D right w.2 V XR b.1)] + rw [ihL, ihR] + ring + simp_rw [hterm] + rw [← Finset.mul_sum] + simp only [rationalProfileMoment] + have hU : (Fintype.card (ZMod p)ˣ : ℝ) ≠ 0 := by + exact_mod_cast Fintype.card_ne_zero + have hn : 1 ≤ 2 ^ n := Nat.one_le_pow n 2 (by omega) + have hexp : 2 ^ (n + 1) - 1 = (2 ^ n - 1) * 2 + 1 := by + rw [pow_succ] + omega + rw [hexp] + conv_rhs => arg 1; rw [pow_succ, pow_mul] + field_simp + +theorem rationalProfileLeafValue_mean_eq {p : ℕ} [Fact p.Prime] + (D : (ZMod p)ˣ) {n : ℕ} {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ n C) + (w : TreeLeafTuple (ZMod p → ℝ) n) (XL XR : (ZMod p)ˣ) : + (∑ x : TreeLeafTuple (ZMod p)ˣ n, rationalProfileLeafValue D T w XL XR x) / + (Fintype.card (TreeLeafTuple (ZMod p)ˣ n) : ℝ) = + (∑ P : (ZMod p)ˣ, rationalProfileMoment D T w XL XR P) / + (Fintype.card (ZMod p)ˣ : ℝ) := by + rw [sum_treeLeafTuple_by_product] + simp_rw [rationalProfileLeafValue_fiber_sum] + rw [← Finset.mul_sum, card_treeLeafTuple, Nat.cast_pow] + have hU : (Fintype.card (ZMod p)ˣ : ℝ) ≠ 0 := by + exact_mod_cast Fintype.card_ne_zero + have hn : 1 ≤ 2 ^ n := Nat.one_le_pow n 2 (by omega) + conv_lhs => rhs; rw [← Nat.sub_add_cancel hn, pow_succ] + field_simp + +/-- Horizontal-level domination for a different nonnegative test at each node. -/ +theorem rationalProfileLeafValue_mean_le {p : ℕ} [Fact p.Prime] (D : (ZMod p)ˣ) + {n : ℕ} {C : (ZMod p)ˣ} (T : RationalTreeData (ZMod p)ˣ n C) + (w : TreeLeafTuple (ZMod p → ℝ) n) (hw : treeWeightsNonneg n w) + (XL XR : (ZMod p)ˣ) : + (∑ x : TreeLeafTuple (ZMod p)ˣ n, rationalProfileLeafValue D T w XL XR x) / + (Fintype.card (TreeLeafTuple (ZMod p)ˣ n) : ℝ) ≤ + (2 : ℝ) ^ (2 ^ n - 1) * treeProfileMean n w := by + rw [rationalProfileLeafValue_mean_eq] + exact rationalProfileMoment_mean_le D T w hw XL XR + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/RationalQuartetCut.lean b/lean/OAI/NumberTheory/Ostmann/Tree/RationalQuartetCut.lean new file mode 100644 index 0000000000000000000000000000000000000000..04d3fd2cf6219b5a1d232abdbb38015d9de22639 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/RationalQuartetCut.lean @@ -0,0 +1,167 @@ +import OAI.NumberTheory.Ostmann.Characters.QuartetProductFibers +import OAI.NumberTheory.Ostmann.Tree.RationalProfileLeaves + +namespace OAI + +/-! # Cutting an actual rational tree at its bottom quartets + +The option-valued state records ancestor validity. On a valid cut each +state contains the original depth-two tree and its propagated current +entries. No quartet replacement or independence hypothesis is used. +-/ + +namespace Ostmann + +open scoped BigOperators + +@[implicit_reducible] def treeLeafMap {A B : Type*} (f : A → B) : (n : ℕ) → + TreeLeafTuple A n → TreeLeafTuple B n + | 0, a => f a + | n + 1, a => (treeLeafMap f n a.1, treeLeafMap f n a.2) + +def treeLeafZipProduct {A B R : Type*} [Mul R] (f : A → B → R) : (n : ℕ) → + TreeLeafTuple A n → TreeLeafTuple B n → R + | 0, a, b => f a b + | n + 1, a, b => treeLeafZipProduct f n a.1 b.1 * treeLeafZipProduct f n a.2 b.2 + +theorem treeLeafProduct_quartetBlocks {U : Type*} [CommGroup U] (n : ℕ) + (m : TreeLeafTuple U (n + 2)) : + treeLeafProduct (n + 2) m = treeLeafProduct n + (treeLeafMap (treeLeafProduct 2) n (quartetBlockTupleEquiv U n m)) := by + induction n with + | zero => rfl + | succ n ih => + change treeLeafProduct (n + 2) m.1 * treeLeafProduct (n + 2) m.2 = _ + rw [ih m.1, ih m.2] + rfl + +def RationalTreeData.cutTwo {U : Type*} [CommGroup U] : (n : ℕ) → {C : U} → + RationalTreeData U (n + 2) C → RationalTreeData U n C + | 0, C, T => .leaf T.frequency C + | n + 1, _, .node s CL CR u left right => + .node s CL CR u (left.cutTwo n) (right.cutTwo n) + +@[simp] theorem RationalTreeData.frequency_cutTwo {U : Type*} [CommGroup U] + (n : ℕ) {C : U} (T : RationalTreeData U (n + 2) C) : + (T.cutTwo n).frequency = T.frequency := by + cases n with + | zero => rfl + | succ n => cases T; rfl + +structure RationalQuartetState (p : ℕ) [Fact p.Prime] where + C : (ZMod p)ˣ + tree : RationalTreeData (ZMod p)ˣ 2 C + XL : (ZMod p)ˣ + XR : (ZMod p)ˣ + conjugations : TreeLeafTuple Bool 2 + +noncomputable def rationalQuartetStates {p : ℕ} [Fact p.Prime] : + (n : ℕ) → {C : (ZMod p)ˣ} → RationalTreeData (ZMod p)ˣ (n + 2) C → + (ZMod p)ˣ → (ZMod p)ˣ → TreeLeafTuple Bool (n + 2) → + TreeLeafTuple (ZMod p)ˣ n → Option (TreeLeafTuple (RationalQuartetState p) n) + | 0, C, T, XL, XR, c, _ => some ⟨C, T, XL, XR, c⟩ + | n + 1, _, .node s CL CR u left right, XL, XR, c, P => + let HL := XL * CL * treeLeafProduct n P.1 + let HR := XR * CR * treeLeafProduct n P.2 + let v := reconstructedEntry (s : ZMod p) left.frequency right.frequency u HL HR + if hv : v = 0 then none else do + let L ← rationalQuartetStates n left (Units.mk0 v hv) XL c.1 P.1 + let R ← rationalQuartetStates n right (Units.mk0 v hv) XR c.2 P.2 + pure (L, R) + +def quartetCutValue {A B R : Type*} [Zero R] [Mul R] (f : A → B → R) (n : ℕ) + (states : Option (TreeLeafTuple A n)) (b : TreeLeafTuple B n) : R := + match states with + | none => 0 + | some a => treeLeafZipProduct f n a b + +theorem quartetCutValue_pair {A B R : Type*} [MulZeroClass R] (f : A → B → R) + (n : ℕ) (L R' : Option (TreeLeafTuple A n)) (b : TreeLeafTuple B (n + 1)) : + quartetCutValue f (n + 1) (do let l ← L; let r ← R'; pure (l, r)) b = + quartetCutValue f n L b.1 * quartetCutValue f n R' b.2 := by + cases L <;> cases R' <;> simp [quartetCutValue, treeLeafZipProduct] + +noncomputable def rationalQuartetStateAmplitude {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (D : (ZMod p)ˣ) (S : RationalQuartetState p) + (m : TreeLeafTuple (ZMod p)ˣ 2) : ℂ := + rationalTreeAmplitude g D S.tree S.XL S.XR S.conjugations m + +/-- Holding all bottom-quartet products fixes the entire upper recursion. -/ +theorem rationalTreeAmplitude_cut {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (D : (ZMod p)ˣ) (n : ℕ) {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ (n + 2) C) (XL XR : (ZMod p)ˣ) + (c : TreeLeafTuple Bool (n + 2)) (m : TreeLeafTuple (ZMod p)ˣ (n + 2)) : + rationalTreeAmplitude g D T XL XR c m = + quartetCutValue (rationalQuartetStateAmplitude g D) n + (rationalQuartetStates n T XL XR c + (treeLeafMap (treeLeafProduct 2) n (quartetBlockTupleEquiv (ZMod p)ˣ n m))) + (quartetBlockTupleEquiv (ZMod p)ˣ n m) := by + induction n generalizing C XL XR with + | zero => rfl + | succ n ih => + cases T with + | node s CL CR u left right => + change rationalTreeAmplitude g D (.node s CL CR u left right) XL XR c m = + quartetCutValue (rationalQuartetStateAmplitude g D) (n + 1) + (rationalQuartetStates (n + 1) (.node s CL CR u left right) XL XR c + (treeLeafMap (treeLeafProduct 2) n (quartetBlockTupleEquiv (ZMod p)ˣ n m.1), + treeLeafMap (treeLeafProduct 2) n (quartetBlockTupleEquiv (ZMod p)ˣ n m.2))) + (quartetBlockTupleEquiv (ZMod p)ˣ n m.1, quartetBlockTupleEquiv (ZMod p)ˣ n m.2) + simp only [rationalTreeAmplitude, rationalQuartetStates] + simp only [treeLeafProduct_quartetBlocks n m.1, treeLeafProduct_quartetBlocks n m.2] + split_ifs with hv + · rfl + · rw [quartetCutValue_pair] + exact congrArg₂ (· * ·) (ih left _ _ c.1 m.1) (ih right _ _ c.2 m.2) + +@[implicit_reducible] def treeLeafZip {A B : Type*} : (n : ℕ) → TreeLeafTuple A n → TreeLeafTuple B n → + TreeLeafTuple (A × B) n + | 0, a, b => (a, b) + | n + 1, a, b => (treeLeafZip n a.1 b.1, treeLeafZip n a.2 b.2) + +noncomputable def rationalQuartetStateArgument {p : ℕ} [Fact p.Prime] + (D : (ZMod p)ˣ) (S : RationalQuartetState p) (P : (ZMod p)ˣ) : (ZMod p)ˣ := + rationalTreeArgument S.tree.frequency S.C D S.XL S.XR P + +/-- The weighted arguments exposed at the cut are exactly the leaves of +the truncated rational tree, with the same invalid-ancestor zeros. -/ +theorem rationalQuartetStates_profile {p : ℕ} [Fact p.Prime] + (D : (ZMod p)ˣ) (n : ℕ) {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ (n + 2) C) (XL XR : (ZMod p)ˣ) + (c : TreeLeafTuple Bool (n + 2)) (P : TreeLeafTuple (ZMod p)ˣ n) + (w : TreeLeafTuple (ZMod p → ℝ) n) : + quartetCutValue (fun S (wp : (ZMod p → ℝ) × (ZMod p)ˣ) => + wp.1 (rationalQuartetStateArgument D S wp.2)) n + (rationalQuartetStates n T XL XR c P) (treeLeafZip n w P) = + rationalProfileLeafValue D (T.cutTwo n) w XL XR P := by + induction n generalizing C XL XR with + | zero => rfl + | succ n ih => + cases T with + | node s CL CR u left right => + simp only [rationalQuartetStates, RationalTreeData.cutTwo, rationalProfileLeafValue, + RationalTreeData.frequency_cutTwo, treeLeafZip] + split_ifs with hv + · rfl + · rw [quartetCutValue_pair] + exact congrArg₂ (· * ·) (ih left _ _ c.1 P.1 w.1) (ih right _ _ c.2 P.2 w.2) + +/-- Horizontal density domination applies directly to the genuine cut +states, even though their current entries depend on the product vector. -/ +theorem rationalQuartetStates_profile_mean_le {p : ℕ} [Fact p.Prime] + (D : (ZMod p)ˣ) (n : ℕ) {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ (n + 2) C) (XL XR : (ZMod p)ˣ) + (c : TreeLeafTuple Bool (n + 2)) + (w : TreeLeafTuple (ZMod p → ℝ) n) (hw : treeWeightsNonneg n w) : + (∑ P : TreeLeafTuple (ZMod p)ˣ n, + quartetCutValue (fun S (wp : (ZMod p → ℝ) × (ZMod p)ˣ) => + wp.1 (rationalQuartetStateArgument D S wp.2)) n + (rationalQuartetStates n T XL XR c P) (treeLeafZip n w P)) / + (Fintype.card (TreeLeafTuple (ZMod p)ˣ n) : ℝ) ≤ + (2 : ℝ) ^ (2 ^ n - 1) * treeProfileMean n w := by + simp_rw [rationalQuartetStates_profile] + exact rationalProfileLeafValue_mean_le D (T.cutTwo n) w hw XL XR + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/RationalQuartetValue.lean b/lean/OAI/NumberTheory/Ostmann/Tree/RationalQuartetValue.lean new file mode 100644 index 0000000000000000000000000000000000000000..9f59f32719ac30355a569ba2ab405dabe894f251 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/RationalQuartetValue.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.Tree.RationalPairValue + +namespace OAI + +/-! # Bottom quartets in the actual rational-tree recursion -/ + +namespace Ostmann + +open scoped BigOperators + +@[simp] theorem rationalTreeFrequency_cast {U : Type*} [CommGroup U] + {n : ℕ} {C C' : U} (h : C = C') (T : RationalTreeData U n C) : + (h ▸ T).frequency = T.frequency := by + cases h + rfl + +@[simp] theorem rationalTreeAmplitude_cast {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (D : (ZMod p)ˣ) {n : ℕ} {C C' : (ZMod p)ˣ} + (h : C = C') (T : RationalTreeData (ZMod p)ˣ n C) + (XL XR : (ZMod p)ˣ) (c : TreeLeafTuple Bool n) (m : TreeLeafTuple (ZMod p)ˣ n) : + rationalTreeAmplitude g D (h ▸ T) XL XR c m = + rationalTreeAmplitude g D T XL XR c m := by + cases h + rfl + +/-- The fixed data above a bottom quartet; its four leaf products remain free. -/ +structure RationalQuartetData (U : Type*) [CommGroup U] where + s : U + sL : U + sR : U + u : U + CL : U + CR : U + s₁ : U + s₂ : U + s₃ : U + s₄ : U + uL : U + uR : U + C₁ : U + C₂ : U + C₃ : U + C₄ : U + left_product : C₁ * C₂ = u * CL + right_product : C₃ * C₄ = u * CR + +def RationalQuartetData.tree {U : Type*} [CommGroup U] (Q : RationalQuartetData U) : + RationalTreeData U 2 (Q.CL * Q.CR) := + .node Q.s Q.CL Q.CR Q.u + (Q.left_product ▸ (.node Q.sL Q.C₁ Q.C₂ Q.uL + (.leaf Q.s₁ (Q.uL * Q.C₁)) (.leaf Q.s₂ (Q.uL * Q.C₂)))) + (Q.right_product ▸ (.node Q.sR Q.C₃ Q.C₄ Q.uR + (.leaf Q.s₃ (Q.uR * Q.C₃)) (.leaf Q.s₄ (Q.uR * Q.C₄)))) + +noncomputable def rationalQuartetValue {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (D : (ZMod p)ˣ) (Q : RationalQuartetData (ZMod p)ˣ) + (XL XR m₁ m₂ m₃ m₄ : (ZMod p)ˣ) : ℂ := + let HL := XL * Q.CL * (m₁ * m₂) + let HR := XR * Q.CR * (m₃ * m₄) + let v := reconstructedEntry (Q.s : ZMod p) Q.sL Q.sR Q.u HL HR + if hv : v = 0 then 0 else + let V := Units.mk0 v hv + fieldBottomPairValue g (rationalTreeArgument Q.sL (Q.u * Q.CL) D V XL (m₁ * m₂)) + (((Q.s₁ / Q.s₂) * ((XL * Q.C₂ * m₂) / (V * Q.C₁ * m₁)) : (ZMod p)ˣ) : ZMod p) * + fieldBottomPairValue g (rationalTreeArgument Q.sR (Q.u * Q.CR) D V XR (m₃ * m₄)) + (((Q.s₃ / Q.s₄) * ((XR * Q.C₄ * m₄) / (V * Q.C₃ * m₃)) : (ZMod p)ˣ) : ZMod p) + +/-- This local value is the depth-two instance of the same tree amplitude +used in the global cycle projection, rather than a new surrogate diagram. -/ +theorem rationalTreeAmplitude_quartet {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (D : (ZMod p)ˣ) (Q : RationalQuartetData (ZMod p)ˣ) + (XL XR m₁ m₂ m₃ m₄ : (ZMod p)ˣ) : + rationalTreeAmplitude g D Q.tree XL XR ((false, true), (false, true)) + ((m₁, m₂), (m₃, m₄)) = rationalQuartetValue g D Q XL XR m₁ m₂ m₃ m₄ := by + unfold RationalQuartetData.tree + simp only [rationalTreeAmplitude] + simp only [rationalTreeFrequency_cast] + simp only [RationalTreeData.frequency, treeLeafProduct] + unfold rationalQuartetValue + dsimp only + by_cases hv : reconstructedEntry (Q.s : ZMod p) Q.sL Q.sR Q.u + ((XL * Q.CL * (m₁ * m₂) : (ZMod p)ˣ) : ZMod p) + ((XR * Q.CR * (m₃ * m₄) : (ZMod p)ˣ) : ZMod p) = 0 + · simp only [hv, dite_true] + · simp only [hv, dite_false] + let V : (ZMod p)ˣ := Units.mk0 _ hv + have hL := rationalTreeAmplitude_cast g D Q.left_product + (.node Q.sL Q.C₁ Q.C₂ Q.uL (.leaf Q.s₁ (Q.uL * Q.C₁)) + (.leaf Q.s₂ (Q.uL * Q.C₂))) V XL (false, true) (m₁, m₂) + have hR := rationalTreeAmplitude_cast g D Q.right_product + (.node Q.sR Q.C₃ Q.C₄ Q.uR (.leaf Q.s₃ (Q.uR * Q.C₃)) + (.leaf Q.s₄ (Q.uR * Q.C₄))) V XR (false, true) (m₃, m₄) + change rationalTreeAmplitude g D (n := 1) _ V XL (false, true) (m₁, m₂) * + rationalTreeAmplitude g D (n := 1) _ V XR (false, true) (m₃, m₄) = _ + rw [hL, hR, rationalTreeAmplitude_pair, rationalTreeAmplitude_pair] + have hargL := congrArg + (fun C => (rationalTreeArgument Q.sL C D V XL (m₁ * m₂) : ZMod p)) Q.left_product + have hargR := congrArg + (fun C => (rationalTreeArgument Q.sR C D V XR (m₃ * m₄) : ZMod p)) Q.right_product + rw [hargL, hargR] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/RationalTree.lean b/lean/OAI/NumberTheory/Ostmann/Tree/RationalTree.lean new file mode 100644 index 0000000000000000000000000000000000000000..20deda8da3985bda635adf7cacd011ce7e966c5d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/RationalTree.lean @@ -0,0 +1,171 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RationalNodeDensity +import OAI.NumberTheory.Ostmann.ZeroDensity.TreeDensity + +namespace OAI + +/-! +# Recursive rational tree data + +The product coefficient is an index of the data type. At every split, +its child indices encode exactly the consistency conditions on the +fixed constants in `src36`. +-/ + +namespace Ostmann + +open scoped BigOperators + +inductive RationalTreeData (U : Type*) [CommGroup U] : ℕ → U → Type _ + | leaf (s C : U) : RationalTreeData U 0 C + | node {n : ℕ} (s CL CR u : U) + (left : RationalTreeData U n (u * CL)) + (right : RationalTreeData U n (u * CR)) : RationalTreeData U (n + 1) (CL * CR) + +@[implicit_reducible] def RationalTreeData.frequency {U : Type*} [CommGroup U] {n : ℕ} {C : U} : + RationalTreeData U n C → U + | .leaf s _ => s + | .node s _ _ _ _ _ => s + +noncomputable def rationalTreeArgument {p : ℕ} [Fact p.Prime] + (s C D XL XR P : (ZMod p)ˣ) : (ZMod p)ˣ := s / (D * XL * XR * C * P) + +noncomputable def rationalTreeMoment {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (D : (ZMod p)ˣ) : + {n : ℕ} → {C : (ZMod p)ˣ} → RationalTreeData (ZMod p)ˣ n C → + (ZMod p)ˣ → (ZMod p)ˣ → (ZMod p)ˣ → ℝ + | _, _, .leaf s C, XL, XR, P => w (rationalTreeArgument s C D XL XR P) + | _, _, .node s CL CR u left right, XL, XR, P => + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * ∑ m : (ZMod p)ˣ, + let HL : (ZMod p)ˣ := XL * CL * m + let HR : (ZMod p)ˣ := XR * CR * (P / m) + let v := reconstructedEntry (s : ZMod p) left.frequency right.frequency u HL HR + if hv : v = 0 then 0 else + rationalTreeMoment w D left (Units.mk0 v hv) XL m * + rationalTreeMoment w D right (Units.mk0 v hv) XR (P / m) + +theorem rationalTreeArgument_child {p : ℕ} [Fact p.Prime] + (s D u X C m v : (ZMod p)ˣ) : + (rationalTreeArgument s (u * C) D v X m : ZMod p) = + childArgument (s : ZMod p) D u ((X * C * m : (ZMod p)ˣ) : ZMod p) v := by + simp only [rationalTreeArgument, childArgument, Units.val_div_eq_div_val, Units.val_mul] + congr 1 + ring + +theorem rationalTreeArgument_node {p : ℕ} [Fact p.Prime] + (s CL CR D XL XR P : (ZMod p)ˣ) : + rationalTreeArgument s (CL * CR) D XL XR P = rationalNodeArgument s D XL XR CL CR P := by + unfold rationalTreeArgument rationalNodeArgument + congr 1 + simp only [mul_left_comm, mul_comm] + +theorem rationalTreeMoment_nonneg {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (hw : ∀ x, 0 ≤ w x) (D : (ZMod p)ˣ) + {n : ℕ} {C : (ZMod p)ˣ} (T : RationalTreeData (ZMod p)ˣ n C) + (XL XR P : (ZMod p)ˣ) : 0 ≤ rationalTreeMoment w D T XL XR P := by + induction T generalizing XL XR P with + | leaf s C => exact hw _ + | node s CL CR u left right ihL ihR => + simp only [rationalTreeMoment] + apply mul_nonneg (by positivity) + apply Finset.sum_nonneg + intro m _ + dsimp + split_ifs + · exact le_rfl + · exact mul_nonneg (ihL _ _ _) (ihR _ _ _) + +/-- The actual recursive rational-node moment is bounded by the uniform density majorant. -/ +theorem rationalTreeMoment_le_majorant {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (hw : ∀ x, 0 ≤ w x) (D : (ZMod p)ˣ) + {n : ℕ} {C : (ZMod p)ˣ} (T : RationalTreeData (ZMod p)ˣ n C) + (XL XR P : (ZMod p)ˣ) : + rationalTreeMoment w D T XL XR P ≤ + treeDensityMajorant w n (rationalTreeArgument T.frequency C D XL XR P) := by + induction T generalizing XL XR P with + | leaf s C => + simp only [rationalTreeMoment, RationalTreeData.frequency, treeDensityMajorant, + Units.ne_zero, ite_false, le_refl] + | @node n s CL CR u left right ihL ihR => + have harg := rationalTreeArgument_node s CL CR D XL XR P + change _ ≤ treeDensityMajorant w (n + 1) (rationalTreeArgument s (CL * CR) D XL XR P) + rw [harg] + simp only [treeDensityMajorant, Units.ne_zero, ite_false] + calc + _ ≤ (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * + ∑ m : (ZMod p)ˣ, rationalNodeValue s left.frequency right.frequency D u XL XR CL CR P + (treeDensityMajorant w n) (treeDensityMajorant w n) m := by + unfold rationalTreeMoment + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Finset.sum_le_sum + intro m _ + dsimp [rationalNodeValue] + split_ifs with hv + · exact le_rfl + · have hL := ihL (Units.mk0 _ hv) XL m + have hR := ihR (Units.mk0 _ hv) XR (P / m) + rw [rationalTreeArgument_child] at hL hR + exact mul_le_mul hL hR (rationalTreeMoment_nonneg w hw D right _ _ _) + (treeDensityMajorant_nonneg w hw n _) + _ ≤ (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * + (2 * ∑ x : ZMod p, treeDensityMajorant w n x * + treeDensityMajorant w n (x - rationalNodeArgument s D XL XR CL CR P)) := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + exact rationalNodeValue_sum_le s left.frequency right.frequency D u XL XR CL CR P + _ _ (treeDensityMajorant_zero w n) (treeDensityMajorant_zero w n) + (treeDensityMajorant_nonneg w hw n) (treeDensityMajorant_nonneg w hw n) + _ = _ := by unfold differenceMoment; ring + +/-- With the other root data fixed, exposing the total leaf product gives a uniform argument. -/ +noncomputable def rationalTreeArgumentEquiv {p : ℕ} [Fact p.Prime] + (s C D XL XR : (ZMod p)ˣ) : (ZMod p)ˣ ≃ (ZMod p)ˣ where + toFun P := rationalTreeArgument s C D XL XR P + invFun y := s / (D * XL * XR * C * y) + left_inv P := by simp [rationalTreeArgument, div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] + right_inv y := by simp [rationalTreeArgument, div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] + +theorem rationalTreeMoment_mean_le {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (hw : ∀ x, 0 ≤ w x) (E : ℝ) + (hE : (∑ d : (ZMod p)ˣ, w d) / (Fintype.card (ZMod p)ˣ : ℝ) ≤ E) + (D : (ZMod p)ˣ) {n : ℕ} {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ n C) (XL XR : (ZMod p)ˣ) : + (∑ P : (ZMod p)ˣ, rationalTreeMoment w D T XL XR P) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ binaryMomentBound E n := by + calc + _ ≤ (∑ P : (ZMod p)ˣ, + treeDensityMajorant w n (rationalTreeArgument T.frequency C D XL XR P)) / + (Fintype.card (ZMod p)ˣ : ℝ) := by + apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg _) + exact Finset.sum_le_sum fun P _ => rationalTreeMoment_le_majorant w hw D T XL XR P + _ = (∑ d : (ZMod p)ˣ, treeDensityMajorant w n d) / + (Fintype.card (ZMod p)ˣ : ℝ) := by + congr 1 + exact (rationalTreeArgumentEquiv T.frequency C D XL XR).sum_comp + (fun d => treeDensityMajorant w n d) + _ ≤ _ := treeDensityMajorant_mean_le w hw E hE n + +/-- The actual rational tree, averaged in its root product, satisfies `src37`. -/ +theorem rationalTreeMoment_l2_bound {p : ℕ} [Fact p.Prime] + (hp : 3 ≤ p) (g : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) + (D : (ZMod p)ˣ) {n : ℕ} {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ n C) (XL XR : (ZMod p)ˣ) : + (∑ P : (ZMod p)ˣ, rationalTreeMoment (fun x => ‖g x‖ ^ 2) D T XL XR P) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ (3 : ℝ) ^ (2 ^ n) := by + have hpr : (3 : ℝ) ≤ p := by exact_mod_cast hp + have hU : (Fintype.card (ZMod p)ˣ : ℝ) = (p : ℝ) - 1 := by + rw [ZMod.card_units, Nat.cast_sub (Fact.out : p.Prime).one_lt.le, Nat.cast_one] + have hsum := sum_units_eq_sum_of_zero (fun x => ‖g x‖ ^ 2) (by simp [hg]) + have hE : (∑ d : (ZMod p)ˣ, ‖g d‖ ^ 2) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ 3 / 2 := by + rw [hU, hsum] + apply (div_le_iff₀ (by linarith : (0 : ℝ) < p - 1)).mpr + linarith + have h := rationalTreeMoment_mean_le (fun x => ‖g x‖ ^ 2) (fun _ => sq_nonneg _) + (3 / 2) hE D T XL XR + rw [binaryMomentBound_eq] at h + norm_num only [show (2 : ℝ) * (3 / 2) = 3 by norm_num] at h + exact h.trans (by have := pow_nonneg (by norm_num : (0 : ℝ) ≤ 3) (2 ^ n); linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/RationalTreeLeaves.lean b/lean/OAI/NumberTheory/Ostmann/Tree/RationalTreeLeaves.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ce906d95c2fa8f029924248024335ad648b614c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/RationalTreeLeaves.lean @@ -0,0 +1,155 @@ +import OAI.NumberTheory.Ostmann.Tree.RationalTree +import OAI.NumberTheory.Ostmann.Characters.TreeLeafProducts + +namespace OAI + +/-! # The rational tree under independent uniform leaf sampling -/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable def rationalTreeLeafValue {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (D : (ZMod p)ˣ) : + {n : ℕ} → {C : (ZMod p)ˣ} → RationalTreeData (ZMod p)ˣ n C → + (ZMod p)ˣ → (ZMod p)ˣ → TreeLeafTuple (ZMod p)ˣ n → ℝ + | _, _, .leaf s C, XL, XR, m => w (rationalTreeArgument s C D XL XR m) + | n + 1, _, .node s CL CR u left right, XL, XR, ab => + let HL : (ZMod p)ˣ := XL * CL * treeLeafProduct n ab.1 + let HR : (ZMod p)ˣ := XR * CR * treeLeafProduct n ab.2 + let v := reconstructedEntry (s : ZMod p) left.frequency right.frequency u HL HR + if hv : v = 0 then 0 else + rationalTreeLeafValue w D left (Units.mk0 v hv) XL ab.1 * + rationalTreeLeafValue w D right (Units.mk0 v hv) XR ab.2 + +theorem rationalTreeLeafValue_fiber_sum {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (D : (ZMod p)ˣ) {n : ℕ} {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ n C) (XL XR P : (ZMod p)ˣ) : + (∑ x : TreeLeafFiber (ZMod p)ˣ n P, rationalTreeLeafValue w D T XL XR x.1) = + (Fintype.card (ZMod p)ˣ : ℝ) ^ (2 ^ n - 1) * rationalTreeMoment w D T XL XR P := by + induction T generalizing XL XR P with + | leaf s C => + have he : ∀ x : TreeLeafFiber (ZMod p)ˣ 0 P, (x.1 : (ZMod p)ˣ) = P := + fun x => x.property + simp only [rationalTreeLeafValue, he, Finset.sum_const, Finset.card_univ, + card_treeLeafFiber, pow_zero, Nat.sub_self, pow_zero, one_smul, one_mul, + rationalTreeMoment] + | @node n s CL CR u left right ihL ihR => + rw [sum_treeLeafFiber_succ] + have hterm (m : (ZMod p)ˣ) : + (∑ a : TreeLeafFiber (ZMod p)ˣ n m, + ∑ b : TreeLeafFiber (ZMod p)ˣ n (P / m), + rationalTreeLeafValue w D (.node s CL CR u left right) XL XR (a.1, b.1)) = + ((Fintype.card (ZMod p)ˣ : ℝ) ^ (2 ^ n - 1)) ^ 2 * + (let HL : (ZMod p)ˣ := XL * CL * m + let HR : (ZMod p)ˣ := XR * CR * (P / m) + let v := reconstructedEntry (s : ZMod p) left.frequency right.frequency u HL HR + if hv : v = 0 then 0 else + rationalTreeMoment w D left (Units.mk0 v hv) XL m * + rationalTreeMoment w D right (Units.mk0 v hv) XR (P / m)) := by + have hfib {Q : (ZMod p)ˣ} (x : TreeLeafFiber (ZMod p)ˣ n Q) : + treeLeafProduct n x.1 = Q := x.property + simp only [rationalTreeLeafValue, hfib] + dsimp + split_ifs with hv + · simp + · let v := reconstructedEntry (s : ZMod p) left.frequency right.frequency u + ((XL : ZMod p) * CL * m) ((XR : ZMod p) * CR * (P / m : (ZMod p)ˣ)) + let V : (ZMod p)ˣ := Units.mk0 v hv + change (∑ a : TreeLeafFiber (ZMod p)ˣ n m, + ∑ b : TreeLeafFiber (ZMod p)ˣ n (P / m), + rationalTreeLeafValue w D left V XL a.1 * + rationalTreeLeafValue w D right V XR b.1) = _ + rw [← Fintype.sum_mul_sum + (fun a : TreeLeafFiber (ZMod p)ˣ n m => rationalTreeLeafValue w D left V XL a.1) + (fun b : TreeLeafFiber (ZMod p)ˣ n (P / m) => rationalTreeLeafValue w D right V XR b.1)] + rw [ihL, ihR] + ring + simp_rw [hterm] + rw [← Finset.mul_sum] + simp only [rationalTreeMoment] + have hU : (Fintype.card (ZMod p)ˣ : ℝ) ≠ 0 := by + exact_mod_cast Fintype.card_ne_zero + have hn : 1 ≤ 2 ^ n := Nat.one_le_pow n 2 (by omega) + have hexp : 2 ^ (n + 1) - 1 = (2 ^ n - 1) * 2 + 1 := by + rw [pow_succ] + omega + rw [hexp] + conv_rhs => arg 1; rw [pow_succ, pow_mul] + field_simp + +theorem rationalTreeLeafValue_mean_eq {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (D : (ZMod p)ˣ) {n : ℕ} {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ n C) (XL XR : (ZMod p)ˣ) : + (∑ x : TreeLeafTuple (ZMod p)ˣ n, rationalTreeLeafValue w D T XL XR x) / + (Fintype.card (TreeLeafTuple (ZMod p)ˣ n) : ℝ) = + (∑ P : (ZMod p)ˣ, rationalTreeMoment w D T XL XR P) / + (Fintype.card (ZMod p)ˣ : ℝ) := by + rw [sum_treeLeafTuple_by_product] + simp_rw [rationalTreeLeafValue_fiber_sum] + rw [← Finset.mul_sum, card_treeLeafTuple, Nat.cast_pow] + have hU : (Fintype.card (ZMod p)ˣ : ℝ) ≠ 0 := by + exact_mod_cast Fintype.card_ne_zero + have hn : 1 ≤ 2 ^ n := Nat.one_le_pow n 2 (by omega) + conv_lhs => rhs; rw [← Nat.sub_add_cancel hn, pow_succ] + field_simp + +/-- The first part of the tree comparison: independent uniform leaves give the `3^r` bound. -/ +theorem rationalTreeLeafValue_l2_bound {p : ℕ} [Fact p.Prime] + (hp : 3 ≤ p) (g : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) + (D : (ZMod p)ˣ) {n : ℕ} {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ n C) (XL XR : (ZMod p)ˣ) : + (∑ x : TreeLeafTuple (ZMod p)ˣ n, + rationalTreeLeafValue (fun y => ‖g y‖ ^ 2) D T XL XR x) / + (Fintype.card (TreeLeafTuple (ZMod p)ˣ n) : ℝ) ≤ (3 : ℝ) ^ (2 ^ n) := by + rw [rationalTreeLeafValue_mean_eq] + exact rationalTreeMoment_l2_bound hp g hg henergy D T XL XR + +/-- The manuscript's diagram value, permitting arbitrary conjugation choices at the leaves. -/ +noncomputable def rationalTreeAmplitude {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (D : (ZMod p)ˣ) : + {n : ℕ} → {C : (ZMod p)ˣ} → RationalTreeData (ZMod p)ˣ n C → + (ZMod p)ˣ → (ZMod p)ˣ → TreeLeafTuple Bool n → TreeLeafTuple (ZMod p)ˣ n → ℂ + | _, _, .leaf s C, XL, XR, c, m => + match (c : Bool) with + | true => star (g (rationalTreeArgument s C D XL XR m)) + | false => g (rationalTreeArgument s C D XL XR m) + | n + 1, _, .node s CL CR u left right, XL, XR, c, ab => + let HL : (ZMod p)ˣ := XL * CL * treeLeafProduct n ab.1 + let HR : (ZMod p)ˣ := XR * CR * treeLeafProduct n ab.2 + let v := reconstructedEntry (s : ZMod p) left.frequency right.frequency u HL HR + if hv : v = 0 then 0 else + rationalTreeAmplitude g D left (Units.mk0 v hv) XL c.1 ab.1 * + rationalTreeAmplitude g D right (Units.mk0 v hv) XR c.2 ab.2 + +theorem norm_rationalTreeAmplitude_sq {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (D : (ZMod p)ˣ) {n : ℕ} {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ n C) (XL XR : (ZMod p)ˣ) + (c : TreeLeafTuple Bool n) (m : TreeLeafTuple (ZMod p)ˣ n) : + ‖rationalTreeAmplitude g D T XL XR c m‖ ^ 2 = + rationalTreeLeafValue (fun y => ‖g y‖ ^ 2) D T XL XR m := by + induction T generalizing XL XR with + | leaf s C => + cases c <;> simp [rationalTreeAmplitude, rationalTreeLeafValue] + | node s CL CR u left right ihL ihR => + simp only [rationalTreeAmplitude, rationalTreeLeafValue] + split_ifs + · simp + · rw [norm_mul, mul_pow, ihL, ihR] + +/-- Equation `src37`, with the actual reconstructed-node diagram and uniform independent leaves. -/ +theorem rationalTreeAmplitude_l2_bound {p : ℕ} [Fact p.Prime] + (hp : 3 ≤ p) (g : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) + (D : (ZMod p)ˣ) {n : ℕ} {C : (ZMod p)ˣ} + (T : RationalTreeData (ZMod p)ˣ n C) (XL XR : (ZMod p)ˣ) + (c : TreeLeafTuple Bool n) : + (∑ m : TreeLeafTuple (ZMod p)ˣ n, ‖rationalTreeAmplitude g D T XL XR c m‖ ^ 2) / + (Fintype.card (TreeLeafTuple (ZMod p)ˣ n) : ℝ) ≤ (3 : ℝ) ^ (2 ^ n) := by + simp_rw [norm_rationalTreeAmplitude_sq] + exact rationalTreeLeafValue_l2_bound hp g hg henergy D T XL XR + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/RationalTreeProfile.lean b/lean/OAI/NumberTheory/Ostmann/Tree/RationalTreeProfile.lean new file mode 100644 index 0000000000000000000000000000000000000000..fce4130ae3f420e79f1ed846e0b6713c1c0afd0d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/RationalTreeProfile.lean @@ -0,0 +1,114 @@ +import OAI.NumberTheory.Ostmann.Characters.TreeProfile + +namespace OAI + +/-! # The actual rational tree with different weights at a horizontal level -/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable def rationalProfileMoment {p : ℕ} [Fact p.Prime] (D : (ZMod p)ˣ) : + {n : ℕ} → {C : (ZMod p)ˣ} → RationalTreeData (ZMod p)ˣ n C → + TreeLeafTuple (ZMod p → ℝ) n → (ZMod p)ˣ → (ZMod p)ˣ → (ZMod p)ˣ → ℝ + | _, _, .leaf s C, w, XL, XR, P => w (rationalTreeArgument s C D XL XR P) + | _, _, .node s CL CR u left right, w, XL, XR, P => + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * ∑ m : (ZMod p)ˣ, + let HL : (ZMod p)ˣ := XL * CL * m + let HR : (ZMod p)ˣ := XR * CR * (P / m) + let v := reconstructedEntry (s : ZMod p) left.frequency right.frequency u HL HR + if hv : v = 0 then 0 else + rationalProfileMoment D left w.1 (Units.mk0 v hv) XL m * + rationalProfileMoment D right w.2 (Units.mk0 v hv) XR (P / m) + +noncomputable def rationalProfileLeafValue {p : ℕ} [Fact p.Prime] (D : (ZMod p)ˣ) : + {n : ℕ} → {C : (ZMod p)ˣ} → RationalTreeData (ZMod p)ˣ n C → + TreeLeafTuple (ZMod p → ℝ) n → (ZMod p)ˣ → (ZMod p)ˣ → + TreeLeafTuple (ZMod p)ˣ n → ℝ + | _, _, .leaf s C, w, XL, XR, m => w (rationalTreeArgument s C D XL XR m) + | n + 1, _, .node s CL CR u left right, w, XL, XR, ab => + let HL : (ZMod p)ˣ := XL * CL * treeLeafProduct n ab.1 + let HR : (ZMod p)ˣ := XR * CR * treeLeafProduct n ab.2 + let v := reconstructedEntry (s : ZMod p) left.frequency right.frequency u HL HR + if hv : v = 0 then 0 else + rationalProfileLeafValue D left w.1 (Units.mk0 v hv) XL ab.1 * + rationalProfileLeafValue D right w.2 (Units.mk0 v hv) XR ab.2 + +theorem rationalProfileMoment_nonneg {p : ℕ} [Fact p.Prime] (D : (ZMod p)ˣ) + {n : ℕ} {C : (ZMod p)ˣ} (T : RationalTreeData (ZMod p)ˣ n C) + (w : TreeLeafTuple (ZMod p → ℝ) n) (hw : treeWeightsNonneg n w) + (XL XR P : (ZMod p)ˣ) : 0 ≤ rationalProfileMoment D T w XL XR P := by + induction T generalizing XL XR P with + | leaf s C => exact hw _ + | node s CL CR u left right ihL ihR => + simp only [rationalProfileMoment] + apply mul_nonneg (by positivity) + apply Finset.sum_nonneg + intro m _ + dsimp + split_ifs + · exact le_rfl + · exact mul_nonneg (ihL w.1 hw.1 _ _ _) (ihR w.2 hw.2 _ _ _) + +theorem rationalProfileMoment_le_majorant {p : ℕ} [Fact p.Prime] (D : (ZMod p)ˣ) + {n : ℕ} {C : (ZMod p)ˣ} (T : RationalTreeData (ZMod p)ˣ n C) + (w : TreeLeafTuple (ZMod p → ℝ) n) (hw : treeWeightsNonneg n w) + (XL XR P : (ZMod p)ˣ) : + rationalProfileMoment D T w XL XR P ≤ + treeProfileMajorant n w (rationalTreeArgument T.frequency C D XL XR P) := by + induction T generalizing XL XR P with + | leaf s C => + simp only [rationalProfileMoment, RationalTreeData.frequency, treeProfileMajorant, + Units.ne_zero, ite_false, le_refl] + | @node n s CL CR u left right ihL ihR => + have harg := rationalTreeArgument_node s CL CR D XL XR P + change _ ≤ treeProfileMajorant (n + 1) w (rationalTreeArgument s (CL * CR) D XL XR P) + rw [harg] + simp only [treeProfileMajorant, Units.ne_zero, ite_false] + calc + _ ≤ (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * + ∑ m : (ZMod p)ˣ, rationalNodeValue s left.frequency right.frequency D u XL XR CL CR P + (treeProfileMajorant n w.1) (treeProfileMajorant n w.2) m := by + unfold rationalProfileMoment + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Finset.sum_le_sum + intro m _ + dsimp [rationalNodeValue] + split_ifs with hv + · exact le_rfl + · have hL := ihL w.1 hw.1 (Units.mk0 _ hv) XL m + have hR := ihR w.2 hw.2 (Units.mk0 _ hv) XR (P / m) + rw [rationalTreeArgument_child] at hL hR + exact mul_le_mul hL hR (rationalProfileMoment_nonneg D right w.2 hw.2 _ _ _) + (treeProfileMajorant_nonneg n w.1 hw.1 _) + _ ≤ (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * + (2 * ∑ x : ZMod p, treeProfileMajorant n w.1 x * + treeProfileMajorant n w.2 (x - rationalNodeArgument s D XL XR CL CR P)) := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + exact rationalNodeValue_sum_le s left.frequency right.frequency D u XL XR CL CR P + _ _ (treeProfileMajorant_zero n w.1) (treeProfileMajorant_zero n w.2) + (treeProfileMajorant_nonneg n w.1 hw.1) (treeProfileMajorant_nonneg n w.2 hw.2) + _ = _ := by unfold differenceMoment; ring + +theorem rationalProfileMoment_mean_le {p : ℕ} [Fact p.Prime] (D : (ZMod p)ˣ) + {n : ℕ} {C : (ZMod p)ˣ} (T : RationalTreeData (ZMod p)ˣ n C) + (w : TreeLeafTuple (ZMod p → ℝ) n) (hw : treeWeightsNonneg n w) + (XL XR : (ZMod p)ˣ) : + (∑ P : (ZMod p)ˣ, rationalProfileMoment D T w XL XR P) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ (2 : ℝ) ^ (2 ^ n - 1) * treeProfileMean n w := by + calc + _ ≤ (∑ P : (ZMod p)ˣ, + treeProfileMajorant n w (rationalTreeArgument T.frequency C D XL XR P)) / + (Fintype.card (ZMod p)ˣ : ℝ) := by + apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg _) + exact Finset.sum_le_sum fun P _ => rationalProfileMoment_le_majorant D T w hw XL XR P + _ = (∑ d : (ZMod p)ˣ, treeProfileMajorant n w d) / + (Fintype.card (ZMod p)ˣ : ℝ) := by + congr 1 + exact (rationalTreeArgumentEquiv T.frequency C D XL XR).sum_comp + (fun d => treeProfileMajorant n w d) + _ ≤ _ := treeProfileMajorant_mean_le n w hw + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalCoordinates.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..ac03afaa5ca90e97e20576d9246c10acf800ddab --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalCoordinates.lean @@ -0,0 +1,47 @@ +import Mathlib.Algebra.Field.Basic +import Mathlib.Tactic + +namespace OAI + +/-! +# Reciprocal coordinates for the uniform Mellin estimate + +The change of variables `r = lam - 1/d` is a permutation even with +the field's zero-inverse convention. Away from the singular bottom-pair +ratio, it turns reciprocal leaf arguments into a quadratic affine map. +-/ + +namespace Ostmann + +variable {K : Type*} [Field K] + +def reciprocalCoordinates (lam : K) : K ≃ K where + toFun d := lam - d⁻¹ + invFun r := (lam - r)⁻¹ + left_inv d := by simp + right_inv r := by simp + +theorem reciprocal_right_argument (lam d : K) (hd : d ≠ 0) : + (d / (lam * d - 1))⁻¹ = lam - d⁻¹ := by + rw [inv_div] + field_simp + +theorem reciprocal_left_argument (lam d : K) (hlam : lam ≠ 0) (hd : d ≠ 0) : + (d * (lam * d) / (lam * d - 1))⁻¹ = + (lam - d⁻¹) - (lam - d⁻¹) ^ 2 / lam := by + rw [inv_div] + field_simp + ring + +theorem reciprocal_coordinate_eq_zero (lam d : K) (hd : d ≠ 0) : + lam - d⁻¹ = 0 ↔ lam * d = 1 := by + rw [sub_eq_zero] + constructor + · intro h + rw [h, inv_mul_cancel₀ hd] + · intro h + exact mul_right_cancel₀ hd (by simpa only [inv_mul_cancel₀ hd] using h) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalDiagonal.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalDiagonal.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad4cc2bda2c2091d6c14f69190bd320d00fd5b76 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalDiagonal.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.Ostmann.Tree.ReciprocalPair +import OAI.NumberTheory.Ostmann.Characters.MellinDiagonal +import OAI.NumberTheory.Ostmann.Characters.BottomPairMellin + +namespace OAI + +/-! +# The diagonal average is an affine correlation + +The substitution `r = lam - 1/d` turns the weighted bottom-pair diagonal +into the affine averaging operator applied to the reciprocal twist. +-/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +theorem fieldBottomPair_eq_bottomPairValue {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (hg : g 0 = 0) (d t : (ZMod p)ˣ) : + fieldBottomPair g d t = bottomPairValue g d t := by + classical + by_cases ht : t = 1 + · subst t + simp [fieldBottomPair, bottomPairValue, hg] + · simp only [bottomPairValue, ht, ite_false, fieldBottomPair] + +theorem mellinDiagonal_reciprocal {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (hg : g 0 = 0) (η : MulChar (ZMod p) ℂ) + (a : ZMod p) (lam : (ZMod p)ˣ) : + mellinDiagonal (bottomPairValue g) + (fun d : (ZMod p)ˣ => η d * ZMod.stdAddChar (-(a * (d : ZMod p)))) lam = + conj (η lam) * + affineAverage (fun r : (ZMod p)ˣ => conj (reciprocalTwist g η a r)) + (reciprocalTwist g η a) ((lam : ZMod p)⁻¹) := by + classical + let G := reciprocalTwist g η a + let H : ZMod p → ℂ := fun d => + fieldBottomPair g d ((lam : ZMod p) * d) * η d * ZMod.stdAddChar (-(a * d)) + let F : ZMod p → ℂ := fun r => conj (G r) * G (r - r ^ 2 / (lam : ZMod p)) + have hH0 : H 0 = 0 := by simp [H, fieldBottomPair, hg] + have hF0 : F 0 = 0 := by simp [F, G, reciprocalTwist_zero g hg] + have hpoint (d : ZMod p) : H d = conj (η lam) * F ((lam : ZMod p) - d⁻¹) := + reciprocal_diagonal_pair g hg η a lam d + have hreindex : (∑ d : ZMod p, F ((lam : ZMod p) - d⁻¹)) = ∑ r : ZMod p, F r := + (reciprocalCoordinates (lam : ZMod p)).bijective.sum_comp F + calc + _ = (p : ℂ)⁻¹ * ∑ d : (ZMod p)ˣ, H d := by + unfold mellinDiagonal + congr 1 + apply Finset.sum_congr rfl + intro d _ + dsimp only [H] + rw [← Units.val_mul, fieldBottomPair_eq_bottomPairValue g hg] + ring + _ = (p : ℂ)⁻¹ * ∑ d : ZMod p, H d := by + rw [sum_units_eq_sum_of_zero H hH0] + _ = conj (η lam) * ((p : ℂ)⁻¹ * ∑ r : ZMod p, F r) := by + simp_rw [hpoint] + rw [← Finset.mul_sum, hreindex] + ring + _ = _ := by + rw [← sum_units_eq_sum_of_zero F hF0] + simp only [F, G, affineAverage, affineGenerator, div_eq_mul_inv] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalPair.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalPair.lean new file mode 100644 index 0000000000000000000000000000000000000000..42324c48332bc27092c7c14399e4678e4bba8166 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalPair.lean @@ -0,0 +1,78 @@ +import OAI.NumberTheory.Ostmann.Tree.ReciprocalCoordinates +import OAI.NumberTheory.Ostmann.Characters.ReciprocalTwist +import OAI.NumberTheory.Ostmann.Tree.BottomPairCoordinates + +namespace OAI + +/-! +# The reciprocal pair identity + +The character and additive phases in the reciprocal twist combine into +the diagonal bottom-pair weight. This is the pointwise calculation behind +the affine-operator parametrization of the uniform Mellin estimate. +-/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +noncomputable def fieldBottomPair {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (d t : ZMod p) : ℂ := + g (d * t / (t - 1)) * conj (g (d / (t - 1))) + +theorem reciprocalTwist_pair_identity {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (η : MulChar (ZMod p) ℂ) (a : ZMod p) + (lam : (ZMod p)ˣ) (d x z : ZMod p) (hz : z ≠ 0) + (hx : x = (lam : ZMod p) * d * z) (hdiff : x - z = d) : + conj (η lam) * (conj (reciprocalTwist g η a z⁻¹) * reciprocalTwist g η a x⁻¹) = + g x * conj (g z) * η d * ZMod.stdAddChar (-(a * d)) := by + have hchar : η x = η lam * η d * η z := by rw [hx, map_mul, map_mul] + have hphase : ZMod.stdAddChar (-(a * x)) = + ZMod.stdAddChar (-(a * d)) * ZMod.stdAddChar (-(a * z)) := by + rw [show -(a * x) = -(a * d) + -(a * z) by rw [← hdiff]; ring, + AddChar.map_add_eq_mul] + have hnlam : ‖η lam‖ = 1 := norm_mulChar_unit η lam + have hnz : ‖η z‖ = 1 := norm_mulChar_unit η (Units.mk0 z hz) + have hne : ‖ZMod.stdAddChar (-(a * z))‖ = 1 := by simp [ZMod.stdAddChar_apply] + calc + _ = (g x * conj (g z) * η d * ZMod.stdAddChar (-(a * d))) * + (conj (η lam) * η lam) * (conj (η z) * η z) * + (conj (ZMod.stdAddChar (-(a * z))) * ZMod.stdAddChar (-(a * z))) := by + simp only [reciprocalTwist, inv_inv, hchar, hphase, map_mul] + ring + _ = _ := by rw [Complex.conj_mul', Complex.conj_mul', Complex.conj_mul', hnlam, hnz, hne]; norm_num + +theorem reciprocal_diagonal_pair {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (hg : g 0 = 0) (η : MulChar (ZMod p) ℂ) + (a : ZMod p) (lam : (ZMod p)ˣ) (d : ZMod p) : + fieldBottomPair g d ((lam : ZMod p) * d) * η d * ZMod.stdAddChar (-(a * d)) = + conj (η lam) * + (conj (reciprocalTwist g η a ((lam : ZMod p) - d⁻¹)) * + reciprocalTwist g η a + (((lam : ZMod p) - d⁻¹) - ((lam : ZMod p) - d⁻¹) ^ 2 / (lam : ZMod p))) := by + by_cases hd : d = 0 + · subst d + have hgen : (lam : ZMod p) - (lam : ZMod p) ^ 2 / (lam : ZMod p) = 0 := by + field_simp + ring + simp only [fieldBottomPair, mul_zero, zero_sub, zero_div, hg, zero_mul, inv_zero, + sub_zero, hgen, reciprocalTwist_zero g hg, mul_zero] + · by_cases hsing : (lam : ZMod p) * d = 1 + · have hr : (lam : ZMod p) - d⁻¹ = 0 := (reciprocal_coordinate_eq_zero _ _ hd).mpr hsing + simp only [fieldBottomPair, hsing, sub_self, div_zero, hg, zero_mul, hr, + reciprocalTwist_zero g hg, map_zero, mul_zero] + · let x := d * ((lam : ZMod p) * d) / ((lam : ZMod p) * d - 1) + let z := d / ((lam : ZMod p) * d - 1) + have hz : z ≠ 0 := div_ne_zero hd (sub_ne_zero.mpr hsing) + have hx : x = (lam : ZMod p) * d * z := by dsimp [x, z]; ring + have hdiff : x - z = d := pair_coordinate_difference d ((lam : ZMod p) * d) hsing + have hr : z⁻¹ = (lam : ZMod p) - d⁻¹ := reciprocal_right_argument _ _ hd + have hq : x⁻¹ = ((lam : ZMod p) - d⁻¹) - + ((lam : ZMod p) - d⁻¹) ^ 2 / (lam : ZMod p) := + reciprocal_left_argument _ _ (Units.ne_zero lam) hd + simpa only [fieldBottomPair, x, z, hr, hq] using + (reciprocalTwist_pair_identity g η a lam d x z hz hx hdiff).symm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalTwist.lean b/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalTwist.lean new file mode 100644 index 0000000000000000000000000000000000000000..243adcb821abc92d26cc7df58bfadce0eaadbd6c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/ReciprocalTwist.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.Ostmann.Tree.AffineSelfBound + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem norm_mulChar_unit (χ : MulChar (ZMod p) ℂ) (u : (ZMod p)ˣ) : ‖χ u‖=1 := by + simpa only [MulChar.coe_equivToUnitHom] using + Complex.norm_eq_one_of_mem_rootsOfUnity (MulChar.apply_mem_rootsOfUnity (χ := χ) u) + +def reciprocalTwist (g : ZMod p → ℂ) (η : MulChar (ZMod p) ℂ) (c : ZMod p) + (h : ZMod p) : ℂ := g h⁻¹*η h⁻¹*ZMod.stdAddChar (c*h⁻¹) + +@[simp] theorem reciprocalTwist_zero (g : ZMod p → ℂ) (η : MulChar (ZMod p) ℂ) + (c : ZMod p) (hg : g 0=0) : reciprocalTwist g η c 0=0 := by + simp [reciprocalTwist, hg] + +theorem reciprocalTwist_mean (g : ZMod p → ℂ) (η : MulChar (ZMod p) ℂ) + (c : ZMod p) : mean (reciprocalTwist g η c)=mixedCorrelation g η c := by + unfold mean reciprocalTwist mixedCorrelation + congr 1 + exact inv_involutive.bijective.sum_comp + (fun h : ZMod p => g h*η h*ZMod.stdAddChar (c*h)) + +theorem reciprocalTwist_norm (g : ZMod p → ℂ) (η : MulChar (ZMod p) ℂ) + (c h : ZMod p) (hg : g 0=0) : ‖reciprocalTwist g η c h‖=‖g h⁻¹‖ := by + by_cases hh : h=0 + · subst h + simp [reciprocalTwist, hg] + · have hi : h⁻¹ ≠ 0 := inv_ne_zero hh + have he := norm_mulChar_unit η (Units.mk0 h⁻¹ hi) + change ‖η h⁻¹‖=1 at he + have hephase : ‖ZMod.stdAddChar (c*h⁻¹)‖=1 := + AddChar.norm_apply (ZMod.stdAddChar : AddChar (ZMod p) ℂ) _ + simp only [reciprocalTwist, norm_mul, he, hephase, mul_one] + +theorem reciprocalTwist_l2Sq (g : ZMod p → ℂ) (η : MulChar (ZMod p) ℂ) + (c : ZMod p) (hg : g 0=0) : l2Sq (reciprocalTwist g η c)=l2Sq g := by + simp only [l2Sq, reciprocalTwist_norm g η c _ hg] + congr 1 + exact inv_involutive.bijective.sum_comp (fun h : ZMod p => ‖g h‖^2) + +theorem reciprocalTwist_affine_bound (g : ZMod p → ℂ) (η : MulChar (ZMod p) ℂ) + (c : ZMod p) (hg0 : g 0=0) (hg : l2Sq g ≤ 1) : + l2Sq (weightedAffine (fun r => conj (reciprocalTwist g η c r)) (reciprocalTwist g η c)) ≤ + (correlationBound g : ℝ)^4 + Real.sqrt (3/(p:ℝ)) := by + have hG := weightedAffine_self_bound (reciprocalTwist g η c) + (reciprocalTwist_zero g η c hg0) (by rwa [reciprocalTwist_l2Sq g η c hg0]) + rw [reciprocalTwist_mean] at hG + exact hG.trans (add_le_add + (pow_le_pow_left₀ (norm_nonneg _) (norm_mixedCorrelation_le g η c) 4) le_rfl) + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/SamePairFiber.lean b/lean/OAI/NumberTheory/Ostmann/Tree/SamePairFiber.lean new file mode 100644 index 0000000000000000000000000000000000000000..cbf422e1309da4e8c436131fcbf478435a84d5d1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/SamePairFiber.lean @@ -0,0 +1,93 @@ +import OAI.NumberTheory.Ostmann.Characters.QuartetSamePairBound +import OAI.NumberTheory.Ostmann.Tree.CrossQuartetFiber + +namespace OAI + +/-! # Exact product-fiber laws for the two same-pair parametrizations -/ + +namespace Ostmann + +open scoped BigOperators + +local instance samePairZeroTupleCommGroup {U : Type*} [CommGroup U] : + CommGroup (TreeLeafTuple U 0) := inferInstanceAs (CommGroup U) + +private theorem first_of_product {U : Type*} [CommGroup U] (a b c d P : U) + (h : (a * b) * (c * d) = P) : P / ((c * d) * b) = a := by + apply div_eq_iff_eq_mul.mpr + exact h.symm.trans (by ac_rfl) + +noncomputable def samePairLeftFiberEquiv {U : Type*} [CommGroup U] (P : U) : + TreeLeafFiber U 2 P ≃ U × (U × U) where + toFun m := ((m.1.2.1 : U) * m.1.2.2, m.1.2.2, m.1.1.2) + invFun x := ⟨samePairLeftLeaves P x.1 x.2.1 x.2.2, + samePair_total_product P x.1 x.2.1 x.2.2⟩ + left_inv m := by + apply Subtype.ext + apply Prod.ext + · exact Prod.ext (first_of_product m.1.1.1 m.1.1.2 m.1.2.1 m.1.2.2 P m.property) rfl + · exact Prod.ext (mul_div_cancel_right _ _) rfl + right_inv x := by + change ((x.1 / x.2.1) * x.2.1, x.2.1, x.2.2) = x + simp only [div_mul_cancel] + +private theorem third_of_product {U : Type*} [CommGroup U] (a b c d P : U) + (h : (a * b) * (c * d) = P) : P * (a * b)⁻¹ / d = c := by + apply div_eq_iff_eq_mul.mpr + apply mul_inv_eq_iff_eq_mul.mpr + exact h.symm.trans (by ac_rfl) + +private theorem undo_pair_product {U : Type*} [CommGroup U] (a b : U) : + ((a * b)⁻¹)⁻¹ / b = a := by rw [inv_inv, mul_div_cancel_right] + +noncomputable def samePairRightFiberEquiv {U : Type*} [CommGroup U] (P : U) : + TreeLeafFiber U 2 P ≃ U × (U × U) where + toFun m := (((m.1.1.1 : U) * m.1.1.2)⁻¹, m.1.1.2, m.1.2.2) + invFun x := ⟨samePairRightLeaves P x.1 x.2.1 x.2.2, + samePair_right_total_product P x.1 x.2.1 x.2.2⟩ + left_inv m := by + apply Subtype.ext + apply Prod.ext + · apply Prod.ext + · exact undo_pair_product m.1.1.1 m.1.1.2 + · rfl + · exact Prod.ext (third_of_product m.1.1.1 m.1.1.2 m.1.2.1 m.1.2.2 P m.property) rfl + right_inv x := by + change (((x.1⁻¹ / x.2.1) * x.2.1)⁻¹, x.2.1, x.2.2) = x + simp only [div_mul_cancel, inv_inv] + +theorem samePairLeftFiberEquiv_symm {U : Type*} [CommGroup U] (P a b r : U) : + ((samePairLeftFiberEquiv P).symm (a, b, r)).1 = samePairLeftLeaves P a b r := rfl + +theorem samePairRightFiberEquiv_symm {U : Type*} [CommGroup U] (P a b r : U) : + ((samePairRightFiberEquiv P).symm (a, b, r)).1 = samePairRightLeaves P a b r := rfl + +theorem sum_samePairLeftFiber {U R : Type*} [CommGroup U] [Fintype U] + [AddCommMonoid R] (P : U) (f : TreeLeafTuple U 2 → R) : + (∑ m : TreeLeafFiber U 2 P, f m.1) = + ∑ a : U, ∑ b : U, ∑ r : U, f (samePairLeftLeaves P a b r) := by + have h := (samePairLeftFiberEquiv P).symm.bijective.sum_comp + (fun m : TreeLeafFiber U 2 P => f m.1) + simpa only [Fintype.sum_prod_type, samePairLeftFiberEquiv_symm] using h.symm + +theorem sum_samePairRightFiber {U R : Type*} [CommGroup U] [Fintype U] + [AddCommMonoid R] (P : U) (f : TreeLeafTuple U 2 → R) : + (∑ m : TreeLeafFiber U 2 P, f m.1) = + ∑ a : U, ∑ b : U, ∑ r : U, f (samePairRightLeaves P a b r) := by + have h := (samePairRightFiberEquiv P).symm.bijective.sum_comp + (fun m : TreeLeafFiber U 2 P => f m.1) + simpa only [Fintype.sum_prod_type, samePairRightFiberEquiv_symm] using h.symm + +theorem mean_samePairLeftFiber {U : Type*} [CommGroup U] [Fintype U] + (P : U) (f : TreeLeafTuple U 2 → ℝ) : + (Fintype.card (TreeLeafFiber U 2 P) : ℝ)⁻¹ * (∑ m : TreeLeafFiber U 2 P, f m.1) = + (Fintype.card U : ℝ)⁻¹ * (∑ a : U, (Fintype.card U : ℝ)⁻¹ * + (∑ b : U, (Fintype.card U : ℝ)⁻¹ * ∑ r : U, f (samePairLeftLeaves P a b r))) := by + rw [sum_samePairLeftFiber P f, card_treeLeafFiber] + norm_num only [Nat.reducePow, Nat.reduceSub, Nat.cast_pow] + simp only [← Finset.mul_sum] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/SamePairHeldAverage.lean b/lean/OAI/NumberTheory/Ostmann/Tree/SamePairHeldAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3be6c18f4f4033d6072a1b849f0707203433399 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/SamePairHeldAverage.lean @@ -0,0 +1,92 @@ +import OAI.NumberTheory.Ostmann.Tree.PairSquareMoment +import OAI.NumberTheory.Ostmann.Characters.SquareRatioCoefficient + +namespace OAI + +/-! # Exposing the held product and split in a same-pair quartet -/ + +namespace Ostmann + +open scoped BigOperators + +theorem quartetRatioValue_samePair_coordinates {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (y K L q b r : (ZMod p)ˣ) : + quartetRatioValue g h true true y (K * r ^ 2) (L * b ^ 2) q = + if q = 1 then 0 else + let d := (y : ZMod p) * (q : ZMod p) / ((q : ZMod p) - 1) + fieldBottomPairValue g d ((K : ZMod p) * d * (r : ZMod p) ^ 2) * + fieldBottomPairValue h (d - y) + ((L : ZMod p) * (d - y) * (b : ZMod p) ^ 2) := by + unfold quartetRatioValue ratioTest + split_ifs + · rfl + · simp only [quartetLeftRatio, quartetRightRatio, ite_true, Units.val_mul, + Units.val_pow_eq_pow_val] + congr 2 <;> ring + +/-- The two held averages cost four; the moving square pullback costs two. +All fixed unit parameters disappear from the resulting majorant. -/ +theorem samePair_held_coefficient_le {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (y J K L : (ZMod p)ˣ) (ρ : MulChar (ZMod p) ℂ) : + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * (∑ a : (ZMod p)ˣ, + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * ∑ b : (ZMod p)ˣ, + ‖mellinCoefficient (fun r : (ZMod p)ˣ => + quartetRatioValue g h true true y (K * r ^ 2) (L * b ^ 2) (J * a ^ 2)) ρ‖ ^ 2) ≤ + 8 * samePairMajorant (fieldPairCoefficientMoment g) (fieldPairMoment h) ρ y := by + let A (d : ZMod p) := squareCharacterMass (fun χ => fieldPairCoefficientMoment g χ d) ρ + let H (q : (ZMod p)ˣ) := if q = 1 then 0 else + let d := (y : ZMod p) * (q : ZMod p) / ((q : ZMod p) - 1) + A d * fieldPairMoment h (d - y) + have hA (d : ZMod p) : 0 ≤ A d := + squareCharacterMass_nonneg _ (fun _ => sq_nonneg _) _ + have hH (q : (ZMod p)ˣ) : 0 ≤ H q := by + dsimp [H] + split_ifs + · exact le_rfl + · exact mul_nonneg (hA _) (fieldPairMoment_nonneg h _) + have hp (q : (ZMod p)ˣ) : + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * (∑ b : (ZMod p)ˣ, + ‖mellinCoefficient (fun r : (ZMod p)ˣ => + quartetRatioValue g h true true y (K * r ^ 2) (L * b ^ 2) q) ρ‖ ^ 2) ≤ + 4 * H q := by + simp_rw [quartetRatioValue_samePair_coordinates] + by_cases hq : q = 1 + · simp [hq, H, mellinCoefficient] + · simp only [hq, ite_false, H] + simpa only [A, mul_assoc] using samePair_fixed_arguments_le g h + ((y : ZMod p) * (q : ZMod p) / ((q : ZMod p) - 1)) + ((y : ZMod p) * (q : ZMod p) / ((q : ZMod p) - 1) - y) K L ρ + have hsum : (∑ q : (ZMod p)ˣ, H q) = + differenceMoment A (fieldPairMoment h) y := by + have hzero : A 0 = 0 := by simp [A, squareCharacterMass] + have hs := pair_ratio_sum_eq y A (fieldPairMoment h) hzero (fieldPairMoment_zero h) + change (∑ q : (ZMod p)ˣ, H q) = ∑ x : ZMod p, A x * fieldPairMoment h (x - y) + rw [← hs] + apply Finset.sum_congr rfl + intro q _ + dsimp [H] + split_ifs with hq + · rfl + · have hq' : (q : ZMod p) ≠ 1 := fun h => hq (Units.ext h) + have hd := pair_coordinate_difference (y : ZMod p) (q : ZMod p) hq' + congr 2 + linear_combination hd + calc + _ ≤ (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * ∑ a : (ZMod p)ˣ, 4 * H (J * a ^ 2) := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + exact Finset.sum_le_sum fun a _ => hp (J * a ^ 2) + _ = 4 * (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * ∑ a : (ZMod p)ˣ, H (J * a ^ 2) := by + rw [← Finset.mul_sum] + ring + _ ≤ 4 * (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * (2 * ∑ q : (ZMod p)ˣ, H q) := + mul_le_mul_of_nonneg_left (sum_square_coset_le_twice J H hH) (by positivity) + _ = _ := by + rw [hsum] + change 4 * (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * + (2 * differenceMoment A (fieldPairMoment h) y) = + 8 * ((Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * differenceMoment A (fieldPairMoment h) y) + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/SamePairMajorant.lean b/lean/OAI/NumberTheory/Ostmann/Tree/SamePairMajorant.lean new file mode 100644 index 0000000000000000000000000000000000000000..f655af43670653cb30e7c479e29f514a27c00e46 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/SamePairMajorant.lean @@ -0,0 +1,86 @@ +import OAI.NumberTheory.Ostmann.Tree.DeletedPairEnergy + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +variable {p : ℕ} [Fact p.Prime] + +def samePairMajorant (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) : ZMod p → ℝ := + nonnegativeDifference (pairSquareEnergy g σ ρ) (pairSecondMoment h τ) + +def untouchedMajorant (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) : ZMod p → ℝ := + nonnegativeDifference (pairSecondMoment g σ) (pairSecondMoment h τ) + +theorem samePairMajorant_nonneg (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : 0 ≤ samePairMajorant g h σ τ ρ y := + nonnegativeDifference_nonneg _ _ (pairSquareEnergy_nonneg g σ ρ) (pairSecondMoment_nonneg h τ) y + +theorem untouchedMajorant_nonneg (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (y : ZMod p) : 0≤untouchedMajorant g h σ τ y := + nonnegativeDifference_nonneg _ _ (pairSecondMoment_nonneg g σ) (pairSecondMoment_nonneg h τ) y + +theorem samePairMajorant_mean_bound (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) (hh0 : h 0=0) (hh : l2Sq h≤1) : + unitMean (samePairMajorant g h σ τ ρ) ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^3* + ∑ χ : MulChar (ZMod p) ℂ with χ^2=ρ,pairFourthMass g χ := by + classical + have hN : (Fintype.card (ZMod p)ˣ:ℝ)≠0 := by exact_mod_cast Fintype.card_ne_zero + apply (nonnegativeDifference_mean _ _ (pairSquareEnergy_nonneg g σ ρ) (pairSecondMoment_nonneg h τ)).trans + calc + _ ≤ (Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2* + (((p:ℝ)*∑ χ : MulChar (ZMod p) ℂ with χ^2=ρ,pairFourthMass g χ)* + ((p:ℝ)^2/(Fintype.card (ZMod p)ˣ:ℝ))) := by + apply mul_le_mul_of_nonneg_left _ (sq_nonneg _) + exact mul_le_mul (pairSquareEnergy_total g σ ρ) (pairSecondMoment_total h τ hh0 hh) + (Finset.sum_nonneg (fun d _ => pairSecondMoment_nonneg h τ d)) + (mul_nonneg (by positivity) (Finset.sum_nonneg (fun χ _ => by unfold pairFourthMass; positivity))) + _ = _ := by field_simp + +theorem samePairMajorant_mean_small (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (ρ : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) + (hh0 : h 0=0) (hh : l2Sq h≤1) : + unitMean (samePairMajorant g h σ τ ρ) ≤ + 2*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^5*(correlationBound g:ℝ)^2 := by + apply (samePairMajorant_mean_bound g h σ τ ρ hh0 hh).trans + apply (mul_le_mul_of_nonneg_left (pairFourthMass_square_fiber g ρ hg0 hg) (by positivity)).trans_eq + ring + +theorem samePairMajorant_mean_total (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (hg0 : g 0=0) (hg : l2Sq g≤1) (hh0 : h 0=0) (hh : l2Sq h≤1) : + (∑ ρ : MulChar (ZMod p) ℂ,unitMean (samePairMajorant g h σ τ ρ)) ≤ + 2*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^4 := by + classical + calc + _ ≤ ∑ ρ : MulChar (ZMod p) ℂ,((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^3* + ∑ χ : MulChar (ZMod p) ℂ with χ^2=ρ,pairFourthMass g χ := + Finset.sum_le_sum (fun ρ _ => samePairMajorant_mean_bound g h σ τ ρ hh0 hh) + _ = ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^3*∑ χ : MulChar (ZMod p) ℂ,pairFourthMass g χ := by + rw [← Finset.mul_sum] + simp only [Finset.sum_filter] + rw [Finset.sum_comm] + simp + _ ≤ ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^3*(2*(p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ)) := + mul_le_mul_of_nonneg_left (pairFourthMass_total g hg0 hg) (by positivity) + _ = _ := by ring + +theorem untouchedMajorant_mean (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (hg0 : g 0=0) (hg : l2Sq g≤1) (hh0 : h 0=0) (hh : l2Sq h≤1) : + unitMean (untouchedMajorant g h σ τ) ≤ ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^4 := by + have hN : (Fintype.card (ZMod p)ˣ:ℝ)≠0 := by exact_mod_cast Fintype.card_ne_zero + apply (nonnegativeDifference_mean _ _ (pairSecondMoment_nonneg g σ) (pairSecondMoment_nonneg h τ)).trans + calc + _ ≤ (Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2* + (((p:ℝ)^2/(Fintype.card (ZMod p)ˣ:ℝ))*((p:ℝ)^2/(Fintype.card (ZMod p)ˣ:ℝ))) := by + apply mul_le_mul_of_nonneg_left _ (sq_nonneg _) + exact mul_le_mul (pairSecondMoment_total g σ hg0 hg) (pairSecondMoment_total h τ hh0 hh) + (Finset.sum_nonneg (fun d _ => pairSecondMoment_nonneg h τ d)) (by positivity) + _ = _ := by field_simp + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/SamePairMeanBounds.lean b/lean/OAI/NumberTheory/Ostmann/Tree/SamePairMeanBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..e63b1cb578c9bf4762969a3921f06ee4167fc546 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/SamePairMeanBounds.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.Ostmann.Tree.PairCoefficientMeans + +namespace OAI + +/-! # The two quantitative mean bounds for the concrete same-pair majorant -/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable local instance samePairMeanBoundsFintype {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +theorem concrete_samePairMajorant_mean_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (hg : g 0 = 0) (ε : ℝ) (hε : 0 ≤ ε) + (hflat : ∀ χ a, ‖additiveFourier (characterTwist g χ) a‖ ≤ ε) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) + (ρ : MulChar (ZMod p) ℂ) : + (∑ y : (ZMod p)ˣ, + samePairMajorant (fieldPairCoefficientMoment g) (fieldPairMoment g) ρ y) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ + 2 * ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 5 * ε ^ 2 := by + have h := samePairMajorant_mean_le (fieldPairCoefficientMoment g) (fieldPairMoment g) + (fun _ _ => sq_nonneg _) (fieldPairMoment_nonneg g) + (((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 3 * ε ^ 2) + (((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2) (by positivity) + (fun χ => fieldPairCoefficientMoment_mean_le g hg χ ε hε (hflat χ) henergy) + (fieldPairMoment_mean_le g hg henergy) ρ + convert h using 1 + ring + +theorem concrete_samePairMajorant_total_mean_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) : + (∑ ρ : MulChar (ZMod p) ℂ, (∑ y : (ZMod p)ˣ, + samePairMajorant (fieldPairCoefficientMoment g) (fieldPairMoment g) ρ y) / + (Fintype.card (ZMod p)ˣ : ℝ)) ≤ + ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 4 := by + have h := samePairMajorant_total_mean_le (fieldPairCoefficientMoment g) (fieldPairMoment g) + (fun _ _ => sq_nonneg _) (fieldPairMoment_nonneg g) + (((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2) + (((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2) (sq_nonneg _) + (fieldPairCoefficientMoment_total_mean_le g hg henergy) + (fieldPairMoment_mean_le g hg henergy) + convert h using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/SampleEqualityPatterns.lean b/lean/OAI/NumberTheory/Ostmann/Tree/SampleEqualityPatterns.lean new file mode 100644 index 0000000000000000000000000000000000000000..7287e93880b1a7cede07520e1a73334249262fe3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/SampleEqualityPatterns.lean @@ -0,0 +1,63 @@ +import Mathlib.Data.Setoid.Basic +import Mathlib.Data.Fintype.Powerset +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Algebra.BigOperators.Group.Finset.Basic + +namespace OAI + +/-! # Exact decomposition of finite samples by equality pattern -/ + +namespace Ostmann +open scoped Classical BigOperators + +/-- A pattern records exactly which sampled positions coincide. Its class values +are distinct; independence is imposed only on their dominating product prior. -/ +abbrev SampleEqualityPattern (I A : Type*) := + Σ s : Setoid I, {x : Quotient s → A // Function.Injective x} + +def SampleEqualityPattern.evaluate {I A : Type*} (p : SampleEqualityPattern I A) : I → A := + fun i => p.2.val (Quotient.mk'' i) + +theorem SampleEqualityPattern.kernel_evaluate {I A : Type*} + (p : SampleEqualityPattern I A) : Setoid.ker p.evaluate = p.1 := by + ext i j + exact ⟨fun h => Quotient.exact (p.2.property h), fun h => congrArg p.2.val (Quotient.sound h)⟩ + +/-- Every sample has a unique equality pattern and a unique injective assignment +of values to its classes. -/ +noncomputable def sampleEqualityPatternEquiv (I A : Type*) : + SampleEqualityPattern I A ≃ (I → A) := + Equiv.ofBijective SampleEqualityPattern.evaluate ⟨by + rintro ⟨s, x⟩ ⟨t, y⟩ h + have hs : s = t := (SampleEqualityPattern.kernel_evaluate ⟨s, x⟩).symm.trans + ((congrArg Setoid.ker h).trans (SampleEqualityPattern.kernel_evaluate ⟨t, y⟩)) + cases hs + congr 1 + apply Subtype.ext + funext q + induction q using Quotient.inductionOn with + | _ i => exact congrFun h i, + fun x => ⟨⟨Setoid.ker x, ⟨Setoid.kerLift x, Setoid.kerLift_injective x⟩⟩, rfl⟩⟩ + +@[instance_reducible] noncomputable def sampleSetoidFintype (I : Type*) [Fintype I] : Fintype (Setoid I) := + Fintype.ofInjective (fun s : Setoid I => {p : I × I | s p.1 p.2}) (by + intro s t h + ext i j + exact Set.ext_iff.mp h (i, j)) + +/-- This equality is a decomposition, so no number-of-samples factor is lost. -/ +theorem sum_sample_equality_patterns {I A : Type*} [Fintype I] [Fintype A] + {M : Type*} [AddCommMonoid M] (f : (I → A) → M) : + letI := sampleSetoidFintype I + (∑ x : I → A, f x) = + ∑ s : Setoid I, ∑ x : {x : Quotient s → A // Function.Injective x}, + f (fun i => x.val (Quotient.mk'' i)) := by + let _ := sampleSetoidFintype I + calc + _ = ∑ p : SampleEqualityPattern I A, f p.evaluate := + (Equiv.sum_comp (sampleEqualityPatternEquiv I A) f).symm + _ = _ := Fintype.sum_sigma _ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/SignedCycleBound.lean b/lean/OAI/NumberTheory/Ostmann/Tree/SignedCycleBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..71bff9c7471d2148eacadb5a076ca2ab1b092c3b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/SignedCycleBound.lean @@ -0,0 +1,81 @@ +import Mathlib.Logic.Equiv.Prod +import OAI.NumberTheory.Ostmann.Characters.ProductMellinParseval +import OAI.NumberTheory.Ostmann.Characters.CycleCoefficient + +namespace OAI + +/-! # Quantitative coefficient bound for a signed cycle -/ + +namespace Ostmann + +open scoped BigOperators + +theorem sum_funSplitAt {I G R : Type*} [Fintype I] [DecidableEq I] [Fintype G] + [AddCommMonoid R] (i : I) (f : G → ({j : I // j ≠ i} → G) → R) : + (∑ ρ : I → G, f (ρ i) (fun j => ρ j.1)) = + ∑ a : G, ∑ τ : {j : I // j ≠ i} → G, f a τ := by + have h := (Equiv.funSplitAt i G).sum_comp (fun x => f x.1 x.2) + change (∑ ρ : I → G, f (ρ i) (fun j => ρ j.1)) = _ at h + simpa only [Fintype.sum_prod_type] using h + +/-- Once a cycle index has sign `1` or `-1`, its character is determined by all the others. -/ +theorem signedCycleCoefficient_sum_le {I G : Type*} [Fintype I] [DecidableEq I] + [CommGroup G] [Fintype G] [DecidableEq G] + (b : I → G → ℝ) (sign : I → ℤ) (i : I) + (hi : sign i = 1 ∨ sign i = -1) (S : ℝ) + (hb : ∀ j a, 0 ≤ b j a) (hS : ∀ a, b i a ≤ S) : + (∑ ρ : I → G, if (∏ j : I, (ρ j) ^ sign j) = 1 then ∏ j : I, b j (ρ j) else 0) ≤ + S * ∏ j : {j : I // j ≠ i}, ∑ a : G, b j.1 a := by + classical + have hproduct (ρ : I → G) : + (∏ j : I, (ρ j) ^ sign j) = (ρ i) ^ sign i * + ∏ j : {j : I // j ≠ i}, (ρ j.1) ^ sign j.1 := + Fintype.prod_eq_mul_prod_subtype_ne _ i + have hweight (ρ : I → G) : + (∏ j : I, b j (ρ j)) = b i (ρ i) * ∏ j : {j : I // j ≠ i}, b j.1 (ρ j.1) := + Fintype.prod_eq_mul_prod_subtype_ne _ i + simp_rw [hproduct, hweight] + rw [sum_funSplitAt i (fun a τ => + if a ^ sign i * (∏ j : {j : I // j ≠ i}, (τ j) ^ sign j.1) = 1 then + b i a * (∏ j : {j : I // j ≠ i}, b j.1 (τ j)) else 0), Finset.sum_comm] + have hinner (τ : {j : I // j ≠ i} → G) : + (∑ a : G, if a ^ sign i * (∏ j, (τ j) ^ sign j.1) = 1 then + b i a * (∏ j, b j.1 (τ j)) else 0) ≤ S * ∏ j, b j.1 (τ j) := by + rcases hi with hi | hi + · simp only [hi, zpow_one, mul_eq_one_iff_eq_inv] + simp only [Finset.sum_ite_eq', Finset.mem_univ, ite_true] + exact mul_le_mul_of_nonneg_right (hS _) (Finset.prod_nonneg fun j _ => hb j.1 _) + · simp only [hi, zpow_neg_one, inv_mul_eq_one] + simp only [Finset.sum_ite_eq', Finset.mem_univ, ite_true] + exact mul_le_mul_of_nonneg_right (hS _) (Finset.prod_nonneg fun j _ => hb j.1 _) + calc + _ ≤ ∑ τ : {j : I // j ≠ i} → G, S * ∏ j, b j.1 (τ j) := + Finset.sum_le_sum fun τ _ => hinner τ + _ = _ := by rw [← Finset.mul_sum, Fintype.prod_sum] + +noncomputable local instance signedCycleFintype {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +/-- The quantitative form of the final cycle-projection step. -/ +theorem cycleAverage_product_energy_le {p : ℕ} [Fact p.Prime] + {I : Type*} [Fintype I] [DecidableEq I] + (f : I → (ZMod p)ˣ → ℂ) (sign : I → ℤ) (i : I) + (hi : sign i = 1 ∨ sign i = -1) (S : ℝ) + (hS : ∀ χ : MulChar (ZMod p) ℂ, ‖mellinCoefficient (f i) χ‖ ^ 2 ≤ S) : + ((Fintype.card (ZMod p)ˣ : ℝ) ^ Fintype.card I)⁻¹ * + (∑ m : I → (ZMod p)ˣ, ‖cycleAverage sign (fun m => ∏ j : I, f j (m j)) m‖ ^ 2) ≤ + S * ∏ j : {j : I // j ≠ i}, + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * ∑ t : (ZMod p)ˣ, ‖f j.1 t‖ ^ 2 := by + classical + rw [cycleAverage_product_energy] + have h := signedCycleCoefficient_sum_le (fun j χ => ‖mellinCoefficient (f j) χ‖ ^ 2) + sign i hi S (fun _ _ => sq_nonneg _) hS + convert h using 1 + congr 1 + apply Finset.prod_congr rfl + intro j _ + exact (mellin_parseval (f j.1)).symm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/SmallDepthMatchingCount.lean b/lean/OAI/NumberTheory/Ostmann/Tree/SmallDepthMatchingCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf516db465f10003d5cd40225c8afec81b205752 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/SmallDepthMatchingCount.lean @@ -0,0 +1,108 @@ +import OAI.NumberTheory.Ostmann.Construction.ConstituentDiagonalSupport +import OAI.NumberTheory.Ostmann.Tree.ComponentFactorial + +namespace OAI + +/-! # The first two diagonals treat every matching as bad -/ + +namespace Ostmann +open scoped Classical + +noncomputable def scheduledDiagonalBadMatchingSet {I : Type*} [Fintype I] + (role : I → CopyScheduleRole) (n m : ℕ) + (word : Fin m ≃ {i : I // role i = .word}) : Finset (Equiv.Perm (CopyScheduleH role n)) := + if n < 2 then cellPreservingMatchings (scheduledBulkLabel role n) + else scheduledBadMatchingSet role n m word + +theorem scheduledDiagonalBadMatchingSet_subset {I : Type*} [Fintype I] + (role : I → CopyScheduleRole) (n m : ℕ) + (word : Fin m ≃ {i : I // role i = .word}) : + scheduledDiagonalBadMatchingSet role n m word ⊆ + cellPreservingMatchings (scheduledBulkLabel role n) := by + unfold scheduledDiagonalBadMatchingSet + split_ifs + · exact Finset.Subset.refl _ + · exact scheduledBadMatchingSet_subset role n m word + +theorem scheduled_cellPreserving_card_bound {I : Type*} [Fintype I] + (role : I → CopyScheduleRole) (n m : ℕ) + (word : Fin m ≃ {i : I // role i = .word}) : + (cellPreservingMatchings (scheduledBulkLabel role n)).card ≤ + (2 ^ n * m).factorial * (Fintype.card (ScheduledNonbulkH role n)).factorial := by + have hc : (cellPreservingMatchings (scheduledBulkLabel role n)).card = + Fintype.card (PartitionMatching (scheduledBulkLabel role n) (scheduledBulkLabel role n)) := by + calc + _ = Fintype.card ↥(cellPreservingMatchings (scheduledBulkLabel role n)) := + (Fintype.card_coe _).symm + _ = _ := by + let E : ↥(cellPreservingMatchings (scheduledBulkLabel role n)) ≃ + PartitionMatching (scheduledBulkLabel role n) (scheduledBulkLabel role n) := { + toFun := fun e => ⟨e.val, (mem_cellPreservingMatchings _ _).mp e.property⟩ + invFun := fun e => ⟨e.val, (mem_cellPreservingMatchings _ _).mpr e.property⟩ + left_inv := fun _ => rfl + right_inv := fun _ => rfl } + exact Fintype.card_congr E + + rw [hc] + have h₁ := Fintype.card_le_of_injective _ (scheduledSeparatedMatching_injective role n m word) + have h₂ := Fintype.card_le_of_injective _ + (separatedMatching_pair_injective (A := Fin (2 ^ n) × Fin m) (B := ScheduledNonbulkH role n)) + exact (h₁.trans h₂).trans_eq (by simp only [Fintype.card_prod, Fintype.card_perm, Fintype.card_fin]) + +theorem small_depth_matching_count {I : Type*} [Fintype I] + (role : I → CopyScheduleRole) (n m : ℕ) + (word : Fin m ≃ {i : I // role i = .word}) (hn : n < 2) : + ((cellPreservingMatchings (scheduledBulkLabel role n)).card : ℝ) ≤ + (m.factorial : ℝ) ^ (2 ^ n) * Real.exp (2 * (2 ^ n * m : ℕ)) * + (Fintype.card (ScheduledNonbulkH role n)).factorial := by + have hr : (2 ^ n : ℕ) ≤ 2 := by interval_cases n <;> norm_num + have hp : (2 ^ n : ℝ) ≤ Real.exp 2 := by + have h := Real.add_one_le_exp (2 : ℝ) + have hr' : (2 ^ n : ℝ) ≤ 2 := by exact_mod_cast hr + linarith + have hf : ((2 ^ n * m).factorial : ℝ) ≤ + (m.factorial : ℝ) ^ (2 ^ n) * Real.exp (2 * (2 ^ n * m : ℕ)) := by + have h := (Nat.cast_le (α := ℝ)).mpr (component_factorial_le (2 ^ n) m) + push_cast at h + apply h.trans + apply mul_le_mul_of_nonneg_left _ (by positivity) + calc + _ ≤ (Real.exp 2) ^ (2 ^ n * m) := pow_le_pow_left₀ (by positivity) hp _ + _ = _ := by rw [← Real.exp_nat_mul]; congr 1; ring + have hc := (Nat.cast_le (α := ℝ)).mpr (scheduled_cellPreserving_card_bound role n m word) + push_cast at hc + exact hc.trans (mul_le_mul_of_nonneg_right hf (by positivity)) + +theorem scheduledDiagonalBadMatchingSet_card_bound {I : Type*} [Fintype I] + (role : I → CopyScheduleRole) (n m : ℕ) + (word : Fin m ≃ {i : I // role i = .word}) (hm : 0 < m) : + ((scheduledDiagonalBadMatchingSet role n m word).card : ℝ) ≤ + (((2 ^ n + 1) * (2 ^ n) ^ (2 * 2 ^ n) : ℕ) : ℝ) * + (m.factorial : ℝ) ^ (2 ^ n) * + Real.exp (((2 ^ n * m : ℕ) : ℝ) * (Real.log (2 ^ n : ℕ) / 4 + 2)) * + (Fintype.card (ScheduledNonbulkH role n)).factorial := by + have hlog : 0 ≤ Real.log (2 ^ n : ℕ) := Real.log_nonneg (by exact_mod_cast Nat.one_le_two_pow) + have hA : (1 : ℝ) ≤ (((2 ^ n + 1) * (2 ^ n) ^ (2 * 2 ^ n) : ℕ) : ℝ) := by + have ha : 0 < ((2 ^ n + 1) * (2 ^ n) ^ (2 * 2 ^ n) : ℕ) := by positivity + exact_mod_cast Nat.succ_le_of_lt ha + unfold scheduledDiagonalBadMatchingSet + split_ifs with hn + · apply (small_depth_matching_count role n m word hn).trans + apply mul_le_mul_of_nonneg_right _ (by positivity) + apply mul_le_mul (le_mul_of_one_le_left (by positivity) hA) + (Real.exp_le_exp.mpr ?_) (Real.exp_pos _).le (by positivity) + convert mul_le_mul_of_nonneg_left (show 2 ≤ Real.log (2 ^ n : ℕ) / 4 + 2 by linarith) + (show (0 : ℝ) ≤ (2 ^ n * m : ℕ) from Nat.cast_nonneg _) using 1; ring + · apply (scheduledBadMatchingSet_card_bound role n m word hm).trans + apply mul_le_mul_of_nonneg_right _ (by positivity) + apply mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr ?_) (by positivity) + push_cast + calc + _ = ((m : ℝ) * (2 : ℝ) ^ n) * (Real.log ((2 : ℝ) ^ n) / 4 + 1 / 4) := by ring + _ ≤ ((m : ℝ) * (2 : ℝ) ^ n) * (Real.log ((2 : ℝ) ^ n) / 4 + 2) := + mul_le_mul_of_nonneg_left (by linarith) (by positivity) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/SpectralFourth.lean b/lean/OAI/NumberTheory/Ostmann/Tree/SpectralFourth.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb0e3de673c8c24997bb153810d8693b204df773 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/SpectralFourth.lean @@ -0,0 +1,90 @@ +import OAI.NumberTheory.Ostmann.Tree.CharacterFourthNonprincipal +import OAI.NumberTheory.Ostmann.Tree.PairTotalMass +import OAI.NumberTheory.Ostmann.Tree.WeightedFourierGauss + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem fourier_nonprincipal_fourth_bound (f : ZMod p → ℂ) (w : ZMod p → ℝ) + (hf : ∀ b,fourier f b=(w b:ℂ)) (hw : ∀ b,0≤w b) : + (∑ α : MulChar (ZMod p) ℂ, if α=1 then 0 else + ∑ a : ZMod p, ‖fourier (fun d => f d*α d) a‖^4) ≤ + 2*(∑ b,w b^2)^2+3*(p:ℝ)⁻¹^2*(∑ b,w b)^4 := by + classical + have hp : 0<(p:ℝ) := by exact_mod_cast (Fact.out : p.Prime).pos + have he (α : MulChar (ZMod p) ℂ) : + (if α=1 then 0 else ∑ a : ZMod p, ‖fourier (fun d => f d*α d) a‖^4) = + (p:ℝ)⁻¹^2*(if α⁻¹=1 then 0 else ∑ a : ZMod p, ‖weightedCharacterSum w α⁻¹ a‖^4) := by + by_cases hα : α=1 + · simp [hα] + · simp only [hα,ite_false,inv_eq_one, + norm_fourier_mulChar_fourth f w hf α hα,← Finset.mul_sum] + simp_rw [he] + rw [← Finset.mul_sum] + have hi := (Equiv.inv (MulChar (ZMod p) ℂ)).bijective.sum_comp + (fun α : MulChar (ZMod p) ℂ => if α=1 then (0:ℝ) else ∑ a : ZMod p, ‖weightedCharacterSum w α a‖^4) + change (∑ α : MulChar (ZMod p) ℂ, if α⁻¹=1 then (0:ℝ) else ∑ a : ZMod p, ‖weightedCharacterSum w α⁻¹ a‖^4) = _ at hi + rw [hi] + have hb := weightedCharacterSum_nonprincipal_fourth_bound w hw + rw [ZMod.card] at hb + have hN : (Fintype.card (ZMod p)ˣ:ℝ)≤(p:ℝ) := by + exact_mod_cast (show Fintype.card (ZMod p)ˣ≤p by rw [ZMod.card_units]; omega) + calc + _ ≤ (p:ℝ)⁻¹^2*(2*(Fintype.card (ZMod p)ˣ:ℝ)*(p:ℝ)*(∑ b,w b^2)^2+3*(∑ b,w b)^4) := + mul_le_mul_of_nonneg_left hb (sq_nonneg _) + _ ≤ (p:ℝ)⁻¹^2*(2*(p:ℝ)*(p:ℝ)*(∑ b,w b^2)^2+3*(∑ b,w b)^4) := by + gcongr + _ = _ := by field_simp + +theorem pairSpectrum_nonprincipal_fourth_bound (g : ZMod p → ℂ) + (hg0 : g 0=0) (hg : l2Sq g≤1) : + (∑ χ : MulChar (ZMod p) ℂ, ∑ α : MulChar (ZMod p) ℂ, + if α=1 then 0 else ∑ a : ZMod p, ‖fourier (fun d => pairSpectrum g χ d*α d) a‖^4) ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^3*((4:ℝ)*(correlationBound g:ℝ)^2+3/(p:ℝ)) := by + let C : ℝ := (p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ) + have hp : 0<(p:ℝ) := by exact_mod_cast (Fact.out : p.Prime).pos + have hN : 0<(Fintype.card (ZMod p)ˣ:ℝ) := by exact_mod_cast Fintype.card_pos + have hC : 0≤C := div_nonneg hp.le hN.le + have hr (χ : MulChar (ZMod p) ℂ) : 0≤pairFourthMass g χ := by unfold pairFourthMass; positivity + have hrmax (χ : MulChar (ZMod p) ℂ) : pairFourthMass g χ≤C^2*(correlationBound g:ℝ)^2 := by + exact (pairFourthMass_le g χ hg0).trans + ((mul_le_mul_of_nonneg_left hg (by positivity)).trans_eq (mul_one _)) + have hr2 : (∑ χ : MulChar (ZMod p) ℂ,pairFourthMass g χ^2) ≤ + 2*C^3*(correlationBound g:ℝ)^2 := by + calc + _ ≤ ∑ χ : MulChar (ZMod p) ℂ, (C^2*(correlationBound g:ℝ)^2)*pairFourthMass g χ := by + apply Finset.sum_le_sum + intro χ _ + simpa only [pow_two] using mul_le_mul_of_nonneg_right (hrmax χ) (hr χ) + _ = (C^2*(correlationBound g:ℝ)^2)*(∑ χ : MulChar (ZMod p) ℂ,pairFourthMass g χ) := by rw [Finset.mul_sum] + _ ≤ (C^2*(correlationBound g:ℝ)^2)*(2*C) := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + simpa only [C,mul_div_assoc] using pairFourthMass_total g hg0 hg + _ = _ := by ring + have hJ (χ : MulChar (ZMod p) ℂ) : (∑ b,pairWeight g χ b)^4≤C^4 := by + rw [pairWeight_mass g χ hg0] + exact pow_le_pow_left₀ (mul_nonneg hC (l2Sq_nonneg g)) + ((mul_le_mul_of_nonneg_left hg hC).trans_eq (mul_one _)) 4 + calc + _ ≤ ∑ χ : MulChar (ZMod p) ℂ, + (2*(pairFourthMass g χ)^2+3*(p:ℝ)⁻¹^2*C^4) := by + apply Finset.sum_le_sum + intro χ _ + have hh := fourier_nonprincipal_fourth_bound (pairSpectrum g χ) (pairWeight g χ) + (fourier_pairSpectrum g χ) (pairWeight_nonneg g χ) + exact hh.trans (add_le_add le_rfl (mul_le_mul_of_nonneg_left (hJ χ) (by positivity))) + _ = 2*(∑ χ : MulChar (ZMod p) ℂ,pairFourthMass g χ^2)+ + (Fintype.card (ZMod p)ˣ:ℝ)*(3*(p:ℝ)⁻¹^2*C^4) := by + rw [Finset.sum_add_distrib,← Finset.mul_sum,Finset.sum_const,Finset.card_univ,mulChar_card,nsmul_eq_mul] + _ ≤ 2*(2*C^3*(correlationBound g:ℝ)^2)+(Fintype.card (ZMod p)ˣ:ℝ)*(3*(p:ℝ)⁻¹^2*C^4) := by + exact add_le_add (mul_le_mul_of_nonneg_left hr2 (by norm_num)) le_rfl + _ = _ := by dsimp [C]; field_simp; ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/SpectralGaussBound.lean b/lean/OAI/NumberTheory/Ostmann/Tree/SpectralGaussBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..3398bee1a91da9accb47a484c75e4ffe0233e2c4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/SpectralGaussBound.lean @@ -0,0 +1,51 @@ +import OAI.NumberTheory.Ostmann.Tree.PrincipalSpectrum +import OAI.NumberTheory.Ostmann.Tree.WeightedFourierGauss + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem norm_weightedCharacterSum_le (w : ZMod p → ℝ) (hw : ∀ b,0≤w b) + (α : MulChar (ZMod p) ℂ) (a : ZMod p) : + ‖weightedCharacterSum w α a‖ ≤ ∑ b,w b := by + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro b _ + rw [norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (hw b)] + exact (mul_le_mul_of_nonneg_left (mulChar_norm_le_one α (a-b)) (hw b)).trans_eq (mul_one _) + +theorem norm_fourier_mulChar_sq_le (f : ZMod p → ℂ) (w : ZMod p → ℝ) + (hf : ∀ b,fourier f b=(w b:ℂ)) (hw : ∀ b,0≤w b) + (α : MulChar (ZMod p) ℂ) (hα : α≠1) (a : ZMod p) : + ‖fourier (fun d => f d*α d) a‖^2 ≤ (p:ℝ)⁻¹*(∑ b,w b)^2 := by + have hp : 0<(p:ℝ) := by exact_mod_cast (Fact.out : p.Prime).pos + have hf4 := norm_fourier_mulChar_fourth f w hf α hα a + have hS : ‖weightedCharacterSum w α⁻¹ a‖^4 ≤ (∑ b,w b)^4 := + pow_le_pow_left₀ (norm_nonneg _) (norm_weightedCharacterSum_le w hw α⁻¹ a) 4 + have h4 := mul_le_mul_of_nonneg_left hS (sq_nonneg ((p:ℝ)⁻¹)) + rw [← hf4] at h4 + have hz : 0≤(p:ℝ)⁻¹*(∑ b,w b)^2 := by positivity + have hz' : 0≤‖fourier (fun d => f d*α d) a‖^2 := sq_nonneg _ + nlinarith only [h4,hz,hz'] + +theorem norm_twistedPairFourier_nonprincipal_sq_le (g : ZMod p → ℂ) + (σ : (ZMod p)ˣ) (χ α : MulChar (ZMod p) ℂ) (hα : α≠1) + (a : ZMod p) (hg0 : g 0=0) (hg : l2Sq g≤1) : + ‖twistedPairFourier g σ χ α a‖^2 ≤ + (p:ℝ)⁻¹*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2 := by + rw [norm_twistedPairFourier_scale] + have hb := norm_fourier_mulChar_sq_le (pairSpectrum g χ) (pairWeight g χ) + (fourier_pairSpectrum g χ) (pairWeight_nonneg g χ) α hα ((σ⁻¹:(ZMod p)ˣ)*a) + rw [pairWeight_mass g χ hg0] at hb + apply hb.trans + apply mul_le_mul_of_nonneg_left _ (by positivity) + exact pow_le_pow_left₀ (mul_nonneg (by positivity) (l2Sq_nonneg g)) + ((mul_le_mul_of_nonneg_left hg (by positivity)).trans_eq (mul_one _)) 2 + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/SpectralParts.lean b/lean/OAI/NumberTheory/Ostmann/Tree/SpectralParts.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d7472ff22ee1a718862f3ca2d394c36bc12974d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/SpectralParts.lean @@ -0,0 +1,79 @@ +import OAI.NumberTheory.Ostmann.Tree.SpectralFourth +import OAI.NumberTheory.Ostmann.Tree.SpectralGaussBound + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def nonprincipalEnergy (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ α : MulChar (ZMod p) ℂ) (a : ZMod p) : ℝ := by + classical + exact if α=1 then 0 else ‖twistedPairFourier g σ χ α a‖^2 + +def principalEnergy (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ α : MulChar (ZMod p) ℂ) (a : ZMod p) : ℝ := by + classical + exact if α=1 then ‖twistedPairFourier g σ χ α a‖^2 else 0 + +theorem spectralEnergy_decomposition (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ α : MulChar (ZMod p) ℂ) (a : ZMod p) : + ‖twistedPairFourier g σ χ α a‖^2= + nonprincipalEnergy g σ χ α a+principalEnergy g σ χ α a := by + classical + by_cases h : α=1 <;> simp [nonprincipalEnergy,principalEnergy,h] + +theorem nonprincipalEnergy_nonneg (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ α : MulChar (ZMod p) ℂ) (a : ZMod p) : 0≤nonprincipalEnergy g σ χ α a := by + classical + unfold nonprincipalEnergy + split_ifs <;> positivity + +theorem principalEnergy_nonneg (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ α : MulChar (ZMod p) ℂ) (a : ZMod p) : 0≤principalEnergy g σ χ α a := by + classical + unfold principalEnergy + split_ifs <;> positivity + +theorem nonprincipalEnergy_le (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ α : MulChar (ZMod p) ℂ) (a : ZMod p) (hg0 : g 0=0) (hg : l2Sq g≤1) : + nonprincipalEnergy g σ χ α a≤(p:ℝ)⁻¹*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2 := by + classical + unfold nonprincipalEnergy + split_ifs with hα + · positivity + · exact norm_twistedPairFourier_nonprincipal_sq_le g σ χ α hα a hg0 hg + +theorem nonprincipalEnergy_fourth (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (hg0 : g 0=0) (hg : l2Sq g≤1) : + (∑ χ : MulChar (ZMod p) ℂ, ∑ α : MulChar (ZMod p) ℂ, + ∑ a : ZMod p, nonprincipalEnergy g σ χ α a^2) ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^3*(4*(correlationBound g:ℝ)^2+3/(p:ℝ)) := by + classical + have he (χ α : MulChar (ZMod p) ℂ) : + (∑ a : ZMod p, nonprincipalEnergy g σ χ α a^2) = + if α=1 then 0 else ∑ a : ZMod p, ‖fourier (fun d => pairSpectrum g χ d*α d) a‖^4 := by + by_cases hα : α=1 + · simp [nonprincipalEnergy,hα] + · simp only [nonprincipalEnergy,hα,ite_false,norm_twistedPairFourier_scale,← pow_mul] + exact (Equiv.mulLeft₀ ((σ⁻¹:(ZMod p)ˣ):ZMod p) (Units.ne_zero _)).bijective.sum_comp + (fun a => ‖fourier (fun d => pairSpectrum g χ d*α d) a‖^4) + simp_rw [he] + exact pairSpectrum_nonprincipal_fourth_bound g hg0 hg + +theorem pairFourthMass_basic_le (g : ZMod p → ℂ) (χ : MulChar (ZMod p) ℂ) + (hg0 : g 0=0) (hg : l2Sq g≤1) : + pairFourthMass g χ≤((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2 := by + calc + _ ≤ (∑ a,pairWeight g χ a)^2 := Finset.sum_sq_le_sq_sum_of_nonneg (fun a _ => pairWeight_nonneg g χ a) + _ ≤ _ := by + rw [pairWeight_mass g χ hg0] + exact pow_le_pow_left₀ (mul_nonneg (by positivity) (l2Sq_nonneg g)) + ((mul_le_mul_of_nonneg_left hg (by positivity)).trans_eq (mul_one _)) 2 + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/SquareMajorant.lean b/lean/OAI/NumberTheory/Ostmann/Tree/SquareMajorant.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d7940527e06acad9c8afa054e5429e4bd1b0d89 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/SquareMajorant.lean @@ -0,0 +1,58 @@ +import OAI.NumberTheory.Ostmann.Tree.NonnegativeDifference + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +variable {p : ℕ} [Fact p.Prime] + +def crossSquareMajorant (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) (L R : PairMode) + (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : ℝ := by + classical + exact ∑ ν : MulChar (ZMod p) ℂ with ν^2=ρ,crossMajorant g h σ τ L R ν y + +theorem crossSquareMajorant_nonneg (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (ρ : MulChar (ZMod p) ℂ) (y : ZMod p) : + 0≤crossSquareMajorant g h σ τ L R ρ y := by + classical + exact Finset.sum_nonneg (fun ν _ => crossMajorant_nonneg g h σ τ L R ν y) + +theorem crossSquareMajorant_mean_small (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (ρ : MulChar (ZMod p) ℂ) + (hσ : (σ:ZMod p)^2=1) (hτ : (τ:ZMod p)^2=1) + (hg0 : g 0=0) (hg : l2Sq g≤1) (hh0 : h 0=0) (hh : l2Sq h≤1) : + unitMean (crossSquareMajorant g h σ τ L R ρ) ≤ + 200*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))* + ((correlationBound g:ℝ)^2+(correlationBound h:ℝ)^2+Real.sqrt (3/(p:ℝ))) := by + classical + let B : ℝ := 100*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))* + ((correlationBound g:ℝ)^2+(correlationBound h:ℝ)^2+Real.sqrt (3/(p:ℝ))) + have hB : 0≤B := by dsimp [B]; positivity + unfold crossSquareMajorant + rw [unitMean_sum] + calc + _ ≤ ∑ ν : MulChar (ZMod p) ℂ with ν^2=ρ,B := Finset.sum_le_sum + (fun ν _ => crossMajorant_mean_small g h σ τ L R ν hσ hτ hg0 hg hh0 hh) + _ ≤ 2*B := by + rw [Finset.sum_const,nsmul_eq_mul] + apply mul_le_mul_of_nonneg_right _ hB + exact_mod_cast character_square_fiber_card (Finset.univ.filter (fun ν : MulChar (ZMod p) ℂ => ν^2=ρ)) ρ + (fun ν hν => (Finset.mem_filter.mp hν).2) + _ = _ := by dsimp [B]; ring + +theorem crossSquareMajorant_mean_total (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (hg0 : g 0=0) (hg : l2Sq g≤1) (hh0 : h 0=0) (hh : l2Sq h≤1) : + (∑ ρ : MulChar (ZMod p) ℂ,unitMean (crossSquareMajorant g h σ τ L R ρ)) ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2 := by + classical + unfold crossSquareMajorant + simp_rw [unitMean_sum, Finset.sum_filter] + rw [Finset.sum_comm] + simp only [Finset.sum_ite_eq,Finset.mem_univ,ite_true] + exact crossMajorant_mean_total g h σ τ L R hg0 hg hh0 hh + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TensorActionMajorization.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TensorActionMajorization.lean new file mode 100644 index 0000000000000000000000000000000000000000..ade884de5a4c79b769397c1be706c3c167afc311 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TensorActionMajorization.lean @@ -0,0 +1,35 @@ +import OAI.NumberTheory.Ostmann.Tree.TensorActionProjection + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +open Ostmann.Tree.Density +variable {F I : Type*} [Field F] [Fintype F] [DecidableEq F] [Fintype I] [DecidableEq I] +variable {A : I → Type*} [∀ i,Fintype (A i)] [∀ i,MulAction Fˣ (A i)] +local instance tensorActionMajorizationFintype : Fintype (MulChar F ℂ) := Fintype.ofFinite _ + +omit [Fintype I] [DecidableEq I] in +theorem actionCoefficient_energy_nonneg (W : ∀ i,A i → ℂ) (i : I) (ρ : MulChar F ℂ) : + 0≤average (fun x : A i => ‖actionCoefficient W i ρ x‖^2) := + mul_nonneg (by positivity) (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) + +theorem actionProjection_energy_le (W : ∀ i,A i → ℂ) + (B : I → MulChar F ℂ → ℝ) + (hB : ∀ i ρ,average (fun x : A i => ‖actionCoefficient W i ρ x‖^2)≤B i ρ) : + average (fun x : ∀ i,A i => ‖actionProjection (F:=F) W x‖^2) ≤ + ∑ ρ : I → MulChar F ℂ,if (∏ i,ρ i)=1 then ∏ i,B i (ρ i) else 0 := by + classical + rw [actionProjection_energy] + apply Finset.sum_le_sum + intro ρ _ + split_ifs + · exact Finset.prod_le_prod₀ (fun i _ => actionCoefficient_energy_nonneg W i (ρ i)) + (fun i _ => hB i (ρ i)) + · exact le_rfl + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TensorActionProjection.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TensorActionProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..1005ab8d04198aa79a5ca0ce24ad29b2e65e7dbe --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TensorActionProjection.lean @@ -0,0 +1,83 @@ +import OAI.NumberTheory.Ostmann.Tree.IndependentMajorants +import OAI.NumberTheory.Ostmann.Tree.TensorProjection + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +open Ostmann.Tree.Density +variable {F I : Type*} [Field F] [Fintype F] [DecidableEq F] [Fintype I] [DecidableEq I] +variable {A : I → Type*} [∀ i,Fintype (A i)] [∀ i,MulAction Fˣ (A i)] +local instance tensorActionFintype : Fintype (MulChar F ℂ) := Fintype.ofFinite _ + +def actionProjection (W : ∀ i,A i → ℂ) (x : ∀ i,A i) : ℂ := + (Fintype.card Fˣ:ℂ)⁻¹*∑ z : Fˣ,∏ i,W i (z • x i) + +def actionCoefficient (W : ∀ i,A i → ℂ) (i : I) (ρ : MulChar F ℂ) (x : A i) : ℂ := + mellin (fun z : Fˣ => W i (z • x)) ρ + +def coordinateActionEquiv (t : I → Fˣ) : (∀ i,A i) ≃ (∀ i,A i) := + Equiv.piCongrRight (fun i => MulAction.toPerm (t i)) + +omit [DecidableEq I] [∀ i,Fintype (A i)] in +theorem tensorSignedProjection_action (W : ∀ i,A i → ℂ) (x : ∀ i,A i) (t : I → Fˣ) : + tensorSignedProjection (fun i z => W i (z • x i)) (fun _ => true) t = + actionProjection (F := F) W (coordinateActionEquiv t x) := by + unfold tensorSignedProjection actionProjection + congr 1 + apply Finset.sum_congr rfl + intro z _ + apply Finset.prod_congr rfl + intro i _ + simp only [signedUnit,ite_true,coordinateActionEquiv,Equiv.piCongrRight_apply, + mul_smul] + change W i (t i • (z • x i))=W i (z • (t i • x i)) + simp only [smul_smul] + rw [mul_comm] + +theorem actionProjection_energy (W : ∀ i,A i → ℂ) : + average (fun x : ∀ i,A i => ‖actionProjection (F := F) W x‖^2) = + ∑ ρ : I → MulChar F ℂ,if (∏ i,ρ i)=1 then + ∏ i,average (fun x : A i => ‖actionCoefficient W i (ρ i) x‖^2) else 0 := by + classical + have hN : (Fintype.card (I → Fˣ):ℝ)≠0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero + have he (t : I → Fˣ) : + average (fun x : ∀ i,A i => + ‖tensorSignedProjection (fun i z => W i (z • x i)) (fun _ => true) t‖^2) = + average (fun x : ∀ i,A i => ‖actionProjection (F := F) W x‖^2) := by + simp_rw [tensorSignedProjection_action] + unfold average + congr 1 + exact (coordinateActionEquiv t).bijective.sum_comp (fun x => ‖actionProjection (F := F) W x‖^2) + calc + _ = average (fun t : I → Fˣ => average (fun x : ∀ i,A i => + ‖tensorSignedProjection (fun i z => W i (z • x i)) (fun _ => true) t‖^2)) := by + simp_rw [he] + simp only [average,Finset.sum_const,Finset.card_univ,nsmul_eq_mul] + exact (inv_mul_cancel_left₀ hN _).symm + _ = average (fun x : ∀ i,A i => average (fun t : I → Fˣ => + ‖tensorSignedProjection (fun i z => W i (z • x i)) (fun _ => true) t‖^2)) := by + simp only [average,Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro x _ + apply Finset.sum_congr rfl + intro t _ + ring + _ = average (Ostmann.Tree.constrainedMajorant (fun _ : I => Equiv.refl (MulChar F ℂ)) + (fun i ρ x => ‖actionCoefficient W i ρ x‖^2)) := by + congr 1 + funext x + rw [show average (fun t : I → Fˣ => + ‖tensorSignedProjection (fun i z => W i (z • x i)) (fun _ => true) t‖^2) = _ from + tensorSignedProjection_parseval (fun i z => W i (z • x i)) (fun _ => true)] + simp only [tensorConstraint,signedCharacter,ite_true,Ostmann.Tree.constrainedMajorant, + Equiv.refl_apply,actionCoefficient] + congr 1 + _ = _ := Ostmann.Tree.constrainedMajorant_average _ _ + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TensorCharacters.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TensorCharacters.lean new file mode 100644 index 0000000000000000000000000000000000000000..ffc766913c0127fe7df43231024c5b34a62da731 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TensorCharacters.lean @@ -0,0 +1,58 @@ +import OAI.NumberTheory.Ostmann.Tree.MellinTransform + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F I : Type*} [Field F] [Fintype F] [DecidableEq F] [Fintype I] [DecidableEq I] +local instance tensorCharactersFintype : Fintype (MulChar F ℂ) := Fintype.ofFinite _ + +def tensorCharacter (ρ : I → MulChar F ℂ) (t : I → Fˣ) : ℂ := ∏ i,ρ i (t i) + +def tensorCoefficient (f : I → Fˣ → ℂ) (ρ : I → MulChar F ℂ) : ℂ := + ∏ i,mellin (f i) (ρ i) + +theorem tensorCharacter_kernel (ρ τ : I → MulChar F ℂ) : + (∑ t : I → Fˣ,tensorCharacter ρ t*conj (tensorCharacter τ t)) = + if ρ=τ then (Fintype.card (I → Fˣ):ℂ) else 0 := by + classical + simp only [tensorCharacter,map_prod,← Finset.prod_mul_distrib] + rw [← Fintype.prod_sum (fun i (u : Fˣ) => ρ i u*conj (τ i u))] + simp_rw [sum_units_character_kernel] + by_cases h : ρ=τ + · subst τ + simp + · rw [ite_eq_right h] + have hi : ∃ i,ρ i≠τ i := by + by_contra hn + apply h + funext i + exact not_not.mp (not_exists.mp hn i) + obtain ⟨i,hi⟩ := hi + exact Finset.prod_eq_zero (Finset.mem_univ i) (ite_eq_right hi) + +theorem tensor_mellin_expansion (f : I → Fˣ → ℂ) (t : I → Fˣ) : + (∏ i,f i (t i)) = + ∑ ρ : I → MulChar F ℂ,tensorCoefficient f ρ*tensorCharacter ρ t := by + classical + calc + _ = ∏ i,∑ χ : MulChar F ℂ,mellin (f i) χ*χ (t i) := by + simp_rw [mellin_inversion] + _ = ∑ ρ : I → MulChar F ℂ,∏ i,mellin (f i) (ρ i)*ρ i (t i) := + Fintype.prod_sum _ + _ = _ := by simp only [Finset.prod_mul_distrib,tensorCoefficient,tensorCharacter] + +def characterUnitEvaluation (u : Fˣ) : MulChar F ℂ →* ℂ where + toFun χ := χ u + map_one' := by simp + map_mul' χ ψ := MulChar.mul_apply χ ψ u + +omit [Fintype F] [DecidableEq F] [DecidableEq I] in +theorem character_product_apply (ρ : I → MulChar F ℂ) (u : Fˣ) : + (∏ i,ρ i) u = ∏ i,ρ i u := map_prod (characterUnitEvaluation u) _ _ + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TensorParseval.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TensorParseval.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e5887f28d602af1b666874bd1f19d0fc115290d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TensorParseval.lean @@ -0,0 +1,52 @@ +import OAI.NumberTheory.Ostmann.Tree.TensorCharacters + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F I : Type*} [Field F] [Fintype F] [DecidableEq F] [Fintype I] [DecidableEq I] +local instance tensorParsevalFintype : Fintype (MulChar F ℂ) := Fintype.ofFinite _ + +def tensorSeries (c : (I → MulChar F ℂ) → ℂ) (t : I → Fˣ) : ℂ := + ∑ ρ : I → MulChar F ℂ,c ρ*tensorCharacter ρ t + +theorem tensorSeries_energy_complex (c : (I → MulChar F ℂ) → ℂ) : + (∑ t : I → Fˣ,conj (tensorSeries c t)*tensorSeries c t) = + (Fintype.card (I → Fˣ):ℂ)*∑ ρ : I → MulChar F ℂ,conj (c ρ)*c ρ := by + classical + simp only [tensorSeries,map_sum,map_mul,Finset.sum_mul,Finset.mul_sum] + rw [Finset.sum_comm] + calc + _ = ∑ ρ : I → MulChar F ℂ,∑ τ : I → MulChar F ℂ, + (conj (c τ)*c ρ)*(∑ t : I → Fˣ,tensorCharacter ρ t*conj (tensorCharacter τ t)) := by + apply Finset.sum_congr rfl + intro ρ _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro τ _ + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro t _ + ring + _ = _ := by + simp_rw [tensorCharacter_kernel] + simp only [mul_ite,mul_zero,Finset.sum_ite_eq,Finset.mem_univ,ite_true] + rw [← Finset.sum_mul,← Finset.mul_sum] + ring + +theorem tensorSeries_parseval (c : (I → MulChar F ℂ) → ℂ) : + (Fintype.card (I → Fˣ):ℝ)⁻¹*(∑ t : I → Fˣ,‖tensorSeries c t‖^2) = + ∑ ρ : I → MulChar F ℂ,‖c ρ‖^2 := by + have hN : (Fintype.card (I → Fˣ):ℂ)≠0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero + apply Complex.ofReal_injective + push_cast + have he := tensorSeries_energy_complex c + simp only [Complex.conj_mul'] at he + rw [he] + exact inv_mul_cancel_left₀ hN _ + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TensorProjection.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TensorProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..780a61c3493c2b3bc38935518ced00c581747cf4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TensorProjection.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.Tree.ConstrainedCharacterSum +import OAI.NumberTheory.Ostmann.Tree.TensorParseval + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {F I : Type*} [Field F] [Fintype F] [DecidableEq F] [Fintype I] [DecidableEq I] +local instance tensorProjectionFintype : Fintype (MulChar F ℂ) := Fintype.ofFinite _ + +def signedUnit (b : Bool) (z : Fˣ) : Fˣ := if b then z else z⁻¹ + +def signedCharacter (b : Bool) (χ : MulChar F ℂ) : MulChar F ℂ := if b then χ else χ⁻¹ + +def signedCharacterEquiv (b : Bool) : MulChar F ℂ ≃ MulChar F ℂ := + if b then Equiv.refl _ else Equiv.inv _ + +omit [Fintype F] [DecidableEq F] in +theorem signedCharacterEquiv_apply (b : Bool) (χ : MulChar F ℂ) : + signedCharacterEquiv b χ=signedCharacter b χ := by cases b <;> rfl + +omit [Fintype F] [DecidableEq F] in +theorem signedCharacter_apply (b : Bool) (χ : MulChar F ℂ) (z : Fˣ) : + signedCharacter b χ z=χ (signedUnit b z) := by + cases b + · simp only [signedCharacter,signedUnit,Bool.false_eq_true,ite_false,MulChar.inv_apply', + Units.val_inv_eq_inv_val] + · rfl + +def tensorConstraint (sign : I → Bool) (ρ : I → MulChar F ℂ) : MulChar F ℂ := + ∏ i,signedCharacter (sign i) (ρ i) + +def tensorSignedProjection (f : I → Fˣ → ℂ) (sign : I → Bool) (t : I → Fˣ) : ℂ := + (Fintype.card Fˣ:ℂ)⁻¹*∑ z : Fˣ,∏ i,f i (t i*signedUnit (sign i) z) + +def tensorProjectedCoefficient (f : I → Fˣ → ℂ) (sign : I → Bool) + (ρ : I → MulChar F ℂ) : ℂ := by + classical + exact if tensorConstraint sign ρ=1 then tensorCoefficient f ρ else 0 + +omit [Fintype F] [DecidableEq F] [DecidableEq I] in +theorem tensorCharacter_signed_action (ρ : I → MulChar F ℂ) (sign : I → Bool) + (t : I → Fˣ) (z : Fˣ) : + tensorCharacter ρ (fun i => t i*signedUnit (sign i) z)= + tensorCharacter ρ t*tensorConstraint sign ρ z := by + simp only [tensorCharacter,Units.val_mul,map_mul,Finset.prod_mul_distrib, + tensorConstraint,character_product_apply,signedCharacter_apply] + +theorem tensorSignedProjection_series (f : I → Fˣ → ℂ) (sign : I → Bool) (t : I → Fˣ) : + tensorSignedProjection f sign t=tensorSeries (tensorProjectedCoefficient f sign) t := by + classical + have hN : (Fintype.card Fˣ:ℂ)≠0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero + unfold tensorSignedProjection + simp_rw [tensor_mellin_expansion,tensorCharacter_signed_action] + rw [Finset.sum_comm,Finset.mul_sum] + unfold tensorSeries + apply Finset.sum_congr rfl + intro ρ _ + have hp (z : Fˣ) : + tensorCoefficient f ρ*(tensorCharacter ρ t*tensorConstraint sign ρ z)= + (tensorCoefficient f ρ*tensorCharacter ρ t)*tensorConstraint sign ρ z := by ring + simp_rw [hp] + rw [← Finset.mul_sum,sum_units_mulChar] + unfold tensorProjectedCoefficient + split_ifs <;> simp_all + field_simp + +theorem tensorSignedProjection_parseval (f : I → Fˣ → ℂ) (sign : I → Bool) : + (Fintype.card (I → Fˣ):ℝ)⁻¹* + (∑ t : I → Fˣ,‖tensorSignedProjection f sign t‖^2) = + ∑ ρ : I → MulChar F ℂ, + if tensorConstraint sign ρ=1 then ∏ i,‖mellin (f i) (ρ i)‖^2 else 0 := by + classical + simp_rw [tensorSignedProjection_series] + rw [tensorSeries_parseval] + apply Finset.sum_congr rfl + intro ρ _ + unfold tensorProjectedCoefficient + split_ifs <;> simp [tensorCoefficient,norm_prod,Finset.prod_pow] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TreeComparison.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TreeComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b9947f3c2ea7f3d44704c7a0a043efeb45bcd2b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TreeComparison.lean @@ -0,0 +1,43 @@ +import OAI.NumberTheory.Ostmann.Tree.QuarterPowerBound +import OAI.NumberTheory.Ostmann.Tree.TreeComparisonSquared + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators +open Ostmann.FiniteField +variable {p : ℕ} [Fact p.Prime] + +def treeComparisonConstant (k : ℕ) : ℝ := 2*Real.sqrt (treeComparisonSquaredConstant k) + +theorem treeComparisonConstant_nonneg (k : ℕ) : 0≤treeComparisonConstant k := by + unfold treeComparisonConstant + positivity + +theorem treeComparisonConstant_pos (k : ℕ) : 0 sq_nonneg _))) + (mul_nonneg (treeProjectionConstant_nonneg k) (treeError_nonneg g)) + _ = _ := by unfold treeComparisonSquaredConstant; ring + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TreeFiberMajorization.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TreeFiberMajorization.lean new file mode 100644 index 0000000000000000000000000000000000000000..17b01f9519409ad0dcd491bba8bb06baef09f89c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TreeFiberMajorization.lean @@ -0,0 +1,71 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleFiberProjection +import OAI.NumberTheory.Ostmann.Tree.CycleLocalMajorantsFrames +import OAI.NumberTheory.Ostmann.Tree.HorizontalProjectionBound +import OAI.NumberTheory.Ostmann.Tree.TensorActionMajorization +import OAI.NumberTheory.Ostmann.Tree.TreeMajorant + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators +open Ostmann.FiniteField QuartetFactorization CycleQuartet Density +variable {p : ℕ} [Fact p.Prime] {k b : ℕ} +local instance treeFiberMajorizationFintype : Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ +local instance treeFiberMajorizationDecEq : DecidableEq (MulChar (ZMod p) ℂ) := Classical.decEq _ +local instance treeFiberProductFintype {m : (ZMod p)ˣ} : Fintype (ProductFiber m) := Fintype.ofFinite _ + +theorem treeProjection_fiber_bound (P : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + (T : Diagram (ZMod p) (k+2)) (g : ZMod p → ℂ) (hg0 : g 0=0) + (M : Leaves (k+2) → (ZMod p)ˣ) : + realFiberAverage (bottomCut k).project (fun N => ‖c.projection (T.value g) N‖^2) + ((bottomCut k).project M) ≤ + integrate (treeMajorant P c T g) (diagramLevelArguments (bottomCut k) T M) := by + classical + rw [diagramLevelArguments_eq_frameArguments] + cases h : ancestorFrames T M with + | none => + change realFiberAverage (bottomCut k).project _ ((bottomCut k).project M)≤0 + have hz := CycleFiberProjection.projection_energy_zero_of_invalid P c T g + ((bottomCut k).project M) h + exact le_of_eq hz + | some fs => + let totals := (bottomCut k).project M + let Ts : Leaves k → Diagram (ZMod p) 2 := fun v => frameDiagram T M fs h v + let : ∀v,MulAction (ZMod p)ˣ (ProductFiber (totals v)) := + fun v => fiberMulAction P c v (totals v) + have hb (v : Leaves k) (ρ : MulChar (ZMod p) ℂ) : + average (fun x : ProductFiber (totals v) => + ‖actionCoefficient (fiberValues Ts g totals) v ρ x‖^2) ≤ + localMajorant P c (bottomParameters k T.parameters) g v ρ + ((fs v).argument T.denominator (totals v)) := by + have hv := frame_actionCoefficient_bound P c T M fs h g hg0 v ρ + simpa only [real_average_fintype_congr _ + (inferInstance : Fintype (ProductFiber (totals v)))] using hv + have hm := actionProjection_energy_le (fiberValues Ts g totals) + (fun v ρ => localMajorant P c (bottomParameters k T.parameters) g v ρ + ((fs v).argument T.denominator (totals v))) hb + have he := CycleFiberProjection.projection_energy_on_fiber P c T g totals fs h + change realFiberAverage (bottomCut k).project _ totals ≤ + treeMajorant P c T g (fun v => (fs v).argument T.denominator (totals v)) + have he' : realFiberAverage (bottomCut k).project + (fun N => ‖c.projection (T.value g) N‖^2) totals = + average (fun m : ∀ v, ProductFiber (totals v) => + ‖CycleFiberProjection.fiberProjection P c totals fs g T.denominator m‖^2) := by + simpa only [realFiberAverage, real_average_fintype_congr _ + (inferInstance : Fintype {N : Leaves (k+2) → (ZMod p)ˣ // (bottomCut k).project N=totals}), + real_average_fintype_congr _ (inferInstance : Fintype (∀ v, ProductFiber (totals v)))] using he + rw [he'] + convert hm using 1 + · congr 1 + · unfold treeMajorant constrainedMajorant + simp only [Equiv.refl_apply] + congr 1 + funext ρ + split_ifs <;> congr 1 + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TreeMajorant.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TreeMajorant.lean new file mode 100644 index 0000000000000000000000000000000000000000..52f8bc69e9cae044962f6ebcac64c55a1053b047 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TreeMajorant.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.Tree.CycleLocalMajorantsCoefficients +import OAI.NumberTheory.Ostmann.Tree.IndependentUniformBound +import OAI.NumberTheory.Ostmann.Tree.QuartetFactorization + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators +open Ostmann.FiniteField QuartetFactorization CycleQuartet +variable {p : ℕ} [Fact p.Prime] {k b : ℕ} +local instance treeMajorantFintype : Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ +local instance treeMajorantDecEq : DecidableEq (MulChar (ZMod p) ℂ) := Classical.decEq _ + +def treeMajorant (P : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + (T : Diagram (ZMod p) (k+2)) (g : ZMod p → ℂ) (y : Leaves k → (ZMod p)ˣ) : ℝ := + constrainedMajorant (fun _ : Leaves k => Equiv.refl (MulChar (ZMod p) ℂ)) + (fun v ρ (u : (ZMod p)ˣ) => localMajorant P c (bottomParameters k T.parameters) g v ρ u) y + +theorem treeMajorant_nonneg (P : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + (T : Diagram (ZMod p) (k+2)) (g : ZMod p → ℂ) (y : Leaves k → (ZMod p)ˣ) : + 0≤treeMajorant P c T g y := + constrainedMajorant_nonneg (fun _ : Leaves k => Equiv.refl (MulChar (ZMod p) ℂ)) + (fun v ρ (u : (ZMod p)ˣ) => localMajorant P c (bottomParameters k T.parameters) g v ρ u) + (fun v ρ u => localMajorant_nonneg P c (bottomParameters k T.parameters) g v ρ u) y + +theorem treeMajorant_mean (P : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + (T : Diagram (ZMod p) (k+2)) (g : ZMod p → ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) : + Density.average (treeMajorant P c T g)≤(25600*treeError g)*(256:ℝ)^(2^k) := by + obtain ⟨j,hj⟩ := cycleQuartets_nonempty P c + have hsmall (ρ : MulChar (ZMod p) ℂ) : + Density.average (fun u : (ZMod p)ˣ => localMajorant P c (bottomParameters k T.parameters) g j ρ u)≤ + 25600*treeError g := localMajorant_mean_small P c _ g j hj ρ hg0 hg + have hmass (v : Leaves k) : + (∑ ρ : MulChar (ZMod p) ℂ,Density.average + (fun u : (ZMod p)ˣ => localMajorant P c (bottomParameters k T.parameters) g v ρ u))≤256 := + localMajorant_mean_total P c _ g v hg0 hg + have h := constrainedMajorant_average_uniform (A:=fun _ : Leaves k => (ZMod p)ˣ) + (fun _ : Leaves k => Equiv.refl (MulChar (ZMod p) ℂ)) + (fun v ρ (u : (ZMod p)ˣ) => localMajorant P c (bottomParameters k T.parameters) g v ρ u) + (fun v ρ u => localMajorant_nonneg P c _ g v ρ u) + j (25600*treeError g) 256 (mul_nonneg (by norm_num) (treeError_nonneg g)) (by norm_num) + hsmall hmass + unfold treeMajorant + simpa only [Fintype.card_fun,Fintype.card_fin,Fintype.card_bool] using h + +def treeProjectionConstant (k : ℕ) : ℝ := + ((2^(2^k-1):ℕ):ℝ)*25600*(256:ℝ)^(2^k) + +theorem treeProjectionConstant_nonneg (k : ℕ) : 0≤treeProjectionConstant k := by + unfold treeProjectionConstant + positivity + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TreeProjectionBound.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TreeProjectionBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..e539734a24b9310f5fb89ef15d224e0994b08713 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TreeProjectionBound.lean @@ -0,0 +1,28 @@ +import OAI.NumberTheory.Ostmann.Tree.TreeFiberMajorization + +namespace OAI + +namespace Ostmann.Tree +noncomputable section +open scoped BigOperators +open Ostmann.FiniteField QuartetFactorization Density +variable {p : ℕ} [Fact p.Prime] {k b : ℕ} + +theorem treeProjection_l2_bound (P : LeafPartition (k+2) b) + (c : BalancedSelection P.label (quartetCut k).label) + (T : Diagram (ZMod p) (k+2)) (g : ZMod p → ℂ) (hg0 : g 0=0) (hg : l2Sq g≤1) : + Density.average (fun M => ‖c.projection (T.value g) M‖^2)≤ + treeProjectionConstant k*treeError g := by + have hd := horizontal_fiber_bound (bottomCut k) T + (fun M => ‖c.projection (T.value g) M‖^2) (treeMajorant P c T g) + (treeMajorant_nonneg P c T g) (treeProjection_fiber_bound P c T g hg0) + apply hd.trans + calc + _ ≤ ((2^(2^k-1):ℕ):ℝ)*((25600*treeError g)*(256:ℝ)^(2^k)) := + mul_le_mul_of_nonneg_left (treeMajorant_mean P c T g hg0 hg) (by positivity) + _ = _ := by unfold treeProjectionConstant; ring + +end +end Ostmann.Tree + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TruncatedModePairing.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TruncatedModePairing.lean new file mode 100644 index 0000000000000000000000000000000000000000..d2ef65d08c3ac48ed04587e484291e87b4a05859 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TruncatedModePairing.lean @@ -0,0 +1,69 @@ +import OAI.NumberTheory.Ostmann.Characters.SparseTruncatedOperator + +namespace OAI + +/-! # Pairing the truncated kernel against only its active centered modes -/ + +namespace Ostmann +open WithLp +open scoped Classical BigOperators ComplexConjugate + +noncomputable def countingVectorNorm {α : Type*} [Fintype α] (f : α → ℂ) : ℝ := + ‖(toLp 2 f : EuclideanSpace ℂ α)‖ + +theorem countingVectorNorm_sq {α : Type*} [Fintype α] (f : α → ℂ) : + countingVectorNorm f ^ 2 = ∑ x, ‖f x‖ ^ 2 := EuclideanSpace.norm_sq_eq _ + +theorem finiteKernelOperator_pairing_le {α β : Type*} [Fintype α] [Fintype β] + (M : α → β → ℂ) (f : α → ℂ) (g : β → ℂ) : + ‖∑ x, conj (f x) * ∑ y, M x y * g y‖ ≤ + ‖finiteKernelOperator M‖ * countingVectorNorm f * countingVectorNorm g := by + have he : (∑ x, conj (f x) * ∑ y, M x y * g y) = + inner ℂ (toLp 2 f : EuclideanSpace ℂ α) + (finiteKernelOperator M (toLp 2 g)) := by + simp only [PiLp.inner_apply, RCLike.inner_apply', finiteKernelOperator_apply] + rw [he] + calc + _ ≤ countingVectorNorm f * ‖finiteKernelOperator M (toLp 2 g)‖ := norm_inner_le_norm _ _ + _ ≤ countingVectorNorm f * (‖finiteKernelOperator M‖ * countingVectorNorm g) := + mul_le_mul_of_nonneg_left ((finiteKernelOperator M).le_opNorm _) (norm_nonneg _) + _ = _ := by ring + +noncomputable def lowModeVector {n : ℕ} {p : Fin n → ℕ} + (K : ℕ) (f : (∀ i, Option (ZMod (p i))) → ℂ) (x : ∀ i, Option (ZMod (p i))) : ℂ := + if (centeredCoordinateSupport x).card ≤ K then f x else 0 + +theorem truncatedSparseTensorKernel_pairing {n : ℕ} + (p : Fin n → ℕ) [∀ i, NeZero (p i)] + (S : ∀ i, Finset (ZMod (p i))) (K : ℕ) + (f g : (∀ i, Option (ZMod (p i))) → ℂ) : + (∑ x, conj (f x) * ∑ y, truncatedSparseTensorKernel p S K x y * g y) = + ∑ x, conj (lowModeVector (2 * K) f x) * + ∑ y, truncatedSparseTensorKernel p S K x y * lowModeVector (2 * K) g y := by + simp_rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro x _ + apply Finset.sum_congr rfl + intro y _ + by_cases hx : (centeredCoordinateSupport x).card ≤ 2 * K + · by_cases hy : (centeredCoordinateSupport y).card ≤ 2 * K + · simp only [lowModeVector, hx, hy, ite_true] + · have hz := truncatedSparseTensorKernel_mode_support p S K x y (Or.inr (by omega)) + simp only [hz, mul_zero, zero_mul] + · have hz := truncatedSparseTensorKernel_mode_support p S K x y (Or.inl (by omega)) + simp only [hz, mul_zero, zero_mul] + +theorem truncatedSparseTensorKernel_pairing_le {n : ℕ} + (p : Fin n → ℕ) [∀ i, NeZero (p i)] + (S : ∀ i, Finset (ZMod (p i))) (K : ℕ) + (f g : (∀ i, Option (ZMod (p i))) → ℂ) : + ‖∑ x, conj (f x) * ∑ y, truncatedSparseTensorKernel p S K x y * g y‖ ≤ + ‖finiteKernelOperator (truncatedSparseTensorKernel p S K)‖ * + countingVectorNorm (lowModeVector (2 * K) f) * + countingVectorNorm (lowModeVector (2 * K) g) := by + rw [truncatedSparseTensorKernel_pairing] + exact finiteKernelOperator_pairing_le _ _ _ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TwistedPairSpectrum.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TwistedPairSpectrum.lean new file mode 100644 index 0000000000000000000000000000000000000000..ffea43685ad51703706dffa19881c6ffb5f27dca --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TwistedPairSpectrum.lean @@ -0,0 +1,52 @@ +import OAI.NumberTheory.Ostmann.Tree.PairTotalMass +import OAI.NumberTheory.Ostmann.Tree.UniformMellin + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def twistedPairFourier (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ α : MulChar (ZMod p) ℂ) (a : ZMod p) : ℂ := + fourier (fun d => pairSpectrum g χ ((σ:ZMod p)*d)*α d) a + +theorem l2Sq_unitMul (f : ZMod p → ℂ) (σ : (ZMod p)ˣ) : + l2Sq (fun d => f ((σ:ZMod p)*d))=l2Sq f := by + unfold l2Sq + congr 1 + exact (Equiv.mulLeft₀ (σ:ZMod p) (Units.ne_zero σ)).bijective.sum_comp (fun d => ‖f d‖^2) + +theorem mulChar_norm_le_one (α : MulChar (ZMod p) ℂ) (d : ZMod p) : ‖α d‖≤1 := by + by_cases hd : d=0 + · simp [hd,MulChar.map_zero] + · exact le_of_eq (mulChar_norm_unit α (Units.mk0 d hd)) + +theorem twistedPairFourier_energy (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (χ α : MulChar (ZMod p) ℂ) : + (∑ a : ZMod p, ‖twistedPairFourier g σ χ α a‖^2) ≤ pairFourthMass g χ := by + rw [pairFourthMass_eq_l2Sq] + change (∑ a, ‖fourier (fun d => pairSpectrum g χ ((σ:ZMod p)*d)*α d) a‖^2) ≤ _ + rw [fourier_parseval,← l2Sq_unitMul (pairSpectrum g χ) σ] + unfold l2Sq + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Finset.sum_le_sum + intro d _ + rw [norm_mul,mul_pow] + have h := pow_le_pow_left₀ (norm_nonneg (α d)) (mulChar_norm_le_one α d) 2 + exact (mul_le_mul_of_nonneg_left h (sq_nonneg _)).trans_eq (by simp) + +theorem twistedPairFourier_uniform (g : ZMod p → ℂ) (σ : (ZMod p)ˣ) + (hσ : (σ:ZMod p)^2=1) (hg0 : g 0=0) (hg : l2Sq g≤1) + (η : MulChar (ZMod p) ℂ) (a : ZMod p) : + (∑ χ : MulChar (ZMod p) ℂ, ‖twistedPairFourier g σ χ (χ*η) a‖^2) ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))* + ((correlationBound g:ℝ)^4+Real.sqrt (3/(p:ℝ))) := by + simpa only [twistedPairFourier,MulChar.mul_apply,mul_assoc] using + uniform_mellin_bound g η a σ hσ hg0 hg + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairBare.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairBare.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e7a9cec8bda4847651c9d831222117e741e9d52 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairBare.lean @@ -0,0 +1,51 @@ +import OAI.NumberTheory.Ostmann.Tree.PairSecondMoment + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def twoPairBare (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) (L R : PairMode) + (d e : ZMod p) (lam mu : (ZMod p)ˣ) : ℂ := + pairTest g σ d ((lam:ZMod p)*L.multiplier d e)* + pairTest h τ e ((mu:ZMod p)*R.multiplier e d) + +theorem twoPairBare_zero_left (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) (L R : PairMode) + (e : ZMod p) (lam mu : (ZMod p)ˣ) (hg0 : g 0=0) : + twoPairBare g h σ τ L R 0 e lam mu=0 := by simp [twoPairBare,pairTest_zero g σ hg0] + +theorem twoPairBare_zero_right (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) (L R : PairMode) + (d : ZMod p) (lam mu : (ZMod p)ˣ) (hh0 : h 0=0) : + twoPairBare g h σ τ L R d 0 lam mu=0 := by simp [twoPairBare,pairTest_zero h τ hh0] + +theorem twoPairBare_parameter_average (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (d e : ZMod p) (hg0 : g 0=0) (hh0 : h 0=0) : + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2* + (∑ lam : (ZMod p)ˣ,∑ mu : (ZMod p)ˣ,‖twoPairBare g h σ τ L R d e lam mu‖^2) = + pairSecondMoment g σ d*pairSecondMoment h τ e := by + by_cases hd : d=0 + · subst d + simp [twoPairBare_zero_left g h σ τ L R _ _ _ hg0,pairSecondMoment_zero g σ hg0] + by_cases he : e=0 + · subst e + simp [twoPairBare_zero_right g h σ τ L R _ _ _ hh0,pairSecondMoment_zero h τ hh0] + let D : (ZMod p)ˣ := Units.mk0 d hd + let E : (ZMod p)ˣ := Units.mk0 e he + have hl : ((L.unitMultiplier D E:(ZMod p)ˣ):ZMod p)=L.multiplier d e := L.coe_unitMultiplier D E + have hr : ((R.unitMultiplier E D:(ZMod p)ˣ):ZMod p)=R.multiplier e d := R.coe_unitMultiplier E D + simp only [twoPairBare,norm_mul,mul_pow] + calc + _ = ((Fintype.card (ZMod p)ˣ:ℝ)⁻¹*∑ lam : (ZMod p)ˣ, + ‖pairTest g σ d ((lam:ZMod p)*L.multiplier d e)‖^2)* + ((Fintype.card (ZMod p)ˣ:ℝ)⁻¹*∑ mu : (ZMod p)ˣ, + ‖pairTest h τ e ((mu:ZMod p)*R.multiplier e d)‖^2) := by + simp only [← Finset.mul_sum,← Finset.sum_mul] + ring + _ = _ := by rw [← hl,← hr,pairSecondMoment_parameter_average,pairSecondMoment_parameter_average] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairConvolution.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..76eb14939b39a199938f29dc0c443ee9ac935dfb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairConvolution.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.Ostmann.Tree.DoubleMellinEnergy +import OAI.NumberTheory.Ostmann.Tree.TwoPairMellin + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def twoPairConvolution (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (ν : MulChar (ZMod p) ℂ) + (lam mu : (ZMod p)ˣ) (y : ZMod p) : ℂ := + mean (fun d => twoPairValue g h σ τ L R ν d (d-y) lam mu) + +theorem twoPairConvolution_doubleMellin (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (ν χ ψ : MulChar (ZMod p) ℂ) (y : ZMod p) + (hg0 : g 0=0) (hh0 : h 0=0) : + doubleMellin (fun lam mu => twoPairConvolution g h σ τ L R ν lam mu y) χ ψ = + differenceConvolution + (fun d => pairSpectrum g χ ((σ:ZMod p)*d)*(leftPairTwist L R ν χ ψ) d) + (fun e => pairSpectrum h ψ ((τ:ZMod p)*e)*(rightPairTwist L R ν χ ψ) e) y := by + unfold twoPairConvolution + rw [doubleMellin_mean] + simp_rw [twoPairValue_doubleMellin g h σ τ L R ν χ ψ _ _ hg0 hh0] + rfl + +theorem twoPairConvolution_energy (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (ν : MulChar (ZMod p) ℂ) (hg0 : g 0=0) (hh0 : h 0=0) : + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2* + (∑ lam : (ZMod p)ˣ,∑ mu : (ZMod p)ˣ,l2Sq (twoPairConvolution g h σ τ L R ν lam mu)) = + ∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + ‖twistedPairFourier g σ χ (leftPairTwist L R ν χ ψ) a‖^2 * + ‖twistedPairFourier h τ ψ (rightPairTwist L R ν χ ψ) (-a)‖^2 := by + rw [doubleMellin_mean_energy] + apply Finset.sum_congr rfl + intro χ _ + apply Finset.sum_congr rfl + intro ψ _ + simp_rw [twoPairConvolution_doubleMellin g h σ τ L R ν χ ψ _ hg0 hh0] + exact differenceConvolution_parseval _ _ + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairMellin.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairMellin.lean new file mode 100644 index 0000000000000000000000000000000000000000..6148220bab743ba9a5d8123bb1e9bdefe3a9c122 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairMellin.lean @@ -0,0 +1,40 @@ +import OAI.NumberTheory.Ostmann.Tree.PairMellinVariables +import OAI.NumberTheory.Ostmann.Tree.TwistedPairSpectrum + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem twoPairValue_doubleMellin (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (ν χ ψ : MulChar (ZMod p) ℂ) (d e : ZMod p) + (hg0 : g 0=0) (hh0 : h 0=0) : + doubleMellin (twoPairValue g h σ τ L R ν d e) χ ψ = + (pairSpectrum g χ ((σ:ZMod p)*d)*(leftPairTwist L R ν χ ψ) d)* + (pairSpectrum h ψ ((τ:ZMod p)*e)*(rightPairTwist L R ν χ ψ) e) := by + by_cases hd : d=0 + · subst d + simp [twoPairValue,doubleMellin,mellin,MulChar.map_zero] + by_cases he : e=0 + · subst e + simp [twoPairValue,doubleMellin,mellin,MulChar.map_zero] + let D : (ZMod p)ˣ := Units.mk0 d hd + let E : (ZMod p)ˣ := Units.mk0 e he + have hl : ((L.unitMultiplier D E:(ZMod p)ˣ):ZMod p)=L.multiplier d e := L.coe_unitMultiplier D E + have hr : ((R.unitMultiplier E D:(ZMod p)ˣ):ZMod p)=R.multiplier e d := R.coe_unitMultiplier E D + unfold twoPairValue + rw [doubleMellin_product,← hl,← hr, + pairTest_mellin_mul g σ (L.unitMultiplier D E) χ d hd hg0, + pairTest_mellin_mul h τ (R.unitMultiplier E D) ψ e he hh0] + have honeD : (1:MulChar (ZMod p) ℂ) d=1 := MulChar.one_apply (isUnit_iff_ne_zero.mpr hd) + have honeE : (1:MulChar (ZMod p) ℂ) e=1 := MulChar.one_apply (isUnit_iff_ne_zero.mpr he) + cases L <;> cases R <;> + simp only [PairMode.unitMultiplier,leftPairTwist,rightPairTwist,MulChar.mul_apply, + MulChar.inv_apply',Units.val_inv_eq_inv_val,D,E,Units.val_mk0,honeD,honeE] <;> ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairModeBounds.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairModeBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..b16ddaadeb76beaf7e7d10059dc6cdcc1c1d34bf --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairModeBounds.lean @@ -0,0 +1,82 @@ +import OAI.NumberTheory.Ostmann.Tree.BadConvolution +import OAI.NumberTheory.Ostmann.Tree.FriendlyRightConvolution +import OAI.NumberTheory.Ostmann.Tree.TwoPairMellin + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem friendly_constant_bound (g h : ZMod p → ℂ) (hg : l2Sq g≤1) : + (2*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2)* + ((correlationBound g:ℝ)^4+Real.sqrt (3/(p:ℝ))) ≤ + 100*((correlationBound g:ℝ)^2+(correlationBound h:ℝ)^2+Real.sqrt (3/(p:ℝ))) := by + have hr : ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2≤4 := + (pow_le_pow_left₀ (show (0:ℝ)≤(p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ) by positivity) + (prime_unit_ratio_le_two (p:=p)) 2).trans_eq (by norm_num) + have he : (correlationBound g:ℝ)^2≤1 := + (pow_le_pow_left₀ (NNReal.coe_nonneg (correlationBound g)) (correlationBound_le_one g hg) 2).trans_eq (by norm_num) + have he4 : (correlationBound g:ℝ)^4≤(correlationBound g:ℝ)^2 := by + have hh := mul_le_mul_of_nonneg_left he (sq_nonneg (correlationBound g:ℝ)) + nlinarith only [hh] + have hprod := mul_le_mul (show 2*((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))^2≤8 by linarith) + (add_le_add he4 le_rfl) (show 0≤(correlationBound g:ℝ)^4+Real.sqrt (3/(p:ℝ)) by positivity) + (show (0:ℝ)≤8 by norm_num) + nlinarith only [hprod,sq_nonneg (correlationBound g:ℝ),sq_nonneg (correlationBound h:ℝ),Real.sqrt_nonneg (3/(p:ℝ))] + +theorem inv_prime_le_sqrt_three : (p:ℝ)⁻¹≤Real.sqrt (3/(p:ℝ)) := by + have hp : 0<(p:ℝ) := by exact_mod_cast (Fact.out : p.Prime).pos + have ht : (p:ℝ)⁻¹≤1 := inv_le_one_of_one_le₀ (by exact_mod_cast (Fact.out : p.Prime).one_lt.le) + have hz : 0≤(p:ℝ)⁻¹ := inv_nonneg.mpr hp.le + have hs := Real.sq_sqrt (show (0:ℝ)≤3/(p:ℝ) by positivity) + have hm := mul_le_mul_of_nonneg_left ht hz + have hsp := Real.sqrt_nonneg (3/(p:ℝ)) + simp only [div_eq_mul_inv] at hs hsp ⊢ + nlinarith only [hm,hs,hsp,hz] + +theorem twoPair_mode_convolution_bound (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (ν : MulChar (ZMod p) ℂ) + (hσ : (σ:ZMod p)^2=1) (hτ : (τ:ZMod p)^2=1) + (hg0 : g 0=0) (hg : l2Sq g≤1) (hh0 : h 0=0) (hh : l2Sq h≤1) : + (∑ χ : MulChar (ZMod p) ℂ,∑ ψ : MulChar (ZMod p) ℂ,∑ a : ZMod p, + ‖twistedPairFourier g σ χ (leftPairTwist L R ν χ ψ) a‖^2 * + ‖twistedPairFourier h τ ψ (rightPairTwist L R ν χ ψ) (-a)‖^2) ≤ + 100*((correlationBound g:ℝ)^2+(correlationBound h:ℝ)^2+Real.sqrt (3/(p:ℝ))) := by + have hcycle (F : MulChar (ZMod p) ℂ → MulChar (ZMod p) ℂ → ZMod p → ℝ) : + (∑ χ,∑ ψ,∑ a,F χ ψ a)=∑ ψ,∑ a,∑ χ,F χ ψ a := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro ψ _ + rw [Finset.sum_comm] + have hswap (F : MulChar (ZMod p) ℂ → MulChar (ZMod p) ℂ → ZMod p → ℝ) : + (∑ χ,∑ ψ,∑ a,F χ ψ a)=∑ χ,∑ a,∑ ψ,F χ ψ a := by + apply Finset.sum_congr rfl + intro χ _ + rw [Finset.sum_comm] + cases L <;> cases R + · rw [hcycle] + have he := friendly_convolution_bound g h σ τ hσ hg0 hg hh0 hh + (fun _ => ν) (fun ψ => ν⁻¹*ψ) + apply le_trans _ (friendly_constant_bound g h hg) + simpa only [leftPairTwist,rightPairTwist,mul_one,mul_comm] using he + · rw [hcycle] + have he := friendly_convolution_bound g h σ τ hσ hg0 hg hh0 hh + (fun ψ => ν*ψ⁻¹) (fun _ => ν⁻¹) + apply le_trans _ (friendly_constant_bound g h hg) + simpa only [leftPairTwist,rightPairTwist,mul_one,mul_assoc,mul_comm,mul_left_comm,add_comm] using he + · rw [hswap] + have he := friendly_convolution_right_bound g h σ τ hτ hg0 hg hh0 hh + (fun _ => ν) (fun χ => ν⁻¹*χ⁻¹) + apply le_trans _ (show _≤100*((correlationBound g:ℝ)^2+(correlationBound h:ℝ)^2+Real.sqrt (3/(p:ℝ))) from by + simpa only [add_comm,add_left_comm,add_assoc] using friendly_constant_bound h g hh) + simpa only [leftPairTwist,rightPairTwist,mul_one,mul_assoc,mul_comm,mul_left_comm,add_comm] using he + · have he := bad_convolution_bound g h σ τ ν hg0 hg hh0 hh + apply le_trans _ (mul_le_mul_of_nonneg_left (add_le_add le_rfl (inv_prime_le_sqrt_three (p:=p))) (by norm_num : (0:ℝ)≤100)) + simpa only [leftPairTwist,rightPairTwist,mul_one] using he + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairRatioEnergy.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairRatioEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..2694b5b1afa7ccfc8989180cfe7fcd4205c8a355 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TwoPairRatioEnergy.lean @@ -0,0 +1,81 @@ +import OAI.NumberTheory.Ostmann.Tree.RatioOrthogonality +import OAI.NumberTheory.Ostmann.Tree.TwoPairBare +import OAI.NumberTheory.Ostmann.Tree.TwoPairConvolution + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem twoPairConvolution_ratio_energy (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) + (L R : PairMode) (lam mu y : (ZMod p)ˣ) (hg0 : g 0=0) (hh0 : h 0=0) : + (∑ ν : MulChar (ZMod p) ℂ,‖twoPairConvolution g h σ τ L R ν lam mu y‖^2) = + (Fintype.card (ZMod p)ˣ:ℝ)*(p:ℝ)⁻¹^2* + ∑ d : ZMod p,‖twoPairBare g h σ τ L R d (d-y) lam mu‖^2 := by + let f : ZMod p → ℂ := fun d => twoPairBare g h σ τ L R d (d-y) lam mu + have he (ν : MulChar (ZMod p) ℂ) : + twoPairConvolution g h σ τ L R ν lam mu y = + (p:ℂ)⁻¹*∑ d : ZMod p,f d*ν d*ν⁻¹ (d-y) := by + unfold twoPairConvolution twoPairValue mean + congr 1 + apply Finset.sum_congr rfl + intro d _ + dsimp [f,twoPairBare] + ring + have hfilter : (∑ d : ZMod p,if d=0 ∨ d=(y:ZMod p) then 0 else ‖f d‖^2)=∑ d : ZMod p,‖f d‖^2 := by + apply Finset.sum_congr rfl + intro d _ + by_cases hd : d=0 ∨ d=(y:ZMod p) + · rcases hd with hd | hd + · subst d + simp [f,twoPairBare_zero_left g h σ τ L R _ _ _ hg0] + · subst d + simp [f,twoPairBare_zero_right g h σ τ L R _ _ _ hh0] + · simp [hd] + simp_rw [he,norm_mul,norm_inv,Complex.norm_natCast,mul_pow] + rw [← Finset.mul_sum,ratio_character_energy f y (Units.ne_zero y),hfilter] + ring + +def crossMajorant (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) (L R : PairMode) + (ν : MulChar (ZMod p) ℂ) (y : ZMod p) : ℝ := + (Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2* + ∑ lam : (ZMod p)ˣ,∑ mu : (ZMod p)ˣ,‖twoPairConvolution g h σ τ L R ν lam mu y‖^2 + +theorem crossMajorant_nonneg (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) (L R : PairMode) + (ν : MulChar (ZMod p) ℂ) (y : ZMod p) : 0≤crossMajorant g h σ τ L R ν y := by + unfold crossMajorant + positivity + +theorem crossMajorant_sum (g h : ZMod p → ℂ) (σ τ : (ZMod p)ˣ) (L R : PairMode) + (y : (ZMod p)ˣ) (hg0 : g 0=0) (hh0 : h 0=0) : + (∑ ν : MulChar (ZMod p) ℂ,crossMajorant g h σ τ L R ν y) = + (Fintype.card (ZMod p)ˣ:ℝ)*(p:ℝ)⁻¹^2* + ∑ d : ZMod p,pairSecondMoment g σ d*pairSecondMoment h τ (d-y) := by + unfold crossMajorant + rw [← Finset.mul_sum] + have hs : (∑ ν : MulChar (ZMod p) ℂ,∑ lam : (ZMod p)ˣ,∑ mu : (ZMod p)ˣ, + ‖twoPairConvolution g h σ τ L R ν lam mu y‖^2) = + ∑ lam : (ZMod p)ˣ,∑ mu : (ZMod p)ˣ,∑ ν : MulChar (ZMod p) ℂ, + ‖twoPairConvolution g h σ τ L R ν lam mu y‖^2 := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro lam _ + rw [Finset.sum_comm] + rw [hs] + simp_rw [twoPairConvolution_ratio_energy g h σ τ L R _ _ y hg0 hh0] + simp only [← Finset.mul_sum] + rw [sum_three_rotate] + calc + _ = (Fintype.card (ZMod p)ˣ:ℝ)*(p:ℝ)⁻¹^2* + ∑ d : ZMod p, (Fintype.card (ZMod p)ˣ:ℝ)⁻¹^2* + ∑ lam : (ZMod p)ˣ,∑ mu : (ZMod p)ˣ,‖twoPairBare g h σ τ L R d (d-y) lam mu‖^2 := by + rw [← Finset.mul_sum] + ring + _ = _ := by simp_rw [twoPairBare_parameter_average g h σ τ L R _ _ hg0 hh0] + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/TwoVertexReindex.lean b/lean/OAI/NumberTheory/Ostmann/Tree/TwoVertexReindex.lean new file mode 100644 index 0000000000000000000000000000000000000000..6c7b10457ba6cabd8258e92153c7fa3414013589 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/TwoVertexReindex.lean @@ -0,0 +1,94 @@ +import Mathlib.Data.Fintype.Sum +import OAI.NumberTheory.Ostmann.Construction.MatchedGraphQuotient + +namespace OAI + +/-! # Isolating two selected actual vertices without changing a graph product -/ + +namespace Ostmann + +open scoped Classical + +abbrev OtherVertices {V : Type*} (a b : V) := {v : V // v ≠ a ∧ v ≠ b} + +noncomputable def twoVertexEquiv {V : Type*} (a b : V) (hab : a ≠ b) : + (Bool ⊕ OtherVertices a b) ≃ V where + toFun v := match v with + | .inl true => a + | .inl false => b + | .inr v => v.val + invFun v := if ha : v = a then .inl true else + if hb : v = b then .inl false else .inr ⟨v, ha, hb⟩ + left_inv v := by + cases v with + | inl t => cases t <;> simp [hab.symm] + | inr v => simp [v.property.1, v.property.2] + right_inv v := by + dsimp only + split_ifs with ha hb + · exact ha.symm + · exact hb.symm + · rfl + +@[simp] theorem twoVertexEquiv_short {V : Type*} (a b : V) (hab : a ≠ b) : + twoVertexEquiv a b hab (.inl true) = a := rfl + +@[simp] theorem twoVertexEquiv_long {V : Type*} (a b : V) (hab : a ≠ b) : + twoVertexEquiv a b hab (.inl false) = b := rfl + +@[simp] theorem twoVertexEquiv_other {V : Type*} (a b : V) (hab : a ≠ b) + (v : OtherVertices a b) : twoVertexEquiv a b hab (.inr v) = v := rfl + +/-- Reindexing is exact even when the unary factors contain role membership +or counterpart-prior restrictions. -/ +theorem finiteEdgeWeight_two_vertices {V : Type*} [Fintype V] (a b : V) (hab : a ≠ b) + (χ : V → ∀ p : ℕ, DirichletCharacter ℂ p) (graph : V → V → ℤ) + (ν : V → ℕ → ℂ) (p : Bool ⊕ OtherVertices a b → ℕ) : + finiteEdgeWeight (dirichletGraphEdge (fun i => χ (twoVertexEquiv a b hab i)) + (fun i j => graph (twoVertexEquiv a b hab i) (twoVertexEquiv a b hab j))) + (fun i => ν (twoVertexEquiv a b hab i)) p = + finiteEdgeWeight (dirichletGraphEdge χ graph) ν (fun v => p ((twoVertexEquiv a b hab).symm v)) := by + classical + have h := finiteEdgeWeight_equiv (twoVertexEquiv a b hab) + (dirichletGraphEdge χ graph) ν (fun v => p ((twoVertexEquiv a b hab).symm v)) + have hp : (fun i => p ((twoVertexEquiv a b hab).symm (twoVertexEquiv a b hab i))) = p := by + funext i + rw [Equiv.symm_apply_apply] + change finiteEdgeWeight + (fun i j => dirichletGraphEdge χ graph (twoVertexEquiv a b hab i) (twoVertexEquiv a b hab j)) + (fun i => ν (twoVertexEquiv a b hab i)) + (fun i => p ((twoVertexEquiv a b hab).symm (twoVertexEquiv a b hab i))) = _ at h + rw [hp] at h + exact h + +theorem reindexed_one_sided_conditions {V : Type*} (a b : V) (hab : a ≠ b) + (graph : V → V → ℤ) (hself : graph a a = 0 ∧ graph b b = 0) + (hreverse : graph b a = 0) : + let e := twoVertexEquiv a b hab + (graph (e (.inl true)) (e (.inl true)) = 0 ∧ + graph (e (.inl false)) (e (.inl false)) = 0) ∧ + graph (e (.inl false)) (e (.inl true)) = 0 := ⟨hself, hreverse⟩ + +/-- All the unselected vertices are fixed only after the two genuine labels +have been isolated. Their factors contribute bounded unary functions. -/ +theorem selected_graph_factorization {V : Type*} [Fintype V] (a b : V) (hab : a ≠ b) + (χ : V → ∀ p : ℕ, DirichletCharacter ℂ p) (graph : V → V → ℤ) + (ν : V → ℕ → ℂ) (outside : OtherVertices a b → ℕ) + (hν : ∀ v x, ‖ν v x‖ ≤ 1) (hself : graph a a = 0 ∧ graph b b = 0) + (hreverse : graph b a = 0) (hforward : graph a b ≠ 0) : + ∃ U W : ℕ → ℂ, (∀ p, ‖U p‖ ≤ 1) ∧ (∀ q, ‖W q‖ ≤ 1) ∧ + ∀ q p, finiteEdgeWeight (dirichletGraphEdge χ graph) ν + (fun v => twoVertexLabels outside q p ((twoVertexEquiv a b hab).symm v)) = + U p * W q * (χ a q ^ graph a b) (p : ZMod q) := by + let e := twoVertexEquiv a b hab + obtain ⟨U, W, hU, hW, hfactor⟩ := dirichlet_one_sided_graph_factorization + (fun v => χ (e v)) (fun v w => graph (e v) (e w)) (fun v => ν (e v)) outside + (fun v x => hν (e v) x) hself hreverse hforward + refine ⟨U, W, hU, hW, ?_⟩ + intro q p + rw [← finiteEdgeWeight_two_vertices a b hab χ graph ν (twoVertexLabels outside q p)] + exact hfactor q p + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/UniformCoordinateAverage.lean b/lean/OAI/NumberTheory/Ostmann/Tree/UniformCoordinateAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..031fc37cc59b26389e8824876a1c425c3691fb14 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/UniformCoordinateAverage.lean @@ -0,0 +1,29 @@ +import Mathlib.Logic.Equiv.Prod +import OAI.NumberTheory.Ostmann.Arithmetic.CRTLineAverage + +namespace OAI + +/-! # Coordinate marginals of the finite uniform CRT product -/ + +namespace Ostmann +open scoped BigOperators Classical + +theorem uniform_pi_coordinate_average {I : Type*} [Fintype I] [DecidableEq I] + (X : I → Type*) [∀ i, Fintype (X i)] [∀ i, Nonempty (X i)] (i : I) + (f : X i → ℝ) : + (Fintype.card (∀ j, X j) : ℝ)⁻¹ * (∑ x : ∀ j, X j, f (x i)) = + (Fintype.card (X i) : ℝ)⁻¹ * ∑ x : X i, f x := by + let e := Equiv.piSplitAt i X + have hs := e.symm.sum_comp (fun x : ∀ j, X j => f (x i)) + have hc := Fintype.card_congr e + have hn : (Fintype.card (∀ j : {j // j ≠ i}, X j) : ℝ) ≠ 0 := by + exact_mod_cast Fintype.card_ne_zero + rw [← hs, hc, Fintype.card_prod, Nat.cast_mul, Fintype.sum_prod_type] + simp only [e, Equiv.piSplitAt, Equiv.coe_fn_mk, Equiv.symm_mk] + simp only [dite_true, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + rw [← Finset.mul_sum] + field_simp + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/UniformGroupReduction.lean b/lean/OAI/NumberTheory/Ostmann/Tree/UniformGroupReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..54a67d37f605478539e9b29edaaf1b43602cb5e5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/UniformGroupReduction.lean @@ -0,0 +1,65 @@ +import Mathlib.GroupTheory.Coset.Card +import OAI.NumberTheory.Ostmann.Arithmetic.SquareRootProbability + +namespace OAI + +/-! # Uniform unit reduction to a divisor of the frequency modulus -/ + +namespace Ostmann + +open scoped BigOperators Classical + +theorem surjective_group_sum {G H : Type*} [Group G] [Group H] + [Fintype G] [Fintype H] (f : G →* H) (hf : Function.Surjective f) (F : H → ℝ) : + (∑ x : G, F (f x)) = (Fintype.card f.ker : ℝ) * ∑ y : H, F y := by + have hcard (y : H) : (Finset.univ.filter (fun x : G => f x = y)).card = + Fintype.card f.ker := by + rw [← Fintype.card_subtype] + exact Fintype.card_congr (MonoidHom.fiberEquivKerOfSurjective hf y) + rw [← Finset.sum_fiberwise_of_maps_to (g := f) (t := Finset.univ) + (fun _ _ => Finset.mem_univ _) (fun x => F (f x))] + calc + _ = ∑ y : H, (Fintype.card f.ker : ℝ) * F y := by + apply Finset.sum_congr rfl + intro y _ + calc + _ = ∑ _x ∈ Finset.univ.filter (fun x : G => f x = y), F y := + Finset.sum_congr rfl fun _ hx => congrArg F (Finset.mem_filter.mp hx).2 + _ = _ := by simp [hcard] + _ = _ := (Finset.mul_sum _ _ _).symm + +theorem surjective_group_average {G H : Type*} [Group G] [Group H] + [Fintype G] [Fintype H] (f : G →* H) (hf : Function.Surjective f) (F : H → ℝ) : + (Fintype.card G : ℝ)⁻¹ * (∑ x : G, F (f x)) = + (Fintype.card H : ℝ)⁻¹ * ∑ y : H, F y := by + have hc : (Fintype.card G : ℝ) = + (Fintype.card f.ker : ℝ) * Fintype.card H := by + simpa only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one] + using surjective_group_sum f hf (fun _ => (1 : ℝ)) + have hk : (Fintype.card f.ker : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero + rw [surjective_group_sum f hf F, hc, mul_inv_rev] + field_simp + +theorem unit_reduction_average {q Q : ℕ} [NeZero q] [NeZero Q] (h : q ∣ Q) + (F : (ZMod q)ˣ → ℝ) : + (Fintype.card (ZMod Q)ˣ : ℝ)⁻¹ * + (∑ x : (ZMod Q)ˣ, F (ZMod.unitsMap h x)) = + (Fintype.card (ZMod q)ˣ : ℝ)⁻¹ * ∑ y : (ZMod q)ˣ, F y := + surjective_group_average (ZMod.unitsMap h) (ZMod.unitsMap_surjective h) F + +theorem unit_reduction_square_probability_le {q Q : ℕ} [NeZero q] [NeZero Q] + (h : q ∣ Q) (a : (ZMod q)ˣ) : + (Fintype.card (ZMod Q)ˣ : ℝ)⁻¹ * + (∑ x : (ZMod Q)ˣ, if (ZMod.unitsMap h x) ^ 2 = a then (1 : ℝ) else 0) ≤ + 2 * (q.divisors.card : ℝ) ^ 2 / q := by + rw [unit_reduction_average h (fun x => if x ^ 2 = a then (1 : ℝ) else 0)] + have hs : (∑ x : (ZMod q)ˣ, if x ^ 2 = a then (1 : ℝ) else 0) = + (Nat.card {x : (ZMod q)ˣ // x ^ 2 = a} : ℝ) := by + rw [Nat.card_eq_fintype_card, Fintype.card_subtype] + simp only [← Finset.sum_filter, Finset.sum_const, nsmul_eq_mul, mul_one] + rw [hs, mul_comm, ← div_eq_mul_inv] + exact unit_square_probability_le q a + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/UniformMellin.lean b/lean/OAI/NumberTheory/Ostmann/Tree/UniformMellin.lean new file mode 100644 index 0000000000000000000000000000000000000000..52a9c7ac1916eaf0765529b122960819a4582685 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/UniformMellin.lean @@ -0,0 +1,48 @@ +import OAI.NumberTheory.Ostmann.Tree.DiagonalMellin + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem uniform_mellin_bound (g : ZMod p → ℂ) (η : MulChar (ZMod p) ℂ) + (a : ZMod p) (σ : (ZMod p)ˣ) (hσ : (σ:ZMod p)^2=1) + (hg0 : g 0=0) (hg : l2Sq g ≤ 1) : + (∑ χ : MulChar (ZMod p) ℂ, + ‖fourier (fun d => pairSpectrum g χ ((σ:ZMod p)*d)*χ d*η d) a‖^2) ≤ + ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))* + ((correlationBound g:ℝ)^4+Real.sqrt (3/(p:ℝ))) := by + let G := reciprocalTwist g η (-a*(σ:ZMod p)) + let T : ZMod p → ℂ := weightedAffine (fun r => conj (G r)) G + have hpoint (lam : (ZMod p)ˣ) : + ‖mean (diagonalPairValue g η a σ lam)‖^2 = ‖T ((σ:ZMod p)/(lam:ZMod p))‖^2 := by + rw [diagonalPair_affine_mean g η a σ lam hσ hg0] + simp only [norm_mul,Complex.norm_conj,mulChar_norm_unit,one_mul] + rfl + have hparse := mellin_parseval (fun lam : (ZMod p)ˣ => mean (diagonalPairValue g η a σ lam)) + simp_rw [diagonalPair_mellin g _ η a σ hg0,hpoint] at hparse + rw [hparse] + have hi : Function.Bijective (fun lam : (ZMod p)ˣ => σ/lam) := + (Equiv.mulLeft σ).bijective.comp inv_involutive.bijective + have hs : (∑ lam : (ZMod p)ˣ, ‖T ((σ:ZMod p)/(lam:ZMod p))‖^2) = + ∑ u : (ZMod p)ˣ, ‖T u‖^2 := by + simpa only [Units.val_div_eq_div_val] using hi.sum_comp (fun u : (ZMod p)ˣ => ‖T u‖^2) + rw [hs] + have hT := reciprocalTwist_affine_bound g η (-a*(σ:ZMod p)) hg0 hg + change l2Sq T ≤ _ at hT + have hp : 0 < (p:ℝ) := by exact_mod_cast (Fact.out : p.Prime).pos + have hN : 0 < (Fintype.card (ZMod p)ˣ:ℝ) := by exact_mod_cast Fintype.card_pos + calc + _ ≤ (Fintype.card (ZMod p)ˣ:ℝ)⁻¹*(∑ t : ZMod p, ‖T t‖^2) := + mul_le_mul_of_nonneg_left (sum_units_le _ (fun _ => sq_nonneg _)) (inv_nonneg.mpr hN.le) + _ = ((p:ℝ)/(Fintype.card (ZMod p)ˣ:ℝ))*l2Sq T := by + dsimp [l2Sq] + field_simp + _ ≤ _ := mul_le_mul_of_nonneg_left hT (div_nonneg hp.le hN.le) + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/UnitSums.lean b/lean/OAI/NumberTheory/Ostmann/Tree/UnitSums.lean new file mode 100644 index 0000000000000000000000000000000000000000..23c0ce0cb43fdc015a36d8554810e641cb7f0fa2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/UnitSums.lean @@ -0,0 +1,55 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators +variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] + +theorem sum_units_of_zero {A : Type*} [AddCommMonoid A] (f : F → A) (hf : f 0=0) : + ∑ u : Fˣ, f u = ∑ x : F, f x := by + have hu : (∑ u : Fˣ, f u) = ∑ x ∈ Finset.univ.erase (0:F), f x := by + apply Finset.sum_bij (fun (u : Fˣ) _ => (u:F)) + · intro u _ + exact Finset.mem_erase.mpr ⟨Units.ne_zero u, Finset.mem_univ _⟩ + · intro u _ v _ h + exact Units.ext h + · intro x hx + refine ⟨Units.mk0 x (Finset.ne_of_mem_erase hx), Finset.mem_univ _, rfl⟩ + · intro _ _ + rfl + rw [hu] + have h := Finset.sum_erase_add Finset.univ f (Finset.mem_univ (0:F)) + simpa only [hf, add_zero] using h + +theorem sum_units_add_zero {A : Type*} [AddCommMonoid A] (f : F → A) : + (∑ u : Fˣ, f u) + f 0 = ∑ x : F, f x := by + have hu : (∑ u : Fˣ, f u) = ∑ x ∈ Finset.univ.erase (0:F), f x := by + apply Finset.sum_bij (fun (u : Fˣ) _ => (u:F)) + · intro u _ + exact Finset.mem_erase.mpr ⟨Units.ne_zero u, Finset.mem_univ _⟩ + · intro u _ v _ h + exact Units.ext h + · intro x hx + refine ⟨Units.mk0 x (Finset.ne_of_mem_erase hx), Finset.mem_univ _, rfl⟩ + · intro _ _ + rfl + rw [hu] + exact Finset.sum_erase_add Finset.univ f (Finset.mem_univ (0:F)) + +theorem sum_units_le (f : F → ℝ) (hf : ∀ x, 0 ≤ f x) : + ∑ u : Fˣ, f u ≤ ∑ x : F, f x := by + apply Finset.sum_le_sum_of_injOn (fun u : Fˣ => (u:F)) + · intro u _ v _ h + exact Units.ext h + · exact Finset.subset_univ _ + · intro _ _ + exact le_rfl + · intro x _ _ + exact hf x + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/UntouchedQuartetBound.lean b/lean/OAI/NumberTheory/Ostmann/Tree/UntouchedQuartetBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..a5a7328719dd819e6c79c3e1a953e3a86c06cb23 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/UntouchedQuartetBound.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.Tree.SamePairFiber + +namespace OAI + +/-! # Conditional second moment of an untouched actual quartet -/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable local instance untouchedFintype {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +theorem sum_samePairMajorant_eq {p : ℕ} [Fact p.Prime] + (g h : ZMod p → ℂ) (y : ZMod p) : + (∑ ρ : MulChar (ZMod p) ℂ, + samePairMajorant (fieldPairCoefficientMoment g) (fieldPairMoment h) ρ y) = + differenceMajorant (fieldPairMoment g) (fieldPairMoment h) y := by + unfold samePairMajorant differenceMajorant differenceMoment + rw [← Finset.mul_sum, Finset.sum_comm] + congr 1 + apply Finset.sum_congr rfl + intro d _ + rw [← Finset.sum_mul, sum_squareCharacterMass, sum_fieldPairCoefficientMoment] + +theorem rationalQuartet_fiber_secondMoment_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (D : (ZMod p)ˣ) (Q : RationalQuartetData (ZMod p)ˣ) + (XL XR P : (ZMod p)ˣ) : + (Fintype.card (TreeLeafFiber (ZMod p)ˣ 2 P) : ℝ)⁻¹ * + (∑ m : TreeLeafFiber (ZMod p)ˣ 2 P, + ‖rationalTreeAmplitude g D Q.tree XL XR ((false, true), (false, true)) m.1‖ ^ 2) ≤ + 8 * differenceMajorant (fieldPairMoment g) (fieldPairMoment g) + (rationalTreeArgument Q.s (Q.CL * Q.CR) D XL XR P) := by + rw [mean_samePairLeftFiber P (fun m => + ‖rationalTreeAmplitude g D Q.tree XL XR ((false, true), (false, true)) m‖ ^ 2)] + have h := Finset.sum_le_sum (s := (Finset.univ : Finset (MulChar (ZMod p) ℂ))) + (fun ρ _ => rationalQuartet_samePair_left_held_bound g D Q XL XR P ρ) + rw [← Finset.mul_sum] at h + conv_rhs at h => rw [← Finset.mul_sum, sum_samePairMajorant_eq] + apply le_of_eq_of_le _ h + symm + rw [Finset.sum_comm] + congr 1 + apply Finset.sum_congr rfl + intro a _ + rw [← Finset.mul_sum, Finset.sum_comm] + congr 1 + apply Finset.sum_congr rfl + intro b _ + exact mellin_parseval (fun r => rationalTreeAmplitude g D Q.tree XL XR + ((false, true), (false, true)) (samePairLeftLeaves P a b r)) + +theorem untouchedQuartetMajorant_mean_le {p : ℕ} [Fact p.Prime] + (g : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) : + (∑ y : (ZMod p)ˣ, + differenceMajorant (fieldPairMoment g) (fieldPairMoment g) y) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ + ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 4 := by + apply (mean_differenceMajorant_le _ _ + (fieldPairMoment_nonneg g) (fieldPairMoment_nonneg g)).trans + have h := fieldPairMoment_mean_le g hg henergy + have h0 : 0 ≤ (∑ d : ZMod p, fieldPairMoment g d) / (Fintype.card (ZMod p)ˣ : ℝ) := + div_nonneg (Finset.sum_nonneg fun d _ => fieldPairMoment_nonneg g d) (Nat.cast_nonneg _) + convert mul_le_mul h h h0 (sq_nonneg _) using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/WeightedAffine.lean b/lean/OAI/NumberTheory/Ostmann/Tree/WeightedAffine.lean new file mode 100644 index 0000000000000000000000000000000000000000..d4a001e29f4678ecc6e9869ee939213e6b59edf9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/WeightedAffine.lean @@ -0,0 +1,98 @@ +import OAI.NumberTheory.Ostmann.Tree.AffineUnitEnergy +import OAI.NumberTheory.Ostmann.Tree.MeanInner + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +def affineSubstitutionEquiv (r : (ZMod p)ˣ) : ZMod p ≃ ZMod p where + toFun := affineUnitSubstitution r + invFun := inverseAffineUnitSubstitution r + left_inv := inverseAffineUnitSubstitution_affine r + right_inv := affineUnitSubstitution_inverse r + +def weightedAffine (w : (ZMod p)ˣ → ℂ) (f : ZMod p → ℂ) (t : ZMod p) : ℂ := + (p:ℂ)⁻¹ * ∑ r, w r * f (affineUnitSubstitution r t) + +def weightedAffineAdjoint (w : (ZMod p)ˣ → ℂ) (f : ZMod p → ℂ) (t : ZMod p) : ℂ := + (p:ℂ)⁻¹ * ∑ r, conj (w r) * f (inverseAffineUnitSubstitution r t) + +theorem affineSubstitution_sum (r : (ZMod p)ˣ) (f : ZMod p → ℂ) : + ∑ t, f (affineUnitSubstitution r t) = ∑ t, f t := + (affineSubstitutionEquiv r).bijective.sum_comp f + +theorem affineSubstitution_pairing (r : (ZMod p)ˣ) (f h : ZMod p → ℂ) : + ∑ t, conj (f (affineUnitSubstitution r t))*h t = + ∑ t, conj (f t)*h (inverseAffineUnitSubstitution r t) := by + have hh := (affineSubstitutionEquiv r).bijective.sum_comp + (fun t => conj (f t)*h (inverseAffineUnitSubstitution r t)) + simpa only [affineSubstitutionEquiv, Equiv.coe_fn_mk, + inverseAffineUnitSubstitution_affine] using hh + +theorem weightedAffine_adjoint (w : (ZMod p)ˣ → ℂ) (f h : ZMod p → ℂ) : + meanInner (weightedAffine w f) h = meanInner f (weightedAffineAdjoint w h) := by + have hl : meanInner (weightedAffine w f) h = + (p:ℂ)⁻¹ * (p:ℂ)⁻¹ * ∑ r, conj (w r) * + ∑ t, conj (f (affineUnitSubstitution r t))*h t := by + simp only [meanInner, mean, weightedAffine, map_mul, map_inv₀, map_natCast, + map_sum, Finset.sum_mul, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro r _ + apply Finset.sum_congr rfl + intro t _ + ring + have hr : meanInner f (weightedAffineAdjoint w h) = + (p:ℂ)⁻¹ * (p:ℂ)⁻¹ * ∑ r, conj (w r) * + ∑ t, conj (f t)*h (inverseAffineUnitSubstitution r t) := by + simp only [meanInner, mean, weightedAffineAdjoint, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro r _ + apply Finset.sum_congr rfl + intro t _ + ring + rw [hl, hr] + simp_rw [affineSubstitution_pairing] + +theorem weightedAffine_adjoint_comp (w : (ZMod p)ˣ → ℂ) (f : ZMod p → ℂ) : + weightedAffineAdjoint w (weightedAffine w f) = + fun t => (p:ℂ)⁻¹*(p:ℂ)⁻¹ * affineAction (affineUnitCoefficient w) f t := by + funext t + unfold affineAction + rw [affineUnitCoefficient_action w f t] + simp only [weightedAffineAdjoint, weightedAffine, Finset.mul_sum] + apply Finset.sum_congr rfl + intro r _ + apply Finset.sum_congr rfl + intro s _ + ring + +theorem weightedAffine_mean (w : (ZMod p)ˣ → ℂ) (f : ZMod p → ℂ) : + mean (weightedAffine w f) = ((p:ℂ)⁻¹ * ∑ r, w r) * mean f := by + simp only [mean, weightedAffine, Finset.mul_sum, Finset.sum_mul] + rw [Finset.sum_comm] + calc + _ = ∑ r, (p:ℂ)⁻¹*(p:ℂ)⁻¹*w r * ∑ t, f (affineUnitSubstitution r t) := by + apply Finset.sum_congr rfl + intro r _ + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro t _ + ring + _ = _ := by + simp only [affineSubstitution_sum, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro r _ + apply Finset.sum_congr rfl + intro t _ + ring + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/WeightedAffineBound.lean b/lean/OAI/NumberTheory/Ostmann/Tree/WeightedAffineBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..24270baa51f551e9d19fc019a38bc0dc91a09335 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/WeightedAffineBound.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.Ostmann.Tree.WeightedAffine + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem weightedAffine_meanzero_bound (w : (ZMod p)ˣ → ℂ) (f : ZMod p → ℂ) + (hw : ∑ r, ‖w r‖^2 ≤ (p:ℝ)) (hf : mean f=0) (hfn : l2Sq f ≤ 1) : + l2Sq (weightedAffine w f) ≤ Real.sqrt (3/(p:ℝ)) := by + have hp : 0 < (p:ℝ) := by exact_mod_cast (Fact.out : p.Prime).pos + have hw0 : 0 ≤ ∑ r, ‖w r‖^2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + have hc : (∑ u, ∑ b, ‖affineUnitCoefficient w u b‖^2) ≤ 3*(p:ℝ)^2 := + (affineUnitCoefficient_energy w).trans + (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hw0 hw 2) (by norm_num)) + have haction : l2Sq (affineAction (affineUnitCoefficient w) f) ≤ 3*(p:ℝ)^3*l2Sq f := by + apply (affineAction_l2Sq_le _ _ hf).trans + have hh := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hc hp.le) (l2Sq_nonneg f) + convert hh using 1 + ring + have hscale : ‖(p:ℂ)⁻¹*(p:ℂ)⁻¹‖^2 = ((p:ℝ)⁻¹)^4 := by + simp only [norm_mul, norm_inv, Complex.norm_natCast] + ring + have hadj : l2Sq (weightedAffineAdjoint w (weightedAffine w f)) ≤ + (3/(p:ℝ))*l2Sq f := by + rw [weightedAffine_adjoint_comp, l2Sq_const_mul, hscale] + calc + _ ≤ ((p:ℝ)⁻¹)^4 * (3*(p:ℝ)^3*l2Sq f) := + mul_le_mul_of_nonneg_left haction (by positivity) + _ = _ := by field_simp + have hcs := meanInner_norm_sq_le f (weightedAffineAdjoint w (weightedAffine w f)) + rw [← weightedAffine_adjoint, meanInner_self, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (l2Sq_nonneg _)] at hcs + have hx : l2Sq (weightedAffine w f)^2 ≤ 3/(p:ℝ) := by + calc + _ ≤ l2Sq f * l2Sq (weightedAffineAdjoint w (weightedAffine w f)) := hcs + _ ≤ l2Sq f * ((3/(p:ℝ))*l2Sq f) := + mul_le_mul_of_nonneg_left hadj (l2Sq_nonneg f) + _ = (3/(p:ℝ))*(l2Sq f)^2 := by ring + _ ≤ (3/(p:ℝ))*1^2 := + mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (l2Sq_nonneg f) hfn 2) (by positivity) + _ = _ := by ring + exact (Real.le_sqrt (l2Sq_nonneg _) (by positivity)).mpr hx + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/Tree/WeightedFourierGauss.lean b/lean/OAI/NumberTheory/Ostmann/Tree/WeightedFourierGauss.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7ffad9058b83976211bf5081ee9ff30d8d3cf8c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/Tree/WeightedFourierGauss.lean @@ -0,0 +1,61 @@ +import OAI.NumberTheory.Ostmann.Characters.Gauss +import OAI.NumberTheory.Ostmann.Tree.CharacterFourth +import OAI.NumberTheory.Ostmann.Tree.PairSpectrum + +namespace OAI + +namespace Ostmann.FiniteField +noncomputable section +open scoped BigOperators ComplexConjugate +variable {p : ℕ} [Fact p.Prime] + +theorem fourier_mulChar_gauss (f : ZMod p → ℂ) (w : ZMod p → ℝ) + (hf : ∀ b,fourier f b=(w b:ℂ)) (α : MulChar (ZMod p) ℂ) (hα : α≠1) (a : ZMod p) : + fourier (fun d => f d*α d) a = + (p:ℂ)⁻¹*gaussSum α ZMod.stdAddChar*α⁻¹ (-1)*weightedCharacterSum w α⁻¹ a := by + have hfin (d : ZMod p) : f d=∑ b,(w b:ℂ)*ZMod.stdAddChar (b*d) := by + rw [fourier_inversion f d] + simp only [hf] + rw [fourier_apply] + simp_rw [hfin, Finset.sum_mul] + rw [Finset.sum_comm] + have hin (b : ZMod p) : + (∑ d : ZMod p, (w b:ℂ)*ZMod.stdAddChar (b*d)*α d*ZMod.stdAddChar (-(a*d))) = + (w b:ℂ)*α⁻¹ (-1)*α⁻¹ (a-b)*gaussSum α ZMod.stdAddChar := by + calc + _ = (w b:ℂ)*∑ d : ZMod p, α d*ZMod.stdAddChar ((b-a)*d) := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro d _ + rw [sub_mul,AddChar.map_sub_eq_div,AddChar.map_neg_eq_inv] + ring + _ = _ := by + rw [Characters.gauss_transform α hα ZMod.stdAddChar (b-a), + show b-a=(-1)*(a-b) from by ring, map_mul] + ring + simp_rw [hin] + simp only [weightedCharacterSum,Finset.mul_sum] + apply Finset.sum_congr rfl + intro b _ + ring + +theorem norm_fourier_mulChar_fourth (f : ZMod p → ℂ) (w : ZMod p → ℝ) + (hf : ∀ b,fourier f b=(w b:ℂ)) (α : MulChar (ZMod p) ℂ) (hα : α≠1) (a : ZMod p) : + ‖fourier (fun d => f d*α d) a‖^4 = + (p:ℝ)⁻¹^2*‖weightedCharacterSum w α⁻¹ a‖^4 := by + rw [fourier_mulChar_gauss f w hf α hα a] + have hunit : ‖α⁻¹ (-1:ZMod p)‖=1 := by + simpa only [Units.val_neg,Units.val_one] using mulChar_norm_unit α⁻¹ (-1:(ZMod p)ˣ) + simp only [norm_mul,norm_inv,Complex.norm_natCast,hunit,mul_one, + Characters.norm_gaussSum α hα ZMod.stdAddChar (ZMod.isPrimitive_stdAddChar p)] + rw [ZMod.card] + have hp : (p:ℝ)≠0 := by exact_mod_cast (Fact.out : p.Prime).ne_zero + have hs : (Real.sqrt (p:ℝ))^2=p := Real.sq_sqrt (by positivity) + calc + _ = ((p:ℝ)⁻¹)^4*((Real.sqrt (p:ℝ))^2)^2*‖weightedCharacterSum w α⁻¹ a‖^4 := by ring + _ = _ := by rw [hs]; field_simp + +end +end Ostmann.FiniteField + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualComplexZeroRegion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualComplexZeroRegion.lean new file mode 100644 index 0000000000000000000000000000000000000000..9cab695335c5841563c99ddf12abdfe264da4c9a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualComplexZeroRegion.lean @@ -0,0 +1,16 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualPageUniqueness +import OAI.NumberTheory.Ostmann.ZeroDensity.ComplexRegionFromPage + +namespace OAI + +/-! # The full-height zero-free region -/ + +namespace Ostmann + +theorem actualComplexZeroRegion : PublishedComplexZeroRegion actualCharacterZeros := by + obtain ⟨κ, hκ, hpage⟩ := exists_actual_page_uniqueness + exact complexZeroRegion_of_page κ hκ hpage + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualDensityDyadic.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualDensityDyadic.lean new file mode 100644 index 0000000000000000000000000000000000000000..6dceea7d52389c2951ed740f61fda4567d5d2ebd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualDensityDyadic.lean @@ -0,0 +1,52 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.OccurrenceCount +import OAI.NumberTheory.Ostmann.ZeroDensity.SelectedDensity +import OAI.NumberTheory.Ostmann.ZeroDensity.SeparatedSelection + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +theorem exists_actual_zero_density_dyadic_constant : + ∃ C : ℝ, 0 < C ∧ ∀ (Q H : ℕ) (exception : Option (PrimitiveFamily Q)) (σ : ℝ), + 0 < Q → 0 < H → 1/2 ≤ σ → σ ≤ 1 → + (totalZeroCount Q exception σ (H : ℝ) : ℝ) ≤ + 8*C*localMultiplicityBound Q H* + (detectorBlockCount (detectorLength Q H (Q^2*H)) : ℝ) * + ∑ j ∈ Finset.range (detectorBlockCount (detectorLength Q H (Q^2*H))), + (((2^j*(Q^2*H) : ℕ) : ℝ)+(Q : ℝ)^2*H) * (1+Real.log Q) * + (1+Real.log (2*(2^j*(Q^2*H) : ℕ) : ℝ))^7 * + (2^j*(Q^2*H) : ℕ) * ((2^j*(Q^2*H) : ℕ) : ℝ)^(-2*σ) := by + classical + obtain ⟨C,hC,hselected⟩ := exists_selected_zero_density_constant + refine ⟨C,hC,?_⟩ + intro Q H exception σ hQ hH hσ hσ1 + have hHR : (1 : ℝ) ≤ H := by exact_mod_cast hH + obtain ⟨r,hrs,hsep,hcard⟩ := exists_separated_selection + (retainedZeros Q exception σ (H : ℝ)) + (fun z => z.1) (fun z => z.point.im) + (retainedZeros_local_card_le Q exception hσ hHR) + have hr := hselected Q H exception σ r hQ hH hσ hσ1 hrs hsep + have hB := localMultiplicityBound_nonneg hQ hHR + calc + (totalZeroCount Q exception σ (H : ℝ) : ℝ) ≤ + 2*localMultiplicityBound Q H*r.card := hcard + _ ≤ 2*localMultiplicityBound Q H* + (4*C*(detectorBlockCount (detectorLength Q H (Q^2*H)) : ℝ) * + ∑ j ∈ Finset.range (detectorBlockCount (detectorLength Q H (Q^2*H))), + (((2^j*(Q^2*H) : ℕ) : ℝ)+(Q : ℝ)^2*H) * (1+Real.log Q) * + (1+Real.log (2*(2^j*(Q^2*H) : ℕ) : ℝ))^7 * + (2^j*(Q^2*H) : ℕ) * ((2^j*(Q^2*H) : ℕ) : ℝ)^(-2*σ)) := + mul_le_mul_of_nonneg_left hr (by positivity) + _ = _ := by ring + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualDetector.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualDetector.lean new file mode 100644 index 0000000000000000000000000000000000000000..a3fd17761baaafd993c1b4a10acb230219c122cf --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualDetector.lean @@ -0,0 +1,85 @@ +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring +import OAI.NumberTheory.Ostmann.Dirichlet.Tail +import OAI.NumberTheory.Ostmann.ZeroDensity.DetectorLength + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open scoped BigOperators ArithmeticFunction.Moebius ArithmeticFunction.zeta + +namespace Ostmann.ZeroDensity + +theorem twistedPolynomial_zeta {q : ℕ} (χ : DirichletCharacter ℂ q) (N : ℕ) (s : ℂ) : + twistedPolynomial χ (ζ : ArithmeticFunction ℂ) N s = + Ostmann.Dirichlet.dirichletPolynomial χ N s := by + unfold twistedPolynomial Ostmann.Dirichlet.dirichletPolynomial + apply Finset.sum_congr rfl + intro n hn + have hn0 : n ≠ 0 := by have := (Finset.mem_Icc.mp hn).1; omega + simp [ArithmeticFunction.natCoe_apply, ArithmeticFunction.zeta_apply_ne hn0] + +theorem actual_zero_mollified_product_le {q Q H X : ℕ} [NeZero q] + (χ : DirichletCharacter ℂ q) (hχ : χ ≠ 1) (hqQ : q ≤ Q) + (hH : 1 ≤ H) (hX : 1 ≤ X) {ρ : ℂ} (hzero : χ.LFunction ρ = 0) + (hβ : 1 / 2 ≤ ρ.re) (hβ1 : ρ.re ≤ 1) (hheight : |ρ.im| ≤ H) : + ‖twistedPolynomial χ (μ : ArithmeticFunction ℂ) X ρ * + twistedPolynomial χ (ζ : ArithmeticFunction ℂ) (detectorLength Q H X) ρ‖ ≤ 5 / 16 := by + have hq : 1 ≤ q := NeZero.pos q + have hQ : 1 ≤ Q := hq.trans hqQ + have hN : 1 ≤ detectorLength Q H X := hX.trans (detectorLength_ge hQ hH hX) + have hβpos : 0 < ρ.re := by linarith + have hHR : (1 : ℝ) ≤ H := by exact_mod_cast hH + have hqQR : (q : ℝ) ≤ Q := by exact_mod_cast hqQ + have hnorm : ‖ρ‖ ≤ 2 * H := by + calc + ‖ρ‖ ≤ |ρ.re| + |ρ.im| := Complex.norm_le_abs_re_add_abs_im ρ + _ ≤ 1 + H := by rw [abs_of_pos hβpos]; linarith + _ ≤ 2 * H := by linarith + have hratio : ‖ρ‖ / ρ.re ≤ 4 * H := by + apply (div_le_iff₀ hβpos).mpr + nlinarith + have hprefactor : (q : ℝ) * (1 + ‖ρ‖ / ρ.re) ≤ 5 * Q * H := by + calc + (q : ℝ) * (1 + ‖ρ‖ / ρ.re) ≤ (Q : ℝ) * (5 * H) := by + apply mul_le_mul hqQR (by linarith) (by positivity) (by positivity) + _ = _ := by ring + have htail := Ostmann.Dirichlet.norm_LFunction_sub_dirichletPolynomial_le χ hχ hβpos hN + rw [hzero, zero_sub, norm_neg] at htail + have hM := norm_mollifierPolynomial_le χ X hβpos.le + have hpow := detectorLength_rpow_le hQ hH hX hβ + rw [norm_mul, twistedPolynomial_zeta] + calc + ‖twistedPolynomial χ (μ : ArithmeticFunction ℂ) X ρ‖ * + ‖Ostmann.Dirichlet.dirichletPolynomial χ (detectorLength Q H X) ρ‖ ≤ + (X : ℝ) * ((q : ℝ) * (1 + ‖ρ‖ / ρ.re) * + (detectorLength Q H X : ℝ) ^ (-ρ.re)) := by + exact mul_le_mul hM htail (norm_nonneg _) (Nat.cast_nonneg _) + _ ≤ (X : ℝ) * ((5 * Q * H) * (16 * (Q : ℝ) * H * X)⁻¹) := by + gcongr + _ = 5 / 16 := by + have hQ0 : (Q : ℝ) ≠ 0 := by positivity + have hH0 : (H : ℝ) ≠ 0 := by positivity + have hX0 : (X : ℝ) ≠ 0 := by positivity + field_simp + +theorem actual_zero_detector {q Q H X : ℕ} [NeZero q] + (χ : DirichletCharacter ℂ q) (hχ : χ ≠ 1) (hqQ : q ≤ Q) + (hH : 1 ≤ H) (hX : 1 ≤ X) {ρ : ℂ} (hzero : χ.LFunction ρ = 0) + (hβ : 1 / 2 ≤ ρ.re) (hβ1 : ρ.re ≤ 1) (hheight : |ρ.im| ≤ H) : + 1 / 2 ≤ ‖detectorPolynomial χ X (detectorLength Q H X) ρ‖ := by + have hQ : 1 ≤ Q := by have := NeZero.pos q; omega + apply detector_large_of_small_product χ hX (detectorLength_ge hQ hH hX) ρ + have h := actual_zero_mollified_product_le χ hχ hqQ hH hX hzero hβ hβ1 hheight + linarith + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualLocalZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualLocalZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..66bec8024480708db6c4cbbfc088eb11efafc525 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualLocalZeros.lean @@ -0,0 +1,62 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualPageUniqueness + +namespace OAI + +/-! # Canonical local exceptional zeros + +An actual near-one zero is selected when one exists. Its uniqueness and +completeness follow from the proved Page theorem, not an analytic input. +-/ + +namespace Ostmann + +noncomputable def actualPageConstant : ℝ := Classical.choose exists_actual_page_uniqueness + +theorem actualPageConstant_pos : 0 < actualPageConstant := + (Classical.choose_spec exists_actual_page_uniqueness).1 + +theorem actualPage_unique (Q : ℕ) (hQ : 2 ≤ Q) (e f : PrimitiveRealZero) + (he : e.modulus ≤ Q) (hf : f.modulus ≤ Q) + (hbe : 1 - actualPageConstant / Real.log (4 * (Q : ℝ)) ≤ e.beta) + (hbf : 1 - actualPageConstant / Real.log (4 * (Q : ℝ)) ≤ f.beta) : e = f := + (Classical.choose_spec exists_actual_page_uniqueness).2 Q hQ e f he hf hbe hbf + +noncomputable def actualLocalZero (q : ℕ) : Option PrimitiveRealZero := by + classical + exact if h : ∃ e : PrimitiveRealZero, e.modulus ∣ q ∧ + 1 - actualPageConstant / Real.log (4 * (q : ℝ)) ≤ e.beta then + some (Classical.choose h) else none + +theorem actualLocalZero_spec (q : ℕ) (e : PrimitiveRealZero) + (he : actualLocalZero q = some e) : + e.modulus ∣ q ∧ 1 - actualPageConstant / Real.log (4 * (q : ℝ)) ≤ e.beta := by + classical + unfold actualLocalZero at he + split at he + next h => + have hh := Classical.choose_spec h + have heq : Classical.choose h = e := Option.some.inj he + rwa [heq] at hh + next => simp at he + +theorem actualLocalZero_complete (q : ℕ) (hq : 1 ≤ q) (e : PrimitiveRealZero) + (he : e.modulus ∣ q) + (hbe : 1 - actualPageConstant / Real.log (4 * (q : ℝ)) ≤ e.beta) : + actualLocalZero q = some e := by + classical + have hq2 : 2 ≤ q := by + by_contra hn + have hq1 : q = 1 := by omega + have he1 : e.modulus = 1 := Nat.eq_one_of_dvd_one (hq1 ▸ he) + exact e.modulus_ne_one he1 + unfold actualLocalZero + rw [dite_eq_left ⟨e, he, hbe⟩] + apply congrArg some + have hh := Classical.choose_spec (show ∃ f : PrimitiveRealZero, f.modulus ∣ q ∧ + 1 - actualPageConstant / Real.log (4 * (q : ℝ)) ≤ f.beta from ⟨e, he, hbe⟩) + exact actualPage_unique q hq2 _ e (Nat.le_of_dvd (by omega) hh.1) + (Nat.le_of_dvd (by omega) he) hh.2 hbe + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualPageUniqueness.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualPageUniqueness.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c3db35c72d6aae244b1150f179739c540639748 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualPageUniqueness.lean @@ -0,0 +1,87 @@ +import Mathlib.Analysis.Complex.ExponentialBounds +import OAI.NumberTheory.Ostmann.ZeroDensity.RealZeroPairExclusion + +namespace OAI + +/-! # Page uniqueness for the actual primitive real zeros + +The one-pole bound for two distinct characters and positivity of the actual +zero sums give an absolute Landau–Page constant. No uniqueness input is used. +-/ + +namespace Ostmann + +open Complex + +theorem exists_actual_page_uniqueness : ∃ κ : ℝ, 0 < κ ∧ + ∀ Q : ℕ, 2 ≤ Q → ∀ e f : PrimitiveRealZero, + e.modulus ≤ Q → f.modulus ≤ Q → + 1 - κ / Real.log (4 * (Q : ℝ)) ≤ e.beta → + 1 - κ / Real.log (4 * (Q : ℝ)) ≤ f.beta → e = f := by + obtain ⟨R, hR, hsingle⟩ := exists_real_zero_sum_upper + obtain ⟨S, hS, hpair⟩ := exists_distinct_real_zero_sum_bound + let D : ℝ := R + S + 10 + have hD : 0 < D := by dsimp [D]; positivity + let κ : ℝ := 1 / (2000 * D) + refine ⟨κ, by dsimp [κ]; positivity, ?_⟩ + intro Q hQ e f he hf hbe hbf + let H : ℝ := Real.log (4 * (Q : ℝ)) + have hQr : 2 ≤ (Q : ℝ) := by exact_mod_cast hQ + have hH : 1 ≤ H := by + apply (Real.le_log_iff_exp_le (by positivity : 0 < 4 * (Q : ℝ))).mpr + exact Real.exp_one_lt_three.le.trans (by linarith) + have hHpos : 0 < H := by linarith + have heLog : Real.log e.modulus ≤ H := by + apply Real.log_le_log (by exact_mod_cast e.positive) + have hh : (e.modulus : ℝ) ≤ Q := by exact_mod_cast he + linarith + have hfLog : Real.log f.modulus ≤ H := by + apply Real.log_le_log (by exact_mod_cast f.positive) + have hh : (f.modulus : ℝ) ≤ Q := by exact_mod_cast hf + linarith + let δ : ℝ := 1 / (100 * D * H) + have hδ : 0 < δ := by dsimp [δ]; positivity + have hδ1 : δ ≤ 1 := by + dsimp [δ] + apply (div_le_one (by positivity : 0 < 100 * D * H)).mpr + have hh := mul_le_mul_of_nonneg_left hH hD.le + dsimp [D] at * + nlinarith + have hRerr : δ * ((1 / 2) * Real.log e.modulus + R) ≤ 1 / 10 := by + rw [show δ * ((1 / 2) * Real.log e.modulus + R) = + ((1 / 2) * Real.log e.modulus + R) / (100 * D * H) by dsimp [δ]; ring] + apply (div_le_iff₀ (by positivity : 0 < 100 * D * H)).mpr + have hrh := mul_le_mul_of_nonneg_left hH hR.le + have hsh := mul_nonneg hS.le hHpos.le + dsimp [D] + nlinarith + have hSerr : δ * (4 * (Real.log e.modulus + Real.log f.modulus) + S) ≤ 1 / 10 := by + rw [show δ * (4 * (Real.log e.modulus + Real.log f.modulus) + S) = + (4 * (Real.log e.modulus + Real.log f.modulus) + S) / (100 * D * H) by + dsimp [δ]; ring] + apply (div_le_iff₀ (by positivity : 0 < 100 * D * H)).mpr + have hsh := mul_le_mul_of_nonneg_left hH hS.le + have hrh := mul_nonneg hR.le hHpos.le + dsimp [D] + nlinarith + have hgap : κ / H = δ / 20 := by + dsimp [κ, δ] + field_simp + ring + apply real_zero_pair_exclusion e f δ + ((1 / 2) * Real.log e.modulus + R) + (4 * (Real.log e.modulus + Real.log f.modulus) + S) + hδ hδ1 hRerr hSerr + · change 1 - κ / H ≤ e.beta at hbe + rwa [hgap] at hbe + · change 1 - κ / H ≤ f.beta at hbf + rwa [hgap] at hbf + · simpa only [add_sub_cancel_left, add_assoc, PrimitiveRealZero.asRealCharacter] using + hsingle e.asRealCharacter (1 + δ) (by linarith) (by linarith) + · intro hne + simpa only [add_sub_cancel_left, add_assoc, PrimitiveRealZero.asRealCharacter] using + hpair e.asRealCharacter f.asRealCharacter hne (1 + δ) (by linarith) (by linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualPrincipalPNT.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualPrincipalPNT.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9e91b3ba0d0b7b6ad071c8e167acbc33dcc220c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualPrincipalPNT.lean @@ -0,0 +1,27 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalChebyshevEstimate +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothPrincipalPNTBridge + +namespace OAI + +/-! # The principal smooth PNT without a progression hypothesis -/ + +namespace Ostmann + +open Filter Asymptotics + +theorem actual_principal_chebyshev_pnt : ∃ c > 0, + (Chebyshev.psi - id) =O[atTop] + (fun x : ℝ => x * Real.exp (-c * (Real.log x) ^ ((1 : ℝ) / 2))) := by + obtain ⟨c, hc, h⟩ := principal_chebyshev_error + refine ⟨c, hc, IsBigO.of_bound 25 ?_⟩ + filter_upwards [h, eventually_ge_atTop (1 : ℝ)] with x hx hx1 + have hxp : 0 < x := by linarith + simpa only [Pi.sub_apply, id_eq, Real.norm_eq_abs, Real.sqrt_eq_rpow, + abs_of_pos (mul_pos hxp (Real.exp_pos _)), mul_assoc] using hx + +theorem actualSmoothPrincipalPNT : PublishedSmoothPrincipalPNT := + publishedSmoothPrincipalPNT_of_chebyshev actual_principal_chebyshev_pnt + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualProgressionInput.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualProgressionInput.lean new file mode 100644 index 0000000000000000000000000000000000000000..28372cbd9526a0585c3e8b7e01cd7565ef3e6187 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualProgressionInput.lean @@ -0,0 +1,37 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualLocalZeros + +namespace OAI + +/-! # The prime-progression estimate with constructed exceptional zeros + +This is the theta estimate of Montgomery–Vaughan, Corollary 11.20. The actual +exceptional-zero family records divisibility, completeness and Page uniqueness. +-/ + +namespace Ostmann + +def ActualProgressionTheta : Prop := + ∃ c C : ℝ, 0 < c ∧ 0 ≤ C ∧ + ∀ q : ℕ, 1 ≤ q → ∀ a : ℕ, a.Coprime q → ∀ x : ℝ, 2 ≤ x → + |primeProgressionTheta q a x - + thetaMainTerm (Nat.totient q) (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) x| ≤ + C * x * Real.exp (-c * Real.sqrt (Real.log x)) + +noncomputable def progressionInput_of_actual_theta (h : ActualProgressionTheta) : + PublishedProgressionInput := { + kappa := actualPageConstant + decay := Classical.choose h + errorConstant := Classical.choose (Classical.choose_spec h) + kappa_pos := actualPageConstant_pos + decay_pos := (Classical.choose_spec (Classical.choose_spec h)).1 + errorConstant_nonneg := (Classical.choose_spec (Classical.choose_spec h)).2.1 + localZero := actualLocalZero + divides := fun q e he => (actualLocalZero_spec q e he).1 + complete := actualLocalZero_complete + unique := actualPage_unique + theta := (Classical.choose_spec (Classical.choose_spec h)).2.2 } + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualRealZeroExpansion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualRealZeroExpansion.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ecd3e77606b16e199516bc5be7d4cff68ac2f83 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualRealZeroExpansion.lean @@ -0,0 +1,65 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCompletedHadamard +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterGammaRealBound + +namespace OAI + +/-! # The actual real-character Hadamard expansion -/ + +namespace Ostmann + +open Complex + +noncomputable def actualRealZeroErrorConstant : ℝ := Classical.choose characterGamma_real_logDeriv_bound + +theorem actualRealZeroErrorConstant_pos : 0 < actualRealZeroErrorConstant := + (Classical.choose_spec characterGamma_real_logDeriv_bound).1 + +/-- The exact zero-sum identity has only the bounded archimedean term left over. -/ +theorem real_character_hadamard_error (χ : PrimitiveRealCharacter) (s : ℝ) + (hs : 1 < s) (hs2 : s ≤ 2) : + |realCharacterZeroSum χ s - χ.logDerivative s - (1 / 2) * Real.log χ.modulus| ≤ + actualRealZeroErrorConstant := by + have he : realCharacterZeroSum χ s - χ.logDerivative s - (1 / 2) * Real.log χ.modulus = + (logDeriv (DirichletCharacter.gammaFactor χ.complexCharacter) (s : ℂ)).re := by + rw [real_completed_hadamard_identity χ s hs hs2, + χ.asComplex.completed_logDeriv_eq_add (s : ℂ) (by simp; linarith)] + rw [PrimitiveRealCharacter.asComplex_L] + change (logDeriv χ.L (s : ℂ) + + logDeriv (DirichletCharacter.gammaFactor χ.complexCharacter) (s : ℂ)).re + + (1 / 2) * Real.log χ.modulus - χ.logDerivative s - + (1 / 2) * Real.log χ.modulus = _ + simp only [Complex.add_re, PrimitiveRealCharacter.logDerivative, logDeriv_apply] + ring + rw [he] + exact (abs_re_le_norm _).trans + ((Classical.choose_spec characterGamma_real_logDeriv_bound).2 χ.asComplex s hs hs2) + +/-- The Hadamard expansion fields of the real-zero input. -/ +noncomputable def actualRealCharacterZeroExpansion (χ : PrimitiveRealCharacter) : + RealCharacterZeroExpansion χ actualRealZeroErrorConstant where + zeros := (realCharacterActualZeros χ).zeros + in_strip := (realCharacterActualZeros χ).in_strip + actual_zero := (realCharacterActualZeros χ).actual_zero + summable := real_character_zero_kernel_summable χ + hadamard := real_character_hadamard_error χ + +/-- The low-height clause of Montgomery--Vaughan 11.3/11.10, +stated for the analytic multiplicity enumeration. -/ +def ActualRealLowHeightRegion (P : PublishedProgressionInput) : Prop := + ∀ (χ : PrimitiveRealCharacter) (Q : ℕ), 2 ≤ Q → χ.modulus ≤ Q → + ∃ E : Finset ℕ, E.card ≤ 1 ∧ + (∀ i ∈ E, ((realCharacterActualZeros χ).zeros i).im = 0 ∧ + 1 - P.kappa / Real.log (4 * (Q : ℝ)) ≤ ((realCharacterActualZeros χ).zeros i).re) ∧ + (∀ i ∉ E, ((realCharacterActualZeros χ).zeros i).im ^ 2 < 1 → + ((realCharacterActualZeros χ).zeros i).re ≤ 1 - P.kappa / Real.log (4 * (Q : ℝ))) + +noncomputable def actualPublishedRealZeroInput (P : PublishedProgressionInput) + (hregion : ActualRealLowHeightRegion P) : PublishedRealZeroInput P where + errorConstant := actualRealZeroErrorConstant + errorConstant_nonneg := actualRealZeroErrorConstant_pos.le + expansion := actualRealCharacterZeroExpansion + region := hregion + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualRealZeroIndices.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualRealZeroIndices.lean new file mode 100644 index 0000000000000000000000000000000000000000..1edfbce4b3221db209a154fa2b5a8623b782bbbd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualRealZeroIndices.lean @@ -0,0 +1,34 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.FullHeightRegionComparison + +namespace OAI + +/-! # Locating every actual real zero in the faithful multiplicity enumeration -/ + +namespace Ostmann + +open Complex + +theorem PrimitiveRealZero.has_actual_index (e : PrimitiveRealZero) : + ∃ i, (realCharacterActualZeros e.asRealCharacter).zeros i = (e.beta : ℂ) := by + apply actualCharacterZeros_complete e.asRealCharacter.asComplex + exact ⟨e.beta_pos, e.beta_lt_one, e.zero⟩ + +theorem PrimitiveRealZero.kernel_le_zero_sum (e : PrimitiveRealZero) (σ : ℝ) + (hσ : 1 < σ) (hσ2 : σ ≤ 2) : + 1 / (σ - e.beta) ≤ shiftedRealCharacterZeroSum e.asRealCharacter (σ : ℂ) := by + obtain ⟨i, hi⟩ := e.has_actual_index + have hh := shifted_real_zero_term_le e.asRealCharacter (σ : ℂ) hσ hσ2 i + rw [hi, ← Complex.ofReal_sub, ← Complex.ofReal_inv, Complex.ofReal_re] at hh + simpa only [one_div] using hh + +theorem PrimitiveRealZero.eq_of_character_beta {e f : PrimitiveRealZero} + (hχ : e.asRealCharacter = f.asRealCharacter) (hβ : e.beta = f.beta) : e = f := by + cases e + cases f + cases hχ + cases hβ + rfl + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualRealZeroRegion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualRealZeroRegion.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd72f931af9efb8f6dfbec807f605d47508e9ebf --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualRealZeroRegion.lean @@ -0,0 +1,99 @@ +import Mathlib.Analysis.Complex.ExponentialBounds +import OAI.NumberTheory.Ostmann.ZeroDensity.LowHeightZeroExclusion + +namespace OAI + +/-! # The actual low-height real-character zero-free region -/ + +namespace Ostmann + +open Complex +open scoped Classical + +/-- A single absolute zero-free constant works for every real primitive +character. Shrinking the progression constant will align the two inputs. -/ +theorem exists_actual_real_low_height_region : ∃ κ : ℝ, 0 < κ ∧ + ∀ P : PublishedProgressionInput, P.kappa ≤ κ → ActualRealLowHeightRegion P := by + obtain ⟨R, hR, hreal⟩ := exists_real_zero_sum_upper + obtain ⟨S, hS, hshift⟩ := exists_low_height_shifted_bound + let D : ℝ := R + S + 4 + have hD : 0 < D := by dsimp [D]; positivity + let κ : ℝ := 1 / (2000 * D) + refine ⟨κ, by dsimp [κ]; positivity, ?_⟩ + intro P hP χ Q hQ hq + let H : ℝ := Real.log (4 * (Q : ℝ)) + have hQr : 2 ≤ (Q : ℝ) := by exact_mod_cast hQ + have hH : 1 ≤ H := by + apply (Real.le_log_iff_exp_le (by positivity : 0 < 4 * (Q : ℝ))).mpr + exact Real.exp_one_lt_three.le.trans (by linarith) + have hHpos : 0 < H := by linarith + have hlog : Real.log χ.modulus ≤ H := by + apply Real.log_le_log (by exact_mod_cast χ.positive) + have hh : (χ.modulus : ℝ) ≤ Q := by exact_mod_cast hq + linarith + let δ : ℝ := 1 / (100 * D * H) + have hδ : 0 < δ := by dsimp [δ]; positivity + have hδ1 : δ ≤ 1 := by + dsimp [δ] + apply (div_le_one (by positivity : 0 < 100 * D * H)).mpr + have hh := mul_le_mul_of_nonneg_left hH (by positivity : 0 ≤ D) + dsimp [D] at * + nlinarith + have hRerr : δ * ((1 / 2) * Real.log χ.modulus + R) ≤ 1 / 10 := by + rw [show δ * ((1 / 2) * Real.log χ.modulus + R) = + ((1 / 2) * Real.log χ.modulus + R) / (100 * D * H) by dsimp [δ]; ring] + apply (div_le_iff₀ (by positivity : 0 < 100 * D * H)).mpr + have hrh := mul_le_mul_of_nonneg_left hH hR.le + have hsh := mul_nonneg hS.le hHpos.le + dsimp [D] + nlinarith + have hSerr : δ * (2 * Real.log χ.modulus + S) ≤ 1 / 10 := by + rw [show δ * (2 * Real.log χ.modulus + S) = + (2 * Real.log χ.modulus + S) / (100 * D * H) by dsimp [δ]; ring] + apply (div_le_iff₀ (by positivity : 0 < 100 * D * H)).mpr + have hsh := mul_le_mul_of_nonneg_left hH hS.le + have hrh := mul_nonneg hR.le hHpos.le + dsimp [D] + nlinarith + have hr : shiftedRealCharacterZeroSum χ ((1 + δ : ℝ) : ℂ) ≤ + 1 / δ + ((1 / 2) * Real.log χ.modulus + R) := by + simpa only [add_sub_cancel_left, add_assoc] using + hreal χ (1 + δ) (by linarith) (by linarith) + have hs : ∀ t : ℝ, |t| ≤ 1 → + 4 * shiftedRealCharacterZeroSum χ (((1 + δ : ℝ) : ℂ) + (t : ℂ) * I) ≤ + 3 / δ + realZeroKernel δ (2 * t) + 2 * Real.log χ.modulus + S := by + intro t ht + simpa only [add_sub_cancel_left] using + hshift χ (1 + δ) t (by linarith) (by linarith) ht + obtain ⟨hrealzero, huniq⟩ := near_low_height_zeros_real_unique χ δ + ((1 / 2) * Real.log χ.modulus + R) S hδ hδ1 hRerr hSerr hr hs + have hgap : P.kappa / H ≤ δ / 20 := by + apply (div_le_div_of_nonneg_right hP hHpos.le).trans + have he : κ / H = δ / 20 := by + dsimp [κ, δ] + field_simp + ring + exact he.le + let E := ((realCharacterActualZeros χ).heightIndices 1).filter + (fun i => 1 - P.kappa / H < ((realCharacterActualZeros χ).zeros i).re) + have hmem (i : ℕ) : i ∈ E ↔ |((realCharacterActualZeros χ).zeros i).im| ≤ 1 ∧ + 1 - P.kappa / H < ((realCharacterActualZeros χ).zeros i).re := by + simp [E] + refine ⟨E, Finset.card_le_one.mpr ?_, ?_, ?_⟩ + · intro i hi j hj + have hi' := (hmem i).mp hi + have hj' := (hmem j).mp hj + exact huniq i j (by linarith [hi'.2]) (by linarith [hj'.2]) hi'.1 hj'.1 + · intro i hi + have hi' := (hmem i).mp hi + exact ⟨hrealzero i (by linarith [hi'.2]) hi'.1, hi'.2.le⟩ + · intro i hi him + by_contra hb + have him' : |((realCharacterActualZeros χ).zeros i).im| ≤ 1 := by + nlinarith [sq_abs ((realCharacterActualZeros χ).zeros i).im, + abs_nonneg ((realCharacterActualZeros χ).zeros i).im] + exact hi ((hmem i).mpr ⟨him', lt_of_not_ge hb⟩) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualThetaEstimate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualThetaEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..247ac7bac0322739855c4f5c6393d4248ba2ec73 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualThetaEstimate.lean @@ -0,0 +1,114 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ResiduePsiEstimate +import OAI.NumberTheory.Ostmann.ZeroDensity.ResiduePrimePowerRemoval +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimitiveRieszErrorDecay +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualProgressionInput + +namespace OAI + +/-! # The actual prime-progression estimate, with no analytic input hypotheses -/ + +namespace Ostmann + +open Filter + +theorem actual_theta_eventual_bound : ∃ c C : ℝ, 0 < c ∧ 0 ≤ C ∧ + ∀ᶠ X : ℝ in atTop, ∀ q : ℕ, 1 ≤ q → ∀ a : ℕ, a.Coprime q → + |primeProgressionTheta q a X - thetaMainTerm q.totient + (pageCoefficient (actualLocalZero q) a) (pageBeta (actualLocalZero q)) X| ≤ + C * X * Real.exp (-c * Real.sqrt (Real.log X)) := by + obtain ⟨c, C, hc, hC, hbound⟩ := residuePsi_eventual_bound + refine ⟨c, C + 1, hc, by positivity, ?_⟩ + filter_upwards [hbound, primitive_riesz_error_decay c hc, + eventually_ge_atTop (1 : ℝ)] with X hmain herr hX + intro q hq a ha + have hp := residuePsi_prime_error q a X hX + have he := herr 0 (by simpa using (Real.exp_nonneg (Real.sqrt (Real.log X)))) + norm_num only [Nat.cast_zero, mul_zero, zero_mul, zero_add] at he + have hs : 0 ≤ Real.sqrt X * Real.log X := + mul_nonneg (Real.sqrt_nonneg _) (Real.log_nonneg hX) + have htri := abs_sub_le (primeProgressionTheta q a X) (residuePsi q a X) + (thetaMainTerm q.totient (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) X) + rw [abs_sub_comm (primeProgressionTheta q a X) (residuePsi q a X)] at htri + have hm := hmain q hq a ha + nlinarith + +theorem actual_theta_bounded_range : ∃ D : ℝ, 0 < D ∧ + ∀ (q a : ℕ) (X L : ℝ), 1 ≤ q → 1 ≤ X → X ≤ L → + |primeProgressionTheta q a X - thetaMainTerm q.totient + (pageCoefficient (actualLocalZero q) a) (pageBeta (actualLocalZero q)) X| ≤ + (2 * Real.log L + D) * X := by + obtain ⟨D, hD, hmain⟩ := canonical_theta_sqrt_bound + refine ⟨D, hD, ?_⟩ + intro q a X L hq hX hXL + have hXp : 0 ≤ X := by linarith + have hqp : 0 < q := by omega + have hqR : (1 : ℝ) ≤ q := by exact_mod_cast hq + have hroot : 1 ≤ Real.sqrt q := (Real.le_sqrt (by norm_num) (by positivity)).mpr (by simpa using hqR) + have hm := (hmain q a X hqp hX).trans + (div_le_self (show 0 ≤ D * X by positivity) hroot) + have hcount := residuePsi_counting_bound q a X hqp hX + have hlog : Real.log X ≤ Real.log L := Real.log_le_log (by linarith) hXL + have hdiv : X / q ≤ X := div_le_self hXp hqR + have hb : residuePsi q a X ≤ 2 * X * Real.log L := by + calc + _ ≤ (X / q + 1) * Real.log X := hcount + _ ≤ (2 * X) * Real.log L := mul_le_mul (by linarith) hlog + (Real.log_nonneg hX) (by positivity) + have hp := primeProgressionTheta_bounds q a X + have ht := abs_sub (primeProgressionTheta q a X) + (thetaMainTerm q.totient (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) X) + rw [abs_of_nonneg hp.1] at ht + nlinarith + +/-- Montgomery--Vaughan's progression estimate specialized to the canonical, +actually constructed exceptional zero. All inputs have been discharged. -/ +theorem actualProgressionTheta : ActualProgressionTheta := by + obtain ⟨c, C, hc, hC, hbound⟩ := actual_theta_eventual_bound + obtain ⟨X0, hX0⟩ := eventually_atTop.mp hbound + obtain ⟨D, hD, hsmall⟩ := actual_theta_bounded_range + let L := max 2 X0 + let K := 2 * Real.log L + D + let B := C + K * Real.exp (c * Real.sqrt (Real.log L)) + have hL : 2 ≤ L := le_max_left _ _ + have hK : 0 ≤ K := by + have hl : 0 ≤ Real.log L := Real.log_nonneg (by linarith) + dsimp [K] + positivity + have hB : 0 ≤ B := by dsimp [B]; positivity + refine ⟨c, B, hc, hB, ?_⟩ + intro q hq a ha X hX + have hXp : 0 ≤ X := by linarith + by_cases hlarge : X0 ≤ X + · exact (hX0 X hlarge q hq a ha).trans (by + apply mul_le_mul_of_nonneg_right _ (Real.exp_nonneg _) + apply mul_le_mul_of_nonneg_right _ hXp + exact le_add_of_nonneg_right (mul_nonneg hK (Real.exp_nonneg _))) + · have hXL : X ≤ L := (le_of_not_ge hlarge).trans (le_max_right _ _) + have hsmall' := hsmall q a X L hq (by linarith) hXL + have hy : Real.sqrt (Real.log X) ≤ Real.sqrt (Real.log L) := + Real.sqrt_le_sqrt (Real.log_le_log (by linarith) hXL) + have he : 1 ≤ Real.exp (c * Real.sqrt (Real.log L)) * + Real.exp (-c * Real.sqrt (Real.log X)) := by + rw [← Real.exp_add] + apply Real.one_le_exp + nlinarith + have hrate : K ≤ B * Real.exp (-c * Real.sqrt (Real.log X)) := by + calc + K = K * 1 := (mul_one _).symm + _ ≤ K * (Real.exp (c * Real.sqrt (Real.log L)) * + Real.exp (-c * Real.sqrt (Real.log X))) := mul_le_mul_of_nonneg_left he hK + _ = (K * Real.exp (c * Real.sqrt (Real.log L))) * + Real.exp (-c * Real.sqrt (Real.log X)) := (mul_assoc _ _ _).symm + _ ≤ B * Real.exp (-c * Real.sqrt (Real.log X)) := by + apply mul_le_mul_of_nonneg_right _ (Real.exp_nonneg _) + dsimp [B] + linarith + exact hsmall'.trans (by + have hh := mul_le_mul_of_nonneg_right hrate hXp + simpa only [K, mul_right_comm] using hh) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa4451d6fbda63f76d2ebc8e442a56126da93e6e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ActualZeros.lean @@ -0,0 +1,115 @@ +import OAI.NumberTheory.Ostmann.Dirichlet.Zeros +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteDecay +import OAI.NumberTheory.Ostmann.ZeroDensity.Target + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Ostmann.ZeroDensity + +def NonprincipalPrimitiveFamily (Q : ℕ) := + {χ : PrimitiveFamily Q // χ.2.1 ≠ 1} + +instance (Q : ℕ) : Fintype (NonprincipalPrimitiveFamily Q) := by + classical + unfold NonprincipalPrimitiveFamily + infer_instance + +def ZeroOccurrence (Q : ℕ) (T : ℝ) := + Σ χ : NonprincipalPrimitiveFamily Q, + Σ ρ : {ρ : ℂ // ρ ∈ Ostmann.Dirichlet.zerosUpTo χ.1.2.1 T}, + Fin (Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ.1) + +instance (Q : ℕ) (T : ℝ) : Fintype (ZeroOccurrence Q T) := by + classical + letI (χ : NonprincipalPrimitiveFamily Q) : + Fintype {ρ : ℂ // ρ ∈ Ostmann.Dirichlet.zerosUpTo χ.1.2.1 T} := + (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).fintype + unfold ZeroOccurrence + infer_instance + +def ZeroOccurrence.point {Q : ℕ} {T : ℝ} (z : ZeroOccurrence Q T) : ℂ := z.2.1.1 + +def retainedZeros (Q : ℕ) (exception : Option (PrimitiveFamily Q)) (σ T : ℝ) : + Finset (ZeroOccurrence Q T) := by + classical + exact Finset.univ.filter (fun z => some z.1.1 ≠ exception ∧ σ ≤ z.point.re) + +def totalZeroCount (Q : ℕ) (exception : Option (PrimitiveFamily Q)) (σ T : ℝ) : ℕ := + (retainedZeros Q exception σ T).card + +theorem ZeroOccurrence.isNontrivialZero {Q : ℕ} {T : ℝ} (z : ZeroOccurrence Q T) : + Ostmann.Dirichlet.IsNontrivialZero z.1.1.2.1 z.point := z.2.1.2.1 + +theorem totalZeroCount_le_none (Q : ℕ) (exception : Option (PrimitiveFamily Q)) + (σ T : ℝ) : + totalZeroCount Q exception σ T ≤ totalZeroCount Q none σ T := by + classical + apply Finset.card_le_card + intro z hz + obtain ⟨_, _, hzσ⟩ := Finset.mem_filter.mp hz + exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, by simp, hzσ⟩ + +theorem totalZeroCount_antitone (Q : ℕ) (exception : Option (PrimitiveFamily Q)) + (T : ℝ) : Antitone (fun σ => totalZeroCount Q exception σ T) := by + classical + intro σ τ hστ + apply Finset.card_le_card + intro z hz + obtain ⟨_, hexc, hzτ⟩ := Finset.mem_filter.mp hz + exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, hexc, hστ.trans hzτ⟩ + +theorem totalZeroCount_pos_of_zero (Q : ℕ) (exception : Option (PrimitiveFamily Q)) + (χ : NonprincipalPrimitiveFamily Q) (hexc : some χ.1 ≠ exception) + {σ T : ℝ} {ρ : ℂ} (hρ : ρ ∈ Ostmann.Dirichlet.zerosUpTo χ.1.2.1 T) + (hσ : σ ≤ ρ.re) : 0 < totalZeroCount Q exception σ T := by + classical + apply Finset.card_pos.mpr + have hm := Ostmann.Dirichlet.zeroMultiplicity_pos χ.1.2.1 χ.2 hρ.1.1 + refine ⟨⟨χ, ⟨ρ, hρ⟩, ⟨0, hm⟩⟩, ?_⟩ + exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, hexc, hσ⟩ + +theorem actual_zero_density_exp_sum_le (Q : ℕ) (exception : Option (PrimitiveFamily Q)) + {T M A B u : ℝ} (hM : 0 < M) (hA : 0 ≤ A) (hB : 0 ≤ B) + (hMA : 2 * A ≤ M) (hu : u ≤ (1 : ℝ) / 2) + (hstrip : ∀ z ∈ retainedZeros Q exception (1 / 2) T, u ≤ 1 - z.point.re) + (hdensity : ∀ y ∈ Set.Icc u (1 / 2), + (totalZeroCount Q exception (1 - y) T : ℝ) ≤ B * Real.exp (A * y)) : + ∑ z ∈ retainedZeros Q exception (1 / 2) T, Real.exp (-M * (1 - z.point.re)) ≤ + (⌊M / 2⌋₊ + 1 : ℝ) * B * Real.exp (1 - M * u / 2) := by + classical + let s := retainedZeros Q exception (1 / 2) T + let gap : ZeroOccurrence Q T → ℝ := fun z => 1 - z.point.re + have htop : ∀ z ∈ s, gap z ≤ (1 : ℝ) / 2 := by + intro z hz + have hz' := (Finset.mem_filter.mp hz).2.2 + dsimp [gap] + linarith + have hzero : ∀ z ∈ s, 0 ≤ gap z := by + intro z _ + have hz := z.isNontrivialZero.2.2 + dsimp [gap] + linarith + have hcount : ∀ y ∈ Set.Icc u (1 / 2), + ((s.filter (fun z => gap z ≤ y)).card : ℝ) ≤ B * Real.exp (A * y) := by + intro y hy + have hsub : s.filter (fun z => gap z ≤ y) ⊆ retainedZeros Q exception (1 - y) T := by + intro z hz + obtain ⟨hzs, hzy⟩ := Finset.mem_filter.mp hz + obtain ⟨_, hexc, _⟩ := Finset.mem_filter.mp hzs + apply Finset.mem_filter.mpr + refine ⟨Finset.mem_univ _, hexc, ?_⟩ + dsimp [gap] at hzy + linarith + exact le_trans (by exact_mod_cast Finset.card_le_card hsub) (hdensity y hy) + simpa only [mul_one_div] using + finite_density_exp_sum_le s gap hM hA hB hMA hstrip hzero htop + (extend_density_bound s gap hA hB hu htop hcount) + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/AnalyticLogBall.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/AnalyticLogBall.lean new file mode 100644 index 0000000000000000000000000000000000000000..d299016427128cad2db06a1eb9ea7d20d56f851d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/AnalyticLogBall.lean @@ -0,0 +1,54 @@ +import Mathlib.Analysis.Complex.HasPrimitives +import Mathlib.Analysis.SpecialFunctions.Complex.Analytic +import Mathlib.Analysis.Calculus.LogDeriv + +namespace OAI + +/-! # A normalized logarithm on a zero-free disk + +This is the local analytic bridge used to bound logarithmic derivatives on +zero-free disks. It is obtained by integrating the actual logarithmic derivative. +-/ + +namespace Ostmann + +open Complex Filter Metric Set +open scoped Topology + +theorem exists_normalized_log_on_ball (g : ℂ → ℂ) (R : ℝ) (hR : 0 < R) + (hg : AnalyticOnNhd ℂ g (ball 0 R)) (hne : ∀ z ∈ ball 0 R, g z ≠ 0) : + ∃ F : ℂ → ℂ, F 0 = 0 ∧ (∀ z ∈ ball 0 R, HasDerivAt F (logDeriv g z) z) ∧ + ∀ z ∈ ball 0 R, g z = g 0 * exp (F z) := by + have hd : DifferentiableOn ℂ (logDeriv g) (ball 0 R) := by + intro z hz + exact ((hg z hz).deriv.div (hg z hz) (hne z hz)).differentiableWithinAt + obtain ⟨F, hF0, hF⟩ := hd.isExactOn_ball.with_val_at 0 0 + refine ⟨F, hF0, hF, ?_⟩ + let H : ℂ → ℂ := fun z => g z * exp (-F z) + have hH (z : ℂ) (hz : z ∈ ball 0 R) : HasDerivAt H 0 z := by + have h := (hg z hz).differentiableAt.hasDerivAt.mul ((hF z hz).neg.cexp) + convert h using 1 + dsimp only [logDeriv_apply] + field_simp [hne z hz] + ring + have hHD : DifferentiableOn ℂ H (ball 0 R) := fun z hz => (hH z hz).differentiableAt.differentiableWithinAt + intro z hz + have hc := isOpen_ball.is_const_of_deriv_eq_zero (convex_ball (0 : ℂ) R).isPreconnected + hHD (fun w hw => (hH w hw).deriv) hz (mem_ball_self hR) + change g z * exp (-F z) = g 0 * exp (-F 0) at hc + rw [hF0, neg_zero, exp_zero, mul_one, exp_neg] at hc + have hmul := congrArg (fun w : ℂ => w * exp (F z)) hc + simpa [mul_assoc, exp_ne_zero] using hmul + +theorem normalized_log_re (g F : ℂ → ℂ) (z : ℂ) (hg0 : g 0 ≠ 0) + (he : g z = g 0 * exp (F z)) : + (F z).re = Real.log ‖g z‖ - Real.log ‖g 0‖ := by + have hnorm := congrArg norm he + rw [norm_mul, norm_exp] at hnorm + have hh := congrArg Real.log hnorm + rw [Real.log_mul (norm_ne_zero_iff.mpr hg0) (Real.exp_ne_zero _), Real.log_exp] at hh + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ArithmeticProgressionRows.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ArithmeticProgressionRows.lean new file mode 100644 index 0000000000000000000000000000000000000000..6cc972bfc3dc1715c7a227b3c08db67eeb126a8c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ArithmeticProgressionRows.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ProgressionErrorRates + +namespace OAI + +/-! # Giant and bulk progression rows used in the arithmetic comparison -/ + +namespace Ostmann + +open Filter + +inductive ArithmeticProgressionRow + | giant + | bulk + deriving DecidableEq + +namespace ArithmeticProgressionRow + +noncomputable def leftExponent : ArithmeticProgressionRow → ℝ + | giant => 49 / 1000 + | bulk => 39 / 10000 + +noncomputable def modulusExponent : ArithmeticProgressionRow → ℝ + | giant => 12 / 1000 + | bulk => 12 / 10000 + +noncomputable def errorExponent : ArithmeticProgressionRow → ℝ + | giant => 18 / 1000 + | bulk => 16 / 10000 + +theorem gaps (r : ArithmeticProgressionRow) : + 0 < r.leftExponent ∧ 0 < r.modulusExponent ∧ + r.errorExponent < r.leftExponent / 2 ∧ + r.errorExponent < r.leftExponent - r.modulusExponent ∧ + 0 < r.leftExponent - r.modulusExponent := by + cases r <;> norm_num [leftExponent, modulusExponent, errorExponent] + +end ArithmeticProgressionRow + +/-- Exactly the two rows of the manuscript's progression table, with one +exceptional character for all moduli in the row. The logarithmic interval +estimate is proved from the published theta and Page inputs. -/ +theorem PublishedProgressionInput.row_log_interval (P : PublishedProgressionInput) + (r : ArithmeticProgressionRow) : + ∀ᶠ L : ℝ in atTop, ∀ (q Q a : ℕ), 2 ≤ Q → 1 ≤ q → q ≤ Q → a.Coprime q → + Real.log (Q : ℝ) ≤ Real.exp (r.modulusExponent * L) → + ∀ s t : ℝ, 1 ≤ s → Real.exp (r.leftExponent * L) ≤ s → s ≤ t → t ≤ s + 1 → + |reciprocalPrimeInterval q a (Real.exp s) (Real.exp t) - + ∫ y in Set.Ioc s t, primeLogDensity (Nat.totient q) + (pageCoefficient (pageAtModulus q (selectedPageZero P Q)) a) + (pageBeta (pageAtModulus q (selectedPageZero P Q))) y| ≤ + 2 * Real.exp (-Real.exp (r.errorExponent * L)) := by + obtain ⟨ha, hμ, hδa, hδμ, haμ⟩ := r.gaps + filter_upwards [P.log_interval_rate r.leftExponent r.modulusExponent r.errorExponent + ha hδa hδμ haμ, + eventually_ge_atTop (Real.log 4 / r.modulusExponent)] with L hL hLlarge + intro q Q a hQ hq hqQ hcop hlog + apply hL q Q a hQ hq hqQ hcop + have hQ0 : (Q : ℝ) ≠ 0 := by exact_mod_cast (by omega : Q ≠ 0) + rw [Real.log_mul (by norm_num : (4 : ℝ) ≠ 0) hQ0] + have hm : Real.log 4 ≤ r.modulusExponent * L := by + have h := (div_le_iff₀ hμ).mp hLlarge + nlinarith + have he := Real.add_one_le_exp (r.modulusExponent * L) + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ArithmeticRieszMean.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ArithmeticRieszMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..805f0a77204442b6b650af0c9a9c8d46d8f96632 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ArithmeticRieszMean.lean @@ -0,0 +1,83 @@ +import Mathlib.NumberTheory.DirichletCharacter.Orthogonality +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterCanonicalRieszDecay +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszIntegral + +namespace OAI + +/-! # Literal finite Riesz sums and character orthogonality -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +noncomputable def rieszTwistMean (g : ℕ → ℂ) (X : ℝ) : ℂ := + ∑ n ∈ Finset.Ioc 0 ⌊X⌋₊, (ArithmeticFunction.vonMangoldt n : ℂ) * g n * rieszPrimeTest (n / X) + +noncomputable def rieszResidueMean (q : ℕ) (a : ZMod q) (X : ℝ) : ℂ := + rieszTwistMean (fun n => if (n : ZMod q) = a then 1 else 0) X + +theorem rieszPrimeTest_norm_le_one (u : ℝ) (hu : 0 ≤ u) : ‖rieszPrimeTest u‖ ≤ 1 := by + rw [rieszPrimeTest, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (le_max_right _ _)] + exact max_le (by linarith) zero_le_one + +theorem rieszTwistMean_eq_character (χ : PrimitiveComplexCharacter) (X : ℝ) (hX : 0 < X) : + rieszTwistMean (fun n => χ.character (n : ZMod χ.modulus)) X = characterRieszMean χ X := by + have hs (n : ℕ) (hn : n ∉ Finset.Ioc 0 ⌊X⌋₊) : + characterMangoldtCoefficient χ n * rieszPrimeTest (n / X) = 0 := by + by_cases hn0 : n = 0 + · subst n; simp [characterMangoldtCoefficient] + · have hnlarge : ⌊X⌋₊ < n := by simp only [Finset.mem_Ioc] at hn; omega + have hlarge : X < n := Nat.lt_of_floor_lt hnlarge + have hdiv : 1 < (n : ℝ) / X := (one_lt_div hX).mpr hlarge + simp only [rieszPrimeTest, max_eq_right (by linarith : 1 - (n : ℝ) / X ≤ 0), + Complex.ofReal_zero, mul_zero] + rw [characterRieszMean, tsum_eq_sum hs] + unfold rieszTwistMean + apply Finset.sum_congr rfl + intro n _ + unfold characterMangoldtCoefficient + ring + +theorem rieszTwistMean_eq_principal (X : ℝ) (hX : 0 < X) : + rieszTwistMean (fun _ => 1) X = principalRieszMean X := by + have hs (n : ℕ) (hn : n ∉ Finset.Ioc 0 ⌊X⌋₊) : + principalMangoldtCoefficient n * rieszPrimeTest (n / X) = 0 := by + by_cases hn0 : n = 0 + · subst n; simp [principalMangoldtCoefficient] + · have hnlarge : ⌊X⌋₊ < n := by simp only [Finset.mem_Ioc] at hn; omega + have hlarge : X < n := Nat.lt_of_floor_lt hnlarge + have hdiv : 1 < (n : ℝ) / X := (one_lt_div hX).mpr hlarge + simp only [rieszPrimeTest, max_eq_right (by linarith : 1 - (n : ℝ) / X ≤ 0), + Complex.ofReal_zero, mul_zero] + rw [principalRieszMean, tsum_eq_sum hs] + simp only [rieszTwistMean, principalMangoldtCoefficient, mul_one] + +theorem rieszResidueMean_orthogonality (q : ℕ) [NeZero q] (a : ZMod q) + (ha : IsUnit a) (X : ℝ) : + (q.totient : ℂ) * rieszResidueMean q a X = + ∑ χ : DirichletCharacter ℂ q, χ a⁻¹ * rieszTwistMean (fun n => χ (n : ZMod q)) X := by + classical + simp only [rieszResidueMean, rieszTwistMean, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro n _ + have ho := DirichletCharacter.sum_char_inv_mul_char_eq ℂ ha (n : ZMod q) + calc + _ = (∑ χ : DirichletCharacter ℂ q, χ a⁻¹ * χ (n : ZMod q)) * + (ArithmeticFunction.vonMangoldt n : ℂ) * rieszPrimeTest (n / X) := by + rw [ho] + by_cases hn : (n : ZMod q) = a + · rw [ite_eq_left hn, ite_eq_left hn.symm] + ring + · rw [ite_eq_right hn, ite_eq_right (Ne.symm hn)] + ring + _ = _ := by + simp only [Finset.sum_mul] + apply Finset.sum_congr rfl + intro χ _ + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BetaDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BetaDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..90e5a90d1bc267aa983dc13567ed727a7b5446a3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BetaDerivative.lean @@ -0,0 +1,102 @@ +import Mathlib.Analysis.Complex.RealDeriv +import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +import Mathlib.NumberTheory.DirichletCharacter.Orthogonality +import Mathlib.Tactic.Ring +import OAI.NumberTheory.Ostmann.ZeroDensity.BetaVariation + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Ostmann.ZeroDensity + +def finiteCharacterPolynomial {q : ℕ} (χ : DirichletCharacter ℂ q) + (a : ℕ → ℂ) (S : Finset ℕ) (s : ℂ) : ℂ := + ∑ n ∈ S, a n * χ n * (n : ℂ) ^ (-s) + +def logDerivativeCoefficients (a : ℕ → ℂ) (n : ℕ) : ℂ := -Complex.log n * a n + +theorem norm_logDerivativeCoefficients_le (a : ℕ → ℂ) {n M : ℕ} + (hn : 1 ≤ n) (hnM : n ≤ M) : + ‖logDerivativeCoefficients a n‖ ≤ Real.log M * ‖a n‖ := by + have hnR : (1 : ℝ) ≤ n := by exact_mod_cast hn + have hnM' : (n : ℝ) ≤ M := by exact_mod_cast hnM + have hlog : ‖Complex.log (n : ℂ)‖ = Real.log n := by + rw [← Complex.natCast_log, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (Real.log_nonneg hnR)] + rw [logDerivativeCoefficients, norm_mul, norm_neg, hlog] + exact mul_le_mul_of_nonneg_right + (Real.log_le_log (lt_of_lt_of_le zero_lt_one hnR) hnM') (norm_nonneg _) + +def logPowerCoefficients (k : ℕ) (a : ℕ → ℂ) (n : ℕ) : ℂ := + (-Complex.log n) ^ k * a n + +@[simp] theorem logPowerCoefficients_zero (a : ℕ → ℂ) : + logPowerCoefficients 0 a = a := by + funext n + simp [logPowerCoefficients] + +@[simp] theorem logDerivative_logPowerCoefficients (k : ℕ) (a : ℕ → ℂ) : + logDerivativeCoefficients (logPowerCoefficients k a) = + logPowerCoefficients (k + 1) a := by + funext n + simp only [logDerivativeCoefficients, logPowerCoefficients, pow_succ] + ring + +theorem norm_logPowerCoefficients_le (k : ℕ) (a : ℕ → ℂ) {n M : ℕ} + (hn : 1 ≤ n) (hnM : n ≤ M) : + ‖logPowerCoefficients k a n‖ ≤ (Real.log M) ^ k * ‖a n‖ := by + induction k with + | zero => simp + | succ k ih => + rw [← logDerivative_logPowerCoefficients] + calc + ‖logDerivativeCoefficients (logPowerCoefficients k a) n‖ ≤ + Real.log M * ‖logPowerCoefficients k a n‖ := + norm_logDerivativeCoefficients_le _ hn hnM + _ ≤ Real.log M * ((Real.log M) ^ k * ‖a n‖) := + mul_le_mul_of_nonneg_left ih (Real.log_nonneg (by exact_mod_cast hn.trans hnM)) + _ = _ := by rw [pow_succ]; ring + +theorem finite_polynomial_beta_derivative {q : ℕ} (χ : DirichletCharacter ℂ q) + (a : ℕ → ℂ) (S : Finset ℕ) (hS : ∀ n ∈ S, 0 < n) (γ β : ℝ) : + HasDerivAt + (fun b : ℝ => finiteCharacterPolynomial χ a S ((b : ℂ) + γ * Complex.I)) + (finiteCharacterPolynomial χ (logDerivativeCoefficients a) S + ((β : ℂ) + γ * Complex.I)) β := by + unfold finiteCharacterPolynomial + apply HasDerivAt.fun_sum + intro n hn + have hn0 : (n : ℂ) ≠ 0 := by exact_mod_cast (hS n hn).ne' + have hcomplex := (((hasDerivAt_id (β : ℂ)).add_const + ((γ : ℂ) * Complex.I)).neg).const_cpow (c := (n : ℂ)) (Or.inl hn0) + have hreal := hcomplex.comp_ofReal + convert hreal.const_mul (a n * χ n) using 1 <;> dsimp [logDerivativeCoefficients] + ring + +theorem finite_polynomial_beta_continuous {q : ℕ} (χ : DirichletCharacter ℂ q) + (a : ℕ → ℂ) (S : Finset ℕ) (hS : ∀ n ∈ S, 0 < n) (γ : ℝ) : + Continuous (fun β : ℝ => finiteCharacterPolynomial χ a S ((β : ℂ) + γ * Complex.I)) := by + exact continuous_iff_continuousAt.mpr fun β => + (finite_polynomial_beta_derivative χ a S hS γ β).continuousAt + +theorem finite_polynomial_beta_variation {q : ℕ} (χ : DirichletCharacter ℂ q) + (a : ℕ → ℂ) (S : Finset ℕ) (hS : ∀ n ∈ S, 0 < n) (γ : ℝ) + {σ β b : ℝ} (hσβ : σ ≤ β) (hβb : β ≤ b) : + ‖finiteCharacterPolynomial χ a S ((β : ℂ) + γ * Complex.I)‖ ^ 2 ≤ + ‖finiteCharacterPolynomial χ a S ((σ : ℂ) + γ * Complex.I)‖ ^ 2 + + ∫ u in σ..b, + (‖finiteCharacterPolynomial χ a S ((u : ℂ) + γ * Complex.I)‖ ^ 2 + + ‖finiteCharacterPolynomial χ (logDerivativeCoefficients a) S + ((u : ℂ) + γ * Complex.I)‖ ^ 2) := by + exact norm_sq_le_base_add_energy _ _ + (finite_polynomial_beta_continuous χ a S hS γ) + (finite_polynomial_beta_continuous χ (logDerivativeCoefficients a) S hS γ) + (fun β => finite_polynomial_beta_derivative χ a S hS γ β) hσβ hβb + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BetaVariation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BetaVariation.lean new file mode 100644 index 0000000000000000000000000000000000000000..a96b973f2d9be6f9b860d8925694e1ff7a19c1d6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BetaVariation.lean @@ -0,0 +1,102 @@ +import Mathlib.Analysis.InnerProductSpace.Calculus +import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum + +namespace OAI + +open scoped BigOperators RealInnerProductSpace +open Set MeasureTheory + +namespace Ostmann.ZeroDensity + +theorem point_le_base_add_variation (F G : ℝ → ℝ) + (hG : Continuous G) (hderiv : ∀ x, HasDerivAt F (G x) x) + {a x b : ℝ} (hax : a ≤ x) (hxb : x ≤ b) : + F x ≤ F a + ∫ t in a..b, |G t| := by + have heq : (∫ t in a..x, G t) = F x - F a := + intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ => hderiv t) + (hG.intervalIntegrable a x) + have hbound : F x - F a ≤ ∫ t in a..b, |G t| := by + calc + F x - F a ≤ |F x - F a| := le_abs_self _ + _ = |∫ t in a..x, G t| := congrArg abs heq.symm + _ ≤ ∫ t in a..x, |G t| := intervalIntegral.abs_integral_le_integral_abs hax + _ ≤ ∫ t in a..b, |G t| := + intervalIntegral.integral_mono_interval le_rfl hax hxb + (Filter.Eventually.of_forall (fun t => abs_nonneg (G t))) + (hG.abs.intervalIntegrable a b) + linarith + +theorem abs_norm_sq_derivative_le (z w : ℂ) : + |2 * inner ℝ z w| ≤ ‖z‖ ^ 2 + ‖w‖ ^ 2 := by + have hinner := abs_real_inner_le_norm z w + rw [abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] + nlinarith [sq_nonneg (‖z‖ - ‖w‖)] + +theorem norm_sq_le_base_add_energy (f g : ℝ → ℂ) + (hf : Continuous f) (hg : Continuous g) + (hderiv : ∀ x, HasDerivAt f (g x) x) + {a x b : ℝ} (hax : a ≤ x) (hxb : x ≤ b) : + ‖f x‖ ^ 2 ≤ ‖f a‖ ^ 2 + ∫ t in a..b, (‖f t‖ ^ 2 + ‖g t‖ ^ 2) := by + have hG : Continuous (fun t => 2 * inner ℝ (f t) (g t)) := by + exact continuous_const.mul (hf.inner hg) + have h := point_le_base_add_variation (fun t => ‖f t‖ ^ 2) + (fun t => 2 * inner ℝ (f t) (g t)) hG (fun t => (hderiv t).norm_sq) hax hxb + apply h.trans + apply add_le_add_right + exact intervalIntegral.integral_mono_on (hax.trans hxb) + (hG.abs.intervalIntegrable a b) + (((hf.norm.pow 2).add (hg.norm.pow 2)).intervalIntegrable a b) + (fun t _ => abs_norm_sq_derivative_le (f t) (g t)) + +theorem sum_norm_sq_varying_parameter_le {ι : Type*} (samples : Finset ι) + (f g : ι → ℝ → ℂ) (β : ι → ℝ) {a b : ℝ} + (hβ : ∀ i ∈ samples, β i ∈ Icc a b) + (hf : ∀ i ∈ samples, Continuous (f i)) (hg : ∀ i ∈ samples, Continuous (g i)) + (hderiv : ∀ i ∈ samples, ∀ t, HasDerivAt (f i) (g i t) t) : + (∑ i ∈ samples, ‖f i (β i)‖ ^ 2) ≤ + (∑ i ∈ samples, ‖f i a‖ ^ 2) + + ∫ t in a..b, ∑ i ∈ samples, (‖f i t‖ ^ 2 + ‖g i t‖ ^ 2) := by + calc + (∑ i ∈ samples, ‖f i (β i)‖ ^ 2) ≤ + ∑ i ∈ samples, (‖f i a‖ ^ 2 + + ∫ t in a..b, (‖f i t‖ ^ 2 + ‖g i t‖ ^ 2)) := by + apply Finset.sum_le_sum + intro i hi + exact norm_sq_le_base_add_energy (f i) (g i) (hf i hi) (hg i hi) + (hderiv i hi) (hβ i hi).1 (hβ i hi).2 + _ = _ := by + rw [Finset.sum_add_distrib, intervalIntegral.integral_finsetSum] + intro i hi + exact ((hf i hi).norm.pow 2 |>.add ((hg i hi).norm.pow 2)).intervalIntegrable a b + +theorem sum_norm_sq_varying_parameter_le_of_uniform {ι : Type*} (samples : Finset ι) + (f g : ι → ℝ → ℂ) (β : ι → ℝ) {a b B₀ B₁ : ℝ} + (hab : a ≤ b) (hlen : b - a ≤ 1) (hB₀ : 0 ≤ B₀) (hB₁ : 0 ≤ B₁) + (hβ : ∀ i ∈ samples, β i ∈ Icc a b) + (hf : ∀ i ∈ samples, Continuous (f i)) (hg : ∀ i ∈ samples, Continuous (g i)) + (hderiv : ∀ i ∈ samples, ∀ t, HasDerivAt (f i) (g i t) t) + (hbound₀ : ∀ t ∈ Icc a b, (∑ i ∈ samples, ‖f i t‖ ^ 2) ≤ B₀) + (hbound₁ : ∀ t ∈ Icc a b, (∑ i ∈ samples, ‖g i t‖ ^ 2) ≤ B₁) : + (∑ i ∈ samples, ‖f i (β i)‖ ^ 2) ≤ 2 * B₀ + B₁ := by + have hbase := hbound₀ a ⟨le_rfl, hab⟩ + have hc : Continuous (fun t => ∑ i ∈ samples, (‖f i t‖ ^ 2 + ‖g i t‖ ^ 2)) := + continuous_finsetSum samples fun i hi => (hf i hi).norm.pow 2 |>.add ((hg i hi).norm.pow 2) + have hint : (∫ t in a..b, ∑ i ∈ samples, (‖f i t‖ ^ 2 + ‖g i t‖ ^ 2)) ≤ + B₀ + B₁ := by + calc + _ ≤ ∫ t in a..b, (B₀ + B₁) := by + apply intervalIntegral.integral_mono_on hab (hc.intervalIntegrable a b) + (intervalIntegrable_const) + intro t ht + rw [Finset.sum_add_distrib] + exact add_le_add (hbound₀ t ht) (hbound₁ t ht) + _ = (b - a) * (B₀ + B₁) := by simp [mul_add] + _ ≤ B₀ + B₁ := by nlinarith + have h := sum_norm_sq_varying_parameter_le samples f g β hβ hf hg hderiv + linarith + +end Ostmann.ZeroDensity + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkAbsoluteDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkAbsoluteDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..981f06242a316b043d742889a054f50819c84847 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkAbsoluteDensity.lean @@ -0,0 +1,80 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.BulkHaarDensity +import OAI.NumberTheory.Ostmann.Arithmetic.MovingSeparatedAverageNorm + +namespace OAI + +/-! # Absolute bulk bounds retaining the frequency tests -/ + +namespace Ostmann +open scoped Classical BigOperators + +/-- The absolute coefficient also separates exactly by CRT. In particular, +the frequency indicators are kept inside their original Haar average. -/ +theorem bulk_absolute_density_crt {I J : Type*} [Fintype I] [Fintype J] + (r : ℕ) [NeZero r] (p : I → ℕ) [∀ i, NeZero (p i)] + [NeZero (∏ i, bulkResidueModuli r p i)] + (hc : Pairwise (fun i j => (bulkResidueModuli r p i).Coprime (bulkResidueModuli r p j))) + (P : PublishedProgressionInput) (Q : ℕ) + (hpage : pageAtModulus (∏ i, bulkResidueModuli r p i) (selectedPageZero P Q) = + pageAtModulus r (selectedPageZero P Q)) + (y : J → ℝ) (F : (J → (ZMod r)ˣ) → ℂ) + (G : ∀ i, (J → (ZMod (p i))ˣ) → ℂ) : + (∑ z, ‖F (bulkResidueEquiv r p hc z).1 * ∏ i, G i ((bulkResidueEquiv r p hc z).2 i)‖ * + ∏ j, selectedPrimeLogDensity P Q (∏ i, bulkResidueModuli r p i) (z j).val.val (y j)) = + (((Fintype.card (J → (ZMod r)ˣ) : ℝ)⁻¹ * + ∑ a, ‖F a‖ * ∏ j, (pageGiantWeight P Q r (a j).val.val (y j)).re) * + ∏ i, ((Fintype.card (J → (ZMod (p i))ˣ) : ℝ)⁻¹ * ∑ b, ‖G i b‖)) * + ∏ j, (y j)⁻¹ := by + have h := bulk_prime_density_crt r p hc P Q hpage y + (fun a => (‖F a‖ : ℂ)) (fun i b => (‖G i b‖ : ℂ)) + simp only [norm_mul, norm_prod] + simp only [pageGiantWeight, Complex.ofReal_re] + simp only [pageGiantWeight] at h + apply Complex.ofReal_injective + push_cast + exact h + +theorem bulk_absolute_density_le {I J : Type*} [Fintype I] [Fintype J] + (r : ℕ) [NeZero r] (p : I → ℕ) [∀ i, NeZero (p i)] + [NeZero (∏ i, bulkResidueModuli r p i)] + (hc : Pairwise (fun i j => (bulkResidueModuli r p i).Coprime (bulkResidueModuli r p j))) + (P : PublishedProgressionInput) (Q : ℕ) + (hpage : pageAtModulus (∏ i, bulkResidueModuli r p i) (selectedPageZero P Q) = + pageAtModulus r (selectedPageZero P Q)) + (y : J → ℝ) (hy : ∀ j, 0 ≤ y j) + (F : (J → (ZMod r)ˣ) → ℂ) (G : ∀ i, (J → (ZMod (p i))ˣ) → ℂ) + (B : I → ℝ) + (hB : ∀ i, (Fintype.card (J → (ZMod (p i))ˣ) : ℝ)⁻¹ * ∑ b, ‖G i b‖ ≤ B i) : + (∑ z, ‖F (bulkResidueEquiv r p hc z).1 * ∏ i, G i ((bulkResidueEquiv r p hc z).2 i)‖ * + ∏ j, selectedPrimeLogDensity P Q (∏ i, bulkResidueModuli r p i) (z j).val.val (y j)) ≤ + ((2 ^ Fintype.card J * ((Fintype.card (J → (ZMod r)ˣ) : ℝ)⁻¹ * ∑ a, ‖F a‖)) * + ∏ i, B i) * ∏ j, (y j)⁻¹ := by + rw [bulk_absolute_density_crt r p hc P Q hpage y F G] + have hlocal (i : I) : 0 ≤ (Fintype.card (J → (ZMod (p i))ˣ) : ℝ)⁻¹ * ∑ b, ‖G i b‖ := + mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg _)) (Finset.sum_nonneg fun b _ => norm_nonneg _) + have hmain : + (Fintype.card (J → (ZMod r)ˣ) : ℝ)⁻¹ * + ∑ a, ‖F a‖ * ∏ j, (pageGiantWeight P Q r (a j).val.val (y j)).re ≤ + 2 ^ Fintype.card J * ((Fintype.card (J → (ZMod r)ˣ) : ℝ)⁻¹ * ∑ a, ‖F a‖) := by + calc + _ ≤ (Fintype.card (J → (ZMod r)ˣ) : ℝ)⁻¹ * ∑ a, ‖F a‖ * 2 ^ Fintype.card J := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Finset.sum_le_sum + intro a _ + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + calc + _ ≤ ∏ _j : J, (2 : ℝ) := Finset.prod_le_prod₀ (fun j _ => + (pageMultiplier_bounds _ _ _ (pageCoefficient_abs_le_one _) (pageBeta_le_one _) + (hy j) _).1) (fun j _ => + (pageMultiplier_bounds _ _ _ (pageCoefficient_abs_le_one _) (pageBeta_le_one _) + (hy j) _).2) + _ = _ := by simp + _ = _ := by rw [← Finset.sum_mul]; ring + apply mul_le_mul_of_nonneg_right _ (Finset.prod_nonneg fun j _ => inv_nonneg.mpr (hy j)) + apply mul_le_mul hmain (Finset.prod_le_prod₀ (fun i _ => hlocal i) (fun i _ => hB i)) + (Finset.prod_nonneg fun i _ => hlocal i) + positivity + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkHaarDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkHaarDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..2329d001918e801c406377e02277f0769ee0af36 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkHaarDensity.lean @@ -0,0 +1,57 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.BulkResidueCRT + +namespace OAI + +/-! # The joint harmonic density exposes the exact bulk Haar average -/ + +namespace Ostmann +open scoped Classical BigOperators + +/-- Every prime density contributes one Haar-unit normalization and one +harmonic factor. Page multipliers remain inside the residue average. -/ +theorem bulk_prime_density_haar {J : Type*} [Fintype J] + (P : PublishedProgressionInput) (Q M : ℕ) [NeZero M] + (y : J → ℝ) (C : (J → (ZMod M)ˣ) → ℂ) : + (∑ z, C z * ∏ j, (selectedPrimeLogDensity P Q M (z j).val.val (y j) : ℂ)) = + ((Fintype.card (J → (ZMod M)ˣ) : ℂ)⁻¹ * + ∑ z, C z * ∏ j, pageGiantWeight P Q M (z j).val.val (y j)) * + ∏ j, (y j : ℂ)⁻¹ := by + have hc : (Fintype.card (J → (ZMod M)ˣ) : ℂ) = + (Nat.totient M : ℂ) ^ Fintype.card J := by + simp only [Fintype.card_fun, ZMod.card_units_eq_totient, Nat.cast_pow] + simp_rw [selectedPrimeLogDensity_page] + simp only [hc, div_eq_mul_inv, mul_inv_rev, Finset.prod_mul_distrib, + Finset.prod_const, Finset.card_univ, ← inv_pow] + simp only [Finset.mul_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro z _ + ring + +/-- The full density in the actual product modulus factors into the retained +frequency/Page average, independent spectator averages and harmonic densities. -/ +theorem bulk_prime_density_crt {I J : Type*} [Fintype I] [Fintype J] + (r : ℕ) [NeZero r] (p : I → ℕ) [∀ i, NeZero (p i)] + [NeZero (∏ i, bulkResidueModuli r p i)] + (hc : Pairwise (fun i j => (bulkResidueModuli r p i).Coprime (bulkResidueModuli r p j))) + (P : PublishedProgressionInput) (Q : ℕ) + (hpage : pageAtModulus (∏ i, bulkResidueModuli r p i) (selectedPageZero P Q) = + pageAtModulus r (selectedPageZero P Q)) + (y : J → ℝ) (F : (J → (ZMod r)ˣ) → ℂ) (G : ∀ i, (J → (ZMod (p i))ˣ) → ℂ) : + (∑ z, (F (bulkResidueEquiv r p hc z).1 * ∏ i, G i ((bulkResidueEquiv r p hc z).2 i)) * + ∏ j, (selectedPrimeLogDensity P Q (∏ i, bulkResidueModuli r p i) (z j).val.val (y j) : ℂ)) = + (((Fintype.card (J → (ZMod r)ˣ) : ℂ)⁻¹ * + ∑ a, F a * ∏ j, pageGiantWeight P Q r (a j).val.val (y j)) * + ∏ i, ((Fintype.card (J → (ZMod (p i))ˣ) : ℂ)⁻¹ * ∑ b, G i b)) * + ∏ j, (y j : ℂ)⁻¹ := by + rw [bulk_prime_density_haar] + congr 1 + have h := bulk_residue_page_average r p hc P Q hpage y F G + convert h using 1 + congr 1 + apply Finset.sum_congr rfl + intro z _ + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkProductDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkProductDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..29db0ec75a29d67e9c911066be88834094b48a88 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkProductDensity.lean @@ -0,0 +1,63 @@ +import Mathlib.MeasureTheory.Integral.Pi +import OAI.NumberTheory.Ostmann.Construction.GiantLogMeasures + +namespace OAI + +/-! # Product densities for the joint Page integral -/ + +namespace Ostmann +open MeasureTheory +open scoped Classical BigOperators + +/-- The scalar-density factors of the ideal bulk laws multiply inside one +finite product integral. This is used with the nonnegative Page densities. -/ +theorem bulk_pi_withDensity {J : Type*} [Fintype J] + (μ : J → Measure ℝ) [∀ j, IsFiniteMeasure (μ j)] + (ρ : J → ℝ → ℝ) + (hi : ∀ j, Integrable (ρ j) (μ j)) (hpos : ∀ j x, 0 ≤ ρ j x) : + Measure.pi (fun j => (μ j).withDensity (fun x => ENNReal.ofReal (ρ j x))) = + (Measure.pi μ).withDensity (fun x => ENNReal.ofReal (∏ j, ρ j (x j))) := by + let ν := fun j => (μ j).withDensity (fun x => ENNReal.ofReal (ρ j x)) + let _ : ∀ j, IsFiniteMeasure (ν j) := fun j => + isFiniteMeasure_withDensity ((lintegral_ofReal_ne_top_iff_integrable + (hi j).aestronglyMeasurable (Filter.Eventually.of_forall (hpos j))).mpr (hi j)) + apply Measure.pi_eq + intro s hs + rw [withDensity_apply _ (MeasurableSet.univ_pi hs)] + have hp : Integrable (fun x : J → ℝ => ∏ j, ρ j (x j)) + ((Measure.pi μ).restrict (Set.univ.pi s)) := by + rw [Measure.restrict_pi_pi] + exact Integrable.fintype_prod (fun j => (hi j).restrict) + rw [← ofReal_integral_eq_lintegral_ofReal hp + (Filter.Eventually.of_forall fun x => Finset.prod_nonneg fun j _ => hpos j (x j)), + Measure.restrict_pi_pi, integral_fintype_prod_eq_prod] + have hn (j : J) : 0 ≤ ∫ x in s j, ρ j x ∂μ j := + integral_nonneg (hpos j) + rw [ENNReal.ofReal_prod_of_nonneg (fun j _ => hn j)] + apply Finset.prod_congr rfl + intro j _ + rw [withDensity_apply _ (hs j), + ← ofReal_integral_eq_lintegral_ofReal (hi j).restrict + (Filter.Eventually.of_forall (hpos j))] + +/-- Exact complex integral form of the joint density identity. -/ +theorem bulk_integral_product_density {J : Type*} [Fintype J] + (μ : J → Measure ℝ) [∀ j, IsFiniteMeasure (μ j)] + (ρ : J → ℝ → ℝ) (hρ : ∀ j, Measurable (ρ j)) + (hi : ∀ j, Integrable (ρ j) (μ j)) (hpos : ∀ j x, 0 ≤ ρ j x) + (f : (J → ℝ) → ℂ) : + (∫ x, f x ∂Measure.pi (fun j => (μ j).withDensity (fun y => ENNReal.ofReal (ρ j y)))) = + ∫ x, f x * ((∏ j, ρ j (x j) : ℝ) : ℂ) ∂Measure.pi μ := by + rw [bulk_pi_withDensity μ ρ hi hpos] + rw [integral_withDensity_eq_integral_toReal_smul₀ + (Measurable.ennreal_ofReal (by fun_prop)).aemeasurable + (Filter.Eventually.of_forall fun _ => ENNReal.ofReal_lt_top)] + apply integral_congr_ae + exact Filter.Eventually.of_forall fun x => by + dsimp only + rw [ENNReal.toReal_ofReal (Finset.prod_nonneg fun j _ => hpos j (x j)), + Complex.real_smul, mul_comm] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkProgressionCutoff.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkProgressionCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7a11a642be8a82de39d616b7e294187aa07ffa9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkProgressionCutoff.lean @@ -0,0 +1,90 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.BulkResidueCRT +import OAI.NumberTheory.Ostmann.Arithmetic.ArithmeticErrorRates + +namespace OAI + +/-! # The actual frequency/spectator modulus fits one progression cutoff -/ + +namespace Ostmann +open Filter +open scoped Classical BigOperators + +noncomputable def bulkProgressionCutoff (L : ℝ) : ℕ := + ⌊Real.exp (Real.exp ((12 / 10000 : ℝ) * L))⌋₊ + +theorem modulus_le_exp_bulk_endpoint {M : ℕ} {L u : ℝ} + (hM : M ≤ bulkProgressionCutoff L) (hL : 0 ≤ L) + (hu : Real.exp ((39 / 10000 : ℝ) * L) ≤ u) : + (M : ℝ) ≤ Real.exp u := by + apply (Nat.cast_le.mpr hM).trans + apply (Nat.floor_le (Real.exp_nonneg _)).trans + apply Real.exp_le_exp.mpr + exact (Real.exp_le_exp.mpr (by linarith)).trans hu + +theorem bulkProgressionCutoff_bounds (L : ℝ) (hL : 2000 ≤ L) : + 2 ≤ bulkProgressionCutoff L ∧ + Real.log (4 * (bulkProgressionCutoff L : ℝ)) ≤ + 2 * Real.exp ((12 / 10000 : ℝ) * L) := by + have hx : (2 : ℝ) ≤ Real.exp ((12 / 10000 : ℝ) * L) := by + have hh : (2 : ℝ) ≤ Real.exp 1 := by linarith [Real.add_one_le_exp 1] + exact hh.trans (Real.exp_le_exp.mpr (by linarith)) + have hbig : (3 : ℝ) ≤ Real.exp ((12 / 10000 : ℝ) * L) := + (by linarith [Real.add_one_le_exp 2] : (3 : ℝ) ≤ Real.exp 2).trans + (Real.exp_le_exp.mpr (by linarith)) + have hQ : 2 ≤ bulkProgressionCutoff L := by + apply Nat.le_floor + exact hx.trans (by linarith [Real.add_one_le_exp (Real.exp ((12 / 10000 : ℝ) * L))]) + refine ⟨hQ, ?_⟩ + have hpos : (0 : ℝ) < bulkProgressionCutoff L := by exact_mod_cast (by omega : 0 < bulkProgressionCutoff L) + have hf : (bulkProgressionCutoff L : ℝ) ≤ Real.exp (Real.exp ((12 / 10000 : ℝ) * L)) := + Nat.floor_le (Real.exp_nonneg _) + have hh := Real.log_le_log (mul_pos (by norm_num : (0 : ℝ) < 4) hpos) + (mul_le_mul_of_nonneg_left hf (by norm_num : (0 : ℝ) ≤ 4)) + rw [Real.log_mul (by norm_num : (4 : ℝ) ≠ 0) (Real.exp_ne_zero _), Real.log_exp] at hh + have hlog : Real.log 4 ≤ 3 := by linarith [Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 4)] + linarith + +theorem bulkResidueModulus_exp_bound (m r : ℕ) (p : Fin m → ℕ) (F V : ℝ) + (hr : (r : ℝ) ≤ Real.exp (F * m)) (hp : ∀ i, (p i : ℝ) ≤ Real.exp V) : + ((∏ i, bulkResidueModuli r p i : ℕ) : ℝ) ≤ Real.exp (F * m + (m : ℝ) * V) := by + have hprod : (∏ i : Fin m, (p i : ℝ)) ≤ Real.exp ((m : ℝ) * V) := by + calc + _ ≤ ∏ _i : Fin m, Real.exp V := Finset.prod_le_prod₀ (fun i _ => Nat.cast_nonneg _) (fun i _ => hp i) + _ = _ := by simp only [Finset.prod_const, Finset.card_univ, Fintype.card_fin, ← Real.exp_nat_mul] + have he : ((∏ i, bulkResidueModuli r p i : ℕ) : ℝ) = (r : ℝ) * ∏ i, (p i : ℝ) := by + rw [Fintype.prod_sum_type] + simp only [bulkResidueModuli, Fintype.prod_unique, Nat.cast_mul, Nat.cast_prod] + rw [he, Real.exp_add] + exact mul_le_mul hr hprod (Finset.prod_nonneg fun i _ => Nat.cast_nonneg _) (Real.exp_nonneg _) + +theorem bulkResidueModulus_progression_range (F K : ℝ) (hF : 0 ≤ F) (hK : 0 ≤ K) : + ∀ᶠ L : ℝ in atTop, ∀ (m r : ℕ) (p : Fin m → ℕ), + (m : ℝ) ≤ K * L → (r : ℝ) ≤ Real.exp (F * m) → + (∀ i, (p i : ℝ) ≤ Real.exp (Real.exp ((1 / 1000 : ℝ) * L))) → + (∏ i, bulkResidueModuli r p i) ≤ bulkProgressionCutoff L := by + filter_upwards [arithmetic_exponent_absorption (1 / 1000) (12 / 10000) 0 ((F + 1) * K) 1 1 + (by norm_num) (by norm_num) (by norm_num) (by norm_num), + eventually_ge_atTop (0 : ℝ)] with L hrate hL + intro m r p hm hr hp + apply Nat.le_floor + apply (bulkResidueModulus_exp_bound m r p F _ hr hp).trans + apply Real.exp_le_exp.mpr + have h₁ := mul_le_mul_of_nonneg_left hm hF + have h₂ := mul_le_mul_of_nonneg_right hm (Real.exp_nonneg ((1 / 1000 : ℝ) * L)) + have h₃ : 0 ≤ K * L := mul_nonneg hK hL + have h₄ : 0 ≤ F * K * L := mul_nonneg (mul_nonneg hF hK) hL + simp only [pow_one, zero_mul, Real.exp_zero, one_mul] at hrate + have h₅ := mul_nonneg h₄ (Real.exp_nonneg ((1 / 1000 : ℝ) * L)) + nlinarith + +theorem bulkResidueModulus_unit_card {M Q : ℕ} [NeZero M] (hMQ : M ≤ Q) + {L : ℝ} (hQ : (Q : ℝ) ≤ Real.exp (Real.exp ((12 / 10000 : ℝ) * L))) : + (Fintype.card (ZMod M)ˣ : ℝ) ≤ Real.exp (Real.exp ((12 / 10000 : ℝ) * L)) := by + have hc : Fintype.card (ZMod M)ˣ ≤ M := by + simpa only [ZMod.card] using Fintype.card_le_of_injective + (fun u : (ZMod M)ˣ => (u : ZMod M)) Units.val_injective + exact (Nat.cast_le.mpr (hc.trans hMQ)).trans hQ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkProgressionRate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkProgressionRate.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c844ac675c62fa88801b84e440ee175865b498f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/BulkProgressionRate.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.WeightedProgressionRates + +namespace OAI + +/-! # The full bulk progression error, including derivative cuts and endpoints -/ + +namespace Ostmann +open Filter + +/-- The Section 8 bulk row absorbs variable polynomial-cut counts, residue +counts, and the complete smooth budget. No fixed bound on the number of roots +is needed: those costs are all included in `V`. -/ +theorem PublishedProgressionInput.bulk_full_progression_budget_rate (P : PublishedProgressionInput) + (C : ℝ) (d : ℕ) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 2 ≤ Q → + Real.log (4 * (Q : ℝ)) ≤ 2 * Real.exp ((12 / 10000 : ℝ) * L) → + ∀ u V : ℝ, Real.exp ((39 / 10000 : ℝ) * L) ≤ u → + V ≤ Real.exp (C * L ^ d + C * L * Real.exp ((14 / 10000 : ℝ) * L)) → + V * (18 * P.errorConstant * Real.exp (-P.decay * Real.sqrt u) + + Real.exp (-P.kappa * u / Real.log (4 * (Q : ℝ))) + 2 * Real.exp (-u)) ≤ + Real.exp (-Real.exp ((125 / 100000 : ℝ) * L)) := by + filter_upwards [P.log_interval_budget_rate (39 / 10000) (12 / 10000) (18 / 10000) + (by norm_num) (by norm_num) (by norm_num) (by norm_num), + arithmetic_error_absorption (14 / 10000) (18 / 10000) (13 / 10000) C 1 d + (by norm_num) (by norm_num) (by norm_num) (by norm_num), + constant_mul_double_exp_le 4 1 (13 / 10000) (125 / 100000) + (by norm_num) (by norm_num) (by norm_num) (by norm_num), + eventually_ge_atTop (0 : ℝ)] with L hP hcost hfour hL + intro Q hQ hlog u V hu hV + have hsmall : Real.exp (-u) ≤ Real.exp (-Real.exp ((18 / 10000 : ℝ) * L)) := by + apply Real.exp_le_exp.mpr + apply neg_le_neg + exact (Real.exp_le_exp.mpr (by nlinarith)).trans hu + have he := hP Q hQ hlog u hu + have hC := P.errorConstant_nonneg + have hn : 0 ≤ 18 * P.errorConstant * Real.exp (-P.decay * Real.sqrt u) + + Real.exp (-P.kappa * u / Real.log (4 * (Q : ℝ))) + 2 * Real.exp (-u) := by positivity + have htotal : 18 * P.errorConstant * Real.exp (-P.decay * Real.sqrt u) + + Real.exp (-P.kappa * u / Real.log (4 * (Q : ℝ))) + 2 * Real.exp (-u) ≤ + 4 * Real.exp (-Real.exp ((18 / 10000 : ℝ) * L)) := by linarith + calc + _ ≤ Real.exp (C * L ^ d + C * L * Real.exp ((14 / 10000 : ℝ) * L)) * + (4 * Real.exp (-Real.exp ((18 / 10000 : ℝ) * L))) := + mul_le_mul hV htotal hn (Real.exp_pos _).le + _ = 4 * (Real.exp (C * L ^ d + C * L * Real.exp ((14 / 10000 : ℝ) * L)) * + Real.exp (-Real.exp ((18 / 10000 : ℝ) * L))) := by ring + _ ≤ 4 * Real.exp (-Real.exp ((13 / 10000 : ℝ) * L)) := by + apply mul_le_mul_of_nonneg_left _ (by norm_num) + simpa only [one_mul, neg_mul] using hcost + _ ≤ _ := by simpa only [one_mul, neg_mul] using hfour + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CanonicalRieszKernelBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CanonicalRieszKernelBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..35cfae25575f8df2b73bd6c3e286efcd7a45d971 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CanonicalRieszKernelBound.lean @@ -0,0 +1,77 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterPageComparison + +namespace OAI + +/-! # Uniform kernel bounds for the canonical exceptional zeros + +For large conductors the Page cutoff is to the right of one half. The +remaining finitely many moduli contribute a finite constant. +-/ + +namespace Ostmann + +open Complex + +noncomputable def pageRieszKernelNorm (q : ℕ) : ℝ := + ‖rieszMellinKernel (pageBeta (actualLocalZero q) : ℂ)‖ + +theorem page_beta_half_for_large_modulus : ∃ N : ℕ, ∀ q : ℕ, N ≤ q → + 1 / 2 ≤ pageBeta (actualLocalZero q) := by + let N := ⌈Real.exp (2 * actualPageConstant)⌉₊ + 1 + refine ⟨N, ?_⟩ + intro q hq + have hqpos : 1 ≤ q := by dsimp [N] at hq; omega + have hqr : (1 : ℝ) ≤ q := by exact_mod_cast hqpos + have he : Real.exp (2 * actualPageConstant) ≤ (q : ℝ) := + (Nat.le_ceil _).trans (by exact_mod_cast (show ⌈Real.exp (2 * actualPageConstant)⌉₊ ≤ q by dsimp [N] at hq; omega)) + have hL : 2 * actualPageConstant ≤ Real.log (4 * (q : ℝ)) := + (Real.le_log_iff_exp_le (by linarith : 0 < 4 * (q : ℝ))).mpr (he.trans (by linarith)) + have hLp : 0 < Real.log (4 * (q : ℝ)) := Real.log_pos (by linarith) + have hfrac : actualPageConstant / Real.log (4 * (q : ℝ)) ≤ 1 / 2 := + (div_le_iff₀ hLp).mpr (by linarith) + cases heq : actualLocalZero q with + | none => norm_num [pageBeta] + | some e => + have hb := (actualLocalZero_spec q e heq).2 + change 1 / 2 ≤ e.beta + linarith + +theorem canonical_riesz_kernel_bound : ∃ C : ℝ, 0 < C ∧ + ∀ q : ℕ, pageRieszKernelNorm q ≤ C := by + classical + obtain ⟨N, hN⟩ := page_beta_half_for_large_modulus + let S := ∑ q ∈ Finset.range N, pageRieszKernelNorm q + have hS : 0 ≤ S := Finset.sum_nonneg (fun q _ => norm_nonneg _) + refine ⟨10 + S, by positivity, ?_⟩ + intro q + by_cases hq : N ≤ q + · have hh := rieszMellinKernel_half_strip (pageBeta (actualLocalZero q) : ℂ) + (by simpa using hN q hq) + have hk : pageRieszKernelNorm q ≤ 9 := by + simpa [pageRieszKernelNorm, rieszLineMajorant] using hh + linarith + · have hs : pageRieszKernelNorm q ≤ S := Finset.single_le_sum (f := pageRieszKernelNorm) (a := q) + (fun k _ => norm_nonneg _) (Finset.mem_range.mpr (Nat.lt_of_not_ge hq)) + linarith + +theorem canonicalCharacterRieszTerm_norm_bound (χ : PrimitiveComplexCharacter) + (q : ℕ) (X C : ℝ) (hX : 0 < X) (hC : 0 ≤ C) + (hbound : pageRieszKernelNorm q ≤ C) : + ‖canonicalCharacterRieszTerm χ q X‖ ≤ C * X ^ pageBeta (actualLocalZero q) := by + classical + cases he : actualLocalZero q with + | none => simp only [canonicalCharacterRieszTerm, he, norm_zero, pageBeta]; positivity + | some e => + by_cases hc : e.asRealCharacter.asComplex = χ + · simp only [canonicalCharacterRieszTerm, he, hc, ↓reduceIte, norm_neg, + rieszContourWeight, norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hX, + Complex.ofReal_re, pageBeta] + have hh : ‖rieszMellinKernel (e.beta : ℂ)‖ ≤ C := by + simpa only [pageRieszKernelNorm, he, pageBeta] using hbound + nlinarith [Real.rpow_pos_of_pos hX e.beta] + · simp only [canonicalCharacterRieszTerm, he, hc, ↓reduceIte, norm_zero, pageBeta] + positivity + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CanonicalThetaSize.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CanonicalThetaSize.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c5206ee078f2e3a8e78ddc92eb3b9d53581d4bb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CanonicalThetaSize.lean @@ -0,0 +1,71 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CanonicalRieszKernelBound +import OAI.NumberTheory.Ostmann.ZeroDensity.TotientSqrtBound +import OAI.NumberTheory.Ostmann.ZeroDensity.ThetaMainTerm + +namespace OAI + +/-! # Elementary size of the canonical progression main term -/ + +namespace Ostmann + +open Complex + +theorem canonical_page_beta_inverse_bound : ∃ B : ℝ, 0 < B ∧ + ∀ q : ℕ, (pageBeta (actualLocalZero q))⁻¹ ≤ B := by + obtain ⟨C, hC, hbound⟩ := canonical_riesz_kernel_bound + refine ⟨2 * C, by positivity, ?_⟩ + intro q + let β := pageBeta (actualLocalZero q) + have hβ : 0 < β := pageBeta_pos _ + have hβ1 : β ≤ 1 := pageBeta_le_one _ + have he : pageRieszKernelNorm q = 1 / (β * (β + 1)) := by + change ‖(1 : ℂ) / ((β : ℂ) * ((β : ℂ) + 1))‖ = _ + rw [show (β : ℂ) + 1 = ((β + 1 : ℝ) : ℂ) by push_cast; rfl, + norm_div, norm_one, norm_mul, Complex.norm_real, Complex.norm_real, + Real.norm_eq_abs, Real.norm_eq_abs, abs_of_pos hβ, abs_of_pos (by linarith : 0 < β + 1)] + have hb := hbound q + rw [he] at hb + have hid : β⁻¹ = (β + 1) * (1 / (β * (β + 1))) := by field_simp + change β⁻¹ ≤ _ + rw [hid] + have hh := mul_le_mul_of_nonneg_left hb (show 0 ≤ β + 1 by linarith) + nlinarith + +theorem thetaMainTerm_size (φ χ β X B : ℝ) (hφ : 0 < φ) (hχ : |χ| ≤ 1) + (hβ : 0 < β) (hβ1 : β ≤ 1) (hX : 1 ≤ X) (_hB : 0 ≤ B) (hinv : β⁻¹ ≤ B) : + |thetaMainTerm φ χ β X| ≤ (1 + B) * X / φ := by + have hXp : 0 ≤ X := by linarith + have hp : 0 ≤ X ^ β := Real.rpow_nonneg hXp _ + have hpow : X ^ β ≤ X := by + simpa only [Real.rpow_one] using Real.rpow_le_rpow_of_exponent_le hX hβ1 + have hc : |χ * X ^ β / β| ≤ X * B := by + rw [abs_div, abs_mul, abs_of_nonneg hp, abs_of_pos hβ, div_eq_mul_inv] + have h1 : |χ| * X ^ β ≤ X := (mul_le_mul_of_nonneg_right hχ hp).trans (by simpa using hpow) + exact mul_le_mul h1 hinv (inv_nonneg.mpr hβ.le) hXp + rw [thetaMainTerm, abs_div, abs_of_pos hφ] + apply div_le_div_of_nonneg_right _ hφ.le + have hh := abs_sub X (χ * X ^ β / β) + rw [abs_of_nonneg hXp] at hh + nlinarith + +theorem canonical_theta_sqrt_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (q a : ℕ) (X : ℝ), 0 < q → 1 ≤ X → + |thetaMainTerm q.totient (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) X| ≤ C * X / Real.sqrt q := by + obtain ⟨B, hB, hβ⟩ := canonical_page_beta_inverse_bound + obtain ⟨D, hD, hφ⟩ := reciprocal_totient_sqrt_bound + refine ⟨(1 + B) * D, by positivity, ?_⟩ + intro q a X hq hX + have hφp : 0 < (q.totient : ℝ) := by exact_mod_cast Nat.totient_pos.mpr hq + have ht := thetaMainTerm_size (q.totient : ℝ) (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) X B hφp (pageCoefficient_abs_le_one _ _) + (pageBeta_pos _) (pageBeta_le_one _) hX hB.le (hβ q) + have hh := mul_le_mul_of_nonneg_left (hφ q hq) (show 0 ≤ (1 + B) * X by positivity) + calc + _ ≤ (1 + B) * X / q.totient := ht + _ ≤ (1 + B) * X * (D / Real.sqrt q) := by simpa only [div_eq_mul_inv, mul_one, one_mul] using hh + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterCanonicalRieszComparison.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterCanonicalRieszComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..6488538e597976c5f63eed28c6e7f4dfa0a08347 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterCanonicalRieszComparison.lean @@ -0,0 +1,97 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CanonicalRieszKernelBound + +namespace OAI + +/-! # Replacing the local contour zero by the canonical Page correction -/ + +namespace Ostmann + +open Complex + +theorem character_riesz_term_comparison (χ : PrimitiveComplexCharacter) (q : ℕ) + (T c X C : ℝ) (e : Option ℕ) + (hq : 1 ≤ q) (hdvd : χ.modulus ∣ q) (hqT : (q : ℝ) ≤ T) (hT : 2 ≤ T) + (hc : 0 < c) (hcp : c ≤ actualPageConstant / 10) (hX : 1 ≤ X) (hC : 0 ≤ C) + (hkernel : pageRieszKernelNorm q ≤ C) + (he : ∀ i, e = some i → + 1 - 2 * c / (Real.log χ.modulus + Real.log (T + 4) + 1) < + ((actualCharacterZeros χ).zeros i).re ∧ + χ.character ^ 2 = 1 ∧ ((actualCharacterZeros χ).zeros i).im = 0) + (hec : ∀ i, 1 - c / (Real.log χ.modulus + Real.log (T + 4) + 1) ≤ + ((actualCharacterZeros χ).zeros i).re → + |((actualCharacterZeros χ).zeros i).im| ≤ T → e = some i) : + ‖characterRieszZeroTerm χ X e - canonicalCharacterRieszTerm χ q X‖ ≤ + C * X ^ (1 - c / (Real.log χ.modulus + Real.log (T + 4) + 1)) := by + classical + have hXp : 0 < X := by linarith + cases e with + | some i => + obtain ⟨hbeta, hsq, him⟩ := he i rfl + rw [selected_riesz_term_eq_canonical χ q i T c X hq hdvd hqT hT hc hcp hsq him hbeta, + sub_self, norm_zero] + positivity + | none => + simp only [characterRieszZeroTerm, zero_sub, norm_neg] + cases hpage : actualLocalZero q with + | none => simp only [canonicalCharacterRieszTerm, hpage, norm_zero]; positivity + | some r => + by_cases hχ : r.asRealCharacter.asComplex = χ + · have hzero : χ.L (r.beta : ℂ) = 0 := by + rw [← hχ] + exact r.zero + obtain ⟨i, hi⟩ := character_zero_enumerated_of_re_pos χ (r.beta : ℂ) + (by simpa using r.beta_pos) hzero + have hβ : r.beta < 1 - c / (Real.log χ.modulus + Real.log (T + 4) + 1) := by + by_contra hn + have hh := hec i (by simpa only [hi, Complex.ofReal_re] using not_lt.mp hn) + (by simp only [hi, Complex.ofReal_im, abs_zero]; linarith) + cases hh + have hh := canonicalCharacterRieszTerm_norm_bound χ q X C hXp hC hkernel + have hp : pageBeta (actualLocalZero q) = r.beta := by simp only [hpage, pageBeta] + rw [hp] at hh + exact hh.trans (mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow_of_exponent_le hX hβ.le) hC) + · simp only [canonicalCharacterRieszTerm, hpage, hχ, ↓reduceIte, norm_zero] + positivity + +theorem character_riesz_canonical_bound : ∃ c A B E : ℝ, + 0 < c ∧ c ≤ 1 / 4 ∧ 0 < A ∧ 0 < B ∧ 0 < E ∧ + ∀ (q : ℕ) (χ : PrimitiveComplexCharacter) (T X b : ℝ), + 1 ≤ q → χ.modulus ∣ q → (q : ℝ) ≤ T → 2 ≤ T → 1 ≤ X → 1 < b → b ≤ 2 → + let H := Real.log χ.modulus + Real.log (T + 4) + 1 + ‖characterRieszMean χ X - canonicalCharacterRieszTerm χ q X‖ ≤ + A * H ^ 2 * X ^ (1 - c / H) + B * H ^ 2 * X ^ b / T ^ 2 + + 2 * (1 / (b - 1) + E) * X ^ b / T := by + obtain ⟨c, A, B, E, hc, hc4, hcp, hA, hB, hE, hbound⟩ := character_riesz_local_bound + obtain ⟨C, hC, hkernel⟩ := canonical_riesz_kernel_bound + refine ⟨c, A + C, B, E, hc, hc4, by positivity, hB, hE, ?_⟩ + intro q χ T X b hq hdvd hqT hT hX hb hb2 + dsimp only + let H := Real.log χ.modulus + Real.log (T + 4) + 1 + have hqlog : 0 ≤ Real.log χ.modulus := Real.log_nonneg (by exact_mod_cast χ.positive) + have hTlog : 0 ≤ Real.log (T + 4) := Real.log_nonneg (by linarith) + have hH : 1 ≤ H := by dsimp [H]; linarith + obtain ⟨e, he, hec, hr⟩ := hbound χ T hT + have hlocal := hr X b hX hb hb2 + have hd := character_riesz_term_comparison χ q T c X C e hq hdvd hqT hT hc hcp hX hC.le + (hkernel q) he hec + have ht := norm_sub_le_norm_sub_add_norm_sub (characterRieszMean χ X) + (characterRieszZeroTerm χ X e) (canonicalCharacterRieszTerm χ q X) + have hsq : 1 ≤ H ^ 2 := by nlinarith + have hx : 0 ≤ X ^ (1 - c / H) := Real.rpow_nonneg (by linarith) _ + have hcost : C * X ^ (1 - c / H) ≤ C * H ^ 2 * X ^ (1 - c / H) := by + have hh := mul_le_mul_of_nonneg_left hsq (mul_nonneg hC.le hx) + convert hh using 1 <;> ring + change ‖characterRieszMean χ X - canonicalCharacterRieszTerm χ q X‖ ≤ + (A + C) * H ^ 2 * X ^ (1 - c / H) + B * H ^ 2 * X ^ b / T ^ 2 + + 2 * (1 / (b - 1) + E) * X ^ b / T + change ‖characterRieszMean χ X - characterRieszZeroTerm χ X e‖ ≤ + A * H ^ 2 * X ^ (1 - c / H) + B * H ^ 2 * X ^ b / T ^ 2 + + 2 * (1 / (b - 1) + E) * X ^ b / T at hlocal + change ‖characterRieszZeroTerm χ X e - canonicalCharacterRieszTerm χ q X‖ ≤ + C * X ^ (1 - c / H) at hd + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterCanonicalRieszDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterCanonicalRieszDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..8438e88c7dca189c4c9025673021796d782e7d6b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterCanonicalRieszDecay.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterCanonicalRieszComparison + +namespace OAI + +/-! # Uniform character Riesz decay with the canonical Page correction -/ + +namespace Ostmann + +open Filter + +theorem character_riesz_canonical_decay : ∃ d : ℝ, 0 < d ∧ + ∀ᶠ y : ℝ in atTop, ∀ q : ℕ, 1 ≤ q → (q : ℝ) ≤ Real.exp y → + ∀ χ : PrimitiveComplexCharacter, χ.modulus ∣ q → + ‖characterRieszMean χ (Real.exp (y ^ 2)) - + canonicalCharacterRieszTerm χ q (Real.exp (y ^ 2))‖ ≤ + 3 * Real.exp (y ^ 2 - d * y) := by + obtain ⟨c, A, B, E, hc, hc4, hA, hB, hE, hbound⟩ := character_riesz_canonical_bound + refine ⟨c / 6, by positivity, ?_⟩ + filter_upwards [riesz_exponential_error c A B E hc hc4 hA.le hB.le hE.le, + eventually_ge_atTop (5 : ℝ)] with y hy hy5 + intro q hq hqy χ hdvd + have hy0 : 0 < y := by linarith + have hT : 2 ≤ Real.exp y := by linarith [Real.add_one_le_exp y] + have hb1 : 1 < 1 + 1 / y ^ 2 := by + have hh : 0 < 1 / y ^ 2 := by positivity + linarith + have hb2 : 1 + 1 / y ^ 2 ≤ 2 := by + have hys : 1 ≤ y ^ 2 := by nlinarith + have hh : 1 / y ^ 2 ≤ 1 := (div_le_one (by positivity)).mpr hys + linarith + have hr := hbound q χ (Real.exp y) (Real.exp (y ^ 2)) (1 + 1 / y ^ 2) + hq hdvd hqy hT (Real.one_le_exp (sq_nonneg y)) hb1 hb2 + have hχq : (χ.modulus : ℝ) ≤ q := by + exact_mod_cast Nat.le_of_dvd (by omega : 0 < q) hdvd + have hχ : (χ.modulus : ℝ) ≤ Real.exp y := hχq.trans hqy + obtain ⟨hH, hHy⟩ := character_riesz_height_log_bound χ y hy5 hχ + exact hr.trans (hy _ hH hHy) + +theorem character_riesz_canonical_sqrt_decay : ∃ d : ℝ, 0 < d ∧ + ∀ᶠ X : ℝ in atTop, ∀ q : ℕ, 1 ≤ q → + (q : ℝ) ≤ Real.exp (Real.sqrt (Real.log X)) → + ∀ χ : PrimitiveComplexCharacter, χ.modulus ∣ q → + ‖characterRieszMean χ X - canonicalCharacterRieszTerm χ q X‖ ≤ + 3 * X * Real.exp (-d * Real.sqrt (Real.log X)) := by + obtain ⟨d, hd, h⟩ := character_riesz_canonical_decay + refine ⟨d, hd, ?_⟩ + have ht := Real.tendsto_sqrt_atTop.comp Real.tendsto_log_atTop + filter_upwards [ht.eventually h, eventually_ge_atTop (1 : ℝ)] with X hX hX1 + have hx : 0 < X := by linarith + have heq : Real.exp ((Real.sqrt (Real.log X)) ^ 2) = X := by + rw [Real.sq_sqrt (Real.log_nonneg hX1), Real.exp_log hx] + intro q hq hqX χ hχ + have hh := hX q hq hqX χ hχ + dsimp only [Function.comp_apply] at hh + rw [heq, Real.exp_sub, Real.sq_sqrt (Real.log_nonneg hX1), Real.exp_log hx] at hh + simpa only [div_eq_mul_inv, ← Real.exp_neg, mul_assoc, neg_mul] using hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterCompletedZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterCompletedZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..229791a69782be14fee470d99e4b5c6e394f2e84 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterCompletedZeros.lean @@ -0,0 +1,40 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterContourZeros +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedLogDerivative + +namespace OAI + +/-! # The zeros of the entire completed character L-function -/ + +namespace Ostmann + +open Complex + +theorem PrimitiveComplexCharacter.completed_order_ne_top (χ : PrimitiveComplexCharacter) + (z : ℂ) : analyticOrderAt χ.completed z ≠ ⊤ := by + intro h + have he := (AnalyticOnNhd.analyticOrderAt_eq_top_iff_eq_zero z χ.completed_analytic).mp h + exact χ.completed_ne_zero_right 2 (by norm_num) (congrFun he 2) + +theorem PrimitiveComplexCharacter.completed_zero_iff (χ : PrimitiveComplexCharacter) + (z : ℂ) : χ.completed z = 0 ↔ z ∈ complexCharacterZeros χ := by + constructor + · intro hz + have hpos : 0 < z.re := by + by_contra h + exact χ.completed_ne_zero_left z (not_lt.mp h) hz + have hlt : z.re < 1 := by + by_contra h + exact χ.completed_ne_zero_right z (not_lt.mp h) hz + refine ⟨hpos, hlt, ?_⟩ + have he := congrFun χ.L_eq_completed_mul_all z + change χ.L z = χ.completed z * χ.gammaInverse z at he + rw [he, hz, zero_mul] + · rintro ⟨hpos, _, hzero⟩ + have he := congrFun χ.L_eq_completed_mul_all z + change χ.L z = χ.completed z * χ.gammaInverse z at he + rw [hzero] at he + exact (mul_eq_zero.mp he.symm).resolve_right (χ.gammaInverse_ne_zero z hpos) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourDiskZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourDiskZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..a3a98ed9dacc0e52978645c7aec21daafb8c6a42 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourDiskZeros.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterContourZeroSet +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterContourZeros + +namespace OAI + +/-! # Zeros in the enlarged contour disk still lie in the critical strip -/ + +namespace Ostmann + +open Complex Metric + +theorem PrimitiveComplexCharacter.L_ne_zero_negative_small (χ : PrimitiveComplexCharacter) + (z : ℂ) (hz : -1 < z.re) (hz' : z.re ≤ 0) (hne : z ≠ 0) : χ.L z ≠ 0 := by + rw [χ.L_eq_completed_mul z hne] + apply mul_ne_zero (χ.completed_ne_zero_left z hz') + classical + unfold PrimitiveComplexCharacter.gammaInverse DirichletCharacter.gammaFactor + split_ifs + · rw [gammaReal_inverse_factor] + apply mul_ne_zero hne + apply mul_ne_zero (inv_ne_zero (mul_ne_zero two_ne_zero (by exact_mod_cast Real.pi_ne_zero))) + apply inv_ne_zero + apply Complex.Gammaℝ_ne_zero_of_re_pos + simp only [add_re] + norm_num + linarith + · apply inv_ne_zero + apply Complex.Gammaℝ_ne_zero_of_re_pos + simp only [add_re, one_re] + linarith + +theorem characterContourZeros_critical (χ : PrimitiveComplexCharacter) (t : ℝ) + (ht : 3 ≤ |t|) (z : ℂ) (hz : z ∈ characterContourZeros χ t) : + z ∈ complexCharacterZeros χ ∧ |z.im| ≤ |t| + 3 := by + obtain ⟨hzball, hzero⟩ := (mem_characterContourZeros χ t z).mp hz + have hn : ‖z - characterZeroCenter t‖ ≤ 21 / 8 := by + simpa only [mem_closedBall, dist_eq_norm] using hzball + have hre := (abs_re_le_norm (z - characterZeroCenter t)).trans hn + have him := (abs_im_le_norm (z - characterZeroCenter t)).trans hn + simp only [sub_re, sub_im, characterZeroCenter_re, characterZeroCenter_im] at hre him + have hz0 : z ≠ 0 := by + intro he + rw [he] at him + simp only [zero_im, zero_sub, abs_neg] at him + linarith + have hpos : 0 < z.re := by + by_contra he + exact χ.L_ne_zero_negative_small z (by linarith [(abs_le.mp hre).1]) (not_lt.mp he) hz0 hzero + have hlt : z.re < 1 := by + by_contra he + exact χ.L_ne_zero_one_le_re z (not_lt.mp he) hzero + refine ⟨⟨hpos, hlt, hzero⟩, ?_⟩ + calc + |z.im| = |(z.im - t) + t| := by congr 1; ring + _ ≤ |z.im - t| + |t| := abs_add_le _ _ + _ ≤ |t| + 3 := by linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourGrowth.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..33e444a0eaeaf60e3abfa8f9d6a39a514426af03 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourGrowth.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterLeftGrowth + +namespace OAI + +/-! # Actual L-function growth on the fixed strip around the contour -/ + +namespace Ostmann + +open Complex + +theorem character_L_contour_strip_growth : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), -(3 / 4 : ℝ) ≤ s.re → s.re ≤ 5 → + ‖χ.L s‖ ≤ C * (χ.modulus : ℝ) ^ 4 * (6 + |s.im|) * Real.exp (Real.pi * |s.im|) := by + obtain ⟨A, hA, hleft⟩ := character_L_left_growth + refine ⟨max A 4, lt_of_lt_of_le hA (le_max_left _ _), ?_⟩ + intro χ s hs hs' + have hq : 1 ≤ (χ.modulus : ℝ) := by exact_mod_cast χ.positive + have hqpos : 0 < (χ.modulus : ℝ) := by exact_mod_cast χ.positive + by_cases hl : s.re ≤ 1 / 2 + · apply (hleft χ s hs hl).trans + gcongr + · exact le_max_left _ _ + · norm_num + · have hpos : 0 < s.re := by linarith + have hn : ‖s‖ ≤ 5 + |s.im| := by + apply (Complex.norm_le_abs_re_add_abs_im s).trans + rw [abs_of_pos hpos] + linarith + have hb : ‖χ.L s‖ ≤ 4 * (χ.modulus : ℝ) * (5 + |s.im|) := by + apply (χ.L_norm_bound_positive s hpos).trans + apply (div_le_iff₀ hpos).mpr + have hp : ‖s‖ * ((χ.modulus : ℝ) + 1) ≤ (5 + |s.im|) * (2 * (χ.modulus : ℝ)) := + mul_le_mul hn (by linarith) (by positivity) (by positivity) + nlinarith [mul_nonneg (by positivity : 0 ≤ (χ.modulus : ℝ) * (5 + |s.im|)) + (by linarith : 0 ≤ s.re - 1 / 2)] + calc + _ ≤ 4 * (χ.modulus : ℝ) * (5 + |s.im|) := hb + _ ≤ 4 * (χ.modulus : ℝ) ^ 4 * (6 + |s.im|) := by + gcongr + · exact le_self_pow₀ hq (by norm_num) + · norm_num + _ ≤ max A 4 * (χ.modulus : ℝ) ^ 4 * (6 + |s.im|) := by + gcongr + exact le_max_right _ _ + _ ≤ _ := le_mul_of_one_le_right (by positivity) + (Real.one_le_exp (by positivity)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourHeights.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourHeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..f53c3e0e0348b7dfe7ef40081cef6a346144ddc1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourHeights.lean @@ -0,0 +1,26 @@ +import Mathlib.Order.Interval.Set.Infinite +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothTruncatedContour + +namespace OAI + +/-! # Heights at which the character contour crosses no zero -/ + +namespace Ostmann + +open Set + +theorem PrimitiveComplexCharacter.exists_contour_height (χ : PrimitiveComplexCharacter) + (T : ℝ) : ∃ t : ℝ, T < t ∧ t < T + 1 ∧ + ∀ z ∈ complexCharacterZeros χ, |z.im| ≠ t := by + let A := {z : ℂ | z ∈ complexCharacterZeros χ ∧ |z.im| ≤ T + 1} + have hA : A.Finite := χ.strip_zeros_finite (T + 1) + obtain ⟨t, ht, hnot⟩ := (Set.Ioo_infinite (show T < T + 1 by linarith)).exists_notMem_finite + (hA.image (fun z : ℂ => |z.im|)) + refine ⟨t, ht.1, ht.2, ?_⟩ + intro z hz he + apply hnot + exact ⟨z, ⟨hz, by rw [he]; exact ht.2.le⟩, he⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourLogGrowth.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourLogGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea8c562dd8bf8aa511d74ba0f425784806f63709 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourLogGrowth.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterDiskGrowth + +namespace OAI + +/-! # Polynomial logarithmic growth along the contour disks -/ + +namespace Ostmann + +open Complex Metric + +theorem character_contour_log_growth (χ : PrimitiveComplexCharacter) : + ∃ B : ℝ, 0 < B ∧ ∀ t : ℝ, ∃ M : ℝ, 1 ≤ M ∧ + (∀ z ∈ closedBall (characterZeroCenter t) (11 / 4 : ℝ), ‖χ.L z‖ ≤ M) ∧ + Real.log (3 * M) ≤ B * (1 + |t|) := by + obtain ⟨C, hC, hbound⟩ := character_L_contour_disk_growth + let D := max C 1 + let Q := 3 * D * (χ.modulus : ℝ) ^ 4 + let B := |Real.log Q| + 20 + 4 * Real.pi + have hD : 1 ≤ D := le_max_right _ _ + have hDpos : 0 < D := lt_of_lt_of_le (by norm_num) hD + have hq : 1 ≤ (χ.modulus : ℝ) := by exact_mod_cast χ.positive + have hqpos : 0 < (χ.modulus : ℝ) := by exact_mod_cast χ.positive + have hQ : 0 < Q := by dsimp [Q]; positivity + have hB : 0 < B := by dsimp [B]; positivity + refine ⟨B, hB, ?_⟩ + intro t + let M := D * (χ.modulus : ℝ) ^ 4 * (9 + |t|) * Real.exp (Real.pi * (|t| + 3)) + have hM : 1 ≤ M := by + dsimp [M] + have hpow : 1 ≤ (χ.modulus : ℝ) ^ 4 := one_le_pow₀ hq + have he : 1 ≤ Real.exp (Real.pi * (|t| + 3)) := Real.one_le_exp (by positivity) + have hmul : 1 ≤ D * (χ.modulus : ℝ) ^ 4 := one_le_mul_of_one_le_of_one_le hD hpow + exact one_le_mul_of_one_le_of_one_le (one_le_mul_of_one_le_of_one_le hmul (by linarith [abs_nonneg t])) he + refine ⟨M, hM, ?_, ?_⟩ + · intro z hz + apply (hbound χ t z hz).trans + dsimp [M, D] + gcongr + exact le_max_left _ _ + · have hMprod : 3 * M = Q * (9 + |t|) * Real.exp (Real.pi * (|t| + 3)) := by + dsimp [M, Q] + ring + rw [hMprod, Real.log_mul (by positivity) (by positivity), + Real.log_mul hQ.ne' (by positivity), Real.log_exp] + have hlog : Real.log (9 + |t|) ≤ 8 + |t| := by + have hh := Real.log_le_sub_one_of_pos (by positivity : 0 < 9 + |t|) + linarith + have hb : 1 + Real.pi ≤ B := by + dsimp [B] + nlinarith [Real.pi_pos, abs_nonneg (Real.log Q)] + have hc : Real.log Q + 8 + 3 * Real.pi ≤ B := by + dsimp [B] + nlinarith [le_abs_self (Real.log Q), Real.pi_pos] + have hh := mul_le_mul_of_nonneg_right hb (abs_nonneg t) + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourZeroSet.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourZeroSet.lean new file mode 100644 index 0000000000000000000000000000000000000000..687558cb18762c7d39bdd5550a02438fc099e1ea --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourZeroSet.lean @@ -0,0 +1,89 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroPolynomial +import OAI.NumberTheory.Ostmann.Characters.CharacterDiskGrowth + +namespace OAI + +/-! # The actual finite zero set removed around a horizontal contour edge -/ + +namespace Ostmann + +open Metric Set MeromorphicOn +open scoped BigOperators Classical + +noncomputable def characterContourDivisor (χ : PrimitiveComplexCharacter) (t : ℝ) := + divisor χ.L (closedBall (characterZeroCenter t) (21 / 8 : ℝ)) + +noncomputable def characterContourZeros (χ : PrimitiveComplexCharacter) (t : ℝ) : Finset ℂ := + ((characterContourDivisor χ t).finiteSupport + (isCompact_closedBall (characterZeroCenter t) (21 / 8 : ℝ))).toFinset + +theorem characterContourDivisor_eq (χ : PrimitiveComplexCharacter) (t : ℝ) (z : ℂ) + (hz : z ∈ closedBall (characterZeroCenter t) (21 / 8 : ℝ)) : + characterContourDivisor χ t z = (analyticOrderNatAt χ.L z : ℤ) := by + rw [← characterZeroOrder_eq_nat] + unfold characterContourDivisor characterZeroOrder + rw [AnalyticOnNhd.divisor_apply (fun z _ => χ.L_analytic z) hz, + AnalyticOnNhd.divisor_apply (fun z _ => χ.L_analytic z) (mem_univ z)] + +theorem mem_characterContourZeros (χ : PrimitiveComplexCharacter) (t : ℝ) (z : ℂ) : + z ∈ characterContourZeros χ t ↔ + z ∈ closedBall (characterZeroCenter t) (21 / 8 : ℝ) ∧ χ.L z = 0 := by + change z ∈ ((characterContourDivisor χ t).finiteSupport (isCompact_closedBall _ _)).toFinset ↔ _ + rw [Set.Finite.mem_toFinset] + change characterContourDivisor χ t z ≠ 0 ↔ _ + constructor + · intro hn + have hz : z ∈ closedBall (characterZeroCenter t) (21 / 8 : ℝ) := + (characterContourDivisor χ t).supportWithinDomain hn + refine ⟨hz, ?_⟩ + rw [characterContourDivisor_eq χ t z hz, ← characterZeroOrder_eq_nat] at hn + exact (characterZeroOrder_pos_iff χ z).mp + (lt_of_le_of_ne (characterZeroOrder_nonneg χ z) (Ne.symm hn)) + · rintro ⟨hz, he⟩ + rw [characterContourDivisor_eq χ t z hz, ← characterZeroOrder_eq_nat] + exact ne_of_gt ((characterZeroOrder_pos_iff χ z).mpr he) + +theorem characterContourZeros_mass_eq (χ : PrimitiveComplexCharacter) (t : ℝ) : + (∑ z ∈ characterContourZeros χ t, (analyticOrderNatAt χ.L z : ℝ)) = + ((∑ᶠ z, characterContourDivisor χ t z : ℤ) : ℝ) := by + rw [finsum_eq_sum_of_support_subset (s := characterContourZeros χ t) _ (by + intro z hz + exact ((characterContourDivisor χ t).finiteSupport + (isCompact_closedBall _ _)).mem_toFinset.mpr hz), Int.cast_sum] + apply Finset.sum_congr rfl + intro z hz + rw [characterContourDivisor_eq χ t z ((mem_characterContourZeros χ t z).mp hz).1] + simp + +theorem characterContourZeros_mass_bound (χ : PrimitiveComplexCharacter) (t M : ℝ) + (hM : 1 ≤ M) + (hbound : ∀ z ∈ closedBall (characterZeroCenter t) (11 / 4 : ℝ), ‖χ.L z‖ ≤ M) : + (∑ z ∈ characterContourZeros χ t, (analyticOrderNatAt χ.L z : ℝ)) ≤ + Real.log (3 * M) / Real.log (22 / 21 : ℝ) := by + have ha : AnalyticOnNhd ℂ χ.L (closedBall (characterZeroCenter t) |(11 / 4 : ℝ)|) := + fun z _ => χ.L_analytic z + have hlo := χ.L_lower_re_two (characterZeroCenter t) (characterZeroCenter_re t) + have hne : χ.L (characterZeroCenter t) ≠ 0 := by + intro he + rw [he, norm_zero] at hlo + linarith + have hj := ha.sum_divisor_le (r := (21 / 8 : ℝ)) (R := (11 / 4 : ℝ)) + (by norm_num) (by norm_num) hM hne (fun z hz => hbound z (by + simpa only [abs_of_pos (by norm_num : (0 : ℝ) < 11 / 4)] using + sphere_subset_closedBall hz)) + have hn : 0 < ‖χ.L (characterZeroCenter t)‖ := by linarith + have hr : M / ‖χ.L (characterZeroCenter t)‖ ≤ 3 * M := by + apply (div_le_iff₀ hn).mpr + nlinarith + rw [characterContourZeros_mass_eq] + change ((∑ᶠ z, divisor χ.L (closedBall (characterZeroCenter t) (21 / 8)) z : ℤ) : ℝ) ≤ _ + rw [show |(21 / 8 : ℝ)| = 21 / 8 by norm_num, + show (11 / 4 : ℝ) / (21 / 8) = 22 / 21 by norm_num] at hj + apply hj.trans + exact div_le_div_of_nonneg_right + (Real.log_le_log (div_pos (by linarith) hn) hr) + (Real.log_pos (by norm_num)).le + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..45913eed418462c3a37c3b37c59d5129a59ad4a0 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterContourZeros.lean @@ -0,0 +1,69 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterTrivialZero +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroSet + +namespace OAI + +/-! # The only zeros crossed by the fixed smooth contour + +Between Re(s)=-1/2 and Re(s)=2 the poles of the logarithmic derivative are +precisely the critical-strip zeros, together with the possible zero at zero. +-/ + +namespace Ostmann + +open Complex + +theorem PrimitiveComplexCharacter.L_ne_zero_one_le_re (χ : PrimitiveComplexCharacter) + (z : ℂ) (hz : 1 ≤ z.re) : χ.L z ≠ 0 := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + exact DirichletCharacter.LFunction_ne_zero_of_one_le_re χ.character (.inl χ.nontrivial) hz + +theorem PrimitiveComplexCharacter.completed_ne_zero_left (χ : PrimitiveComplexCharacter) + (z : ℂ) (hz : z.re ≤ 0) : χ.completed z ≠ 0 := by + apply (χ.completed_analytic z).analyticOrderAt_eq_zero.mp + have hpos : 0 < (1 - z).re := by simp; linarith + have hge : 1 ≤ (1 - z).re := by simp; linarith + calc + analyticOrderAt χ.completed z = analyticOrderAt χ.inverse.completed (1 - z) := by + simpa using χ.completed_order_reflection (1 - z) + _ = analyticOrderAt χ.inverse.L (1 - z) := (χ.inverse.L_order_eq_completed _ hpos).symm + _ = 0 := (χ.inverse.L_analytic _).analyticOrderAt_eq_zero.mpr + (χ.inverse.L_ne_zero_one_le_re _ hge) + +theorem PrimitiveComplexCharacter.L_ne_zero_left_ne_origin (χ : PrimitiveComplexCharacter) + (z : ℂ) (hz : -(1 / 2 : ℝ) ≤ z.re) (hz' : z.re ≤ 0) (hne : z ≠ 0) : χ.L z ≠ 0 := by + rw [χ.L_eq_completed_mul z hne] + apply mul_ne_zero (χ.completed_ne_zero_left z hz') + classical + unfold PrimitiveComplexCharacter.gammaInverse DirichletCharacter.gammaFactor + split_ifs + · rw [gammaReal_inverse_factor] + apply mul_ne_zero hne + apply mul_ne_zero (inv_ne_zero (mul_ne_zero two_ne_zero (by exact_mod_cast Real.pi_ne_zero))) + apply inv_ne_zero + apply Complex.Gammaℝ_ne_zero_of_re_pos + simp only [add_re] + norm_num + linarith + · apply inv_ne_zero + apply Complex.Gammaℝ_ne_zero_of_re_pos + simp only [add_re, one_re] + linarith + +theorem PrimitiveComplexCharacter.contour_zero_location (χ : PrimitiveComplexCharacter) + (z : ℂ) (hz : -(1 / 2 : ℝ) ≤ z.re) (hzero : χ.L z = 0) : + z = 0 ∨ z ∈ complexCharacterZeros χ := by + by_cases hne : z = 0 + · exact .inl hne + right + have hpos : 0 < z.re := by + by_contra hh + exact χ.L_ne_zero_left_ne_origin z hz (not_lt.mp hh) hne hzero + have hlt : z.re < 1 := by + by_contra hh + exact χ.L_ne_zero_one_le_re z (not_lt.mp hh) hzero + exact ⟨hpos, hlt, hzero⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterFullZeroCount.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterFullZeroCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..b241e50ce15ca66263831b81111bc81f835ee5a4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterFullZeroCount.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroReflection + +namespace OAI + +/-! # Ordinary zero-count bound, with analytic multiplicities -/ + +namespace Ostmann + +open Set +open scoped BigOperators Classical + +theorem PrimitiveComplexCharacter.full_zero_sum_rate (χ : PrimitiveComplexCharacter) + (T : ℝ) (hT : 0 ≤ T) (S : Finset ℂ) + (hS : ∀ z ∈ S, 0 < z.re ∧ z.re < 1 ∧ |z.im| ≤ T) : + ∑ z ∈ S, (characterZeroOrder χ z : ℝ) ≤ + (32 / Real.log (14 / 13)) * (T + 1) * Real.log ((χ.modulus : ℝ) * (T + 2)) := by + let A := S.filter (fun z => 1 / 2 ≤ z.re) + let B := S.filter (fun z => ¬ 1 / 2 ≤ z.re) + let C := B.image (fun z : ℂ => 1 - z) + have hA := χ.right_zero_sum_rate T hT A (by + intro z hz + obtain ⟨hzS, hzre⟩ := Finset.mem_filter.mp hz + exact ⟨hzre, (hS z hzS).2.1.le, (hS z hzS).2.2⟩) + have hC := χ.inverse.right_zero_sum_rate T hT C (by + intro w hw + obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hw + obtain ⟨hzS, hzre⟩ := Finset.mem_filter.mp hz + obtain ⟨hr, hr', hi⟩ := hS z hzS + simp only [Complex.sub_re, Complex.one_re, Complex.sub_im, Complex.one_im, + zero_sub, abs_neg] + exact ⟨by linarith, by linarith, hi⟩) + have heq : ∑ z ∈ B, (characterZeroOrder χ z : ℝ) = + ∑ w ∈ C, (characterZeroOrder χ.inverse w : ℝ) := by + dsimp only [C] + rw [Finset.sum_image (by + intro z hz w hw he + exact sub_right_injective he)] + apply Finset.sum_congr rfl + intro z hz + have hzS := (Finset.mem_filter.mp hz).1 + obtain ⟨hr, hr', hi⟩ := hS z hzS + have hh := characterZeroOrder_reflection χ (1 - z) + (by simp; linarith) (by simp; linarith) + rw [show (1 : ℂ) - (1 - z) = z by ring] at hh + exact_mod_cast hh + have hsplit : ∑ z ∈ S, (characterZeroOrder χ z : ℝ) = + (∑ z ∈ A, (characterZeroOrder χ z : ℝ)) + ∑ z ∈ B, (characterZeroOrder χ z : ℝ) := by + exact (Finset.sum_filter_add_sum_filter_not S (fun z => 1 / 2 ≤ z.re) + (fun z => (characterZeroOrder χ z : ℝ))).symm + rw [hsplit, heq] + simp only [PrimitiveComplexCharacter.inverse_modulus] at hC + calc + _ ≤ (16 / Real.log (14 / 13)) * (T + 1) * Real.log ((χ.modulus : ℝ) * (T + 2)) + + (16 / Real.log (14 / 13)) * (T + 1) * Real.log ((χ.modulus : ℝ) * (T + 2)) := + add_le_add hA hC + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaContour.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaContour.lean new file mode 100644 index 0000000000000000000000000000000000000000..6bc8b635f4ccd5d7db500510971a72ae08434f8e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaContour.lean @@ -0,0 +1,74 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaRealContourBound +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterContourZeros + +namespace OAI + +/-! # The actual character Gamma factors on both vertical contour lines -/ + +namespace Ostmann + +open Complex +open scoped Classical + +private theorem contourLine_expanded (s : ℂ) (hs : s.re = -(1 / 2 : ℝ) ∨ s.re = 3 / 2) : + s.re = -(1 / 2 : ℝ) ∨ s.re = 1 / 2 ∨ s.re = 3 / 2 ∨ s.re = 5 / 2 := by + rcases hs with h | h + · exact .inl h + · exact .inr (.inr (.inl h)) + +private theorem contourLine_shift (s : ℂ) (hs : s.re = -(1 / 2 : ℝ) ∨ s.re = 3 / 2) : + (s + 1).re = -(1 / 2 : ℝ) ∨ (s + 1).re = 1 / 2 ∨ + (s + 1).re = 3 / 2 ∨ (s + 1).re = 5 / 2 := by + simp only [add_re, one_re] + rcases hs with h | h + · right; left; linarith + · right; right; right; linarith + +theorem PrimitiveComplexCharacter.gammaFactor_differentiableAt + (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = -(1 / 2 : ℝ) ∨ s.re = 3 / 2) : + DifferentiableAt ℂ (DirichletCharacter.gammaFactor χ.character) s := by + by_cases hc : χ.character.Even + · rw [show DirichletCharacter.gammaFactor χ.character = Complex.Gammaℝ from + funext (fun u => by simp [DirichletCharacter.gammaFactor, hc])] + exact gammaReal_differentiableAt s (gammaReal_contour_regular s (contourLine_expanded s hs)) + · rw [show DirichletCharacter.gammaFactor χ.character = Complex.Gammaℝ ∘ (fun u : ℂ => u + 1) from + funext (fun u => by simp [DirichletCharacter.gammaFactor, hc])] + exact (gammaReal_differentiableAt (s + 1) (gammaReal_contour_regular _ (contourLine_shift s hs))).comp s + (differentiableAt_id.add_const (1 : ℂ)) + +theorem characterGamma_contour_bound : ∃ B : ℝ, 0 < B ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), + (s.re = -(1 / 2 : ℝ) ∨ s.re = 3 / 2) → + ‖logDeriv (DirichletCharacter.gammaFactor χ.character) s‖ ≤ B * (1 + |s.im|) := by + obtain ⟨B, hB, hbound⟩ := gammaReal_contour_logDeriv_bound + refine ⟨B, hB, ?_⟩ + intro χ s hs + by_cases hc : χ.character.Even + · rw [show DirichletCharacter.gammaFactor χ.character = Complex.Gammaℝ from + funext (fun u => by simp [DirichletCharacter.gammaFactor, hc])] + exact hbound s (contourLine_expanded s hs) + · rw [show DirichletCharacter.gammaFactor χ.character = Complex.Gammaℝ ∘ (fun u : ℂ => u + 1) from + funext (fun u => by simp [DirichletCharacter.gammaFactor, hc])] + rw [logDeriv_comp (g := fun u : ℂ => u + 1) (x := s) + (gammaReal_differentiableAt (s + 1) (gammaReal_contour_regular _ (contourLine_shift s hs))) + (differentiableAt_id.add_const (1 : ℂ))] + simpa using hbound (s + 1) (contourLine_shift s hs) + +theorem characterGammaInverse_contour_bound : ∃ B : ℝ, 0 < B ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), + (s.re = -(1 / 2 : ℝ) ∨ s.re = 3 / 2) → + ‖logDeriv χ.gammaInverse s‖ ≤ B * (1 + |s.im|) := by + obtain ⟨B, hB, hbound⟩ := characterGamma_contour_bound + refine ⟨B, hB, ?_⟩ + intro χ s hs + have he := logDeriv_fun_zpow (χ.gammaFactor_differentiableAt s hs) (-1 : ℤ) + have hi : logDeriv χ.gammaInverse s = -logDeriv (DirichletCharacter.gammaFactor χ.character) s := by + rw [show χ.gammaInverse = (fun x => (DirichletCharacter.gammaFactor χ.character x)⁻¹) from rfl] + simpa only [zpow_neg_one, Int.cast_neg, Int.cast_one, neg_one_mul] using he + rw [hi, norm_neg] + exact hbound χ s hs + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaFactorialGrowth.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaFactorialGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..dec461370c0ce1c395c82c5bd8f7233d7a7b4c04 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaFactorialGrowth.lean @@ -0,0 +1,42 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaFactorialGrowth +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterGammaGrowth + +namespace OAI + +/-! # Factorial growth for the archimedean factors on expanding disks -/ + +namespace Ostmann + +open Complex + +theorem gammaReal_factorial_growth : ∃ C : ℝ, 0 < C ∧ + ∀ (N : ℕ) (s : ℂ), (1 / 2 : ℝ) ≤ s.re → s.re ≤ (N : ℝ) + 2 → + ‖Complex.Gammaℝ s‖ ≤ C + ((N + 1).factorial : ℝ) := by + obtain ⟨C, hC, hbound⟩ := gamma_factorial_growth + refine ⟨C, hC, ?_⟩ + intro N s hs hs' + have hg := hbound N (s / 2) (by simp; linarith) (by simp; linarith [Nat.cast_nonneg (α := ℝ) N]) + have hp : ‖(Real.pi : ℂ) ^ (-s / 2)‖ ≤ 1 := by + rw [Complex.norm_cpow_eq_rpow_re_of_pos Real.pi_pos] + apply Real.rpow_le_one_of_one_le_of_nonpos (by linarith [Real.pi_gt_three] : 1 ≤ Real.pi) + simp + linarith + rw [Complex.Gammaℝ_def, norm_mul] + exact (mul_le_mul hp hg (norm_nonneg _) (by norm_num)).trans_eq (one_mul _) + +theorem characterGamma_factorial_growth : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (N : ℕ) (s : ℂ), + (1 / 2 : ℝ) ≤ s.re → s.re ≤ (N : ℝ) + 1 → + ‖DirichletCharacter.gammaFactor χ.character s‖ ≤ C + ((N + 1).factorial : ℝ) := by + obtain ⟨C, hC, hbound⟩ := gammaReal_factorial_growth + refine ⟨C, hC, ?_⟩ + intro χ N s hs hs' + classical + unfold DirichletCharacter.gammaFactor + split_ifs + · exact hbound N s hs (by linarith) + · exact hbound N (s + 1) (by simp; linarith) (by simp; linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaGrowth.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..2174eb53fa532e4846fd327100febfeff893077a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaGrowth.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaGrowthStrip +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedLogDerivative + +namespace OAI + +/-! # Uniform Gamma factors for the horizontal-contour growth estimate -/ + +namespace Ostmann + +open Complex +open scoped Classical + +theorem characterGamma_growth_bounds : ∃ C : ℝ, 0 < C ∧ + (∀ (χ : PrimitiveComplexCharacter) (s : ℂ), (1 / 2 : ℝ) ≤ s.re → s.re ≤ 7 / 4 → + ‖DirichletCharacter.gammaFactor χ.character s‖ ≤ C) ∧ + (∀ (χ : PrimitiveComplexCharacter) (s : ℂ), -(3 / 4 : ℝ) ≤ s.re → s.re ≤ 1 / 2 → + ‖χ.gammaInverse s‖ ≤ C * Real.exp (Real.pi * |s.im|)) := by + obtain ⟨C, hC, hp, hi⟩ := gammaReal_growth_bounds + refine ⟨C, hC, ?_, ?_⟩ + · intro χ s hs hs' + by_cases hc : χ.character.Even + · simpa only [DirichletCharacter.gammaFactor, hc, ↓reduceIte] using hp s hs (by linarith) + · simpa only [DirichletCharacter.gammaFactor, hc, ↓reduceIte] using + hp (s + 1) (by simp; linarith) (by simp; linarith) + · intro χ s hs hs' + by_cases hc : χ.character.Even + · simpa only [PrimitiveComplexCharacter.gammaInverse, DirichletCharacter.gammaFactor, hc, ↓reduceIte] + using hi s hs (by linarith) + · simpa only [PrimitiveComplexCharacter.gammaInverse, DirichletCharacter.gammaFactor, hc, ↓reduceIte, + add_im, one_im, add_zero] using hi (s + 1) (by simp; linarith) (by simp; linarith) + +theorem PrimitiveComplexCharacter.L_reflection_product (χ : PrimitiveComplexCharacter) + (s : ℂ) (hs : s.re < 1) : + χ.L s = (χ.modulus : ℂ) ^ (1 / 2 - s) * + @DirichletCharacter.rootNumber χ.modulus ⟨χ.positive.ne'⟩ χ.character * + χ.inverse.L (1 - s) * DirichletCharacter.gammaFactor χ.inverse.character (1 - s) * + χ.gammaInverse s := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have hpos : 0 < (1 - s).re := by simp; linarith + have hgne : DirichletCharacter.gammaFactor χ.inverse.character (1 - s) ≠ 0 := by + intro hz + have hh := χ.inverse.gammaInverse_ne_zero _ hpos + apply hh + change (DirichletCharacter.gammaFactor χ.inverse.character (1 - s))⁻¹ = 0 + rw [hz, inv_zero] + have hLi := congrFun χ.inverse.L_eq_completed_mul_all (1 - s) + change χ.inverse.L (1 - s) = χ.inverse.completed (1 - s) / + DirichletCharacter.gammaFactor χ.inverse.character (1 - s) at hLi + have hCi := (eq_div_iff hgne).mp hLi + have hfun := χ.primitive.completedLFunction_one_sub (1 - s) + have harg : 1 - (1 - s) = s := by ring + have hexp : (1 - s) - 1 / 2 = 1 / 2 - s := by ring + rw [harg, hexp] at hfun + have hL := congrFun χ.L_eq_completed_mul_all s + change χ.L s = χ.completed s * χ.gammaInverse s at hL + rw [hL] + change χ.completed s = (χ.modulus : ℂ) ^ (1 / 2 - s) * + DirichletCharacter.rootNumber χ.character * χ.inverse.completed (1 - s) at hfun + rw [hfun, ← hCi] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaGrowthSequence.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaGrowthSequence.lean new file mode 100644 index 0000000000000000000000000000000000000000..824ac6060ced4c1cf1be40dc1e892f6013c4749b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaGrowthSequence.lean @@ -0,0 +1,78 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaLogDerivativeGrowth +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedRightGrowth + +namespace OAI + +/-! # An explicit sequence on which the character Gamma logarithmic derivative diverges -/ + +namespace Ostmann + +open Complex Filter +open scoped Topology Classical + +noncomputable def characterGammaSample (χ : PrimitiveComplexCharacter) (n : ℕ) : ℂ := + if χ.character.Even then 2 * ((n : ℂ) + 1) else 2 * (n : ℂ) + 1 + +theorem characterGammaSample_re_lower (χ : PrimitiveComplexCharacter) (n : ℕ) : + 2 * (n : ℝ) + 1 ≤ (characterGammaSample χ n).re := by + unfold characterGammaSample + split_ifs <;> simp + linarith + +theorem gammaReal_logDeriv_double_nat (n : ℕ) : + logDeriv Complex.Gammaℝ (2 * ((n : ℂ) + 1)) = + ((-Real.eulerMascheroniConstant + (harmonic n : ℝ) - Real.log Real.pi) / 2 : ℝ) := by + have harg : 2 * ((n : ℂ) + 1) / 2 = (n : ℂ) + 1 := by ring + have hn : ∀ k : ℕ, (n : ℂ) + 1 ≠ -(k : ℂ) := by + intro k hk + have hh := congrArg Complex.re hk + simp only [add_re, natCast_re, one_re, neg_re] at hh + have := Nat.cast_nonneg (α := ℝ) n + have := Nat.cast_nonneg (α := ℝ) k + linarith + rw [gammaReal_logDeriv _ (by rwa [harg]), harg, Complex.digamma_def, + gamma_logDeriv_nat, ← Complex.ofReal_log Real.pi_pos.le] + push_cast + rfl + +theorem characterGamma_logDeriv_sample (χ : PrimitiveComplexCharacter) (n : ℕ) : + logDeriv (DirichletCharacter.gammaFactor χ.character) (characterGammaSample χ n) = + ((-Real.eulerMascheroniConstant + (harmonic n : ℝ) - Real.log Real.pi) / 2 : ℝ) := by + by_cases hc : χ.character.Even + · rw [show DirichletCharacter.gammaFactor χ.character = Complex.Gammaℝ from + funext (fun u => by simp [DirichletCharacter.gammaFactor, hc])] + simpa [characterGammaSample, hc] using gammaReal_logDeriv_double_nat n + · have he : DirichletCharacter.gammaFactor χ.character = + Complex.Gammaℝ ∘ (fun u : ℂ => u + 1) := by + funext u + simp [DirichletCharacter.gammaFactor, hc] + rw [he] + simp only [characterGammaSample, hc, ↓reduceIte] + have ha : 2 * (n : ℂ) + 1 + 1 = 2 * ((n : ℂ) + 1) := by ring + have hreg : ∀ k : ℕ, (2 * (n : ℂ) + 1 + 1) / 2 ≠ -(k : ℂ) := by + intro k hk + have hh := congrArg Complex.re hk + norm_num at hh + have := Nat.cast_nonneg (α := ℝ) n + have := Nat.cast_nonneg (α := ℝ) k + linarith + rw [logDeriv_comp (g := fun u : ℂ => u + 1) (x := 2 * (n : ℂ) + 1) + (gammaReal_differentiableAt _ hreg) + (differentiableAt_id.add_const (1 : ℂ))] + simpa only [deriv_add_const, deriv_id'', mul_one, ha] using gammaReal_logDeriv_double_nat n + +theorem characterGamma_logDeriv_sample_re_tendsto (χ : PrimitiveComplexCharacter) : + Tendsto (fun n => (logDeriv (DirichletCharacter.gammaFactor χ.character) + (characterGammaSample χ n)).re) atTop atTop := by + apply tendsto_atTop.2 + intro b + have hh := gamma_logDeriv_nat_re_tendsto.eventually_ge_atTop (2 * b + Real.log Real.pi) + filter_upwards [hh] with n hn + rw [characterGamma_logDeriv_sample] + rw [gamma_logDeriv_nat] at hn + simp only [add_re, neg_re, ofReal_re] at hn ⊢ + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaRealBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaRealBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..d155f031596e9bcf73fb3bb161310097911f268d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaRealBound.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedDivergence + +namespace OAI + +/-! # Uniform archimedean error on the real interval used by the zero argument -/ + +namespace Ostmann + +open Complex Set +open scoped Classical + +theorem gammaReal_analyticAt_pos (z : ℂ) (hz : 0 < z.re) : + AnalyticAt ℂ Complex.Gammaℝ z := by + rw [analyticAt_iff_eventually_differentiableAt] + filter_upwards [(isOpen_lt continuous_const Complex.continuous_re).mem_nhds hz] with w hw + apply gammaReal_differentiableAt + intro n hn + have hh := congrArg Complex.re hn + simp only [div_ofNat_re, neg_re, natCast_re] at hh + linarith [Nat.cast_nonneg (α := ℝ) n] + +theorem gammaReal_logDeriv_real_bound : ∃ C : ℝ, 0 < C ∧ + ∀ t : ℝ, 1 ≤ t → t ≤ 3 → ‖logDeriv Complex.Gammaℝ (t : ℂ)‖ ≤ C := by + have hc : ContinuousOn (fun t : ℝ => logDeriv Complex.Gammaℝ (t : ℂ)) (Icc 1 3) := by + intro t ht + have htpos : 0 < (t : ℂ).re := by simp; linarith [ht.1] + have ha := gammaReal_analyticAt_pos (t : ℂ) htpos + exact ((ha.deriv.div ha (Complex.Gammaℝ_ne_zero_of_re_pos htpos)).continuousAt.comp + Complex.continuous_ofReal.continuousAt).continuousWithinAt + obtain ⟨C, hC⟩ := isCompact_Icc.exists_bound_of_continuousOn hc + refine ⟨|C| + 1, by positivity, ?_⟩ + intro t ht ht' + exact (hC t ⟨ht, ht'⟩).trans (by linarith [le_abs_self C]) + +theorem characterGamma_real_logDeriv_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℝ), 1 < s → s ≤ 2 → + ‖logDeriv (DirichletCharacter.gammaFactor χ.character) (s : ℂ)‖ ≤ C := by + obtain ⟨C, hC, hb⟩ := gammaReal_logDeriv_real_bound + refine ⟨C, hC, ?_⟩ + intro χ s hs hs' + by_cases he : χ.character.Even + · rw [show DirichletCharacter.gammaFactor χ.character = Complex.Gammaℝ from + funext (fun u => by simp [DirichletCharacter.gammaFactor, he])] + exact hb s hs.le (by linarith) + · rw [show DirichletCharacter.gammaFactor χ.character = + Complex.Gammaℝ ∘ (fun u : ℂ => u + 1) from + funext (fun u => by simp [DirichletCharacter.gammaFactor, he])] + rw [logDeriv_comp (g := fun u : ℂ => u + 1) (x := (s : ℂ)) + (gammaReal_analyticAt_pos ((s : ℂ) + 1) (by simp; linarith)).differentiableAt + (differentiableAt_id.add_const (1 : ℂ))] + simpa using hb (s + 1) (by linarith) (by linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaShift.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..4ec43e5228725744cca927b4afa5738c4e62024d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterGammaShift.lean @@ -0,0 +1,87 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SharpGammaRealShift +import OAI.NumberTheory.Ostmann.Characters.CharacterRootNumberUnit + +namespace OAI + +/-! # Uniform shifted Gamma factors for actual primitive characters -/ + +namespace Ostmann + +open Complex +open scoped Classical + + theorem character_gamma_shift (χ : PrimitiveComplexCharacter) (s w : ℂ) + (hs : s.re = 1 / 2) (hw : 0 ≤ w.re) (hw2 : w.re ≤ 2) : + ‖DirichletCharacter.gammaFactor χ.character (s + w) / + DirichletCharacter.gammaFactor χ.character s‖ ≤ + Real.exp ((59 + |Real.eulerMascheroniConstant|) * (1 + |w.im|)) * + (|s.im| + 2) ^ (w.re / 2) := by + by_cases he : χ.character.Even + · simpa only [DirichletCharacter.gammaFactor, he, ↓reduceIte] using + sharp_gammaReal_shift s w (by linarith) (by linarith) hw hw2 + · have h := sharp_gammaReal_shift (s + 1) w + (by simp; linarith) (by simp; linarith) hw hw2 + simpa only [DirichletCharacter.gammaFactor, he, ↓reduceIte, add_im, one_im, + add_zero, add_right_comm s w 1] using h + +noncomputable def densityCompletedSquareWeight (χ : PrimitiveComplexCharacter) (s w : ℂ) : ℂ := + (χ.modulus : ℂ) ^ w * + (DirichletCharacter.gammaFactor χ.character (s + w) / + DirichletCharacter.gammaFactor χ.character s) ^ 2 * Complex.exp (w ^ 2) + + theorem gaussian_linear_abs_bound (C σ u : ℝ) (hσ : 0 ≤ σ) (hσ2 : σ ≤ 2) : + Real.exp (2 * C * (1 + |u|) + σ ^ 2 - u ^ 2) ≤ + Real.exp (2 * C + 4 + 2 * C ^ 2) * Real.exp (-(u ^ 2) / 2) := by + rw [← Real.exp_add] + apply Real.exp_le_exp.mpr + nlinarith [sq_nonneg (|u| - 2 * C), sq_abs u] + + theorem densityCompletedSquareWeight_bound (χ : PrimitiveComplexCharacter) (s w : ℂ) + (hs : s.re = 1 / 2) (hw : 0 ≤ w.re) (hw2 : w.re ≤ 2) : + ‖densityCompletedSquareWeight χ s w‖ ≤ + Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) * + ((χ.modulus : ℝ) * (|s.im| + 2)) ^ w.re * Real.exp (-(w.im ^ 2) / 2) := by + let C : ℝ := 59 + |Real.eulerMascheroniConstant| + have hq : (0 : ℝ) < χ.modulus := by exact_mod_cast χ.positive + have hG := character_gamma_shift χ s w hs hw hw2 + have hsq := pow_le_pow_left₀ (norm_nonneg _) hG 2 + have hp : ‖(χ.modulus : ℂ) ^ w‖ = (χ.modulus : ℝ) ^ w.re := by + rw [← Complex.ofReal_natCast, Complex.norm_cpow_eq_rpow_re_of_pos hq] + have he : ‖Complex.exp (w ^ 2)‖ = Real.exp (w.re ^ 2 - w.im ^ 2) := by + rw [Complex.norm_exp] + congr 1 + simp [pow_two, Complex.mul_re] + have hsquare : (Real.exp (C * (1 + |w.im|)) * (|s.im| + 2) ^ (w.re / 2)) ^ 2 = + Real.exp (2 * C * (1 + |w.im|)) * (|s.im| + 2) ^ w.re := by + rw [mul_pow, ← Real.exp_nat_mul, ← Real.rpow_natCast, + ← Real.rpow_mul (by positivity : 0 ≤ |s.im| + 2)] + congr 1 + · congr 1 + norm_num + ring + · congr 1 + norm_num + have hpow : (χ.modulus : ℝ) ^ w.re * (|s.im| + 2) ^ w.re = + ((χ.modulus : ℝ) * (|s.im| + 2)) ^ w.re := + (Real.mul_rpow hq.le (by positivity)).symm + calc + _ ≤ (χ.modulus : ℝ) ^ w.re * + (Real.exp (C * (1 + |w.im|)) * (|s.im| + 2) ^ (w.re / 2)) ^ 2 * + Real.exp (w.re ^ 2 - w.im ^ 2) := by + simpa only [densityCompletedSquareWeight, norm_mul, norm_pow, hp, he] using + mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hsq (by positivity)) + (Real.exp_nonneg (w.re ^ 2 - w.im ^ 2)) + _ = ((χ.modulus : ℝ) * (|s.im| + 2)) ^ w.re * + Real.exp (2 * C * (1 + |w.im|) + w.re ^ 2 - w.im ^ 2) := by + rw [hsquare, show 2 * C * (1 + |w.im|) + w.re ^ 2 - w.im ^ 2 = + 2 * C * (1 + |w.im|) + (w.re ^ 2 - w.im ^ 2) by ring, Real.exp_add, ← hpow] + ring + _ ≤ _ := by + have h := mul_le_mul_of_nonneg_left (gaussian_linear_abs_bound C w.re w.im hw hw2) + (Real.rpow_nonneg (mul_nonneg hq.le (by positivity : 0 ≤ |s.im| + 2)) w.re) + simpa only [C, mul_assoc, mul_left_comm] using h + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterHadamardBounds.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterHadamardBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..acd8f1d192c9c2a464ad8381e258a254ecd74690 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterHadamardBounds.lean @@ -0,0 +1,53 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ComplexCharacterHadamard +import OAI.NumberTheory.Ostmann.ZeroDensity.LogarithmicGammaBound + +namespace OAI + +/-! # Logarithmic bounds from the actual character zero sum -/ + +namespace Ostmann + +open Complex + + theorem character_real_zero_sum_nonneg (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : 1 < s.re) : 0 ≤ characterRealZeroSum χ s := by + apply tsum_nonneg + intro i + rw [realZeroKernel_complex_sub] + exact realZeroKernel_nonneg (by linarith [((actualCharacterZeros χ).in_strip i).2]) + +theorem character_real_zero_term_le (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : 1 < s.re) (hs2 : s.re ≤ 2) (i : ℕ) : + ((s - (actualCharacterZeros χ).zeros i)⁻¹).re ≤ characterRealZeroSum χ s := by + exact (character_real_zero_summable χ s hs hs2).le_tsum i (fun j _ => by + rw [realZeroKernel_complex_sub] + exact realZeroKernel_nonneg (by linarith [((actualCharacterZeros χ).in_strip j).2])) + +theorem exists_character_zero_sum_log_bound : ∃ B : ℝ, 0 < B ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), 1 < s.re → s.re ≤ 2 → + characterRealZeroSum χ s ≤ (logDeriv χ.L s).re + + (1 / 2) * Real.log χ.modulus + B * Real.log (|s.im| + 2) := by + obtain ⟨B, hB, hb⟩ := characterGamma_logarithmic_bound + refine ⟨B, hB, ?_⟩ + intro χ s hs hs2 + rw [complex_character_hadamard_identity χ s hs hs2, + χ.completed_logDeriv_eq_add s hs.le, Complex.add_re] + have hh := (Complex.re_le_norm _).trans (hb χ s hs hs2) + linarith + +/-- Positivity of every actual zero contribution gives the uniform lower bound +for the ordinary logarithmic derivative used in the zero-free argument. -/ +theorem exists_character_logDeriv_real_lower : ∃ B : ℝ, 0 < B ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), 1 < s.re → s.re ≤ 2 → + -(1 / 2) * Real.log χ.modulus - B * Real.log (|s.im| + 2) ≤ + (logDeriv χ.L s).re := by + obtain ⟨B, hB, hb⟩ := exists_character_zero_sum_log_bound + refine ⟨B, hB, ?_⟩ + intro χ s hs hs2 + have hh := hb χ s hs hs2 + have hn := character_real_zero_sum_nonneg χ s hs + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterHeightZeroCount.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterHeightZeroCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..177b2ed8f8ae941193fcc69651a5f870d5d62351 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterHeightZeroCount.lean @@ -0,0 +1,53 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothTruncatedContour + +namespace OAI + +/-! # A polynomial bound for the finite set of forbidden contour ordinates -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +theorem criticalZerosUpTo_card_bound (χ : PrimitiveComplexCharacter) (T : ℝ) (hT : 0 ≤ T) : + ((criticalZerosUpTo χ T).card : ℝ) ≤ + (32 / Real.log (14 / 13)) * (T + 1) * Real.log ((χ.modulus : ℝ) * (T + 2)) := by + calc + _ = ∑ _z ∈ criticalZerosUpTo χ T, (1 : ℝ) := by simp + _ ≤ ∑ z ∈ criticalZerosUpTo χ T, (characterZeroOrder χ z : ℝ) := by + apply Finset.sum_le_sum + intro z hz + have he := (mem_criticalZerosUpTo.mp hz).1.2.2 + have ho := (characterZeroOrder_pos_iff χ z).mpr he + have hi : (1 : ℤ) ≤ characterZeroOrder χ z := ho + exact_mod_cast hi + _ ≤ _ := χ.full_zero_sum_rate T hT _ (by + intro z hz + obtain ⟨hz, hi⟩ := mem_criticalZerosUpTo.mp hz + exact ⟨hz.1, hz.2.1, hi⟩) + +theorem criticalZerosUpTo_card_polynomial (χ : PrimitiveComplexCharacter) : + ∃ C : ℝ, 0 < C ∧ ∀ T : ℝ, 0 ≤ T → + ((criticalZerosUpTo χ (T + 4)).card : ℝ) ≤ C * (T + 5) ^ 2 := by + let A := 32 / Real.log (14 / 13 : ℝ) + have hA : 0 < A := div_pos (by norm_num) (Real.log_pos (by norm_num)) + have hq : 0 < (χ.modulus : ℝ) := by exact_mod_cast χ.positive + refine ⟨2 * A * χ.modulus, by positivity, ?_⟩ + intro T hT + have hh := criticalZerosUpTo_card_bound χ (T + 4) (by linarith) + have hl : Real.log ((χ.modulus : ℝ) * (T + 4 + 2)) ≤ + (χ.modulus : ℝ) * (T + 4 + 2) := by + have he := Real.log_le_sub_one_of_pos + (by positivity : 0 < (χ.modulus : ℝ) * (T + 4 + 2)) + linarith + have hx : T + 4 + 2 ≤ 2 * (T + 5) := by linarith + calc + _ ≤ A * (T + 4 + 1) * Real.log ((χ.modulus : ℝ) * (T + 4 + 2)) := hh + _ ≤ A * (T + 4 + 1) * ((χ.modulus : ℝ) * (2 * (T + 5))) := by + exact mul_le_mul_of_nonneg_left + (hl.trans (mul_le_mul_of_nonneg_left hx hq.le)) (by positivity) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterIndexedRealZero.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterIndexedRealZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..39b0f0343b900a17bf3f50b61b5f6d8723c382c6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterIndexedRealZero.lean @@ -0,0 +1,51 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterRieszZeroSelection +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualLocalZeros + +namespace OAI + +/-! # An actual indexed real zero as the canonical Page-zero datum -/ + +namespace Ostmann + +noncomputable def indexedRealZero (χ : PrimitiveComplexCharacter) (i : ℕ) + (hsq : χ.character ^ 2 = 1) (him : ((actualCharacterZeros χ).zeros i).im = 0) : + PrimitiveRealZero where + modulus := χ.modulus + positive := χ.positive + character := (χ.asReal hsq).character + primitive := (χ.asReal hsq).primitive + nontrivial := (χ.asReal hsq).nontrivial + beta := ((actualCharacterZeros χ).zeros i).re + beta_pos := ((actualCharacterZeros χ).in_strip i).1 + beta_lt_one := ((actualCharacterZeros χ).in_strip i).2 + zero := by + change (χ.asReal hsq).asComplex.L (((actualCharacterZeros χ).zeros i).re : ℂ) = 0 + rw [χ.asReal_asComplex hsq] + have he : (((actualCharacterZeros χ).zeros i).re : ℂ) = (actualCharacterZeros χ).zeros i := by + apply Complex.ext <;> simp [him] + rw [he] + exact (actualCharacterZeros χ).actual_zero i + +@[simp] theorem indexedRealZero_modulus (χ : PrimitiveComplexCharacter) (i : ℕ) + (hsq : χ.character ^ 2 = 1) (him : ((actualCharacterZeros χ).zeros i).im = 0) : + (indexedRealZero χ i hsq him).modulus = χ.modulus := rfl + +@[simp] theorem indexedRealZero_beta (χ : PrimitiveComplexCharacter) (i : ℕ) + (hsq : χ.character ^ 2 = 1) (him : ((actualCharacterZeros χ).zeros i).im = 0) : + (indexedRealZero χ i hsq him).beta = ((actualCharacterZeros χ).zeros i).re := rfl + +@[simp] theorem indexedRealZero_character (χ : PrimitiveComplexCharacter) (i : ℕ) + (hsq : χ.character ^ 2 = 1) (him : ((actualCharacterZeros χ).zeros i).im = 0) : + (indexedRealZero χ i hsq him).asRealCharacter.asComplex = χ := χ.asReal_asComplex hsq + +theorem indexedRealZero_canonical (χ : PrimitiveComplexCharacter) (i : ℕ) + (hsq : χ.character ^ 2 = 1) (him : ((actualCharacterZeros χ).zeros i).im = 0) + (q : ℕ) (hq : 1 ≤ q) (hdvd : χ.modulus ∣ q) + (hnear : 1 - actualPageConstant / Real.log (4 * (q : ℝ)) ≤ + ((actualCharacterZeros χ).zeros i).re) : + actualLocalZero q = some (indexedRealZero χ i hsq him) := + actualLocalZero_complete q hq _ hdvd hnear + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterLocalZeroCount.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterLocalZeroCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..d519cf96dd73198b7577a3e6a8d74577bc24bb6a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterLocalZeroCount.lean @@ -0,0 +1,95 @@ +import Mathlib.Analysis.Complex.JensenFormula +import OAI.NumberTheory.Ostmann.Characters.CharacterMellinBound + +namespace OAI + +/-! # Local zero counts for primitive character L-functions + +Jensen's formula is applied to disks centered on Re(s)=2. The larger +radius stays in the positive half-plane; the smaller disk covers a unit +ordinate interval in the right half of the critical strip. +-/ + +namespace Ostmann + +open Metric Set MeromorphicOn +open scoped BigOperators + +noncomputable def characterZeroCenter (t : ℝ) : ℂ := 2 + (t : ℂ) * Complex.I + +@[simp] theorem characterZeroCenter_re (t : ℝ) : (characterZeroCenter t).re = 2 := by + simp [characterZeroCenter] + +@[simp] theorem characterZeroCenter_im (t : ℝ) : (characterZeroCenter t).im = t := by + simp [characterZeroCenter] + +theorem characterZeroCenter_norm (t : ℝ) : ‖characterZeroCenter t‖ ≤ 2 + |t| := by + simpa using Complex.norm_le_abs_re_add_abs_im (characterZeroCenter t) + +theorem character_disk_re (t : ℝ) (z : ℂ) + (hz : z ∈ closedBall (characterZeroCenter t) (7 / 4 : ℝ)) : 1 / 4 ≤ z.re := by + rw [mem_closedBall, dist_eq_norm] at hz + have hr := (Complex.abs_re_le_norm (z - characterZeroCenter t)).trans hz + simp only [Complex.sub_re, characterZeroCenter_re] at hr + linarith [(abs_le.mp hr).1] + +theorem character_disk_norm (t : ℝ) (z : ℂ) + (hz : z ∈ closedBall (characterZeroCenter t) (7 / 4 : ℝ)) : ‖z‖ ≤ |t| + 4 := by + rw [mem_closedBall, dist_eq_norm] at hz + have htri := norm_add_le (z - characterZeroCenter t) (characterZeroCenter t) + rw [sub_add_cancel] at htri + linarith [characterZeroCenter_norm t] + +theorem PrimitiveComplexCharacter.L_disk_bound (χ : PrimitiveComplexCharacter) + (t : ℝ) (z : ℂ) (hz : z ∈ closedBall (characterZeroCenter t) (7 / 4 : ℝ)) : + ‖χ.L z‖ ≤ 16 * (χ.modulus : ℝ) * (|t| + 2) := by + have hr := character_disk_re t z hz + have hnorm := character_disk_norm t z hz + have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive + calc + _ ≤ ‖z‖ * ((χ.modulus : ℝ) + 1) / z.re := χ.L_norm_bound_positive z (by linarith) + _ ≤ ‖z‖ * ((χ.modulus : ℝ) + 1) / (1 / 4) := + div_le_div_of_nonneg_left (by positivity) (by norm_num) hr + _ ≤ (|t| + 4) * ((χ.modulus : ℝ) + 1) / (1 / 4) := by gcongr + _ ≤ _ := by + norm_num only [div_eq_mul_inv, inv_div, inv_one] + nlinarith [abs_nonneg t, mul_nonneg (sub_nonneg.mpr hq) (abs_nonneg t)] + +noncomputable def characterLocalZeroMass (χ : PrimitiveComplexCharacter) (t : ℝ) : ℤ := + ∑ᶠ z, divisor χ.L (closedBall (characterZeroCenter t) (13 / 8 : ℝ)) z + +/-- A logarithmic zero count, including analytic multiplicity, on each local disk. -/ +theorem PrimitiveComplexCharacter.local_zero_mass_bound (χ : PrimitiveComplexCharacter) + (t : ℝ) : + (characterLocalZeroMass χ t : ℝ) ≤ + Real.log (48 * (χ.modulus : ℝ) * (|t| + 2)) / Real.log (14 / 13) := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive + have ha : AnalyticOnNhd ℂ χ.L (closedBall (characterZeroCenter t) |(7 / 4 : ℝ)|) := + fun _ _ => (DirichletCharacter.differentiable_LFunction χ.nontrivial).analyticAt _ + have hlo := χ.L_lower_re_two (characterZeroCenter t) (characterZeroCenter_re t) + have hne : χ.L (characterZeroCenter t) ≠ 0 := by + intro he + rw [he, norm_zero] at hlo + linarith + have hM : 1 ≤ 16 * (χ.modulus : ℝ) * (|t| + 2) := by + nlinarith [abs_nonneg t, mul_nonneg (sub_nonneg.mpr hq) (abs_nonneg t)] + have hj := ha.sum_divisor_le (r := (13 / 8 : ℝ)) (R := (7 / 4 : ℝ)) + (by norm_num) (by norm_num) hM hne (fun z hz => + χ.L_disk_bound t z (by simpa only [abs_of_pos (by norm_num : (0 : ℝ) < 7 / 4)] using + sphere_subset_closedBall hz)) + have hratio : (16 * (χ.modulus : ℝ) * (|t| + 2)) / ‖χ.L (characterZeroCenter t)‖ ≤ + 48 * (χ.modulus : ℝ) * (|t| + 2) := by + apply (div_le_iff₀ (by linarith : 0 < ‖χ.L (characterZeroCenter t)‖)).2 + nlinarith [mul_le_mul_of_nonneg_left hlo + (show 0 ≤ 48 * (χ.modulus : ℝ) * (|t| + 2) by positivity)] + have hlog : 0 < Real.log (14 / 13 : ℝ) := Real.log_pos (by norm_num) + have hlogratio := Real.log_le_log (div_pos (by positivity) + (by linarith : 0 < ‖χ.L (characterZeroCenter t)‖)) hratio + rw [show |(13 / 8 : ℝ)| = 13 / 8 by norm_num, + show (7 / 4 : ℝ) / (13 / 8) = 14 / 13 by norm_num] at hj + exact hj.trans (div_le_div_of_nonneg_right hlogratio hlog.le) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterNearZeroSimple.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterNearZeroSimple.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b7d6e8c131fd2958185c56cf866a8b70ac8e0f9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterNearZeroSimple.lean @@ -0,0 +1,61 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterNearZeroUnique +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroPartialSums + +namespace OAI + +/-! # Unique near-one indices have analytic multiplicity one -/ + +namespace Ostmann + +open scoped Classical + +theorem actual_character_zero_simple (χ : PrimitiveComplexCharacter) (i : ℕ) + (hunique : ∀ j : ℕ, (actualCharacterZeros χ).zeros j = (actualCharacterZeros χ).zeros i → j = i) : + analyticOrderNatAt χ.L ((actualCharacterZeros χ).zeros i) = 1 := by + let Z := actualCharacterZeros χ + let z := Z.zeros i + let T := |z.im| + have hz : z ∈ criticalZerosUpTo χ T := by + apply mem_criticalZerosUpTo.mpr + exact ⟨⟨(Z.in_strip i).1, (Z.in_strip i).2, Z.actual_zero i⟩, le_rfl⟩ + have hf := characterZeroEnumeration_fiber_card χ (faithfulCharacterZeroEquiv χ) T z hz + change ((Z.heightIndices T).filter (fun j => Z.zeros j = z)).card = analyticOrderNatAt χ.L z at hf + have hsingle : (Z.heightIndices T).filter (fun j => Z.zeros j = z) = {i} := by + ext j + simp only [Finset.mem_filter, Finset.mem_singleton] + constructor + · intro hj + exact hunique j hj.2 + · intro hj + subst j + exact ⟨(Z.mem_heightIndices T i).mpr le_rfl, rfl⟩ + rw [hsingle, Finset.card_singleton] at hf + exact hf.symm + +theorem character_near_zero_simple : ∃ c : ℝ, 0 < c ∧ + ∀ (χ : PrimitiveComplexCharacter) (T : ℝ), 2 ≤ T → + let H := Real.log χ.modulus + Real.log (T + 2) + 1 + (∀ i : ℕ, |((actualCharacterZeros χ).zeros i).im| ≤ T → + 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re → + χ.character ^ 2 = 1 ∧ ((actualCharacterZeros χ).zeros i).im = 0 ∧ + analyticOrderNatAt χ.L ((actualCharacterZeros χ).zeros i) = 1) ∧ + (∀ i j : ℕ, |((actualCharacterZeros χ).zeros i).im| ≤ T → + |((actualCharacterZeros χ).zeros j).im| ≤ T → + 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re → + 1 - c / H ≤ ((actualCharacterZeros χ).zeros j).re → i = j) := by + obtain ⟨c, hc, hdata⟩ := character_near_zero_unique + refine ⟨c, hc, ?_⟩ + intro χ T hT + obtain ⟨hreal, huniq⟩ := hdata χ T hT + refine ⟨?_, huniq⟩ + intro i hi hnear + obtain ⟨hsq, him⟩ := hreal i hi hnear + refine ⟨hsq, him, actual_character_zero_simple χ i ?_⟩ + intro j hj + apply huniq j i _ hi _ hnear + · simpa only [hj] using hi + · simpa only [hj] using hnear + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterNearZeroUnique.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterNearZeroUnique.lean new file mode 100644 index 0000000000000000000000000000000000000000..54b5736531ff6498db1d448cf2c59bf533291965 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterNearZeroUnique.lean @@ -0,0 +1,84 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.FullHeightRegionComparison + +namespace OAI + +/-! # The unique simple real zero that can enter a character's Riesz rectangle -/ + +namespace Ostmann + +theorem character_near_zero_unique : ∃ c : ℝ, 0 < c ∧ + ∀ (χ : PrimitiveComplexCharacter) (T : ℝ), 2 ≤ T → + let H := Real.log χ.modulus + Real.log (T + 2) + 1 + (∀ i : ℕ, |((actualCharacterZeros χ).zeros i).im| ≤ T → + 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re → + χ.character ^ 2 = 1 ∧ ((actualCharacterZeros χ).zeros i).im = 0) ∧ + (∀ i j : ℕ, |((actualCharacterZeros χ).zeros i).im| ≤ T → + |((actualCharacterZeros χ).zeros j).im| ≤ T → + 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re → + 1 - c / H ≤ ((actualCharacterZeros χ).zeros j).re → i = j) := by + obtain ⟨cn, hcn, hn⟩ := exists_nonquadratic_zero_free_region + obtain ⟨cr, hcr, hr⟩ := exists_full_height_real_region + let c := min (cn / 2) (cr / 2) + have hc : 0 < c := lt_min (by positivity) (by positivity) + have hcnc : c < cn := by + have hh := min_le_left (cn / 2) (cr / 2) + dsimp [c] + linarith + have hcrc : c ≤ cr := by + have hh := min_le_right (cn / 2) (cr / 2) + dsimp [c] + linarith + refine ⟨c, hc, ?_⟩ + intro χ T hT + dsimp only + let H := Real.log χ.modulus + Real.log (T + 2) + 1 + have hq : 0 ≤ Real.log χ.modulus := Real.log_nonneg (by exact_mod_cast χ.positive) + have hHp : 0 < H := by + have ht : 0 ≤ Real.log (T + 2) := Real.log_nonneg (by linarith) + dsimp [H] + linarith + by_cases hsq : χ.character ^ 2 = 1 + · have hreal := hr (χ.asReal hsq) T hT + dsimp only at hreal + simp only [realCharacterActualZeros] at hreal + rw [χ.asReal_asComplex hsq] at hreal + have hcut : c / H ≤ cr / H := div_le_div_of_nonneg_right hcrc hHp.le + constructor + · intro i hi hnear + refine ⟨hsq, ?_⟩ + apply hreal.1 i + · exact hi + · change 1 - cr / H ≤ _ + linarith + · intro i j hi hj hni hnj + apply hreal.2 i j + · exact hi + · exact hj + · change 1 - cr / H ≤ _ + linarith + · change 1 - cr / H ≤ _ + linarith + · have hnone (i : ℕ) (hi : |((actualCharacterZeros χ).zeros i).im| ≤ T) + (hnear : 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re) : False := by + let V := Real.log χ.modulus + Real.log (|((actualCharacterZeros χ).zeros i).im| + 2) + 1 + have hVp : 0 < V := by + have ht : 0 ≤ Real.log (|((actualCharacterZeros χ).zeros i).im| + 2) := + Real.log_nonneg (by linarith [abs_nonneg ((actualCharacterZeros χ).zeros i).im]) + dsimp [V] + linarith + have hVH : V ≤ H := by + have hh := Real.log_le_log (by positivity : 0 < |((actualCharacterZeros χ).zeros i).im| + 2) + (show |((actualCharacterZeros χ).zeros i).im| + 2 ≤ T + 2 by linarith) + dsimp [V, H] + linarith + have hm : cn / H ≤ cn / V := div_le_div_of_nonneg_left hcn.le hVp hVH + have hs : c / H < cn / H := (div_lt_div_iff_of_pos_right hHp).mpr hcnc + have hz := hn χ hsq i + change cn / V ≤ _ at hz + linarith + exact ⟨fun i hi hnear => (hnone i hi hnear).elim, + fun i _ hi _ hnear _ => (hnone i hi hnear).elim⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszBoundary.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszBoundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..7b77ad51cffa387664ab3c656dbea37b9b7fdf4b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszBoundary.lean @@ -0,0 +1,120 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.OneZeroBoundaryCut +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterNearZeroSimple +import OAI.NumberTheory.Ostmann.Characters.CharacterLogarithmicSeparation +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualLocalZeros + +namespace OAI + +/-! # A uniformly controlled Riesz boundary, including exceptional characters -/ + +namespace Ostmann + +open Complex + +theorem character_riesz_boundary_data : ∃ c C : ℝ, + 0 < c ∧ c ≤ 1 / 4 ∧ c ≤ actualPageConstant / 10 ∧ 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (T : ℝ), 2 ≤ T → + let H := Real.log χ.modulus + Real.log (T + 4) + 1 + (∀ i : ℕ, |((actualCharacterZeros χ).zeros i).im| ≤ T + 2 → + 1 - 4 * c / H ≤ ((actualCharacterZeros χ).zeros i).re → + χ.character ^ 2 = 1 ∧ ((actualCharacterZeros χ).zeros i).im = 0 ∧ + analyticOrderNatAt χ.L ((actualCharacterZeros χ).zeros i) = 1) ∧ + (∀ i j : ℕ, |((actualCharacterZeros χ).zeros i).im| ≤ T + 2 → + |((actualCharacterZeros χ).zeros j).im| ≤ T + 2 → + 1 - 4 * c / H ≤ ((actualCharacterZeros χ).zeros i).re → + 1 - 4 * c / H ≤ ((actualCharacterZeros χ).zeros j).re → i = j) ∧ + ∃ a : ℝ, 1 - 2 * c / H ≤ a ∧ a ≤ 1 - c / H ∧ + ∀ s : ℂ, ((s.re = a ∧ |s.im| ≤ T) ∨ + (a ≤ s.re ∧ s.re ≤ 2 ∧ |s.im| = T)) → + χ.L s ≠ 0 ∧ ‖logDeriv χ.L s‖ ≤ C * H ^ 2 := by + obtain ⟨c0, hc0, hnear⟩ := character_near_zero_simple + obtain ⟨C0, hC0, hbound⟩ := character_logDeriv_logarithmic_separation + let c := min (c0 / 4) (min (1 / 4) (actualPageConstant / 10)) + have hc : 0 < c := lt_min (by positivity) (lt_min (by norm_num) + (div_pos actualPageConstant_pos (by norm_num))) + have hc4 : c ≤ 1 / 4 := (min_le_right _ _).trans (min_le_left _ _) + have hcp : c ≤ actualPageConstant / 10 := (min_le_right _ _).trans (min_le_right _ _) + have hcc : 4 * c ≤ c0 := by + have hh := min_le_left (c0 / 4) (min (1 / 4) (actualPageConstant / 10)) + dsimp [c] + linarith + refine ⟨c, C0 * (1 + 2 / c), hc, hc4, hcp, by positivity, ?_⟩ + intro χ T hT + dsimp only + let H := Real.log χ.modulus + Real.log (T + 4) + 1 + have hq : 0 ≤ Real.log χ.modulus := Real.log_nonneg (by exact_mod_cast χ.positive) + have htlog : 0 ≤ Real.log (T + 4) := Real.log_nonneg (by linarith) + have hH : 1 ≤ H := by dsimp [H]; linarith + have hHp : 0 < H := by linarith + let δ := c / H + have hδ : 0 < δ := div_pos hc hHp + have hδ4 : δ ≤ 1 / 4 := calc + c / H ≤ c / 1 := div_le_div_of_nonneg_left hc.le (by norm_num) hH + _ ≤ 1 / 4 := by simpa using hc4 + obtain ⟨hr, hu⟩ := hnear χ (T + 2) (by linarith) + rw [show T + 2 + 2 = T + 4 by ring] at hr hu + have hfrac : 4 * c / H ≤ c0 / H := div_le_div_of_nonneg_right hcc hHp.le + have hr' (i : ℕ) (hi : |((actualCharacterZeros χ).zeros i).im| ≤ T + 2) + (hn : 1 - 4 * c / H ≤ ((actualCharacterZeros χ).zeros i).re) : + χ.character ^ 2 = 1 ∧ ((actualCharacterZeros χ).zeros i).im = 0 ∧ + analyticOrderNatAt χ.L ((actualCharacterZeros χ).zeros i) = 1 := by + apply hr i hi + change 1 - c0 / H ≤ _ + linarith + have hu' (i j : ℕ) (hi : |((actualCharacterZeros χ).zeros i).im| ≤ T + 2) + (hj : |((actualCharacterZeros χ).zeros j).im| ≤ T + 2) + (hni : 1 - 4 * c / H ≤ ((actualCharacterZeros χ).zeros i).re) + (hnj : 1 - 4 * c / H ≤ ((actualCharacterZeros χ).zeros j).re) : i = j := by + apply hu i j hi hj <;> change 1 - c0 / H ≤ _ <;> linarith + refine ⟨hr', hu', ?_⟩ + obtain ⟨a, ha, ha', hsep⟩ := one_zero_boundary_cut (actualCharacterZeros χ).zeros δ T + hδ hδ4 hT (fun i hi hn => (hr' i hi (by simpa [δ, mul_div_assoc] using hn)).2.1) + (fun i j hi hj hni hnj => hu' i j hi hj + (by simpa [δ, mul_div_assoc] using hni) (by simpa [δ, mul_div_assoc] using hnj)) + refine ⟨a, by simpa [δ, mul_div_assoc] using ha, ha', ?_⟩ + intro s hs + have hsa : a ≤ s.re := by + rcases hs with hs | hs + · exact hs.1.ge + · exact hs.1 + have hs2 : s.re ≤ 2 := by + rcases hs with hs | hs + · rw [hs.1]; linarith + · exact hs.2.1 + have hst : |s.im| ≤ T := by + rcases hs with hs | hs + · exact hs.2 + · exact hs.2.2.le + have hspos : 1 / 2 ≤ s.re := by linarith + have hdist := hsep s hs + have hne : χ.L s ≠ 0 := by + have hcn : χ.completed s ≠ 0 := by + intro hz + obtain ⟨i, hi⟩ := actualCharacterZeros_complete χ s ((χ.completed_zero_iff s).mp hz) + have hh := hdist i + rw [hi, sub_self, norm_zero] at hh + linarith + rw [χ.L_eq_completed_mul_all] + exact mul_ne_zero hcn (χ.gammaInverse_ne_zero s (by linarith)) + refine ⟨hne, ?_⟩ + have hb := hbound χ s (δ / 2) hspos hs2 (by positivity) hdist + have hlogs : Real.log χ.modulus + Real.log (|s.im| + 2) + 1 ≤ H := by + have hh := Real.log_le_log (by positivity : 0 < |s.im| + 2) + (show |s.im| + 2 ≤ T + 4 by linarith) + dsimp [H] + linarith + have hinv : (δ / 2)⁻¹ = 2 * H / c := by dsimp [δ]; field_simp + have hcost : 1 + (δ / 2)⁻¹ ≤ H * (1 + 2 / c) := by + rw [hinv] + calc + 1 + 2 * H / c ≤ H + 2 * H / c := add_le_add hH le_rfl + _ = H * (1 + 2 / c) := by ring + calc + _ ≤ C0 * H * (H * (1 + 2 / c)) := hb.trans + (mul_le_mul (mul_le_mul_of_nonneg_left hlogs hC0.le) hcost + (by positivity) (by positivity)) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszLocalBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszLocalBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..fcb16dd83924e81fba18362cd8fc72725c51959d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszLocalBound.lean @@ -0,0 +1,101 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterRieszBoundary +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterRieszZeroSelection +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterRieszResidueBound + +namespace OAI + +/-! # A uniform Riesz estimate with its actual possible real-zero term -/ + +namespace Ostmann + +open Complex + +theorem character_riesz_local_bound : ∃ c A B E : ℝ, + 0 < c ∧ c ≤ 1 / 4 ∧ c ≤ actualPageConstant / 10 ∧ 0 < A ∧ 0 < B ∧ 0 < E ∧ + ∀ (χ : PrimitiveComplexCharacter) (T : ℝ), 2 ≤ T → + let H := Real.log χ.modulus + Real.log (T + 4) + 1 + ∃ e : Option ℕ, + (∀ i, e = some i → 1 - 2 * c / H < ((actualCharacterZeros χ).zeros i).re ∧ + χ.character ^ 2 = 1 ∧ ((actualCharacterZeros χ).zeros i).im = 0) ∧ + (∀ i, 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re → + |((actualCharacterZeros χ).zeros i).im| ≤ T → e = some i) ∧ + ∀ X b : ℝ, 1 ≤ X → 1 < b → b ≤ 2 → + ‖characterRieszMean χ X - characterRieszZeroTerm χ X e‖ ≤ + A * H ^ 2 * X ^ (1 - c / H) + B * H ^ 2 * X ^ b / T ^ 2 + + 2 * (1 / (b - 1) + E) * X ^ b / T := by + obtain ⟨c, C, hc, hc4, hcp, hC, hdata⟩ := character_riesz_boundary_data + obtain ⟨K, E, hK, hE, hrect⟩ := characterRieszMean_residue_rectangle_bound + refine ⟨c, K * C, 4 * C, E, hc, hc4, hcp, by positivity, by positivity, hE, ?_⟩ + intro χ T hT + dsimp only + let H := Real.log χ.modulus + Real.log (T + 4) + 1 + have hq : 0 ≤ Real.log χ.modulus := Real.log_nonneg (by exact_mod_cast χ.positive) + have htlog : 0 ≤ Real.log (T + 4) := Real.log_nonneg (by linarith) + have hH : 1 ≤ H := by dsimp [H]; linarith + have hHp : 0 < H := by linarith + have hδ : 0 < c / H := div_pos hc hHp + have hδ4 : c / H ≤ 1 / 4 := calc + c / H ≤ c / 1 := div_le_div_of_nonneg_left hc.le (by norm_num) hH + _ ≤ 1 / 4 := by simpa using hc4 + obtain ⟨hr, hu, a, ha, ha', hedge⟩ := hdata χ T hT + change 1 - 2 * c / H ≤ a at ha + change a ≤ 1 - c / H at ha' + have ha0 : 1 / 2 ≤ a := by rw [mul_div_assoc] at ha; linarith + have ha1 : a < 1 := by linarith + have hreal (i : ℕ) (hi : a ≤ ((actualCharacterZeros χ).zeros i).re) + (hit : |((actualCharacterZeros χ).zeros i).im| ≤ T) : + χ.character ^ 2 = 1 ∧ ((actualCharacterZeros χ).zeros i).im = 0 ∧ + analyticOrderNatAt χ.L ((actualCharacterZeros χ).zeros i) = 1 := by + apply hr i (by linarith) + change 1 - 4 * c / H ≤ _ + have hh : 0 ≤ c / H := hδ.le + rw [mul_div_assoc] at ha ⊢ + linarith + have huniq (i j : ℕ) (hi : a ≤ ((actualCharacterZeros χ).zeros i).re) + (hj : a ≤ ((actualCharacterZeros χ).zeros j).re) + (hit : |((actualCharacterZeros χ).zeros i).im| ≤ T) + (hjt : |((actualCharacterZeros χ).zeros j).im| ≤ T) : i = j := by + apply hu i j (by linarith) (by linarith) + · change 1 - 4 * c / H ≤ _ + rw [mul_div_assoc] at ha ⊢ + linarith + · change 1 - 4 * c / H ≤ _ + rw [mul_div_assoc] at ha ⊢ + linarith + obtain ⟨e, he, hecomplete, heres⟩ := character_riesz_zero_selection χ a T + (by linarith) ha1 (by linarith) (fun s hs ht => (hedge s (.inl ⟨hs, ht⟩)).1) + hreal huniq + refine ⟨e, ?_, ?_, ?_⟩ + · intro i hi + obtain ⟨hai, hsq, him⟩ := he i hi + exact ⟨ha.trans_lt hai, hsq, him⟩ + · intro i hi hit + exact hecomplete i (ha'.trans hi) hit + · intro X b hX hb hb2 + have hab : a ≤ b := ha1.le.trans hb.le + have hbound (s : ℂ) (hs : (s.re = a ∧ |s.im| ≤ T) ∨ + (a ≤ s.re ∧ s.re ≤ b ∧ |s.im| = T)) : ‖logDeriv χ.L s‖ ≤ C * H ^ 2 := by + apply (hedge s _).2 + rcases hs with hs | hs + · exact .inl hs + · exact .inr ⟨hs.1, hs.2.1.trans hb2, hs.2.2⟩ + have hh := hrect χ X a b T (C * H ^ 2) (characterRieszZeroTerm χ X e) + hX ha0 hab hb hb2 (by linarith) (by positivity) + (heres X b (by linarith) hb) hbound + have hx : X ^ a ≤ X ^ (1 - c / H) := Real.rpow_le_rpow_of_exponent_le hX ha' + have hfirst := mul_le_mul_of_nonneg_left hx (show 0 ≤ K * (C * H ^ 2) by positivity) + have hlen : b - a ≤ 2 := by linarith + have hsecond := mul_le_mul_of_nonneg_left hlen + (show 0 ≤ 2 * (C * H ^ 2 * X ^ b / T ^ 2) by positivity) + calc + _ ≤ K * (C * H ^ 2) * X ^ a + + 2 * (C * H ^ 2 * X ^ b / T ^ 2) * (b - a) + + 2 * (1 / (b - 1) + E) * X ^ b / T := hh + _ ≤ K * (C * H ^ 2) * X ^ (1 - c / H) + + 2 * (C * H ^ 2 * X ^ b / T ^ 2) * 2 + + 2 * (1 / (b - 1) + E) * X ^ b / T := by linarith + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszLocalDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszLocalDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..c761693ab4f2b4d3bdd5d5d99e8e86b1453a8a13 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszLocalDecay.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterRieszLocalBound +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszExponentialParameters + +namespace OAI + +/-! # Exponential decay with the actual local exceptional-zero contribution -/ + +namespace Ostmann + +open Filter + +theorem character_riesz_height_log_bound (χ : PrimitiveComplexCharacter) (y : ℝ) + (hy : 5 ≤ y) (hχ : (χ.modulus : ℝ) ≤ Real.exp y) : + 0 < Real.log χ.modulus + Real.log (Real.exp y + 4) + 1 ∧ + Real.log χ.modulus + Real.log (Real.exp y + 4) + 1 ≤ 3 * y := by + have hq : 0 ≤ Real.log χ.modulus := Real.log_nonneg (by exact_mod_cast χ.positive) + have ht : 0 ≤ Real.log (Real.exp y + 4) := Real.log_nonneg (by linarith [Real.exp_pos y]) + refine ⟨by linarith, ?_⟩ + have hqy : Real.log χ.modulus ≤ y := by + simpa only [Real.log_exp] using Real.log_le_log (by exact_mod_cast χ.positive) hχ + have he : 4 ≤ Real.exp y := by linarith [Real.add_one_le_exp y] + have hty : Real.log (Real.exp y + 4) ≤ Real.log 2 + y := by + calc + _ ≤ Real.log (2 * Real.exp y) := Real.log_le_log (by positivity) (by linarith) + _ = _ := by rw [Real.log_mul (by norm_num) (by positivity), Real.log_exp] + linarith [Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 2)] + +theorem character_riesz_local_decay : ∃ c d : ℝ, 0 < c ∧ c ≤ 1 / 4 ∧ c ≤ actualPageConstant / 10 ∧ 0 < d ∧ + ∀ᶠ y : ℝ in atTop, ∀ χ : PrimitiveComplexCharacter, (χ.modulus : ℝ) ≤ Real.exp y → + let H := Real.log χ.modulus + Real.log (Real.exp y + 4) + 1 + ∃ e : Option ℕ, + (∀ i, e = some i → 1 - 2 * c / H < ((actualCharacterZeros χ).zeros i).re ∧ + χ.character ^ 2 = 1 ∧ ((actualCharacterZeros χ).zeros i).im = 0) ∧ + (∀ i, 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re → + |((actualCharacterZeros χ).zeros i).im| ≤ Real.exp y → e = some i) ∧ + ‖characterRieszMean χ (Real.exp (y ^ 2)) - + characterRieszZeroTerm χ (Real.exp (y ^ 2)) e‖ ≤ + 3 * Real.exp (y ^ 2 - d * y) := by + obtain ⟨c, A, B, E, hc, hc4, hcp, hA, hB, hE, hbound⟩ := character_riesz_local_bound + refine ⟨c, c / 6, hc, hc4, hcp, by positivity, ?_⟩ + filter_upwards [riesz_exponential_error c A B E hc hc4 hA.le hB.le hE.le, + eventually_ge_atTop (5 : ℝ)] with y hy hy5 + intro χ hχ + have hy0 : 0 < y := by linarith + have hT : 2 ≤ Real.exp y := by linarith [Real.add_one_le_exp y] + obtain ⟨e, he, hec, hb⟩ := hbound χ (Real.exp y) hT + refine ⟨e, he, hec, ?_⟩ + have hb1 : 1 < 1 + 1 / y ^ 2 := by + have hh : 0 < 1 / y ^ 2 := by positivity + linarith + have hb2 : 1 + 1 / y ^ 2 ≤ 2 := by + have hys : 1 ≤ y ^ 2 := by nlinarith + have hh : 1 / y ^ 2 ≤ 1 := (div_le_one (by positivity)).mpr hys + linarith + have hr := hb (Real.exp (y ^ 2)) (1 + 1 / y ^ 2) + (Real.one_le_exp (sq_nonneg y)) hb1 hb2 + obtain ⟨hH, hHy⟩ := character_riesz_height_log_bound χ y hy5 hχ + exact hr.trans (hy _ hH hHy) + +theorem character_riesz_local_sqrt_decay : ∃ c d : ℝ, 0 < c ∧ c ≤ 1 / 4 ∧ c ≤ actualPageConstant / 10 ∧ 0 < d ∧ + ∀ᶠ X : ℝ in atTop, ∀ χ : PrimitiveComplexCharacter, + (χ.modulus : ℝ) ≤ Real.exp (Real.sqrt (Real.log X)) → + let T := Real.exp (Real.sqrt (Real.log X)) + let H := Real.log χ.modulus + Real.log (T + 4) + 1 + ∃ e : Option ℕ, + (∀ i, e = some i → 1 - 2 * c / H < ((actualCharacterZeros χ).zeros i).re ∧ + χ.character ^ 2 = 1 ∧ ((actualCharacterZeros χ).zeros i).im = 0) ∧ + (∀ i, 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re → + |((actualCharacterZeros χ).zeros i).im| ≤ T → e = some i) ∧ + ‖characterRieszMean χ X - characterRieszZeroTerm χ X e‖ ≤ + 3 * X * Real.exp (-d * Real.sqrt (Real.log X)) := by + obtain ⟨c, d, hc, hc4, hcp, hd, h⟩ := character_riesz_local_decay + refine ⟨c, d, hc, hc4, hcp, hd, ?_⟩ + have ht := Real.tendsto_sqrt_atTop.comp Real.tendsto_log_atTop + filter_upwards [ht.eventually h, eventually_ge_atTop (1 : ℝ)] with X hX hX1 + have hx : 0 < X := by linarith + have heq : Real.exp ((Real.sqrt (Real.log X)) ^ 2) = X := by + rw [Real.sq_sqrt (Real.log_nonneg hX1), Real.exp_log hx] + intro χ hχ + obtain ⟨e, he, hec, hb⟩ := hX χ hχ + refine ⟨e, he, hec, ?_⟩ + dsimp only [Function.comp_apply] at hb + rw [heq, Real.exp_sub, Real.sq_sqrt (Real.log_nonneg hX1), Real.exp_log hx] at hb + simpa only [div_eq_mul_inv, ← Real.exp_neg, mul_assoc, neg_mul] using hb + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszResidueBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszResidueBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ea4324689ef41152dad16c8c2903cd9af839e15 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszResidueBound.lean @@ -0,0 +1,81 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.WeightedRieszRectangle +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszResidueTruncation + +namespace OAI + +/-! # Character Riesz bounds retaining the exact rectangle residue -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped Interval + +theorem character_logDeriv_right_continuous (χ : PrimitiveComplexCharacter) + (b : ℝ) (hb : 1 < b) : + Continuous (fun t : ℝ => -logDeriv χ.L (rieszMellinLine b t)) := by + apply continuous_iff_continuousAt.mpr + intro t + have hn := χ.L_ne_zero_one_le_re (rieszMellinLine b t) (by simpa using hb.le) + exact (((χ.L_analytic _).deriv.div (χ.L_analytic _) hn).neg.continuousAt).comp + (rieszMellinLine_continuous b).continuousAt + +theorem characterRieszMean_residue_rectangle_bound : ∃ K C : ℝ, 0 < K ∧ 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (X a b T M : ℝ) (v : ℂ), + 1 ≤ X → 1 / 2 ≤ a → a ≤ b → 1 < b → b ≤ 2 → 0 < T → 0 ≤ M → + rectangleBoundaryIntegral (fun s => -logDeriv χ.L s * rieszContourWeight X s) + a b (-T) T = I * (((2 * Real.pi : ℝ) : ℂ) * v) → + (∀ s : ℂ, ((s.re = a ∧ |s.im| ≤ T) ∨ + (a ≤ s.re ∧ s.re ≤ b ∧ |s.im| = T)) → ‖logDeriv χ.L s‖ ≤ M) → + ‖characterRieszMean χ X - v‖ ≤ K * M * X ^ a + + 2 * (M * X ^ b / T ^ 2) * (b - a) + + 2 * (1 / (b - 1) + C) * X ^ b / T := by + obtain ⟨K, hK, hleft⟩ := weightedRiesz_left_segment_bound + obtain ⟨C, hC, hright⟩ := character_logDeriv_right_pole_bound + refine ⟨K, C, hK, hC, ?_⟩ + intro χ X a b T M v hX ha hab hb hb2 hT hM hres hedge + have hXp : 0 < X := by linarith + have hlow (t : ℝ) (ht : t ∈ Icc (-T) T) : + ‖-logDeriv χ.L (rieszMellinLine a t)‖ ≤ M := by + rw [norm_neg] + apply hedge + left + exact ⟨rieszMellinLine_re _ _, by simpa [rieszMellinLine] using abs_le.mpr ht⟩ + have he (σ t : ℝ) (hσ : σ ∈ Icc a b) (ht : |t| = T) : + ‖-logDeriv χ.L ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M := by + rw [norm_neg] + apply hedge + right + simpa using And.intro hσ.1 (And.intro hσ.2 ht) + have hl := hleft (fun s => -logDeriv χ.L s) X a T M hXp ha hM hlow + have hl' : ‖∫ t in -T..T, rightRieszIntegrand χ X a t‖ ≤ K * M * X ^ a := by + simpa only [intervalIntegral.integral_of_le (show -T ≤ T by linarith), + integral_Icc_eq_integral_Ioc, rightRieszIntegrand] using hl + have hu := weightedRiesz_horizontal_segment_bound (fun s => -logDeriv χ.L s) + X a b T M hX hab (by simpa [abs_of_pos hT]) hM + (fun σ hσ => he σ T hσ (abs_of_pos hT)) + have hd := weightedRiesz_horizontal_segment_bound (fun s => -logDeriv χ.L s) + X a b (-T) M hX hab (by simpa [abs_neg, abs_of_pos hT]) hM + (fun σ hσ => he σ (-T) hσ (by rw [abs_neg, abs_of_pos hT])) + rw [neg_sq] at hd + have hv := rectangle_vertical_shift_residue_norm_bound _ a b (-T) T _ hres + have hrightBound (t : ℝ) : ‖-logDeriv χ.L (rieszMellinLine b t)‖ ≤ 1 / (b - 1) + C := by + simpa only [norm_neg, rieszMellinLine_re] using hright χ (rieszMellinLine b t) + (by simpa using hb) (by simpa using hb2) + have ht := riesz_residue_truncation (fun s => -logDeriv χ.L s) X b + (1 / (b - 1) + C) T v hXp hb.le (by positivity) hT + (character_logDeriv_right_continuous χ b hb) hrightBound + rw [← characterRieszMean_eq_vertical_logDerivative χ X b hXp hb] at ht + change ‖(∫ t in -T..T, rightRieszIntegrand χ X b t) - _‖ ≤ + ‖∫ t in -T..T, rightRieszIntegrand χ X a t‖ + _ + _ at hv + change ‖characterRieszMean χ X - v‖ ≤ + ‖(∫ t in -T..T, rightRieszIntegrand χ X b t) - ((2 * Real.pi : ℝ) : ℂ) * v‖ + _ at ht + change ‖∫ σ in a..b, -logDeriv χ.L ((σ : ℂ) + (T : ℂ) * I) * + rieszContourWeight X ((σ : ℂ) + (T : ℂ) * I)‖ ≤ _ at hu + change ‖∫ σ in a..b, -logDeriv χ.L ((σ : ℂ) + ((-T : ℝ) : ℂ) * I) * + rieszContourWeight X ((σ : ℂ) + ((-T : ℝ) : ℂ) * I)‖ ≤ _ at hd + change ‖∫ t in -T..T, rightRieszIntegrand χ X a t‖ ≤ _ at hl' + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszZeroSelection.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszZeroSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..ab4da22bf345790387c2a3b7ad52dd749481ad5c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRieszZeroSelection.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszSingleZeroRectangle +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterNearZeroSimple + +namespace OAI + +/-! # The unique actual zero contribution selected by a Riesz rectangle -/ + +namespace Ostmann + +open Complex Set +open scoped Interval + +noncomputable def characterRieszZeroTerm (χ : PrimitiveComplexCharacter) (X : ℝ) + (e : Option ℕ) : ℂ := + match e with + | none => 0 + | some i => -rieszContourWeight X ((actualCharacterZeros χ).zeros i) + +theorem character_zero_enumerated_of_re_pos (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : 0 < s.re) (hz : χ.L s = 0) : + ∃ i, (actualCharacterZeros χ).zeros i = s := by + apply actualCharacterZeros_complete + refine ⟨hs, ?_, hz⟩ + by_contra hn + exact χ.L_ne_zero_one_le_re s (not_lt.mp hn) hz + +theorem character_riesz_zero_selection (χ : PrimitiveComplexCharacter) (a T : ℝ) + (ha : 0 < a) (ha1 : a < 1) (hT : 0 < T) + (hleft : ∀ s : ℂ, s.re = a → |s.im| ≤ T → χ.L s ≠ 0) + (hreal : ∀ i : ℕ, a ≤ ((actualCharacterZeros χ).zeros i).re → + |((actualCharacterZeros χ).zeros i).im| ≤ T → + χ.character ^ 2 = 1 ∧ ((actualCharacterZeros χ).zeros i).im = 0 ∧ + analyticOrderNatAt χ.L ((actualCharacterZeros χ).zeros i) = 1) + (hunique : ∀ i j : ℕ, a ≤ ((actualCharacterZeros χ).zeros i).re → + a ≤ ((actualCharacterZeros χ).zeros j).re → + |((actualCharacterZeros χ).zeros i).im| ≤ T → + |((actualCharacterZeros χ).zeros j).im| ≤ T → i = j) : + ∃ e : Option ℕ, + (∀ i : ℕ, e = some i → a < ((actualCharacterZeros χ).zeros i).re ∧ + χ.character ^ 2 = 1 ∧ ((actualCharacterZeros χ).zeros i).im = 0) ∧ + (∀ i : ℕ, a ≤ ((actualCharacterZeros χ).zeros i).re → + |((actualCharacterZeros χ).zeros i).im| ≤ T → e = some i) ∧ + ∀ X b : ℝ, 0 < X → 1 < b → + rectangleBoundaryIntegral (fun s => -logDeriv χ.L s * rieszContourWeight X s) + a b (-T) T = I * (((2 * Real.pi : ℝ) : ℂ) * characterRieszZeroTerm χ X e) := by + classical + let Z := actualCharacterZeros χ + by_cases hex : ∃ i : ℕ, a ≤ (Z.zeros i).re ∧ |(Z.zeros i).im| ≤ T + · obtain ⟨i, hi, hit⟩ := hex + obtain ⟨hsq, him, hm⟩ := hreal i hi hit + change (Z.zeros i).im = 0 at him + have hai : a < (Z.zeros i).re := by + apply lt_of_le_of_ne hi + intro he + exact hleft (Z.zeros i) he.symm hit (Z.actual_zero i) + refine ⟨some i, ?_, ?_, ?_⟩ + · intro j hj + cases Option.some.inj hj + exact ⟨hai, hsq, him⟩ + · intro j hj hjt + rw [hunique j i hj hi hjt hit] + · intro X b hX hb + have hzeros (s : ℂ) (hs : s ∈ uIcc a b ×ℂ uIcc (-T) T) (hz : χ.L s = 0) : + s = Z.zeros i := by + have hab : a ≤ b := ha1.le.trans hb.le + have hsr : a ≤ s.re := ((uIcc_of_le hab) ▸ hs.1).1 + have hst : |s.im| ≤ T := by + apply abs_le.mpr + simpa only [uIcc_of_le (by linarith : -T ≤ T), mem_preimage, mem_Icc] using hs.2 + obtain ⟨j, hj⟩ := character_zero_enumerated_of_re_pos χ s (ha.trans_le hsr) hz + have hji := hunique j i (by simpa only [hj] using hsr) hi + (by simpa only [hj] using hst) hit + change Z.zeros j = s at hj + simpa only [hji] using hj.symm + have hr := rieszContour_single_zero_rectangle χ X hX a b (-T) T (Z.zeros i) + ha hai ((Z.in_strip i).2.trans hb) (by simpa only [him] using neg_neg_of_pos hT) + (by simpa only [him] using hT) hzeros + rw [hm] at hr + simp only [Nat.cast_one, one_mul] at hr + rw [hr] + simp only [characterRieszZeroTerm] + push_cast + ring + · refine ⟨none, by simp, ?_, ?_⟩ + · intro i hi hit + exact (hex ⟨i, hi, hit⟩).elim + · intro X b hX hb + have hab : a ≤ b := ha1.le.trans hb.le + have hzero := rieszContour_rectangle_zero χ X hX a b (-T) T ha hab + have hn (s : ℂ) (hs : s ∈ uIcc a b ×ℂ uIcc (-T) T) : χ.L s ≠ 0 := by + intro hz + have hsr : a ≤ s.re := ((uIcc_of_le hab) ▸ hs.1).1 + have hst : |s.im| ≤ T := by + apply abs_le.mpr + simpa only [uIcc_of_le (by linarith : -T ≤ T), mem_preimage, mem_Icc] using hs.2 + obtain ⟨i, hi⟩ := character_zero_enumerated_of_re_pos χ s (ha.trans_le hsr) hz + change Z.zeros i = s at hi + exact hex ⟨i, by simpa only [hi] using hsr, by simpa only [hi] using hst⟩ + rw [hzero hn] + simp [characterRieszZeroTerm] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRightZeroCount.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRightZeroCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..e0f0579de76d8cade3fa8f760e16cfdd9ba7567d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterRightZeroCount.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroCover + +namespace OAI + +/-! # Quantitative zero count in the right half of the critical strip -/ + +namespace Ostmann + +open Metric Set +open scoped BigOperators Classical + +/-- Sum of actual analytic multiplicities over any finite right-half family. -/ +theorem PrimitiveComplexCharacter.right_zero_sum_bound (χ : PrimitiveComplexCharacter) + (T : ℝ) (hT : 0 ≤ T) (S : Finset ℂ) + (hS : ∀ z ∈ S, 1 / 2 ≤ z.re ∧ z.re ≤ 1 ∧ |z.im| ≤ T) : + ∑ z ∈ S, (characterZeroOrder χ z : ℝ) ≤ + (2 * T + 2) * (Real.log (48 * (χ.modulus : ℝ) * (T + 3)) / Real.log (14 / 13)) := by + have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive + have hden : 0 < Real.log (14 / 13 : ℝ) := Real.log_pos (by norm_num) + have hpos : 0 ≤ Real.log (48 * (χ.modulus : ℝ) * (T + 3)) / Real.log (14 / 13) := by + apply div_nonneg _ hden.le + apply Real.log_nonneg + nlinarith [mul_nonneg (sub_nonneg.mpr hq) hT] + have hfiber (n : ℤ) (hn : n ∈ characterOrdinateBins T) : + ∑ z ∈ S.filter (fun z => ⌊z.im⌋ = n), (characterZeroOrder χ z : ℝ) ≤ + Real.log (48 * (χ.modulus : ℝ) * (T + 3)) / Real.log (14 / 13) := by + have hlocal := characterZeroOrder_sum_le_local χ ((n : ℝ) + 1 / 2) + (S.filter fun z => ⌊z.im⌋ = n) (by + intro z hz + obtain ⟨hzS, hzn⟩ := Finset.mem_filter.mp hz + simpa only [hzn] using character_floor_mem_disk z (hS z hzS).1 (hS z hzS).2.1) + have hlocalR : ∑ z ∈ S.filter (fun z => ⌊z.im⌋ = n), (characterZeroOrder χ z : ℝ) ≤ + (characterLocalZeroMass χ ((n : ℝ) + 1 / 2) : ℝ) := by exact_mod_cast hlocal + have hb := χ.local_zero_mass_bound ((n : ℝ) + 1 / 2) + refine (hlocalR.trans hb).trans (div_le_div_of_nonneg_right ?_ hden.le) + apply Real.log_le_log (by positivity) + apply mul_le_mul_of_nonneg_left _ (by positivity) + have hn' := characterOrdinateBins_center_bound T n hn + linarith + calc + _ = ∑ n ∈ characterOrdinateBins T, + ∑ z ∈ S.filter (fun z => ⌊z.im⌋ = n), (characterZeroOrder χ z : ℝ) := by + symm + exact Finset.sum_fiberwise_of_maps_to + (fun z hz => characterOrdinateBins_mem T z (hS z hz).2.2) _ + _ ≤ ∑ _n ∈ characterOrdinateBins T, + Real.log (48 * (χ.modulus : ℝ) * (T + 3)) / Real.log (14 / 13) := + Finset.sum_le_sum hfiber + _ = ((characterOrdinateBins T).card : ℝ) * + (Real.log (48 * (χ.modulus : ℝ) * (T + 3)) / Real.log (14 / 13)) := by simp + _ ≤ _ := mul_le_mul_of_nonneg_right (characterOrdinateBins_card T hT) hpos + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterSiegelTools.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterSiegelTools.lean new file mode 100644 index 0000000000000000000000000000000000000000..01d8e5eefc900154ec10f8f3f86a805a56218334 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterSiegelTools.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.PrimeGaps.SiegelBounds +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterComplexification + +namespace OAI + +/-! # Bridges from the proved Siegel value bound to actual real zeros + +The three reused character-analysis modules are the unchanged completed result +028 sources at f5371230bbb5024338caeeb3a6eaf46fb2cd4842. The derivative bridge +below specializes their regular Dirichlet-series bound near the line Re(s)=1. +-/ + +namespace Ostmann + +open Filter Topology Complex + + theorem real_character_quadratic {q : ℕ} [NeZero q] (χ : DirichletCharacter ℝ q) : + χ.IsQuadratic := by + intro x + by_cases hx : IsUnit x + · obtain ⟨u, rfl⟩ := hx + have hh := χ.unit_norm_eq_one u + rw [Real.norm_eq_abs] at hh + rcases abs_eq_abs.mp (hh.trans (abs_one.symm)) with h | h + · exact Or.inr (Or.inl h) + · exact Or.inr (Or.inr h) + · exact Or.inl (χ.map_nonunit hx) + + theorem character_deriv_small_power {η : ℝ} (hη : 0 < η) (hη1 : η ≤ 1 / 2) : + ∃ K : ℝ, 0 < K ∧ ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), χ ≠ 1 → + ∀ s : ℂ, 1 - η / 2 ≤ s.re → + ‖deriv χ.LFunction s‖ ≤ K * (((q : ℝ) + 2) * (‖s‖ + 2)) ^ (2 * η) := by + obtain ⟨K, hK, h⟩ := LargePrimeGaps.regularSeries_deriv_norm_small_power hη hη1 + refine ⟨K, hK, ?_⟩ + intro q _ χ hχ s hs + have he : LargePrimeGaps.regularSeries + (LargePrimeGaps.positiveCoefficients (fun n => χ (n : ZMod q))) 0 =ᶠ[𝓝 s] χ.LFunction := by + filter_upwards [(continuous_re.tendsto s).eventually + (lt_mem_nhds (by linarith : 0 < s.re))] with z hz + exact LargePrimeGaps.regularSeries_character_eq hχ hz + rw [← he.deriv_eq] + have hb := h _ 0 (q + 1) (LargePrimeGaps.positiveCoefficients_zero _) + (LargePrimeGaps.positiveCoefficients_norm_le (fun n => χ.norm_le_one _)) + (by simp) (by positivity) (fun t _ => LargePrimeGaps.discrepancy_character_bound hχ t) s hs + convert hb using 1 + congr 3 + ring + + theorem character_zero_value_bound {η K : ℝ} (hη : 0 < η) (hη1 : η ≤ 1 / 2) + (hK : 0 < K) (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q) (hχ : χ ≠ 1) + (hd : ∀ s : ℂ, 1 - η / 2 ≤ s.re → + ‖deriv χ.LFunction s‖ ≤ K * (((q : ℝ) + 2) * (‖s‖ + 2)) ^ (2 * η)) + {β : ℝ} (hβ : 1 - η / 2 ≤ β) (hβ1 : β < 1) (hz : χ.LFunction (β : ℂ) = 0) : + ‖χ.LFunction 1‖ ≤ (1 - β) * (K * 4 ^ (2 * η) * ((q : ℝ) + 2) ^ (2 * η)) := by + have hbnd : ∀ s ∈ Metric.closedBall (1 : ℂ) (η / 2), + ‖deriv χ.LFunction s‖ ≤ K * 4 ^ (2 * η) * ((q : ℝ) + 2) ^ (2 * η) := by + intro s hs + have hsD := Metric.mem_closedBall.mp hs + have hsR : 1 - η / 2 ≤ s.re := by + have hh := Complex.re_le_norm (1 - s) + rw [Complex.sub_re, Complex.one_re, ← dist_eq_norm, dist_comm] at hh + linarith + have hsN : ‖s‖ ≤ 2 := by + have hh : ‖s‖ ≤ dist s 1 + 1 := by simpa only [norm_one, sub_add_cancel, dist_eq_norm] using norm_add_le (s - 1) (1 : ℂ) + linarith + calc + _ ≤ K * (((q : ℝ) + 2) * (‖s‖ + 2)) ^ (2 * η) := hd s hsR + _ ≤ K * (((q : ℝ) + 2) * 4) ^ (2 * η) := by gcongr; nlinarith + _ = _ := by rw [Real.mul_rpow (by positivity) (by norm_num)]; ring + have hbetaMem : (β : ℂ) ∈ Metric.closedBall (1 : ℂ) (η / 2) := by + rw [Metric.mem_closedBall, dist_eq_norm, ← Complex.ofReal_one, ← Complex.ofReal_sub, + Complex.norm_real, Real.norm_eq_abs, abs_of_neg (by linarith : β - 1 < 0)] + linarith + have honeMem : (1 : ℂ) ∈ Metric.closedBall (1 : ℂ) (η / 2) := by + simp only [Metric.mem_closedBall, dist_self] + positivity + have hh := (convex_closedBall (1 : ℂ) (η / 2)).norm_image_sub_le_of_norm_deriv_le + (fun s _ => (DirichletCharacter.differentiable_LFunction hχ s)) hbnd hbetaMem honeMem + rw [hz, sub_zero] at hh + have hnorm : ‖(1 : ℂ) - (β : ℂ)‖ = 1 - β := by + rw [← Complex.ofReal_one, ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (by linarith : 0 < 1 - β)] + rw [hnorm] at hh + nlinarith [hh] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterTrivialZero.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterTrivialZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..96483e38cb76f67c64203fe4969789716eb6aea9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterTrivialZero.lean @@ -0,0 +1,77 @@ +import Mathlib.NumberTheory.LSeries.Nonvanishing +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroReflection + +namespace OAI + +/-! # The residue at the origin in the primitive explicit formula -/ + +namespace Ostmann + +open Filter +open scoped Topology Classical + +theorem gammaReal_inverse_factor (s : ℂ) : + (Complex.Gammaℝ s)⁻¹ = s * ((2 * (Real.pi : ℂ))⁻¹ * (Complex.Gammaℝ (s + 2))⁻¹) := by + by_cases hs : s = 0 + · subst s + simp [Complex.Gammaℝ_def, Complex.Gamma_zero] + rw [Complex.Gammaℝ_add_two hs] + simp [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm, hs, + Complex.ofReal_ne_zero.mpr Real.pi_ne_zero] + +theorem gammaReal_inverse_order_zero : + analyticOrderAt (fun s : ℂ => (Complex.Gammaℝ s)⁻¹) 0 = 1 := by + let H : ℂ → ℂ := fun s => (2 * (Real.pi : ℂ))⁻¹ * (Complex.Gammaℝ (s + 2))⁻¹ + have hH : AnalyticAt ℂ H 0 := + ((Complex.differentiable_Gammaℝ_inv.comp (differentiable_id.add_const 2)).const_mul _).analyticAt 0 + have hHne : H 0 ≠ 0 := by + dsimp only [H] + exact mul_ne_zero (inv_ne_zero (mul_ne_zero two_ne_zero (by exact_mod_cast Real.pi_ne_zero))) + (inv_ne_zero (Complex.Gammaℝ_ne_zero_of_re_pos (by norm_num))) + have he : (fun s : ℂ => (Complex.Gammaℝ s)⁻¹) = (fun s => s) * H := by + funext s + exact gammaReal_inverse_factor s + rw [he] + change analyticOrderAt (id * H) 0 = 1 + rw [analyticOrderAt_mul analyticAt_id hH, hH.analyticOrderAt_eq_zero.mpr hHne, add_zero] + simp + +theorem PrimitiveComplexCharacter.completed_order_zero (χ : PrimitiveComplexCharacter) : + analyticOrderAt χ.completed 0 = 0 := by + rw [show (0 : ℂ) = 1 - 1 by ring, χ.completed_order_reflection] + rw [← χ.inverse.L_order_eq_completed 1 (by norm_num)] + apply (χ.inverse.L_analytic 1).analyticOrderAt_eq_zero.mpr + let : NeZero χ.inverse.modulus := ⟨χ.inverse.positive.ne'⟩ + exact DirichletCharacter.LFunction_apply_one_ne_zero χ.inverse.nontrivial + +theorem PrimitiveComplexCharacter.L_order_at_zero (χ : PrimitiveComplexCharacter) : + analyticOrderAt χ.L 0 = if χ.character.Even then 1 else 0 := by + classical + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have hq : χ.modulus ≠ 1 := fun h => χ.nontrivial (DirichletCharacter.level_one' χ.character h) + have he : χ.L = χ.completed * χ.gammaInverse := by + funext s + exact (DirichletCharacter.LFunction_eq_completed_div_gammaFactor χ.character s (.inr hq)).trans + (div_eq_mul_inv _ _) + rw [he, analyticOrderAt_mul (χ.completed_analytic 0) (χ.gammaInverse_analytic 0), + χ.completed_order_zero, zero_add] + by_cases hχ : χ.character.Even + · simp only [hχ, ↓reduceIte] + change analyticOrderAt (fun s => (DirichletCharacter.gammaFactor χ.character s)⁻¹) 0 = 1 + simp_rw [hχ.gammaFactor_def] + exact gammaReal_inverse_order_zero + · simp only [hχ, ↓reduceIte] + apply (χ.gammaInverse_analytic 0).analyticOrderAt_eq_zero.mpr + simp [PrimitiveComplexCharacter.gammaInverse, DirichletCharacter.gammaFactor, hχ, + Complex.Gammaℝ_one] + +theorem PrimitiveComplexCharacter.L_multiplicity_at_zero (χ : PrimitiveComplexCharacter) : + analyticOrderNatAt χ.L 0 = if χ.character (-1) = 1 then 1 else 0 := by + classical + unfold analyticOrderNatAt + rw [χ.L_order_at_zero] + split_ifs <;> simp_all [DirichletCharacter.Even] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroCopies.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroCopies.lean new file mode 100644 index 0000000000000000000000000000000000000000..669364af84472b92e65d0eb571a8c8763311dc0c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroCopies.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterEnumerationCount + +namespace OAI + +/-! # The actual zero set with multiplicity labels + +Each copy is a genuine zero together with an integer smaller than its analytic +order. Any bijective numbering of these copies automatically has the correct +multiplicity bound and finite bounded-height ranges. +-/ + +namespace Ostmann + +open Set +open scoped Classical + +abbrev CharacterZeroCopy (χ : PrimitiveComplexCharacter) := + {p : ℂ × ℕ // p.1 ∈ complexCharacterZeros χ ∧ p.2 < analyticOrderNatAt χ.L p.1} + +theorem characterZeroCopy_finite_height (χ : PrimitiveComplexCharacter) (T : ℝ) : + {c : CharacterZeroCopy χ | |c.val.1.im| ≤ T}.Finite := by + let V : Set (ℂ × ℕ) := ⋃ z ∈ {z : ℂ | z ∈ complexCharacterZeros χ ∧ |z.im| ≤ T}, + ({z} ×ˢ {n : ℕ | n < analyticOrderNatAt χ.L z}) + have hV : V.Finite := (χ.strip_zeros_finite T).biUnion + (fun z _ => (finite_singleton z).prod (finite_lt_nat _)) + apply (hV.preimage (fun _ _ _ _ h => Subtype.ext h)).subset + intro c hc + exact Set.mem_iUnion.mpr ⟨c.val.1, Set.mem_iUnion.mpr + ⟨⟨c.property.1, hc⟩, ⟨rfl, c.property.2⟩⟩⟩ + +noncomputable def characterZeroEnumeration (χ : PrimitiveComplexCharacter) + (e : ℕ ≃ CharacterZeroCopy χ) : ComplexZeroEnumeration χ where + zeros i := (e i).val.1 + in_strip i := ⟨(e i).property.1.1, (e i).property.1.2.1⟩ + actual_zero i := (e i).property.1.2.2 + finite_height T := (characterZeroCopy_finite_height χ T).preimage + (fun _ _ _ _ h => e.injective h) + +theorem characterZeroEnumeration_respectsMultiplicity (χ : PrimitiveComplexCharacter) + (e : ℕ ≃ CharacterZeroCopy χ) : (characterZeroEnumeration χ e).RespectsMultiplicity := by + intro S z + change (S.filter (fun i => (e i).val.1 = z)).card ≤ analyticOrderNatAt χ.L z + rw [← Finset.card_range (analyticOrderNatAt χ.L z)] + apply Finset.card_le_card_of_injOn (fun i => (e i).val.2) + · intro i hi + have hzi := (Finset.mem_filter.mp hi).2 + have hbound := (e i).property.2 + rw [hzi] at hbound + exact Finset.mem_range.mpr hbound + · intro i hi j hj hindex + apply e.injective + apply Subtype.ext + exact Prod.ext ((Finset.mem_filter.mp hi).2.trans (Finset.mem_filter.mp hj).2.symm) hindex + +/-- Every genuine zero and every one of its multiplicity labels occurs once. -/ +theorem characterZeroEnumeration_complete (χ : PrimitiveComplexCharacter) + (e : ℕ ≃ CharacterZeroCopy χ) (z : ℂ) (hz : z ∈ complexCharacterZeros χ) + (k : ℕ) (hk : k < analyticOrderNatAt χ.L z) : + ∃! i : ℕ, (e i).val = (z, k) := by + let c : CharacterZeroCopy χ := ⟨(z, k), hz, hk⟩ + refine ⟨e.symm c, ?_, ?_⟩ + · simp [c] + · intro i hi + apply e.injective + apply Subtype.ext + simpa [c] using hi + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroCountRate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroCountRate.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a1c1cca860019dd012fbc065571bb8349e4a06c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroCountRate.lean @@ -0,0 +1,45 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterRightZeroCount + +namespace OAI + +/-! # Standard conductor-height form of the right-half zero count -/ + +namespace Ostmann + +open scoped BigOperators + +theorem character_zero_log_cost (q T : ℝ) (hq : 1 ≤ q) (hT : 0 ≤ T) : + Real.log (48 * q * (T + 3)) ≤ 8 * Real.log (q * (T + 2)) := by + have hx : 2 ≤ q * (T + 2) := by nlinarith [mul_nonneg (sub_nonneg.mpr hq) hT] + have hpow : (2 : ℝ) ^ 7 ≤ (q * (T + 2)) ^ 7 := pow_le_pow_left₀ (by norm_num) hx 7 + have hy : 48 * q * (T + 3) ≤ 72 * (q * (T + 2)) := by + nlinarith [mul_nonneg (show 0 ≤ q by linarith) hT] + have hfinal : 48 * q * (T + 3) ≤ (q * (T + 2)) ^ 8 := by + calc + _ ≤ 72 * (q * (T + 2)) := hy + _ ≤ 2 ^ 7 * (q * (T + 2)) := by nlinarith + _ ≤ (q * (T + 2)) ^ 7 * (q * (T + 2)) := + mul_le_mul_of_nonneg_right hpow (by linarith) + _ = _ := by ring + have hl := Real.log_le_log (show 0 < 48 * q * (T + 3) by positivity) hfinal + simpa [Real.log_pow] using hl + +/-- The uniform ordinary zero-count rate on the right half of the critical strip. -/ +theorem PrimitiveComplexCharacter.right_zero_sum_rate (χ : PrimitiveComplexCharacter) + (T : ℝ) (hT : 0 ≤ T) (S : Finset ℂ) + (hS : ∀ z ∈ S, 1 / 2 ≤ z.re ∧ z.re ≤ 1 ∧ |z.im| ≤ T) : + ∑ z ∈ S, (characterZeroOrder χ z : ℝ) ≤ + (16 / Real.log (14 / 13)) * (T + 1) * Real.log ((χ.modulus : ℝ) * (T + 2)) := by + have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive + have hden : 0 ≤ Real.log (14 / 13 : ℝ) := (Real.log_pos (by norm_num)).le + calc + _ ≤ (2 * T + 2) * (Real.log (48 * (χ.modulus : ℝ) * (T + 3)) / Real.log (14 / 13)) := + χ.right_zero_sum_bound T hT S hS + _ ≤ (2 * T + 2) * (8 * Real.log ((χ.modulus : ℝ) * (T + 2)) / Real.log (14 / 13)) := + mul_le_mul_of_nonneg_left + (div_le_div_of_nonneg_right (character_zero_log_cost _ _ hq hT) hden) (by linarith) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroCover.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c9de5ed97620e6b9e5d8bee9d07170f2fde7eac --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroCover.lean @@ -0,0 +1,59 @@ +import Mathlib.Data.Int.Interval +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroMultiplicity + +namespace OAI + +/-! # Covering the right critical half-strip by Jensen disks -/ + +namespace Ostmann + +open Metric Set +open scoped BigOperators Classical + +theorem character_strip_mem_disk (z : ℂ) (t : ℝ) + (hr : 1 / 2 ≤ z.re) (hr' : z.re ≤ 1) (hi : |z.im - t| ≤ 1 / 2) : + z ∈ closedBall (characterZeroCenter t) (13 / 8 : ℝ) := by + rw [mem_closedBall, dist_eq_norm] + have hs : ‖z - characterZeroCenter t‖ ^ 2 = (z.re - 2) ^ 2 + (z.im - t) ^ 2 := by + rw [Complex.sq_norm] + simp [Complex.normSq_apply, Complex.sub_re, Complex.sub_im, pow_two] + have hire := abs_le.mp hi + have hprod := mul_nonneg (show 0 ≤ z.re - 1 / 2 by linarith) + (show 0 ≤ 1 - z.re by linarith) + have hiprod := mul_nonneg (show 0 ≤ 1 / 2 - (z.im - t) by linarith) + (show 0 ≤ 1 / 2 + (z.im - t) by linarith) + nlinarith [norm_nonneg (z - characterZeroCenter t)] + +noncomputable def characterOrdinateBins (T : ℝ) : Finset ℤ := + Finset.Icc ⌊-T⌋ ⌊T⌋ + +theorem characterOrdinateBins_mem (T : ℝ) (z : ℂ) (hz : |z.im| ≤ T) : + ⌊z.im⌋ ∈ characterOrdinateBins T := by + exact Finset.mem_Icc.mpr ⟨Int.floor_mono (abs_le.mp hz).1, Int.floor_mono (abs_le.mp hz).2⟩ + +theorem characterOrdinateBins_card (T : ℝ) (hT : 0 ≤ T) : + ((characterOrdinateBins T).card : ℝ) ≤ 2 * T + 2 := by + have hle : ⌊-T⌋ ≤ ⌊T⌋ + 1 := by + have h := Int.floor_mono (show -T ≤ T by linarith) + omega + have hc := Int.card_Icc_of_le _ _ hle + have hc' : ((characterOrdinateBins T).card : ℝ) = (⌊T⌋ : ℝ) + 1 - (⌊-T⌋ : ℝ) := by + exact_mod_cast hc + rw [hc'] + linarith [Int.floor_le T, Int.lt_floor_add_one (-T)] + +theorem characterOrdinateBins_center_bound (T : ℝ) (n : ℤ) + (hn : n ∈ characterOrdinateBins T) : |(n : ℝ) + 1 / 2| ≤ T + 1 := by + obtain ⟨hlo, hhi⟩ := Finset.mem_Icc.mp hn + have hlo' : (⌊-T⌋ : ℝ) ≤ n := by exact_mod_cast hlo + have hhi' : (n : ℝ) ≤ ⌊T⌋ := by exact_mod_cast hhi + exact abs_le.mpr ⟨by linarith [Int.lt_floor_add_one (-T)], by linarith [Int.floor_le T]⟩ + +theorem character_floor_mem_disk (z : ℂ) (hr : 1 / 2 ≤ z.re) (hr' : z.re ≤ 1) : + z ∈ closedBall (characterZeroCenter ((⌊z.im⌋ : ℝ) + 1 / 2)) (13 / 8 : ℝ) := by + apply character_strip_mem_disk z _ hr hr' + exact abs_le.mpr ⟨by linarith [Int.floor_le z.im], by linarith [Int.lt_floor_add_one z.im]⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroDiagonal.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroDiagonal.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e9ac12efef525853c1083a58808108b1c1eada6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroDiagonal.lean @@ -0,0 +1,61 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterLiteralDiagonal + +namespace OAI + +/-! # At depth zero every compatible matching preserves the empty anchor code -/ +namespace Ostmann +open scoped Classical BigOperators + +theorem constituentMatchingFamily_empty {I D : Type*} [Fintype I] [Fintype D] + (role : I → CopyScheduleRole) (size : I → ℕ) + (χ : (Σ i, Fin (size i)) → ∀ p : ℕ, DirichletCharacter ℂ p) + (κ : (Σ i, Fin (size i)) → ℕ → ℂ) (pivot : ℕ → (Σ i, Fin (size i))) + (n : ℕ) (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) + (Q : (Σ i, Fin (size i)) → Finset ℕ) + (childBound pivotBound : ℕ → ℕ) (ranges : (j : ℕ) → List (ScheduleAtomRange role j)) + (leaf : ScheduleAtomState role → ℤ → ℂ) (hist : D → FrequencyTree ℤ n) (M : ℕ) : + constituentMatchingFamily role size χ κ pivot n P hP Q childBound pivotBound ranges + leaf hist ∅ M = 0 := by + simp only [constituentMatchingFamily, Finset.sum_empty, mul_zero, Finset.sum_const_zero] + +theorem character_literal_diagonal_zero {k : ℕ} (m : ℕ) (r : Fin k → ℕ) (f : ℕ) + (Q : Fin (m + 1) → Finset ℕ) (U : Finset ℕ) + (R : (v : CharacterCell k) → Fin (characterCellSize r f v) → Finset ℕ) + (hQ : ∀ i : Fin m, Q i.succ = U) (htop : Disjoint U (Q 0)) + (hR : ∀ v i, Disjoint U (R v i)) + (χ : (Σ v, Fin (characterSize m r f v)) → ∀ p : ℕ, DirichletCharacter ℂ p) + (κ : (Σ v, Fin (characterSize m r f v)) → ℕ → ℂ) + (pivot : ℕ → (Σ v, Fin (characterSize m r f v))) + (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) + (J : ℕ) (hJ : 0 < J) (cellLo cellHi : CharacterCell k → ℕ) + (V cap : ℕ → ℕ) (leaf : ScheduleAtomState (characterRole k) → ℤ → ℂ) + (center : ∀ p : ℕ, ZMod p) (p : CharacterRole k) + (hlarge : ∀ q ∈ P, V 0 < q) : + let lo := initialWordAtomLower J cellLo + let hi := initialWordAtomUpper J cellHi + let Q₀ := characterFullPrimeCells m r f Q R + let ρ := fun i : Σ v, Fin (characterSize m r f v) => characterRole k i.1 + let A := selectedAnchorMatchingSet ρ 0 m (characterBulk m r f) (characterBulk_role m r f) + scheduledConstituentDiagonal (characterRole k) (characterSize m r f) χ κ pivot P hP Q₀ + lo hi V cap leaf center p 0 = + ∑ M ∈ Finset.Icc (lo p) (hi p), + (constituentMatchingFamily (characterRole k) (characterSize m r f) χ κ pivot 0 P hP Q₀ + V cap (atomIntervalRanges (characterRole k) lo hi) leaf + (scheduledFrequencyHistory V 0) A M).re := by + have h := character_literal_diagonal_split m r f 0 Q U R hQ htop hR χ κ pivot P hP + J hJ cellLo cellHi V cap leaf center p hlarge + dsimp only at h ⊢ + have he : cellPreservingMatchings (selectedBulkLabel + (fun i : Σ v, Fin (characterSize m r f v) => characterRole k i.1) 0 m + (characterBulk m r f) (characterBulk_role m r f)) \ + selectedAnchorMatchingSet + (fun i : Σ v, Fin (characterSize m r f v) => characterRole k i.1) 0 m + (characterBulk m r f) (characterBulk_role m r f) = ∅ := by + rw [selectedAnchorMatchingSet_zero, Finset.sdiff_self] + rw [he] at h + simpa only [constituentMatchingFamily_empty, Complex.zero_re, Finset.sum_const_zero, + add_zero] using h + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroFreeLogDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroFreeLogDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..677b9f596a25f9fd86ea006e66b505b41f608112 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroFreeLogDerivative.lean @@ -0,0 +1,108 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterLogarithmicSeparation +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualComplexZeroRegion + +namespace OAI + +/-! # Uniform logarithmic derivatives in the zero-free rectangle + +One exceptional character is omitted. All other primitive characters have +an explicit log-squared bound on the right-hand contour rectangle. +-/ + +namespace Ostmann + +open Complex + +theorem character_zero_free_logDeriv_data : ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ + ∀ Q : ℕ, 101 ≤ Q → ∀ T : ℝ, 2 ≤ T → + ∃ exception : Option PrimitiveComplexCharacter, + ∀ χ : PrimitiveComplexCharacter, χ.modulus ≤ Q → some χ ≠ exception → + ∀ s : ℂ, 1 - c / Real.log (2 * (Q : ℝ) * (T + 2)) ≤ s.re → s.re ≤ 2 → + |s.im| ≤ T → χ.L s ≠ 0 ∧ ‖logDeriv χ.L s‖ ≤ + C * (Real.log (2 * (Q : ℝ) * (T + 2))) ^ 2 := by + obtain ⟨c0, hc0, hregion⟩ := actualComplexZeroRegion + obtain ⟨C0, hC0, hsepbound⟩ := character_logDeriv_logarithmic_separation + let c := min (c0 / 4) (1 / 4) + have hc : 0 < c := lt_min (by positivity) (by norm_num) + have hcc0 : 4 * c ≤ c0 := by have hh := min_le_left (c0 / 4) (1 / 4); dsimp [c]; linarith + have hcquarter : c ≤ 1 / 4 := min_le_right _ _ + refine ⟨c, 3 * C0 * (1 + c⁻¹), hc, by positivity, ?_⟩ + intro Q hQ T hT + obtain ⟨exception, hexception⟩ := hregion Q hQ (T + 2) (by linarith) + refine ⟨exception, ?_⟩ + intro χ hχ hne s hs hs2 ht + let H := Real.log (2 * (Q : ℝ) * (T + 2)) + have hH : 1 ≤ H := conductor_height_log_ge_one Q (by omega) (T + 2) (by linarith) + have hHp : 0 < H := by linarith + let δ := c / H + have hδ : 0 < δ := div_pos hc hHp + have hδquarter : δ ≤ 1 / 4 := by + calc + c / H ≤ c / 1 := div_le_div_of_nonneg_left hc.le (by norm_num) hH + _ ≤ 1 / 4 := by simpa using hcquarter + have hspos : 1 / 2 ≤ s.re := by change 1 - δ ≤ s.re at hs; linarith + have hsep (i : ℕ) : δ ≤ ‖s - (actualCharacterZeros χ).zeros i‖ := by + by_cases hi : |((actualCharacterZeros χ).zeros i).im| ≤ T + 2 + · have hzero := hexception χ hχ hne i hi + have hfrac : 4 * δ ≤ c0 / H := by + change 4 * (c / H) ≤ c0 / H + rw [← mul_div_assoc] + exact div_le_div_of_nonneg_right hcc0 hHp.le + have hre : δ ≤ (s - (actualCharacterZeros χ).zeros i).re := by + change 1 - δ ≤ s.re at hs + change c0 / H ≤ _ at hzero + simp only [Complex.sub_re] + linarith + exact hre.trans (Complex.re_le_norm _) + · have hi' : T + 2 < |((actualCharacterZeros χ).zeros i).im| := lt_of_not_ge hi + have htri := abs_add_le (s.im - ((actualCharacterZeros χ).zeros i).im) (-s.im) + have hdist := Complex.abs_im_le_norm (s - (actualCharacterZeros χ).zeros i) + rw [show s.im - ((actualCharacterZeros χ).zeros i).im + -s.im = + -((actualCharacterZeros χ).zeros i).im by ring, abs_neg, abs_neg] at htri + simp only [Complex.sub_im] at hdist + linarith + have hcn : χ.completed s ≠ 0 := by + intro hz + obtain ⟨i, hi⟩ := actualCharacterZeros_complete χ s ((χ.completed_zero_iff s).mp hz) + have hh := hsep i + rw [hi, sub_self, norm_zero] at hh + linarith + refine ⟨?_, ?_⟩ + · rw [χ.L_eq_completed_mul_all] + exact mul_ne_zero hcn (χ.gammaInverse_ne_zero s (by linarith)) + · have hb := hsepbound χ s δ hspos hs2 hδ hsep + + have hQr : (1 : ℝ) ≤ Q := by exact_mod_cast (show 1 ≤ Q by omega) + have hqlog : Real.log χ.modulus ≤ H := by + apply Real.log_le_log (by exact_mod_cast χ.positive) + have hh : (χ.modulus : ℝ) ≤ Q := by exact_mod_cast hχ + nlinarith + have htlog : Real.log (|s.im| + 2) ≤ H := by + apply Real.log_le_log (by positivity) + nlinarith [abs_nonneg s.im] + have hlogs : Real.log χ.modulus + Real.log (|s.im| + 2) + 1 ≤ 3 * H := by linarith + have hdinv : δ⁻¹ = H * c⁻¹ := by dsimp [δ]; rw [inv_div]; ring + have hcost : 1 + δ⁻¹ ≤ H * (1 + c⁻¹) := by rw [hdinv]; nlinarith + calc + _ ≤ C0 * (3 * H) * (H * (1 + c⁻¹)) := by + apply hb.trans + exact mul_le_mul (mul_le_mul_of_nonneg_left hlogs hC0.le) hcost + (by positivity) (by positivity) + _ = _ := by dsimp [H]; ring + +theorem character_zero_free_logDeriv_bound : ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ + ∀ Q : ℕ, 101 ≤ Q → ∀ T : ℝ, 2 ≤ T → + ∃ exception : Option PrimitiveComplexCharacter, + ∀ χ : PrimitiveComplexCharacter, χ.modulus ≤ Q → some χ ≠ exception → + ∀ s : ℂ, 1 - c / Real.log (2 * (Q : ℝ) * (T + 2)) ≤ s.re → s.re ≤ 2 → + |s.im| ≤ T → ‖logDeriv χ.L s‖ ≤ + C * (Real.log (2 * (Q : ℝ) * (T + 2))) ^ 2 := by + obtain ⟨c, C, hc, hC, h⟩ := character_zero_free_logDeriv_data + refine ⟨c, C, hc, hC, ?_⟩ + intro Q hQ T hT + obtain ⟨e, he⟩ := h Q hQ T hT + exact ⟨e, fun χ hχ hne s hs hs2 ht => (he χ hχ hne s hs hs2 ht).2⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroInverseSquare.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroInverseSquare.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a42a21a7bcf766af23e4312ea1513ce6bf3455a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroInverseSquare.lean @@ -0,0 +1,31 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.InverseSquareZeroSum +import OAI.NumberTheory.Ostmann.Characters.CharacterFaithfulEnumeration + +namespace OAI + +/-! # Square-decaying sums over the actual character zeros -/ + +namespace Ostmann + +open scoped Classical BigOperators + +theorem character_zero_inverse_square_summable (χ : PrimitiveComplexCharacter) : + Summable (fun i => ((1 + |((actualCharacterZeros χ).zeros i).im|) ^ 2)⁻¹) := by + let Z := actualCharacterZeros χ + let K : ℝ := 32 / Real.log (14 / 13) + have hK : 0 ≤ K := div_nonneg (by norm_num) (Real.log_nonneg (by norm_num)) + have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive + apply inverse_square_weights_summable (fun i => |(Z.zeros i).im|) χ.modulus K hq hK + (fun _ => abs_nonneg _) + intro S t ht + have hsub : S.filter (fun i => |(Z.zeros i).im| ≤ t) ⊆ Z.heightIndices t := by + intro i hi + exact (Z.mem_heightIndices t i).mpr (Finset.mem_filter.mp hi).2 + have hc := Z.count_bound_of_multiplicity (actualCharacterZeros_respectsMultiplicity χ) t ht + rw [Z.count_zero_eq_card] at hc + exact (show (((S.filter (fun i => |(Z.zeros i).im| ≤ t)).card : ℝ)) ≤ + (Z.heightIndices t).card from by exact_mod_cast Finset.card_le_card hsub).trans hc + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroMultiplicity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroMultiplicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf66d2a77162c33fb95720e7c8a988e6b193e0eb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroMultiplicity.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterLocalZeroCount + +namespace OAI + +/-! # Actual analytic multiplicities of character zeros + +The divisor on the whole plane is used consistently, so local disk counts +and later sums over finitely many zeros count the same multiplicities. +-/ + +namespace Ostmann + +open Metric Set MeromorphicOn +open scoped BigOperators Classical + +theorem PrimitiveComplexCharacter.L_analytic (χ : PrimitiveComplexCharacter) (z : ℂ) : + AnalyticAt ℂ χ.L z := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + exact (DirichletCharacter.differentiable_LFunction χ.nontrivial).analyticAt z + +theorem PrimitiveComplexCharacter.L_order_ne_top (χ : PrimitiveComplexCharacter) (z : ℂ) : + analyticOrderAt χ.L z ≠ ⊤ := by + intro h + have he := (AnalyticOnNhd.analyticOrderAt_eq_top_iff_eq_zero z χ.L_analytic).mp h + have hn := χ.L_lower_re_two (2 : ℂ) (by norm_num) + rw [he] at hn + norm_num at hn + +noncomputable def characterZeroOrder (χ : PrimitiveComplexCharacter) (z : ℂ) : ℤ := + divisor χ.L univ z + +theorem characterZeroOrder_nonneg (χ : PrimitiveComplexCharacter) (z : ℂ) : + 0 ≤ characterZeroOrder χ z := + (show AnalyticOnNhd ℂ χ.L univ from fun z _ => χ.L_analytic z).divisor_nonneg z + +theorem characterZeroOrder_eq_local (χ : PrimitiveComplexCharacter) (t : ℝ) (z : ℂ) + (hz : z ∈ closedBall (characterZeroCenter t) (13 / 8 : ℝ)) : + characterZeroOrder χ z = + divisor χ.L (closedBall (characterZeroCenter t) (13 / 8 : ℝ)) z := by + simp only [characterZeroOrder, AnalyticOnNhd.divisor_apply + (show AnalyticOnNhd ℂ χ.L univ from fun z _ => χ.L_analytic z) (mem_univ z), + AnalyticOnNhd.divisor_apply + (show AnalyticOnNhd ℂ χ.L (closedBall (characterZeroCenter t) (13 / 8 : ℝ)) from + fun z _ => χ.L_analytic z) hz] + +theorem characterZeroOrder_sum_le_local (χ : PrimitiveComplexCharacter) (t : ℝ) + (S : Finset ℂ) (hS : ∀ z ∈ S, z ∈ closedBall (characterZeroCenter t) (13 / 8 : ℝ)) : + ∑ z ∈ S, characterZeroOrder χ z ≤ characterLocalZeroMass χ t := by + let D := divisor χ.L (closedBall (characterZeroCenter t) (13 / 8 : ℝ)) + have hfin := D.finiteSupport (isCompact_closedBall (characterZeroCenter t) (13 / 8 : ℝ)) + have hnonneg : ∀ z, 0 ≤ D z := + (show AnalyticOnNhd ℂ χ.L (closedBall (characterZeroCenter t) (13 / 8 : ℝ)) from + fun z _ => χ.L_analytic z).divisor_nonneg + calc + _ = ∑ z ∈ S, D z := Finset.sum_congr rfl (fun z hz => characterZeroOrder_eq_local χ t z (hS z hz)) + _ ≤ ∑ z ∈ S ∪ hfin.toFinset, D z := by + apply Finset.sum_le_sum_of_subset_of_nonneg Finset.subset_union_left + intro z _ _ + exact hnonneg z + _ = ∑ᶠ z, D z := by + symm + apply finsum_eq_sum_of_support_subset + intro z hz + exact Finset.mem_union_right _ (hfin.mem_toFinset.mpr hz) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroPartialSums.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroPartialSums.lean new file mode 100644 index 0000000000000000000000000000000000000000..b21fe6a6a42e711cef3cfdee69a99ae7460bf413 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroPartialSums.lean @@ -0,0 +1,81 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroCopies +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothTruncatedContour + +namespace OAI + +/-! # Identifying the finite contour zero sum with the true zero enumeration -/ + +namespace Ostmann + +open Filter +open scoped Topology BigOperators Classical + +theorem characterZeroEnumeration_fiber_card (χ : PrimitiveComplexCharacter) + (e : ℕ ≃ CharacterZeroCopy χ) (T : ℝ) (z : ℂ) + (hz : z ∈ criticalZerosUpTo χ T) : + (((characterZeroEnumeration χ e).heightIndices T).filter + (fun i => (characterZeroEnumeration χ e).zeros i = z)).card = analyticOrderNatAt χ.L z := by + have hz' := mem_criticalZerosUpTo.mp hz + let Z := characterZeroEnumeration χ e + calc + _ = (Finset.range (analyticOrderNatAt χ.L z)).card := by + apply Finset.card_bij (fun i _ => (e i).val.2) + · intro i hi + have hzi : (e i).val.1 = z := (Finset.mem_filter.mp hi).2 + exact Finset.mem_range.mpr (hzi ▸ (e i).property.2) + · intro i hi j hj he + apply e.injective + apply Subtype.ext + exact Prod.ext ((Finset.mem_filter.mp hi).2.trans (Finset.mem_filter.mp hj).2.symm) he + · intro k hk + let c : CharacterZeroCopy χ := ⟨(z, k), hz'.1, Finset.mem_range.mp hk⟩ + refine ⟨e.symm c, Finset.mem_filter.mpr ⟨?_, ?_⟩, ?_⟩ + · change e.symm c ∈ Z.heightIndices T + rw [Z.mem_heightIndices] + change |(e (e.symm c)).val.1.im| ≤ T + simpa [c] using hz'.2 + · change (e (e.symm c)).val.1 = z + simp [c] + · simp [c] + _ = _ := Finset.card_range _ + +theorem characterZeroEnumeration_height_sum (χ : PrimitiveComplexCharacter) + (e : ℕ ≃ CharacterZeroCopy χ) (T : ℝ) (W : ℂ → ℂ) : + (∑ z ∈ criticalZerosUpTo χ T, (analyticOrderNatAt χ.L z : ℂ) * W z) = + ∑ i ∈ (characterZeroEnumeration χ e).heightIndices T, + W ((characterZeroEnumeration χ e).zeros i) := by + let Z := characterZeroEnumeration χ e + have hm : ∀ i ∈ Z.heightIndices T, Z.zeros i ∈ criticalZerosUpTo χ T := by + intro i hi + exact mem_criticalZerosUpTo.mpr + ⟨⟨(Z.in_strip i).1, (Z.in_strip i).2, Z.actual_zero i⟩, (Z.mem_heightIndices T i).mp hi⟩ + rw [← Finset.sum_fiberwise_of_maps_to hm (fun i => W (Z.zeros i))] + apply Finset.sum_congr rfl + intro z hz + calc + (analyticOrderNatAt χ.L z : ℂ) * W z = + ∑ i ∈ (Z.heightIndices T).filter (fun i => Z.zeros i = z), W z := by + simp [Z, characterZeroEnumeration_fiber_card χ e T z hz, nsmul_eq_mul] + _ = _ := by + apply Finset.sum_congr rfl + intro i hi + rw [(Finset.mem_filter.mp hi).2] + +theorem ComplexZeroEnumeration.tendsto_heightIndices {χ : PrimitiveComplexCharacter} + (Z : ComplexZeroEnumeration χ) : Tendsto Z.heightIndices atTop atTop := by + apply tendsto_atTop.2 + intro S + have hh : ∀ᶠ T : ℝ in atTop, ∀ i ∈ S, |(Z.zeros i).im| ≤ T := + (Filter.eventually_all_finset S).mpr (fun i _ => eventually_ge_atTop _) + filter_upwards [hh] with T hT + intro i hi + exact (Z.mem_heightIndices T i).mpr (hT i hi) + +theorem ComplexZeroEnumeration.tendsto_height_sum {χ : PrimitiveComplexCharacter} + (Z : ComplexZeroEnumeration χ) (f : ℕ → ℂ) (hf : Summable f) : + Tendsto (fun T : ℝ => ∑ i ∈ Z.heightIndices T, f i) atTop (𝓝 (∑' i, f i)) := + hf.hasSum.comp Z.tendsto_heightIndices + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroPolynomial.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e60a22bdf8b411af5f763741466d924386d06b6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroPolynomial.lean @@ -0,0 +1,83 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroSet + +namespace OAI + +/-! # Removing the actual finite zero factors of an entire character L-function -/ + +namespace Ostmann + +open Filter Set +open scoped Topology BigOperators Classical + +noncomputable def characterZeroPolynomial (χ : PrimitiveComplexCharacter) + (S : Finset ℂ) (s : ℂ) : ℂ := + ∏ z ∈ S, (s - z) ^ analyticOrderNatAt χ.L z + +theorem characterZeroPolynomial_analytic (χ : PrimitiveComplexCharacter) + (S : Finset ℂ) (s : ℂ) : AnalyticAt ℂ (characterZeroPolynomial χ S) s := by + exact S.analyticAt_fun_prod fun z _ => (analyticAt_id.sub analyticAt_const).pow _ + +theorem characterZeroPolynomial_ne_zero (χ : PrimitiveComplexCharacter) + (S : Finset ℂ) (s : ℂ) (hs : s ∉ S) : characterZeroPolynomial χ S s ≠ 0 := by + apply Finset.prod_ne_zero_iff.mpr + intro z hz + exact pow_ne_zero _ (sub_ne_zero.mpr (fun he => hs (he ▸ hz))) + +theorem characterZeroPolynomial_insert (χ : PrimitiveComplexCharacter) + (S : Finset ℂ) (z s : ℂ) (hz : z ∈ S) : + characterZeroPolynomial χ S s = + (s - z) ^ analyticOrderNatAt χ.L z * characterZeroPolynomial χ (S.erase z) s := by + exact (Finset.mul_prod_erase S _ hz).symm + +/-- The quotient by any finite collection of complete zero factors extends +analytically to the whole plane. It is nonzero at each removed zero. -/ +theorem character_remove_finite_zeros (χ : PrimitiveComplexCharacter) (S : Finset ℂ) : + ∃ g : ℂ → ℂ, (∀ s, AnalyticAt ℂ g s) ∧ + (∀ s, χ.L s = characterZeroPolynomial χ S s * g s) ∧ + (∀ s ∈ S, g s ≠ 0) := by + choose R hR hRne heR using fun z => + (χ.L_analytic z).analyticOrderAt_ne_top.mp (χ.L_order_ne_top z) + let g : ℂ → ℂ := fun z => if z ∈ S then + R z z / characterZeroPolynomial χ (S.erase z) z + else χ.L z / characterZeroPolynomial χ S z + have hlocal (z : ℂ) (hz : z ∈ S) : + g =ᶠ[𝓝 z] fun s => R z s / characterZeroPolynomial χ (S.erase z) s := by + have hav : ∀ᶠ s in 𝓝 z, s ∉ S.erase z := + (S.erase z).finite_toSet.isClosed.isOpen_compl.mem_nhds (by simp) + filter_upwards [hav, heR z] with s hs he + by_cases hsz : s = z + · subst s + simp only [g, ite_eq_left hz] + · have hsS : s ∉ S := fun h => hs (Finset.mem_erase.mpr ⟨hsz, h⟩) + simp only [g, ite_eq_right hsS] + rw [characterZeroPolynomial_insert χ S z s hz, he] + simp only [smul_eq_mul] + exact mul_div_mul_left _ _ (pow_ne_zero _ (sub_ne_zero.mpr hsz)) + have ha : ∀ s, AnalyticAt ℂ g s := by + intro s + by_cases hs : s ∈ S + · exact ((hR s).div (characterZeroPolynomial_analytic χ (S.erase s) s) + (characterZeroPolynomial_ne_zero χ (S.erase s) s (by simp))).congr + (hlocal s hs).symm + · apply ((χ.L_analytic s).div (characterZeroPolynomial_analytic χ S s) + (characterZeroPolynomial_ne_zero χ S s hs)).congr + have hav : ∀ᶠ z in 𝓝 s, z ∉ S := S.finite_toSet.isClosed.isOpen_compl.mem_nhds hs + filter_upwards [hav] with z hz + simp only [g, ite_eq_right hz, Pi.div_apply] + refine ⟨g, ha, ?_, ?_⟩ + · intro s + by_cases hs : s ∈ S + · rw [(hlocal s hs).self_of_nhds, characterZeroPolynomial_insert χ S s s hs] + have he := (heR s).self_of_nhds + simp only [smul_eq_mul] at he + rw [he] + field_simp [characterZeroPolynomial_ne_zero χ (S.erase s) s (by simp)] + · simp only [g, ite_eq_right hs] + exact (mul_div_cancel₀ _ (characterZeroPolynomial_ne_zero χ S s hs)).symm + · intro s hs + simp only [g, ite_eq_left hs] + exact div_ne_zero (hRne s) (characterZeroPolynomial_ne_zero χ (S.erase s) s (by simp)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroQuotientBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroQuotientBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..a41724a89cf97ebde2d1925fca9c64f62c4e2ec4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroQuotientBound.lean @@ -0,0 +1,82 @@ +import Mathlib.Analysis.Complex.AbsMax +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterContourZeroSet + +namespace OAI + +/-! # Modulus bounds after removing the finite zero factors -/ + +namespace Ostmann + +open Complex Metric Set +open scoped BigOperators + +theorem characterZeroPolynomial_norm_le (χ : PrimitiveComplexCharacter) (S : Finset ℂ) + (z : ℂ) (r : ℝ) (_hr : 0 ≤ r) (hS : ∀ w ∈ S, ‖z - w‖ ≤ r) : + ‖characterZeroPolynomial χ S z‖ ≤ r ^ (∑ w ∈ S, analyticOrderNatAt χ.L w) := by + simp only [characterZeroPolynomial, norm_prod, norm_pow] + rw [← Finset.prod_pow_eq_pow_sum] + exact Finset.prod_le_prod₀ (fun _ _ => by positivity) + (fun w hw => pow_le_pow_left₀ (norm_nonneg _) (hS w hw) _) + +theorem characterZeroPolynomial_norm_ge (χ : PrimitiveComplexCharacter) (S : Finset ℂ) + (z : ℂ) (r : ℝ) (hr : 0 ≤ r) (hS : ∀ w ∈ S, r ≤ ‖z - w‖) : + r ^ (∑ w ∈ S, analyticOrderNatAt χ.L w) ≤ ‖characterZeroPolynomial χ S z‖ := by + simp only [characterZeroPolynomial, norm_prod, norm_pow] + rw [← Finset.prod_pow_eq_pow_sum] + exact Finset.prod_le_prod₀ (fun _ _ => pow_nonneg hr _) + (fun w hw => pow_le_pow_left₀ hr (hS w hw) _) + +/-- The removed quotient is nonvanishing on the whole smaller disk. -/ +theorem character_contour_quotient_exists (χ : PrimitiveComplexCharacter) (t : ℝ) : + ∃ g : ℂ → ℂ, (∀ s, AnalyticAt ℂ g s) ∧ + (∀ s, χ.L s = characterZeroPolynomial χ (characterContourZeros χ t) s * g s) ∧ + (∀ s ∈ closedBall (characterZeroCenter t) (21 / 8 : ℝ), g s ≠ 0) := by + obtain ⟨g, hg, he, hne⟩ := character_remove_finite_zeros χ (characterContourZeros χ t) + refine ⟨g, hg, he, ?_⟩ + intro s hs + by_cases hz : s ∈ characterContourZeros χ t + · exact hne s hz + · intro hh + have hf : χ.L s = 0 := by rw [he, hh, mul_zero] + exact hz ((mem_characterContourZeros χ t s).mpr ⟨hs, hf⟩) + +/-- A fixed annular reserve bounds the analytic quotient throughout the outer + disk, even when the original L-function vanishes inside it. -/ +theorem character_contour_quotient_bound (χ : PrimitiveComplexCharacter) (t M : ℝ) + (_hM : 0 ≤ M) + (hbound : ∀ z ∈ closedBall (characterZeroCenter t) (11 / 4 : ℝ), ‖χ.L z‖ ≤ M) + (g : ℂ → ℂ) (hg : ∀ s, AnalyticAt ℂ g s) + (he : ∀ s, χ.L s = characterZeroPolynomial χ (characterContourZeros χ t) s * g s) : + ∀ z ∈ closedBall (characterZeroCenter t) (11 / 4 : ℝ), + ‖g z‖ ≤ M * 8 ^ (∑ w ∈ characterContourZeros χ t, analyticOrderNatAt χ.L w) := by + let N := ∑ w ∈ characterContourZeros χ t, analyticOrderNatAt χ.L w + have hb : ∀ z ∈ sphere (characterZeroCenter t) (11 / 4 : ℝ), ‖g z‖ ≤ M * 8 ^ N := by + intro z hz + have hdist : ‖z - characterZeroCenter t‖ = 11 / 4 := by + simpa only [mem_sphere, dist_eq_norm] using hz + have hlower : (1 / 8 : ℝ) ^ N ≤ ‖characterZeroPolynomial χ (characterContourZeros χ t) z‖ := by + apply characterZeroPolynomial_norm_ge χ _ z (1 / 8) (by norm_num) + intro w hw + have hw' := ((mem_characterContourZeros χ t w).mp hw).1 + have hdw : ‖w - characterZeroCenter t‖ ≤ 21 / 8 := by + simpa only [mem_closedBall, dist_eq_norm] using hw' + have hh := norm_sub_le (z - w) (characterZeroCenter t - w) + rw [sub_sub_sub_cancel_right, norm_sub_rev (characterZeroCenter t)] at hh + linarith + have hnorm := hbound z (sphere_subset_closedBall hz) + rw [he z, norm_mul] at hnorm + have hprod : (1 / 8 : ℝ) ^ N * ‖g z‖ ≤ M := + (mul_le_mul_of_nonneg_right hlower (norm_nonneg _)).trans hnorm + have hh := (le_div_iff₀ (pow_pos (by norm_num : (0 : ℝ) < 1 / 8) N)).mpr (by simpa only [mul_comm] using hprod) + simpa only [one_div, inv_pow, div_inv_eq_mul] using hh + intro z hz + apply Complex.norm_le_of_forall_mem_frontier_norm_le (U := ball (characterZeroCenter t) (11 / 4)) isBounded_ball (f := g) + · exact DiffContOnCl.mk_ball (fun w _ => (hg w).differentiableAt.differentiableWithinAt) + (fun w _ => (hg w).continuousAt.continuousWithinAt) + · rw [frontier_ball (characterZeroCenter t) (by norm_num : (11 / 4 : ℝ) ≠ 0)] + exact hb + · rwa [closure_ball (characterZeroCenter t) (by norm_num : (11 / 4 : ℝ) ≠ 0)] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroQuotientLog.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroQuotientLog.lean new file mode 100644 index 0000000000000000000000000000000000000000..d1428452fc2bccde78e42887aeaeb42d1983f16e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroQuotientLog.lean @@ -0,0 +1,62 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroQuotientBound +import OAI.NumberTheory.Ostmann.ZeroDensity.LogDerivativeContourDisk + +namespace OAI + +/-! # The normalized logarithm of the quotient by all nearby zeros -/ + +namespace Ostmann + +open Complex Metric Set +open scoped BigOperators + +theorem character_contour_quotient_log_bound (χ : PrimitiveComplexCharacter) (t M : ℝ) + (hM : 1 ≤ M) + (hbound : ∀ z ∈ closedBall (characterZeroCenter t) (11 / 4 : ℝ), ‖χ.L z‖ ≤ M) + (g : ℂ → ℂ) (hg : ∀ s, AnalyticAt ℂ g s) + (he : ∀ s, χ.L s = characterZeroPolynomial χ (characterContourZeros χ t) s * g s) + (hne : ∀ s ∈ closedBall (characterZeroCenter t) (21 / 8 : ℝ), g s ≠ 0) : + ∀ z ∈ closedBall (characterZeroCenter t) (21 / 8 : ℝ), + Real.log ‖g z‖ - Real.log ‖g (characterZeroCenter t)‖ ≤ + Real.log (3 * M) + + (∑ w ∈ characterContourZeros χ t, (analyticOrderNatAt χ.L w : ℝ)) * Real.log 21 := by + let N := ∑ w ∈ characterContourZeros χ t, analyticOrderNatAt χ.L w + have hc : characterZeroCenter t ∈ closedBall (characterZeroCenter t) (21 / 8 : ℝ) := + mem_closedBall_self (by norm_num) + have hgc : 0 < ‖g (characterZeroCenter t)‖ := norm_pos_iff.mpr (hne _ hc) + have hp : ‖characterZeroPolynomial χ (characterContourZeros χ t) (characterZeroCenter t)‖ ≤ + (21 / 8 : ℝ) ^ N := by + apply characterZeroPolynomial_norm_le χ _ _ _ (by norm_num) + intro w hw + rw [norm_sub_rev] + exact (mem_closedBall_iff_norm.mp ((mem_characterContourZeros χ t w).mp hw).1) + have hlo : (1 / 3 : ℝ) ≤ (21 / 8 : ℝ) ^ N * ‖g (characterZeroCenter t)‖ := by + have hh := χ.L_lower_re_two (characterZeroCenter t) (characterZeroCenter_re t) + rw [he, norm_mul] at hh + exact hh.trans (mul_le_mul_of_nonneg_right hp (norm_nonneg _)) + have hpow : (8 : ℝ) ^ N * (21 / 8 : ℝ) ^ N = 21 ^ N := by + rw [← mul_pow] + norm_num + have hm : M * 8 ^ N ≤ 3 * M * 21 ^ N * ‖g (characterZeroCenter t)‖ := by + calc + _ = (3 * M * 8 ^ N) * (1 / 3) := by ring + _ ≤ (3 * M * 8 ^ N) * ((21 / 8) ^ N * ‖g (characterZeroCenter t)‖) := + mul_le_mul_of_nonneg_left hlo (by positivity) + _ = 3 * M * (8 ^ N * (21 / 8) ^ N) * ‖g (characterZeroCenter t)‖ := by ring + _ = _ := by rw [hpow] + intro z hz + have hzouter : z ∈ closedBall (characterZeroCenter t) (11 / 4 : ℝ) := + closedBall_subset_closedBall (by norm_num) hz + have hupper := character_contour_quotient_bound χ t M (by linarith) hbound g hg he z hzouter + have hratio : ‖g z‖ / ‖g (characterZeroCenter t)‖ ≤ 3 * M * 21 ^ N := + (div_le_iff₀ hgc).mpr (hupper.trans hm) + have hnz : 0 < ‖g z‖ := norm_pos_iff.mpr (hne z hz) + rw [← Real.log_div hnz.ne' hgc.ne'] + apply (Real.log_le_log (div_pos hnz hgc) hratio).trans_eq + rw [Real.log_mul (by positivity : 3 * M ≠ 0) (by positivity : (21 : ℝ) ^ N ≠ 0), + Real.log_pow] + simp only [N, Nat.cast_sum] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroReflection.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroReflection.lean new file mode 100644 index 0000000000000000000000000000000000000000..93814314bba84839e6034bb255696131ee06b49c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroReflection.lean @@ -0,0 +1,56 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterFunctionalEquation + +namespace OAI + +/-! # Functional-equation symmetry preserves zero multiplicity -/ + +namespace Ostmann + +open Filter Set +open scoped Topology + +theorem PrimitiveComplexCharacter.completed_order_reflection (χ : PrimitiveComplexCharacter) + (s : ℂ) : analyticOrderAt χ.completed (1 - s) = + analyticOrderAt χ.inverse.completed s := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + let G : ℂ → ℂ := fun z => (χ.modulus : ℂ) ^ (z - 1 / 2) * + DirichletCharacter.rootNumber χ.character + have hq : (χ.modulus : ℂ) ≠ 0 := by exact_mod_cast χ.positive.ne' + have hG : AnalyticAt ℂ G s := + (((differentiable_id.sub_const (1 / 2 : ℂ)).const_cpow (.inl hq)).mul_const + (DirichletCharacter.rootNumber χ.character)).analyticAt s + have hGne : G s ≠ 0 := mul_ne_zero (Complex.cpow_ne_zero_iff.mpr (.inl hq)) χ.rootNumber_ne_zero + have he : χ.completed ∘ (fun z => 1 - z) = G * χ.inverse.completed := by + funext z + exact χ.primitive.completedLFunction_one_sub z + have hcomp := analyticOrderAt_comp_of_deriv_ne_zero + (f := χ.completed) (z₀ := s) + (show AnalyticAt ℂ (fun z => 1 - z) s from analyticAt_const.sub analyticAt_id) + (show deriv (fun z : ℂ => 1 - z) s ≠ 0 by + change deriv (fun z : ℂ => 1 - id z) s ≠ 0 + rw [((hasDerivAt_id s).const_sub (1 : ℂ)).deriv] + norm_num) + rw [he, analyticOrderAt_mul hG (χ.inverse.completed_analytic s), + hG.analyticOrderAt_eq_zero.mpr hGne, zero_add] at hcomp + exact hcomp.symm + +theorem PrimitiveComplexCharacter.L_order_reflection (χ : PrimitiveComplexCharacter) + (s : ℂ) (hs : 0 < s.re) (hs' : s.re < 1) : + analyticOrderAt χ.L (1 - s) = analyticOrderAt χ.inverse.L s := by + rw [χ.L_order_eq_completed (1 - s) (by simp; linarith), + χ.inverse.L_order_eq_completed s hs] + exact χ.completed_order_reflection s + +theorem characterZeroOrder_reflection (χ : PrimitiveComplexCharacter) + (s : ℂ) (hs : 0 < s.re) (hs' : s.re < 1) : + characterZeroOrder χ (1 - s) = characterZeroOrder χ.inverse s := by + rw [characterZeroOrder, characterZeroOrder, + MeromorphicOn.AnalyticOnNhd.divisor_apply + (show AnalyticOnNhd ℂ χ.L univ from fun z _ => χ.L_analytic z) (mem_univ _), + MeromorphicOn.AnalyticOnNhd.divisor_apply + (show AnalyticOnNhd ℂ χ.inverse.L univ from fun z _ => χ.inverse.L_analytic z) (mem_univ _), + χ.L_order_reflection s hs hs'] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroSet.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroSet.lean new file mode 100644 index 0000000000000000000000000000000000000000..a24530bf1d886cd2042090e530a46dde7bf2fe49 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZeroSet.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterFullZeroCount + +namespace OAI + +/-! # Finiteness and multiplicity of actual zeros in bounded strips -/ + +namespace Ostmann + +open Metric Set MeromorphicOn +open scoped BigOperators Classical + +theorem characterZeroOrder_eq_nat (χ : PrimitiveComplexCharacter) (z : ℂ) : + characterZeroOrder χ z = (analyticOrderNatAt χ.L z : ℤ) := by + obtain ⟨n, hn⟩ := ENat.ne_top_iff_exists.mp (χ.L_order_ne_top z) + rw [characterZeroOrder, AnalyticOnNhd.divisor_apply + (show AnalyticOnNhd ℂ χ.L univ from fun z _ => χ.L_analytic z) (mem_univ z)] + simp [analyticOrderNatAt, ← hn] + +theorem characterZeroOrder_pos_iff (χ : PrimitiveComplexCharacter) (z : ℂ) : + 0 < characterZeroOrder χ z ↔ χ.L z = 0 := by + rw [characterZeroOrder_eq_nat, Int.natCast_pos] + obtain ⟨n, hn⟩ := ENat.ne_top_iff_exists.mp (χ.L_order_ne_top z) + have hnat : analyticOrderNatAt χ.L z = n := by simp [analyticOrderNatAt, ← hn] + rw [hnat] + have hf := (χ.L_analytic z).analyticOrderAt_ne_zero + have hnzero : n ≠ 0 ↔ χ.L z = 0 := by simpa only [← hn, Nat.cast_ne_zero] using hf + exact Nat.pos_iff_ne_zero.trans hnzero + +def complexCharacterZeros (χ : PrimitiveComplexCharacter) : Set ℂ := + {z | 0 < z.re ∧ z.re < 1 ∧ χ.L z = 0} + +theorem PrimitiveComplexCharacter.strip_zeros_finite (χ : PrimitiveComplexCharacter) (T : ℝ) : + {z : ℂ | z ∈ complexCharacterZeros χ ∧ |z.im| ≤ T}.Finite := by + by_cases hT : 0 ≤ T + · let K := closedBall (0 : ℂ) (T + 1) + have ha : AnalyticOnNhd ℂ χ.L K := fun z _ => χ.L_analytic z + apply ((divisor χ.L K).finiteSupport (isCompact_closedBall _ _)).subset + intro z hz + obtain ⟨⟨hr, hr', hzero⟩, hi⟩ := hz + have hzK : z ∈ K := by + rw [mem_closedBall, dist_zero_right] + have hn := Complex.norm_le_abs_re_add_abs_im z + rw [abs_of_pos hr] at hn + linarith + have hdiv : divisor χ.L K z = characterZeroOrder χ z := by + rw [ha.divisor_apply hzK, characterZeroOrder, + AnalyticOnNhd.divisor_apply + (show AnalyticOnNhd ℂ χ.L univ from fun z _ => χ.L_analytic z) (mem_univ z)] + change divisor χ.L K z ≠ 0 + rw [hdiv] + exact ne_of_gt ((characterZeroOrder_pos_iff χ z).mpr hzero) + · have he : {z : ℂ | z ∈ complexCharacterZeros χ ∧ |z.im| ≤ T} = ∅ := by + apply Set.eq_empty_iff_forall_notMem.mpr + intro z hz + exact hT ((abs_nonneg z.im).trans hz.2) + rw [he] + exact finite_empty + +theorem PrimitiveComplexCharacter.zeros_countable (χ : PrimitiveComplexCharacter) : + (complexCharacterZeros χ).Countable := by + apply (Set.countable_iUnion (fun n : ℕ => (χ.strip_zeros_finite (n : ℝ)).countable)).mono + intro z hz + obtain ⟨n, hn⟩ := exists_nat_ge |z.im| + exact Set.mem_iUnion.mpr ⟨n, hz, hn⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZerosInfinite.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZerosInfinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..45955127d3746e4563f366ba91e2174b94a29e54 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CharacterZerosInfinite.lean @@ -0,0 +1,32 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedFiniteBound +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedDivergence + +namespace OAI + +/-! # Infinitely many actual nontrivial zeros for every primitive character -/ + +namespace Ostmann + +open Complex Filter Set +open scoped Topology + +/-- A finite zero set would force bounded logarithmic derivative, contradicting +its Gamma-factor growth along the positive real axis. -/ +theorem PrimitiveComplexCharacter.zeros_infinite (χ : PrimitiveComplexCharacter) : + (complexCharacterZeros χ).Infinite := by + intro hfinite + obtain ⟨R, C, hR, hC, hbound⟩ := completed_logDeriv_bounded_of_finite_zeros χ hfinite + have hg := (completed_logDeriv_sample_re_tendsto χ).eventually_ge_atTop (C + 1) + have hr := (tendsto_natCast_atTop_atTop (R := ℝ)).eventually_ge_atTop (max R 2) + obtain ⟨n, hn, hnR⟩ := (hg.and hr).exists + have hsample := characterGammaSample_re_lower χ n + have hn0 : 0 ≤ (n : ℝ) := Nat.cast_nonneg _ + have hnr : R ≤ (n : ℝ) := (le_max_left R 2).trans hnR + have hb := hbound (characterGammaSample χ n) (by linarith) + have hre := (le_abs_self ((logDeriv χ.completed (characterGammaSample χ n)).re)).trans + (abs_re_le_norm (logDeriv χ.completed (characterGammaSample χ n))) + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CoefficientEnergy.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CoefficientEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d1e9766227ee9a9736cda2123f2730c1f77a4d1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CoefficientEnergy.lean @@ -0,0 +1,94 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Tactic.GCongr +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring +import OAI.NumberTheory.Ostmann.Arithmetic.DivisorSquareMean +import OAI.NumberTheory.Ostmann.ZeroDensity.BetaDerivative +import OAI.NumberTheory.Ostmann.ZeroDensity.Mollifier + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Ostmann.ZeroDensity + +theorem dyadic_coefficient_energy_le (a : ℕ → ℂ) {C σ : ℝ} (_hC : 0 ≤ C) + (hσ : 0 ≤ σ) {U : ℕ} (hU : 1 ≤ U) + (ha : ∀ n ∈ Finset.Ioc U (2 * U), ‖a n‖ ≤ C * (n.divisors.card : ℝ)) : + (∑ n ∈ Finset.Ioc U (2 * U), ‖a n‖ ^ 2 * (n : ℝ) ^ (-2 * σ)) ≤ + C ^ 2 * (2 * U * (1 + Real.log (2 * U)) ^ 3 * (U : ℝ) ^ (-2 * σ)) := by + have hUR : (0 : ℝ) < U := by exact_mod_cast (Nat.zero_lt_one.trans_le hU) + have hpoint : ∀ n ∈ Finset.Ioc U (2 * U), + ‖a n‖ ^ 2 * (n : ℝ) ^ (-2 * σ) ≤ + C ^ 2 * (n.divisors.card : ℝ) ^ 2 * (U : ℝ) ^ (-2 * σ) := by + intro n hn + have hnU : (U : ℝ) ≤ n := by exact_mod_cast (Finset.mem_Ioc.mp hn).1.le + have hpow : (n : ℝ) ^ (-2 * σ) ≤ (U : ℝ) ^ (-2 * σ) := + Real.rpow_le_rpow_of_nonpos hUR hnU (by nlinarith) + have hnorm : ‖a n‖ ^ 2 ≤ C ^ 2 * (n.divisors.card : ℝ) ^ 2 := by + simpa only [mul_pow] using pow_le_pow_left₀ (norm_nonneg _) (ha n hn) 2 + exact mul_le_mul hnorm hpow (Real.rpow_nonneg (Nat.cast_nonneg _) _) + (by positivity) + have hdivisors : (∑ n ∈ Finset.Ioc U (2 * U), (n.divisors.card : ℝ) ^ 2) ≤ + (2 * U : ℝ) * (1 + Real.log (2 * U)) ^ 3 := by + calc + (∑ n ∈ Finset.Ioc U (2 * U), (n.divisors.card : ℝ) ^ 2) ≤ + ∑ n ∈ Finset.Icc 1 (2 * U), (n.divisors.card : ℝ) ^ 2 := by + apply Finset.sum_le_sum_of_subset_of_nonneg + · intro n hn + exact Finset.mem_Icc.mpr ⟨by have := (Finset.mem_Ioc.mp hn).1; omega, + (Finset.mem_Ioc.mp hn).2⟩ + · intro n _ _ + positivity + _ ≤ _ := by simpa only [Nat.cast_mul, Nat.cast_ofNat] using + Ostmann.Arithmetic.DivisorSquareMean.divisor_square_mean (2 * U) + calc + (∑ n ∈ Finset.Ioc U (2 * U), ‖a n‖ ^ 2 * (n : ℝ) ^ (-2 * σ)) ≤ + ∑ n ∈ Finset.Ioc U (2 * U), + C ^ 2 * (n.divisors.card : ℝ) ^ 2 * (U : ℝ) ^ (-2 * σ) := + Finset.sum_le_sum hpoint + _ = C ^ 2 * (∑ n ∈ Finset.Ioc U (2 * U), (n.divisors.card : ℝ) ^ 2) * + (U : ℝ) ^ (-2 * σ) := by rw [← Finset.sum_mul, ← Finset.mul_sum] + _ ≤ C ^ 2 * ((2 * U : ℝ) * (1 + Real.log (2 * U)) ^ 3) * + (U : ℝ) ^ (-2 * σ) := by gcongr + _ = _ := by ring + +theorem mollifier_dyadic_energy_le (X N : ℕ) {σ : ℝ} (hσ : 0 ≤ σ) + {U : ℕ} (hU : 1 ≤ U) : + (∑ n ∈ Finset.Ioc U (2 * U), ‖mollifierCoefficient X N n‖ ^ 2 * + (n : ℝ) ^ (-2 * σ)) ≤ + 2 * U * (1 + Real.log (2 * U)) ^ 3 * (U : ℝ) ^ (-2 * σ) := by + simpa only [one_pow, one_mul] using + dyadic_coefficient_energy_le (mollifierCoefficient X N) (C := 1) zero_le_one hσ hU + (fun n _ => by simpa using norm_mollifierCoefficient_le X N n) + +theorem mollifier_logPower_dyadic_energy_le (X N k : ℕ) {σ : ℝ} (hσ : 0 ≤ σ) + {U : ℕ} (hU : 1 ≤ U) : + (∑ n ∈ Finset.Ioc U (2 * U), + ‖logPowerCoefficients k (mollifierCoefficient X N) n‖ ^ 2 * + (n : ℝ) ^ (-2 * σ)) ≤ + (Real.log (2 * U)) ^ (2 * k) * + (2 * U * (1 + Real.log (2 * U)) ^ 3 * (U : ℝ) ^ (-2 * σ)) := by + have hlog : 0 ≤ Real.log (2 * U : ℝ) := Real.log_nonneg (by + have : (1 : ℝ) ≤ U := by exact_mod_cast hU + linarith) + have hbound : ∀ n ∈ Finset.Ioc U (2 * U), + ‖logPowerCoefficients k (mollifierCoefficient X N) n‖ ≤ + (Real.log (2 * U : ℝ)) ^ k * (n.divisors.card : ℝ) := by + intro n hn + have hn1 : 1 ≤ n := by have := (Finset.mem_Ioc.mp hn).1; omega + have hh := norm_logPowerCoefficients_le k (mollifierCoefficient X N) + hn1 (Finset.mem_Ioc.mp hn).2 + simp only [Nat.cast_mul, Nat.cast_ofNat] at hh + exact hh.trans (mul_le_mul_of_nonneg_left (norm_mollifierCoefficient_le X N n) + (pow_nonneg hlog k)) + have h := dyadic_coefficient_energy_le + (logPowerCoefficients k (mollifierCoefficient X N)) (pow_nonneg hlog k) hσ hU hbound + simpa only [← pow_mul, Nat.mul_comm k 2] using h + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedCharacterConjugation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedCharacterConjugation.lean new file mode 100644 index 0000000000000000000000000000000000000000..7ac35c61dd9362d117cbd65622b486bf05a1ea24 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedCharacterConjugation.lean @@ -0,0 +1,90 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ComplexCharacterConjugation +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedLogDerivative + +namespace OAI + +/-! # The completed functional equation with conjugation -/ + +namespace Ostmann + +open Complex Filter Set +open scoped ComplexConjugate Topology + +theorem gammaReal_conjugate (s : ℂ) : Complex.Gammaℝ (conj s) = conj (Complex.Gammaℝ s) := by + have hpi : (Real.pi : ℂ).arg ≠ Real.pi := by + rw [Complex.arg_ofReal_of_nonneg Real.pi_pos.le] + exact Real.pi_pos.ne + simp only [Complex.Gammaℝ_def, map_mul] + have hg : Complex.Gamma (conj s / 2) = conj (Complex.Gamma (s / 2)) := by + simpa only [map_div₀, map_ofNat] using Complex.Gamma_conj (s / 2) + rw [hg] + have hh := Complex.cpow_conj (Real.pi : ℂ) (-s / 2) hpi + simpa only [map_neg, map_div₀, map_ofNat, Complex.conj_ofReal] using + congrArg (fun z : ℂ => z * conj (Complex.Gamma (s / 2))) hh + +theorem character_even_inverse_iff {q : ℕ} (χ : DirichletCharacter ℂ q) : + (χ⁻¹).Even ↔ χ.Even := by + change (χ⁻¹) (-1) = 1 ↔ χ (-1) = 1 + rw [← MulChar.star_eq_inv, MulChar.star_apply, RCLike.star_def] + constructor + · intro h + have hh := congrArg conj h + simpa only [Complex.conj_conj, map_one] using hh + · intro h + rw [h, map_one] + +theorem PrimitiveComplexCharacter.gammaFactor_inverse_conj (χ : PrimitiveComplexCharacter) (s : ℂ) : + DirichletCharacter.gammaFactor χ.inverse.character (conj s) = + conj (DirichletCharacter.gammaFactor χ.character s) := by + change DirichletCharacter.gammaFactor (χ.character⁻¹) (conj s) = _ + by_cases he : χ.character.Even + · simp only [DirichletCharacter.gammaFactor, (character_even_inverse_iff χ.character).mpr he, + he, ite_true, gammaReal_conjugate] + · have hi : ¬(χ.character⁻¹).Even := fun h => he ((character_even_inverse_iff χ.character).mp h) + simpa only [DirichletCharacter.gammaFactor, he, hi, ite_false, map_add, map_one] using + gammaReal_conjugate (s + 1) + +theorem PrimitiveComplexCharacter.gammaInverse_inverse_conj (χ : PrimitiveComplexCharacter) (s : ℂ) : + χ.inverse.gammaInverse (conj s) = conj (χ.gammaInverse s) := by + simp only [PrimitiveComplexCharacter.gammaInverse, χ.gammaFactor_inverse_conj, map_inv₀] + +theorem PrimitiveComplexCharacter.completed_inverse_conj_right (χ : PrimitiveComplexCharacter) + (s : ℂ) (hs : 0 < s.re) : χ.inverse.completed (conj s) = conj (χ.completed s) := by + have hsne : s ≠ 0 := by + intro h + rw [h] at hs + norm_num at hs + have hscne : conj s ≠ 0 := by intro h; apply hsne; simpa using congrArg conj h + apply mul_right_cancel₀ (χ.inverse.gammaInverse_ne_zero (conj s) (by simpa using hs)) + calc + _ = χ.inverse.L (conj s) := (χ.inverse.L_eq_completed_mul (conj s) hscne).symm + _ = conj (χ.L s) := by + have he := congrFun χ.inverse_L_eq_conjugate (conj s) + simpa only [Function.comp_apply, Complex.conj_conj] using he + _ = _ := by + rw [χ.L_eq_completed_mul s hsne, map_mul, χ.gammaInverse_inverse_conj] + +theorem PrimitiveComplexCharacter.inverse_completed_eq_conjugate (χ : PrimitiveComplexCharacter) : + χ.inverse.completed = conj ∘ χ.completed ∘ conj := by + have hd : Differentiable ℂ (conj ∘ χ.completed ∘ conj) := by + intro z + simpa only [Complex.conj_conj] using (χ.completed_analytic (conj z)).differentiableAt.conj_conj + have hg := hd.differentiableOn.analyticOnNhd isOpen_univ + have hf : AnalyticOnNhd ℂ χ.inverse.completed univ := fun z _ => χ.inverse.completed_analytic z + apply hf.eq_of_eventuallyEq hg (z₀ := (2 : ℂ)) + filter_upwards [(isOpen_lt continuous_const Complex.continuous_re).mem_nhds + (show (0 : ℝ) < (2 : ℂ).re by norm_num)] with z hz + simpa only [Function.comp_apply, Complex.conj_conj] using + χ.completed_inverse_conj_right (conj z) (by simpa using hz) + +theorem PrimitiveComplexCharacter.completed_logDeriv_self_reflection + (χ : PrimitiveComplexCharacter) (s : ℂ) (hs : 1 ≤ s.re) : + logDeriv χ.completed (1 - conj s) = + -Complex.log (χ.modulus : ℂ) - conj (logDeriv χ.completed s) := by + rw [χ.completed_logDeriv_reflection (conj s) (by simpa using hs), + χ.inverse_completed_eq_conjugate, logDeriv_apply, deriv_conj_conj] + simp only [Function.comp_apply, Complex.conj_conj, logDeriv_apply, map_div₀] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedCompensationPrior.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedCompensationPrior.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b477b3fc8a38f7530317ff20a24aadd071d3522 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedCompensationPrior.lean @@ -0,0 +1,86 @@ +import OAI.NumberTheory.Ostmann.Construction.ScheduledSelectedGaps + +namespace OAI + +/-! # A total prior extending precisely the used compensation cells + +Unused indices reuse the selected top cell. The pivot exponent retains its +original zero default beyond the finite list; no extra transfer is performed. +-/ +namespace Ostmann +open scoped Classical BigOperators + +def completedCompensationCell (top : ℕ) (cs : List ℕ) (n : ℕ) : ℕ := + (cs.drop n).headD top + +noncomputable def completedCompensationSets (A B : Set ℕ) (N : ℕ) (X : ℝ) + (hi : ℕ) (D : Finset ℕ) (top : ℕ) (cs : List ℕ) (n : ℕ) : Finset ℕ := + selectedTailCellPrimes A B N X hi D (completedCompensationCell top cs n) + +noncomputable def completedCompensationPrior (A B : Set ℕ) (N : ℕ) (X : ℝ) + (hi : ℕ) (D P : Finset ℕ) (top : ℕ) (cs : List ℕ) (n : ℕ) : P → ℝ := + primeSubsetPrior P (completedCompensationSets A B N X hi D top cs n) + +theorem completedCompensationCell_used (top : ℕ) (cs : List ℕ) (n : ℕ) + (hn : n < cs.length) : completedCompensationCell top cs n = (cs.drop n).headD 0 := by + unfold completedCompensationCell + rw [list_headD_drop_get cs top n hn, list_headD_drop_get cs 0 n hn] + +theorem completedCompensationPrior_used (A B : Set ℕ) (N : ℕ) (X : ℝ) + (hi : ℕ) (D P : Finset ℕ) (top : ℕ) (cs : List ℕ) (n : ℕ) (hn : n < cs.length) : + completedCompensationPrior A B N X hi D P top cs n = + selectedCompensationPrior A B N X hi D P cs n := by + unfold completedCompensationPrior completedCompensationSets selectedCompensationPrior + rw [completedCompensationCell_used top cs n hn] + +theorem completedCompensationCell_selected + {A B : Set ℕ} {N hi top : ℕ} {a C L X target : ℝ} {D : Finset ℕ} + {cs : List ℕ} {targets : List ℝ} + (htop : SelectedSmallTailCell A B N a C L X hi D target top) + (hcs : List.Forall₂ + (fun j w => SelectedSmallTailCell A B N a C L X hi D (w / 4) j) cs targets) + (n : ℕ) : + ∃ t, SelectedSmallTailCell A B N a C L X hi D t (completedCompensationCell top cs n) := by + by_cases hn : n < cs.length + · refine ⟨(targets.drop n).headD 0 / 4, ?_⟩ + rw [completedCompensationCell_used top cs n hn] + exact forall₂_headD_drop hcs n hn + · refine ⟨target, ?_⟩ + simpa only [completedCompensationCell, List.drop_eq_nil_of_le (Nat.le_of_not_gt hn), + List.headD_nil] using htop + +theorem completedCompensationPrior_data + {A B : Set ℕ} {N hi top : ℕ} {a C L X target : ℝ} {D : Finset ℕ} + {cs : List ℕ} {targets : List ℝ} + (htop : SelectedSmallTailCell A B N a C L X hi D target top) + (hcs : List.Forall₂ + (fun j w => SelectedSmallTailCell A B N a C L X hi D (w / 4) j) cs targets) + (P : Finset ℕ) (hP : initialRegularPrimeRange L ⊆ P) (n : ℕ) : + let Q := completedCompensationSets A B N X hi D top cs n + Q ⊆ P ∧ Real.exp (-(2 * L)) ≤ ∑ p ∈ Q, (p : ℝ)⁻¹ ∧ + (∑ p : P, completedCompensationPrior A B N X hi D P top cs n p) = 1 ∧ + (∀ p : P, 0 ≤ completedCompensationPrior A B N X hi D P top cs n p ∧ + (p : ℝ) * completedCompensationPrior A B N X hi D P top cs n p ≤ Real.exp (2 * L)) := by + intro Q + obtain ⟨t, ht⟩ := completedCompensationCell_selected htop hcs n + have hQP := ht.subset_initialRegularPrimeRange.trans hP + have hd := ht.prior_data P hQP + exact ⟨hQP, ht.2.2.2.1, hd.1, hd.2.1⟩ + +theorem completedCompensationPrior_lower (A B : Set ℕ) (N : ℕ) (X : ℝ) + (hi : ℕ) (D P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) + (top : ℕ) (cs : List ℕ) (n : ℕ) (q : P) + (hq : completedCompensationPrior A B N X hi D P top cs n q ≠ 0) : + Real.exp (selectedCompensationCenter cs n - 1) ≤ (q : ℝ) := by + by_cases hn : n < cs.length + · rw [completedCompensationPrior_used A B N X hi D P top cs n hn] at hq + exact selectedCompensationPrior_lower A B N X hi D P cs n q hq + · have he : selectedCompensationCenter cs n = 1 := by + simp only [selectedCompensationCenter, List.drop_eq_nil_of_le (Nat.le_of_not_gt hn), + List.headD_nil, Nat.cast_zero, zero_add] + rw [he, sub_self, Real.exp_zero] + exact_mod_cast (hP q q.property).one_le + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedDiskGrowthRate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedDiskGrowthRate.lean new file mode 100644 index 0000000000000000000000000000000000000000..4304739d3409efe20e50fcd9ea8989bd62b10093 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedDiskGrowthRate.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CompletedDiskZeros +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedLogGrowth + +namespace OAI + +/-! # Common logarithmic growth rates for the function and its disk divisor -/ + +namespace Ostmann + +private theorem affine_log_growth_bound (a b x : ℝ) (ha : 1 ≤ a) (hb : 1 ≤ b) + (hx : 1 ≤ x) (hxab : x ≤ a * b) : + x * (1 + Real.log x) ≤ a * (1 + Real.log a) * b * (1 + Real.log b) := by + have ha0 : 0 < a := by linarith + have hb0 : 0 < b := by linarith + have hx0 : 0 < x := by linarith + have hla := Real.log_nonneg ha + have hlb := Real.log_nonneg hb + have hlx := Real.log_nonneg hx + have hl := Real.log_le_log hx0 hxab + rw [Real.log_mul ha0.ne' hb0.ne'] at hl + calc + _ ≤ (a * b) * (1 + Real.log a + Real.log b) := + mul_le_mul hxab (by linarith) (by positivity) (by positivity) + _ ≤ _ := by + nlinarith [mul_nonneg (mul_nonneg (mul_nonneg ha0.le hb0.le) hla) hlb] + +theorem completed_circle_log_growth (χ : PrimitiveComplexCharacter) : + ∃ C : ℝ, 0 < C ∧ ∀ (n : ℕ) (z : ℂ), ‖z‖ ≤ 3 * ((n : ℝ) + 1) → + Real.log ‖χ.completed z‖ ≤ C * ((n : ℝ) + 9) * (1 + Real.log ((n : ℝ) + 9)) := by + obtain ⟨A, hA, hg⟩ := character_completed_log_growth χ + refine ⟨A * (3 * (1 + Real.log 3)), by positivity [Real.log_nonneg (by norm_num : (1 : ℝ) ≤ 3)], ?_⟩ + intro n z hz + have hb : 1 ≤ (n : ℝ) + 9 := by linarith [Nat.cast_nonneg (α := ℝ) n] + have hh := hg (3 * n + 3) z (by push_cast; linarith) + have hx : 1 ≤ ((3 * n + 3 : ℕ) : ℝ) + 3 := by linarith [Nat.cast_nonneg (α := ℝ) (3 * n + 3)] + have hxab : ((3 * n + 3 : ℕ) : ℝ) + 3 ≤ 3 * ((n : ℝ) + 9) := by push_cast; linarith + have hh' := mul_le_mul_of_nonneg_left + (affine_log_growth_bound 3 ((n : ℝ) + 9) _ (by norm_num) hb hx hxab) hA.le + exact hh.trans (by convert hh' using 1 <;> ring) + +theorem completed_disk_mass_log_growth (χ : PrimitiveComplexCharacter) : + ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, + (∑ z ∈ completedDiskZeros χ ((n : ℝ) + 1), (analyticOrderNatAt χ.completed z : ℝ)) ≤ + C * ((n : ℝ) + 9) * (1 + Real.log ((n : ℝ) + 9)) := by + let K : ℝ := 32 / Real.log (14 / 13) + let a : ℝ := 2 * χ.modulus + have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive + have hK : 0 < K := div_pos (by norm_num) (Real.log_pos (by norm_num)) + have ha : 1 ≤ a := by dsimp [a]; linarith + have hla := Real.log_nonneg ha + refine ⟨K * a * (1 + Real.log a), by positivity, ?_⟩ + intro n + let x : ℝ := χ.modulus * (2 * ((n : ℝ) + 1) + 2) + have hx : 1 ≤ x := by dsimp [x]; nlinarith [Nat.cast_nonneg (α := ℝ) n] + have hxlog := Real.log_nonneg hx + have hb : 1 ≤ (n : ℝ) + 9 := by linarith [Nat.cast_nonneg (α := ℝ) n] + have hxab : x ≤ a * ((n : ℝ) + 9) := by + dsimp [x, a] + nlinarith + have h0 : 0 ≤ 2 * ((n : ℝ) + 1) + 1 := by positivity + have h1 : 2 * ((n : ℝ) + 1) + 1 ≤ x := by dsimp [x]; nlinarith + have hm := completedDiskZeros_mass_bound χ ((n : ℝ) + 1) (by positivity) + change _ ≤ K * (2 * ((n : ℝ) + 1) + 1) * Real.log x at hm + have hp : K * (2 * ((n : ℝ) + 1) + 1) * Real.log x ≤ K * (x * (1 + Real.log x)) := by + nlinarith [mul_le_mul h1 (show Real.log x ≤ 1 + Real.log x by linarith) + hxlog (by linarith : 0 ≤ x)] + have hh := mul_le_mul_of_nonneg_left + (affine_log_growth_bound a ((n : ℝ) + 9) x ha hb hx hxab) hK.le + exact hm.trans (hp.trans (by convert hh using 1; ring)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedDiskZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedDiskZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..66833a3f28fca2983bdb2780ab73ac6980496a3f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedDiskZeros.lean @@ -0,0 +1,61 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterCompletedZeros +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteZeroQuotientNormalized +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroPartialSums + +namespace OAI + +/-! # Removing precisely the completed L-function zeros in an expanding disk -/ + +namespace Ostmann + +open Complex Metric Set +open scoped BigOperators Classical + +noncomputable def completedDiskZeros (χ : PrimitiveComplexCharacter) (R : ℝ) : Finset ℂ := + (criticalZerosUpTo χ (2 * R)).filter (fun z => ‖z‖ ≤ 2 * R) + +@[simp] theorem mem_completedDiskZeros (χ : PrimitiveComplexCharacter) (R : ℝ) (z : ℂ) : + z ∈ completedDiskZeros χ R ↔ ‖z‖ ≤ 2 * R ∧ χ.completed z = 0 := by + rw [completedDiskZeros, Finset.mem_filter, mem_criticalZerosUpTo] + constructor + · rintro ⟨⟨hz, _⟩, hn⟩ + exact ⟨hn, (χ.completed_zero_iff z).mpr hz⟩ + · rintro ⟨hn, hz⟩ + exact ⟨⟨(χ.completed_zero_iff z).mp hz, (abs_im_le_norm z).trans hn⟩, hn⟩ + +theorem completed_disk_quotient_exists (χ : PrimitiveComplexCharacter) (R : ℝ) : + ∃ g : ℂ → ℂ, (∀ z, AnalyticAt ℂ g z) ∧ + (∀ z, χ.completed z = finiteZeroPolynomial χ.completed (completedDiskZeros χ R) z * g z) ∧ + (∀ z ∈ closedBall (0 : ℂ) (2 * R), g z ≠ 0) := by + obtain ⟨g, hg, he, hne⟩ := remove_finite_analytic_zeros χ.completed χ.completed_analytic + χ.completed_order_ne_top (completedDiskZeros χ R) + refine ⟨g, hg, he, ?_⟩ + intro z hz + by_cases hm : z ∈ completedDiskZeros χ R + · exact hne z hm + · intro hzero + apply hm + refine (mem_completedDiskZeros χ R z).mpr ⟨?_, ?_⟩ + · simpa using hz + · rw [he, hzero, mul_zero] + +theorem completedDiskZeros_mass_bound (χ : PrimitiveComplexCharacter) (R : ℝ) (hR : 0 ≤ R) : + (∑ z ∈ completedDiskZeros χ R, (analyticOrderNatAt χ.completed z : ℝ)) ≤ + (32 / Real.log (14 / 13)) * (2 * R + 1) * Real.log ((χ.modulus : ℝ) * (2 * R + 2)) := by + have he : ∀ z ∈ completedDiskZeros χ R, + (analyticOrderNatAt χ.completed z : ℝ) = (characterZeroOrder χ z : ℝ) := by + intro z hz + have hr := ((χ.completed_zero_iff z).mp ((mem_completedDiskZeros χ R z).mp hz).2).1 + rw [characterZeroOrder_eq_nat] + congr 1 + exact (congrArg ENat.toNat (χ.L_order_eq_completed z hr)).symm + rw [Finset.sum_congr rfl he] + apply χ.full_zero_sum_rate (2 * R) (by positivity) + intro z hz + obtain ⟨hn, hz0⟩ := (mem_completedDiskZeros χ R z).mp hz + have hz' := (χ.completed_zero_iff z).mp hz0 + exact ⟨hz'.1, hz'.2.1, (abs_im_le_norm z).trans hn⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedFiniteLogDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedFiniteLogDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..97be4f3530bdceea14626216c03a7d8cddaa199e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedFiniteLogDerivative.lean @@ -0,0 +1,36 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CompletedDiskZeros +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteZeroPolynomialLogDerivative + +namespace OAI + +/-! # Logarithmic derivatives with precisely the disk zeros removed -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +noncomputable def completedZeroPartialFraction (χ : PrimitiveComplexCharacter) (R : ℝ) (s : ℂ) : ℂ := + ∑ z ∈ completedDiskZeros χ R, (analyticOrderNatAt χ.completed z : ℂ) / (s - z) + +theorem completed_logDeriv_remove_finite (χ : PrimitiveComplexCharacter) (R : ℝ) + (g : ℂ → ℂ) (hg : ∀ z, AnalyticAt ℂ g z) + (he : ∀ z, χ.completed z = finiteZeroPolynomial χ.completed (completedDiskZeros χ R) z * g z) + (s : ℂ) (hs : χ.completed s ≠ 0) : + logDeriv χ.completed s - completedZeroPartialFraction χ R s = logDeriv g s := by + have hsS : s ∉ completedDiskZeros χ R := fun h => hs ((mem_completedDiskZeros χ R s).mp h).2 + have hgn : g s ≠ 0 := by + intro h + exact hs (by rw [he, h, mul_zero]) + have hfun : χ.completed = fun z => finiteZeroPolynomial χ.completed (completedDiskZeros χ R) z * g z := funext he + have hsplit : logDeriv χ.completed s = + logDeriv (finiteZeroPolynomial χ.completed (completedDiskZeros χ R)) s + logDeriv g s := by + conv_lhs => rw [hfun] + exact logDeriv_fun_mul s (finiteZeroPolynomial_ne_zero _ _ s hsS) hgn + (finiteZeroPolynomial_analytic _ _ s).differentiableAt (hg s).differentiableAt + rw [hsplit, finiteZeroPolynomial_logDeriv _ _ s hsS] + simp [completedZeroPartialFraction] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedLogDerivativeSeparated.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedLogDerivativeSeparated.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad3c5af2b00d52b9bec054696258e75bf750c53c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedLogDerivativeSeparated.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterResolventBound +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterHadamardBounds + +namespace OAI + +/-! # The completed logarithmic derivative away from the actual zeros -/ + +namespace Ostmann + +open Complex Filter +open scoped BigOperators Topology + +theorem completed_logDeriv_difference_bound (χ : PrimitiveComplexCharacter) + (s w : ℂ) (A δ : ℝ) (hA : 0 ≤ A) (hδ : 0 < δ) + (hw : w.re = 2) (hshift : ‖w - s‖ ≤ A) + (hsep : ∀ i : ℕ, δ ≤ ‖s - (actualCharacterZeros χ).zeros i‖) : + ‖logDeriv χ.completed s - logDeriv χ.completed w‖ ≤ + A * (1 + A / δ) * characterRealZeroSum χ w := by + have hsne : χ.completed s ≠ 0 := by + intro hz + obtain ⟨i, hi⟩ := actualCharacterZeros_complete χ s ((χ.completed_zero_iff s).mp hz) + have hh := hsep i + rw [hi, sub_self, norm_zero] at hh + linarith + have hwne : χ.completed w ≠ 0 := χ.completed_ne_zero_right w (by linarith) + have hsum := character_real_zero_summable χ w (by linarith) (by linarith) + have hbound (n : ℕ) : + ‖completedZeroPartialFraction χ ((n : ℝ) + 1) s - + completedZeroPartialFraction χ ((n : ℝ) + 1) w‖ ≤ + A * (1 + A / δ) * characterRealZeroSum χ w := by + rw [completedZeroPartialFraction_index_sum χ (faithfulCharacterZeroEquiv χ), + completedZeroPartialFraction_index_sum χ (faithfulCharacterZeroEquiv χ), + ← Finset.sum_sub_distrib] + apply (norm_sum_le _ _).trans + calc + _ ≤ ∑ i ∈ (actualCharacterZeros χ).diskIndices ((n : ℝ) + 1), + (A * (1 + A / δ)) * ((w - (actualCharacterZeros χ).zeros i)⁻¹).re := by + apply Finset.sum_le_sum + intro i _ + exact zero_resolvent_difference_bound s w _ A δ hA hδ (hsep i) hshift (by + change 1 ≤ w.re - ((actualCharacterZeros χ).zeros i).re + rw [hw] + linarith [((actualCharacterZeros χ).in_strip i).2]) + _ ≤ A * (1 + A / δ) * characterRealZeroSum χ w := by + rw [← Finset.mul_sum] + apply mul_le_mul_of_nonneg_left _ (by positivity) + exact hsum.sum_le_tsum _ (fun i _ => by + rw [realZeroKernel_complex_sub] + exact realZeroKernel_nonneg (by linarith [((actualCharacterZeros χ).in_strip i).2])) + have hlim := (completed_partial_fraction_difference_tendsto χ w s hwne hsne).norm + exact le_of_tendsto hlim (Filter.Eventually.of_forall hbound) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedPartialFractionLimit.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedPartialFractionLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..724b3999d84b62760e30b0980285bf23ddf85d12 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedPartialFractionLimit.lean @@ -0,0 +1,62 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CompletedFiniteLogDerivative +import OAI.NumberTheory.Ostmann.ZeroDensity.CompletedQuotientGrowth +import OAI.NumberTheory.Ostmann.ZeroDensity.LogarithmicDiskRate + +namespace OAI + +/-! # The limit of actual completed-L logarithmic-derivative differences -/ + +namespace Ostmann + +open Complex Filter Metric Set +open scoped Topology + +/-- Subtracting at two fixed nonzero points cancels the constant logarithmic +part. This is the exact part of Hadamard factorization needed below. -/ +theorem completed_partial_fraction_difference_tendsto (χ : PrimitiveComplexCharacter) + (x y : ℂ) (hx : χ.completed x ≠ 0) (hy : χ.completed y ≠ 0) : + Tendsto (fun n : ℕ => completedZeroPartialFraction χ ((n : ℝ) + 1) y - + completedZeroPartialFraction χ ((n : ℝ) + 1) x) atTop + (𝓝 (logDeriv χ.completed y - logDeriv χ.completed x)) := by + obtain ⟨C, hC, hgrowth⟩ := completed_quotient_log_growth χ + let D : ℝ := |Real.log ‖χ.completed 0‖| + 1 + let A : ℕ → ℝ := fun n => C * ((n : ℝ) + 9) * (1 + Real.log ((n : ℝ) + 9)) + D + have hA (n : ℕ) : 0 < A n := by + have hl : 0 ≤ Real.log ((n : ℝ) + 9) := Real.log_nonneg (by linarith [Nat.cast_nonneg (α := ℝ) n]) + dsimp [A, D] + positivity + have hlim : Tendsto (fun n : ℕ => + (64 * A n / (2 * ((n : ℝ) + 1)) ^ 2) * ‖y - x‖) atTop (𝓝 0) := by + have hh := (logarithmic_disk_rate C 9 D (by norm_num)).const_mul (16 * ‖y - x‖) + simp only [mul_zero] at hh + convert hh using 1 + funext n + dsimp [A] + have hn : (n : ℝ) + 1 ≠ 0 := by positivity + field_simp [hn] + ring + have hlarge := (tendsto_natCast_atTop_atTop (R := ℝ)).eventually_ge_atTop (2 * (‖x‖ + ‖y‖) + 1) + apply tendsto_iff_norm_sub_tendsto_zero.mpr + apply squeeze_zero' (Filter.Eventually.of_forall (fun _ => norm_nonneg _)) ?_ hlim + filter_upwards [hlarge] with n hn + obtain ⟨g, hg, he, hne, hl⟩ := hgrowth n + have hxsize : ‖x‖ ≤ (2 * ((n : ℝ) + 1)) / 4 := by linarith [norm_nonneg y] + have hysize : ‖y‖ ≤ (2 * ((n : ℝ) + 1)) / 4 := by linarith [norm_nonneg x] + have hh := logDeriv_disk_oscillation g (2 * ((n : ℝ) + 1)) (A n) + (by positivity) (hA n) (fun z _ => hg z) + (fun z hz => hne z (ball_subset_closedBall hz)) + (by simpa only [A, D, add_assoc] using hl) x y hxsize hysize + have hx' := completed_logDeriv_remove_finite χ ((n : ℝ) + 1) g hg he x hx + have hy' := completed_logDeriv_remove_finite χ ((n : ℝ) + 1) g hg he y hy + have herr : (completedZeroPartialFraction χ ((n : ℝ) + 1) y - + completedZeroPartialFraction χ ((n : ℝ) + 1) x) - + (logDeriv χ.completed y - logDeriv χ.completed x) = + -(logDeriv g y - logDeriv g x) := by + rw [← hx', ← hy'] + ring + rw [herr, norm_neg] + exact hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedQuotientGrowth.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedQuotientGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f1e15a4a4fbf9f3b0003709de052cf7edd5a8cd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/CompletedQuotientGrowth.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CompletedDiskGrowthRate +import OAI.NumberTheory.Ostmann.ZeroDensity.LogDerivativeDiskOscillation + +namespace OAI + +/-! # Uniform normalized growth of the actual zero-removed quotients -/ + +namespace Ostmann + +open Complex Metric Set +open scoped BigOperators + +theorem completed_quotient_log_growth (χ : PrimitiveComplexCharacter) : + ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, ∃ g : ℂ → ℂ, + (∀ z, AnalyticAt ℂ g z) ∧ + (∀ z, χ.completed z = + finiteZeroPolynomial χ.completed (completedDiskZeros χ ((n : ℝ) + 1)) z * g z) ∧ + (∀ z ∈ closedBall (0 : ℂ) (2 * ((n : ℝ) + 1)), g z ≠ 0) ∧ + (∀ z ∈ ball (0 : ℂ) (2 * ((n : ℝ) + 1)), + Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ + C * ((n : ℝ) + 9) * (1 + Real.log ((n : ℝ) + 9)) + + |Real.log ‖χ.completed 0‖| + 1) := by + obtain ⟨U, hU, hf⟩ := completed_circle_log_growth χ + obtain ⟨V, hV, hmass⟩ := completed_disk_mass_log_growth χ + have hl2 : 0 ≤ Real.log 2 := Real.log_nonneg (by norm_num) + refine ⟨U + V * Real.log 2 + 1, by positivity, ?_⟩ + intro n + let R : ℝ := (n : ℝ) + 1 + let B : ℝ := ((n : ℝ) + 9) * (1 + Real.log ((n : ℝ) + 9)) + let M : ℝ := Real.exp (U * B) + have hR : 0 < R := by dsimp [R]; positivity + have hB : 0 < B := by + have hh : 0 ≤ Real.log ((n : ℝ) + 9) := Real.log_nonneg (by linarith [Nat.cast_nonneg (α := ℝ) n]) + dsimp [B] + positivity + have hM : 0 < M := Real.exp_pos _ + have hf0 : χ.completed 0 ≠ 0 := χ.completed_ne_zero_left 0 (by simp) + obtain ⟨g, hg, he, hne⟩ := completed_disk_quotient_exists χ R + refine ⟨g, hg, he, hne, ?_⟩ + intro z hz + have hfM : ∀ w ∈ sphere (0 : ℂ) (3 * R), ‖χ.completed w‖ ≤ M := by + intro w hw + have hwn : ‖w‖ = 3 * R := by simpa using hw + have hh := hf n w (by change ‖w‖ ≤ 3 * R; exact hwn.le) + apply (Real.le_exp_log ‖χ.completed w‖).trans + apply Real.exp_le_exp.mpr + simpa only [B, mul_assoc] using hh + have hb := finite_zero_quotient_normalized_log χ.completed g (completedDiskZeros χ R) + R M hR hM hf0 (fun w hw => ((mem_completedDiskZeros χ R w).mp hw).1) hg he + hfM z (ball_subset_closedBall hz) (hne z (ball_subset_closedBall hz)) + have hm := mul_le_mul_of_nonneg_right (hmass n) hl2 + dsimp only [M] at hb + rw [Real.log_exp] at hb + dsimp only [R, B] at hb + nlinarith [neg_le_abs (Real.log ‖χ.completed 0‖)] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexCharacterConjugation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexCharacterConjugation.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2b388b67f9a903e2e113b2b30044d76199710da --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexCharacterConjugation.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterConjugateZeros + +namespace OAI + +/-! # Conjugation and multiplicity for general primitive character zeros -/ + +namespace Ostmann + +open Complex Filter Set +open scoped ComplexConjugate Topology + +theorem iteratedDeriv_conjugation (f : ℂ → ℂ) (n : ℕ) : + iteratedDeriv n (conj ∘ f ∘ conj) = conj ∘ iteratedDeriv n f ∘ conj := by + induction n with + | zero => rfl + | succ n ih => simp only [iteratedDeriv_succ, ih, deriv_conj_conj] + +theorem analyticOrderAt_conjugation (f : ℂ → ℂ) (hf : ∀ z, AnalyticAt ℂ f z) + (z : ℂ) (hfinite : analyticOrderAt f (conj z) ≠ ⊤) : + analyticOrderAt (conj ∘ f ∘ conj) z = analyticOrderAt f (conj z) := by + have hd : Differentiable ℂ (conj ∘ f ∘ conj) := by + intro w + simpa only [Complex.conj_conj] using (hf (conj w)).differentiableAt.conj_conj + have hg := hd.analyticAt z + have hn : analyticOrderAt f (conj z) = (analyticOrderNatAt f (conj z) : ℕ∞) := + (Nat.cast_analyticOrderNatAt hfinite).symm + rw [hn] + apply (analyticOrderAt_eq_nat_iff_iteratedDeriv_eq_zero hg).mpr + have hh := (analyticOrderAt_eq_nat_iff_iteratedDeriv_eq_zero (hf (conj z))).mp hn + simp only [iteratedDeriv_conjugation, Function.comp_apply] + constructor + · intro k hk + rw [hh.1 k hk, map_zero] + · intro he + apply hh.2 + have he' := congrArg conj he + simpa only [Complex.conj_conj, map_zero] using he' + +theorem PrimitiveComplexCharacter.inverse_L_conj_right (χ : PrimitiveComplexCharacter) + (s : ℂ) (hs : 1 < s.re) : χ.inverse.L (conj s) = conj (χ.L s) := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + change DirichletCharacter.LFunction (χ.character⁻¹) (conj s) = + conj (DirichletCharacter.LFunction χ.character s) + rw [(χ.character⁻¹).LFunction_eq_LSeries (by simpa using hs), χ.character.LFunction_eq_LSeries hs] + change (∑' n, LSeries.term _ (conj s) n) = conj (∑' n, LSeries.term _ s n) + rw [Complex.conj_tsum] + apply tsum_congr + intro n + by_cases hn : n = 0 + · subst n; simp + · rw [LSeries.term_of_ne_zero hn, LSeries.term_of_ne_zero hn] + have ha : (n : ℂ).arg ≠ Real.pi := by + rw [show (n : ℂ) = ((n : ℝ) : ℂ) from rfl, + Complex.arg_ofReal_of_nonneg (Nat.cast_nonneg n)] + exact Real.pi_pos.ne + rw [Complex.cpow_conj _ _ ha] + simp only [map_div₀, map_natCast, ← MulChar.star_eq_inv, MulChar.star_apply, RCLike.star_def] + +theorem PrimitiveComplexCharacter.inverse_L_eq_conjugate (χ : PrimitiveComplexCharacter) : + χ.inverse.L = conj ∘ χ.L ∘ conj := by + have hd : Differentiable ℂ (conj ∘ χ.L ∘ conj) := by + intro z + simpa only [Complex.conj_conj] using (χ.L_analytic (conj z)).differentiableAt.conj_conj + have hg := hd.differentiableOn.analyticOnNhd isOpen_univ + have hf : AnalyticOnNhd ℂ χ.inverse.L univ := fun z _ => χ.inverse.L_analytic z + apply hf.eq_of_eventuallyEq hg (z₀ := (2 : ℂ)) + filter_upwards [(isOpen_lt continuous_const Complex.continuous_re).mem_nhds + (show (1 : ℝ) < (2 : ℂ).re by norm_num)] with z hz + simpa only [Function.comp_apply, Complex.conj_conj] using + χ.inverse_L_conj_right (conj z) (by simpa using hz) + +theorem PrimitiveComplexCharacter.L_order_conjugate (χ : PrimitiveComplexCharacter) (z : ℂ) : + analyticOrderAt χ.inverse.L (conj z) = analyticOrderAt χ.L z := by + rw [χ.inverse_L_eq_conjugate, analyticOrderAt_conjugation χ.L χ.L_analytic] + · simp + · simpa using χ.L_order_ne_top z + +theorem PrimitiveComplexCharacter.L_order_self_reflection (χ : PrimitiveComplexCharacter) + (z : ℂ) (hz : 0 < z.re) (hz1 : z.re < 1) : + analyticOrderAt χ.L (1 - conj z) = analyticOrderAt χ.L z := by + rw [χ.L_order_reflection (conj z) (by simpa using hz) (by simpa using hz1), χ.L_order_conjugate] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexCharacterHadamard.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexCharacterHadamard.lean new file mode 100644 index 0000000000000000000000000000000000000000..6cb06b0004c6d4e299bc55661b84b328cac46280 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexCharacterHadamard.lean @@ -0,0 +1,93 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CompletedCharacterConjugation +import OAI.NumberTheory.Ostmann.Characters.CharacterSelfReflection +import OAI.NumberTheory.Ostmann.ZeroDensity.ShiftedRealHadamard + +namespace OAI + +/-! # The actual real-part Hadamard identity for complex characters -/ + +namespace Ostmann + +open Complex Filter +open scoped Topology BigOperators ComplexConjugate + +noncomputable def characterRealZeroSum (χ : PrimitiveComplexCharacter) (s : ℂ) : ℝ := + ∑' i, ((s - (actualCharacterZeros χ).zeros i)⁻¹).re + +theorem character_real_zero_summable (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : 1 < s.re) (hs2 : s.re ≤ 2) : + Summable (fun i => ((s - (actualCharacterZeros χ).zeros i)⁻¹).re) := by + let Z := actualCharacterZeros χ + have hh := character_zero_inverse_square_summable χ + let C := 8 + 4 * (s.re - 1)⁻¹ + have hC : 0 ≤ C := by dsimp [C]; positivity + apply Summable.of_nonneg_of_le + (fun i => by rw [realZeroKernel_complex_sub]; exact realZeroKernel_nonneg (by linarith [(Z.in_strip i).2])) + (fun i => ?_) (hh.mul_left (C * (1 + |s.im|) ^ 2)) + rw [realZeroKernel_complex_sub] + calc + _ ≤ C * ((1 + |s.im - (Z.zeros i).im|) ^ 2)⁻¹ := + real_zero_kernel_square_bound _ _ (s.re - 1) (by linarith) + (by linarith [(Z.in_strip i).2]) (by linarith [(Z.in_strip i).1]) + _ ≤ C * ((1 + |s.im|) ^ 2 * ((1 + |(Z.zeros i).im|) ^ 2)⁻¹) := + mul_le_mul_of_nonneg_left (inverse_square_shift_bound _ _) hC + _ = _ := by dsimp [Z]; ring + +theorem character_completed_partial_real_limit (χ : PrimitiveComplexCharacter) (s : ℂ) + (hsum : Summable (fun i => ((s - (actualCharacterZeros χ).zeros i)⁻¹).re)) : + Tendsto (fun n : ℕ => (completedZeroPartialFraction χ ((n : ℝ) + 1) s).re) + atTop (𝓝 (characterRealZeroSum χ s)) := by + let Z := actualCharacterZeros χ + have hn : Tendsto (fun n : ℕ => (n : ℝ) + 1) atTop atTop := + tendsto_atTop_add_const_right _ _ tendsto_natCast_atTop_atTop + have hh := hsum.hasSum.comp (Z.tendsto_diskIndices.comp hn) + unfold characterRealZeroSum + convert hh using 1 + funext n + rw [completedZeroPartialFraction_index_sum χ (faithfulCharacterZeroEquiv χ), Complex.re_sum] + rfl + +theorem character_real_zero_self_reflection (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : 1 < s.re) (hs2 : s.re ≤ 2) : + Summable (fun i => ((1 - conj s - (actualCharacterZeros χ).zeros i)⁻¹).re) ∧ + characterRealZeroSum χ (1 - conj s) = -characterRealZeroSum χ s := by + have he (i : ℕ) : ((1 - conj s - (actualCharacterZeros χ).zeros i)⁻¹).re = + -((s - (actualCharacterZeros χ).zeros (characterZeroIndexSelfReflection χ i))⁻¹).re := by + rw [characterZeroIndexSelfReflection_zeros] + have ha : s - (1 - conj ((actualCharacterZeros χ).zeros i)) = + -conj (1 - conj s - (actualCharacterZeros χ).zeros i) := by simp; ring + rw [ha, inv_neg, Complex.neg_re, neg_neg, ← map_inv₀, Complex.conj_re] + have hsum := character_real_zero_summable χ s hs hs2 + constructor + · simpa only [he, Function.comp_def] using + (hsum.comp_injective (characterZeroIndexSelfReflection χ).injective).neg + · unfold characterRealZeroSum + simp_rw [he] + rw [tsum_neg] + congr 1 + exact (characterZeroIndexSelfReflection χ).tsum_eq + (fun i => ((s - (actualCharacterZeros χ).zeros i)⁻¹).re) + +/-- The conjugate functional equation cancels the constant term, yielding the +actual zero sum used in the full-height zero-free argument. -/ +theorem complex_character_hadamard_identity (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : 1 < s.re) (hs2 : s.re ≤ 2) : + characterRealZeroSum χ s = (logDeriv χ.completed s).re + + (1 / 2) * Real.log χ.modulus := by + have hp := character_completed_partial_real_limit χ s (character_real_zero_summable χ s hs hs2) + obtain ⟨hn, heq⟩ := character_real_zero_self_reflection χ s hs hs2 + have hm := character_completed_partial_real_limit χ (1 - conj s) hn + have hc := completed_partial_fraction_difference_tendsto χ (1 - conj s) s + (χ.completed_ne_zero_left _ (by simp; linarith)) (χ.completed_ne_zero_right _ hs.le) + have hr := Complex.continuous_re.continuousAt.tendsto.comp hc + have hlim : characterRealZeroSum χ s - characterRealZeroSum χ (1 - conj s) = + (logDeriv χ.completed s - logDeriv χ.completed (1 - conj s)).re := by + apply tendsto_nhds_unique (hp.sub hm) + simpa only [Function.comp_def, Complex.sub_re] using hr + rw [heq, χ.completed_logDeriv_self_reflection s hs.le] at hlim + simp only [Complex.sub_re, Complex.neg_re, Complex.conj_re, Complex.log_re, Complex.norm_natCast] at hlim + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexCharacterTrigonometric.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexCharacterTrigonometric.lean new file mode 100644 index 0000000000000000000000000000000000000000..b6fbec608637b149d85b5add4570eaa2b5573a90 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexCharacterTrigonometric.lean @@ -0,0 +1,86 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterTrigonometric + +namespace OAI + +/-! # The 3-4-1 Euler inequality for every complex Dirichlet character -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +theorem complex_character_polynomial_nonneg (v : ℂ) (hv : ‖v‖ ≤ 1) : + 0 ≤ 3 + 4 * v.re + (v * v).re := by + have hsq := Complex.sq_norm v + have hn := norm_nonneg v + simp only [Complex.normSq_apply] at hsq + rw [Complex.mul_re] + nlinarith [sq_nonneg (v.re + 1)] + +theorem complex_character_trigonometric_term_nonneg {q : ℕ} + (χ : DirichletCharacter ℂ q) (σ t : ℝ) (n : ℕ) : + 0 ≤ 3 * (LSeries.term (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ) n).re + + 4 * (LSeries.term (fun n => χ n * (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + (t : ℂ) * I) n).re + + (LSeries.term (fun n => (χ ^ 2) n * (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + ((2 * t : ℝ) : ℂ) * I) n).re := by + by_cases hn : n = 0 + · subst n; simp + let u : ℂ := (n : ℂ) ^ (-(t : ℂ) * I) + have hu : ‖u‖ = 1 := by + dsimp [u] + rw [Complex.norm_natCast_cpow_of_pos (Nat.pos_of_ne_zero hn)] + simp + have hv : ‖χ n * u‖ ≤ 1 := by simpa [norm_mul, hu] using χ.norm_le_one n + have hp := complex_character_polynomial_nonneg (χ n * u) hv + have hb : 0 ≤ ArithmeticFunction.vonMangoldt n * (n : ℝ) ^ (-σ) := + mul_nonneg ArithmeticFunction.vonMangoldt_nonneg (Real.rpow_nonneg (Nat.cast_nonneg n) _) + have hphase : (n : ℂ) ^ (-((2 * t : ℝ) : ℂ) * I) = u * u := by + rw [show -((2 * t : ℝ) : ℂ) * I = -(t : ℂ) * I + -(t : ℂ) * I by push_cast; ring] + exact Complex.cpow_add _ _ (by exact_mod_cast hn) + have hzero := LSeries_term_vertical (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) n hn σ 0 + simp only [Complex.ofReal_zero, neg_zero, zero_mul, Complex.cpow_zero, mul_one, add_zero] at hzero + rw [hzero, LSeries_term_vertical _ n hn, LSeries_term_vertical _ n hn, hphase] + have hsquare : (χ ^ 2) n = χ n * χ n := by simp [pow_two] + rw [hsquare] + convert mul_nonneg hb hp using 1 + simp only [Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im] + ring + +theorem dirichlet_mangoldt_LSeries_eq {q : ℕ} [NeZero q] + (χ : DirichletCharacter ℂ q) (s : ℂ) (hs : 1 < s.re) : + LSeries (fun n => χ n * (ArithmeticFunction.vonMangoldt n : ℂ)) s = + -logDeriv (DirichletCharacter.LFunction χ) s := by + have he := χ.LSeries_twist_vonMangoldt_eq hs + rw [← χ.deriv_LFunction_eq_deriv_LSeries hs, ← χ.LFunction_eq_LSeries hs] at he + exact he.trans (neg_div _ _) + +theorem complex_character_trigonometric_sum_nonneg {q : ℕ} + (χ : DirichletCharacter ℂ q) (σ t : ℝ) (hσ : 1 < σ) : + 0 ≤ 3 * (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ)).re + + 4 * (LSeries (fun n => χ n * (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + (t : ℂ) * I)).re + + (LSeries (fun n => (χ ^ 2) n * (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + ((2 * t : ℝ) : ℂ) * I)).re := by + have h0 := ArithmeticFunction.LSeriesSummable_vonMangoldt (s := (σ : ℂ)) hσ + have h1 := χ.LSeriesSummable_twist_vonMangoldt + (s := (σ : ℂ) + (t : ℂ) * I) (by simpa using hσ) + change LSeriesSummable (fun n => χ n * (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + (t : ℂ) * I) at h1 + have h2 := (χ ^ 2).LSeriesSummable_twist_vonMangoldt + (s := (σ : ℂ) + ((2 * t : ℝ) : ℂ) * I) (by simpa using hσ) + change LSeriesSummable (fun n => (χ ^ 2) n * (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + ((2 * t : ℝ) : ℂ) * I) at h2 + have hh := tsum_nonneg (L := SummationFilter.unconditional ℕ) + (complex_character_trigonometric_term_nonneg χ σ t) + have h0r := (Complex.hasSum_re h0.hasSum).summable + have h1r := (Complex.hasSum_re h1.hasSum).summable + have h2r := (Complex.hasSum_re h2.hasSum).summable + rw [Summable.tsum_add ((h0r.mul_left 3).add (h1r.mul_left 4)) h2r, + Summable.tsum_add (h0r.mul_left 3) (h1r.mul_left 4), tsum_mul_left, tsum_mul_left, + ← Complex.re_tsum h0, ← Complex.re_tsum h1, ← Complex.re_tsum h2] at hh + exact hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexDensityProof.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexDensityProof.lean new file mode 100644 index 0000000000000000000000000000000000000000..e048ec7f0bb33d0a50ce430d29beaa3a48dbb39d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexDensityProof.lean @@ -0,0 +1,79 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityAllZeros +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityNearCritical + +namespace OAI + +/-! # The actual Montgomery–Inoue zero-density input + +The detector, fourth moment and large sieve prove the separated bound. Jensen +counts retain every analytic multiplicity when passing to the full enumeration. +This discharges the instance of Montgomery, *Zeros of L-functions* (1969), +Theorem 1, recorded in Inoue (2021), Lemma 1, needed by the main proof. +-/ + +namespace Ostmann + +open scoped BigOperators + + theorem density_ten_to_thirteen_logs (L : ℝ) (hL : Real.log 2 ≤ L) : + L ^ 10 ≤ (Real.log 2)⁻¹ ^ 3 * L ^ 13 := by + have hl : 0 < Real.log 2 := Real.log_pos (by norm_num) + have hp := pow_le_pow_left₀ hl.le hL 3 + calc + L ^ 10 = (Real.log 2)⁻¹ ^ 3 * ((Real.log 2) ^ 3 * L ^ 10) := by + rw [← mul_assoc, ← mul_pow, inv_mul_cancel₀ hl.ne', one_pow, one_mul] + _ ≤ (Real.log 2)⁻¹ ^ 3 * (L ^ 3 * L ^ 10) := by gcongr + _ = _ := by ring + + theorem publishedComplexZeroDensity : PublishedComplexZeroDensity actualCharacterZeros := by + obtain ⟨C1, hC1, hnear⟩ := density_near_critical_family + obtain ⟨C2, hC2, hfar⟩ := density_all_zero_count + refine ⟨C1 + C2 * (Real.log 2)⁻¹ ^ 3, by positivity, ?_⟩ + intro Q hQ T σ hT hσ hσ1 F hF + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hB : 1 < (Q : ℝ) ^ 2 * T := by nlinarith + have hlogB : 0 < Real.log ((Q : ℝ) ^ 2 * T) := Real.log_pos hB + have hL : Real.log 2 ≤ Real.log ((Q : ℝ) * T) := + Real.log_le_log (by norm_num) (by nlinarith) + have hL0 : 0 ≤ Real.log ((Q : ℝ) * T) := (Real.log_pos (by norm_num : (1 : ℝ) < 2)).le.trans hL + by_cases hn : σ ≤ 1 / 2 + 1 / Real.log ((Q : ℝ) ^ 2 * T) + · exact (hnear Q hQ T σ hT hσ hσ1 hn F hF).trans + (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (le_add_of_nonneg_right (by positivity) : + C1 ≤ C1 + C2 * (Real.log 2)⁻¹ ^ 3) (by positivity)) (by positivity)) + · have hs : 1 / 2 < σ := by + have hi : 0 < 1 / Real.log ((Q : ℝ) ^ 2 * T) := by positivity + linarith + have hb4 : 4 ≤ (Q : ℝ) ^ 2 * T := by + by_contra hh + have hle : (Q : ℝ) ^ 2 * T ≤ 4 := le_of_lt (lt_of_not_ge hh) + have hlog : Real.log ((Q : ℝ) ^ 2 * T) ≤ 2 := by + have h := Real.log_le_log (by linarith) hle + have h4 : Real.log (4 : ℝ) = 2 * Real.log 2 := by + have hp := Real.log_pow (2 : ℝ) 2 + norm_num at hp + exact hp + rw [h4] at h + have h2 := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 2) + linarith + have hi : (1 / 2 : ℝ) ≤ 1 / Real.log ((Q : ℝ) ^ 2 * T) := + (le_div_iff₀ hlogB).mpr (by linarith) + apply hn + linarith + have hg : 1 / Real.log ((Q : ℝ) ^ 2 * T) ≤ σ - 1 / 2 := by linarith + have hf := hfar Q hQ T σ hT hb4 hs hσ1 hg F hF + have ha := density_ten_to_thirteen_logs (Real.log ((Q : ℝ) * T)) hL + calc + _ ≤ C2 * ((Q : ℝ) ^ 2 * T) ^ densityTargetExponent σ * + (Real.log ((Q : ℝ) * T)) ^ 10 := hf + _ ≤ C2 * ((Q : ℝ) ^ 2 * T) ^ densityTargetExponent σ * + ((Real.log 2)⁻¹ ^ 3 * (Real.log ((Q : ℝ) * T)) ^ 13) := by + exact mul_le_mul_of_nonneg_left ha (by positivity) + _ = (C2 * (Real.log 2)⁻¹ ^ 3) * ((Q : ℝ) ^ 2 * T) ^ (3 * (1 - σ) / (2 - σ)) * + (Real.log ((Q : ℝ) * T)) ^ 13 := by unfold densityTargetExponent; ring + _ ≤ _ := by + exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right + (le_add_of_nonneg_left hC1.le) (by positivity)) (by positivity) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexLowZeroBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexLowZeroBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f402ec8dbe8cf88d7b6d38777c6d317bcbd37d0 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexLowZeroBound.lean @@ -0,0 +1,103 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedComplexZeroDensity +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteLaplaceDensity + +namespace OAI + +/-! # The low-zero Laplace estimate from the published density theorem -/ + +namespace Ostmann +open scoped Classical BigOperators + +noncomputable def lowZeroIndices (Z : ∀ χ, ComplexZeroEnumeration χ) + (F : Finset PrimitiveComplexCharacter) (T : ℝ) : Finset (Σ _χ : PrimitiveComplexCharacter, ℕ) := + F.sigma fun χ => ((Z χ).heightIndices T).filter (fun i => 1 / 2 ≤ ((Z χ).zeros i).re) + +theorem complex_zero_density_exponential + (Z : ∀ χ, ComplexZeroEnumeration χ) {C : ℝ} (hC : 0 ≤ C) + (hdensity : ∀ (Q : ℕ), 1 ≤ Q → ∀ (T σ : ℝ), 2 ≤ T → + 1 / 2 ≤ σ → σ ≤ 1 → ∀ F : Finset PrimitiveComplexCharacter, + (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ((Z χ).count σ T : ℝ)) ≤ + C * ((Q : ℝ) ^ 2 * T) ^ (3 * (1 - σ) / (2 - σ)) * + (Real.log ((Q : ℝ) * T)) ^ 13) + (Q : ℕ) (hQ : 1 ≤ Q) (T y : ℝ) (hT : 2 ≤ T) (hy : 0 ≤ y) (hy' : y ≤ 1 / 2) + (F : Finset PrimitiveComplexCharacter) (hF : ∀ χ ∈ F, χ.modulus ≤ Q) : + (∑ χ ∈ F, ((Z χ).count (1 - y) T : ℝ)) ≤ + (C * (Real.log ((Q : ℝ) * T)) ^ 13) * + Real.exp ((3 * Real.log ((Q : ℝ) ^ 2 * T)) * y) := by + have hQr : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hbase : 1 ≤ (Q : ℝ) ^ 2 * T := by nlinarith + have hlog : 0 ≤ Real.log ((Q : ℝ) * T) := Real.log_nonneg (by nlinarith) + have hexp : 3 * (1 - (1 - y)) / (2 - (1 - y)) ≤ 3 * y := by + calc + _ = 3 * y / (1 + y) := by congr 1 <;> ring + _ ≤ 3 * y := div_le_self (by positivity) (by linarith) + have hp := Real.rpow_le_rpow_of_exponent_le hbase hexp + have hd := hdensity Q hQ T (1 - y) hT (by linarith) (by linarith) F hF + apply hd.trans + have hm := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hp hC) + (pow_nonneg hlog 13) + have he : ((Q : ℝ) ^ 2 * T) ^ (3 * y) = + Real.exp ((3 * Real.log ((Q : ℝ) ^ 2 * T)) * y) := by + rw [Real.rpow_def_of_pos (by linarith : 0 < (Q : ℝ) ^ 2 * T)] + congr 1 + ring + rw [he] at hm + convert hm using 1 + ring + +theorem lowZeroIndices_count_bound + (Z : ∀ χ, ComplexZeroEnumeration χ) (F : Finset PrimitiveComplexCharacter) + (T A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) + (hd : ∀ y : ℝ, 0 ≤ y → y ≤ 1 / 2 → + (∑ χ ∈ F, ((Z χ).count (1 - y) T : ℝ)) ≤ B * Real.exp (A * y)) : + ∀ t : ℝ, 0 ≤ t → + (((lowZeroIndices Z F T).filter + (fun z => 1 - ((Z z.1).zeros z.2).re ≤ t)).card : ℝ) ≤ B * Real.exp (A * t) := by + intro t ht + let y := min t (1 / 2 : ℝ) + have hy : 0 ≤ y := le_min ht (by norm_num) + have hy' : y ≤ 1 / 2 := min_le_right _ _ + have hsub : (lowZeroIndices Z F T).filter + (fun z => 1 - ((Z z.1).zeros z.2).re ≤ t) ⊆ + F.sigma (fun χ => ((Z χ).heightIndices T).filter + (fun i => 1 - y ≤ ((Z χ).zeros i).re)) := by + intro z hz + obtain ⟨hz, hgap⟩ := Finset.mem_filter.mp hz + obtain ⟨hχ, hi⟩ := Finset.mem_sigma.mp hz + obtain ⟨hi, hre⟩ := Finset.mem_filter.mp hi + apply Finset.mem_sigma.mpr + refine ⟨hχ, Finset.mem_filter.mpr ⟨hi, ?_⟩⟩ + have hh : 1 - ((Z z.1).zeros z.2).re ≤ y := le_min hgap (by linarith) + linarith + calc + _ ≤ ((F.sigma (fun χ => ((Z χ).heightIndices T).filter + (fun i => 1 - y ≤ ((Z χ).zeros i).re))).card : ℝ) := by + exact_mod_cast Finset.card_le_card hsub + _ = ∑ χ ∈ F, ((Z χ).count (1 - y) T : ℝ) := by + rw [Finset.card_sigma, Nat.cast_sum] + rfl + _ ≤ B * Real.exp (A * y) := hd y hy hy' + _ ≤ B * Real.exp (A * t) := mul_le_mul_of_nonneg_left + (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left (min_le_left _ _) hA)) hB + +theorem low_zero_laplace_bound + (Z : ∀ χ, ComplexZeroEnumeration χ) (F : Finset PrimitiveComplexCharacter) + (T A B M u : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (hM : 4 * A ≤ M) (hu : 0 ≤ u) + (hgap : ∀ χ ∈ F, ∀ i ∈ (Z χ).heightIndices T, u ≤ 1 - ((Z χ).zeros i).re) + (hd : ∀ y : ℝ, 0 ≤ y → y ≤ 1 / 2 → + (∑ χ ∈ F, ((Z χ).count (1 - y) T : ℝ)) ≤ B * Real.exp (A * y)) : + (∑ χ ∈ F, ∑ i ∈ ((Z χ).heightIndices T).filter + (fun i => 1 / 2 ≤ ((Z χ).zeros i).re), + Real.exp (-M * (1 - ((Z χ).zeros i).re))) ≤ + 2 * B ^ 2 * Real.exp (-(M * u) / 2) := by + have hh := finite_laplace_density_bound (lowZeroIndices Z F T) + (fun z => 1 - ((Z z.1).zeros z.2).re) A B M u hA hB hM hu + (fun z hz => hgap z.1 (Finset.mem_sigma.mp hz).1 z.2 + (Finset.mem_filter.mp (Finset.mem_sigma.mp hz).2).1) + (lowZeroIndices_count_bound Z F T A B hA hB hd) + simpa only [lowZeroIndices, Finset.sum_sigma] using hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexPrimeWeights.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexPrimeWeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb2bbcd1ed754566a5fcb0c46b7653d2fdf746b1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexPrimeWeights.lean @@ -0,0 +1,87 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.PrimeIntervalVariation +import OAI.NumberTheory.Ostmann.Arithmetic.WeightedPrimeIntervals + +namespace OAI + +/-! # Complex smooth weights on actual prime intervals -/ + +namespace Ostmann +open MeasureTheory +open scoped BigOperators + +noncomputable def complexPrimeInterval (q a : ℕ) (s t : ℝ) (w : ℝ → ℂ) : ℂ := + ∑ p ∈ Finset.Ioc ⌊Real.exp s⌋₊ ⌊Real.exp t⌋₊, + if p.Prime ∧ Nat.ModEq q p a then w (Real.log p) * ((p : ℝ)⁻¹ : ℂ) else 0 + +theorem complexPrimeInterval_add (q a : ℕ) (u v t : ℝ) (w : ℝ → ℂ) + (huv : u ≤ v) (hvt : v ≤ t) : + complexPrimeInterval q a u v w + complexPrimeInterval q a v t w = + complexPrimeInterval q a u t w := + Finset.sum_Ioc_consecutive _ (Nat.floor_le_floor (Real.exp_le_exp.mpr huv)) + (Nat.floor_le_floor (Real.exp_le_exp.mpr hvt)) + +theorem complexPrimeInterval_freeze (q a : ℕ) (s t : ℝ) (w : ℝ → ℂ) (c : ℂ) (η : ℝ) + (hw : ∀ y ∈ Set.Ioc s t, ‖w y - c‖ ≤ η) : + ‖complexPrimeInterval q a s t w - + c * (reciprocalPrimeInterval q a (Real.exp s) (Real.exp t) : ℂ)‖ ≤ + η * reciprocalPrimeInterval q a (Real.exp s) (Real.exp t) := by + have heq : complexPrimeInterval q a s t w - + c * (reciprocalPrimeInterval q a (Real.exp s) (Real.exp t) : ℂ) = + ∑ p ∈ Finset.Ioc ⌊Real.exp s⌋₊ ⌊Real.exp t⌋₊, + if p.Prime ∧ Nat.ModEq q p a then (w (Real.log p) - c) * ((p : ℝ)⁻¹ : ℂ) else 0 := by + unfold complexPrimeInterval reciprocalPrimeInterval + rw [Complex.ofReal_sum, Finset.mul_sum, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro p _ + split <;> simp_all [sub_mul] + rw [heq] + apply (norm_sum_le _ _).trans + calc + _ ≤ ∑ p ∈ Finset.Ioc ⌊Real.exp s⌋₊ ⌊Real.exp t⌋₊, + η * (if p.Prime ∧ Nat.ModEq q p a then (p : ℝ)⁻¹ else 0) := by + apply Finset.sum_le_sum + intro p hp + by_cases h : p.Prime ∧ Nat.ModEq q p a + · rw [ite_eq_left h, ite_eq_left h, norm_mul, norm_inv, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (Nat.cast_nonneg p)] + exact mul_le_mul_of_nonneg_right (hw _ (log_mem_of_mem_exp_interval hp)) (by positivity) + · simp [h] + _ = _ := by rw [← Finset.mul_sum]; rfl + +/-- Freezing a continuous complex weight costs its oscillation times the +length of the log interval. In particular the cost is additive over meshes. -/ +theorem complex_density_integral_freeze (φ χ β s t : ℝ) (hφ : 1 ≤ φ) + (hχ : |χ| ≤ 1) (hβ : β ≤ 1) (hs : 1 ≤ s) (hst : s ≤ t) + (w : ℝ → ℂ) (hwc : ContinuousOn w (Set.Icc s t)) (c : ℂ) (η : ℝ) (hη : 0 ≤ η) + (hw : ∀ y ∈ Set.Ioc s t, ‖w y - c‖ ≤ η) : + ‖(∫ y in Set.Ioc s t, w y * (primeLogDensity φ χ β y : ℂ)) - + c * (∫ y in Set.Ioc s t, primeLogDensity φ χ β y : ℝ)‖ ≤ 2 * η * (t - s) := by + have hc := continuousOn_primeLogDensity φ χ β (t := t) (by linarith : 0 < s) + have hiw : IntegrableOn (fun y => w y * (primeLogDensity φ χ β y : ℂ)) (Set.Ioc s t) := + (hwc.mul (Complex.continuous_ofReal.comp_continuousOn hc)).integrableOn_Icc.mono_set + Set.Ioc_subset_Icc_self + have hic : IntegrableOn (fun y => c * (primeLogDensity φ χ β y : ℂ)) (Set.Ioc s t) := + (continuousOn_const.mul (Complex.continuous_ofReal.comp_continuousOn hc)).integrableOn_Icc.mono_set + Set.Ioc_subset_Icc_self + have heq : (∫ y in Set.Ioc s t, w y * (primeLogDensity φ χ β y : ℂ)) - + c * (∫ y in Set.Ioc s t, primeLogDensity φ χ β y : ℝ) = + ∫ y in Set.Ioc s t, (w y - c) * (primeLogDensity φ χ β y : ℂ) := by + rw [← integral_complex_ofReal, ← integral_const_mul, ← integral_sub hiw hic] + apply setIntegral_congr_fun measurableSet_Ioc + intro y _ + ring + rw [heq] + have hi := intervalIntegral.norm_integral_le_of_norm_le_const + (a := s) (b := t) (C := 2 * η) + (f := fun y => (w y - c) * (primeLogDensity φ χ β y : ℂ)) + (fun y hy => by + have hy' := (Set.uIoc_of_le hst) ▸ hy + rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] + exact (mul_le_mul (hw y hy') + (primeLogDensity_abs_le_two φ χ β hφ hχ hβ (hs.trans hy'.1.le)) + (abs_nonneg _) hη).trans_eq (mul_comm η 2)) + rwa [intervalIntegral.integral_of_le hst, abs_of_nonneg (sub_nonneg.mpr hst)] at hi + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexRegionFromPage.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexRegionFromPage.lean new file mode 100644 index 0000000000000000000000000000000000000000..3458d49b228147811d4ab237e4722f63db0361a8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ComplexRegionFromPage.lean @@ -0,0 +1,118 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.FullHeightRegionComparison + +namespace OAI + +/-! # The complex zero-free input follows from the retained real Page input -/ + +namespace Ostmann + +theorem complexZeroRegion_of_page (κ : ℝ) (hκ : 0 < κ) + (hunique : ∀ Q : ℕ, 2 ≤ Q → ∀ e f : PrimitiveRealZero, + e.modulus ≤ Q → f.modulus ≤ Q → + 1 - κ / Real.log (4 * (Q : ℝ)) ≤ e.beta → + 1 - κ / Real.log (4 * (Q : ℝ)) ≤ f.beta → e = f) : + PublishedComplexZeroRegion actualCharacterZeros := by + classical + obtain ⟨cn, hcn, hn⟩ := exists_nonquadratic_zero_free_region + obtain ⟨cr, hcr, hr⟩ := exists_full_height_real_region + let c := min (cn / 4) (min (cr / 4) κ) + have hc : 0 < c := lt_min (by positivity) (lt_min (by positivity) hκ) + have hcnc : c ≤ cn / 4 := min_le_left _ _ + have hcrc : c ≤ cr / 4 := (min_le_right _ _).trans (min_le_left _ _) + have hcP : c ≤ κ := (min_le_right _ _).trans (min_le_right _ _) + refine ⟨c, hc, ?_⟩ + intro Q hQ T hT + let H := Real.log (2 * (Q : ℝ) * T) + have hQ1 : 1 ≤ Q := by omega + have hHp : 0 < H := lt_of_lt_of_le zero_lt_one (conductor_height_log_ge_one Q hQ1 T hT) + have hconvert : ∀ (χ : PrimitiveComplexCharacter), χ.modulus ≤ Q → ∀ i : ℕ, + |((actualCharacterZeros χ).zeros i).im| ≤ T → + 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re → + ∃ e : PrimitiveRealZero, e.modulus = χ.modulus ∧ + e.beta = ((actualCharacterZeros χ).zeros i).re ∧ e.asRealCharacter.asComplex = χ := by + intro χ hχ i hi hnear + let U := Real.log χ.modulus + Real.log (T + 2) + 1 + have hq : 0 ≤ Real.log χ.modulus := Real.log_nonneg (by exact_mod_cast χ.positive) + have ht : 0 ≤ Real.log (T + 2) := Real.log_nonneg (by linarith) + have hUp : 0 < U := by dsimp [U]; linarith + have hUH : U ≤ 2 * H := local_height_log_le χ.modulus Q χ.positive hχ T hT + have hsq : χ.character ^ 2 = 1 := by + by_contra hsq + let V := Real.log χ.modulus + Real.log (|((actualCharacterZeros χ).zeros i).im| + 2) + 1 + have hVp : 0 < V := by + have hl : 0 ≤ Real.log (|((actualCharacterZeros χ).zeros i).im| + 2) := + Real.log_nonneg (by linarith [abs_nonneg ((actualCharacterZeros χ).zeros i).im]) + dsimp [V] + linarith + have hVU : V ≤ U := by + have hl := Real.log_le_log (by positivity : 0 < |((actualCharacterZeros χ).zeros i).im| + 2) + (show |((actualCharacterZeros χ).zeros i).im| + 2 ≤ T + 2 by linarith) + dsimp [V, U] + linarith + have hcut := small_cutoff_fraction c cn U H hc.le hUp hHp hcnc hUH + have hhalf : cn / (2 * U) < cn / U := by + apply (div_lt_div_iff₀ (by positivity) hUp).mpr + nlinarith + have hmono : cn / U ≤ cn / V := by + apply (div_le_div_iff₀ hUp hVp).mpr + exact mul_le_mul_of_nonneg_left hVU hcn.le + have hzero := hn χ hsq i + change cn / V ≤ _ at hzero + linarith + have hcut := small_cutoff_fraction c cr U H hc.le hUp hHp hcrc hUH + have hhalf : cr / (2 * U) ≤ cr / U := by + apply (div_le_div_iff₀ (by positivity) hUp).mpr + nlinarith + have hnearR : 1 - cr / U ≤ ((actualCharacterZeros χ).zeros i).re := by linarith + have him : ((realCharacterActualZeros (χ.asReal hsq)).zeros i).im = 0 := + (hr (χ.asReal hsq) T hT).1 i + (by rw [realCharacterActualZeros, χ.asReal_asComplex hsq]; exact hi) + (by + change 1 - cr / U ≤ ((actualCharacterZeros (χ.asReal hsq).asComplex).zeros i).re + rw [χ.asReal_asComplex hsq] + exact hnearR) + let e := (actualRealCharacterZeroExpansion (χ.asReal hsq)).realZero i him + refine ⟨e, rfl, ?_, ?_⟩ + · change ((realCharacterActualZeros (χ.asReal hsq)).zeros i).re = _ + rw [realCharacterActualZeros, χ.asReal_asComplex hsq] + · change ((actualRealCharacterZeroExpansion (χ.asReal hsq)).realZero i him).asRealCharacter.asComplex = χ + rw [actualRealZero_asCharacter, PrimitiveComplexCharacter.asReal_asComplex] + have hlog4 : 0 < Real.log (4 * (Q : ℝ)) := Real.log_pos (by exact_mod_cast (by omega : 1 < 4 * Q)) + have hlogH : Real.log (4 * (Q : ℝ)) ≤ H := by + apply Real.log_le_log (by positivity) + have hQr : (0 : ℝ) ≤ Q := Nat.cast_nonneg Q + nlinarith + have hPage : c / H ≤ κ / Real.log (4 * (Q : ℝ)) := by + apply (div_le_div_iff₀ hHp hlog4).mpr + exact (mul_le_mul_of_nonneg_left hlogH hc.le).trans + (mul_le_mul_of_nonneg_right hcP hHp.le) + have huniq (χ ψ : PrimitiveComplexCharacter) (hχ : χ.modulus ≤ Q) (hψ : ψ.modulus ≤ Q) + (i j : ℕ) (hi : |((actualCharacterZeros χ).zeros i).im| ≤ T) + (hj : |((actualCharacterZeros ψ).zeros j).im| ≤ T) + (hni : 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re) + (hnj : 1 - c / H ≤ ((actualCharacterZeros ψ).zeros j).re) : χ = ψ := by + obtain ⟨e, heq, heb, heχ⟩ := hconvert χ hχ i hi hni + obtain ⟨f, hfq, hfb, hfψ⟩ := hconvert ψ hψ j hj hnj + have hef := hunique Q (by omega) e f (by simpa [heq] using hχ) + (by simpa [hfq] using hψ) (by rw [heb]; linarith) (by rw [hfb]; linarith) + exact heχ.symm.trans ((congrArg (fun e : PrimitiveRealZero => e.asRealCharacter.asComplex) hef).trans hfψ) + by_cases hex : ∃ χ : PrimitiveComplexCharacter, χ.modulus ≤ Q ∧ ∃ i : ℕ, + |((actualCharacterZeros χ).zeros i).im| ≤ T ∧ 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re + · obtain ⟨χ₀, hχ₀, i₀, hi₀, hn₀⟩ := hex + refine ⟨some χ₀, ?_⟩ + intro χ hχ hne i hi + by_contra hbad + have hn : 1 - c / H ≤ ((actualCharacterZeros χ).zeros i).re := by linarith [lt_of_not_ge hbad] + exact hne (congrArg some (huniq χ χ₀ hχ hχ₀ i i₀ hi hi₀ hn hn₀)) + · refine ⟨none, ?_⟩ + intro χ hχ _ i hi + by_contra hbad + exact hex ⟨χ, hχ, i, hi, by linarith [lt_of_not_ge hbad]⟩ + +theorem PublishedProgressionInput.complexZeroRegion (P : PublishedProgressionInput) : + PublishedComplexZeroRegion actualCharacterZeros := + complexZeroRegion_of_page P.kappa P.kappa_pos P.unique + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ConductorDeletion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ConductorDeletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b81c299e06e5a484bc195f52bebd3068b15604e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ConductorDeletion.lean @@ -0,0 +1,68 @@ +import Mathlib.Data.Nat.Prime.Basic +import Mathlib.Data.Nat.GCD.BigOperators +import Mathlib.Algebra.BigOperators.Ring.Finset + +namespace OAI + +/-! # Conductor support after deleting one large prime + +For each exceptional conductor choose one prime divisor above the threshold, +if there is one, and exclude that value from the nongiant priors. A conductor +that still divides the arithmetic modulus is then supported on its frequency +block, with full prime-power multiplicity. +-/ + +namespace Ostmann + +open scoped BigOperators Classical + +noncomputable def deletedConductorPrime (D T : ℕ) : Option ℕ := + if h : ∃ p, p.Prime ∧ p ∣ D ∧ T ≤ p then some h.choose else none + +theorem deletedConductorPrime_spec {D T p : ℕ} + (h : deletedConductorPrime D T = some p) : p.Prime ∧ p ∣ D ∧ T ≤ p := by + unfold deletedConductorPrime at h + split at h + next hex => + have hp : hex.choose = p := Option.some.inj h + exact hp ▸ hex.choose_spec + next => simp at h + +/-- If the chosen large divisor was excluded, any surviving conductor divides +only the small frequency modulus. No squarefree assumption on the conductor +or on either modulus is needed. -/ +theorem conductor_dvd_frequency_of_deletion (D Q R T : ℕ) + (hQ : ∀ p, p.Prime → p ∣ Q → p < T) + (hR : ∀ p, p.Prime → p ∣ R → T ≤ p) + (hdeleted : ∀ p, deletedConductorPrime D T = some p → ¬p ∣ R) + (hD : D ∣ Q * R) : D ∣ Q := by + by_cases hlarge : ∃ p, p.Prime ∧ p ∣ D ∧ T ≤ p + · have hsel : deletedConductorPrime D T = some hlarge.choose := by + simp [deletedConductorPrime, hlarge] + obtain ⟨hp, hpD, hpT⟩ := hlarge.choose_spec + have hpQR := dvd_trans hpD hD + rcases hp.dvd_mul.mp hpQR with hpQ | hpR + · exact False.elim ((not_lt_of_ge hpT) (hQ _ hp hpQ)) + · exact False.elim (hdeleted _ hsel hpR) + · have hcop : D.Coprime R := Nat.coprime_of_dvd fun p hp hpD hpR => + hlarge ⟨p, hp, hpD, hR p hp hpR⟩ + exact hcop.dvd_of_dvd_mul_left (by simpa only [Nat.mul_comm] using hD) + +/-- Excluding a prime value excludes it from a product of powers of sampled +primes, even when the occurrence exponents exceed one. -/ +theorem excluded_prime_not_dvd_product {p : ℕ} (hp : p.Prime) + (P : Finset ℕ) (e : ℕ → ℕ) (hP : ∀ q ∈ P, q.Prime) (hex : p ∉ P) : + ¬p ∣ ∏ q ∈ P, q ^ e q := by + have hcop : p.Coprime (∏ q ∈ P, q ^ e q) := by + apply Nat.Coprime.prod_right + intro q hq + apply Nat.Coprime.pow_right + apply hp.coprime_iff_not_dvd.mpr + intro hd + have heq := (Nat.prime_dvd_prime_iff_eq hp (hP q hq)).mp hd + exact hex (heq ▸ hq) + exact hp.coprime_iff_not_dvd.mp hcop + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ContourPolynomial.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ContourPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..38ae68d56c19ef3c49b493528e544e2d272ef5d4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ContourPolynomial.lean @@ -0,0 +1,80 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RemainderDecay +import OAI.NumberTheory.Ostmann.ZeroDensity.SupplyContourScales + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open Filter +open scoped Topology +namespace Ostmann.ZeroDensity + +theorem conductor_height_polynomial_le_exp (B : ℕ) {Q H : ℝ} + (hQ : 1 ≤ Q) (hH : 2 ≤ H) : + Q^2*(Q*(H+2))^B ≤ + Real.exp (((B : ℝ)+2)*(Real.log Q+Real.log (H+6))) := by + have hQp : 0 < Q := by linarith + have hHp : 0 < H+6 := by linarith + have hqbase : Q ≤ Q*(H+6) := by nlinarith + calc + _ ≤ (Q*(H+6))^2*(Q*(H+6))^B := by + apply mul_le_mul + · exact pow_le_pow_left₀ hQp.le hqbase 2 + · exact pow_le_pow_left₀ (by positivity) (by nlinarith : Q*(H+2) ≤ Q*(H+6)) B + · positivity + · positivity + _ = (Q*(H+6))^(B+2) := by rw [pow_add]; ring + _ = _ := by + rw [← Real.rpow_natCast, Real.rpow_def_of_pos (mul_pos hQp hHp), + Real.log_mul hQp.ne' hHp.ne'] + push_cast + congr 1 + ring + +theorem eventually_supply_left_edge_decay (B P : ℕ) {E : ℝ} (hE : 0 ≤ E) (D : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 0 < Q → Q ≤ supplyConductorCutoff L → + (Q : ℝ)^2*Real.sqrt (supplyPrimeSample L : ℝ)* + ((Q : ℝ)*((supplyContourHeight P E L : ℝ)+2))^B ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-D*L) := by + let K : ℝ := ((B : ℝ)+2)*(20003*((P : ℝ)+1)+E+8) + have hdecay := eventually_sqrt_subpower_decay K D + filter_upwards [hdecay,eventually_ge_atTop (1 : ℝ)] with L hdecay hL + intro Q hQ hQQ + have hQr : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hH : (2 : ℝ) ≤ supplyContourHeight P E L := by + exact_mod_cast supplyContourHeight_ge_two P E L + have hp := conductor_height_polynomial_le_exp B hQr hH + have hlogQ : Real.log (Q : ℝ) ≤ Real.log (supplyConductorCutoff L : ℝ) := + Real.log_le_log (by exact_mod_cast hQ) (by exact_mod_cast hQQ) + have hb := supplyContourHeight_modulus_budget P hE hL + unfold Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight at hb + rw [abs_of_nonneg (Nat.cast_nonneg _)] at hb + have hexp : ((B : ℝ)+2)*(Real.log (Q : ℝ)+Real.log ((supplyContourHeight P E L : ℝ)+6)) ≤ + K*L*Real.exp (9*L/10) := by + have hh := mul_le_mul_of_nonneg_left (show Real.log (Q : ℝ)+ + Real.log ((supplyContourHeight P E L : ℝ)+6) ≤ + (20003*((P : ℝ)+1)+E+8)*L*Real.exp (9*L/10) by linarith) + (show 0 ≤ (B : ℝ)+2 by positivity) + dsimp [K] + nlinarith only [hh] + have hX : (1 : ℝ) < supplyPrimeSample L := by + by_contra! hh + have hl := Real.log_nonpos (Nat.cast_nonneg (supplyPrimeSample L)) hh + have hlo := log_supplyPrimeSample_lower L + have he := Real.exp_pos L + linarith + calc + _ = Real.sqrt (supplyPrimeSample L : ℝ)* + ((Q : ℝ)^2*((Q : ℝ)*((supplyContourHeight P E L : ℝ)+2))^B) := by ring + _ ≤ Real.sqrt (supplyPrimeSample L : ℝ)*Real.exp (K*L*Real.exp (9*L/10)) := + mul_le_mul_of_nonneg_left (hp.trans (Real.exp_le_exp.mpr hexp)) (Real.sqrt_nonneg _) + _ ≤ _ := hdecay _ hX (log_supplyPrimeSample_lower L) + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ContourTail.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ContourTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb58aabdd79eb81325569f3314eb4c9023686b6a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ContourTail.lean @@ -0,0 +1,62 @@ +import Mathlib.Tactic.FieldSimp +import OAI.NumberTheory.Ostmann.ZeroDensity.RemainderDecay + +namespace OAI + +noncomputable section +namespace Ostmann.ZeroDensity + +theorem contour_polynomial_ratio_le (B : ℕ) {Q H : ℝ} (hQ : 0 < Q) (hH : 2 ≤ H) : + (Q*(H+2))^B/H^(B+1) ≤ (2 : ℝ)^B*Q^B/H := by + have hHp : 0 < H := by linarith + calc + _ ≤ (Q*(2*H))^B/H^(B+1) := by + apply div_le_div_of_nonneg_right _ (by positivity) + apply pow_le_pow_left₀ (by positivity) + nlinarith + _ = _ := by + rw [mul_pow,mul_pow,pow_succ] + field_simp + +theorem contour_tail_power_bound (B : ℕ) {Q H X E L : ℝ} + (hQ : 0 < Q) (hH : 2 ≤ H) (hL : 0 ≤ L) + (hXlog : 0 ≤ Real.log X) (hXupper : Real.log X ≤ 2*Real.exp L) + (hheight : Q^(B+2)*Real.exp (E*L) ≤ H) : + Q^2*(Q*(H+2))^B/H^(B+1)*(1+Real.log X)^B ≤ + (6 : ℝ)^B*Real.exp (((B : ℝ)-E)*L) := by + have hHp : 0 < H := by linarith + have hE : 0 < Real.exp (E*L) := Real.exp_pos _ + have hratio : Q^(B+2)/H ≤ Real.exp (-E*L) := by + calc + _ ≤ Q^(B+2)/(Q^(B+2)*Real.exp (E*L)) := + div_le_div_of_nonneg_left (by positivity) (by positivity) hheight + _ = _ := by + rw [show -E*L = -(E*L) by ring, Real.exp_neg] + field_simp + have hlogbound : 1+Real.log X ≤ 3*Real.exp L := by + have he := Real.one_le_exp hL + linarith + have hpoly := contour_polynomial_ratio_le B hQ hH + calc + _ = Q^2*((Q*(H+2))^B/H^(B+1))*(1+Real.log X)^B := by ring + _ ≤ Q^2*((2 : ℝ)^B*Q^B/H)*(3*Real.exp L)^B := by + apply mul_le_mul + · exact mul_le_mul_of_nonneg_left hpoly (sq_nonneg _) + · exact pow_le_pow_left₀ (by positivity) hlogbound B + · positivity + · positivity + _ = (6 : ℝ)^B*(Q^(B+2)/H)*(Real.exp L)^B := by + rw [show (6 : ℝ)=2*3 by norm_num,mul_pow,mul_pow,pow_add] + ring + _ ≤ (6 : ℝ)^B*Real.exp (-E*L)*(Real.exp L)^B := by + gcongr + _ = _ := by + rw [← Real.exp_nat_mul, mul_assoc, ← Real.exp_add] + congr 2 + ring + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Density.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Density.lean new file mode 100644 index 0000000000000000000000000000000000000000..24270e3db831fb80bc30c84ec876875776d3a7f5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Density.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualDensityDyadic +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityNumerics +import OAI.NumberTheory.Ostmann.ZeroDensity.MultiplicityLog + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +theorem exists_actual_zero_density_constant : + ∃ C : ℝ, 0 < C ∧ ∀ (Q H : ℕ) (exception : Option (PrimitiveFamily Q)) (σ : ℝ), + 0 < Q → 0 < H → 1/2 ≤ σ → σ ≤ 1 → + (totalZeroCount Q exception σ (H : ℝ) : ℝ) ≤ + C*((Q^2*H : ℕ) : ℝ)^(10*(1-σ))*(1+Real.log (Q*H : ℕ))^11 := by + obtain ⟨Cs,hCs,hs⟩ := exists_actual_zero_density_dyadic_constant + obtain ⟨Cn,hCn,hn⟩ := exists_density_numerical_constant + obtain ⟨Cm,hCm,hm⟩ := exists_localMultiplicity_log_constant + refine ⟨2*Cs*Cn*Cm,by positivity,?_⟩ + intro Q H exception σ hQ hH hσ hσ1 + let J := detectorBlockCount (detectorLength Q H (Q^2*H)) + let E : ℝ := ∑ j ∈ Finset.range J, + (((2^j*(Q^2*H) : ℕ) : ℝ)+(Q : ℝ)^2*H) * (1+Real.log Q) * + (1+Real.log (2*(2^j*(Q^2*H) : ℕ) : ℝ))^7 * + (2^j*(Q^2*H) : ℕ) * ((2^j*(Q^2*H) : ℕ) : ℝ)^(-2*σ) + let L : ℝ := 1+Real.log (Q*H : ℕ) + let Z : ℝ := ((Q^2*H : ℕ) : ℝ)^(10*(1-σ)) + have hL : 0 ≤ L := by + have hp : 0 < Q*H := Nat.mul_pos hQ hH + have hreal : (1 : ℝ) ≤ (Q*H : ℕ) := by exact_mod_cast hp + have := Real.log_nonneg hreal + dsimp [L] + linarith + have hZ : 0 ≤ Z := Real.rpow_nonneg (Nat.cast_nonneg _) _ + have hlocal := localMultiplicityBound_nonneg hQ (show (1 : ℝ) ≤ H by exact_mod_cast hH) + have hactual : (totalZeroCount Q exception σ (H : ℝ) : ℝ) ≤ + 8*Cs*localMultiplicityBound Q H*J*E := hs Q H exception σ hQ hH hσ hσ1 + have hnumeric : 4*(J : ℝ)*E ≤ Cn*Z*L^10 := hn Q H σ hQ hH (by linarith) hσ1 + have hmultiplicity : localMultiplicityBound Q H ≤ Cm*L := by + simpa only [L,Nat.cast_mul] using hm Q H hQ hH + calc + (totalZeroCount Q exception σ (H : ℝ) : ℝ) ≤ + 8*Cs*localMultiplicityBound Q H*J*E := hactual + _ = (2*Cs*localMultiplicityBound Q H)*(4*(J : ℝ)*E) := by ring + _ ≤ (2*Cs*localMultiplicityBound Q H)*(Cn*Z*L^10) := + mul_le_mul_of_nonneg_left hnumeric (by positivity) + _ ≤ (2*Cs*(Cm*L))*(Cn*Z*L^10) := by + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hmultiplicity (by positivity)) (by positivity) + _ = (2*Cs*Cn*Cm)*Z*L^11 := by ring + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAbscissaEnergy.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAbscissaEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..3cee49ae883e1d556181df99f0a400fb6c22b33e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAbscissaEnergy.lean @@ -0,0 +1,47 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityAbscissaPolynomial + +namespace OAI + +/-! # Coefficient energy decreases to the right of the density line -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + + theorem densityVerticalCoeff_norm_mono (a : ℕ → ℂ) (σ x : ℝ) (hx : σ ≤ x) + (n : ℕ) (hn : 1 ≤ n) : + ‖densityVerticalCoeff a x n‖ ≤ ‖densityVerticalCoeff a σ n‖ := by + have hp : 0 < n := lt_of_lt_of_le Nat.zero_lt_one hn + have hnR : (1 : ℝ) ≤ n := by exact_mod_cast hn + rw [densityVerticalCoeff_norm a x n hp, densityVerticalCoeff_norm a σ n hp] + exact div_le_div_of_nonneg_left (norm_nonneg _) (Real.rpow_pos_of_pos (by positivity) σ) + (Real.rpow_le_rpow_of_exponent_le hnR hx) + + theorem density_abscissa_energy_mono (N : ℕ) (a : ℕ → ℂ) (σ x : ℝ) (hx : σ ≤ x) : + (∑ n ∈ Finset.Icc 1 N, ‖densityVerticalCoeff a x n‖ ^ 2) ≤ + ∑ n ∈ Finset.Icc 1 N, ‖densityVerticalCoeff a σ n‖ ^ 2 := by + apply Finset.sum_le_sum + intro n hn + exact pow_le_pow_left₀ (norm_nonneg _) (densityVerticalCoeff_norm_mono a σ x hx n (Finset.mem_Icc.mp hn).1) 2 + + theorem density_abscissa_derivative_energy (N : ℕ) (a : ℕ → ℂ) (σ : ℝ) : + (∑ n ∈ Finset.Icc 1 N, ‖densityVerticalCoeff (densityAbscissaDerivativeCoeff a) σ n‖ ^ 2) ≤ + (Real.log (N + 1 : ℕ)) ^ 2 * ∑ n ∈ Finset.Icc 1 N, ‖densityVerticalCoeff a σ n‖ ^ 2 := by + rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro n hn + have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast (Finset.mem_Icc.mp hn).1 + have hl : 0 ≤ Real.log n := Real.log_nonneg hn1 + have hlN : Real.log n ≤ Real.log (N + 1 : ℕ) := + Real.log_le_log (by positivity) (by exact_mod_cast (by have := (Finset.mem_Icc.mp hn).2; omega : n ≤ N + 1)) + have he : densityVerticalCoeff (densityAbscissaDerivativeCoeff a) σ n = + -(Real.log n : ℂ) * densityVerticalCoeff a σ n := by + unfold densityVerticalCoeff densityAbscissaDerivativeCoeff + ring + rw [he, norm_mul, norm_neg, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hl, mul_pow] + exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hl hlN 2) (sq_nonneg _) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAbscissaPolynomial.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAbscissaPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..460119753fa500813fa363b03b3ee4507f433911 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAbscissaPolynomial.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityAbscissaSample +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityVerticalPolynomial +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityGaussianFubini + +namespace OAI + +/-! # Differentiating the actual Dirichlet polynomial in its real part -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +noncomputable def densityAbscissaDerivativeCoeff (a : ℕ → ℂ) (n : ℕ) : ℂ := + -(Real.log n : ℂ) * a n + + theorem densityVerticalCoeff_exp (a : ℕ → ℂ) (σ : ℝ) (n : ℕ) (hn : 0 < n) : + densityVerticalCoeff a σ n = a n * Complex.exp (-(Real.log n : ℂ) * (σ : ℂ)) := by + have hnC : (n : ℂ) ≠ 0 := by exact_mod_cast hn.ne' + have hl : Complex.log (n : ℂ) = (Real.log n : ℂ) := by + simpa only [Complex.ofReal_natCast] using + (Complex.ofReal_log (show (0 : ℝ) ≤ n by positivity)).symm + rw [densityVerticalCoeff, Complex.cpow_def_of_ne_zero hnC, hl, div_eq_mul_inv, ← Complex.exp_neg] + congr 2 + ring + + theorem densityVerticalCoeff_hasDerivAt (a : ℕ → ℂ) (n : ℕ) (hn : 0 < n) (σ : ℝ) : + HasDerivAt (fun x : ℝ => densityVerticalCoeff a x n) + (densityVerticalCoeff (densityAbscissaDerivativeCoeff a) σ n) σ := by + have hd := ((((hasDerivAt_id σ).ofReal_comp).const_mul (-(Real.log n : ℂ))).cexp).const_mul (a n) + simp only [id_eq, Complex.ofReal_one, mul_one] at hd + convert hd using 1 + · funext x + exact densityVerticalCoeff_exp a x n hn + · rw [densityVerticalCoeff_exp _ σ n hn] + unfold densityAbscissaDerivativeCoeff + ring + + theorem density_abscissa_polynomial_hasDerivAt {q : ℕ} (S : Finset ℕ) + (hS : ∀ n ∈ S, 0 < n) (a : ℕ → ℂ) (χ : DirichletCharacter ℂ q) (t σ : ℝ) : + HasDerivAt (fun x => densityCharacterPolynomial S (densityVerticalCoeff a x) χ t) + (densityCharacterPolynomial S (densityVerticalCoeff (densityAbscissaDerivativeCoeff a) σ) χ t) σ := by + unfold densityCharacterPolynomial + exact HasDerivAt.fun_sum (fun n hn => + ((densityVerticalCoeff_hasDerivAt a n (hS n hn) σ).mul_const (χ (n : ZMod q))).mul_const + (realAdditivePhase (-(Real.log n * t)))) + + theorem density_abscissa_polynomial_continuous {q : ℕ} (S : Finset ℕ) + (hS : ∀ n ∈ S, 0 < n) (a : ℕ → ℂ) (χ : DirichletCharacter ℂ q) (t : ℝ) : + Continuous (fun x => densityCharacterPolynomial S (densityVerticalCoeff a x) χ t) := + continuous_iff_continuousAt.mpr (fun x => + (density_abscissa_polynomial_hasDerivAt S hS a χ t x).continuousAt) + + theorem density_abscissa_polynomial_sample {q : ℕ} (S : Finset ℕ) + (hS : ∀ n ∈ S, 0 < n) (a : ℕ → ℂ) (χ : DirichletCharacter ℂ q) (t σ β : ℝ) + (hσβ : σ ≤ β) (hβ : β ≤ 1) : + ‖densityCharacterPolynomial S (densityVerticalCoeff a β) χ t‖ ^ 2 ≤ + 2 * (∫ x in σ..2, ‖densityCharacterPolynomial S (densityVerticalCoeff a x) χ t‖ ^ 2) + + ∫ x in σ..2, ‖densityCharacterPolynomial S + (densityVerticalCoeff (densityAbscissaDerivativeCoeff a) x) χ t‖ ^ 2 := by + exact density_abscissa_sample _ _ + (density_abscissa_polynomial_hasDerivAt S hS a χ t) + (density_abscissa_polynomial_continuous S hS (densityAbscissaDerivativeCoeff a) χ t) + σ β hσβ hβ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAbscissaSample.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAbscissaSample.lean new file mode 100644 index 0000000000000000000000000000000000000000..7c6e1b49a7683d30d95b1c7c3c6d8489b86bca7c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAbscissaSample.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySobolevPoint + +namespace OAI + +/-! # Sampling a variable real part without moving left of the density line -/ + +namespace Ostmann + +open MeasureTheory Set + + theorem density_forward_interval_sample (f g : ℝ → ℂ) + (hf : ∀ x, HasDerivAt f (g x) x) (hg : Continuous g) (t : ℝ) : + ‖f t‖ ^ 2 ≤ 2 * (∫ x in t..t + 1, ‖f x‖ ^ 2) + + ∫ x in t..t + 1, ‖g x‖ ^ 2 := by + have hcont : Continuous f := continuous_iff_continuousAt.mpr (fun x => (hf x).continuousAt) + have hab : t ≤ t + 1 := by linarith + have hpoint (u : ℝ) (hu : u ∈ Icc t (t + 1)) := + density_energy_oscillation f g hf hg t (t + 1) t u ⟨le_rfl, hab⟩ hu + have hi := intervalIntegral.integral_mono_on (μ := volume) hab intervalIntegrable_const + (((hcont.norm.pow 2).intervalIntegrable t (t + 1)).add intervalIntegrable_const) hpoint + rw [intervalIntegral.integral_const, intervalIntegral.integral_add, + intervalIntegral.integral_const, intervalIntegral.integral_add] at hi + · simp only [show t + 1 - t = (1 : ℝ) by ring, smul_eq_mul, one_mul] at hi + change ‖f t‖ ^ 2 ≤ (∫ x in t..t + 1, ‖f x‖ ^ 2) + + ((∫ x in t..t + 1, ‖f x‖ ^ 2) + ∫ x in t..t + 1, ‖g x‖ ^ 2) at hi + linarith + · exact (hcont.norm.pow 2).intervalIntegrable _ _ + · exact (hg.norm.pow 2).intervalIntegrable _ _ + · exact (hcont.norm.pow 2).intervalIntegrable _ _ + · exact intervalIntegrable_const + + theorem density_abscissa_sample (f g : ℝ → ℂ) + (hf : ∀ x, HasDerivAt f (g x) x) (hg : Continuous g) + (σ β : ℝ) (hσβ : σ ≤ β) (hβ : β ≤ 1) : + ‖f β‖ ^ 2 ≤ 2 * (∫ x in σ..2, ‖f x‖ ^ 2) + ∫ x in σ..2, ‖g x‖ ^ 2 := by + have hcont : Continuous f := continuous_iff_continuousAt.mpr (fun x => (hf x).continuousAt) + have h := density_forward_interval_sample f g hf hg β + have hF := intervalIntegral.integral_mono_interval (μ := volume) hσβ (by linarith : β ≤ β + 1) + (by linarith : β + 1 ≤ 2) + (Filter.Eventually.of_forall (fun x => sq_nonneg ‖f x‖)) + ((hcont.norm.pow 2).intervalIntegrable σ 2) + have hG := intervalIntegral.integral_mono_interval (μ := volume) hσβ (by linarith : β ≤ β + 1) + (by linarith : β + 1 ≤ 2) + (Filter.Eventually.of_forall (fun x => sq_nonneg ‖g x‖)) + ((hg.norm.pow 2).intervalIntegrable σ 2) + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityActualBlock.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityActualBlock.lean new file mode 100644 index 0000000000000000000000000000000000000000..81f5ddb159b05fac24e6bede169491d74d4db671 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityActualBlock.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDyadicBlockCost +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorPolynomial + +namespace OAI + +/-! # Uniform estimates for the actual detector's dyadic blocks -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_actual_block_bound : + ∃ C : ℝ, 0 < C ∧ ∀ X M Q : ℕ, 1 ≤ X → X ≤ M → 1 ≤ Q → + ∀ Y T σ : ℝ, 2 ≤ Y → 1 ≤ T → 1 / 2 ≤ σ → σ ≤ 1 → + ∀ {ι : Type} (R : Finset ι) (c : ι → PrimitiveComplexCharacter) (t β : ι → ℝ), + (∀ i ∈ R, (c i).modulus ≤ Q) → (∀ i ∈ R, |t i| ≤ T) → + (∀ i ∈ R, ∀ j ∈ R, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∀ i ∈ R, σ ≤ β i ∧ β i ≤ 1) → + (∑ i ∈ R, ‖densityCharacterPolynomial (Finset.Ioc M (2 * M)) + (densityVerticalCoeff (densityPolynomialCoefficient X Y) (β i)) (c i).character (t i)‖ ^ 2) ≤ + C * (1 + Real.log (2 * Y + 1)) ^ 7 * + (Y ^ (2 - 2 * σ) + (Q : ℝ) ^ 2 * T * (X : ℝ) ^ (1 - 2 * σ)) := by + obtain ⟨C, hC, hb⟩ := density_divisor_block_sieve + refine ⟨792 * C, by positivity, ?_⟩ + intro X M Q hX hXM hQ Y T σ hY hT hσ hσ1 ι R c t β hc ht hs hβ + have hM : 1 ≤ M := hX.trans hXM + have hXp : (1 : ℝ) ≤ X := by exact_mod_cast hX + have hMp : (0 : ℝ) < M := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hM) + by_cases hMY : (M : ℝ) ≤ Y + · have hU : Finset.Ioc M (2 * M) ⊆ Finset.Icc M (2 * M) := by + intro n hn + exact Finset.mem_Icc.mpr ⟨(Finset.mem_Ioc.mp hn).1.le, (Finset.mem_Ioc.mp hn).2⟩ + have h := hb M (2 * M) Q hM hQ T σ hT (by linarith) hσ1 _ hU + (densityPolynomialCoefficient X Y) + (fun n _ => densityPolynomialCoefficient_norm X Y (by linarith) n) R c t β hc ht hs hβ + have hcost := density_dyadic_total_cost C X M Y Q T σ hC.le hXp + (by exact_mod_cast hXM) hMY hT hσ hσ1 + apply h.trans + simpa only [Nat.cast_mul, Nat.cast_ofNat, Nat.cast_add, Nat.cast_one] using hcost + · have hz (i : ι) : densityCharacterPolynomial (Finset.Ioc M (2 * M)) + (densityVerticalCoeff (densityPolynomialCoefficient X Y) (β i)) (c i).character (t i) = 0 := by + unfold densityCharacterPolynomial + apply Finset.sum_eq_zero + intro n hn + have hyn : Y ≤ n := (le_of_not_ge hMY).trans (by exact_mod_cast (Finset.mem_Ioc.mp hn).1.le) + rw [densityVerticalCoeff, densityPolynomialCoefficient_above X n Y (by linarith) hyn] + simp + simp only [hz, norm_zero, zero_pow (by decide : (2 : ℕ) ≠ 0), Finset.sum_const_zero] + have hl : 0 ≤ Real.log (2 * Y + 1) := Real.log_nonneg (by linarith) + positivity + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAllZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAllZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ac1d03b93b01471341af3107e49134efcb5c22c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityAllZeros.lean @@ -0,0 +1,97 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySeparatedCount +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityZeroBins + +namespace OAI + +/-! # The separated density bound for every zero, with analytic multiplicities -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_all_zero_count : + ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 1 ≤ Q → ∀ T σ : ℝ, + 2 ≤ T → 4 ≤ (Q : ℝ) ^ 2 * T → 1 / 2 < σ → σ ≤ 1 → + 1 / Real.log ((Q : ℝ) ^ 2 * T) ≤ σ - 1 / 2 → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ((actualCharacterZeros χ).count σ T : ℝ)) ≤ + C * ((Q : ℝ) ^ 2 * T) ^ densityTargetExponent σ * + (Real.log ((Q : ℝ) * T)) ^ 10 := by + obtain ⟨C, hC, hsep⟩ := density_separated_zero_count + refine ⟨80 * C / Real.log (14 / 13), by positivity, ?_⟩ + intro Q hQ T σ hT hB hσ hσ1 hgap F hF + let S := densityZeroIndices F σ T + let K := S.image densityZeroBin + let I := {k : DensityZeroBin // k ∈ K} + have hex (k : I) : ∃ n : ℕ, (⟨k.val.1, n⟩ : DensityZeroIndex) ∈ S ∧ + ⌊((actualCharacterZeros k.val.1).zeros n).im⌋ = k.val.2 := + densityZeroBin_nonempty S k.val k.property + choose idx hidx using hex + let c : I → PrimitiveComplexCharacter := fun k => k.val.1 + let z : I → ℂ := fun k => (actualCharacterZeros (c k)).zeros (idx k) + let t : I → ℝ := fun k => (z k).im / (2 * Real.pi) + let β : I → ℝ := fun k => (z k).re + have hdata (k : I) : c k ∈ F ∧ |(z k).im| ≤ T ∧ σ ≤ β k := + (densityZeroIndices_mem F σ T ⟨c k, idx k⟩).mp (hidx k).1 + have hfloor (k : I) : ⌊(z k).im⌋ = k.val.2 := (hidx k).2 + have hz (k : I) : densityVerticalPoint (β k) (t k) = z k := by + apply Complex.ext + · simp [densityVerticalPoint, β] + · have him (a b : ℝ) : (densityVerticalPoint a b).im = 2 * Real.pi * b := by + simp [densityVerticalPoint] + rw [him] + dsimp [t] + field_simp + let color : I → ℤ := fun k => k.val.2 % 10 + let U : Finset I := Finset.univ + have hcount (j : ℤ) : ((U.filter fun k => color k = j).card : ℝ) ≤ + C * ((Q : ℝ) ^ 2 * T) ^ densityTargetExponent σ * + (Real.log ((Q : ℝ) * T)) ^ 9 := by + apply hsep Q hQ T σ hT hB hσ hσ1 hgap (U.filter fun k => color k = j) c t β + · intro k _ + exact hF (c k) (hdata k).1 + · intro k _ + dsimp [t] + rw [abs_div, abs_of_pos (by positivity : 0 < 2 * Real.pi)] + exact (div_le_self (abs_nonneg _) (by nlinarith [Real.pi_gt_three])).trans (hdata k).2.1 + · intro k hk l hl hcl hne + apply density_ordinate_bin_separation + · rw [hfloor k, hfloor l] + exact (Finset.mem_filter.mp hk).2.trans (Finset.mem_filter.mp hl).2.symm + · rw [hfloor k, hfloor l] + intro hb + apply hne + apply Subtype.ext + exact Sigma.ext hcl (heq_of_eq hb) + · intro k _ + refine ⟨(hdata k).2.2, (actualCharacterZeros (c k)).in_strip (idx k) |>.2.le, ?_⟩ + rw [hz] + exact (actualCharacterZeros (c k)).actual_zero (idx k) + have hcolors : U.card = ∑ j ∈ Finset.Ico (0 : ℤ) 10, (U.filter fun k => color k = j).card := by + apply Finset.card_eq_sum_card_fiberwise + intro k _ + exact Finset.mem_Ico.mpr ⟨Int.emod_nonneg _ (by norm_num), Int.emod_lt_of_pos _ (by norm_num)⟩ + have hK : (K.card : ℝ) ≤ 10 * (C * ((Q : ℝ) ^ 2 * T) ^ densityTargetExponent σ * + (Real.log ((Q : ℝ) * T)) ^ 9) := by + have heq : U.card = K.card := by simp [U, I] + rw [← heq, hcolors, Nat.cast_sum] + calc + _ ≤ ∑ _j ∈ Finset.Ico (0 : ℤ) 10, + C * ((Q : ℝ) ^ 2 * T) ^ densityTargetExponent σ * + (Real.log ((Q : ℝ) * T)) ^ 9 := Finset.sum_le_sum fun j _ => hcount j + _ = _ := by norm_num + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hlog : 0 ≤ Real.log ((Q : ℝ) * T) := Real.log_nonneg (by nlinarith) + rw [← densityZeroIndices_card] + have hb := densityZeroIndices_bin_bound Q hQ T σ hT hσ.le F hF + calc + _ ≤ (K.card : ℝ) * ((8 / Real.log (14 / 13)) * Real.log ((Q : ℝ) * T)) := hb + _ ≤ (10 * (C * ((Q : ℝ) ^ 2 * T) ^ densityTargetExponent σ * + (Real.log ((Q : ℝ) * T)) ^ 9)) * + ((8 / Real.log (14 / 13)) * Real.log ((Q : ℝ) * T)) := by + exact mul_le_mul_of_nonneg_right hK (by positivity) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityBalanceParameters.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityBalanceParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..148d7bec7b29ddb18d40de932ba85f88eece832a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityBalanceParameters.lean @@ -0,0 +1,77 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityMomentCutoff + +namespace OAI + +/-! # The conductor-height parameters in the two zero-detector estimates -/ + +namespace Ostmann + +noncomputable def densityTargetExponent (σ : ℝ) : ℝ := 3 * (1 - σ) / (2 - σ) +noncomputable def densityBalanceExponent (σ : ℝ) : ℝ := 3 / (2 * (2 - σ)) + + theorem density_conductor_height_log (Q : ℕ) (hQ : 1 ≤ Q) (T : ℝ) (hT : 2 ≤ T) : + Real.log ((Q : ℝ) ^ 2 * T) ≤ 2 * Real.log ((Q : ℝ) * T) := by + have hq : (0 : ℝ) < Q := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hQ) + have ht : 0 < T := by linarith + rw [Real.log_mul (by positivity) ht.ne', Real.log_pow, + Real.log_mul hq.ne' ht.ne'] + have hl : 0 ≤ Real.log T := Real.log_nonneg (by linarith) + norm_num only [Nat.cast_ofNat] + linarith + + theorem density_detector_cutoff (Q : ℕ) (hQ : 1 ≤ Q) (T : ℝ) (hT : 2 ≤ T) : + ∃ X : ℕ, 1 ≤ X ∧ (Q : ℝ) ^ 2 * T ≤ X ∧ + (X : ℝ) + (Q : ℝ) ^ 2 * T ≤ 17 * ((Q : ℝ) ^ 2 * T) ∧ + 1 + Real.log X ≤ 20 * Real.log ((Q : ℝ) * T) := by + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hB : 2 ≤ (Q : ℝ) ^ 2 * T := by nlinarith + obtain ⟨X, hX, hlX, hscale, hsize, hlog⟩ := density_moment_cutoff 1 (by decide) ((Q : ℝ) ^ 2 * T) hB + norm_num at hscale hsize hlog + refine ⟨X, hX, by nlinarith, hsize, ?_⟩ + have hlB := density_conductor_height_log Q hQ T hT + linarith + + theorem density_balance_at_least_one (σ : ℝ) (hσ : 1 / 2 ≤ σ) (hσ1 : σ ≤ 1) : + 1 ≤ densityBalanceExponent σ := by + unfold densityBalanceExponent + apply (le_div_iff₀ (by linarith : 0 < 2 * (2 - σ))).mpr + linarith + + theorem density_balance_identity (B σ : ℝ) (hB : 0 < B) (hσ : σ < 2) : + B ^ 3 * (B ^ densityBalanceExponent σ) ^ (2 - 4 * σ) = + (B ^ densityTargetExponent σ) ^ (3 : ℕ) := by + rw [← Real.rpow_natCast B 3, ← Real.rpow_natCast (B ^ densityTargetExponent σ) 3, + ← Real.rpow_mul hB.le, ← Real.rpow_mul hB.le, ← Real.rpow_add hB] + congr 1 + unfold densityTargetExponent densityBalanceExponent + have hd : 2 - σ ≠ 0 := by linarith + field_simp [hd] + ring + + theorem density_away_inverse_gap (Q : ℕ) (hQ : 1 ≤ Q) (T σ : ℝ) (hT : 2 ≤ T) + (hσ : 1 / 2 < σ) (hgap : 1 / Real.log ((Q : ℝ) ^ 2 * T) ≤ σ - 1 / 2) : + 1 / (σ - 1 / 2) ≤ 2 * Real.log ((Q : ℝ) * T) := by + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hB : 1 < (Q : ℝ) ^ 2 * T := by nlinarith + have hl : 0 < Real.log ((Q : ℝ) ^ 2 * T) := Real.log_pos hB + have hh := mul_le_mul_of_nonneg_right hgap hl.le + rw [div_mul_cancel₀ _ hl.ne'] at hh + apply (div_le_iff₀ (by linarith : 0 < σ - 1 / 2)).mpr + have hlog := density_conductor_height_log Q hQ T hT + nlinarith + + theorem density_balanced_count_from_cube (C R B σ L : ℝ) (hC : 0 ≤ C) + (hR : 0 ≤ R) (hB : 0 ≤ B) + (h : R ^ 3 ≤ C * (B ^ densityTargetExponent σ) ^ 3 * L ^ 12) : + R ≤ (C + 1) * B ^ densityTargetExponent σ * L ^ 4 := by + have hc : C ≤ (C + 1) ^ 3 := by nlinarith [sq_nonneg C] + have hh : R ^ 3 ≤ ((C + 1) * B ^ densityTargetExponent σ * L ^ 4) ^ 3 := by + apply h.trans + have hm := mul_le_mul_of_nonneg_right hc + (show 0 ≤ (B ^ densityTargetExponent σ) ^ 3 * L ^ 12 by positivity) + convert hm using 1 <;> ring + exact (pow_le_pow_iff_left₀ hR (by positivity) (by decide : (3 : ℕ) ≠ 0)).mp hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityBlockCauchy.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityBlockCauchy.lean new file mode 100644 index 0000000000000000000000000000000000000000..bed7a8a7bc2b0e50f94fc44f3f3bcb4afdb3bdf3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityBlockCauchy.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFiniteContinuity + +namespace OAI + +/-! # Combining the finite coefficient blocks without a length loss -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators Classical + + theorem density_weighted_sum_norm_sq {ι : Type*} (S : Finset ι) + (f : ι → ℂ) (w : ι → ℝ) (hw : ∀ i ∈ S, 0 < w i) : + ‖∑ i ∈ S, f i‖ ^ 2 ≤ (∑ i ∈ S, w i) * ∑ i ∈ S, ‖f i‖ ^ 2 / w i := by + apply (pow_le_pow_left₀ (norm_nonneg _) (norm_sum_le _ _) 2).trans + apply Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul S + (fun i hi => (hw i hi).le) (fun i hi => div_nonneg (sq_nonneg _) (hw i hi).le) + intro i hi + rw [mul_div_cancel₀ _ (hw i hi).ne'] + + theorem density_weighted_block_mean {α ι : Type*} (F : Finset α) (S : Finset ι) + (f : α → ι → ℝ → ℂ) (w : ι → ℝ) (hw : ∀ i ∈ S, 0 < w i) (T : ℝ) + (hf : ∀ χ ∈ F, ∀ i ∈ S, ContinuousOn (f χ i) (Icc (-T) T)) : + (∑ χ ∈ F, ∫ t in Icc (-T) T, ‖∑ i ∈ S, f χ i t‖ ^ 2) ≤ + (∑ i ∈ S, w i) * ∑ i ∈ S, + (∑ χ ∈ F, ∫ t in Icc (-T) T, ‖f χ i t‖ ^ 2) / w i := by + have hi (χ : α) (hχ : χ ∈ F) (i : ι) (hi : i ∈ S) : + Integrable (fun t => ‖f χ i t‖ ^ 2 / w i) (volume.restrict (Icc (-T) T)) := + (((hf χ hχ i hi).norm.pow 2).div_const _).integrableOn_Icc + calc + _ ≤ ∑ χ ∈ F, ∫ t in Icc (-T) T, + (∑ i ∈ S, w i) * ∑ i ∈ S, ‖f χ i t‖ ^ 2 / w i := by + apply Finset.sum_le_sum + intro χ hχ + apply integral_mono + · exact ((continuousOn_finsetSum S (fun i hi => hf χ hχ i hi)).norm.pow 2).integrableOn_Icc + · exact (integrable_finsetSum S (fun i hi' => hi χ hχ i hi')).const_mul _ + · intro t + exact density_weighted_sum_norm_sq S (fun i => f χ i t) w hw + _ = _ := by + simp_rw [integral_const_mul] + rw [← Finset.mul_sum] + congr 1 + calc + _ = ∑ χ ∈ F, ∑ i ∈ S, ∫ t in Icc (-T) T, ‖f χ i t‖ ^ 2 / w i := by + apply Finset.sum_congr rfl + intro χ hχ + exact integral_finsetSum S (fun i hi' => hi χ hχ i hi') + _ = _ := by + rw [Finset.sum_comm] + simp only [integral_div, Finset.sum_div] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityBlockWeights.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityBlockWeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c302249dd6b0af773ea8598e361d40da903d291 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityBlockWeights.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDyadicMean +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityBlockCauchy + +namespace OAI + +/-! # Summable weights for the actual dyadic-square estimates -/ + +namespace Ostmann + +open scoped BigOperators + + theorem density_block_weight_sum (J : ℕ) : + (∑ j ∈ Finset.range J, (3 / 4 : ℝ) ^ j) ≤ 4 := by + have h := (summable_geometric_of_abs_lt_one (by norm_num : |(3 / 4 : ℝ)| < 1)).sum_le_tsum + (Finset.range J) (fun _ _ => by positivity) + have he : (∑' j : ℕ, (3 / 4 : ℝ) ^ j) = 4 := by + rw [tsum_geometric_of_abs_lt_one (by norm_num : |(3 / 4 : ℝ)| < 1)] + norm_num + exact h.trans_eq he + + theorem density_block_energy_summable : + Summable (fun j : ℕ => (j + 2 : ℝ) ^ 3 * (2 / 3 : ℝ) ^ j) := by + have h3 := summable_pow_mul_geometric_of_norm_lt_one 3 (by norm_num : ‖(2 / 3 : ℝ)‖ < 1) + have h2 := summable_pow_mul_geometric_of_norm_lt_one 2 (by norm_num : ‖(2 / 3 : ℝ)‖ < 1) + have h1 := summable_pow_mul_geometric_of_norm_lt_one 1 (by norm_num : ‖(2 / 3 : ℝ)‖ < 1) + have h0 := summable_geometric_of_abs_lt_one (by norm_num : |(2 / 3 : ℝ)| < 1) + convert ((h3.add (h2.mul_left 6)).add (h1.mul_left 12)).add (h0.mul_left 8) using 1 + funext j + ring + +noncomputable def densityBlockEnergyConstant : ℝ := + ∑' j : ℕ, (j + 2 : ℝ) ^ 3 * (2 / 3 : ℝ) ^ j + + theorem densityBlockEnergyConstant_pos : 0 < densityBlockEnergyConstant := by + unfold densityBlockEnergyConstant + have h := density_block_energy_summable.le_tsum 0 (fun _ _ => by positivity) + norm_num at h + linarith + + theorem density_block_energy_sum (J : ℕ) : + (∑ j ∈ Finset.range J, ((j + 2 : ℝ) ^ 3 / (2 : ℝ) ^ j) / (3 / 4 : ℝ) ^ j) ≤ + densityBlockEnergyConstant := by + have he (j : ℕ) : ((j + 2 : ℝ) ^ 3 / (2 : ℝ) ^ j) / (3 / 4 : ℝ) ^ j = + (j + 2 : ℝ) ^ 3 * (2 / 3 : ℝ) ^ j := by + rw [div_div, ← mul_pow] + have hmul : (2 : ℝ) * (3 / 4) = 3 / 2 := by norm_num + rw [hmul, div_eq_mul_inv, ← inv_pow] + norm_num + simp_rw [he] + exact density_block_energy_summable.sum_le_tsum (Finset.range J) (fun _ _ => by positivity) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCRTProduct.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCRTProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e3d08e0f68e6e121b738603aed9dcffe694ec05 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCRTProduct.lean @@ -0,0 +1,118 @@ +import Mathlib.Data.Nat.GCD.BigOperators +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFourier + +namespace OAI + +/-! # Constructing the density product and its Fourier hypotheses -/ + +namespace Ostmann + +open scoped BigOperators + +/-- A bounded density product with its proved local-mean-zero consequence. -/ +structure DensityCRTData (q : ℕ) [NeZero q] where + value : ZMod q → ℂ + norm_le_one : ∀ x, ‖value x‖ ≤ 1 + fourier_nonunit : ∀ x, ¬IsUnit x → densityFourier value x = 0 + +namespace DensityCRTData + +noncomputable def one : DensityCRTData 1 where + value := fun _ => 1 + norm_le_one := by intro x; simp + fourier_nonunit := by + intro x hx + exact (hx (by have h : x = 1 := Subsingleton.elim _ _; rw [h]; exact isUnit_one)).elim + +noncomputable def prime (p : ℕ) [Fact p.Prime] (S : Finset (ZMod p)) : DensityCRTData p where + value := fun x => (centeredDensity S x : ℂ) + norm_le_one := by + intro x + simpa only [Complex.norm_real, Real.norm_eq_abs] using centeredDensity_abs_le S x + fourier_nonunit := densityFourier_centered_prime_nonunit S + +noncomputable def mul {m n : ℕ} [NeZero m] [NeZero n] + (h : m.Coprime n) (A : DensityCRTData m) (B : DensityCRTData n) : DensityCRTData (m * n) where + value := fun x => A.value ((ZMod.chineseRemainder h) x).1 * B.value ((ZMod.chineseRemainder h) x).2 + norm_le_one := by + intro x + rw [norm_mul] + exact (mul_le_mul (A.norm_le_one _) (B.norm_le_one _) (norm_nonneg _) zero_le_one).trans_eq (mul_one 1) + fourier_nonunit := densityFourier_crt_nonunit h A.value B.value A.fourier_nonunit B.fourier_nonunit + +end DensityCRTData + +theorem prime_list_prod_pos (ps : List ℕ) (hp : ∀ p ∈ ps, p.Prime) : 0 < ps.prod := by + induction ps with + | nil => simp + | cons p ps ih => + simp only [List.prod_cons] + exact Nat.mul_pos (hp p (List.mem_cons_self)).pos (ih (fun q hq => hp q (List.mem_cons_of_mem p hq))) + +/-- This is the actual product of the centered functions, formed by CRT +along the list of distinct prime factors. -/ +noncomputable def densityCRTList (ps : List ℕ) (hp : ∀ p ∈ ps, p.Prime) + (hc : ps.Pairwise Nat.Coprime) (S : ∀ p : ℕ, Finset (ZMod p)) : + @DensityCRTData ps.prod ⟨(prime_list_prod_pos ps hp).ne'⟩ := by + cases ps with + | nil => exact DensityCRTData.one + | cons p ps => + have hp' : ∀ q ∈ ps, q.Prime := fun q hq => hp q (List.mem_cons_of_mem p hq) + have hcp := List.pairwise_cons.mp hc + let : Fact p.Prime := ⟨hp p List.mem_cons_self⟩ + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp').ne'⟩ + change DensityCRTData (p * ps.prod) + exact DensityCRTData.mul (m := p) (n := ps.prod) (Nat.coprime_list_prod_right_iff.mpr hcp.1) + (DensityCRTData.prime p (S p)) (densityCRTList ps hp' hcp.2 S) + +theorem densityCRTList_intCast (ps : List ℕ) (hp : ∀ p ∈ ps, p.Prime) + (hc : ps.Pairwise Nat.Coprime) (S : ∀ p : ℕ, Finset (ZMod p)) (n : ℤ) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + (densityCRTList ps hp hc S).value (n : ZMod ps.prod) = + (ps.map fun p => (centeredDensity (S p) (n : ZMod p) : ℂ)).prod := by + induction ps with + | nil => rfl + | cons p ps ih => + have hp' : ∀ q ∈ ps, q.Prime := fun q hq => hp q (List.mem_cons_of_mem p hq) + have hcp := List.pairwise_cons.mp hc + let : Fact p.Prime := ⟨hp p List.mem_cons_self⟩ + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp').ne'⟩ + change (centeredDensity (S p) + ((ZMod.chineseRemainder (Nat.coprime_list_prod_right_iff.mpr hcp.1)) (n : ZMod (p * ps.prod))).1 : ℂ) * + (densityCRTList ps hp' hcp.2 S).value + ((ZMod.chineseRemainder (Nat.coprime_list_prod_right_iff.mpr hcp.1)) (n : ZMod (p * ps.prod))).2 = _ + rw [map_intCast] + change (centeredDensity (S p) (n : ZMod p) : ℂ) * + (densityCRTList ps hp' hcp.2 S).value (n : ZMod ps.prod) = _ + rw [ih hp' hcp.2] + rfl + +/-- The hypotheses of the small-kernel bound hold for the original finite +product of centered density functions. -/ +theorem densityCRTList_energy (ps : List ℕ) (hp : ∀ p ∈ ps, p.Prime) + (hc : ps.Pairwise Nat.Coprime) (S : ∀ p : ℕ, Finset (ZMod p)) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + (∑ a : ZMod ps.prod, ‖densityFourier (densityCRTList ps hp hc S).value a‖ ^ 2) ≤ ps.prod := by + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + exact densityFourier_energy_le _ (densityCRTList ps hp hc S).norm_le_one + +/-- The manuscript's small-kernel bound with all density Fourier +hypotheses supplied by the original centered factors. -/ +theorem densityCRT_small_quadratic_sum (ps : List ℕ) (hp : ∀ p ∈ ps, p.Prime) + (hc : ps.Pairwise Nat.Coprime) (S : ∀ p : ℕ, Finset (ZMod p)) + (W : ℕ) (a : ZMod ps.prod) (weight : ℕ → ℂ) (B C N : ℝ) + (hB : 0 ≤ B) (hN : 0 < N) (hq : (ps.prod : ℝ) ≤ N) + (hW : (W : ℝ) ≤ C * N) (hw : ∀ w ∈ Finset.Ioc 0 W, ‖weight w‖ ≤ B) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + ‖(N : ℂ)⁻¹ * ∑ w ∈ Finset.Ioc 0 W, + densityFourier (densityCRTList ps hp hc S).value (a * (w : ZMod ps.prod) ^ 2) * weight w‖ ≤ + B * (C + 1) * Real.sqrt ((2 : ℝ) ^ (ps.prod.primeFactors.card + 1)) := by + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + exact small_kernel_quadratic_sum_bound ps.prod W + (densityFourier (densityCRTList ps hp hc S).value) + (densityCRTList ps hp hc S).fourier_nonunit (densityCRTList_energy ps hp hc S) + a weight B C N hB hN hq hW hw + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCharacterFamily.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCharacterFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..c1899ae32847c47d73fc76100724db0fdafc8101 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCharacterFamily.lean @@ -0,0 +1,82 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimitiveCharacterCard +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityGaussianFubini + +namespace OAI + +/-! # Grouping the actual primitive characters by their conductors -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators Classical + +noncomputable def densityCharacterFamily (F : Finset PrimitiveComplexCharacter) (q : ℕ) : + Finset (DirichletCharacter ℂ q) := + ((F.filter fun χ => χ.modulus = q).attach).image fun χ => + χ.val.atModulus q (Finset.mem_filter.mp χ.property).2 + + theorem densityCharacterFamily_injective (F : Finset PrimitiveComplexCharacter) (q : ℕ) : + Function.Injective (fun χ : {χ // χ ∈ F.filter (fun χ => χ.modulus = q)} => + χ.val.atModulus q (Finset.mem_filter.mp χ.property).2) := by + intro χ ψ he + apply Subtype.ext + have hχ := (Finset.mem_filter.mp χ.property).2 + have hψ := (Finset.mem_filter.mp ψ.property).2 + obtain ⟨⟨m, hm, c, hc, hn⟩, hmem⟩ := χ + obtain ⟨⟨n, hp, d, hd, hd'⟩, hmem'⟩ := ψ + dsimp at hχ hψ + subst m + subst n + dsimp [PrimitiveComplexCharacter.atModulus] at he + cases he + rfl + + theorem densityCharacterFamily_primitive (F : Finset PrimitiveComplexCharacter) (q : ℕ) + (χ : DirichletCharacter ℂ q) (hχ : χ ∈ densityCharacterFamily F q) : χ.IsPrimitive := by + obtain ⟨ψ, _, rfl⟩ := Finset.mem_image.mp hχ + have hψ := (Finset.mem_filter.mp ψ.property).2 + obtain ⟨⟨n, hp, d, hd, hn⟩, hmem⟩ := ψ + dsimp at hψ + subst n + exact hd + + theorem densityCharacterFamily_sum (F : Finset PrimitiveComplexCharacter) (Q : ℕ) + (hF : ∀ χ ∈ F, χ.modulus ≤ Q) + (f : (q : ℕ) → DirichletCharacter ℂ q → ℝ) : + (∑ χ ∈ F, f χ.modulus χ.character) = + ∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ densityCharacterFamily F q, f q χ := by + have hm : ∀ χ ∈ F, χ.modulus ∈ Finset.Icc 1 Q := fun χ hχ => + Finset.mem_Icc.mpr ⟨χ.positive, hF χ hχ⟩ + rw [← Finset.sum_fiberwise_of_maps_to hm] + apply Finset.sum_congr rfl + intro q _ + rw [densityCharacterFamily, Finset.sum_image] + · rw [← Finset.sum_attach (F.filter fun χ => χ.modulus = q)] + apply Finset.sum_congr rfl + intro χ _ + have hχ := (Finset.mem_filter.mp χ.property).2 + obtain ⟨⟨n, hp, d, hd, hn⟩, hmem⟩ := χ + dsimp at hχ + subst n + rfl + · exact fun χ _ ψ _ he => densityCharacterFamily_injective F q he + + theorem gaussian_hybrid_primitive_mean : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + ∀ a : ℕ → ℂ, ∀ F : Finset PrimitiveComplexCharacter, + (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ∫ t in Icc (-T) T, ∫ u : ℝ, densityHalfGaussian u * + ‖densityCharacterPolynomial (Finset.Icc 1 N) a χ.character (t + u)‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 := by + obtain ⟨C, hC, hb⟩ := gaussian_hybrid_mean + refine ⟨C, hC, ?_⟩ + intro N Q hQ T hT a F hF + rw [densityCharacterFamily_sum F Q hF (fun q χ => ∫ t in Icc (-T) T, + ∫ u : ℝ, densityHalfGaussian u * + ‖densityCharacterPolynomial (Finset.Icc 1 N) a χ (t + u)‖ ^ 2)] + exact hb N Q hQ T hT a (densityCharacterFamily F) + (fun q _ χ hχ => densityCharacterFamily_primitive F q χ hχ) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCompletedSquare.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCompletedSquare.lean new file mode 100644 index 0000000000000000000000000000000000000000..4fa0aeee713c530a25068d615bf52132d13f1702 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCompletedSquare.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterGammaShift +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedRightGrowth + +namespace OAI + +/-! # The entire completed square and its exact reflection -/ + +namespace Ostmann + +open Complex + +noncomputable def densityCompletedSquare (χ : PrimitiveComplexCharacter) (s : ℂ) : ℂ := + (χ.modulus : ℂ) ^ s * χ.completed s ^ 2 + + theorem densityCompletedSquare_analytic (χ : PrimitiveComplexCharacter) (s : ℂ) : + AnalyticAt ℂ (densityCompletedSquare χ) s := by + have hq : (χ.modulus : ℂ) ≠ 0 := by exact_mod_cast χ.positive.ne' + exact ((differentiable_id.const_cpow (Or.inl hq)).analyticAt s).mul + ((χ.completed_analytic s).pow 2) + + theorem densityCompletedSquare_reflection (χ : PrimitiveComplexCharacter) (s : ℂ) : + densityCompletedSquare χ s = + (@DirichletCharacter.rootNumber χ.modulus ⟨χ.positive.ne'⟩ χ.character) ^ 2 * + densityCompletedSquare χ.inverse (1 - s) := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have hq : (χ.modulus : ℂ) ≠ 0 := by exact_mod_cast χ.positive.ne' + have hf := χ.primitive.completedLFunction_one_sub (1 - s) + rw [show (1 : ℂ) - (1 - s) = s by ring, + show (1 : ℂ) - s - 1 / 2 = 1 / 2 - s by ring] at hf + change χ.completed s = (χ.modulus : ℂ) ^ (1 / 2 - s) * + DirichletCharacter.rootNumber χ.character * χ.inverse.completed (1 - s) at hf + have hp : (χ.modulus : ℂ) ^ s * ((χ.modulus : ℂ) ^ (1 / 2 - s)) ^ 2 = + (χ.modulus : ℂ) ^ (1 - s) := by + rw [← Complex.cpow_mul_nat, ← Complex.cpow_add _ _ hq] + congr 1 + norm_num + ring + unfold densityCompletedSquare + rw [hf, mul_pow, mul_pow] + change (χ.modulus : ℂ) ^ s * + (((χ.modulus : ℂ) ^ (1 / 2 - s)) ^ 2 * + (DirichletCharacter.rootNumber χ.character) ^ 2 * χ.inverse.completed (1 - s) ^ 2) = _ + calc + _ = ((χ.modulus : ℂ) ^ s * ((χ.modulus : ℂ) ^ (1 / 2 - s)) ^ 2) * + (DirichletCharacter.rootNumber χ.character) ^ 2 * χ.inverse.completed (1 - s) ^ 2 := by ring + _ = _ := by rw [hp, PrimitiveComplexCharacter.inverse_modulus]; ring + + theorem densityCompletedSquare_eq (χ : PrimitiveComplexCharacter) (s : ℂ) (hs : 0 < s.re) : + densityCompletedSquare χ s = (χ.modulus : ℂ) ^ s * + (DirichletCharacter.gammaFactor χ.character s) ^ 2 * χ.L s ^ 2 := by + rw [densityCompletedSquare, χ.completed_eq_L_mul_gamma s hs, mul_pow] + ring + +noncomputable def densitySquareNormalizer (χ : PrimitiveComplexCharacter) (s : ℂ) : ℂ := + (χ.modulus : ℂ) ^ s * (DirichletCharacter.gammaFactor χ.character s) ^ 2 + + theorem densitySquareNormalizer_ne_zero (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : 0 < s.re) : densitySquareNormalizer χ s ≠ 0 := by + have hq : (χ.modulus : ℂ) ≠ 0 := by exact_mod_cast χ.positive.ne' + have hg : DirichletCharacter.gammaFactor χ.character s ≠ 0 := by + intro he + have hn := χ.gammaInverse_ne_zero s hs + exact hn (by simp only [PrimitiveComplexCharacter.gammaInverse, he, inv_zero]) + exact mul_ne_zero (Complex.cpow_ne_zero_iff.mpr (Or.inl hq)) (pow_ne_zero 2 hg) + + theorem densityCompletedSquare_div (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : 0 < s.re) : densityCompletedSquare χ s / densitySquareNormalizer χ s = χ.L s ^ 2 := by + rw [densityCompletedSquare_eq χ s hs] + exact mul_div_cancel_left₀ _ (densitySquareNormalizer_ne_zero χ s hs) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCompletedStrip.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCompletedStrip.lean new file mode 100644 index 0000000000000000000000000000000000000000..60bed009a42f52246453909bc45bf541bccd500d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCompletedStrip.lean @@ -0,0 +1,81 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityCompletedSquare +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterGammaGrowth + +namespace OAI + +/-! # A polynomial bound for the entire completed square on the contour strip -/ + +namespace Ostmann + +open Complex + + theorem density_completed_strip_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), -(1 / 2 : ℝ) ≤ s.re → s.re ≤ 3 / 2 → + ‖χ.completed s‖ ≤ C * ((χ.modulus : ℝ) + 1) ^ 2 * (|s.im| + 2) := by + obtain ⟨G, hG, hg, _⟩ := characterGamma_growth_bounds + have hr (χ : PrimitiveComplexCharacter) (s : ℂ) (hs : 1 / 2 ≤ s.re) (hs3 : s.re ≤ 3 / 2) : + ‖χ.completed s‖ ≤ (2 * G) * ((χ.modulus : ℝ) + 1) * (|s.im| + 2) := by + have hpos : 0 < s.re := by linarith + have hn : ‖s‖ ≤ |s.im| + 2 := by + apply (Complex.norm_le_abs_re_add_abs_im s).trans + rw [abs_of_pos hpos] + linarith + have hl : ‖χ.L s‖ ≤ 2 * ((χ.modulus : ℝ) + 1) * (|s.im| + 2) := by + apply (χ.L_norm_bound_positive s hpos).trans + apply (div_le_iff₀ hpos).mpr + have h := mul_le_mul_of_nonneg_right hn (by positivity : 0 ≤ (χ.modulus : ℝ) + 1) + have hm := mul_le_mul_of_nonneg_left hs (by positivity : + 0 ≤ 2 * ((χ.modulus : ℝ) + 1) * (|s.im| + 2)) + nlinarith + rw [χ.completed_eq_L_mul_gamma s hpos, norm_mul] + exact (mul_le_mul hl (hg χ s hs (by linarith)) (norm_nonneg _) (by positivity)).trans_eq + (by ring) + refine ⟨2 * G, by positivity, ?_⟩ + intro χ s hs hs3 + have hq : 1 ≤ (χ.modulus : ℝ) := by exact_mod_cast χ.positive + by_cases hh : 1 / 2 ≤ s.re + · apply (hr χ s hh hs3).trans + have hqq : (χ.modulus : ℝ) + 1 ≤ ((χ.modulus : ℝ) + 1) ^ 2 := by nlinarith + exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hqq (by positivity)) (by positivity) + · let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have hi := hr χ.inverse (1 - s) (by simp; linarith) (by simp; linarith) + simp only [PrimitiveComplexCharacter.inverse_modulus, sub_im, one_im, zero_sub, abs_neg] at hi + have hp : ‖(χ.modulus : ℂ) ^ (1 / 2 - s)‖ ≤ χ.modulus := by + rw [← Complex.ofReal_natCast, Complex.norm_cpow_eq_rpow_re_of_pos (by linarith)] + apply (Real.rpow_le_rpow_of_exponent_le hq (show (1 / 2 - s).re ≤ 1 by simp; linarith)).trans_eq + exact Real.rpow_one _ + have hf := χ.primitive.completedLFunction_one_sub (1 - s) + rw [show (1 : ℂ) - (1 - s) = s by ring, + show (1 : ℂ) - s - 1 / 2 = 1 / 2 - s by ring] at hf + change χ.completed s = (χ.modulus : ℂ) ^ (1 / 2 - s) * + DirichletCharacter.rootNumber χ.character * χ.inverse.completed (1 - s) at hf + rw [hf, norm_mul, norm_mul, χ.rootNumber_norm_eq_one, mul_one] + calc + _ ≤ (χ.modulus : ℝ) * ((2 * G) * ((χ.modulus : ℝ) + 1) * (|s.im| + 2)) := + mul_le_mul hp hi (norm_nonneg _) (by positivity) + _ ≤ _ := by + have hqq : (χ.modulus : ℝ) * ((χ.modulus : ℝ) + 1) ≤ ((χ.modulus : ℝ) + 1) ^ 2 := by nlinarith + have h := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hqq + (by positivity : 0 ≤ 2 * G)) (by positivity : 0 ≤ |s.im| + 2) + nlinarith + + theorem density_completed_square_strip_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), -(1 / 2 : ℝ) ≤ s.re → s.re ≤ 3 / 2 → + ‖densityCompletedSquare χ s‖ ≤ C * ((χ.modulus : ℝ) + 1) ^ 6 * (|s.im| + 2) ^ 2 := by + obtain ⟨C, hC, hb⟩ := density_completed_strip_bound + refine ⟨C ^ 2, by positivity, ?_⟩ + intro χ s hs hs3 + have hq : 1 ≤ (χ.modulus : ℝ) := by exact_mod_cast χ.positive + have hp : ‖(χ.modulus : ℂ) ^ s‖ ≤ ((χ.modulus : ℝ) + 1) ^ 2 := by + rw [← Complex.ofReal_natCast, Complex.norm_cpow_eq_rpow_re_of_pos (by linarith)] + calc + _ ≤ (χ.modulus : ℝ) ^ (2 : ℝ) := Real.rpow_le_rpow_of_exponent_le hq (by linarith) + _ ≤ _ := by rw [Real.rpow_two]; nlinarith + rw [densityCompletedSquare, norm_mul, norm_pow] + apply (mul_le_mul hp (pow_le_pow_left₀ (norm_nonneg _) (hb χ s hs hs3) 2) + (by positivity) (by positivity)).trans_eq + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCorrelation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCorrelation.lean new file mode 100644 index 0000000000000000000000000000000000000000..ecb6d928a651c31e27aede01a234ec3372ba0123 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCorrelation.lean @@ -0,0 +1,99 @@ +import OAI.NumberTheory.Ostmann.Characters.PrimeCRTFourier + +namespace OAI + +/-! # The prime-by-prime correlation bound for centered densities -/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +/-- Which of the two squarefree divisors contains a prime of their union. -/ +inductive CorrelationSide where + | left + | right + | both + +/-- Extend the local transform to an unrestricted prime index. The value at +zero is immaterial; all applications index positive primes. -/ +noncomputable def primeDensityFourier (f : ∀ p : ℕ, ZMod p → ℂ) (p : ℕ) : ZMod p → ℂ := + if h : 0 < p then @densityFourier p ⟨h.ne'⟩ (f p) else fun _ => 0 + +theorem primeDensityFourier_eq {p : ℕ} [NeZero p] (f : ∀ p : ℕ, ZMod p → ℂ) : + primeDensityFourier f p = densityFourier (f p) := by + simp only [primeDensityFourier, dite_eq_left (Nat.pos_of_ne_zero (NeZero.ne p))] + +noncomputable def correlationPrimeFactor (f : ∀ p : ℕ, ZMod p → ℂ) + (side : ℕ → CorrelationSide) (a b : ∀ p : ℕ, (ZMod p)ˣ) (p : ℕ) (x : ZMod p) : ℂ := + match side p with + | .left => primeDensityFourier f p ((a p : ZMod p) * x) + | .right => conj (primeDensityFourier f p ((b p : ZMod p) * x)) + | .both => primeDensityFourier f p ((a p : ZMod p) * x) * + conj (primeDensityFourier f p ((b p : ZMod p) * x)) + +noncomputable def correlationPrimeBound (side : ℕ → CorrelationSide) (p : ℕ) : ℝ := + match side p with + | .left => (Real.sqrt (p : ℝ))⁻¹ + | .right => (Real.sqrt (p : ℝ))⁻¹ + | .both => 1 + +theorem correlationPrimeBound_nonneg (side : ℕ → CorrelationSide) (p : ℕ) : + 0 ≤ correlationPrimeBound side p := by + unfold correlationPrimeBound + split <;> positivity + +theorem correlationPrimeFactor_coefficient_le {p : ℕ} [NeZero p] + (f : ∀ p : ℕ, ZMod p → ℂ) (hf : ∀ x, ‖f p x‖ ≤ 1) + (side : ℕ → CorrelationSide) (a b : ∀ p : ℕ, (ZMod p)ˣ) (u : ZMod p) : + ‖additiveFourier (correlationPrimeFactor f side a b p) u‖ ≤ + correlationPrimeBound side p := by + unfold correlationPrimeFactor correlationPrimeBound + cases side p with + | left => + simp only [primeDensityFourier_eq] + exact densityFourier_unit_coefficient_le (f p) hf (a p) u + | right => + simp only [primeDensityFourier_eq, additiveFourier_conj, Complex.norm_conj] + exact densityFourier_unit_coefficient_le (f p) hf (b p) (-u) + | both => + simp only [primeDensityFourier_eq] + exact densityFourier_unit_cross_le_one (f p) (f p) hf hf (a p) (b p) u + +/-- This proves the local-product form of the manuscript's `A_{d,d'}`, +with no analytic hypothesis on the density beyond its pointwise bound. -/ +theorem density_correlation_coefficient_bound (ps : List ℕ) + (hp : ∀ p ∈ ps, p.Prime) (hc : ps.Pairwise Nat.Coprime) + (f : ∀ p : ℕ, ZMod p → ℂ) (hf : ∀ p ∈ ps, ∀ x, ‖f p x‖ ≤ 1) + (side : ℕ → CorrelationSide) (a b : ∀ p : ℕ, (ZMod p)ˣ) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + ∀ u, ‖additiveFourier (primeCRTFunction ps hp hc (correlationPrimeFactor f side a b)) u‖ ≤ + (ps.map (correlationPrimeBound side)).prod := by + apply primeCRTFunction_coefficient_le + · intro p _ + exact correlationPrimeBound_nonneg side p + · intro p h u + let : NeZero p := ⟨(hp p h).ne_zero⟩ + exact correlationPrimeFactor_coefficient_le f (hf p h) side a b u + +/-- The weighted linear-phase estimate for the actual product of local +correlation factors. -/ +theorem density_correlation_weighted_sum_bound (ps : List ℕ) + (hp : ∀ p ∈ ps, p.Prime) (hc : ps.Pairwise Nat.Coprime) + (f : ∀ p : ℕ, ZMod p → ℂ) (hf : ∀ p ∈ ps, ∀ x, ‖f p x‖ ≤ 1) + (side : ℕ → CorrelationSide) (a b : ∀ p : ℕ, (ZMod p)ˣ) + (α : ℝ) (w : ℕ → ℂ) (N : ℕ) : + ‖∑ n ∈ Finset.range N, w n * + (primeCRTFunction ps hp hc (correlationPrimeFactor f side a b) (n : ZMod ps.prod) * + realAdditivePhase α ^ n)‖ ≤ + discreteVariation w N * (2 * (ps.map (correlationPrimeBound side)).prod * + ((N : ℝ) + ps.prod * (1 + Real.log ps.prod))) := by + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + apply weighted_periodic_linear_phase_bound + · exact List.prod_nonneg (fun x hx => by + obtain ⟨p, _, rfl⟩ := List.mem_map.mp hx + exact correlationPrimeBound_nonneg side p) + · exact density_correlation_coefficient_bound ps hp hc f hf side a b + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCorrelationMass.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCorrelationMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..a55c519e7b3505f5ebe32a48ff1b544e22a6e7c0 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCorrelationMass.lean @@ -0,0 +1,126 @@ +import OAI.NumberTheory.Ostmann.QuadraticCenter.PrimeSetQuadratic + +namespace OAI + +/-! # Absolute residue mass of the actual density correlations -/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +theorem norm_sum_le_of_energy {q : ℕ} [NeZero q] (f : ZMod q → ℂ) + (hf : (∑ x : ZMod q, ‖f x‖ ^ 2) ≤ q) : + (∑ x : ZMod q, ‖f x‖) ≤ q := by + have hc := Finset.sum_mul_sq_le_sq_mul_sq (Finset.univ : Finset (ZMod q)) + (fun x => ‖f x‖) (fun _ => (1 : ℝ)) + simp only [mul_one, one_pow, Finset.sum_const, Finset.card_univ, ZMod.card, + nsmul_eq_mul] at hc + have hq : (0 : ℝ) ≤ q := Nat.cast_nonneg q + have hh := mul_le_mul_of_nonneg_right hf hq + have hs : 0 ≤ ∑ x : ZMod q, ‖f x‖ := Finset.sum_nonneg (fun _ _ => norm_nonneg _) + nlinarith + +theorem norm_product_sum_le_of_energy {q : ℕ} [NeZero q] (f g : ZMod q → ℂ) + (hf : (∑ x : ZMod q, ‖f x‖ ^ 2) ≤ q) + (hg : (∑ x : ZMod q, ‖g x‖ ^ 2) ≤ q) : + (∑ x : ZMod q, ‖f x * conj (g x)‖) ≤ q := by + simp only [norm_mul, Complex.norm_conj] + have hc := Finset.sum_mul_sq_le_sq_mul_sq (Finset.univ : Finset (ZMod q)) + (fun x => ‖f x‖) (fun x => ‖g x‖) + have hh := mul_le_mul hf hg (by positivity) (Nat.cast_nonneg q) + have hs : 0 ≤ ∑ x : ZMod q, ‖f x‖ * ‖g x‖ := Finset.sum_nonneg (fun _ _ => by positivity) + nlinarith + +theorem correlationPrimeFactor_mass (p : ℕ) [NeZero p] + (f : ∀ p : ℕ, ZMod p → ℂ) (hf : ∀ x, ‖f p x‖ ≤ 1) + (side : ℕ → CorrelationSide) (a b : ∀ p : ℕ, (ZMod p)ˣ) : + (∑ x : ZMod p, ‖correlationPrimeFactor f side a b p x‖) ≤ p := by + have ha : (∑ x : ZMod p, ‖densityFourier (f p) ((a p : ZMod p) * x)‖ ^ 2) ≤ p := by + rw [unit_dilation_energy] + exact densityFourier_energy_le _ hf + have hb : (∑ x : ZMod p, ‖densityFourier (f p) ((b p : ZMod p) * x)‖ ^ 2) ≤ p := by + rw [unit_dilation_energy] + exact densityFourier_energy_le _ hf + simp only [correlationPrimeFactor, primeDensityFourier_eq] + cases side p with + | left => exact norm_sum_le_of_energy _ ha + | right => simpa only [Complex.norm_conj] using norm_sum_le_of_energy _ hb + | both => exact norm_product_sum_le_of_energy _ _ ha hb + +theorem primeCRTFunction_mass (ps : List ℕ) (hp : ∀ p ∈ ps, p.Prime) + (hc : ps.Pairwise Nat.Coprime) (F : ∀ p : ℕ, ZMod p → ℂ) + (hF : ∀ p (h : p ∈ ps), let : NeZero p := ⟨(hp p h).ne_zero⟩; + (∑ x : ZMod p, ‖F p x‖) ≤ p) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + (∑ x : ZMod ps.prod, ‖primeCRTFunction ps hp hc F x‖) ≤ ps.prod := by + induction ps with + | nil => + intro _ + simp only [primeCRTFunction, norm_one, Finset.sum_const, nsmul_eq_mul, + mul_one, List.prod_nil, Nat.cast_one] + have hcard : (Finset.univ : Finset (ZMod ([] : List ℕ).prod)).card = 1 := by + rw [Finset.card_univ, ZMod.card, List.prod_nil] + exact_mod_cast hcard.le + | cons p ps ih => + have hp' : ∀ q ∈ ps, q.Prime := fun q hq => hp q (List.mem_cons_of_mem p hq) + have hcp := List.pairwise_cons.mp hc + let : NeZero p := ⟨(hp p List.mem_cons_self).ne_zero⟩ + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp').ne'⟩ + intro _ + let e := ZMod.chineseRemainder (Nat.coprime_list_prod_right_iff.mpr hcp.1) + change (∑ x : ZMod (p * ps.prod), ‖F p (e x).1 * primeCRTFunction ps hp' hcp.2 F (e x).2‖) ≤ _ + rw [← e.symm.bijective.sum_comp (fun x => + ‖F p (e x).1 * primeCRTFunction ps hp' hcp.2 F (e x).2‖)] + simp only [e.apply_symm_apply] + simp only [Fintype.sum_prod_type, norm_mul] + simp_rw [← Finset.mul_sum] + rw [← Finset.sum_mul] + have ht := ih hp' hcp.2 (fun q hq => hF q (List.mem_cons_of_mem p hq)) + simpa only [List.prod_cons, Nat.cast_mul] using + mul_le_mul (hF p List.mem_cons_self) ht (by positivity) (Nat.cast_nonneg p) + +/-- The original two density transforms have a common periodic model whose +absolute mass is at most one after probability normalization. -/ +theorem primeSet_density_correlation_mass_model (U V : Finset ℕ) + (hpU : ∀ p ∈ U, p.Prime) (hpV : ∀ p ∈ V, p.Prime) + (S : ∀ p : ℕ, Finset (ZMod p)) + (vp : (ZMod U.toList.prod)ˣ) (vq : (ZMod V.toList.prod)ˣ) : + let : NeZero U.toList.prod := ⟨(prime_list_prod_pos _ (primeSet_list_prime U hpU)).ne'⟩ + let : NeZero V.toList.prod := ⟨(prime_list_prod_pos _ (primeSet_list_prime V hpV)).ne'⟩ + ∃ F : ZMod (U ∪ V).toList.prod → ℂ, + (∀ n : ℤ, + densityFourier (densityCRTList U.toList (primeSet_list_prime U hpU) (primeSet_list_coprime U hpU) S).value + ((vp : ZMod U.toList.prod) * (n : ZMod U.toList.prod)) * + conj (densityFourier (densityCRTList V.toList (primeSet_list_prime V hpV) (primeSet_list_coprime V hpV) S).value + ((vq : ZMod V.toList.prod) * (n : ZMod V.toList.prod))) = F (n : ZMod (U ∪ V).toList.prod)) ∧ + (let : NeZero (U ∪ V).toList.prod := ⟨(prime_list_prod_pos _ + (primeSet_list_prime (U ∪ V) (fun p hp => (Finset.mem_union.mp hp).elim (hpU p) (hpV p)))).ne'⟩ + (∑ x : ZMod (U ∪ V).toList.prod, ‖F x‖) ≤ (U ∪ V).toList.prod) := by + intro _ _ + let hpUV : ∀ p ∈ U ∪ V, p.Prime := fun p hp => + (Finset.mem_union.mp hp).elim (hpU p) (hpV p) + let : NeZero (U ∪ V).toList.prod := ⟨(prime_list_prod_pos _ (primeSet_list_prime _ hpUV)).ne'⟩ + let f : ∀ p : ℕ, ZMod p → ℂ := fun p x => (centeredDensity (S p) x : ℂ) + obtain ⟨a, ha⟩ := densityFourier_centered_unit_product U.toList + (primeSet_list_prime U hpU) (primeSet_list_coprime U hpU) S vp + obtain ⟨b, hb⟩ := densityFourier_centered_unit_product V.toList + (primeSet_list_prime V hpV) (primeSet_list_coprime V hpV) S vq + refine ⟨primeCRTFunction (U ∪ V).toList (primeSet_list_prime _ hpUV) + (primeSet_list_coprime _ hpUV) (correlationPrimeFactor f (supportCorrelationSide U V) a b), ?_, ?_⟩ + · intro n + rw [ha, hb, primeCRTFunction_intCast, + ← List.prod_toFinset _ U.nodup_toList, + ← List.prod_toFinset _ V.nodup_toList, + ← List.prod_toFinset _ (U ∪ V).nodup_toList] + simp only [Finset.toList_toFinset] + exact (local_correlation_product U V (U ∪ V) rfl f a b n).symm + · apply primeCRTFunction_mass + intro p hp + let : NeZero p := ⟨(primeSet_list_prime _ hpUV p hp).ne_zero⟩ + apply correlationPrimeFactor_mass + intro x + simpa only [f, Complex.norm_real, Real.norm_eq_abs] using centeredDensity_abs_le (S p) x + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCriticalDetector.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCriticalDetector.lean new file mode 100644 index 0000000000000000000000000000000000000000..5216ee0f14e7a1ba14ce71c1fc8d0537c1f9ef61 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCriticalDetector.lean @@ -0,0 +1,132 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorDichotomy +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFourierContour +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityKernelPacking + +namespace OAI + +/-! # The detector in the height convention of the proved moments -/ + +namespace Ostmann + +open Complex MeasureTheory + +noncomputable def densityCriticalProduct (χ : PrimitiveComplexCharacter) (X : ℕ) + (t u : ℝ) : ℂ := + χ.L (densityVerticalPoint (1 / 2) (t + u)) * + densityMollifier X χ.character (densityVerticalPoint (1 / 2) (t + u)) + + theorem densityCriticalProduct_continuous (χ : PrimitiveComplexCharacter) (X : ℕ) (t : ℝ) : + Continuous (densityCriticalProduct χ X t) := by + have hL : Continuous χ.L := continuous_iff_continuousAt.mpr (fun z => (χ.L_analytic z).continuousAt) + have hM : Continuous (densityMollifier X χ.character) := by + apply continuous_iff_continuousAt.mpr + intro z + simpa only [zero_add] using (densityMollifier_shift_analytic χ X 0 z).continuousAt + exact (hL.mul hM).comp (by unfold densityVerticalPoint; fun_prop) + + theorem densityCriticalProduct_bound (χ : PrimitiveComplexCharacter) (X : ℕ) (t u : ℝ) : + ‖densityCriticalProduct χ X t u‖ ≤ + (2 * ((χ.modulus : ℝ) + 1) * X * (3 + 2 * Real.pi * |t| + 2 * Real.pi)) * + (1 + |u|) := by + have hL := density_L_short_positive_bound χ (densityVerticalPoint (1 / 2) (t + u)) + (by simp [densityVerticalPoint]) (by norm_num [densityVerticalPoint]) + have hM := densityMollifier_norm_le χ X (densityVerticalPoint (1 / 2) (t + u)) + (by simp [densityVerticalPoint]) + have ha : |(densityVerticalPoint (1 / 2) (t + u)).im| ≤ + 2 * Real.pi * (|t| + |u|) := by + have him : (densityVerticalPoint (1 / 2) (t + u)).im = 2 * Real.pi * (t + u) := by + simp [densityVerticalPoint] + rw [him] + rw [abs_mul, abs_of_pos (by positivity : 0 < 2 * Real.pi)] + exact mul_le_mul_of_nonneg_left (abs_add_le t u) (by positivity) + have hb : 3 + |(densityVerticalPoint (1 / 2) (t + u)).im| ≤ + (3 + 2 * Real.pi * |t| + 2 * Real.pi) * (1 + |u|) := by + nlinarith [Real.pi_pos, abs_nonneg t, abs_nonneg u, + show 0 ≤ 2 * Real.pi * |t| * |u| by positivity] + rw [densityCriticalProduct, norm_mul] + apply (mul_le_mul hL hM (norm_nonneg _) (by positivity)).trans + have h := mul_le_mul_of_nonneg_left hb + (show 0 ≤ 2 * ((χ.modulus : ℝ) + 1) * X by positivity) + convert h using 1 <;> ring + + theorem densityCriticalProduct_integrable (χ : PrimitiveComplexCharacter) (X : ℕ) (t : ℝ) : + Integrable (fun u => densityCubicWeight u * ‖densityCriticalProduct χ X t u‖) := by + let K := 2 * ((χ.modulus : ℝ) + 1) * X * (3 + 2 * Real.pi * |t| + 2 * Real.pi) + have hg : Integrable (fun u : ℝ => (1 + |u|) ^ (-(2 : ℝ))) := by + simpa only [Real.norm_eq_abs] using + (integrable_one_add_norm (E := ℝ) (by norm_num : (Module.finrank ℝ ℝ : ℝ) < 2)) + apply (hg.const_mul K).mono' + · exact ((by + exact continuous_const.div ((continuous_const.add continuous_abs).pow 3) + (fun u => by positivity) : Continuous densityCubicWeight).mul + (densityCriticalProduct_continuous χ X t).norm).aestronglyMeasurable + · filter_upwards with u + rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (densityCubicWeight_nonneg _) (norm_nonneg _))] + calc + _ ≤ densityCubicWeight u * (K * (1 + |u|)) := + mul_le_mul_of_nonneg_left (densityCriticalProduct_bound χ X t u) (densityCubicWeight_nonneg u) + _ = K * (1 + |u|) ^ (-(2 : ℝ)) := by + rw [densityCubicWeight, Real.rpow_neg (by positivity), Real.rpow_ofNat] + field_simp + + theorem densityCubicWeight_scaled (u : ℝ) : + densityCubicWeight (2 * Real.pi * u) ≤ densityCubicWeight u := by + unfold densityCubicWeight + apply one_div_le_one_div_of_le (by positivity) + apply pow_le_pow_left₀ (by positivity) + rw [abs_mul, abs_of_pos (by positivity : 0 < 2 * Real.pi)] + nlinarith [Real.pi_gt_three, abs_nonneg u] + + theorem densityDetector_scaled_bound (χ : PrimitiveComplexCharacter) (X : ℕ) + (β t : ℝ) (hβ : 1 / 2 < β) (hβ1 : β ≤ 1) (Y : ℝ) (hY : 1 ≤ Y) (u : ℝ) : + ‖densityDetectorIntegrand χ X (densityVerticalPoint β t) Y + (((1 / 2 - β : ℝ) : ℂ) + (2 * Real.pi * u : ℝ) * I)‖ ≤ + (16 * Y ^ (1 / 2 - β) / (β - 1 / 2)) * + (densityCubicWeight u * ‖densityCriticalProduct χ X t u‖) := by + have he : densityVerticalPoint β t + (((1 / 2 - β : ℝ) : ℂ) + (2 * Real.pi * u : ℝ) * I) = + densityVerticalPoint (1 / 2) (t + u) := by + unfold densityVerticalPoint + push_cast + ring + have hk := densityDetectorKernel_left_bound (β - 1 / 2) (2 * Real.pi * u) + (by linarith) (by linarith) + rw [← Complex.ofReal_neg, show -(β - 1 / 2) = 1 / 2 - β by ring, + ← densityCubicWeight_rpow] at hk + have hk' := hk.trans (mul_le_mul_of_nonneg_left (densityCubicWeight_scaled u) (by positivity)) + rw [densityDetectorIntegrand, norm_mul, norm_mul, he, + Complex.norm_cpow_eq_rpow_re_of_pos (by linarith : 0 < Y)] + simp only [add_re, ofReal_re, mul_re, ofReal_im, I_re, I_im, mul_zero, zero_mul, + sub_zero, add_zero] + have hh := mul_le_mul_of_nonneg_left hk' + (show 0 ≤ ‖densityCriticalProduct χ X t u‖ * Y ^ (1 / 2 - β) by positivity) + convert hh using 1 <;> dsimp [densityCriticalProduct] + ring + + theorem densityDetectorMean_at_zero_bound (χ : PrimitiveComplexCharacter) (X : ℕ) + (β t : ℝ) (hβ : 1 / 2 < β) (hβ1 : β ≤ 1) + (hz : χ.L (densityVerticalPoint β t) = 0) (Y : ℝ) (hY : 1 ≤ Y) : + ‖densityDetectorMean χ X (densityVerticalPoint β t) Y‖ ≤ + (16 * Y ^ (1 / 2 - β) / (β - 1 / 2)) * + ∫ u : ℝ, densityCubicWeight u * ‖densityCriticalProduct χ X t u‖ := by + rw [densityDetectorMean_at_zero χ X _ (by simpa [densityVerticalPoint] using hβ) + (by simpa [densityVerticalPoint] using hβ1) hz Y hY] + have hre : (densityVerticalPoint β t).re = β := by simp [densityVerticalPoint] + rw [hre] + have hscale := density_fourier_integral_scale (fun u => densityDetectorIntegrand χ X + (densityVerticalPoint β t) Y (((1 / 2 - β : ℝ) : ℂ) + u * I)) + have hconst : ((1 / (2 * Real.pi) : ℝ) : ℂ) = (2 * (Real.pi : ℂ))⁻¹ := by + simp + rw [hconst] + change ‖(2 * (Real.pi : ℂ))⁻¹ * (∫ u : ℝ, densityDetectorIntegrand χ X + (densityVerticalPoint β t) Y (((1 / 2 - β : ℝ) : ℂ) + u * I))‖ ≤ _ + rw [hscale] + apply (norm_integral_le_integral_norm _).trans + rw [← integral_const_mul] + apply integral_mono_of_nonneg + · exact Filter.Eventually.of_forall (fun _ => norm_nonneg _) + · exact (densityCriticalProduct_integrable χ X t).const_mul _ + · exact Filter.Eventually.of_forall (densityDetector_scaled_bound χ X β t hβ hβ1 Y hY) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCriticalMass.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCriticalMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..c051ccf20ff99f0d68dc324569d34cbfe2bdeba5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCriticalMass.lean @@ -0,0 +1,51 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityCriticalDetector +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityPackedProduct + +namespace OAI + +/-! # The literal critical-line mass controlling the integral alternative -/ + +namespace Ostmann + +open MeasureTheory + +noncomputable def densityCriticalMass (χ : PrimitiveComplexCharacter) (X : ℕ) (t : ℝ) : ℝ := + ∫ v, densityCubicWeight (v - t) * ‖χ.L (densityVerticalPoint (1 / 2) v)‖ * + ‖densityMollifier X χ.character (densityVerticalPoint (1 / 2) v)‖ + + theorem densityCriticalMass_nonneg (χ : PrimitiveComplexCharacter) (X : ℕ) (t : ℝ) : + 0 ≤ densityCriticalMass χ X t := + integral_nonneg (fun _ => mul_nonneg (mul_nonneg (densityCubicWeight_nonneg _) (norm_nonneg _)) (norm_nonneg _)) + + theorem densityCriticalMass_eq (χ : PrimitiveComplexCharacter) (X : ℕ) (t : ℝ) : + (∫ u, densityCubicWeight u * ‖densityCriticalProduct χ X t u‖) = densityCriticalMass χ X t := by + have he := integral_add_right_eq_self (μ := volume) + (fun v => densityCubicWeight (v - t) * ‖χ.L (densityVerticalPoint (1 / 2) v)‖ * + ‖densityMollifier X χ.character (densityVerticalPoint (1 / 2) v)‖) t + convert he using 1 + apply integral_congr_ae + filter_upwards with u + simp only [add_sub_cancel_right, densityCriticalProduct, norm_mul] + rw [add_comm u t] + ring + rfl + + theorem densityDetector_uniform_mass_bound (χ : PrimitiveComplexCharacter) (X : ℕ) + (σ β t : ℝ) (hσ : 1 / 2 < σ) (hβ : σ ≤ β) (hβ1 : β ≤ 1) + (hz : χ.L (densityVerticalPoint β t) = 0) (Y : ℝ) (hY : 1 ≤ Y) : + ‖densityDetectorMean χ X (densityVerticalPoint β t) Y‖ ≤ + (16 * Y ^ (1 / 2 - σ) / (σ - 1 / 2)) * densityCriticalMass χ X t := by + have hm := densityDetectorMean_at_zero_bound χ X β t (hσ.trans_le hβ) hβ1 hz Y hY + rw [densityCriticalMass_eq] at hm + apply hm.trans + apply mul_le_mul_of_nonneg_right _ (densityCriticalMass_nonneg χ X t) + calc + _ ≤ (16 * Y ^ (1 / 2 - σ)) / (β - 1 / 2) := by + apply div_le_div_of_nonneg_right _ (by linarith) + exact mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow_of_exponent_le hY (by linarith)) (by norm_num) + _ ≤ _ := div_le_div_of_nonneg_left (by positivity) (by linarith) (by linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCubicIntegrability.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCubicIntegrability.lean new file mode 100644 index 0000000000000000000000000000000000000000..846da4c43beffee53285ef0a14f4dd3eb2af2716 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityCubicIntegrability.lean @@ -0,0 +1,58 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityPackedCharacterMoments +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityWeightedProductCauchy + +namespace OAI + +/-! # Integrability of the mixed critical-line detector product -/ + +namespace Ostmann + +open MeasureTheory + + theorem densityCubicWeight_continuous : Continuous densityCubicWeight := by + unfold densityCubicWeight + exact continuous_const.div ((continuous_const.add continuous_abs).pow 3) (fun _ => by positivity) + + theorem densityCubicWeight_integrable : Integrable densityCubicWeight := by + have h : Integrable (fun v : ℝ => (1 + ‖v‖) ^ (-(3 : ℝ))) := + integrable_one_add_norm (E := ℝ) (by norm_num : (Module.finrank ℝ ℝ : ℝ) < 3) + simpa only [Real.norm_eq_abs, ← densityCubicWeight_rpow] using h + + theorem densityCubicWeight_shift_integrable (t : ℝ) : + Integrable (fun v => densityCubicWeight (v - t)) := + densityCubicWeight_integrable.comp_sub_right t + + theorem densityCubicWeight_shift_integral (t : ℝ) : + (∫ v, densityCubicWeight (v - t)) = ∫ v, densityCubicWeight v := + integral_sub_right_eq_self densityCubicWeight t + + theorem density_cubic_mixed_integrable (f g : ℝ → ℝ) (hf : Continuous f) (hg : Continuous g) + (hf0 : ∀ v, 0 ≤ f v) (hg0 : ∀ v, 0 ≤ g v) (t : ℝ) + (h4 : Integrable (fun v => densityCubicWeight (v - t) * f v ^ 4)) + (h2g : Integrable (fun v => densityCubicWeight (v - t) * g v ^ 2)) : + Integrable (fun v => densityCubicWeight (v - t) * f v ^ 2) ∧ + Integrable (fun v => densityCubicWeight (v - t) * f v * g v) := by + have hwc : Continuous (fun v => densityCubicWeight (v - t)) := + densityCubicWeight_continuous.comp (continuous_id.sub continuous_const) + have h2 : Integrable (fun v => densityCubicWeight (v - t) * f v ^ 2) := by + apply ((densityCubicWeight_shift_integrable t).add h4).mono' + (hwc.mul (hf.pow 2)).aestronglyMeasurable + filter_upwards with v + change ‖densityCubicWeight (v - t) * f v ^ 2‖ ≤ _ + rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (densityCubicWeight_nonneg _) (sq_nonneg _))] + have h : f v ^ 2 ≤ 1 + f v ^ 4 := by nlinarith [sq_nonneg (f v ^ 2 - 1)] + have hh := mul_le_mul_of_nonneg_left h (densityCubicWeight_nonneg (v - t)) + simpa only [mul_add, mul_one, Pi.add_apply] using hh + refine ⟨h2, ?_⟩ + apply (h2.add h2g).mono' ((hwc.mul hf).mul hg).aestronglyMeasurable + filter_upwards with v + change ‖densityCubicWeight (v - t) * f v * g v‖ ≤ _ + rw [Real.norm_eq_abs, abs_of_nonneg + (mul_nonneg (mul_nonneg (densityCubicWeight_nonneg _) (hf0 v)) (hg0 v))] + have h : f v * g v ≤ f v ^ 2 + g v ^ 2 := by nlinarith [sq_nonneg (f v - g v)] + have hh := mul_le_mul_of_nonneg_left h (densityCubicWeight_nonneg (v - t)) + simpa only [mul_add, mul_assoc, Pi.add_apply] using hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDefectSelection.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDefectSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..f86caf8ff442af53e3f0de16dac973a33aba5ee6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDefectSelection.lean @@ -0,0 +1,77 @@ +import OAI.NumberTheory.Ostmann.Construction.CollisionTestTransfer +import OAI.NumberTheory.Ostmann.Construction.WeightedPrimeSelection + +namespace OAI + +/-! # Small collision defect forces balanced supports and accurate tests -/ + +namespace Ostmann + +open scoped BigOperators Classical + +theorem reciprocal_gap_forces_thirds (a b p : ℝ) (ha : 0 < a) (hb : 0 < b) + (hsum : a + b = p) (hgap : p * (1 / a + 1 / b - 4 / p) ≤ 1 / 4) : + p / 3 ≤ a ∧ a ≤ 2 * p / 3 := by + have hp : 0 < p := by linarith + have hab : 0 < a * b := mul_pos ha hb + have hid : p * (1 / a + 1 / b - 4 / p) = (a - b) ^ 2 / (a * b) := by + field_simp + rw [← hsum] + ring + have hsq : (a - b) ^ 2 ≤ (1 / 4 : ℝ) * (a * b) := by + apply (div_le_iff₀ hab).mp + rwa [← hid] + constructor + · by_contra! h + have hba : 0 ≤ b - 2 * a := by linarith + have hab' : 0 ≤ 2 * b - a := by linarith + nlinarith [mul_nonneg hba hab'] + · by_contra! h + have hab' : 0 ≤ a - 2 * b := by linarith + have hba : 0 ≤ 2 * a - b := by linarith + nlinarith [mul_nonneg hab' hba] + +theorem small_defect_balances_supports (p : ℕ) (S T : Finset ℕ) (μ ν : ℕ → ℝ) + (hS : S.Nonempty) (hT : T.Nonempty) (hcard : S.card + T.card = p) + (hsmall : (p : ℝ) * collisionDefect p S T μ ν ≤ 1 / 4) : + (p : ℝ) / 3 ≤ S.card ∧ (S.card : ℝ) ≤ 2 * p / 3 := by + apply reciprocal_gap_forces_thirds (S.card : ℝ) T.card p + (by exact_mod_cast hS.card_pos) (by exact_mod_cast hT.card_pos) (by exact_mod_cast hcard) + have henergy : 0 ≤ (∑ r ∈ S, (μ r - 1 / (S.card : ℝ)) ^ 2) + + ∑ r ∈ T, (ν r - 1 / (T.card : ℝ)) ^ 2 := by positivity + have hm := mul_nonneg (Nat.cast_nonneg (α := ℝ) p) henergy + unfold collisionDefect at hsmall + nlinarith only [hsmall, hm] + +theorem small_defect_controls_test_errors (p : ℕ) (S T : Finset ℕ) (μ ν f g : ℕ → ℝ) + (hS : S.Nonempty) (hT : T.Nonempty) (hcard : S.card + T.card ≤ p) + (hf : ∀ r ∈ S, |f r| ≤ 1) (hg : ∀ r ∈ T, |g r| ≤ 1) + (δ : ℝ) (hδ : 0 ≤ δ) + (hsmall : (p : ℝ) * collisionDefect p S T μ ν ≤ δ ^ 2 / 64) : + |residueTestError S μ f| ≤ δ / 8 ∧ |residueTestError T ν g| ≤ δ / 8 := by + have hh := (collisionDefect_controls_tests p S T μ ν f g hS hT hcard hf hg).trans hsmall + have hs := sq_nonneg (residueTestError S μ f) + have ht := sq_nonneg (residueTestError T ν g) + constructor + · rw [abs_le] + constructor <;> nlinarith + · rw [abs_le] + constructor <;> nlinarith + +/-- Weighted Markov bound, used with cost `p * collisionDefect`. -/ +theorem weighted_cost_exception_bound (P : Finset ℕ) (w cost : ℕ → ℝ) (δ : ℝ) + (hw : ∀ p ∈ P, 0 ≤ w p) (hcost : ∀ p ∈ P, 0 ≤ cost p) : + δ * (∑ p ∈ P.filter (fun p => δ < cost p), w p) ≤ ∑ p ∈ P, w p * cost p := by + rw [Finset.mul_sum] + calc + _ ≤ ∑ p ∈ P.filter (fun p => δ < cost p), w p * cost p := by + apply Finset.sum_le_sum + intro p hp + have hp' := Finset.mem_filter.mp hp + simpa only [mul_comm] using mul_le_mul_of_nonneg_left hp'.2.le (hw p hp'.1) + _ ≤ _ := Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) + (fun p hp _ => mul_nonneg (hw p hp) (hcost p hp)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorAnalytic.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorAnalytic.lean new file mode 100644 index 0000000000000000000000000000000000000000..c881b0432a1e4815784babd9e58579f5dee3f8cc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorAnalytic.lean @@ -0,0 +1,81 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorIntegral +import OAI.NumberTheory.Ostmann.ZeroDensity.RectangleAnalyticPole + +namespace OAI + +/-! # Cancellation of the detector contour pole at an actual L-function zero -/ + +namespace Ostmann + +open Complex Set +open scoped BigOperators + +noncomputable def densityDetectorFactor (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (Y : ℝ) (w : ℂ) : ℂ := + χ.L (s + w) * densityMollifier X χ.character (s + w) * (Y : ℂ) ^ w / + ((w + 1) * (w + 2)) + +noncomputable def densityDetectorIntegrand (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (Y : ℝ) (w : ℂ) : ℂ := + χ.L (s + w) * densityMollifier X χ.character (s + w) * (Y : ℂ) ^ w * + densityDetectorKernel w + + theorem densityMollifier_shift_analytic (χ : PrimitiveComplexCharacter) (X : ℕ) + (s w : ℂ) : AnalyticAt ℂ (fun z => densityMollifier X χ.character (s + z)) w := by + unfold densityMollifier + apply Finset.analyticAt_fun_sum + intro n hn + have hnp : 0 < n := (Finset.mem_Icc.mp hn).1 + have hnC : (n : ℂ) ≠ 0 := by exact_mod_cast hnp.ne' + have hp := ((differentiable_id.const_cpow (Or.inl hnC)).analyticAt (s + w)).comp + (analyticAt_const.add analyticAt_id : AnalyticAt ℂ (fun z : ℂ => s + z) w) + exact analyticAt_const.div hp (Complex.cpow_ne_zero_iff.mpr (Or.inl hnC)) + + theorem densityDetectorFactor_analytic (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (Y : ℝ) (hY : 0 < Y) (w : ℂ) (hw : -1 < w.re) : + AnalyticAt ℂ (densityDetectorFactor χ X s Y) w := by + have hy : (Y : ℂ) ≠ 0 := by exact_mod_cast hY.ne' + have h1 : w + 1 ≠ 0 := by + intro h + have hr := congrArg Complex.re h + norm_num at hr + linarith + have h2 : w + 2 ≠ 0 := by + intro h + have hr := congrArg Complex.re h + norm_num at hr + linarith + exact ((((χ.L_analytic (s + w)).comp (analyticAt_const.add analyticAt_id)).mul + (densityMollifier_shift_analytic χ X s w)).mul + ((differentiable_id.const_cpow (Or.inl hy)).analyticAt w)).div + ((analyticAt_id.add analyticAt_const).mul (analyticAt_id.add analyticAt_const)) + (mul_ne_zero h1 h2) + + theorem densityDetectorIntegrand_eq (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (Y : ℝ) (w : ℂ) : + densityDetectorIntegrand χ X s Y w = densityDetectorFactor χ X s Y w / w := by + unfold densityDetectorIntegrand densityDetectorFactor densityDetectorKernel + simp only [div_eq_mul_inv, mul_inv_rev, one_mul] + ring + + theorem densityDetector_rectangle_zero (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hz : χ.L s = 0) (Y : ℝ) (hY : 0 < Y) + (a b c d : ℝ) (ha0 : a < 0) (ha : -1 < a) (hb : 0 < b) (hc : c < 0) (hd : 0 < d) : + rectangleBoundaryIntegral (densityDetectorIntegrand χ X s Y) a b c d = 0 := by + have hf : ∀ w ∈ uIcc a b ×ℂ uIcc c d, + AnalyticAt ℂ (densityDetectorFactor χ X s Y) w := by + intro w hw + have hr : a ≤ w.re := by + have h := hw.1 + exact (show w.re ∈ Icc a b from by simpa only [uIcc_of_le (ha0.trans hb).le, mem_preimage] using h).1 + exact densityDetectorFactor_analytic χ X s Y hY w (ha.trans_le hr) + have h := rectangle_analytic_pole (densityDetectorFactor χ X s Y) a b c d ha0 hb hc hd hf + have he : densityDetectorFactor χ X s Y 0 = 0 := by simp [densityDetectorFactor, hz] + simp only [he, mul_zero] at h + convert h using 1 + exact congrArg (fun f => rectangleBoundaryIntegral f a b c d) + (funext (densityDetectorIntegrand_eq χ X s Y)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorBlocks.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..29093fc6583b89c58e363243112db333e6ef7a69 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorBlocks.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorPolynomial +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDyadicPartition + +namespace OAI + +/-! # Exact dyadic decomposition of the original polynomial alternative -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem densityDetector_polynomial_extended (χ : PrimitiveComplexCharacter) (X N : ℕ) + (Y : ℝ) (hY : 0 < Y) (hN : ⌊Y⌋₊ ≤ N) (β t : ℝ) : + (∑ n ∈ (Finset.Icc 1 ⌊Y⌋₊).filter (fun n => X < n), + LSeries.term (densityDetectorCharacterCoefficient χ X) (densityVerticalPoint β t) n * + densityDetectorWeight (n / Y)) = + densityCharacterPolynomial (Finset.Icc 1 N) + (densityVerticalCoeff (densityPolynomialCoefficient X Y) β) χ.character t := by + rw [densityDetector_polynomial] + unfold densityCharacterPolynomial + apply Finset.sum_subset + · intro n hn + exact Finset.mem_Icc.mpr ⟨(Finset.mem_Icc.mp hn).1, (Finset.mem_Icc.mp hn).2.trans hN⟩ + · intro n hn hn' + have hn1 := (Finset.mem_Icc.mp hn).1 + have hfloor : ⌊Y⌋₊ < n := by + have hnnot : ¬ n ≤ ⌊Y⌋₊ := fun h => hn' (Finset.mem_Icc.mpr ⟨hn1, h⟩) + omega + have hyn : Y < n := (Nat.floor_lt hY.le).mp hfloor + rw [densityVerticalCoeff, densityPolynomialCoefficient_above X n Y hY hyn.le] + simp + + theorem densityDetector_polynomial_blocks (χ : PrimitiveComplexCharacter) (X J : ℕ) + (hX : 1 ≤ X) (Y : ℝ) (hY : 0 < Y) (hcover : ⌊Y⌋₊ ≤ 2 ^ J * X) (β t : ℝ) : + (∑ n ∈ (Finset.Icc 1 ⌊Y⌋₊).filter (fun n => X < n), + LSeries.term (densityDetectorCharacterCoefficient χ X) (densityVerticalPoint β t) n * + densityDetectorWeight (n / Y)) = + ∑ j ∈ Finset.range J, densityCharacterPolynomial + (Finset.Ioc (2 ^ j * X) (2 * (2 ^ j * X))) + (densityVerticalCoeff (densityPolynomialCoefficient X Y) β) χ.character t := by + rw [densityDetector_polynomial_extended χ X (2 ^ J * X) Y hY hcover] + unfold densityCharacterPolynomial + rw [density_dyadic_partition X J hX] + have hhead : (∑ n ∈ Finset.Icc 1 X, + densityVerticalCoeff (densityPolynomialCoefficient X Y) β n * χ.character (n : ZMod χ.modulus) * + realAdditivePhase (-(Real.log n * t))) = 0 := by + apply Finset.sum_eq_zero + intro n hn + rw [densityVerticalCoeff, densityPolynomialCoefficient_below X n Y (Finset.mem_Icc.mp hn).2] + simp + rw [hhead, zero_add] + apply Finset.sum_congr rfl + intro j _ + congr 2 + rw [pow_succ] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorCoefficients.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorCoefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..f08f8c3669850e957fa93edd2ada89647160b270 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorCoefficients.lean @@ -0,0 +1,73 @@ +import Mathlib.NumberTheory.ArithmeticFunction.Moebius +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityHarmonicDivisors + +namespace OAI + +/-! # The actual truncated Möbius coefficients in the zero detector -/ + +namespace Ostmann + +open scoped BigOperators Classical + +noncomputable def densityMobiusCutoff (X n : ℕ) : ℂ := + if n ≤ X then (ArithmeticFunction.moebius n : ℂ) else 0 + +noncomputable def densityDetectorCoefficient (X n : ℕ) : ℂ := + ∑ d ∈ n.divisors, densityMobiusCutoff X d + + theorem densityMobiusCutoff_norm (X n : ℕ) : ‖densityMobiusCutoff X n‖ ≤ 1 := by + unfold densityMobiusCutoff + split_ifs + · norm_cast + exact ArithmeticFunction.abs_moebius_le_one + · simp + + theorem densityDetectorCoefficient_norm (X n : ℕ) : + ‖densityDetectorCoefficient X n‖ ≤ n.divisors.card := by + apply (norm_sum_le _ _).trans + calc + _ ≤ ∑ d ∈ n.divisors, (1 : ℝ) := + Finset.sum_le_sum (fun d _ => densityMobiusCutoff_norm X d) + _ = _ := by simp + + theorem densityDetectorCoefficient_initial (X n : ℕ) (hn : n ≤ X) : + densityDetectorCoefficient X n = if n = 1 then 1 else 0 := by + have he : densityDetectorCoefficient X n = ∑ d ∈ n.divisors, + (ArithmeticFunction.moebius d : ℂ) := by + apply Finset.sum_congr rfl + intro d hd + unfold densityMobiusCutoff + exact ite_eq_left ((Nat.le_of_dvd (Nat.pos_of_ne_zero (Nat.mem_divisors.mp hd).2) (Nat.dvd_of_mem_divisors hd)).trans hn) + rw [he] + have hm := congrArg (fun f : ArithmeticFunction ℂ => f n) + (ArithmeticFunction.coe_zeta_mul_coe_moebius (R := ℂ)) + rw [ArithmeticFunction.coe_zeta_mul_apply] at hm + simpa only [ArithmeticFunction.intCoe_apply, ArithmeticFunction.one_apply] using hm + + theorem densityDetectorCoefficient_one {X : ℕ} (hX : 1 ≤ X) : + densityDetectorCoefficient X 1 = 1 := by + rw [densityDetectorCoefficient_initial X 1 hX, ite_eq_left rfl] + + theorem densityDetectorCoefficient_small {X n : ℕ} (hn : 2 ≤ n) (hX : n ≤ X) : + densityDetectorCoefficient X n = 0 := by + rw [densityDetectorCoefficient_initial X n hX, ite_eq_right (by omega)] + + theorem densityDetectorCoefficient_energy (X N : ℕ) : + (∑ n ∈ Finset.Icc 1 N, ‖densityDetectorCoefficient X n‖ ^ 2) ≤ + (N : ℝ) * (1 + Real.log N) ^ 3 := by + apply (Finset.sum_le_sum (fun n _ => + pow_le_pow_left₀ (norm_nonneg _) (densityDetectorCoefficient_norm X n) 2)).trans + exact density_divisor_square_sum N + + theorem densityDetectorCoefficient_harmonic_energy (X N : ℕ) : + (∑ n ∈ Finset.Icc 1 N, ‖densityDetectorCoefficient X n‖ ^ 2 / n) ≤ + (1 + Real.log N) ^ 4 := by + apply (Finset.sum_le_sum (fun n _ => + div_le_div_of_nonneg_right + (pow_le_pow_left₀ (norm_nonneg _) (densityDetectorCoefficient_norm X n) 2) + (Nat.cast_nonneg n))).trans + exact density_divisor_square_harmonic N + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorDichotomy.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorDichotomy.lean new file mode 100644 index 0000000000000000000000000000000000000000..18290a0fb49a19610830ec1bc84b5bbba99ddbed --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorDichotomy.lean @@ -0,0 +1,40 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorShift + +namespace OAI + +/-! # The actual polynomial-or-critical-integral alternative at every zero -/ + +namespace Ostmann + +open Complex MeasureTheory +open scoped BigOperators + + theorem densityDetector_dichotomy (χ : PrimitiveComplexCharacter) (X : ℕ) (hX : 1 ≤ X) + (s : ℂ) (hs : 1 / 2 < s.re) (hs1 : s.re ≤ 1) (hz : χ.L s = 0) + (Y : ℝ) (hY : 4 ≤ Y) : + (1 / 8 : ℝ) ≤ ‖∑ n ∈ (Finset.Icc 1 ⌊Y⌋₊).filter (fun n => X < n), + LSeries.term (densityDetectorCharacterCoefficient χ X) s n * densityDetectorWeight (n / Y)‖ ∨ + (1 / 8 : ℝ) ≤ ‖((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ u : ℝ, + densityDetectorIntegrand χ X s Y (((1 / 2 - s.re : ℝ) : ℂ) + u * I)‖ := by + let P : ℂ := ∑ n ∈ (Finset.Icc 1 ⌊Y⌋₊).filter (fun n => X < n), + LSeries.term (densityDetectorCharacterCoefficient χ X) s n * densityDetectorWeight (n / Y) + by_cases hp : (1 / 8 : ℝ) ≤ ‖P‖ + · exact Or.inl hp + · right + have hsplit := densityDetectorMean_split χ X hX s Y (by linarith) + have he : densityDetectorWeight (1 / Y) = densityDetectorMean χ X s Y - P := by + rw [hsplit] + dsimp [P] + ring + have hn := norm_sub_le (densityDetectorMean χ X s Y) P + rw [← he] at hn + have hw : (1 / 4 : ℝ) ≤ ‖densityDetectorWeight (1 / Y)‖ := + (densityDetectorWeight_at_one_div Y hY).trans (Complex.re_le_norm _) + have hm : (1 / 8 : ℝ) ≤ ‖densityDetectorMean χ X s Y‖ := by + have hp' : ‖P‖ < 1 / 8 := lt_of_not_ge hp + linarith + rwa [densityDetectorMean_at_zero χ X s hs hs1 hz Y (by linarith)] at hm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorDyadicCover.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorDyadicCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce49afe6895a8df8f50c01cd6bcfbe72a2c391a0 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorDyadicCover.lean @@ -0,0 +1,36 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Algebra.Order.Floor.Ring + +namespace OAI + +/-! # A logarithmic number of blocks covers the detector polynomial -/ + +namespace Ostmann + + theorem density_detector_dyadic_cover (X : ℕ) (hX : 1 ≤ X) (Y : ℝ) (hY : 2 ≤ Y) : + ∃ J : ℕ, 1 ≤ J ∧ ⌊Y⌋₊ ≤ 2 ^ J * X ∧ + (J : ℝ) ≤ (2 / Real.log 2) * Real.log Y := by + have hl2 : 0 < Real.log 2 := Real.log_pos (by norm_num) + have hlY : Real.log 2 ≤ Real.log Y := Real.log_le_log (by norm_num) hY + have hratio : 1 ≤ Real.log Y / Real.log 2 := (le_div_iff₀ hl2).mpr (by simpa using hlY) + let J := ⌈Real.log Y / Real.log 2⌉₊ + have hj : Real.log Y / Real.log 2 ≤ J := Nat.le_ceil _ + have hj1 : 1 ≤ J := by exact_mod_cast (hratio.trans hj) + have hjup : (J : ℝ) < Real.log Y / Real.log 2 + 1 := + Nat.ceil_lt_add_one (by linarith : 0 ≤ Real.log Y / Real.log 2) + have hlog : Real.log Y ≤ (J : ℝ) * Real.log 2 := (div_le_iff₀ hl2).mp hj + have hpow : Y ≤ (2 : ℝ) ^ J := by + apply (Real.log_le_log_iff (by linarith : 0 < Y) (by positivity)).mp + simpa only [Real.log_pow] using hlog + have hx : (1 : ℝ) ≤ X := by exact_mod_cast hX + have hfloor : (⌊Y⌋₊ : ℝ) ≤ (2 : ℝ) ^ J * X := by + apply (Nat.floor_le (by linarith : 0 ≤ Y)).trans + exact hpow.trans (le_mul_of_one_le_right (by positivity) hx) + refine ⟨J, hj1, by exact_mod_cast hfloor, ?_⟩ + have hratio2 : Real.log Y / Real.log 2 + 1 ≤ 2 * (Real.log Y / Real.log 2) := by linarith + have he : 2 * (Real.log Y / Real.log 2) = (2 / Real.log 2) * Real.log Y := by ring + exact hjup.le.trans (hratio2.trans_eq he) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorHorizontal.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorHorizontal.lean new file mode 100644 index 0000000000000000000000000000000000000000..a23f2bcb4c26ce6741ef5f00418292c176c12cb7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorHorizontal.lean @@ -0,0 +1,71 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorVertical +import OAI.NumberTheory.Ostmann.ZeroDensity.RectangleVerticalLimit + +namespace OAI + +/-! # Vanishing horizontal edges for the actual zero detector -/ + +namespace Ostmann + +open Complex MeasureTheory Filter Set +open scoped Topology Interval + + theorem densityDetector_high_bound (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hs : 1 / 2 ≤ s.re) (hs1 : s.re ≤ 1) (Y : ℝ) (hY : 1 ≤ Y) + (x u : ℝ) (hx : 1 / 2 - s.re ≤ x) (hx2 : x ≤ 2) (hu : 1 ≤ |u|) : + ‖densityDetectorIntegrand χ X s Y ((x : ℂ) + u * I)‖ ≤ + 2 * (2 * ((χ.modulus : ℝ) + 1) * X * Y ^ 2 * (3 + |s.im|)) / |u| ^ 2 := by + let K := 2 * ((χ.modulus : ℝ) + 1) * X * Y ^ 2 * (3 + |s.im|) + have hK : 0 ≤ K := by dsimp [K]; positivity + have hup : 0 < |u| := by linarith + have hn := densityDetector_numerator_bound χ X s hs hs1 Y hY x u hx hx2 + have hk := densityDetectorKernel_high_bound x u hup + rw [densityDetectorIntegrand, norm_mul] + calc + _ ≤ (K * (1 + |u|)) * (|u| ^ 3)⁻¹ := mul_le_mul hn hk (norm_nonneg _) (by positivity) + _ ≤ (K * (2 * |u|)) * (|u| ^ 3)⁻¹ := by + apply mul_le_mul_of_nonneg_right _ (by positivity) + apply mul_le_mul_of_nonneg_left _ hK + linarith + _ = 2 * K / |u| ^ 2 := by field_simp + + theorem densityDetector_horizontal_bound (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hs : 1 / 2 ≤ s.re) (hs1 : s.re ≤ 1) (Y : ℝ) (hY : 1 ≤ Y) + (u : ℝ) (hu : 1 ≤ |u|) : + ‖∫ x in (1 / 2 - s.re)..2, densityDetectorIntegrand χ X s Y ((x : ℂ) + u * I)‖ ≤ + (2 * (2 * ((χ.modulus : ℝ) + 1) * X * Y ^ 2 * (3 + |s.im|)) * + |2 - (1 / 2 - s.re)|) / |u| ^ 2 := by + have hab : 1 / 2 - s.re ≤ 2 := by linarith + have h := intervalIntegral.norm_integral_le_of_norm_le_const + (fun x (hx : x ∈ Ι (1 / 2 - s.re) 2) => densityDetector_high_bound χ X s hs hs1 Y hY x u + (by rw [uIoc_of_le hab] at hx; exact hx.1.le) + (by rw [uIoc_of_le hab] at hx; exact hx.2) hu) + convert h using 1 + ring + + theorem densityDetector_horizontal_tendsto (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hs : 1 / 2 ≤ s.re) (hs1 : s.re ≤ 1) (Y : ℝ) (hY : 1 ≤ Y) : + Tendsto (fun u : ℝ => ∫ x in (1 / 2 - s.re)..2, + densityDetectorIntegrand χ X s Y ((x : ℂ) + u * I)) atTop (𝓝 0) ∧ + Tendsto (fun u : ℝ => ∫ x in (1 / 2 - s.re)..2, + densityDetectorIntegrand χ X s Y ((x : ℂ) + (-u) * I)) atTop (𝓝 0) := by + let K := 2 * (2 * ((χ.modulus : ℝ) + 1) * X * Y ^ 2 * (3 + |s.im|)) * |2 - (1 / 2 - s.re)| + have ht : Tendsto (fun u : ℝ => K / u ^ 2) atTop (𝓝 0) := by + simpa only [div_eq_mul_inv, mul_zero, Function.comp_apply] using + (tendsto_inv_atTop_zero.comp (tendsto_pow_atTop (by norm_num : (2 : ℕ) ≠ 0))).const_mul K + constructor + · rw [tendsto_zero_iff_norm_tendsto_zero] + apply squeeze_zero' (Filter.Eventually.of_forall (fun _ => norm_nonneg _)) _ ht + filter_upwards [eventually_ge_atTop (1 : ℝ)] with u hu + simpa only [abs_of_nonneg (by linarith : 0 ≤ u)] using + densityDetector_horizontal_bound χ X s hs hs1 Y hY u (by rwa [abs_of_nonneg (by linarith)]) + · rw [tendsto_zero_iff_norm_tendsto_zero] + apply squeeze_zero' (Filter.Eventually.of_forall (fun _ => norm_nonneg _)) _ ht + filter_upwards [eventually_ge_atTop (1 : ℝ)] with u hu + have hb := densityDetector_horizontal_bound χ X s hs hs1 Y hY (-u) + (by simpa only [abs_neg, abs_of_nonneg (by linarith : 0 ≤ u)] using hu) + simpa only [abs_neg, abs_of_nonneg (by linarith : 0 ≤ u), Complex.ofReal_neg] using hb + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorIntegral.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..15873011bc5d4634b29065cca78091250c149928 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorIntegral.lean @@ -0,0 +1,125 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorSeries +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFiniteSeriesBridge + +namespace OAI + +/-! # The exact initial contour of the compact Mobius zero detector -/ + +namespace Ostmann + +open Complex MeasureTheory +open scoped BigOperators Classical + +noncomputable def densityDetectorVerticalTerm (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (Y : ℝ) (n : ℕ) (t : ℝ) : ℂ := + LSeries.term (densityDetectorCharacterCoefficient χ X) (s + (2 + (t : ℂ) * I)) n * + (Y : ℂ) ^ (2 + (t : ℂ) * I) * densityDetectorKernel (2 + (t : ℂ) * I) + + theorem densityDetectorVerticalTerm_norm (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (Y : ℝ) (hY : 0 < Y) (n : ℕ) (t : ℝ) : + ‖densityDetectorVerticalTerm χ X s Y n t‖ = + (‖LSeries.term (densityDetectorCharacterCoefficient χ X) (s + 2) n‖ * Y ^ 2) * + ‖densityDetectorKernel (2 + (t : ℂ) * I)‖ := by + unfold densityDetectorVerticalTerm + rw [norm_mul, norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hY] + have he : (2 + (t : ℂ) * I).re = (2 : ℝ) := by simp + rw [he, Real.rpow_two] + have hn : ‖LSeries.term (densityDetectorCharacterCoefficient χ X) (s + (2 + (t : ℂ) * I)) n‖ = + ‖LSeries.term (densityDetectorCharacterCoefficient χ X) (s + 2) n‖ := by + simp only [LSeries.norm_term_eq] + congr 2 + simp + rw [hn] + + theorem densityDetectorVerticalTerm_continuous (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (Y : ℝ) (hY : 0 < Y) (n : ℕ) : + Continuous (densityDetectorVerticalTerm χ X s Y n) := by + have hk : Continuous (fun t : ℝ => densityDetectorKernel (2 + (t : ℂ) * I)) := by + unfold densityDetectorKernel + apply continuous_const.div (by fun_prop) + intro t + apply mul_ne_zero + · apply mul_ne_zero <;> norm_num [Complex.ext_iff] + · norm_num [Complex.ext_iff] + have hpow : Continuous (fun t : ℝ => (Y : ℂ) ^ (2 + (t : ℂ) * I)) := + (differentiable_id.const_cpow (Or.inl (by exact_mod_cast hY.ne'))).continuous.comp (by fun_prop) + apply Continuous.mul _ hk + apply Continuous.mul _ hpow + by_cases hn : n = 0 + · subst n + simp only [LSeries.term_zero] + exact continuous_const + · simp only [LSeries.term_of_ne_zero hn] + apply continuous_const.div + · exact (differentiable_id.const_cpow (Or.inl (by exact_mod_cast hn))).continuous.comp (by fun_prop) + · intro t + exact Complex.cpow_ne_zero_iff.mpr (Or.inl (by exact_mod_cast hn)) + + theorem densityDetectorVerticalTerm_integrable (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (Y : ℝ) (hY : 0 < Y) (n : ℕ) : + Integrable (densityDetectorVerticalTerm χ X s Y n) := by + have hk := (densityDetectorKernel_verticalIntegrable 2 (by norm_num)).norm + apply (hk.const_mul (‖LSeries.term (densityDetectorCharacterCoefficient χ X) (s + 2) n‖ * Y ^ 2)).mono' + (densityDetectorVerticalTerm_continuous χ X s Y hY n).aestronglyMeasurable + exact Filter.Eventually.of_forall (fun t => (densityDetectorVerticalTerm_norm χ X s Y hY n t).le) + + theorem densityDetectorVerticalTerm_summable_norm (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hs : 0 ≤ s.re) (Y : ℝ) (hY : 0 < Y) : + Summable (fun n : ℕ => ∫ t : ℝ, ‖densityDetectorVerticalTerm χ X s Y n t‖) := by + have hsum := (densityDetectorCharacterCoefficient_summable χ X (s + 2) + (by simp; linarith)).norm + have h := (hsum.mul_right (Y ^ 2)).mul_right + (∫ t : ℝ, ‖densityDetectorKernel (2 + (t : ℂ) * I)‖) + apply h.congr + intro n + simp only [densityDetectorVerticalTerm_norm χ X s Y hY, integral_const_mul] + + theorem densityDetectorVerticalTerm_inversion (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (Y : ℝ) (hY : 0 < Y) (n : ℕ) : + ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, densityDetectorVerticalTerm χ X s Y n t) = + LSeries.term (densityDetectorCharacterCoefficient χ X) s n * densityDetectorWeight (n / Y) := by + by_cases hn : n = 0 + · subst n + simp [densityDetectorVerticalTerm] + have hnR : 0 < (n : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero hn + have he (t : ℝ) : densityDetectorVerticalTerm χ X s Y n t = + LSeries.term (densityDetectorCharacterCoefficient χ X) s n * + (((n : ℝ) / Y : ℝ) : ℂ) ^ (-(2 + (t : ℂ) * I)) * + densityDetectorKernel (2 + (t : ℂ) * I) := by + rw [densityDetectorVerticalTerm, density_LSeries_term_add, Complex.cpow_neg, + Complex.ofReal_div, Complex.div_cpow_ofReal_nonneg hnR.le hY.le, inv_div] + push_cast + ring + simp_rw [he, mul_assoc] + rw [integral_const_mul] + have hinv := densityDetectorWeight_mellin_inversion 2 ((n : ℝ) / Y) (by norm_num) (div_pos hnR hY) + change ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, + (((n : ℝ) / Y : ℝ) : ℂ) ^ (-(2 + (t : ℂ) * I)) * + densityDetectorKernel (2 + (t : ℂ) * I)) = _ at hinv + rw [← hinv] + ring + + theorem densityDetectorMean_eq_integral (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hs : 0 ≤ s.re) (Y : ℝ) (hY : 0 < Y) : + densityDetectorMean χ X s Y = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, + χ.L (s + (2 + (t : ℂ) * I)) * + densityMollifier X χ.character (s + (2 + (t : ℂ) * I)) * + (Y : ℂ) ^ (2 + (t : ℂ) * I) * densityDetectorKernel (2 + (t : ℂ) * I) := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + rw [densityDetectorMean_tsum χ X s Y hY] + simp_rw [← densityDetectorVerticalTerm_inversion χ X s Y hY] + rw [tsum_mul_left, integral_tsum_of_summable_integral_norm + (fun n => densityDetectorVerticalTerm_integrable χ X s Y hY n) + (densityDetectorVerticalTerm_summable_norm χ X s hs Y hY)] + congr 1 + apply integral_congr_ae + filter_upwards with t + simp only [densityDetectorVerticalTerm, tsum_mul_right] + rw [show (∑' n, LSeries.term (densityDetectorCharacterCoefficient χ X) + (s + (2 + (t : ℂ) * I)) n) = + χ.L (s + (2 + (t : ℂ) * I)) * densityMollifier X χ.character (s + (2 + (t : ℂ) * I)) from + density_mollifier_L_product X χ.character _ (by simp; linarith)] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorKernel.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..2bd5e68fb424c2f2d43fed4571b1d8390fb81a1b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorKernel.lean @@ -0,0 +1,96 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorWeight + +namespace OAI + +/-! # The cubic vertical decay of the compact zero-detector kernel -/ + +namespace Ostmann + +open Complex MeasureTheory + + theorem densityDetectorKernel_line_bound (σ t : ℝ) (hσ : 1 ≤ σ) : + ‖densityDetectorKernel ((σ : ℂ) + (t : ℂ) * I)‖ ≤ + 8 * (1 + |t|) ^ (-(3 : ℝ)) := by + let s : ℂ := (σ : ℂ) + (t : ℂ) * I + have hr : s.re = σ := by simp [s] + have hi : s.im = t := by simp [s] + have h0 : 1 + |t| ≤ 2 * ‖s‖ := by + have ha := Complex.re_le_norm s + have hb := Complex.abs_im_le_norm s + rw [hr] at ha + rw [hi] at hb + linarith + have h1 : 1 + |t| ≤ 2 * ‖s + 1‖ := by + have ha := Complex.re_le_norm (s + 1) + have hb := Complex.abs_im_le_norm (s + 1) + simp only [add_re, one_re, hr, add_im, one_im, add_zero, hi] at ha hb + linarith + have h2 : 1 + |t| ≤ 2 * ‖s + 2‖ := by + have ha := Complex.re_le_norm (s + 2) + have hb := Complex.abs_im_le_norm (s + 2) + norm_num [hr, hi] at ha hb + linarith + have hp : (1 + |t|) ^ 3 ≤ 8 * (‖s‖ * ‖s + 1‖ * ‖s + 2‖) := by + have h01 := mul_le_mul h0 h1 (by positivity) (by positivity) + have h012 := mul_le_mul h01 h2 (by positivity) (by positivity) + nlinarith + have hn0 : 0 < ‖s‖ := by linarith [abs_nonneg t] + have hn1 : 0 < ‖s + 1‖ := by linarith [abs_nonneg t] + have hn2 : 0 < ‖s + 2‖ := by linarith [abs_nonneg t] + change ‖1 / (s * (s + 1) * (s + 2))‖ ≤ _ + rw [norm_div, norm_one, norm_mul, norm_mul, Real.rpow_neg (by positivity : 0 ≤ 1 + |t|), + Real.rpow_ofNat, ← div_eq_mul_inv] + apply (div_le_div_iff₀ (by positivity : 0 < ‖s‖ * ‖s + 1‖ * ‖s + 2‖) + (by positivity : 0 < (1 + |t|) ^ 3)).mpr + nlinarith + + theorem densityDetectorKernel_verticalIntegrable (σ : ℝ) (hσ : 1 ≤ σ) : + Complex.VerticalIntegrable densityDetectorKernel σ := by + have hmajor : Integrable (fun t : ℝ => 8 * (1 + ‖t‖) ^ (-(3 : ℝ))) := + (integrable_one_add_norm (E := ℝ) (by norm_num : (Module.finrank ℝ ℝ : ℝ) < 3)).const_mul 8 + have hc : Continuous (fun t : ℝ => densityDetectorKernel ((σ : ℂ) + (t : ℂ) * I)) := by + unfold densityDetectorKernel + apply continuous_const.div + · fun_prop + · intro t + apply mul_ne_zero + · apply mul_ne_zero + · intro h + have hr := congrArg Complex.re h + simp at hr + linarith + · intro h + have hr := congrArg Complex.re h + simp at hr + linarith + · intro h + have hr := congrArg Complex.re h + simp at hr + linarith + apply hmajor.mono' hc.aestronglyMeasurable + filter_upwards with t + simpa only [Real.norm_eq_abs] using densityDetectorKernel_line_bound σ t hσ + + theorem densityDetectorWeight_mellin_inversion (σ x : ℝ) (hσ : 1 ≤ σ) (hx : 0 < x) : + mellinInv σ densityDetectorKernel x = densityDetectorWeight x := by + have hσp : 0 < σ := by linarith + have hF : Complex.VerticalIntegrable (mellin densityDetectorWeight) σ := by + have he : (fun t : ℝ => mellin densityDetectorWeight ((σ : ℂ) + (t : ℂ) * I)) = + (fun t : ℝ => densityDetectorKernel ((σ : ℂ) + (t : ℂ) * I)) := by + funext t + exact (densityDetectorWeight_hasMellin _ (by simpa using hσp)).2 + change Integrable (fun t : ℝ => mellin densityDetectorWeight ((σ : ℂ) + (t : ℂ) * I)) + rw [he] + exact densityDetectorKernel_verticalIntegrable σ hσ + have hi := mellinInv_mellin_eq σ densityDetectorWeight hx + (densityDetectorWeight_hasMellin (σ : ℂ) hσp).1 hF densityDetectorWeight_continuous.continuousAt + rw [← hi] + unfold mellinInv + congr 1 + apply integral_congr_ae + filter_upwards with t + rw [(densityDetectorWeight_hasMellin ((σ : ℂ) + (t : ℂ) * I) (by simpa using hσp)).2] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorKernelLeft.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorKernelLeft.lean new file mode 100644 index 0000000000000000000000000000000000000000..15cb1b6617cbb889cdb0c0be1a3a16b295a6e9a3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorKernelLeft.lean @@ -0,0 +1,66 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorKernel + +namespace OAI + +/-! # The critical-line side of the compact detector contour -/ + +namespace Ostmann + +open Complex + + theorem densityDetectorKernel_left_bound (δ u : ℝ) (hδ : 0 < δ) (hδ2 : δ ≤ 1 / 2) : + ‖densityDetectorKernel ((-δ : ℂ) + (u : ℂ) * I)‖ ≤ + (16 / δ) * (1 + |u|) ^ (-(3 : ℝ)) := by + let w : ℂ := (-δ : ℂ) + (u : ℂ) * I + have hr : w.re = -δ := by simp [w] + have hi : w.im = u := by simp [w] + have h0 : δ * (1 + |u|) ≤ 2 * ‖w‖ := by + have ha := Complex.abs_re_le_norm w + have hb := Complex.abs_im_le_norm w + rw [hr, abs_neg, abs_of_pos hδ] at ha + rw [hi] at hb + nlinarith [abs_nonneg u] + have h1 : 1 + |u| ≤ 4 * ‖w + 1‖ := by + have ha := Complex.re_le_norm (w + 1) + have hb := Complex.abs_im_le_norm (w + 1) + simp only [add_re, one_re, hr, add_im, one_im, add_zero, hi] at ha hb + linarith + have h2 : 1 + |u| ≤ 2 * ‖w + 2‖ := by + have ha := Complex.re_le_norm (w + 2) + have hb := Complex.abs_im_le_norm (w + 2) + norm_num [hr, hi] at ha hb + linarith + have hp : δ * (1 + |u|) ^ 3 ≤ 16 * (‖w‖ * ‖w + 1‖ * ‖w + 2‖) := by + have h01 := mul_le_mul h0 h1 (by positivity) (by positivity) + have h012 := mul_le_mul h01 h2 (by positivity) (by positivity) + nlinarith + have hn0 : 0 < ‖w‖ := by nlinarith [abs_nonneg u] + have hn1 : 0 < ‖w + 1‖ := by linarith [abs_nonneg u] + have hn2 : 0 < ‖w + 2‖ := by linarith [abs_nonneg u] + change ‖1 / (w * (w + 1) * (w + 2))‖ ≤ _ + rw [norm_div, norm_one, norm_mul, norm_mul, Real.rpow_neg (by positivity : 0 ≤ 1 + |u|), + Real.rpow_ofNat] + rw [show (16 / δ) * ((1 + |u|) ^ 3)⁻¹ = 16 / (δ * (1 + |u|) ^ 3) by + simp only [div_eq_mul_inv, mul_inv_rev] + ring] + apply (div_le_div_iff₀ (by positivity : 0 < ‖w‖ * ‖w + 1‖ * ‖w + 2‖) + (by positivity : 0 < δ * (1 + |u|) ^ 3)).mpr + nlinarith + + theorem densityDetectorKernel_high_bound (x u : ℝ) (hu : 0 < |u|) : + ‖densityDetectorKernel ((x : ℂ) + (u : ℂ) * I)‖ ≤ (|u| ^ 3)⁻¹ := by + let w : ℂ := (x : ℂ) + (u : ℂ) * I + have h0 : |u| ≤ ‖w‖ := by simpa [w] using Complex.abs_im_le_norm w + have h1 : |u| ≤ ‖w + 1‖ := by simpa [w] using Complex.abs_im_le_norm (w + 1) + have h2 : |u| ≤ ‖w + 2‖ := by simpa [w] using Complex.abs_im_le_norm (w + 2) + have hp : |u| ^ 3 ≤ ‖w‖ * ‖w + 1‖ * ‖w + 2‖ := by + have h01 := mul_le_mul h0 h1 hu.le (norm_nonneg _) + have h012 := mul_le_mul h01 h2 hu.le (mul_nonneg (norm_nonneg _) (norm_nonneg _)) + nlinarith + change ‖1 / (w * (w + 1) * (w + 2))‖ ≤ _ + rw [norm_div, norm_one, norm_mul, norm_mul, ← one_div] + exact one_div_le_one_div_of_le (pow_pos hu 3) hp + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorPolynomial.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..51845010615e7d62499b496d7141234475230689 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorPolynomial.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorDichotomy +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityAbscissaPolynomial + +namespace OAI + +/-! # The original polynomial alternative as one common coefficient sequence -/ + +namespace Ostmann + +open Complex +open scoped BigOperators Classical + + theorem densityDetectorWeight_norm_le_one (x : ℝ) (hx : 0 ≤ x) : ‖densityDetectorWeight x‖ ≤ 1 := by + by_cases h1 : 1 ≤ x + · rw [densityDetectorWeight_zero x h1, norm_zero] + norm_num + · have hle : x ≤ 1 := le_of_not_ge h1 + rw [densityDetectorWeight_eq x hle, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (by positivity : 0 ≤ (1 - x) ^ 2 / 2)] + nlinarith + +noncomputable def densityPolynomialCoefficient (X : ℕ) (Y : ℝ) (n : ℕ) : ℂ := + if X < n then densityDetectorCoefficient X n * densityDetectorWeight (n / Y) else 0 + + theorem densityPolynomialCoefficient_norm (X : ℕ) (Y : ℝ) (hY : 0 < Y) (n : ℕ) : + ‖densityPolynomialCoefficient X Y n‖ ≤ n.divisors.card := by + unfold densityPolynomialCoefficient + split_ifs + · rw [norm_mul] + exact (mul_le_mul (densityDetectorCoefficient_norm X n) + (densityDetectorWeight_norm_le_one (n / Y) (by positivity)) (norm_nonneg _) (by positivity)).trans_eq (mul_one _) + · simp + + theorem densityPolynomialCoefficient_below (X n : ℕ) (Y : ℝ) (hn : n ≤ X) : + densityPolynomialCoefficient X Y n = 0 := by + simp [densityPolynomialCoefficient, Nat.not_lt.mpr hn] + + theorem densityPolynomialCoefficient_above (X n : ℕ) (Y : ℝ) (hY : 0 < Y) (hn : Y ≤ n) : + densityPolynomialCoefficient X Y n = 0 := by + simp [densityPolynomialCoefficient, densityDetectorWeight_zero (n / Y) + ((le_div_iff₀ hY).mpr (by simpa using hn))] + + theorem densityDetector_polynomial (χ : PrimitiveComplexCharacter) (X : ℕ) (Y β t : ℝ) : + (∑ n ∈ (Finset.Icc 1 ⌊Y⌋₊).filter (fun n => X < n), + LSeries.term (densityDetectorCharacterCoefficient χ X) (densityVerticalPoint β t) n * + densityDetectorWeight (n / Y)) = + densityCharacterPolynomial (Finset.Icc 1 ⌊Y⌋₊) + (densityVerticalCoeff (densityPolynomialCoefficient X Y) β) χ.character t := by + rw [Finset.sum_filter] + unfold densityCharacterPolynomial + apply Finset.sum_congr rfl + intro n hn + have hnp : 0 < n := (Finset.mem_Icc.mp hn).1 + by_cases hX : X < n + · rw [ite_eq_left hX, LSeries.term_of_ne_zero hnp.ne', densityDetectorCharacterCoefficient, + density_vertical_term _ β t n hnp] + unfold densityVerticalCoeff densityPolynomialCoefficient + rw [ite_eq_left hX] + ring + · simp [hX, densityVerticalCoeff, densityPolynomialCoefficient] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorSeries.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorSeries.lean new file mode 100644 index 0000000000000000000000000000000000000000..cbba8e76f34471aebf90ec75e66ff15aa9a58b19 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorSeries.lean @@ -0,0 +1,92 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityMollifierProduct +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorKernel + +namespace OAI + +/-! # The true truncated Mobius series in the zero detector -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators Classical + +noncomputable def densityDetectorCharacterCoefficient (χ : PrimitiveComplexCharacter) + (X n : ℕ) : ℂ := χ.character (n : ZMod χ.modulus) * densityDetectorCoefficient X n + +noncomputable def densityDetectorMean (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (Y : ℝ) : ℂ := + ∑ n ∈ Finset.Icc 1 ⌊Y⌋₊, LSeries.term (densityDetectorCharacterCoefficient χ X) s n * + densityDetectorWeight (n / Y) + + theorem densityDetectorCharacterCoefficient_norm (χ : PrimitiveComplexCharacter) (X n : ℕ) : + ‖densityDetectorCharacterCoefficient χ X n‖ ≤ n.divisors.card := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + rw [densityDetectorCharacterCoefficient, norm_mul] + apply (mul_le_mul (χ.character.norm_le_one _) (densityDetectorCoefficient_norm X n) + (norm_nonneg _) zero_le_one).trans_eq + ring + + theorem densityDetectorMean_split (χ : PrimitiveComplexCharacter) (X : ℕ) (hX : 1 ≤ X) + (s : ℂ) (Y : ℝ) (hY : 1 ≤ Y) : + densityDetectorMean χ X s Y = densityDetectorWeight (1 / Y) + + ∑ n ∈ (Finset.Icc 1 ⌊Y⌋₊).filter (fun n => X < n), + LSeries.term (densityDetectorCharacterCoefficient χ X) s n * densityDetectorWeight (n / Y) := by + let U := Finset.Icc 1 ⌊Y⌋₊ + have h1 : 1 ∈ U := Finset.mem_Icc.mpr ⟨le_rfl, (Nat.le_floor_iff (by linarith : 0 ≤ Y)).mpr (by simpa using hY)⟩ + have hf : ∑ n ∈ U, LSeries.term (densityDetectorCharacterCoefficient χ X) s n * densityDetectorWeight (n / Y) = + ∑ n ∈ U, ((if n = 1 then densityDetectorWeight (1 / Y) else 0) + + (if X < n then LSeries.term (densityDetectorCharacterCoefficient χ X) s n * + densityDetectorWeight (n / Y) else 0)) := by + apply Finset.sum_congr rfl + intro n hn + by_cases hn1 : n = 1 + · subst n + simp [densityDetectorCharacterCoefficient, densityDetectorCoefficient_one hX, + LSeries.term_of_ne_zero, show ¬ X < 1 by omega] + · by_cases hnX : X < n + · simp [hn1, hnX] + · have hn2 : 2 ≤ n := by have := (Finset.mem_Icc.mp hn).1; omega + have hz := densityDetectorCoefficient_small hn2 (by omega : n ≤ X) + simp [hn1, hnX, LSeries.term_of_ne_zero (show n ≠ 0 by omega), + densityDetectorCharacterCoefficient, hz] + unfold densityDetectorMean + rw [hf, Finset.sum_add_distrib] + simp only [Finset.sum_ite_eq', h1, ↓reduceIte, Finset.sum_filter] + rfl + +end Ostmann + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators Classical + + theorem densityDetectorCharacterCoefficient_summable (χ : PrimitiveComplexCharacter) + (X : ℕ) (s : ℂ) (hs : 1 < s.re) : + LSeriesSummable (densityDetectorCharacterCoefficient χ X) s := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have h := (χ.character.LSeriesSummable_of_one_lt_re hs).convolution + (LSeriesSummable_of_bounded_of_one_lt_re + (fun n _ => densityMollifierCoefficient_norm X n χ.character) hs) + rw [density_detector_convolution] at h + exact h + + theorem densityDetectorMean_tsum (χ : PrimitiveComplexCharacter) (X : ℕ) (s : ℂ) + (Y : ℝ) (hY : 0 < Y) : + densityDetectorMean χ X s Y = ∑' n : ℕ, + LSeries.term (densityDetectorCharacterCoefficient χ X) s n * densityDetectorWeight (n / Y) := by + symm + apply tsum_eq_sum + intro n hn + by_cases hn0 : n = 0 + · simp [hn0] + · have hnY : Y < n := by + have hnN : ⌊Y⌋₊ < n := by + by_contra h + exact hn (Finset.mem_Icc.mpr ⟨by omega, by omega⟩) + exact (Nat.floor_lt (by positivity : 0 ≤ Y)).mp hnN + rw [densityDetectorWeight_zero _ ((le_div_iff₀ hY).mpr (by simpa using hnY.le)), mul_zero] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorShift.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..61b6e2e3b71fadc7a9f5fa773b69576ceac8aeab --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorShift.lean @@ -0,0 +1,58 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorHorizontal + +namespace OAI + +/-! # The exact compact detector identity at an actual zero -/ + +namespace Ostmann + +open Complex MeasureTheory Filter +open scoped Topology + + theorem densityDetector_right_integrable (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hs : 1 / 2 ≤ s.re) (hs1 : s.re ≤ 1) (Y : ℝ) (hY : 1 ≤ Y) : + Integrable (fun u : ℝ => densityDetectorIntegrand χ X s Y (2 + u * I)) := by + let K := 2 * ((χ.modulus : ℝ) + 1) * X * Y ^ 2 * (3 + |s.im|) + have hg : Integrable (fun u : ℝ => (1 + |u|) ^ (-(2 : ℝ))) := by + simpa only [Real.norm_eq_abs] using + (integrable_one_add_norm (E := ℝ) (by norm_num : (Module.finrank ℝ ℝ : ℝ) < 2)) + apply (hg.const_mul (K * 8)).mono' + · exact (densityDetectorIntegrand_line_continuous χ X s Y (by linarith) 2 + (by norm_num) (by norm_num)).aestronglyMeasurable + · filter_upwards with u + have hn := densityDetector_numerator_bound χ X s hs hs1 Y hY 2 u (by linarith) le_rfl + have hk := densityDetectorKernel_line_bound 2 u (by norm_num) + rw [densityDetectorIntegrand, norm_mul] + apply (mul_le_mul hn hk (norm_nonneg _) (by positivity)).trans_eq + have he : (1 + |u|) * (1 + |u|) ^ (-(3 : ℝ)) = (1 + |u|) ^ (-(2 : ℝ)) := by + rw [show -(2 : ℝ) = 1 + -(3 : ℝ) by ring, + Real.rpow_add (by positivity : 0 < 1 + |u|), Real.rpow_one] + calc + _ = K * 8 * ((1 + |u|) * (1 + |u|) ^ (-(3 : ℝ))) := by dsimp [K]; ring + _ = _ := by rw [he] + + theorem densityDetector_zero_contour_shift (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hs : 1 / 2 < s.re) (hs1 : s.re ≤ 1) (hz : χ.L s = 0) + (Y : ℝ) (hY : 1 ≤ Y) : + (∫ u : ℝ, densityDetectorIntegrand χ X s Y (((1 / 2 - s.re : ℝ) : ℂ) + u * I)) = + ∫ u : ℝ, densityDetectorIntegrand χ X s Y (2 + u * I) := by + obtain ⟨ht, hd⟩ := densityDetector_horizontal_tendsto χ X s hs.le hs1 Y hY + apply rectangle_vertical_limit _ _ _ + (densityDetector_left_integrable χ X s hs hs1 Y hY) + (densityDetector_right_integrable χ X s hs.le hs1 Y hY) ht hd + filter_upwards [eventually_gt_atTop (0 : ℝ)] with T hT + exact densityDetector_rectangle_zero χ X s hz Y (by linarith) (1 / 2 - s.re) 2 (-T) T + (by linarith) (by linarith) (by norm_num) (by linarith) hT + + theorem densityDetectorMean_at_zero (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hs : 1 / 2 < s.re) (hs1 : s.re ≤ 1) (hz : χ.L s = 0) + (Y : ℝ) (hY : 1 ≤ Y) : + densityDetectorMean χ X s Y = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ u : ℝ, + densityDetectorIntegrand χ X s Y (((1 / 2 - s.re : ℝ) : ℂ) + u * I) := by + rw [densityDetectorMean_eq_integral χ X s (by linarith) Y (by linarith)] + change _ * (∫ u : ℝ, densityDetectorIntegrand χ X s Y (2 + u * I)) = _ + rw [densityDetector_zero_contour_shift χ X s hs hs1 hz Y hY] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorVertical.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorVertical.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ec036167a7bf74702ee974d7dccde8284508815 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorVertical.lean @@ -0,0 +1,63 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityMollifierBound +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorKernelLeft + +namespace OAI + +/-! # Integrability at the critical-line side of the actual detector -/ + +namespace Ostmann + +open Complex MeasureTheory + + theorem densityDetectorIntegrand_line_continuous (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (Y : ℝ) (hY : 0 < Y) (x : ℝ) (hx : -1 < x) (hx0 : x ≠ 0) : + Continuous (fun u : ℝ => densityDetectorIntegrand χ X s Y ((x : ℂ) + u * I)) := by + apply continuous_iff_continuousAt.mpr + intro u + have hw : (x : ℂ) + u * I ≠ 0 := by + intro h + have hr := congrArg Complex.re h + exact hx0 (by simpa using hr) + have ha : AnalyticAt ℂ (fun w => densityDetectorFactor χ X s Y w / w) ((x : ℂ) + u * I) := + (densityDetectorFactor_analytic χ X s Y hY _ (by simpa using hx)).div analyticAt_id hw + have he : densityDetectorIntegrand χ X s Y = fun w => densityDetectorFactor χ X s Y w / w := + funext (densityDetectorIntegrand_eq χ X s Y) + rw [he] + exact ContinuousAt.comp (g := fun w : ℂ => densityDetectorFactor χ X s Y w / w) + (f := fun v : ℝ => (x : ℂ) + v * I) ha.continuousAt (by fun_prop) + + theorem densityDetector_left_bound (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hs : 1 / 2 < s.re) (hs1 : s.re ≤ 1) (Y : ℝ) (hY : 1 ≤ Y) (u : ℝ) : + ‖densityDetectorIntegrand χ X s Y (((1 / 2 - s.re : ℝ) : ℂ) + u * I)‖ ≤ + (2 * ((χ.modulus : ℝ) + 1) * X * Y ^ 2 * (3 + |s.im|)) * + (16 / (s.re - 1 / 2)) * (1 + |u|) ^ (-(2 : ℝ)) := by + have hn := densityDetector_numerator_bound χ X s hs.le hs1 Y hY (1 / 2 - s.re) u le_rfl (by linarith) + have hk := densityDetectorKernel_left_bound (s.re - 1 / 2) u (by linarith) (by linarith) + have hx : (-(s.re - 1 / 2) : ℝ) = 1 / 2 - s.re := by ring + rw [← Complex.ofReal_neg, hx] at hk + rw [densityDetectorIntegrand, norm_mul] + apply (mul_le_mul hn hk (norm_nonneg _) (by positivity)).trans_eq + have he : (1 + |u|) * (1 + |u|) ^ (-(3 : ℝ)) = (1 + |u|) ^ (-(2 : ℝ)) := by + rw [show -(2 : ℝ) = 1 + -(3 : ℝ) by ring, + Real.rpow_add (by positivity : 0 < 1 + |u|), Real.rpow_one] + calc + _ = (2 * ((χ.modulus : ℝ) + 1) * X * Y ^ 2 * (3 + |s.im|)) * + (16 / (s.re - 1 / 2)) * ((1 + |u|) * (1 + |u|) ^ (-(3 : ℝ))) := by ring + _ = _ := by rw [he] + + theorem densityDetector_left_integrable (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hs : 1 / 2 < s.re) (hs1 : s.re ≤ 1) (Y : ℝ) (hY : 1 ≤ Y) : + Integrable (fun u : ℝ => densityDetectorIntegrand χ X s Y + (((1 / 2 - s.re : ℝ) : ℂ) + u * I)) := by + have hg : Integrable (fun u : ℝ => (1 + |u|) ^ (-(2 : ℝ))) := by + simpa only [Real.norm_eq_abs] using + (integrable_one_add_norm (E := ℝ) (by norm_num : (Module.finrank ℝ ℝ : ℝ) < 2)) + apply (hg.const_mul ((2 * ((χ.modulus : ℝ) + 1) * X * Y ^ 2 * (3 + |s.im|)) * + (16 / (s.re - 1 / 2)))).mono' + · exact (densityDetectorIntegrand_line_continuous χ X s Y (by linarith) _ + (by linarith) (by linarith)).aestronglyMeasurable + · exact Filter.Eventually.of_forall (densityDetector_left_bound χ X s hs hs1 Y hY) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorWeight.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorWeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..6c9755cf2360a7f3abc5936e359cc74cc6fdc10e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDetectorWeight.lean @@ -0,0 +1,99 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszMellinInversion + +namespace OAI + +/-! # The compact quadratic Riesz weight for detecting actual zeros -/ + +namespace Ostmann + +open Complex MeasureTheory Set + +noncomputable def densityDetectorWeight (x : ℝ) : ℂ := + (max (1 - x) 0 : ℝ) ^ 2 / 2 + +noncomputable def densityDetectorKernel (s : ℂ) : ℂ := + 1 / (s * (s + 1) * (s + 2)) + + theorem densityDetectorWeight_continuous : Continuous densityDetectorWeight := by + unfold densityDetectorWeight + fun_prop + + theorem densityDetectorWeight_nonneg (x : ℝ) : 0 ≤ (densityDetectorWeight x).re := by + simp only [densityDetectorWeight, div_ofNat_re, pow_two, mul_re, ofReal_re, ofReal_im, + mul_zero, sub_zero] + positivity + + theorem densityDetectorWeight_zero (x : ℝ) (hx : 1 ≤ x) : densityDetectorWeight x = 0 := by + simp [densityDetectorWeight, max_eq_right (by linarith : 1 - x ≤ 0)] + + theorem densityDetectorWeight_eq (x : ℝ) (hx : x ≤ 1) : + densityDetectorWeight x = ((1 - x) ^ 2 / 2 : ℝ) := by + simp only [densityDetectorWeight, max_eq_left (by linarith : 0 ≤ 1 - x), + ofReal_div, ofReal_pow, ofReal_ofNat] + + theorem densityDetectorWeight_at_one_div (Y : ℝ) (hY : 4 ≤ Y) : + 1 / 4 ≤ (densityDetectorWeight (1 / Y)).re := by + have hYp : 0 < Y := by linarith + rw [densityDetectorWeight_eq _ (by exact (div_le_one hYp).mpr (by linarith))] + simp only [ofReal_re] + have hy : 0 ≤ 1 / Y := by positivity + have hy4 : 1 / Y ≤ (1 / 4 : ℝ) := (div_le_div_iff₀ hYp (by norm_num)).mpr (by linarith) + nlinarith + +end Ostmann + +namespace Ostmann + +open Complex MeasureTheory Set + + theorem densityDetectorWeight_hasMellin (s : ℂ) (hs : 0 < s.re) : + HasMellin densityDetectorWeight s (densityDetectorKernel s) := by + let f0 : ℝ → ℂ := indicator (Ioc 0 1) (fun _ => 1) + let f1 : ℝ → ℂ := indicator (Ioc 0 1) (fun u => (u : ℂ) ^ (1 : ℂ)) + let f2 : ℝ → ℂ := indicator (Ioc 0 1) (fun u => (u : ℂ) ^ (2 : ℂ)) + have h0 : HasMellin f0 s (1 / s) := hasMellin_one_Ioc hs + have h1 : HasMellin f1 s (1 / (s + 1)) := hasMellin_cpow_Ioc 1 (by simp; linarith) + have h2 : HasMellin f2 s (1 / (s + 2)) := hasMellin_cpow_Ioc 2 (by simp; linarith) + have h21 := hasMellin_const_smul h1.1 (2 : ℂ) + have hsub := hasMellin_sub h0.1 h21.1 + have hadd := hasMellin_add hsub.1 h2.1 + have hhalf := hasMellin_const_smul hadd.1 (1 / 2 : ℂ) + rw [hadd.2, hsub.2, h21.2, h0.2, h1.2, h2.2] at hhalf + let f : ℝ → ℂ := fun u => (1 / 2 : ℂ) • ((f0 u - (2 : ℂ) • f1 u) + f2 u) + have he : EqOn f densityDetectorWeight (Ioi 0) := by + intro u hu + change 0 < u at hu + by_cases hle : u ≤ 1 + · have hm : u ∈ Ioc (0 : ℝ) 1 := ⟨hu, hle⟩ + simp only [f, f0, f1, f2, indicator_of_mem hm, cpow_one, cpow_ofNat, smul_eq_mul, + densityDetectorWeight, max_eq_left (sub_nonneg.mpr hle)] + push_cast + ring + · have hn : u ∉ Ioc (0 : ℝ) 1 := fun h => hle h.2 + simp [f, f0, f1, f2, hn, densityDetectorWeight, max_eq_right (by linarith : 1 - u ≤ 0)] + refine ⟨hhalf.1.congr_fun (fun u hu => congrArg (fun a : ℂ => (u : ℂ) ^ (s - 1) • a) + (he hu)) measurableSet_Ioi, ?_⟩ + have hi : mellin densityDetectorWeight s = mellin f s := by + apply setIntegral_congr_fun measurableSet_Ioi + intro u hu + exact congrArg (fun a : ℂ => (u : ℂ) ^ (s - 1) • a) (he hu).symm + rw [hi, hhalf.2] + have hsn : s ≠ 0 := by intro h; simp [h] at hs + have hs1 : s + 1 ≠ 0 := by + intro h + have := congrArg Complex.re h + simp only [add_re, one_re, zero_re] at this + linarith + have hs2 : s + 2 ≠ 0 := by + intro h + have := congrArg Complex.re h + norm_num at this + linarith + unfold densityDetectorKernel + simp only [smul_eq_mul] + field_simp + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDiscreteHybrid.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDiscreteHybrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..9eb6c44b54f7589a49af65c91696d688ce82945e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDiscreteHybrid.lean @@ -0,0 +1,65 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityPolynomialDerivative + +namespace OAI + +/-! # The hybrid large sieve at separated ordinates -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators Classical + + theorem discrete_hybrid_multiplicative_large_sieve : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + ∀ a : ℕ → ℂ, ∀ F : (q : ℕ) → Finset (DirichletCharacter ℂ q), + (∀ q ∈ Finset.Icc 1 Q, ∀ χ ∈ F q, χ.IsPrimitive) → + ∀ (ι : Type) (R : (q : ℕ) → DirichletCharacter ℂ q → Finset ι) + (t : (q : ℕ) → DirichletCharacter ℂ q → ι → ℝ), + (∀ q ∈ Finset.Icc 1 Q, ∀ χ ∈ F q, ∀ i ∈ R q χ, |t q χ i| ≤ T) → + (∀ q ∈ Finset.Icc 1 Q, ∀ χ ∈ F q, ∀ i ∈ R q χ, ∀ j ∈ R q χ, + i ≠ j → 1 ≤ |t q χ i - t q χ j|) → + (∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, ∑ i ∈ R q χ, + ‖∑ n ∈ Finset.Icc 1 N, a n * χ (n : ZMod q) * + realAdditivePhase (-(Real.log n * t q χ i))‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * (T + 1)) * + (2 + 64 * (Real.log (N + 1 : ℕ)) ^ 2) * ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 := by + obtain ⟨C, hC, hmean⟩ := hybrid_multiplicative_large_sieve + refine ⟨C, hC, ?_⟩ + intro N Q hQ T hT a F hF ι R t ht hsep + have hT1 : 1 ≤ T + 1 := by linarith + have hder (q : ℕ) (χ : DirichletCharacter ℂ q) (n : ℕ) : + densityDerivativeCoeff (fun m => a m * χ (m : ZMod q)) n = + densityDerivativeCoeff a n * χ (n : ZMod q) := by + unfold densityDerivativeCoeff + ring + have hpoint (q : ℕ) (hq : q ∈ Finset.Icc 1 Q) (χ : DirichletCharacter ℂ q) (hχ : χ ∈ F q) : + (∑ i ∈ R q χ, ‖∑ n ∈ Finset.Icc 1 N, a n * χ (n : ZMod q) * + realAdditivePhase (-(Real.log n * t q χ i))‖ ^ 2) ≤ + 2 * (∫ u in Icc (-(T + 1)) (T + 1), ‖∑ n ∈ Finset.Icc 1 N, + a n * χ (n : ZMod q) * realAdditivePhase (-(Real.log n * u))‖ ^ 2) + + ∫ u in Icc (-(T + 1)) (T + 1), ‖∑ n ∈ Finset.Icc 1 N, + densityDerivativeCoeff a n * χ (n : ZMod q) * + realAdditivePhase (-(Real.log n * u))‖ ^ 2 := by + have hp := density_separated_samples (R q χ) (t q χ) T (ht q hq χ hχ) (hsep q hq χ hχ) + (fun u => ∑ n ∈ Finset.Icc 1 N, (a n * χ (n : ZMod q)) * + realAdditivePhase (-(Real.log n * u))) + (fun u => ∑ n ∈ Finset.Icc 1 N, + densityDerivativeCoeff (fun m => a m * χ (m : ZMod q)) n * + realAdditivePhase (-(Real.log n * u))) + (density_polynomial_hasDerivAt _ _) (density_polynomial_continuous _ _) + simpa only [hder, show -T - 1 = -(T + 1) by ring] using hp + have hs := Finset.sum_le_sum (s := Finset.Icc 1 Q) (fun q hq => + Finset.sum_le_sum (s := F q) (fun χ hχ => hpoint q hq χ hχ)) + simp only [Finset.sum_add_distrib, ← Finset.mul_sum] at hs + have ha := hmean N Q hQ (T + 1) hT1 a F hF + have hd := hmean N Q hQ (T + 1) hT1 (densityDerivativeCoeff a) F hF + have hB : 0 ≤ C * ((N : ℝ) + (Q : ℝ) ^ 2 * (T + 1)) := by positivity + have hd' := hd.trans (mul_le_mul_of_nonneg_left (density_derivative_coefficient_bound N a) hB) + have hb := add_le_add (mul_le_mul_of_nonneg_left ha (by norm_num : (0 : ℝ) ≤ 2)) hd' + apply hs.trans + convert hb using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDivisorBlock.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDivisorBlock.lean new file mode 100644 index 0000000000000000000000000000000000000000..8864457244b97ec8d3c9b1a758e814ee35925de3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDivisorBlock.lean @@ -0,0 +1,39 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityShiftedDivisorEnergy + +namespace OAI + +/-! # Divisor coefficient energy on a concrete positive block -/ + +namespace Ostmann + +open scoped BigOperators + + theorem density_divisor_block_energy (S : Finset ℕ) (M N : ℕ) (hM : 1 ≤ M) + (hS : S ⊆ Finset.Icc M N) (a : ℕ → ℂ) + (ha : ∀ n ∈ S, ‖a n‖ ≤ n.divisors.card) (σ : ℝ) (hσ : 0 ≤ σ) : + (∑ n ∈ S, ‖densityVerticalCoeff a σ n‖ ^ 2) ≤ + (N : ℝ) * (1 + Real.log N) ^ 3 / (M : ℝ) ^ (2 * σ) := by + have hMp : (0 : ℝ) < M := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hM) + calc + _ ≤ ∑ n ∈ S, (n.divisors.card : ℝ) ^ 2 / (M : ℝ) ^ (2 * σ) := by + apply Finset.sum_le_sum + intro n hn + have hMn := (Finset.mem_Icc.mp (hS hn)).1 + have hnp : 0 < n := lt_of_lt_of_le (lt_of_lt_of_le Nat.zero_lt_one hM) hMn + rw [densityVerticalCoeff_square a σ n hnp] + apply (div_le_div_of_nonneg_right (pow_le_pow_left₀ (norm_nonneg _) (ha n hn) 2) (by positivity)).trans + exact div_le_div_of_nonneg_left (sq_nonneg _) (Real.rpow_pos_of_pos hMp _) + (Real.rpow_le_rpow hMp.le (by exact_mod_cast hMn) (by positivity)) + _ = (∑ n ∈ S, (n.divisors.card : ℝ) ^ 2) / (M : ℝ) ^ (2 * σ) := by rw [Finset.sum_div] + _ ≤ (∑ n ∈ Finset.Icc 1 N, (n.divisors.card : ℝ) ^ 2) / (M : ℝ) ^ (2 * σ) := by + apply div_le_div_of_nonneg_right _ (by positivity) + apply Finset.sum_le_sum_of_subset_of_nonneg + · intro n hn + exact Finset.mem_Icc.mpr ⟨hM.trans (Finset.mem_Icc.mp (hS hn)).1, (Finset.mem_Icc.mp (hS hn)).2⟩ + · intro n _ _ + positivity + _ ≤ _ := div_le_div_of_nonneg_right (density_divisor_square_sum N) (by positivity) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDivisorBlockSieve.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDivisorBlockSieve.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f7749240a7a702ab87d1b43096ead3f7fb78b44 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDivisorBlockSieve.lean @@ -0,0 +1,39 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySubsetAbscissaSieve +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDivisorBlock + +namespace OAI + +/-! # The variable-abscissa sieve on a divisor-bounded coefficient block -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_divisor_block_sieve : + ∃ C : ℝ, 0 < C ∧ ∀ M N Q : ℕ, 1 ≤ M → 1 ≤ Q → + ∀ T σ : ℝ, 1 ≤ T → 0 ≤ σ → σ ≤ 1 → + ∀ U : Finset ℕ, U ⊆ Finset.Icc M N → ∀ a : ℕ → ℂ, + (∀ n ∈ U, ‖a n‖ ≤ n.divisors.card) → + ∀ {ι : Type} (R : Finset ι) (c : ι → PrimitiveComplexCharacter) (t β : ι → ℝ), + (∀ i ∈ R, (c i).modulus ≤ Q) → (∀ i ∈ R, |t i| ≤ T) → + (∀ i ∈ R, ∀ j ∈ R, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∀ i ∈ R, σ ≤ β i ∧ β i ≤ 1) → + (∑ i ∈ R, ‖densityCharacterPolynomial U + (densityVerticalCoeff a (β i)) (c i).character (t i)‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * (T + 1)) * + (2 + 64 * (Real.log (N + 1 : ℕ)) ^ 2) * (2 + (Real.log (N + 1 : ℕ)) ^ 2) * + ((N : ℝ) * (1 + Real.log N) ^ 3 / (M : ℝ) ^ (2 * σ)) := by + obtain ⟨C, hC, hb⟩ := density_subset_abscissa_sieve + refine ⟨C, hC, ?_⟩ + intro M N Q hM hQ T σ hT hσ0 hσ1 U hU a ha ι R c t β hc ht hs hβ + have hU1 : U ⊆ Finset.Icc 1 N := by + intro n hn + obtain ⟨hMn, hnN⟩ := Finset.mem_Icc.mp (hU hn) + exact Finset.mem_Icc.mpr ⟨hM.trans hMn, hnN⟩ + have h := hb N Q hQ T σ hT hσ0 hσ1 U hU1 a R c t β hc ht hs hβ + exact h.trans (mul_le_mul_of_nonneg_left + (density_divisor_block_energy U M N hM hU a ha σ hσ0) (by positivity)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDivisorMoment.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDivisorMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..23ebecf24c4b82ebf597a264577a9db81899aa26 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDivisorMoment.lean @@ -0,0 +1,72 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.LcmFrequencySum +import OAI.NumberTheory.Ostmann.Supply.MultiplierWeightedBudget + +namespace OAI + +/-! # The elementary second moment of divisor coefficients + +Pairs of divisors are counted by their least common multiple. The +harmonic-cube estimate gives the logarithmic third power without a +pointwise divisor bound. +-/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_divisor_count_as_sum (N n : ℕ) (hn : n ∈ Finset.Icc 1 N) : + (n.divisors.card : ℝ) = ∑ d ∈ Finset.Icc 1 N, if d ∣ n then (1 : ℝ) else 0 := by + have he : (Finset.Icc 1 N).filter (fun d => d ∣ n) = n.divisors := by + ext d + simp only [Finset.mem_filter, Finset.mem_Icc, Nat.mem_divisors] + constructor + · intro h + exact ⟨h.2, by have hpos := (Finset.mem_Icc.mp hn).1; omega⟩ + · intro h + have hpos : 0 < n := (Finset.mem_Icc.mp hn).1 + have hdpos := Nat.pos_of_dvd_of_pos h.1 hpos + exact ⟨⟨hdpos, (Nat.le_of_dvd hpos h.1).trans (Finset.mem_Icc.mp hn).2⟩, h.1⟩ + rw [← Finset.sum_filter, he] + simp + + theorem density_divisor_square_as_sum (N n : ℕ) (hn : n ∈ Finset.Icc 1 N) : + (n.divisors.card : ℝ) ^ 2 = ∑ d ∈ Finset.Icc 1 N, ∑ e ∈ Finset.Icc 1 N, + if d.lcm e ∣ n then (1 : ℝ) else 0 := by + rw [density_divisor_count_as_sum N n hn, pow_two, Finset.sum_mul_sum] + apply Finset.sum_congr rfl + intro d _ + apply Finset.sum_congr rfl + intro e _ + by_cases hd : d ∣ n <;> by_cases he : e ∣ n <;> + simp [Nat.lcm_dvd_iff, hd, he] + + theorem density_divisor_square_sum (N : ℕ) : + (∑ n ∈ Finset.Icc 1 N, (n.divisors.card : ℝ) ^ 2) ≤ + (N : ℝ) * (1 + Real.log N) ^ 3 := by + calc + _ = ∑ d ∈ Finset.Icc 1 N, ∑ e ∈ Finset.Icc 1 N, + ((N / d.lcm e : ℕ) : ℝ) := by + rw [Finset.sum_congr rfl (fun n hn => density_divisor_square_as_sum N n hn)] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro d _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro e _ + rw [← Finset.sum_filter] + simp only [Finset.sum_const, nsmul_eq_mul, mul_one] + exact_mod_cast positiveMultipliers_dvd_card N (d.lcm e) + _ ≤ (N : ℝ) * ∑ d ∈ Finset.Icc 1 N, ∑ e ∈ Finset.Icc 1 N, + ((d.lcm e : ℕ) : ℝ)⁻¹ := by + simp only [Finset.mul_sum] + apply Finset.sum_le_sum + intro d _ + apply Finset.sum_le_sum + intro e _ + simpa only [div_eq_mul_inv] using + (Nat.cast_div_le (m := N) (n := d.lcm e) (α := ℝ)) + _ ≤ _ := mul_le_mul_of_nonneg_left (reciprocal_lcm_sum_le_log_cube N) (Nat.cast_nonneg _) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicArithmetic.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicArithmetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..7a12b3948b7e9f955a5f75e0cf635718d6011742 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicArithmetic.lean @@ -0,0 +1,48 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityTailBlock + +namespace OAI + +/-! # Numerical decay of the distant dyadic coefficient blocks -/ + +namespace Ostmann + +open scoped BigOperators + + theorem density_dyadic_fraction_bound (B V A r L : ℝ) + (hB : 0 ≤ B) (hBV : B ≤ V) (hV : 0 < V) (hA : 0 ≤ A) (hr : 1 ≤ r) (hL : 0 ≤ L) : + B ^ 2 * (2 * r * V + A) * ((2 * r * V) * L ^ 3 / (r * V) ^ 3) ≤ + 4 * (V + A) * L ^ 3 / r := by + have hrp : 0 < r := by linarith + have hsq : B ^ 2 ≤ V ^ 2 := pow_le_pow_left₀ hB hBV 2 + calc + _ ≤ V ^ 2 * (2 * r * V + A) * ((2 * r * V) * L ^ 3 / (r * V) ^ 3) := by + apply mul_le_mul_of_nonneg_right _ (by positivity) + exact mul_le_mul_of_nonneg_right hsq (by positivity) + _ = (4 * V / r + 2 * A / r ^ 2) * L ^ 3 := by field_simp; ring + _ ≤ (4 * (V + A) / r) * L ^ 3 := by + apply mul_le_mul_of_nonneg_right _ (pow_nonneg hL 3) + apply (le_div_iff₀ hrp).mpr + have hdiv : (2 * A / r ^ 2) * r = 2 * A / r := by field_simp + rw [add_mul, div_mul_cancel₀ _ hrp.ne', hdiv] + have hb : 2 * A / r ≤ 4 * A := by + apply (div_le_iff₀ hrp).mpr + nlinarith + nlinarith + _ = _ := by ring + + theorem density_dyadic_log_bound (N j : ℕ) (hN : 1 ≤ N) : + 1 + Real.log ((2 : ℝ) ^ (j + 1) * N) ≤ + (j + 2 : ℝ) * (1 + Real.log N) := by + have hNp : (0 : ℝ) < N := by exact_mod_cast (show 0 < N by omega) + have hNl : 0 ≤ Real.log N := Real.log_nonneg (by exact_mod_cast hN) + rw [Real.log_mul (by positivity) hNp.ne', Real.log_pow] + have htwo : Real.log 2 ≤ 1 := by + have h := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 2) + linarith + have hj : (0 : ℝ) ≤ j := Nat.cast_nonneg j + push_cast + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicBlockCost.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicBlockCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..b177758eb0fd6b91536b02fbadc1e0fa5a7b3ade --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicBlockCost.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDivisorBlockSieve + +namespace OAI + +/-! # The sharp length cost of one dyadic detector block -/ + +namespace Ostmann + + theorem density_dyadic_power_cost (m Y Q T σ : ℝ) (hm : 0 < m) (hmY : m ≤ Y) + (hT : 1 ≤ T) (_hσ : 1 / 2 ≤ σ) (hσ1 : σ ≤ 1) : + ((2 * m + Q ^ 2 * (T + 1)) * (2 * m)) / m ^ (2 * σ) ≤ + 4 * (Y ^ (2 - 2 * σ) + (Q ^ 2 * T) * m ^ (1 - 2 * σ)) := by + have hq : Q ^ 2 * (T + 1) ≤ 2 * (Q ^ 2 * T) := by nlinarith [sq_nonneg Q] + have hfirst := Real.rpow_le_rpow hm.le hmY (by linarith : 0 ≤ 2 - 2 * σ) + have hpower2 : m ^ (2 - 2 * σ) = m ^ 2 / m ^ (2 * σ) := by + rw [Real.rpow_sub hm, Real.rpow_two] + have hpower1 : m ^ (1 - 2 * σ) = m / m ^ (2 * σ) := by + rw [Real.rpow_sub hm, Real.rpow_one] + calc + _ ≤ (4 * (m + Q ^ 2 * T) * m) / m ^ (2 * σ) := by + apply div_le_div_of_nonneg_right _ (by positivity) + nlinarith + _ = 4 * (m ^ (2 - 2 * σ) + (Q ^ 2 * T) * m ^ (1 - 2 * σ)) := by + rw [hpower2, hpower1] + ring + _ ≤ _ := by gcongr + + theorem density_dyadic_log_cost (m Y : ℝ) (hm : 1 ≤ m) (hmY : m ≤ Y) : + (2 + 64 * (Real.log (2 * m + 1)) ^ 2) * (2 + (Real.log (2 * m + 1)) ^ 2) * + (1 + Real.log (2 * m)) ^ 3 ≤ 198 * (1 + Real.log (2 * Y + 1)) ^ 7 := by + let L := 1 + Real.log (2 * Y + 1) + have hY : 1 ≤ Y := hm.trans hmY + have hlog : 0 ≤ Real.log (2 * Y + 1) := Real.log_nonneg (by linarith) + have hL : 1 ≤ L := by dsimp [L]; linarith + have h1 : 0 ≤ Real.log (2 * m + 1) := Real.log_nonneg (by linarith) + have h1L : Real.log (2 * m + 1) ≤ L := by + have h := Real.log_le_log (by linarith : 0 < 2 * m + 1) (by linarith : 2 * m + 1 ≤ 2 * Y + 1) + dsimp [L] + linarith + have hs : (Real.log (2 * m + 1)) ^ 2 ≤ L ^ 2 := pow_le_pow_left₀ h1 h1L 2 + have hL2 : 1 ≤ L ^ 2 := one_le_pow₀ hL + have ha : 2 + 64 * (Real.log (2 * m + 1)) ^ 2 ≤ 66 * L ^ 2 := by nlinarith + have hb : 2 + (Real.log (2 * m + 1)) ^ 2 ≤ 3 * L ^ 2 := by nlinarith + have hc0 : 0 ≤ 1 + Real.log (2 * m) := by + have h := Real.log_nonneg (by linarith : 1 ≤ 2 * m) + linarith + have hc : 1 + Real.log (2 * m) ≤ L := by + dsimp [L] + have h : Real.log (2 * m) ≤ Real.log (2 * Y + 1) := + Real.log_le_log (by linarith : 0 < 2 * m) (by linarith : 2 * m ≤ 2 * Y + 1) + exact add_le_add le_rfl h + calc + _ ≤ (66 * L ^ 2) * (3 * L ^ 2) * L ^ 3 := by + exact mul_le_mul (mul_le_mul ha hb (by positivity) (by positivity)) + (pow_le_pow_left₀ hc0 hc 3) (by positivity) (by positivity) + _ = _ := by dsimp [L]; ring + + theorem density_dyadic_total_cost (C x m Y Q T σ : ℝ) (hC : 0 ≤ C) + (hx : 1 ≤ x) (hxm : x ≤ m) (hmY : m ≤ Y) (hT : 1 ≤ T) + (hσ : 1 / 2 ≤ σ) (hσ1 : σ ≤ 1) : + C * (2 * m + Q ^ 2 * (T + 1)) * + (2 + 64 * (Real.log (2 * m + 1)) ^ 2) * (2 + (Real.log (2 * m + 1)) ^ 2) * + (2 * m * (1 + Real.log (2 * m)) ^ 3 / m ^ (2 * σ)) ≤ + (792 * C) * (1 + Real.log (2 * Y + 1)) ^ 7 * + (Y ^ (2 - 2 * σ) + Q ^ 2 * T * x ^ (1 - 2 * σ)) := by + have hm : 0 < m := by linarith + have hlogY : 0 ≤ Real.log (2 * Y + 1) := Real.log_nonneg (by linarith) + have hl := density_dyadic_log_cost m Y (hx.trans hxm) hmY + have hp := density_dyadic_power_cost m Y Q T σ hm hmY hT hσ hσ1 + have hr := Real.rpow_le_rpow_of_nonpos (by linarith : 0 < x) hxm (by linarith : 1 - 2 * σ ≤ 0) + have hp' : ((2 * m + Q ^ 2 * (T + 1)) * (2 * m)) / m ^ (2 * σ) ≤ + 4 * (Y ^ (2 - 2 * σ) + Q ^ 2 * T * x ^ (1 - 2 * σ)) := by + apply hp.trans + gcongr + calc + _ = C * ((2 + 64 * (Real.log (2 * m + 1)) ^ 2) * (2 + (Real.log (2 * m + 1)) ^ 2) * + (1 + Real.log (2 * m)) ^ 3) * (((2 * m + Q ^ 2 * (T + 1)) * (2 * m)) / m ^ (2 * σ)) := by ring + _ ≤ C * (198 * (1 + Real.log (2 * Y + 1)) ^ 7) * + (4 * (Y ^ (2 - 2 * σ) + Q ^ 2 * T * x ^ (1 - 2 * σ))) := by + apply mul_le_mul (mul_le_mul_of_nonneg_left hl hC) hp' (by positivity) (by positivity) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicMean.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..a894bb42304e9d869f4fc774b9556bf6da471621 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicMean.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDyadicArithmetic + +namespace OAI + +/-! # Decaying mean squares for the actual distant dyadic blocks -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators Classical + + theorem densityFiniteSquare_dyadic_mean : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ N → 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + 10 * (Q : ℝ) * T ≤ N → ∀ j : ℕ, + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖∑ n ∈ Finset.Ioc (2 ^ j * N) (2 ^ (j + 1) * N), + densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * (1 + Real.log N) ^ 3 * + (j + 2 : ℝ) ^ 3 / (2 : ℝ) ^ j := by + obtain ⟨C, hC, hb⟩ := densityFiniteSquare_tail_mean + refine ⟨4 * C, by positivity, ?_⟩ + intro N Q hN hQ T hT hscale j F hF + have hM : 1 ≤ 2 ^ j * N := one_le_mul (by exact_mod_cast (one_le_pow₀ (by norm_num : 1 ≤ (2 : ℕ)) : 1 ≤ (2 : ℕ) ^ j)) hN + have hS : Finset.Ioc (2 ^ j * N) (2 ^ (j + 1) * N) ⊆ + Finset.Icc (2 ^ j * N) (2 ^ (j + 1) * N) := by + intro n hn + exact Finset.mem_Icc.mpr ⟨(Finset.mem_Ioc.mp hn).1.le, (Finset.mem_Ioc.mp hn).2⟩ + have h := hb (2 ^ j * N) (2 ^ (j + 1) * N) Q hM hQ T hT + (Finset.Ioc (2 ^ j * N) (2 ^ (j + 1) * N)) hS F hF + have hNp : (0 : ℝ) < N := by exact_mod_cast (show 0 < N by omega) + have hr : (1 : ℝ) ≤ 2 ^ j := one_le_pow₀ (by norm_num) + have hNl : 0 ≤ Real.log N := Real.log_nonneg (by exact_mod_cast hN) + have hlog0 : 0 ≤ 1 + Real.log ((2 : ℝ) ^ (j + 1) * N) := by + apply le_trans (by norm_num : (0 : ℝ) ≤ 1) (le_add_of_nonneg_right _) + apply Real.log_nonneg + have hp : (1 : ℝ) ≤ 2 ^ (j + 1) := one_le_pow₀ (by norm_num) + have hn : (1 : ℝ) ≤ N := by exact_mod_cast hN + nlinarith + have hlog := pow_le_pow_left₀ hlog0 (density_dyadic_log_bound N j hN) 3 + have hend : (2 : ℝ) ^ (j + 1) * N = 2 * (2 : ℝ) ^ j * N := by rw [pow_succ]; ring + simp only [Nat.cast_mul, Nat.cast_pow, Nat.cast_ofNat] at h + calc + _ ≤ C * ((10 * (Q : ℝ) * T) ^ 2 * + ((2 : ℝ) ^ (j + 1) * N + (Q : ℝ) ^ 2 * T) * + (((2 : ℝ) ^ (j + 1) * N) * (1 + Real.log ((2 : ℝ) ^ (j + 1) * N)) ^ 3 / + ((2 : ℝ) ^ j * N) ^ 3)) := by + convert h using 1 + ring + _ ≤ C * (4 * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * + (1 + Real.log ((2 : ℝ) ^ (j + 1) * N)) ^ 3 / (2 : ℝ) ^ j) := by + apply mul_le_mul_of_nonneg_left _ hC.le + rw [hend] + exact density_dyadic_fraction_bound _ _ _ _ _ (by positivity) hscale hNp + (by positivity) hr (by simpa only [hend] using hlog0) + _ ≤ C * (4 * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * + (((j + 2 : ℝ) * (1 + Real.log N)) ^ 3) / (2 : ℝ) ^ j) := by + apply mul_le_mul_of_nonneg_left _ hC.le + exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hlog (by positivity)) (by positivity) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicPartition.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f0e62c5e7ba76b29c3d61ca21314d9b9e18766e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicPartition.lean @@ -0,0 +1,37 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityTailBlock + +namespace OAI + +/-! # The actual coefficient head and consecutive dyadic blocks -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_dyadic_partition (N J : ℕ) (hN : 1 ≤ N) (a : ℕ → ℂ) : + (∑ n ∈ Finset.Icc 1 (2 ^ J * N), a n) = + (∑ n ∈ Finset.Icc 1 N, a n) + + ∑ j ∈ Finset.range J, ∑ n ∈ Finset.Ioc (2 ^ j * N) (2 ^ (j + 1) * N), a n := by + induction J with + | zero => simp + | succ J ih => + have hM : 1 ≤ 2 ^ J * N := one_le_mul (one_le_pow₀ (by norm_num)) hN + have hE : 2 ^ J * N ≤ 2 ^ (J + 1) * N := by rw [pow_succ]; nlinarith + have he : Finset.Icc 1 (2 ^ (J + 1) * N) = + Finset.Icc 1 (2 ^ J * N) ∪ Finset.Ioc (2 ^ J * N) (2 ^ (J + 1) * N) := by + ext n + simp only [Finset.mem_Icc, Finset.mem_union, Finset.mem_Ioc] + omega + have hd : Disjoint (Finset.Icc 1 (2 ^ J * N)) + (Finset.Ioc (2 ^ J * N) (2 ^ (J + 1) * N)) := by + apply Finset.disjoint_left.mpr + intro n hn hm + have hn' := (Finset.mem_Icc.mp hn).2 + have hm' := (Finset.mem_Ioc.mp hm).1 + omega + rw [he, Finset.sum_union hd, ih, Finset.sum_range_succ] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicShells.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicShells.lean new file mode 100644 index 0000000000000000000000000000000000000000..8d5f0a2be8c36f1aab41ec9d3fc6c4f32afb6cbe --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityDyadicShells.lean @@ -0,0 +1,76 @@ +import Mathlib.Analysis.SpecificLimits.Basic +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFatou + +namespace OAI + +/-! # A disjoint dyadic decomposition of the whole height line -/ + +namespace Ostmann + +open Set Filter +open scoped Topology + +noncomputable def densityHeightBall (T : ℝ) (j : ℕ) : Set ℝ := + Icc (-((2 : ℝ) ^ j * T)) ((2 : ℝ) ^ j * T) + +noncomputable def densityHeightShell (T : ℝ) : ℕ → Set ℝ + | 0 => densityHeightBall T 0 + | j + 1 => densityHeightBall T (j + 1) \ densityHeightBall T j + + theorem densityHeightBall_mem (T : ℝ) (j : ℕ) (x : ℝ) : + x ∈ densityHeightBall T j ↔ |x| ≤ (2 : ℝ) ^ j * T := by + exact abs_le.symm + + theorem densityHeightBall_mono (T : ℝ) (hT : 0 ≤ T) {i j : ℕ} (hij : i ≤ j) : + densityHeightBall T i ⊆ densityHeightBall T j := by + intro x hx + rw [densityHeightBall_mem] at hx ⊢ + exact hx.trans (mul_le_mul_of_nonneg_right (pow_le_pow_right₀ (by norm_num) hij) hT) + + theorem densityHeightShell_measurable (T : ℝ) (j : ℕ) : MeasurableSet (densityHeightShell T j) := by + cases j with + | zero => exact measurableSet_Icc + | succ j => exact measurableSet_Icc.diff measurableSet_Icc + + theorem densityHeightShell_subset (T : ℝ) (j : ℕ) : + densityHeightShell T j ⊆ densityHeightBall T j := by + cases j with + | zero => exact Set.Subset.rfl + | succ j => exact Set.sdiff_subset + + theorem densityHeightShell_disjoint (T : ℝ) (hT : 0 ≤ T) : + Pairwise (fun i j => Disjoint (densityHeightShell T i) (densityHeightShell T j)) := by + have hd (i j : ℕ) (hij : i < j) : Disjoint (densityHeightShell T i) (densityHeightShell T j) := by + obtain ⟨k, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : j ≠ 0) + apply Set.disjoint_left.mpr + intro x hx hy + exact hy.2 (densityHeightBall_mono T hT (by omega) (densityHeightShell_subset T i hx)) + intro i j hij + rcases lt_or_gt_of_ne hij with h | h + · exact hd i j h + · exact (hd j i h).symm + + theorem densityHeightShell_cover (T : ℝ) (hT : 0 < T) : + (⋃ j : ℕ, densityHeightShell T j) = Set.univ := by + apply Set.eq_univ_of_forall + intro x + have hex : ∃ j : ℕ, |x| ≤ (2 : ℝ) ^ j * T := by + have ht : Tendsto (fun j : ℕ => (2 : ℝ) ^ j * T) atTop atTop := + (tendsto_pow_atTop_atTop_of_one_lt (by norm_num : (1 : ℝ) < 2)).atTop_mul_const hT + obtain ⟨j, hj⟩ := (ht.eventually (eventually_ge_atTop |x|)).exists + exact ⟨j, hj⟩ + let j := Nat.find hex + have hj : |x| ≤ (2 : ℝ) ^ j * T := Nat.find_spec hex + apply Set.mem_iUnion.mpr + refine ⟨j, ?_⟩ + cases he : j with + | zero => exact (densityHeightBall_mem T 0 x).mpr (by simpa only [he] using hj) + | succ k => + change x ∈ densityHeightBall T (k + 1) \ densityHeightBall T k + refine ⟨(densityHeightBall_mem T (k + 1) x).mpr (by simpa only [he] using hj), ?_⟩ + rw [densityHeightBall_mem] + exact Nat.find_min hex (by omega : k < Nat.find hex) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFatou.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFatou.lean new file mode 100644 index 0000000000000000000000000000000000000000..a25ee1f8c1f31617cf219aca7a5b0a447317cafa --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFatou.lean @@ -0,0 +1,39 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFiniteContinuity + +namespace OAI + +/-! # Passing a uniform positive mean bound to the actual series limit -/ + +namespace Ostmann + +open Filter MeasureTheory +open scoped Topology + + theorem density_integral_limit_bound (g : ℕ → ℝ → ℝ) (f : ℝ → ℝ) + (μ : Measure ℝ) (B : ℝ) (hB : 0 ≤ B) + (hg : ∀ n, Integrable (g n) μ) (hg0 : ∀ n t, 0 ≤ g n t) + (hf : ∀ t, Tendsto (fun n => g n t) atTop (𝓝 (f t))) + (hb : ∀ n, ∫ t, g n t ∂μ ≤ B) : + Integrable f μ ∧ (∫ t, f t ∂μ) ≤ B := by + have hf0 (t : ℝ) : 0 ≤ f t := ge_of_tendsto (hf t) (Filter.Eventually.of_forall (fun n => hg0 n t)) + have hfn : ∀ᵐ t ∂μ, Tendsto (fun n => g n t) atTop (𝓝 (f t)) := Filter.Eventually.of_forall hf + have hn (n : ℕ) : (∫⁻ t, ‖g n t‖ₑ ∂μ) = ENNReal.ofReal (∫ t, g n t ∂μ) := by + simp_rw [Real.enorm_eq_ofReal (hg0 n _)] + exact (ofReal_integral_eq_lintegral_ofReal (hg n) (Filter.Eventually.of_forall (hg0 n))).symm + have hlim : Filter.liminf (fun n => ∫⁻ t, ‖g n t‖ₑ ∂μ) atTop ≤ ENNReal.ofReal B := by + apply liminf_le_of_frequently_le' + exact Filter.Eventually.frequently (Filter.Eventually.of_forall (fun n => by + rw [hn n] + exact ENNReal.ofReal_le_ofReal (hb n))) + have hint : Integrable f μ := integrable_of_tendsto hfn (fun n => (hg n).aestronglyMeasurable) + (ne_top_of_le_ne_top ENNReal.ofReal_ne_top hlim) + refine ⟨hint, ?_⟩ + have hfat := (lintegral_enorm_le_liminf_of_tendsto hfn + (fun n => (hg n).aestronglyMeasurable.aemeasurable.enorm)).trans hlim + simp_rw [Real.enorm_eq_ofReal (hf0 _)] at hfat + rw [← ofReal_integral_eq_lintegral_ofReal hint (Filter.Eventually.of_forall hf0)] at hfat + exact (ENNReal.ofReal_le_ofReal_iff hB).mp hfat + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteBlockSquare.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteBlockSquare.lean new file mode 100644 index 0000000000000000000000000000000000000000..bbe81c9d507a9dce98595d09bea900f3cd197464 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteBlockSquare.lean @@ -0,0 +1,24 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityBlockCauchy + +namespace OAI + +/-! # Summing finitely many actual polynomial blocks -/ + +namespace Ostmann + +open scoped BigOperators + + theorem density_finite_block_square {ι : Type*} (R : Finset ι) (J : ℕ) (f : ι → ℕ → ℂ) : + (∑ i ∈ R, ‖∑ j ∈ Finset.range J, f i j‖ ^ 2) ≤ + (J : ℝ) * ∑ j ∈ Finset.range J, ∑ i ∈ R, ‖f i j‖ ^ 2 := by + calc + _ ≤ ∑ i ∈ R, (J : ℝ) * ∑ j ∈ Finset.range J, ‖f i j‖ ^ 2 := by + apply Finset.sum_le_sum + intro i _ + simpa using density_weighted_sum_norm_sq (Finset.range J) (f i) (fun _ => (1 : ℝ)) + (fun _ _ => by norm_num) + _ = _ := by rw [← Finset.mul_sum, Finset.sum_comm] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteContinuity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..298e0abac8c65f13bccba7f8ed01a77232d434fc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteContinuity.lean @@ -0,0 +1,95 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityKernelCost + +namespace OAI + +/-! # Continuity of the actual finite square on a bounded height interval -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators + + theorem densitySquareKernel_vertical_continuous (χ : PrimitiveComplexCharacter) + (c : ℝ) (hc : 0 < c) : + Continuous (fun z : ℝ × ℝ => densitySquareKernel χ + (densityVerticalPoint (1 / 2) z.1) ((c : ℂ) + (2 * Real.pi * z.2 : ℝ) * I)) := by + have hs : Continuous (fun z : ℝ × ℝ => densityVerticalPoint (1 / 2) z.1) := by + unfold densityVerticalPoint + fun_prop + have hw : Continuous (fun z : ℝ × ℝ => (c : ℂ) + (2 * Real.pi * z.2 : ℝ) * I) := by fun_prop + have hg : Continuous (fun z : ℝ × ℝ => DirichletCharacter.gammaFactor χ.character + (densityVerticalPoint (1 / 2) z.1 + ((c : ℂ) + (2 * Real.pi * z.2 : ℝ) * I))) := by + apply continuous_iff_continuousAt.mpr + intro z + apply (χ.gammaFactor_differentiableAt_pos _ (by simp [densityVerticalPoint]; linarith)).continuousAt.comp + exact (hs.add hw).continuousAt + have hg0 : Continuous (fun z : ℝ × ℝ => + DirichletCharacter.gammaFactor χ.character (densityVerticalPoint (1 / 2) z.1)) := by + apply continuous_iff_continuousAt.mpr + intro z + apply (χ.gammaFactor_differentiableAt_pos _ (by norm_num [densityVerticalPoint])).continuousAt.comp + exact hs.continuousAt + have hgn (z : ℝ × ℝ) : + DirichletCharacter.gammaFactor χ.character (densityVerticalPoint (1 / 2) z.1) ≠ 0 := by + intro h + exact χ.gammaInverse_ne_zero (densityVerticalPoint (1 / 2) z.1) (by norm_num [densityVerticalPoint]) + (by simp only [PrimitiveComplexCharacter.gammaInverse, h, inv_zero]) + have hq : (χ.modulus : ℂ) ≠ 0 := by exact_mod_cast χ.positive.ne' + unfold densitySquareKernel densityCompletedSquareWeight + apply Continuous.div + · exact (((differentiable_id.const_cpow (Or.inl hq)).continuous.comp hw).mul + ((hg.div hg0 hgn).pow 2)).mul ((hw.pow 2).cexp) + · exact hw + · intro z h + have hr := congrArg Complex.re h + simp only [add_re, ofReal_re, mul_re, ofReal_im, I_re, I_im, mul_zero, + zero_mul, sub_self, add_zero, zero_re] at hr + exact hc.ne' hr + + theorem densityFiniteSquare_continuousOn (χ : PrimitiveComplexCharacter) + (S : Finset ℕ) (hS : ∀ n ∈ S, 1 ≤ n) (T : ℝ) (hT : 1 ≤ T) : + ContinuousOn (fun t : ℝ => ∑ n ∈ S, + densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n) (Icc (-T) T) := by + let a := densityVerticalCoeff (fun n : ℕ => (n.divisors.card : ℂ)) (1 / 2 + (1 : ℝ)) + let K : ℝ := densityKernelCost χ.modulus T 1 * ∑ n ∈ S, ‖a n‖ + let f : ℝ → ℝ → ℂ := fun t u => densitySquareKernel χ + (densityVerticalPoint (1 / 2) t) ((1 : ℂ) + (2 * Real.pi * u : ℝ) * I) * + densityCharacterPolynomial S a χ.character (t + u) + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have hf : Continuous (Function.uncurry f) := by + exact (densitySquareKernel_vertical_continuous χ 1 (by norm_num)).mul + ((densityCharacterPolynomial_continuous S a χ.character).comp + (continuous_fst.add continuous_snd)) + have hI : ContinuousOn (fun t => ∫ u : ℝ, f t u) (Icc (-T) T) := by + apply continuousOn_of_dominated (bound := fun u => K * densityHalfGaussian u) + · intro t _ + exact (hf.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable + · intro t ht + filter_upwards with u + have hk := densitySquareKernel_common_bound χ.modulus χ.positive T 1 hT + (by norm_num) (by norm_num) χ le_rfl t u (abs_le.mpr ht) + have hp := densityCharacterPolynomial_norm S a χ.character (t + u) + dsimp [f, K] + rw [norm_mul] + calc + _ ≤ (densityKernelCost χ.modulus T 1 * densityHalfGaussian u) * + (∑ n ∈ S, ‖a n‖) := mul_le_mul hk hp (norm_nonneg _) + (mul_nonneg (densityKernelCost_pos χ.modulus χ.positive T 1 hT (by norm_num)).le + (densityHalfGaussian_pos u).le) + _ = _ := by ring + · exact densityHalfGaussian_integrable.const_mul K + · filter_upwards with u + exact (hf.comp (continuous_id.prodMk continuous_const)).continuousOn + have he (t : ℝ) : (∑ n ∈ S, + densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n) = ∫ u : ℝ, f t u := by + rw [densitySquareIntegralTerm_sum_fourier χ _ (by simp [densityVerticalPoint]) S hS 1 + (by norm_num) (by norm_num)] + apply integral_congr_ae + filter_upwards with u + rw [densityFiniteKernel, densityFiniteMellin_original_polynomial χ S hS 1 t u] + rfl + simpa only [← he] using hI + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteContourShift.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteContourShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ce9a43c4109d1123c4b39905488c3976f601d7b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteContourShift.lean @@ -0,0 +1,61 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityKernelStrip +import OAI.NumberTheory.Ostmann.ZeroDensity.GaussianContourShift + +namespace OAI + +/-! # Shifting the actual finite Dirichlet polynomial to a short positive line -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators + +noncomputable def densityFiniteMellin (S : Finset ℕ) (a : ℕ → ℂ) (w : ℂ) : ℂ := + ∑ n ∈ S, a n / (n : ℂ) ^ w + + theorem densityFiniteMellin_analytic (S : Finset ℕ) (a : ℕ → ℂ) + (hS : ∀ n ∈ S, 1 ≤ n) (w : ℂ) : AnalyticAt ℂ (densityFiniteMellin S a) w := by + apply Finset.analyticAt_fun_sum + intro n hn + have hn0 : (n : ℂ) ≠ 0 := by exact_mod_cast (by have := hS n hn; omega : n ≠ 0) + exact analyticAt_const.div ((differentiable_id.const_cpow (Or.inl hn0)).analyticAt w) + (Complex.cpow_ne_zero_iff.mpr (Or.inl hn0)) + + theorem densityFiniteMellin_norm (S : Finset ℕ) (a : ℕ → ℂ) + (hS : ∀ n ∈ S, 1 ≤ n) (w : ℂ) (hw : 0 ≤ w.re) : + ‖densityFiniteMellin S a w‖ ≤ ∑ n ∈ S, ‖a n‖ := by + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro n hn + rw [norm_div, norm_natCast_cpow_of_pos (lt_of_lt_of_le Nat.zero_lt_one (hS n hn))] + apply div_le_self (norm_nonneg _) + exact Real.one_le_rpow (by exact_mod_cast hS n hn) hw + +noncomputable def densityFiniteKernel (χ : PrimitiveComplexCharacter) (s : ℂ) + (S : Finset ℕ) (a : ℕ → ℂ) (w : ℂ) : ℂ := + densitySquareKernel χ s w * densityFiniteMellin S a w + + theorem densityFiniteKernel_shift (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (S : Finset ℕ) (a : ℕ → ℂ) (hS : ∀ n ∈ S, 1 ≤ n) + (c : ℝ) (hc : 0 < c) (hc1 : c ≤ 1) : + (∫ u : ℝ, densityFiniteKernel χ s S a ((c : ℂ) + u * I)) = + ∫ u : ℝ, densityFiniteKernel χ s S a (1 + u * I) := by + let K := Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) * + ((χ.modulus : ℝ) * (|s.im| + 2)) / c + apply gaussian_strip_vertical_eq (densityFiniteKernel χ s S a) c 1 + (K * ∑ n ∈ S, ‖a n‖) hc1 + · intro w hw hw1 + exact (densitySquareKernel_analytic χ s w hs (hc.trans_le hw)).mul + (densityFiniteMellin_analytic S a hS w) + · intro x hx u + have hk := densitySquareKernel_strip_bound χ s hs c x u hc hx.1 hx.2 + have hm := densityFiniteMellin_norm S a hS ((x : ℂ) + u * I) (by simp; linarith [hx.1]) + rw [densityFiniteKernel, norm_mul] + have h := mul_le_mul hk hm (norm_nonneg _) (by positivity) + convert h using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteIntegralEnergy.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteIntegralEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..bee2c3ecebdba275008e4f94ad25b4f6a3cfd9d6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteIntegralEnergy.lean @@ -0,0 +1,37 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityKernelLineBound + +namespace OAI + +/-! # The square of a finite contour integral at its true short-line cost -/ + +namespace Ostmann + +open Complex MeasureTheory +open scoped BigOperators + + theorem densityFiniteKernel_integral_energy (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (S : Finset ℕ) (a : ℕ → ℂ) (hS : ∀ n ∈ S, 1 ≤ n) + (c : ℝ) (hc : 0 < c) (hc1 : c ≤ 1) : + ‖∫ u : ℝ, densityFiniteKernel χ s S a ((c : ℂ) + u * I)‖ ^ 2 ≤ + (Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) * + ((χ.modulus : ℝ) * (|s.im| + 2)) ^ c / c) ^ 2 * + (∫ u : ℝ, densityHalfGaussian u) * + ∫ u : ℝ, densityHalfGaussian u * ‖densityFiniteMellin S a ((c : ℂ) + u * I)‖ ^ 2 := by + have hcont : Continuous (fun u : ℝ => ‖densityFiniteMellin S a ((c : ℂ) + u * I)‖) := by + apply Continuous.norm + apply continuous_iff_continuousAt.mpr + intro u + exact (densityFiniteMellin_analytic S a hS _).continuousAt.comp (by fun_prop) + apply density_gaussian_integral_cauchy _ _ _ (∑ n ∈ S, ‖a n‖) hcont + (fun u => norm_nonneg _) _ _ + · intro u + exact densityFiniteMellin_norm S a hS _ (by simp; linarith) + · intro u + rw [densityFiniteKernel, norm_mul] + exact mul_le_mul_of_nonneg_right (densitySquareKernel_short_line χ s hs c u hc hc1) + (norm_nonneg _) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteSeriesBridge.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteSeriesBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..e633434e741dec9b91a621fcb4e45dc20758e35e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteSeriesBridge.lean @@ -0,0 +1,56 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySquareSeriesIntegral +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFiniteContourShift + +namespace OAI + +/-! # The original divisor coefficients in each shifted finite contour -/ + +namespace Ostmann + +open Complex MeasureTheory +open scoped BigOperators + + theorem density_LSeries_term_add (a : ℕ → ℂ) (s w : ℂ) (n : ℕ) : + LSeries.term a (s + w) n = LSeries.term a s n / (n : ℂ) ^ w := by + by_cases hn : n = 0 + · subst n + simp + · have hnC : (n : ℂ) ≠ 0 := by exact_mod_cast hn + rw [LSeries.term_of_ne_zero hn, LSeries.term_of_ne_zero hn, Complex.cpow_add _ _ hnC] + ring + + theorem densityFiniteKernel_original_terms (χ : PrimitiveComplexCharacter) (s w : ℂ) + (S : Finset ℕ) : + densityFiniteKernel χ s S (fun n => LSeries.term (densitySquareCoefficient χ) s n) w = + ∑ n ∈ S, densitySquareKernel χ s w * LSeries.term (densitySquareCoefficient χ) (s + w) n := by + unfold densityFiniteKernel densityFiniteMellin + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro n _ + rw [density_LSeries_term_add] + + theorem densitySquareIntegralTerm_sum (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (S : Finset ℕ) : + (∑ n ∈ S, densitySquareIntegralTerm χ s n) = + (2 * (Real.pi : ℂ))⁻¹ * ∫ u : ℝ, + densityFiniteKernel χ s S (fun n => LSeries.term (densitySquareCoefficient χ) s n) (1 + u * I) := by + unfold densitySquareIntegralTerm + rw [← Finset.mul_sum, ← integral_finsetSum S (fun n _ => densitySquareSeriesTerm_integrable χ s hs n)] + congr 1 + apply integral_congr_ae + filter_upwards with u + exact (densityFiniteKernel_original_terms χ s (1 + u * I) S).symm + + theorem densitySquareIntegralTerm_sum_shift (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (S : Finset ℕ) (hS : ∀ n ∈ S, 1 ≤ n) + (c : ℝ) (hc : 0 < c) (hc1 : c ≤ 1) : + (∑ n ∈ S, densitySquareIntegralTerm χ s n) = + (2 * (Real.pi : ℂ))⁻¹ * ∫ u : ℝ, + densityFiniteKernel χ s S (fun n => LSeries.term (densitySquareCoefficient χ) s n) + ((c : ℂ) + u * I) := by + rw [densitySquareIntegralTerm_sum χ s hs S, + densityFiniteKernel_shift χ s hs S (fun n => LSeries.term (densitySquareCoefficient χ) s n) hS c hc hc1] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteSquareEnergy.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteSquareEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..106f054f0f7b35bfb9513e17d4c3351241fbf2ad --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteSquareEnergy.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFourierContour +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityKernelLineBound + +namespace OAI + +/-! # The original finite square sum bounded by its Gaussian polynomial energy -/ + +namespace Ostmann + +open Complex MeasureTheory +open scoped BigOperators + + theorem densityHalfGaussian_fourier_scale (u : ℝ) : + densityHalfGaussian (2 * Real.pi * u) ≤ densityHalfGaussian u := by + unfold densityHalfGaussian + apply Real.exp_le_exp.mpr + have hp : 1 ≤ (2 * Real.pi) ^ 2 := by nlinarith [Real.pi_gt_three] + have h := mul_nonneg (sub_nonneg.mpr hp) (sq_nonneg u) + nlinarith + + theorem densityFiniteSquare_energy (χ : PrimitiveComplexCharacter) + (S : Finset ℕ) (hS : ∀ n ∈ S, 1 ≤ n) (c t : ℝ) (hc : 0 < c) (hc1 : c ≤ 1) : + ‖∑ n ∈ S, densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n‖ ^ 2 ≤ + (Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) * + ((χ.modulus : ℝ) * (|(densityVerticalPoint (1 / 2) t).im| + 2)) ^ c / c) ^ 2 * + (∫ u : ℝ, densityHalfGaussian u) * ∫ u : ℝ, densityHalfGaussian u * + ‖densityCharacterPolynomial S + (densityVerticalCoeff (fun n : ℕ => (n.divisors.card : ℂ)) (1 / 2 + c)) + χ.character (t + u)‖ ^ 2 := by + let a := densityVerticalCoeff (fun n : ℕ => (n.divisors.card : ℂ)) (1 / 2 + c) + let s := densityVerticalPoint (1 / 2) t + have hs : s.re = 1 / 2 := by simp [s, densityVerticalPoint] + let M := Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) * + ((χ.modulus : ℝ) * (|s.im| + 2)) ^ c / c + have hM : 0 ≤ M := by dsimp [M]; positivity + rw [densitySquareIntegralTerm_sum_fourier χ s hs S hS c hc hc1] + have hp : Continuous (fun u : ℝ => ‖densityCharacterPolynomial S a χ.character (t + u)‖) := + (((densityCharacterPolynomial_continuous S a χ.character).comp (continuous_const.add continuous_id)).norm) + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + apply density_gaussian_integral_cauchy _ _ M (∑ n ∈ S, ‖a n‖) hp (fun _ => norm_nonneg _) + (fun u => densityCharacterPolynomial_norm S a χ.character (t + u)) + intro u + rw [densityFiniteKernel, norm_mul, densityFiniteMellin_original_polynomial χ S hS c t u] + have hk := densitySquareKernel_short_line χ s hs c (2 * Real.pi * u) hc hc1 + calc + _ ≤ (M * densityHalfGaussian (2 * Real.pi * u)) * ‖densityCharacterPolynomial S a χ.character (t + u)‖ := + mul_le_mul_of_nonneg_right hk (norm_nonneg _) + _ ≤ _ := mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left (densityHalfGaussian_fourier_scale u) hM) (norm_nonneg _) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteSquareMean.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteSquareMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e2cef77572ef07d612d45a57e0e3fc49459fa57 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFiniteSquareMean.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFiniteContinuity +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityGaussianSubset + +namespace OAI + +/-! # Mean square of an actual finite piece of the smoothed square -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators Classical + + theorem densityFiniteSquare_mean : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T c : ℝ, + 1 ≤ T → 0 < c → c ≤ 1 → ∀ S : Finset ℕ, S ⊆ Finset.Icc 1 N → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖∑ n ∈ S, densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n‖ ^ 2) ≤ + C * (densityKernelCost Q T c) ^ 2 * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * + ∑ n ∈ S, + ‖densityVerticalCoeff (fun n : ℕ => (n.divisors.card : ℂ)) (1 / 2 + c) n‖ ^ 2 := by + obtain ⟨C, hC, hb⟩ := gaussian_hybrid_primitive_subset + refine ⟨(∫ u : ℝ, densityHalfGaussian u) * C, + mul_pos densityHalfGaussian_integral_pos hC, ?_⟩ + intro N Q hQ T c hT hc hc1 S hS F hF + let a := densityVerticalCoeff (fun n : ℕ => (n.divisors.card : ℂ)) (1 / 2 + c) + let G := ∫ u : ℝ, densityHalfGaussian u + let K := densityKernelCost Q T c + have hG : 0 ≤ G := densityHalfGaussian_integral_pos.le + have hp (χ : PrimitiveComplexCharacter) : + Integrable (fun t => ∫ u : ℝ, densityHalfGaussian u * + ‖densityCharacterPolynomial S a χ.character (t + u)‖ ^ 2) + (volume.restrict (Icc (-T) T)) := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + exact (density_gaussian_character_integrable S a χ.character T).integral_prod_left + have hspos : ∀ n ∈ S, 1 ≤ n := fun n hn => (Finset.mem_Icc.mp (hS hn)).1 + have hpoint (χ : PrimitiveComplexCharacter) (hχ : χ ∈ F) (t : ℝ) (ht : t ∈ Icc (-T) T) : + ‖∑ n ∈ S, densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n‖ ^ 2 ≤ + K ^ 2 * G * ∫ u : ℝ, densityHalfGaussian u * + ‖densityCharacterPolynomial S a χ.character (t + u)‖ ^ 2 := by + apply (densityFiniteSquare_energy χ S hspos c t hc hc1).trans + apply mul_le_mul_of_nonneg_right _ (integral_nonneg (fun u => mul_nonneg (densityHalfGaussian_pos u).le (sq_nonneg _))) + apply mul_le_mul_of_nonneg_right _ hG + apply pow_le_pow_left₀ (by positivity) + exact density_kernel_cost_bound Q hQ T c hT hc χ (hF χ hχ) t (abs_le.mpr ht) + have hm : (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖∑ n ∈ S, densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n‖ ^ 2) ≤ + K ^ 2 * G * (∑ χ ∈ F, ∫ t in Icc (-T) T, ∫ u : ℝ, densityHalfGaussian u * + ‖densityCharacterPolynomial S a χ.character (t + u)‖ ^ 2) := by + rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro χ hχ + rw [← integral_const_mul] + apply integral_mono_ae + · exact (((densityFiniteSquare_continuousOn χ S hspos T hT).norm).pow 2).integrableOn_Icc + · exact (hp χ).const_mul _ + · filter_upwards [ae_restrict_mem measurableSet_Icc] with t ht + exact hpoint χ hχ t ht + apply hm.trans + have h := mul_le_mul_of_nonneg_left (hb N Q hQ T hT S hS a F hF) + (mul_nonneg (sq_nonneg K) hG) + convert h using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourier.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourier.lean new file mode 100644 index 0000000000000000000000000000000000000000..9a2a577dfe011b64f557555962bfc1364a8b8593 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourier.lean @@ -0,0 +1,114 @@ +import OAI.NumberTheory.Ostmann.Characters.CRTFourier +import OAI.NumberTheory.Ostmann.QuadraticCenter.SmallKernelQuadraticSum + +namespace OAI + +/-! # The normalized Fourier transform of the actual centered density -/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable def centeredDensity {q : ℕ} (S : Finset (ZMod q)) (x : ZMod q) : ℝ := + (if x ∈ S then 1 else 0) - (S.card : ℝ) / q + +noncomputable def densityFourier {q : ℕ} [NeZero q] (f : ZMod q → ℂ) (a : ZMod q) : ℂ := + (Real.sqrt (q : ℝ) : ℂ) * additiveFourier f a + +theorem centeredDensity_abs_le {q : ℕ} [NeZero q] (S : Finset (ZMod q)) (x : ZMod q) : + |centeredDensity S x| ≤ 1 := by + have hq : (0 : ℝ) < q := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) + have hcard : (S.card : ℝ) ≤ q := by + exact_mod_cast (show S.card ≤ q by simpa using Finset.card_le_card (Finset.subset_univ S)) + have hσ : (S.card : ℝ) / q ≤ 1 := (div_le_one hq).mpr hcard + have hσ0 : 0 ≤ (S.card : ℝ) / q := by positivity + unfold centeredDensity + split <;> rw [abs_le] <;> constructor <;> linarith + +theorem centeredDensity_sum {q : ℕ} [NeZero q] (S : Finset (ZMod q)) : + ∑ x : ZMod q, centeredDensity S x = 0 := by + classical + have hq : (q : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne q + unfold centeredDensity + rw [Finset.sum_sub_distrib] + have hsum : (∑ x : ZMod q, if x ∈ S then (1 : ℝ) else 0) = S.card := by simp + rw [hsum] + simp only [Finset.sum_const, Finset.card_univ, ZMod.card, nsmul_eq_mul] + field_simp + ring + +theorem densityFourier_energy {q : ℕ} [NeZero q] (f : ZMod q → ℂ) : + (∑ a : ZMod q, ‖densityFourier f a‖ ^ 2) = ∑ x : ZMod q, ‖f x‖ ^ 2 := by + have hq : (q : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne q + simp only [densityFourier, norm_mul, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (Real.sqrt_nonneg _), mul_pow, Real.sq_sqrt (Nat.cast_nonneg q)] + rw [← Finset.mul_sum, additiveFourier_parseval, ← mul_assoc, mul_inv_cancel₀ hq, one_mul] + +theorem densityFourier_energy_le {q : ℕ} [NeZero q] (f : ZMod q → ℂ) + (hf : ∀ x, ‖f x‖ ≤ 1) : (∑ a : ZMod q, ‖densityFourier f a‖ ^ 2) ≤ q := by + rw [densityFourier_energy] + calc + _ ≤ ∑ _x : ZMod q, (1 : ℝ) := Finset.sum_le_sum (fun x _ => by + simpa using pow_le_pow_left₀ (norm_nonneg _) (hf x) 2) + _ = _ := by simp + +theorem densityFourier_centered_zero {q : ℕ} [NeZero q] (S : Finset (ZMod q)) : + densityFourier (fun x => (centeredDensity S x : ℂ)) 0 = 0 := by + simp only [densityFourier, additiveFourier_apply, mul_zero, neg_zero, AddChar.map_zero_eq_one, mul_one] + have hsum : (∑ x : ZMod q, (centeredDensity S x : ℂ)) = 0 := by + rw [← Complex.ofReal_sum, centeredDensity_sum, Complex.ofReal_zero] + rw [hsum, mul_zero, mul_zero] + +theorem densityFourier_centered_energy {q : ℕ} [NeZero q] (S : Finset (ZMod q)) : + (∑ a : ZMod q, ‖densityFourier (fun x => (centeredDensity S x : ℂ)) a‖ ^ 2) ≤ q := by + apply densityFourier_energy_le + intro x + simpa only [Complex.norm_real, Real.norm_eq_abs] using centeredDensity_abs_le S x + +/-- Probability-normalized CRT Fourier factorization remains exact after +multiplication by the square root of the modulus. -/ +theorem densityFourier_crt {m n : ℕ} [NeZero m] [NeZero n] + (h : m.Coprime n) (f : ZMod m → ℂ) (g : ZMod n → ℂ) (u : ZMod (m * n)) : + densityFourier (fun x => f ((ZMod.chineseRemainder h) x).1 * + g ((ZMod.chineseRemainder h) x).2) u = + densityFourier f ((n : ZMod m)⁻¹ * ((ZMod.chineseRemainder h) u).1) * + densityFourier g ((m : ZMod n)⁻¹ * ((ZMod.chineseRemainder h) u).2) := by + simp only [densityFourier, additiveFourier_crt h f g u, Nat.cast_mul, + Real.sqrt_mul (Nat.cast_nonneg m), Complex.ofReal_mul] + ring + +/-- Each local centered Fourier transform vanishes at zero. The CRT product +therefore vanishes at every nonunit of the composite modulus. -/ +theorem densityFourier_crt_nonunit {m n : ℕ} [NeZero m] [NeZero n] + (h : m.Coprime n) (f : ZMod m → ℂ) (g : ZMod n → ℂ) + (hf : ∀ x, ¬IsUnit x → densityFourier f x = 0) + (hg : ∀ x, ¬IsUnit x → densityFourier g x = 0) + (u : ZMod (m * n)) (hu : ¬IsUnit u) : + densityFourier (fun x => f ((ZMod.chineseRemainder h) x).1 * + g ((ZMod.chineseRemainder h) x).2) u = 0 := by + rw [densityFourier_crt] + by_cases h₁ : IsUnit ((n : ZMod m)⁻¹ * ((ZMod.chineseRemainder h) u).1) + · have h₂ : ¬IsUnit ((m : ZMod n)⁻¹ * ((ZMod.chineseRemainder h) u).2) := by + intro h₂ + have ha := isUnit_of_mul_isUnit_right h₁ + have hb := isUnit_of_mul_isUnit_right h₂ + obtain ⟨a, ha⟩ := ha.exists_right_inv + obtain ⟨b, hb⟩ := hb.exists_right_inv + have he : IsUnit ((ZMod.chineseRemainder h) u) := + IsUnit.of_mul_eq_one (a, b) (Prod.ext ha hb) + have hh := he.map (ZMod.chineseRemainder h).symm.toMonoidHom + change IsUnit ((ZMod.chineseRemainder h).symm ((ZMod.chineseRemainder h) u)) at hh + exact hu (by simpa only [RingEquiv.symm_apply_apply] using hh) + rw [hg _ h₂, mul_zero] + · rw [hf _ h₁, zero_mul] + +/-- This supplies the local hypotheses for every prime factor of `L`. -/ +theorem densityFourier_centered_prime_nonunit {p : ℕ} [Fact p.Prime] + (S : Finset (ZMod p)) (x : ZMod p) (hx : ¬IsUnit x) : + densityFourier (fun y => (centeredDensity S y : ℂ)) x = 0 := by + have hx0 : x = 0 := by simpa only [isUnit_iff_ne_zero, not_not] using hx + rw [hx0, densityFourier_centered_zero] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierBounds.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..d0b88282538108ca69e10f1a56cfce31c4e26bbc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierBounds.lean @@ -0,0 +1,92 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityCRTProduct +import OAI.NumberTheory.Ostmann.Characters.AffineAction +import OAI.NumberTheory.Ostmann.Preliminaries.TestFunctions + +namespace OAI + +/-! # The two local Fourier bounds in the large-kernel correlation -/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +theorem additiveFourier_twice {q : ℕ} [NeZero q] (f : ZMod q → ℂ) (a : ZMod q) : + additiveFourier (additiveFourier f) a = (q : ℂ)⁻¹ * f (-a) := by + rw [additiveFourier_apply] + congr 1 + have hi := additiveFourier_inversion f (-a) + simpa only [mul_neg] using hi.symm + +/-- A prime occurring in exactly one of the divisors costs `q^(-1/2)`. -/ +theorem densityFourier_coefficient_le {q : ℕ} [NeZero q] (f : ZMod q → ℂ) + (hf : ∀ x, ‖f x‖ ≤ 1) (a : ZMod q) : + ‖additiveFourier (densityFourier f) a‖ ≤ (Real.sqrt (q : ℝ))⁻¹ := by + have hq : (0 : ℝ) < q := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) + have hs : 0 < Real.sqrt (q : ℝ) := Real.sqrt_pos.mpr hq + have hs2 := Real.sq_sqrt hq.le + change ‖additiveFourier (fun x => (Real.sqrt (q : ℝ) : ℂ) * additiveFourier f x) a‖ ≤ _ + rw [additiveFourier_const_mul, additiveFourier_twice, norm_mul, norm_mul, norm_inv, + Complex.norm_natCast, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hs] + calc + _ ≤ Real.sqrt (q : ℝ) * ((q : ℝ)⁻¹ * 1) := + mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (hf (-a)) (by positivity)) hs.le + _ = _ := by field_simp; nlinarith + +/-- Unit dilations preserve the local coefficient bound. -/ +theorem densityFourier_unit_coefficient_le {q : ℕ} [NeZero q] + (f : ZMod q → ℂ) (hf : ∀ x, ‖f x‖ ≤ 1) (a : (ZMod q)ˣ) (u : ZMod q) : + ‖additiveFourier (fun x => densityFourier f ((a : ZMod q) * x)) u‖ ≤ (Real.sqrt (q : ℝ))⁻¹ := by + rw [additiveFourier_unit_mul] + exact densityFourier_coefficient_le f hf _ + +/-- At a common prime, the product costs only one, by Cauchy--Schwarz. -/ +theorem additiveFourier_cross_le_one {q : ℕ} [NeZero q] + (f g : ZMod q → ℂ) (hf : (∑ x, ‖f x‖ ^ 2) ≤ q) + (hg : (∑ x, ‖g x‖ ^ 2) ≤ q) (u : ZMod q) : + ‖additiveFourier (fun x => f x * conj (g x)) u‖ ≤ 1 := by + have hq : (0 : ℝ) < q := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) + have hS : 0 ≤ ∑ x : ZMod q, ‖f x‖ * ‖g x‖ := Finset.sum_nonneg (fun _ _ => by positivity) + have hcs := Finset.sum_mul_sq_le_sq_mul_sq (Finset.univ : Finset (ZMod q)) + (fun x => ‖f x‖) (fun x => ‖g x‖) + have he : (∑ x : ZMod q, ‖f x‖ * ‖g x‖) ≤ q := by + have hb := mul_le_mul hf hg (by positivity : 0 ≤ ∑ x : ZMod q, ‖g x‖ ^ 2) hq.le + nlinarith + rw [additiveFourier_apply, norm_mul, norm_inv, Complex.norm_natCast] + calc + _ ≤ (q : ℝ)⁻¹ * ∑ x : ZMod q, ‖f x‖ * ‖g x‖ := by + apply mul_le_mul_of_nonneg_left _ (inv_nonneg.mpr hq.le) + apply (norm_sum_le _ _).trans_eq + apply Finset.sum_congr rfl + intro x hx + simp only [norm_mul, Complex.norm_conj] + have hn : ‖ZMod.stdAddChar (-(x * u))‖ = 1 := by simp [ZMod.stdAddChar_apply] + rw [hn, mul_one] + _ ≤ (q : ℝ)⁻¹ * q := mul_le_mul_of_nonneg_left he (inv_nonneg.mpr hq.le) + _ = 1 := inv_mul_cancel₀ hq.ne' + +/-- Conjugation reverses the Fourier frequency. -/ +theorem additiveFourier_conj {q : ℕ} [NeZero q] (f : ZMod q → ℂ) (a : ZMod q) : + additiveFourier (fun x => conj (f x)) a = conj (additiveFourier f (-a)) := by + simp only [additiveFourier_apply, map_mul, map_sum, map_inv₀, map_natCast, + stdAddChar_conj, mul_neg, neg_neg] + +/-- Unit dilations preserve the counting-measure energy. -/ +theorem unit_dilation_energy {q : ℕ} [NeZero q] (f : ZMod q → ℂ) (a : (ZMod q)ˣ) : + (∑ x : ZMod q, ‖f ((a : ZMod q) * x)‖ ^ 2) = ∑ x : ZMod q, ‖f x‖ ^ 2 := + (Units.mulLeft a).bijective.sum_comp (fun x : ZMod q => ‖f x‖ ^ 2) + +/-- The common-prime factor of the original density correlation. -/ +theorem densityFourier_unit_cross_le_one {q : ℕ} [NeZero q] + (f g : ZMod q → ℂ) (hf : ∀ x, ‖f x‖ ≤ 1) (hg : ∀ x, ‖g x‖ ≤ 1) + (a b : (ZMod q)ˣ) (u : ZMod q) : + ‖additiveFourier (fun x => densityFourier f ((a : ZMod q) * x) * + conj (densityFourier g ((b : ZMod q) * x))) u‖ ≤ 1 := by + apply additiveFourier_cross_le_one + · rw [unit_dilation_energy] + exact densityFourier_energy_le f hf + · rw [unit_dilation_energy] + exact densityFourier_energy_le g hg + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierContour.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierContour.lean new file mode 100644 index 0000000000000000000000000000000000000000..abe1e773a597d57058aebbe84f5d276c59c38c30 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierContour.lean @@ -0,0 +1,52 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFiniteSeriesBridge +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityGaussianFubini +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityVerticalPolynomial + +namespace OAI + +/-! # The exact Fourier scaling of the original finite contour sums -/ + +namespace Ostmann + +open Complex MeasureTheory +open scoped BigOperators + + theorem density_fourier_integral_scale (f : ℝ → ℂ) : + (2 * (Real.pi : ℂ))⁻¹ * (∫ u : ℝ, f u) = ∫ u : ℝ, f (2 * Real.pi * u) := by + rw [Measure.integral_comp_mul_left f (2 * Real.pi), + abs_of_pos (inv_pos.mpr (mul_pos (by norm_num) Real.pi_pos))] + simp only [Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_mul, Complex.ofReal_ofNat] + + theorem densitySquareIntegralTerm_sum_fourier (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (S : Finset ℕ) (hS : ∀ n ∈ S, 1 ≤ n) + (c : ℝ) (hc : 0 < c) (hc1 : c ≤ 1) : + (∑ n ∈ S, densitySquareIntegralTerm χ s n) = + ∫ u : ℝ, densityFiniteKernel χ s S (fun n => LSeries.term (densitySquareCoefficient χ) s n) + ((c : ℂ) + (2 * Real.pi * u : ℝ) * I) := by + rw [densitySquareIntegralTerm_sum_shift χ s hs S hS c hc hc1, + density_fourier_integral_scale] + + theorem densityFiniteMellin_original_polynomial (χ : PrimitiveComplexCharacter) + (S : Finset ℕ) (hS : ∀ n ∈ S, 1 ≤ n) (c t u : ℝ) : + densityFiniteMellin S (fun n => LSeries.term (densitySquareCoefficient χ) + (densityVerticalPoint (1 / 2) t) n) ((c : ℂ) + (2 * Real.pi * u : ℝ) * I) = + densityCharacterPolynomial S + (densityVerticalCoeff (fun n : ℕ => (n.divisors.card : ℂ)) (1 / 2 + c)) + χ.character (t + u) := by + unfold densityFiniteMellin densityCharacterPolynomial + apply Finset.sum_congr rfl + intro n hn + rw [← density_LSeries_term_add] + have hp : 0 < n := lt_of_lt_of_le Nat.zero_lt_one (hS n hn) + have he : densityVerticalPoint (1 / 2) t + ((c : ℂ) + (2 * Real.pi * u : ℝ) * I) = + densityVerticalPoint (1 / 2 + c) (t + u) := by + unfold densityVerticalPoint + push_cast + ring + rw [he, LSeries.term_of_ne_zero hp.ne', density_vertical_term _ _ _ n hp] + unfold densitySquareCoefficient densityVerticalCoeff + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierProduct.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..868a81c3ded5706f314d6290d8afec78358695b2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierProduct.lean @@ -0,0 +1,103 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityCorrelation + +namespace OAI + +/-! # Identifying the original density transform with its local prime factors -/ + +namespace Ostmann + +open scoped BigOperators + +private theorem intCast_isUnit_of_dvd {d q : ℕ} (hd : d ∣ q) (j : ℤ) + (hj : IsUnit (j : ZMod q)) : IsUnit (j : ZMod d) := by + simpa only [map_intCast] using hj.map (ZMod.castHom hd (ZMod d)) + +/-- The multipliers produced by CRT are genuine units; they may be absorbed +in the local arguments without imposing a new hypothesis on the density. -/ +theorem densityFourier_primeCRTFunction (ps : List ℕ) + (hp : ∀ p ∈ ps, p.Prime) (hc : ps.Pairwise Nat.Coprime) + (f : ∀ p : ℕ, ZMod p → ℂ) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + ∃ a : ∀ p : ℕ, (ZMod p)ˣ, ∀ n : ℤ, + densityFourier (primeCRTFunction ps hp hc f) (n : ZMod ps.prod) = + (ps.map fun p => primeDensityFourier f p ((a p : ZMod p) * (n : ZMod p))).prod := by + classical + induction ps with + | nil => + refine ⟨fun _ => 1, ?_⟩ + intro n + change densityFourier (fun _ : ZMod 1 => (1 : ℂ)) (n : ZMod 1) = 1 + simp only [densityFourier, additiveFourier_apply, Nat.cast_one, Real.sqrt_one, + Complex.ofReal_one, inv_one, one_mul, Finset.univ_unique, Finset.sum_singleton] + exact (congrArg ZMod.stdAddChar (Subsingleton.elim _ (0 : ZMod 1))).trans + (AddChar.map_zero_eq_one _) + | cons p ps ih => + have hp' : ∀ q ∈ ps, q.Prime := fun q hq => hp q (List.mem_cons_of_mem p hq) + have hcp := List.pairwise_cons.mp hc + let : NeZero p := ⟨(hp p List.mem_cons_self).ne_zero⟩ + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp').ne'⟩ + obtain ⟨b, hb⟩ := ih hp' hcp.2 + have hv : IsUnit (ps.prod : ZMod p) := + (ZMod.isUnit_iff_coprime ps.prod p).mpr + (Nat.coprime_list_prod_right_iff.mpr hcp.1).symm + let v : (ZMod p)ˣ := hv.unit⁻¹ + have hvval : (v : ZMod p) = (ps.prod : ZMod p)⁻¹ := by + change (hv.unit⁻¹ : (ZMod p)ˣ).val = _ + rw [← ZMod.inv_coe_unit, IsUnit.unit_spec] + have hu : IsUnit (p : ZMod ps.prod) := + (ZMod.isUnit_iff_coprime p ps.prod).mpr (Nat.coprime_list_prod_right_iff.mpr hcp.1) + let u : (ZMod ps.prod)ˣ := hu.unit⁻¹ + have huval : (u : ZMod ps.prod) = (p : ZMod ps.prod)⁻¹ := by + change (hu.unit⁻¹ : (ZMod ps.prod)ˣ).val = _ + rw [← ZMod.inv_coe_unit, IsUnit.unit_spec] + obtain ⟨j, hj⟩ := ZMod.intCast_surjective (u : ZMod ps.prod) + have hjunit : IsUnit (j : ZMod ps.prod) := hj ▸ u.isUnit + let c : ∀ q : ℕ, (ZMod q)ˣ := fun q => + if hq : q ∈ ps then (intCast_isUnit_of_dvd (List.dvd_prod hq) j hjunit).unit else 1 + have hcval (q : ℕ) (hq : q ∈ ps) : (c q : ZMod q) = (j : ZMod q) := by + simp only [c, dite_eq_left hq, IsUnit.unit_spec] + have hne (q : ℕ) (hq : q ∈ ps) : q ≠ p := by + intro he + subst q + have hh := hcp.1 p hq + have hh1 : p = 1 := by simpa [Nat.Coprime] using hh + exact (hp p List.mem_cons_self).ne_one hh1 + let a : ∀ q : ℕ, (ZMod q)ˣ := Function.update (fun q => b q * c q) p v + refine ⟨a, ?_⟩ + intro n + change densityFourier (fun x : ZMod (p * ps.prod) => + f p ((ZMod.chineseRemainder (Nat.coprime_list_prod_right_iff.mpr hcp.1)) x).1 * + primeCRTFunction ps hp' hcp.2 f + ((ZMod.chineseRemainder (Nat.coprime_list_prod_right_iff.mpr hcp.1)) x).2) + (n : ZMod (p * ps.prod)) = _ + rw [densityFourier_crt (m := p) (n := ps.prod), map_intCast] + change densityFourier (f p) ((ps.prod : ZMod p)⁻¹ * (n : ZMod p)) * + densityFourier (primeCRTFunction ps hp' hcp.2 f) + ((p : ZMod ps.prod)⁻¹ * (n : ZMod ps.prod)) = _ + rw [← huval, ← hj, ← Int.cast_mul, hb (j * n)] + simp only [List.map_cons, List.prod_cons] + congr 1 + · rw [primeDensityFourier_eq] + simp only [a, Function.update_self, hvval] + · apply congrArg List.prod + apply List.map_congr_left + intro q hq + have haq : a q = b q * c q := Function.update_of_ne (hne q hq) _ _ + rw [haq, Units.val_mul, hcval q hq, Int.cast_mul, mul_assoc] + +/-- The recursively formed CRT density is exactly the product of the +centered functions in the manuscript. -/ +theorem densityCRTList_value_eq_primeCRTFunction (ps : List ℕ) + (hp : ∀ p ∈ ps, p.Prime) (hc : ps.Pairwise Nat.Coprime) + (S : ∀ p : ℕ, Finset (ZMod p)) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + (densityCRTList ps hp hc S).value = + primeCRTFunction ps hp hc (fun p x => (centeredDensity (S p) x : ℂ)) := by + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + funext x + obtain ⟨n, rfl⟩ := ZMod.intCast_surjective x + rw [densityCRTList_intCast, primeCRTFunction_intCast] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierUnitProduct.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierUnitProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c1f49fe176948882a0d64a99e54ac61d98d3139 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourierUnitProduct.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFourierProduct + +namespace OAI + +/-! # The local factorization after the scalar multipliers in the quadratic sum -/ + +namespace Ostmann + +open scoped BigOperators + +theorem densityFourier_primeCRTFunction_unit (ps : List ℕ) + (hp : ∀ p ∈ ps, p.Prime) (hc : ps.Pairwise Nat.Coprime) + (f : ∀ p : ℕ, ZMod p → ℂ) (v : (ZMod ps.prod)ˣ) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + ∃ a : ∀ p : ℕ, (ZMod p)ˣ, ∀ n : ℤ, + densityFourier (primeCRTFunction ps hp hc f) ((v : ZMod ps.prod) * (n : ZMod ps.prod)) = + (ps.map fun p => primeDensityFourier f p ((a p : ZMod p) * (n : ZMod p))).prod := by + classical + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + obtain ⟨b, hb⟩ := densityFourier_primeCRTFunction ps hp hc f + obtain ⟨j, hj⟩ := ZMod.intCast_surjective (v : ZMod ps.prod) + let c : ∀ p : ℕ, (ZMod p)ˣ := fun p => if h : p ∈ ps then + Units.map (ZMod.castHom (List.dvd_prod h) (ZMod p)).toMonoidHom v else 1 + have hcv (p : ℕ) (h : p ∈ ps) : (c p : ZMod p) = (j : ZMod p) := by + simp only [c, dite_eq_left h, Units.coe_map] + change (ZMod.castHom (List.dvd_prod h) (ZMod p)) (v : ZMod ps.prod) = _ + rw [← hj, map_intCast] + refine ⟨fun p => b p * c p, ?_⟩ + intro n + rw [← hj, ← Int.cast_mul, hb] + apply congrArg List.prod + apply List.map_congr_left + intro p h + rw [Units.val_mul, hcv p h, Int.cast_mul, mul_assoc] + +theorem densityFourier_centered_unit_product (ps : List ℕ) + (hp : ∀ p ∈ ps, p.Prime) (hc : ps.Pairwise Nat.Coprime) + (S : ∀ p : ℕ, Finset (ZMod p)) (v : (ZMod ps.prod)ˣ) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + ∃ a : ∀ p : ℕ, (ZMod p)ˣ, ∀ n : ℤ, + densityFourier (densityCRTList ps hp hc S).value ((v : ZMod ps.prod) * (n : ZMod ps.prod)) = + (ps.map fun p => primeDensityFourier (fun p x => (centeredDensity (S p) x : ℂ)) p + ((a p : ZMod p) * (n : ZMod p))).prod := by + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + rw [densityCRTList_value_eq_primeCRTFunction] + exact densityFourier_primeCRTFunction_unit ps hp hc _ v + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourthMoment.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourthMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..67aee3c7e1d1725ddd43cbb869f1ebc6460fdd61 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityFourthMoment.lean @@ -0,0 +1,61 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySmoothedMean +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySquareConjugation +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityMomentCutoff + +namespace OAI + +/-! # The actual primitive-character fourth moment for the density argument -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators Classical + + theorem density_L_fourth_integrable (χ : PrimitiveComplexCharacter) (T : ℝ) : + Integrable (fun t => ‖χ.L (densityVerticalPoint (1 / 2) t)‖ ^ 4) + (volume.restrict (Icc (-T) T)) := by + have hL : Continuous χ.L := continuous_iff_continuousAt.mpr (fun z => (χ.L_analytic z).continuousAt) + have hs : Continuous (fun t : ℝ => densityVerticalPoint (1 / 2) t) := by + unfold densityVerticalPoint + fun_prop + exact (((hL.comp hs).norm.pow 4).continuousOn).integrableOn_Icc + + theorem density_fourth_moment : + ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 2 ≤ T → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖χ.L (densityVerticalPoint (1 / 2) t)‖ ^ 4) ≤ + C * ((Q : ℝ) ^ 2 * T) * (Real.log ((Q : ℝ) * T)) ^ 6 := by + obtain ⟨C, hC, hb⟩ := densitySmoothedSquare_mean + refine ⟨4 * C * 17 * 5 ^ 6, by positivity, ?_⟩ + intro Q hQ T hT F hF + obtain ⟨N, hN, hL, hscale, hsize, hlog⟩ := density_moment_cutoff Q hQ T hT + obtain ⟨hi, hm⟩ := hb N Q hN hQ T (by linarith) hL hscale F hF + have hfirst : (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖χ.L (densityVerticalPoint (1 / 2) t)‖ ^ 4) ≤ + 4 * (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖densitySmoothedSquare χ (densityVerticalPoint (1 / 2) t)‖ ^ 2) := by + rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro χ hχ + rw [← integral_const_mul] + apply integral_mono (density_L_fourth_integrable χ T) ((hi χ hχ).const_mul 4) + intro t + exact density_L_fourth_single_bound χ _ (by simp [densityVerticalPoint]) + have hlog0 : 0 ≤ Real.log ((Q : ℝ) * T) := by + apply Real.log_nonneg + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + nlinarith + calc + _ ≤ 4 * (C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * (Real.log N) ^ 6) := + hfirst.trans (mul_le_mul_of_nonneg_left hm (by norm_num)) + _ ≤ 4 * (C * (17 * ((Q : ℝ) ^ 2 * T)) * + (5 * Real.log ((Q : ℝ) * T)) ^ 6) := by + apply mul_le_mul_of_nonneg_left _ (by norm_num) + apply mul_le_mul _ (pow_le_pow_left₀ (by linarith) hlog 6) (by positivity) (by positivity) + exact mul_le_mul_of_nonneg_left (by simpa only [mul_assoc] using hsize) hC.le + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianCauchy.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianCauchy.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e9b2a985973feffea3861be7de4e642c7985720 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianCauchy.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityWeightedCauchy + +namespace OAI + +/-! # Weighted square bounds for the Gaussian contour integral -/ + +namespace Ostmann + +open MeasureTheory + +noncomputable def densityHalfGaussian (u : ℝ) : ℝ := Real.exp (-(u ^ 2) / 2) + + theorem densityHalfGaussian_integrable : Integrable densityHalfGaussian := by + convert integrable_exp_neg_mul_sq (b := (1 / 2 : ℝ)) (by norm_num) using 1 + funext u + unfold densityHalfGaussian + congr 1 + ring + + theorem densityHalfGaussian_pos (u : ℝ) : 0 < densityHalfGaussian u := Real.exp_pos _ + + theorem densityHalfGaussian_continuous : Continuous densityHalfGaussian := by + unfold densityHalfGaussian + fun_prop + + theorem densityHalfGaussian_integral_pos : 0 < ∫ u, densityHalfGaussian u := + integral_exp_pos densityHalfGaussian_integrable + + theorem density_gaussian_integral_cauchy (f : ℝ → ℂ) (p : ℝ → ℝ) (M A : ℝ) + (hp : Continuous p) (hp0 : ∀ u, 0 ≤ p u) (hpA : ∀ u, p u ≤ A) + (hb : ∀ u, ‖f u‖ ≤ M * densityHalfGaussian u * p u) : + ‖∫ u, f u‖ ^ 2 ≤ M ^ 2 * (∫ u, densityHalfGaussian u) * + ∫ u, densityHalfGaussian u * (p u) ^ 2 := by + have hg := densityHalfGaussian_integrable + have hc := densityHalfGaussian_continuous + have hA : 0 ≤ A := (hp0 0).trans (hpA 0) + have hgp : Integrable (fun u => densityHalfGaussian u * p u) := by + apply (hg.const_mul A).mono' (hc.mul hp).aestronglyMeasurable + filter_upwards with u + simp only [Pi.mul_apply] + rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (densityHalfGaussian_pos u).le (hp0 u))] + nlinarith [densityHalfGaussian_pos u, hpA u] + have hgpp : Integrable (fun u => densityHalfGaussian u * (p u) ^ 2) := by + apply (hg.const_mul (A ^ 2)).mono' (hc.mul (hp.pow 2)).aestronglyMeasurable + filter_upwards with u + simp only [Pi.mul_apply, Pi.pow_apply] + rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (densityHalfGaussian_pos u).le (sq_nonneg _))] + have hh := pow_le_pow_left₀ (hp0 u) (hpA u) 2 + nlinarith [densityHalfGaussian_pos u] + have hn : ‖∫ u, f u‖ ≤ M * ∫ u, densityHalfGaussian u * p u := by + rw [← integral_const_mul] + apply norm_integral_le_of_norm_le (hgp.const_mul M) + filter_upwards with u + simpa only [mul_assoc] using hb u + have hs := density_weighted_cauchy densityHalfGaussian p hg hgp hgpp + (fun u => (densityHalfGaussian_pos u).le) densityHalfGaussian_integral_pos + calc + _ ≤ (M * ∫ u, densityHalfGaussian u * p u) ^ 2 := + pow_le_pow_left₀ (norm_nonneg _) hn 2 + _ = M ^ 2 * (∫ u, densityHalfGaussian u * p u) ^ 2 := mul_pow _ _ _ + _ ≤ M ^ 2 * ((∫ u, densityHalfGaussian u) * ∫ u, densityHalfGaussian u * (p u) ^ 2) := + mul_le_mul_of_nonneg_left hs (sq_nonneg M) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianEnvelope.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianEnvelope.lean new file mode 100644 index 0000000000000000000000000000000000000000..d7820226352e3e0fa7d7f4bd470a8b9311a039ab --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianEnvelope.lean @@ -0,0 +1,82 @@ +import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySquareGaussian +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityCompletedStrip + +namespace OAI + +/-! # An integrable envelope for the completed-square contour -/ + +namespace Ostmann + +open Complex Filter MeasureTheory +open scoped Topology + +noncomputable def densityGaussianEnvelope (u : ℝ) : ℝ := (1 + u ^ 2) * Real.exp (-(u ^ 2)) + + theorem densityGaussianEnvelope_nonneg (u : ℝ) : 0 ≤ densityGaussianEnvelope u := by + unfold densityGaussianEnvelope + positivity + + theorem densityGaussianEnvelope_integrable : Integrable densityGaussianEnvelope := by + have h0 := integrable_exp_neg_mul_sq (b := (1 : ℝ)) (by norm_num) + have h2 := integrable_rpow_mul_exp_neg_mul_sq (b := (1 : ℝ)) (by norm_num) + (s := (2 : ℝ)) (by norm_num) + convert h0.add h2 using 1 + funext u + simp only [densityGaussianEnvelope, Real.rpow_two, neg_mul, one_mul, add_mul, Pi.add_apply] + + theorem densityGaussianEnvelope_tendsto : + Tendsto densityGaussianEnvelope atTop (𝓝 0) := by + have hp : Tendsto (fun t : ℝ => t ^ 2) atTop atTop := + tendsto_pow_atTop (by norm_num : (2 : ℕ) ≠ 0) + have h0 := Real.tendsto_exp_neg_atTop_nhds_zero.comp hp + have h1 := (Real.tendsto_pow_mul_exp_neg_atTop_nhds_zero 1).comp hp + convert h0.add h1 using 1 + · funext u + simp only [densityGaussianEnvelope, Function.comp_apply, pow_one, add_mul, one_mul] + · norm_num + + theorem densitySquareGaussian_band_bound (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : ∃ K : ℝ, 0 < K ∧ ∀ x u : ℝ, |x| ≤ 1 → + ‖densitySquareGaussian χ s ((x : ℂ) + u * I)‖ ≤ K * densityGaussianEnvelope u := by + obtain ⟨C, hC, hb⟩ := density_completed_square_strip_bound + let a := |s.im| + 2 + let K := C * ((χ.modulus : ℝ) + 1) ^ 6 * 2 * a ^ 2 * Real.exp 1 + have ha : 2 ≤ a := by dsimp [a]; linarith [abs_nonneg s.im] + refine ⟨K, by dsimp [K]; positivity, ?_⟩ + intro x u hx + have hz : -(1 / 2 : ℝ) ≤ (s + ((x : ℂ) + u * I)).re ∧ + (s + ((x : ℂ) + u * I)).re ≤ 3 / 2 := by + simp only [add_re, ofReal_re, mul_re, I_re, I_im, ofReal_im, mul_zero, + zero_mul, sub_self, add_zero, hs] + exact ⟨by linarith [(abs_le.mp hx).1], by linarith [(abs_le.mp hx).2]⟩ + have hi : |(s + ((x : ℂ) + u * I)).im| + 2 ≤ a + |u| := by + simp only [add_im, ofReal_im, mul_im, I_re, I_im, ofReal_re, mul_one, + zero_mul, add_zero, zero_add] + dsimp [a] + linarith [abs_add_le s.im u] + have hpoly : (|(s + ((x : ℂ) + u * I)).im| + 2) ^ 2 ≤ 2 * a ^ 2 * (1 + u ^ 2) := by + have h1 := pow_le_pow_left₀ (by positivity : 0 ≤ |(s + ((x : ℂ) + u * I)).im| + 2) hi 2 + have haa : 1 ≤ a ^ 2 := by nlinarith + have h2 := mul_nonneg (sub_nonneg.mpr haa) (sq_nonneg u) + nlinarith [sq_nonneg (a - |u|), sq_abs u] + have hexp : ‖Complex.exp (((x : ℂ) + u * I) ^ 2)‖ ≤ Real.exp 1 * Real.exp (-(u ^ 2)) := by + rw [Complex.norm_exp, ← Real.exp_add] + apply Real.exp_le_exp.mpr + have hxx : x ^ 2 ≤ 1 := by nlinarith [(abs_le.mp hx).1, (abs_le.mp hx).2] + have hre : (((x : ℂ) + u * I) ^ 2).re = x ^ 2 - u ^ 2 := by + simp [pow_two, mul_re, mul_im] + rw [hre] + linarith + rw [densitySquareGaussian, norm_mul] + calc + _ ≤ (C * ((χ.modulus : ℝ) + 1) ^ 6 * (|(s + ((x : ℂ) + u * I)).im| + 2) ^ 2) * + (Real.exp 1 * Real.exp (-(u ^ 2))) := + mul_le_mul (hb χ _ hz.1 hz.2) hexp (norm_nonneg _) (by positivity) + _ ≤ (C * ((χ.modulus : ℝ) + 1) ^ 6 * (2 * a ^ 2 * (1 + u ^ 2))) * + (Real.exp 1 * Real.exp (-(u ^ 2))) := by gcongr + _ = K * densityGaussianEnvelope u := by dsimp [K, densityGaussianEnvelope]; ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianFubini.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianFubini.lean new file mode 100644 index 0000000000000000000000000000000000000000..af2890f3be85e5c77835dd63383151ce23515efe --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianFubini.lean @@ -0,0 +1,101 @@ +import Mathlib.MeasureTheory.Integral.Prod +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityGaussianHybrid + +namespace OAI + +/-! # The Gaussian and height integrals for actual character polynomials -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators Classical + +noncomputable def densityCharacterPolynomial {q : ℕ} (S : Finset ℕ) (a : ℕ → ℂ) + (χ : DirichletCharacter ℂ q) (t : ℝ) : ℂ := + ∑ n ∈ S, a n * χ (n : ZMod q) * realAdditivePhase (-(Real.log n * t)) + + theorem densityCharacterPolynomial_continuous {q : ℕ} (S : Finset ℕ) (a : ℕ → ℂ) + (χ : DirichletCharacter ℂ q) : Continuous (densityCharacterPolynomial S a χ) := by + unfold densityCharacterPolynomial realAdditivePhase + fun_prop + + theorem densityCharacterPolynomial_norm {q : ℕ} [NeZero q] (S : Finset ℕ) (a : ℕ → ℂ) + (χ : DirichletCharacter ℂ q) (t : ℝ) : + ‖densityCharacterPolynomial S a χ t‖ ≤ ∑ n ∈ S, ‖a n‖ := by + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro n _ + rw [norm_mul, norm_mul, norm_realAdditivePhase, mul_one] + exact mul_le_of_le_one_right (norm_nonneg _) (χ.norm_le_one _) + + theorem density_gaussian_character_integrable {q : ℕ} [NeZero q] (S : Finset ℕ) + (a : ℕ → ℂ) (χ : DirichletCharacter ℂ q) (T : ℝ) : + Integrable (fun z : ℝ × ℝ => densityHalfGaussian z.2 * + ‖densityCharacterPolynomial S a χ (z.1 + z.2)‖ ^ 2) + ((volume.restrict (Icc (-T) T)).prod volume) := by + let μ := volume.restrict (Icc (-T) T) + have : IsFiniteMeasure μ := by dsimp [μ]; infer_instance + have hbase : Integrable (fun z : ℝ × ℝ => densityHalfGaussian z.2) (μ.prod volume) := by + simpa only [one_mul] using (integrable_const (1 : ℝ) (μ := μ)).mul_prod densityHalfGaussian_integrable + have hc : Continuous (fun z : ℝ × ℝ => densityHalfGaussian z.2 * + ‖densityCharacterPolynomial S a χ (z.1 + z.2)‖ ^ 2) := by + exact (densityHalfGaussian_continuous.comp continuous_snd).mul + (((densityCharacterPolynomial_continuous S a χ).comp (continuous_fst.add continuous_snd)).norm.pow 2) + apply (hbase.const_mul ((∑ n ∈ S, ‖a n‖) ^ 2)).mono' hc.aestronglyMeasurable + filter_upwards with z + rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (densityHalfGaussian_pos z.2).le (sq_nonneg _))] + have h := pow_le_pow_left₀ (norm_nonneg _) (densityCharacterPolynomial_norm S a χ (z.1 + z.2)) 2 + nlinarith [densityHalfGaussian_pos z.2] + + theorem density_gaussian_character_fubini {q : ℕ} [NeZero q] (S : Finset ℕ) + (a : ℕ → ℂ) (χ : DirichletCharacter ℂ q) (T : ℝ) : + (∫ t in Icc (-T) T, ∫ u : ℝ, densityHalfGaussian u * + ‖densityCharacterPolynomial S a χ (t + u)‖ ^ 2) = + ∫ u : ℝ, densityHalfGaussian u * ∫ t in Icc (-T) T, + ‖densityCharacterPolynomial S a χ (t + u)‖ ^ 2 := by + rw [integral_integral_swap (density_gaussian_character_integrable S a χ T)] + apply integral_congr_ae + filter_upwards with u + rw [integral_const_mul] + + theorem gaussian_hybrid_mean : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + ∀ a : ℕ → ℂ, ∀ F : (q : ℕ) → Finset (DirichletCharacter ℂ q), + (∀ q ∈ Finset.Icc 1 Q, ∀ χ ∈ F q, χ.IsPrimitive) → + (∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, + ∫ t in Icc (-T) T, ∫ u : ℝ, densityHalfGaussian u * + ‖densityCharacterPolynomial (Finset.Icc 1 N) a χ (t + u)‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 := by + obtain ⟨C, hC, hb⟩ := gaussian_hybrid_multiplicative_large_sieve + refine ⟨C, hC, ?_⟩ + intro N Q hQ T hT a F hF + have hi (q : ℕ) (hq : q ∈ Finset.Icc 1 Q) (χ : DirichletCharacter ℂ q) : + Integrable (fun u : ℝ => densityHalfGaussian u * ∫ t in Icc (-T) T, + ‖densityCharacterPolynomial (Finset.Icc 1 N) a χ (t + u)‖ ^ 2) := by + let : NeZero q := ⟨by have := (Finset.mem_Icc.mp hq).1; omega⟩ + have h := (density_gaussian_character_integrable (Finset.Icc 1 N) a χ T).integral_prod_right + simpa only [integral_const_mul] using h + calc + _ = ∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, + ∫ u : ℝ, densityHalfGaussian u * ∫ t in Icc (-T) T, + ‖densityCharacterPolynomial (Finset.Icc 1 N) a χ (t + u)‖ ^ 2 := by + apply Finset.sum_congr rfl + intro q hq + let : NeZero q := ⟨by have := (Finset.mem_Icc.mp hq).1; omega⟩ + apply Finset.sum_congr rfl + intro χ _ + exact density_gaussian_character_fubini (Finset.Icc 1 N) a χ T + _ = ∫ u : ℝ, densityHalfGaussian u * + (∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, ∫ t in Icc (-T) T, + ‖densityCharacterPolynomial (Finset.Icc 1 N) a χ (t + u)‖ ^ 2) := by + symm + simp_rw [Finset.mul_sum] + rw [integral_finsetSum _ (fun q hq => integrable_finsetSum _ (fun χ _ => hi q hq χ))] + apply Finset.sum_congr rfl + intro q hq + exact integral_finsetSum _ (fun χ _ => hi q hq χ) + _ ≤ _ := by simpa only [densityCharacterPolynomial] using hb N Q hQ T hT a F hF + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianHybrid.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianHybrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d2bde7a48ed19791e049a10fcca5b1e0ef30017 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianHybrid.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityShiftedHybrid +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityGaussianCauchy + +namespace OAI + +/-! # The hybrid mean square averaged over the Gaussian translation -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators Classical + + theorem densityHalfGaussian_first_moment : + Integrable (fun u : ℝ => densityHalfGaussian u * |u|) := by + have h := (integrable_mul_exp_neg_mul_sq (b := (1 / 2 : ℝ)) (by norm_num)).norm + convert h using 1 + funext u + rw [Real.norm_eq_abs, abs_mul, abs_of_pos (Real.exp_pos _)] + unfold densityHalfGaussian + rw [mul_comm] + congr 1 + congr 1 + ring + + theorem gaussian_hybrid_multiplicative_large_sieve : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + ∀ a : ℕ → ℂ, ∀ F : (q : ℕ) → Finset (DirichletCharacter ℂ q), + (∀ q ∈ Finset.Icc 1 Q, ∀ χ ∈ F q, χ.IsPrimitive) → + (∫ u : ℝ, densityHalfGaussian u * + (∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, + ∫ t in Icc (-T) T, ‖∑ n ∈ Finset.Icc 1 N, + a n * χ (n : ZMod q) * realAdditivePhase (-(Real.log n * (t + u)))‖ ^ 2)) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 := by + obtain ⟨C, hC, hb⟩ := shifted_hybrid_multiplicative_large_sieve + let G0 := ∫ u : ℝ, densityHalfGaussian u + let G1 := ∫ u : ℝ, densityHalfGaussian u * |u| + have hG0 : 0 < G0 := densityHalfGaussian_integral_pos + have hG1 : 0 ≤ G1 := integral_nonneg (fun u => mul_nonneg (densityHalfGaussian_pos u).le (abs_nonneg u)) + refine ⟨C * (G0 + G1), by positivity, ?_⟩ + intro N Q hQ T hT a F hF + let E := ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 + let A := (N : ℝ) + (Q : ℝ) ^ 2 * T + have hE : 0 ≤ E := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + let H : ℝ → ℝ := fun u => ∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, + ∫ t in Icc (-T) T, ‖∑ n ∈ Finset.Icc 1 N, + a n * χ (n : ZMod q) * realAdditivePhase (-(Real.log n * (t + u)))‖ ^ 2 + have hmaj : Integrable (fun u => densityHalfGaussian u * (C * (A + (Q : ℝ) ^ 2 * |u|) * E)) := by + have he : (fun u => densityHalfGaussian u * (C * (A + (Q : ℝ) ^ 2 * |u|) * E)) = + (fun u => (C * E * A) * densityHalfGaussian u + + (C * E * (Q : ℝ) ^ 2) * (densityHalfGaussian u * |u|)) := by + funext u + ring + rw [he] + exact (densityHalfGaussian_integrable.const_mul _).add (densityHalfGaussian_first_moment.const_mul _) + have hmean : (∫ u, densityHalfGaussian u * H u) ≤ + ∫ u, densityHalfGaussian u * (C * (A + (Q : ℝ) ^ 2 * |u|) * E) := by + apply integral_mono_of_nonneg + (Filter.Eventually.of_forall (fun u => mul_nonneg (densityHalfGaussian_pos u).le + (Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => + integral_nonneg (fun _ => sq_nonneg _)))))) hmaj + apply Filter.Eventually.of_forall + intro u + have h := hb N Q hQ T u hT a F hF + have he : (N : ℝ) + (Q : ℝ) ^ 2 * (T + |u|) = A + (Q : ℝ) ^ 2 * |u| := by dsimp [A]; ring + rw [he] at h + exact mul_le_mul_of_nonneg_left h (densityHalfGaussian_pos u).le + have heval : (∫ u, densityHalfGaussian u * (C * (A + (Q : ℝ) ^ 2 * |u|) * E)) = + C * E * (A * G0 + (Q : ℝ) ^ 2 * G1) := by + have he : (fun u => densityHalfGaussian u * (C * (A + (Q : ℝ) ^ 2 * |u|) * E)) = + (fun u => (C * E * A) * densityHalfGaussian u + + (C * E * (Q : ℝ) ^ 2) * (densityHalfGaussian u * |u|)) := by + funext u + ring + rw [he, integral_add (densityHalfGaussian_integrable.const_mul _) + (densityHalfGaussian_first_moment.const_mul _), integral_const_mul, integral_const_mul] + dsimp [G0, G1] + ring + change (∫ u, densityHalfGaussian u * H u) ≤ _ + apply hmean.trans + rw [heval] + have hQA : (Q : ℝ) ^ 2 ≤ A := by dsimp [A]; nlinarith [Nat.cast_nonneg (α := ℝ) N, sq_nonneg (Q : ℝ)] + have hg := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hQA hG1) (mul_nonneg hC.le hE) + change _ ≤ C * (G0 + G1) * A * E + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianSubset.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianSubset.lean new file mode 100644 index 0000000000000000000000000000000000000000..40072b12d6ad98cc7a3ed7386ba50c8c4bfc0362 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityGaussianSubset.lean @@ -0,0 +1,47 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityCharacterFamily + +namespace OAI + +/-! # Gaussian hybrid means on a finite coefficient interval or subset -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators Classical + + theorem density_sum_truncate {A : Type*} [AddCommMonoid A] + (S U : Finset ℕ) (hS : S ⊆ U) (f : ℕ → A) : + (∑ n ∈ U, if n ∈ S then f n else 0) = ∑ n ∈ S, f n := by + rw [← Finset.sum_subset hS (fun n _ hn => by simp [hn])] + exact Finset.sum_congr rfl (fun n hn => by simp [hn]) + + theorem gaussian_hybrid_primitive_subset : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + ∀ S : Finset ℕ, S ⊆ Finset.Icc 1 N → ∀ a : ℕ → ℂ, + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ∫ t in Icc (-T) T, ∫ u : ℝ, densityHalfGaussian u * + ‖densityCharacterPolynomial S a χ.character (t + u)‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * ∑ n ∈ S, ‖a n‖ ^ 2 := by + obtain ⟨C, hC, hb⟩ := gaussian_hybrid_primitive_mean + refine ⟨C, hC, ?_⟩ + intro N Q hQ T hT S hS a F hF + let b : ℕ → ℂ := fun n => if n ∈ S then a n else 0 + have hp (χ : PrimitiveComplexCharacter) (t : ℝ) : + densityCharacterPolynomial (Finset.Icc 1 N) b χ.character t = + densityCharacterPolynomial S a χ.character t := by + unfold densityCharacterPolynomial + convert density_sum_truncate S (Finset.Icc 1 N) hS + (fun n => a n * χ.character (n : ZMod χ.modulus) * realAdditivePhase (-(Real.log n * t))) using 1 + apply Finset.sum_congr rfl + intro n _ + by_cases hn : n ∈ S <;> simp [b, hn] + have he : (∑ n ∈ Finset.Icc 1 N, ‖b n‖ ^ 2) = ∑ n ∈ S, ‖a n‖ ^ 2 := by + convert density_sum_truncate S (Finset.Icc 1 N) hS (fun n => ‖a n‖ ^ 2) using 1 + apply Finset.sum_congr rfl + intro n _ + by_cases hn : n ∈ S <;> simp [b, hn] + simpa only [hp, he] using hb N Q hQ T hT b F hF + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHarmonicDivisors.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHarmonicDivisors.lean new file mode 100644 index 0000000000000000000000000000000000000000..7b2da3229b687247b913177c814106faaf07adb2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHarmonicDivisors.lean @@ -0,0 +1,84 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDivisorMoment + +namespace OAI + +/-! # The harmonic second moment of the divisor function -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_harmonic_multiples (N d : ℕ) (hd : 0 < d) : + (∑ n ∈ (Finset.Icc 1 N).filter (fun n => d ∣ n), (n : ℝ)⁻¹) = + (d : ℝ)⁻¹ * ∑ k ∈ Finset.Icc 1 (N / d), (k : ℝ)⁻¹ := by + rw [Finset.mul_sum] + symm + apply Finset.sum_bij (fun k _ => d * k) + · intro k hk + obtain ⟨hk1, hkN⟩ := Finset.mem_Icc.mp hk + have hu := (Nat.le_div_iff_mul_le hd).mp hkN + exact Finset.mem_filter.mpr ⟨Finset.mem_Icc.mpr + ⟨Nat.mul_pos hd hk1, by simpa only [mul_comm] using hu⟩, dvd_mul_right d k⟩ + · intro k _ l _ hkl + exact Nat.eq_of_mul_eq_mul_left hd hkl + · intro n hn + obtain ⟨hnN, hdn⟩ := Finset.mem_filter.mp hn + have hn1 := (Finset.mem_Icc.mp hnN).1 + have hdle : d ≤ n := Nat.le_of_dvd hn1 hdn + refine ⟨n / d, Finset.mem_Icc.mpr ⟨Nat.div_pos hdle hd, + Nat.div_le_div_right (Finset.mem_Icc.mp hnN).2⟩, ?_⟩ + exact Nat.mul_div_cancel' hdn + · intro k _ + rw [Nat.cast_mul, mul_inv_rev, mul_comm] + + theorem density_harmonic_multiples_le (N d : ℕ) (hd : 0 < d) : + (∑ n ∈ (Finset.Icc 1 N).filter (fun n => d ∣ n), (n : ℝ)⁻¹) ≤ + (d : ℝ)⁻¹ * ∑ k ∈ Finset.Icc 1 N, (k : ℝ)⁻¹ := by + rw [density_harmonic_multiples N d hd] + apply mul_le_mul_of_nonneg_left _ (inv_nonneg.mpr (Nat.cast_nonneg _)) + exact Finset.sum_le_sum_of_subset_of_nonneg + (Finset.Icc_subset_Icc_right (Nat.div_le_self N d)) (fun _ _ _ => by positivity) + + theorem density_divisor_square_harmonic (N : ℕ) : + (∑ n ∈ Finset.Icc 1 N, (n.divisors.card : ℝ) ^ 2 / n) ≤ + (1 + Real.log N) ^ 4 := by + let H : ℝ := ∑ k ∈ Finset.Icc 1 N, (k : ℝ)⁻¹ + have hH : 0 ≤ H := Finset.sum_nonneg (fun _ _ => by positivity) + have hHlog : H ≤ 1 + Real.log N := by + simpa only [H, harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast] + using harmonic_le_one_add_log N + have hexp (n : ℕ) (hn : n ∈ Finset.Icc 1 N) : + (n.divisors.card : ℝ) ^ 2 / n = + ∑ d ∈ Finset.Icc 1 N, ∑ e ∈ Finset.Icc 1 N, + if d.lcm e ∣ n then (n : ℝ)⁻¹ else 0 := by + rw [density_divisor_square_as_sum N n hn, div_eq_mul_inv] + simp only [Finset.sum_mul, ite_mul, one_mul, zero_mul] + calc + _ = ∑ d ∈ Finset.Icc 1 N, ∑ e ∈ Finset.Icc 1 N, + ∑ n ∈ (Finset.Icc 1 N).filter (fun n => d.lcm e ∣ n), (n : ℝ)⁻¹ := by + rw [Finset.sum_congr rfl hexp, Finset.sum_comm] + apply Finset.sum_congr rfl + intro d _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro e _ + rw [Finset.sum_filter] + _ ≤ ∑ d ∈ Finset.Icc 1 N, ∑ e ∈ Finset.Icc 1 N, + ((d.lcm e : ℕ) : ℝ)⁻¹ * H := by + apply Finset.sum_le_sum + intro d hd + apply Finset.sum_le_sum + intro e he + apply density_harmonic_multiples_le + exact Nat.lcm_pos (Finset.mem_Icc.mp hd).1 (Finset.mem_Icc.mp he).1 + _ = (∑ d ∈ Finset.Icc 1 N, ∑ e ∈ Finset.Icc 1 N, + ((d.lcm e : ℕ) : ℝ)⁻¹) * H := by simp only [Finset.sum_mul] + _ ≤ (1 + Real.log N) ^ 3 * H := + mul_le_mul_of_nonneg_right (reciprocal_lcm_sum_le_log_cube N) hH + _ ≤ (1 + Real.log N) ^ 3 * (1 + Real.log N) := + mul_le_mul_of_nonneg_left hHlog (pow_nonneg (hH.trans hHlog) 3) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHeadCutoff.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHeadCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..b64990489da25d4088a4deeb44c5a7646df3c3f9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHeadCutoff.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFiniteSquareMean +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityShiftedDivisorEnergy + +namespace OAI + +/-! # The logarithmic short contour for the actual finite head -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators Classical + + theorem densityKernelCost_log (N Q : ℕ) (hQ : 1 ≤ Q) (T : ℝ) (hT : 1 ≤ T) + (hN : 1 ≤ Real.log N) (hscale : 10 * (Q : ℝ) * T ≤ N) : + densityKernelCost Q T (1 / Real.log N) ≤ + densityKernelConstant * Real.exp 1 * Real.log N := by + have hNp : (0 : ℝ) < N := by + have hq : (0 : ℝ) < Q := by exact_mod_cast (show 0 < Q by omega) + have hB : 0 < 10 * (Q : ℝ) * T := by positivity + exact hB.trans_le hscale + have hc : 0 < 1 / Real.log N := div_pos zero_lt_one (by linarith) + have hpow : (N : ℝ) ^ (1 / Real.log N) = Real.exp 1 := by + rw [Real.rpow_def_of_pos hNp] + congr 1 + field_simp + unfold densityKernelCost + calc + _ ≤ densityKernelConstant * (N : ℝ) ^ (1 / Real.log N) / (1 / Real.log N) := by + apply div_le_div_of_nonneg_right _ hc.le + exact mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow (by positivity) hscale hc.le) densityKernelConstant_pos.le + _ = _ := by rw [hpow]; field_simp + + theorem densityFiniteSquare_head_mean : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + 1 ≤ Real.log N → 10 * (Q : ℝ) * T ≤ N → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖∑ n ∈ Finset.Icc 1 N, + densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * (Real.log N) ^ 6 := by + obtain ⟨C, hC, hb⟩ := densityFiniteSquare_mean + refine ⟨16 * C * (densityKernelConstant * Real.exp 1) ^ 2, by + have := densityKernelConstant_pos + positivity, ?_⟩ + intro N Q hQ T hT hN hscale F hF + let c : ℝ := 1 / Real.log N + have hc : 0 < c := div_pos zero_lt_one (by linarith) + have hc1 : c ≤ 1 := by dsimp [c]; exact (div_le_one (by linarith)).mpr hN + have h := hb N Q hQ T c hT hc hc1 (Finset.Icc 1 N) (fun _ hn => hn) F hF + have he := density_divisor_shifted_head N c hc.le + have hk := densityKernelCost_log N Q hQ T hT hN hscale + have hlog : (1 + Real.log N) ^ 4 ≤ 16 * (Real.log N) ^ 4 := by + have h := pow_le_pow_left₀ (by linarith : 0 ≤ 1 + Real.log N) + (by linarith : 1 + Real.log N ≤ 2 * Real.log N) 4 + nlinarith + calc + _ ≤ C * (densityKernelCost Q T c) ^ 2 * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * + (1 + Real.log N) ^ 4 := h.trans (mul_le_mul_of_nonneg_left he (by positivity)) + _ ≤ C * (densityKernelConstant * Real.exp 1 * Real.log N) ^ 2 * + ((N : ℝ) + (Q : ℝ) ^ 2 * T) * (16 * (Real.log N) ^ 4) := by + apply mul_le_mul _ hlog (by positivity) (by positivity) + apply mul_le_mul_of_nonneg_right _ (by positivity) + exact mul_le_mul_of_nonneg_left + (pow_le_pow_left₀ (densityKernelCost_pos Q hQ T c hT hc).le hk 2) hC.le + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHeightWeight.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHeightWeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e3cfe637fb47104c86e8c2db6309e6d44f34b62 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHeightWeight.lean @@ -0,0 +1,65 @@ +import Mathlib.Analysis.SpecificLimits.Normed +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDyadicShells +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityKernelPacking + +namespace OAI + +/-! # Summable cubic weights on the dyadic height shells -/ + +namespace Ostmann + +open Set + +noncomputable def densityHeightWeight (T x : ℝ) : ℝ := densityCubicWeight (x / T) + + theorem densityHeightWeight_nonneg (T x : ℝ) : 0 ≤ densityHeightWeight T x := + densityCubicWeight_nonneg _ + + theorem densityHeightWeight_continuous (T : ℝ) : Continuous (densityHeightWeight T) := by + unfold densityHeightWeight densityCubicWeight + exact continuous_const.div + ((continuous_const.add (continuous_id.div_const T).abs).pow 3) (fun x => by positivity) + + theorem densityHeightWeight_shell (T : ℝ) (hT : 0 < T) (j : ℕ) (x : ℝ) + (hx : x ∈ densityHeightShell T (j + 1)) : + densityHeightWeight T x ≤ (1 / 8 : ℝ) ^ j := by + have ha : (2 : ℝ) ^ j * T < |x| := by + have h := hx.2 + rw [densityHeightBall_mem] at h + exact lt_of_not_ge h + have hd : (2 : ℝ) ^ j ≤ 1 + |x / T| := by + rw [abs_div, abs_of_pos hT] + have hh : (2 : ℝ) ^ j < |x| / T := (lt_div_iff₀ hT).mpr ha + linarith + calc + densityHeightWeight T x ≤ 1 / ((2 : ℝ) ^ j) ^ 3 := by + apply one_div_le_one_div_of_le (by positivity) + exact pow_le_pow_left₀ (by positivity) hd 3 + _ = (1 / 8 : ℝ) ^ j := by + rw [← pow_mul, Nat.mul_comm, pow_mul, one_div_pow] + norm_num + + theorem density_height_energy_summable (k : ℕ) : + Summable (fun j : ℕ => (j + 2 : ℝ) ^ k * (1 / 4 : ℝ) ^ j) := by + have h0 : Summable (fun j : ℕ => (j : ℝ) ^ k * (1 / 4 : ℝ) ^ j) := + summable_pow_mul_geometric_of_norm_lt_one k (by norm_num : ‖(1 / 4 : ℝ)‖ < 1) + have h : Summable (fun j : ℕ => ((j + 2 : ℕ) : ℝ) ^ k * (1 / 4 : ℝ) ^ (j + 2)) := + (summable_nat_add_iff 2).mpr h0 + have hm := h.mul_right (16 : ℝ) + convert hm using 1 + funext j + push_cast + rw [pow_add] + ring + +noncomputable def densityHeightEnergyConstant (k : ℕ) : ℝ := + 1 + 2 * ∑' j : ℕ, (j + 2 : ℝ) ^ k * (1 / 4 : ℝ) ^ j + + theorem densityHeightEnergyConstant_pos (k : ℕ) : 0 < densityHeightEnergyConstant k := by + have hh : 0 ≤ ∑' j : ℕ, (j + 2 : ℝ) ^ k * (1 / 4 : ℝ) ^ j := tsum_nonneg (fun _ => by positivity) + unfold densityHeightEnergyConstant + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHybridIntegral.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHybridIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d26af4346b08e5851bf32d63c1cb7659059aaec --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHybridIntegral.lean @@ -0,0 +1,119 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityWindowEnergy +import OAI.NumberTheory.Ostmann.Preliminaries.LocalizedMultiplicativeSieve + +namespace OAI + +/-! # Integrated short-window sieve for complex Dirichlet polynomials -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators SchwartzMap FourierTransform Classical + + theorem density_finite_localized_integrable (S : Finset ℕ) + (W : 𝓢(ℝ, ℂ)) (h : ℝ) (hh : 0 < h) (a : ℕ → ℂ) : + Integrable (fun x : ℝ => ‖∑ n ∈ S, a n * W ((x - Real.log n) / h)‖ ^ 2) := by + have hi := density_localized_square_integrable W h hh + (fun n : S => a n) (fun n : S => Real.log n) + have he (x : ℝ) : (∑ n : S, a n * W ((x - Real.log n) / h)) = + ∑ n ∈ S, a n * W ((x - Real.log n) / h) := + Finset.sum_coe_sort S (fun n : ℕ => a n * W ((x - Real.log n) / h)) + simpa only [he] using hi + + theorem density_window_energy_integral (S : Finset ℕ) + (W : 𝓢(ℝ, ℂ)) (h : ℝ) (hh : 0 < h) (a : ℕ → ℂ) : + (∫ x : ℝ, ∑ n ∈ S, ‖a n * W ((x - Real.log n) / h)‖ ^ 2) = + h * (∫ x : ℝ, ‖W x‖ ^ 2) * ∑ n ∈ S, ‖a n‖ ^ 2 := by + rw [integral_finsetSum] + · rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro n _ + simp only [norm_mul, mul_pow, integral_const_mul, density_shifted_window_square W h hh] + ring + · intro n _ + simpa only [norm_mul, mul_pow] using + (density_shifted_window_integrable W h hh (Real.log n)).const_mul (‖a n‖ ^ 2) + + theorem density_integrated_localized_sieve (N Q : ℕ) (hQ : 1 ≤ Q) + (W : 𝓢(ℝ, ℂ)) (h : ℝ) (hh : 0 < h) + (hW : ∀ y, 1 ≤ |y| → W y = 0) (a : ℕ → ℂ) + (F : (q : ℕ) → Finset (DirichletCharacter ℂ q)) + (hF : ∀ q ∈ Finset.Icc 1 Q, ∀ χ ∈ F q, χ.IsPrimitive) : + (∫ x : ℝ, ∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, + ‖∑ n ∈ Finset.Icc 1 N, a n * W ((x - Real.log n) / h) * χ (n : ZMod q)‖ ^ 2) ≤ + (2 * N * h + (Q : ℝ) ^ 2 + 2) * h * + (∫ x : ℝ, ‖W x‖ ^ 2) * ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 := by + have hi : Integrable (fun x : ℝ => (2 * N * h + (Q : ℝ) ^ 2 + 2) * + ∑ n ∈ Finset.Icc 1 N, ‖a n * W ((x - Real.log n) / h)‖ ^ 2) := by + apply Integrable.const_mul + apply integrable_finsetSum + intro n _ + simpa only [norm_mul, mul_pow] using + (density_shifted_window_integrable W h hh (Real.log n)).const_mul (‖a n‖ ^ 2) + have hm := integral_mono_of_nonneg + (Filter.Eventually.of_forall (fun x => Finset.sum_nonneg (fun _ _ => + Finset.sum_nonneg (fun _ _ => sq_nonneg _)))) hi + (Filter.Eventually.of_forall (fun x => localized_multiplicative_sieve N Q hQ x h hh W hW a F hF)) + rw [integral_const_mul, density_window_energy_integral _ W h hh] at hm + simpa only [mul_assoc] using hm + + theorem density_hybrid_window (N Q : ℕ) (hQ : 1 ≤ Q) + (W : 𝓢(ℝ, ℂ)) (c h T : ℝ) (hc : 0 < c) (hh : 0 < h) + (hwindow : h * T ≤ 1) (hW : ∀ y, 1 ≤ |y| → W y = 0) + (hWlower : ∀ t, |t| ≤ 1 → c ≤ ‖𝓕 W t‖) (a : ℕ → ℂ) + (F : (q : ℕ) → Finset (DirichletCharacter ℂ q)) + (hF : ∀ q ∈ Finset.Icc 1 Q, ∀ χ ∈ F q, χ.IsPrimitive) : + h ^ 2 * c ^ 2 * (∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, + ∫ t in Icc (-T) T, ‖∑ n ∈ Finset.Icc 1 N, + a n * χ (n : ZMod q) * realAdditivePhase (-(Real.log n * t))‖ ^ 2) ≤ + (2 * N * h + (Q : ℝ) ^ 2 + 2) * h * + (∫ x : ℝ, ‖W x‖ ^ 2) * ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 := by + have hint (q : ℕ) (χ : DirichletCharacter ℂ q) : + Integrable (fun x : ℝ => ‖∑ n ∈ Finset.Icc 1 N, + a n * χ (n : ZMod q) * W ((x - Real.log n) / h)‖ ^ 2) := + density_finite_localized_integrable _ W h hh _ + have hpoint (q : ℕ) (χ : DirichletCharacter ℂ q) := + density_height_window_bound W c h T hc hh hwindow hWlower + (fun n : Finset.Icc 1 N => a n * χ (n.val : ZMod q)) + (fun n : Finset.Icc 1 N => Real.log n) + have he1 (q : ℕ) (χ : DirichletCharacter ℂ q) (t : ℝ) : + (∑ n : Finset.Icc 1 N, a n * χ (n.val : ZMod q) * + realAdditivePhase (-(Real.log n * t))) = + ∑ n ∈ Finset.Icc 1 N, a n * χ (n : ZMod q) * + realAdditivePhase (-(Real.log n * t)) := + Finset.sum_coe_sort (Finset.Icc 1 N) (fun n : ℕ => + a n * χ (n : ZMod q) * realAdditivePhase (-(Real.log n * t))) + have he2 (q : ℕ) (χ : DirichletCharacter ℂ q) (x : ℝ) : + (∑ n : Finset.Icc 1 N, a n * χ (n.val : ZMod q) * + W ((x - Real.log n) / h)) = + ∑ n ∈ Finset.Icc 1 N, a n * χ (n : ZMod q) * W ((x - Real.log n) / h) := + Finset.sum_coe_sort (Finset.Icc 1 N) (fun n : ℕ => + a n * χ (n : ZMod q) * W ((x - Real.log n) / h)) + simp only [he1, he2] at hpoint + have hs := Finset.sum_le_sum (s := Finset.Icc 1 Q) (fun q _ => + Finset.sum_le_sum (s := F q) (fun χ _ => hpoint q χ)) + simp only [← Finset.mul_sum] at hs + have he : (∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, + ∫ x : ℝ, ‖∑ n ∈ Finset.Icc 1 N, + a n * χ (n : ZMod q) * W ((x - Real.log n) / h)‖ ^ 2) = + ∫ x : ℝ, ∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, + ‖∑ n ∈ Finset.Icc 1 N, + a n * W ((x - Real.log n) / h) * χ (n : ZMod q)‖ ^ 2 := by + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro q _ + rw [integral_finsetSum _ (fun χ _ => by + simpa only [mul_right_comm] using hint q χ)] + apply Finset.sum_congr rfl + intro χ _ + simp only [mul_right_comm] + · intro q _ + apply integrable_finsetSum + intro χ _ + simpa only [mul_right_comm] using hint q χ + rw [he] at hs + exact hs.trans (density_integrated_localized_sieve N Q hQ W h hh hW a F hF) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHybridSieve.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHybridSieve.lean new file mode 100644 index 0000000000000000000000000000000000000000..83ae2c1a3f8ffb35be7381307a49abe5705ab6f3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityHybridSieve.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityHybridIntegral + +namespace OAI + +/-! # A hybrid large sieve with an absolute constant + +The character and height variables are averaged simultaneously. The proof uses +short logarithmic windows and the already proved finite additive large sieve. +-/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators SchwartzMap FourierTransform Classical + + theorem hybrid_multiplicative_large_sieve : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + ∀ a : ℕ → ℂ, ∀ F : (q : ℕ) → Finset (DirichletCharacter ℂ q), + (∀ q ∈ Finset.Icc 1 Q, ∀ χ ∈ F q, χ.IsPrimitive) → + (∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, + ∫ t in Icc (-T) T, ‖∑ n ∈ Finset.Icc 1 N, + a n * χ (n : ZMod q) * realAdditivePhase (-(Real.log n * t))‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 := by + obtain ⟨c, W, hc, hW, _, hWlower⟩ := exists_density_localizer + let K : ℝ := ∫ x : ℝ, ‖W x‖ ^ 2 + have hK : 0 ≤ K := integral_nonneg (fun _ => sq_nonneg _) + refine ⟨3 * (K + 1) / c ^ 2, by positivity, ?_⟩ + intro N Q hQ T hT a F hF + have hTpos : 0 < T := by linarith + have hc2 : 0 < c ^ 2 := pow_pos hc 2 + have hh : 0 < T⁻¹ := inv_pos.mpr hTpos + have hb := density_hybrid_window N Q hQ W c T⁻¹ T hc hh + (by rw [inv_mul_cancel₀ hTpos.ne']) hW hWlower a F hF + let E : ℝ := ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 + have hE : 0 ≤ E := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + have hd : 0 < T⁻¹ ^ 2 * c ^ 2 := mul_pos (pow_pos hh 2) hc2 + have hb' := (le_div_iff₀' hd).mpr hb + have hid : ((2 * (N : ℝ) * T⁻¹ + (Q : ℝ) ^ 2 + 2) * T⁻¹ * K * E) / + (T⁻¹ ^ 2 * c ^ 2) = + (K / c ^ 2) * (2 * N + ((Q : ℝ) ^ 2 + 2) * T) * E := by + field_simp + ring + change _ ≤ ((2 * (N : ℝ) * T⁻¹ + (Q : ℝ) ^ 2 + 2) * T⁻¹ * K * E) / + (T⁻¹ ^ 2 * c ^ 2) at hb' + rw [hid] at hb' + apply hb'.trans + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hq2 : (1 : ℝ) ≤ (Q : ℝ) ^ 2 := by nlinarith + have hsize : 2 * (N : ℝ) + ((Q : ℝ) ^ 2 + 2) * T ≤ + 3 * ((N : ℝ) + (Q : ℝ) ^ 2 * T) := by + nlinarith [Nat.cast_nonneg (α := ℝ) N, mul_nonneg (by linarith : 0 ≤ (Q : ℝ) ^ 2 - 1) hTpos.le] + have hbase : 0 ≤ (N : ℝ) + (Q : ℝ) ^ 2 * T := by positivity + have hfirst := mul_le_mul_of_nonneg_left hsize (div_nonneg hK hc2.le) + have hsecond := mul_le_mul_of_nonneg_right + (div_le_div_of_nonneg_right (by linarith : K ≤ K + 1) hc2.le) + (mul_nonneg (by norm_num : (0 : ℝ) ≤ 3) hbase) + have hbound : (K / c ^ 2) * (2 * (N : ℝ) + ((Q : ℝ) ^ 2 + 2) * T) ≤ + (3 * (K + 1) / c ^ 2) * ((N : ℝ) + (Q : ℝ) ^ 2 * T) := by + calc + _ ≤ (K / c ^ 2) * (3 * ((N : ℝ) + (Q : ℝ) ^ 2 * T)) := hfirst + _ ≤ ((K + 1) / c ^ 2) * (3 * ((N : ℝ) + (Q : ℝ) ^ 2 * T)) := hsecond + _ = _ := by ring + exact mul_le_mul_of_nonneg_right hbound hE + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityIncrementTree.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityIncrementTree.lean new file mode 100644 index 0000000000000000000000000000000000000000..bdcefbaa14e3f81d639095866bfd2df592c01910 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityIncrementTree.lean @@ -0,0 +1,81 @@ +import Mathlib.Algebra.Order.BigOperators.Ring.Finset +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Data.List.Basic +import Mathlib.Tactic.Linarith + +namespace OAI + +/-! # Finite density increment for selecting a rich block + +A low-density child of a block forces a definite increase in another child. +Iterating cannot exceed a fixed upper density, so a block with no low child +occurs before a bounded depth. +-/ + +namespace Ostmann + +open scoped BigOperators Classical + +private theorem density_child_increment {M : ℕ} (hM : 0 < M) + (x : Fin M → ℝ) (D d : ℝ) (hd : 0 < d) (hD : d ≤ D) + (hmean : ∑ i, x i = M * D) (hbad : ∃ i, x i < d / 2) : + ∃ i, D + d / (4 * M) ≤ x i := by + obtain ⟨i, hi⟩ := hbad + by_contra! h + have hsum : (∑ j ∈ Finset.univ.erase i, x j) ≤ + ((Finset.univ.erase i).card : ℝ) * (D + d / (4 * M)) := by + calc + _ ≤ ∑ _j ∈ Finset.univ.erase i, (D + d / (4 * M)) := + Finset.sum_le_sum (fun j _ => (h j).le) + _ = _ := by simp only [Finset.sum_const, nsmul_eq_mul] + have hcard : ((Finset.univ.erase i).card : ℝ) = (M : ℝ) - 1 := by + have hh := Finset.card_erase_add_one (Finset.mem_univ i) + simp only [Finset.card_univ, Fintype.card_fin] at hh + have hh' : ((Finset.univ.erase i).card : ℝ) + 1 = M := by exact_mod_cast hh + linarith + have heq := Finset.sum_erase_add (Finset.univ : Finset (Fin M)) x (Finset.mem_univ i) + have hMr : (0 : ℝ) < M := by exact_mod_cast hM + have he : (M : ℝ) * (d / (4 * M)) = d / 4 := by field_simp + rw [hcard] at hsum + nlinarith [div_nonneg hd.le (by positivity : (0 : ℝ) ≤ 4 * M)] + +/-- The fixed increment forces a rich node before the density ceiling is +reached. A node is an actual ordered list of child choices. -/ +theorem exists_rich_density_node {M : ℕ} (hM : 0 < M) (H : ℕ) + (D : List (Fin M) → ℝ) (d U : ℝ) (hd : 0 < d) + (hroot : d ≤ D []) + (hmean : ∀ w, w.length < H → (∑ i, D (w ++ [i])) = M * D w) + (hupper : ∀ w, w.length ≤ H → D w ≤ U) + (hdepth : U < d + H * (d / (4 * M))) : + ∃ w : List (Fin M), w.length < H ∧ ∀ i, d / 2 ≤ D (w ++ [i]) := by + let ε := d / (4 * M) + have hε : 0 < ε := by dsimp [ε]; positivity + have hsteps : ∀ j ≤ H, + (∃ w : List (Fin M), w.length < j ∧ ∀ i, d / 2 ≤ D (w ++ [i])) ∨ + ∃ w : List (Fin M), w.length = j ∧ d + j * ε ≤ D w := by + intro j + induction j with + | zero => intro _; exact Or.inr ⟨[], rfl, by simpa using hroot⟩ + | succ j ih => + intro hj + rcases ih (by omega) with ⟨w, hw, hgood⟩ | ⟨w, hw, hD⟩ + · exact Or.inl ⟨w, by omega, hgood⟩ + · by_cases hgood : ∀ i, d / 2 ≤ D (w ++ [i]) + · exact Or.inl ⟨w, by omega, hgood⟩ + · have hbad : ∃ i, D (w ++ [i]) < d / 2 := by simpa using hgood + obtain ⟨i, hi⟩ := density_child_increment hM (fun i => D (w ++ [i])) (D w) d hd + (by nlinarith [mul_nonneg (Nat.cast_nonneg (α := ℝ) j) hε.le]) + (hmean w (by omega)) hbad + right + refine ⟨w ++ [i], by simp [hw], ?_⟩ + change D w + ε ≤ D (w ++ [i]) at hi + push_cast + linarith + rcases hsteps H le_rfl with h | ⟨w, hw, hD⟩ + · exact h + · have hu := hupper w hw.le + exact False.elim (by dsimp [ε] at hD; linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityIntegralAlternative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityIntegralAlternative.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a509431711b74480729d107dc610a030dcf62d1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityIntegralAlternative.lean @@ -0,0 +1,69 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityCriticalMass + +namespace OAI + +/-! # Counting the integral alternative at actual L-function zeros -/ + +namespace Ostmann + +open MeasureTheory +open scoped BigOperators Classical + + theorem density_count_cube (R I K D : ℝ) (hR : 0 ≤ R) (hD : 0 ≤ D) + (hlower : R ≤ K * I) (hfourth : I ^ 4 ≤ R * D) : R ^ 3 ≤ K ^ 4 * D := by + by_cases hzero : R = 0 + · simpa only [hzero, zero_pow (by decide : (3 : ℕ) ≠ 0)] using + mul_nonneg (by positivity : 0 ≤ K ^ 4) hD + · have hpos : 0 < R := lt_of_le_of_ne hR (Ne.symm hzero) + have hp := pow_le_pow_left₀ hR hlower 4 + rw [mul_pow] at hp + have hu := mul_le_mul_of_nonneg_left hfourth (by positivity : 0 ≤ K ^ 4) + have hh : R * R ^ 3 ≤ R * (K ^ 4 * D) := by nlinarith + exact (mul_le_mul_iff_right₀ hpos).mp (by simpa only [mul_comm R] using hh) + + theorem density_integral_alternative_count : + ∃ C : ℝ, 0 < C ∧ ∀ X Q : ℕ, 1 ≤ X → 1 ≤ Q → ∀ T σ Y : ℝ, + 2 ≤ T → 1 / 2 < σ → 1 ≤ Y → + ∀ {ι : Type} (S : Finset ι) (c : ι → PrimitiveComplexCharacter) (β t : ι → ℝ), + (∀ i ∈ S, (c i).modulus ≤ Q) → (∀ i ∈ S, |t i| ≤ T) → + (∀ i ∈ S, ∀ j ∈ S, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∀ i ∈ S, σ ≤ β i ∧ β i ≤ 1 ∧ (c i).L (densityVerticalPoint (β i) (t i)) = 0) → + (∀ i ∈ S, (1 / 8 : ℝ) ≤ ‖densityDetectorMean (c i) X (densityVerticalPoint (β i) (t i)) Y‖) → + (S.card : ℝ) ^ 3 ≤ C * (128 * Y ^ (1 / 2 - σ) / (σ - 1 / 2)) ^ 4 * + ((Q : ℝ) ^ 2 * T) * ((X : ℝ) + (Q : ℝ) ^ 2 * T) ^ 2 * + (Real.log ((Q : ℝ) * T)) ^ 6 * (1 + Real.log X) ^ 2 := by + obtain ⟨C, hC, hb⟩ := density_packed_product_fourth + refine ⟨C, hC, ?_⟩ + intro X Q hX hQ T σ Y hT hσ hY ι S c β t hc ht hsep hz hlarge + let I0 := ∑ i ∈ S, densityCriticalMass (c i) X (t i) + let K := 128 * Y ^ (1 / 2 - σ) / (σ - 1 / 2) + let D := C * ((Q : ℝ) ^ 2 * T) * ((X : ℝ) + (Q : ℝ) ^ 2 * T) ^ 2 * + (Real.log ((Q : ℝ) * T)) ^ 6 * (1 + Real.log X) ^ 2 + have hlower : (S.card : ℝ) ≤ K * I0 := by + have hsum : (∑ _i ∈ S, (1 / 8 : ℝ)) ≤ + ∑ i ∈ S, (16 * Y ^ (1 / 2 - σ) / (σ - 1 / 2)) * densityCriticalMass (c i) X (t i) := by + apply Finset.sum_le_sum + intro i hi + exact (hlarge i hi).trans (densityDetector_uniform_mass_bound (c i) X σ (β i) (t i) + hσ (hz i hi).1 (hz i hi).2.1 (hz i hi).2.2 Y hY) + simp only [Finset.sum_const, nsmul_eq_mul, ← Finset.mul_sum] at hsum + have hh := mul_le_mul_of_nonneg_left hsum (by norm_num : (0 : ℝ) ≤ 8) + convert hh using 1 + · ring + · dsimp [K, I0] + ring + have hfourth : I0 ^ 4 ≤ (S.card : ℝ) * D := by + have h := hb X Q hX hQ T hT S c t hc ht hsep + change I0 ^ 4 ≤ _ at h + convert h using 1 + dsimp [D] + ring + have hmain := density_count_cube (S.card : ℝ) I0 K D (Nat.cast_nonneg _) (by dsimp [D]; positivity) + hlower hfourth + convert hmain using 1 + dsimp [K, D] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityIntegralBalanced.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityIntegralBalanced.lean new file mode 100644 index 0000000000000000000000000000000000000000..bed8fb0b3d27707ca0fec4c9e2a43fc1be6708be --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityIntegralBalanced.lean @@ -0,0 +1,72 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityIntegralAlternative +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityBalanceParameters + +namespace OAI + +/-! # The balanced Montgomery exponent for the integral alternative -/ + +namespace Ostmann + +open MeasureTheory +open scoped BigOperators Classical + + theorem density_integral_alternative_balanced : + ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 1 ≤ Q → ∀ T σ : ℝ, + 2 ≤ T → 1 / 2 < σ → σ ≤ 1 → + 1 / Real.log ((Q : ℝ) ^ 2 * T) ≤ σ - 1 / 2 → + ∃ X : ℕ, 1 ≤ X ∧ (Q : ℝ) ^ 2 * T ≤ X ∧ + ∀ {ι : Type} (S : Finset ι) (c : ι → PrimitiveComplexCharacter) (β t : ι → ℝ), + (∀ i ∈ S, (c i).modulus ≤ Q) → (∀ i ∈ S, |t i| ≤ T) → + (∀ i ∈ S, ∀ j ∈ S, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∀ i ∈ S, σ ≤ β i ∧ β i ≤ 1 ∧ (c i).L (densityVerticalPoint (β i) (t i)) = 0) → + (∀ i ∈ S, (1 / 8 : ℝ) ≤ ‖densityDetectorMean (c i) X (densityVerticalPoint (β i) (t i)) + (((Q : ℝ) ^ 2 * T) ^ densityBalanceExponent σ)‖) → + (S.card : ℝ) ^ 3 ≤ C * (((Q : ℝ) ^ 2 * T) ^ densityTargetExponent σ) ^ 3 * + (Real.log ((Q : ℝ) * T)) ^ 12 := by + obtain ⟨C, hC, hb⟩ := density_integral_alternative_count + refine ⟨C * 256 ^ 4 * 17 ^ 2 * 20 ^ 2, by positivity, ?_⟩ + intro Q hQ T σ hT hσ hσ1 hgap + obtain ⟨X, hX, hXB, hsize, hlogX⟩ := density_detector_cutoff Q hQ T hT + refine ⟨X, hX, hXB, ?_⟩ + intro ι S c β t hc ht hs hz hlarge + let B := (Q : ℝ) ^ 2 * T + let Y := B ^ densityBalanceExponent σ + let L := Real.log ((Q : ℝ) * T) + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hB : 1 ≤ B := by dsimp [B]; nlinarith + have hBp : 0 < B := lt_of_lt_of_le zero_lt_one hB + have hY : 1 ≤ Y := Real.one_le_rpow hB (le_trans zero_le_one (density_balance_at_least_one σ hσ.le hσ1)) + have hYp : 0 < Y := lt_of_lt_of_le zero_lt_one hY + have hL : 0 ≤ L := Real.log_nonneg (by nlinarith) + have hXlog : 0 ≤ 1 + Real.log X := by + have hx : (1 : ℝ) ≤ X := by exact_mod_cast hX + have h := Real.log_nonneg hx + linarith + have hK : 128 * Y ^ (1 / 2 - σ) / (σ - 1 / 2) ≤ + 256 * Y ^ (1 / 2 - σ) * L := by + have h := density_away_inverse_gap Q hQ T σ hT hσ hgap + have hm := mul_le_mul_of_nonneg_left h + (show 0 ≤ 128 * Y ^ (1 / 2 - σ) by positivity) + convert hm using 1 + · ring + · dsimp [L] + ring + have hpow : (Y ^ (1 / 2 - σ)) ^ (4 : ℕ) = Y ^ (2 - 4 * σ) := by + rw [← Real.rpow_natCast, ← Real.rpow_mul hYp.le] + congr 1 + ring + have hK4 : (128 * Y ^ (1 / 2 - σ) / (σ - 1 / 2)) ^ 4 ≤ + 256 ^ 4 * Y ^ (2 - 4 * σ) * L ^ 4 := by + have h := pow_le_pow_left₀ (by positivity) hK 4 + simpa only [mul_pow, hpow] using h + have hcount := hb X Q hX hQ T σ Y hT hσ hY S c β t hc ht hs hz hlarge + apply hcount.trans + calc + _ ≤ C * (256 ^ 4 * Y ^ (2 - 4 * σ) * L ^ 4) * B * (17 * B) ^ 2 * L ^ 6 * (20 * L) ^ 2 := by + gcongr + _ = (C * 256 ^ 4 * 17 ^ 2 * 20 ^ 2) * (B ^ 3 * Y ^ (2 - 4 * σ)) * L ^ 12 := by ring + _ = _ := by rw [density_balance_identity B σ hBp (by linarith)] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelCost.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..f069937bd7285271b617eb7cb15d63047b4602c9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelCost.lean @@ -0,0 +1,71 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFiniteSquareEnergy + +namespace OAI + +/-! # A common height and conductor cost for the smoothed square -/ + +namespace Ostmann + +open Complex + +noncomputable def densityKernelConstant : ℝ := + Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) + +noncomputable def densityKernelCost (Q : ℕ) (T c : ℝ) : ℝ := + densityKernelConstant * (10 * Q * T) ^ c / c + + theorem densityKernelConstant_pos : 0 < densityKernelConstant := Real.exp_pos _ + + theorem densityKernelCost_pos (Q : ℕ) (hQ : 1 ≤ Q) (T c : ℝ) + (hT : 1 ≤ T) (hc : 0 < c) : 0 < densityKernelCost Q T c := by + unfold densityKernelCost + apply div_pos (mul_pos densityKernelConstant_pos _) hc + apply Real.rpow_pos_of_pos + have hq : (0 : ℝ) < Q := by exact_mod_cast (show 0 < Q by omega) + positivity + + theorem density_vertical_height_bound (Q : ℕ) (_hQ : 1 ≤ Q) (T : ℝ) (hT : 1 ≤ T) + (χ : PrimitiveComplexCharacter) (hχ : χ.modulus ≤ Q) (t : ℝ) (ht : |t| ≤ T) : + (χ.modulus : ℝ) * (|(densityVerticalPoint (1 / 2) t).im| + 2) ≤ 10 * Q * T := by + have hq : (χ.modulus : ℝ) ≤ Q := by exact_mod_cast hχ + have him : (densityVerticalPoint (1 / 2) t).im = 2 * Real.pi * t := by + simp [densityVerticalPoint] + rw [him, abs_mul, abs_of_pos (by positivity : 0 < 2 * Real.pi)] + have hb : 2 * Real.pi * |t| + 2 ≤ 10 * T := by + nlinarith [Real.pi_lt_four, Real.pi_pos] + calc + _ ≤ (χ.modulus : ℝ) * (10 * T) := mul_le_mul_of_nonneg_left hb (Nat.cast_nonneg _) + _ ≤ (Q : ℝ) * (10 * T) := mul_le_mul_of_nonneg_right hq (by positivity) + _ = _ := by ring + + theorem density_kernel_cost_bound (Q : ℕ) (hQ : 1 ≤ Q) (T c : ℝ) + (hT : 1 ≤ T) (hc : 0 < c) (χ : PrimitiveComplexCharacter) (hχ : χ.modulus ≤ Q) + (t : ℝ) (ht : |t| ≤ T) : + densityKernelConstant * + ((χ.modulus : ℝ) * (|(densityVerticalPoint (1 / 2) t).im| + 2)) ^ c / c ≤ + densityKernelCost Q T c := by + unfold densityKernelCost + apply div_le_div_of_nonneg_right _ hc.le + apply mul_le_mul_of_nonneg_left _ densityKernelConstant_pos.le + exact Real.rpow_le_rpow (by positivity) + (density_vertical_height_bound Q hQ T hT χ hχ t ht) hc.le + + theorem densitySquareKernel_common_bound (Q : ℕ) (hQ : 1 ≤ Q) (T c : ℝ) + (hT : 1 ≤ T) (hc : 0 < c) (hc1 : c ≤ 1) + (χ : PrimitiveComplexCharacter) (hχ : χ.modulus ≤ Q) (t u : ℝ) (ht : |t| ≤ T) : + ‖densitySquareKernel χ (densityVerticalPoint (1 / 2) t) + ((c : ℂ) + (2 * Real.pi * u : ℝ) * I)‖ ≤ + densityKernelCost Q T c * densityHalfGaussian u := by + have hs : (densityVerticalPoint (1 / 2) t).re = 1 / 2 := by simp [densityVerticalPoint] + apply (densitySquareKernel_short_line χ _ hs c (2 * Real.pi * u) hc hc1).trans + calc + _ ≤ densityKernelCost Q T c * densityHalfGaussian (2 * Real.pi * u) := + mul_le_mul_of_nonneg_right (density_kernel_cost_bound Q hQ T c hT hc χ hχ t ht) + (densityHalfGaussian_pos _).le + _ ≤ _ := mul_le_mul_of_nonneg_left (densityHalfGaussian_fourier_scale u) + (densityKernelCost_pos Q hQ T c hT hc).le + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelHeightPacking.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelHeightPacking.lean new file mode 100644 index 0000000000000000000000000000000000000000..5dc318d6dacd0305337d7022b43ee9d96e09919f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelHeightPacking.lean @@ -0,0 +1,89 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityHeightWeight +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySeparatedSampling + +namespace OAI + +/-! # The translated detector kernels keep the original height scale -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators + + theorem density_separated_card (S : Finset ℝ) (T : ℝ) (hT : 0 ≤ T) + (hS : ∀ x ∈ S, |x| ≤ T) + (hsep : ∀ x ∈ S, ∀ y ∈ S, x ≠ y → 1 ≤ |x - y|) : + (S.card : ℝ) ≤ 2 * (T + 1) := by + have h := density_sample_window_integrals S id T hS hsep (fun _ => (1 : ℝ)) + continuous_const (fun _ => by norm_num) + simp only [intervalIntegral.integral_const, smul_eq_mul, mul_one, + show ∀ x : ℝ, x + 1 / 2 - (x - 1 / 2) = 1 by intro x; ring, + Finset.sum_const, nsmul_eq_mul, mul_one] at h + have he : (∫ _x in Icc (-T - 1) (T + 1), (1 : ℝ)) = 2 * (T + 1) := by + rw [integral_const, smul_eq_mul, mul_one, Measure.real, Measure.restrict_apply_univ, + Real.volume_Icc] + simp only [ENNReal.toReal_ofReal (by linarith : 0 ≤ T + 1 - (-T - 1))] + ring + rwa [he] at h + + theorem densityHeightWeight_eq (T x : ℝ) (hT : 0 < T) : + densityHeightWeight T x = T ^ 3 / (T + |x|) ^ 3 := by + unfold densityHeightWeight densityCubicWeight + rw [abs_div, abs_of_pos hT] + field_simp + + theorem density_kernel_far_bound (T v x : ℝ) (hT : 0 < T) + (hx : |x| ≤ T) (hv : 2 * T < |v|) : + densityCubicWeight (v - x) ≤ 64 / (T + |v|) ^ 3 := by + have ht : |v| ≤ |v - x| + |x| := by + simpa only [sub_add_cancel] using abs_add_le (v - x) x + have hd : T + |v| ≤ 4 * (1 + |v - x|) := by linarith [abs_nonneg (v - x)] + have hp := pow_le_pow_left₀ (by positivity : 0 ≤ T + |v|) hd 3 + unfold densityCubicWeight + apply (div_le_div_iff₀ (by positivity) (by positivity)).mpr + nlinarith + + theorem density_kernel_height_packing (S : Finset ℝ) (T : ℝ) (hT : 1 ≤ T) + (hS : ∀ x ∈ S, |x| ≤ T) + (hsep : ∀ x ∈ S, ∀ y ∈ S, x ≠ y → 1 ≤ |x - y|) (v : ℝ) : + (∑ x ∈ S, densityCubicWeight (v - x)) ≤ + (256 + 27 * (1 + 4 * Real.pi ^ 2 / 3)) * densityHeightWeight T v := by + have hTp : 0 < T := by linarith + have hw : 0 ≤ densityHeightWeight T v := densityHeightWeight_nonneg T v + have hK : 0 ≤ 1 + 4 * Real.pi ^ 2 / 3 := by positivity + by_cases hv : |v| ≤ 2 * T + · have hh : |v / T| ≤ 2 := by + rw [abs_div, abs_of_pos hTp] + exact (div_le_iff₀ hTp).mpr hv + have hweight : 1 ≤ 27 * densityHeightWeight T v := by + unfold densityHeightWeight densityCubicWeight + have hd : (1 + |v / T|) ^ 3 ≤ 27 := by + have h := pow_le_pow_left₀ (by positivity : 0 ≤ 1 + |v / T|) + (by linarith : 1 + |v / T| ≤ 3) 3 + norm_num at h ⊢ + exact h + rw [mul_one_div] + apply (le_div_iff₀ (by positivity : 0 < (1 + |v / T|) ^ 3)).mpr + nlinarith + calc + _ ≤ 1 + 4 * Real.pi ^ 2 / 3 := densityCubicWeight_separated_sum S hsep v + _ ≤ (1 + 4 * Real.pi ^ 2 / 3) * (27 * densityHeightWeight T v) := + le_mul_of_one_le_right hK hweight + _ ≤ _ := by nlinarith + · have hv' : 2 * T < |v| := lt_of_not_ge hv + have hc : (S.card : ℝ) ≤ 4 * T := (density_separated_card S T hTp.le hS hsep).trans (by linarith) + have hTc : T ≤ T ^ 3 := by nlinarith [sq_nonneg (T - 1)] + calc + _ ≤ ∑ _x ∈ S, 64 / (T + |v|) ^ 3 := + Finset.sum_le_sum (fun x hx => density_kernel_far_bound T v x hTp (hS x hx) hv') + _ = (S.card : ℝ) * (64 / (T + |v|) ^ 3) := by simp + _ ≤ (4 * T) * (64 / (T + |v|) ^ 3) := mul_le_mul_of_nonneg_right hc (by positivity) + _ = 256 * T / (T + |v|) ^ 3 := by ring + _ ≤ 256 * T ^ 3 / (T + |v|) ^ 3 := + div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hTc (by norm_num)) (by positivity) + _ = 256 * densityHeightWeight T v := by rw [densityHeightWeight_eq T v hTp]; ring + _ ≤ _ := by nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelLineBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelLineBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..5606fc7ebe31c0da6f4c842c3c546eef4d89a9d2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelLineBound.lean @@ -0,0 +1,33 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityKernelStrip +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityGaussianCauchy + +namespace OAI + +/-! # The short-line kernel bound retaining its exact conductor exponent -/ + +namespace Ostmann + +open Complex + + theorem densitySquareKernel_short_line (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (c u : ℝ) (hc : 0 < c) (hc1 : c ≤ 1) : + ‖densitySquareKernel χ s ((c : ℂ) + u * I)‖ ≤ + (Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) * + ((χ.modulus : ℝ) * (|s.im| + 2)) ^ c / c) * densityHalfGaussian u := by + have hb := densityCompletedSquareWeight_bound χ s ((c : ℂ) + u * I) hs + (by simp; linarith) (by simp; linarith) + have he : ((c : ℂ) + u * I).re = c := by simp + have hi : ((c : ℂ) + u * I).im = u := by simp + rw [he, hi] at hb + have hn : c ≤ ‖(c : ℂ) + u * I‖ := by simpa only [he] using Complex.re_le_norm ((c : ℂ) + u * I) + rw [densitySquareKernel, norm_div] + apply (div_le_div_of_nonneg_left (norm_nonneg _) hc hn).trans + have hd := div_le_div_of_nonneg_right hb hc.le + unfold densityHalfGaussian + convert hd using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelPacking.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelPacking.lean new file mode 100644 index 0000000000000000000000000000000000000000..34192d70e360081ffc3bc61e523ea5d92fbf9659 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelPacking.lean @@ -0,0 +1,104 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import OAI.NumberTheory.Ostmann.Preliminaries.SeparatedSetSquares + +namespace OAI + +/-! # The cubic detector kernel on separated ordinates -/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable def densityCubicWeight (u : ℝ) : ℝ := 1 / (1 + |u|) ^ 3 + + theorem densityCubicWeight_nonneg (u : ℝ) : 0 ≤ densityCubicWeight u := by + unfold densityCubicWeight + positivity + + theorem densityCubicWeight_le_one (u : ℝ) : densityCubicWeight u ≤ 1 := by + unfold densityCubicWeight + apply (div_le_one (by positivity)).mpr + nlinarith [abs_nonneg u, sq_nonneg |u|] + + theorem densityCubicWeight_le_inverse_square (u : ℝ) (hu : u ≠ 0) : + densityCubicWeight u ≤ 1 / u ^ 2 := by + unfold densityCubicWeight + apply one_div_le_one_div_of_le (sq_pos_of_ne_zero hu) + have he : u ^ 2 = |u| ^ 2 := (sq_abs u).symm + rw [he] + nlinarith [abs_nonneg u, sq_nonneg |u|] + + theorem densityCubicWeight_rpow (u : ℝ) : + densityCubicWeight u = (1 + |u|) ^ (-(3 : ℝ)) := by + rw [Real.rpow_neg (by positivity), Real.rpow_ofNat] + simp [densityCubicWeight] + + theorem densityCubicWeight_separated_sum (S : Finset ℝ) + (hsep : ∀ x ∈ S, ∀ y ∈ S, x ≠ y → 1 ≤ |x - y|) (v : ℝ) : + (∑ x ∈ S, densityCubicWeight (v - x)) ≤ 1 + 4 * Real.pi ^ 2 / 3 := by + classical + let A := S.filter (fun x => |v - x| < 1 / 2) + let B := S.filter (fun x => ¬ |v - x| < 1 / 2) + have hA : A.card ≤ 1 := by + apply Finset.card_le_one.mpr + intro x hx y hy + by_contra hxy + have hx' := Finset.mem_filter.mp hx + have hy' := Finset.mem_filter.mp hy + have hd := hsep x hx'.1 y hy'.1 hxy + have ht : |x - y| ≤ |v - x| + |v - y| := by + calc + _ = |(v - y) - (v - x)| := by congr 1; ring + _ ≤ |v - y| + |v - x| := by + simpa only [sub_eq_add_neg, abs_neg] using abs_add_le (v - y) (-(v - x)) + _ = _ := by ring + linarith + have hnear : (∑ x ∈ A, densityCubicWeight (v - x)) ≤ 1 := by + calc + _ ≤ ∑ _x ∈ A, (1 : ℝ) := Finset.sum_le_sum (fun x _ => densityCubicWeight_le_one (v - x)) + _ = (A.card : ℝ) := by simp + _ ≤ 1 := by exact_mod_cast hA + let R := B.image (fun x => v - x) + have hinj : Function.Injective (fun x : ℝ => v - x) := by + intro x y h + linarith + have hRfirst : ∀ x ∈ R, (1 / 2 : ℝ) ≤ |x| := by + intro x hx + obtain ⟨y, hy, rfl⟩ := Finset.mem_image.mp hx + exact le_of_not_gt (Finset.mem_filter.mp hy).2 + have hRsep : ∀ x ∈ R, ∀ y ∈ R, x ≠ y → (1 / 2 : ℝ) ≤ |x - y| := by + intro x hx y hy hxy + obtain ⟨a, ha, rfl⟩ := Finset.mem_image.mp hx + obtain ⟨b, hb, rfl⟩ := Finset.mem_image.mp hy + have hab : a ≠ b := fun h => hxy (congrArg (fun z => v - z) h) + have h := hsep a (Finset.mem_filter.mp ha).1 b (Finset.mem_filter.mp hb).1 hab + have he : |(v - a) - (v - b)| = |a - b| := by + rw [show (v - a) - (v - b) = -(a - b) by ring, abs_neg] + rw [he] + linarith + have hfar := separated_set_inverse_squares R (1 / 2) (by norm_num) hRfirst hRsep + have hsumR : (∑ x ∈ B, 1 / (v - x) ^ 2) = ∑ x ∈ R, 1 / x ^ 2 := by + rw [Finset.sum_image] + exact fun x _ y _ h => hinj h + have hB : (∑ x ∈ B, densityCubicWeight (v - x)) ≤ 4 * Real.pi ^ 2 / 3 := by + calc + _ ≤ ∑ x ∈ B, 1 / (v - x) ^ 2 := by + apply Finset.sum_le_sum + intro x hx + apply densityCubicWeight_le_inverse_square + intro he + have h := (Finset.mem_filter.mp hx).2 + simp only [he, abs_zero] at h + norm_num at h + _ = ∑ x ∈ R, 1 / x ^ 2 := hsumR + _ ≤ Real.pi ^ 2 / (3 * (1 / 2) ^ 2) := hfar + _ = _ := by ring + have hsplit := Finset.sum_filter_add_sum_filter_not S + (fun x => |v - x| < 1 / 2) (fun x => densityCubicWeight (v - x)) + change (∑ x ∈ A, densityCubicWeight (v - x)) + + (∑ x ∈ B, densityCubicWeight (v - x)) = _ at hsplit + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelStrip.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelStrip.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d5b8411860605f4171982f21268378b48b84463 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityKernelStrip.lean @@ -0,0 +1,61 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySmoothedKernel + +namespace OAI + +/-! # Uniform control of the square kernel between two positive vertical lines -/ + +namespace Ostmann + +open Complex + + theorem densitySquareKernel_analytic (χ : PrimitiveComplexCharacter) (s w : ℂ) + (hs : s.re = 1 / 2) (hw : 0 < w.re) : + AnalyticAt ℂ (densitySquareKernel χ s) w := by + have hq : (χ.modulus : ℂ) ≠ 0 := by exact_mod_cast χ.positive.ne' + have hpos : 0 < (s + w).re := by simp only [add_re]; linarith + have hΓ : AnalyticAt ℂ (DirichletCharacter.gammaFactor χ.character) (s + w) := by + rw [analyticAt_iff_eventually_differentiableAt] + filter_upwards [(isOpen_lt continuous_const Complex.continuous_re).mem_nhds hpos] with z hz + exact χ.gammaFactor_differentiableAt_pos z hz + have hd : AnalyticAt ℂ (fun z => DirichletCharacter.gammaFactor χ.character (s + z)) w := + hΓ.comp (analyticAt_const.add analyticAt_id) + have hgn : DirichletCharacter.gammaFactor χ.character s ≠ 0 := by + intro he + exact χ.gammaInverse_ne_zero s (by linarith) + (by simp only [PrimitiveComplexCharacter.gammaInverse, he, inv_zero]) + have hwn : w ≠ 0 := by intro h; simp [h] at hw + exact ((((differentiable_id.const_cpow (Or.inl hq)).analyticAt w).mul + ((hd.div analyticAt_const hgn).pow 2)).mul ((analyticAt_id.pow 2).cexp)).div analyticAt_id hwn + + theorem densitySquareKernel_strip_bound (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (c x u : ℝ) (hc : 0 < c) (hcx : c ≤ x) (hx : x ≤ 1) : + ‖densitySquareKernel χ s ((x : ℂ) + u * I)‖ ≤ + (Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) * + ((χ.modulus : ℝ) * (|s.im| + 2)) / c) * Real.exp (-(u ^ 2) / 2) := by + let B := (χ.modulus : ℝ) * (|s.im| + 2) + have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive + have hB : 1 ≤ B := by dsimp [B]; nlinarith [abs_nonneg s.im] + have hw0 : 0 ≤ (((x : ℂ) + u * I).re) := by simp; linarith + have hw2 : (((x : ℂ) + u * I).re) ≤ 2 := by simp; linarith + have hb := densityCompletedSquareWeight_bound χ s ((x : ℂ) + u * I) hs hw0 hw2 + have he : ((x : ℂ) + u * I).re = x := by simp + have hi : ((x : ℂ) + u * I).im = u := by simp + rw [he, hi] at hb + have hp : B ^ x ≤ B := + (Real.rpow_le_rpow_of_exponent_le hB hx).trans_eq (Real.rpow_one B) + have hcn : c ≤ ‖(x : ℂ) + u * I‖ := by + exact hcx.trans (by simpa only [he] using Complex.re_le_norm ((x : ℂ) + u * I)) + rw [densitySquareKernel, norm_div] + apply (div_le_div_of_nonneg_left (norm_nonneg _) hc hcn).trans + apply (div_le_div_of_nonneg_right hb hc.le).trans + have h := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hp + (Real.exp_nonneg (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2))) (Real.exp_nonneg (-(u ^ 2) / 2)) + have hd := div_le_div_of_nonneg_right h hc.le + convert hd using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityLocalMultiplicity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityLocalMultiplicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..857b3cb7566c32f094af461e77ec4edaf275c063 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityLocalMultiplicity.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterFaithfulEnumeration + +namespace OAI + +/-! # Local ordinate bins retain the actual analytic zero multiplicities -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_local_index_count (χ : PrimitiveComplexCharacter) (S : Finset ℕ) (n : ℤ) + (hr : ∀ i ∈ S, 1 / 2 ≤ ((actualCharacterZeros χ).zeros i).re) + (hn : ∀ i ∈ S, ⌊((actualCharacterZeros χ).zeros i).im⌋ = n) : + (S.card : ℝ) ≤ Real.log (48 * (χ.modulus : ℝ) * (|(n : ℝ) + 1 / 2| + 2)) / + Real.log (14 / 13) := by + let Z := actualCharacterZeros χ + let F := S.image Z.zeros + have hcard : S.card = ∑ z ∈ F, (S.filter fun i => Z.zeros i = z).card := + Finset.card_eq_sum_card_image Z.zeros S + have hbound : (S.card : ℝ) ≤ ∑ z ∈ F, (characterZeroOrder χ z : ℝ) := by + rw [hcard, Nat.cast_sum] + apply Finset.sum_le_sum + intro z _ + have h := actualCharacterZeros_respectsMultiplicity χ S z + rw [characterZeroOrder_eq_nat] + exact_mod_cast h + have hlocal := characterZeroOrder_sum_le_local χ ((n : ℝ) + 1 / 2) F (by + intro z hz + obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hz + have h := character_floor_mem_disk (Z.zeros i) (hr i hi) (Z.in_strip i).2.le + change Z.zeros i ∈ Metric.closedBall (characterZeroCenter ((n : ℝ) + 1 / 2)) (13 / 8) + have hni : ⌊(Z.zeros i).im⌋ = n := hn i hi + simpa only [hni] using h) + have hlocalR : (∑ z ∈ F, (characterZeroOrder χ z : ℝ)) ≤ + (characterLocalZeroMass χ ((n : ℝ) + 1 / 2) : ℝ) := by exact_mod_cast hlocal + exact hbound.trans (hlocalR.trans (χ.local_zero_mass_bound _)) + + theorem density_local_index_log_bound (Q : ℕ) (hQ : 1 ≤ Q) (T : ℝ) (hT : 2 ≤ T) + (χ : PrimitiveComplexCharacter) (hχ : χ.modulus ≤ Q) (S : Finset ℕ) (n : ℤ) + (hr : ∀ i ∈ S, 1 / 2 ≤ ((actualCharacterZeros χ).zeros i).re) + (hn : ∀ i ∈ S, ⌊((actualCharacterZeros χ).zeros i).im⌋ = n) + (hcenter : |(n : ℝ) + 1 / 2| ≤ T + 1) : + (S.card : ℝ) ≤ (8 / Real.log (14 / 13)) * Real.log ((Q : ℝ) * T) := by + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hc : (χ.modulus : ℝ) ≤ Q := by exact_mod_cast hχ + have hcp : (0 : ℝ) < χ.modulus := by exact_mod_cast χ.positive + have hl : Real.log 2 ≤ Real.log ((Q : ℝ) * T) := Real.log_le_log (by norm_num) (by nlinarith) + have hlog : Real.log (48 * (χ.modulus : ℝ) * (|(n : ℝ) + 1 / 2| + 2)) ≤ + 8 * Real.log ((Q : ℝ) * T) := by + have hsize : 48 * (χ.modulus : ℝ) * (|(n : ℝ) + 1 / 2| + 2) ≤ + 128 * ((Q : ℝ) * T) := by + have h1 := mul_le_mul_of_nonneg_left hcenter (show 0 ≤ 48 * (χ.modulus : ℝ) by positivity) + have h2 := mul_le_mul_of_nonneg_right hc (show 0 ≤ 48 * (T + 3) by positivity) + nlinarith + apply (Real.log_le_log (by positivity) hsize).trans + rw [Real.log_mul (by norm_num) (by positivity)] + have h128 : Real.log 128 = 7 * Real.log 2 := by + have h := Real.log_pow (2 : ℝ) 7 + norm_num at h + exact h + rw [h128] + linarith + have h := (density_local_index_count χ S n hr hn).trans + (div_le_div_of_nonneg_right hlog (Real.log_pos (by norm_num : (1 : ℝ) < 14 / 13)).le) + convert h using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityLocalizedPolynomial.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityLocalizedPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe39a4932915eff9dd440f5827d1d706f47f10fb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityLocalizedPolynomial.lean @@ -0,0 +1,69 @@ +import Mathlib.Analysis.Distribution.SchwartzSpace.Fourier +import OAI.NumberTheory.Ostmann.Construction.PositiveFourierCutoff +import OAI.NumberTheory.Ostmann.Quadratic.QuadraticLogTranslation +import OAI.NumberTheory.Ostmann.Arithmetic.ScaledPoisson + +namespace OAI + +/-! # Exact Fourier localization for finite Dirichlet polynomials -/ + +namespace Ostmann + +open MeasureTheory +open scoped BigOperators SchwartzMap FourierTransform + +noncomputable def densityLocalizedPolynomial {ι : Type*} [Fintype ι] + (W : 𝓢(ℝ, ℂ)) (h : ℝ) (hh : 0 < h) (a : ι → ℂ) (freq : ι → ℝ) : 𝓢(ℝ, ℂ) := + ∑ j, a j • (positiveDilate W h⁻¹ (inv_pos.mpr hh)).compSubConstCLM ℂ (freq j) + + theorem densityLocalizedPolynomial_apply {ι : Type*} [Fintype ι] + (W : 𝓢(ℝ, ℂ)) (h : ℝ) (hh : 0 < h) (a : ι → ℂ) (freq : ι → ℝ) (x : ℝ) : + densityLocalizedPolynomial W h hh a freq x = + ∑ j, a j * W ((x - freq j) / h) := by + simp only [densityLocalizedPolynomial, sum_apply, smul_apply, + SchwartzMap.compSubConstCLM_apply, positiveDilate_apply, smul_eq_mul] + congr 1 + funext j + rw [div_eq_inv_mul] + + theorem densityLocalizedPolynomial_fourier {ι : Type*} [Fintype ι] + (W : 𝓢(ℝ, ℂ)) (h : ℝ) (hh : 0 < h) (a : ι → ℂ) (freq : ι → ℝ) (t : ℝ) : + 𝓕 (densityLocalizedPolynomial W h hh a freq) t = + (h : ℂ) * 𝓕 W (h * t) * ∑ j, a j * realAdditivePhase (-(freq j * t)) := by + simp only [densityLocalizedPolynomial, FourierTransform.fourier_sum, FourierTransform.fourier_smul, + sum_apply, smul_apply, quadratic_fourier_translate, + positiveDilate_fourier, div_inv_eq_mul, smul_eq_mul] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + rw [mul_comm t h] + push_cast + rw [inv_inv] + ring + + theorem densityLocalizedPolynomial_plancherel {ι : Type*} [Fintype ι] + (W : 𝓢(ℝ, ℂ)) (h : ℝ) (hh : 0 < h) (a : ι → ℂ) (freq : ι → ℝ) : + (∫ t : ℝ, h ^ 2 * ‖𝓕 W (h * t)‖ ^ 2 * + ‖∑ j, a j * realAdditivePhase (-(freq j * t))‖ ^ 2) = + ∫ x : ℝ, ‖∑ j, a j * W ((x - freq j) / h)‖ ^ 2 := by + have H := SchwartzMap.integral_norm_sq_fourier (densityLocalizedPolynomial W h hh a freq) + simpa only [densityLocalizedPolynomial_fourier, densityLocalizedPolynomial_apply, + norm_mul, mul_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hh] using H + + theorem density_localized_pointwise_bound {ι : Type*} [Fintype ι] + (W : 𝓢(ℝ, ℂ)) (c h T : ℝ) (hc : 0 < c) (hh : 0 < h) + (hwindow : h * T ≤ 1) (hW : ∀ t, |t| ≤ 1 → c ≤ ‖𝓕 W t‖) + (a : ι → ℂ) (freq : ι → ℝ) (t : ℝ) (ht : |t| ≤ T) : + h ^ 2 * c ^ 2 * ‖∑ j, a j * realAdditivePhase (-(freq j * t))‖ ^ 2 ≤ + ‖𝓕 (densityLocalizedPolynomial W h hh a freq) t‖ ^ 2 := by + have ht' : |h * t| ≤ 1 := by + rw [abs_mul, abs_of_pos hh] + exact (mul_le_mul_of_nonneg_left ht hh.le).trans hwindow + have hw := hW (h * t) ht' + rw [densityLocalizedPolynomial_fourier, norm_mul, norm_mul, mul_pow, mul_pow, + Complex.norm_real, Real.norm_eq_abs, abs_of_pos hh] + gcongr + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMollifierBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMollifierBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca8c245dd61ba591af08c688572a71fb1de20bac --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMollifierBound.lean @@ -0,0 +1,79 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityMollifierProduct +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorAnalytic + +namespace OAI + +/-! # Elementary growth bounds for the actual zero-detector product -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + + theorem densityMollifier_norm_le (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (hs : 0 ≤ s.re) : ‖densityMollifier X χ.character s‖ ≤ X := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + apply (norm_sum_le _ _).trans + calc + _ ≤ ∑ n ∈ Finset.Icc 1 X, (1 : ℝ) := by + apply Finset.sum_le_sum + intro n hn + have hnp : 0 < n := (Finset.mem_Icc.mp hn).1 + have hnR : (1 : ℝ) ≤ n := by exact_mod_cast hnp + have hμ : ‖(ArithmeticFunction.moebius n : ℂ)‖ ≤ 1 := by + norm_cast + exact ArithmeticFunction.abs_moebius_le_one + rw [norm_div, norm_mul, ← Complex.ofReal_natCast, + Complex.norm_cpow_eq_rpow_re_of_pos (by positivity)] + apply (div_le_div_of_nonneg_right + (mul_le_mul (χ.character.norm_le_one _) hμ (norm_nonneg _) zero_le_one) + (Real.rpow_nonneg (by positivity) s.re)).trans + rw [one_mul] + exact (div_le_one (Real.rpow_pos_of_pos (by positivity) s.re)).mpr + (Real.one_le_rpow hnR hs) + _ = _ := by simp [Nat.card_Icc] + + theorem density_L_short_positive_bound (χ : PrimitiveComplexCharacter) (z : ℂ) + (hz : 1 / 2 ≤ z.re) (hz3 : z.re ≤ 3) : + ‖χ.L z‖ ≤ 2 * ((χ.modulus : ℝ) + 1) * (3 + |z.im|) := by + have hzp : 0 < z.re := by linarith + have hn : ‖z‖ ≤ 3 + |z.im| := by + apply (Complex.norm_le_abs_re_add_abs_im z).trans + rw [abs_of_pos hzp] + linarith + apply (χ.L_norm_bound_positive z hzp).trans + apply (div_le_iff₀ hzp).mpr + have h1 := mul_le_mul_of_nonneg_right hn (show 0 ≤ (χ.modulus : ℝ) + 1 by positivity) + have h2 := mul_le_mul_of_nonneg_left hz + (show 0 ≤ 2 * ((χ.modulus : ℝ) + 1) * (3 + |z.im|) by positivity) + nlinarith + + theorem densityDetector_numerator_bound (χ : PrimitiveComplexCharacter) (X : ℕ) + (s : ℂ) (_hs : 1 / 2 ≤ s.re) (hs1 : s.re ≤ 1) (Y : ℝ) (hY : 1 ≤ Y) + (x u : ℝ) (hx : 1 / 2 - s.re ≤ x) (hx2 : x ≤ 2) : + ‖χ.L (s + ((x : ℂ) + u * I)) * densityMollifier X χ.character (s + ((x : ℂ) + u * I)) * + (Y : ℂ) ^ ((x : ℂ) + u * I)‖ ≤ + (2 * ((χ.modulus : ℝ) + 1) * X * Y ^ 2 * (3 + |s.im|)) * (1 + |u|) := by + have hz : 1 / 2 ≤ (s + ((x : ℂ) + u * I)).re := by simp; linarith + have hz3 : (s + ((x : ℂ) + u * I)).re ≤ 3 := by simp; linarith + have hL := density_L_short_positive_bound χ _ hz hz3 + have hM := densityMollifier_norm_le χ X _ (by linarith) + have hpow : ‖(Y : ℂ) ^ ((x : ℂ) + u * I)‖ ≤ Y ^ 2 := by + rw [Complex.norm_cpow_eq_rpow_re_of_pos (by linarith : 0 < Y)] + have he : (((x : ℂ) + u * I).re) = x := by simp + rw [he, ← Real.rpow_two] + exact Real.rpow_le_rpow_of_exponent_le hY hx2 + have him : |(s + ((x : ℂ) + u * I)).im| ≤ |s.im| + |u| := by + simpa using abs_add_le s.im u + rw [norm_mul, norm_mul] + apply (mul_le_mul (mul_le_mul hL hM (norm_nonneg _) (by positivity)) hpow + (norm_nonneg _) (by positivity)).trans + have hsimple : 3 + |(s + ((x : ℂ) + u * I)).im| ≤ (3 + |s.im|) * (1 + |u|) := by + nlinarith [abs_nonneg s.im, abs_nonneg u] + have h := mul_le_mul_of_nonneg_left hsimple + (show 0 ≤ 2 * ((χ.modulus : ℝ) + 1) * X * Y ^ 2 by positivity) + convert h using 1 <;> ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMollifierMean.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMollifierMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..23032f4a5ba51969580e6ea79d99abafe47a09bc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMollifierMean.lean @@ -0,0 +1,69 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityVerticalPolynomial + +namespace OAI + +/-! # The mean square of the actual critical-line Möbius polynomial -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators Classical + + theorem densityMollifier_vertical {q : ℕ} (X : ℕ) (χ : DirichletCharacter ℂ q) (σ t : ℝ) : + densityMollifier X χ (densityVerticalPoint σ t) = + ∑ n ∈ Finset.Icc 1 X, + densityVerticalCoeff (fun n => (ArithmeticFunction.moebius n : ℂ)) σ n * + χ (n : ZMod q) * realAdditivePhase (-(Real.log n * t)) := by + unfold densityMollifier + apply Finset.sum_congr rfl + intro n hn + rw [density_vertical_term _ σ t n (Finset.mem_Icc.mp hn).1] + unfold densityVerticalCoeff + ring + + theorem density_mobius_half_energy (X : ℕ) : + (∑ n ∈ Finset.Icc 1 X, + ‖densityVerticalCoeff (fun n => (ArithmeticFunction.moebius n : ℂ)) (1 / 2) n‖ ^ 2) ≤ + 1 + Real.log X := by + have hsum : (∑ n ∈ Finset.Icc 1 X, + ‖densityVerticalCoeff (fun n => (ArithmeticFunction.moebius n : ℂ)) (1 / 2) n‖ ^ 2) ≤ + ∑ n ∈ Finset.Icc 1 X, (n : ℝ)⁻¹ := by + apply Finset.sum_le_sum + intro n hn + rw [densityVerticalCoeff_half_square _ n (Finset.mem_Icc.mp hn).1] + have hm : ‖(ArithmeticFunction.moebius n : ℂ)‖ ≤ 1 := by + norm_cast + exact ArithmeticFunction.abs_moebius_le_one + have hsq : ‖(ArithmeticFunction.moebius n : ℂ)‖ ^ 2 ≤ 1 := by nlinarith [norm_nonneg (ArithmeticFunction.moebius n : ℂ)] + simpa only [one_div] using div_le_div_of_nonneg_right hsq (Nat.cast_nonneg n) + apply hsum.trans + simpa only [harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast] + using harmonic_le_one_add_log X + + theorem critical_mollifier_mean : + ∃ C : ℝ, 0 < C ∧ ∀ X Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + ∀ F : (q : ℕ) → Finset (DirichletCharacter ℂ q), + (∀ q ∈ Finset.Icc 1 Q, ∀ χ ∈ F q, χ.IsPrimitive) → + (∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, + ∫ t in Icc (-T) T, ‖densityMollifier X χ (densityVerticalPoint (1 / 2) t)‖ ^ 2) ≤ + C * ((X : ℝ) + (Q : ℝ) ^ 2 * T) * (1 + Real.log X) := by + obtain ⟨C, hC, hmean⟩ := hybrid_multiplicative_large_sieve + refine ⟨C, hC, ?_⟩ + intro X Q hQ T hT F hF + have h := hmean X Q hQ T hT + (densityVerticalCoeff (fun n => (ArithmeticFunction.moebius n : ℂ)) (1 / 2)) F hF + simp only [← densityMollifier_vertical] at h + exact h.trans (mul_le_mul_of_nonneg_left (density_mobius_half_energy X) (by positivity)) + + theorem density_divisor_half_energy (N : ℕ) (a : ℕ → ℂ) + (ha : ∀ n ∈ Finset.Icc 1 N, ‖a n‖ ≤ n.divisors.card) : + (∑ n ∈ Finset.Icc 1 N, ‖densityVerticalCoeff a (1 / 2) n‖ ^ 2) ≤ + (1 + Real.log N) ^ 4 := by + apply (Finset.sum_le_sum (fun n hn => ?_)).trans (density_divisor_square_harmonic N) + rw [densityVerticalCoeff_half_square _ n (Finset.mem_Icc.mp hn).1] + exact div_le_div_of_nonneg_right + (pow_le_pow_left₀ (norm_nonneg _) (ha n hn) 2) (Nat.cast_nonneg n) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMollifierProduct.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMollifierProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd916ea3562654ab592a730d18c85f24b05c64de --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMollifierProduct.lean @@ -0,0 +1,72 @@ +import Mathlib.NumberTheory.LSeries.Convolution +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorCoefficients +import OAI.NumberTheory.Ostmann.Characters.CharacterRightHalfPlane + +namespace OAI + +/-! # The actual finite mollifier times the character L-function -/ + +namespace Ostmann + +open scoped BigOperators Classical + +noncomputable def densityMollifierCoefficient {q : ℕ} (X : ℕ) + (χ : DirichletCharacter ℂ q) (n : ℕ) : ℂ := + χ (n : ZMod q) * densityMobiusCutoff X n + +noncomputable def densityMollifier {q : ℕ} (X : ℕ) (χ : DirichletCharacter ℂ q) (s : ℂ) : ℂ := + ∑ n ∈ Finset.Icc 1 X, χ (n : ZMod q) * (ArithmeticFunction.moebius n : ℂ) / (n : ℂ) ^ s + + theorem density_detector_convolution {q : ℕ} (X : ℕ) (χ : DirichletCharacter ℂ q) : + LSeries.convolution (fun n : ℕ => χ (n : ZMod q)) (densityMollifierCoefficient X χ) = + fun n : ℕ => χ (n : ZMod q) * densityDetectorCoefficient X n := by + funext n + rw [LSeries.convolution_def] + change (∑ p ∈ n.divisorsAntidiagonal, + χ (p.1 : ZMod q) * (χ (p.2 : ZMod q) * densityMobiusCutoff X p.2)) = _ + calc + _ = χ (n : ZMod q) * ∑ p ∈ n.divisorsAntidiagonal, densityMobiusCutoff X p.2 := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro p hp + have hm := (Nat.mem_divisorsAntidiagonal.mp hp).1 + rw [← mul_assoc, ← map_mul, ← Nat.cast_mul, hm] + _ = _ := by + rw [Nat.sum_divisorsAntidiagonal' (fun _ b => densityMobiusCutoff X b)] + rfl + + theorem densityMollifier_eq_LSeries {q : ℕ} (X : ℕ) (χ : DirichletCharacter ℂ q) (s : ℂ) : + densityMollifier X χ s = LSeries (densityMollifierCoefficient X χ) s := by + have hout (n : ℕ) (hn : n ∉ Finset.Icc 1 X) : + LSeries.term (densityMollifierCoefficient X χ) s n = 0 := by + by_cases hn0 : n = 0 + · subst n; simp + · have hnX : ¬n ≤ X := by simp only [Finset.mem_Icc] at hn; omega + rw [LSeries.term_of_ne_zero hn0] + simp only [densityMollifierCoefficient, densityMobiusCutoff, ite_eq_right hnX, mul_zero, zero_div] + rw [LSeries, tsum_eq_sum hout] + apply Finset.sum_congr rfl + intro n hn + have hnn := Finset.mem_Icc.mp hn + rw [LSeries.term_of_ne_zero (by omega : n ≠ 0)] + simp only [densityMollifierCoefficient, densityMobiusCutoff, ite_eq_left hnn.2] + + theorem densityMollifierCoefficient_norm {q : ℕ} [NeZero q] (X n : ℕ) + (χ : DirichletCharacter ℂ q) : ‖densityMollifierCoefficient X χ n‖ ≤ 1 := by + rw [densityMollifierCoefficient, norm_mul] + exact (mul_le_mul (χ.norm_le_one _) (densityMobiusCutoff_norm X n) + (norm_nonneg _) zero_le_one).trans_eq (one_mul 1) + + theorem density_mollifier_L_product {q : ℕ} [NeZero q] (X : ℕ) + (χ : DirichletCharacter ℂ q) (s : ℂ) (hs : 1 < s.re) : + LSeries (fun n : ℕ => χ (n : ZMod q) * densityDetectorCoefficient X n) s = + DirichletCharacter.LFunction χ s * densityMollifier X χ s := by + rw [← density_detector_convolution X χ, + LSeries_convolution' (χ.LSeriesSummable_of_one_lt_re hs) + (LSeriesSummable_of_bounded_of_one_lt_re + (fun n _ => densityMollifierCoefficient_norm X n χ) hs), + DirichletCharacter.LFunction_eq_LSeries χ hs, densityMollifier_eq_LSeries] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMomentCutoff.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMomentCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b28ee28dd35916fa410e997019f055fc2409b36 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMomentCutoff.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityHeadCutoff + +namespace OAI + +/-! # The integer cutoff for the actual fourth moment -/ + +namespace Ostmann + + theorem density_moment_cutoff (Q : ℕ) (hQ : 1 ≤ Q) (T : ℝ) (hT : 2 ≤ T) : + ∃ N : ℕ, 1 ≤ N ∧ 1 ≤ Real.log N ∧ 10 * (Q : ℝ) * T ≤ N ∧ + (N : ℝ) + (Q : ℝ) ^ 2 * T ≤ 17 * (Q : ℝ) ^ 2 * T ∧ + Real.log N ≤ 5 * Real.log ((Q : ℝ) * T) := by + let N := ⌈10 * (Q : ℝ) * T⌉₊ + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hqt : 2 ≤ (Q : ℝ) * T := by nlinarith + have hscale : 10 * (Q : ℝ) * T ≤ N := Nat.le_ceil _ + have hten : (10 : ℝ) ≤ N := by linarith + have hN : 1 ≤ N := by exact_mod_cast (show (1 : ℝ) ≤ N by linarith) + have hupper : (N : ℝ) ≤ 16 * ((Q : ℝ) * T) := by + have h := Nat.ceil_lt_add_one (by positivity : 0 ≤ 10 * (Q : ℝ) * T) + change (N : ℝ) < 10 * (Q : ℝ) * T + 1 at h + linarith + have hlogN : 1 ≤ Real.log N := by + have hlog10 : (1 : ℝ) ≤ Real.log 10 := by + have h := Real.le_log_one_add_of_nonneg (by norm_num : (0 : ℝ) ≤ 9) + norm_num at h + linarith + exact hlog10.trans (Real.log_le_log (by norm_num) hten) + refine ⟨N, hN, hlogN, hscale, ?_, ?_⟩ + · have hqtA : (Q : ℝ) * T ≤ (Q : ℝ) ^ 2 * T := by + have h := mul_le_mul_of_nonneg_right hq (by positivity : 0 ≤ (Q : ℝ) * T) + nlinarith + linarith + · have hlqt : Real.log 2 ≤ Real.log ((Q : ℝ) * T) := Real.log_le_log (by norm_num) hqt + have hlog := Real.log_le_log (show (0 : ℝ) < N by linarith) hupper + rw [Real.log_mul (by norm_num) (by positivity)] at hlog + have h16 : Real.log 16 = 4 * Real.log 2 := by + have h := Real.log_pow (2 : ℝ) 4 + norm_num at h + exact h + rw [h16] at hlog + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMomentDyadic.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMomentDyadic.lean new file mode 100644 index 0000000000000000000000000000000000000000..d42ced2ecbf0bc5a94ad77100b5d72ca2faecf47 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityMomentDyadic.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFourthMoment +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityWeightedMoment +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityMollifierMean +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorAnalytic + +namespace OAI + +/-! # Dyadic height bounds for the actual fourth and mollifier moments -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators + + theorem density_dyadic_height_log (Q : ℕ) (hQ : 1 ≤ Q) (T : ℝ) (hT : 2 ≤ T) (j : ℕ) : + Real.log ((Q : ℝ) * ((2 : ℝ) ^ j * T)) ≤ + (j + 1 : ℝ) * Real.log ((Q : ℝ) * T) := by + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hqt : 0 < (Q : ℝ) * T := by positivity + have hl : Real.log 2 ≤ Real.log ((Q : ℝ) * T) := + Real.log_le_log (by norm_num) (by nlinarith) + calc + _ = (j : ℝ) * Real.log 2 + Real.log ((Q : ℝ) * T) := by + rw [show (Q : ℝ) * ((2 : ℝ) ^ j * T) = (2 : ℝ) ^ j * ((Q : ℝ) * T) by ring, + Real.log_mul (by positivity) hqt.ne', Real.log_pow] + _ ≤ (j : ℝ) * Real.log ((Q : ℝ) * T) + Real.log ((Q : ℝ) * T) := + add_le_add (mul_le_mul_of_nonneg_left hl (Nat.cast_nonneg j)) le_rfl + _ = _ := by ring + + theorem density_L_fourth_family_continuous (F : Finset PrimitiveComplexCharacter) : + Continuous (fun t => ∑ χ ∈ F, ‖χ.L (densityVerticalPoint (1 / 2) t)‖ ^ 4) := by + apply continuous_finsetSum + intro χ _ + have hL : Continuous χ.L := continuous_iff_continuousAt.mpr (fun z => (χ.L_analytic z).continuousAt) + exact ((hL.comp (by unfold densityVerticalPoint; fun_prop)).norm.pow 4) + + theorem density_mollifier_family_continuous (F : Finset PrimitiveComplexCharacter) (X : ℕ) : + Continuous (fun t => ∑ χ ∈ F, + ‖densityMollifier X χ.character (densityVerticalPoint (1 / 2) t)‖ ^ 2) := by + apply continuous_finsetSum + intro χ _ + have hM : Continuous (densityMollifier X χ.character) := by + apply continuous_iff_continuousAt.mpr + intro z + simpa only [zero_add] using (densityMollifier_shift_analytic χ X 0 z).continuousAt + exact ((hM.comp (by unfold densityVerticalPoint; fun_prop)).norm.pow 2) + + theorem density_mollifier_primitive_mean : + ∃ C : ℝ, 0 < C ∧ ∀ X Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖densityMollifier X χ.character (densityVerticalPoint (1 / 2) t)‖ ^ 2) ≤ + C * ((X : ℝ) + (Q : ℝ) ^ 2 * T) * (1 + Real.log X) := by + obtain ⟨C, hC, hb⟩ := critical_mollifier_mean + refine ⟨C, hC, ?_⟩ + intro X Q hQ T hT F hF + rw [densityCharacterFamily_sum F Q hF (fun q χ => ∫ t in Icc (-T) T, + ‖densityMollifier X χ (densityVerticalPoint (1 / 2) t)‖ ^ 2)] + exact hb X Q hQ T hT (densityCharacterFamily F) + (fun q _ χ hχ => densityCharacterFamily_primitive F q χ hχ) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNearCritical.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNearCritical.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d221eac7428a8400fcfe5691742dd7fc3d418e1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNearCritical.lean @@ -0,0 +1,108 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import OAI.NumberTheory.Ostmann.Characters.CharacterFaithfulEnumeration + +namespace OAI + +/-! # Ordinary zero counting in the narrow strip next to the critical line -/ + +namespace Ostmann + +open scoped BigOperators + + theorem density_near_critical_power (B σ : ℝ) (hB : 1 < B) + (_hσ : 1 / 2 ≤ σ) (hσ1 : σ ≤ 1) (hnear : σ ≤ 1 / 2 + 1 / Real.log B) : + B ≤ Real.exp 2 * B ^ (3 * (1 - σ) / (2 - σ)) := by + let a := 3 * (1 - σ) / (2 - σ) + have hl : 0 < Real.log B := Real.log_pos hB + have hd : 0 < 2 - σ := by linarith + have he : (1 - a) * (2 - σ) = 2 * (σ - 1 / 2) := by + dsimp [a] + field_simp + ring + have ht : 2 * (σ - 1 / 2) ≤ 2 / Real.log B := by + rw [show 2 / Real.log B = 2 * (1 / Real.log B) by ring] + linarith + have hp : 2 / Real.log B ≤ (2 / Real.log B) * (2 - σ) := by + apply le_mul_of_one_le_right (by positivity) + linarith + have ha : 1 - a ≤ 2 / Real.log B := by nlinarith + have hm : (1 - a) * Real.log B ≤ 2 := by + have hh := mul_le_mul_of_nonneg_right ha hl.le + rwa [div_mul_cancel₀ _ hl.ne'] at hh + calc + B = Real.exp (Real.log B) := (Real.exp_log (by linarith)).symm + _ ≤ Real.exp (2 + Real.log B * a) := Real.exp_le_exp.mpr (by nlinarith) + _ = Real.exp 2 * B ^ a := by rw [Real.exp_add, Real.rpow_def_of_pos (by linarith)] + + theorem density_ordinary_family_bound (Q : ℕ) (hQ : 1 ≤ Q) (T : ℝ) (hT : 0 ≤ T) + (σ : ℝ) (F : Finset PrimitiveComplexCharacter) (hF : ∀ χ ∈ F, χ.modulus ≤ Q) : + (∑ χ ∈ F, ((actualCharacterZeros χ).count σ T : ℝ)) ≤ + (32 / Real.log (14 / 13)) * (Q : ℝ) ^ 2 * (T + 1) * + Real.log ((Q : ℝ) * (T + 2)) := by + calc + _ ≤ ∑ χ ∈ F, ((actualCharacterZeros χ).count 0 T : ℝ) := by + apply Finset.sum_le_sum + intro χ _ + apply Nat.cast_le.mpr + rw [ComplexZeroEnumeration.count_zero_eq_card] + exact Finset.card_filter_le _ _ + _ ≤ _ := family_zero_count_of_individual (32 / Real.log (14 / 13)) + (by positivity) + (fun χ U hU => (actualCharacterZeros χ).count_bound_of_multiplicity + (actualCharacterZeros_respectsMultiplicity χ) U hU) Q hQ T hT F hF + + theorem density_log_thirteen_absorption (x : ℝ) (hx : Real.log 2 ≤ x) : + x ≤ (Real.log 2)⁻¹ ^ 12 * x ^ 13 := by + have hl : 0 < Real.log 2 := Real.log_pos (by norm_num) + have hx0 : 0 ≤ x := hl.le.trans hx + have hp := pow_le_pow_left₀ hl.le hx 12 + have h : (Real.log 2) ^ 12 * x ≤ x ^ 13 := by + calc + _ ≤ x ^ 12 * x := mul_le_mul_of_nonneg_right hp hx0 + _ = _ := by ring + calc + x = (Real.log 2)⁻¹ ^ 12 * ((Real.log 2) ^ 12 * x) := by + rw [← mul_assoc, ← mul_pow, inv_mul_cancel₀ hl.ne', one_pow, one_mul] + _ ≤ _ := mul_le_mul_of_nonneg_left h (by positivity) + + theorem density_near_critical_family : + ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 1 ≤ Q → ∀ T σ : ℝ, 2 ≤ T → + 1 / 2 ≤ σ → σ ≤ 1 → σ ≤ 1 / 2 + 1 / Real.log ((Q : ℝ) ^ 2 * T) → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ((actualCharacterZeros χ).count σ T : ℝ)) ≤ + C * ((Q : ℝ) ^ 2 * T) ^ (3 * (1 - σ) / (2 - σ)) * + (Real.log ((Q : ℝ) * T)) ^ 13 := by + let C0 := 32 / Real.log (14 / 13) + refine ⟨4 * C0 * Real.exp 2 * (Real.log 2)⁻¹ ^ 12, by dsimp [C0]; positivity, ?_⟩ + intro Q hQ T σ hT hσ hσ1 hnear F hF + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hq0 : (0 : ℝ) < Q := by linarith + have hB : 1 < (Q : ℝ) ^ 2 * T := by nlinarith + have hl : Real.log 2 ≤ Real.log ((Q : ℝ) * T) := + Real.log_le_log (by norm_num) (by nlinarith) + have hl0 : 0 ≤ Real.log ((Q : ℝ) * T) := (Real.log_pos (by norm_num : (1 : ℝ) < 2)).le.trans hl + have hlog : Real.log ((Q : ℝ) * (T + 2)) ≤ 2 * Real.log ((Q : ℝ) * T) := by + calc + _ ≤ Real.log (2 * ((Q : ℝ) * T)) := Real.log_le_log (by positivity) (by nlinarith) + _ = Real.log 2 + Real.log ((Q : ℝ) * T) := Real.log_mul (by norm_num) (by positivity) + _ ≤ _ := by linarith + have hC : 0 ≤ C0 := by dsimp [C0]; positivity + have hlog0 : 0 ≤ Real.log ((Q : ℝ) * (T + 2)) := + Real.log_nonneg (by nlinarith) + have hordinary := density_ordinary_family_bound Q hQ T (by linarith) σ F hF + have hpow := density_near_critical_power ((Q : ℝ) ^ 2 * T) σ hB hσ hσ1 hnear + have habs := density_log_thirteen_absorption (Real.log ((Q : ℝ) * T)) hl + calc + _ ≤ C0 * (Q : ℝ) ^ 2 * (T + 1) * Real.log ((Q : ℝ) * (T + 2)) := hordinary + _ ≤ C0 * (Q : ℝ) ^ 2 * (2 * T) * (2 * Real.log ((Q : ℝ) * T)) := by + apply mul_le_mul _ hlog hlog0 (by positivity) + exact mul_le_mul_of_nonneg_left (by linarith : T + 1 ≤ 2 * T) (by positivity) + _ = 4 * C0 * ((Q : ℝ) ^ 2 * T) * Real.log ((Q : ℝ) * T) := by ring + _ ≤ 4 * C0 * (Real.exp 2 * ((Q : ℝ) ^ 2 * T) ^ (3 * (1 - σ) / (2 - σ))) * + ((Real.log 2)⁻¹ ^ 12 * (Real.log ((Q : ℝ) * T)) ^ 13) := by + exact mul_le_mul (mul_le_mul_of_nonneg_left hpow (by positivity)) habs hl0 (by positivity) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNormalizedEquation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNormalizedEquation.lean new file mode 100644 index 0000000000000000000000000000000000000000..d6af3fdf0d4e6a9fbb682eb21ba0919d81dc34cb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNormalizedEquation.lean @@ -0,0 +1,71 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySquareEquation +import OAI.NumberTheory.Ostmann.ZeroDensity.CompletedCharacterConjugation + +namespace OAI + +/-! # The normalized square functional equation on the critical line -/ + +namespace Ostmann + +open Complex +open scoped ComplexConjugate + +noncomputable def densitySmoothedSquare (χ : PrimitiveComplexCharacter) (s : ℂ) : ℂ := + densitySquareIntegral χ s / densitySquareNormalizer χ s + +noncomputable def densitySquareRootFactor (χ : PrimitiveComplexCharacter) (s : ℂ) : ℂ := + (@DirichletCharacter.rootNumber χ.modulus ⟨χ.positive.ne'⟩ χ.character) ^ 2 * + densitySquareNormalizer χ.inverse (1 - s) / densitySquareNormalizer χ s + + theorem density_critical_reflection (s : ℂ) (hs : s.re = 1 / 2) : 1 - s = conj s := by + apply Complex.ext <;> simp [hs] + ring + + theorem densitySquareNormalizer_reflected_norm (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : + ‖densitySquareNormalizer χ.inverse (1 - s)‖ = ‖densitySquareNormalizer χ s‖ := by + have hq : (0 : ℝ) < χ.modulus := by exact_mod_cast χ.positive + rw [density_critical_reflection s hs] + unfold densitySquareNormalizer + rw [χ.gammaFactor_inverse_conj] + simp only [norm_mul, norm_pow, norm_conj, PrimitiveComplexCharacter.inverse_modulus] + congr 1 + rw [← Complex.ofReal_natCast, Complex.norm_cpow_eq_rpow_re_of_pos hq, + Complex.norm_cpow_eq_rpow_re_of_pos hq, Complex.conj_re] + + theorem densitySquareRootFactor_norm (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : ‖densitySquareRootFactor χ s‖ = 1 := by + rw [densitySquareRootFactor, norm_div, norm_mul, norm_pow, χ.rootNumber_norm_eq_one, + one_pow, one_mul, densitySquareNormalizer_reflected_norm χ s hs] + exact div_self (norm_ne_zero_iff.mpr (densitySquareNormalizer_ne_zero χ s (by linarith))) + + theorem density_L_square_equation (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : + χ.L s ^ 2 = densitySmoothedSquare χ s + + densitySquareRootFactor χ s * densitySmoothedSquare χ.inverse (1 - s) := by + have hp : 0 < s.re := by linarith + have hi : 0 < (1 - s).re := by simp; linarith + have hn := densitySquareNormalizer_ne_zero χ s hp + have hni := densitySquareNormalizer_ne_zero χ.inverse (1 - s) hi + have he := congrArg (fun z : ℂ => z / densitySquareNormalizer χ s) + (densityCompletedSquare_equation χ s hs) + rw [densityCompletedSquare_div χ s hp] at he + rw [he] + unfold densitySmoothedSquare densitySquareRootFactor + field_simp + + theorem density_L_fourth_bound (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : + ‖χ.L s‖ ^ 4 ≤ 2 * ‖densitySmoothedSquare χ s‖ ^ 2 + + 2 * ‖densitySmoothedSquare χ.inverse (1 - s)‖ ^ 2 := by + have he := norm_add_le (densitySmoothedSquare χ s) + (densitySquareRootFactor χ s * densitySmoothedSquare χ.inverse (1 - s)) + rw [← density_L_square_equation χ s hs, norm_pow, norm_mul, + densitySquareRootFactor_norm χ s hs, one_mul] at he + have hh := pow_le_pow_left₀ (sq_nonneg ‖χ.L s‖) he 2 + nlinarith [sq_nonneg (‖densitySmoothedSquare χ s‖ - + ‖densitySmoothedSquare χ.inverse (1 - s)‖)] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNumerics.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNumerics.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ffc2a112eaaf7ee46b446a6871aec3e97be2128 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNumerics.lean @@ -0,0 +1,47 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityNumericsScales + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +theorem exists_density_numerical_constant : + ∃ C : ℝ, 0 < C ∧ ∀ (Q H : ℕ) (σ : ℝ), + 1 ≤ Q → 1 ≤ H → 0 ≤ σ → σ ≤ 1 → + 4*(detectorBlockCount (detectorLength Q H (Q^2*H)) : ℝ) * + ∑ j ∈ Finset.range (detectorBlockCount (detectorLength Q H (Q^2*H))), + (((2^j*(Q^2*H) : ℕ) : ℝ)+(Q : ℝ)^2*H) * (1+Real.log Q) * + (1+Real.log (2*(2^j*(Q^2*H) : ℕ) : ℝ))^7 * + (2^j*(Q^2*H) : ℕ) * ((2^j*(Q^2*H) : ℕ) : ℝ)^(-2*σ) ≤ + C*((Q^2*H : ℕ):ℝ)^(10*(1-σ))*(1+Real.log (Q*H : ℕ))^10 := by + let D : ℝ := 265/Real.log 2+1 + have hD : 0 < D := by + have : 0 < Real.log (2:ℝ) := Real.log_pos (by norm_num) + dsimp [D] + positivity + refine ⟨8*512^2*2048^7*D^2,by positivity,?_⟩ + intro Q H σ hQ hH hσ hσ1 + let J := detectorBlockCount (detectorLength Q H (Q^2*H)) + let B : ℝ := (Q^2*H : ℕ) + let L : ℝ := 1+Real.log (Q*H : ℕ) + let U : ℕ → ℝ := fun j => (2^j*(Q^2*H) : ℕ) + have hnat := density_nat_scales hQ hH + have hlogs := density_log_scales hQ hH + have hB : 1 ≤ B := by dsimp [B]; exact_mod_cast hnat.1 + have hU (j : ℕ) (hj : j ∈ Finset.range J) : B ≤ U j ∧ U j ≤ 512*B^5 := by + have hh := hnat.2.2.2 j (Finset.mem_range.mp hj) + constructor + · dsimp [B,U]; exact_mod_cast hh.1 + · dsimp [B,U]; exact_mod_cast hh.2 + have hb := density_sum_bound U hB hlogs.1 hD.le (density_block_count_bound hQ hH) + hlogs.2.1 hlogs.2.2.1 hσ hσ1 hU + (fun j hj => (hlogs.2.2.2.2 (U j) (hU j hj).1 (hU j hj).2).1) + (fun j hj => (hlogs.2.2.2.2 (U j) (hU j hj).1 (hU j hj).2).2) + simpa only [U,B,L,J,Nat.cast_mul,Nat.cast_pow,Nat.cast_ofNat] using hb + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNumericsBasic.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNumericsBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2c269e55a8d9040842ea3950cd76074b3dbd807 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNumericsBasic.lean @@ -0,0 +1,75 @@ +import Mathlib + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +theorem density_power_bound {B U σ : ℝ} (hB : 1 ≤ B) (hBU : B ≤ U) + (hU : U ≤ 512 * B^5) (hσ : 0 ≤ σ) (hσ1 : σ ≤ 1) : + (U+B)*U*U^(-2*σ) ≤ (2*512^2 : ℝ)*B^(10*(1-σ)) := by + have hBp : 0 < B := by linarith + have hUp : 0 < U := lt_of_lt_of_le hBp hBU + have ha : 0 ≤ 2*(1-σ) := by positivity + have hb : 2*(1-σ) ≤ 2 := by linarith + have hp : U^2*U^(-2*σ) = U^(2*(1-σ)) := by + rw [← Real.rpow_natCast U 2, ← Real.rpow_add hUp] + congr 1 + ring + have hc : (512 : ℝ)^(2*(1-σ)) ≤ 512^2 := by + simpa only [Real.rpow_two] using + Real.rpow_le_rpow_of_exponent_le (by norm_num : (1:ℝ) ≤ 512) hb + calc + (U+B)*U*U^(-2*σ) ≤ (2*U)*U*U^(-2*σ) := by + gcongr + linarith + _ = 2*U^(2*(1-σ)) := by rw [show 2*U*U = 2*U^2 by ring, mul_assoc, hp] + _ ≤ 2*(512*B^5)^(2*(1-σ)) := by gcongr + _ = 2*((512:ℝ)^(2*(1-σ))*B^(10*(1-σ))) := by + rw [Real.mul_rpow (by norm_num) (by positivity), + ← Real.rpow_natCast B 5, ← Real.rpow_mul hBp.le] + congr 3 + ring + _ ≤ _ := by + rw [← mul_assoc] + exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hc (by norm_num)) + (Real.rpow_nonneg hBp.le _) + +theorem density_sum_bound {J : ℕ} {B L D σ A : ℝ} (U : ℕ → ℝ) + (hB : 1 ≤ B) (hL : 1 ≤ L) (_hD : 0 ≤ D) + (hJ : (J:ℝ) ≤ D*L) (hA0 : 0 ≤ A) (hA : A ≤ L) + (hσ : 0 ≤ σ) (hσ1 : σ ≤ 1) + (hU : ∀ j ∈ Finset.range J, B ≤ U j ∧ U j ≤ 512*B^5) + (hlog0 : ∀ j ∈ Finset.range J, 0 ≤ 1+Real.log (2*U j)) + (hlog : ∀ j ∈ Finset.range J, 1+Real.log (2*U j) ≤ 2048*L) : + 4*(J:ℝ)*∑ j ∈ Finset.range J, + (U j+B)*A*(1+Real.log (2*U j))^7*U j*(U j)^(-2*σ) ≤ + (8*512^2*2048^7*D^2)*B^(10*(1-σ))*L^10 := by + have hLn : 0 ≤ L := by linarith + have hterm (j : ℕ) (hj : j ∈ Finset.range J) : + (U j+B)*A*(1+Real.log (2*U j))^7*U j*(U j)^(-2*σ) ≤ + (2*512^2)*2048^7*B^(10*(1-σ))*L^8 := by + have hp := density_power_bound hB (hU j hj).1 (hU j hj).2 hσ hσ1 + calc + _ = ((U j+B)*U j*(U j)^(-2*σ))*A*(1+Real.log (2*U j))^7 := by ring + _ ≤ ((2*512^2)*B^(10*(1-σ)))*L*(2048*L)^7 := by + apply mul_le_mul + · exact mul_le_mul hp hA hA0 (by positivity) + · exact pow_le_pow_left₀ (hlog0 j hj) (hlog j hj) 7 + · exact pow_nonneg (hlog0 j hj) 7 + · positivity + _ = _ := by ring + calc + _ ≤ 4*(J:ℝ)*∑ _j ∈ Finset.range J, + (2*512^2)*2048^7*B^(10*(1-σ))*L^8 := by + exact mul_le_mul_of_nonneg_left (Finset.sum_le_sum hterm) (by positivity) + _ = 4*(J:ℝ)^2*((2*512^2)*2048^7*B^(10*(1-σ))*L^8) := by simp; ring + _ ≤ 4*(D*L)^2*((2*512^2)*2048^7*B^(10*(1-σ))*L^8) := by gcongr + _ = _ := by ring + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNumericsScales.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNumericsScales.lean new file mode 100644 index 0000000000000000000000000000000000000000..1765cddc86e8acb9e521d7f21cb8accf06365fdd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityNumericsScales.lean @@ -0,0 +1,103 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityNumericsBasic +import OAI.NumberTheory.Ostmann.ZeroDensity.DetectorLength +import OAI.NumberTheory.Ostmann.ZeroDensity.DyadicDetector + +namespace OAI + +noncomputable section +namespace Ostmann.ZeroDensity + +theorem density_nat_scales {Q H : ℕ} (hQ : 1 ≤ Q) (hH : 1 ≤ H) : + let B := Q^2*H + let N := detectorLength Q H B + let J := detectorBlockCount N + 1 ≤ B ∧ 1 ≤ N ∧ N ≤ 256*B^5 ∧ + ∀ j < J, B ≤ 2^j*B ∧ 2^j*B ≤ 512*B^5 := by + dsimp only + let B := Q^2*H + let N := detectorLength Q H B + have hB : 1 ≤ B := by + have : 0 < B := by dsimp [B]; positivity + omega + have hN : 1 ≤ N := hB.trans (detectorLength_ge hQ hH hB) + have hBN : B*N ≤ 256*B^5 := detector_support_length_le hQ + have hNN : N ≤ B*N := by simpa using Nat.mul_le_mul_right N hB + refine ⟨hB,hN,hNN.trans hBN,?_⟩ + intro j hj + have hpow : 1 ≤ 2^j := by + have : 0 < (2:ℕ)^j := by positivity + omega + refine ⟨by simpa using Nat.mul_le_mul_right B hpow,?_⟩ + calc + 2^j*B ≤ 2^(detectorBlockCount N)*B := by gcongr + _ ≤ (2*N)*B := Nat.mul_le_mul_right B (detectorBlockCount_pow_le hN) + _ = 2*(B*N) := by ring + _ ≤ 2*(256*B^5) := Nat.mul_le_mul_left 2 hBN + _ = _ := by ring + +theorem density_log_scales {Q H : ℕ} (hQ : 1 ≤ Q) (hH : 1 ≤ H) : + let B : ℝ := (Q^2*H : ℕ) + let L : ℝ := 1+Real.log (Q*H : ℕ) + 1 ≤ L ∧ 0 ≤ 1+Real.log (Q:ℝ) ∧ 1+Real.log (Q:ℝ) ≤ L ∧ + Real.log B ≤ 2*Real.log (Q*H : ℕ) ∧ + ∀ U : ℝ, B ≤ U → U ≤ 512*B^5 → + 0 ≤ 1+Real.log (2*U) ∧ 1+Real.log (2*U) ≤ 2048*L := by + dsimp only + have hQr : (1:ℝ) ≤ Q := by exact_mod_cast hQ + have hHr : (1:ℝ) ≤ H := by exact_mod_cast hH + have hQp : (0:ℝ) < Q := by linarith + have hHp : (0:ℝ) < H := by linarith + have hqlog : 0 ≤ Real.log (Q:ℝ) := Real.log_nonneg hQr + have hhlog : 0 ≤ Real.log (H:ℝ) := Real.log_nonneg hHr + have hlog : Real.log (Q*H : ℕ) = Real.log (Q:ℝ)+Real.log (H:ℝ) := by + push_cast + exact Real.log_mul (ne_of_gt hQp) (ne_of_gt hHp) + have hBlog : Real.log (Q^2*H : ℕ) = 2*Real.log (Q:ℝ)+Real.log (H:ℝ) := by + push_cast + rw [Real.log_mul (by positivity) (ne_of_gt hHp), Real.log_pow] + norm_num + have hB : (1:ℝ) ≤ (Q^2*H : ℕ) := by + exact_mod_cast (density_nat_scales hQ hH).1 + refine ⟨by rw [hlog]; linarith, by linarith, by rw [hlog]; linarith, + by rw [hBlog,hlog]; linarith, ?_⟩ + intro U hBU hU + have hUp : 0 < U := by linarith + have h2U : 1 ≤ 2*U := by linarith + refine ⟨by linarith [Real.log_nonneg h2U],?_⟩ + have hlarge : 2*U ≤ 1024*((Q^2*H : ℕ):ℝ)^5 := by linarith + have hlogU := Real.log_le_log (by positivity : (0:ℝ)<2*U) hlarge + rw [Real.log_mul (x := 1024) (y := ((Q^2*H : ℕ):ℝ)^5) (by norm_num) (by positivity), Real.log_pow] at hlogU + have hc := Real.log_le_sub_one_of_pos (by norm_num : (0:ℝ)<1024) + simp only [hBlog,hlog] at hlogU ⊢ + norm_num only [Nat.cast_ofNat] at hlogU + norm_num only [show (1024:ℝ)-1=1023 by norm_num] at hc + linarith + +theorem density_block_count_bound {Q H : ℕ} (hQ : 1 ≤ Q) (hH : 1 ≤ H) : + (detectorBlockCount (detectorLength Q H (Q^2*H)) : ℝ) ≤ + (265/Real.log 2+1)*(1+Real.log (Q*H : ℕ)) := by + let N := detectorLength Q H (Q^2*H) + have hsc := density_nat_scales hQ hH + have hN : (0:ℝ) densityCubicWeight (v - t i) * + ‖(c i).L (densityVerticalPoint (1 / 2) v)‖ ^ 4)) ∧ + (∑ i ∈ S, ∫ v, densityCubicWeight (v - t i) * + ‖(c i).L (densityVerticalPoint (1 / 2) v)‖ ^ 4) ≤ + C * ((Q : ℝ) ^ 2 * T) * (Real.log ((Q : ℝ) * T)) ^ 6 := by + obtain ⟨C, hC, hb⟩ := density_weighted_fourth_moment + refine ⟨densityKernelPackingConstant * C, mul_pos densityKernelPackingConstant_pos hC, ?_⟩ + intro Q hQ T hT ι S c t hc ht hs + have hF : ∀ χ ∈ S.image c, χ.modulus ≤ Q := by + intro χ hχ + obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hχ + exact hc i hi + obtain ⟨hi, hm⟩ := hb Q hQ T hT (S.image c) hF + obtain ⟨hpi, hpm⟩ := density_packed_moment S c t T (by linarith) ht hs + (fun χ v => ‖χ.L (densityVerticalPoint (1 / 2) v)‖ ^ 4) + (fun χ => by simpa using density_L_fourth_family_continuous {χ}) + (fun _ _ => by positivity) hi + refine ⟨hpi, hpm.trans ?_⟩ + have h := mul_le_mul_of_nonneg_left hm densityKernelPackingConstant_pos.le + convert h using 1; ring + + theorem density_packed_mollifier_mean : + ∃ C : ℝ, 0 < C ∧ ∀ X Q : ℕ, 1 ≤ X → 1 ≤ Q → ∀ T : ℝ, 2 ≤ T → + ∀ {ι : Type} (S : Finset ι) (c : ι → PrimitiveComplexCharacter) (t : ι → ℝ), + (∀ i ∈ S, (c i).modulus ≤ Q) → (∀ i ∈ S, |t i| ≤ T) → + (∀ i ∈ S, ∀ j ∈ S, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∀ i ∈ S, Integrable (fun v => densityCubicWeight (v - t i) * + ‖densityMollifier X (c i).character (densityVerticalPoint (1 / 2) v)‖ ^ 2)) ∧ + (∑ i ∈ S, ∫ v, densityCubicWeight (v - t i) * + ‖densityMollifier X (c i).character (densityVerticalPoint (1 / 2) v)‖ ^ 2) ≤ + C * ((X : ℝ) + (Q : ℝ) ^ 2 * T) * (1 + Real.log X) := by + obtain ⟨C, hC, hb⟩ := density_weighted_mollifier_mean + refine ⟨densityKernelPackingConstant * C, mul_pos densityKernelPackingConstant_pos hC, ?_⟩ + intro X Q hX hQ T hT ι S c t hc ht hs + have hF : ∀ χ ∈ S.image c, χ.modulus ≤ Q := by + intro χ hχ + obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hχ + exact hc i hi + obtain ⟨hi, hm⟩ := hb X Q hX hQ T hT (S.image c) hF + obtain ⟨hpi, hpm⟩ := density_packed_moment S c t T (by linarith) ht hs + (fun χ v => ‖densityMollifier X χ.character (densityVerticalPoint (1 / 2) v)‖ ^ 2) + (fun χ => by simpa using density_mollifier_family_continuous {χ} X) + (fun _ _ => by positivity) hi + refine ⟨hpi, hpm.trans ?_⟩ + have h := mul_le_mul_of_nonneg_left hm densityKernelPackingConstant_pos.le + convert h using 1; ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPackedMoment.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPackedMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..9d09b31f8572570efdfa6024c24f745c7f77c86e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPackedMoment.lean @@ -0,0 +1,98 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityKernelHeightPacking + +namespace OAI + +/-! # Summing translated moments over characterwise separated ordinates -/ + +namespace Ostmann + +open MeasureTheory +open scoped BigOperators Classical + +noncomputable def densityKernelPackingConstant : ℝ := 256 + 27 * (1 + 4 * Real.pi ^ 2 / 3) + + theorem densityKernelPackingConstant_pos : 0 < densityKernelPackingConstant := by + unfold densityKernelPackingConstant + positivity + + theorem density_indexed_kernel_packing {ι : Type*} (S : Finset ι) (t : ι → ℝ) + (T : ℝ) (hT : 1 ≤ T) (ht : ∀ i ∈ S, |t i| ≤ T) + (hsep : ∀ i ∈ S, ∀ j ∈ S, i ≠ j → 1 ≤ |t i - t j|) (v : ℝ) : + (∑ i ∈ S, densityCubicWeight (v - t i)) ≤ densityKernelPackingConstant * densityHeightWeight T v := by + classical + have hinj : Set.InjOn t S := by + intro i hi j hj he + by_contra hij + have h := hsep i hi j hj hij + rw [he, sub_self, abs_zero] at h + norm_num at h + have hb := density_kernel_height_packing (S.image t) T hT + (by intro x hx; obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hx; exact ht i hi) + (by + intro x hx y hy hxy + obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hx + obtain ⟨j, hj, rfl⟩ := Finset.mem_image.mp hy + exact hsep i hi j hj (fun he => hxy (congrArg t he))) v + rwa [Finset.sum_image (fun _ hi _ hj he => hinj hi hj he)] at hb + + theorem density_packed_pointwise {ι κ : Type*} (S : Finset ι) (c : ι → κ) (t : ι → ℝ) + (T : ℝ) (hT : 1 ≤ T) (ht : ∀ i ∈ S, |t i| ≤ T) + (hsep : ∀ i ∈ S, ∀ j ∈ S, c i = c j → i ≠ j → 1 ≤ |t i - t j|) + (f : κ → ℝ → ℝ) (hf0 : ∀ a v, 0 ≤ f a v) (v : ℝ) : + (∑ i ∈ S, densityCubicWeight (v - t i) * f (c i) v) ≤ + densityKernelPackingConstant * (densityHeightWeight T v * ∑ a ∈ S.image c, f a v) := by + classical + have hmap : ∀ i ∈ S, c i ∈ S.image c := fun i hi => Finset.mem_image.mpr ⟨i, hi, rfl⟩ + rw [← Finset.sum_fiberwise_of_maps_to hmap] + calc + _ = ∑ a ∈ S.image c, (∑ i ∈ S.filter (fun i => c i = a), densityCubicWeight (v - t i)) * f a v := by + apply Finset.sum_congr rfl + intro a _ + rw [Finset.sum_mul] + apply Finset.sum_congr rfl + intro i hi + rw [(Finset.mem_filter.mp hi).2] + _ ≤ ∑ a ∈ S.image c, (densityKernelPackingConstant * densityHeightWeight T v) * f a v := by + apply Finset.sum_le_sum + intro a _ + apply mul_le_mul_of_nonneg_right _ (hf0 a v) + apply density_indexed_kernel_packing _ t T hT + · intro i hi + exact ht i (Finset.mem_filter.mp hi).1 + · intro i hi j hj hij + have hi' := Finset.mem_filter.mp hi + have hj' := Finset.mem_filter.mp hj + exact hsep i hi'.1 j hj'.1 (hi'.2.trans hj'.2.symm) hij + _ = _ := by rw [← Finset.mul_sum]; ring + + theorem density_packed_moment {ι κ : Type*} (S : Finset ι) (c : ι → κ) (t : ι → ℝ) + (T : ℝ) (hT : 1 ≤ T) (ht : ∀ i ∈ S, |t i| ≤ T) + (hsep : ∀ i ∈ S, ∀ j ∈ S, c i = c j → i ≠ j → 1 ≤ |t i - t j|) + (f : κ → ℝ → ℝ) (hf : ∀ a, Continuous (f a)) (hf0 : ∀ a v, 0 ≤ f a v) + (hint : Integrable (fun v => densityHeightWeight T v * ∑ a ∈ S.image c, f a v)) : + (∀ i ∈ S, Integrable (fun v => densityCubicWeight (v - t i) * f (c i) v)) ∧ + (∑ i ∈ S, ∫ v, densityCubicWeight (v - t i) * f (c i) v) ≤ + densityKernelPackingConstant * ∫ v, densityHeightWeight T v * ∑ a ∈ S.image c, f a v := by + classical + have hc : Continuous densityCubicWeight := by + unfold densityCubicWeight + exact continuous_const.div ((continuous_const.add continuous_abs).pow 3) (fun _ => by positivity) + have hi (i : ι) (hi : i ∈ S) : Integrable (fun v => densityCubicWeight (v - t i) * f (c i) v) := by + apply (hint.const_mul densityKernelPackingConstant).mono' + (((hc.comp (continuous_id.sub continuous_const)).mul (hf (c i))).aestronglyMeasurable) + filter_upwards with v + change ‖densityCubicWeight (v - t i) * f (c i) v‖ ≤ _ + rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (densityCubicWeight_nonneg _) (hf0 _ _))] + exact (Finset.single_le_sum + (f := fun j => densityCubicWeight (v - t j) * f (c j) v) + (fun j _ => mul_nonneg (densityCubicWeight_nonneg _) (hf0 _ _)) hi).trans + (density_packed_pointwise S c t T hT ht hsep f hf0 v) + refine ⟨hi, ?_⟩ + rw [← integral_finsetSum S hi, ← integral_const_mul] + apply integral_mono (integrable_finsetSum S hi) (hint.const_mul _) + intro v + exact density_packed_pointwise S c t T hT ht hsep f hf0 v + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPackedProduct.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPackedProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..c705fedadadafaba3e2513ffdc4541ebad14cdde --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPackedProduct.lean @@ -0,0 +1,76 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityCubicIntegrability + +namespace OAI + +/-! # The fourth-power bound for the actual detector product -/ + +namespace Ostmann + +open MeasureTheory +open scoped BigOperators Classical + + theorem density_packed_product_fourth : + ∃ C : ℝ, 0 < C ∧ ∀ X Q : ℕ, 1 ≤ X → 1 ≤ Q → ∀ T : ℝ, 2 ≤ T → + ∀ {ι : Type} (S : Finset ι) (c : ι → PrimitiveComplexCharacter) (t : ι → ℝ), + (∀ i ∈ S, (c i).modulus ≤ Q) → (∀ i ∈ S, |t i| ≤ T) → + (∀ i ∈ S, ∀ j ∈ S, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∑ i ∈ S, ∫ v, densityCubicWeight (v - t i) * + ‖(c i).L (densityVerticalPoint (1 / 2) v)‖ * + ‖densityMollifier X (c i).character (densityVerticalPoint (1 / 2) v)‖) ^ 4 ≤ + C * S.card * ((Q : ℝ) ^ 2 * T) * ((X : ℝ) + (Q : ℝ) ^ 2 * T) ^ 2 * + (Real.log ((Q : ℝ) * T)) ^ 6 * (1 + Real.log X) ^ 2 := by + obtain ⟨C4, hC4, hfourth⟩ := density_packed_fourth_moment + obtain ⟨C2, hC2, hsecond⟩ := density_packed_mollifier_mean + let W0 := 1 + ∫ v, densityCubicWeight v + have hW0 : 0 < W0 := by + have hn : 0 ≤ ∫ v : ℝ, densityCubicWeight v := + integral_nonneg (fun v => densityCubicWeight_nonneg v) + dsimp [W0] + linarith + refine ⟨W0 * C4 * C2 ^ 2, by positivity, ?_⟩ + intro X Q hX hQ T hT ι S c t hc ht hs + obtain ⟨hi4, hb4⟩ := hfourth Q hQ T hT S c t hc ht hs + obtain ⟨hiM, hbM⟩ := hsecond X Q hX hQ T hT S c t hc ht hs + let f := fun i v => ‖(c i).L (densityVerticalPoint (1 / 2) v)‖ + let g := fun i v => ‖densityMollifier X (c i).character (densityVerticalPoint (1 / 2) v)‖ + let w := fun i v => densityCubicWeight (v - t i) + have hfc (i : ι) : Continuous (f i) := by + have hl : Continuous (c i).L := continuous_iff_continuousAt.mpr (fun z => ((c i).L_analytic z).continuousAt) + exact (hl.comp (by unfold densityVerticalPoint; fun_prop)).norm + have hgc (i : ι) : Continuous (g i) := by + have hm : Continuous (densityMollifier X (c i).character) := by + apply continuous_iff_continuousAt.mpr + intro z + simpa only [zero_add] using (densityMollifier_shift_analytic (c i) X 0 z).continuousAt + exact (hm.comp (by unfold densityVerticalPoint; fun_prop)).norm + have hmixed (i : ι) (hi : i ∈ S) := density_cubic_mixed_integrable (f i) (g i) + (hfc i) (hgc i) (fun _ => norm_nonneg _) (fun _ => norm_nonneg _) (t i) (hi4 i hi) (hiM i hi) + have hpow := density_finite_product_fourth S w f g + (fun _ _ _ => densityCubicWeight_nonneg _) + (fun i _ => densityCubicWeight_shift_integrable (t i)) + (fun i hi => (hmixed i hi).1) hi4 hiM (fun i hi => (hmixed i hi).2) + have hweight : (∑ i ∈ S, ∫ v, w i v) ≤ (S.card : ℝ) * W0 := by + dsimp [w] + simp_rw [densityCubicWeight_shift_integral] + simp only [Finset.sum_const, nsmul_eq_mul] + apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) + dsimp [W0] + linarith + have hf4non : 0 ≤ ∑ i ∈ S, ∫ v, w i v * f i v ^ 4 := + Finset.sum_nonneg (fun i _ => integral_nonneg (fun v => mul_nonneg (densityCubicWeight_nonneg _) (by positivity))) + have hmnon : 0 ≤ ∑ i ∈ S, ∫ v, w i v * g i v ^ 2 := + Finset.sum_nonneg (fun i _ => integral_nonneg (fun v => mul_nonneg (densityCubicWeight_nonneg _) (sq_nonneg _))) + have hWnon : 0 ≤ (S.card : ℝ) * W0 := by positivity + have hWM := mul_le_mul hweight hb4 hf4non hWnon + have hMsq := pow_le_pow_left₀ hmnon hbM 2 + apply hpow.trans + calc + _ ≤ ((S.card : ℝ) * W0) * + (C4 * ((Q : ℝ) ^ 2 * T) * (Real.log ((Q : ℝ) * T)) ^ 6) * + (C2 * ((X : ℝ) + (Q : ℝ) ^ 2 * T) * (1 + Real.log X)) ^ 2 := + mul_le_mul hWM hMsq (sq_nonneg _) (by positivity) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPartialMean.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPartialMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..6bd1109de34db4cc6ae30056087d67d76b10b243 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPartialMean.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityHeadCutoff +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityTailAssembly +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDyadicPartition + +namespace OAI + +/-! # A uniform sixth-log bound for all growing partial smoothed squares -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators Classical + + theorem densityFiniteSquare_partial_mean : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ N → 1 ≤ Q → ∀ T : ℝ, + 1 ≤ T → 1 ≤ Real.log N → 10 * (Q : ℝ) * T ≤ N → ∀ J : ℕ, + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖∑ n ∈ Finset.Icc 1 (2 ^ J * N), + densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * (Real.log N) ^ 6 := by + obtain ⟨CH, hCH, hhead⟩ := densityFiniteSquare_head_mean + obtain ⟨CT, hCT, htail⟩ := densityFiniteSquare_tail_assembly + refine ⟨2 * CH + 16 * CT, by positivity, ?_⟩ + intro N Q hN hQ T hT hL hscale J F hF + let H := fun (χ : PrimitiveComplexCharacter) (t : ℝ) => + ∑ n ∈ Finset.Icc 1 N, densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n + let R := fun (χ : PrimitiveComplexCharacter) (t : ℝ) => + ∑ j ∈ Finset.range J, ∑ n ∈ Finset.Ioc (2 ^ j * N) (2 ^ (j + 1) * N), + densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n + have hH (χ : PrimitiveComplexCharacter) : ContinuousOn (H χ) (Icc (-T) T) := + densityFiniteSquare_continuousOn χ _ (fun n hn => (Finset.mem_Icc.mp hn).1) T hT + have hR (χ : PrimitiveComplexCharacter) : ContinuousOn (R χ) (Icc (-T) T) := by + apply continuousOn_finsetSum + intro j _ + apply densityFiniteSquare_continuousOn χ _ _ T hT + intro n hn + have hn' := (Finset.mem_Ioc.mp hn).1 + omega + have hpoint (χ : PrimitiveComplexCharacter) (t : ℝ) : + ‖H χ t + R χ t‖ ^ 2 ≤ 2 * ‖H χ t‖ ^ 2 + 2 * ‖R χ t‖ ^ 2 := by + have h := pow_le_pow_left₀ (norm_nonneg _) (norm_add_le (H χ t) (R χ t)) 2 + nlinarith [sq_nonneg (‖H χ t‖ - ‖R χ t‖)] + have hm (χ : PrimitiveComplexCharacter) : + (∫ t in Icc (-T) T, ‖H χ t + R χ t‖ ^ 2) ≤ + 2 * (∫ t in Icc (-T) T, ‖H χ t‖ ^ 2) + + 2 * (∫ t in Icc (-T) T, ‖R χ t‖ ^ 2) := by + have hh : Integrable (fun t => ‖H χ t‖ ^ 2) (volume.restrict (Icc (-T) T)) := + ((hH χ).norm.pow 2).integrableOn_Icc + have hr : Integrable (fun t => ‖R χ t‖ ^ 2) (volume.restrict (Icc (-T) T)) := + ((hR χ).norm.pow 2).integrableOn_Icc + have hi := (hh.const_mul 2).add (hr.const_mul 2) + have hb := integral_mono (((hH χ).add (hR χ)).norm.pow 2).integrableOn_Icc hi (hpoint χ) + simp only [Pi.add_apply, Pi.pow_apply] at hb + have hadd := integral_add (hh.const_mul 2) (hr.const_mul 2) + rw [hadd, integral_const_mul, integral_const_mul] at hb + exact hb + have hlog : (1 + Real.log N) ^ 3 ≤ 8 * (Real.log N) ^ 6 := by + have hbase : 1 + Real.log N ≤ 2 * (Real.log N) ^ 2 := by nlinarith + have h := pow_le_pow_left₀ (by linarith : 0 ≤ 1 + Real.log N) hbase 3 + nlinarith + calc + _ = ∑ χ ∈ F, ∫ t in Icc (-T) T, ‖H χ t + R χ t‖ ^ 2 := by + apply Finset.sum_congr rfl + intro χ _ + apply integral_congr_ae + filter_upwards with t + rw [density_dyadic_partition N J hN] + _ ≤ ∑ χ ∈ F, (2 * (∫ t in Icc (-T) T, ‖H χ t‖ ^ 2) + + 2 * (∫ t in Icc (-T) T, ‖R χ t‖ ^ 2)) := Finset.sum_le_sum (fun χ _ => hm χ) + _ = 2 * (∑ χ ∈ F, ∫ t in Icc (-T) T, ‖H χ t‖ ^ 2) + + 2 * (∑ χ ∈ F, ∫ t in Icc (-T) T, ‖R χ t‖ ^ 2) := by + simp only [Finset.sum_add_distrib, Finset.mul_sum] + _ ≤ 2 * (CH * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * (Real.log N) ^ 6) + + 2 * (CT * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * (1 + Real.log N) ^ 3) := by + exact add_le_add (mul_le_mul_of_nonneg_left (hhead N Q hQ T hT hL hscale F hF) (by norm_num)) + (mul_le_mul_of_nonneg_left (htail N Q hN hQ T hT hscale J F hF) (by norm_num)) + _ ≤ _ := by + have hb := mul_le_mul_of_nonneg_left hlog + (show 0 ≤ 2 * CT * ((N : ℝ) + (Q : ℝ) ^ 2 * T) by positivity) + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialAlternative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialAlternative.lean new file mode 100644 index 0000000000000000000000000000000000000000..d72fefb879288a1a46cca856c17c2e210b37cb41 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialAlternative.lean @@ -0,0 +1,72 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityActualBlock +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorBlocks +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDetectorDyadicCover +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFiniteBlockSquare + +namespace OAI + +/-! # Counting the polynomial alternative with its actual compact coefficients -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_polynomial_alternative_count : + ∃ C : ℝ, 0 < C ∧ ∀ X Q : ℕ, 1 ≤ X → 1 ≤ Q → ∀ Y T σ : ℝ, + 2 ≤ Y → 1 ≤ T → 1 / 2 ≤ σ → σ ≤ 1 → + ∀ {ι : Type} (R : Finset ι) (c : ι → PrimitiveComplexCharacter) (t β : ι → ℝ), + (∀ i ∈ R, (c i).modulus ≤ Q) → (∀ i ∈ R, |t i| ≤ T) → + (∀ i ∈ R, ∀ j ∈ R, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∀ i ∈ R, σ ≤ β i ∧ β i ≤ 1) → + (∀ i ∈ R, (1 / 8 : ℝ) ≤ ‖∑ n ∈ (Finset.Icc 1 ⌊Y⌋₊).filter (fun n => X < n), + LSeries.term (densityDetectorCharacterCoefficient (c i) X) (densityVerticalPoint (β i) (t i)) n * + densityDetectorWeight (n / Y)‖) → + (R.card : ℝ) ≤ C * (1 + Real.log (2 * Y + 1)) ^ 9 * + (Y ^ (2 - 2 * σ) + (Q : ℝ) ^ 2 * T * (X : ℝ) ^ (1 - 2 * σ)) := by + obtain ⟨C, hC, hb⟩ := density_actual_block_bound + let A := 2 / Real.log 2 + have hA : 0 < A := by dsimp [A]; positivity + refine ⟨64 * C * A ^ 2, by positivity, ?_⟩ + intro X Q hX hQ Y T σ hY hT hσ hσ1 ι R c t β hc ht hs hβ hlarge + obtain ⟨J, _hJ, hcover, hJbound⟩ := density_detector_dyadic_cover X hX Y hY + let L := 1 + Real.log (2 * Y + 1) + let G := Y ^ (2 - 2 * σ) + (Q : ℝ) ^ 2 * T * (X : ℝ) ^ (1 - 2 * σ) + let f := fun i j => densityCharacterPolynomial (Finset.Ioc (2 ^ j * X) (2 * (2 ^ j * X))) + (densityVerticalCoeff (densityPolynomialCoefficient X Y) (β i)) (c i).character (t i) + have hL0 : 0 ≤ L := by + have h := Real.log_nonneg (by linarith : 1 ≤ 2 * Y + 1) + dsimp [L] + linarith + have hG : 0 ≤ G := by dsimp [G]; positivity + have hblock (j : ℕ) : (∑ i ∈ R, ‖f i j‖ ^ 2) ≤ C * L ^ 7 * G := by + apply hb X (2 ^ j * X) Q hX _ hQ Y T σ hY hT hσ hσ1 R c t β hc ht hs hβ + exact Nat.le_mul_of_pos_left X (by positivity) + have hlower : (R.card : ℝ) / 64 ≤ ∑ i ∈ R, ‖∑ j ∈ Finset.range J, f i j‖ ^ 2 := by + have h := Finset.sum_le_sum (s := R) (fun i hi => show (1 / 64 : ℝ) ≤ ‖∑ j ∈ Finset.range J, f i j‖ ^ 2 from by + have hh := hlarge i hi + rw [densityDetector_polynomial_blocks (c i) X J hX Y (by linarith) hcover] at hh + change (1 / 8 : ℝ) ≤ ‖∑ j ∈ Finset.range J, f i j‖ at hh + nlinarith [norm_nonneg (∑ j ∈ Finset.range J, f i j)]) + simpa only [Finset.sum_const, nsmul_eq_mul, div_eq_mul_inv, one_mul] using h + have hupper : (∑ i ∈ R, ‖∑ j ∈ Finset.range J, f i j‖ ^ 2) ≤ + (J : ℝ) ^ 2 * (C * L ^ 7 * G) := by + apply (density_finite_block_square R J f).trans + have h := mul_le_mul_of_nonneg_left (Finset.sum_le_sum (s := Finset.range J) (fun j _ => hblock j)) + (Nat.cast_nonneg J : (0 : ℝ) ≤ J) + simpa only [Finset.sum_const, Finset.card_range, nsmul_eq_mul, pow_two, mul_assoc] using h + have hlog : Real.log Y ≤ L := by + have h := Real.log_le_log (by linarith : 0 < Y) (by linarith : Y ≤ 2 * Y + 1) + dsimp [L] + linarith + have hJ : (J : ℝ) ≤ A * L := hJbound.trans (mul_le_mul_of_nonneg_left hlog hA.le) + have hJ2 := pow_le_pow_left₀ (Nat.cast_nonneg J : (0 : ℝ) ≤ J) hJ 2 + have hfinal := hlower.trans (hupper.trans (mul_le_mul_of_nonneg_right hJ2 (by positivity))) + have hh := mul_le_mul_of_nonneg_left hfinal (by norm_num : (0 : ℝ) ≤ 64) + convert hh using 1 + · ring + · dsimp [L, G] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialBalance.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialBalance.lean new file mode 100644 index 0000000000000000000000000000000000000000..7817539dc8c8f1739b88c39fb963794cb05c45bf --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialBalance.lean @@ -0,0 +1,77 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityBalanceParameters + +namespace OAI + +/-! # The balanced exponent and logarithms in the polynomial alternative -/ + +namespace Ostmann + + theorem density_balance_at_most (σ : ℝ) (hσ : σ ≤ 1) : + densityBalanceExponent σ ≤ 3 / 2 := by + unfold densityBalanceExponent + apply (div_le_iff₀ (by linarith : 0 < 2 * (2 - σ))).mpr + linarith + + theorem density_target_at_least (σ : ℝ) (hσ : 1 / 2 ≤ σ) (hσ1 : σ ≤ 1) : + 2 - 2 * σ ≤ densityTargetExponent σ := by + unfold densityTargetExponent + apply (le_div_iff₀ (by linarith : 0 < 2 - σ)).mpr + nlinarith [mul_nonneg (show 0 ≤ σ - 1 / 2 by linarith) (show 0 ≤ 1 - σ by linarith)] + + theorem density_polynomial_balanced_powers (B X σ : ℝ) (hB : 1 ≤ B) (hBX : B ≤ X) + (hσ : 1 / 2 ≤ σ) (hσ1 : σ ≤ 1) : + (B ^ densityBalanceExponent σ) ^ (2 - 2 * σ) + B * X ^ (1 - 2 * σ) ≤ + 2 * B ^ densityTargetExponent σ := by + have hBp : 0 < B := lt_of_lt_of_le zero_lt_one hB + have he : (B ^ densityBalanceExponent σ) ^ (2 - 2 * σ) = B ^ densityTargetExponent σ := by + rw [← Real.rpow_mul hBp.le] + congr 1 + unfold densityBalanceExponent densityTargetExponent + have hd : 2 - σ ≠ 0 := by linarith + field_simp [hd] + have hx := Real.rpow_le_rpow_of_nonpos hBp hBX (by linarith : 1 - 2 * σ ≤ 0) + have hb : B * B ^ (1 - 2 * σ) = B ^ (2 - 2 * σ) := by + rw [show 2 - 2 * σ = 1 + (1 - 2 * σ) by ring, Real.rpow_add hBp, Real.rpow_one] + have ht := Real.rpow_le_rpow_of_exponent_le hB (density_target_at_least σ hσ hσ1) + rw [he] + have h := (mul_le_mul_of_nonneg_left hx hBp.le).trans (hb.le.trans ht) + linarith + + theorem density_balanced_log_cost (Q : ℕ) (hQ : 1 ≤ Q) (T σ : ℝ) (hT : 2 ≤ T) + (hσ : 1 / 2 ≤ σ) (hσ1 : σ ≤ 1) : + 1 + Real.log (2 * (((Q : ℝ) ^ 2 * T) ^ densityBalanceExponent σ) + 1) ≤ + 8 * Real.log ((Q : ℝ) * T) := by + let B := (Q : ℝ) ^ 2 * T + let L := Real.log ((Q : ℝ) * T) + let Y := B ^ densityBalanceExponent σ + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hB : 2 ≤ B := by dsimp [B]; nlinarith + have hBp : 0 < B := by linarith + have hY : 2 ≤ Y := by + have h := Real.rpow_le_rpow_of_exponent_le (by linarith : 1 ≤ B) + (density_balance_at_least_one σ hσ hσ1) + rw [Real.rpow_one] at h + exact hB.trans h + have hL : Real.log 2 ≤ L := Real.log_le_log (by norm_num) (by nlinarith) + have hlogB := density_conductor_height_log Q hQ T hT + have hlogY : Real.log Y ≤ 3 * L := by + rw [show Real.log Y = densityBalanceExponent σ * Real.log B by exact Real.log_rpow hBp _] + have ha := density_balance_at_most σ hσ1 + have hlB : 0 ≤ Real.log B := Real.log_nonneg (by linarith) + have hm := mul_le_mul_of_nonneg_right ha hlB + dsimp [B, L] at * + linarith + have hlog4 : Real.log 4 = 2 * Real.log 2 := by + have h := Real.log_pow (2 : ℝ) 2 + norm_num at h + exact h + have hlog : Real.log (2 * Y + 1) ≤ Real.log 4 + Real.log Y := by + rw [← Real.log_mul (by norm_num : (4 : ℝ) ≠ 0) (by linarith : Y ≠ 0)] + exact Real.log_le_log (by linarith) (by linarith) + rw [hlog4] at hlog + change 1 + Real.log (2 * Y + 1) ≤ 8 * L + nlinarith [Real.log_two_gt_d9] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialBalanced.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialBalanced.lean new file mode 100644 index 0000000000000000000000000000000000000000..178bdfb037be20f30c9eae77b8370f1ad5b30857 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialBalanced.lean @@ -0,0 +1,53 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityPolynomialAlternative +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityPolynomialBalance + +namespace OAI + +/-! # The balanced density exponent for the actual polynomial alternative -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_polynomial_alternative_balanced : + ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 1 ≤ Q → ∀ T σ : ℝ, + 2 ≤ T → 1 / 2 ≤ σ → σ ≤ 1 → ∀ X : ℕ, 1 ≤ X → (Q : ℝ) ^ 2 * T ≤ X → + ∀ {ι : Type} (R : Finset ι) (c : ι → PrimitiveComplexCharacter) (t β : ι → ℝ), + (∀ i ∈ R, (c i).modulus ≤ Q) → (∀ i ∈ R, |t i| ≤ T) → + (∀ i ∈ R, ∀ j ∈ R, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∀ i ∈ R, σ ≤ β i ∧ β i ≤ 1) → + (∀ i ∈ R, (1 / 8 : ℝ) ≤ ‖∑ n ∈ + (Finset.Icc 1 ⌊((Q : ℝ) ^ 2 * T) ^ densityBalanceExponent σ⌋₊).filter (fun n => X < n), + LSeries.term (densityDetectorCharacterCoefficient (c i) X) (densityVerticalPoint (β i) (t i)) n * + densityDetectorWeight (n / (((Q : ℝ) ^ 2 * T) ^ densityBalanceExponent σ))‖) → + (R.card : ℝ) ≤ C * ((Q : ℝ) ^ 2 * T) ^ densityTargetExponent σ * + (Real.log ((Q : ℝ) * T)) ^ 9 := by + obtain ⟨C, hC, hb⟩ := density_polynomial_alternative_count + refine ⟨2 * C * 8 ^ 9, by positivity, ?_⟩ + intro Q hQ T σ hT hσ hσ1 X hX hBX ι R c t β hc ht hs hβ hlarge + let B := (Q : ℝ) ^ 2 * T + let Y := B ^ densityBalanceExponent σ + let L := Real.log ((Q : ℝ) * T) + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hB : 2 ≤ B := by dsimp [B]; nlinarith + have hY : 2 ≤ Y := by + have h := Real.rpow_le_rpow_of_exponent_le (by linarith : 1 ≤ B) + (density_balance_at_least_one σ hσ hσ1) + rw [Real.rpow_one] at h + exact hB.trans h + have hL : 0 ≤ L := Real.log_nonneg (by nlinarith) + have hlog := density_balanced_log_cost Q hQ T σ hT hσ hσ1 + have hpow := density_polynomial_balanced_powers B X σ (by linarith) hBX hσ hσ1 + have h := hb X Q hX hQ Y T σ hY (by linarith) hσ hσ1 R c t β hc ht hs hβ hlarge + apply h.trans + calc + _ ≤ C * (8 * L) ^ 9 * (2 * B ^ densityTargetExponent σ) := by + apply mul_le_mul _ hpow (by positivity) (by positivity) + exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (by + have := Real.log_nonneg (by linarith : 1 ≤ 2 * Y + 1) + linarith) hlog 9) hC.le + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..673070e2311286e3de3d60e1d4950cbce9e2e600 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPolynomialDerivative.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySeparatedSampling + +namespace OAI + +/-! # The explicit height derivative and its coefficient energy -/ + +namespace Ostmann + +open scoped BigOperators Classical + +noncomputable def densityDerivativeCoeff (a : ℕ → ℂ) (n : ℕ) : ℂ := + (-2 * (Real.pi : ℂ) * Complex.I * (Real.log n : ℂ)) * a n + + theorem density_log_phase_derivative (l t : ℝ) : + HasDerivAt (fun x : ℝ => realAdditivePhase (-(l * x))) + ((-2 * (Real.pi : ℂ) * Complex.I * (l : ℂ)) * realAdditivePhase (-(l * t))) t := by + let k : ℂ := -2 * (Real.pi : ℂ) * Complex.I * (l : ℂ) + have he (x : ℝ) : realAdditivePhase (-(l * x)) = Complex.exp (k * (x : ℂ)) := by + unfold realAdditivePhase + congr 1 + dsimp [k] + push_cast + ring + have hd := (((hasDerivAt_id t).ofReal_comp).const_mul k).cexp + simp only [id_eq, Complex.ofReal_one, mul_one] at hd + convert hd using 1 + · funext x + exact he x + · rw [he] + change k * Complex.exp (k * (t : ℂ)) = Complex.exp (k * (t : ℂ)) * k + ring + + theorem density_polynomial_hasDerivAt (S : Finset ℕ) (a : ℕ → ℂ) (t : ℝ) : + HasDerivAt (fun x : ℝ => ∑ n ∈ S, a n * realAdditivePhase (-(Real.log n * x))) + (∑ n ∈ S, densityDerivativeCoeff a n * realAdditivePhase (-(Real.log n * t))) t := by + convert HasDerivAt.fun_sum (u := S) (fun n _ => + (density_log_phase_derivative (Real.log n) t).const_mul (a n)) using 1 + apply Finset.sum_congr rfl + intro n _ + unfold densityDerivativeCoeff + ring + + theorem density_polynomial_continuous (S : Finset ℕ) (a : ℕ → ℂ) : + Continuous (fun t : ℝ => ∑ n ∈ S, a n * realAdditivePhase (-(Real.log n * t))) := + continuous_iff_continuousAt.mpr (fun t => (density_polynomial_hasDerivAt S a t).continuousAt) + + theorem density_derivative_coefficient_bound (N : ℕ) (a : ℕ → ℂ) : + (∑ n ∈ Finset.Icc 1 N, ‖densityDerivativeCoeff a n‖ ^ 2) ≤ + 64 * (Real.log (N + 1 : ℕ)) ^ 2 * ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 := by + rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro n hn + obtain ⟨hn1, hnN⟩ := Finset.mem_Icc.mp hn + have hnR : (1 : ℝ) ≤ n := by exact_mod_cast hn1 + have hlog : 0 ≤ Real.log n := Real.log_nonneg hnR + have hlogN : Real.log n ≤ Real.log (N + 1 : ℕ) := + Real.log_le_log (by positivity) (by exact_mod_cast (by omega : n ≤ N + 1)) + have hcoef : ‖-2 * (Real.pi : ℂ) * Complex.I * (Real.log n : ℂ)‖ ≤ + 8 * Real.log (N + 1 : ℕ) := by + simp only [norm_mul, norm_neg, Complex.norm_ofNat, Complex.norm_real, + Real.norm_eq_abs, Complex.norm_I, mul_one, abs_of_pos Real.pi_pos, + abs_of_nonneg hlog] + nlinarith [Real.pi_lt_four, Real.pi_pos] + rw [densityDerivativeCoeff, norm_mul, mul_pow] + apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) + nlinarith [norm_nonneg (-2 * (Real.pi : ℂ) * Complex.I * (Real.log n : ℂ))] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPrimeBlock.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPrimeBlock.lean new file mode 100644 index 0000000000000000000000000000000000000000..3cbdae402adff657694995424208315a1546ff77 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPrimeBlock.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.Construction.BiasedPrimeBlock + +namespace OAI + +/-! # A populated small-prime block with balanced residue masks -/ + +namespace Ostmann + +open scoped BigOperators Classical + +theorem exists_density_prime_block {A B : Set ℕ} (hA : A.Infinite) (hB : B.Infinite) + (N lo hi : ℕ) (U C E : ℝ) (hU : 1 ≤ U) + (hUC : 4 * (Real.log 2 + 2 * C) ≤ U) (hM : MertensEstimate C) + (hdis : ∀ p ∈ logPrimeBand U, Disjoint (tailResidues A N p) (negTailResidues B N p)) + (hbudget : (∑ p ∈ logPrimeBand U, Real.log (p : ℝ) * tailCollisionDefect A N p + (summandTail A lo hi) (summandTail B lo hi) + (fun _ => 1 / ((summandTail A lo hi).card : ℝ)) + (fun _ => 1 / ((summandTail B lo hi).card : ℝ))) ≤ E) + (hE : 64 * E ≤ U / 4) : + ∃ (z : ℕ) (P : Finset ℕ), 2 ≤ z ∧ P.Nonempty ∧ P ⊆ logPrimeBand U ∧ + (∀ p ∈ P, z ≤ p ∧ p < 2 * z) ∧ + (z : ℝ) ≤ (8 + 8 / Real.log 2) * Real.log z * P.card ∧ + (∀ p ∈ P, (p : ℝ) / 3 ≤ (tailSupport A N p).card ∧ + ((tailSupport A N p).card : ℝ) ≤ 2 * p / 3) := by + let S := tailSupport A N + let T := fun p => Finset.range p \ S p + let μ := fun p => residueMass (summandTail A lo hi) (fun _ => 1 / ((summandTail A lo hi).card : ℝ)) p + let ν := fun p => fiberMass (summandTail B lo hi) (fun _ => 1 / ((summandTail B lo hi).card : ℝ)) (negativeResidue p) + have hprime (p : ℕ) (hp : p ∈ logPrimeBand U) : p.Prime := (logPrimeBand_mem hp).1 + have hS : ∀ p ∈ logPrimeBand U, (S p).Nonempty := fun p hp => tailSupport_nonempty hA N p (hprime p hp).pos + have hT : ∀ p ∈ logPrimeBand U, (T p).Nonempty := fun p hp => + tailSupport_complement_nonempty hB (hprime p hp).pos (hdis p hp) + have hc : ∀ p ∈ logPrimeBand U, (S p).card + (T p).card = p := fun p _ => + tailSupport_card_add_complement A N p + let R := stableTailPrimes A B N lo hi (logPrimeBand U) 1 + have hRsub : R ⊆ logPrimeBand U := Finset.filter_subset _ _ + have hw := stableBiasPrimes_weight (logPrimeBand U) S T μ ν 1 E (by norm_num) hprime hS hT + (fun p hp => (hc p hp).le) hbudget + change (∑ p ∈ logPrimeBand U, Real.log (p : ℝ) / p) - 64 * E / 1 ^ 2 ≤ + ∑ p ∈ R, Real.log (p : ℝ) / p at hw + norm_num only [one_pow, div_one] at hw + have hmass : (1 / 2 : ℝ) * U ≤ ∑ p ∈ R, Real.log (p : ℝ) / p := by + linarith [(logPrimeBand_weight_bounds U C hU hM).1] + obtain ⟨z, P, hz, hP, hPne, hrange, hpop⟩ := exists_populated_prime_block R + ⌊Real.exp (2 * U)⌋₊ U (1 / 2) hU (by norm_num) + (fun p hp => hprime p (hRsub hp)) + (fun p hp => Nat.le_of_mem_primesLE (Finset.mem_sdiff.mp (hRsub hp)).1) + (Nat.floor_le (Real.exp_nonneg _)) hmass + refine ⟨z, P, hz, hPne, hP.trans hRsub, hrange, ?_, ?_⟩ + · convert hpop using 1 + ring + · intro p hp + have hh := stableBiasPrimes_pointwise (logPrimeBand U) S T μ ν + (fun _ _ => 0) (fun _ _ => 0) 1 (by norm_num) (by norm_num) hS hT hc + (fun _ _ _ _ => by norm_num) (fun _ _ _ _ => by norm_num) p (hP hp) + exact ⟨hh.1, hh.2.1⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPrimitiveHybrid.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPrimitiveHybrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef0fdfdc90e257e5f36886bab978706723cb4c17 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityPrimitiveHybrid.lean @@ -0,0 +1,89 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityCharacterFamily +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDiscreteHybrid + +namespace OAI + +/-! # The hybrid sieve for the actual primitive-character index type -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators Classical + + theorem density_primitive_hybrid_mean : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + ∀ a : ℕ → ℂ, ∀ F : Finset PrimitiveComplexCharacter, + (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖densityCharacterPolynomial (Finset.Icc 1 N) a χ.character t‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 := by + obtain ⟨C, hC, hb⟩ := hybrid_multiplicative_large_sieve + refine ⟨C, hC, ?_⟩ + intro N Q hQ T hT a F hF + rw [densityCharacterFamily_sum F Q hF (fun q χ => ∫ t in Icc (-T) T, + ‖densityCharacterPolynomial (Finset.Icc 1 N) a χ t‖ ^ 2)] + exact hb N Q hQ T hT a (densityCharacterFamily F) + (fun q _ χ hχ => densityCharacterFamily_primitive F q χ hχ) + + theorem density_primitive_discrete_hybrid : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + ∀ a : ℕ → ℂ, ∀ {ι : Type} (R : Finset ι) (c : ι → PrimitiveComplexCharacter) (t : ι → ℝ), + (∀ i ∈ R, (c i).modulus ≤ Q) → (∀ i ∈ R, |t i| ≤ T) → + (∀ i ∈ R, ∀ j ∈ R, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∑ i ∈ R, ‖densityCharacterPolynomial (Finset.Icc 1 N) a (c i).character (t i)‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * (T + 1)) * + (2 + 64 * (Real.log (N + 1 : ℕ)) ^ 2) * ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 := by + obtain ⟨C, hC, hb⟩ := density_primitive_hybrid_mean + refine ⟨C, hC, ?_⟩ + intro N Q hQ T hT a ι R c t hc ht hsep + let F := R.image c + have hF : ∀ χ ∈ F, χ.modulus ≤ Q := by + intro χ hχ + obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hχ + exact hc i hi + have hpoint (χ : PrimitiveComplexCharacter) : + (∑ i ∈ R.filter (fun i => c i = χ), + ‖densityCharacterPolynomial (Finset.Icc 1 N) a χ.character (t i)‖ ^ 2) ≤ + 2 * (∫ u in Icc (-(T + 1)) (T + 1), + ‖densityCharacterPolynomial (Finset.Icc 1 N) a χ.character u‖ ^ 2) + + ∫ u in Icc (-(T + 1)) (T + 1), + ‖densityCharacterPolynomial (Finset.Icc 1 N) (densityDerivativeCoeff a) χ.character u‖ ^ 2 := by + have hder (n : ℕ) : densityDerivativeCoeff (fun m => a m * χ.character (m : ZMod χ.modulus)) n = + densityDerivativeCoeff a n * χ.character (n : ZMod χ.modulus) := by + unfold densityDerivativeCoeff + ring + have h := density_separated_samples (R.filter (fun i => c i = χ)) t T + (fun i hi => ht i (Finset.mem_filter.mp hi).1) + (fun i hi j hj hij => hsep i (Finset.mem_filter.mp hi).1 j (Finset.mem_filter.mp hj).1 + ((Finset.mem_filter.mp hi).2.trans (Finset.mem_filter.mp hj).2.symm) hij) + (fun u => ∑ n ∈ Finset.Icc 1 N, (a n * χ.character (n : ZMod χ.modulus)) * + realAdditivePhase (-(Real.log n * u))) + (fun u => ∑ n ∈ Finset.Icc 1 N, + densityDerivativeCoeff (fun m => a m * χ.character (m : ZMod χ.modulus)) n * + realAdditivePhase (-(Real.log n * u))) + (density_polynomial_hasDerivAt _ _) (density_polynomial_continuous _ _) + simpa only [hder, densityCharacterPolynomial, show -T - 1 = -(T + 1) by ring] using h + have he : (∑ i ∈ R, ‖densityCharacterPolynomial (Finset.Icc 1 N) a (c i).character (t i)‖ ^ 2) = + ∑ χ ∈ F, ∑ i ∈ R.filter (fun i => c i = χ), + ‖densityCharacterPolynomial (Finset.Icc 1 N) a χ.character (t i)‖ ^ 2 := by + have hmap : ∀ i ∈ R, c i ∈ F := fun i hi => Finset.mem_image.mpr ⟨i, hi, rfl⟩ + rw [← Finset.sum_fiberwise_of_maps_to hmap] + apply Finset.sum_congr rfl + intro χ _ + apply Finset.sum_congr rfl + intro i hi + rw [(Finset.mem_filter.mp hi).2] + rw [he] + have hs := Finset.sum_le_sum (s := F) (fun χ _ => hpoint χ) + simp only [Finset.sum_add_distrib, ← Finset.mul_sum] at hs + have ha := hb N Q hQ (T + 1) (by linarith) a F hF + have hd := hb N Q hQ (T + 1) (by linarith) (densityDerivativeCoeff a) F hF + have hd' := hd.trans (mul_le_mul_of_nonneg_left (density_derivative_coefficient_bound N a) (by positivity)) + apply hs.trans + have h := add_le_add (mul_le_mul_of_nonneg_left ha (by norm_num : (0 : ℝ) ≤ 2)) hd' + convert h using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySeparatedCount.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySeparatedCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3b1f1c974d7dda17c6a99b2026ea53b66cd20ea --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySeparatedCount.lean @@ -0,0 +1,91 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityPolynomialBalanced +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityIntegralBalanced + +namespace OAI + +/-! # Combining the two genuine detector alternatives at separated zeros -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_four_to_nine_logs (L : ℝ) (hL : Real.log 2 ≤ L) : + L ^ 4 ≤ (Real.log 2)⁻¹ ^ 5 * L ^ 9 := by + have hl : 0 < Real.log 2 := Real.log_pos (by norm_num) + have hp := pow_le_pow_left₀ hl.le hL 5 + calc + L ^ 4 = (Real.log 2)⁻¹ ^ 5 * ((Real.log 2) ^ 5 * L ^ 4) := by + rw [← mul_assoc, ← mul_pow, inv_mul_cancel₀ hl.ne', one_pow, one_mul] + _ ≤ (Real.log 2)⁻¹ ^ 5 * (L ^ 5 * L ^ 4) := by gcongr + _ = _ := by ring + + theorem density_separated_zero_count : + ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 1 ≤ Q → ∀ T σ : ℝ, + 2 ≤ T → 4 ≤ (Q : ℝ) ^ 2 * T → 1 / 2 < σ → σ ≤ 1 → + 1 / Real.log ((Q : ℝ) ^ 2 * T) ≤ σ - 1 / 2 → + ∀ {ι : Type} (R : Finset ι) (c : ι → PrimitiveComplexCharacter) (t β : ι → ℝ), + (∀ i ∈ R, (c i).modulus ≤ Q) → (∀ i ∈ R, |t i| ≤ T) → + (∀ i ∈ R, ∀ j ∈ R, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∀ i ∈ R, σ ≤ β i ∧ β i ≤ 1 ∧ (c i).L (densityVerticalPoint (β i) (t i)) = 0) → + (R.card : ℝ) ≤ C * ((Q : ℝ) ^ 2 * T) ^ densityTargetExponent σ * + (Real.log ((Q : ℝ) * T)) ^ 9 := by + obtain ⟨C1, hC1, hp⟩ := density_polynomial_alternative_balanced + obtain ⟨C2, hC2, hi⟩ := density_integral_alternative_balanced + refine ⟨C1 + (C2 + 1) * (Real.log 2)⁻¹ ^ 5, by positivity, ?_⟩ + intro Q hQ T σ hT hB4 hσ hσ1 hgap ι R c t β hc ht hs hz + obtain ⟨X, hX, hBX, hiX⟩ := hi Q hQ T σ hT hσ hσ1 hgap + let B := (Q : ℝ) ^ 2 * T + let Y := B ^ densityBalanceExponent σ + let L := Real.log ((Q : ℝ) * T) + let p : ι → Prop := fun i => (1 / 8 : ℝ) ≤ ‖∑ n ∈ (Finset.Icc 1 ⌊Y⌋₊).filter (fun n => X < n), + LSeries.term (densityDetectorCharacterCoefficient (c i) X) (densityVerticalPoint (β i) (t i)) n * + densityDetectorWeight (n / Y)‖ + let P := R.filter p + let N := R.filter (fun i => ¬p i) + have hY : 4 ≤ Y := by + have hh := Real.rpow_le_rpow_of_exponent_le (by linarith : 1 ≤ B) + (density_balance_at_least_one σ hσ.le hσ1) + rw [Real.rpow_one] at hh + exact hB4.trans hh + have hP := hp Q hQ T σ hT hσ.le hσ1 X hX hBX P c t β + (fun i h => hc i (Finset.mem_filter.mp h).1) + (fun i h => ht i (Finset.mem_filter.mp h).1) + (fun i h j h' => hs i (Finset.mem_filter.mp h).1 j (Finset.mem_filter.mp h').1) + (fun i h => ⟨(hz i (Finset.mem_filter.mp h).1).1, (hz i (Finset.mem_filter.mp h).1).2.1⟩) + (fun _ h => (Finset.mem_filter.mp h).2) + have hNlarge (i : ι) (hiN : i ∈ N) : + (1 / 8 : ℝ) ≤ ‖densityDetectorMean (c i) X (densityVerticalPoint (β i) (t i)) Y‖ := by + obtain ⟨hir, hn⟩ := Finset.mem_filter.mp hiN + have hzi := hz i hir + have hd := densityDetector_dichotomy (c i) X hX (densityVerticalPoint (β i) (t i)) + (by simpa [densityVerticalPoint] using hσ.trans_le hzi.1) + (by simpa [densityVerticalPoint] using hzi.2.1) hzi.2.2 Y hY + rcases hd with h | h + · exact False.elim (hn h) + · rw [densityDetectorMean_at_zero (c i) X _ + (by simpa [densityVerticalPoint] using hσ.trans_le hzi.1) + (by simpa [densityVerticalPoint] using hzi.2.1) hzi.2.2 Y (by linarith)] + exact h + have hNcube := hiX N c β t + (fun i h => hc i (Finset.mem_filter.mp h).1) + (fun i h => ht i (Finset.mem_filter.mp h).1) + (fun i h j h' => hs i (Finset.mem_filter.mp h).1 j (Finset.mem_filter.mp h').1) + (fun i h => hz i (Finset.mem_filter.mp h).1) hNlarge + have hN := density_balanced_count_from_cube C2 N.card B σ L hC2.le (Nat.cast_nonneg _) + (by dsimp [B]; positivity) hNcube + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hL : Real.log 2 ≤ L := Real.log_le_log (by norm_num) (by nlinarith) + have hN' : (N.card : ℝ) ≤ (C2 + 1) * B ^ densityTargetExponent σ * + ((Real.log 2)⁻¹ ^ 5 * L ^ 9) := + hN.trans (mul_le_mul_of_nonneg_left (density_four_to_nine_logs L hL) (by positivity)) + have hcard : (R.card : ℝ) = (P.card : ℝ) + (N.card : ℝ) := by + exact_mod_cast (Finset.card_filter_add_card_filter_not (s := R) (p := p)).symm + rw [hcard] + have hh := add_le_add hP hN' + convert hh using 1 + dsimp [B, L] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySeparatedSampling.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySeparatedSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..7216e538bb7fd9e9457f5195d50f7464bbe1ddda --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySeparatedSampling.lean @@ -0,0 +1,63 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySobolevPoint + +namespace OAI + +/-! # Disjoint unit windows for separated height samples -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators Classical + + theorem density_disjoint_sample_windows {ι : Type*} (S : Finset ι) (t : ι → ℝ) + (hsep : ∀ i ∈ S, ∀ j ∈ S, i ≠ j → 1 ≤ |t i - t j|) : + Set.Pairwise (↑S) (fun i j => Disjoint (Ioc (t i - 1 / 2) (t i + 1 / 2)) + (Ioc (t j - 1 / 2) (t j + 1 / 2))) := by + intro i hi j hj hij + apply Set.disjoint_left.mpr + intro x hx hy + have hh := hsep i hi j hj hij + have hn : |t i - t j| < 1 := abs_lt.mpr ⟨by linarith [hx.2, hy.1], by linarith [hy.2, hx.1]⟩ + linarith + + theorem density_sample_window_integrals {ι : Type*} (S : Finset ι) (t : ι → ℝ) + (T : ℝ) (hT : ∀ i ∈ S, |t i| ≤ T) + (hsep : ∀ i ∈ S, ∀ j ∈ S, i ≠ j → 1 ≤ |t i - t j|) + (F : ℝ → ℝ) (hF : Continuous F) (hFnon : ∀ x, 0 ≤ F x) : + (∑ i ∈ S, ∫ x in t i - 1 / 2..t i + 1 / 2, F x) ≤ + ∫ x in Icc (-T - 1) (T + 1), F x := by + have he : (∑ i ∈ S, ∫ x in t i - 1 / 2..t i + 1 / 2, F x) = + ∫ x in ⋃ i ∈ S, Ioc (t i - 1 / 2) (t i + 1 / 2), F x := by + have horder (i : ι) : t i - 1 / 2 ≤ t i + 1 / 2 := by linarith + simp_rw [intervalIntegral.integral_of_le (horder _)] + exact (integral_biUnion_finset S (fun _ _ => measurableSet_Ioc) + (density_disjoint_sample_windows S t hsep) + (fun i _ => hF.integrableOn_Icc.mono_set Ioc_subset_Icc_self)).symm + rw [he] + apply setIntegral_mono_set hF.integrableOn_Icc (Filter.Eventually.of_forall hFnon) + apply Filter.Eventually.of_forall + intro x hx + obtain ⟨i, hi, hxi⟩ := Set.mem_iUnion₂.mp hx + have ht := abs_le.mp (hT i hi) + exact ⟨by linarith [hxi.1], by linarith [hxi.2]⟩ + + theorem density_separated_samples {ι : Type*} (S : Finset ι) (t : ι → ℝ) + (T : ℝ) (hT : ∀ i ∈ S, |t i| ≤ T) + (hsep : ∀ i ∈ S, ∀ j ∈ S, i ≠ j → 1 ≤ |t i - t j|) + (f g : ℝ → ℂ) (hf : ∀ x, HasDerivAt f (g x) x) (hg : Continuous g) : + (∑ i ∈ S, ‖f (t i)‖ ^ 2) ≤ + 2 * (∫ x in Icc (-T - 1) (T + 1), ‖f x‖ ^ 2) + + ∫ x in Icc (-T - 1) (T + 1), ‖g x‖ ^ 2 := by + have hfc : Continuous f := continuous_iff_continuousAt.mpr (fun x => (hf x).continuousAt) + have hs := Finset.sum_le_sum (s := S) (fun i _ => density_unit_interval_sample f g hf hg (t i)) + rw [Finset.sum_add_distrib, ← Finset.mul_sum] at hs + apply hs.trans + exact add_le_add + (mul_le_mul_of_nonneg_left (density_sample_window_integrals S t T hT hsep + (fun x => ‖f x‖ ^ 2) (hfc.norm.pow 2) (fun _ => sq_nonneg _)) (by norm_num)) + (density_sample_window_integrals S t T hT hsep + (fun x => ‖g x‖ ^ 2) (hg.norm.pow 2) (fun _ => sq_nonneg _)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityShiftedDivisorEnergy.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityShiftedDivisorEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..baaf429b00d00875aee9e573de1eff121ade32e7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityShiftedDivisorEnergy.lean @@ -0,0 +1,66 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityMollifierMean + +namespace OAI + +/-! # Divisor energies for the short head and the far coefficient blocks -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem densityVerticalCoeff_square (a : ℕ → ℂ) (σ : ℝ) (n : ℕ) (hn : 0 < n) : + ‖densityVerticalCoeff a σ n‖ ^ 2 = ‖a n‖ ^ 2 / (n : ℝ) ^ (2 * σ) := by + rw [densityVerticalCoeff_norm a σ n hn, div_pow] + congr 1 + rw [← Real.rpow_natCast, ← Real.rpow_mul (by positivity : (0 : ℝ) ≤ n)] + congr 1 + norm_num + ring + + theorem density_divisor_shifted_head (N : ℕ) (c : ℝ) (hc : 0 ≤ c) : + (∑ n ∈ Finset.Icc 1 N, + ‖densityVerticalCoeff (fun n : ℕ => (n.divisors.card : ℂ)) (1 / 2 + c) n‖ ^ 2) ≤ + (1 + Real.log N) ^ 4 := by + apply (Finset.sum_le_sum (fun n hn => ?_)).trans (density_divisor_square_harmonic N) + have hnR : (1 : ℝ) ≤ n := by exact_mod_cast (Finset.mem_Icc.mp hn).1 + rw [densityVerticalCoeff_square _ _ n (Finset.mem_Icc.mp hn).1] + simp only [Complex.norm_natCast] + apply div_le_div_of_nonneg_left (sq_nonneg _) (by positivity) + calc + (n : ℝ) = (n : ℝ) ^ (1 : ℝ) := (Real.rpow_one _).symm + _ ≤ (n : ℝ) ^ (2 * (1 / 2 + c)) := + Real.rpow_le_rpow_of_exponent_le hnR (by linarith) + + theorem density_divisor_shifted_tail (S : Finset ℕ) (M N : ℕ) (hM : 1 ≤ M) + (hS : S ⊆ Finset.Icc M N) : + (∑ n ∈ S, + ‖densityVerticalCoeff (fun n : ℕ => (n.divisors.card : ℂ)) (1 / 2 + (1 : ℝ)) n‖ ^ 2) ≤ + (N : ℝ) * (1 + Real.log N) ^ 3 / (M : ℝ) ^ 3 := by + have hMp : (0 : ℝ) < M := by exact_mod_cast (show 0 < M by omega) + calc + _ ≤ ∑ n ∈ S, (n.divisors.card : ℝ) ^ 2 / (M : ℝ) ^ 3 := by + apply Finset.sum_le_sum + intro n hn + have hMn := (Finset.mem_Icc.mp (hS hn)).1 + have hnpos : 0 < n := lt_of_lt_of_le (by omega : 0 < M) hMn + rw [densityVerticalCoeff_square _ _ n hnpos] + norm_num only [Complex.norm_natCast, show (2 : ℝ) * (1 / 2 + 1) = 3 by norm_num, + Real.rpow_natCast] + have hp : (M : ℝ) ^ 3 ≤ (n : ℝ) ^ 3 := + pow_le_pow_left₀ hMp.le (by exact_mod_cast hMn) 3 + convert div_le_div_of_nonneg_left (sq_nonneg (n.divisors.card : ℝ)) (pow_pos hMp 3) hp using 1 + simp only [Real.rpow_ofNat] + _ = (∑ n ∈ S, (n.divisors.card : ℝ) ^ 2) / (M : ℝ) ^ 3 := by rw [Finset.sum_div] + _ ≤ (∑ n ∈ Finset.Icc 1 N, (n.divisors.card : ℝ) ^ 2) / (M : ℝ) ^ 3 := by + apply div_le_div_of_nonneg_right _ (pow_nonneg hMp.le 3) + apply Finset.sum_le_sum_of_subset_of_nonneg + · intro n hn + exact Finset.mem_Icc.mpr ⟨hM.trans (Finset.mem_Icc.mp (hS hn)).1, + (Finset.mem_Icc.mp (hS hn)).2⟩ + · intro n _ _ + positivity + _ ≤ _ := div_le_div_of_nonneg_right (density_divisor_square_sum N) (pow_nonneg hMp.le 3) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityShiftedHybrid.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityShiftedHybrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..2a7a983628a578982468d3557031510d3c966d97 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityShiftedHybrid.lean @@ -0,0 +1,52 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityHybridSieve + +namespace OAI + +/-! # The hybrid large sieve on translated height intervals -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators Interval Classical + + theorem density_interval_translate_le (f : ℝ → ℝ) (hf : Continuous f) + (hf0 : ∀ t, 0 ≤ f t) (T u : ℝ) (hT : 0 ≤ T) : + (∫ t in Icc (-T) T, f (t + u)) ≤ + ∫ t in Icc (-(T + |u|)) (T + |u|), f t := by + have he : (∫ t in Icc (-T) T, f (t + u)) = + ∫ t in Icc (-T + u) (T + u), f t := by + rw [integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by linarith : -T ≤ T), + intervalIntegral.integral_comp_add_right, intervalIntegral.integral_of_le (by linarith : -T + u ≤ T + u), + ← integral_Icc_eq_integral_Ioc] + rw [he] + apply setIntegral_mono_set hf.integrableOn_Icc (Filter.Eventually.of_forall hf0) + apply Filter.Eventually.of_forall + intro t ht + exact ⟨by linarith [ht.1, neg_le_abs u], by linarith [ht.2, le_abs_self u]⟩ + + theorem shifted_hybrid_multiplicative_large_sieve : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T u : ℝ, 1 ≤ T → + ∀ a : ℕ → ℂ, ∀ F : (q : ℕ) → Finset (DirichletCharacter ℂ q), + (∀ q ∈ Finset.Icc 1 Q, ∀ χ ∈ F q, χ.IsPrimitive) → + (∑ q ∈ Finset.Icc 1 Q, ∑ χ ∈ F q, + ∫ t in Icc (-T) T, ‖∑ n ∈ Finset.Icc 1 N, + a n * χ (n : ZMod q) * realAdditivePhase (-(Real.log n * (t + u)))‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * (T + |u|)) * ∑ n ∈ Finset.Icc 1 N, ‖a n‖ ^ 2 := by + obtain ⟨C, hC, hb⟩ := hybrid_multiplicative_large_sieve + refine ⟨C, hC, ?_⟩ + intro N Q hQ T u hT a F hF + apply le_trans _ (hb N Q hQ (T + |u|) (by linarith [abs_nonneg u]) a F hF) + apply Finset.sum_le_sum + intro q hq + apply Finset.sum_le_sum + intro χ hχ + let f : ℝ → ℝ := fun t => ‖∑ n ∈ Finset.Icc 1 N, + a n * χ (n : ZMod q) * realAdditivePhase (-(Real.log n * t))‖ ^ 2 + have hc : Continuous f := by + dsimp [f, realAdditivePhase] + fun_prop + exact density_interval_translate_le f hc (fun t => sq_nonneg _) T u (by linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySmoothedKernel.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySmoothedKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb8d1d5edc73debad9370159bbd0f079a2f797fe --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySmoothedKernel.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityNormalizedEquation +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedDivergence + +namespace OAI + +/-! # The normalized right-hand kernel in the square functional equation -/ + +namespace Ostmann + +open Complex MeasureTheory + +noncomputable def densitySquareKernel (χ : PrimitiveComplexCharacter) (s w : ℂ) : ℂ := + densityCompletedSquareWeight χ s w / w + + theorem densitySmoothedSquare_integral (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : + densitySmoothedSquare χ s = (2 * (Real.pi : ℂ))⁻¹ * + ∫ u : ℝ, densitySquareKernel χ s (1 + u * I) * χ.L (s + (1 + u * I)) ^ 2 := by + unfold densitySmoothedSquare densitySquareIntegral + rw [mul_div_assoc, ← integral_div] + congr 1 + apply integral_congr_ae + filter_upwards with u + have hp : 0 < s.re := by linarith + have hu : 0 < (s + (1 + (u : ℂ) * I)).re := by norm_num [hs] + calc + _ = (densitySquareGaussian χ s (1 + u * I) / densitySquareNormalizer χ s) / + (1 + u * I) := by unfold densitySquareContour; ring + _ = _ := by rw [densitySquareGaussian_normalized χ s _ hp hu]; unfold densitySquareKernel; ring + + theorem densitySquareKernel_line_bound (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (u : ℝ) : + ‖densitySquareKernel χ s (1 + u * I)‖ ≤ + (Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) * + ((χ.modulus : ℝ) * (|s.im| + 2))) * Real.exp (-(u ^ 2) / 2) := by + have hn : 1 ≤ ‖(1 : ℂ) + u * I‖ := by + simpa using Complex.re_le_norm ((1 : ℂ) + u * I) + rw [densitySquareKernel, norm_div] + apply (div_le_self (norm_nonneg _) hn).trans + have h := densityCompletedSquareWeight_bound χ s (1 + u * I) hs + (by norm_num) (by norm_num) + simpa using h + + theorem densitySquareKernel_line_continuous (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : Continuous (fun u : ℝ => densitySquareKernel χ s (1 + u * I)) := by + have hΓ : Continuous (fun u : ℝ => + DirichletCharacter.gammaFactor χ.character (s + (1 + (u : ℂ) * I))) := by + apply continuous_iff_continuousAt.mpr + intro u + apply (χ.gammaFactor_differentiableAt_pos _ (by norm_num [hs])).continuousAt.comp + fun_prop + unfold densitySquareKernel densityCompletedSquareWeight + apply Continuous.div + · apply Continuous.mul + · apply Continuous.mul + · have hq : (χ.modulus : ℂ) ≠ 0 := by exact_mod_cast χ.positive.ne' + exact (differentiable_id.const_cpow (Or.inl hq)).continuous.comp (by fun_prop) + · exact (hΓ.div_const _).pow 2 + · fun_prop + · fun_prop + · intro u h + have hr := congrArg Complex.re h + norm_num at hr + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySmoothedMean.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySmoothedMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9cf9029b9f0080772a9a9ac95a11c0f32a027e5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySmoothedMean.lean @@ -0,0 +1,65 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityPartialMean +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySquareLimit +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFatou + +namespace OAI + +/-! # The actual smoothed square satisfies the sixth-log mean bound -/ + +namespace Ostmann + +open Complex MeasureTheory Filter Set +open scoped BigOperators Topology Classical + + theorem densitySmoothedSquare_mean : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ N → 1 ≤ Q → ∀ T : ℝ, + 1 ≤ T → 1 ≤ Real.log N → 10 * (Q : ℝ) * T ≤ N → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∀ χ ∈ F, Integrable (fun t => + ‖densitySmoothedSquare χ (densityVerticalPoint (1 / 2) t)‖ ^ 2) + (volume.restrict (Icc (-T) T))) ∧ + (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖densitySmoothedSquare χ (densityVerticalPoint (1 / 2) t)‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * (Real.log N) ^ 6 := by + obtain ⟨C, hC, hb⟩ := densityFiniteSquare_partial_mean + refine ⟨C, hC, ?_⟩ + intro N Q hN hQ T hT hL hscale F hF + let p := fun (J : ℕ) (χ : PrimitiveComplexCharacter) (t : ℝ) => + ‖∑ n ∈ Finset.Icc 1 (2 ^ J * N), + densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n‖ ^ 2 + let f := fun (χ : PrimitiveComplexCharacter) (t : ℝ) => + ‖densitySmoothedSquare χ (densityVerticalPoint (1 / 2) t)‖ ^ 2 + have hp (J : ℕ) (χ : PrimitiveComplexCharacter) : + Integrable (p J χ) (volume.restrict (Icc (-T) T)) := + ((densityFiniteSquare_continuousOn χ _ (fun n hn => (Finset.mem_Icc.mp hn).1) T hT).norm.pow 2).integrableOn_Icc + have ht (χ : PrimitiveComplexCharacter) (t : ℝ) : + Tendsto (fun J => p J χ t) atTop (𝓝 (f χ t)) := + ((densitySquare_partial_limit χ N hN t).norm).pow 2 + have hsum : Integrable (fun t => ∑ χ ∈ F, f χ t) (volume.restrict (Icc (-T) T)) ∧ + (∫ t in Icc (-T) T, ∑ χ ∈ F, f χ t) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * (Real.log N) ^ 6 := by + apply density_integral_limit_bound (fun J t => ∑ χ ∈ F, p J χ t) + (fun t => ∑ χ ∈ F, f χ t) _ _ (by positivity) + · intro J + exact integrable_finsetSum F (fun χ _ => hp J χ) + · intro J t + exact Finset.sum_nonneg (fun χ _ => sq_nonneg _) + · intro t + exact tendsto_finsetSum F (fun χ _ => ht χ t) + · intro J + rw [integral_finsetSum F (fun χ _ => hp J χ)] + exact hb N Q hN hQ T hT hL hscale J F hF + have hi (χ : PrimitiveComplexCharacter) (hχ : χ ∈ F) : + Integrable (f χ) (volume.restrict (Icc (-T) T)) := by + apply hsum.1.mono' + · exact aestronglyMeasurable_of_tendsto_ae atTop (fun J => (hp J χ).aestronglyMeasurable) + (Filter.Eventually.of_forall (ht χ)) + · filter_upwards with t + rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] + exact Finset.single_le_sum (f := fun ψ => f ψ t) (fun ψ _ => sq_nonneg _) hχ + refine ⟨hi, ?_⟩ + simpa only [integral_finsetSum F hi] using hsum.2 + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySobolevPoint.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySobolevPoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..592397fea0f3a59a165dd5c98713b2ae52f4118f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySobolevPoint.lean @@ -0,0 +1,80 @@ +import Mathlib.MeasureTheory.Integral.IntervalIntegral.DistLEIntegral +import Mathlib.Analysis.InnerProductSpace.Calculus +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityHybridSieve + +namespace OAI + +/-! # Point sampling from the energy of a differentiable complex function -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped ComplexConjugate + + theorem density_energy_derivative_bound {f : ℝ → ℂ} {f' : ℂ} {x : ℝ} + (hf : HasDerivAt f f' x) : + ‖deriv (fun t => ‖f t‖ ^ 2) x‖ ≤ ‖f x‖ ^ 2 + ‖f'‖ ^ 2 := by + rw [hf.norm_sq.deriv] + have hi := norm_inner_le_norm (𝕜 := ℝ) (f x) f' + have hnorm : ‖(2 : ℝ) * inner ℝ (f x) f'‖ ≤ 2 * (‖f x‖ * ‖f'‖) := by + rw [norm_mul, Real.norm_eq_abs, abs_of_pos (by norm_num : (0 : ℝ) < 2)] + exact mul_le_mul_of_nonneg_left hi (by norm_num) + exact hnorm.trans (by nlinarith [sq_nonneg (‖f x‖ - ‖f'‖)]) + + theorem density_energy_oscillation (f g : ℝ → ℂ) + (hf : ∀ x, HasDerivAt f (g x) x) (hg : Continuous g) + (a b t u : ℝ) (ht : t ∈ Icc a b) (hu : u ∈ Icc a b) : + ‖f t‖ ^ 2 ≤ ‖f u‖ ^ 2 + ∫ x in a..b, (‖f x‖ ^ 2 + ‖g x‖ ^ 2) := by + have hcont : Continuous f := continuous_iff_continuousAt.mpr (fun x => (hf x).continuousAt) + have hcE : Continuous (fun x => ‖f x‖ ^ 2) := hcont.norm.pow 2 + have hcB : Continuous (fun x => ‖f x‖ ^ 2 + ‖g x‖ ^ 2) := + (hcont.norm.pow 2).add (hg.norm.pow 2) + have hdE : Differentiable ℝ (fun x => ‖f x‖ ^ 2) := fun x => (hf x).norm_sq.differentiableAt + have hbound : ∀ᵐ x : ℝ, ‖deriv (fun t => ‖f t‖ ^ 2) x‖ ≤ ‖f x‖ ^ 2 + ‖g x‖ ^ 2 := + Filter.Eventually.of_forall (fun x => density_energy_derivative_bound (hf x)) + have hab : a ≤ b := ht.1.trans ht.2 + have hbnon : ∀ᵐ x : ℝ, 0 ≤ ‖f x‖ ^ 2 + ‖g x‖ ^ 2 := + Filter.Eventually.of_forall (fun x => add_nonneg (sq_nonneg _) (sq_nonneg _)) + have hstep (v w : ℝ) (hv : v ∈ Icc a b) (hw : w ∈ Icc a b) (hvw : v ≤ w) : + ‖‖f w‖ ^ 2 - ‖f v‖ ^ 2‖ ≤ ∫ x in a..b, (‖f x‖ ^ 2 + ‖g x‖ ^ 2) := by + have h := norm_sub_le_integral_of_norm_deriv_le_of_le hvw hcE.continuousOn + hdE.differentiableOn (hbound.mono (fun _ hx _ => hx)) (hcB.intervalIntegrable v w) + have hm := intervalIntegral.integral_mono_interval hv.1 hvw hw.2 (ae_restrict_of_ae hbnon) + (hcB.intervalIntegrable a b) + exact h.trans hm + have hdiff : ‖‖f t‖ ^ 2 - ‖f u‖ ^ 2‖ ≤ + ∫ x in a..b, (‖f x‖ ^ 2 + ‖g x‖ ^ 2) := by + rcases le_total u t with h | h + · exact hstep u t hu ht h + · simpa only [norm_sub_rev] using hstep t u ht hu h + have hl := (le_abs_self (‖f t‖ ^ 2 - ‖f u‖ ^ 2)).trans + (by simpa only [Real.norm_eq_abs] using hdiff) + linarith + + theorem density_unit_interval_sample (f g : ℝ → ℂ) + (hf : ∀ x, HasDerivAt f (g x) x) (hg : Continuous g) (t : ℝ) : + ‖f t‖ ^ 2 ≤ 2 * (∫ x in t - 1 / 2..t + 1 / 2, ‖f x‖ ^ 2) + + ∫ x in t - 1 / 2..t + 1 / 2, ‖g x‖ ^ 2 := by + have hcont : Continuous f := continuous_iff_continuousAt.mpr (fun x => (hf x).continuousAt) + have hab : t - 1 / 2 ≤ t + 1 / 2 := by linarith + have hpoint (u : ℝ) (hu : u ∈ Icc (t - 1 / 2) (t + 1 / 2)) := + density_energy_oscillation f g hf hg (t - 1 / 2) (t + 1 / 2) t u + ⟨by linarith, by linarith⟩ hu + have hi := intervalIntegral.integral_mono_on (μ := volume) hab intervalIntegrable_const + (((hcont.norm.pow 2).intervalIntegrable (t - 1 / 2) (t + 1 / 2)).add intervalIntegrable_const) hpoint + rw [intervalIntegral.integral_const, intervalIntegral.integral_add, + intervalIntegral.integral_const, intervalIntegral.integral_add] at hi + · simp only [show t + 1 / 2 - (t - 1 / 2) = (1 : ℝ) by ring, smul_eq_mul, + one_mul] at hi + change ‖f t‖ ^ 2 ≤ (∫ x in t - 1 / 2..t + 1 / 2, ‖f x‖ ^ 2) + + ((∫ x in t - 1 / 2..t + 1 / 2, ‖f x‖ ^ 2) + + ∫ x in t - 1 / 2..t + 1 / 2, ‖g x‖ ^ 2) at hi + linarith + · exact (hcont.norm.pow 2).intervalIntegrable _ _ + · exact (hg.norm.pow 2).intervalIntegrable _ _ + · exact (hcont.norm.pow 2).intervalIntegrable _ _ + · exact intervalIntegrable_const + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareConjugation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareConjugation.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b964b89eb709f45efb6fae802c1ec5ee037be31 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareConjugation.lean @@ -0,0 +1,66 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityNormalizedEquation + +namespace OAI + +/-! # Conjugating the actual smoothed square -/ + +namespace Ostmann + +open Complex MeasureTheory +open scoped ComplexConjugate + + theorem density_nat_cpow_conj (q : ℕ) (s : ℂ) : + (q : ℂ) ^ conj s = conj ((q : ℂ) ^ s) := by + have ha : (q : ℂ).arg ≠ Real.pi := by + rw [← Complex.ofReal_natCast, Complex.arg_ofReal_of_nonneg (Nat.cast_nonneg q)] + exact Real.pi_pos.ne + simpa only [map_natCast] using Complex.cpow_conj (q : ℂ) s ha + + theorem densityCompletedSquare_inverse_conj (χ : PrimitiveComplexCharacter) (s : ℂ) : + densityCompletedSquare χ.inverse (conj s) = conj (densityCompletedSquare χ s) := by + simp only [densityCompletedSquare, PrimitiveComplexCharacter.inverse_modulus, + χ.inverse_completed_eq_conjugate, Function.comp_apply, Complex.conj_conj, + density_nat_cpow_conj, map_mul, map_pow] + + theorem densitySquareNormalizer_inverse_conj (χ : PrimitiveComplexCharacter) (s : ℂ) : + densitySquareNormalizer χ.inverse (conj s) = conj (densitySquareNormalizer χ s) := by + unfold densitySquareNormalizer + rw [χ.gammaFactor_inverse_conj, PrimitiveComplexCharacter.inverse_modulus, + density_nat_cpow_conj, map_mul, map_pow] + + theorem densitySquareContour_inverse_conj (χ : PrimitiveComplexCharacter) (s w : ℂ) : + densitySquareContour χ.inverse (conj s) (conj w) = conj (densitySquareContour χ s w) := by + unfold densitySquareContour densitySquareGaussian + rw [← map_add, densityCompletedSquare_inverse_conj] + simp only [map_div₀, map_mul] + rw [← map_pow, Complex.exp_conj] + + theorem densitySquareIntegral_inverse_conj (χ : PrimitiveComplexCharacter) (s : ℂ) : + densitySquareIntegral χ.inverse (conj s) = conj (densitySquareIntegral χ s) := by + have he (u : ℝ) : densitySquareContour χ.inverse (conj s) (1 + u * I) = + conj (densitySquareContour χ s (1 + (-u : ℝ) * I)) := by + simpa only [map_add, map_one, map_mul, map_neg, Complex.conj_ofReal, Complex.conj_I, + Complex.ofReal_neg, neg_mul, mul_neg, neg_neg] using + densitySquareContour_inverse_conj χ s (1 + (-u : ℝ) * I) + unfold densitySquareIntegral + simp_rw [he] + rw [integral_conj] + have hn := integral_neg_eq_self (fun u : ℝ => densitySquareContour χ s (1 + u * I)) volume + rw [hn] + simp only [map_mul, map_inv₀, map_ofNat, Complex.conj_ofReal] + + theorem densitySmoothedSquare_inverse_conj (χ : PrimitiveComplexCharacter) (s : ℂ) : + densitySmoothedSquare χ.inverse (conj s) = conj (densitySmoothedSquare χ s) := by + unfold densitySmoothedSquare + rw [densitySquareIntegral_inverse_conj, densitySquareNormalizer_inverse_conj, map_div₀] + + theorem density_L_fourth_single_bound (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : + ‖χ.L s‖ ^ 4 ≤ 4 * ‖densitySmoothedSquare χ s‖ ^ 2 := by + have h := density_L_fourth_bound χ s hs + rw [density_critical_reflection s hs, densitySmoothedSquare_inverse_conj, norm_conj] at h + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareContour.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareContour.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b0c98523d930eccdbb8a8bc2754dd790b878285 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareContour.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityGaussianEnvelope + +namespace OAI + +/-! # The convergent vertical lines and vanishing horizontal edges -/ + +namespace Ostmann + +open Complex Filter MeasureTheory Set +open scoped Topology Interval + +noncomputable def densitySquareContour (χ : PrimitiveComplexCharacter) (s w : ℂ) : ℂ := + densitySquareGaussian χ s w / w + + theorem densitySquareContour_bound (χ : PrimitiveComplexCharacter) (s : ℂ) (K : ℝ) + (hK : ∀ x u : ℝ, |x| ≤ 1 → + ‖densitySquareGaussian χ s ((x : ℂ) + u * I)‖ ≤ K * densityGaussianEnvelope u) + (x u : ℝ) (hx : |x| ≤ 1) (hn : 1 ≤ ‖(x : ℂ) + u * I‖) : + ‖densitySquareContour χ s ((x : ℂ) + u * I)‖ ≤ K * densityGaussianEnvelope u := by + rw [densitySquareContour, norm_div] + exact (div_le_self (norm_nonneg _) hn).trans (hK x u hx) + + theorem densitySquareContour_vertical_integrable (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (x : ℝ) (hx : |x| = 1) : + Integrable (fun u : ℝ => densitySquareContour χ s ((x : ℂ) + u * I)) := by + obtain ⟨K, _, hK⟩ := densitySquareGaussian_band_bound χ s hs + have hcont : Continuous (fun u : ℝ => densitySquareContour χ s ((x : ℂ) + u * I)) := by + have hF : Continuous (densitySquareGaussian χ s) := + continuous_iff_continuousAt.mpr (fun w => (densitySquareGaussian_analytic χ s w).continuousAt) + apply (hF.comp (by fun_prop)).div (by fun_prop) + intro u he + have hr := congrArg Complex.re he + simp only [add_re, ofReal_re, mul_re, I_re, I_im, ofReal_im, mul_zero, + zero_mul, sub_self, add_zero, zero_re] at hr + simp [hr] at hx + apply (densityGaussianEnvelope_integrable.const_mul K).mono' hcont.aestronglyMeasurable + filter_upwards with u + apply densitySquareContour_bound χ s K hK x u hx.le + have hn := Complex.abs_re_le_norm ((x : ℂ) + u * I) + simpa only [add_re, ofReal_re, mul_re, I_re, I_im, ofReal_im, mul_zero, + zero_mul, sub_self, add_zero, hx] using hn + + theorem densitySquareContour_horizontal_bound (χ : PrimitiveComplexCharacter) (s : ℂ) + (K : ℝ) (hK : ∀ x u : ℝ, |x| ≤ 1 → + ‖densitySquareGaussian χ s ((x : ℂ) + u * I)‖ ≤ K * densityGaussianEnvelope u) + (u : ℝ) (hu : 1 ≤ |u|) : + ‖∫ x in (-1 : ℝ)..1, densitySquareContour χ s ((x : ℂ) + u * I)‖ ≤ + 2 * K * densityGaussianEnvelope u := by + have hb : ∀ x ∈ Ι (-1 : ℝ) 1, + ‖densitySquareContour χ s ((x : ℂ) + u * I)‖ ≤ K * densityGaussianEnvelope u := by + intro x hx + have hxm : -1 ≤ x ∧ x ≤ 1 := by + rw [uIoc_of_le (by norm_num : (-1 : ℝ) ≤ 1)] at hx + exact ⟨hx.1.le, hx.2⟩ + apply densitySquareContour_bound χ s K hK x u (abs_le.mpr hxm) + have hn := Complex.abs_im_le_norm ((x : ℂ) + u * I) + have he : (((x : ℂ) + u * I).im) = u := by simp + rw [he] at hn + exact hu.trans hn + have h := intervalIntegral.norm_integral_le_of_norm_le_const hb + norm_num at h + convert h using 1 + ring + + theorem densitySquareContour_horizontal_tendsto (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : + Tendsto (fun u : ℝ => ∫ x in (-1 : ℝ)..1, + densitySquareContour χ s ((x : ℂ) + u * I)) atTop (𝓝 0) ∧ + Tendsto (fun u : ℝ => ∫ x in (-1 : ℝ)..1, + densitySquareContour χ s ((x : ℂ) + (-u) * I)) atTop (𝓝 0) := by + obtain ⟨K, _, hK⟩ := densitySquareGaussian_band_bound χ s hs + have he : Tendsto (fun u => 2 * K * densityGaussianEnvelope u) atTop (𝓝 0) := by + simpa only [mul_zero] using densityGaussianEnvelope_tendsto.const_mul (2 * K) + constructor + · rw [tendsto_zero_iff_norm_tendsto_zero] + apply squeeze_zero' (Filter.Eventually.of_forall (fun _ => norm_nonneg _)) _ he + filter_upwards [eventually_ge_atTop (1 : ℝ)] with u hu + exact densitySquareContour_horizontal_bound χ s K hK u (by simpa [abs_of_pos (by linarith : 0 < u)]) + · rw [tendsto_zero_iff_norm_tendsto_zero] + apply squeeze_zero' (Filter.Eventually.of_forall (fun _ => norm_nonneg _)) _ he + filter_upwards [eventually_ge_atTop (1 : ℝ)] with u hu + have h := densitySquareContour_horizontal_bound χ s K hK (-u) + (by simpa [abs_of_pos (by linarith : 0 < u)]) + simpa only [densityGaussianEnvelope, neg_sq, Complex.ofReal_neg] using h + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareEquation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareEquation.lean new file mode 100644 index 0000000000000000000000000000000000000000..42747000a2306974db2776b66d09ade941b9410b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareEquation.lean @@ -0,0 +1,79 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySquareContour + +namespace OAI + +/-! # The actual Gaussian functional equation for the completed square -/ + +namespace Ostmann + +open Complex Filter MeasureTheory +open scoped Topology Interval + + theorem densitySquareContour_limit (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : + I * (∫ u : ℝ, densitySquareContour χ s (1 + u * I)) - + I * (∫ u : ℝ, densitySquareContour χ s (-1 + u * I)) = + (2 * (Real.pi : ℂ) * I) * densityCompletedSquare χ s := by + obtain ⟨htop, hbot⟩ := densitySquareContour_horizontal_tendsto χ s hs + have hr := intervalIntegral_tendsto_integral + (densitySquareContour_vertical_integrable χ s hs 1 (by norm_num)) + tendsto_neg_atTop_atBot tendsto_id + have hl := intervalIntegral_tendsto_integral + (densitySquareContour_vertical_integrable χ s hs (-1) (by norm_num)) + tendsto_neg_atTop_atBot tendsto_id + have hlim := ((hbot.sub htop).add (hr.const_mul I)).sub (hl.const_mul I) + have hlim' : Tendsto (fun T : ℝ => + rectangleBoundaryIntegral (densitySquareContour χ s) (-1) 1 (-T) T) atTop + (𝓝 (I * (∫ u : ℝ, densitySquareContour χ s (1 + u * I)) - + I * (∫ u : ℝ, densitySquareContour χ s (-1 + u * I)))) := by + simpa [rectangleBoundaryIntegral] using hlim + apply tendsto_nhds_unique hlim' + apply tendsto_const_nhds.congr' + filter_upwards [eventually_ge_atTop (1 : ℝ)] with T hT + exact (densitySquareGaussian_rectangle χ s (-1) 1 T (by norm_num) (by norm_num) + (by linarith)).symm + + theorem densitySquareContour_left_reflection (χ : PrimitiveComplexCharacter) (s : ℂ) : + (∫ u : ℝ, densitySquareContour χ s (-1 + u * I)) = + -(@DirichletCharacter.rootNumber χ.modulus ⟨χ.positive.ne'⟩ χ.character) ^ 2 * + ∫ u : ℝ, densitySquareContour χ.inverse (1 - s) (1 + u * I) := by + have he (u : ℝ) : densitySquareContour χ s (-1 + (-u) * I) = + -(@DirichletCharacter.rootNumber χ.modulus ⟨χ.positive.ne'⟩ χ.character) ^ 2 * + densitySquareContour χ.inverse (1 - s) (1 + u * I) := by + have hw : (-1 : ℂ) + (-u) * I = -(1 + (u : ℂ) * I) := by ring + rw [densitySquareContour, hw, densitySquareGaussian_reflection, densitySquareContour, div_neg] + ring + calc + _ = ∫ u : ℝ, densitySquareContour χ s (-1 + (-u) * I) := by + symm + simpa only [Complex.ofReal_neg] using + integral_neg_eq_self (fun u : ℝ => densitySquareContour χ s (-1 + u * I)) volume + _ = _ := by simp_rw [he]; rw [integral_const_mul] + +noncomputable def densitySquareIntegral (χ : PrimitiveComplexCharacter) (s : ℂ) : ℂ := + (2 * (Real.pi : ℂ))⁻¹ * ∫ u : ℝ, densitySquareContour χ s (1 + u * I) + + theorem densityCompletedSquare_equation (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : + densityCompletedSquare χ s = densitySquareIntegral χ s + + (@DirichletCharacter.rootNumber χ.modulus ⟨χ.positive.ne'⟩ χ.character) ^ 2 * + densitySquareIntegral χ.inverse (1 - s) := by + have h := densitySquareContour_limit χ s hs + rw [densitySquareContour_left_reflection] at h + have hpi : (Real.pi : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr Real.pi_ne_zero + have he : (2 * (Real.pi : ℂ)) * densityCompletedSquare χ s = + (∫ u : ℝ, densitySquareContour χ s (1 + u * I)) + + (@DirichletCharacter.rootNumber χ.modulus ⟨χ.positive.ne'⟩ χ.character) ^ 2 * + ∫ u : ℝ, densitySquareContour χ.inverse (1 - s) (1 + u * I) := by + apply mul_left_cancel₀ (show (I : ℂ) ≠ 0 from I_ne_zero) + calc + _ = (2 * (Real.pi : ℂ) * I) * densityCompletedSquare χ s := by ring + _ = _ := h.symm.trans (by ring) + unfold densitySquareIntegral + field_simp + simp_rw [mul_comm I] + linear_combination he + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareGaussian.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareGaussian.lean new file mode 100644 index 0000000000000000000000000000000000000000..d0eac607c174d6c6c769212fd649db77c2ba64c9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareGaussian.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityCompletedSquare +import OAI.NumberTheory.Ostmann.ZeroDensity.RectangleAnalyticPole + +namespace OAI + +/-! # The Gaussian contour for the actual completed square -/ + +namespace Ostmann + +open Complex + +noncomputable def densitySquareGaussian (χ : PrimitiveComplexCharacter) (s w : ℂ) : ℂ := + densityCompletedSquare χ (s + w) * Complex.exp (w ^ 2) + + theorem densitySquareGaussian_analytic (χ : PrimitiveComplexCharacter) (s w : ℂ) : + AnalyticAt ℂ (densitySquareGaussian χ s) w := by + exact ((densityCompletedSquare_analytic χ (s + w)).comp + (analyticAt_const.add analyticAt_id)).mul ((analyticAt_id.pow 2).cexp) + + theorem densitySquareGaussian_reflection (χ : PrimitiveComplexCharacter) (s w : ℂ) : + densitySquareGaussian χ s (-w) = + (@DirichletCharacter.rootNumber χ.modulus ⟨χ.positive.ne'⟩ χ.character) ^ 2 * + densitySquareGaussian χ.inverse (1 - s) w := by + rw [densitySquareGaussian, densityCompletedSquare_reflection] + simp only [neg_sq, densitySquareGaussian] + rw [show 1 - (s + -w) = (1 - s) + w by ring] + ring + + theorem densitySquareGaussian_rectangle (χ : PrimitiveComplexCharacter) (s : ℂ) + (a b T : ℝ) (ha : a < 0) (hb : 0 < b) (hT : 0 < T) : + rectangleBoundaryIntegral (fun w => densitySquareGaussian χ s w / w) a b (-T) T = + (2 * (Real.pi : ℂ) * I) * densityCompletedSquare χ s := by + have h := rectangle_analytic_pole (densitySquareGaussian χ s) a b (-T) T ha hb + (by linarith) hT (fun w _ => densitySquareGaussian_analytic χ s w) + simpa only [densitySquareGaussian, add_zero, zero_pow (by norm_num : 2 ≠ 0), + Complex.exp_zero, mul_one] using h + + theorem densitySquareGaussian_normalized (χ : PrimitiveComplexCharacter) (s w : ℂ) + (hs : 0 < s.re) (hsw : 0 < (s + w).re) : + densitySquareGaussian χ s w / densitySquareNormalizer χ s = + densityCompletedSquareWeight χ s w * χ.L (s + w) ^ 2 := by + have hq : (χ.modulus : ℂ) ≠ 0 := by exact_mod_cast χ.positive.ne' + have hp : (χ.modulus : ℂ) ^ s ≠ 0 := Complex.cpow_ne_zero_iff.mpr (Or.inl hq) + have hg : DirichletCharacter.gammaFactor χ.character s ≠ 0 := by + intro he + exact χ.gammaInverse_ne_zero s hs + (by simp only [PrimitiveComplexCharacter.gammaInverse, he, inv_zero]) + rw [densitySquareGaussian, densityCompletedSquare_eq χ (s + w) hsw, + Complex.cpow_add _ _ hq] + unfold densitySquareNormalizer densityCompletedSquareWeight + field_simp + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareLimit.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..329f6c5b824aeb3f21a302796fbe92e994630ba5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareLimit.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDyadicPartition + +namespace OAI + +/-! # Convergence of the growing original square sums -/ + +namespace Ostmann + +open Complex MeasureTheory Filter +open scoped BigOperators Topology Classical + + theorem densitySquareIntegralTerm_summable (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : Summable (densitySquareIntegralTerm χ s) := by + have h := hasSum_integral_of_summable_integral_norm + (fun n => densitySquareSeriesTerm_integrable χ s hs n) + (densitySquareSeriesTerm_integral_summable χ s hs) + exact h.summable.mul_left (2 * (Real.pi : ℂ))⁻¹ + + @[simp] theorem densitySquareIntegralTerm_zero (χ : PrimitiveComplexCharacter) (s : ℂ) : + densitySquareIntegralTerm χ s 0 = 0 := by + simp [densitySquareIntegralTerm, densitySquareSeriesTerm] + + theorem densitySquare_partial_limit (χ : PrimitiveComplexCharacter) (N : ℕ) (hN : 1 ≤ N) + (t : ℝ) : + Tendsto (fun J : ℕ => ∑ n ∈ Finset.Icc 1 (2 ^ J * N), + densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n) atTop + (𝓝 (densitySmoothedSquare χ (densityVerticalPoint (1 / 2) t))) := by + let s := densityVerticalPoint (1 / 2) t + have hs : s.re = 1 / 2 := by simp [s, densityVerticalPoint] + have hc : Tendsto (fun J : ℕ => 2 ^ J * N + 1) atTop atTop := by + apply tendsto_atTop_mono _ (tendsto_pow_atTop_atTop_of_one_lt (by decide : 1 < (2 : ℕ))) + intro J + have h := Nat.le_mul_of_pos_right (2 ^ J) (by omega : 0 < N) + omega + have he (K : ℕ) : (∑ n ∈ Finset.Icc 1 K, densitySquareIntegralTerm χ s n) = + ∑ n ∈ Finset.range (K + 1), densitySquareIntegralTerm χ s n := by + apply Finset.sum_subset + · intro n hn + exact Finset.mem_range.mpr (by have := (Finset.mem_Icc.mp hn).2; omega) + · intro n hn hnot + have hn' := Finset.mem_range.mp hn + have hzero : n = 0 := by + by_contra hz + exact hnot (Finset.mem_Icc.mpr ⟨by omega, by omega⟩) + simp [hzero] + have h := ((densitySquareIntegralTerm_summable χ s hs).hasSum.tendsto_sum_nat).comp hc + rw [← densitySmoothedSquare_series χ s hs] at h + change Tendsto (fun J => ∑ n ∈ Finset.range (2 ^ J * N + 1), densitySquareIntegralTerm χ s n) + atTop (𝓝 (densitySmoothedSquare χ s)) at h + exact h.congr' (Filter.Eventually.of_forall (fun J => (he (2 ^ J * N)).symm)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareSeries.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareSeries.lean new file mode 100644 index 0000000000000000000000000000000000000000..28777595d740a5eb6061eabc5b40c75eba5a6fec --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareSeries.lean @@ -0,0 +1,37 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityMollifierProduct + +namespace OAI + +/-! # The actual divisor coefficients of the squared character L-function -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_character_self_convolution {q : ℕ} (χ : DirichletCharacter ℂ q) : + LSeries.convolution (fun n : ℕ => χ (n : ZMod q)) (fun n : ℕ => χ (n : ZMod q)) = + fun n : ℕ => χ (n : ZMod q) * (n.divisors.card : ℂ) := by + funext n + rw [LSeries.convolution_def] + calc + _ = ∑ _p ∈ n.divisorsAntidiagonal, χ (n : ZMod q) := by + apply Finset.sum_congr rfl + intro p hp + rw [← map_mul, ← Nat.cast_mul, (Nat.mem_divisorsAntidiagonal.mp hp).1] + _ = _ := by + rw [Nat.sum_divisorsAntidiagonal' (fun _ _ => χ (n : ZMod q))] + simp only [Finset.sum_const, nsmul_eq_mul] + ring + + theorem density_square_LSeries {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) + (s : ℂ) (hs : 1 < s.re) : + LSeries (fun n : ℕ => χ (n : ZMod q) * (n.divisors.card : ℂ)) s = + DirichletCharacter.LFunction χ s ^ 2 := by + rw [← density_character_self_convolution χ, + LSeries_convolution' (χ.LSeriesSummable_of_one_lt_re hs) + (χ.LSeriesSummable_of_one_lt_re hs), ← DirichletCharacter.LFunction_eq_LSeries χ hs] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareSeriesIntegral.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareSeriesIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..766182634aeda3ef362f08cfffe932e3ba37ca87 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareSeriesIntegral.lean @@ -0,0 +1,56 @@ +import Mathlib.MeasureTheory.Integral.DominatedConvergence +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySquareTerms + +namespace OAI + +/-! # Exchanging the actual divisor series and the Gaussian contour integral -/ + +namespace Ostmann + +open Complex MeasureTheory + + theorem densitySquareSeriesTerm_integral_summable (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : + Summable (fun n : ℕ => ∫ u : ℝ, ‖densitySquareSeriesTerm χ s n u‖) := by + let K := Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) * ((χ.modulus : ℝ) * (|s.im| + 2)) + let g : ℝ → ℝ := fun u => Real.exp (-(u ^ 2) / 2) + have hg : Integrable g := by + convert integrable_exp_neg_mul_sq (b := (1 / 2 : ℝ)) (by norm_num) using 1 + funext u + dsimp [g] + congr 1 + ring + have hb (n : ℕ) : (∫ u : ℝ, ‖densitySquareSeriesTerm χ s n u‖) ≤ + (K * ‖LSeries.term (densitySquareCoefficient χ) (3 / 2 : ℂ) n‖) * ∫ u : ℝ, g u := by + rw [← integral_const_mul] + apply integral_mono_ae (densitySquareSeriesTerm_integrable χ s hs n).norm + (hg.const_mul _) + filter_upwards with u + exact densitySquareSeriesTerm_bound χ s hs n u + have hsum := ((densitySquareCoefficient_summable χ).norm.mul_left K).mul_right (∫ u : ℝ, g u) + exact hsum.of_nonneg_of_le (fun n => integral_nonneg (fun u => norm_nonneg _)) hb + +noncomputable def densitySquareIntegralTerm (χ : PrimitiveComplexCharacter) (s : ℂ) (n : ℕ) : ℂ := + (2 * (Real.pi : ℂ))⁻¹ * ∫ u : ℝ, densitySquareSeriesTerm χ s n u + + theorem densitySmoothedSquare_series (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) : densitySmoothedSquare χ s = ∑' n : ℕ, densitySquareIntegralTerm χ s n := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have he (u : ℝ) : densitySquareKernel χ s (1 + u * I) * χ.L (s + (1 + u * I)) ^ 2 = + ∑' n : ℕ, densitySquareSeriesTerm χ s n u := by + have hp : 1 < (s + (1 + (u : ℂ) * I)).re := by norm_num [hs] + have hL : χ.L (s + (1 + u * I)) ^ 2 = + LSeries (densitySquareCoefficient χ) (s + (1 + u * I)) := + (density_square_LSeries χ.character _ hp).symm + rw [hL, LSeries, ← tsum_mul_left] + rfl + rw [densitySmoothedSquare_integral χ s hs] + simp_rw [he] + rw [← integral_tsum_of_summable_integral_norm (fun n => densitySquareSeriesTerm_integrable χ s hs n) + (densitySquareSeriesTerm_integral_summable χ s hs)] + exact tsum_mul_left.symm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareTerms.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareTerms.lean new file mode 100644 index 0000000000000000000000000000000000000000..d2ab6442d843e3b9c0a4aa6d6102191004741b85 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySquareTerms.lean @@ -0,0 +1,76 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySmoothedKernel +import OAI.NumberTheory.Ostmann.ZeroDensity.DensitySquareSeries + +namespace OAI + +/-! # Absolutely integrable Dirichlet terms on the initial right line -/ + +namespace Ostmann + +open Complex MeasureTheory + +noncomputable def densitySquareCoefficient (χ : PrimitiveComplexCharacter) (n : ℕ) : ℂ := + χ.character (n : ZMod χ.modulus) * (n.divisors.card : ℂ) + + theorem densitySquareCoefficient_summable (χ : PrimitiveComplexCharacter) : + LSeriesSummable (densitySquareCoefficient χ) (3 / 2 : ℂ) := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have h := (χ.character.LSeriesSummable_of_one_lt_re (s := (3 / 2 : ℂ)) (by norm_num)).convolution + (χ.character.LSeriesSummable_of_one_lt_re (s := (3 / 2 : ℂ)) (by norm_num)) + rw [density_character_self_convolution] at h + exact h + +noncomputable def densitySquareSeriesTerm (χ : PrimitiveComplexCharacter) (s : ℂ) + (n : ℕ) (u : ℝ) : ℂ := + densitySquareKernel χ s (1 + u * I) * + LSeries.term (densitySquareCoefficient χ) (s + (1 + u * I)) n + + theorem densitySquareSeriesTerm_bound (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (n : ℕ) (u : ℝ) : + ‖densitySquareSeriesTerm χ s n u‖ ≤ + ((Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) * + ((χ.modulus : ℝ) * (|s.im| + 2))) * + ‖LSeries.term (densitySquareCoefficient χ) (3 / 2 : ℂ) n‖) * + Real.exp (-(u ^ 2) / 2) := by + have he : ‖LSeries.term (densitySquareCoefficient χ) (s + (1 + (u : ℂ) * I)) n‖ = + ‖LSeries.term (densitySquareCoefficient χ) (3 / 2 : ℂ) n‖ := by + simp only [LSeries.norm_term_eq] + norm_num [hs] + rw [densitySquareSeriesTerm, norm_mul, he] + have h := mul_le_mul_of_nonneg_right (densitySquareKernel_line_bound χ s hs u) + (norm_nonneg (LSeries.term (densitySquareCoefficient χ) (3 / 2 : ℂ) n)) + convert h using 1 + ring + + theorem densitySquareSeriesTerm_continuous (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (n : ℕ) : Continuous (densitySquareSeriesTerm χ s n) := by + apply (densitySquareKernel_line_continuous χ s hs).mul + by_cases hn : n = 0 + · subst n + simp only [LSeries.term_zero] + exact continuous_const + · simp only [LSeries.term_of_ne_zero hn] + have hnC : (n : ℂ) ≠ 0 := by exact_mod_cast hn + have hp : Continuous (fun u : ℝ => (n : ℂ) ^ (s + (1 + u * I))) := + (differentiable_id.const_cpow (Or.inl hnC)).continuous.comp (by fun_prop) + exact continuous_const.div hp (fun u => Complex.cpow_ne_zero_iff.mpr (Or.inl hnC)) + + theorem densitySquareSeriesTerm_integrable (χ : PrimitiveComplexCharacter) (s : ℂ) + (hs : s.re = 1 / 2) (n : ℕ) : Integrable (densitySquareSeriesTerm χ s n) := by + have hg : Integrable (fun u : ℝ => Real.exp (-(u ^ 2) / 2)) := by + convert integrable_exp_neg_mul_sq (b := (1 / 2 : ℝ)) (by norm_num) using 1 + funext u + congr 1 + ring + apply (hg.const_mul ((Real.exp (2 * (59 + |Real.eulerMascheroniConstant|) + 4 + + 2 * (59 + |Real.eulerMascheroniConstant|) ^ 2) * + ((χ.modulus : ℝ) * (|s.im| + 2))) * + ‖LSeries.term (densitySquareCoefficient χ) (3 / 2 : ℂ) n‖)).mono' + (densitySquareSeriesTerm_continuous χ s hs n).aestronglyMeasurable + filter_upwards with u + exact densitySquareSeriesTerm_bound χ s hs n u + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySubsetAbscissaSieve.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySubsetAbscissaSieve.lean new file mode 100644 index 0000000000000000000000000000000000000000..98db32286ddd9250a9183c90be0d7bfbb19a1daa --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensitySubsetAbscissaSieve.lean @@ -0,0 +1,49 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityVariableAbscissaSieve +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityGaussianSubset + +namespace OAI + +/-! # Variable-abscissa sieve on a concrete coefficient block -/ + +namespace Ostmann + +open scoped BigOperators Classical + + theorem density_subset_abscissa_sieve : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T σ : ℝ, 1 ≤ T → 0 ≤ σ → σ ≤ 1 → + ∀ U : Finset ℕ, U ⊆ Finset.Icc 1 N → ∀ a : ℕ → ℂ, + ∀ {ι : Type} (R : Finset ι) (c : ι → PrimitiveComplexCharacter) (t β : ι → ℝ), + (∀ i ∈ R, (c i).modulus ≤ Q) → (∀ i ∈ R, |t i| ≤ T) → + (∀ i ∈ R, ∀ j ∈ R, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∀ i ∈ R, σ ≤ β i ∧ β i ≤ 1) → + (∑ i ∈ R, ‖densityCharacterPolynomial U + (densityVerticalCoeff a (β i)) (c i).character (t i)‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * (T + 1)) * + (2 + 64 * (Real.log (N + 1 : ℕ)) ^ 2) * (2 + (Real.log (N + 1 : ℕ)) ^ 2) * + ∑ n ∈ U, ‖densityVerticalCoeff a σ n‖ ^ 2 := by + obtain ⟨C, hC, hb⟩ := density_variable_abscissa_sieve + refine ⟨C, hC, ?_⟩ + intro N Q hQ T σ hT hσ0 hσ1 U hU a ι R c t β hc ht hs hβ + let b : ℕ → ℂ := fun n => if n ∈ U then a n else 0 + have hp (χ : PrimitiveComplexCharacter) (x u : ℝ) : + densityCharacterPolynomial (Finset.Icc 1 N) (densityVerticalCoeff b x) χ.character u = + densityCharacterPolynomial U (densityVerticalCoeff a x) χ.character u := by + unfold densityCharacterPolynomial + convert density_sum_truncate U (Finset.Icc 1 N) hU + (fun n => densityVerticalCoeff a x n * χ.character (n : ZMod χ.modulus) * + realAdditivePhase (-(Real.log n * u))) using 1 + apply Finset.sum_congr rfl + intro n _ + by_cases hn : n ∈ U <;> simp [b, densityVerticalCoeff, hn] + have he : (∑ n ∈ Finset.Icc 1 N, ‖densityVerticalCoeff b σ n‖ ^ 2) = + ∑ n ∈ U, ‖densityVerticalCoeff a σ n‖ ^ 2 := by + convert density_sum_truncate U (Finset.Icc 1 N) hU + (fun n => ‖densityVerticalCoeff a σ n‖ ^ 2) using 1 + apply Finset.sum_congr rfl + intro n _ + by_cases hn : n ∈ U <;> simp [b, densityVerticalCoeff, hn] + simpa only [hp, he] using hb N Q hQ T σ hT hσ0 hσ1 b R c t β hc ht hs hβ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityTailAssembly.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityTailAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7bf7d8a3385ba760a6b9c61477e76a578252af0 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityTailAssembly.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityBlockWeights + +namespace OAI + +/-! # A uniform mean square for every finite dyadic tail -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators Classical + + theorem densityFiniteSquare_tail_assembly : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ N → 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + 10 * (Q : ℝ) * T ≤ N → ∀ J : ℕ, + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖∑ j ∈ Finset.range J, ∑ n ∈ Finset.Ioc (2 ^ j * N) (2 ^ (j + 1) * N), + densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * (1 + Real.log N) ^ 3 := by + obtain ⟨C, hC, hb⟩ := densityFiniteSquare_dyadic_mean + refine ⟨4 * C * densityBlockEnergyConstant, by + have := densityBlockEnergyConstant_pos + positivity, ?_⟩ + intro N Q hN hQ T hT hscale J F hF + let K := ((N : ℝ) + (Q : ℝ) ^ 2 * T) * (1 + Real.log N) ^ 3 + have hK : 0 ≤ K := by + have hNl := Real.log_nonneg (show (1 : ℝ) ≤ N by exact_mod_cast hN) + dsimp [K] + positivity + let f := fun (χ : PrimitiveComplexCharacter) (j : ℕ) (t : ℝ) => + ∑ n ∈ Finset.Ioc (2 ^ j * N) (2 ^ (j + 1) * N), + densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n + have hf (χ : PrimitiveComplexCharacter) (j : ℕ) : ContinuousOn (f χ j) (Icc (-T) T) := by + apply densityFiniteSquare_continuousOn χ _ _ T hT + intro n hn + have hnp : 0 < n := lt_of_le_of_lt (Nat.zero_le _) (Finset.mem_Ioc.mp hn).1 + omega + have hs : (∑ j ∈ Finset.range J, + (∑ χ ∈ F, ∫ t in Icc (-T) T, ‖f χ j t‖ ^ 2) / (3 / 4 : ℝ) ^ j) ≤ + C * K * densityBlockEnergyConstant := by + calc + _ ≤ ∑ j ∈ Finset.range J, + (C * K * (j + 2 : ℝ) ^ 3 / (2 : ℝ) ^ j) / (3 / 4 : ℝ) ^ j := by + apply Finset.sum_le_sum + intro j _ + have hj : (∑ χ ∈ F, ∫ t in Icc (-T) T, ‖f χ j t‖ ^ 2) ≤ + C * K * (j + 2 : ℝ) ^ 3 / (2 : ℝ) ^ j := by + simpa only [f, K, mul_assoc] using hb N Q hN hQ T hT hscale j F hF + exact div_le_div_of_nonneg_right hj (by positivity) + _ = C * K * ∑ j ∈ Finset.range J, + ((j + 2 : ℝ) ^ 3 / (2 : ℝ) ^ j) / (3 / 4 : ℝ) ^ j := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + ring + _ ≤ _ := mul_le_mul_of_nonneg_left (density_block_energy_sum J) (mul_nonneg hC.le hK) + have h := density_weighted_block_mean F (Finset.range J) f (fun j => (3 / 4 : ℝ) ^ j) + (fun j _ => by positivity) T (fun χ _ j _ => hf χ j) + apply h.trans + calc + _ ≤ (∑ j ∈ Finset.range J, (3 / 4 : ℝ) ^ j) * (C * K * densityBlockEnergyConstant) := + mul_le_mul_of_nonneg_left hs (Finset.sum_nonneg (fun _ _ => by positivity)) + _ ≤ 4 * (C * K * densityBlockEnergyConstant) := + mul_le_mul_of_nonneg_right (density_block_weight_sum J) + (mul_nonneg (mul_nonneg hC.le hK) densityBlockEnergyConstant_pos.le) + _ = _ := by dsimp [K]; ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityTailBlock.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityTailBlock.lean new file mode 100644 index 0000000000000000000000000000000000000000..f135b0a32f78673701b555ca467da1d33819c8a2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityTailBlock.lean @@ -0,0 +1,35 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFiniteSquareMean +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityShiftedDivisorEnergy + +namespace OAI + +/-! # The original finite square on a distant coefficient block -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped BigOperators Classical + + theorem densityFiniteSquare_tail_mean : + ∃ C : ℝ, 0 < C ∧ ∀ M N Q : ℕ, 1 ≤ M → 1 ≤ Q → ∀ T : ℝ, 1 ≤ T → + ∀ S : Finset ℕ, S ⊆ Finset.Icc M N → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ∫ t in Icc (-T) T, + ‖∑ n ∈ S, densitySquareIntegralTerm χ (densityVerticalPoint (1 / 2) t) n‖ ^ 2) ≤ + C * (10 * (Q : ℝ) * T) ^ 2 * ((N : ℝ) + (Q : ℝ) ^ 2 * T) * + ((N : ℝ) * (1 + Real.log N) ^ 3 / (M : ℝ) ^ 3) := by + obtain ⟨C, hC, hb⟩ := densityFiniteSquare_mean + refine ⟨C * densityKernelConstant ^ 2, mul_pos hC (sq_pos_of_pos densityKernelConstant_pos), ?_⟩ + intro M N Q hM hQ T hT S hS F hF + have hSN : S ⊆ Finset.Icc 1 N := fun n hn => + Finset.mem_Icc.mpr ⟨hM.trans (Finset.mem_Icc.mp (hS hn)).1, (Finset.mem_Icc.mp (hS hn)).2⟩ + have h := hb N Q hQ T 1 hT (by norm_num) (by norm_num) S hSN F hF + have he := density_divisor_shifted_tail S M N hM hS + have hbound := h.trans (mul_le_mul_of_nonneg_left he (by positivity)) + convert hbound using 1 + simp only [densityKernelCost, Real.rpow_one, div_one] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityVariableAbscissaSieve.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityVariableAbscissaSieve.lean new file mode 100644 index 0000000000000000000000000000000000000000..2da6812fcda24c851dff1f7e5fec42cca1c04de7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityVariableAbscissaSieve.lean @@ -0,0 +1,84 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityPrimitiveHybrid +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityAbscissaEnergy + +namespace OAI + +/-! # The hybrid sieve with different real parts at the sampled zeros -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators Classical + + theorem density_variable_abscissa_sieve : + ∃ C : ℝ, 0 < C ∧ ∀ N Q : ℕ, 1 ≤ Q → ∀ T σ : ℝ, 1 ≤ T → 0 ≤ σ → σ ≤ 1 → + ∀ a : ℕ → ℂ, ∀ {ι : Type} (R : Finset ι) (c : ι → PrimitiveComplexCharacter) (t β : ι → ℝ), + (∀ i ∈ R, (c i).modulus ≤ Q) → (∀ i ∈ R, |t i| ≤ T) → + (∀ i ∈ R, ∀ j ∈ R, c i = c j → i ≠ j → 1 ≤ |t i - t j|) → + (∀ i ∈ R, σ ≤ β i ∧ β i ≤ 1) → + (∑ i ∈ R, ‖densityCharacterPolynomial (Finset.Icc 1 N) + (densityVerticalCoeff a (β i)) (c i).character (t i)‖ ^ 2) ≤ + C * ((N : ℝ) + (Q : ℝ) ^ 2 * (T + 1)) * + (2 + 64 * (Real.log (N + 1 : ℕ)) ^ 2) * (2 + (Real.log (N + 1 : ℕ)) ^ 2) * + ∑ n ∈ Finset.Icc 1 N, ‖densityVerticalCoeff a σ n‖ ^ 2 := by + obtain ⟨C, hC, hb⟩ := density_primitive_discrete_hybrid + refine ⟨2 * C, by positivity, ?_⟩ + intro N Q hQ T σ hT hσ0 hσ1 a ι R c t β hc ht hs hβ + let E := ∑ n ∈ Finset.Icc 1 N, ‖densityVerticalCoeff a σ n‖ ^ 2 + let K := C * ((N : ℝ) + (Q : ℝ) ^ 2 * (T + 1)) * (2 + 64 * (Real.log (N + 1 : ℕ)) ^ 2) + let F := fun x : ℝ => ∑ i ∈ R, ‖densityCharacterPolynomial (Finset.Icc 1 N) + (densityVerticalCoeff a x) (c i).character (t i)‖ ^ 2 + let G := fun x : ℝ => ∑ i ∈ R, ‖densityCharacterPolynomial (Finset.Icc 1 N) + (densityVerticalCoeff (densityAbscissaDerivativeCoeff a) x) (c i).character (t i)‖ ^ 2 + have hpos (n : ℕ) (hn : n ∈ Finset.Icc 1 N) : 0 < n := (Finset.mem_Icc.mp hn).1 + have hFc : Continuous F := continuous_finsetSum R (fun i _ => + ((density_abscissa_polynomial_continuous _ hpos a (c i).character (t i)).norm.pow 2)) + have hGc : Continuous G := continuous_finsetSum R (fun i _ => + ((density_abscissa_polynomial_continuous _ hpos (densityAbscissaDerivativeCoeff a) (c i).character (t i)).norm.pow 2)) + have hK : 0 ≤ K := by dsimp [K]; positivity + have hE : 0 ≤ E := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + have hFb (x : ℝ) (hx : x ∈ Icc σ 2) : F x ≤ K * E := by + have h := hb N Q hQ T hT (densityVerticalCoeff a x) R c t hc ht hs + exact h.trans (mul_le_mul_of_nonneg_left (density_abscissa_energy_mono N a σ x hx.1) hK) + have hGb (x : ℝ) (hx : x ∈ Icc σ 2) : G x ≤ K * ((Real.log (N + 1 : ℕ)) ^ 2 * E) := by + have h := hb N Q hQ T hT (densityVerticalCoeff (densityAbscissaDerivativeCoeff a) x) R c t hc ht hs + have he := (density_abscissa_energy_mono N (densityAbscissaDerivativeCoeff a) σ x hx.1).trans + (density_abscissa_derivative_energy N a σ) + exact h.trans (mul_le_mul_of_nonneg_left he hK) + have hσ2 : σ ≤ 2 := by linarith + have hIF : (∫ x in σ..2, F x) ≤ 2 * (K * E) := by + have h := intervalIntegral.integral_mono_on (μ := volume) hσ2 (hFc.intervalIntegrable σ 2) + intervalIntegrable_const hFb + rw [intervalIntegral.integral_const, smul_eq_mul] at h + exact h.trans (mul_le_mul_of_nonneg_right (by linarith : 2 - σ ≤ 2) (mul_nonneg hK hE)) + have hIG : (∫ x in σ..2, G x) ≤ 2 * (K * ((Real.log (N + 1 : ℕ)) ^ 2 * E)) := by + have h := intervalIntegral.integral_mono_on (μ := volume) hσ2 (hGc.intervalIntegrable σ 2) + intervalIntegrable_const hGb + rw [intervalIntegral.integral_const, smul_eq_mul] at h + exact h.trans (mul_le_mul_of_nonneg_right (by linarith : 2 - σ ≤ 2) (by positivity)) + have hsample := Finset.sum_le_sum (s := R) (fun i hi => + density_abscissa_polynomial_sample (Finset.Icc 1 N) hpos a (c i).character (t i) σ (β i) + (hβ i hi).1 (hβ i hi).2) + simp only [Finset.sum_add_distrib, ← Finset.mul_sum] at hsample + have heF : (∫ x in σ..2, F x) = ∑ i ∈ R, ∫ x in σ..2, + ‖densityCharacterPolynomial (Finset.Icc 1 N) (densityVerticalCoeff a x) (c i).character (t i)‖ ^ 2 := by + simpa only [F, Pi.pow_apply] using intervalIntegral.integral_finsetSum + (μ := volume) (fun i (_hi : i ∈ R) => + ((density_abscissa_polynomial_continuous _ hpos a (c i).character (t i)).norm.pow 2).intervalIntegrable σ 2) + have heG : (∫ x in σ..2, G x) = ∑ i ∈ R, ∫ x in σ..2, + ‖densityCharacterPolynomial (Finset.Icc 1 N) + (densityVerticalCoeff (densityAbscissaDerivativeCoeff a) x) (c i).character (t i)‖ ^ 2 := by + simpa only [G, Pi.pow_apply] using intervalIntegral.integral_finsetSum + (μ := volume) (fun i (_hi : i ∈ R) => + ((density_abscissa_polynomial_continuous _ hpos (densityAbscissaDerivativeCoeff a) + (c i).character (t i)).norm.pow 2).intervalIntegrable σ 2) + rw [← heF, ← heG] at hsample + apply hsample.trans + have h := add_le_add (mul_le_mul_of_nonneg_left hIF (by norm_num : (0 : ℝ) ≤ 2)) hIG + convert h using 1 + dsimp [K, E] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityVerticalPolynomial.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityVerticalPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..834908409507655d8e17684b765e2df826333117 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityVerticalPolynomial.lean @@ -0,0 +1,57 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityMollifierProduct +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityDiscreteHybrid + +namespace OAI + +/-! # Vertical Dirichlet polynomials with the actual complex powers -/ + +namespace Ostmann + +open scoped BigOperators Classical + +noncomputable def densityVerticalPoint (σ t : ℝ) : ℂ := + (σ : ℂ) + 2 * (Real.pi : ℂ) * Complex.I * t + +noncomputable def densityVerticalCoeff (a : ℕ → ℂ) (σ : ℝ) (n : ℕ) : ℂ := + a n / (n : ℂ) ^ (σ : ℂ) + + theorem density_vertical_term (a : ℂ) (σ t : ℝ) (n : ℕ) (hn : 0 < n) : + a / (n : ℂ) ^ densityVerticalPoint σ t = + (a / (n : ℂ) ^ (σ : ℂ)) * realAdditivePhase (-(Real.log n * t)) := by + have hnC : (n : ℂ) ≠ 0 := by exact_mod_cast hn.ne' + have hlog : Complex.log (n : ℂ) = (Real.log n : ℂ) := by + simpa only [Complex.ofReal_natCast] using + (Complex.ofReal_log (show (0 : ℝ) ≤ n by positivity)).symm + have he : ((n : ℂ) ^ (2 * (Real.pi : ℂ) * Complex.I * t))⁻¹ = + realAdditivePhase (-(Real.log n * t)) := by + rw [Complex.cpow_def_of_ne_zero hnC, ← Complex.exp_neg, hlog] + unfold realAdditivePhase + congr 1 + push_cast + ring + rw [densityVerticalPoint, Complex.cpow_add _ _ hnC, div_mul_eq_div_mul_one_div, + one_div, he] + + theorem density_vertical_polynomial (S : Finset ℕ) (hS : ∀ n ∈ S, 0 < n) + (a : ℕ → ℂ) (σ t : ℝ) : + (∑ n ∈ S, a n / (n : ℂ) ^ densityVerticalPoint σ t) = + ∑ n ∈ S, densityVerticalCoeff a σ n * realAdditivePhase (-(Real.log n * t)) := by + exact Finset.sum_congr rfl (fun n hn => density_vertical_term _ σ t n (hS n hn)) + + theorem densityVerticalCoeff_norm (a : ℕ → ℂ) (σ : ℝ) (n : ℕ) (hn : 0 < n) : + ‖densityVerticalCoeff a σ n‖ = ‖a n‖ / (n : ℝ) ^ σ := by + rw [densityVerticalCoeff, norm_div] + congr 1 + rw [← Complex.ofReal_natCast, Complex.norm_cpow_eq_rpow_re_of_pos (by positivity)] + rfl + + theorem densityVerticalCoeff_half_square (a : ℕ → ℂ) (n : ℕ) (hn : 0 < n) : + ‖densityVerticalCoeff a (1 / 2) n‖ ^ 2 = ‖a n‖ ^ 2 / n := by + have hden : ((n : ℝ) ^ (1 / 2 : ℝ)) ^ 2 = n := by + rw [← Real.rpow_natCast, ← Real.rpow_mul (by positivity)] + norm_num + rw [densityVerticalCoeff_norm a _ n hn, div_pow, hden] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedCauchy.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedCauchy.lean new file mode 100644 index 0000000000000000000000000000000000000000..01aae85a4ac4b424b43f2931895400e096fa0006 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedCauchy.lean @@ -0,0 +1,42 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFiniteContourShift + +namespace OAI + +/-! # The weighted Cauchy inequality used for the finite contour polynomials -/ + +namespace Ostmann + +open MeasureTheory + + theorem density_weighted_cauchy (g p : ℝ → ℝ) + (hg : Integrable g) (hgp : Integrable (fun u => g u * p u)) + (hgpp : Integrable (fun u => g u * (p u) ^ 2)) + (hg0 : ∀ u, 0 ≤ g u) (hpos : 0 < ∫ u, g u) : + (∫ u, g u * p u) ^ 2 ≤ (∫ u, g u) * ∫ u, g u * (p u) ^ 2 := by + let A := ∫ u, g u + let B := ∫ u, g u * p u + let D := ∫ u, g u * (p u) ^ 2 + let t := B / A + have hA : 0 < A := hpos + have htA : t * A = B := div_mul_cancel₀ B hA.ne' + have he : (∫ u, g u * (p u - t) ^ 2) = D - 2 * t * B + t ^ 2 * A := by + have hf : (fun u => g u * (p u - t) ^ 2) = + (fun u => (g u * (p u) ^ 2 - (2 * t) * (g u * p u)) + t ^ 2 * g u) := by + funext u + ring + rw [hf] + have hadd := integral_add (hgpp.sub (hgp.const_mul (2 * t))) (hg.const_mul (t ^ 2)) + have hsub := integral_sub hgpp (hgp.const_mul (2 * t)) + simp only [Pi.sub_apply] at hadd hsub + rw [hadd, hsub, integral_const_mul, integral_const_mul] + have hn : 0 ≤ D - 2 * t * B + t ^ 2 * A := by + rw [← he] + exact integral_nonneg (fun u => mul_nonneg (hg0 u) (sq_nonneg _)) + have hm := mul_nonneg hA.le hn + have hs : (t * A) ^ 2 = B ^ 2 := congrArg (fun x : ℝ => x ^ 2) htA + change B ^ 2 ≤ A * D + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedFourth.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedFourth.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a78124633c84375a2e86b4e86a90d43c9b1c9cc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedFourth.lean @@ -0,0 +1,53 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityMomentDyadic + +namespace OAI + +/-! # The actual fourth moment with a whole-line cubic height weight -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators + + theorem density_weighted_fourth_moment : + ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 2 ≤ T → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + Integrable (fun t => densityHeightWeight T t * + ∑ χ ∈ F, ‖χ.L (densityVerticalPoint (1 / 2) t)‖ ^ 4) ∧ + (∫ t, densityHeightWeight T t * + ∑ χ ∈ F, ‖χ.L (densityVerticalPoint (1 / 2) t)‖ ^ 4) ≤ + C * ((Q : ℝ) ^ 2 * T) * (Real.log ((Q : ℝ) * T)) ^ 6 := by + obtain ⟨C, hC, hb⟩ := density_fourth_moment + refine ⟨C * densityHeightEnergyConstant 6, mul_pos hC (densityHeightEnergyConstant_pos 6), ?_⟩ + intro Q hQ T hT F hF + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hl0 : 0 ≤ Real.log ((Q : ℝ) * T) := Real.log_nonneg (by nlinarith) + let A := C * ((Q : ℝ) ^ 2 * T) * (Real.log ((Q : ℝ) * T)) ^ 6 + have hball (j : ℕ) : + (∫ t in densityHeightBall T j, ∑ χ ∈ F, ‖χ.L (densityVerticalPoint (1 / 2) t)‖ ^ 4) ≤ + A * (2 : ℝ) ^ j * (j + 1 : ℝ) ^ 6 := by + have hp : (1 : ℝ) ≤ (2 : ℝ) ^ j := one_le_pow₀ (by norm_num) + have hH : 2 ≤ (2 : ℝ) ^ j * T := by nlinarith + have hh := hb Q hQ ((2 : ℝ) ^ j * T) hH F hF + rw [densityHeightBall, integral_finsetSum F (fun χ _ => + density_L_fourth_integrable χ ((2 : ℝ) ^ j * T))] + apply hh.trans + have hlog := density_dyadic_height_log Q hQ T hT j + have hlog0 : 0 ≤ Real.log ((Q : ℝ) * ((2 : ℝ) ^ j * T)) := + Real.log_nonneg (by nlinarith) + calc + _ ≤ C * ((Q : ℝ) ^ 2 * ((2 : ℝ) ^ j * T)) * + ((j + 1 : ℝ) * Real.log ((Q : ℝ) * T)) ^ 6 := + mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hlog0 hlog 6) (by positivity) + _ = _ := by dsimp [A]; ring + obtain ⟨hi, hm⟩ := density_weighted_moment + (fun t => ∑ χ ∈ F, ‖χ.L (densityVerticalPoint (1 / 2) t)‖ ^ 4) + (density_L_fourth_family_continuous F) (fun _ => Finset.sum_nonneg (fun _ _ => by positivity)) + T (by linarith) A (by dsimp [A]; positivity) 6 hball + refine ⟨hi, hm.trans_eq ?_⟩ + dsimp [A] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedMollifier.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedMollifier.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad0ab3d5562cff02217e5e3815387cae5f05f2bf --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedMollifier.lean @@ -0,0 +1,57 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityMomentDyadic + +namespace OAI + +/-! # The actual mollifier mean with a whole-line cubic height weight -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators + + theorem density_weighted_mollifier_mean : + ∃ C : ℝ, 0 < C ∧ ∀ X Q : ℕ, 1 ≤ X → 1 ≤ Q → ∀ T : ℝ, 2 ≤ T → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + Integrable (fun t => densityHeightWeight T t * ∑ χ ∈ F, + ‖densityMollifier X χ.character (densityVerticalPoint (1 / 2) t)‖ ^ 2) ∧ + (∫ t, densityHeightWeight T t * ∑ χ ∈ F, + ‖densityMollifier X χ.character (densityVerticalPoint (1 / 2) t)‖ ^ 2) ≤ + C * ((X : ℝ) + (Q : ℝ) ^ 2 * T) * (1 + Real.log X) := by + obtain ⟨C, hC, hb⟩ := density_mollifier_primitive_mean + refine ⟨C * densityHeightEnergyConstant 0, mul_pos hC (densityHeightEnergyConstant_pos 0), ?_⟩ + intro X Q hX hQ T hT F hF + have hx : (1 : ℝ) ≤ X := by exact_mod_cast hX + have hl0 : 0 ≤ Real.log X := Real.log_nonneg hx + let A := C * ((X : ℝ) + (Q : ℝ) ^ 2 * T) * (1 + Real.log X) + have hfχ (χ : PrimitiveComplexCharacter) : + Continuous (fun t => ‖densityMollifier X χ.character (densityVerticalPoint (1 / 2) t)‖ ^ 2) := by + have h := density_mollifier_family_continuous {χ} X + simpa using h + have hball (j : ℕ) : + (∫ t in densityHeightBall T j, ∑ χ ∈ F, + ‖densityMollifier X χ.character (densityVerticalPoint (1 / 2) t)‖ ^ 2) ≤ + A * (2 : ℝ) ^ j * (j + 1 : ℝ) ^ 0 := by + have hp : (1 : ℝ) ≤ (2 : ℝ) ^ j := one_le_pow₀ (by norm_num) + have hH : 1 ≤ (2 : ℝ) ^ j * T := by nlinarith + have hh := hb X Q hQ ((2 : ℝ) ^ j * T) hH F hF + rw [densityHeightBall, integral_finsetSum F (fun χ _ => (hfχ χ).continuousOn.integrableOn_Icc)] + apply hh.trans + have hsize : (X : ℝ) + (Q : ℝ) ^ 2 * ((2 : ℝ) ^ j * T) ≤ + ((X : ℝ) + (Q : ℝ) ^ 2 * T) * (2 : ℝ) ^ j := by + have h := mul_le_mul_of_nonneg_left hp (Nat.cast_nonneg X : (0 : ℝ) ≤ X) + nlinarith + calc + _ ≤ C * (((X : ℝ) + (Q : ℝ) ^ 2 * T) * (2 : ℝ) ^ j) * (1 + Real.log X) := + mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hsize hC.le) (by positivity) + _ = _ := by dsimp [A]; ring + obtain ⟨hi, hm⟩ := density_weighted_moment + (fun t => ∑ χ ∈ F, ‖densityMollifier X χ.character (densityVerticalPoint (1 / 2) t)‖ ^ 2) + (density_mollifier_family_continuous F X) (fun _ => Finset.sum_nonneg (fun _ _ => by positivity)) + T (by linarith) A (by dsimp [A]; positivity) 0 hball + refine ⟨hi, hm.trans_eq ?_⟩ + dsimp [A] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedMoment.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..3976bf7b472e959a6774e6af3fd1c3b390df8953 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedMoment.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityHeightWeight + +namespace OAI + +/-! # A whole-line weighted moment from compact height moments -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators + +noncomputable def densityShellBudget (A : ℝ) (k : ℕ) : ℕ → ℝ + | 0 => A + | j + 1 => 2 * A * ((j + 2 : ℝ) ^ k * (1 / 4 : ℝ) ^ j) + + theorem densityShellBudget_nonneg (A : ℝ) (hA : 0 ≤ A) (k j : ℕ) : + 0 ≤ densityShellBudget A k j := by + cases j <;> simp only [densityShellBudget] <;> positivity + + theorem densityShellBudget_summable (A : ℝ) (k : ℕ) : Summable (densityShellBudget A k) := by + apply (summable_nat_add_iff 1).mp + exact (density_height_energy_summable k).mul_left (2 * A) + + theorem densityShellBudget_sum (A : ℝ) (k : ℕ) : + (∑' j, densityShellBudget A k j) = A * densityHeightEnergyConstant k := by + rw [(densityShellBudget_summable A k).tsum_eq_zero_add] + simp only [densityShellBudget] + rw [tsum_mul_left] + unfold densityHeightEnergyConstant + ring + + theorem density_weighted_shell_bound (f : ℝ → ℝ) (hf : Continuous f) + (hf0 : ∀ x, 0 ≤ f x) (T : ℝ) (hT : 0 < T) (A : ℝ) (k : ℕ) + (hball : ∀ j : ℕ, (∫ x in densityHeightBall T j, f x) ≤ + A * (2 : ℝ) ^ j * (j + 1 : ℝ) ^ k) (j : ℕ) : + (∫ x in densityHeightShell T j, densityHeightWeight T x * f x) ≤ + densityShellBudget A k j := by + have hi (j : ℕ) : IntegrableOn f (densityHeightBall T j) := hf.continuousOn.integrableOn_Icc + have hiw (j : ℕ) : IntegrableOn (fun x => densityHeightWeight T x * f x) (densityHeightShell T j) := + (((densityHeightWeight_continuous T).mul hf).continuousOn.integrableOn_Icc).mono_set + (densityHeightShell_subset T j) + cases j with + | zero => + apply (integral_mono (hiw 0) (hi 0) (fun x => ?_)).trans + · simpa only [densityHeightShell, densityShellBudget, pow_zero, mul_one, Nat.cast_zero, zero_add, one_pow] using hball 0 + · exact mul_le_of_le_one_left (hf0 x) (densityCubicWeight_le_one _) + | succ j => + have hsub : (∫ x in densityHeightShell T (j + 1), f x) ≤ + ∫ x in densityHeightBall T (j + 1), f x := + setIntegral_mono_set (hi (j + 1)) (Filter.Eventually.of_forall hf0) + (Filter.Eventually.of_forall (fun _ hx => densityHeightShell_subset T (j + 1) hx)) + calc + _ ≤ (1 / 8 : ℝ) ^ j * ∫ x in densityHeightShell T (j + 1), f x := by + rw [← integral_const_mul] + apply setIntegral_mono_on (hiw (j + 1)) + (((hi (j + 1)).mono_set (densityHeightShell_subset T (j + 1))).const_mul _) + (densityHeightShell_measurable T (j + 1)) + intro x hx + exact mul_le_mul_of_nonneg_right (densityHeightWeight_shell T hT j x hx) (hf0 x) + _ ≤ (1 / 8 : ℝ) ^ j * (A * (2 : ℝ) ^ (j + 1) * (j + 1 + 1 : ℝ) ^ k) := + mul_le_mul_of_nonneg_left (hsub.trans (by + simpa only [Nat.cast_add, Nat.cast_one] using hball (j + 1))) (by positivity) + _ = densityShellBudget A k (j + 1) := by + simp only [densityShellBudget, pow_succ] + have he : (1 / 8 : ℝ) ^ j * (2 : ℝ) ^ j = (1 / 4 : ℝ) ^ j := by + rw [← mul_pow] + norm_num + rw [show (j + 1 + 1 : ℝ) = j + 2 by ring] + calc + _ = 2 * A * (j + 2 : ℝ) ^ k * ((1 / 8 : ℝ) ^ j * (2 : ℝ) ^ j) := by ring + _ = _ := by rw [he]; ring + + theorem density_weighted_moment (f : ℝ → ℝ) (hf : Continuous f) + (hf0 : ∀ x, 0 ≤ f x) (T : ℝ) (hT : 0 < T) (A : ℝ) (_hA : 0 ≤ A) (k : ℕ) + (hball : ∀ j : ℕ, (∫ x in densityHeightBall T j, f x) ≤ + A * (2 : ℝ) ^ j * (j + 1 : ℝ) ^ k) : + Integrable (fun x => densityHeightWeight T x * f x) ∧ + (∫ x, densityHeightWeight T x * f x) ≤ A * densityHeightEnergyConstant k := by + let g := fun x => densityHeightWeight T x * f x + have hg0 (x : ℝ) : 0 ≤ g x := mul_nonneg (densityHeightWeight_nonneg T x) (hf0 x) + have hi (j : ℕ) : IntegrableOn g (densityHeightShell T j) := + (((densityHeightWeight_continuous T).mul hf).continuousOn.integrableOn_Icc).mono_set + (densityHeightShell_subset T j) + have hb (j : ℕ) : (∫ x in densityHeightShell T j, g x) ≤ densityShellBudget A k j := + density_weighted_shell_bound f hf hf0 T hT A k hball j + have hsum : Summable (fun j => ∫ x in densityHeightShell T j, g x) := + (densityShellBudget_summable A k).of_nonneg_of_le + (fun j => integral_nonneg (fun x => hg0 x)) hb + have hnorm : Summable (fun j => ∫ x in densityHeightShell T j, ‖g x‖) := by + simpa only [Real.norm_eq_abs, abs_of_nonneg (hg0 _)] using hsum + have hgi := integrableOn_iUnion_of_summable_integral_norm hi hnorm + rw [densityHeightShell_cover T hT, integrableOn_univ] at hgi + refine ⟨hgi, ?_⟩ + have he := integral_iUnion (densityHeightShell_measurable T) + (densityHeightShell_disjoint T hT.le) (show IntegrableOn g (⋃ j, densityHeightShell T j) by + rwa [densityHeightShell_cover T hT, integrableOn_univ]) + rw [densityHeightShell_cover T hT, setIntegral_univ] at he + change (∫ x, g x) ≤ _ + rw [he, ← densityShellBudget_sum A k] + exact hsum.tsum_le_tsum hb (densityShellBudget_summable A k) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedProductCauchy.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedProductCauchy.lean new file mode 100644 index 0000000000000000000000000000000000000000..d4e4284373426e151a0b2fc7dc896595fd4daf46 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWeightedProductCauchy.lean @@ -0,0 +1,92 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityWeightedCauchy + +namespace OAI + +/-! # Weighted product Cauchy inequalities for the zero detector -/ + +namespace Ostmann + +open MeasureTheory +open scoped BigOperators + + theorem density_product_cauchy (w f g : ℝ → ℝ) + (hw : ∀ x, 0 ≤ w x) + (hff : Integrable (fun x => w x * f x ^ 2)) + (hgg : Integrable (fun x => w x * g x ^ 2)) + (hfg : Integrable (fun x => w x * f x * g x)) : + (∫ x, w x * f x * g x) ^ 2 ≤ + (∫ x, w x * f x ^ 2) * ∫ x, w x * g x ^ 2 := by + let A := ∫ x, w x * f x ^ 2 + let B := ∫ x, w x * f x * g x + let D := ∫ x, w x * g x ^ 2 + have hA : 0 ≤ A := integral_nonneg (fun x => mul_nonneg (hw x) (sq_nonneg _)) + have hq (t : ℝ) : 0 ≤ D - 2 * t * B + t ^ 2 * A := by + have he : (fun x => w x * (g x - t * f x) ^ 2) = + (fun x => (w x * g x ^ 2 - (2 * t) * (w x * f x * g x)) + t ^ 2 * (w x * f x ^ 2)) := by + funext x + ring + have hh := integral_add (hgg.sub (hfg.const_mul (2 * t))) (hff.const_mul (t ^ 2)) + have hs := integral_sub hgg (hfg.const_mul (2 * t)) + simp only [Pi.sub_apply] at hh hs + have hn : 0 ≤ ∫ x, w x * (g x - t * f x) ^ 2 := + integral_nonneg (fun x => mul_nonneg (hw x) (sq_nonneg _)) + rw [he, hh, hs, integral_const_mul, integral_const_mul] at hn + exact hn + change B ^ 2 ≤ A * D + by_cases ha : 0 < A + · have ht : (B / A) * A = B := div_mul_cancel₀ B ha.ne' + have hh := hq (B / A) + have hm := mul_nonneg ha.le hh + have hs := congrArg (fun x : ℝ => x ^ 2) ht + nlinarith + · have ha0 : A = 0 := le_antisymm (le_of_not_gt ha) hA + by_cases hb : B = 0 + · simp [ha0, hb] + · have ht : ((D + 1) / (2 * B)) * (2 * B) = D + 1 := + div_mul_cancel₀ _ (mul_ne_zero (by norm_num) hb) + have hh := hq ((D + 1) / (2 * B)) + rw [ha0, mul_zero, add_zero] at hh + nlinarith + + theorem density_finite_product_cauchy {ι : Type*} (S : Finset ι) + (w f g : ι → ℝ → ℝ) (hw : ∀ i ∈ S, ∀ x, 0 ≤ w i x) + (hff : ∀ i ∈ S, Integrable (fun x => w i x * f i x ^ 2)) + (hgg : ∀ i ∈ S, Integrable (fun x => w i x * g i x ^ 2)) + (hfg : ∀ i ∈ S, Integrable (fun x => w i x * f i x * g i x)) : + (∑ i ∈ S, ∫ x, w i x * f i x * g i x) ^ 2 ≤ + (∑ i ∈ S, ∫ x, w i x * f i x ^ 2) * + ∑ i ∈ S, ∫ x, w i x * g i x ^ 2 := by + apply Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul S + (fun i hi => integral_nonneg (fun x => mul_nonneg (hw i hi x) (sq_nonneg _))) + (fun i hi => integral_nonneg (fun x => mul_nonneg (hw i hi x) (sq_nonneg _))) + intro i hi + exact density_product_cauchy (w i) (f i) (g i) (hw i hi) (hff i hi) (hgg i hi) (hfg i hi) + + theorem density_finite_product_fourth {ι : Type*} (S : Finset ι) + (w f g : ι → ℝ → ℝ) (hw : ∀ i ∈ S, ∀ x, 0 ≤ w i x) + (h0 : ∀ i ∈ S, Integrable (w i)) + (h2 : ∀ i ∈ S, Integrable (fun x => w i x * f i x ^ 2)) + (h4 : ∀ i ∈ S, Integrable (fun x => w i x * f i x ^ 4)) + (hg : ∀ i ∈ S, Integrable (fun x => w i x * g i x ^ 2)) + (hfg : ∀ i ∈ S, Integrable (fun x => w i x * f i x * g i x)) : + (∑ i ∈ S, ∫ x, w i x * f i x * g i x) ^ 4 ≤ + (∑ i ∈ S, ∫ x, w i x) * (∑ i ∈ S, ∫ x, w i x * f i x ^ 4) * + (∑ i ∈ S, ∫ x, w i x * g i x ^ 2) ^ 2 := by + have hfirst := density_finite_product_cauchy S w f g hw h2 hg hfg + have hsecond := density_finite_product_cauchy S w (fun _ _ => 1) (fun i x => f i x ^ 2) hw + (fun i hi => by simpa using h0 i hi) + (fun i hi => by simpa only [← pow_mul] using h4 i hi) + (fun i hi => by simpa using h2 i hi) + simp only [one_pow, mul_one, ← pow_mul] at hsecond + calc + _ = ((∑ i ∈ S, ∫ x, w i x * f i x * g i x) ^ 2) ^ 2 := by ring + _ ≤ ((∑ i ∈ S, ∫ x, w i x * f i x ^ 2) * + (∑ i ∈ S, ∫ x, w i x * g i x ^ 2)) ^ 2 := + pow_le_pow_left₀ (sq_nonneg _) hfirst 2 + _ = (∑ i ∈ S, ∫ x, w i x * f i x ^ 2) ^ 2 * + (∑ i ∈ S, ∫ x, w i x * g i x ^ 2) ^ 2 := mul_pow _ _ _ + _ ≤ _ := mul_le_mul_of_nonneg_right hsecond (sq_nonneg _) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWindowEnergy.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWindowEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..0270cb5ccba95d8bcf7353536ee89693de5f45cc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityWindowEnergy.lean @@ -0,0 +1,74 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityLocalizedPolynomial + +namespace OAI + +/-! # A compact Fourier window controls the height mean square -/ + +namespace Ostmann + +open MeasureTheory Set +open scoped BigOperators SchwartzMap FourierTransform + + theorem density_schwartz_square_integrable (W : 𝓢(ℝ, ℂ)) : + Integrable (fun x : ℝ => ‖W x‖ ^ 2) := + (memLp_two_iff_integrable_sq_norm W.continuous.aestronglyMeasurable).mp (W.memLp 2) + + theorem density_height_window_bound {ι : Type*} [Fintype ι] + (W : 𝓢(ℝ, ℂ)) (c h T : ℝ) (hc : 0 < c) (hh : 0 < h) + (hwindow : h * T ≤ 1) (hW : ∀ t, |t| ≤ 1 → c ≤ ‖𝓕 W t‖) + (a : ι → ℂ) (freq : ι → ℝ) : + h ^ 2 * c ^ 2 * (∫ t in Icc (-T) T, + ‖∑ j, a j * realAdditivePhase (-(freq j * t))‖ ^ 2) ≤ + ∫ x : ℝ, ‖∑ j, a j * W ((x - freq j) / h)‖ ^ 2 := by + let P := densityLocalizedPolynomial W h hh a freq + have hi : Integrable (fun t : ℝ => ‖𝓕 P t‖ ^ 2) := + density_schwartz_square_integrable (𝓕 P) + have hl : IntegrableOn (fun t : ℝ => h ^ 2 * c ^ 2 * + ‖∑ j, a j * realAdditivePhase (-(freq j * t))‖ ^ 2) (Icc (-T) T) := by + apply ContinuousOn.integrableOn_Icc + apply Continuous.continuousOn + unfold realAdditivePhase + fun_prop + have hm : (∫ t in Icc (-T) T, h ^ 2 * c ^ 2 * + ‖∑ j, a j * realAdditivePhase (-(freq j * t))‖ ^ 2) ≤ + ∫ t in Icc (-T) T, ‖𝓕 P t‖ ^ 2 := by + apply setIntegral_mono_on hl hi.integrableOn measurableSet_Icc + intro t ht + exact density_localized_pointwise_bound W c h T hc hh hwindow hW a freq t + (abs_le.mpr ht) + rw [integral_const_mul] at hm + have hb := setIntegral_le_integral (s := Icc (-T) T) hi + (Filter.Eventually.of_forall (fun t => sq_nonneg ‖𝓕 P t‖)) + apply (hm.trans hb).trans_eq + rw [SchwartzMap.integral_norm_sq_fourier] + apply integral_congr_ae + filter_upwards with x + rw [show P = densityLocalizedPolynomial W h hh a freq from rfl, + densityLocalizedPolynomial_apply] + + theorem density_shifted_window_square (W : 𝓢(ℝ, ℂ)) (h : ℝ) (hh : 0 < h) (v : ℝ) : + (∫ x : ℝ, ‖W ((x - v) / h)‖ ^ 2) = h * ∫ x : ℝ, ‖W x‖ ^ 2 := by + have ht := integral_add_right_eq_self (μ := volume) + (fun x : ℝ => ‖W (x / h)‖ ^ 2) (-v) + simp only [sub_eq_add_neg] at ⊢ + rw [ht] + simpa only [abs_of_pos hh, smul_eq_mul] using + Measure.integral_comp_div (fun x : ℝ => ‖W x‖ ^ 2) h + + theorem density_shifted_window_integrable (W : 𝓢(ℝ, ℂ)) (h : ℝ) + (hh : 0 < h) (v : ℝ) : + Integrable (fun x : ℝ => ‖W ((x - v) / h)‖ ^ 2) := by + have hi := density_schwartz_square_integrable + ((positiveDilate W h⁻¹ (inv_pos.mpr hh)).compSubConstCLM ℂ v) + simpa only [SchwartzMap.compSubConstCLM_apply, positiveDilate_apply, + div_eq_inv_mul] using hi + + theorem density_localized_square_integrable {ι : Type*} [Fintype ι] + (W : 𝓢(ℝ, ℂ)) (h : ℝ) (hh : 0 < h) (a : ι → ℂ) (freq : ι → ℝ) : + Integrable (fun x : ℝ => ‖∑ j, a j * W ((x - freq j) / h)‖ ^ 2) := by + simpa only [densityLocalizedPolynomial_apply] using + density_schwartz_square_integrable (densityLocalizedPolynomial W h hh a freq) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityZeroBins.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityZeroBins.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9abf28cc7997f7cdfe69302d1a98dfa1646955b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DensityZeroBins.lean @@ -0,0 +1,116 @@ +import Mathlib.Data.Finset.Sigma +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityLocalMultiplicity + +namespace OAI + +/-! # Actual zero indices, unit ordinate bins and separated representatives -/ + +namespace Ostmann + +open scoped BigOperators Classical + +abbrev DensityZeroIndex := Σ _ : PrimitiveComplexCharacter, ℕ +abbrev DensityZeroBin := Σ _ : PrimitiveComplexCharacter, ℤ + +noncomputable def densityZeroIndices (F : Finset PrimitiveComplexCharacter) (σ T : ℝ) : + Finset DensityZeroIndex := + F.sigma fun χ => ((actualCharacterZeros χ).heightIndices T).filter + (fun i => σ ≤ ((actualCharacterZeros χ).zeros i).re) + +noncomputable def densityZeroBin (i : DensityZeroIndex) : DensityZeroBin := + ⟨i.1, ⌊((actualCharacterZeros i.1).zeros i.2).im⌋⟩ + + theorem densityZeroIndices_mem (F : Finset PrimitiveComplexCharacter) (σ T : ℝ) + (i : DensityZeroIndex) : i ∈ densityZeroIndices F σ T ↔ + i.1 ∈ F ∧ |((actualCharacterZeros i.1).zeros i.2).im| ≤ T ∧ + σ ≤ ((actualCharacterZeros i.1).zeros i.2).re := by + simp [densityZeroIndices, ComplexZeroEnumeration.mem_heightIndices] + + theorem densityZeroIndices_card (F : Finset PrimitiveComplexCharacter) (σ T : ℝ) : + ((densityZeroIndices F σ T).card : ℝ) = + ∑ χ ∈ F, ((actualCharacterZeros χ).count σ T : ℝ) := by + simp [densityZeroIndices, Finset.card_sigma, ComplexZeroEnumeration.count] + + theorem densityZeroBin_nonempty (S : Finset DensityZeroIndex) (k : DensityZeroBin) + (hk : k ∈ S.image densityZeroBin) : + ∃ n : ℕ, (⟨k.1, n⟩ : DensityZeroIndex) ∈ S ∧ + ⌊((actualCharacterZeros k.1).zeros n).im⌋ = k.2 := by + obtain ⟨⟨χ, n⟩, hn, he⟩ := Finset.mem_image.mp hk + cases he + exact ⟨n, hn, rfl⟩ + + theorem densityZeroBin_fiber_bound (Q : ℕ) (hQ : 1 ≤ Q) (T σ : ℝ) + (hT : 2 ≤ T) (hσ : 1 / 2 ≤ σ) (F : Finset PrimitiveComplexCharacter) + (hF : ∀ χ ∈ F, χ.modulus ≤ Q) (k : DensityZeroBin) : + (((densityZeroIndices F σ T).filter fun i => densityZeroBin i = k).card : ℝ) ≤ + (8 / Real.log (14 / 13)) * Real.log ((Q : ℝ) * T) := by + let S := (densityZeroIndices F σ T).filter fun i => densityZeroBin i = k + let N := S.image (fun i => i.2) + have hchar (i : DensityZeroIndex) (hi : i ∈ S) : i.1 = k.1 := + congrArg Sigma.fst (Finset.mem_filter.mp hi).2 + have hdata (n : ℕ) (hn : n ∈ N) : + k.1 ∈ F ∧ |((actualCharacterZeros k.1).zeros n).im| ≤ T ∧ + σ ≤ ((actualCharacterZeros k.1).zeros n).re ∧ + ⌊((actualCharacterZeros k.1).zeros n).im⌋ = k.2 := by + obtain ⟨⟨χ, m⟩, hm, rfl⟩ := Finset.mem_image.mp hn + have hc := hchar ⟨χ, m⟩ hm + dsimp at hc + subst χ + have hd := (densityZeroIndices_mem F σ T ⟨k.1, m⟩).mp (Finset.mem_filter.mp hm).1 + have hb := (Finset.mem_filter.mp hm).2 + have hb' : ⌊((actualCharacterZeros k.1).zeros m).im⌋ = k.2 := + congrArg (fun x : DensityZeroBin => x.2) hb + exact ⟨hd.1, hd.2.1, hd.2.2, hb'⟩ + have hinj : Set.InjOn (fun i : DensityZeroIndex => i.2) S := by + intro i hi j hj he + exact Sigma.ext ((hchar i hi).trans (hchar j hj).symm) (heq_of_eq he) + have hcard : N.card = S.card := Finset.card_image_of_injOn hinj + by_cases hn : N.Nonempty + · obtain ⟨n, hn⟩ := hn + have hd := hdata n hn + have hc := characterOrdinateBins_center_bound T k.2 (by + rw [← hd.2.2.2] + exact characterOrdinateBins_mem T _ hd.2.1) + have hb := density_local_index_log_bound Q hQ T hT k.1 (hF k.1 hd.1) N k.2 + (fun n hn => hσ.trans (hdata n hn).2.2.1) + (fun n hn => (hdata n hn).2.2.2) hc + rwa [hcard] at hb + · have hzero : N.card = 0 := Finset.card_eq_zero.mpr (Finset.not_nonempty_iff_eq_empty.mp hn) + change (S.card : ℝ) ≤ _ + rw [← hcard, hzero, Nat.cast_zero] + have hq : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + apply mul_nonneg (by positivity) + exact Real.log_nonneg (by nlinarith) + + theorem densityZeroIndices_bin_bound (Q : ℕ) (hQ : 1 ≤ Q) (T σ : ℝ) + (hT : 2 ≤ T) (hσ : 1 / 2 ≤ σ) (F : Finset PrimitiveComplexCharacter) + (hF : ∀ χ ∈ F, χ.modulus ≤ Q) : + ((densityZeroIndices F σ T).card : ℝ) ≤ + ((densityZeroIndices F σ T).image densityZeroBin).card * + ((8 / Real.log (14 / 13)) * Real.log ((Q : ℝ) * T)) := by + rw [Finset.card_eq_sum_card_image densityZeroBin (densityZeroIndices F σ T), Nat.cast_sum] + calc + _ ≤ ∑ k ∈ (densityZeroIndices F σ T).image densityZeroBin, + ((8 / Real.log (14 / 13)) * Real.log ((Q : ℝ) * T)) := by + exact Finset.sum_le_sum fun k _ => densityZeroBin_fiber_bound Q hQ T σ hT hσ F hF k + _ = _ := by simp + + theorem density_ordinate_bin_separation (x y : ℝ) + (hm : ⌊x⌋ % 10 = ⌊y⌋ % 10) (hne : ⌊x⌋ ≠ ⌊y⌋) : + 1 ≤ |x / (2 * Real.pi) - y / (2 * Real.pi)| := by + have hgap : ⌊x⌋ + 10 ≤ ⌊y⌋ ∨ ⌊y⌋ + 10 ≤ ⌊x⌋ := by omega + have hphys : 9 ≤ |x - y| := by + rcases hgap with h | h + · have hc : (⌊x⌋ : ℝ) + 10 ≤ ⌊y⌋ := by exact_mod_cast h + have hh : 9 ≤ y - x := by linarith [Int.floor_le y, Int.lt_floor_add_one x] + rw [abs_sub_comm] + exact hh.trans (le_abs_self _) + · have hc : (⌊y⌋ : ℝ) + 10 ≤ ⌊x⌋ := by exact_mod_cast h + exact (show 9 ≤ x - y by linarith [Int.floor_le x, Int.lt_floor_add_one y]).trans (le_abs_self _) + rw [← sub_div, abs_div, abs_of_pos (by positivity : 0 < 2 * Real.pi)] + apply (le_div_iff₀ (by positivity : 0 < 2 * Real.pi)).mpr + nlinarith [Real.pi_lt_four] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DetectorLength.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DetectorLength.lean new file mode 100644 index 0000000000000000000000000000000000000000..1fe1ca0dceaedea71fc0f8b6f4db4138a55ec800 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DetectorLength.lean @@ -0,0 +1,53 @@ +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteDetector + +namespace OAI + +noncomputable section +namespace Ostmann.ZeroDensity + +def detectorLength (Q H X : ℕ) : ℕ := (16 * Q * H * X) ^ 2 + +theorem detectorLength_ge {Q H X : ℕ} (hQ : 1 ≤ Q) (hH : 1 ≤ H) (hX : 1 ≤ X) : + X ≤ detectorLength Q H X := by + have hbase : 1 ≤ 16 * Q * H := by + have : 0 < 16 * Q * H := by positivity + omega + have hXB : X ≤ 16 * Q * H * X := by + simpa using Nat.mul_le_mul_right X hbase + unfold detectorLength + nlinarith + +theorem detectorLength_rpow_le {Q H X : ℕ} (hQ : 1 ≤ Q) (hH : 1 ≤ H) (hX : 1 ≤ X) + {β : ℝ} (hβ : 1 / 2 ≤ β) : + (detectorLength Q H X : ℝ) ^ (-β) ≤ + (16 * (Q : ℝ) * (H : ℝ) * (X : ℝ))⁻¹ := by + have hN : (1 : ℝ) ≤ detectorLength Q H X := by + exact_mod_cast hX.trans (detectorLength_ge hQ hH hX) + calc + (detectorLength Q H X : ℝ) ^ (-β) ≤ + (detectorLength Q H X : ℝ) ^ (-((1 : ℝ) / 2)) := + Real.rpow_le_rpow_of_exponent_le hN (by linarith) + _ = (Real.sqrt (detectorLength Q H X : ℝ))⁻¹ := by + rw [Real.rpow_neg (by positivity : (0 : ℝ) ≤ detectorLength Q H X), + Real.sqrt_eq_rpow] + _ = (16 * (Q : ℝ) * (H : ℝ) * (X : ℝ))⁻¹ := by + simp [detectorLength, Real.sqrt_sq_eq_abs, abs_of_nonneg] + +theorem detector_support_length_le {Q H : ℕ} (hQ : 1 ≤ Q) : + (Q ^ 2 * H) * detectorLength Q H (Q ^ 2 * H) ≤ 256 * (Q ^ 2 * H) ^ 5 := by + have hp : Q ^ 8 ≤ Q ^ 10 := Nat.pow_le_pow_right (by omega) (by decide) + calc + (Q ^ 2 * H) * detectorLength Q H (Q ^ 2 * H) = 256 * Q ^ 8 * H ^ 5 := by + unfold detectorLength + ring + _ ≤ 256 * Q ^ 10 * H ^ 5 := Nat.mul_le_mul_right _ (Nat.mul_le_mul_left _ hp) + _ = 256 * (Q ^ 2 * H) ^ 5 := by ring + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DigammaTailEstimate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DigammaTailEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..659e5e3320344833ef7f4d106340692edf622c37 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DigammaTailEstimate.lean @@ -0,0 +1,47 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.LogarithmicGammaBound + +namespace OAI + +/-! # A bounded tail in the sharp positive-strip digamma comparison -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +noncomputable def densityDigammaTerm (z : ℂ) (n : ℕ) : ℂ := + ((n : ℂ) + 1)⁻¹ - (z + n)⁻¹ + + theorem density_digamma_hasSum (z : ℂ) (hz : 0 < z.re) : + HasSum (densityDigammaTerm z) (Complex.digamma z + Real.eulerMascheroniConstant) := by + have h := Complex.hasSum_digamma_of_re_pos hz + apply h.congr + intro n + simp only [densityDigammaTerm] + + theorem density_digamma_tail_bound (z : ℂ) (hz : 1 / 8 ≤ z.re) (N : ℕ) (hN : 1 ≤ N) : + ‖∑' i : ℕ, densityDigammaTerm z (i + N)‖ ≤ + 8 * (‖z‖ + 1) / N := by + have hpos : 0 < z.re := by linarith + have hsum := (density_digamma_hasSum z hpos).summable + have hnorm := (summable_nat_add_iff N).mpr hsum.norm + have hmajor := (summable_nat_add_iff N).mpr Complex.summable_one_div_natCast_add_one_sq + have hp (i : ℕ) : ‖densityDigammaTerm z (i + N)‖ ≤ + 8 * (‖z‖ + 1) * (1 / (((i + N : ℕ) : ℝ) + 1) ^ 2) := by + have h := Complex.norm_inv_add_one_sub_inv_le (a := 1 / 8) (R := ‖z‖) + (by norm_num) (by norm_num) hz le_rfl (i + N) + change ‖densityDigammaTerm z (i + N)‖ ≤ _ at h + convert h using 1 + field_simp + calc + _ ≤ ∑' i : ℕ, ‖densityDigammaTerm z (i + N)‖ := norm_tsum_le_tsum_norm hnorm + _ ≤ ∑' i : ℕ, 8 * (‖z‖ + 1) * (1 / (((i + N : ℕ) : ℝ) + 1) ^ 2) := + hnorm.tsum_le_tsum hp (hmajor.mul_left _) + _ = 8 * (‖z‖ + 1) * ∑' i : ℕ, 1 / (((i + N : ℕ) : ℝ) + 1) ^ 2 := tsum_mul_left + _ ≤ 8 * (‖z‖ + 1) * (N : ℝ)⁻¹ := + mul_le_mul_of_nonneg_left (Complex.tsum_one_div_natCast_add_add_one_sq_le hN) (by positivity) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DirichletGraphFactor.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DirichletGraphFactor.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b029c9e78f33b739de8533c5db0c84409757e94 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DirichletGraphFactor.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.OneSidedGraphFactor + +namespace OAI + +/-! # The genuine character attached to a surviving directed edge -/ + +namespace Ostmann + +open scoped BigOperators + +/-- Nonzero powers commute with evaluation also at nonunits. This permits +the same bounded extension convention after large coprimalities are removed. -/ +theorem dirichlet_zpow_apply_nonzero {p : ℕ} (χ : DirichletCharacter ℂ p) + (e : ℤ) (he : e ≠ 0) (x : ZMod p) : (χ ^ e) x = χ x ^ e := by + cases e with + | ofNat n => + have hn : n ≠ 0 := by intro hn; subst n; exact he rfl + change (χ ^ (n : ℤ)) x = χ x ^ (n : ℤ) + simp only [zpow_natCast] + exact χ.pow_apply' hn x + | negSucc n => + simp only [zpow_negSucc, MulChar.inv_apply_eq_inv', + χ.pow_apply' (Nat.succ_ne_zero n)] + +noncomputable def dirichletGraphEdge {I : Type*} + (χ : I → ∀ p : ℕ, DirichletCharacter ℂ p) (b : I → I → ℤ) + (i j : I) (x y : ℕ) : ℂ := χ i x (y : ZMod x) ^ b i j + +theorem dirichletGraphEdge_norm {I : Type*} + (χ : I → ∀ p : ℕ, DirichletCharacter ℂ p) (b : I → I → ℤ) + (i j : I) (x y : ℕ) : ‖dirichletGraphEdge χ b i j x y‖ ≤ 1 := + character_zpow_norm_le_one (χ i x) _ _ + +/-- A zero reverse edge leaves exactly one short-modulus character of the +long prime. All other factors depend on at most one of the two variables. -/ +theorem dirichlet_one_sided_graph_factorization {J : Type*} [Fintype J] + (χ : (Bool ⊕ J) → ∀ p : ℕ, DirichletCharacter ℂ p) + (b : (Bool ⊕ J) → (Bool ⊕ J) → ℤ) + (ν : (Bool ⊕ J) → ℕ → ℂ) (fixed : J → ℕ) + (hν : ∀ i x, ‖ν i x‖ ≤ 1) + (hself : b (.inl true) (.inl true) = 0 ∧ b (.inl false) (.inl false) = 0) + (hreverse : b (.inl false) (.inl true) = 0) + (hforward : b (.inl true) (.inl false) ≠ 0) : + ∃ U V : ℕ → ℂ, (∀ p, ‖U p‖ ≤ 1) ∧ (∀ q, ‖V q‖ ≤ 1) ∧ + ∀ q p, finiteEdgeWeight (dirichletGraphEdge χ b) ν (twoVertexLabels fixed q p) = + U p * V q * (χ (.inl true) q ^ b (.inl true) (.inl false)) (p : ZMod q) := by + refine ⟨longGraphFactor (dirichletGraphEdge χ b) ν fixed, + shortGraphFactor (dirichletGraphEdge χ b) ν fixed, + longGraphFactor_norm _ ν fixed (dirichletGraphEdge_norm χ b) hν, + shortGraphFactor_norm _ ν fixed (dirichletGraphEdge_norm χ b) hν, ?_⟩ + intro q p + rw [one_sided_graph_factorization _ ν fixed q p + (by simp only [dirichletGraphEdge, hself.1, hself.2, zpow_zero, and_self]) + (by simp only [dirichletGraphEdge, hreverse, zpow_zero])] + rw [dirichlet_zpow_apply_nonzero _ _ hforward] + rfl + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DirichletLogDerivativeBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DirichletLogDerivativeBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed7d74a12f1131248108f79b038056930a5597de --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DirichletLogDerivativeBound.lean @@ -0,0 +1,100 @@ +import Mathlib.NumberTheory.LSeries.PrimesInAP +import Mathlib.Analysis.Normed.Group.Bounded + +namespace OAI + +/-! # A uniform Euler-series bound for real arguments + +This part uses proved Mathlib theorems only: the continued zeta pole, the +Euler logarithmic derivative, and the norm bound for Dirichlet characters. +-/ + +namespace Ostmann + +open scoped BigOperators ComplexOrder +open Complex LSeries + +theorem residue_one_eq_vonMangoldt : + ArithmeticFunction.vonMangoldt.residueClass (0 : ZMod 1) = ArithmeticFunction.vonMangoldt := by + funext n + simp [ArithmeticFunction.vonMangoldt.residueClass, Subsingleton.elim (n : ZMod 1) 0] + +theorem exists_vonMangoldt_series_bound : + ∃ C : ℝ, 0 < C ∧ ∀ s : ℝ, 1 < s → s ≤ 2 → + ‖LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ)‖ ≤ 1 / (s - 1) + C := by + let F := ArithmeticFunction.vonMangoldt.LFunctionResidueClassAux (0 : ZMod 1) + have hcont : ContinuousOn (fun s : ℝ => F (s : ℂ)) (Set.Icc 1 2) := by + apply ArithmeticFunction.vonMangoldt.continuousOn_LFunctionResidueClassAux (0 : ZMod 1) |>.comp + Complex.continuous_ofReal.continuousOn + intro s hs + exact hs.1 + obtain ⟨M, hM⟩ := isCompact_Icc.exists_bound_of_continuousOn hcont + refine ⟨|M| + 1, by positivity, ?_⟩ + intro s hs hs2 + have hunit : IsUnit (0 : ZMod 1) := by + rw [Subsingleton.elim (0 : ZMod 1) 1] + exact isUnit_one + have heq := ArithmeticFunction.vonMangoldt.eqOn_LFunctionResidueClassAux hunit + (show (s : ℂ) ∈ {z : ℂ | 1 < z.re} by exact hs) + rw [residue_one_eq_vonMangoldt] at heq + simp only [Nat.totient_one, Nat.cast_one, inv_one] at heq + have he : LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ) = + F (s : ℂ) + 1 / ((s : ℂ) - 1) := by + change F (s : ℂ) = _ at heq + rw [heq] + ring + have hnorm : ‖1 / ((s : ℂ) - 1)‖ = 1 / (s - 1) := by + rw [← Complex.ofReal_one, ← Complex.ofReal_sub, ← Complex.ofReal_div, + Complex.norm_real, Real.norm_eq_abs, abs_of_pos (by positivity)] + rw [he] + have hb := norm_add_le (F (s : ℂ)) (1 / ((s : ℂ) - 1)) + rw [hnorm] at hb + have hg := hM s ⟨hs.le, hs2⟩ + have hMabs := le_abs_self M + linarith + +theorem dirichlet_logDerivative_le_vonMangoldt {q : ℕ} [NeZero q] + (χ : DirichletCharacter ℂ q) (s : ℝ) (hs : 1 < s) : + ‖deriv (DirichletCharacter.LFunction χ) (s : ℂ) / + DirichletCharacter.LFunction χ (s : ℂ)‖ ≤ + ‖LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ)‖ := by + let a : ℕ → ℂ := fun n => (ArithmeticFunction.vonMangoldt n : ℂ) + have hs' : 1 < (s : ℂ).re := hs + have ha : LSeriesSummable a (s : ℂ) := ArithmeticFunction.LSeriesSummable_vonMangoldt hs' + have ht := χ.LSeriesSummable_twist_vonMangoldt hs' + have he := χ.LSeries_twist_vonMangoldt_eq hs' + rw [← χ.deriv_LFunction_eq_deriv_LSeries hs', ← χ.LFunction_eq_LSeries hs'] at he + have hn (n : ℕ) : ‖LSeries.term (fun n => χ n * a n) (s : ℂ) n‖ ≤ + ‖LSeries.term a (s : ℂ) n‖ := by + apply LSeries.norm_term_le + rw [norm_mul] + exact mul_le_of_le_one_left (norm_nonneg _) (χ.norm_le_one _) + have hr (n : ℕ) : ‖LSeries.term a (s : ℂ) n‖ = (LSeries.term a (s : ℂ) n).re := by + have hp : (0 : ℂ) ≤ a n := by + change (0 : ℂ) ≤ (ArithmeticFunction.vonMangoldt n : ℂ) + exact_mod_cast ArithmeticFunction.vonMangoldt_nonneg (n := n) + have hh := congrArg Complex.re (Complex.eq_coe_norm_of_nonneg (LSeries.term_nonneg hp s)) + simpa only [Complex.ofReal_re] using hh.symm + calc + _ = ‖LSeries (fun n => χ n * a n) (s : ℂ)‖ := by + change LSeries (fun n => χ n * a n) (s : ℂ) = _ at he + rw [he] + simp only [neg_div, norm_neg] + _ ≤ ∑' n, ‖LSeries.term (fun n => χ n * a n) (s : ℂ) n‖ := norm_tsum_le_tsum_norm ht.norm + _ ≤ ∑' n, ‖LSeries.term a (s : ℂ) n‖ := ht.norm.tsum_le_tsum hn ha.norm + _ = (LSeries a (s : ℂ)).re := by simp_rw [hr]; exact (Complex.re_tsum ha).symm + _ ≤ ‖LSeries a (s : ℂ)‖ := Complex.re_le_norm _ + +theorem exists_dirichlet_logDerivative_bound : + ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q) + (s : ℝ), 1 < s → s ≤ 2 → + ‖deriv (DirichletCharacter.LFunction χ) (s : ℂ) / + DirichletCharacter.LFunction χ (s : ℂ)‖ ≤ 1 / (s - 1) + C := by + obtain ⟨C, hC, hbound⟩ := exists_vonMangoldt_series_bound + refine ⟨C, hC, ?_⟩ + intro q hq χ s hs hs2 + exact (dirichlet_logDerivative_le_vonMangoldt χ s hs).trans (hbound s hs hs2) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DyadicDetector.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DyadicDetector.lean new file mode 100644 index 0000000000000000000000000000000000000000..8511fea51ce4c9530dc398f1c2069bed2d7dc42f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/DyadicDetector.lean @@ -0,0 +1,103 @@ +import Mathlib.Algebra.Order.BigOperators.Group.LocallyFinite +import Mathlib.Algebra.Order.Chebyshev +import Mathlib.Analysis.SpecialFunctions.Log.Base +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteDetector + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Ostmann.ZeroDensity + +theorem sum_dyadic_intervals {E : Type*} [AddCommMonoid E] (f : ℕ → E) (X J : ℕ) : + (∑ j ∈ Finset.range J, ∑ n ∈ Finset.Ioc (2 ^ j * X) (2 ^ (j + 1) * X), f n) = + ∑ n ∈ Finset.Ioc X (2 ^ J * X), f n := by + induction J with + | zero => simp + | succ J ih => + rw [Finset.sum_range_succ, ih] + apply Finset.sum_Ioc_consecutive f + · have hpow : 1 ≤ 2 ^ J := by + have : 0 < (2 : ℕ) ^ J := by positivity + omega + simpa using Nat.mul_le_mul_right X hpow + · exact Nat.mul_le_mul_right X (Nat.pow_le_pow_right (by decide) (by omega)) + +def detectorBlock {q : ℕ} (χ : DirichletCharacter ℂ q) (X N j : ℕ) (s : ℂ) : ℂ := + ∑ n ∈ Finset.Ioc (2 ^ j * X) (2 ^ (j + 1) * X), + mollifierCoefficient X N n * χ n * (n : ℂ) ^ (-s) + +theorem detector_eq_sum_blocks {q : ℕ} (χ : DirichletCharacter ℂ q) + (X N J : ℕ) (hN : N ≤ 2 ^ J) (s : ℂ) : + detectorPolynomial χ X N s = ∑ j ∈ Finset.range J, detectorBlock χ X N j s := by + unfold detectorPolynomial detectorBlock + rw [sum_dyadic_intervals] + apply Finset.sum_subset + · intro n hn + apply Finset.mem_Ioc.mpr + refine ⟨(Finset.mem_Ioc.mp hn).1, (Finset.mem_Ioc.mp hn).2.trans ?_⟩ + simpa [mul_comm] using Nat.mul_le_mul_left X hN + · intro n hn hnot + have hnX : X < n := (Finset.mem_Ioc.mp hn).1 + have hsupport : X * N < n := by + simp only [Finset.mem_Ioc] at hnot + omega + simp [mollifierCoefficient_support hsupport] + +theorem norm_sum_sq_le_card_mul {ι : Type*} (s : Finset ι) (f : ι → ℂ) : + ‖∑ i ∈ s, f i‖ ^ 2 ≤ (s.card : ℝ) * ∑ i ∈ s, ‖f i‖ ^ 2 := by + calc + ‖∑ i ∈ s, f i‖ ^ 2 ≤ (∑ i ∈ s, ‖f i‖) ^ 2 := by + have h := norm_sum_le s f + have hnonneg : 0 ≤ ∑ i ∈ s, ‖f i‖ := Finset.sum_nonneg fun _ _ => norm_nonneg _ + nlinarith [norm_nonneg (∑ i ∈ s, f i)] + _ ≤ _ := sq_sum_le_card_mul_sum_sq + +theorem detector_norm_sq_le_blocks {q : ℕ} (χ : DirichletCharacter ℂ q) + (X N J : ℕ) (hN : N ≤ 2 ^ J) (s : ℂ) : + ‖detectorPolynomial χ X N s‖ ^ 2 ≤ + (J : ℝ) * ∑ j ∈ Finset.range J, ‖detectorBlock χ X N j s‖ ^ 2 := by + rw [detector_eq_sum_blocks χ X N J hN s] + simpa using norm_sum_sq_le_card_mul (Finset.range J) (fun j => detectorBlock χ X N j s) + +theorem detected_family_card_le {ι : Type*} (samples : Finset ι) (J : ℕ) + (block : ι → ℕ → ℂ) + (hdetector : ∀ i ∈ samples, 1 / 2 ≤ ‖∑ j ∈ Finset.range J, block i j‖) : + (samples.card : ℝ) ≤ + 4 * J * ∑ j ∈ Finset.range J, ∑ i ∈ samples, ‖block i j‖ ^ 2 := by + have hpoint : ∀ i ∈ samples, + (1 : ℝ) ≤ 4 * J * ∑ j ∈ Finset.range J, ‖block i j‖ ^ 2 := by + intro i hi + have hlo := hdetector i hi + have hhi := norm_sum_sq_le_card_mul (Finset.range J) (block i) + simp only [Finset.card_range] at hhi + nlinarith [norm_nonneg (∑ j ∈ Finset.range J, block i j)] + calc + (samples.card : ℝ) = ∑ _i ∈ samples, (1 : ℝ) := by simp + _ ≤ ∑ i ∈ samples, 4 * J * ∑ j ∈ Finset.range J, ‖block i j‖ ^ 2 := + Finset.sum_le_sum hpoint + _ = 4 * J * ∑ j ∈ Finset.range J, ∑ i ∈ samples, ‖block i j‖ ^ 2 := by + rw [← Finset.mul_sum, Finset.sum_comm] + +def detectorBlockCount (N : ℕ) : ℕ := Nat.log 2 N + 1 + +theorem detectorBlockCount_covers (N : ℕ) : N ≤ 2 ^ detectorBlockCount N := + (Nat.lt_pow_succ_log_self (by decide : 1 < 2) N).le + +theorem detectorBlockCount_le_log (N : ℕ) : + (detectorBlockCount N : ℝ) ≤ Real.log N / Real.log 2 + 1 := by + simpa [detectorBlockCount, Real.logb] using add_le_add_right (Real.natLog_le_logb N 2) 1 + +theorem detectorBlockCount_pow_le {N : ℕ} (hN : 1 ≤ N) : + 2 ^ detectorBlockCount N ≤ 2 * N := by + unfold detectorBlockCount + rw [pow_succ] + have h := Nat.mul_le_mul_right 2 (Nat.pow_log_le_self 2 (by omega : N ≠ 0)) + simpa [mul_comm] using h + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/EventualDensityPrimeBlock.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/EventualDensityPrimeBlock.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd1eda3ccae1ea5f433cf733f3c3f9fdfe3e348f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/EventualDensityPrimeBlock.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityPrimeBlock + +namespace OAI + +/-! # The actual small-prime block at the manuscript's scale -/ + +namespace Ostmann + +open Filter +open scoped BigOperators Classical + +theorem exists_eventual_density_prime_block (hsize : PublishedSummandSizeBound) + {A B : Set ℕ} (hA : A.Infinite) (hB : B.Infinite) (h : EventuallyPrimeSumset A B) + (C : ℝ) (hM : MertensEstimate C) : + ∃ N : ℕ, ∃ L₀ : ℝ, ∀ᶠ T : ℝ in atTop, ∀ L : ℝ, + L₀ ≤ L → T ^ (3 / 2 : ℝ) ≤ L → L ≤ 2 * T ^ 2 → + ∀ hi : ℕ, (hi : ℝ) = Real.exp L → + N + tailCollisionCutoff L ≤ summandTailCutoff L ∧ + ∃ (z : ℕ) (P : Finset ℕ), 2 ≤ z ∧ P.Nonempty ∧ + P ⊆ logPrimeBand (T ^ (1 / 10000000 : ℝ)) ∧ + (∀ p ∈ P, z ≤ p ∧ p < 2 * z) ∧ + (z : ℝ) ≤ (8 + 8 / Real.log 2) * Real.log z * P.card ∧ + (∀ p ∈ P, (p : ℝ) / 3 ≤ (tailSupport A N p).card ∧ + ((tailSupport A N p).card : ℝ) ≤ 2 * p / 3) := by + obtain ⟨N, hN⟩ := h.disjoint_tail_residues + obtain ⟨a, ha, hlarge⟩ := exists_large_summand_tails hsize hA hB h + obtain ⟨L₁, hL₁⟩ := eventually_atTop.mp hlarge + obtain ⟨L₂, hL₂⟩ := eventually_atTop.mp (eventual_tailCollisionCutoff N) + refine ⟨N, max L₁ L₂, ?_⟩ + have hγ : (0 : ℝ) < 1 / 10000000 := by norm_num + filter_upwards [eventual_tailDefectBudget_negligible a C 1 (1 / 4) (1 / 10000000) + (by norm_num) (by norm_num) hγ, + (tendsto_rpow_atTop hγ).eventually_ge_atTop (max 1 (4 * (Real.log 2 + 2 * C))), + eventually_ge_atTop (4096 : ℝ)] with T hloss hU hT + intro L hL hTL hLU hi hhi + have hcut := hL₂ L ((le_max_right _ _).trans hL) + refine ⟨hcut.2.2, ?_⟩ + let U := T ^ (1 / 10000000 : ℝ) + have hU1 : 1 ≤ U := (le_max_left _ _).trans hU + have hUC : 4 * (Real.log 2 + 2 * C) ≤ U := (le_max_right _ _).trans hU + have hUT : U ≤ T := by + have hh := Real.rpow_le_rpow_of_exponent_le (by linarith : 1 ≤ T) + (show (1 / 10000000 : ℝ) ≤ 1 by norm_num) + simpa only [Real.rpow_one] using hh + have hband := logPrimeBand_subset_tailCollisionCutoff T L U hT hTL hLU hUT + obtain ⟨hsa, hsb, _, _, _⟩ := hL₁ L ((le_max_left _ _).trans hL) hi hhi + have hsa' : a * Real.exp (L / 2) / L ^ 3 ≤ (summandTail A (summandTailCutoff L) hi).card := by + simpa only [positiveSummandTail_card] using hsa + have hsb' : a * Real.exp (L / 2) / L ^ 3 ≤ (summandTail B (summandTailCutoff L) hi).card := by + simpa only [negativeSummandTail_card] using hsb + have hfull := uniform_tail_collision_bound hA hB N (summandTailCutoff L) hi a L C + ha hcut.1 hcut.2.1 hhi hcut.2.2 + (fun p hp => hN p (Nat.prime_of_mem_primesLE hp)) hsa' hsb' hM.lower + apply exists_density_prime_block hA hB N (summandTailCutoff L) hi U C (tailDefectBudget a C L) + hU1 hUC hM (fun p hp => hN p (logPrimeBand_mem hp).1) + · apply le_trans _ hfull + apply Finset.sum_le_sum_of_subset_of_nonneg hband + intro p hp _ + apply mul_nonneg (Real.log_natCast_nonneg p) + apply collisionDefect_nonneg + · exact tailSupport_nonempty hA N p (Nat.prime_of_mem_primesLE hp).pos + · exact tailSupport_complement_nonempty hB (Nat.prime_of_mem_primesLE hp).pos + (hN p (Nat.prime_of_mem_primesLE hp)) + · exact (tailSupport_card_add_complement A N p).le + · have hh := hloss L hcut.1 hLU + simpa only [one_pow, div_one, one_div_mul_eq_div] using hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ExceptionalPrimeDeletion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ExceptionalPrimeDeletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..d00da6a97c0fa89207878bf1d98a921d58a8d389 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ExceptionalPrimeDeletion.lean @@ -0,0 +1,94 @@ +import OAI.NumberTheory.Ostmann.Characters.PrimitiveCharacterReduction +import OAI.NumberTheory.Ostmann.Characters.SparseBandMass + +namespace OAI + +/-! # Removing at most one prime excludes the exceptional conductor -/ +namespace Ostmann +open scoped Classical BigOperators + +theorem PrimitiveComplexCharacter.modulus_one_lt (χ : PrimitiveComplexCharacter) : + 1 < χ.modulus := by + have : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have hc : χ.character.conductor ≠ 1 := by + intro h + exact χ.nontrivial (DirichletCharacter.eq_one_iff_conductor_eq_one.mpr h) + have hh := χ.primitive + change χ.character.conductor = χ.modulus at hh + have hp := χ.positive + omega + +theorem prime_mem_of_dvd_prime_product (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) + (q : ℕ) (hq : q.Prime) (hd : q ∣ ∏ p ∈ P, p) : q ∈ P := by + induction P using Finset.induction_on with + | empty => + simp only [Finset.prod_empty] at hd + exact (hq.ne_one (Nat.dvd_one.mp hd)).elim + | @insert p P hp ih => + rw [Finset.prod_insert hp] at hd + rcases hq.dvd_mul.mp hd with hd | hd + · have he : q = p := ((Nat.dvd_prime (hP p (Finset.mem_insert_self _ _))).mp hd).resolve_left hq.ne_one + simp [he] + · exact Finset.mem_insert_of_mem (ih (fun r hr => hP r (Finset.mem_insert_of_mem hr)) hd) + +theorem exists_prime_deletion_avoiding (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) + (d : ℕ) (hd : 1 < d) : + ∃ Q : Finset ℕ, Q ⊆ P ∧ P.card ≤ Q.card + 1 ∧ ¬ d ∣ ∏ p ∈ Q, p := by + by_cases hdiv : d ∣ ∏ p ∈ P, p + · obtain ⟨q, hq, hqd⟩ := Nat.exists_prime_and_dvd (show d ≠ 1 by omega) + have hqP := prime_mem_of_dvd_prime_product P hP q hq (hqd.trans hdiv) + refine ⟨P.erase q, Finset.erase_subset _ _, ?_, ?_⟩ + · have hh := Finset.card_erase_add_one hqP + omega + · intro hh + have hmem := prime_mem_of_dvd_prime_product (P.erase q) + (fun p hp => hP p (Finset.mem_erase.mp hp).2) q hq (hqd.trans hh) + exact (Finset.mem_erase.mp hmem).1 rfl + · exact ⟨P, Finset.Subset.refl _, by omega, hdiv⟩ + +theorem exists_exceptional_prime_deletion (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) + (exception : Option PrimitiveComplexCharacter) : + ∃ Q : Finset ℕ, Q ⊆ P ∧ P.card ≤ Q.card + 1 ∧ + ∀ ρ, exception = some ρ → ¬ ρ.modulus ∣ ∏ p ∈ Q, p := by + cases exception with + | none => exact ⟨P, Finset.Subset.refl _, by omega, by intro ρ h; contradiction⟩ + | some ρ => + obtain ⟨Q, hQP, hcard, hd⟩ := exists_prime_deletion_avoiding P hP ρ.modulus ρ.modulus_one_lt + exact ⟨Q, hQP, hcard, by intro σ h; cases Option.some.inj h; exact hd⟩ + +theorem prime_deletion_harmonic_loss (P Q : Finset ℕ) + (hP : ∀ p ∈ P, p.Prime) (hQP : Q ⊆ P) (hcard : P.card ≤ Q.card + 1) : + (∑ p ∈ P, (p : ℝ)⁻¹) ≤ (∑ p ∈ Q, (p : ℝ)⁻¹) + 1 / 2 := by + have hc : (P \ Q).card ≤ 1 := by + have hh := Finset.card_sdiff_of_subset hQP + have hle := Finset.card_le_card hQP + omega + have hs : (∑ p ∈ P \ Q, (p : ℝ)⁻¹) ≤ 1 / 2 := by + calc + _ ≤ ∑ _p ∈ P \ Q, (1 / 2 : ℝ) := by + apply Finset.sum_le_sum + intro p hp + have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast (hP p (Finset.mem_sdiff.mp hp).1).two_le + simpa only [one_div] using one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 2) hp2 + _ ≤ 1 / 2 := by + simp only [Finset.sum_const, nsmul_eq_mul] + have hc' : ((P \ Q).card : ℝ) ≤ 1 := by exact_mod_cast hc + linarith + have hsum : (∑ p ∈ P \ Q, (p : ℝ)⁻¹) + (∑ p ∈ Q, (p : ℝ)⁻¹) = + (∑ p ∈ P, (p : ℝ)⁻¹) := Finset.sum_sdiff hQP + linarith + +theorem exists_exceptional_prime_deletion_mass (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) + (exception : Option PrimitiveComplexCharacter) (L : ℝ) (hL : 50 ≤ L) + (hmass : (69 / 100 : ℝ) * L ≤ ∑ p ∈ P, (p : ℝ)⁻¹) : + ∃ Q : Finset ℕ, Q ⊆ P ∧ + (17 / 25 : ℝ) * L ≤ (∑ p ∈ Q, (p : ℝ)⁻¹) ∧ + ∀ ρ, exception = some ρ → ¬ ρ.modulus ∣ ∏ p ∈ Q, p := by + obtain ⟨Q, hQP, hcard, havoid⟩ := exists_exceptional_prime_deletion P hP exception + refine ⟨Q, hQP, ?_, havoid⟩ + have hh := prime_deletion_harmonic_loss P Q hP hQP hcard + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteAnalyticZeroFactors.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteAnalyticZeroFactors.lean new file mode 100644 index 0000000000000000000000000000000000000000..25dc6f0b803d421fc4a3e86e6002010b1de45f8d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteAnalyticZeroFactors.lean @@ -0,0 +1,84 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroPolynomial + +namespace OAI + +/-! # Finite zero-factor removal for the completed-character application -/ + +namespace Ostmann + +open Filter Set +open scoped Topology BigOperators Classical + +noncomputable def finiteZeroPolynomial (f : ℂ → ℂ) + (S : Finset ℂ) (s : ℂ) : ℂ := + ∏ z ∈ S, (s - z) ^ analyticOrderNatAt f z + +theorem finiteZeroPolynomial_analytic (f : ℂ → ℂ) + (S : Finset ℂ) (s : ℂ) : AnalyticAt ℂ (finiteZeroPolynomial f S) s := by + exact S.analyticAt_fun_prod fun z _ => (analyticAt_id.sub analyticAt_const).pow _ + +theorem finiteZeroPolynomial_ne_zero (f : ℂ → ℂ) + (S : Finset ℂ) (s : ℂ) (hs : s ∉ S) : finiteZeroPolynomial f S s ≠ 0 := by + apply Finset.prod_ne_zero_iff.mpr + intro z hz + exact pow_ne_zero _ (sub_ne_zero.mpr (fun he => hs (he ▸ hz))) + +theorem finiteZeroPolynomial_insert (f : ℂ → ℂ) + (S : Finset ℂ) (z s : ℂ) (hz : z ∈ S) : + finiteZeroPolynomial f S s = + (s - z) ^ analyticOrderNatAt f z * finiteZeroPolynomial f (S.erase z) s := by + exact (Finset.mul_prod_erase S _ hz).symm + +/-- The quotient by any finite collection of complete zero factors extends +analytically to the whole plane. It is nonzero at each removed zero. -/ +theorem remove_finite_analytic_zeros (f : ℂ → ℂ) + (hf : ∀ z, AnalyticAt ℂ f z) (horder : ∀ z, analyticOrderAt f z ≠ ⊤) (S : Finset ℂ) : + ∃ g : ℂ → ℂ, (∀ s, AnalyticAt ℂ g s) ∧ + (∀ s, f s = finiteZeroPolynomial f S s * g s) ∧ + (∀ s ∈ S, g s ≠ 0) := by + choose R hR hRne heR using fun z => + (hf z).analyticOrderAt_ne_top.mp (horder z) + let g : ℂ → ℂ := fun z => if z ∈ S then + R z z / finiteZeroPolynomial f (S.erase z) z + else f z / finiteZeroPolynomial f S z + have hlocal (z : ℂ) (hz : z ∈ S) : + g =ᶠ[𝓝 z] fun s => R z s / finiteZeroPolynomial f (S.erase z) s := by + have hav : ∀ᶠ s in 𝓝 z, s ∉ S.erase z := + (S.erase z).finite_toSet.isClosed.isOpen_compl.mem_nhds (by simp) + filter_upwards [hav, heR z] with s hs he + by_cases hsz : s = z + · subst s + simp only [g, ite_eq_left hz] + · have hsS : s ∉ S := fun h => hs (Finset.mem_erase.mpr ⟨hsz, h⟩) + simp only [g, ite_eq_right hsS] + rw [finiteZeroPolynomial_insert f S z s hz, he] + simp only [smul_eq_mul] + exact mul_div_mul_left _ _ (pow_ne_zero _ (sub_ne_zero.mpr hsz)) + have ha : ∀ s, AnalyticAt ℂ g s := by + intro s + by_cases hs : s ∈ S + · exact ((hR s).div (finiteZeroPolynomial_analytic f (S.erase s) s) + (finiteZeroPolynomial_ne_zero f (S.erase s) s (by simp))).congr + (hlocal s hs).symm + · apply ((hf s).div (finiteZeroPolynomial_analytic f S s) + (finiteZeroPolynomial_ne_zero f S s hs)).congr + have hav : ∀ᶠ z in 𝓝 s, z ∉ S := S.finite_toSet.isClosed.isOpen_compl.mem_nhds hs + filter_upwards [hav] with z hz + simp only [g, ite_eq_right hz, Pi.div_apply] + refine ⟨g, ha, ?_, ?_⟩ + · intro s + by_cases hs : s ∈ S + · rw [(hlocal s hs).self_of_nhds, finiteZeroPolynomial_insert f S s s hs] + have he := (heR s).self_of_nhds + simp only [smul_eq_mul] at he + rw [he] + field_simp [finiteZeroPolynomial_ne_zero f (S.erase s) s (by simp)] + · simp only [g, ite_eq_right hs] + exact (mul_div_cancel₀ _ (finiteZeroPolynomial_ne_zero f S s hs)).symm + · intro s hs + simp only [g, ite_eq_left hs] + exact div_ne_zero (hRne s) (finiteZeroPolynomial_ne_zero f (S.erase s) s (by simp)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5de950a57e41fc98a5fc25da6fa251030bb4e91 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteDecay.lean @@ -0,0 +1,119 @@ +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Data.Rat.Floor +import Mathlib.Tactic.GCongr +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +open scoped BigOperators + +namespace Ostmann.ZeroDensity + +theorem extend_density_bound {ι : Type*} (s : Finset ι) (gap : ι → ℝ) + {A B u b : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hub : u ≤ b) + (htop : ∀ i ∈ s, gap i ≤ b) + (hdensity : ∀ t ∈ Set.Icc u b, + ((s.filter (fun i => gap i ≤ t)).card : ℝ) ≤ B * Real.exp (A * t)) : + ∀ t, u ≤ t → + ((s.filter (fun i => gap i ≤ t)).card : ℝ) ≤ B * Real.exp (A * t) := by + classical + intro t hut + by_cases htb : t ≤ b + · exact hdensity t ⟨hut, htb⟩ + · have hbt : b ≤ t := le_of_not_ge htb + have hb := hdensity b ⟨hub, le_rfl⟩ + have hfilter : s.filter (fun i => gap i ≤ b) = s := by + exact Finset.filter_true_of_mem htop + rw [hfilter] at hb + calc + ((s.filter (fun i => gap i ≤ t)).card : ℝ) ≤ (s.card : ℝ) := by + exact_mod_cast Finset.card_filter_le s (fun i => gap i ≤ t) + _ ≤ B * Real.exp (A * b) := hb + _ ≤ B * Real.exp (A * t) := by gcongr + +theorem finite_density_exp_sum_le {ι : Type*} (s : Finset ι) (gap : ι → ℝ) + {M A B u b : ℝ} (hM : 0 < M) (_hA : 0 ≤ A) (hB : 0 ≤ B) + (hMA : 2 * A ≤ M) (hgap : ∀ i ∈ s, u ≤ gap i) + (hzero : ∀ i ∈ s, 0 ≤ gap i) (htop : ∀ i ∈ s, gap i ≤ b) + (hdensity : ∀ t, u ≤ t → + ((s.filter (fun i => gap i ≤ t)).card : ℝ) ≤ B * Real.exp (A * t)) : + ∑ i ∈ s, Real.exp (-M * gap i) ≤ + (⌊M * b⌋₊ + 1 : ℝ) * B * Real.exp (1 - M * u / 2) := by + classical + let bin : ι → ℕ := fun i => ⌊M * gap i⌋₊ + let bins := Finset.range (⌊M * b⌋₊ + 1) + have hmap : ∀ i ∈ s, bin i ∈ bins := by + intro i hi + apply Finset.mem_range.mpr + exact Nat.lt_succ_of_le (Nat.floor_mono (mul_le_mul_of_nonneg_left (htop i hi) hM.le)) + rw [← Finset.sum_fiberwise_of_maps_to hmap] + have hbin : ∀ k ∈ bins, + ∑ i ∈ s with bin i = k, Real.exp (-M * gap i) ≤ + B * Real.exp (1 - M * u / 2) := by + intro k hk + by_cases hempty : (s.filter (fun i => bin i = k)).Nonempty + · obtain ⟨j, hj⟩ := hempty + have hjs := (Finset.mem_filter.mp hj).1 + have hjbin := (Finset.mem_filter.mp hj).2 + have hjupper : M * gap j < (k : ℝ) + 1 := by + simpa only [bin, hjbin] using Nat.lt_floor_add_one (M * gap j) + have hku : M * u < (k : ℝ) + 1 := + lt_of_le_of_lt (mul_le_mul_of_nonneg_left (hgap j hjs) hM.le) hjupper + have ht : u ≤ ((k : ℝ) + 1) / M := by + apply (le_div_iff₀ hM).mpr + nlinarith + have hsubset : s.filter (fun i => bin i = k) ⊆ + s.filter (fun i => gap i ≤ ((k : ℝ) + 1) / M) := by + intro i hi + obtain ⟨his, hik⟩ := Finset.mem_filter.mp hi + apply Finset.mem_filter.mpr ⟨his, ?_⟩ + apply (le_div_iff₀ hM).mpr + have hiupper : M * gap i < (k : ℝ) + 1 := by + simpa only [bin, hik] using Nat.lt_floor_add_one (M * gap i) + nlinarith + have hcount : ((s.filter (fun i => bin i = k)).card : ℝ) ≤ + B * Real.exp (A * (((k : ℝ) + 1) / M)) := by + exact le_trans (by exact_mod_cast Finset.card_le_card hsubset) + (hdensity _ ht) + have hexponent : A * (((k : ℝ) + 1) / M) - k ≤ 1 - M * u / 2 := by + have hkzero : 0 ≤ (k : ℝ) := Nat.cast_nonneg _ + have hhalf : A / M ≤ (1 : ℝ) / 2 := by + apply (div_le_iff₀ hM).mpr + linarith + have hprod := mul_le_mul_of_nonneg_right hhalf (by positivity : 0 ≤ (k : ℝ) + 1) + rw [div_mul_eq_mul_div] at hprod + have heq : A * (((k : ℝ) + 1) / M) = A / M * ((k : ℝ) + 1) := by ring + rw [heq] + nlinarith + calc + ∑ i ∈ s with bin i = k, Real.exp (-M * gap i) ≤ + ∑ _i ∈ s with bin _i = k, Real.exp (-(k : ℝ)) := by + apply Finset.sum_le_sum + intro i hi + obtain ⟨his, hik⟩ := Finset.mem_filter.mp hi + apply Real.exp_le_exp.mpr + have hf := Nat.floor_le (mul_nonneg hM.le (hzero i his)) + change (bin i : ℝ) ≤ M * gap i at hf + rw [hik] at hf + linarith + _ = ((s.filter (fun i => bin i = k)).card : ℝ) * Real.exp (-(k : ℝ)) := by + simp + _ ≤ (B * Real.exp (A * (((k : ℝ) + 1) / M))) * Real.exp (-(k : ℝ)) := by + gcongr + _ = B * Real.exp (A * (((k : ℝ) + 1) / M) - k) := by + rw [mul_assoc, ← Real.exp_add, sub_eq_add_neg] + _ ≤ B * Real.exp (1 - M * u / 2) := by gcongr + · simp only [Finset.not_nonempty_iff_eq_empty.mp hempty, Finset.sum_empty] + positivity + calc + ∑ k ∈ bins, ∑ i ∈ s with bin i = k, Real.exp (-M * gap i) ≤ + ∑ _k ∈ bins, B * Real.exp (1 - M * u / 2) := Finset.sum_le_sum hbin + _ = (⌊M * b⌋₊ + 1 : ℝ) * B * Real.exp (1 - M * u / 2) := by + simp [bins, mul_assoc] + +end Ostmann.ZeroDensity + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteDetector.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteDetector.lean new file mode 100644 index 0000000000000000000000000000000000000000..51f4c81037e6335d7da8ab78071ff016c2a4e220 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteDetector.lean @@ -0,0 +1,139 @@ +import Mathlib.NumberTheory.LSeries.DirichletContinuation +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import OAI.NumberTheory.Ostmann.ZeroDensity.Mollifier + +namespace OAI + +noncomputable section +open scoped BigOperators ArithmeticFunction.Moebius ArithmeticFunction.zeta LSeries.notation + +namespace Ostmann.ZeroDensity + +def twistedPolynomial {q : ℕ} (χ : DirichletCharacter ℂ q) (f : ArithmeticFunction ℂ) + (N : ℕ) (s : ℂ) : ℂ := + ∑ n ∈ Finset.Icc 1 N, f n * χ n * (n : ℂ) ^ (-s) + +theorem LSeries_eq_twistedPolynomial_of_support {q : ℕ} + (χ : DirichletCharacter ℂ q) (f : ArithmeticFunction ℂ) (N : ℕ) (s : ℂ) + (hsupport : ∀ n, N < n → f n = 0) : + LSeries (characterTwist χ f) s = twistedPolynomial χ f N s := by + unfold LSeries twistedPolynomial + rw [tsum_eq_sum (s := Finset.Icc 1 N)] + · apply Finset.sum_congr rfl + intro n hn + rw [LSeries.term_def₀ (by simp)] + rfl + · intro n hn + rw [LSeries.term_def₀ (by simp)] + by_cases hnzero : n = 0 + · simp [hnzero] + · have hNn : N < n := by + simp only [Finset.mem_Icc] at hn + omega + simp [hsupport n hNn] + +theorem LSeries_truncate_eq_twistedPolynomial {q : ℕ} + (χ : DirichletCharacter ℂ q) (f : ArithmeticFunction ℂ) (N : ℕ) (s : ℂ) : + LSeries (characterTwist χ (truncate N f)) s = twistedPolynomial χ f N s := by + rw [LSeries_eq_twistedPolynomial_of_support χ (truncate N f) N s + (by intro n hn; simp [not_le_of_gt hn])] + unfold twistedPolynomial + apply Finset.sum_congr rfl + intro n hn + simp [(Finset.mem_Icc.mp hn).2] + +def detectorPolynomial {q : ℕ} (χ : DirichletCharacter ℂ q) (X N : ℕ) (s : ℂ) : ℂ := + ∑ n ∈ Finset.Ioc X (X * N), mollifierCoefficient X N n * χ n * (n : ℂ) ^ (-s) + +theorem mollifier_polynomial_split {q : ℕ} (χ : DirichletCharacter ℂ q) + {X N : ℕ} (hX : 1 ≤ X) (hXN : X ≤ N) (s : ℂ) : + twistedPolynomial χ (mollifierCoefficient X N) (X * N) s = + 1 + detectorPolynomial χ X N s := by + classical + have hN : 1 ≤ N := hX.trans hXN + have hprod : 1 ≤ X * N := by + have := Nat.mul_pos (by omega : 0 < X) (by omega : 0 < N) + omega + let f : ℕ → ℂ := fun n => mollifierCoefficient X N n * χ n * (n : ℂ) ^ (-s) + have hsub : insert 1 (Finset.Ioc X (X * N)) ⊆ Finset.Icc 1 (X * N) := by + intro n hn + rcases Finset.mem_insert.mp hn with rfl | hn + · exact Finset.mem_Icc.mpr ⟨le_rfl, hprod⟩ + · exact Finset.mem_Icc.mpr ⟨by have := (Finset.mem_Ioc.mp hn).1; omega, + (Finset.mem_Ioc.mp hn).2⟩ + have hsum : ∑ n ∈ insert 1 (Finset.Ioc X (X * N)), f n = + ∑ n ∈ Finset.Icc 1 (X * N), f n := by + apply Finset.sum_subset hsub + intro n hn hnot + have hnot1 : n ≠ 1 := by + intro h + subst n + exact hnot (Finset.mem_insert_self _ _) + have hnotIoc : n ∉ Finset.Ioc X (X * N) := fun h => hnot (Finset.mem_insert_of_mem h) + have hnX : n ≤ X := by + have hnmax := (Finset.mem_Icc.mp hn).2 + simp only [Finset.mem_Ioc] at hnotIoc + omega + have hn2 : 2 ≤ n := by have := (Finset.mem_Icc.mp hn).1; omega + simp [f, mollifierCoefficient_vanish hXN hn2 hnX] + have hnot : 1 ∉ Finset.Ioc X (X * N) := by simp; omega + rw [Finset.sum_insert hnot] at hsum + have hf1 : f 1 = 1 := by simp [f, mollifierCoefficient_one hX hN] + rw [hf1] at hsum + exact hsum.symm + +theorem finite_mollifier_identity {q : ℕ} (χ : DirichletCharacter ℂ q) + {X N : ℕ} (hX : 1 ≤ X) (hXN : X ≤ N) (s : ℂ) : + twistedPolynomial χ (μ : ArithmeticFunction ℂ) X s * + twistedPolynomial χ (ζ : ArithmeticFunction ℂ) N s = + 1 + detectorPolynomial χ X N s := by + rw [← LSeries_truncate_eq_twistedPolynomial, + ← LSeries_truncate_eq_twistedPolynomial, ← mollifier_product] + rw [LSeries_eq_twistedPolynomial_of_support χ (mollifierCoefficient X N) (X * N) s + (fun _ hn => mollifierCoefficient_support hn)] + exact mollifier_polynomial_split χ hX hXN s + +theorem norm_moebius_le_one (n : ℕ) : ‖(μ n : ℂ)‖ ≤ 1 := by + rcases ArithmeticFunction.moebius_eq_or n with hm | hm | hm <;> simp [hm] + +theorem norm_mollifierPolynomial_le {q : ℕ} (χ : DirichletCharacter ℂ q) + (X : ℕ) {s : ℂ} (hs : 0 ≤ s.re) : + ‖twistedPolynomial χ (μ : ArithmeticFunction ℂ) X s‖ ≤ (X : ℝ) := by + unfold twistedPolynomial + calc + ‖∑ n ∈ Finset.Icc 1 X, (μ : ArithmeticFunction ℂ) n * χ n * (n : ℂ) ^ (-s)‖ ≤ + ∑ n ∈ Finset.Icc 1 X, ‖(μ : ArithmeticFunction ℂ) n * χ n * (n : ℂ) ^ (-s)‖ := + norm_sum_le _ _ + _ ≤ ∑ _n ∈ Finset.Icc 1 X, (1 : ℝ) := by + apply Finset.sum_le_sum + intro n hn + have hn1 : 1 ≤ n := (Finset.mem_Icc.mp hn).1 + have hnpos : 0 < n := by omega + have hpower : ‖(n : ℂ) ^ (-s)‖ ≤ 1 := by + rw [Complex.norm_natCast_cpow_of_pos hnpos] + exact Real.rpow_le_one_of_one_le_of_nonpos (by exact_mod_cast hn1) (by simpa) + rw [norm_mul, norm_mul] + have hmu : ‖(μ : ArithmeticFunction ℂ) n‖ ≤ 1 := by + simpa only [ArithmeticFunction.intCoe_apply] using norm_moebius_le_one n + have hprod := mul_le_mul hmu (χ.norm_le_one n) (norm_nonneg _) zero_le_one + have htotal := mul_le_mul hprod hpower (norm_nonneg _) (by norm_num : (0 : ℝ) ≤ 1 * 1) + simpa only [one_mul] using htotal + _ = (X : ℝ) := by simp + +theorem detector_large_of_small_product {q : ℕ} (χ : DirichletCharacter ℂ q) + {X N : ℕ} (hX : 1 ≤ X) (hXN : X ≤ N) (s : ℂ) + (hsmall : ‖twistedPolynomial χ (μ : ArithmeticFunction ℂ) X s * + twistedPolynomial χ (ζ : ArithmeticFunction ℂ) N s‖ ≤ 1 / 2) : + 1 / 2 ≤ ‖detectorPolynomial χ X N s‖ := by + rw [finite_mollifier_identity χ hX hXN s] at hsmall + have htriangle := norm_sub_le (1 + detectorPolynomial χ X N s) + (detectorPolynomial χ X N s) + simp only [add_sub_cancel_right, norm_one] at htriangle + linarith + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteInverseSquareDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteInverseSquareDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..1fa3581a4f7d3dfd56c6dd99b87a37ff90455a0d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteInverseSquareDensity.lean @@ -0,0 +1,57 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteLaplaceDensity + +namespace OAI + +/-! # Inverse-square summability from a three-halves counting bound -/ + +namespace Ostmann + +open scoped Classical BigOperators + +/-- Sorting by height converts the counting bound into a convergent 4/3-series. -/ +theorem finite_exp_three_halves_sum {ι : Type*} (S : Finset ι) + (y : ι → ℝ) (B : ℝ) (hB : 0 ≤ B) + (hy : ∀ i ∈ S, 0 ≤ y i) + (hc : ∀ t : ℝ, 0 ≤ t → + ((S.filter (fun i => y i ≤ t)).card : ℝ) ≤ B * Real.exp ((3 / 2) * t)) : + (∑ i ∈ S, Real.exp (-2 * y i)) ≤ B ^ (4 / 3 : ℝ) * + ∑ j ∈ Finset.range S.card, ((j + 1 : ℕ) : ℝ) ^ (-4 / 3 : ℝ) := by + revert hy hc + refine Finset.strongInductionOn S ?_ + intro S ih hy hc + by_cases hn : S.Nonempty + · obtain ⟨i, hi, hmax⟩ := S.exists_max_image y hn + have hf : S.filter (fun j => y j ≤ y i) = S := Finset.filter_eq_self.mpr hmax + have hcard := hc (y i) (hy i hi) + rw [hf] at hcard + have hn0 : (0 : ℝ) < S.card := by exact_mod_cast Finset.card_pos.mpr hn + have hm := mul_le_mul_of_nonneg_right hcard (Real.exp_nonneg (-((3 / 2) * y i))) + have he : Real.exp ((3 / 2) * y i) * Real.exp (-((3 / 2) * y i)) = 1 := by + rw [← Real.exp_add, add_neg_cancel, Real.exp_zero] + rw [mul_assoc, he, mul_one] at hm + have hd : Real.exp (-((3 / 2) * y i)) ≤ B / S.card := by + apply (le_div_iff₀ hn0).mpr + simpa only [mul_comm] using hm + have hpoint : Real.exp (-2 * y i) ≤ B ^ (4 / 3 : ℝ) * (S.card : ℝ) ^ (-4 / 3 : ℝ) := by + have hh := Real.rpow_le_rpow (Real.exp_nonneg _) hd (by norm_num : (0 : ℝ) ≤ 4 / 3) + rw [← Real.exp_mul, Real.div_rpow hB hn0.le, div_eq_mul_inv] at hh + convert hh using 1 + · congr 1; ring + · rw [show (-4 / 3 : ℝ) = -(4 / 3) by ring, Real.rpow_neg hn0.le] + rfl + have hrest := ih (S.erase i) (Finset.erase_ssubset hi) + (fun j hj => hy j (Finset.mem_of_mem_erase hj)) + (fun t ht => (show (((S.erase i).filter (fun j => y j ≤ t)).card : ℝ) ≤ + (S.filter (fun j => y j ≤ t)).card from by + exact_mod_cast Finset.card_le_card (Finset.filter_subset_filter _ (Finset.erase_subset _ _))).trans + (hc t ht)) + have hsize : (S.erase i).card + 1 = S.card := Finset.card_erase_add_one hi + rw [← Finset.sum_erase_add S (fun i => Real.exp (-2 * y i)) hi] + rw [← hsize, Finset.sum_range_succ, mul_add] + exact add_le_add hrest (by simpa only [hsize] using hpoint) + · have he : S = ∅ := Finset.not_nonempty_iff_eq_empty.mp hn + simp only [he, Finset.sum_empty, Finset.card_empty, Finset.range_zero, mul_zero, le_refl] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteLaplaceDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteLaplaceDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..52c07efae4732ac308575ced99efe77d9c121f6b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteLaplaceDensity.lean @@ -0,0 +1,105 @@ +import Mathlib.Analysis.SpecialFunctions.ExpDeriv +import Mathlib.Analysis.PSeries +import Mathlib.Data.Finset.Max +import Mathlib.Algebra.BigOperators.Intervals +import Mathlib.Tactic + +namespace OAI + +namespace Ostmann +open scoped Classical BigOperators + +theorem finite_exp_density_square_sum {ι : Type*} (S : Finset ι) + (y : ι → ℝ) (A B : ℝ) (hB : 0 ≤ B) + (hy : ∀ i ∈ S, 0 ≤ y i) + (hc : ∀ t : ℝ, 0 ≤ t → + ((S.filter (fun i => y i ≤ t)).card : ℝ) ≤ B * Real.exp (A * t)) : + (∑ i ∈ S, Real.exp (-(2 * A) * y i)) ≤ + B ^ 2 * ∑ j ∈ Finset.range S.card, ((j + 1 : ℕ) : ℝ)⁻¹ ^ 2 := by + revert hy hc + refine Finset.strongInductionOn S ?_ + intro S ih hy hc + by_cases hn : S.Nonempty + · obtain ⟨i, hi, hmax⟩ := S.exists_max_image y hn + have hf : S.filter (fun j => y j ≤ y i) = S := by + apply Finset.filter_eq_self.mpr + exact hmax + have hcard := hc (y i) (hy i hi) + rw [hf] at hcard + have hn0 : (0 : ℝ) < S.card := by exact_mod_cast Finset.card_pos.mpr hn + have hm := mul_le_mul_of_nonneg_right hcard (Real.exp_nonneg (-(A * y i))) + have he : Real.exp (A * y i) * Real.exp (-(A * y i)) = 1 := by + rw [← Real.exp_add, add_neg_cancel, Real.exp_zero] + rw [mul_assoc, he, mul_one] at hm + have hpoint : Real.exp (-(2 * A) * y i) ≤ B ^ 2 * (S.card : ℝ)⁻¹ ^ 2 := by + have hd : Real.exp (-(A * y i)) ≤ B / S.card := by + apply (le_div_iff₀ hn0).mpr + simpa only [mul_comm] using hm + have hs := (sq_le_sq₀ (Real.exp_nonneg _) (div_nonneg hB hn0.le)).mpr hd + convert hs using 1 + · rw [pow_two, ← Real.exp_add] + congr 1 + ring + · rw [div_pow, div_eq_mul_inv, inv_pow] + have hrest := ih (S.erase i) (Finset.erase_ssubset hi) + (fun j hj => hy j (Finset.mem_of_mem_erase hj)) + (fun t ht => (show (((S.erase i).filter (fun j => y j ≤ t)).card : ℝ) ≤ + (S.filter (fun j => y j ≤ t)).card from by + exact_mod_cast Finset.card_le_card (Finset.filter_subset_filter _ (Finset.erase_subset _ _))).trans + (hc t ht)) + have hsize : (S.erase i).card + 1 = S.card := Finset.card_erase_add_one hi + rw [← Finset.sum_erase_add S (fun i => Real.exp (-(2 * A) * y i)) hi] + rw [← hsize, Finset.sum_range_succ, mul_add] + exact add_le_add hrest (by simpa only [hsize] using hpoint) + · have he : S = ∅ := Finset.not_nonempty_iff_eq_empty.mp hn + simp only [he, Finset.sum_empty, Finset.card_empty, Finset.range_zero, mul_zero, le_refl] + +theorem finite_reciprocal_square_sum_le_two (N : ℕ) : + (∑ j ∈ Finset.range N, ((j + 1 : ℕ) : ℝ)⁻¹ ^ 2) ≤ 2 := by + have he : (∑ j ∈ Finset.range N, ((j + 1 : ℕ) : ℝ)⁻¹ ^ 2) = + ∑ j ∈ Finset.Ioo 0 (N + 1), ((j : ℝ) ^ 2)⁻¹ := by + have hset : Finset.Ioo 0 (N + 1) = Finset.Ico 1 (N + 1) := by + ext j + simp only [Finset.mem_Ioo, Finset.mem_Ico] + omega + rw [hset, Finset.sum_Ico_eq_sum_range] + simp only [Nat.add_sub_cancel, inv_pow, Nat.add_comm] + rw [he] + simpa only [Nat.cast_zero, zero_add, div_one] using + (sum_Ioo_inv_sq_le (α := ℝ) 0 (N + 1)) + +/-- An exponential counting bound and a zero-free gap give exponential +decay for the whole finite zero sum. Squaring the counting constant is harmless +for the subsequent `exp(-D L)` estimates. -/ +theorem finite_laplace_density_bound {ι : Type*} (S : Finset ι) + (y : ι → ℝ) (A B M u : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) + (hM : 4 * A ≤ M) (hu : 0 ≤ u) (hy : ∀ i ∈ S, u ≤ y i) + (hc : ∀ t : ℝ, 0 ≤ t → + ((S.filter (fun i => y i ≤ t)).card : ℝ) ≤ B * Real.exp (A * t)) : + (∑ i ∈ S, Real.exp (-M * y i)) ≤ + 2 * B ^ 2 * Real.exp (-(M * u) / 2) := by + have hy0 (i) (hi : i ∈ S) : 0 ≤ y i := hu.trans (hy i hi) + have hM0 : 0 ≤ M := by linarith + calc + _ ≤ ∑ i ∈ S, Real.exp (-(M * u) / 2) * Real.exp (-(2 * A) * y i) := by + apply Finset.sum_le_sum + intro i hi + rw [← Real.exp_add] + apply Real.exp_le_exp.mpr + have h1 := mul_nonneg (sub_nonneg.mpr (hy i hi)) hM0 + have h2 := mul_nonneg (by linarith : 0 ≤ M - 4 * A) (hy0 i hi) + nlinarith + _ = Real.exp (-(M * u) / 2) * ∑ i ∈ S, Real.exp (-(2 * A) * y i) := + (Finset.mul_sum ..).symm + _ ≤ Real.exp (-(M * u) / 2) * (B ^ 2 * + ∑ j ∈ Finset.range S.card, ((j + 1 : ℕ) : ℝ)⁻¹ ^ 2) := + mul_le_mul_of_nonneg_left (finite_exp_density_square_sum S y A B hB hy0 hc) + (Real.exp_nonneg _) + _ ≤ Real.exp (-(M * u) / 2) * (B ^ 2 * 2) := + mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left + (finite_reciprocal_square_sum_le_two S.card) (sq_nonneg B)) (Real.exp_nonneg _) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FinitePriorDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FinitePriorDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..eca033f3ce78c50f0e8067a568284e29d75314e6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FinitePriorDensity.lean @@ -0,0 +1,51 @@ +import Mathlib.Analysis.Complex.Basic +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Linarith + +namespace OAI + +/-! # Absorbing a dominated finite sampling law into a complex multiplier -/ + +namespace Ostmann + +noncomputable def finitePriorDensity {X : Type*} (μ : X → ℝ) (F : X → ℂ) (x : X) : ℂ := + F x / (μ x : ℂ) + +/-- The scalar is the retained product of one-over-prime line probabilities. +It is positive, so a zero dominating prior forces the original summand to vanish. -/ +theorem finitePriorDensity_cancel {X : Type*} (μ : X → ℝ) (F : X → ℂ) + (c : X → ℝ) (B : ℝ) (hc : ∀ x, 0 < c x) + (hbound : ∀ x, ‖F x‖ * c x ≤ B * μ x) (x : X) : + (μ x : ℂ) * finitePriorDensity μ F x = F x := by + by_cases hμ : μ x = 0 + · have hF : F x = 0 := by + apply norm_eq_zero.mp + have h := hbound x + rw [hμ, mul_zero] at h + have hp := hc x + exact le_antisymm (by nlinarith [norm_nonneg (F x)]) (norm_nonneg _) + simp only [finitePriorDensity, hμ, hF, Complex.ofReal_zero, zero_div, mul_zero] + · unfold finitePriorDensity + exact mul_div_cancel₀ _ (Complex.ofReal_ne_zero.mpr hμ) + +theorem finitePriorDensity_bound {X : Type*} (μ : X → ℝ) (F : X → ℂ) + (c : X → ℝ) (B : ℝ) (hμ : ∀ x, 0 ≤ μ x) (hB : 0 ≤ B) + (hbound : ∀ x, ‖F x‖ * c x ≤ B * μ x) (x : X) : + ‖finitePriorDensity μ F x‖ * c x ≤ B := by + by_cases hz : μ x = 0 + · simp only [finitePriorDensity, hz, Complex.ofReal_zero, div_zero, norm_zero, zero_mul] + exact hB + · have hp : 0 < μ x := lt_of_le_of_ne (hμ x) (Ne.symm hz) + simp only [finitePriorDensity, norm_div, Complex.norm_real, Real.norm_of_nonneg (hμ x)] + rw [div_mul_eq_mul_div] + exact (div_le_iff₀ hp).mpr (hbound x) + +theorem finitePriorDensity_ne_zero {X : Type*} (μ : X → ℝ) (F : X → ℂ) + (x : X) (h : finitePriorDensity μ F x ≠ 0) : F x ≠ 0 := by + intro hF + apply h + simp only [finitePriorDensity, hF, zero_div] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroLogDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroLogDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..81d0a852a922a678dc4ac83628b325417e11e48a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroLogDerivative.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteZeroQuotientGrowth +import OAI.NumberTheory.Ostmann.ZeroDensity.LogDerivativeVanishing +import OAI.NumberTheory.Ostmann.ZeroDensity.LogarithmicDiskRate + +namespace OAI + +/-! # Constant logarithmic derivative after removing a finite zero set -/ + +namespace Ostmann + +open Complex Filter Metric Set +open scoped Topology BigOperators + +/-- The precise elementary finite-order consequence needed for a hypothetical +finite set of completed-character zeros. -/ +theorem finite_zero_quotient_logDeriv_constant (f g : ℂ → ℂ) (S : Finset ℂ) + (hg : ∀ z, AnalyticAt ℂ g z) (hne : ∀ z, g z ≠ 0) + (he : ∀ z, f z = finiteZeroPolynomial f S z * g z) + (A : ℝ) (hA : 0 < A) + (hf : ∀ (N : ℕ) (z : ℂ), ‖z‖ ≤ (N : ℝ) + 1 → + Real.log ‖f z‖ ≤ A * ((N : ℝ) + 3) * (1 + Real.log ((N : ℝ) + 3))) : + ∃ c : ℂ, ∀ z, logDeriv g z = c := by + obtain ⟨R, hR⟩ := exists_nat_gt (∑ z ∈ S, ‖z‖) + have hS : ∀ z ∈ S, ‖z‖ ≤ (R : ℝ) := by + intro z hz + exact (Finset.single_le_sum (fun w _ => norm_nonneg w) hz).trans hR.le + have hgrowth := finite_zero_quotient_log_growth f g S R hS A hA hg hne he hf + have hderiv : ∀ w, deriv (logDeriv g) w = 0 := by + intro w + obtain ⟨m, hm⟩ := exists_nat_gt ‖w‖ + let b : ℝ := (m : ℝ) + R + 4 + let D : ℝ := |Real.log ‖g w‖| + 1 + let B : ℕ → ℝ := fun n => A * ((n : ℝ) + b) * (1 + Real.log ((n : ℝ) + b)) + D + have hb : 1 ≤ b := by dsimp [b]; linarith [Nat.cast_nonneg (α := ℝ) m, Nat.cast_nonneg (α := ℝ) R] + have hB (n : ℕ) : 0 < B n := by + have hl : 0 ≤ Real.log ((n : ℝ) + b) := + Real.log_nonneg (by linarith [Nat.cast_nonneg (α := ℝ) n]) + dsimp [B, D] + positivity + have hlocal : ∀ (n : ℕ) (z : ℂ), z ∈ ball (0 : ℂ) ((n : ℝ) + 1) → + Real.log ‖g (z + w)‖ - Real.log ‖g (0 + w)‖ ≤ B n := by + intro n z hz + have hzn : ‖z‖ < (n : ℝ) + 1 := by simpa only [mem_ball, dist_zero_right] using hz + have hzw : ‖z + w‖ ≤ ((n + m : ℕ) : ℝ) + 1 := by + have hh := norm_add_le z w + push_cast + linarith + have hh := hgrowth (n + m) (z + w) hzw + simp only [Nat.cast_add] at hh + dsimp [B, b, D] + simp only [zero_add] + simp only [add_assoc] at hh ⊢ + linarith [neg_le_abs (Real.log ‖g w‖)] + have hh := deriv_logDeriv_eq_zero_of_disk_bounds (fun z => g (z + w)) + (fun z => (hg (z + w)).comp (f := fun u : ℂ => u + w) (x := z) (by fun_prop)) + (fun z => hne (z + w)) (fun n => (n : ℝ) + 1) B (fun _ => by positivity) hB hlocal + (logarithmic_disk_rate A b D hb) + have hshift : logDeriv (fun z => g (z + w)) = fun z => logDeriv g (z + w) := by + funext z + have hc := logDeriv_comp (f := g) (g := fun u : ℂ => u + w) (x := z) + (hg (z + w)).differentiableAt (differentiableAt_id.add_const w) + simpa [Function.comp_def] using hc + rw [hshift, deriv_comp_add_const, zero_add] at hh + exact hh + have hd : Differentiable ℂ (logDeriv g) := fun z => + ((hg z).deriv.div (hg z) (hne z)).differentiableAt + refine ⟨logDeriv g 0, fun z => ?_⟩ + exact isOpen_univ.is_const_of_deriv_eq_zero isPreconnected_univ + hd.differentiableOn (fun w _ => hderiv w) (mem_univ z) (mem_univ 0) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroPolynomialLogDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroPolynomialLogDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..546605b7b9f154d4e1cfd062ab7482c23c101a0d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroPolynomialLogDerivative.lean @@ -0,0 +1,32 @@ +import Mathlib.Analysis.Calculus.LogDeriv +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteAnalyticZeroFactors + +namespace OAI + +/-! # The logarithmic derivative of the actual finite zero polynomial -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +theorem finiteZeroPolynomial_logDeriv (f : ℂ → ℂ) (S : Finset ℂ) + (s : ℂ) (hs : s ∉ S) : + logDeriv (finiteZeroPolynomial f S) s = + ∑ z ∈ S, (analyticOrderNatAt f z : ℂ) / (s - z) := by + change logDeriv (fun w => ∏ z ∈ S, (w - z) ^ analyticOrderNatAt f z) s = _ + rw [logDeriv_fun_prod] + · apply Finset.sum_congr rfl + intro z hz + have hp := logDeriv_fun_pow (f := fun w : ℂ => w - z) (x := s) + (differentiableAt_id.sub_const z) (analyticOrderNatAt f z) + rw [hp] + simp [logDeriv_apply, div_eq_mul_inv] + · intro z hz + exact pow_ne_zero _ (sub_ne_zero.mpr (fun he => hs (he ▸ hz))) + · intro z _ + exact (differentiableAt_id.sub_const z).pow _ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroQuotientDisk.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroQuotientDisk.lean new file mode 100644 index 0000000000000000000000000000000000000000..35258e90c1fc61b0f98046caf3106171dcf6a5a3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroQuotientDisk.lean @@ -0,0 +1,64 @@ +import Mathlib.Analysis.Complex.AbsMax +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteAnalyticZeroFactors + +namespace OAI + +/-! # Scaled disk bounds for finite zero removal -/ + +namespace Ostmann + +open Complex Metric Set +open scoped BigOperators + +theorem finiteZeroPolynomial_norm_le (f : ℂ → ℂ) (S : Finset ℂ) + (z : ℂ) (r : ℝ) (_hr : 0 ≤ r) (hS : ∀ w ∈ S, ‖z - w‖ ≤ r) : + ‖finiteZeroPolynomial f S z‖ ≤ r ^ (∑ w ∈ S, analyticOrderNatAt f w) := by + simp only [finiteZeroPolynomial, norm_prod, norm_pow] + rw [← Finset.prod_pow_eq_pow_sum] + exact Finset.prod_le_prod₀ (fun _ _ => by positivity) + (fun w hw => pow_le_pow_left₀ (norm_nonneg _) (hS w hw) _) + +theorem finiteZeroPolynomial_norm_ge (f : ℂ → ℂ) (S : Finset ℂ) + (z : ℂ) (r : ℝ) (hr : 0 ≤ r) (hS : ∀ w ∈ S, r ≤ ‖z - w‖) : + r ^ (∑ w ∈ S, analyticOrderNatAt f w) ≤ ‖finiteZeroPolynomial f S z‖ := by + simp only [finiteZeroPolynomial, norm_prod, norm_pow] + rw [← Finset.prod_pow_eq_pow_sum] + exact Finset.prod_le_prod₀ (fun _ _ => pow_nonneg hr _) + (fun w hw => pow_le_pow_left₀ hr (hS w hw) _) + +/-- The annulus between radii 2R and 3R separates the removed zeros from + the circle on which the original function is estimated. -/ +theorem finite_zero_quotient_disk_bound (f g : ℂ → ℂ) (S : Finset ℂ) + (R M : ℝ) (hR : 0 < R) (_hM : 0 ≤ M) + (hS : ∀ w ∈ S, ‖w‖ ≤ 2 * R) + (hg : ∀ s, AnalyticAt ℂ g s) + (he : ∀ s, f s = finiteZeroPolynomial f S s * g s) + (hf : ∀ z ∈ sphere (0 : ℂ) (3 * R), ‖f z‖ ≤ M) : + ∀ z ∈ closedBall (0 : ℂ) (3 * R), + ‖g z‖ ≤ M / R ^ (∑ w ∈ S, analyticOrderNatAt f w) := by + let N := ∑ w ∈ S, analyticOrderNatAt f w + have hb : ∀ z ∈ sphere (0 : ℂ) (3 * R), ‖g z‖ ≤ M / R ^ N := by + intro z hz + have hnorm : ‖z‖ = 3 * R := by simpa using hz + have hp : R ^ N ≤ ‖finiteZeroPolynomial f S z‖ := by + apply finiteZeroPolynomial_norm_ge f S z R hR.le + intro w hw + have ht := norm_add_le (z - w) w + rw [sub_add_cancel] at ht + linarith [hS w hw] + have hfm := hf z hz + rw [he, norm_mul] at hfm + apply (le_div_iff₀ (pow_pos hR N)).mpr + simpa only [mul_comm] using (mul_le_mul_of_nonneg_right hp (norm_nonneg _)).trans hfm + intro z hz + apply Complex.norm_le_of_forall_mem_frontier_norm_le (U := ball (0 : ℂ) (3 * R)) + isBounded_ball (f := g) + · exact DiffContOnCl.mk_ball (fun w _ => (hg w).differentiableAt.differentiableWithinAt) + (fun w _ => (hg w).continuousAt.continuousWithinAt) + · rw [frontier_ball (0 : ℂ) (by positivity : 3 * R ≠ 0)] + exact hb + · rwa [closure_ball (0 : ℂ) (by positivity : 3 * R ≠ 0)] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroQuotientGrowth.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroQuotientGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..543cdd3f454cb0466583d790ce50cc4c9d53b766 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroQuotientGrowth.lean @@ -0,0 +1,63 @@ +import Mathlib.Analysis.Complex.AbsMax +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteAnalyticZeroFactors + +namespace OAI + +/-! # Removing finitely many zeros preserves the required logarithmic growth -/ + +namespace Ostmann + +open Complex Metric Set +open scoped BigOperators + +theorem finite_zero_quotient_log_growth (f g : ℂ → ℂ) (S : Finset ℂ) (R : ℕ) + (hS : ∀ z ∈ S, ‖z‖ ≤ (R : ℝ)) (A : ℝ) (_hA : 0 < A) + (hg : ∀ z, AnalyticAt ℂ g z) (hne : ∀ z, g z ≠ 0) + (he : ∀ z, f z = finiteZeroPolynomial f S z * g z) + (hf : ∀ (N : ℕ) (z : ℂ), ‖z‖ ≤ (N : ℝ) + 1 → + Real.log ‖f z‖ ≤ A * ((N : ℝ) + 3) * (1 + Real.log ((N : ℝ) + 3))) : + ∀ (N : ℕ) (z : ℂ), ‖z‖ ≤ (N : ℝ) + 1 → + Real.log ‖g z‖ ≤ A * ((N : ℝ) + R + 4) * (1 + Real.log ((N : ℝ) + R + 4)) := by + intro N z hz + let r : ℝ := (N : ℝ) + R + 2 + let B : ℝ := A * ((N : ℝ) + R + 4) * (1 + Real.log ((N : ℝ) + R + 4)) + have hr : 0 < r := by dsimp [r]; positivity + have hbd : ∀ w ∈ sphere (0 : ℂ) r, ‖g w‖ ≤ Real.exp B := by + intro w hw + have hnw : ‖w‖ = r := by simpa using hw + have hdist (u : ℂ) (hu : u ∈ S) : 1 ≤ ‖w - u‖ := by + have hh := norm_le_norm_sub_add w u + have hsu := hS u hu + dsimp [r] at hnw + linarith [Nat.cast_nonneg (α := ℝ) N] + have hp : 1 ≤ ‖finiteZeroPolynomial f S w‖ := by + rw [finiteZeroPolynomial, norm_prod] + apply Finset.one_le_prod₀ + intro u hu + rw [norm_pow] + exact one_le_pow₀ (hdist u hu) + have hfn : 0 < ‖f w‖ := by + rw [he w, norm_mul] + exact mul_pos (by linarith) (norm_pos_iff.mpr (hne w)) + have hlog := hf (N + R + 1) w (by push_cast; dsimp [r] at hnw; linarith) + have hlog' : Real.log ‖f w‖ ≤ B := by + simpa only [Nat.cast_add, Nat.cast_one, B, + show (N : ℝ) + R + 1 + 3 = (N : ℝ) + R + 4 by ring] using hlog + calc + _ ≤ ‖finiteZeroPolynomial f S w‖ * ‖g w‖ := le_mul_of_one_le_left (norm_nonneg _) hp + _ = ‖f w‖ := by rw [he w, norm_mul] + _ ≤ Real.exp B := by simpa only [Real.exp_log hfn] using Real.exp_le_exp.mpr hlog' + have hn : ‖g z‖ ≤ Real.exp B := by + apply Complex.norm_le_of_forall_mem_frontier_norm_le (U := ball (0 : ℂ) r) isBounded_ball + · exact DiffContOnCl.mk_ball (fun w _ => (hg w).differentiableAt.differentiableWithinAt) + (fun w _ => (hg w).continuousAt.continuousWithinAt) + · rwa [frontier_ball 0 hr.ne'] + · rw [closure_ball 0 hr.ne', mem_closedBall, dist_zero_right] + dsimp [r] + linarith [Nat.cast_nonneg (α := ℝ) R] + have hh := Real.log_le_log (norm_pos_iff.mpr (hne z)) hn + simpa only [Real.log_exp] using hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroQuotientNormalized.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroQuotientNormalized.lean new file mode 100644 index 0000000000000000000000000000000000000000..d00c64736bd9de5eef54ceb7cd426facf858be62 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FiniteZeroQuotientNormalized.lean @@ -0,0 +1,53 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteZeroQuotientDisk + +namespace OAI + +/-! # Normalized logarithmic bounds after removing all zeros in a disk -/ + +namespace Ostmann + +open Complex Metric Set +open scoped BigOperators + +theorem finite_zero_quotient_normalized_log (f g : ℂ → ℂ) (S : Finset ℂ) + (R M : ℝ) (hR : 0 < R) (hM : 0 < M) (hf0 : f 0 ≠ 0) + (hS : ∀ w ∈ S, ‖w‖ ≤ 2 * R) + (hg : ∀ s, AnalyticAt ℂ g s) + (he : ∀ s, f s = finiteZeroPolynomial f S s * g s) + (hf : ∀ z ∈ sphere (0 : ℂ) (3 * R), ‖f z‖ ≤ M) + (z : ℂ) (hz : z ∈ closedBall (0 : ℂ) (2 * R)) (hgz : g z ≠ 0) : + Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ Real.log M + + (∑ w ∈ S, (analyticOrderNatAt f w : ℝ)) * Real.log 2 - Real.log ‖f 0‖ := by + let N := ∑ w ∈ S, analyticOrderNatAt f w + have hgne : g 0 ≠ 0 := by + intro h + exact hf0 (by rw [he, h, mul_zero]) + have hgn : 0 < ‖g 0‖ := norm_pos_iff.mpr hgne + have hfn : 0 < ‖f 0‖ := norm_pos_iff.mpr hf0 + have hp : ‖finiteZeroPolynomial f S 0‖ ≤ (2 * R) ^ N := by + apply finiteZeroPolynomial_norm_le f S 0 (2 * R) (by positivity) + intro w hw + simpa only [zero_sub, norm_neg] using hS w hw + have hb : ‖f 0‖ ≤ (2 * R) ^ N * ‖g 0‖ := by + rw [he 0, norm_mul] + exact mul_le_mul_of_nonneg_right hp (norm_nonneg _) + have hu := finite_zero_quotient_disk_bound f g S R M hR hM.le hS hg he hf z + (closedBall_subset_closedBall (by linarith) hz) + have hm : ‖g z‖ * ‖f 0‖ ≤ M * 2 ^ N * ‖g 0‖ := by + calc + _ ≤ (M / R ^ N) * ((2 * R) ^ N * ‖g 0‖) := + mul_le_mul hu hb hfn.le (div_nonneg hM.le (pow_nonneg hR.le _)) + _ = _ := by + rw [mul_pow] + field_simp [hR.ne'] + have hratio : ‖g z‖ / ‖g 0‖ ≤ (M * 2 ^ N) / ‖f 0‖ := + (div_le_div_iff₀ hgn hfn).mpr hm + have hzn : 0 < ‖g z‖ := norm_pos_iff.mpr hgz + rw [← Real.log_div hzn.ne' hgn.ne'] + apply (Real.log_le_log (div_pos hzn hgn) hratio).trans_eq + rw [Real.log_div (by positivity) hfn.ne', Real.log_mul hM.ne' (by positivity), Real.log_pow] + simp only [N, Nat.cast_sum] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRealExclusion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRealExclusion.lean new file mode 100644 index 0000000000000000000000000000000000000000..996ee78fcd1f95bf770128668a94eb9ebd2f52c8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRealExclusion.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.FullHeightRealShiftedBound +import OAI.NumberTheory.Ostmann.ZeroDensity.LowHeightZeroExclusion + +namespace OAI + +/-! # The exceptional real-zero argument in a bounded ordinate range -/ + +namespace Ostmann + +open Complex +open scoped ComplexConjugate + +theorem near_real_zero_small_ordinate (χ : PrimitiveRealCharacter) (δ S T : ℝ) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hS : δ * S ≤ 1 / 10) + (hupper : ∀ t : ℝ, |t| ≤ T → + 4 * shiftedRealCharacterZeroSum χ (((1 + δ : ℝ) : ℂ) + (t : ℂ) * I) ≤ + 3 / δ + realZeroKernel δ (2 * t) + S) + (i : ℕ) (hi : 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros i).re) + (hiy : |((realCharacterActualZeros χ).zeros i).im| ≤ T) : + |((realCharacterActualZeros χ).zeros i).im| < δ / 2 := by + by_contra hy + let ρ := (realCharacterActualZeros χ).zeros i + let a : ℝ := 1 + δ - ρ.re + let s : ℂ := ((1 + δ : ℝ) : ℂ) + (ρ.im : ℂ) * I + have ha : δ ≤ a := by dsimp [a, ρ]; linarith [((realCharacterActualZeros χ).in_strip i).2] + have ha' : a ≤ (21 / 20) * δ := by dsimp [a, ρ]; linarith + have hterm := shifted_real_zero_term_le χ s (by dsimp [s]; simp; linarith) + (by dsimp [s]; simp; linarith) i + have hdiff : s - (realCharacterActualZeros χ).zeros i = (a : ℂ) := by + apply Complex.ext <;> simp [s, a, ρ] + rw [hdiff, ← Complex.ofReal_inv, Complex.ofReal_re] at hterm + have hb := (mul_le_mul_of_nonneg_left hterm (by norm_num : (0 : ℝ) ≤ 4)).trans (hupper ρ.im hiy) + have hp := mul_le_mul_of_nonneg_left hb hδ.le + have he : δ * (3 / δ + realZeroKernel δ (2 * ρ.im) + S) = + 3 + δ * realZeroKernel δ (2 * ρ.im) + δ * S := by field_simp + rw [he] at hp + have hm := real_zero_shifted_mass δ a hδ ha ha' + have hk := real_zero_double_height_mass δ ρ.im hδ (le_of_not_gt hy) + simp only [div_eq_mul_inv] at hm + linarith + +theorem near_real_zeros_real_unique_height (χ : PrimitiveRealCharacter) (δ R S T : ℝ) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hR : δ * R ≤ 1 / 10) (hS : δ * S ≤ 1 / 10) + (hreal : shiftedRealCharacterZeroSum χ ((1 + δ : ℝ) : ℂ) ≤ 1 / δ + R) + (hshift : ∀ t : ℝ, |t| ≤ T → + 4 * shiftedRealCharacterZeroSum χ (((1 + δ : ℝ) : ℂ) + (t : ℂ) * I) ≤ + 3 / δ + realZeroKernel δ (2 * t) + S) : + (∀ i, 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros i).re → + |((realCharacterActualZeros χ).zeros i).im| ≤ T → + ((realCharacterActualZeros χ).zeros i).im = 0) ∧ + (∀ i j, 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros i).re → + 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros j).re → + |((realCharacterActualZeros χ).zeros i).im| ≤ T → + |((realCharacterActualZeros χ).zeros j).im| ≤ T → i = j) := by + have hsmall := near_real_zero_small_ordinate χ δ S T hδ hδ1 hS hshift + have huniq := near_axis_zero_indices_unique χ δ R hδ hδ1 hR hreal + constructor + · intro i hi hiy + obtain ⟨j, hj⟩ := realCharacterActualZeros_conjugate χ i + have hjre : 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros j).re := by simpa [hj] using hi + have hjim : |((realCharacterActualZeros χ).zeros j).im| ≤ δ / 2 := by + simpa [hj] using (hsmall i hi hiy).le + have hij := huniq i j hi hjre (hsmall i hi hiy).le hjim + rw [← hij] at hj + have hh := congrArg Complex.im hj + simp only [Complex.conj_im] at hh + linarith + · intro i j hi hj hiy hjy + exact huniq i j hi hj (hsmall i hi hiy).le (hsmall j hj hjy).le + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRealRegion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRealRegion.lean new file mode 100644 index 0000000000000000000000000000000000000000..f994b6e0c042b060fb3be53c7d6d7475a03d6a57 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRealRegion.lean @@ -0,0 +1,94 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.FullHeightRealExclusion + +namespace OAI + +/-! # A uniform full-height real-character zero-free region with one simple exception -/ + +namespace Ostmann + +open Complex + +theorem exists_full_height_real_region : ∃ c : ℝ, 0 < c ∧ + ∀ (χ : PrimitiveRealCharacter) (T : ℝ), 2 ≤ T → + let H := Real.log χ.modulus + Real.log (T + 2) + 1 + (∀ i, |((realCharacterActualZeros χ).zeros i).im| ≤ T → + 1 - c / H ≤ ((realCharacterActualZeros χ).zeros i).re → + ((realCharacterActualZeros χ).zeros i).im = 0) ∧ + (∀ i j, |((realCharacterActualZeros χ).zeros i).im| ≤ T → + |((realCharacterActualZeros χ).zeros j).im| ≤ T → + 1 - c / H ≤ ((realCharacterActualZeros χ).zeros i).re → + 1 - c / H ≤ ((realCharacterActualZeros χ).zeros j).re → i = j) := by + obtain ⟨C, hC, hshift⟩ := exists_full_height_real_shifted_bound + obtain ⟨R, hR, hreal⟩ := exists_real_zero_sum_upper + let D := R + C + 4 + have hD : 0 < D := by dsimp [D]; positivity + refine ⟨1 / (2000 * D), by positivity, ?_⟩ + intro χ T hT + dsimp only + let H := Real.log χ.modulus + Real.log (T + 2) + 1 + have hq : 0 ≤ Real.log χ.modulus := Real.log_nonneg (by exact_mod_cast χ.positive) + have ht : 0 ≤ Real.log (T + 2) := Real.log_nonneg (by linarith) + have hH : 1 ≤ H := by dsimp [H]; linarith + have hHp : 0 < H := by linarith + have hqH : Real.log χ.modulus ≤ H := by dsimp [H]; linarith + let δ := 1 / (100 * D * H) + have hδ : 0 < δ := by dsimp [δ]; positivity + have hDH : 1 ≤ D * H := by + have hmul := mul_le_mul_of_nonneg_left hH hD.le + dsimp [D] at * + linarith + have hδ1 : δ ≤ 1 := by + dsimp [δ] + apply (div_le_iff₀ (by positivity)).mpr + nlinarith + have hmass : δ * (D * H) = 1 / 100 := by dsimp [δ]; field_simp + have hRE : (1 / 2) * Real.log χ.modulus + R ≤ D * H := by + have hrh := mul_le_mul_of_nonneg_left hH hR.le + have hch := mul_nonneg hC.le hHp.le + dsimp [D] + nlinarith + have hCE : C * H ≤ D * H := by dsimp [D]; nlinarith [mul_nonneg hR.le hHp.le] + have hRb : δ * ((1 / 2) * Real.log χ.modulus + R) ≤ 1 / 10 := by + have hh := mul_le_mul_of_nonneg_left hRE hδ.le + rw [hmass] at hh + linarith + have hCb : δ * (C * H) ≤ 1 / 10 := by + have hh := mul_le_mul_of_nonneg_left hCE hδ.le + rw [hmass] at hh + linarith + have hr : shiftedRealCharacterZeroSum χ ((1 + δ : ℝ) : ℂ) ≤ + 1 / δ + ((1 / 2) * Real.log χ.modulus + R) := by + simpa only [add_sub_cancel_left, add_assoc] using + hreal χ (1 + δ) (by linarith) (by linarith) + have hs : ∀ t : ℝ, |t| ≤ T → + 4 * shiftedRealCharacterZeroSum χ (((1 + δ : ℝ) : ℂ) + (t : ℂ) * I) ≤ + 3 / δ + realZeroKernel δ (2 * t) + C * H := by + intro t htT + have hh := hshift χ (1 + δ) t (by linarith) (by linarith) + simp only [add_sub_cancel_left] at hh + have hlog : Real.log (|t| + 2) ≤ Real.log (T + 2) := + Real.log_le_log (by positivity) (by linarith) + have hm := mul_le_mul_of_nonneg_left hlog hC.le + dsimp [H] + linarith + obtain ⟨ha, hu⟩ := near_real_zeros_real_unique_height χ δ + ((1 / 2) * Real.log χ.modulus + R) (C * H) T hδ hδ1 hRb hCb hr hs + have hcut : (1 / (2000 * D)) / H = δ / 20 := by + dsimp [δ] + field_simp + ring + constructor + · intro i hi hnear + apply ha i _ hi + change 1 - (1 / (2000 * D)) / H ≤ _ at hnear + rwa [hcut] at hnear + · intro i j hi hj hnear hnear' + apply hu i j _ _ hi hj + · change 1 - (1 / (2000 * D)) / H ≤ _ at hnear + rwa [hcut] at hnear + · change 1 - (1 / (2000 * D)) / H ≤ _ at hnear' + rwa [hcut] at hnear' + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRealShiftedBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRealShiftedBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..09f7c626aa199027bce130920ab954c5ef776c85 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRealShiftedBound.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.VonMangoldtLogarithmicBound +import OAI.NumberTheory.Ostmann.ZeroDensity.NonquadraticZeroBound + +namespace OAI + +/-! # The real-character shifted zero sum at every height -/ + +namespace Ostmann + +open Complex + +theorem exists_full_height_real_shifted_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveRealCharacter) (σ t : ℝ), 1 < σ → σ ≤ 2 → + 4 * shiftedRealCharacterZeroSum χ ((σ : ℂ) + (t : ℂ) * I) ≤ + 3 / (σ - 1) + realZeroKernel (σ - 1) (2 * t) + + C * (Real.log χ.modulus + Real.log (|t| + 2) + 1) := by + obtain ⟨G, hG, hg⟩ := exists_character_zero_sum_log_bound + obtain ⟨V, hV, hv⟩ := exists_vonMangoldt_logarithmic_upper + obtain ⟨R, hR, hr⟩ := exists_vonMangoldt_series_bound + refine ⟨4 * G + 2 * V + 3 * R + 4, by positivity, ?_⟩ + intro χ σ t hσ hσ2 + have hzero := hg χ.asComplex ((σ : ℂ) + (t : ℂ) * I) + (by simpa using hσ) (by simpa using hσ2) + have hreal := (Complex.re_le_norm _).trans (hr σ hσ hσ2) + have hdouble := hv ((σ : ℂ) + ((2 * t : ℝ) : ℂ) * I) + (by simpa using hσ) (by simpa using hσ2) + have hp := real_character_trigonometric_sum_nonneg χ σ t hσ + have he := χ.asComplex.mangoldt_LSeries_eq ((σ : ℂ) + (t : ℂ) * I) (by simpa using hσ) + change LSeries (fun n => χ.complexCharacter n * (ArithmeticFunction.vonMangoldt n : ℂ)) _ = _ at he + rw [PrimitiveRealCharacter.asComplex_L] at he + rw [he, neg_div, Complex.neg_re] at hp + change shiftedRealCharacterZeroSum χ _ ≤ (logDeriv χ.L _).re + + (1 / 2) * Real.log χ.modulus + G * Real.log (|((σ : ℂ) + (t : ℂ) * I).im| + 2) at hzero + simp only [Complex.ofReal_re, Complex.ofReal_im, Complex.add_re, Complex.add_im, + Complex.mul_re, Complex.mul_im, Complex.I_re, Complex.I_im, + mul_zero, mul_one, zero_add, add_zero, sub_zero] at hdouble hzero + have hlog := mul_le_mul_of_nonneg_left (log_double_abs_height_le t) hV.le + have hq : 0 ≤ Real.log χ.modulus := Real.log_nonneg (by exact_mod_cast χ.positive) + have ht : 0 ≤ Real.log (|t| + 2) := Real.log_nonneg (by linarith [abs_nonneg t]) + have hGq := mul_nonneg hG.le hq + have hVq := mul_nonneg hV.le hq + have hRq := mul_nonneg hR.le hq + have hRt := mul_nonneg hR.le ht + simp only [logDeriv_apply] at hzero + simp only [div_eq_mul_inv] at hreal ⊢ + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRegionComparison.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRegionComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..aeded284001ec34c95021d3ed54cfc3758fb2999 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/FullHeightRegionComparison.lean @@ -0,0 +1,53 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.FullHeightRealRegion +import OAI.NumberTheory.Ostmann.ZeroDensity.NonquadraticZeroRegion +import OAI.NumberTheory.Ostmann.Quadratic.QuadraticCharacterReal + +namespace OAI + +/-! # Comparing the conductor-height cutoffs with the published Page cutoff -/ + +namespace Ostmann + +theorem conductor_height_log_ge_one (Q : ℕ) (hQ : 1 ≤ Q) (T : ℝ) (hT : 2 ≤ T) : + 1 ≤ Real.log (2 * (Q : ℝ) * T) := by + have hQr : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + apply (Real.le_log_iff_exp_le (by positivity : 0 < 2 * (Q : ℝ) * T)).mpr + have hh := mul_le_mul_of_nonneg_right hQr (by linarith : 0 ≤ T) + exact Real.exp_one_lt_three.le.trans (by nlinarith) + +theorem local_height_log_le (q Q : ℕ) (hq : 0 < q) (hqQ : q ≤ Q) + (T : ℝ) (hT : 2 ≤ T) : + Real.log q + Real.log (T + 2) + 1 ≤ 2 * Real.log (2 * (Q : ℝ) * T) := by + have hQr : (q : ℝ) ≤ Q := by exact_mod_cast hqQ + have hqp : (0 : ℝ) < q := by exact_mod_cast hq + have hQ1 : 1 ≤ Q := (Nat.succ_le_iff.mpr hq).trans hqQ + have hH := conductor_height_log_ge_one Q hQ1 T hT + have hp : (q : ℝ) * (T + 2) ≤ 2 * (Q : ℝ) * T := by + have hQpos : (0 : ℝ) ≤ Q := Nat.cast_nonneg _ + have hh := mul_le_mul_of_nonneg_right hQr (by linarith : 0 ≤ T + 2) + nlinarith + have hl := Real.log_le_log (mul_pos hqp (by linarith : 0 < T + 2)) hp + rw [Real.log_mul hqp.ne' (by linarith : T + 2 ≠ 0)] at hl + linarith + +theorem small_cutoff_fraction (a b U V : ℝ) (ha : 0 ≤ a) (hU : 0 < U) (hV : 0 < V) + (hab : a ≤ b / 4) (hUV : U ≤ 2 * V) : a / V ≤ b / (2 * U) := by + apply (div_le_div_iff₀ hV (by positivity)).mpr + have hh := mul_le_mul_of_nonneg_left hUV (by positivity : 0 ≤ 2 * a) + have hh' := mul_le_mul_of_nonneg_right hab hV.le + nlinarith + +noncomputable def PrimitiveRealZero.asRealCharacter (e : PrimitiveRealZero) : PrimitiveRealCharacter where + modulus := e.modulus + positive := e.positive + character := e.character + primitive := e.primitive + nontrivial := e.nontrivial + +@[simp] theorem actualRealZero_asCharacter (χ : PrimitiveRealCharacter) (i : ℕ) + (hi : ((realCharacterActualZeros χ).zeros i).im = 0) : + ((actualRealCharacterZeroExpansion χ).realZero i hi).asRealCharacter = χ := rfl + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaContourBounds.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaContourBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..c71f937ea73fd88819cf521fc215ae58e9f230d1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaContourBounds.lean @@ -0,0 +1,66 @@ +import Mathlib.Analysis.SpecialFunctions.Gamma.Digamma +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaLogDerivativeBound + +namespace OAI + +/-! # Gamma logarithmic derivatives on the four contour lines -/ + +namespace Ostmann + +open Complex + +theorem gamma_not_pole_of_re (z : ℂ) (hz : -1 < z.re) (hne : z.re ≠ 0) : + ∀ n : ℕ, z ≠ -(n : ℂ) := by + intro n he + have hh := congrArg Complex.re he + cases n with + | zero => simp at hh; exact hne hh + | succ n => + simp at hh + have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg n + linarith + +theorem norm_inv_le_four_of_quarter_re (z : ℂ) (hz : |z.re| = 1 / 4) : + ‖z⁻¹‖ ≤ 4 := by + rw [norm_inv] + have hn : (1 / 4 : ℝ) ≤ ‖z‖ := hz ▸ abs_re_le_norm z + have hi := one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 1 / 4) hn + simpa only [one_div, inv_div, inv_one, mul_one, inv_inv] using hi + +theorem gamma_logDeriv_contour_bound : ∃ B : ℝ, 0 < B ∧ ∀ z : ℂ, + (z.re = -(1 / 4 : ℝ) ∨ z.re = 1 / 4 ∨ z.re = 3 / 4 ∨ z.re = 5 / 4) → + ‖logDeriv Complex.Gamma z‖ ≤ B * (1 + |z.im|) := by + obtain ⟨B, hB, hbound⟩ := gamma_logDeriv_strip_bound + refine ⟨B + 4, by linarith, ?_⟩ + intro z hz + rcases hz with hz | hz | hz | hz + · have hp := gamma_not_pole_of_re z (by linarith) (by rw [hz]; norm_num) + have hrec := Complex.digamma_apply_add_one z hp + have hb := hbound (z + 1) (by simp; linarith) (by simp; linarith) + have hi := norm_inv_le_four_of_quarter_re z (by rw [hz]; norm_num) + have he : logDeriv Complex.Gamma z = logDeriv Complex.Gamma (z + 1) - z⁻¹ := by + simp only [← Complex.digamma_def] + rw [hrec] + ring + rw [he] + have hh := (norm_sub_le (logDeriv Complex.Gamma (z + 1)) z⁻¹).trans (add_le_add hb hi) + simp only [add_im, one_im, add_zero] at hh + nlinarith [abs_nonneg z.im] + · have hb := hbound z (by linarith) (by linarith) + nlinarith [abs_nonneg z.im] + · have hb := hbound z (by linarith) (by linarith) + nlinarith [abs_nonneg z.im] + · have hp := gamma_not_pole_of_re (z - 1) (by simp; linarith) (by simp; linarith) + have hrec := Complex.digamma_apply_add_one (z - 1) hp + have hb := hbound (z - 1) (by simp; linarith) (by simp; linarith) + have hi := norm_inv_le_four_of_quarter_re (z - 1) (by simp; rw [hz]; norm_num) + have he : logDeriv Complex.Gamma z = logDeriv Complex.Gamma (z - 1) + (z - 1)⁻¹ := by + simpa only [sub_add_cancel, Complex.digamma_def] using hrec + rw [he] + have hh := (norm_add_le (logDeriv Complex.Gamma (z - 1)) (z - 1)⁻¹).trans (add_le_add hb hi) + simp only [sub_im, one_im, sub_zero] at hh + nlinarith [abs_nonneg z.im] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaFactorialGrowth.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaFactorialGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..a26749eef45de17a7a2adb6ba45541df8f68bab2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaFactorialGrowth.lean @@ -0,0 +1,35 @@ +import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaStripBound + +namespace OAI + +/-! # A factorial bound for Gamma on expanding right-half-plane disks -/ + +namespace Ostmann + +open Complex + +theorem gamma_factorial_growth : ∃ C : ℝ, 0 < C ∧ + ∀ (N : ℕ) (s : ℂ), (1 / 4 : ℝ) ≤ s.re → s.re ≤ (N : ℝ) + 2 → + ‖Complex.Gamma s‖ ≤ C + ((N + 1).factorial : ℝ) := by + obtain ⟨C, hC, hbound⟩ := gamma_positive_strip_bound (1 / 4) 2 (by norm_num) + refine ⟨C, hC, ?_⟩ + intro N s hs hs' + by_cases hsmall : s.re ≤ 2 + · exact (hbound s hs hsmall).trans (le_add_of_nonneg_right (Nat.cast_nonneg _)) + · have hpos : 0 < s.re := by linarith + have hm : Real.Gamma s.re ≤ Real.Gamma ((N : ℝ) + 2) := + Real.Gamma_strictMonoOn_Ici.monotoneOn (by change 2 ≤ s.re; linarith) + (by change 2 ≤ (N : ℝ) + 2; linarith [Nat.cast_nonneg (α := ℝ) N]) hs' + have he : Real.Gamma ((N : ℝ) + 2) = ((N + 1).factorial : ℝ) := by + simpa only [Nat.cast_add, Nat.cast_one, add_assoc, one_add_one_eq_two] using + Real.Gamma_nat_eq_factorial (N + 1) + calc + _ ≤ Real.Gamma s.re := gamma_norm_le_real s hpos + _ ≤ Real.Gamma ((N : ℝ) + 2) := hm + _ = _ := he + _ ≤ _ := le_add_of_nonneg_left hC.le + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaGrowthStrip.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaGrowthStrip.lean new file mode 100644 index 0000000000000000000000000000000000000000..98907a64c67e4fcc9909fea6add64b3adc615ad4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaGrowthStrip.lean @@ -0,0 +1,59 @@ +import Mathlib.Analysis.Real.Pi.Bounds +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaRealContourBound + +namespace OAI + +/-! # Gamma-factor growth in the narrow strip around the contour + +The upper bounds use only Euler's integral and reflection. They are needed +for the horizontal-edge logarithmic-derivative estimate. +-/ + +namespace Ostmann + +open Complex + +theorem gammaReal_inverse_eq (s : ℂ) : + (Complex.Gammaℝ s)⁻¹ = (Real.pi : ℂ) ^ (s / 2) * (Complex.Gamma (s / 2))⁻¹ := by + rw [Complex.Gammaℝ_def, mul_inv] + congr 1 + rw [← Complex.cpow_neg] + congr 1 + ring + +theorem gammaReal_growth_bounds : ∃ C : ℝ, 0 < C ∧ + (∀ s : ℂ, (1 / 2 : ℝ) ≤ s.re → s.re ≤ 11 / 4 → ‖Complex.Gammaℝ s‖ ≤ C) ∧ + (∀ s : ℂ, -(3 / 4 : ℝ) ≤ s.re → s.re ≤ 3 / 2 → + ‖(Complex.Gammaℝ s)⁻¹‖ ≤ C * Real.exp (Real.pi * |s.im|)) := by + obtain ⟨C, hC, hΓ⟩ := gamma_positive_strip_bound (1 / 4) (11 / 8) (by norm_num) + refine ⟨C, hC, ?_, ?_⟩ + · intro s hs hs' + have hg := hΓ (s / 2) (by simp; linarith) (by simp; linarith) + have hp : ‖(Real.pi : ℂ) ^ (-s / 2)‖ ≤ 1 := by + rw [Complex.norm_cpow_eq_rpow_re_of_pos Real.pi_pos] + apply Real.rpow_le_one_of_one_le_of_nonpos (by linarith [Real.pi_gt_three] : (1 : ℝ) ≤ Real.pi) + simp + linarith + rw [Complex.Gammaℝ_def, norm_mul] + exact (mul_le_mul hp hg (norm_nonneg _) (by norm_num)).trans_eq (one_mul C) + · intro s hs hs' + have hg := hΓ (1 - s / 2) (by simp; linarith) (by simp; linarith) + have hi := gamma_inv_norm_bound C hC.le (s / 2) (by simp; linarith) hg + have hp : ‖(Real.pi : ℂ) ^ (s / 2)‖ ≤ Real.pi := by + rw [Complex.norm_cpow_eq_rpow_re_of_pos Real.pi_pos] + calc + _ ≤ Real.pi ^ (1 : ℝ) := Real.rpow_le_rpow_of_exponent_le (by linarith [Real.pi_gt_three] : (1 : ℝ) ≤ Real.pi) (by simp; linarith) + _ = _ := Real.rpow_one _ + have him : |(s / 2).im| ≤ |s.im| := by + simp only [div_ofNat_im, abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 2)] + linarith [abs_nonneg s.im] + rw [gammaReal_inverse_eq, norm_mul] + calc + _ ≤ Real.pi * ((C / Real.pi) * Real.exp (Real.pi * |(s / 2).im|)) := + mul_le_mul hp hi (norm_nonneg _) Real.pi_pos.le + _ = C * Real.exp (Real.pi * |(s / 2).im|) := by field_simp + _ ≤ C * Real.exp (Real.pi * |s.im|) := by gcongr + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaHalfStripBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaHalfStripBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e345032d7d701b009bb1dd80301b43d357fa243 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaHalfStripBound.lean @@ -0,0 +1,76 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.LogarithmicGammaBound + +namespace OAI + +/-! # The Gamma bound on the positive strip used for contour displacement -/ + +namespace Ostmann + +open Complex + +theorem gammaReal_logarithmic_half_strip : ∃ B : ℝ, 0 < B ∧ ∀ s : ℂ, + 1 / 2 ≤ s.re → s.re ≤ 3 → + ‖logDeriv Complex.Gammaℝ s‖ ≤ B * Real.log (|s.im| + 2) := by + obtain ⟨C, hC, hb⟩ := Complex.exists_norm_digamma_div_two_le_log + (a := 1 / 2) (b := 3) (by norm_num) + let D := |Real.log Real.pi| / Real.log 2 + have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) + have hD : 0 ≤ D := by dsimp [D]; positivity + refine ⟨C + D + 1, by positivity, ?_⟩ + intro s hs hs' + have hregular : ∀ n : ℕ, s / 2 ≠ -(n : ℂ) := by + intro n hn + have hh := congrArg Complex.re hn + simp only [div_ofNat_re, neg_re, natCast_re] at hh + linarith [Nat.cast_nonneg (α := ℝ) n] + have hlog : Real.log 2 ≤ Real.log (|s.im| + 2) := + Real.log_le_log (by norm_num) (by linarith [abs_nonneg s.im]) + have hlogpos : 0 < Real.log (|s.im| + 2) := hlog2.trans_le hlog + have hDlog : |Real.log Real.pi| ≤ D * Real.log (|s.im| + 2) := by + have hm := mul_le_mul_of_nonneg_left hlog hD + dsimp [D] at hm + rwa [div_mul_cancel₀ _ hlog2.ne'] at hm + have hpi : ‖Complex.log (Real.pi : ℂ)‖ = |Real.log Real.pi| := by + rw [← Complex.ofReal_log Real.pi_pos.le, Complex.norm_real, Real.norm_eq_abs] + rw [gammaReal_logDeriv s hregular, norm_div, norm_ofNat] + have hh := (norm_sub_le (Complex.digamma (s / 2)) (Complex.log (Real.pi : ℂ))).trans + (add_le_add (hb s hs hs') (le_refl _)) + rw [hpi] at hh + change ‖Complex.digamma (s / 2) - Complex.log (Real.pi : ℂ)‖ / 2 ≤ _ + nlinarith + +theorem characterGamma_logarithmic_half_strip : ∃ B : ℝ, 0 < B ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), 1 / 2 ≤ s.re → s.re ≤ 2 → + ‖logDeriv (DirichletCharacter.gammaFactor χ.character) s‖ ≤ + B * Real.log (|s.im| + 2) := by + obtain ⟨B, hB, hb⟩ := gammaReal_logarithmic_half_strip + refine ⟨B, hB, ?_⟩ + intro χ s hs hs' + by_cases he : χ.character.Even + · rw [show DirichletCharacter.gammaFactor χ.character = Complex.Gammaℝ from + funext (fun u => by simp [DirichletCharacter.gammaFactor, he])] + exact hb s hs (by linarith) + · rw [show DirichletCharacter.gammaFactor χ.character = + Complex.Gammaℝ ∘ (fun u : ℂ => u + 1) from + funext (fun u => by simp [DirichletCharacter.gammaFactor, he])] + rw [logDeriv_comp (g := fun u : ℂ => u + 1) (x := s) + (gammaReal_analyticAt_pos (s + 1) (by simp; linarith)).differentiableAt + (differentiableAt_id.add_const (1 : ℂ))] + simpa using hb (s + 1) (by simp; linarith) (by simp; linarith) + +theorem characterGammaInverse_logarithmic_half_strip : ∃ B : ℝ, 0 < B ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), 1 / 2 ≤ s.re → s.re ≤ 2 → + ‖logDeriv χ.gammaInverse s‖ ≤ B * Real.log (|s.im| + 2) := by + obtain ⟨B, hB, hb⟩ := characterGamma_logarithmic_half_strip + refine ⟨B, hB, ?_⟩ + intro χ s hs hs2 + have he := logDeriv_fun_zpow (χ.gammaFactor_differentiableAt_pos s (by linarith)) (-1 : ℤ) + have hi : logDeriv χ.gammaInverse s = -logDeriv (DirichletCharacter.gammaFactor χ.character) s := by + rw [show χ.gammaInverse = (fun x => (DirichletCharacter.gammaFactor χ.character x)⁻¹) from rfl] + simpa only [zpow_neg_one, Int.cast_neg, Int.cast_one, neg_one_mul] using he + rw [hi, norm_neg] + exact hb χ s hs hs2 + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaInverseBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaInverseBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c7cd723a7135eac1fee9bd0bbf53e8bc7db3f8e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaInverseBound.lean @@ -0,0 +1,54 @@ +import Mathlib.Analysis.SpecialFunctions.Gamma.Beta +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaStripBound + +namespace OAI + +/-! # A reciprocal Gamma bound from the reflection formula -/ + +namespace Ostmann + +open Complex + +theorem complex_sin_norm_le_exp (z : ℂ) : ‖Complex.sin z‖ ≤ Real.exp |z.im| := by + rw [Complex.sin, norm_div, norm_mul, norm_I, mul_one, norm_ofNat] + have hp : ‖exp (-z * I)‖ ≤ Real.exp |z.im| := by + rw [norm_exp] + apply Real.exp_le_exp.mpr + simpa using le_abs_self z.im + have hm : ‖exp (z * I)‖ ≤ Real.exp |z.im| := by + rw [norm_exp] + apply Real.exp_le_exp.mpr + simpa using neg_le_abs z.im + calc + _ ≤ (Real.exp |z.im| + Real.exp |z.im|) / 2 := + div_le_div_of_nonneg_right ((norm_sub_le _ _).trans (add_le_add hp hm)) (by norm_num) + _ = _ := by ring + +theorem gamma_inv_reflection (z : ℂ) (hz' : z.re < 1) : + (Complex.Gamma z)⁻¹ = Complex.Gamma (1 - z) * sin ((Real.pi : ℂ) * z) / (Real.pi : ℂ) := by + have hne : Complex.Gamma (1 - z) ≠ 0 := + Complex.Gamma_ne_zero_of_re_pos (by simp; linarith) + calc + _ = Complex.Gamma (1 - z) * (Complex.Gamma z * Complex.Gamma (1 - z))⁻¹ := by + simp [mul_inv_rev, hne] + _ = _ := by + rw [Complex.Gamma_mul_Gamma_one_sub] + simp only [inv_div] + ring + +theorem gamma_inv_norm_bound (C : ℝ) (hC : 0 ≤ C) (z : ℂ) + (hz' : z.re < 1) (hΓ : ‖Complex.Gamma (1 - z)‖ ≤ C) : + ‖(Complex.Gamma z)⁻¹‖ ≤ (C / Real.pi) * Real.exp (Real.pi * |z.im|) := by + rw [gamma_inv_reflection z hz', norm_div, norm_mul, + Complex.norm_of_nonneg Real.pi_pos.le] + have hs : ‖sin ((Real.pi : ℂ) * z)‖ ≤ Real.exp (Real.pi * |z.im|) := by + convert complex_sin_norm_le_exp ((Real.pi : ℂ) * z) using 1 + simp [abs_mul, abs_of_pos Real.pi_pos] + calc + _ ≤ C * Real.exp (Real.pi * |z.im|) / Real.pi := by + gcongr + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaLogDerivativeBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaLogDerivativeBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9af9487a8eb034e5e24b4b6d167f1878cbe7071 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaLogDerivativeBound.lean @@ -0,0 +1,87 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaInverseBound +import OAI.NumberTheory.Ostmann.ZeroDensity.LogDerivativeDiskBound + +namespace OAI + +/-! # A polynomial bound for the Gamma logarithmic derivative + +Only the compact real strip [1/4,3/4] is needed. The proof combines the +Euler-integral upper bound, the reflection lower bound, and the disk estimate. +-/ + +namespace Ostmann + +open Complex Metric Set + +/-- Linear growth is enough after multiplication by the eighth-order Mellin decay. -/ +theorem gamma_logDeriv_strip_bound : ∃ B : ℝ, 0 < B ∧ ∀ z : ℂ, + (1 / 4 : ℝ) ≤ z.re → z.re ≤ 3 / 4 → + ‖logDeriv Complex.Gamma z‖ ≤ B * (1 + |z.im|) := by + obtain ⟨C, hC, hbound⟩ := gamma_positive_strip_bound (1 / 8) (7 / 8) (by norm_num) + let K : ℝ := 2 * |Real.log C| + |Real.log Real.pi| + 1 + have hK : 0 < K := by dsimp [K]; positivity + refine ⟨32 * (K + Real.pi), by positivity, ?_⟩ + intro z hz hz' + let g : ℂ → ℂ := fun w => Complex.Gamma (z + w) + have hre (w : ℂ) (hw : w ∈ ball 0 (1 / 8 : ℝ)) : + (1 / 8 : ℝ) ≤ (z + w).re ∧ (z + w).re ≤ 7 / 8 := by + have hn : ‖w‖ < 1 / 8 := by simpa using hw + have ha := abs_re_le_norm w + have hl := neg_le_abs w.re + have hu := le_abs_self w.re + simp only [add_re] + constructor <;> linarith + have hgpos (w : ℂ) (hw : w ∈ ball 0 (1 / 8 : ℝ)) : 0 < (z + w).re := by + linarith [(hre w hw).1] + have hgd (w : ℂ) (hw : w ∈ ball 0 (1 / 8 : ℝ)) : DifferentiableAt ℂ Complex.Gamma (z + w) := by + apply Complex.differentiableAt_Gamma + intro n he + have hh := congrArg Complex.re he + simp at hh + have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg n + have hp := hgpos w hw + simp only [add_re] at hp + linarith + have hg : AnalyticOnNhd ℂ g (ball 0 (1 / 8 : ℝ)) := by + intro w hw + rw [analyticAt_iff_eventually_differentiableAt] + filter_upwards [isOpen_ball.eventually_mem hw] with u hu + exact (hgd u hu).comp u (differentiableAt_id.const_add z) + have hne (w : ℂ) (hw : w ∈ ball 0 (1 / 8 : ℝ)) : g w ≠ 0 := + Complex.Gamma_ne_zero_of_re_pos (hgpos w hw) + have hgz : Complex.Gamma z ≠ 0 := Complex.Gamma_ne_zero_of_re_pos (by linarith) + have hi : ‖(Complex.Gamma z)⁻¹‖ ≤ (C / Real.pi) * Real.exp (Real.pi * |z.im|) := + gamma_inv_norm_bound C hC.le z (by linarith) + (hbound (1 - z) (by simp; linarith) (by simp; linarith)) + have hlogInv : -Real.log ‖Complex.Gamma z‖ ≤ + Real.log C - Real.log Real.pi + Real.pi * |z.im| := by + calc + _ = Real.log ‖(Complex.Gamma z)⁻¹‖ := by rw [norm_inv, Real.log_inv] + _ ≤ Real.log ((C / Real.pi) * Real.exp (Real.pi * |z.im|)) := + Real.log_le_log (norm_pos_iff.mpr (inv_ne_zero hgz)) hi + _ = _ := by rw [Real.log_mul (div_ne_zero hC.ne' Real.pi_ne_zero) (Real.exp_ne_zero _), + Real.log_div hC.ne' Real.pi_ne_zero, Real.log_exp] + have hlog (w : ℂ) (hw : w ∈ ball 0 (1 / 8 : ℝ)) : + Real.log ‖g w‖ - Real.log ‖g 0‖ ≤ K + Real.pi * |z.im| := by + have hu : Real.log ‖g w‖ ≤ Real.log C := + Real.log_le_log (norm_pos_iff.mpr (hne w hw)) (hbound (z + w) (hre w hw).1 (hre w hw).2) + simp only [g, add_zero] at * + dsimp only [K] + linarith [le_abs_self (Real.log C), neg_le_abs (Real.log Real.pi)] + have hestimate := logDeriv_norm_le_of_disk g (1 / 8) (K + Real.pi * |z.im|) + (by norm_num) (by positivity) hg hne hlog + have hdg : HasDerivAt g (deriv Complex.Gamma z) 0 := by + convert! (hgd 0 (mem_ball_self (by norm_num : (0 : ℝ) < 1 / 8))).hasDerivAt.comp 0 + ((hasDerivAt_id (0 : ℂ)).const_add z) using 1 + simp + have he : logDeriv g 0 = logDeriv Complex.Gamma z := by + simp only [logDeriv_apply, hdg.deriv, g, add_zero] + rw [he] at hestimate + calc + _ ≤ 32 * (K + Real.pi * |z.im|) := by convert hestimate using 1; ring + _ ≤ 32 * (K + Real.pi) * (1 + |z.im|) := by + nlinarith [abs_nonneg z.im, Real.pi_pos] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaLogDerivativeGrowth.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaLogDerivativeGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..23860dbde7f181e5eb72fb2706f8dc4498e1c415 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaLogDerivativeGrowth.lean @@ -0,0 +1,37 @@ +import Mathlib.NumberTheory.Harmonic.GammaDeriv +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaRealLogDerivative + +namespace OAI + +/-! # Divergence of the Gamma logarithmic derivative at positive integers -/ + +namespace Ostmann + +open Complex Filter +open scoped Topology + +theorem gamma_logDeriv_nat (n : ℕ) : + logDeriv Complex.Gamma ((n : ℂ) + 1) = + (-Real.eulerMascheroniConstant + (harmonic n : ℝ) : ℂ) := by + rw [logDeriv_apply, Complex.deriv_Gamma_nat, Complex.Gamma_nat_eq_factorial] + have hn : (n.factorial : ℂ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero n + rw [mul_div_cancel_left₀ _ hn] + push_cast + rfl + +theorem gamma_logDeriv_nat_re_tendsto : + Tendsto (fun n : ℕ => (logDeriv Complex.Gamma ((n : ℂ) + 1)).re) atTop atTop := by + apply tendsto_atTop.2 + intro b + have h1 := Real.tendsto_harmonic_sub_log.eventually + (lt_mem_nhds (show Real.eulerMascheroniConstant - 1 < Real.eulerMascheroniConstant by linarith)) + have h2 := (Real.tendsto_log_atTop.comp tendsto_natCast_atTop_atTop).eventually_ge_atTop (b + 1) + filter_upwards [h1, h2] with n hn hn' + simp only [Function.comp_apply] at hn' + rw [gamma_logDeriv_nat] + simp only [add_re, neg_re, ofReal_re] + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaNormDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaNormDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..9db9fdd2d26d98ed9bcdbdcbac03c542fe553671 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaNormDerivative.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.LogNormDerivative +import OAI.NumberTheory.Ostmann.ZeroDensity.SharpDigammaStrip + +namespace OAI + +/-! # Horizontal and vertical logarithmic derivatives of Gamma -/ + +namespace Ostmann + +open Complex + + theorem gamma_differentiableAt_pos {z : ℂ} (hz : 0 < z.re) : + DifferentiableAt ℂ Complex.Gamma z := by + apply Complex.differentiableAt_Gamma + intro n he + have hr := congrArg Complex.re he + simp only [neg_re, natCast_re] at hr + have hn := Nat.cast_nonneg (α := ℝ) n + linarith + + theorem gamma_log_norm_horizontal (a t : ℝ) (ha : 0 < a) : + HasDerivAt (fun x : ℝ => Real.log ‖Complex.Gamma ((x : ℂ) + t * I)‖) + (Complex.digamma ((a : ℂ) + t * I)).re a := by + have hz : 0 < ((a : ℂ) + t * I).re := by simpa + have hp : HasDerivAt (fun x : ℝ => (x : ℂ) + t * I) 1 a := by + simpa using Complex.ofRealCLM.hasDerivAt.add_const ((t : ℂ) * I) + have hg := (gamma_differentiableAt_pos hz).hasDerivAt.scomp a hp + have hd := hasDerivAt_log_norm hg (Complex.Gamma_ne_zero_of_re_pos hz) + simpa only [Function.comp_apply, one_smul, digamma_def, logDeriv_apply] using hd + + theorem gamma_log_norm_vertical (a t : ℝ) (ha : 0 < a) : + HasDerivAt (fun y : ℝ => Real.log ‖Complex.Gamma ((a : ℂ) + y * I)‖) + (-(Complex.digamma ((a : ℂ) + t * I)).im) t := by + have hz : 0 < ((a : ℂ) + t * I).re := by simpa + have hp : HasDerivAt (fun y : ℝ => (a : ℂ) + y * I) I t := by + simpa using (Complex.ofRealCLM.hasDerivAt.mul_const I).const_add (a : ℂ) + have hg := (gamma_differentiableAt_pos hz).hasDerivAt.scomp t hp + have hd := hasDerivAt_log_norm hg (Complex.Gamma_ne_zero_of_re_pos hz) + simpa only [Function.comp_apply, digamma_def, logDeriv_apply, smul_eq_mul, + mul_div_assoc, I_mul_re] using hd + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaRealContourBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaRealContourBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..026641dbd011add8b9ca06c399c61d2df774dd2b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaRealContourBound.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaRealLogDerivative + +namespace OAI + +/-! # Bounds for the real-place Gamma factor on the shifted contour -/ + +namespace Ostmann + +open Complex + +theorem gammaReal_differentiableAt (s : ℂ) (hs : ∀ n : ℕ, s / 2 ≠ -(n : ℂ)) : + DifferentiableAt ℂ Complex.Gammaℝ s := by + have hpi : (Real.pi : ℂ) ≠ 0 := by exact_mod_cast Real.pi_ne_zero + exact (((differentiableAt_id.neg).div_const 2).const_cpow (.inl hpi)).mul + ((Complex.differentiableAt_Gamma _ hs).comp s (differentiableAt_id.div_const 2)) + +theorem gammaReal_contour_regular (s : ℂ) + (hs : s.re = -(1 / 2 : ℝ) ∨ s.re = 1 / 2 ∨ s.re = 3 / 2 ∨ s.re = 5 / 2) : + ∀ n : ℕ, s / 2 ≠ -(n : ℂ) := by + apply gamma_not_pole_of_re + · simp only [div_ofNat_re] + rcases hs with h | h | h | h <;> linarith + · simp only [div_ofNat_re] + rcases hs with h | h | h | h <;> rw [h] <;> norm_num + +theorem gammaReal_contour_logDeriv_bound : ∃ B : ℝ, 0 < B ∧ ∀ s : ℂ, + (s.re = -(1 / 2 : ℝ) ∨ s.re = 1 / 2 ∨ s.re = 3 / 2 ∨ s.re = 5 / 2) → + ‖logDeriv Complex.Gammaℝ s‖ ≤ B * (1 + |s.im|) := by + obtain ⟨B, hB, hbound⟩ := gamma_logDeriv_contour_bound + refine ⟨B + |Real.log Real.pi| + 1, by positivity, ?_⟩ + intro s hs + have hhalf : (s / 2).re = -(1 / 4 : ℝ) ∨ (s / 2).re = 1 / 4 ∨ + (s / 2).re = 3 / 4 ∨ (s / 2).re = 5 / 4 := by + simp only [div_ofNat_re] + rcases hs with h | h | h | h + · left; linarith + · right; left; linarith + · right; right; left; linarith + · right; right; right; linarith + have hb := hbound (s / 2) hhalf + change ‖Complex.digamma (s / 2)‖ ≤ _ at hb + have him : |(s / 2).im| = |s.im| / 2 := by simp [abs_div] + have hnorm : ‖Complex.log (Real.pi : ℂ)‖ = |Real.log Real.pi| := by + rw [← Complex.ofReal_log Real.pi_pos.le, Complex.norm_real, Real.norm_eq_abs] + rw [gammaReal_logDeriv s (gammaReal_contour_regular s hs), norm_div, norm_ofNat] + have hh := (norm_sub_le (Complex.digamma (s / 2)) (Complex.log (Real.pi : ℂ))).trans + (add_le_add hb (le_refl ‖Complex.log (Real.pi : ℂ)‖)) + rw [him, hnorm] at hh + change ‖Complex.digamma (s / 2) - Complex.log (Real.pi : ℂ)‖ / 2 ≤ _ + nlinarith [abs_nonneg s.im, abs_nonneg (Real.log Real.pi)] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaRealLogDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaRealLogDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..55f576b052f41b2e15d995c0b1a7e34abcdee566 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaRealLogDerivative.lean @@ -0,0 +1,32 @@ +import Mathlib.Analysis.SpecialFunctions.Gamma.Deligne +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaContourBounds + +namespace OAI + +/-! # Logarithmic derivatives of the archimedean Gamma factor -/ + +namespace Ostmann + +open Complex + +theorem gammaReal_logDeriv (s : ℂ) (hs : ∀ n : ℕ, s / 2 ≠ -(n : ℂ)) : + logDeriv Complex.Gammaℝ s = (Complex.digamma (s / 2) - Complex.log (Real.pi : ℂ)) / 2 := by + have hpi : (Real.pi : ℂ) ≠ 0 := by exact_mod_cast Real.pi_ne_zero + let p : ℂ → ℂ := fun u => (Real.pi : ℂ) ^ (-u / 2) + have hpne : p s ≠ 0 := Complex.cpow_ne_zero_iff.mpr (.inl hpi) + have hp := (((hasDerivAt_id s).neg).div_const 2).const_cpow (.inl hpi) + have hplog : logDeriv p s = -(Complex.log (Real.pi : ℂ)) / 2 := by + rw [logDeriv_apply, show deriv p s = p s * Complex.log (Real.pi : ℂ) * (-1 / 2) from hp.deriv] + field_simp [hpne] + have hgamma := ((hasDerivAt_id s).div_const 2).logDeriv_Gamma hs + simp only [id_eq] at hgamma + have hgd : DifferentiableAt ℂ (fun u : ℂ => Complex.Gamma (u / 2)) s := + (Complex.differentiableAt_Gamma _ hs).comp s (differentiableAt_id.div_const 2) + have he : Complex.Gammaℝ = fun u => p u * Complex.Gamma (u / 2) := rfl + rw [he, logDeriv_fun_mul (f := p) (g := fun u => Complex.Gamma (u / 2)) s hpne + (Complex.Gamma_ne_zero hs) hp.differentiableAt hgd, hplog, hgamma] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaStripBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaStripBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e261cec911124c08778289dee7636a6d93afa91 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GammaStripBound.lean @@ -0,0 +1,39 @@ +import Mathlib.Analysis.SpecialFunctions.Gamma.Deriv + +namespace OAI + +/-! # Bounds for Gamma on the positive vertical strips used by the contour -/ + +namespace Ostmann + +open Complex MeasureTheory Set + +/-- The Euler integral bounds Gamma at a complex point by its real value. -/ +theorem gamma_norm_le_real (z : ℂ) (hz : 0 < z.re) : + ‖Complex.Gamma z‖ ≤ Real.Gamma z.re := by + rw [Complex.Gamma_eq_integral hz, Complex.GammaIntegral, Real.Gamma_eq_integral hz] + apply (norm_integral_le_integral_norm _).trans_eq + apply integral_congr_ae + filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht + rw [norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos ht] + simp [Complex.norm_exp] + +theorem gamma_positive_strip_bound (a b : ℝ) (ha : 0 < a) : + ∃ C : ℝ, 0 < C ∧ ∀ z : ℂ, a ≤ z.re → z.re ≤ b → ‖Complex.Gamma z‖ ≤ C := by + have hc : ContinuousOn Real.Gamma (Icc a b) := by + intro x hx + apply (Real.differentiableAt_Gamma (fun n => ?_)).continuousAt.continuousWithinAt + have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg n + linarith [hx.1] + obtain ⟨C, hC⟩ := isCompact_Icc.exists_bound_of_continuousOn hc + refine ⟨max C 1, lt_of_lt_of_le zero_lt_one (le_max_right _ _), ?_⟩ + intro z hza hzb + calc + ‖Complex.Gamma z‖ ≤ Real.Gamma z.re := gamma_norm_le_real z (lt_of_lt_of_le ha hza) + _ ≤ ‖Real.Gamma z.re‖ := le_abs_self _ + _ ≤ C := hC z.re ⟨hza, hzb⟩ + _ ≤ max C 1 := le_max_left _ _ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GaussianContourShift.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GaussianContourShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..829057d7223a3cc4b96f6d842d5028ccaafbfa11 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GaussianContourShift.lean @@ -0,0 +1,69 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityGaussianEnvelope + +namespace OAI + +/-! # Shifting a vertical Gaussian integral inside an analytic strip -/ + +namespace Ostmann + +open Complex Filter MeasureTheory Set +open scoped Topology Interval + + theorem gaussian_strip_vertical_eq (f : ℂ → ℂ) (a b K : ℝ) (hab : a ≤ b) + (hf : ∀ z : ℂ, a ≤ z.re → z.re ≤ b → AnalyticAt ℂ f z) + (hb : ∀ x ∈ Icc a b, ∀ u : ℝ, ‖f ((x : ℂ) + u * I)‖ ≤ K * Real.exp (-(u ^ 2) / 2)) : + (∫ u : ℝ, f ((a : ℂ) + u * I)) = ∫ u : ℝ, f ((b : ℂ) + u * I) := by + let g : ℝ → ℝ := fun u => Real.exp (-(u ^ 2) / 2) + have hg : Integrable g := by + convert integrable_exp_neg_mul_sq (b := (1 / 2 : ℝ)) (by norm_num) using 1 + funext u + dsimp [g] + congr 1 + ring + have hlim : Tendsto g atTop (𝓝 0) := by + have hp : Tendsto (fun u : ℝ => u ^ 2 / 2) atTop atTop := + (tendsto_pow_atTop (by norm_num : (2 : ℕ) ≠ 0)).atTop_div_const (by norm_num) + simpa only [g, Function.comp_def, neg_div] using Real.tendsto_exp_neg_atTop_nhds_zero.comp hp + have hv (x : ℝ) (hx : x ∈ Icc a b) : Integrable (fun u : ℝ => f ((x : ℂ) + u * I)) := by + have hc : Continuous (fun u : ℝ => f ((x : ℂ) + u * I)) := by + apply continuous_iff_continuousAt.mpr + intro u + exact (hf _ (by simpa using hx.1) (by simpa using hx.2)).continuousAt.comp (by fun_prop) + apply (hg.const_mul K).mono' hc.aestronglyMeasurable + filter_upwards with u + exact hb x hx u + have hh (u : ℝ) : ‖∫ x in a..b, f ((x : ℂ) + u * I)‖ ≤ + (K * |b - a|) * g u := by + have h := intervalIntegral.norm_integral_le_of_norm_le_const + (fun x (hx : x ∈ Ι a b) => hb x + (by rw [uIoc_of_le hab] at hx; exact ⟨hx.1.le, hx.2⟩) u) + convert h using 1 + ring + have htop : Tendsto (fun u : ℝ => ∫ x in a..b, f ((x : ℂ) + u * I)) atTop (𝓝 0) := by + rw [tendsto_zero_iff_norm_tendsto_zero] + exact squeeze_zero (fun _ => norm_nonneg _) hh (by simpa using hlim.const_mul (K * |b - a|)) + have hbot : Tendsto (fun u : ℝ => ∫ x in a..b, f ((x : ℂ) + (-u) * I)) atTop (𝓝 0) := by + rw [tendsto_zero_iff_norm_tendsto_zero] + apply squeeze_zero (fun _ => norm_nonneg _) _ (by simpa using hlim.const_mul (K * |b - a|)) + intro u + simpa only [g, neg_sq, Complex.ofReal_neg] using hh (-u) + have hr := intervalIntegral_tendsto_integral (hv b ⟨hab, le_rfl⟩) + tendsto_neg_atTop_atBot tendsto_id + have hl := intervalIntegral_tendsto_integral (hv a ⟨le_rfl, hab⟩) + tendsto_neg_atTop_atBot tendsto_id + have hbd : Tendsto (fun T : ℝ => rectangleBoundaryIntegral f a b (-T) T) atTop + (𝓝 (I * (∫ u : ℝ, f ((b : ℂ) + u * I)) - I * ∫ u : ℝ, f ((a : ℂ) + u * I))) := by + simpa [rectangleBoundaryIntegral] using ((hbot.sub htop).add (hr.const_mul I)).sub (hl.const_mul I) + have hz : ∀ T : ℝ, rectangleBoundaryIntegral f a b (-T) T = 0 := by + intro T + apply rectangleBoundaryIntegral_eq_zero + intro z hz + have hre : z.re ∈ Icc a b := by simpa only [uIcc_of_le hab, mem_preimage] using hz.1 + exact hf z hre.1 hre.2 + have he : I * (∫ u : ℝ, f ((b : ℂ) + u * I)) - I * (∫ u : ℝ, f ((a : ℂ) + u * I)) = 0 := + tendsto_nhds_unique hbd (tendsto_const_nhds.congr (fun T => (hz T).symm)) + exact (mul_left_cancel₀ I_ne_zero (sub_eq_zero.mp he)).symm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GiantDensitySum.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GiantDensitySum.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0b380d2cc56af123e1b4b421572810e15c8e78f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GiantDensitySum.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.Construction.GiantLogMeasures + +namespace OAI + +/-! # Moving the finite residue average inside the common real integral -/ + +namespace Ostmann +open MeasureTheory +open scoped BigOperators Classical + +theorem double_integral_finset_sum {A : Type*} (S : Finset A) + (μ ν : Measure ℝ) (F : A → ℝ → ℝ → ℂ) + (hinner : ∀ a ∈ S, ∀ x, Integrable (F a x) ν) + (houter : ∀ a ∈ S, Integrable (fun x => ∫ y, F a x y ∂ν) μ) : + (∫ x, ∫ y, ∑ a ∈ S, F a x y ∂ν ∂μ) = + ∑ a ∈ S, ∫ x, ∫ y, F a x y ∂ν ∂μ := by + have hin (x : ℝ) : (∫ y, ∑ a ∈ S, F a x y ∂ν) = + ∑ a ∈ S, ∫ y, F a x y ∂ν := + integral_finsetSum S (fun a ha => hinner a ha x) + simp_rw [hin] + exact integral_finsetSum S houter + +/-- The complex residue coefficient is kept signed throughout this interchange. -/ +theorem bounded_density_pair_sum {A B : Type*} (S : Finset A) (T : Finset B) + (μ ν : Measure ℝ) [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (H : ℝ → ℝ → ℂ) (hH : Measurable (Function.uncurry H)) + (K : ℝ) (hK : ∀ x y, ‖H x y‖ ≤ K) + (α : A → ℝ → ℂ) (β : B → ℝ → ℂ) + (hα : ∀ a ∈ S, Measurable (α a)) (hβ : ∀ b ∈ T, Measurable (β b)) + (U V : ℝ) (hU : 0 ≤ U) (_hV : 0 ≤ V) + (hαU : ∀ a ∈ S, ∀ x, ‖α a x‖ ≤ U) (hβV : ∀ b ∈ T, ∀ x, ‖β b x‖ ≤ V) + (c : A → B → ℂ) : + (∑ a ∈ S, ∑ b ∈ T, + ∫ x, ∫ y, c a b * H x y * α a x * β b y ∂ν ∂μ) = + ∫ x, ∫ y, H x y * (∑ a ∈ S, ∑ b ∈ T, c a b * α a x * β b y) ∂ν ∂μ := by + have hK0 : 0 ≤ K := (norm_nonneg (H 0 0)).trans (hK 0 0) + let F := fun z : A × B => fun x y => c z.1 z.2 * H x y * α z.1 x * β z.2 y + have hf (z : A × B) (hz : z ∈ S.product T) : Measurable (Function.uncurry (F z)) := by + obtain ⟨ha, hb⟩ := Finset.mem_product.mp hz + exact ((measurable_const.mul hH).mul ((hα z.1 ha).comp measurable_fst)).mul + ((hβ z.2 hb).comp measurable_snd) + have hn (z : A × B) (hz : z ∈ S.product T) (x y : ℝ) : + ‖F z x y‖ ≤ ‖c z.1 z.2‖ * K * U * V := by + obtain ⟨ha, hb⟩ := Finset.mem_product.mp hz + dsimp only [F] + simp only [norm_mul] + apply mul_le_mul _ (hβV z.2 hb y) (norm_nonneg _) (mul_nonneg (by positivity) hU) + apply mul_le_mul _ (hαU z.1 ha x) (norm_nonneg _) (by positivity) + exact mul_le_mul_of_nonneg_left (hK x y) (norm_nonneg _) + have hp (z : A × B) (hz : z ∈ S.product T) : + Integrable (Function.uncurry (F z)) (μ.prod ν) := + ⟨(hf z hz).aestronglyMeasurable, + HasFiniteIntegral.of_bounded (Filter.Eventually.of_forall fun x => hn z hz x.1 x.2)⟩ + have hi (z : A × B) (hz : z ∈ S.product T) (x : ℝ) : Integrable (F z x) ν := + ⟨((hf z hz).comp (measurable_const.prodMk measurable_id)).aestronglyMeasurable, + HasFiniteIntegral.of_bounded (Filter.Eventually.of_forall fun y => hn z hz x y)⟩ + have hs := double_integral_finset_sum (S.product T) μ ν F hi (fun z hz => (hp z hz).integral_prod_left) + simp only [Finset.product_eq_sprod, Finset.sum_product, F] at hs + rw [← hs] + apply integral_congr_ae + filter_upwards [] with x + apply integral_congr_ae + filter_upwards [] with y + simp only [Finset.mul_sum] + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GiantHaarDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GiantHaarDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..bab4a2ab47a2504c6926206aa14bf44d69b3c537 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/GiantHaarDensity.lean @@ -0,0 +1,65 @@ +import OAI.NumberTheory.Ostmann.Supply.NaturalResidueAverage +import OAI.NumberTheory.Ostmann.ZeroDensity.RestrictedGiantDensity + +namespace OAI + +/-! # The exact Haar residue factors inside the real giant integral -/ + +namespace Ostmann +open scoped BigOperators Classical + +noncomputable def pageGiantWeight (P : PublishedProgressionInput) (Q q a : ℕ) (x : ℝ) : ℂ := + (pageMultiplier (fun a => pageCoefficient (pageAtModulus q (selectedPageZero P Q)) a) + (pageBeta (pageAtModulus q (selectedPageZero P Q))) x a : ℝ) + +noncomputable def correctedPrimePairAverage (P : PublishedProgressionInput) (Q q : ℕ) [NeZero q] + (c : ℕ → ℕ → ℂ) (x y : ℝ) : ℂ := + (Fintype.card ((ZMod q)ˣ × (ZMod q)ˣ) : ℂ)⁻¹ * + ∑ z : (ZMod q)ˣ × (ZMod q)ˣ, + c (z.1 : ZMod q).val (z.2 : ZMod q).val * + pageGiantWeight P Q q (z.1 : ZMod q).val x * pageGiantWeight P Q q (z.2 : ZMod q).val y + +noncomputable def correctedMixedPairAverage (P : PublishedProgressionInput) (Q q : ℕ) [NeZero q] + (c : ℕ → ℕ → ℂ) (y : ℝ) : ℂ := + (Fintype.card (ZMod q × (ZMod q)ˣ) : ℂ)⁻¹ * + ∑ z : ZMod q × (ZMod q)ˣ, + c z.1.val (z.2 : ZMod q).val * pageGiantWeight P Q q (z.2 : ZMod q).val y + +theorem selectedPrimeLogDensity_page (P : PublishedProgressionInput) (Q q a : ℕ) (x : ℝ) : + (selectedPrimeLogDensity P Q q a x : ℂ) = + pageGiantWeight P Q q a x / ((Nat.totient q : ℂ) * (x : ℂ)) := by + simp only [selectedPrimeLogDensity, primeLogDensity, pageGiantWeight, pageMultiplier, + Complex.ofReal_div, Complex.ofReal_sub, Complex.ofReal_one, Complex.ofReal_mul, Complex.ofReal_natCast] + +theorem prime_pair_density_haar (P : PublishedProgressionInput) (Q q : ℕ) [NeZero q] + (c : ℕ → ℕ → ℂ) (x y : ℝ) : + (∑ a ∈ reducedResidues q, ∑ b ∈ reducedResidues q, + c a b * (selectedPrimeLogDensity P Q q a x : ℂ) * (selectedPrimeLogDensity P Q q b y : ℂ)) = + correctedPrimePairAverage P Q q c x y / ((x : ℂ) * (y : ℂ)) := by + simp_rw [sum_reducedResidues_eq_units, selectedPrimeLogDensity_page] + simp only [correctedPrimePairAverage, Fintype.card_prod, ZMod.card_units_eq_totient, + Nat.cast_mul, Fintype.sum_prod_type, div_eq_mul_inv, mul_inv_rev, Finset.mul_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + ring + +theorem mixed_pair_density_haar (P : PublishedProgressionInput) (Q q : ℕ) [NeZero q] + (c : ℕ → ℕ → ℂ) (J x y : ℝ) : + (∑ a ∈ Finset.range q, ∑ b ∈ reducedResidues q, + c a b * (integerLogDensity q J x : ℂ) * (selectedPrimeLogDensity P Q q b y : ℂ)) = + (Real.exp (x - J) : ℂ) * correctedMixedPairAverage P Q q c y / (y : ℂ) := by + simp_rw [sum_range_eq_zmod, sum_reducedResidues_eq_units, selectedPrimeLogDensity_page] + simp only [correctedMixedPairAverage, Fintype.card_prod, ZMod.card, ZMod.card_units_eq_totient, + Nat.cast_mul, Fintype.sum_prod_type, integerLogDensity, Complex.ofReal_mul, Complex.ofReal_inv, Complex.ofReal_natCast, + div_eq_mul_inv, mul_inv_rev, Finset.mul_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HadamardPrimeBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HadamardPrimeBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..99f37597881109eb0b1e9d9cfcabb284920ab59d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HadamardPrimeBound.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedRealZeros +import OAI.NumberTheory.Ostmann.ZeroDensity.DirichletLogDerivativeBound + +namespace OAI + +/-! # Deriving signed prime-mass bounds from the published zero expansion -/ + +namespace Ostmann + +open scoped BigOperators + +theorem realCharacterZeroExpansion_anchor {χ : PrimitiveRealCharacter} {C : ℝ} + (Z : RealCharacterZeroExpansion χ C) (s₀ L A : ℝ) + (hs : 1 < s₀) (hs2 : s₀ ≤ 2) (hlog : Real.log χ.modulus ≤ L) + (hderiv : χ.logDerivative s₀ ≤ L + A) (herror : A + C ≤ L / 2) : + (∑' i, realZeroKernel (s₀ - (Z.zeros i).re) (Z.zeros i).im) ≤ 2 * L := by + have hh := (abs_le.mp (Z.hadamard s₀ hs hs2)).2 + linarith + +/-- The bounded Euler prime-power error has already been proved. Only the +Hadamard expansion remains an input to this implication. -/ +theorem exists_signed_prime_lower_of_zero_sum : + ∃ A : ℝ, 0 ≤ A ∧ ∀ (χ : PrimitiveRealCharacter) (C : ℝ) + (Z : RealCharacterZeroExpansion χ C) (s B : ℝ), 1 < s → s ≤ 2 → + (∑' i, realZeroKernel (s - (Z.zeros i).re) (Z.zeros i).im) ≤ B → + -B - C - A ≤ ∑' n, realPrimeTerm χ.character s n := by + obtain ⟨A, hA, heuler⟩ := exists_realPrimeSeries_error + refine ⟨A, hA, ?_⟩ + intro χ C Z s B hs hs2 hzeros + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have he := (heuler χ.modulus χ.character s hs).2 + change |(∑' n, realPrimeTerm χ.character s n) + χ.logDerivative s| ≤ A at he + have hh := (abs_le.mp (Z.hadamard s hs hs2)).1 + have hlog : 0 ≤ Real.log (χ.modulus : ℝ) := by + apply Real.log_nonneg + exact_mod_cast χ.positive + have he' := (abs_le.mp he).1 + linarith + +/-- Actual real exceptions in a finite zero family cost at most one Siegel +term when the region has at most one exceptional zero. -/ +theorem exceptional_zero_sum_bound (hSiegel : PublishedSiegelBound) + (ε : ℝ) (hε : 0 < ε) : ∃ K : ℝ, 0 < K ∧ + ∀ (χ : PrimitiveRealCharacter) (C : ℝ) (Z : RealCharacterZeroExpansion χ C) + (E : Finset ℕ) (s : ℝ), E.card ≤ 1 → 1 < s → + (∀ i ∈ E, (Z.zeros i).im = 0) → + (∑ i ∈ E, (s - (Z.zeros i).re)⁻¹) ≤ K * (χ.modulus : ℝ) ^ ε := by + obtain ⟨K, hK, hbound⟩ := hSiegel ε hε + refine ⟨K, hK, ?_⟩ + intro χ C Z E s hE hs hreal + have hf (i : ℕ) (hi : i ∈ E) : (s - (Z.zeros i).re)⁻¹ ≤ K * (χ.modulus : ℝ) ^ ε := by + have hβ := (Z.in_strip i).2 + have he := hbound (Z.realZero i (hreal i hi)) + change (1 - (Z.zeros i).re)⁻¹ ≤ K * (χ.modulus : ℝ) ^ ε at he + have hinv : (s - (Z.zeros i).re)⁻¹ ≤ (1 - (Z.zeros i).re)⁻¹ := + inv_anti₀ (by linarith) (by linarith) + exact hinv.trans he + calc + _ ≤ (E.card : ℝ) * (K * (χ.modulus : ℝ) ^ ε) := by + simpa only [nsmul_eq_mul] using Finset.sum_le_card_nsmul E _ _ hf + _ ≤ K * (χ.modulus : ℝ) ^ ε := by + have hER : (E.card : ℝ) ≤ 1 := by exact_mod_cast hE + have hnn : 0 ≤ K * (χ.modulus : ℝ) ^ ε := by positivity + simpa only [one_mul] using mul_le_mul_of_nonneg_right hER hnn + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HeightBudgets.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HeightBudgets.lean new file mode 100644 index 0000000000000000000000000000000000000000..adb95d3e3c555d1124342576d329ab051a3664c0 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HeightBudgets.lean @@ -0,0 +1,56 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.Scales +import OAI.NumberTheory.Ostmann.ZeroDensity.ZeroFreeWeights + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +namespace Ostmann.ZeroDensity + +theorem conductor_height_log_le (Q H : ℕ) (hQ : 0 < Q) (hH : 0 < H) : + Real.log (Q*H : ℕ) ≤ Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q (H : ℝ) := by + have hqp : (0 : ℝ) < Q := by exact_mod_cast hQ + have hhp : (0 : ℝ) < H := by exact_mod_cast hH + have hh := Real.log_le_log hhp (show (H : ℝ) ≤ H+6 by linarith) + unfold Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight + rw [abs_of_nonneg hhp.le, Nat.cast_mul, Real.log_mul hqp.ne' hhp.ne'] + linarith + +theorem density_height_log_le (Q H : ℕ) (hQ : 0 < Q) (hH : 0 < H) : + Real.log (Q^2*H : ℕ) ≤ 2*Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q (H : ℝ) := by + have hqp : (0 : ℝ) < Q := by exact_mod_cast hQ + have hhp : (0 : ℝ) < H := by exact_mod_cast hH + have hhn : 0 ≤ Real.log (H : ℝ) := Real.log_nonneg (by exact_mod_cast hH) + have hh := Real.log_le_log hhp (show (H : ℝ) ≤ H+6 by linarith) + unfold Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight + rw [abs_of_nonneg hhp.le, Nat.cast_mul, Nat.cast_pow, + Real.log_mul (by positivity) hhp.ne', Real.log_pow] + norm_num only [Nat.cast_ofNat] + linarith + +theorem density_height_gap_gain {c B L M Y : ℝ} (hc : 0 < c) (hB : 0 < B) + (hL : 0 < L) (hY : 0 < Y) (hM : Real.exp L ≤ M) + (hYB : Y ≤ B*L*Real.exp (9*L/10)) : + (c/(2*B))*Real.exp (L/10)/L ≤ M*(c/Y)/2 := by + have he : Real.exp L = Real.exp (L/10)*Real.exp (9*L/10) := by + rw [← Real.exp_add] + congr 1 + ring + calc + (c/(2*B))*Real.exp (L/10)/L = + Real.exp L*(c/(B*L*Real.exp (9*L/10)))/2 := by + rw [he] + field_simp + _ ≤ M*(c/Y)/2 := by + apply div_le_div_of_nonneg_right _ (by norm_num) + exact mul_le_mul hM (div_le_div_of_nonneg_left hc.le hY hYB) + (by positivity) (lt_of_lt_of_le (Real.exp_pos L) hM).le + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HighWeightDensityWave.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HighWeightDensityWave.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d51cc6b9ebadd1e8de21c7d625769df331d3256 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HighWeightDensityWave.lean @@ -0,0 +1,86 @@ +import OAI.NumberTheory.Ostmann.QuadraticCenter.HighWeightPeriodicMass + +namespace OAI + +/-! # High-weight decay for the original smoothed density waves -/ + +namespace Ostmann + +open Filter +open scoped BigOperators ComplexConjugate SchwartzMap + +theorem densityWave_pair_norm_le {p q : ℕ} [NeZero p] [NeZero q] + (g : ZMod p → ℂ) (h : ZMod q → ℂ) (a : (ZMod p)ˣ) (b : (ZMod q)ˣ) + (Φ Ψ : 𝓢(ℝ, ℂ)) (α β Y Z : ℝ) (n : ℕ) : + ‖densityWave g a Φ α Y n * conj (densityWave h b Ψ β Z n)‖ ≤ + (SchwartzMap.seminorm ℝ 0 0 Φ * SchwartzMap.seminorm ℝ 0 0 Ψ) * + ‖g ((a : ZMod p) * n) * conj (h ((b : ZMod q) * n))‖ := by + simp only [densityWave, norm_mul, Complex.norm_conj, norm_pow, + norm_realAdditivePhase, one_pow, mul_one] + calc + _ = (‖Φ ((n : ℝ) / Y)‖ * ‖Ψ ((n : ℝ) / Z)‖) * + (‖g ((a : ZMod p) * n)‖ * ‖h ((b : ZMod q) * n)‖) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_right + (mul_le_mul (Φ.norm_le_seminorm ℝ _) (Ψ.norm_le_seminorm ℝ _) + (norm_nonneg _) (by positivity)) (by positivity) + +theorem eventual_high_weight_density_wave (C : ℝ) : + ∀ᶠ T : ℝ in atTop, ∀ (U V : Finset ℕ) + (hpU : ∀ p ∈ U, p.Prime) (hpV : ∀ p ∈ V, p.Prime) + (N : ℕ) (S : Finset ℕ) (u : ℝ), + 2 * (U ∪ V).toList.prod ^ 2 ≤ N → (2 * N : ℝ) ≤ Real.exp (C * T) → + (∀ s ∈ S, Squarefree s) → (∀ s ∈ S, s ∈ Finset.Ioc N (2 * N)) → + (∀ s ∈ S, (U ∪ V).toList.prod.Coprime s) → + 2 ≤ u → u ≤ 4 * T ^ (1 / 1000000 : ℝ) → + (∀ s ∈ S, Real.exp (T ^ (9999999 / 10000000 : ℝ) / 200) < u ^ s.primeFactors.card) → + ∀ (D : ∀ p : ℕ, Finset (ZMod p)) (a : (ZMod U.toList.prod)ˣ) (b : (ZMod V.toList.prod)ˣ) + (Φ Ψ : 𝓢(ℝ, ℂ)) (α β Y Z : ℝ), + let : NeZero U.toList.prod := ⟨(prime_list_prod_pos _ (primeSet_list_prime U hpU)).ne'⟩ + let : NeZero V.toList.prod := ⟨(prime_list_prod_pos _ (primeSet_list_prime V hpV)).ne'⟩ + ‖∑ s ∈ S, (u ^ s.primeFactors.card : ℂ) * + (densityWave (densityFourier + (densityCRTList U.toList (primeSet_list_prime U hpU) (primeSet_list_coprime U hpU) D).value) + a Φ α Y s * + conj (densityWave (densityFourier + (densityCRTList V.toList (primeSet_list_prime V hpV) (primeSet_list_coprime V hpV) D).value) + b Ψ β Z s))‖ ≤ + (SchwartzMap.seminorm ℝ 0 0 Φ * SchwartzMap.seminorm ℝ 0 0 Ψ) * + (N * Real.exp (-10 * T ^ (9999999 / 10000000 : ℝ))) := by + filter_upwards [eventual_high_weight_periodic_mass C] with T hT + intro U V hpU hpV N S u hsize hcut hS hrange hcop hu huU hhigh D a b Φ Ψ α β Y Z _ _ + let hpUV : ∀ p ∈ U ∪ V, p.Prime := fun p hp => + (Finset.mem_union.mp hp).elim (hpU p) (hpV p) + let : NeZero (U ∪ V).toList.prod := ⟨(prime_list_prod_pos _ (primeSet_list_prime _ hpUV)).ne'⟩ + let g := densityFourier + (densityCRTList U.toList (primeSet_list_prime U hpU) (primeSet_list_coprime U hpU) D).value + let h := densityFourier + (densityCRTList V.toList (primeSet_list_prime V hpV) (primeSet_list_coprime V hpV) D).value + obtain ⟨F, hF, hmass⟩ := primeSet_density_correlation_mass_model U V hpU hpV D a b + have he (s : ℕ) : g ((a : ZMod U.toList.prod) * s) * + conj (h ((b : ZMod V.toList.prod) * s)) = F (s : ZMod (U ∪ V).toList.prod) := by + simpa only [Int.cast_natCast] using hF (s : ℤ) + have hdecay := hT N (U ∪ V).toList.prod S u (prime_list_prod_pos _ (primeSet_list_prime _ hpUV)) + hsize hcut hS hrange hcop hu huU hhigh F hmass + have hu0 : 0 ≤ u := by linarith + let B := SchwartzMap.seminorm ℝ 0 0 Φ * SchwartzMap.seminorm ℝ 0 0 Ψ + change ‖∑ s ∈ S, (u ^ s.primeFactors.card : ℂ) * + (densityWave g a Φ α Y s * conj (densityWave h b Ψ β Z s))‖ ≤ _ + calc + _ ≤ ∑ s ∈ S, ‖(u ^ s.primeFactors.card : ℂ) * + (densityWave g a Φ α Y s * conj (densityWave h b Ψ β Z s))‖ := norm_sum_le _ _ + _ ≤ ∑ s ∈ S, u ^ s.primeFactors.card * (B * ‖F (s : ZMod (U ∪ V).toList.prod)‖) := by + apply Finset.sum_le_sum + intro s hs + rw [norm_mul, norm_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hu0] + apply mul_le_mul_of_nonneg_left _ (by positivity) + simpa only [he, B] using densityWave_pair_norm_le g h a b Φ Ψ α β Y Z s + _ = B * ∑ s ∈ S, u ^ s.primeFactors.card * ‖F (s : ZMod (U ∪ V).toList.prod)‖ := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro s hs + ring + _ ≤ _ := mul_le_mul_of_nonneg_left hdecay (by dsimp [B]; positivity) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HighZeroTailBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HighZeroTailBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7571221ea2ea779ace165c4adda8043a21359dc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/HighZeroTailBound.lean @@ -0,0 +1,77 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteLaplaceDensity + +namespace OAI + +/-! # Rapid Mellin decay summed against an ordinary zero count -/ + +namespace Ostmann +open scoped Classical BigOperators + +theorem zero_height_log_count {ι : Type*} (S : Finset ι) (h : ι → ℝ) + (Q K : ℝ) (hQ : 1 ≤ Q) (hK : 0 ≤ K) (hh : ∀ i ∈ S, 0 ≤ h i) + (hcount : ∀ t : ℝ, 0 ≤ t → + ((S.filter (fun i => h i ≤ t)).card : ℝ) ≤ K * (t + 1) * Real.log (Q * (t + 2))) : + ∀ s : ℝ, 0 ≤ s → + ((S.filter (fun i => Real.log (1 + h i) ≤ s)).card : ℝ) ≤ + (2 * K * (Real.log Q + 3)) * Real.exp (2 * s) := by + intro s hs + have hQp : 0 < Q := by linarith + have he : 1 ≤ Real.exp s := Real.one_le_exp hs + have hlogQ : 0 ≤ Real.log Q := Real.log_nonneg hQ + have hsub : S.filter (fun i => Real.log (1 + h i) ≤ s) ⊆ + S.filter (fun i => h i ≤ Real.exp s) := by + intro i hi + obtain ⟨hiS, hi⟩ := Finset.mem_filter.mp hi + refine Finset.mem_filter.mpr ⟨hiS, ?_⟩ + have hpos : 0 < 1 + h i := by linarith [hh i hiS] + have hex := (Real.log_le_iff_le_exp hpos).mp hi + linarith + have hlog : Real.log (Q * (Real.exp s + 2)) ≤ (Real.log Q + 3) * Real.exp s := by + rw [Real.log_mul hQp.ne' (by positivity : Real.exp s + 2 ≠ 0)] + have he2 : 3 ≤ Real.exp (2 : ℝ) := by linarith [Real.add_one_le_exp (2 : ℝ)] + have hinside : Real.exp s + 2 ≤ Real.exp (s + 2) := by + rw [Real.exp_add] + nlinarith + have hl := Real.log_le_log (by positivity : 0 < Real.exp s + 2) hinside + rw [Real.log_exp] at hl + have hq := mul_le_mul_of_nonneg_left he (by linarith : 0 ≤ Real.log Q + 2) + have hs' := Real.add_one_le_exp s + nlinarith + have hlog0 : 0 ≤ Real.log (Q * (Real.exp s + 2)) := + Real.log_nonneg (by nlinarith) + calc + _ ≤ ((S.filter (fun i => h i ≤ Real.exp s)).card : ℝ) := by + exact_mod_cast Finset.card_le_card hsub + _ ≤ K * (Real.exp s + 1) * Real.log (Q * (Real.exp s + 2)) := + hcount (Real.exp s) (Real.exp_nonneg _) + _ ≤ (K * (2 * Real.exp s)) * ((Real.log Q + 3) * Real.exp s) := by + apply mul_le_mul + · exact mul_le_mul_of_nonneg_left (by linarith) hK + · exact hlog + · exact hlog0 + · positivity + _ = (2 * K * (Real.log Q + 3)) * Real.exp (2 * s) := by + rw [show 2 * s = s + s by ring, Real.exp_add] + ring + +theorem finite_high_zero_tail_bound {ι : Type*} (S : Finset ι) (h : ι → ℝ) + (Q K T : ℝ) (hQ : 1 ≤ Q) (hK : 0 ≤ K) (hT : 0 ≤ T) + (hh : ∀ i ∈ S, T ≤ h i) + (hcount : ∀ t : ℝ, 0 ≤ t → + ((S.filter (fun i => h i ≤ t)).card : ℝ) ≤ K * (t + 1) * Real.log (Q * (t + 2))) : + (∑ i ∈ S, Real.exp (-8 * Real.log (1 + h i))) ≤ + 2 * (2 * K * (Real.log Q + 3)) ^ 2 * Real.exp (-4 * Real.log (1 + T)) := by + have hh0 (i) (hi : i ∈ S) : 0 ≤ h i := hT.trans (hh i hi) + have hlogQ : 0 ≤ Real.log Q := Real.log_nonneg hQ + have hu : 0 ≤ Real.log (1 + T) := Real.log_nonneg (by linarith) + have hh' := finite_laplace_density_bound S (fun i => Real.log (1 + h i)) 2 + (2 * K * (Real.log Q + 3)) 8 (Real.log (1 + T)) (by norm_num) (by positivity) + (by norm_num) hu + (fun i hi => Real.log_le_log (by linarith : 0 < 1 + T) (by linarith [hh i hi])) + (zero_height_log_count S h Q K hQ hK hh0 hcount) + rw [show -(8 * Real.log (1 + T)) / 2 = -4 * Real.log (1 + T) by ring] at hh' + exact hh' + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ImprimitiveEulerBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ImprimitiveEulerBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..2dddd146ae717a64d8c21a1a37b07888f09ff87e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ImprimitiveEulerBound.lean @@ -0,0 +1,111 @@ +import OAI.NumberTheory.Ostmann.Preliminaries.PrimeDivisors +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedLogDerivative + +namespace OAI + +/-! # The finite Euler-factor cost of changing a character's level -/ + +namespace Ostmann + +open Complex Filter +open scoped BigOperators Topology + +noncomputable def imprimitiveEulerFactor {q : ℕ} (χ : DirichletCharacter ℂ q) + (p : ℕ) (s : ℂ) : ℂ := 1 - χ p * (p : ℂ) ^ (-s) + +noncomputable def imprimitiveEulerProduct {q : ℕ} (χ : DirichletCharacter ℂ q) + (N : ℕ) (s : ℂ) : ℂ := ∏ p ∈ N.primeFactors, imprimitiveEulerFactor χ p s + +theorem euler_tail_norm_le_half {q : ℕ} (χ : DirichletCharacter ℂ q) + {p : ℕ} (hp : p.Prime) (s : ℂ) (hs : 1 ≤ s.re) : + ‖χ p * (p : ℂ) ^ (-s)‖ ≤ 1 / 2 := by + have hp1 : (1 : ℝ) ≤ p := by exact_mod_cast hp.one_lt.le + have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hp.two_le + calc + _ ≤ ‖(p : ℂ) ^ (-s)‖ := by rw [norm_mul]; exact mul_le_of_le_one_left (norm_nonneg _) (χ.norm_le_one _) + _ = (p : ℝ) ^ (-s.re) := by rw [Complex.norm_natCast_cpow_of_pos hp.pos]; simp + _ ≤ (p : ℝ) ^ (-1 : ℝ) := Real.rpow_le_rpow_of_exponent_le hp1 (by linarith) + _ = (p : ℝ)⁻¹ := Real.rpow_neg_one _ + _ ≤ 1 / 2 := by simpa using inv_anti₀ (by norm_num : (0 : ℝ) < 2) hp2 + +theorem imprimitiveEulerFactor_ne_zero {q : ℕ} (χ : DirichletCharacter ℂ q) + {p : ℕ} (hp : p.Prime) (s : ℂ) (hs : 1 ≤ s.re) : imprimitiveEulerFactor χ p s ≠ 0 := by + intro h + have hh := euler_tail_norm_le_half χ hp s hs + have he : χ p * (p : ℂ) ^ (-s) = 1 := (sub_eq_zero.mp h).symm + rw [he, norm_one] at hh + norm_num at hh + +theorem imprimitiveEulerFactor_hasDeriv {q : ℕ} (χ : DirichletCharacter ℂ q) + {p : ℕ} (hp : p.Prime) (s : ℂ) : + HasDerivAt (imprimitiveEulerFactor χ p) + ((χ p * (p : ℂ) ^ (-s)) * Complex.log (p : ℂ)) s := by + have hn : (p : ℂ) ≠ 0 := by exact_mod_cast hp.ne_zero + have hh := (((hasDerivAt_id s).neg).const_cpow (.inl hn)).const_mul (χ p) |>.const_sub 1 + change HasDerivAt (fun x : ℂ => 1 - χ p * (p : ℂ) ^ (-x)) _ s + convert hh using 1 <;> dsimp + ring + +theorem imprimitiveEulerFactor_logDeriv_bound {q : ℕ} (χ : DirichletCharacter ℂ q) + {p : ℕ} (hp : p.Prime) (s : ℂ) (hs : 1 ≤ s.re) : + ‖logDeriv (imprimitiveEulerFactor χ p) s‖ ≤ Real.log p := by + let u := χ p * (p : ℂ) ^ (-s) + have hu : ‖u‖ ≤ 1 / 2 := euler_tail_norm_le_half χ hp s hs + have hden : 0 < ‖1 - u‖ := norm_pos_iff.mpr (imprimitiveEulerFactor_ne_zero χ hp s hs) + have hcomp : ‖u‖ ≤ ‖1 - u‖ := by + have hh := norm_sub_norm_le (1 : ℂ) u + rw [norm_one] at hh + linarith + have hlog : ‖Complex.log (p : ℂ)‖ = Real.log p := by + rw [← Complex.ofReal_natCast, ← Complex.ofReal_log (Nat.cast_nonneg p), Complex.norm_real, + Real.norm_eq_abs, abs_of_nonneg (Real.log_nonneg (by exact_mod_cast hp.one_lt.le))] + rw [logDeriv_apply, (imprimitiveEulerFactor_hasDeriv χ hp s).deriv, norm_div, norm_mul, hlog] + apply (div_le_iff₀ hden).mpr + change ‖u‖ * Real.log p ≤ Real.log p * ‖1 - u‖ + have hplog : 0 ≤ Real.log (p : ℝ) := + Real.log_nonneg (show (1 : ℝ) ≤ p by exact_mod_cast hp.one_lt.le) + nlinarith [mul_le_mul_of_nonneg_right hcomp hplog] + +theorem imprimitiveEulerProduct_logDeriv_bound {q : ℕ} (χ : DirichletCharacter ℂ q) + (N : ℕ) (hN : 0 < N) (s : ℂ) (hs : 1 ≤ s.re) : + ‖logDeriv (imprimitiveEulerProduct χ N) s‖ ≤ Real.log N := by + have he : logDeriv (imprimitiveEulerProduct χ N) s = + ∑ p ∈ N.primeFactors, logDeriv (imprimitiveEulerFactor χ p) s := by + unfold imprimitiveEulerProduct + rw [logDeriv_fun_prod] + · intro p hp + exact imprimitiveEulerFactor_ne_zero χ (Nat.prime_of_mem_primeFactors hp) s hs + · intro p hp + exact (imprimitiveEulerFactor_hasDeriv χ (Nat.prime_of_mem_primeFactors hp) s).differentiableAt + rw [he] + apply (norm_sum_le _ _).trans + apply (Finset.sum_le_sum (fun p hp => + imprimitiveEulerFactor_logDeriv_bound χ (Nat.prime_of_mem_primeFactors hp) s hs)).trans + exact sum_log_prime_divisors_le _ hN (fun _ hp => Nat.prime_of_mem_primeFactors hp) + (fun _ hp => Nat.dvd_of_mem_primeFactors hp) + +/-- Passing from a primitive character to any multiple level costs at most +`log N` in its logarithmic derivative, uniformly throughout Re(s)>1. -/ +theorem logDeriv_changeLevel_bound {q N : ℕ} [NeZero q] [NeZero N] + (χ : DirichletCharacter ℂ q) (hN : q ∣ N) (s : ℂ) (hs : 1 < s.re) : + ‖logDeriv (DirichletCharacter.LFunction (DirichletCharacter.changeLevel hN χ)) s - + logDeriv (DirichletCharacter.LFunction χ) s‖ ≤ Real.log N := by + have he : DirichletCharacter.LFunction (DirichletCharacter.changeLevel hN χ) =ᶠ[𝓝 s] + (DirichletCharacter.LFunction χ) * imprimitiveEulerProduct χ N := by + filter_upwards [(isOpen_lt continuous_const Complex.continuous_re).mem_nhds hs] with z hz + exact DirichletCharacter.LFunction_changeLevel hN χ (.inr (by intro h; simp [h] at hz)) + have hprod : imprimitiveEulerProduct χ N s ≠ 0 := Finset.prod_ne_zero_iff.mpr + (fun p hp => imprimitiveEulerFactor_ne_zero χ (Nat.prime_of_mem_primeFactors hp) s hs.le) + have hprodD : DifferentiableAt ℂ (imprimitiveEulerProduct χ N) s := + DifferentiableAt.fun_finsetProd (fun p hp => + (imprimitiveEulerFactor_hasDeriv χ (Nat.prime_of_mem_primeFactors hp) s).differentiableAt) + have hl := (logDeriv_congr_nhds he).self_of_nhds + rw [logDeriv_mul s (DirichletCharacter.LFunction_ne_zero_of_one_le_re χ + (.inr (by intro h; simp [h] at hs)) hs.le) hprod + (DirichletCharacter.differentiableAt_LFunction χ s (.inl (by intro h; simp [h] at hs))) hprodD] at hl + rw [hl, add_sub_cancel_left] + exact imprimitiveEulerProduct_logDeriv_bound χ N (NeZero.pos N) s hs.le + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InducedCharacterRieszDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InducedCharacterRieszDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..ac29eced68d4651fae041bbd16c35a3a35656435 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InducedCharacterRieszDecay.lean @@ -0,0 +1,57 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimitiveRieszErrorDecay +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszDecay + +namespace OAI + +/-! # Uniform Riesz estimates for all characters at the ambient modulus -/ + +namespace Ostmann + +open Filter + +noncomputable def reducedRieszMain (q : ℕ) (e : Option PrimitiveComplexCharacter) (X : ℝ) : ℂ := + match e with + | none => (X / 2 : ℝ) + | some χ => canonicalCharacterRieszTerm χ q X + +theorem induced_character_riesz_decay : ∃ d : ℝ, 0 < d ∧ + ∀ᶠ X : ℝ in atTop, ∀ q : ℕ, 1 ≤ q → + (q : ℝ) ≤ Real.exp (Real.sqrt (Real.log X)) → + ∀ [NeZero q] (χ : DirichletCharacter ℂ q), + ‖rieszTwistMean (fun n => χ (n : ZMod q)) X - + reducedRieszMain q (primitiveCharacterReduction χ) X‖ ≤ + 4 * X * Real.exp (-d * Real.sqrt (Real.log X)) := by + obtain ⟨dp, hdp, hp⟩ := principal_riesz_sqrt_decay + obtain ⟨dc, hdc, hc⟩ := character_riesz_canonical_sqrt_decay + let d := min dp dc + have hd : 0 < d := lt_min hdp hdc + refine ⟨d, hd, ?_⟩ + filter_upwards [hp, hc, primitive_riesz_error_decay d hd, + eventually_ge_atTop (1 : ℝ)] with X hprincipal hcharacter herror hX + intro q hq hqX inst χ + have hXp : 0 < X := by linarith + have hdec (D : ℝ) (hD : d ≤ D) : + 3 * X * Real.exp (-D * Real.sqrt (Real.log X)) ≤ + 3 * X * Real.exp (-d * Real.sqrt (Real.log X)) := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Real.exp_le_exp.mpr + nlinarith [Real.sqrt_nonneg (Real.log X)] + have hr : ‖reducedRieszMean (primitiveCharacterReduction χ) X - + reducedRieszMain q (primitiveCharacterReduction χ) X‖ ≤ + 3 * X * Real.exp (-d * Real.sqrt (Real.log X)) := by + cases he : primitiveCharacterReduction χ with + | none => + exact hprincipal.trans (hdec dp (min_le_left _ _)) + | some ρ => + exact (hcharacter q hq hqX ρ (primitiveReduction_divides χ ρ he)).trans + (hdec dc (min_le_right _ _)) + have he := (rieszTwistMean_primitive_comparison χ X hX).trans (herror q hqX) + have ht := norm_sub_le_norm_sub_add_norm_sub + (rieszTwistMean (fun n => χ (n : ZMod q)) X) + (reducedRieszMean (primitiveCharacterReduction χ) X) + (reducedRieszMain q (primitiveCharacterReduction χ) X) + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InfiniteHighZeroBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InfiniteHighZeroBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..fdfa72c4c49575b5cbefafd28eacdcc778150be7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InfiniteHighZeroBound.lean @@ -0,0 +1,52 @@ +import Mathlib.Topology.Algebra.InfiniteSum.Real +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothZeroTermBounds + +namespace OAI + +/-! # The complete high-zero tail over a finite character family -/ + +namespace Ostmann +open scoped Classical BigOperators + +theorem high_smooth_zero_tsum_bound {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : PublishedSmoothExplicitFormula Z) (Q : ℕ) (hQ : 1 ≤ Q) + (F : Finset PrimitiveComplexCharacter) (hF : ∀ χ ∈ F, χ.modulus ≤ Q) + (T X : ℝ) (hT : 0 ≤ T) (hX : 1 ≤ X) : + (∑ χ ∈ F, ∑' i : ℕ, if T ≤ |((Z χ).zeros i).im| then + ‖smoothZeroTerm Z χ X i‖ else 0) ≤ + (X * P.mellinConstant) * + (2 * (2 * (P.zeroCountConstant * (Q : ℝ) ^ 2) * (Real.log Q + 3)) ^ 2 * + Real.exp (-4 * Real.log (1 + T))) := by + let f : (Σ _χ : PrimitiveComplexCharacter, ℕ) → ℝ := fun z => + if z.1 ∈ F ∧ T ≤ |((Z z.1).zeros z.2).im| then ‖smoothZeroTerm Z z.1 X z.2‖ else 0 + have hf : 0 ≤ f := by intro z; dsimp [f]; split_ifs <;> positivity + have hb (S : Finset (Σ _χ : PrimitiveComplexCharacter, ℕ)) : + (∑ z ∈ S, f z) ≤ + (X * P.mellinConstant) * + (2 * (2 * (P.zeroCountConstant * (Q : ℝ) ^ 2) * (Real.log Q + 3)) ^ 2 * + Real.exp (-4 * Real.log (1 + T))) := by + let G := S.filter (fun z => z.1 ∈ F ∧ T ≤ |((Z z.1).zeros z.2).im|) + have he : (∑ z ∈ S, f z) = ∑ z ∈ G, ‖smoothZeroTerm Z z.1 X z.2‖ := by + simp only [G, Finset.sum_filter, f] + rw [he] + exact finite_high_smooth_zero_bound P Q hQ F hF G + (fun z hz => (Finset.mem_filter.mp hz).2.1) T X hT hX + (fun z hz => (Finset.mem_filter.mp hz).2.2) + have hsum := summable_of_sum_le hf hb + have hbound := Real.tsum_le_of_sum_le hf hb + rw [hsum.tsum_sigma] at hbound + have houter : (∑' χ, ∑' i, f ⟨χ, i⟩) = ∑ χ ∈ F, ∑' i, f ⟨χ, i⟩ := by + apply tsum_eq_sum + intro χ hχ + simp only [f, hχ, false_and, ite_false, tsum_zero] + rw [houter] at hbound + convert hbound using 1 + apply Finset.sum_congr rfl + intro χ hχ + apply tsum_congr + intro i + simp only [f, hχ, true_and] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InitialIntervalZero.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InitialIntervalZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..182e24bd5e1bb8cc5154316909630d5467f3d028 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InitialIntervalZero.lean @@ -0,0 +1,29 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.AtomIntervalRanges + +namespace OAI + +/-! # A nontrivial original interval removes the initial zero frequency -/ +namespace Ostmann +open scoped Classical + +theorem fullAtomTransferWeight_zero_of_interval {I : Type*} [Fintype I] + (role : I → CopyScheduleRole) (lo hi : I → ℕ) + (childBound pivotBound : ℕ → ℕ) (leaf : ScheduleAtomState role → ℤ → ℂ) + (i : I) (hi₁ : 1 < lo i) (x : CopyScheduleAtoms role 0 → ℕ) : + fullAtomTransferWeight role childBound pivotBound (atomIntervalRanges role lo hi) + leaf 0 x (0 : ℤ) = 0 := by + by_contra h + have hu := (fullAtomTransferWeight_top_support role childBound pivotBound + (atomIntervalRanges role lo hi) leaf 0 x (0 : ℤ) h).2 ⟨i, trivial⟩ + have he : x ⟨i, trivial⟩ = 1 := by + simpa only [frequencyRoot, Int.natAbs_zero, Nat.coprime_zero_right] using hu + have hr := (atomIntervalRanges_holds_iff role lo hi 0 x).mp + (fun r hr => fullAtomTransferWeight_top_range role childBound pivotBound + (atomIntervalRanges role lo hi) leaf 0 x (0 : ℤ) h r hr) + have hl := (hr ⟨i, trivial⟩).1 + change lo i ≤ x ⟨i, trivial⟩ at hl + omega + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/IntegerProgressionPartition.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/IntegerProgressionPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..cdd00e3595b29fe465d6f28c3ebe09cb36c740f6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/IntegerProgressionPartition.lean @@ -0,0 +1,40 @@ +import Mathlib.Logic.Equiv.Fin.Basic +import OAI.NumberTheory.Ostmann.Characters.OneSidedCharacterBound + +namespace OAI + +/-! # Exact residue-progressions in a padded integer interval -/ + +namespace Ostmann + +/-- Row/column transposition lists each residue class in increasing order. -/ +def integerProgressionPartition (Q K : ℕ) : Fin (K * Q) ≃ Σ _ : Fin Q, Fin K := + finProdFinEquiv.symm.trans ((Equiv.prodComm (Fin K) (Fin Q)).trans + (Equiv.sigmaEquivProd (Fin Q) (Fin K)).symm) + +theorem integerProgressionPartition_value (Q K a : ℕ) (r : Fin Q) (j : Fin K) : + a + ((integerProgressionPartition Q K).symm ⟨r, j⟩).val = (a + r.val) + Q * j.val := by + change a + (r.val + Q * j.val) = _ + omega + +/-- An interval can be padded by at most one modulus to get this exact +rectangular decomposition; original support indicators can retain its endpoints. -/ +theorem integerProgressionPartition_padding (N Q : ℕ) (hQ : 0 < Q) : + N < (N / Q + 1) * Q ∧ (N / Q + 1) * Q ≤ N + Q := by + have hmod := Nat.mod_lt N hQ + have he : N / Q * Q + N % Q = N := by + simpa only [Nat.mul_comm] using Nat.div_add_mod N Q + rw [Nat.add_mul, one_mul] + omega + +/-- Reindexing the original integer sum introduces neither missing boundary +integers nor multiplicity. -/ +theorem integerProgressionPartition_sum {M : Type*} [AddCommMonoid M] + (Q K : ℕ) (f : Fin (K * Q) → M) : + (∑ x, f x) = ∑ r : Fin Q, ∑ j : Fin K, + f ((integerProgressionPartition Q K).symm ⟨r, j⟩) := by + rw [← (integerProgressionPartition Q K).symm.sum_comp f, Fintype.sum_sigma] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/IntegratedThetaMain.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/IntegratedThetaMain.lean new file mode 100644 index 0000000000000000000000000000000000000000..c20e130ab16bc443c2b9d96854be0b2a0904bc31 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/IntegratedThetaMain.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ThetaMainTerm +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszSmoothRecovery + +namespace OAI + +/-! # The integrated principal and exceptional main term for positive unsmoothing -/ + +namespace Ostmann + +noncomputable def integratedThetaMain (φ χ β x : ℝ) : ℝ := + (x ^ 2 / 2 - χ * x ^ (β + 1) / (β * (β + 1))) / φ + +theorem hasDerivAt_integratedThetaMain (φ χ β : ℝ) (hβ : 0 < β) + {x : ℝ} (hx : 0 < x) : + HasDerivAt (integratedThetaMain φ χ β) (thetaMainTerm φ χ β x) x := by + have h := (((hasDerivAt_id x).pow 2).div_const 2).sub + (((Real.hasDerivAt_rpow_const (p := β + 1) (.inl hx.ne')).const_mul χ).div_const (β * (β + 1))) + have h := h.div_const φ + norm_num only [Nat.reduceSub, pow_one, mul_one, id_eq] at h + change HasDerivAt (integratedThetaMain φ χ β) + ((2 * x / 2 - χ * ((β + 1) * x ^ (β + 1 - 1)) / (β * (β + 1))) / φ) x at h + have he : (2 * x / 2 - χ * ((β + 1) * x ^ (β + 1 - 1)) / (β * (β + 1))) / φ = + thetaMainTerm φ χ β x := by + rw [show β + 1 - 1 = β by ring] + unfold thetaMainTerm + congr 1 + field_simp + exact he ▸ h + +theorem thetaMainDensity_abs_le_two (φ χ β x : ℝ) + (hφ : 1 ≤ φ) (hχ : |χ| ≤ 1) (hβ : β ≤ 1) (hx : 1 ≤ x) : + |thetaMainDensity φ χ β x| ≤ 2 := by + have hφp : 0 < φ := by linarith + have hp : 0 ≤ x ^ (β - 1) := Real.rpow_nonneg (by linarith) _ + have hpow : x ^ (β - 1) ≤ 1 := by + have hh := Real.rpow_le_rpow_of_exponent_le hx (show β - 1 ≤ 0 by linarith) + simpa using hh + have hmul : |χ * x ^ (β - 1)| ≤ 1 := by + rw [abs_mul, abs_of_nonneg hp] + exact (mul_le_mul hχ hpow hp zero_le_one).trans_eq (one_mul 1) + have hnum : |1 - χ * x ^ (β - 1)| ≤ 2 := by + have hh := abs_sub (1 : ℝ) (χ * x ^ (β - 1)) + norm_num only [abs_one] at hh + linarith + rw [thetaMainDensity, abs_div, abs_of_pos hφp] + apply (div_le_iff₀ hφp).mpr + linarith + +theorem integratedThetaMain_remainder_pair (φ χ β x h : ℝ) + (hφ : 1 ≤ φ) (hχ : |χ| ≤ 1) (hβ : 0 < β) (hβ1 : β ≤ 1) + (hh : 0 < h) (hx : 1 ≤ x - h) : + |integratedThetaMain φ χ β (x + h) - integratedThetaMain φ χ β x - + h * thetaMainTerm φ χ β x| ≤ 2 * h ^ 2 ∧ + |integratedThetaMain φ χ β x - integratedThetaMain φ χ β (x - h) - + h * thetaMainTerm φ χ β x| ≤ 2 * h ^ 2 := by + apply smooth_main_remainder_pair (integratedThetaMain φ χ β) (thetaMainTerm φ χ β) + (thetaMainDensity φ χ β) x h hh + · intro t ht + exact hasDerivAt_integratedThetaMain φ χ β hβ (by have := ht.1; linarith) + · intro t ht + exact hasDerivAt_thetaMainTerm φ χ β hβ.ne' (by have := ht.1; linarith) + · intro t ht + exact thetaMainDensity_abs_le_two φ χ β t hφ hχ hβ1 (hx.trans ht.1) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/IntervalDensityTree.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/IntervalDensityTree.lean new file mode 100644 index 0000000000000000000000000000000000000000..c77f022b3fbe0d0b03796ff9f39fa4117e8f07b8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/IntervalDensityTree.lean @@ -0,0 +1,126 @@ +import Mathlib.Algebra.BigOperators.Fin +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Algebra.BigOperators.Ring.Finset +import Mathlib.Algebra.BigOperators.Field +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityIncrementTree + +namespace OAI + +/-! # Equal subdivisions of actual intervals + +Cumulative mass functions give exact averaging identities on the interval +partition, so the density-increment tree applies to concrete interval masses. +-/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable def intervalNode {M : ℕ} (a L : ℝ) (w : List (Fin M)) : ℝ × ℝ := + w.foldl (fun (s : ℝ × ℝ) (i : Fin M) => (s.1 + (i : ℝ) * (s.2 / M), s.2 / M)) (a, L) + +noncomputable def intervalNodeDensity {M : ℕ} (φ : ℝ → ℝ) (a L : ℝ) + (w : List (Fin M)) : ℝ := + let s := intervalNode a L w + (φ (s.1 + s.2) - φ s.1) / s.2 + +theorem intervalNode_nil {M : ℕ} (a L : ℝ) : + intervalNode (M := M) a L [] = (a, L) := rfl + +theorem intervalNode_child {M : ℕ} (a L : ℝ) (w : List (Fin M)) (i : Fin M) : + intervalNode a L (w ++ [i]) = + ((intervalNode a L w).1 + (i : ℝ) * ((intervalNode a L w).2 / M), + (intervalNode a L w).2 / M) := by + simp only [intervalNode, List.foldl_append, List.foldl_cons, List.foldl_nil] + +theorem intervalNode_width_pos {M : ℕ} (hM : 0 < M) (a L : ℝ) (hL : 0 < L) + (w : List (Fin M)) : 0 < (intervalNode a L w).2 := by + induction w generalizing a L with + | nil => exact hL + | cons i w ih => + change 0 < (intervalNode (a + (i : ℝ) * (L / M)) (L / M) w).2 + exact ih _ _ (div_pos hL (by exact_mod_cast hM)) + +private theorem equal_interval_mass_sum {M : ℕ} (hM : 0 < M) + (φ : ℝ → ℝ) (a L : ℝ) : + (∑ i : Fin M, + (φ (a + ((i : ℝ) + 1) * (L / M)) - φ (a + (i : ℝ) * (L / M)))) = + φ (a + L) - φ a := by + have hh := Finset.sum_range_sub (fun j : ℕ => φ (a + (j : ℝ) * (L / M))) M + rw [Finset.sum_range] at hh + have he : (M : ℝ) * (L / M) = L := by + have hm : (M : ℝ) ≠ 0 := by exact_mod_cast hM.ne' + field_simp + simpa only [Nat.cast_add, Nat.cast_one, Nat.cast_zero, zero_mul, add_zero, he] using hh + +theorem intervalNodeDensity_average {M : ℕ} (hM : 0 < M) (φ : ℝ → ℝ) + (a L : ℝ) (hL : 0 < L) (w : List (Fin M)) : + (∑ i, intervalNodeDensity φ a L (w ++ [i])) = M * intervalNodeDensity φ a L w := by + have hW := intervalNode_width_pos hM a L hL w + have hM0 : (M : ℝ) ≠ 0 := by exact_mod_cast hM.ne' + simp only [intervalNodeDensity, intervalNode_child] + have he (i : Fin M) : + (intervalNode a L w).1 + (i : ℝ) * ((intervalNode a L w).2 / M) + + (intervalNode a L w).2 / M = + (intervalNode a L w).1 + ((i : ℝ) + 1) * ((intervalNode a L w).2 / M) := by ring + simp_rw [he] + rw [← Finset.sum_div, equal_interval_mass_sum hM] + field_simp + +theorem intervalNode_width {M : ℕ} (_hM : 0 < M) (a L : ℝ) (w : List (Fin M)) : + (intervalNode a L w).2 = L / (M : ℝ) ^ w.length := by + induction w generalizing a L with + | nil => simp [intervalNode] + | cons i w ih => + change (intervalNode (a + (i : ℝ) * (L / M)) (L / M) w).2 = _ + rw [ih, List.length_cons, pow_succ] + ring + +theorem intervalNode_bounds {M : ℕ} (hM : 0 < M) (a L : ℝ) (hL : 0 ≤ L) + (w : List (Fin M)) : + a ≤ (intervalNode a L w).1 ∧ + (intervalNode a L w).1 + (intervalNode a L w).2 ≤ a + L := by + induction w generalizing a L with + | nil => exact ⟨le_rfl, le_rfl⟩ + | cons i w ih => + have hMr : (0 : ℝ) < M := by exact_mod_cast hM + have hi0 : (0 : ℝ) ≤ i := Nat.cast_nonneg _ + have hiM : (i : ℝ) + 1 ≤ M := by exact_mod_cast i.isLt + have hq : 0 ≤ L / M := div_nonneg hL hMr.le + have hbound := mul_le_mul_of_nonneg_right hiM hq + have he : (M : ℝ) * (L / M) = L := by field_simp + rw [he] at hbound + change a ≤ (intervalNode (a + (i : ℝ) * (L / M)) (L / M) w).1 ∧ _ + have h := ih (a + (i : ℝ) * (L / M)) (L / M) hq + constructor + · exact (le_add_of_nonneg_right (mul_nonneg hi0 hq)).trans h.1 + · change (intervalNode (a + (i : ℝ) * (L / M)) (L / M) w).1 + + (intervalNode (a + (i : ℝ) * (L / M)) (L / M) w).2 ≤ a + L + linarith [h.2] + +theorem intervalNode_width_lower {M : ℕ} (hM : 0 < M) (a L : ℝ) (hL : 0 ≤ L) + (H : ℕ) (w : List (Fin M)) (hw : w.length ≤ H) : + L / (M : ℝ) ^ H ≤ (intervalNode a L w).2 := by + rw [intervalNode_width hM] + apply div_le_div_of_nonneg_left hL (by positivity) + exact pow_le_pow_right₀ (by exact_mod_cast hM : (1 : ℝ) ≤ M) hw + +/-- A concrete cumulative mass function has a rich interval node once its +root density is positive and all relevant interval densities are bounded. -/ +theorem exists_rich_interval_node {M : ℕ} (hM : 0 < M) (H : ℕ) + (φ : ℝ → ℝ) (a L d U : ℝ) (hL : 0 < L) (hd : 0 < d) + (hroot : d ≤ (φ (a + L) - φ a) / L) + (hupper : ∀ w : List (Fin M), w.length ≤ H → intervalNodeDensity φ a L w ≤ U) + (hdepth : U < d + H * (d / (4 * M))) : + ∃ w : List (Fin M), w.length < H ∧ + ∀ i, d / 2 ≤ intervalNodeDensity φ a L (w ++ [i]) := by + apply exists_rich_density_node hM H (intervalNodeDensity φ a L) d U hd + · exact hroot + · intro w _ + exact intervalNodeDensity_average hM φ a L hL w + · exact hupper + · exact hdepth + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InverseSquareZeroSum.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InverseSquareZeroSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc4a0ee66589d42a3c91dfe9d008f0a29c88d1d8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/InverseSquareZeroSum.lean @@ -0,0 +1,85 @@ +import Mathlib.Topology.Algebra.InfiniteSum.Real +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteInverseSquareDensity +import OAI.NumberTheory.Ostmann.ZeroDensity.HighZeroTailBound + +namespace OAI + +/-! # Convergence of inverse-square weights from the ordinary zero count -/ + +namespace Ostmann + +open scoped Classical BigOperators + +private theorem zero_height_log_three_halves {ι : Type*} (S : Finset ι) (h : ι → ℝ) + (Q K : ℝ) (hQ : 1 ≤ Q) (hK : 0 ≤ K) (hh : ∀ i ∈ S, 0 ≤ h i) + (hcount : ∀ t : ℝ, 0 ≤ t → + ((S.filter (fun i => h i ≤ t)).card : ℝ) ≤ K * (t + 1) * Real.log (Q * (t + 2))) : + ∀ s : ℝ, 0 ≤ s → + ((S.filter (fun i => Real.log (1 + h i) ≤ s)).card : ℝ) ≤ + (2 * K * (Real.log Q + 5)) * Real.exp ((3 / 2) * s) := by + intro s hs + have hQp : 0 < Q := by linarith + have he : 1 ≤ Real.exp s := Real.one_le_exp hs + have hhf : 1 ≤ Real.exp (s / 2) := Real.one_le_exp (by linarith) + have hlogQ : 0 ≤ Real.log Q := Real.log_nonneg hQ + have hsub : S.filter (fun i => Real.log (1 + h i) ≤ s) ⊆ + S.filter (fun i => h i ≤ Real.exp s) := by + intro i hi + obtain ⟨hiS, hi⟩ := Finset.mem_filter.mp hi + refine Finset.mem_filter.mpr ⟨hiS, ?_⟩ + have hex := (Real.log_le_iff_le_exp (by linarith [hh i hiS] : 0 < 1 + h i)).mp hi + linarith + have hlog : Real.log (Q * (Real.exp s + 2)) ≤ + (Real.log Q + 5) * Real.exp (s / 2) := by + rw [Real.log_mul hQp.ne' (by positivity : Real.exp s + 2 ≠ 0)] + have hinside : Real.exp s + 2 ≤ 3 * Real.exp s := by linarith + have hl := Real.log_le_log (by positivity : 0 < Real.exp s + 2) hinside + rw [Real.log_mul (by norm_num) (Real.exp_ne_zero _), Real.log_exp] at hl + have hl3 := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 3) + have hs' := Real.add_one_le_exp (s / 2) + have hq := mul_le_mul_of_nonneg_left hhf (by linarith : 0 ≤ Real.log Q + 3) + nlinarith + have hl0 : 0 ≤ Real.log (Q * (Real.exp s + 2)) := Real.log_nonneg (by nlinarith) + calc + _ ≤ ((S.filter (fun i => h i ≤ Real.exp s)).card : ℝ) := by + exact_mod_cast Finset.card_le_card hsub + _ ≤ K * (Real.exp s + 1) * Real.log (Q * (Real.exp s + 2)) := + hcount (Real.exp s) (Real.exp_nonneg _) + _ ≤ (K * (2 * Real.exp s)) * ((Real.log Q + 5) * Real.exp (s / 2)) := by + apply mul_le_mul + · exact mul_le_mul_of_nonneg_left (by linarith) hK + · exact hlog + · exact hl0 + · positivity + _ = (2 * K * (Real.log Q + 5)) * Real.exp ((3 / 2) * s) := by + rw [show (3 / 2 : ℝ) * s = s + s / 2 by ring, Real.exp_add] + ring + +/-- Only the ordinary O(T log T) count is needed, not a zero-free region. -/ +theorem inverse_square_weights_summable {ι : Type*} (h : ι → ℝ) + (Q K : ℝ) (hQ : 1 ≤ Q) (hK : 0 ≤ K) (hh : ∀ i, 0 ≤ h i) + (hcount : ∀ (S : Finset ι) (t : ℝ), 0 ≤ t → + ((S.filter (fun i => h i ≤ t)).card : ℝ) ≤ K * (t + 1) * Real.log (Q * (t + 2))) : + Summable (fun i => ((1 + h i) ^ 2)⁻¹) := by + let B := 2 * K * (Real.log Q + 5) + let f : ℕ → ℝ := fun j => ((j + 1 : ℕ) : ℝ) ^ (-4 / 3 : ℝ) + have hB : 0 ≤ B := by dsimp [B]; positivity [Real.log_nonneg hQ] + have hf : Summable f := by + have ht := (Real.summable_nat_rpow.mpr (by norm_num : (-4 / 3 : ℝ) < -1)) + simpa only [f, Nat.cast_add, Nat.cast_one] using (summable_nat_add_iff 1).mpr ht + have he (i : ι) : Real.exp (-2 * Real.log (1 + h i)) = ((1 + h i) ^ 2)⁻¹ := by + rw [show -2 * Real.log (1 + h i) = -(Real.log (1 + h i) + Real.log (1 + h i)) by ring, + Real.exp_neg, Real.exp_add, Real.exp_log (by linarith [hh i] : 0 < 1 + h i), pow_two] + apply summable_of_sum_le (fun i => by positivity) (c := B ^ (4 / 3 : ℝ) * ∑' j, f j) + intro S + have hb := finite_exp_three_halves_sum S (fun i => Real.log (1 + h i)) B hB + (fun i _ => Real.log_nonneg (by linarith [hh i])) + (zero_height_log_three_halves S h Q K hQ hK (fun i _ => hh i) (hcount S)) + simp_rw [he] at hb + exact hb.trans (mul_le_mul_of_nonneg_left + (hf.sum_le_tsum (Finset.range S.card) (fun _ _ => Real.rpow_nonneg (Nat.cast_nonneg _) _)) + (Real.rpow_nonneg hB _)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LiteralSupplyZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LiteralSupplyZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..a660edeb88d459c8f0fda666c8e69d63bbe694aa --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LiteralSupplyZeros.lean @@ -0,0 +1,86 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SupplyContourScales +import OAI.NumberTheory.Ostmann.ZeroDensity.SupplyZeroDecay + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open scoped BigOperators Topology +open Filter +namespace Ostmann.ZeroDensity + +theorem eventually_literal_supply_zero_decay (P : ℕ) {E : ℝ} (hE : 0 ≤ E) (D : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ exception : Option (PrimitiveFamily (supplyConductorCutoff L)), + (∑ z ∈ retainedZeros (supplyConductorCutoff L) exception (1/2) + (supplyContourHeight P E L : ℝ), (supplyPrimeSample L : ℝ)^z.point.re) ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-D*L) := by + have hbudget : 0 < 20003*((P : ℝ)+1)+E+8 := by positivity + have hd := eventually_zero_power_supply_decay hbudget D + filter_upwards [hd,eventually_ge_atTop (1 : ℝ)] with L hd hL + intro exception + have hX : (1 : ℝ) < supplyPrimeSample L := by + by_contra! hh + have hlog := Real.log_nonpos (Nat.cast_nonneg (supplyPrimeSample L)) hh + have hlo := log_supplyPrimeSample_lower L + have hp := Real.exp_pos L + linarith + have hH : 0 < supplyContourHeight P E L := by + have hh := supplyContourHeight_ge_two P E L + omega + have hlog := log_supplyPrimeSample_bounds hL + exact hd (supplyConductorCutoff L) (supplyContourHeight P E L) exception + (supplyPrimeSample L : ℝ) (supplyConductorCutoff_pos L) hH hX hlog.1 hlog.2 + (supplyContourHeight_modulus_budget P hE hL) + +theorem eventually_literal_supply_zero_decay_succ (P : ℕ) {E : ℝ} (hE : 0 ≤ E) (D : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ exception : Option (PrimitiveFamily (supplyConductorCutoff L)), + (∑ z ∈ retainedZeros (supplyConductorCutoff L) exception (1/2) + ((supplyContourHeight P E L+1 : ℕ) : ℝ), (supplyPrimeSample L : ℝ)^z.point.re) ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-D*L) := by + have hbudget : 0 < 20003*((P : ℝ)+1)+E+9 := by positivity + have hd := eventually_zero_power_supply_decay hbudget D + filter_upwards [hd,eventually_ge_atTop (1 : ℝ)] with L hd hL + intro exception + have hX : (1 : ℝ) < supplyPrimeSample L := by + by_contra! hh + have hlog := Real.log_nonpos (Nat.cast_nonneg (supplyPrimeSample L)) hh + have hlo := log_supplyPrimeSample_lower L + have hp := Real.exp_pos L + linarith + have hlog := log_supplyPrimeSample_bounds hL + exact hd (supplyConductorCutoff L) (supplyContourHeight P E L+1) exception + (supplyPrimeSample L : ℝ) (supplyConductorCutoff_pos L) (by omega) hX hlog.1 hlog.2 + (supplyContourHeight_succ_modulus_budget P hE hL) + +theorem eventually_uniform_supply_zero_decay_succ (P : ℕ) {E : ℝ} (hE : 0 ≤ E) (D : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 0 < Q → Q ≤ supplyConductorCutoff L → + ∀ exception : Option (PrimitiveFamily Q), + (∑ z ∈ retainedZeros Q exception (1/2) + ((supplyContourHeight P E L+1 : ℕ) : ℝ), (supplyPrimeSample L : ℝ)^z.point.re) ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-D*L) := by + have hbudget : 0 < 20003*((P : ℝ)+1)+E+9 := by positivity + have hd := eventually_zero_power_supply_decay hbudget D + filter_upwards [hd,eventually_ge_atTop (1 : ℝ)] with L hd hL + intro Q hQ hQQ exception + let : NeZero Q := ⟨by omega⟩ + let : NeZero (supplyConductorCutoff L) := ⟨Nat.ne_of_gt (supplyConductorCutoff_pos L)⟩ + have hX : (1 : ℝ) < supplyPrimeSample L := by + by_contra! hh + have hlog := Real.log_nonpos (Nat.cast_nonneg (supplyPrimeSample L)) hh + have hlo := log_supplyPrimeSample_lower L + have hp := Real.exp_pos L + linarith + have hlog := log_supplyPrimeSample_bounds hL + apply hd Q (supplyContourHeight P E L+1) exception + (supplyPrimeSample L : ℝ) hQ (by omega) hX hlog.1 hlog.2 + exact (Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight_mono hQQ _).trans + (supplyContourHeight_succ_modulus_budget P hE hL) + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeContourDisk.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeContourDisk.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f05d07facf60a2aaae86e52d10af68ea6916ecf --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeContourDisk.lean @@ -0,0 +1,56 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.LogDerivativeDiskBound + +namespace OAI + +/-! # The zero-free logarithmic-derivative bound up to the contour's left edge -/ + +namespace Ostmann + +open Complex Filter Metric Set +open scoped Topology + +theorem logDeriv_norm_le_contour_disk (g : ℂ → ℂ) (A : ℝ) (hA : 0 < A) + (hg : AnalyticOnNhd ℂ g (ball 0 (21 / 8))) + (hne : ∀ z ∈ ball 0 (21 / 8), g z ≠ 0) + (hlog : ∀ z ∈ ball 0 (21 / 8), Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A) + (w : ℂ) (hw : ‖w‖ ≤ 5 / 2) : ‖logDeriv g w‖ ≤ 1312 * A := by + obtain ⟨F, hF0, hF, heF⟩ := exists_normalized_log_on_ball g (21 / 8) + (by norm_num) hg hne + have hd : DifferentiableOn ℂ F (ball 0 (21 / 8)) := fun z hz => + (hF z hz).differentiableAt.differentiableWithinAt + have hreal : MapsTo F (ball 0 (21 / 8)) {z : ℂ | z.re ≤ A} := by + intro z hz + change (F z).re ≤ A + rw [normalized_log_re g F z (hne 0 (mem_ball_self (by norm_num))) (heF z hz)] + exact hlog z hz + have hv (v : ℂ) (hv : v ∈ closedBall w (1 / 16)) : ‖v‖ ≤ 41 / 16 := by + have hh := norm_le_norm_sub_add v w + have hdist : ‖v - w‖ ≤ 1 / 16 := by simpa only [mem_closedBall, dist_eq_norm] using hv + linarith + have hvball (v : ℂ) (h : v ∈ closedBall w (1 / 16)) : v ∈ ball 0 (21 / 8) := by + rw [mem_ball, dist_zero_right] + linarith [hv v h] + have hdc : DiffContOnCl ℂ F (ball w (1 / 16)) := by + apply DiffContOnCl.mk_ball + · intro v hv' + exact (hF v (hvball v (ball_subset_closedBall hv'))).differentiableAt.differentiableWithinAt + · exact fun v hv' => (hF v (hvball v hv')).continuousAt.continuousWithinAt + have hbound : ∀ v ∈ sphere w (1 / 16), ‖F v‖ ≤ 82 * A := by + intro v hv' + have hvC := sphere_subset_closedBall hv' + have hnv := hv v hvC + have hden : 0 < 21 / 8 - ‖v‖ := by linarith + have hh := Complex.borelCaratheodory_zero hA hd hreal (by norm_num) + (hvball v hvC) hF0 + apply hh.trans + apply (div_le_iff₀ hden).mpr + nlinarith + have hh := Complex.norm_deriv_le_of_forall_mem_sphere_norm_le + (by norm_num : (0 : ℝ) < 1 / 16) hdc hbound + have hwball : w ∈ ball 0 (21 / 8) := by rw [mem_ball, dist_zero_right]; linarith + rw [(hF w hwball).deriv] at hh + convert hh using 1; ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeDiskBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeDiskBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..31d8745dc10faffa850ce0034134987a8a30d526 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeDiskBound.lean @@ -0,0 +1,93 @@ +import Mathlib.Analysis.Complex.BorelCaratheodory +import Mathlib.Analysis.Complex.Liouville +import OAI.NumberTheory.Ostmann.ZeroDensity.AnalyticLogBall + +namespace OAI + +/-! # A logarithmic-derivative estimate from the actual modulus on a disk -/ + +namespace Ostmann + +open Complex Filter Metric Set +open scoped Topology + +theorem logDeriv_norm_le_of_disk (g : ℂ → ℂ) (R A : ℝ) (hR : 0 < R) (hA : 0 < A) + (hg : AnalyticOnNhd ℂ g (ball 0 R)) (hne : ∀ z ∈ ball 0 R, g z ≠ 0) + (hlog : ∀ z ∈ ball 0 R, Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A) : + ‖logDeriv g 0‖ ≤ 4 * A / R := by + obtain ⟨F, hF0, hF, heF⟩ := exists_normalized_log_on_ball g R hR hg hne + have hd : DifferentiableOn ℂ F (ball 0 R) := fun z hz => + (hF z hz).differentiableAt.differentiableWithinAt + have hreal : MapsTo F (ball 0 R) {z : ℂ | z.re ≤ A} := by + intro z hz + change (F z).re ≤ A + rw [normalized_log_re g F z (hne 0 (mem_ball_self hR)) (heF z hz)] + exact hlog z hz + have hhalf : 0 < R / 2 := by positivity + have hsmall (z : ℂ) (hz : z ∈ closedBall 0 (R / 2)) : z ∈ ball 0 R := by + exact mem_ball.mpr (lt_of_le_of_lt (mem_closedBall.mp hz) (by linarith)) + have hdc : DiffContOnCl ℂ F (ball 0 (R / 2)) := by + refine ⟨hd.mono (ball_subset_ball (by linarith)), ?_⟩ + rw [closure_ball 0 hhalf.ne'] + exact fun z hz => (hF z (hsmall z hz)).continuousAt.continuousWithinAt + have hb : ∀ z ∈ sphere 0 (R / 2), ‖F z‖ ≤ 2 * A := by + intro z hz + have hn : ‖z‖ = R / 2 := by simpa using hz + have hh := Complex.borelCaratheodory_zero hA hd hreal hR + (hsmall z (sphere_subset_closedBall hz)) hF0 + rw [hn] at hh + convert hh using 1 + field_simp + ring + have hh := Complex.norm_deriv_le_of_forall_mem_sphere_norm_le hhalf hdc hb + rw [(hF 0 (mem_ball_self hR)).deriv] at hh + convert hh using 1 + field_simp + ring + +/-- The same modulus information controls the logarithmic derivative throughout +an inner half-disk, with the normalization still taken at its original center. -/ +theorem logDeriv_norm_le_inner_disk (g : ℂ → ℂ) (R A : ℝ) (hR : 0 < R) (hA : 0 < A) + (hg : AnalyticOnNhd ℂ g (ball 0 R)) (hne : ∀ z ∈ ball 0 R, g z ≠ 0) + (hlog : ∀ z ∈ ball 0 R, Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A) + (w : ℂ) (hw : ‖w‖ ≤ R / 2) : ‖logDeriv g w‖ ≤ 24 * A / R := by + obtain ⟨F, hF0, hF, heF⟩ := exists_normalized_log_on_ball g R hR hg hne + have hd : DifferentiableOn ℂ F (ball 0 R) := fun z hz => + (hF z hz).differentiableAt.differentiableWithinAt + have hreal : MapsTo F (ball 0 R) {z : ℂ | z.re ≤ A} := by + intro z hz + change (F z).re ≤ A + rw [normalized_log_re g F z (hne 0 (mem_ball_self hR)) (heF z hz)] + exact hlog z hz + have hv (v : ℂ) (hv : v ∈ closedBall w (R / 4)) : ‖v‖ ≤ 3 * R / 4 := by + have hh := norm_le_norm_sub_add v w + have hdist : ‖v - w‖ ≤ R / 4 := by simpa only [mem_closedBall, dist_eq_norm] using hv + linarith + have hvball (v : ℂ) (h : v ∈ closedBall w (R / 4)) : v ∈ ball 0 R := by + rw [mem_ball, dist_zero_right] + linarith [hv v h] + have hdc : DiffContOnCl ℂ F (ball w (R / 4)) := by + apply DiffContOnCl.mk_ball + · intro v hv' + exact (hF v (hvball v (ball_subset_closedBall hv'))).differentiableAt.differentiableWithinAt + · exact fun v hv' => (hF v (hvball v hv')).continuousAt.continuousWithinAt + have hbound : ∀ v ∈ sphere w (R / 4), ‖F v‖ ≤ 6 * A := by + intro v hv' + have hvC := sphere_subset_closedBall hv' + have hnv := hv v hvC + have hden : 0 < R - ‖v‖ := by linarith + have hh := Complex.borelCaratheodory_zero hA hd hreal hR (hvball v hvC) hF0 + apply hh.trans + apply (div_le_iff₀ hden).mpr + nlinarith + have hh := Complex.norm_deriv_le_of_forall_mem_sphere_norm_le + (by positivity : 0 < R / 4) hdc hbound + have hwball : w ∈ ball 0 R := by rw [mem_ball, dist_zero_right]; linarith + rw [(hF w hwball).deriv] at hh + convert hh using 1 + field_simp + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeDiskOscillation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeDiskOscillation.lean new file mode 100644 index 0000000000000000000000000000000000000000..8bd7f3be7c2d43c90eddbc8ebb09a2ff0fafa769 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeDiskOscillation.lean @@ -0,0 +1,32 @@ +import Mathlib.Analysis.Calculus.MeanValue +import OAI.NumberTheory.Ostmann.ZeroDensity.LogDerivativeInnerSecondBound + +namespace OAI + +/-! # Vanishing oscillation of logarithmic derivatives on inner disks -/ + +namespace Ostmann + +open Complex Metric Set + +theorem logDeriv_disk_oscillation (g : ℂ → ℂ) (R A : ℝ) + (hR : 0 < R) (hA : 0 < A) + (hg : AnalyticOnNhd ℂ g (ball 0 R)) (hne : ∀ z ∈ ball 0 R, g z ≠ 0) + (hlog : ∀ z ∈ ball 0 R, Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A) + (x y : ℂ) (hx : ‖x‖ ≤ R / 4) (hy : ‖y‖ ≤ R / 4) : + ‖logDeriv g y - logDeriv g x‖ ≤ (64 * A / R ^ 2) * ‖y - x‖ := by + have hin (z : ℂ) (hz : z ∈ closedBall (0 : ℂ) (R / 4)) : z ∈ ball 0 R := by + have hz' : ‖z‖ ≤ R / 4 := by simpa using hz + simpa only [mem_ball, dist_zero_right] using hz'.trans_lt (by linarith : R / 4 < R) + have hd (z : ℂ) (hz : z ∈ closedBall (0 : ℂ) (R / 4)) : + DifferentiableAt ℂ (logDeriv g) z := + ((hg z (hin z hz)).deriv.div (hg z (hin z hz)) (hne z (hin z hz))).differentiableAt + apply (convex_closedBall (0 : ℂ) (R / 4)).norm_image_sub_le_of_norm_deriv_le hd + · intro z hz + exact deriv_logDeriv_norm_le_inner_disk g R A hR hA hg hne hlog z (by simpa using hz) + · simpa using hx + · simpa using hy + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeInnerSecondBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeInnerSecondBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..82498c46892f1f456a230a45406221adf045e23e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeInnerSecondBound.lean @@ -0,0 +1,63 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.LogDerivativeSecondBound + +namespace OAI + +/-! # Uniform second-logarithmic-derivative control inside a zero-free disk -/ + +namespace Ostmann + +open Complex Filter Metric Set +open scoped Topology + +theorem deriv_logDeriv_norm_le_inner_disk (g : ℂ → ℂ) (R A : ℝ) + (hR : 0 < R) (hA : 0 < A) + (hg : AnalyticOnNhd ℂ g (ball 0 R)) (hne : ∀ z ∈ ball 0 R, g z ≠ 0) + (hlog : ∀ z ∈ ball 0 R, Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A) + (w : ℂ) (hw : ‖w‖ ≤ R / 4) : + ‖deriv (logDeriv g) w‖ ≤ 64 * A / R ^ 2 := by + obtain ⟨F, hF0, hF, heF⟩ := exists_normalized_log_on_ball g R hR hg hne + have hd : DifferentiableOn ℂ F (ball 0 R) := fun z hz => + (hF z hz).differentiableAt.differentiableWithinAt + have hreal : MapsTo F (ball 0 R) {z : ℂ | z.re ≤ A} := by + intro z hz + change (F z).re ≤ A + rw [normalized_log_re g F z (hne 0 (mem_ball_self hR)) (heF z hz)] + exact hlog z hz + have hquarter : 0 < R / 4 := by positivity + have hsmall (z : ℂ) (hz : z ∈ closedBall w (R / 4)) : ‖z‖ ≤ R / 2 := by + have hz' : ‖z - w‖ ≤ R / 4 := mem_closedBall_iff_norm.mp hz + have ht := norm_add_le (z - w) w + rw [sub_add_cancel] at ht + linarith + have hin (z : ℂ) (hz : z ∈ closedBall w (R / 4)) : z ∈ ball 0 R := by + simpa only [mem_ball, dist_zero_right] using (hsmall z hz).trans_lt (by linarith : R / 2 < R) + have hdc : DiffContOnCl ℂ F (ball w (R / 4)) := by + refine ⟨fun z hz => (hF z (hin z (ball_subset_closedBall hz))).differentiableAt.differentiableWithinAt, ?_⟩ + rw [closure_ball w hquarter.ne'] + exact fun z hz => (hF z (hin z hz)).continuousAt.continuousWithinAt + have hb : ∀ z ∈ sphere w (R / 4), ‖F z‖ ≤ 2 * A := by + intro z hz + have hz' := sphere_subset_closedBall hz + have hn := hsmall z hz' + have hh := Complex.borelCaratheodory_zero hA hd hreal hR (hin z hz') hF0 + apply hh.trans + have hden : 0 < R - ‖z‖ := by linarith + apply (div_le_iff₀ hden).mpr + nlinarith + have hwball : w ∈ ball (0 : ℂ) R := by + simpa only [mem_ball, dist_zero_right] using hw.trans_lt (by linarith : R / 4 < R) + have he : deriv F =ᶠ[𝓝 w] logDeriv g := by + filter_upwards [isOpen_ball.mem_nhds hwball] with z hz + exact (hF z hz).deriv + have he' : iteratedDeriv 2 F w = deriv (logDeriv g) w := by + simpa only [iteratedDeriv_succ, iteratedDeriv_zero] using he.deriv_eq + have hh := Complex.norm_iteratedDeriv_le_of_forall_mem_sphere_norm_le 2 hquarter hdc hb + rw [he'] at hh + convert hh using 1 + norm_num + field_simp + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeSecondBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeSecondBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9c8e238b03e67b56f293d3d61f02fbbe19dea20 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeSecondBound.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.LogDerivativeDiskBound + +namespace OAI + +/-! # A second-derivative estimate for the normalized analytic logarithm -/ + +namespace Ostmann + +open Complex Filter Metric Set +open scoped Topology + +theorem deriv_logDeriv_norm_le_of_disk (g : ℂ → ℂ) (R A : ℝ) + (hR : 0 < R) (hA : 0 < A) + (hg : AnalyticOnNhd ℂ g (ball 0 R)) (hne : ∀ z ∈ ball 0 R, g z ≠ 0) + (hlog : ∀ z ∈ ball 0 R, Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A) : + ‖deriv (logDeriv g) 0‖ ≤ 16 * A / R ^ 2 := by + obtain ⟨F, hF0, hF, heF⟩ := exists_normalized_log_on_ball g R hR hg hne + have hd : DifferentiableOn ℂ F (ball 0 R) := fun z hz => + (hF z hz).differentiableAt.differentiableWithinAt + have hreal : MapsTo F (ball 0 R) {z : ℂ | z.re ≤ A} := by + intro z hz + change (F z).re ≤ A + rw [normalized_log_re g F z (hne 0 (mem_ball_self hR)) (heF z hz)] + exact hlog z hz + have hhalf : 0 < R / 2 := by positivity + have hsmall (z : ℂ) (hz : z ∈ closedBall 0 (R / 2)) : z ∈ ball 0 R := + mem_ball.mpr (lt_of_le_of_lt (mem_closedBall.mp hz) (by linarith)) + have hdc : DiffContOnCl ℂ F (ball 0 (R / 2)) := by + refine ⟨hd.mono (ball_subset_ball (by linarith)), ?_⟩ + rw [closure_ball 0 hhalf.ne'] + exact fun z hz => (hF z (hsmall z hz)).continuousAt.continuousWithinAt + have hb : ∀ z ∈ sphere 0 (R / 2), ‖F z‖ ≤ 2 * A := by + intro z hz + have hn : ‖z‖ = R / 2 := by simpa using hz + have hh := Complex.borelCaratheodory_zero hA hd hreal hR + (hsmall z (sphere_subset_closedBall hz)) hF0 + rw [hn] at hh + convert hh using 1 + field_simp + ring + have he : deriv F =ᶠ[𝓝 (0 : ℂ)] logDeriv g := by + filter_upwards [isOpen_ball.mem_nhds (mem_ball_self hR)] with z hz + exact (hF z hz).deriv + have he' : iteratedDeriv 2 F 0 = deriv (logDeriv g) 0 := by + simpa only [iteratedDeriv_succ, iteratedDeriv_zero] using he.deriv_eq + have hh := Complex.norm_iteratedDeriv_le_of_forall_mem_sphere_norm_le 2 hhalf hdc hb + rw [he'] at hh + convert hh using 1 + norm_num + field_simp + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeVanishing.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeVanishing.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ff3706e88d56a9df89192e5450a3f38bb38d846 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogDerivativeVanishing.lean @@ -0,0 +1,29 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.LogDerivativeSecondBound + +namespace OAI + +/-! # Vanishing second logarithmic derivative from subquadratic disk bounds -/ + +namespace Ostmann + +open Complex Filter Metric +open scoped Topology + +theorem deriv_logDeriv_eq_zero_of_disk_bounds (g : ℂ → ℂ) + (hg : ∀ z, AnalyticAt ℂ g z) (hne : ∀ z, g z ≠ 0) + (R A : ℕ → ℝ) (hR : ∀ n, 0 < R n) (hA : ∀ n, 0 < A n) + (hlog : ∀ n z, z ∈ ball 0 (R n) → + Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A n) + (hsmall : Tendsto (fun n => A n / (R n) ^ 2) atTop (𝓝 0)) : + deriv (logDeriv g) 0 = 0 := by + have hb (n : ℕ) : ‖deriv (logDeriv g) 0‖ ≤ 16 * (A n / (R n) ^ 2) := by + simpa only [mul_div_assoc] using deriv_logDeriv_norm_le_of_disk g (R n) (A n) + (hR n) (hA n) (fun z _ => hg z) (fun z _ => hne z) (hlog n) + have ht : Tendsto (fun n => 16 * (A n / (R n) ^ 2)) atTop (𝓝 0) := by + simpa using hsmall.const_mul 16 + have hh : ‖deriv (logDeriv g) 0‖ ≤ 0 := ge_of_tendsto ht (Eventually.of_forall hb) + exact norm_eq_zero.mp (le_antisymm hh (norm_nonneg _)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogNormDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogNormDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..a9d41e62010fea75139088bec1a8073f56b9e281 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogNormDerivative.lean @@ -0,0 +1,32 @@ +import Mathlib.Analysis.InnerProductSpace.Calculus +import Mathlib.Analysis.Complex.RealDeriv +import Mathlib.Analysis.SpecialFunctions.Log.Deriv + +namespace OAI + +/-! # Real derivatives of logarithmic complex norms -/ + +namespace Ostmann + +open Complex + + theorem hasDerivAt_log_norm {f : ℝ → ℂ} {f' : ℂ} {x : ℝ} + (hf : HasDerivAt f f' x) (hne : f x ≠ 0) : + HasDerivAt (fun t => Real.log ‖f t‖) (f' / f x).re x := by + have hn : ‖f x‖ ≠ 0 := norm_ne_zero_iff.mpr hne + have hd := (hf.norm_sq.log (pow_ne_zero 2 hn)).div_const 2 + have he : (2 * inner ℝ (f x) f' / ‖f x‖ ^ 2) / 2 = (f' / f x).re := by + rw [real_inner_eq_re_inner ℂ, RCLike.inner_apply, Complex.div_re, + ← Complex.normSq_eq_norm_sq] + change 2 * (f' * (starRingEnd ℂ) (f x)).re / Complex.normSq (f x) / 2 = _ + simp only [Complex.mul_re, Complex.conj_re, Complex.conj_im] + ring + rw [he] at hd + convert hd using 1 + ext t + rw [Real.log_pow] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogarithmicDiskRate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogarithmicDiskRate.lean new file mode 100644 index 0000000000000000000000000000000000000000..d7043eca5b1bedeb475639159309f7e6a31a8d46 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogarithmicDiskRate.lean @@ -0,0 +1,50 @@ +import Mathlib.Analysis.SpecialFunctions.Log.Basic +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Tactic + +namespace OAI + +/-! # The logarithmic growth rate needed for the finite-zero contradiction -/ + +namespace Ostmann + +open Filter +open scoped Topology + +theorem logarithmic_disk_rate (A b D : ℝ) (hb : 1 ≤ b) : + Tendsto (fun n : ℕ => + (A * ((n : ℝ) + b) * (1 + Real.log ((n : ℝ) + b)) + D) / ((n : ℝ) + 1) ^ 2) + atTop (𝓝 0) := by + have hx : Tendsto (fun n : ℕ => (n : ℝ) + b) atTop atTop := + tendsto_atTop_add_const_right _ _ tendsto_natCast_atTop_atTop + have hy : Tendsto (fun n : ℕ => (n : ℝ) + 1) atTop atTop := + tendsto_atTop_add_const_right _ _ tendsto_natCast_atTop_atTop + have hc : Tendsto (fun n : ℕ => (b - 1) / ((n : ℝ) + 1)) atTop (𝓝 0) := + tendsto_const_nhds.div_atTop hy + have hr : Tendsto (fun n : ℕ => ((n : ℝ) + b) / ((n : ℝ) + 1)) atTop (𝓝 1) := by + have hh := hc.const_add 1 + convert hh using 1 + · funext n + field_simp + ring + · simp + have hlog : Tendsto (fun n : ℕ => Real.log ((n : ℝ) + b) / ((n : ℝ) + b)) atTop (𝓝 0) := by + simpa only [pow_one, one_mul, add_zero, Function.comp_def] using + (Real.tendsto_pow_log_div_mul_add_atTop 1 0 1 one_ne_zero).comp hx + have hlog' : Tendsto (fun n : ℕ => (1 + Real.log ((n : ℝ) + b)) / ((n : ℝ) + b)) atTop (𝓝 0) := by + simpa only [zero_add, add_div] using (tendsto_const_nhds.div_atTop hx).add hlog + have hpow : Tendsto (fun n : ℕ => ((n : ℝ) + 1) ^ 2) atTop atTop := + (tendsto_pow_atTop (by norm_num : (2 : ℕ) ≠ 0)).comp hy + have hd : Tendsto (fun n : ℕ => D / ((n : ℝ) + 1) ^ 2) atTop (𝓝 0) := + tendsto_const_nhds.div_atTop hpow + have hh := ((hr.pow 2).const_mul A).mul hlog' |>.add hd + simp only [one_pow, mul_one, mul_zero, zero_add] at hh + convert hh using 1 + funext n + have hxn : (n : ℝ) + b ≠ 0 := by linarith [Nat.cast_nonneg (α := ℝ) n] + have hyn : (n : ℝ) + 1 ≠ 0 := by positivity + field_simp [hxn, hyn] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogarithmicGammaBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogarithmicGammaBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b622db4de7372856802501110bcbe327693870f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LogarithmicGammaBound.lean @@ -0,0 +1,68 @@ +import PrimeNumberTheoremAnd.Mathlib.Analysis.SpecialFunctions.Gamma.DigammaSeries +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaRealLogDerivative +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterGammaRealBound + +namespace OAI + +/-! # The logarithmic Gamma bound needed in the full-height zero-free region + +The positive-strip digamma series gives a concrete logarithmic bound. +-/ + +namespace Ostmann + +open Complex + +theorem gammaReal_logarithmic_bound : ∃ B : ℝ, 0 < B ∧ ∀ s : ℂ, + 1 ≤ s.re → s.re ≤ 3 → + ‖logDeriv Complex.Gammaℝ s‖ ≤ B * Real.log (|s.im| + 2) := by + obtain ⟨C, hC, hb⟩ := Complex.exists_norm_digamma_div_two_le_log + (a := 1) (b := 3) (by norm_num) + let D := |Real.log Real.pi| / Real.log 2 + have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) + have hD : 0 ≤ D := by dsimp [D]; positivity + refine ⟨C + D + 1, by positivity, ?_⟩ + intro s hs hs' + have hregular : ∀ n : ℕ, s / 2 ≠ -(n : ℂ) := by + intro n hn + have hh := congrArg Complex.re hn + simp only [div_ofNat_re, neg_re, natCast_re] at hh + linarith [Nat.cast_nonneg (α := ℝ) n] + have hlog : Real.log 2 ≤ Real.log (|s.im| + 2) := + Real.log_le_log (by norm_num) (by linarith [abs_nonneg s.im]) + have hlogpos : 0 < Real.log (|s.im| + 2) := hlog2.trans_le hlog + have hDlog : |Real.log Real.pi| ≤ D * Real.log (|s.im| + 2) := by + have hm := mul_le_mul_of_nonneg_left hlog hD + dsimp [D] at hm + rwa [div_mul_cancel₀ _ hlog2.ne'] at hm + have hpi : ‖Complex.log (Real.pi : ℂ)‖ = |Real.log Real.pi| := by + rw [← Complex.ofReal_log Real.pi_pos.le, Complex.norm_real, Real.norm_eq_abs] + rw [gammaReal_logDeriv s hregular, norm_div, norm_ofNat] + have hh := (norm_sub_le (Complex.digamma (s / 2)) (Complex.log (Real.pi : ℂ))).trans + (add_le_add (hb s hs hs') (le_refl _)) + rw [hpi] at hh + change ‖Complex.digamma (s / 2) - Complex.log (Real.pi : ℂ)‖ / 2 ≤ _ + nlinarith + +theorem characterGamma_logarithmic_bound : ∃ B : ℝ, 0 < B ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), 1 < s.re → s.re ≤ 2 → + ‖logDeriv (DirichletCharacter.gammaFactor χ.character) s‖ ≤ + B * Real.log (|s.im| + 2) := by + obtain ⟨B, hB, hb⟩ := gammaReal_logarithmic_bound + refine ⟨B, hB, ?_⟩ + intro χ s hs hs' + by_cases he : χ.character.Even + · rw [show DirichletCharacter.gammaFactor χ.character = Complex.Gammaℝ from + funext (fun u => by simp [DirichletCharacter.gammaFactor, he])] + exact hb s hs.le (by linarith) + · rw [show DirichletCharacter.gammaFactor χ.character = + Complex.Gammaℝ ∘ (fun u : ℂ => u + 1) from + funext (fun u => by simp [DirichletCharacter.gammaFactor, he])] + rw [logDeriv_comp (g := fun u : ℂ => u + 1) (x := s) + (gammaReal_analyticAt_pos (s + 1) (by simp; linarith)).differentiableAt + (differentiableAt_id.add_const (1 : ℂ))] + simpa using hb (s + 1) (by simp; linarith) (by simp; linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightArchimedean.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightArchimedean.lean new file mode 100644 index 0000000000000000000000000000000000000000..27470711e4e5d65c924a74e53e92465e03d16856 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightArchimedean.lean @@ -0,0 +1,69 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterGammaRealBound +import OAI.NumberTheory.Ostmann.ZeroDensity.VonMangoldtPole + +namespace OAI + +/-! # Uniform Gamma and zeta-pole errors in the low-height rectangle -/ + +namespace Ostmann + +open Complex Set + + theorem gammaReal_logDeriv_rectangle_bound : ∃ C : ℝ, 0 < C ∧ + ∀ z : ℂ, 1 ≤ z.re → z.re ≤ 3 → |z.im| ≤ 2 → + ‖logDeriv Complex.Gammaℝ z‖ ≤ C := by + let K : Set ℂ := Icc (1 : ℝ) 3 ×ℂ Icc (-2 : ℝ) 2 + have hc : ContinuousOn (logDeriv Complex.Gammaℝ) K := by + intro z hz + have hzpos : 0 < z.re := by have := hz.1.1; linarith + have ha := gammaReal_analyticAt_pos z hzpos + exact (ha.deriv.div ha (Complex.Gammaℝ_ne_zero_of_re_pos hzpos)).continuousAt.continuousWithinAt + obtain ⟨C, hC⟩ := (isCompact_Icc.reProdIm isCompact_Icc).exists_bound_of_continuousOn hc + refine ⟨|C| + 1, by positivity, ?_⟩ + intro z hz hz' hi + exact (hC z ⟨⟨hz, hz'⟩, abs_le.mp hi⟩).trans (by linarith [le_abs_self C]) + +theorem characterGamma_low_height_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), 1 < s.re → s.re ≤ 2 → |s.im| ≤ 2 → + ‖logDeriv (DirichletCharacter.gammaFactor χ.character) s‖ ≤ C := by + obtain ⟨C, hC, hb⟩ := gammaReal_logDeriv_rectangle_bound + refine ⟨C, hC, ?_⟩ + intro χ s hs hs' hi + by_cases he : χ.character.Even + · rw [show DirichletCharacter.gammaFactor χ.character = Complex.Gammaℝ from + funext (fun u => by simp [DirichletCharacter.gammaFactor, he])] + exact hb s hs.le (by linarith) hi + · rw [show DirichletCharacter.gammaFactor χ.character = + Complex.Gammaℝ ∘ (fun u : ℂ => u + 1) from + funext (fun u => by simp [DirichletCharacter.gammaFactor, he])] + rw [logDeriv_comp (g := fun u : ℂ => u + 1) (x := s) + (gammaReal_analyticAt_pos (s + 1) (by simp; linarith)).differentiableAt + (differentiableAt_id.add_const (1 : ℂ))] + simpa using hb (s + 1) (by simp; linarith) (by simp; linarith) (by simpa using hi) + +/-- The pole remainder is uniformly bounded even when the evaluation point +approaches one through the complex low-height rectangle. -/ +theorem vonMangoldt_low_height_pole_error : ∃ C : ℝ, 0 < C ∧ + ∀ s : ℂ, 1 < s.re → s.re ≤ 2 → |s.im| ≤ 2 → + ‖LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) s - (s - 1)⁻¹‖ ≤ C := by + let F := ArithmeticFunction.vonMangoldt.LFunctionResidueClassAux (0 : ZMod 1) + let K : Set ℂ := Icc (1 : ℝ) 2 ×ℂ Icc (-2 : ℝ) 2 + have hc : ContinuousOn F K := + (ArithmeticFunction.vonMangoldt.continuousOn_LFunctionResidueClassAux (0 : ZMod 1)).mono + (fun _ hs => hs.1.1) + obtain ⟨C, hC⟩ := (isCompact_Icc.reProdIm isCompact_Icc).exists_bound_of_continuousOn hc + refine ⟨|C| + 1, by positivity, ?_⟩ + intro s hs hs' hi + have hunit : IsUnit (0 : ZMod 1) := by + rw [Subsingleton.elim (0 : ZMod 1) 1] + exact isUnit_one + have he := ArithmeticFunction.vonMangoldt.eqOn_LFunctionResidueClassAux hunit hs + rw [residue_one_eq_vonMangoldt] at he + simp only [Nat.totient_one, Nat.cast_one, inv_one, one_div] at he + change F s = _ at he + rw [← he] + exact (hC s ⟨⟨hs.le, hs'⟩, abs_le.mp hi⟩).trans (by linarith [le_abs_self C]) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightShiftedBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightShiftedBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..c2ea4f789147b3d6f46aad1edfc023f1f31dd75c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightShiftedBound.lean @@ -0,0 +1,47 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterTrigonometric + +namespace OAI + +/-! # The shifted zero-sum bound from trigonometric positivity -/ + +namespace Ostmann + +open Complex + +/-- The coefficient three on the real pole, and the separate doubled-height +pole, give the strict inequality needed to exclude a nonreal exceptional zero. -/ +theorem exists_low_height_shifted_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveRealCharacter) (σ t : ℝ), 1 < σ → σ ≤ 2 → |t| ≤ 1 → + 4 * shiftedRealCharacterZeroSum χ ((σ : ℂ) + (t : ℂ) * I) ≤ + 3 / (σ - 1) + realZeroKernel (σ - 1) (2 * t) + + 2 * Real.log χ.modulus + C := by + obtain ⟨G, hG, hg⟩ := exists_low_height_zero_sum_error + obtain ⟨V, hV, hv⟩ := exists_low_height_vonMangoldt_upper + refine ⟨4 * G + 4 * V, by positivity, ?_⟩ + intro χ σ t hσ hσ2 ht + have ht2 : |2 * t| ≤ 2 := by rw [abs_mul]; norm_num; linarith + have hzero := hg χ ((σ : ℂ) + (t : ℂ) * I) (by simpa using hσ) + (by simpa using hσ2) (by simpa using ht.trans (by norm_num : (1 : ℝ) ≤ 2)) + have hreal := hv (σ : ℂ) hσ hσ2 (by simp) + have hdouble := hv ((σ : ℂ) + ((2 * t : ℝ) : ℂ) * I) (by simpa using hσ) + (by simpa using hσ2) (by simpa using ht2) + have hp := real_character_trigonometric_sum_nonneg χ σ t hσ + have he := χ.asComplex.mangoldt_LSeries_eq ((σ : ℂ) + (t : ℂ) * I) (by simpa using hσ) + change LSeries (fun n => χ.complexCharacter n * (ArithmeticFunction.vonMangoldt n : ℂ)) _ = _ at he + rw [PrimitiveRealCharacter.asComplex_L] at he + rw [he, neg_div, Complex.neg_re] at hp + have hk : realZeroKernel (σ - 1) 0 = 1 / (σ - 1) := by + unfold realZeroKernel + field_simp [sub_ne_zero.mpr hσ.ne'] + ring + simp only [Complex.ofReal_re, Complex.ofReal_im, Complex.add_re, Complex.add_im, + Complex.mul_re, Complex.mul_im, Complex.I_re, Complex.I_im, + mul_zero, mul_one, zero_add, add_zero, sub_zero] at hdouble hreal + rw [hk] at hreal + rw [logDeriv_apply] at hzero + simp only [div_eq_mul_inv] at * + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightZeroBounds.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightZeroBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f4ce9bcfd7318ed409b435942be649101f3aba5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightZeroBounds.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ShiftedRealHadamard +import OAI.NumberTheory.Ostmann.ZeroDensity.LowHeightArchimedean +import OAI.NumberTheory.Ostmann.ZeroDensity.DirichletLogDerivativeBound + +namespace OAI + +/-! # Actual zero sums and bounded low-height errors -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +theorem shifted_real_zero_sum_nonneg (χ : PrimitiveRealCharacter) (s : ℂ) + (hs : 1 < s.re) : 0 ≤ shiftedRealCharacterZeroSum χ s := by + apply tsum_nonneg + intro i + rw [realZeroKernel_complex_sub] + exact realZeroKernel_nonneg (by linarith [((realCharacterActualZeros χ).in_strip i).2]) + +theorem shifted_real_zero_term_le (χ : PrimitiveRealCharacter) (s : ℂ) + (hs : 1 < s.re) (hs2 : s.re ≤ 2) (i : ℕ) : + ((s - (realCharacterActualZeros χ).zeros i)⁻¹).re ≤ shiftedRealCharacterZeroSum χ s := by + exact (shifted_real_zero_summable χ s hs hs2).le_tsum i (fun j _ => by + rw [realZeroKernel_complex_sub] + exact realZeroKernel_nonneg (by linarith [((realCharacterActualZeros χ).in_strip j).2])) + +theorem shifted_real_zero_pair_le (χ : PrimitiveRealCharacter) (s : ℂ) + (hs : 1 < s.re) (hs2 : s.re ≤ 2) (i j : ℕ) (hij : i ≠ j) : + ((s - (realCharacterActualZeros χ).zeros i)⁻¹).re + + ((s - (realCharacterActualZeros χ).zeros j)⁻¹).re ≤ shiftedRealCharacterZeroSum χ s := by + have hh := (shifted_real_zero_summable χ s hs hs2).sum_le_tsum {i,j} (fun k _ => by + rw [realZeroKernel_complex_sub] + exact realZeroKernel_nonneg (by linarith [((realCharacterActualZeros χ).in_strip k).2])) + simpa only [Finset.sum_pair hij, shiftedRealCharacterZeroSum] using hh + +/-- Uniform upper error after replacing the completed logarithmic derivative +by the ordinary one in the actual shifted zero identity. -/ +theorem exists_low_height_zero_sum_error : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveRealCharacter) (s : ℂ), 1 < s.re → s.re ≤ 2 → |s.im| ≤ 2 → + shiftedRealCharacterZeroSum χ s ≤ (logDeriv χ.L s).re + + (1 / 2) * Real.log χ.modulus + C := by + obtain ⟨C, hC, hb⟩ := characterGamma_low_height_bound + refine ⟨C, hC, ?_⟩ + intro χ s hs hs2 hi + rw [shifted_real_hadamard_identity χ s hs hs2, + χ.asComplex.completed_logDeriv_eq_add s hs.le, PrimitiveRealCharacter.asComplex_L, + Complex.add_re] + have hh := (Complex.re_le_norm _).trans (hb χ.asComplex s hs hs2 hi) + linarith + +/-- On the real axis the elementary Euler bound gives a single pole, uniformly +in the primitive real character. -/ +theorem exists_real_zero_sum_upper : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveRealCharacter) (s : ℝ), 1 < s → s ≤ 2 → + shiftedRealCharacterZeroSum χ (s : ℂ) ≤ 1 / (s - 1) + + (1 / 2) * Real.log χ.modulus + C := by + obtain ⟨C, hC, hb⟩ := exists_low_height_zero_sum_error + obtain ⟨D, hD, hd⟩ := exists_dirichlet_logDerivative_bound + refine ⟨C + D, by positivity, ?_⟩ + intro χ s hs hs2 + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have hh := hb χ (s : ℂ) hs hs2 (by simp) + have hnorm := hd χ.modulus χ.complexCharacter s hs hs2 + change ‖logDeriv χ.L (s : ℂ)‖ ≤ _ at hnorm + have hre := (Complex.re_le_norm _).trans hnorm + linarith + +theorem exists_low_height_vonMangoldt_upper : ∃ C : ℝ, 0 < C ∧ + ∀ s : ℂ, 1 < s.re → s.re ≤ 2 → |s.im| ≤ 2 → + (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) s).re ≤ + realZeroKernel (s.re - 1) s.im + C := by + obtain ⟨C, hC, hb⟩ := vonMangoldt_low_height_pole_error + refine ⟨C, hC, ?_⟩ + intro s hs hs2 hi + have hh := (Complex.re_le_norm _).trans (hb s hs hs2 hi) + rw [Complex.sub_re] at hh + have he : ((s - 1)⁻¹).re = realZeroKernel (s.re - 1) s.im := by + simpa using realZeroKernel_complex_sub s 1 + rw [he] at hh + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightZeroExclusion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightZeroExclusion.lean new file mode 100644 index 0000000000000000000000000000000000000000..a12840ef56d3407d383f40e3a990901753f1f7cc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowHeightZeroExclusion.lean @@ -0,0 +1,100 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.LowHeightShiftedBound +import OAI.NumberTheory.Ostmann.ZeroDensity.ZeroFreeNumerics +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterConjugateZeros + +namespace OAI + +/-! # The local exceptional-zero argument with explicit margins -/ + +namespace Ostmann + +open Complex +open scoped ComplexConjugate + +theorem near_axis_zero_indices_unique (χ : PrimitiveRealCharacter) (δ R : ℝ) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hR : δ * R ≤ 1 / 10) + (hupper : shiftedRealCharacterZeroSum χ ((1 + δ : ℝ) : ℂ) ≤ 1 / δ + R) + (i j : ℕ) + (hi : 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros i).re) + (hj : 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros j).re) + (hiy : |((realCharacterActualZeros χ).zeros i).im| ≤ δ / 2) + (hjy : |((realCharacterActualZeros χ).zeros j).im| ≤ δ / 2) : i = j := by + by_contra hij + have hpair := (shifted_real_zero_pair_le χ ((1 + δ : ℝ) : ℂ) + (by simp; linarith) (by simp; linarith) i j hij).trans hupper + rw [realZeroKernel_complex, realZeroKernel_complex] at hpair + have hmi := real_zero_near_mass δ (1 + δ - ((realCharacterActualZeros χ).zeros i).re) + _ hδ (by linarith [((realCharacterActualZeros χ).in_strip i).2]) (by linarith) hiy + have hmj := real_zero_near_mass δ (1 + δ - ((realCharacterActualZeros χ).zeros j).re) + _ hδ (by linarith [((realCharacterActualZeros χ).in_strip j).2]) (by linarith) hjy + have hp := mul_le_mul_of_nonneg_left hpair hδ.le + have he : δ * (1 / δ + R) = 1 + δ * R := by field_simp + rw [he, mul_add] at hp + linarith + +theorem near_zero_small_height (χ : PrimitiveRealCharacter) (δ S : ℝ) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) + (hS : δ * (2 * Real.log χ.modulus + S) ≤ 1 / 10) + (hupper : ∀ t : ℝ, |t| ≤ 1 → + 4 * shiftedRealCharacterZeroSum χ (((1 + δ : ℝ) : ℂ) + (t : ℂ) * I) ≤ + 3 / δ + realZeroKernel δ (2 * t) + 2 * Real.log χ.modulus + S) + (i : ℕ) (hi : 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros i).re) + (hiy : |((realCharacterActualZeros χ).zeros i).im| ≤ 1) : + |((realCharacterActualZeros χ).zeros i).im| < δ / 2 := by + by_contra hy + let ρ := (realCharacterActualZeros χ).zeros i + let a : ℝ := 1 + δ - ρ.re + let s : ℂ := ((1 + δ : ℝ) : ℂ) + (ρ.im : ℂ) * I + have ha : δ ≤ a := by dsimp [a, ρ]; linarith [((realCharacterActualZeros χ).in_strip i).2] + have ha' : a ≤ (21 / 20) * δ := by dsimp [a, ρ]; linarith + have hterm := shifted_real_zero_term_le χ s (by dsimp [s]; simp; linarith) + (by dsimp [s]; simp; linarith) i + have hdiff : s - (realCharacterActualZeros χ).zeros i = (a : ℂ) := by + apply Complex.ext <;> simp [s, a, ρ] + rw [hdiff, ← Complex.ofReal_inv, Complex.ofReal_re] at hterm + have hb := (mul_le_mul_of_nonneg_left hterm (by norm_num : (0 : ℝ) ≤ 4)).trans (hupper ρ.im hiy) + have hp := mul_le_mul_of_nonneg_left hb hδ.le + have he : δ * (3 / δ + realZeroKernel δ (2 * ρ.im) + 2 * Real.log χ.modulus + S) = + 3 + δ * realZeroKernel δ (2 * ρ.im) + δ * (2 * Real.log χ.modulus + S) := by + field_simp; ring + rw [he] at hp + have hm := real_zero_shifted_mass δ a hδ ha ha' + have hk := real_zero_double_height_mass δ ρ.im hδ (le_of_not_gt hy) + simp only [div_eq_mul_inv] at hm + linarith + +/-- The local inequalities force every exceptional low-height zero to be real, +and count multiplicities: two distinct indices are impossible. -/ +theorem near_low_height_zeros_real_unique (χ : PrimitiveRealCharacter) (δ R S : ℝ) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hR : δ * R ≤ 1 / 10) + (hS : δ * (2 * Real.log χ.modulus + S) ≤ 1 / 10) + (hreal : shiftedRealCharacterZeroSum χ ((1 + δ : ℝ) : ℂ) ≤ 1 / δ + R) + (hshift : ∀ t : ℝ, |t| ≤ 1 → + 4 * shiftedRealCharacterZeroSum χ (((1 + δ : ℝ) : ℂ) + (t : ℂ) * I) ≤ + 3 / δ + realZeroKernel δ (2 * t) + 2 * Real.log χ.modulus + S) : + (∀ i, 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros i).re → + |((realCharacterActualZeros χ).zeros i).im| ≤ 1 → + ((realCharacterActualZeros χ).zeros i).im = 0) ∧ + (∀ i j, 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros i).re → + 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros j).re → + |((realCharacterActualZeros χ).zeros i).im| ≤ 1 → + |((realCharacterActualZeros χ).zeros j).im| ≤ 1 → i = j) := by + have hsmall := near_zero_small_height χ δ S hδ hδ1 hS hshift + have huniq := near_axis_zero_indices_unique χ δ R hδ hδ1 hR hreal + constructor + · intro i hi hiy + obtain ⟨j, hj⟩ := realCharacterActualZeros_conjugate χ i + have hjre : 1 - δ / 20 ≤ ((realCharacterActualZeros χ).zeros j).re := by simpa [hj] using hi + have hjim : |((realCharacterActualZeros χ).zeros j).im| ≤ δ / 2 := by + simpa [hj] using (hsmall i hi hiy).le + have hij := huniq i j hi hjre (hsmall i hi hiy).le hjim + rw [← hij] at hj + have hh := congrArg Complex.im hj + simp only [Complex.conj_im] at hh + linarith + · intro i j hi hj hiy hjy + exact huniq i j hi hj (hsmall i hi hiy).le (hsmall j hj hjy).le + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowZeroDecayRate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowZeroDecayRate.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f88e0504bd25a3ba23024aa5da297a419405865 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/LowZeroDecayRate.lean @@ -0,0 +1,89 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +import OAI.NumberTheory.Ostmann.ZeroDensity.RetainedLowZeroEstimate + +namespace OAI + +/-! # The low-zero contribution at the actual growing conductor cutoff -/ + +namespace Ostmann +open Filter + +theorem eventual_low_zero_error (C c a D : ℝ) (hc : 0 < c) (ha : 0 < a) : + ∀ᶠ L : ℝ in atTop, ∀ q : ℝ, 0 ≤ q → q ≤ a * L * Real.exp ((9 / 10 : ℝ) * L) → + 2 * (C * (6 * q) ^ 13) ^ 2 * + Real.exp (-(Real.exp L * (c / (Real.log 2 + 6 * q))) / 2) ≤ + Real.exp (-D * L) := by + let b := 2 + 6 * a + let E := max (D + 25) 1 + have hb : 0 < b := by dsimp [b]; linarith + have hE : 0 < E := lt_of_lt_of_le (by norm_num : (0 : ℝ) < 1) (le_max_right _ _) + have hpoly := ((isLittleO_pow_exp_pos_mul_atTop 26 + (show (0 : ℝ) < 8 / 5 by norm_num)).const_mul_left (2 * C ^ 2 * (6 * a) ^ 26)).bound + (show (0 : ℝ) < 1 by norm_num) + have hfast := ((isLittleO_pow_exp_pos_mul_atTop 2 + (show (0 : ℝ) < 1 / 10 by norm_num)).const_mul_left (2 * b * E)).bound hc + filter_upwards [hpoly, hfast, eventually_ge_atTop (1 : ℝ)] with L hpoly hfast hL + intro q hq hqa + have hLp : 0 < L := by linarith + have hpoly' : 2 * C ^ 2 * (6 * a) ^ 26 * L ^ 26 ≤ Real.exp ((8 / 5 : ℝ) * L) := by + simpa only [Real.norm_eq_abs, abs_of_nonneg (by positivity : + 0 ≤ (2 * C ^ 2 * (6 * a) ^ 26) * L ^ 26), + abs_of_pos (Real.exp_pos _), one_mul] using hpoly + have hfast' : 2 * b * E * L ^ 2 ≤ c * Real.exp ((1 / 10 : ℝ) * L) := by + simpa only [Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ 2 * b * E * L ^ 2), + abs_of_pos (Real.exp_pos _)] using hfast + have hden0 : 0 < Real.log 2 + 6 * q := by + have hh : 0 < Real.log (2 : ℝ) := Real.log_pos (by norm_num) + linarith + have hden : Real.log 2 + 6 * q ≤ b * L * Real.exp ((9 / 10 : ℝ) * L) := by + have he : 1 ≤ Real.exp ((9 / 10 : ℝ) * L) := Real.one_le_exp (by positivity) + have hprod : 1 ≤ L * Real.exp ((9 / 10 : ℝ) * L) := + hL.trans (le_mul_of_one_le_right hLp.le he) + have hl : Real.log (2 : ℝ) ≤ 2 := Real.log_le_self (by norm_num) + dsimp [b] + nlinarith + have hexp : Real.exp ((1 / 10 : ℝ) * L) * Real.exp ((9 / 10 : ℝ) * L) = + Real.exp L := by + rw [← Real.exp_add] + congr 1 + ring + have hgap : E * L ≤ (Real.exp L * (c / (Real.log 2 + 6 * q))) / 2 := by + have hm := mul_le_mul_of_nonneg_right hfast' (Real.exp_nonneg ((9 / 10 : ℝ) * L)) + rw [mul_assoc c, hexp] at hm + have hd := mul_le_mul_of_nonneg_left hden (by positivity : 0 ≤ 2 * E * L) + have hf : (E * L) * (2 * (Real.log 2 + 6 * q)) ≤ Real.exp L * c := by + nlinarith [hm, hd] + apply (le_div_iff₀ (by norm_num : (0 : ℝ) < 2)).mpr + rw [← mul_div_assoc] + apply (le_div_iff₀ hden0).mpr + convert hf using 1 + ring + have hcoefficient : 2 * (C * (6 * q) ^ 13) ^ 2 ≤ Real.exp (25 * L) := by + have hpow := pow_le_pow_left₀ (by positivity : 0 ≤ 6 * q) + (show 6 * q ≤ 6 * (a * L * Real.exp ((9 / 10 : ℝ) * L)) by linarith [hqa]) 26 + have hm := mul_le_mul_of_nonneg_left hpow (by positivity : 0 ≤ 2 * C ^ 2) + have hpowexp : Real.exp ((9 / 10 : ℝ) * L) ^ 26 = + Real.exp ((117 / 5 : ℝ) * L) := by + rw [← Real.exp_nat_mul] + congr 1 + ring + have hbnd : 2 * (C * (6 * q) ^ 13) ^ 2 ≤ + (2 * C ^ 2 * (6 * a) ^ 26 * L ^ 26) * Real.exp ((117 / 5 : ℝ) * L) := by + convert hm using 1 <;> simp only [mul_pow, hpowexp] <;> ring + calc + _ ≤ _ := hbnd + _ ≤ Real.exp ((8 / 5 : ℝ) * L) * Real.exp ((117 / 5 : ℝ) * L) := + mul_le_mul_of_nonneg_right hpoly' (Real.exp_nonneg _) + _ = _ := by rw [← Real.exp_add]; congr 1; ring + calc + _ ≤ Real.exp (25 * L) * Real.exp (-E * L) := mul_le_mul hcoefficient + (Real.exp_le_exp.mpr (by linarith)) (Real.exp_nonneg _) (Real.exp_nonneg _) + _ = Real.exp ((25 - E) * L) := by rw [← Real.exp_add]; congr 1; ring + _ ≤ _ := Real.exp_le_exp.mpr (by + have hh := mul_le_mul_of_nonneg_right (le_max_left (D + 25) 1) hLp.le + dsimp [E] + linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MertensFromProgression.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MertensFromProgression.lean new file mode 100644 index 0000000000000000000000000000000000000000..63077406f323c02b789a77e0fbea0a7604a29648 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MertensFromProgression.lean @@ -0,0 +1,165 @@ +import OAI.NumberTheory.Ostmann.Preliminaries.MertensThetaKernel +import OAI.NumberTheory.Ostmann.Preliminaries.MertensFromFirst + +namespace OAI + +/-! # Mertens estimates from the progression estimate + +The conductor-one theta bound implies the first Mertens estimate. +-/ + +namespace Ostmann + +open Finset MeasureTheory +open scoped BigOperators Interval + +/-- Abel summation for the logarithmically weighted prime sum. -/ +theorem prime_log_div_partial_summation (Q : ℕ) (hQ : 2 ≤ Q) : + (∑ p ∈ Nat.primesLE Q, Real.log (p : ℝ) / p) = + Chebyshev.theta Q / Q + ∫ t in (2 : ℝ)..Q, Chebyshev.theta t / t ^ 2 := by + have hQR : (2 : ℝ) ≤ Q := by exact_mod_cast hQ + have hd : ContinuousOn (deriv (fun t : ℝ => t⁻¹)) (Set.Icc 2 Q) := by + simp only [deriv_inv'] + exact ((continuousOn_id.pow 2).inv₀ (fun t ht => + pow_ne_zero 2 (by change t ≠ 0; linarith [ht.1]))).neg + have h := sum_mul_eq_sub_integral_mul₁ (primeProgressionLog 1 0) + (by norm_num [primeProgressionLog]) (by norm_num [primeProgressionLog]) (Q : ℝ) + (f := fun t : ℝ => t⁻¹) + (fun t ht => (hasDerivAt_inv (by linarith [ht.1] : t ≠ 0)).differentiableAt) + hd.integrableOn_Icc + have hs : (∑ n ∈ Icc 0 Q, (n : ℝ)⁻¹ * primeProgressionLog 1 0 n) = + ∑ p ∈ Nat.primesLE Q, Real.log (p : ℝ) / p := by + rw [Nat.primesLE_eq_filter_Icc_zero, sum_filter] + apply sum_congr rfl + intro n hn + simp [primeProgressionLog, Nat.ModEq, Nat.mod_one, mul_ite, div_eq_mul_inv, mul_comm] + change _ = (Q : ℝ)⁻¹ * primeProgressionTheta 1 0 Q - + ∫ t in Set.Ioc (2 : ℝ) Q, deriv (fun t : ℝ => t⁻¹) t * + primeProgressionTheta 1 0 t at h + rw [Nat.floor_natCast, hs] at h + simp_rw [primeProgressionTheta_one, deriv_inv, neg_mul] at h + rw [← intervalIntegral.integral_of_le hQR, intervalIntegral.integral_neg, + sub_neg_eq_add] at h + simpa only [div_eq_mul_inv, mul_comm] using h + +private theorem theta_div_sq_integrable (Q : ℕ) (hQ : 2 ≤ Q) : + IntervalIntegrable (fun t : ℝ => Chebyshev.theta t / t ^ 2) volume 2 Q := by + rw [intervalIntegrable_iff_integrableOn_Icc_of_le + (show (2 : ℝ) ≤ Q by exact_mod_cast hQ)] + have hc : ContinuousOn (fun t : ℝ => (t ^ 2)⁻¹) (Set.Icc 2 Q) := by + exact (continuousOn_id.pow 2).inv₀ (fun t ht => + pow_ne_zero 2 (by change t ≠ 0; linarith [ht.1])) + have h := integrableOn_mul_sum_Icc (primeProgressionLog 1 0) + (m := 0) (show (0 : ℝ) ≤ 2 by norm_num) hc.integrableOn_Icc + change IntegrableOn (fun t : ℝ => (t ^ 2)⁻¹ * primeProgressionTheta 1 0 t) + (Set.Icc 2 Q) at h + simpa only [primeProgressionTheta_one, div_eq_mul_inv, mul_comm] using h + +/-- The integrated theta error is bounded independently of the cutoff. -/ +theorem PublishedProgressionInput.theta_error_integral (P : PublishedProgressionInput) + (Q : ℕ) (hQ : 2 ≤ Q) : + |∫ t in (2 : ℝ)..Q, (Chebyshev.theta t - t) / t ^ 2| ≤ + P.errorConstant * (-thetaErrorPrimitive P.decay 2) := by + have hQR : (2 : ℝ) ≤ Q := by exact_mod_cast hQ + have hk : IntervalIntegrable (fun t : ℝ => + Real.exp (-P.decay * Real.sqrt (Real.log t)) / t) volume 2 Q := by + rw [intervalIntegrable_iff_integrableOn_Icc_of_le hQR] + apply ContinuousOn.integrableOn_Icc + fun_prop (disch := grind) + have hi : IntervalIntegrable (fun t : ℝ => + (Chebyshev.theta t - t) / t ^ 2) volume 2 Q := by + have hv : IntervalIntegrable (fun t : ℝ => t⁻¹) volume 2 Q := by + rw [intervalIntegrable_iff_integrableOn_Icc_of_le hQR] + apply ContinuousOn.integrableOn_Icc + fun_prop (disch := grind) + apply ((theta_div_sq_integrable Q hQ).sub hv).congr + intro t ht + rw [Set.uIoc_of_le hQR] at ht + have ht0 : t ≠ 0 := by linarith [ht.1] + field_simp + calc + _ ≤ ∫ t in (2 : ℝ)..Q, |(Chebyshev.theta t - t) / t ^ 2| := by + simpa only [Real.norm_eq_abs] using + (intervalIntegral.norm_integral_le_integral_norm hQR + (f := fun t : ℝ => (Chebyshev.theta t - t) / t ^ 2)) + _ ≤ ∫ t in (2 : ℝ)..Q, + P.errorConstant * (Real.exp (-P.decay * Real.sqrt (Real.log t)) / t) := by + apply intervalIntegral.integral_mono_on hQR hi.norm (hk.const_mul _) + intro t ht + have ht0 : 0 < t := by linarith [ht.1] + rw [Real.norm_eq_abs, abs_div, abs_of_nonneg (sq_nonneg t)] + calc + _ ≤ (P.errorConstant * t * Real.exp (-P.decay * Real.sqrt (Real.log t))) / + t ^ 2 := div_le_div_of_nonneg_right (P.principal_theta_bound t ht.1) + (sq_nonneg _) + _ = _ := by field_simp + _ = P.errorConstant * ∫ t in (2 : ℝ)..Q, + Real.exp (-P.decay * Real.sqrt (Real.log t)) / t := + intervalIntegral.integral_const_mul _ _ + _ ≤ _ := mul_le_mul_of_nonneg_left + (theta_error_kernel_integral_bound P.decay_pos hQR) P.errorConstant_nonneg + +noncomputable def PublishedProgressionInput.mertensConstant (P : PublishedProgressionInput) : ℝ := + |1 - Real.log 2| + P.errorConstant + + P.errorConstant * (-thetaErrorPrimitive P.decay 2) + +theorem PublishedProgressionInput.mertensConstant_nonneg (P : PublishedProgressionInput) : + 0 ≤ P.mertensConstant := by + unfold PublishedProgressionInput.mertensConstant + exact add_nonneg (add_nonneg (abs_nonneg _) P.errorConstant_nonneg) + (mul_nonneg P.errorConstant_nonneg (neg_nonneg.mpr + (thetaErrorPrimitive_nonpos P.decay_pos 2))) + +/-- First Mertens, with a concrete constant depending on the +progression estimate. -/ +theorem PublishedProgressionInput.mertens (P : PublishedProgressionInput) : + MertensEstimate P.mertensConstant := by + intro Q hQ + by_cases hQ2 : 2 ≤ Q + · have hQR : (2 : ℝ) ≤ Q := by exact_mod_cast hQ2 + have hQ0 : (0 : ℝ) < Q := by linarith + have hv : IntervalIntegrable (fun t : ℝ => t⁻¹) volume 2 Q := by + rw [intervalIntegrable_iff_integrableOn_Icc_of_le hQR] + apply ContinuousOn.integrableOn_Icc + fun_prop (disch := grind) + have hsplit : (∫ t in (2 : ℝ)..Q, (Chebyshev.theta t - t) / t ^ 2) = + (∫ t in (2 : ℝ)..Q, Chebyshev.theta t / t ^ 2) - + (Real.log Q - Real.log 2) := by + have he : (∫ t in (2 : ℝ)..Q, (Chebyshev.theta t - t) / t ^ 2) = + ∫ t in (2 : ℝ)..Q, Chebyshev.theta t / t ^ 2 - t⁻¹ := by + apply intervalIntegral.integral_congr + intro t ht + rw [Set.uIcc_of_le hQR] at ht + have ht0 : t ≠ 0 := by linarith [ht.1] + field_simp + rw [he, intervalIntegral.integral_sub (theta_div_sq_integrable Q hQ2) hv, + integral_inv_of_pos (by norm_num) hQ0, + Real.log_div hQ0.ne' (by norm_num : (2 : ℝ) ≠ 0)] + have hid : (∑ p ∈ Nat.primesLE Q, Real.log (p : ℝ) / p) - Real.log Q = + (1 - Real.log 2) + (Chebyshev.theta Q - Q) / Q + + ∫ t in (2 : ℝ)..Q, (Chebyshev.theta t - t) / t ^ 2 := by + rw [hsplit, prime_log_div_partial_summation Q hQ2] + field_simp + ring + have hend : |(Chebyshev.theta Q - Q) / Q| ≤ P.errorConstant := by + rw [abs_div, abs_of_pos hQ0] + calc + _ ≤ (P.errorConstant * Q * Real.exp (-P.decay * Real.sqrt (Real.log Q))) / Q := + div_le_div_of_nonneg_right (P.principal_theta_bound Q hQR) hQ0.le + _ = P.errorConstant * Real.exp (-P.decay * Real.sqrt (Real.log Q)) := by + field_simp + _ ≤ P.errorConstant * 1 := mul_le_mul_of_nonneg_left + (Real.exp_le_one_iff.mpr (mul_nonpos_of_nonpos_of_nonneg + (neg_nonpos.mpr P.decay_pos.le) (Real.sqrt_nonneg _))) P.errorConstant_nonneg + _ = _ := mul_one _ + rw [hid] + exact ((abs_add_le _ _).trans (add_le_add (abs_add_le _ _) le_rfl)).trans + (add_le_add (add_le_add le_rfl hend) (P.theta_error_integral Q hQ2)) + · have hQ1 : Q = 1 := by omega + subst Q + simpa only [Nat.primesLE_one, sum_empty, Nat.cast_one, Real.log_one, sub_self, + abs_zero] using P.mertensConstant_nonneg + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Mollifier.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Mollifier.lean new file mode 100644 index 0000000000000000000000000000000000000000..f91f011780613bc2aaf7b0fa7e4e6204f76b7ac7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Mollifier.lean @@ -0,0 +1,121 @@ +import Mathlib.NumberTheory.ArithmeticFunction.Moebius +import Mathlib.NumberTheory.DirichletCharacter.Orthogonality +import Mathlib.NumberTheory.LSeries.Convolution + +namespace OAI + +noncomputable section +open scoped BigOperators ArithmeticFunction.Moebius ArithmeticFunction.zeta LSeries.notation + +namespace Ostmann.ZeroDensity + +def truncate (N : ℕ) (f : ArithmeticFunction ℂ) : ArithmeticFunction ℂ := + ⟨fun n => if n ≤ N then f n else 0, by simp⟩ + +@[simp] theorem truncate_apply (N : ℕ) (f : ArithmeticFunction ℂ) (n : ℕ) : + truncate N f n = if n ≤ N then f n else 0 := rfl + +def mollifierCoefficient (X N : ℕ) : ArithmeticFunction ℂ := + truncate X (μ : ArithmeticFunction ℂ) * truncate N (ζ : ArithmeticFunction ℂ) + +theorem mollifierCoefficient_initial {X N n : ℕ} (hnX : n ≤ X) (hnN : n ≤ N) : + mollifierCoefficient X N n = (1 : ArithmeticFunction ℂ) n := by + calc + mollifierCoefficient X N n = + ((μ : ArithmeticFunction ℂ) * (ζ : ArithmeticFunction ℂ)) n := by + rw [mollifierCoefficient, ArithmeticFunction.mul_apply, ArithmeticFunction.mul_apply] + apply Finset.sum_congr rfl + intro p hp + have hp1 := Nat.divisor_le (Nat.fst_mem_divisors_of_mem_antidiagonal hp) + have hp2 := Nat.divisor_le (Nat.snd_mem_divisors_of_mem_antidiagonal hp) + simp [hp1.trans hnX, hp2.trans hnN] + _ = _ := by rw [ArithmeticFunction.coe_moebius_mul_coe_zeta] + +@[simp] theorem mollifierCoefficient_one {X N : ℕ} (hX : 1 ≤ X) (hN : 1 ≤ N) : + mollifierCoefficient X N 1 = 1 := by + simpa using mollifierCoefficient_initial hX hN + +theorem mollifierCoefficient_vanish {X N n : ℕ} (hX : X ≤ N) + (hn : 2 ≤ n) (hnX : n ≤ X) : mollifierCoefficient X N n = 0 := by + rw [mollifierCoefficient_initial hnX (hnX.trans hX)] + exact ArithmeticFunction.one_apply_ne (by omega) + +theorem mollifierCoefficient_support {X N n : ℕ} (hn : X * N < n) : + mollifierCoefficient X N n = 0 := by + rw [mollifierCoefficient, ArithmeticFunction.mul_apply] + apply Finset.sum_eq_zero + intro p hp + have hprod := (Nat.mem_divisorsAntidiagonal.mp hp).1 + by_cases hx : p.1 ≤ X + · have hn' : ¬p.2 ≤ N := by + intro hN + have := Nat.mul_le_mul hx hN + omega + simp [hx, hn'] + · simp [hx] + +theorem norm_mollifierCoefficient_le (X N n : ℕ) : + ‖mollifierCoefficient X N n‖ ≤ (n.divisors.card : ℝ) := by + rw [mollifierCoefficient, ArithmeticFunction.mul_apply] + calc + ‖∑ p ∈ n.divisorsAntidiagonal, + truncate X (μ : ArithmeticFunction ℂ) p.1 * + truncate N (ζ : ArithmeticFunction ℂ) p.2‖ ≤ + ∑ p ∈ n.divisorsAntidiagonal, + ‖truncate X (μ : ArithmeticFunction ℂ) p.1 * + truncate N (ζ : ArithmeticFunction ℂ) p.2‖ := norm_sum_le _ _ + _ ≤ ∑ _p ∈ n.divisorsAntidiagonal, (1 : ℝ) := by + apply Finset.sum_le_sum + intro p hp + have hp2 := Nat.right_ne_zero_of_mem_divisorsAntidiagonal hp + by_cases hx : p.1 ≤ X <;> by_cases hn : p.2 ≤ N + · rcases ArithmeticFunction.moebius_eq_or p.1 with hm | hm | hm <;> + simp [hx, hn, ArithmeticFunction.natCoe_apply, + ArithmeticFunction.intCoe_apply, ArithmeticFunction.zeta_apply_ne hp2, hm] + · simp [hn] + · simp [hx] + · simp [hx] + _ = (n.divisors.card : ℝ) := by + rw [← Nat.map_div_right_divisors] + simp + +def characterTwist {q : ℕ} (χ : DirichletCharacter ℂ q) + (f : ArithmeticFunction ℂ) : ArithmeticFunction ℂ := + ⟨fun n => f n * χ n, by simp⟩ + +@[simp] theorem characterTwist_apply {q : ℕ} (χ : DirichletCharacter ℂ q) + (f : ArithmeticFunction ℂ) (n : ℕ) : characterTwist χ f n = f n * χ n := rfl + +theorem characterTwist_mul {q : ℕ} (χ : DirichletCharacter ℂ q) + (f g : ArithmeticFunction ℂ) : + characterTwist χ (f * g) = characterTwist χ f * characterTwist χ g := by + ext n + simp only [characterTwist_apply, ArithmeticFunction.mul_apply, Finset.sum_mul] + apply Finset.sum_congr rfl + intro p hp + have hprod := (Nat.mem_divisorsAntidiagonal.mp hp).1 + rw [← hprod, Nat.cast_mul, map_mul] + ring + +theorem truncated_twist_summable {q : ℕ} (χ : DirichletCharacter ℂ q) + (N : ℕ) (f : ArithmeticFunction ℂ) (s : ℂ) : + LSeriesSummable (characterTwist χ (truncate N f)) s := by + apply summable_of_ne_finset_zero (s := Finset.range (N + 1)) + intro n hn + have hnN : ¬n ≤ N := by simpa using hn + simp [LSeries.term, hnN] + +theorem mollifier_product {q : ℕ} (χ : DirichletCharacter ℂ q) + (X N : ℕ) (s : ℂ) : + LSeries (characterTwist χ (mollifierCoefficient X N)) s = + LSeries (characterTwist χ (truncate X (μ : ArithmeticFunction ℂ))) s * + LSeries (characterTwist χ (truncate N (ζ : ArithmeticFunction ℂ))) s := by + rw [mollifierCoefficient, characterTwist_mul] + exact ArithmeticFunction.LSeries_mul' (truncated_twist_summable χ X _ s) + (truncated_twist_summable χ N _ s) + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MovingFullSmoothZero.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MovingFullSmoothZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..d74019eccc98747d5e7ffc63d438fe3ababe0497 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MovingFullSmoothZero.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.MovingSpectatorZero +import OAI.NumberTheory.Ostmann.Arithmetic.MovingFullSmooth + +namespace OAI + +/-! # Full smooth coefficients with only the actual spectator zero convention -/ + +namespace Ostmann +open scoped BigOperators Classical SchwartzMap + +/-- Factor every spectator while retaining the full smooth and arithmetic +coefficient. This identity includes zero-support terms. -/ +theorem movingSlotWeight_spectator_product_of_zero {σ I : Type*} + (q : I → ℕ) [∀ i, Fact (q i).Prime] + (value : σ → ℕ) (childBound pivotBound : ℕ → ℕ) + (F : MovingSlotState σ → ℤ → ℂ) + (extra : MovingSlotState σ → ℤ → ℤ → ℤ → ℝ) + (g : ∀ i, ZMod (q i) → ℂ) (hg : ∀ i, g i 0 = 0) (D : ∀ i, (ZMod (q i))ˣ) (S : Finset I) + {n : ℕ} (T : MovingSlotData σ n) (t : FrequencyTree ℤ n) (hT : T.Follows t) + (XL XR : ℕ) : + recursiveTransferWeight (movingSlotSystem value childBound pivotBound) + (fun x s => F x s * ∏ i ∈ S, spectatorHistoryLeaf (movingSlotModulus value) (g i) (D i) x s) + (movingSlotCutoff value childBound pivotBound extra) n ⟨n, T, XL, XR⟩ t = + recursiveTransferWeight (movingSlotSystem value childBound pivotBound) F + (movingSlotCutoff value childBound pivotBound extra) n ⟨n, T, XL, XR⟩ t * + ∏ i ∈ S, movingSlotSpectator value (g i) (D i) T XL XR := by + induction S using Finset.induction_on generalizing F with + | empty => simp only [Finset.prod_empty, mul_one] + | @insert i S hi ih => + simp only [Finset.prod_insert hi] + have he : (fun x s => F x s * (spectatorHistoryLeaf (movingSlotModulus value) (g i) (D i) x s * + ∏ j ∈ S, spectatorHistoryLeaf (movingSlotModulus value) (g j) (D j) x s)) = + (fun x s => (F x s * ∏ j ∈ S, spectatorHistoryLeaf (movingSlotModulus value) (g j) (D j) x s) * + spectatorHistoryLeaf (movingSlotModulus value) (g i) (D i) x s) := by + funext x s + ring + rw [he, movingSlotWeight_spectator_of_zero value childBound pivotBound _ extra + (g i) (hg i) (D i) T t hT XL XR, ih] + ring + +/-- The complete moving coefficient splits into the original scalar support, +its actual smooth polynomial weight, and all of its spectator trees. No +nonzero-term hypothesis is needed. -/ +theorem moving_full_smooth_spectator_of_zero {σ I : Type*} + (q : I → ℕ) [∀ i, Fact (q i).Prime] + (value : σ → ℕ) (hvalue : ∀ i, value i ≠ 0) (childBound pivotBound : ℕ → ℕ) + (F : MovingSlotState σ → ℤ → ℂ) (extra : MovingSlotState σ → ℤ → ℤ → ℤ → ℝ) + (g : ∀ i, ZMod (q i) → ℂ) (hg : ∀ i, g i 0 = 0) (Dq : ∀ i, (ZMod (q i))ˣ) (S : Finset I) + (ψ : 𝓢(ℝ, ℂ)) (X lo hi : ℝ) (hlo : 1 ≤ lo) (hhi : lo ≤ hi) + (φ : ℝ → ℝ) (G : ℕ → ℝ) (B D : ℝ) (hB : 0 ≤ B) (hD : 0 ≤ D) + (hφ : ∀ x, |φ x| ≤ B) (hlip : ∀ x y, |φ x - φ y| ≤ D * |x - y|) + (hout : ∀ x, 1 ≤ |x| → φ x = 0) + {n : ℕ} (T : MovingSlotData σ n) (t : FrequencyTree ℤ n) (hT : T.Follows t) + (hfreq : T.Frequencies (· ≠ 0)) (XL XR : ℕ) (L R : Polynomial ℝ) (z : ℝ) + (hL : L.eval z = (XL : ℝ)) (hR : R.eval z = (XR : ℝ)) : + recursiveTransferWeight (movingSlotSystem value childBound pivotBound) + (fun x s => (movingWindowLeaf value X lo hi F x s * movingFourierLeaf value ψ X x s) * + ∏ i ∈ S, spectatorHistoryLeaf (movingSlotModulus value) (g i) (Dq i) x s) + (movingSlotCutoff value childBound pivotBound + (movingPhiExtra value childBound pivotBound extra φ G)) n ⟨n, T, XL, XR⟩ t = + (recursiveTransferWeight (movingSlotSystem value childBound pivotBound) + (movingWindowLeaf value X lo hi F) (movingSlotCutoff value childBound pivotBound extra) + n ⟨n, T, XL, XR⟩ t * + smoothPolynomialWeight (movingSmoothPolynomialFactors value T L R ψ X lo hi hlo hhi + φ G B D hB hD hφ hlip) z) * + ∏ i ∈ S, movingSlotSpectator value (g i) (Dq i) T XL XR := by + rw [movingSlotWeight_spectator_product_of_zero q value childBound pivotBound _ _ g hg Dq S T t hT XL XR, + moving_full_smooth_polynomial value hvalue childBound pivotBound F extra ψ X lo hi hlo hhi + φ G B D hB hD hφ hlip hout T t hT hfreq XL XR L R z hL hR] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MovingSpectatorZero.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MovingSpectatorZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..f435c1ed402f35c8b2518957309785c6865e51b2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MovingSpectatorZero.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.MovingSlotSpectator + +namespace OAI + +/-! # The spectator zero convention eliminates inserted nonunits -/ + +namespace Ostmann +open scoped Classical + +/-- A giant which is zero at an outside prime survives along one child path +until a leaf. Its zero contribution is thus forced by the original transform. -/ +theorem movingSlotSpectator_zero {σ : Type*} {q : ℕ} [Fact q.Prime] + (value : σ → ℕ) (g : ZMod q → ℂ) (hg : g 0 = 0) (D : (ZMod q)ˣ) + {n : ℕ} (T : MovingSlotData σ n) (XL XR : ℕ) + (hzero : (XL : ZMod q) = 0 ∨ (XR : ZMod q) = 0) : + movingSlotSpectator value g D T XL XR = 0 := by + induction T generalizing XL XR with + | leaf s regular => + rcases hzero with h | h <;> + simp only [movingSlotSpectator, Nat.cast_mul, h, zero_mul, mul_zero, div_zero, hg] + | node s CL CR U left right ihL ihR => + simp only [movingSlotSpectator] + split_ifs + · rfl + · rcases hzero with h | h + · rw [ihL _ _ (Or.inr h), zero_mul] + · rw [ihR _ _ (Or.inr h), star_zero, mul_zero] + +/-- For the actual transforms (which vanish at zero), no extra hypothesis +that the composite pivot is a unit is needed for spectator factorization. -/ +theorem movingSlotWeight_spectator_of_zero {σ : Type*} {q : ℕ} [Fact q.Prime] + (value : σ → ℕ) (childBound pivotBound : ℕ → ℕ) + (F : MovingSlotState σ → ℤ → ℂ) + (extra : MovingSlotState σ → ℤ → ℤ → ℤ → ℝ) + (g : ZMod q → ℂ) (hg : g 0 = 0) (D : (ZMod q)ˣ) + {n : ℕ} (T : MovingSlotData σ n) (t : FrequencyTree ℤ n) (hT : T.Follows t) + (XL XR : ℕ) : + recursiveTransferWeight (movingSlotSystem value childBound pivotBound) + (fun x s => F x s * spectatorHistoryLeaf (movingSlotModulus value) g D x s) + (movingSlotCutoff value childBound pivotBound extra) n ⟨n, T, XL, XR⟩ t = + recursiveTransferWeight (movingSlotSystem value childBound pivotBound) F + (movingSlotCutoff value childBound pivotBound extra) n ⟨n, T, XL, XR⟩ t * + movingSlotSpectator value g D T XL XR := by + let sys := movingSlotSystem value childBound pivotBound + let cutoff := movingSlotCutoff value childBound pivotBound extra + induction T generalizing XL XR with + | leaf s regular => + have hs : s = t := hT + simp only [recursiveTransferWeight, spectatorHistoryLeaf, movingSlotModulus, + movingSlotSpectator, hs] + | @node n s CL CR u left right ihL ihR => + let x : MovingSlotState σ := ⟨n + 1, .node s CL CR u left right, XL, XR⟩ + by_cases hw : recursiveTransferWeight sys F cutoff (n + 1) x t = 0 + · rw [recursiveTransferWeight_mul_leaf] + change recursiveTransferWeight sys F cutoff (n + 1) x t * _ = + recursiveTransferWeight sys F cutoff (n + 1) x t * _ + rw [hw, zero_mul, zero_mul] + · obtain ⟨P, hvalid, _, _⟩ := recursiveTransferWeight_nonzero_valid sys F cutoff _ x t hw + have hnode := recursiveTransferWeight_node sys F cutoff n x t P hvalid + have hcut : cutoff x t.1 (frequencyRoot n t.2.1) (frequencyRoot n t.2.2) ≠ 0 := by + intro hz + apply hw + rw [hnode, hz, Complex.ofReal_zero, zero_mul, zero_mul] + have hdiv : 0 < MovingSlotReversal.naturalProduct value u ∧ + MovingSlotReversal.naturalProduct value u ∣ P := by + by_contra hd + apply hcut + change (if 0 < MovingSlotReversal.naturalProduct value u ∧ + MovingSlotReversal.naturalProduct value u ∣ historyPivot sys x t.1 _ _ then _ else 0) = 0 + rw [hvalid.historyPivot_eq] + exact ite_eq_right hd + let p := P / MovingSlotReversal.naturalProduct value u + have hP : P = MovingSlotReversal.naturalProduct value u * p := + (Nat.mul_div_cancel' hdiv.2).symm + have hrel : left.frequency * ((XR * MovingSlotReversal.naturalProduct value CR : ℕ) : ℤ) - + right.frequency * ((XL * MovingSlotReversal.naturalProduct value CL : ℕ) : ℤ) = + s * ((MovingSlotReversal.naturalProduct value u * p : ℕ) : ℤ) := by + simpa only [sys, movingSlotSystem, MovingSlotState.leftProduct, MovingSlotState.rightProduct, + x, ← hT.1, ← hT.2.1.root, ← hT.2.2.root, hP, Int.cast_natCast] using hvalid.relation + have hnat : (MovingSlotData.step s CL CR u left right false).naturalPivot value XL XR = p := by + unfold MovingSlotReversal.naturalPivot movingGiantPivot + simp only [MovingSlotData.step, Nat.mul_one] + rw [reconstructedPivot_of_eq _ _ (by simpa only [← hT.1] using hvalid.root_ne_zero) + (MovingSlotReversal.naturalProduct value u * p) hrel] + exact Nat.mul_div_cancel_left p hdiv.1 + rw [recursiveTransferWeight_node _ _ _ _ _ _ P hvalid, hnode] + change (cutoff x t.1 _ _ : ℂ) * + recursiveTransferWeight sys (fun x s => F x s * spectatorHistoryLeaf (movingSlotModulus value) g D x s) + cutoff n ⟨n, left, p, XL⟩ t.2.1 * + star (recursiveTransferWeight sys (fun x s => F x s * spectatorHistoryLeaf (movingSlotModulus value) g D x s) + cutoff n ⟨n, right, p, XR⟩ t.2.2) = + ((cutoff x t.1 _ _ : ℂ) * recursiveTransferWeight sys F cutoff n ⟨n, left, p, XL⟩ t.2.1 * + star (recursiveTransferWeight sys F cutoff n ⟨n, right, p, XR⟩ t.2.2)) * _ + rw [ihL t.2.1 hT.2.1 p XL, ihR t.2.2 hT.2.2 p XR] + rw [movingSlotSpectator, hnat] + by_cases hp : (p : ZMod q) = 0 + · rw [ite_eq_left hp, mul_zero, movingSlotSpectator_zero value g hg D left p XL (Or.inl hp), mul_zero, mul_zero] + simp only [zero_mul] + · rw [ite_eq_right hp, star_mul] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MovingZeroFrequency.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MovingZeroFrequency.lean new file mode 100644 index 0000000000000000000000000000000000000000..53face09df0e0f615d67f83037e1b566378a8aa9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MovingZeroFrequency.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.MovingFrequencyPrimeSquare +import OAI.NumberTheory.Ostmann.Construction.WordTransferFullPeriod + +namespace OAI + +/-! # Zero frequencies vanish in the original sampled histories -/ + +namespace Ostmann +open scoped Classical BigOperators SchwartzMap + +theorem recursiveTransferWeight_nonzero_frequencies {State : Type*} + (sys : TransferHistorySystem State) (leaf : State → ℤ → ℂ) + (cutoff : State → ℤ → ℤ → ℤ → ℝ) (hleaf : ∀ x, leaf x 0 = 0) + (n : ℕ) (x : State) (t : FrequencyTree ℤ n) + (ht : recursiveTransferWeight sys leaf cutoff n x t ≠ 0) : + ∀ s ∈ allFrequencyList n t, s ≠ 0 := by + induction n generalizing x with + | zero => + intro s hs + have hst : s = t := by simpa only [allFrequencyList, List.mem_singleton] using hs + subst s + intro hz + subst t + exact ht (hleaf x) + | succ n ih => + obtain ⟨P, hP, _, _⟩ := recursiveTransferWeight_nonzero_valid sys leaf cutoff _ x t ht + rw [recursiveTransferWeight_node sys leaf cutoff n x t P hP] at ht + have hL : recursiveTransferWeight sys leaf cutoff n (sys.leftState x P) t.2.1 ≠ 0 := by + intro hz + exact ht (by rw [hz, mul_zero, zero_mul]) + have hR : recursiveTransferWeight sys leaf cutoff n (sys.rightState x P) t.2.2 ≠ 0 := by + intro hz + exact ht (by rw [hz, star_zero, mul_zero]) + intro s hs + simp only [allFrequencyList, List.mem_cons, List.mem_append] at hs + rcases hs with rfl | hs | hs + · exact hP.root_ne_zero + · exact ih _ _ hL s hs + · exact ih _ _ hR s hs + +theorem movingSupportedSampledWeight_zero_frequency {σ : Type*} [Fintype σ] + (value : σ → ℕ) (outside : List ℕ) (μ : ℕ → σ → ℝ) + (childBound pivotBound : ℕ → ℕ) (F : MovingSlotState σ → ℤ → ℂ) + (E : MovingSlotState σ → ℤ → ℤ → ℤ → ℝ) (hF : ∀ x, F x 0 = 0) + (n : ℕ) (t : FrequencyTree ℤ n) (small bulk : TreeLeafTuple (List σ) n) + (XL XR : ℕ) (hz : ¬ ∀ s ∈ allFrequencyList n t, s ≠ 0) : + movingSupportedSampledWeight value outside μ childBound pivotBound F E + n t small bulk XL XR = 0 := by + unfold movingSupportedSampledWeight movingSampledWeight + apply Finset.sum_eq_zero + intro a _ + suffices h : recursiveTransferWeight (movingSlotSystem value childBound pivotBound) + (movingGuardedLeaf value outside F) + (movingSlotCutoff value childBound pivotBound + (movingLocalExtra + (movingGuardedExtra value outside (movingLocalExtra (movingCompensatedExtra value E))))) + n ⟨n, buildMovingSlotData n t small bulk a, XL, XR⟩ t = 0 by + rw [h, mul_zero] + by_contra hn + apply hz + apply recursiveTransferWeight_nonzero_frequencies _ _ _ _ n _ t hn + intro x + simp only [movingGuardedLeaf, hF, ite_self] + +theorem movingOriginalSampleAverage_zero_frequency {σ I : Type} [Fintype σ] + (q : I → ℕ) [∀ i, Fact (q i).Prime] (value : σ → ℕ) (outside : List ℕ) + (μ : ℕ → σ → ℝ) (childBound pivotBound : ℕ → ℕ) + (F : {n : ℕ} → MovingSlotData σ n → ℤ → ℂ) + (hF : ∀ n (T : MovingSlotData σ n), F T 0 = 0) + (g : ∀ i, ZMod (q i) → ℂ) (Dq : ∀ i, (ZMod (q i))ˣ) (S : Finset I) + (ψ : 𝓢(ℝ, ℂ)) (X lo hi : ℝ) (φ : ℝ → ℝ) (G : ℕ → ℝ) + (n : ℕ) (t : FrequencyTree ℤ n) (small bulk : TreeLeafTuple (List σ) n) + (XL XR : ℕ) (hz : ¬ ∀ s ∈ allFrequencyList n t, s ≠ 0) : + movingOriginalSampleAverage q value outside μ childBound pivotBound F g Dq S ψ X lo hi φ G + n t small bulk XL XR = 0 := by + rw [movingOriginalSampleAverage_eq] + apply movingSupportedSampledWeight_zero_frequency value outside μ childBound pivotBound + _ _ _ n t small bulk XL XR hz + intro x + simp only [movingOriginalLeaf, movingWindowLeaf, movingDataLeaf, hF, ite_self, + zero_mul] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MultiplicityLog.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MultiplicityLog.lean new file mode 100644 index 0000000000000000000000000000000000000000..04fdd9eafe75d6815ea824b10308f3b16da1b637 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/MultiplicityLog.lean @@ -0,0 +1,49 @@ +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring +import OAI.NumberTheory.Ostmann.ZeroDensity.OccurrenceCount + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +namespace Ostmann.ZeroDensity + +theorem exists_localMultiplicity_log_constant : + ∃ C : ℝ, 0 < C ∧ ∀ Q H : ℕ, 0 < Q → 0 < H → + localMultiplicityBound Q (H : ℝ) ≤ C*(1+Real.log ((Q : ℝ)*H)) := by + let A : ℝ := 32*Erdos970.Erdos970Dependency.SiegelWalfisz.absoluteZetaTwo + let L : ℝ := Real.log (55/52) + have hB := Erdos970.Erdos970Dependency.SiegelWalfisz.one_le_absoluteZetaTwo + have hA : 1 ≤ A := by dsimp [A]; linarith + have hApos : 0 < A := lt_of_lt_of_le zero_lt_one hA + have hlogA : 0 ≤ Real.log A := Real.log_nonneg hA + have hL : 0 < L := Real.log_pos (by norm_num : (1 : ℝ)<55/52) + refine ⟨(Real.log A+1)/L, by positivity, ?_⟩ + intro Q H hQ hH + have hQR : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hHR : (1 : ℝ) ≤ H := by exact_mod_cast hH + have hQH : (1 : ℝ) ≤ (Q : ℝ)*H := by nlinarith + have hlog : 0 ≤ Real.log ((Q : ℝ)*H) := Real.log_nonneg hQH + calc + localMultiplicityBound Q (H : ℝ) ≤ Real.log (A*((Q : ℝ)*H))/L := by + apply div_le_div_of_nonneg_right _ hL.le + apply Real.log_le_log (by positivity) + dsimp [A] + nlinarith [mul_nonneg (show 0 ≤ Erdos970.Erdos970Dependency.SiegelWalfisz.absoluteZetaTwo*(Q : ℝ) by positivity) + (show 0 ≤ (H : ℝ)-1 by linarith)] + _ = (Real.log A+Real.log ((Q : ℝ)*H))/L := by + rw [Real.log_mul (ne_of_gt hApos) (by positivity)] + _ ≤ ((Real.log A+1)/L)*(1+Real.log ((Q : ℝ)*H)) := by + rw [div_mul_eq_mul_div] + apply div_le_div_of_nonneg_right _ hL.le + nlinarith [mul_nonneg hlogA hlog] + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonexceptionalRieszBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonexceptionalRieszBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..6d86b7cbaf6e984e49d0d9eee266048d986839fd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonexceptionalRieszBound.lean @@ -0,0 +1,81 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszRectangleBound +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroFreeLogDerivative + +namespace OAI + +/-! # The nonexceptional Riesz estimate from the actual zero-free region -/ + +namespace Ostmann + +open Complex Set +open scoped Interval + +theorem nonexceptional_character_riesz_bound : ∃ c A B E : ℝ, + 0 < c ∧ c ≤ 1 / 4 ∧ 0 < A ∧ 0 < B ∧ 0 < E ∧ + ∀ Q : ℕ, 101 ≤ Q → ∀ T : ℝ, 2 ≤ T → + ∃ exception : Option PrimitiveComplexCharacter, + ∀ χ : PrimitiveComplexCharacter, χ.modulus ≤ Q → some χ ≠ exception → + ∀ X b : ℝ, 1 ≤ X → 1 < b → b ≤ 2 → + let H := Real.log (2 * (Q : ℝ) * (T + 2)) + ‖characterRieszMean χ X‖ ≤ A * H ^ 2 * X ^ (1 - c / H) + + B * H ^ 2 * X ^ b / T ^ 2 + 2 * (1 / (b - 1) + E) * X ^ b / T := by + obtain ⟨c0, M0, hc0, hM0, hdata⟩ := character_zero_free_logDeriv_data + obtain ⟨K, E, hK, hE, hrect⟩ := characterRieszMean_rectangle_bound + let c := min c0 (1 / 4) + have hc : 0 < c := lt_min hc0 (by norm_num) + have hcc0 : c ≤ c0 := min_le_left _ _ + have hc4 : c ≤ 1 / 4 := min_le_right _ _ + refine ⟨c, K * M0, 4 * M0, E, hc, hc4, by positivity, by positivity, hE, ?_⟩ + intro Q hQ T hT + obtain ⟨exception, he⟩ := hdata Q hQ T hT + refine ⟨exception, ?_⟩ + intro χ hχ hne X b hX hb hb2 + dsimp only + let H := Real.log (2 * (Q : ℝ) * (T + 2)) + let a := 1 - c / H + have hH : 1 ≤ H := conductor_height_log_ge_one Q (by omega) (T + 2) (by linarith) + have hHp : 0 < H := by linarith + have ha : 1 / 2 ≤ a := by + have hh : c / H ≤ 1 / 4 := calc + c / H ≤ c / 1 := div_le_div_of_nonneg_left hc.le (by norm_num) hH + _ ≤ 1 / 4 := by simpa using hc4 + dsimp [a] + linarith + have ha1 : a ≤ 1 := by + have hh : 0 ≤ c / H := by positivity + dsimp [a] + linarith + have hab : a ≤ b := ha1.trans hb.le + have hpoint (z : ℂ) (hz : z ∈ uIcc a b ×ℂ uIcc (-T) T) : + χ.L z ≠ 0 ∧ ‖logDeriv χ.L z‖ ≤ M0 * H ^ 2 := by + have hzre : a ≤ z.re ∧ z.re ≤ b := by simpa [uIcc_of_le hab] using hz.1 + have hzim : -T ≤ z.im ∧ z.im ≤ T := by + simpa [uIcc_of_le (show -T ≤ T by linarith)] using hz.2 + have hf := div_le_div_of_nonneg_right hcc0 hHp.le + apply he χ hχ hne z + · change 1 - c0 / H ≤ z.re + dsimp [a] at hzre + linarith + · exact hzre.2.trans hb2 + · exact abs_le.mpr hzim + have hr := hrect χ X a b T (M0 * H ^ 2) hX ha hab hb hb2 + (by linarith) (by positivity) (fun z hz => (hpoint z hz).1) (fun z hz => (hpoint z hz).2) + have hlen : b - a ≤ 2 := by linarith + have hterm : 2 * (M0 * H ^ 2 * X ^ b / T ^ 2) * (b - a) ≤ + 4 * M0 * H ^ 2 * X ^ b / T ^ 2 := by + have hh := mul_le_mul_of_nonneg_left hlen + (by positivity : 0 ≤ 2 * (M0 * H ^ 2 * X ^ b / T ^ 2)) + convert hh using 1 + ring + calc + _ ≤ K * (M0 * H ^ 2) * X ^ a + + 2 * (M0 * H ^ 2 * X ^ b / T ^ 2) * (b - a) + + 2 * (1 / (b - 1) + E) * X ^ b / T := hr + _ ≤ K * (M0 * H ^ 2) * X ^ a + + 4 * M0 * H ^ 2 * X ^ b / T ^ 2 + + 2 * (1 / (b - 1) + E) * X ^ b / T := by linarith + _ = _ := by dsimp [a, H]; ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonexceptionalRieszDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonexceptionalRieszDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..0a154a29b51bffe4da220450524e9e4caf16d3f6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonexceptionalRieszDecay.lean @@ -0,0 +1,81 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszExponentialParameters + +namespace OAI + +/-! # Exponential decay for the actual nonexceptional Riesz means -/ + +namespace Ostmann + +open Filter + +theorem riesz_height_log_bound (y : ℝ) (hy : 5 ≤ y) (Q : ℕ) + (hQ : 1 ≤ Q) (hQy : (Q : ℝ) ≤ Real.exp y) : + 0 < Real.log (2 * (Q : ℝ) * (Real.exp y + 2)) ∧ + Real.log (2 * (Q : ℝ) * (Real.exp y + 2)) ≤ 3 * y := by + have hQr : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hT : 2 ≤ Real.exp y := by linarith [Real.add_one_le_exp y] + have hpos : 1 < 2 * (Q : ℝ) * (Real.exp y + 2) := by nlinarith + refine ⟨Real.log_pos hpos, ?_⟩ + have hprod : 2 * (Q : ℝ) * (Real.exp y + 2) ≤ 4 * (Real.exp y) ^ 2 := by + nlinarith [Real.exp_pos y] + calc + _ ≤ Real.log (4 * (Real.exp y) ^ 2) := Real.log_le_log (by linarith) hprod + _ = Real.log 4 + 2 * y := by rw [Real.log_mul (by norm_num) (by positivity), + Real.log_pow, Real.log_exp]; norm_num + _ ≤ 3 * y := by linarith [Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 4)] + +theorem nonexceptional_character_riesz_decay : ∃ d : ℝ, 0 < d ∧ + ∀ᶠ y : ℝ in atTop, ∀ Q : ℕ, 101 ≤ Q → (Q : ℝ) ≤ Real.exp y → + ∃ exception : Option PrimitiveComplexCharacter, + ∀ χ : PrimitiveComplexCharacter, χ.modulus ≤ Q → some χ ≠ exception → + ‖characterRieszMean χ (Real.exp (y ^ 2))‖ ≤ + 3 * Real.exp (y ^ 2 - d * y) := by + obtain ⟨c, A, B, E, hc, hc4, hA, hB, hE, hbound⟩ := nonexceptional_character_riesz_bound + refine ⟨c / 6, by positivity, ?_⟩ + filter_upwards [riesz_exponential_error c A B E hc hc4 hA.le hB.le hE.le, + eventually_ge_atTop (5 : ℝ)] with y hy hy5 + intro Q hQ hQy + have hy0 : 0 < y := by linarith + have hT : 2 ≤ Real.exp y := by linarith [Real.add_one_le_exp y] + obtain ⟨exception, he⟩ := hbound Q hQ (Real.exp y) hT + refine ⟨exception, ?_⟩ + intro χ hχ hne + have hb1 : 1 < 1 + 1 / y ^ 2 := by + have hh : 0 < 1 / y ^ 2 := by positivity + linarith + have hb2 : 1 + 1 / y ^ 2 ≤ 2 := by + have hys : 1 ≤ y ^ 2 := by nlinarith + have hh : 1 / y ^ 2 ≤ 1 := (div_le_one (by positivity)).mpr hys + linarith + have hr := he χ hχ hne (Real.exp (y ^ 2)) (1 + 1 / y ^ 2) + (Real.one_le_exp (sq_nonneg y)) hb1 hb2 + obtain ⟨hH, hHy⟩ := riesz_height_log_bound y hy5 Q (by omega) hQy + exact hr.trans (hy _ hH hHy) + +theorem nonexceptional_character_riesz_sqrt_decay : ∃ d : ℝ, 0 < d ∧ + ∀ᶠ X : ℝ in atTop, ∀ Q : ℕ, 101 ≤ Q → + (Q : ℝ) ≤ Real.exp (Real.sqrt (Real.log X)) → + ∃ exception : Option PrimitiveComplexCharacter, + ∀ χ : PrimitiveComplexCharacter, χ.modulus ≤ Q → some χ ≠ exception → + ‖characterRieszMean χ X‖ ≤ + 3 * X * Real.exp (-d * Real.sqrt (Real.log X)) := by + obtain ⟨d, hd, h⟩ := nonexceptional_character_riesz_decay + refine ⟨d, hd, ?_⟩ + have ht := Real.tendsto_sqrt_atTop.comp Real.tendsto_log_atTop + filter_upwards [ht.eventually h, eventually_ge_atTop (1 : ℝ)] with X hX hX1 + have hx : 0 < X := by linarith + have heq : Real.exp ((Real.sqrt (Real.log X)) ^ 2) = X := by + rw [Real.sq_sqrt (Real.log_nonneg hX1), Real.exp_log hx] + intro Q hQ hQX + obtain ⟨exception, he⟩ := hX Q hQ hQX + refine ⟨exception, ?_⟩ + intro χ hχ hne + have hh := he χ hχ hne + dsimp only [Function.comp_apply] at hh + rw [heq, Real.exp_sub, Real.sq_sqrt (Real.log_nonneg hX1), Real.exp_log hx, + div_eq_mul_inv, ← Real.exp_neg] at hh + simpa only [mul_assoc, neg_mul] using hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonprincipalLogDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonprincipalLogDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..a9d55b8f93c4639db2dcb75f94a177c87e57358a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonprincipalLogDerivative.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterHadamardBounds +import OAI.NumberTheory.Ostmann.ZeroDensity.ImprimitiveEulerBound + +namespace OAI + +/-! # The logarithmic-derivative lower bound at an arbitrary character level -/ + +namespace Ostmann + +open Complex + +noncomputable def primitiveOfNonprincipal {q : ℕ} [NeZero q] + (χ : DirichletCharacter ℂ q) (hχ : χ ≠ 1) : PrimitiveComplexCharacter where + modulus := χ.conductor + positive := Nat.pos_of_ne_zero χ.conductor_ne_zero + character := χ.primitiveCharacter + primitive := χ.primitiveCharacter_isPrimitive + nontrivial := by + intro he + apply hχ + rw [← χ.changeLevel_primitiveCharacter, he, DirichletCharacter.changeLevel_one] + +theorem primitiveOfNonprincipal_logDeriv_difference {q : ℕ} [NeZero q] + (χ : DirichletCharacter ℂ q) (hχ : χ ≠ 1) (s : ℂ) (hs : 1 < s.re) : + ‖logDeriv (DirichletCharacter.LFunction χ) s - + logDeriv (primitiveOfNonprincipal χ hχ).L s‖ ≤ Real.log q := by + let : NeZero χ.conductor := ⟨χ.conductor_ne_zero⟩ + have hh := logDeriv_changeLevel_bound χ.primitiveCharacter χ.conductor_dvd_level s hs + rw [χ.changeLevel_primitiveCharacter] at hh + exact hh + +/-- Only a logarithmic modulus loss is incurred by imprimitive characters. -/ +theorem exists_nonprincipal_logDeriv_real_lower : ∃ B : ℝ, 0 < B ∧ + ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), χ ≠ 1 → + ∀ s : ℂ, 1 < s.re → s.re ≤ 2 → + -(3 / 2) * Real.log q - B * Real.log (|s.im| + 2) ≤ + (logDeriv (DirichletCharacter.LFunction χ) s).re := by + obtain ⟨B, hB, hb⟩ := exists_character_logDeriv_real_lower + refine ⟨B, hB, ?_⟩ + intro q _ χ hχ s hs hs2 + have hprimitive := hb (primitiveOfNonprincipal χ hχ) s hs hs2 + have herr := primitiveOfNonprincipal_logDeriv_difference χ hχ s hs + have hre := Complex.re_le_norm (-(logDeriv (DirichletCharacter.LFunction χ) s - + logDeriv (primitiveOfNonprincipal χ hχ).L s)) + rw [Complex.neg_re, Complex.sub_re, norm_neg] at hre + have hlog : Real.log χ.conductor ≤ Real.log q := + Real.log_le_log (by exact_mod_cast Nat.pos_of_ne_zero χ.conductor_ne_zero) + (by exact_mod_cast Nat.le_of_dvd (NeZero.pos q) χ.conductor_dvd_level) + change -(1 / 2) * Real.log χ.conductor - B * Real.log (|s.im| + 2) ≤ _ at hprimitive + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonquadraticZeroBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonquadraticZeroBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7a9de3be4e950435986be384d526cc8fdd571ec --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonquadraticZeroBound.lean @@ -0,0 +1,63 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.NonprincipalLogDerivative +import OAI.NumberTheory.Ostmann.ZeroDensity.ComplexCharacterTrigonometric + +namespace OAI + +/-! # The full-height zero-sum bound when the squared character is nonprincipal -/ + +namespace Ostmann + +open Complex + +theorem log_double_abs_height_le (t : ℝ) : + Real.log (|2 * t| + 2) ≤ 2 * Real.log (|t| + 2) := by + have ht : 0 ≤ |t| := abs_nonneg t + have hl : Real.log 2 ≤ Real.log (|t| + 2) := + Real.log_le_log (by norm_num) (by linarith) + calc + Real.log (|2 * t| + 2) ≤ Real.log (2 * (|t| + 2)) := by + apply Real.log_le_log (by positivity) + rw [abs_mul] + norm_num + linarith + _ = Real.log 2 + Real.log (|t| + 2) := Real.log_mul (by norm_num) (by positivity) + _ ≤ 2 * Real.log (|t| + 2) := by linarith + +theorem exists_nonquadratic_zero_sum_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter), χ.character ^ 2 ≠ 1 → + ∀ σ t : ℝ, 1 < σ → σ ≤ 2 → + 4 * characterRealZeroSum χ ((σ : ℂ) + (t : ℂ) * I) ≤ + 3 / (σ - 1) + C * (Real.log χ.modulus + Real.log (|t| + 2) + 1) := by + obtain ⟨B, hB, hb⟩ := exists_nonprincipal_logDeriv_real_lower + obtain ⟨G, hG, hg⟩ := exists_character_zero_sum_log_bound + obtain ⟨V, hV, hv⟩ := exists_vonMangoldt_series_bound + refine ⟨4 * G + 2 * B + 4 * V + 4, by positivity, ?_⟩ + intro χ hχ σ t hσ hσ2 + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + have hp := complex_character_trigonometric_sum_nonneg χ.character σ t hσ + rw [dirichlet_mangoldt_LSeries_eq _ _ (by simpa using hσ), + dirichlet_mangoldt_LSeries_eq _ _ (by simpa using hσ), Complex.neg_re, Complex.neg_re] at hp + have hh := hg χ ((σ : ℂ) + (t : ℂ) * I) (by simpa using hσ) (by simpa using hσ2) + have hd := hb χ.modulus (χ.character ^ 2) hχ + ((σ : ℂ) + ((2 * t : ℝ) : ℂ) * I) (by simpa using hσ) (by simpa using hσ2) + have hvr := (Complex.re_le_norm _).trans (hv σ hσ hσ2) + have hlog := log_double_abs_height_le t + have hq : 0 ≤ Real.log χ.modulus := Real.log_nonneg (by exact_mod_cast χ.positive) + have ht : 0 ≤ Real.log (|t| + 2) := Real.log_nonneg (by linarith [abs_nonneg t]) + simp only [Complex.add_im, Complex.mul_im, Complex.ofReal_im, Complex.I_im, + Complex.ofReal_re, Complex.I_re, mul_one, mul_zero, add_zero, zero_add] at hh hd + change 4 * characterRealZeroSum χ _ ≤ _ + change characterRealZeroSum χ _ ≤ + (logDeriv (DirichletCharacter.LFunction χ.character) _).re + + (1 / 2) * Real.log χ.modulus + G * Real.log (|t| + 2) at hh + have hBlog := mul_le_mul_of_nonneg_left hlog hB.le + have hGq := mul_nonneg hG.le hq + have hBq := mul_nonneg hB.le hq + have hVq := mul_nonneg hV.le hq + have hVt := mul_nonneg hV.le ht + simp only [div_eq_mul_inv] at hvr ⊢ + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonquadraticZeroRegion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonquadraticZeroRegion.lean new file mode 100644 index 0000000000000000000000000000000000000000..99cf7c9c619aa23abe25a1b9ed4fba775f0b90e9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/NonquadraticZeroRegion.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.NonquadraticZeroBound +import OAI.NumberTheory.Ostmann.ZeroDensity.ZeroFreeNumerics + +namespace OAI + +/-! # An unconditional logarithmic zero-free region for nonquadratic characters -/ + +namespace Ostmann + +open Complex + +theorem exists_nonquadratic_zero_free_region : ∃ c : ℝ, 0 < c ∧ + ∀ (χ : PrimitiveComplexCharacter), χ.character ^ 2 ≠ 1 → ∀ i : ℕ, + c / (Real.log χ.modulus + Real.log (|((actualCharacterZeros χ).zeros i).im| + 2) + 1) ≤ + 1 - ((actualCharacterZeros χ).zeros i).re := by + obtain ⟨C, hC, hb⟩ := exists_nonquadratic_zero_sum_bound + refine ⟨1 / (2000 * (C + 1)), by positivity, ?_⟩ + intro χ hχ i + let ρ := (actualCharacterZeros χ).zeros i + let H := Real.log χ.modulus + Real.log (|ρ.im| + 2) + 1 + let δ := 1 / (100 * (C + 1) * H) + have hq : 0 ≤ Real.log χ.modulus := Real.log_nonneg (by exact_mod_cast χ.positive) + have ht : 0 ≤ Real.log (|ρ.im| + 2) := Real.log_nonneg (by linarith [abs_nonneg ρ.im]) + have hH : 1 ≤ H := by dsimp [H]; linarith + have hHp : 0 < H := lt_of_lt_of_le zero_lt_one hH + have hδ : 0 < δ := by dsimp [δ]; positivity + have hδ1 : δ ≤ 1 := by + dsimp [δ] + apply (div_le_iff₀ (by positivity)).mpr + nlinarith + have hbudget : δ * (C * H) ≤ 1 / 100 := by + dsimp [δ] + have he : (1 / (100 * (C + 1) * H)) * (C * H) = C / (100 * (C + 1)) := by + field_simp + rw [he] + apply (div_le_iff₀ (by positivity)).mpr + linarith + have hcut : (1 / (2000 * (C + 1))) / H = δ / 20 := by + dsimp [δ] + field_simp + ring + rw [hcut] + by_contra hnot + have hnear : 1 - δ / 20 ≤ ρ.re := by dsimp [ρ]; linarith [lt_of_not_ge hnot] + let a := 1 + δ - ρ.re + let s : ℂ := ((1 + δ : ℝ) : ℂ) + (ρ.im : ℂ) * I + have ha : δ ≤ a := by dsimp [a]; linarith [((actualCharacterZeros χ).in_strip i).2] + have ha' : a ≤ (21 / 20) * δ := by dsimp [a]; linarith + have hterm := character_real_zero_term_le χ s (by dsimp [s]; simp; linarith) + (by dsimp [s]; simp; linarith) i + have hdiff : s - (actualCharacterZeros χ).zeros i = (a : ℂ) := by + apply Complex.ext <;> simp [s, a, ρ] + rw [hdiff, ← Complex.ofReal_inv, Complex.ofReal_re] at hterm + have hupper := hb χ hχ (1 + δ) ρ.im (by linarith) (by linarith) + have hup : 4 * characterRealZeroSum χ s ≤ 3 / δ + C * H := by + simpa only [add_sub_cancel_left] using hupper + have hp := mul_le_mul_of_nonneg_left + ((mul_le_mul_of_nonneg_left hterm (by norm_num : (0 : ℝ) ≤ 4)).trans hup) hδ.le + have he : δ * (3 / δ + C * H) = 3 + δ * (C * H) := by field_simp + rw [he] at hp + have hm := real_zero_shifted_mass δ a hδ ha ha' + simp only [div_eq_mul_inv] at hm + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OccurrenceCount.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OccurrenceCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..58a259c7f4a5023d00088562bc7d90735216df82 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OccurrenceCount.lean @@ -0,0 +1,129 @@ +import Mathlib.Data.Fintype.BigOperators +import OAI.NumberTheory.Ostmann.Dirichlet.UniformZeroCount +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualZeros + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open scoped BigOperators Classical +namespace Ostmann.ZeroDensity + +theorem card_occurrences_eq_sum (Q : ℕ) (T : ℝ) + (χ : NonprincipalPrimitiveFamily Q) (P : ℂ → Prop) : + ((Finset.univ.filter (fun z : ZeroOccurrence Q T => z.1 = χ ∧ P z.point)).card) = + ∑ ρ ∈ (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).toFinset.filter P, + Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ := by + classical + let (ψ : NonprincipalPrimitiveFamily Q) : + Fintype {ρ : ℂ // ρ ∈ Ostmann.Dirichlet.zerosUpTo ψ.1.2.1 T} := + (Ostmann.Dirichlet.zerosUpTo_finite ψ.1.2.1 ψ.2 T).fintype + rw [Finset.card_eq_sum_ones, Finset.sum_filter] + change (∑ z : (Σ ψ : NonprincipalPrimitiveFamily Q, + Σ ρ : {ρ : ℂ // ρ ∈ Ostmann.Dirichlet.zerosUpTo ψ.1.2.1 T}, + Fin (Ostmann.Dirichlet.zeroMultiplicity ψ.1.2.1 ρ.1)), + if z.1 = χ ∧ P z.2.1.1 then 1 else 0) = _ + simp only [Fintype.sum_sigma, ite_and, Finset.sum_ite_irrel, Finset.sum_const_zero] + simp only [Finset.sum_ite_eq'] + rw [Finset.sum_filter] + symm + convert Finset.sum_subtype + (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).toFinset + (fun ρ => (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).mem_toFinset) + (fun ρ => if P ρ then Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ else 0) using 1 + simp only [Finset.mem_univ, ite_true] + apply Finset.sum_congr rfl + intro ρ _ + by_cases hρ : P ρ.1 <;> simp [hρ] + +theorem local_occurrences_le_log (Q : ℕ) (T : ℝ) + (χ : NonprincipalPrimitiveFamily Q) (t : ℝ) : + ((Finset.univ.filter (fun z : ZeroOccurrence Q T => + z.1 = χ ∧ (1 / 2 ≤ z.point.re ∧ |z.point.im - t| ≤ 1 / 2))).card : ℝ) ≤ + Real.log (4 * Erdos970.Erdos970Dependency.SiegelWalfisz.absoluteZetaTwo * (χ.1.1.val + 1) * (|t| + 6)) / + Real.log (55 / 52) := by + classical + let S := (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).toFinset.filter + (fun ρ => 1 / 2 ≤ ρ.re ∧ |ρ.im - t| ≤ 1 / 2) + have hj := Ostmann.Dirichlet.local_zero_count_le_log χ.1.2.1 χ.2 t S (by + intro ρ hρ + obtain ⟨hz, hre, him⟩ := Finset.mem_filter.mp hρ + have hz' := (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).mem_toFinset.mp hz + exact ⟨hre, hz'.1.2.2.le, him⟩) + calc + _ = ((∑ ρ ∈ S, Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ : ℕ) : ℝ) := by + congr 1 + convert card_occurrences_eq_sum Q T χ + (fun ρ => 1 / 2 ≤ ρ.re ∧ |ρ.im-t| ≤ 1 / 2) using 1 + all_goals congr 1 + all_goals first | rfl | (ext z; simp [S]) + _ = ∑ ρ ∈ S, (Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ : ℝ) := by + push_cast + rfl + _ ≤ _ := by simpa only [Nat.cast_add, Nat.cast_one] using hj + +def localMultiplicityBound (Q : ℕ) (H : ℝ) : ℝ := + Real.log (4 * Erdos970.Erdos970Dependency.SiegelWalfisz.absoluteZetaTwo * Q * (H + 7)) / + Real.log (55 / 52) + +theorem localMultiplicityBound_nonneg {Q : ℕ} (hQ : 1 ≤ Q) {H : ℝ} (hH : 1 ≤ H) : + 0 ≤ localMultiplicityBound Q H := by + have hB := Erdos970.Erdos970Dependency.SiegelWalfisz.one_le_absoluteZetaTwo + have hQR : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hBQ : 1 ≤ Erdos970.Erdos970Dependency.SiegelWalfisz.absoluteZetaTwo * Q := by nlinarith + apply div_nonneg (Real.log_nonneg _) (Real.log_pos (by norm_num : (1 : ℝ) < 55 / 52)).le + nlinarith + +theorem retainedZeros_local_card_le (Q : ℕ) (exception : Option (PrimitiveFamily Q)) + {σ H : ℝ} (hσ : 1 / 2 ≤ σ) (hH : 1 ≤ H) + (χ : NonprincipalPrimitiveFamily Q) (t : ℝ) : + (((retainedZeros Q exception σ H).filter (fun z => + z.1 = χ ∧ |z.point.im - t| ≤ 1 / 2)).card : ℝ) ≤ localMultiplicityBound Q H := by + classical + let s := (retainedZeros Q exception σ H).filter (fun z => + z.1 = χ ∧ |z.point.im - t| ≤ 1 / 2) + have hQ : 1 ≤ Q := by have := χ.1.1.isLt; omega + by_cases hs : s.Nonempty + · obtain ⟨z, hz⟩ := hs + have hzt := (Finset.mem_filter.mp hz).2.2 + have hzH := z.2.1.2.2 + have ht : |t| ≤ H + 1 := by + have habs : |t| ≤ |z.point.im| + |z.point.im - t| := by + have he : t = z.point.im - (z.point.im - t) := by ring + calc + |t| = |z.point.im - (z.point.im - t)| := congrArg abs he + _ ≤ |z.point.im| + |z.point.im - t| := abs_sub _ _ + change |z.point.im| ≤ H at hzH + linarith + have hsub : s ⊆ Finset.univ.filter (fun z : ZeroOccurrence Q H => + z.1 = χ ∧ (1 / 2 ≤ z.point.re ∧ |z.point.im - t| ≤ 1 / 2)) := by + intro z hz + obtain ⟨hretain, heq, him⟩ := Finset.mem_filter.mp hz + have hre := (Finset.mem_filter.mp hretain).2.2 + exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, heq, hσ.trans hre, him⟩ + have hcount := (show (s.card : ℝ) ≤ + ((Finset.univ.filter (fun z : ZeroOccurrence Q H => + z.1 = χ ∧ (1 / 2 ≤ z.point.re ∧ |z.point.im - t| ≤ 1 / 2))).card : ℝ) by + exact_mod_cast Finset.card_le_card hsub).trans (local_occurrences_le_log Q H χ t) + apply hcount.trans + apply div_le_div_of_nonneg_right _ (Real.log_pos (by norm_num : (1 : ℝ) < 55 / 52)).le + have hB := Erdos970.Erdos970Dependency.SiegelWalfisz.one_le_absoluteZetaTwo + have hq : (χ.1.1.val + 1 : ℝ) ≤ Q := by exact_mod_cast (Nat.succ_le_of_lt χ.1.1.isLt) + have hqpos : (0 : ℝ) < χ.1.1.val + 1 := by positivity + apply Real.log_le_log (by positivity) + have h1 := mul_le_mul_of_nonneg_left hq + (show 0 ≤ 4 * Erdos970.Erdos970Dependency.SiegelWalfisz.absoluteZetaTwo by linarith) + exact mul_le_mul h1 (by linarith) (by positivity) (by positivity) + · have hempty : s = ∅ := Finset.not_nonempty_iff_eq_empty.mp hs + change (s.card : ℝ) ≤ _ + rw [hempty, Finset.card_empty, Nat.cast_zero] + exact localMultiplicityBound_nonneg hQ hH + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OccurrenceSum.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OccurrenceSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..e41c86953f0bc0f441330a1bb9ea1ed49c169175 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OccurrenceSum.lean @@ -0,0 +1,57 @@ +import Mathlib.Data.Fintype.BigOperators +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualZeros + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +theorem sum_zeroOccurrences {A : Type*} [AddCommMonoid A] (Q : ℕ) (T : ℝ) + (f : NonprincipalPrimitiveFamily Q → ℂ → A) : + (∑ z : ZeroOccurrence Q T, f z.1 z.point) = + ∑ χ : NonprincipalPrimitiveFamily Q, + ∑ ρ ∈ (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).toFinset, + Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ • f χ ρ := by + classical + let (χ : NonprincipalPrimitiveFamily Q) : + Fintype {ρ : ℂ // ρ ∈ Ostmann.Dirichlet.zerosUpTo χ.1.2.1 T} := + (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).fintype + change (∑ z : (Σ χ : NonprincipalPrimitiveFamily Q, + Σ ρ : {ρ : ℂ // ρ ∈ Ostmann.Dirichlet.zerosUpTo χ.1.2.1 T}, + Fin (Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ.1)), f z.1 z.2.1.1) = _ + simp only [Fintype.sum_sigma] + apply Finset.sum_congr rfl + intro χ hχ + let : Fintype {ρ : ℂ // ρ ∈ Ostmann.Dirichlet.zerosUpTo χ.1.2.1 T} := this χ + symm + convert Finset.sum_subtype + (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).toFinset + (fun ρ => (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).mem_toFinset) + (fun ρ => Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ • f χ ρ) using 1 + swap + · exact this + · apply Finset.sum_congr rfl + intro ρ hρ + change (∑ _i : Fin (Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ.1), f χ ρ.1) = _ + rw [Finset.sum_const, Finset.card_univ, Fintype.card_fin] + +theorem sum_retainedZeros {A : Type*} [AddCommMonoid A] (Q : ℕ) + (exception : Option (PrimitiveFamily Q)) (σ T : ℝ) + (f : NonprincipalPrimitiveFamily Q → ℂ → A) : + (∑ z ∈ retainedZeros Q exception σ T, f z.1 z.point) = + ∑ χ : NonprincipalPrimitiveFamily Q, + ∑ ρ ∈ (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).toFinset, + if some χ.1 ≠ exception ∧ σ ≤ ρ.re then + Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ • f χ ρ else 0 := by + classical + rw [retainedZeros, Finset.sum_filter] + have h := sum_zeroOccurrences Q T (fun χ ρ => + if some χ.1 ≠ exception ∧ σ ≤ ρ.re then f χ ρ else 0) + simpa only [smul_ite, nsmul_zero] using h + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OneZeroBoundaryCut.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OneZeroBoundaryCut.lean new file mode 100644 index 0000000000000000000000000000000000000000..86e1efe842e2a9a8d726ab53e2d7df798f2c2276 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OneZeroBoundaryCut.lean @@ -0,0 +1,71 @@ +import Mathlib.Analysis.Complex.Norm +import Mathlib.Tactic + +namespace OAI + +/-! # Choosing one of two left boundaries away from a unique real zero -/ + +namespace Ostmann + +open Complex + +theorem exists_two_point_cut (δ β : ℝ) (hδ : 0 < δ) : + ∃ a : ℝ, 1 - 2 * δ ≤ a ∧ a ≤ 1 - δ ∧ δ / 2 ≤ |a - β| := by + by_cases hβ : β ≤ 1 - 3 * δ / 2 + · refine ⟨1 - δ, by linarith, le_rfl, ?_⟩ + exact (show δ / 2 ≤ 1 - δ - β by linarith).trans (le_abs_self _) + · refine ⟨1 - 2 * δ, le_rfl, by linarith, ?_⟩ + exact (show δ / 2 ≤ -(1 - 2 * δ - β) by linarith).trans (neg_le_abs _) + +theorem one_zero_boundary_cut (Z : ℕ → ℂ) (δ T : ℝ) + (hδ : 0 < δ) (hδ4 : δ ≤ 1 / 4) (hT : 2 ≤ T) + (hreal : ∀ i, |(Z i).im| ≤ T + 2 → 1 - 4 * δ ≤ (Z i).re → (Z i).im = 0) + (hunique : ∀ i j, |(Z i).im| ≤ T + 2 → |(Z j).im| ≤ T + 2 → + 1 - 4 * δ ≤ (Z i).re → 1 - 4 * δ ≤ (Z j).re → i = j) : + ∃ a : ℝ, 1 - 2 * δ ≤ a ∧ a ≤ 1 - δ ∧ + ∀ s : ℂ, ((s.re = a ∧ |s.im| ≤ T) ∨ (a ≤ s.re ∧ s.re ≤ 2 ∧ |s.im| = T)) → + ∀ i : ℕ, δ / 2 ≤ ‖s - Z i‖ := by + classical + have hcut : ∃ a : ℝ, 1 - 2 * δ ≤ a ∧ a ≤ 1 - δ ∧ + ∀ i, |(Z i).im| ≤ T + 2 → 1 - 4 * δ ≤ (Z i).re → δ / 2 ≤ |a - (Z i).re| := by + by_cases hex : ∃ i, |(Z i).im| ≤ T + 2 ∧ 1 - 4 * δ ≤ (Z i).re + · obtain ⟨i, hi, hni⟩ := hex + obtain ⟨a, ha, ha', hagap⟩ := exists_two_point_cut δ (Z i).re hδ + refine ⟨a, ha, ha', ?_⟩ + intro j hj hnj + have he := hunique j i hj hi hnj hni + simpa only [he] using hagap + · refine ⟨1 - δ, by linarith, le_rfl, ?_⟩ + intro i hi hni + exact (hex ⟨i, hi, hni⟩).elim + obtain ⟨a, ha, ha', hasep⟩ := hcut + refine ⟨a, ha, ha', ?_⟩ + intro s hs i + have hsa : a ≤ s.re := by rcases hs with h | h <;> linarith [h.1] + have hst : |s.im| ≤ T := by + rcases hs with h | h + · exact h.2 + · exact h.2.2.le + by_cases hi : |(Z i).im| ≤ T + 2 + · by_cases hni : 1 - 4 * δ ≤ (Z i).re + · rcases hs with hs | hs + · have hg := hasep i hi hni + have hn := Complex.abs_re_le_norm (s - Z i) + simp only [Complex.sub_re, hs.1] at hn + exact hg.trans hn + · have him := hreal i hi hni + have hn := Complex.abs_im_le_norm (s - Z i) + rw [Complex.sub_im, him, sub_zero, hs.2.2] at hn + linarith + · have hn := Complex.re_le_norm (s - Z i) + simp only [Complex.sub_re] at hn + linarith + · have htall := abs_add_le (s.im - (Z i).im) (-s.im) + rw [show s.im - (Z i).im + -s.im = -(Z i).im by ring, abs_neg, abs_neg] at htall + have hn := Complex.abs_im_le_norm (s - Z i) + simp only [Complex.sub_im] at hn + linarith [lt_of_not_ge hi] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OrdinaryPrimeIntervals.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OrdinaryPrimeIntervals.lean new file mode 100644 index 0000000000000000000000000000000000000000..a383e077027d7b30e09eec2f266ebc19caa3fc27 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OrdinaryPrimeIntervals.lean @@ -0,0 +1,100 @@ +import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedProgressionInputs + +namespace OAI + +/-! # The ordinary prime interval and its normalization + +The conductor-one character is trivial, so the ordinary prime prior has +no Page correction. Its logarithmic interval mass and inverse bound are +derived from the same published theta input. +-/ + +namespace Ostmann + +open Filter MeasureTheory + +theorem PrimitiveRealZero.modulus_ne_one (e : PrimitiveRealZero) : e.modulus ≠ 1 := by + let : NeZero e.modulus := ⟨Nat.ne_of_gt e.positive⟩ + intro h + apply e.nontrivial + exact (DirichletCharacter.eq_one_iff_conductor_eq_one (χ := e.character)).mpr (e.primitive.trans h) + +theorem PublishedProgressionInput.localZero_one (P : PublishedProgressionInput) : + P.localZero 1 = none := by + cases he : P.localZero 1 with + | none => rfl + | some e => exact False.elim (e.modulus_ne_one (Nat.dvd_one.mp (P.divides 1 e he))) + +theorem PublishedProgressionInput.ordinary_log_interval (P : PublishedProgressionInput) + {s t : ℝ} (hs : 1 ≤ s) (hst : s ≤ t) (hshort : t ≤ s + 1) : + |reciprocalPrimeInterval 1 0 (Real.exp s) (Real.exp t) - Real.log (t / s)| ≤ + 18 * P.errorConstant * Real.exp (-P.decay * Real.sqrt s) := by + have h := P.local_log_interval 1 0 (by norm_num) (by norm_num) hs hst hshort + rw [P.localZero_one] at h + simp only [pageCoefficient, pageBeta, Nat.totient_one, Nat.cast_one, + primeLogDensity, zero_mul, sub_zero, one_mul] at h + rw [← intervalIntegral.integral_of_le hst, + integral_one_div_of_pos (by linarith) (by linarith)] at h + exact h + +theorem log_unit_ratio_lower {s : ℝ} (hs : 0 < s) : + 1 / (s + 1) ≤ Real.log ((s + 1) / s) := by + have h := Real.one_sub_inv_le_log_of_pos (x := (s + 1) / s) + (div_pos (by linarith) hs) + have heq : 1 - ((s + 1) / s)⁻¹ = 1 / (s + 1) := by + field_simp + ring + rwa [heq] at h + +theorem theta_log_error_small (C c : ℝ) (hc : 0 < c) : + ∀ᶠ s : ℝ in atTop, + 18 * C * Real.exp (-c * Real.sqrt s) ≤ 1 / (2 * (s + 1)) := by + have hpow := (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero 2 c hc).comp + Real.tendsto_sqrt_atTop + have hlin : Tendsto (fun s : ℝ => s * Real.exp (-c * Real.sqrt s)) atTop (nhds 0) := by + apply hpow.congr' + filter_upwards [eventually_ge_atTop (0 : ℝ)] with s hs + dsimp only [Function.comp_def] + rw [Real.rpow_two, Real.sq_sqrt hs] + have hzero := (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero 0 c hc).comp + Real.tendsto_sqrt_atTop + simp only [Real.rpow_zero, one_mul, Function.comp_def] at hzero + have hsum : Tendsto (fun s : ℝ => + (s + 1) * (18 * C * Real.exp (-c * Real.sqrt s))) atTop (nhds 0) := by + have hb : Tendsto (fun s : ℝ => 18 * C * + (s * Real.exp (-c * Real.sqrt s) + Real.exp (-c * Real.sqrt s))) atTop (nhds 0) := by + simpa only [add_zero, mul_zero] using ((hlin.add hzero).const_mul (18 * C)) + exact hb.congr (fun s => by ring) + filter_upwards [hsum.eventually_lt_const (by norm_num : (0 : ℝ) < 1 / 2), + eventually_ge_atTop (1 : ℝ)] with s hsmall hs + apply (le_div_iff₀ (by positivity : 0 < 2 * (s + 1))).mpr + nlinarith + +theorem PublishedProgressionInput.ordinary_interval_lower (P : PublishedProgressionInput) : + ∀ᶠ s : ℝ in atTop, + 1 / (2 * (s + 1)) ≤ reciprocalPrimeInterval 1 0 (Real.exp s) (Real.exp (s + 1)) := by + filter_upwards [theta_log_error_small P.errorConstant P.decay P.decay_pos, + eventually_ge_atTop (1 : ℝ)] with s herr hs + have h := P.ordinary_log_interval hs (by linarith : s ≤ s + 1) le_rfl + have hlower := log_unit_ratio_lower (by linarith : 0 < s) + have hhalf : 1 / (s + 1) = 2 * (1 / (2 * (s + 1))) := by field_simp + have hh := (abs_le.mp h).1 + linarith + +/-- The normalizing reciprocal costs only a factor linear in the log +coordinate, exactly as required by the arithmetic idealization. -/ +theorem PublishedProgressionInput.ordinary_normalization_bound (P : PublishedProgressionInput) : + ∀ᶠ s : ℝ in atTop, + 0 < reciprocalPrimeInterval 1 0 (Real.exp s) (Real.exp (s + 1)) ∧ + (reciprocalPrimeInterval 1 0 (Real.exp s) (Real.exp (s + 1)))⁻¹ ≤ 2 * (s + 1) := by + filter_upwards [P.ordinary_interval_lower, eventually_ge_atTop (1 : ℝ)] with s hS hs + have hpos : 0 < (1 : ℝ) / (2 * (s + 1)) := by positivity + refine ⟨hpos.trans_le hS, ?_⟩ + have hi := one_div_le_one_div_of_le hpos hS + simpa only [one_div, inv_inv] using hi + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OriginalDensityCorrelation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OriginalDensityCorrelation.lean new file mode 100644 index 0000000000000000000000000000000000000000..7f2491370d33bc2c654f83bb61ea05e2b94b91d1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/OriginalDensityCorrelation.lean @@ -0,0 +1,113 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DensityFourierUnitProduct + +namespace OAI + +/-! # Correlation estimates for the original two divisor transforms -/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +private theorem prime_list_nodup (ps : List ℕ) (hp : ∀ p ∈ ps, p.Prime) + (hc : ps.Pairwise Nat.Coprime) : ps.Nodup := by + induction ps with + | nil => simp + | cons p ps ih => + obtain ⟨hhead, htail⟩ := List.pairwise_cons.mp hc + refine List.nodup_cons.mpr ⟨?_, ih (fun q hq => hp q (List.mem_cons_of_mem p hq)) htail⟩ + intro hmem + have he : p = 1 := by simpa [Nat.Coprime] using hhead p hmem + exact (hp p List.mem_cons_self).ne_one he + +noncomputable def supportCorrelationSide (U V : Finset ℕ) (p : ℕ) : CorrelationSide := + if p ∈ U then if p ∈ V then .both else .left else .right + +private theorem prod_mask_subset {ι : Type*} [DecidableEq ι] (U P : Finset ι) + (hUP : U ⊆ P) (F : ι → ℂ) : + (∏ p ∈ P, if p ∈ U then F p else 1) = ∏ p ∈ U, F p := by + rw [Finset.prod_ite_mem, Finset.inter_eq_right.mpr hUP] + +theorem local_correlation_product (U V P : Finset ℕ) (hP : P = U ∪ V) + (f : ∀ p : ℕ, ZMod p → ℂ) (a b : ∀ p : ℕ, (ZMod p)ˣ) (n : ℤ) : + (∏ p ∈ P, correlationPrimeFactor f (supportCorrelationSide U V) a b p (n : ZMod p)) = + (∏ p ∈ U, primeDensityFourier f p ((a p : ZMod p) * (n : ZMod p))) * + conj (∏ p ∈ V, primeDensityFourier f p ((b p : ZMod p) * (n : ZMod p))) := by + classical + have hf (p : ℕ) (hp : p ∈ P) : + correlationPrimeFactor f (supportCorrelationSide U V) a b p (n : ZMod p) = + (if p ∈ U then primeDensityFourier f p ((a p : ZMod p) * (n : ZMod p)) else 1) * + (if p ∈ V then conj (primeDensityFourier f p ((b p : ZMod p) * (n : ZMod p))) else 1) := by + have hm : p ∈ U ∨ p ∈ V := by simpa only [hP, Finset.mem_union] using hp + unfold correlationPrimeFactor supportCorrelationSide + rcases hm with hu | hv + · by_cases hv : p ∈ V <;> simp [hu, hv] + · by_cases hu : p ∈ U <;> simp [hu, hv] + rw [Finset.prod_congr rfl hf, Finset.prod_mul_distrib, + prod_mask_subset U P (by rw [hP]; exact Finset.subset_union_left), + prod_mask_subset V P (by rw [hP]; exact Finset.subset_union_right), map_prod] + +/-- Both original transforms have one common periodic model. Its coefficient +bound is derived from the local density functions, including their CRT twists. -/ +theorem original_density_correlation_model (ps qs rs : List ℕ) + (hp : ∀ p ∈ ps, p.Prime) (hq : ∀ p ∈ qs, p.Prime) (hr : ∀ p ∈ rs, p.Prime) + (hcp : ps.Pairwise Nat.Coprime) (hcq : qs.Pairwise Nat.Coprime) (hcr : rs.Pairwise Nat.Coprime) + (hrs : rs.toFinset = ps.toFinset ∪ qs.toFinset) + (vp : (ZMod ps.prod)ˣ) (vq : (ZMod qs.prod)ˣ) + (f : ∀ p : ℕ, ZMod p → ℂ) (hf : ∀ p ∈ rs, ∀ x, ‖f p x‖ ≤ 1) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + let : NeZero qs.prod := ⟨(prime_list_prod_pos qs hq).ne'⟩ + let : NeZero rs.prod := ⟨(prime_list_prod_pos rs hr).ne'⟩ + ∃ F : ZMod rs.prod → ℂ, + (∀ n : ℤ, densityFourier (primeCRTFunction ps hp hcp f) ((vp : ZMod ps.prod) * (n : ZMod ps.prod)) * + conj (densityFourier (primeCRTFunction qs hq hcq f) ((vq : ZMod qs.prod) * (n : ZMod qs.prod))) = F (n : ZMod rs.prod)) ∧ + (∀ u, ‖additiveFourier F u‖ ≤ + (rs.map (correlationPrimeBound (supportCorrelationSide ps.toFinset qs.toFinset))).prod) := by + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + let : NeZero qs.prod := ⟨(prime_list_prod_pos qs hq).ne'⟩ + let : NeZero rs.prod := ⟨(prime_list_prod_pos rs hr).ne'⟩ + obtain ⟨a, ha⟩ := densityFourier_primeCRTFunction_unit ps hp hcp f vp + obtain ⟨b, hb⟩ := densityFourier_primeCRTFunction_unit qs hq hcq f vq + refine ⟨primeCRTFunction rs hr hcr + (correlationPrimeFactor f (supportCorrelationSide ps.toFinset qs.toFinset) a b), ?_, ?_⟩ + · intro n + rw [ha, hb, primeCRTFunction_intCast, + ← List.prod_toFinset _ (prime_list_nodup ps hp hcp), + ← List.prod_toFinset _ (prime_list_nodup qs hq hcq), + ← List.prod_toFinset _ (prime_list_nodup rs hr hcr)] + exact (local_correlation_product ps.toFinset qs.toFinset rs.toFinset hrs f a b n).symm + · exact density_correlation_coefficient_bound rs hr hcr f hf _ a b + +/-- The weighted periodic estimate applies to the two CRT divisor transforms. -/ +theorem original_density_correlation_weighted_bound (ps qs rs : List ℕ) + (hp : ∀ p ∈ ps, p.Prime) (hq : ∀ p ∈ qs, p.Prime) (hr : ∀ p ∈ rs, p.Prime) + (hcp : ps.Pairwise Nat.Coprime) (hcq : qs.Pairwise Nat.Coprime) (hcr : rs.Pairwise Nat.Coprime) + (hrs : rs.toFinset = ps.toFinset ∪ qs.toFinset) + (vp : (ZMod ps.prod)ˣ) (vq : (ZMod qs.prod)ˣ) + (f : ∀ p : ℕ, ZMod p → ℂ) (hf : ∀ p ∈ rs, ∀ x, ‖f p x‖ ≤ 1) + (α : ℝ) (w : ℕ → ℂ) (N : ℕ) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + let : NeZero qs.prod := ⟨(prime_list_prod_pos qs hq).ne'⟩ + ‖∑ n ∈ Finset.range N, w n * + (densityFourier (primeCRTFunction ps hp hcp f) ((vp : ZMod ps.prod) * (n : ZMod ps.prod)) * + conj (densityFourier (primeCRTFunction qs hq hcq f) ((vq : ZMod qs.prod) * (n : ZMod qs.prod))) * + realAdditivePhase α ^ n)‖ ≤ discreteVariation w N * + (2 * (rs.map (correlationPrimeBound (supportCorrelationSide ps.toFinset qs.toFinset))).prod * + ((N : ℝ) + rs.prod * (1 + Real.log rs.prod))) := by + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + let : NeZero qs.prod := ⟨(prime_list_prod_pos qs hq).ne'⟩ + let : NeZero rs.prod := ⟨(prime_list_prod_pos rs hr).ne'⟩ + obtain ⟨F, hF, hbound⟩ := original_density_correlation_model ps qs rs hp hq hr hcp hcq hcr hrs vp vq f hf + have he (n : ℕ) : densityFourier (primeCRTFunction ps hp hcp f) + ((vp : ZMod ps.prod) * (n : ZMod ps.prod)) * + conj (densityFourier (primeCRTFunction qs hq hcq f) + ((vq : ZMod qs.prod) * (n : ZMod qs.prod))) = F (n : ZMod rs.prod) := by + simpa only [Int.cast_natCast] using hF (n : ℤ) + simp_rw [he] + apply weighted_periodic_linear_phase_bound rs.prod F _ α _ hbound w N + exact List.prod_nonneg (fun x hx => by + obtain ⟨p, _, rfl⟩ := List.mem_map.mp hx + exact correlationPrimeBound_nonneg _ p) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageConductorProjection.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageConductorProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd8b60df4ffa85be575bc33904b9e613d76b6425 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageConductorProjection.lean @@ -0,0 +1,58 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PageSelection +import OAI.NumberTheory.Ostmann.ZeroDensity.ConductorDeletion + +namespace OAI + +/-! # The selected Page correction factors through the frequency modulus -/ + +namespace Ostmann + +open Classical + +/-- After excluding a selected large conductor prime, the correction on +the full modulus is exactly its correction on the frequency modulus. -/ +theorem pageAtModulus_mul_eq (z : Option PrimitiveRealZero) (Q R T : ℕ) + (hQ : ∀ p, p.Prime → p ∣ Q → p < T) + (hR : ∀ p, p.Prime → p ∣ R → T ≤ p) + (hexcluded : ∀ e, z = some e → ∀ p, + deletedConductorPrime e.modulus T = some p → ¬p ∣ R) : + pageAtModulus (Q * R) z = pageAtModulus Q z := by + cases z with + | none => rfl + | some e => + by_cases hd : e.modulus ∣ Q * R + · have hf := conductor_dvd_frequency_of_deletion e.modulus Q R T hQ hR + (hexcluded e rfl) hd + simp [pageAtModulus, hd, hf] + · have hf : ¬e.modulus ∣ Q := fun h => hd (dvd_mul_of_dvd_left h R) + simp [pageAtModulus, hd, hf] + +/-- The character value itself depends only on the smaller residue. This +is the arithmetic justification for keeping the Page factor in the +frequency-coordinate average when applying CRT. -/ +theorem pageCoefficient_eq_of_modEq (z : Option PrimitiveRealZero) {Q a b : ℕ} + (hab : Nat.ModEq Q a b) : + pageCoefficient (pageAtModulus Q z) a = pageCoefficient (pageAtModulus Q z) b := by + cases z with + | none => rfl + | some e => + by_cases hd : e.modulus ∣ Q + · have heq : (a : ZMod e.modulus) = (b : ZMod e.modulus) := + (ZMod.natCast_eq_natCast_iff a b e.modulus).mpr (hab.of_dvd hd) + simp only [pageAtModulus, Option.bind_some, ite_eq_left hd, pageCoefficient, heq] + · simp [pageAtModulus, hd, pageCoefficient] + +theorem selectedPageCorrection_frequency (P : PublishedProgressionInput) (N Q R T : ℕ) + (hQ : ∀ p, p.Prime → p ∣ Q → p < T) + (hR : ∀ p, p.Prime → p ∣ R → T ≤ p) + (hexcluded : ∀ e, selectedPageZero P N = some e → ∀ p, + deletedConductorPrime e.modulus T = some p → ¬p ∣ R) + {a b : ℕ} (hab : Nat.ModEq Q a b) : + pageCoefficient (pageAtModulus (Q * R) (selectedPageZero P N)) a = + pageCoefficient (pageAtModulus (Q * R) (selectedPageZero P N)) b := by + rw [pageAtModulus_mul_eq (selectedPageZero P N) Q R T hQ hR hexcluded] + exact pageCoefficient_eq_of_modEq _ hab + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageFactors.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageFactors.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d33300c9fd04368c4be4b11a11685cadf7f0d85 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageFactors.lean @@ -0,0 +1,96 @@ +import Mathlib.Analysis.SpecialFunctions.Exp +import OAI.NumberTheory.Ostmann.Construction.FinitePriorComparison +import OAI.NumberTheory.Ostmann.Arithmetic.CRTResidueAverage + +namespace OAI + +/-! # Keeping the exceptional-character density in the arithmetic measures + +The correction is retained, including when it correlates with the amplitude. +Once its conductor is supported on the frequency modulus, CRT places it in +that coordinate and the other residue averages factor exactly. +-/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable def pageMultiplier {A : Type*} (χ : A → ℝ) (β t : ℝ) (a : A) : ℝ := + 1 - χ a * Real.exp ((β - 1) * t) + +theorem pageMultiplier_bounds {A : Type*} (χ : A → ℝ) (β t : ℝ) + (hχ : ∀ a, |χ a| ≤ 1) (hβ : β ≤ 1) (ht : 0 ≤ t) (a : A) : + 0 ≤ pageMultiplier χ β t a ∧ pageMultiplier χ β t a ≤ 2 := by + have he0 := (Real.exp_pos ((β - 1) * t)).le + have he1 : Real.exp ((β - 1) * t) ≤ 1 := Real.exp_le_one_iff.mpr + (mul_nonpos_of_nonpos_of_nonneg (by linarith) ht) + have hχa := abs_le.mp (hχ a) + have hprod := mul_le_mul_of_nonneg_right hχa.2 he0 + have hprod' := mul_le_mul_of_nonneg_right hχa.1 he0 + dsimp [pageMultiplier] + constructor <;> nlinarith + +theorem pageMultiplier_zero {A : Type*} (β t : ℝ) (a : A) : + pageMultiplier (fun _ : A => 0) β t a = 1 := by simp [pageMultiplier] + +/-- The corrected coordinate prior has mass at most two, even if its +exceptional character has nonzero mean under the original prior. -/ +theorem page_prior_mass_le_two {A : Type*} [Fintype A] + (μ : A → ℝ) (hμ : ∀ a, 0 ≤ μ a) (hmass : ∑ a, μ a ≤ 1) + (χ : A → ℝ) (β t : ℝ) (hχ : ∀ a, |χ a| ≤ 1) (hβ : β ≤ 1) (ht : 0 ≤ t) : + (∀ a, 0 ≤ μ a * pageMultiplier χ β t a) ∧ + (∑ a, μ a * pageMultiplier χ β t a) ≤ 2 := by + constructor + · intro a + exact mul_nonneg (hμ a) (pageMultiplier_bounds χ β t hχ hβ ht a).1 + · calc + _ ≤ ∑ a, μ a * 2 := Finset.sum_le_sum fun a _ => + mul_le_mul_of_nonneg_left (pageMultiplier_bounds χ β t hχ hβ ht a).2 (hμ a) + _ = (∑ a, μ a) * 2 := (Finset.sum_mul _ _ _).symm + _ ≤ 2 := by linarith + +/-- Exact separation of a retained density and all remaining coordinates. +This also applies to signed and complex amplitudes. -/ +theorem uniform_equiv_product_average {A B C : Type*} + [Fintype A] [Fintype B] [Fintype C] + (e : A ≃ B × C) (f : B → ℂ) (g : C → ℂ) : + (Fintype.card A : ℂ)⁻¹ * (∑ a, f (e a).1 * g (e a).2) = + ((Fintype.card B : ℂ)⁻¹ * ∑ b, f b) * + ((Fintype.card C : ℂ)⁻¹ * ∑ c, g c) := by + rw [e.sum_comp (fun z => f z.1 * g z.2), Fintype.card_congr e, + Fintype.card_prod, Nat.cast_mul, mul_inv_rev, Fintype.sum_prod_type] + simp_rw [← Finset.mul_sum] + rw [← Finset.sum_mul] + ring + +/-- In the finite box decomposition, the Page factor remains inside the +frequency-coordinate integral; it is never replaced by its mean. -/ +theorem retained_page_average {A B C : Type*} + [Fintype A] [Fintype B] [Fintype C] + (e : A ≃ B × C) (χ : B → ℝ) (β t : ℝ) (f : B → ℂ) (g : C → ℂ) : + (Fintype.card A : ℂ)⁻¹ * + (∑ a, (pageMultiplier χ β t (e a).1 : ℂ) * f (e a).1 * g (e a).2) = + ((Fintype.card B : ℂ)⁻¹ * ∑ b, (pageMultiplier χ β t b : ℂ) * f b) * + ((Fintype.card C : ℂ)⁻¹ * ∑ c, g c) := + uniform_equiv_product_average e (fun b => (pageMultiplier χ β t b : ℂ) * f b) g + +/-- The retained frequency block and all other unit residues in the actual +modulus. -/ +noncomputable def crtSplitUnitEquiv (q r : ℕ) (h : q.Coprime r) : + (ZMod (q * r))ˣ ≃ (ZMod q)ˣ × (ZMod r)ˣ := + ((Units.mapEquiv (ZMod.chineseRemainder h).toMulEquiv).trans + MulEquiv.prodUnits).toEquiv + +theorem crt_retained_page_average (q r : ℕ) [NeZero q] [NeZero r] + [NeZero (q * r)] (h : q.Coprime r) + (χ : (ZMod q)ˣ → ℝ) (β t : ℝ) (f : (ZMod q)ˣ → ℂ) (g : (ZMod r)ˣ → ℂ) : + (Fintype.card (ZMod (q * r))ˣ : ℂ)⁻¹ * + (∑ a, (pageMultiplier χ β t (crtSplitUnitEquiv q r h a).1 : ℂ) * + f (crtSplitUnitEquiv q r h a).1 * g (crtSplitUnitEquiv q r h a).2) = + ((Fintype.card (ZMod q)ˣ : ℂ)⁻¹ * ∑ b, (pageMultiplier χ β t b : ℂ) * f b) * + ((Fintype.card (ZMod r)ˣ : ℂ)⁻¹ * ∑ c, g c) := + retained_page_average (crtSplitUnitEquiv q r h) χ β t f g + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PagePairCapacity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PagePairCapacity.lean new file mode 100644 index 0000000000000000000000000000000000000000..8d654186e745d218ccaaa34f45cbeee0d9caad01 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PagePairCapacity.lean @@ -0,0 +1,32 @@ +import OAI.NumberTheory.Ostmann.QuadraticCenter.PagePopulationDecay + +namespace OAI + +/-! # Endpoint products dominate the exceptional Page population -/ + +namespace Ostmann + +open Filter + +theorem eventual_page_pair_capacity (a C : ℝ) (ha : 0 < a) : + ∀ᶠ L : ℝ in atTop, + C * (Real.exp L / L ^ 40) < (a * Real.exp (L / 2) / L ^ 6) ^ 2 := by + have hp : ∀ᶠ L : ℝ in atTop, C / a ^ 2 < L ^ 28 := + (tendsto_pow_atTop (by norm_num : (28 : ℕ) ≠ 0)).eventually_gt_atTop (C / a ^ 2) + filter_upwards [hp, eventually_gt_atTop (0 : ℝ)] with L hpower hL + have hmain : C < a ^ 2 * L ^ 28 := by + have hh := (div_lt_iff₀ (pow_pos ha 2)).mp hpower + simpa only [mul_comm] using hh + have he : Real.exp L = (Real.exp (L / 2)) ^ 2 := by + rw [← Real.exp_nat_mul]; congr 1; norm_num; ring + have hfactor : 0 < Real.exp L / L ^ 40 := div_pos (Real.exp_pos L) (pow_pos hL 40) + have hmul := mul_lt_mul_of_pos_right hmain hfactor + have hid : a ^ 2 * L ^ 28 * (Real.exp L / L ^ 40) = + (a * Real.exp (L / 2) / L ^ 6) ^ 2 := by + rw [he] + field_simp + rwa [hid] at hmul + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageRegularAverage.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageRegularAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..2cea650bad15c99bf02371cb74b7b62c398d2686 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageRegularAverage.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.MovingReducedCRT + +namespace OAI + +/-! # The retained Page term in the actual regular-prime average -/ + +namespace Ostmann +open scoped Classical BigOperators + +/-- The deletion prescribed before the nongiant priors prevents an exceptional +conductor from using any prime in the regular block, including its powers. -/ +theorem pageAtModulus_regular_factor (z : Option PrimitiveRealZero) (C R T : ℕ) + (hC : ∀ p, p.Prime → p ∣ C → T ≤ p) + (hexcluded : ∀ e, z = some e → ∀ p, + deletedConductorPrime e.modulus T = some p → ¬p ∣ C * R) : + pageAtModulus (C * R) z = pageAtModulus R z := by + cases z with + | none => rfl + | some e => + by_cases hd : e.modulus ∣ C * R + · have hr : e.modulus ∣ R := by + by_cases hlarge : ∃ p, p.Prime ∧ p ∣ e.modulus ∧ T ≤ p + · have hp : deletedConductorPrime e.modulus T = some hlarge.choose := by + simp [deletedConductorPrime, hlarge] + exact False.elim (hexcluded e rfl _ hp (hlarge.choose_spec.2.1.trans hd)) + · have hc : e.modulus.Coprime C := Nat.coprime_of_dvd fun p hp hpe hpc => + hlarge ⟨p, hp, hpe, hC p hp hpc⟩ + exact hc.dvd_of_dvd_mul_left hd + simp [pageAtModulus, hd, hr] + · have hr : ¬ e.modulus ∣ R := fun h => hd (dvd_mul_of_dvd_right h C) + simp [pageAtModulus, hd, hr] + +theorem pageGiantWeight_modEq (P : PublishedProgressionInput) (Q r a b : ℕ) + (h : Nat.ModEq r a b) (y : ℝ) : + pageGiantWeight P Q r a y = pageGiantWeight P Q r b y := by + simp only [pageGiantWeight, pageMultiplier, pageCoefficient_eq_of_modEq _ h] + +theorem periodic_coefficient_regular_page_average {I : Type*} [Fintype I] [DecidableEq I] + (P : PublishedProgressionInput) (Q : ℕ) + (p : I → ℕ) [∀ i, Fact (p i).Prime] [∀ i, NeZero (p i)] [NeZero (∏ i, p i)] + (hc : Pairwise (fun i j => (p i).Coprime (p j))) + (r : ℕ) [NeZero r] [NeZero ((∏ i, p i) * r)] (hcop : (∏ i, p i).Coprime r) + (hpage : pageAtModulus ((∏ i, p i) * r) (selectedPageZero P Q) = + pageAtModulus r (selectedPageZero P Q)) + (active : I → Bool) (s : ℤ) (other : ∀ i, ZMod (p i)) + (hs : ∀ i, (s : ZMod (p i)) ≠ 0) (ho : ∀ i, other i ≠ 0) + (g : ∀ i, ZMod (p i) → ℂ) (hg : ∀ i, g i 0 = 0) + (henergy : ∀ i, (∑ x : ZMod (p i), ‖g i x‖ ^ 2) = p i) + (C : ℕ → ℕ → ℂ) + (hC : ∀ a b d e, Nat.ModEq r a d → Nat.ModEq r b e → C a b = C d e) (y : ℝ) : + correctedMixedPairAverage P Q ((∏ i, p i) * r) + (fun a b => C a b * (guardedRegularMultiplier p active s other g a b : ℂ)) y = + ((∏ i, if active i then (1 : ℝ) else 1 - (p i : ℝ)⁻¹ : ℝ) : ℂ) * + correctedMixedPairAverage P Q r C y := by + have he := periodic_coefficient_regular_average p hc r hcop active s other hs ho g hg henergy + (fun a b => C a b * pageGiantWeight P Q r b y) + (fun a b d e ha hb => by rw [hC a b d e ha hb, pageGiantWeight_modEq P Q r b e hb y]) + change _ = _ at he + convert he using 1 + · unfold correctedMixedPairAverage + congr 1 + apply Finset.sum_congr rfl + intro z _ + simp only [pageGiantWeight, hpage] + ring + · rfl + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageResidueReduction.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageResidueReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f1ebb2d1e818fbcb3e46260e50dc96f2d693fc9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageResidueReduction.lean @@ -0,0 +1,57 @@ +import OAI.NumberTheory.Ostmann.Construction.ExternalResidueReduction +import OAI.NumberTheory.Ostmann.ZeroDensity.GiantHaarDensity +import OAI.NumberTheory.Ostmann.ZeroDensity.PageConductorProjection + +namespace OAI + +/-! # Retaining the Page factor when redundant residue coordinates are removed -/ + +namespace Ostmann +open scoped BigOperators Classical + +theorem nat_modEq_castHom_val {m n : ℕ} [NeZero m] [NeZero n] + (h : m ∣ n) (a : ZMod n) : + Nat.ModEq m a.val ((ZMod.castHom h (ZMod m)) a).val := by + apply (ZMod.natCast_eq_natCast_iff _ _ _).mp + rw [ZMod.natCast_zmod_val] + have hh := map_natCast (ZMod.castHom h (ZMod m)) a.val + rw [ZMod.natCast_zmod_val] at hh + exact hh.symm + +theorem pageGiantWeight_castHom (P : PublishedProgressionInput) (Q : ℕ) + {m n : ℕ} [NeZero m] [NeZero n] (h : m ∣ n) + (hpage : pageAtModulus n (selectedPageZero P Q) = pageAtModulus m (selectedPageZero P Q)) + (a : ZMod n) (x : ℝ) : + pageGiantWeight P Q n a.val x = + pageGiantWeight P Q m ((ZMod.castHom h (ZMod m)) a).val x := by + have he := pageCoefficient_eq_of_modEq (selectedPageZero P Q) (nat_modEq_castHom_val h a) + simp only [pageGiantWeight, hpage, pageMultiplier, he] + +theorem uniform_external_page_reduction (P : PublishedProgressionInput) (Q : ℕ) + {m n : ℕ} [NeZero m] [NeZero n] (h : m ∣ n) + (hpage : pageAtModulus n (selectedPageZero P Q) = pageAtModulus m (selectedPageZero P Q)) + (F : ZMod m × (ZMod m)ˣ → ℂ) (y : ℝ) : + (Fintype.card (ZMod n × (ZMod n)ˣ) : ℂ)⁻¹ * + (∑ z, F (externalResidueReduction h z) * pageGiantWeight P Q n (z.2 : ZMod n).val y) = + (Fintype.card (ZMod m × (ZMod m)ˣ) : ℂ)⁻¹ * + ∑ z, F z * pageGiantWeight P Q m (z.2 : ZMod m).val y := by + have he (z : ZMod n × (ZMod n)ˣ) := pageGiantWeight_castHom P Q h hpage (z.2 : ZMod n) y + simp_rw [he] + exact uniform_external_residue_reduction h (fun z => F z * pageGiantWeight P Q m (z.2 : ZMod m).val y) + +theorem uniform_prime_pair_page_reduction (P : PublishedProgressionInput) (Q : ℕ) + {m n : ℕ} [NeZero m] [NeZero n] (h : m ∣ n) + (hpage : pageAtModulus n (selectedPageZero P Q) = pageAtModulus m (selectedPageZero P Q)) + (F : (ZMod m)ˣ × (ZMod m)ˣ → ℂ) (x y : ℝ) : + (Fintype.card ((ZMod n)ˣ × (ZMod n)ˣ) : ℂ)⁻¹ * + (∑ z, F (primePairResidueReduction h z) * pageGiantWeight P Q n (z.1 : ZMod n).val x * + pageGiantWeight P Q n (z.2 : ZMod n).val y) = + (Fintype.card ((ZMod m)ˣ × (ZMod m)ˣ) : ℂ)⁻¹ * + ∑ z, F z * pageGiantWeight P Q m (z.1 : ZMod m).val x * pageGiantWeight P Q m (z.2 : ZMod m).val y := by + simp_rw [pageGiantWeight_castHom P Q h hpage] + exact uniform_prime_pair_residue_reduction h (fun z => + F z * pageGiantWeight P Q m (z.1 : ZMod m).val x * pageGiantWeight P Q m (z.2 : ZMod m).val y) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageSelection.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..df7accab0e149787331df0d237f9bed1f0be4860 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PageSelection.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedProgressionInputs + +namespace OAI + +/-! # A single exceptional character for every modulus in a row + +Only zeros in Page's common region are retained. Local exceptional zeros +outside that region will be bounded as an error, rather than identified +with a character belonging to a different modulus. +-/ + +namespace Ostmann + +open Classical + +noncomputable def selectedPageZero (P : PublishedProgressionInput) (Q : ℕ) : + Option PrimitiveRealZero := + if h : ∃ e : PrimitiveRealZero, e.modulus ≤ Q ∧ + 1 - P.kappa / Real.log (4 * (Q : ℝ)) ≤ e.beta then some h.choose else none + +noncomputable def pageAtModulus (q : ℕ) (z : Option PrimitiveRealZero) : + Option PrimitiveRealZero := + z.bind fun e => if e.modulus ∣ q then some e else none + +theorem selectedPageZero_spec (P : PublishedProgressionInput) (Q : ℕ) + (e : PrimitiveRealZero) (he : selectedPageZero P Q = some e) : + e.modulus ≤ Q ∧ 1 - P.kappa / Real.log (4 * (Q : ℝ)) ≤ e.beta := by + unfold selectedPageZero at he + split at he + next hex => + have h := Option.some.inj he + exact h ▸ hex.choose_spec + next => simp at he + +theorem selectedPageZero_eq (P : PublishedProgressionInput) (Q : ℕ) + (hQ : 2 ≤ Q) (e : PrimitiveRealZero) (hmod : e.modulus ≤ Q) + (hnear : 1 - P.kappa / Real.log (4 * (Q : ℝ)) ≤ e.beta) : + selectedPageZero P Q = some e := by + have hex : ∃ f : PrimitiveRealZero, f.modulus ≤ Q ∧ + 1 - P.kappa / Real.log (4 * (Q : ℝ)) ≤ f.beta := ⟨e, hmod, hnear⟩ + have heq := P.unique Q hQ hex.choose e hex.choose_spec.1 hmod hex.choose_spec.2 hnear + unfold selectedPageZero + rw [dite_eq_left hex, heq] + +theorem page_region_mono (P : PublishedProgressionInput) {q Q : ℕ} + (hq : 1 ≤ q) (hqQ : q ≤ Q) : + 1 - P.kappa / Real.log (4 * (q : ℝ)) ≤ + 1 - P.kappa / Real.log (4 * (Q : ℝ)) := by + have hq' : (1 : ℝ) ≤ q := by exact_mod_cast hq + have hpos : 0 < Real.log (4 * (q : ℝ)) := Real.log_pos (by linarith) + have hlog : Real.log (4 * (q : ℝ)) ≤ Real.log (4 * (Q : ℝ)) := + Real.log_le_log (by positivity) (by exact_mod_cast Nat.mul_le_mul_left 4 hqQ) + have hdiv := div_le_div_of_nonneg_left P.kappa_pos.le hpos hlog + linarith + +theorem localZero_eq_of_selected (P : PublishedProgressionInput) {q Q : ℕ} + (hq : 1 ≤ q) (hqQ : q ≤ Q) (e : PrimitiveRealZero) + (he : selectedPageZero P Q = some e) (hd : e.modulus ∣ q) : + P.localZero q = some e := + P.complete q hq e hd + ((page_region_mono P hq hqQ).trans (selectedPageZero_spec P Q e he).2) + +/-- Every local correction either equals the restriction of the same global +Page correction, or is a zero lying strictly outside the common region. +In the latter case the global correction is absent from that modulus. -/ +theorem localZero_selected_alternative (P : PublishedProgressionInput) {q Q : ℕ} + (hQ : 2 ≤ Q) (hq : 1 ≤ q) (hqQ : q ≤ Q) : + P.localZero q = pageAtModulus q (selectedPageZero P Q) ∨ + ∃ e : PrimitiveRealZero, P.localZero q = some e ∧ + e.beta < 1 - P.kappa / Real.log (4 * (Q : ℝ)) ∧ + pageAtModulus q (selectedPageZero P Q) = none := by + cases hl : P.localZero q with + | none => + left + cases hg : selectedPageZero P Q with + | none => simp [pageAtModulus] + | some e => + by_cases hd : e.modulus ∣ q + · have hc := localZero_eq_of_selected P hq hqQ e hg hd + rw [hl] at hc + contradiction + · simp [pageAtModulus, hd] + | some e => + have hd := P.divides q e hl + by_cases hn : 1 - P.kappa / Real.log (4 * (Q : ℝ)) ≤ e.beta + · left + have he := selectedPageZero_eq P Q hQ e + ((Nat.le_of_dvd (by omega) hd).trans hqQ) hn + simp [he, pageAtModulus, hd] + · right + refine ⟨e, rfl, lt_of_not_ge hn, ?_⟩ + cases hg : selectedPageZero P Q with + | none => simp [pageAtModulus] + | some f => + by_cases hf : f.modulus ∣ q + · have hc := localZero_eq_of_selected P hq hqQ f hg hf + rw [hl] at hc + have hef := Option.some.inj hc + exact False.elim (hn (hef ▸ (selectedPageZero_spec P Q f hg).2)) + · simp [pageAtModulus, hf] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PairDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PairDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e68e3d77fb08f26d1f77da3713bfa8bd83cb1e3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PairDensity.lean @@ -0,0 +1,82 @@ +import OAI.NumberTheory.Ostmann.Characters.SquareAverage +import OAI.NumberTheory.Ostmann.Characters.BottomPairMellin +import OAI.NumberTheory.Ostmann.Characters.AffineAction + +namespace OAI + +/-! +# Density of one tree split + +Given the parent difference, a split coordinate produces the child ratio +as a fixed unit times its inverse square. Each valid child pair therefore +has multiplicity at most two. Zero weights at zero discard invalid nodes. +-/ + +namespace Ostmann + +open scoped BigOperators + +/-- A full-field sum in ratio coordinates is exactly the difference convolution. -/ +theorem pair_ratio_sum_eq {p : ℕ} [Fact p.Prime] + (d : (ZMod p)ˣ) (f g : ZMod p → ℝ) (hf : f 0 = 0) (hg : g 0 = 0) : + (∑ t : (ZMod p)ˣ, if t = 1 then 0 else + f ((d : ZMod p) * (t : ZMod p) / ((t : ZMod p) - 1)) * + g ((d : ZMod p) / ((t : ZMod p) - 1))) = + ∑ x : ZMod p, f x * g (x - d) := by + classical + let H : ZMod p → ℝ := fun t => if t = 1 then 0 else + f ((d : ZMod p) * t / (t - 1)) * g ((d : ZMod p) / (t - 1)) + have hH0 : H 0 = 0 := by simp [H, hf] + have hunit (t : (ZMod p)ˣ) : (if t = 1 then 0 else + f ((d : ZMod p) * (t : ZMod p) / ((t : ZMod p) - 1)) * + g ((d : ZMod p) / ((t : ZMod p) - 1))) = H t := by + have ht : (t : ZMod p) = 1 ↔ t = 1 := by + constructor + · intro h; exact Units.ext h + · intro h; simp [h] + simp only [H, ht] + let e : ZMod p ≃ ZMod p := + (Function.Involutive.toPerm _ ratioInvolution_involutive).trans + (Equiv.mulLeft₀ (d : ZMod p) (Units.ne_zero d)) + have he (t : ZMod p) : H t = f (e t) * g (e t - d) := by + change H t = f ((d : ZMod p) * ratioInvolution t) * + g ((d : ZMod p) * ratioInvolution t - d) + by_cases ht : t = 1 + · simp [H, ratioInvolution, ht, hg] + · have hdif : (d : ZMod p) * t / (t - 1) - d = + (d : ZMod p) / (t - 1) := by + have h := pair_coordinate_difference (d : ZMod p) t ht + linear_combination h + simp only [H, ht, ite_false, ratioInvolution, ← mul_div_assoc, hdif] + simp_rw [hunit] + rw [sum_units_eq_sum_of_zero H hH0] + simp_rw [he] + exact e.bijective.sum_comp (fun x => f x * g (x - d)) + +/-- Counting form of the conditional density bound at one internal node. -/ +theorem pair_inverse_square_density {p : ℕ} [Fact p.Prime] + (d K : (ZMod p)ˣ) (f g : ZMod p → ℝ) + (hf : f 0 = 0) (hg : g 0 = 0) + (hfn : ∀ x, 0 ≤ f x) (hgn : ∀ x, 0 ≤ g x) : + (∑ m : (ZMod p)ˣ, + let t := K * (m⁻¹) ^ 2 + if t = 1 then 0 else + f ((d : ZMod p) * (t : ZMod p) / ((t : ZMod p) - 1)) * + g ((d : ZMod p) / ((t : ZMod p) - 1))) ≤ + 2 * ∑ x : ZMod p, f x * g (x - d) := by + let H : (ZMod p)ˣ → ℝ := fun t => if t = 1 then 0 else + f ((d : ZMod p) * (t : ZMod p) / ((t : ZMod p) - 1)) * + g ((d : ZMod p) / ((t : ZMod p) - 1)) + have hn (t : (ZMod p)ˣ) : 0 ≤ H t := by + dsimp [H] + split_ifs + · exact le_rfl + · exact mul_nonneg (hfn _) (hgn _) + have h := sum_inverse_square_coset_le_twice K H hn + rw [show (∑ t : (ZMod p)ˣ, H t) = ∑ x : ZMod p, f x * g (x - d) from + pair_ratio_sum_eq d f g hf hg] at h + exact h + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PositiveResidueProgression.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PositiveResidueProgression.lean new file mode 100644 index 0000000000000000000000000000000000000000..a072ee073883b8d76c050094bea9e12f3806a58e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PositiveResidueProgression.lean @@ -0,0 +1,103 @@ +import OAI.NumberTheory.Ostmann.Quadratic.QuadraticResidueDecomposition + +namespace OAI + +/-! # The exact finite progression of positive integers in a residue class -/ + +namespace Ostmann + +open scoped BigOperators + +theorem exists_positive_residue_representative {q : ℕ} [NeZero q] (r : ZMod q) : + ∃ a : ℕ, 0 < a ∧ a ≤ q ∧ (a : ZMod q) = r := by + by_cases hr : r.val = 0 + · refine ⟨q, NeZero.pos q, le_rfl, ?_⟩ + have hz : r = 0 := by simpa only [hr, Nat.cast_zero] using r.natCast_zmod_val.symm + simp [hz] + · exact ⟨r.val, Nat.pos_of_ne_zero hr, r.val_lt.le, r.natCast_zmod_val⟩ + +theorem positive_residue_progression (q a W : ℕ) (hq : 0 < q) + (ha : 0 < a) (haq : a ≤ q) : + ((Finset.Ioc 0 W).filter (fun w => w ≡ a [MOD q])) = + (Finset.range ((W + q - a) / q)).image (fun j => a + q * j) := by + classical + have haqW : a ≤ W + q := by omega + have hsub : W + q - a + a = W + q := Nat.sub_add_cancel haqW + ext w + constructor + · intro hw + obtain ⟨hw, hmod⟩ := Finset.mem_filter.mp hw + obtain ⟨hw0, hwW⟩ := Finset.mem_Ioc.mp hw + have haw : a ≤ w := by + rcases lt_or_eq_of_le haq with haq' | heq + · have hm : w % q = a := (show w % q = a % q from hmod).trans (Nat.mod_eq_of_lt haq') + rw [← hm] + exact Nat.mod_le w q + · have hqw : q ∣ w := by + apply Nat.dvd_of_mod_eq_zero + simpa only [heq, Nat.mod_self] using (show w % q = a % q from hmod) + exact heq ▸ Nat.le_of_dvd hw0 hqw + obtain ⟨j, hj⟩ := hmod.symm.dvd' + have hval : a + q * j = w := by omega + refine Finset.mem_image.mpr ⟨j, Finset.mem_range.mpr ?_, hval⟩ + apply Nat.lt_of_succ_le + apply (Nat.le_div_iff_mul_le hq).mpr + nlinarith + · intro hw + obtain ⟨j, hj, rfl⟩ := Finset.mem_image.mp hw + have hh := (Nat.le_div_iff_mul_le hq).mp (Nat.succ_le_of_lt (Finset.mem_range.mp hj)) + apply Finset.mem_filter.mpr + refine ⟨Finset.mem_Ioc.mpr ⟨by omega, ?_⟩, ?_⟩ + · nlinarith + · simp [Nat.ModEq] + +theorem sum_positive_residue_progression (q a W : ℕ) (hq : 0 < q) + (ha : 0 < a) (haq : a ≤ q) (f : ℕ → ℂ) : + (∑ w ∈ (Finset.Ioc 0 W).filter (fun w => w ≡ a [MOD q]), f w) = + ∑ j ∈ Finset.range ((W + q - a) / q), f (a + q * j) := by + classical + rw [positive_residue_progression q a W hq ha haq, Finset.sum_image] + intro j _ k _ he + exact Nat.eq_of_mul_eq_mul_left hq (Nat.add_left_cancel he) + +theorem sum_positive_zmod_progression {q : ℕ} [NeZero q] (a W : ℕ) + (ha : 0 < a) (haq : a ≤ q) (f : ℕ → ℂ) : + (∑ w ∈ (Finset.Ioc 0 W).filter (fun w : ℕ => (w : ZMod q) = a), f w) = + ∑ j ∈ Finset.range ((W + q - a) / q), f (a + q * j) := by + simp_rw [ZMod.natCast_eq_natCast_iff] + exact sum_positive_residue_progression q a W (NeZero.pos q) ha haq f + +/-- The floor cutoff loses less than two progression steps, uniformly in the +residue. This keeps the inverse estimate at the original quadratic scale. -/ +theorem positive_progression_length_bounds (q a : ℕ) (B Y : ℝ) + (hq : 0 < q) (ha : 0 < a) (haq : a ≤ q) (hB : 3 ≤ B) (hY : 1 ≤ Y) : + let W := ⌊B * q * Y⌋₊ + let N := (W + q - a) / q + Y ≤ (N : ℝ) ∧ (N : ℝ) ≤ (B + 1) * Y := by + dsimp only + let W := ⌊B * q * Y⌋₊ + let N := (W + q - a) / q + have hqR : (1 : ℝ) ≤ q := by exact_mod_cast hq + have haR : (0 : ℝ) < a := by exact_mod_cast ha + have haqR : (a : ℝ) ≤ q := by exact_mod_cast haq + have hfloor : (W : ℝ) ≤ B * q * Y := Nat.floor_le (by positivity) + have hfloor' : B * q * Y < (W : ℝ) + 1 := Nat.lt_floor_add_one _ + have hsub : W + q - a + a = W + q := Nat.sub_add_cancel (by omega) + have hdiv : N * q ≤ W + q - a := Nat.div_mul_le_self _ _ + have hdiv' : W + q - a < (N + 1) * q := by + exact (Nat.div_lt_iff_lt_mul hq).mp (Nat.lt_succ_self N) + have hsubR : ((W + q - a : ℕ) : ℝ) + a = (W : ℝ) + q := by exact_mod_cast hsub + have hdivR : (N : ℝ) * q ≤ ((W + q - a : ℕ) : ℝ) := by exact_mod_cast hdiv + have hdivR' : ((W + q - a : ℕ) : ℝ) < ((N : ℝ) + 1) * q := by exact_mod_cast hdiv' + have hqpos : (0 : ℝ) < q := by exact_mod_cast hq + constructor + · have hBY : 3 * Y ≤ B * Y := mul_le_mul_of_nonneg_right hB (by linarith) + have hYq : 1 ≤ Y * q := by nlinarith + have hBYq : 3 * Y * q ≤ B * q * Y := by nlinarith [mul_le_mul_of_nonneg_right hBY hqpos.le] + nlinarith + · have hYq : (q : ℝ) ≤ Y * q := le_mul_of_one_le_left hqpos.le hY + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeLogDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeLogDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..6d81e4cc0a2440ca5483ddd181b34bc1b20513d4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeLogDensity.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ThetaToHarmonic + +namespace OAI + +/-! # The retained Page density in logarithmic coordinates -/ + +namespace Ostmann + +open MeasureTheory + +noncomputable def primeLogDensity (φ χ β t : ℝ) : ℝ := + (1 - χ * Real.exp ((β - 1) * t)) / (φ * t) + +/-- The Jacobian cancels the `1/x` part of the harmonic weight. The +exceptional contribution has no extra factor of its zero `β`. -/ +theorem thetaMain_log_substitution (φ χ β : ℝ) {s t : ℝ} + (hs : 0 < s) (hst : s ≤ t) : + (∫ x in Set.Ioc (Real.exp s) (Real.exp t), + primeHarmonicWeight x * thetaMainDensity φ χ β x) = + ∫ y in Set.Ioc s t, primeLogDensity φ χ β y := by + let g := fun x => primeHarmonicWeight x * thetaMainDensity φ χ β x + have hg : ContinuousOn g (Real.exp '' Set.uIcc s t) := by + rintro _ ⟨y, hy, rfl⟩ + have hy0 : 0 < y := hs.trans_le (((Set.uIcc_of_le hst) ▸ hy).1) + have hexp : 1 < Real.exp y := Real.one_lt_exp_iff.mpr hy0 + have hw := (hasDerivAt_primeHarmonicWeight hexp).continuousAt + have hd : ContinuousAt (thetaMainDensity φ χ β) (Real.exp y) := + (continuousAt_const.sub ((Real.continuousAt_rpow_const _ (β - 1) + (Or.inl (Real.exp_ne_zero y))).const_mul χ)).div_const φ + exact (hw.mul hd).continuousWithinAt + have hsub := intervalIntegral.integral_comp_mul_deriv' + (fun y (_ : y ∈ Set.uIcc s t) => Real.hasDerivAt_exp y) + Real.continuous_exp.continuousOn hg + calc + _ = ∫ x in Real.exp s..Real.exp t, g x := + (intervalIntegral.integral_of_le (Real.exp_le_exp.mpr hst)).symm + _ = ∫ y in s..t, (g ∘ Real.exp) y * Real.exp y := hsub.symm + _ = ∫ y in s..t, primeLogDensity φ χ β y := by + apply intervalIntegral.integral_congr + intro y hy + have hy0 : 0 < y := hs.trans_le (((Set.uIcc_of_le hst) ▸ hy).1) + dsimp [g, primeHarmonicWeight, thetaMainDensity, primeLogDensity] + rw [Real.log_exp, ← Real.exp_mul] + rw [mul_comm y (β - 1)] + field_simp + _ = _ := intervalIntegral.integral_of_le hst + +/-- The actual reciprocal-prime interval estimate in logarithmic coordinates, +proved from the precise theta estimate. -/ +theorem prime_log_interval_error (q a : ℕ) (φ χ β c C : ℝ) (hβ : β ≠ 0) + (hc : 0 ≤ c) (hC : 0 ≤ C) {s t : ℝ} (hs : 1 ≤ s) + (hst : s ≤ t) (hshort : t ≤ s + 1) + (hθ : ∀ x ∈ Set.Icc (Real.exp s) (Real.exp t), + |primeProgressionTheta q a x - thetaMainTerm φ χ β x| ≤ + C * x * Real.exp (-c * Real.sqrt (Real.log x))) : + |reciprocalPrimeInterval q a (Real.exp s) (Real.exp t) - + ∫ y in Set.Ioc s t, primeLogDensity φ χ β y| ≤ + 18 * C * Real.exp (-c * Real.sqrt s) := by + have h := theta_to_log_interval_error q a φ χ β c C hβ hc hC hs hst hshort hθ + rwa [thetaMain_log_substitution φ χ β (lt_of_lt_of_le zero_lt_one hs) hst] at h + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeLogDensityBounds.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeLogDensityBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..08badfe01ae48cbd357c23a7727a529c316756e1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeLogDensityBounds.lean @@ -0,0 +1,80 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimeLogDensity +import OAI.NumberTheory.Ostmann.ZeroDensity.PageFactors + +namespace OAI + +/-! # Bounds on the retained density and on discarded real zeros -/ + +namespace Ostmann + +open MeasureTheory + +theorem continuousOn_primeLogDensity (φ χ β : ℝ) {s t : ℝ} (hs : 0 < s) : + ContinuousOn (primeLogDensity φ χ β) (Set.Icc s t) := by + intro y hy + have hy0 : y ≠ 0 := ne_of_gt (hs.trans_le hy.1) + have hn : ContinuousAt (fun y : ℝ => + (1 - χ * Real.exp ((β - 1) * y)) / y) y := + (continuousAt_const.sub ((Real.continuous_exp.continuousAt.comp + (continuousAt_const.mul continuousAt_id)).const_mul χ)).div continuousAt_id hy0 + apply ((hn.div_const φ).congr_of_eventuallyEq ?_).continuousWithinAt + filter_upwards [] with x + dsimp [primeLogDensity] + ring + +theorem primeLogDensity_bounds (φ χ β : ℝ) (hφ : 0 ≤ φ) + (hχ : |χ| ≤ 1) (hβ : β ≤ 1) {t : ℝ} (ht : 0 ≤ t) : + 0 ≤ primeLogDensity φ χ β t ∧ primeLogDensity φ χ β t ≤ 2 / (φ * t) := by + have h := pageMultiplier_bounds (fun _ : Unit => χ) β t (fun _ => hχ) hβ ht () + dsimp [pageMultiplier] at h + exact ⟨div_nonneg h.1 (mul_nonneg hφ ht), + div_le_div_of_nonneg_right h.2 (mul_nonneg hφ ht)⟩ + +/-- A zero separated from one by `d` contributes at most `exp (-d*s)` +throughout a logarithmic interval beginning at `s ≥ 1`. -/ +theorem primeLogDensity_correction_le (φ χ β d : ℝ) (hφ : 1 ≤ φ) + (hχ : |χ| ≤ 1) (hd : 0 ≤ d) (hβ : β ≤ 1 - d) + {s y : ℝ} (hs : 1 ≤ s) (hsy : s ≤ y) : + |primeLogDensity φ χ β y - primeLogDensity φ 0 1 y| ≤ + Real.exp (-d * s) := by + have hy : (1 : ℝ) ≤ y := hs.trans hsy + have hden : (1 : ℝ) ≤ φ * y := by nlinarith + have hden0 : 0 < φ * y := lt_of_lt_of_le zero_lt_one hden + have hid : primeLogDensity φ χ β y - primeLogDensity φ 0 1 y = + -(χ * Real.exp ((β - 1) * y)) / (φ * y) := by + dsimp [primeLogDensity] + ring + rw [hid, abs_div, abs_neg, abs_mul, abs_of_pos (Real.exp_pos _), abs_of_pos hden0] + have hexp : Real.exp ((β - 1) * y) ≤ Real.exp (-d * s) := by + apply Real.exp_le_exp.mpr + nlinarith + calc + _ ≤ Real.exp ((β - 1) * y) / (φ * y) := + div_le_div_of_nonneg_right + (by simpa using mul_le_mul_of_nonneg_right hχ (Real.exp_pos _).le) hden0.le + _ ≤ Real.exp (-d * s) / (φ * y) := div_le_div_of_nonneg_right hexp hden0.le + _ ≤ Real.exp (-d * s) := (div_le_self (Real.exp_pos _).le hden) + +theorem primeLogDensity_integral_correction_le (φ χ β d : ℝ) (hφ : 1 ≤ φ) + (hχ : |χ| ≤ 1) (hd : 0 ≤ d) (hβ : β ≤ 1 - d) + {s t : ℝ} (hs : 1 ≤ s) (hst : s ≤ t) (hshort : t ≤ s + 1) : + |(∫ y in Set.Ioc s t, primeLogDensity φ χ β y) - + (∫ y in Set.Ioc s t, primeLogDensity φ 0 1 y)| ≤ Real.exp (-d * s) := by + have hs0 : 0 < s := lt_of_lt_of_le zero_lt_one hs + have hI (χ β : ℝ) : IntegrableOn (primeLogDensity φ χ β) (Set.Ioc s t) := + (continuousOn_primeLogDensity φ χ β hs0).integrableOn_Icc.mono_set Set.Ioc_subset_Icc_self + rw [← integral_sub (hI χ β) (hI 0 1)] + have hi := intervalIntegral.norm_integral_le_of_norm_le_const + (a := s) (b := t) (C := Real.exp (-d * s)) + (f := fun y => primeLogDensity φ χ β y - primeLogDensity φ 0 1 y) + (fun y hy => by + rw [Real.norm_eq_abs] + exact primeLogDensity_correction_le φ χ β d hφ hχ hd hβ hs + (((Set.uIoc_of_le hst) ▸ hy).1.le)) + rw [intervalIntegral.integral_of_le hst, Real.norm_eq_abs, + abs_of_nonneg (sub_nonneg.mpr hst)] at hi + exact hi.trans (by nlinarith [Real.exp_pos (-d * s)]) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeLogDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeLogDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..a0c77566eafd0e8518997df82b92de700ec2e2cf --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeLogDerivative.lean @@ -0,0 +1,59 @@ +import Mathlib.Tactic.LinearCombination +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimePowerRemainder + +namespace OAI + +/-! # The prime logarithmic series and the actual L-function derivative -/ + +namespace Ostmann + +open scoped BigOperators +open Complex LSeries + +noncomputable def primeLogCoefficients {q : ℕ} (χ : DirichletCharacter ℂ q) (n : ℕ) : ℂ := + if n.Prime then χ n * (Real.log n : ℂ) else 0 + +theorem twisted_vonMangoldt_decomposition {q : ℕ} (χ : DirichletCharacter ℂ q) : + (fun n : ℕ => χ n * (ArithmeticFunction.vonMangoldt n : ℂ)) = + primeLogCoefficients χ + (fun n : ℕ => χ n * primePowerRemainder n) := by + funext n + by_cases hp : n.Prime + · simp [primeLogCoefficients, primePowerRemainder, hp, ArithmeticFunction.vonMangoldt_apply_prime hp] + · simp [primeLogCoefficients, primePowerRemainder, hp] + +/-- Removing prime powers from the proved Euler identity costs only an +absolute bounded error, uniformly in the character and s > 1. -/ +theorem exists_primeLogDerivative_error : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q) (s : ℝ), 1 < s → + LSeriesSummable (primeLogCoefficients χ) (s : ℂ) ∧ + ‖LSeries (primeLogCoefficients χ) (s : ℂ) + + deriv (DirichletCharacter.LFunction χ) (s : ℂ) / + DirichletCharacter.LFunction χ (s : ℂ)‖ ≤ C := by + obtain ⟨C, hC, hrem⟩ := exists_primePowerRemainder_bound + refine ⟨C, hC, ?_⟩ + intro q hq χ s hs + obtain ⟨hremSum, hremBound⟩ := hrem q χ s hs.le + have ht := χ.LSeriesSummable_twist_vonMangoldt (show 1 < (s : ℂ).re from hs) + have hdiff : (fun n : ℕ => χ n * (ArithmeticFunction.vonMangoldt n : ℂ)) - + (fun n : ℕ => χ n * primePowerRemainder n) = primeLogCoefficients χ := by + rw [twisted_vonMangoldt_decomposition] + exact add_sub_cancel_right _ _ + have hp : LSeriesSummable (primeLogCoefficients χ) (s : ℂ) := by + rw [← hdiff] + exact ht.sub hremSum + have he := χ.LSeries_twist_vonMangoldt_eq (show 1 < (s : ℂ).re from hs) + rw [← χ.deriv_LFunction_eq_deriv_LSeries hs, ← χ.LFunction_eq_LSeries hs] at he + change LSeries (fun n : ℕ => χ n * (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ) = _ at he + rw [twisted_vonMangoldt_decomposition, LSeries_add hp hremSum] at he + have hid : LSeries (primeLogCoefficients χ) (s : ℂ) + + deriv (DirichletCharacter.LFunction χ) (s : ℂ) / + DirichletCharacter.LFunction χ (s : ℂ) = + -LSeries (fun n : ℕ => χ n * primePowerRemainder n) (s : ℂ) := by + linear_combination he + refine ⟨hp, ?_⟩ + rw [hid, norm_neg] + exact hremBound + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimePartialSummation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimePartialSummation.lean new file mode 100644 index 0000000000000000000000000000000000000000..d12db66f6720f0b56553e43553e704ac6384b8c7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimePartialSummation.lean @@ -0,0 +1,99 @@ +import Mathlib.NumberTheory.AbelSummation +import Mathlib.Analysis.SpecialFunctions.Log.Deriv +import Mathlib.NumberTheory.PrimeCounting +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Ring +import Mathlib.Tactic.Linarith + +namespace OAI + +/-! # Partial summation for the reciprocal-prime progression measure + +This is the bridge from the published theta estimate (Montgomery--Vaughan, +Corollary 11.20, equations (11.32) and (11.34)) to the interval weights used +in Section 8. The conversion itself is proved here. +-/ + +namespace Ostmann + +open scoped BigOperators +open MeasureTheory + +noncomputable def primeProgressionLog (q a n : ℕ) : ℝ := + if n.Prime ∧ Nat.ModEq q n a then Real.log n else 0 + +noncomputable def primeProgressionTheta (q a : ℕ) (x : ℝ) : ℝ := + ∑ n ∈ Finset.Icc 0 ⌊x⌋₊, primeProgressionLog q a n + +noncomputable def reciprocalPrimeInterval (q a : ℕ) (u v : ℝ) : ℝ := + ∑ n ∈ Finset.Ioc ⌊u⌋₊ ⌊v⌋₊, + if n.Prime ∧ Nat.ModEq q n a then (n : ℝ)⁻¹ else 0 + +noncomputable def primeHarmonicWeight (x : ℝ) : ℝ := (x * Real.log x)⁻¹ + +noncomputable def primeHarmonicDerivative (x : ℝ) : ℝ := + -(Real.log x + 1) / (x * Real.log x) ^ 2 + +theorem hasDerivAt_primeHarmonicWeight {x : ℝ} (hx : 1 < x) : + HasDerivAt primeHarmonicWeight (primeHarmonicDerivative x) x := by + have hx0 : x ≠ 0 := ne_of_gt (lt_trans zero_lt_one hx) + have hlog : Real.log x ≠ 0 := ne_of_gt (Real.log_pos hx) + have h := ((hasDerivAt_id x).mul (Real.hasDerivAt_log hx0)).inv (mul_ne_zero hx0 hlog) + change HasDerivAt (fun y : ℝ => (y * Real.log y)⁻¹) + (-(1 * Real.log x + x * x⁻¹) / (x * Real.log x) ^ 2) x at h + change HasDerivAt (fun y : ℝ => (y * Real.log y)⁻¹) + (-(Real.log x + 1) / (x * Real.log x) ^ 2) x + simpa only [one_mul, mul_inv_cancel₀ hx0] using h + +theorem continuousOn_primeHarmonicDerivative {u v : ℝ} (hu : 1 < u) : + ContinuousOn primeHarmonicDerivative (Set.Icc u v) := by + intro x hx + have hx1 : 1 < x := lt_of_lt_of_le hu hx.1 + have hx0 : x ≠ 0 := ne_of_gt (lt_trans zero_lt_one hx1) + have hlog : Real.log x ≠ 0 := ne_of_gt (Real.log_pos hx1) + exact (((Real.continuousAt_log hx0).add continuousAt_const).neg.div + ((continuousAt_id.mul (Real.continuousAt_log hx0)).pow 2) + (pow_ne_zero 2 (mul_ne_zero hx0 hlog))).continuousWithinAt + +/-- The exact Abel formula on the actual prime progression, with arbitrary +real endpoints greater than one. -/ +theorem reciprocalPrimeInterval_eq_partialSummation (q a : ℕ) + {u v : ℝ} (hu : 1 < u) (huv : u ≤ v) : + reciprocalPrimeInterval q a u v = + primeHarmonicWeight v * primeProgressionTheta q a v - + primeHarmonicWeight u * primeProgressionTheta q a u - + ∫ t in Set.Ioc u v, primeHarmonicDerivative t * primeProgressionTheta q a t := by + have hd (t : ℝ) (ht : t ∈ Set.Icc u v) := + hasDerivAt_primeHarmonicWeight (lt_of_lt_of_le hu ht.1) + have hdi : Set.EqOn (deriv primeHarmonicWeight) primeHarmonicDerivative (Set.Icc u v) := + fun t ht => (hd t ht).deriv + have hint : IntegrableOn (deriv primeHarmonicWeight) (Set.Icc u v) := + ((continuousOn_primeHarmonicDerivative hu).congr hdi).integrableOn_Icc + have hab := sum_mul_eq_sub_sub_integral_mul (primeProgressionLog q a) + (le_of_lt (lt_trans zero_lt_one hu)) huv (fun t ht => (hd t ht).differentiableAt) hint + have hs : (∑ n ∈ Finset.Ioc ⌊u⌋₊ ⌊v⌋₊, + primeHarmonicWeight n * primeProgressionLog q a n) = reciprocalPrimeInterval q a u v := by + apply Finset.sum_congr rfl + intro n _ + by_cases h : n.Prime ∧ Nat.ModEq q n a + · have hn1 : (1 : ℝ) < n := by exact_mod_cast h.1.one_lt + have hlog : Real.log (n : ℝ) ≠ 0 := ne_of_gt (Real.log_pos hn1) + simp [primeProgressionLog, h, primeHarmonicWeight, mul_inv_rev, + mul_comm, hlog] + · simp [primeProgressionLog, h] + rw [hs] at hab + change reciprocalPrimeInterval q a u v = + primeHarmonicWeight v * primeProgressionTheta q a v - + primeHarmonicWeight u * primeProgressionTheta q a u - + ∫ t in Set.Ioc u v, deriv primeHarmonicWeight t * primeProgressionTheta q a t at hab + have hi : (∫ t in Set.Ioc u v, deriv primeHarmonicWeight t * primeProgressionTheta q a t) = + ∫ t in Set.Ioc u v, primeHarmonicDerivative t * primeProgressionTheta q a t := by + apply setIntegral_congr_fun measurableSet_Ioc + intro t ht + exact congrArg (fun z => z * primeProgressionTheta q a t) + (hdi (Set.Ioc_subset_Icc_self ht)) + rwa [hi] at hab + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimePowerRemainder.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimePowerRemainder.lean new file mode 100644 index 0000000000000000000000000000000000000000..cbb78b8fc639391b530cb16318b75c1dabc9d357 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimePowerRemainder.lean @@ -0,0 +1,61 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DirichletLogDerivativeBound + +namespace OAI + +/-! # Uniform control of the prime-power remainder in the Euler identity -/ + +namespace Ostmann + +open scoped BigOperators +open Complex LSeries + +noncomputable def primePowerRemainder (n : ℕ) : ℂ := + if n.Prime then 0 else (ArithmeticFunction.vonMangoldt n : ℂ) + +theorem primePowerRemainder_summable_one : LSeriesSummable primePowerRemainder (1 : ℂ) := by + have h := ArithmeticFunction.vonMangoldt.summable_residueClass_non_primes_div (0 : ZMod 1) + rw [residue_one_eq_vonMangoldt] at h + apply summable_norm_iff.mp + convert h using 1 + funext n + rw [LSeries.norm_term_eq] + by_cases hn : n = 0 + · subst n + simp + · simp only [hn, ite_false, Complex.one_re, Real.rpow_one] + by_cases hp : n.Prime + · simp [primePowerRemainder, hp] + · simp [primePowerRemainder, hp, Real.norm_eq_abs, + abs_of_nonneg (ArithmeticFunction.vonMangoldt_nonneg (n := n))] + +theorem primePowerRemainder_twist_norm_le {q : ℕ} (χ : DirichletCharacter ℂ q) + (s : ℝ) (hs : 1 ≤ s) (n : ℕ) : + ‖LSeries.term (fun n => χ n * primePowerRemainder n) (s : ℂ) n‖ ≤ + ‖LSeries.term primePowerRemainder (1 : ℂ) n‖ := by + apply (LSeries.norm_term_le (s : ℂ) ?_).trans + (LSeries.norm_term_le_of_re_le_re primePowerRemainder (by exact hs) n) + rw [norm_mul] + exact mul_le_of_le_one_left (norm_nonneg _) (χ.norm_le_one _) + +/-- A single absolute constant bounds all higher-prime-power contributions, +uniformly in the modulus, character and real s >= 1. -/ +theorem exists_primePowerRemainder_bound : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (q : ℕ) (χ : DirichletCharacter ℂ q) (s : ℝ), 1 ≤ s → + LSeriesSummable (fun n => χ n * primePowerRemainder n) (s : ℂ) ∧ + ‖LSeries (fun n => χ n * primePowerRemainder n) (s : ℂ)‖ ≤ C := by + let C := ∑' n, ‖LSeries.term primePowerRemainder (1 : ℂ) n‖ + have hsum := primePowerRemainder_summable_one.norm + refine ⟨C, tsum_nonneg (fun _ => norm_nonneg _), ?_⟩ + intro q χ s hs + have hn := primePowerRemainder_twist_norm_le χ s hs + have hsumn : Summable (fun n => ‖LSeries.term + (fun n => χ n * primePowerRemainder n) (s : ℂ) n‖) := + Summable.of_nonneg_of_le (fun _ => norm_nonneg _) hn hsum + have ht : LSeriesSummable (fun n => χ n * primePowerRemainder n) (s : ℂ) := + summable_norm_iff.mp hsumn + refine ⟨ht, ?_⟩ + exact (norm_tsum_le_tsum_norm hsumn).trans (hsumn.tsum_le_tsum hn hsum) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimePowerSupplyDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimePowerSupplyDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a08d42653388ccc4e37fb7a5eb2487e082368b4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimePowerSupplyDecay.lean @@ -0,0 +1,58 @@ +import OAI.NumberTheory.Ostmann.Supply.PrimePowerTransfer +import OAI.NumberTheory.Ostmann.ZeroDensity.ContourPolynomial + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open Filter Set +open scoped Topology +namespace Ostmann.ZeroDensity + +theorem eventually_supply_prime_power_decay {C : ℝ} (hC : 0 < C) (D : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 0 < Q → Q ≤ supplyConductorCutoff L → + (Q : ℝ)^2*C*Real.sqrt (supplyPrimeSample L : ℝ) ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-D*L) := by + have hl := eventually_supply_left_edge_decay 0 0 (E := 0) (by norm_num) (D+1) + have hc := eventually_constant_exp_decay hC D + filter_upwards [hl,hc] with L hl hc + intro Q hQ hQQ + have hh := hl Q hQ hQQ + simp only [pow_zero,mul_one] at hh + calc + _ = C*((Q : ℝ)^2*Real.sqrt (supplyPrimeSample L : ℝ)) := by ring + _ ≤ C*((supplyPrimeSample L : ℝ)*Real.exp (-(D+1)*L)) := + mul_le_mul_of_nonneg_left hh hC.le + _ = (supplyPrimeSample L : ℝ)*(C*Real.exp (-(D+1)*L)) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hc (Nat.cast_nonneg _) + +theorem prime_error_supply_decay_of_vonMangoldt {φ : ℝ → ℝ} + (hφ : Continuous φ) (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) + (hΛ : ∀ D : ℝ, ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, + 0 < Q → Q ≤ supplyConductorCutoff L → + totalPrimitiveError Q none φ (supplyPrimeSample L : ℝ) ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-D*L)) (D : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 0 < Q → Q ≤ supplyConductorCutoff L → + Ostmann.Supply.totalPrimitivePrimeError Q none φ (supplyPrimeSample L : ℝ) ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-D*L) := by + obtain ⟨C,hC,htransfer⟩ := Ostmann.Supply.exists_totalPrimitivePrimeError_le φ hφ hs + have hpower := eventually_supply_prime_power_decay hC (D+1) + have htwo := eventually_constant_exp_decay (C := 2) (by norm_num) D + filter_upwards [hΛ (D+1),hpower,htwo] with L hmain hp htwo + intro Q hQ hQQ + have htr := htransfer Q none (supplyPrimeSample L : ℝ) + (Nat.cast_pos.mpr (supplyPrimeSample_pos L)) + have hm := hmain Q hQ hQQ + have hh := hp Q hQ hQQ + have hb := mul_le_mul_of_nonneg_left htwo + (Nat.cast_nonneg (supplyPrimeSample L) : (0 : ℝ) ≤ supplyPrimeSample L) + linarith + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeSumInputs.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeSumInputs.lean new file mode 100644 index 0000000000000000000000000000000000000000..22cb5b9bd4a2161298b4548543cbf543104de8cd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimeSumInputs.lean @@ -0,0 +1,50 @@ +import Mathlib.NumberTheory.Chebyshev +import OAI.NumberTheory.Ostmann.Preliminaries.TailStability + +namespace OAI + +namespace Ostmann + +open scoped BigOperators + +/-- The precise one-sided consequence of Mertens' first theorem needed by +the collision argument. `C` is fixed independently of the cutoff. -/ +def MertensLowerBound (C : ℝ) : Prop := + ∀ Q : ℕ, 1 ≤ Q → Real.log (Q : ℝ) - C ≤ + ∑ p ∈ Nat.primesLE Q, Real.log (p : ℝ) / (p : ℝ) + +theorem prime_log_weight_le (Q : ℕ) : + (∑ p ∈ Nat.primesLE Q, Real.log (p : ℝ)) ≤ Real.log 4 * Q := by + rw [← Chebyshev.theta_eq_sum_primesLE_log] + exact Chebyshev.theta_le_log4_mul_x (Nat.cast_nonneg Q) + +/-- Collision stability on all primes up to `Q`, conditional on exactly the +lower prime-sum estimate above. This is a component of the main proof, not +the paper's infinite-summand theorem. -/ +theorem EventuallyPrimeSumset.tail_collision_stability_of_mertens + {A B : Set ℕ} (h : EventuallyPrimeSumset A B) (hA : A.Infinite) (hB : B.Infinite) + {C : ℝ} (hM : MertensLowerBound C) : + ∃ N, ∀ (A₀ B₀ : Finset ℕ) (μ ν : ℕ → ℝ) (X Q : ℕ) (m : ℝ), + 1 ≤ X → 1 ≤ Q → + (∀ a ∈ A₀, a ∈ A ∧ N + Q < a ∧ a ≤ X) → + (∀ b ∈ B₀, b ∈ B ∧ N + Q < b ∧ b ≤ X) → + (∀ a ∈ A₀, 0 ≤ μ a) → (∀ b ∈ B₀, 0 ≤ ν b) → + (∑ a ∈ A₀, μ a) = 1 → (∑ b ∈ B₀, ν b) = 1 → + (∀ a ∈ A₀, μ a ≤ m) → (∀ b ∈ B₀, ν b ≤ m) → 0 ≤ m → + 0 ≤ (∑ p ∈ Nat.primesLE Q, + Real.log (p : ℝ) * tailCollisionDefect A N p A₀ B₀ μ ν) ∧ + (∑ p ∈ Nat.primesLE Q, + Real.log (p : ℝ) * tailCollisionDefect A N p A₀ B₀ μ ν) ≤ + 2 * Real.log (X : ℝ) - 4 * Real.log (Q : ℝ) + 4 * C + + 2 * m * Real.log 4 * Q := by + obtain ⟨N, hN⟩ := h.tail_collision_stability hA hB + refine ⟨N, ?_⟩ + intro A₀ B₀ μ ν X Q m hX hQ hAtail hBtail hμ hν hmassμ hmassν hatomμ hatomν hm + exact hN (Nat.primesLE Q) A₀ B₀ μ ν X Q m (Real.log 4) C hX + (fun p hp => ⟨Nat.prime_of_mem_primesLE hp, Nat.le_of_mem_primesLE hp⟩) + hAtail hBtail hμ hν hmassμ hmassν hatomμ hatomν hm + (prime_log_weight_le Q) (hM Q hQ) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveCharacterCard.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveCharacterCard.lean new file mode 100644 index 0000000000000000000000000000000000000000..f0444398120ec2d52aabfc7716774c3f66404f1a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveCharacterCard.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedComplexZeroDensity + +namespace OAI + +/-! # The elementary conductor-family cardinality bound -/ +namespace Ostmann +open scoped Classical BigOperators + +noncomputable def PrimitiveComplexCharacter.atModulus (χ : PrimitiveComplexCharacter) + (q : ℕ) (h : χ.modulus = q) : DirichletCharacter ℂ q := h ▸ χ.character + +theorem primitive_character_fiber_card (F : Finset PrimitiveComplexCharacter) + (q : ℕ) (hq : 0 < q) : (F.filter (fun χ => χ.modulus = q)).card ≤ q := by + let S := F.filter (fun χ => χ.modulus = q) + let f : S → DirichletCharacter ℂ q := fun χ => + χ.val.atModulus q (Finset.mem_filter.mp χ.property).2 + have hf : Function.Injective f := by + intro χ ψ he + apply Subtype.ext + have hχ := (Finset.mem_filter.mp χ.property).2 + have hψ := (Finset.mem_filter.mp ψ.property).2 + obtain ⟨⟨m, hm, c, hc, hn⟩, hmem⟩ := χ + obtain ⟨⟨n, hp, d, hd, hd'⟩, hmem'⟩ := ψ + dsimp at hχ hψ + subst m + subst n + dsimp [f, PrimitiveComplexCharacter.atModulus] at he + cases he + rfl + have : NeZero q := ⟨hq.ne'⟩ + calc + _ = Fintype.card S := (Fintype.card_coe S).symm + _ ≤ Fintype.card (DirichletCharacter ℂ q) := Fintype.card_le_of_injective f hf + _ = q.totient := by + rw [← Nat.card_eq_fintype_card, DirichletCharacter.card_eq_totient_of_hasEnoughRootsOfUnity] + _ ≤ q := Nat.totient_le q + +theorem primitive_character_family_card (F : Finset PrimitiveComplexCharacter) + (Q : ℕ) (hF : ∀ χ ∈ F, χ.modulus ≤ Q) : F.card ≤ Q ^ 2 := by + have hmap : (F : Set PrimitiveComplexCharacter).MapsTo + PrimitiveComplexCharacter.modulus (Finset.Icc 1 Q) := by + intro χ hχ + exact Finset.mem_Icc.mpr ⟨χ.positive, hF χ hχ⟩ + rw [Finset.card_eq_sum_card_fiberwise hmap] + calc + _ ≤ ∑ q ∈ Finset.Icc 1 Q, Q := by + apply Finset.sum_le_sum + intro q hq + exact (primitive_character_fiber_card F q (Finset.mem_Icc.mp hq).1).trans + (Finset.mem_Icc.mp hq).2 + _ = Q ^ 2 := by simp [Nat.card_Icc, pow_two] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveErrorBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveErrorBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..0db2a7e0d9af8ab62ad897295acd06a628f49414 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveErrorBound.lean @@ -0,0 +1,52 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.OccurrenceSum +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimitiveErrorSum + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +theorem totalPrimitiveError_le_of_explicit_bounds (Q : ℕ) (hQ : 0 < Q) + (φ : ℝ → ℝ) (X T : ℝ) {A R E : ℝ} (hA : 0 ≤ A) (hR : 0 ≤ R) + (hprincipal : ‖smoothError (1 : DirichletCharacter ℂ 1) φ X‖ ≤ E) + (hcharacters : ∀ χ : NonprincipalPrimitiveFamily Q, + ‖smoothError χ.val.2.val φ X‖ ≤ A* + ((∑ ρ ∈ (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).toFinset.filter + (fun ρ => (1 : ℝ)/2 ≤ ρ.re), + (Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ : ℝ)*X^ρ.re)+R)) : + totalPrimitiveError Q none φ X ≤ + E+A*((∑ z ∈ retainedZeros Q none (1/2) T, X^z.point.re)+(Q : ℝ)^2*R) := by + classical + let Z : NonprincipalPrimitiveFamily Q → ℝ := fun χ => + ∑ ρ ∈ (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 T).toFinset.filter + (fun ρ => (1 : ℝ)/2 ≤ ρ.re), + (Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 ρ : ℝ)*X^ρ.re + have hzero : (∑ χ : NonprincipalPrimitiveFamily Q, Z χ) = + ∑ z ∈ retainedZeros Q none (1/2) T, X^z.point.re := by + have hz := sum_retainedZeros Q none ((1 : ℝ)/2) T + (fun (_χ : NonprincipalPrimitiveFamily Q) (ρ : ℂ) => X^ρ.re) + simpa only [Z, Finset.sum_filter, ne_eq, reduceCtorEq, not_false_eq_true, true_and, nsmul_eq_mul] using hz.symm + have hcard : (Fintype.card (NonprincipalPrimitiveFamily Q) : ℝ) ≤ (Q : ℝ)^2 := by + exact_mod_cast card_nonprincipalPrimitiveFamily_le Q + rw [totalPrimitiveError_split Q hQ] + apply add_le_add hprincipal + calc + (∑ χ : NonprincipalPrimitiveFamily Q, ‖smoothError χ.val.2.val φ X‖) ≤ + ∑ χ : NonprincipalPrimitiveFamily Q, A*(Z χ+R) := + Finset.sum_le_sum (fun χ _ => hcharacters χ) + _ = A*((∑ χ : NonprincipalPrimitiveFamily Q, Z χ)+ + (Fintype.card (NonprincipalPrimitiveFamily Q) : ℝ)*R) := by + rw [← Finset.mul_sum, Finset.sum_add_distrib] + simp + _ = A*((∑ z ∈ retainedZeros Q none (1/2) T, X^z.point.re)+ + (Fintype.card (NonprincipalPrimitiveFamily Q) : ℝ)*R) := by rw [hzero] + _ ≤ A*((∑ z ∈ retainedZeros Q none (1/2) T, X^z.point.re)+(Q : ℝ)^2*R) := by + exact mul_le_mul_of_nonneg_left + (add_le_add (le_refl _) (mul_le_mul_of_nonneg_right hcard hR)) hA + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveErrorSum.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveErrorSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9eb4509bdf3ff44a8ce80157ca191b11872252b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveErrorSum.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualZeros + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +def principalPrimitive (Q : ℕ) (hQ : 0 < Q) : PrimitiveFamily Q := + ⟨⟨0,hQ⟩,⟨1,DirichletCharacter.isPrimitive_one_level_one⟩⟩ + +theorem primitive_principal_unique (Q : ℕ) (hQ : 0 < Q) (χ : PrimitiveFamily Q) + (hχ : χ.2.val = 1) : χ = principalPrimitive Q hQ := by + rcases χ with ⟨⟨q,hq⟩,χ,hprim⟩ + change χ = 1 at hχ + change χ.conductor = q+1 at hprim + rw [hχ,DirichletCharacter.conductor_one] at hprim + have hq0 : q=0 := by omega + subst q + subst χ + rfl + +theorem sum_primitiveFamily_split {A : Type*} [AddCommMonoid A] + (Q : ℕ) (hQ : 0 < Q) (f : PrimitiveFamily Q → A) : + (∑ χ : PrimitiveFamily Q, f χ) = + f (principalPrimitive Q hQ)+∑ χ : NonprincipalPrimitiveFamily Q, f χ.val := by + classical + let : Unique {χ : PrimitiveFamily Q // χ.2.val = 1} := + ⟨⟨⟨principalPrimitive Q hQ,rfl⟩⟩, + fun χ => Subtype.ext (primitive_principal_unique Q hQ χ.val χ.property)⟩ + have h := Fintype.sum_subtype_add_sum_subtype (fun χ : PrimitiveFamily Q => χ.2.val=1) f + have hd : (default : {χ : PrimitiveFamily Q // χ.2.val=1}).val = + principalPrimitive Q hQ := primitive_principal_unique Q hQ _ (default : {χ : PrimitiveFamily Q // χ.2.val=1}).property + simp only [Fintype.sum_unique, hd] at h + convert h.symm using 1 + congr 1 + +theorem totalPrimitiveError_split (Q : ℕ) (hQ : 0 < Q) (φ : ℝ → ℝ) (X : ℝ) : + totalPrimitiveError Q none φ X = + ‖smoothError (1 : DirichletCharacter ℂ 1) φ X‖+ + ∑ χ : NonprincipalPrimitiveFamily Q, ‖smoothError χ.val.2.val φ X‖ := by + rw [totalPrimitiveError_none] + exact sum_primitiveFamily_split Q hQ (fun χ => ‖smoothError χ.2.val φ X‖) + +theorem card_nonprincipalPrimitiveFamily_le (Q : ℕ) : + Fintype.card (NonprincipalPrimitiveFamily Q) ≤ Q^2 := by + exact (Fintype.card_le_of_injective + (fun χ : NonprincipalPrimitiveFamily Q => χ.val) Subtype.val_injective).trans + (card_primitiveFamily_le Q) + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveExplicitComparison.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveExplicitComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..3eaf585ecac22a27ee5265c972d370357c211253 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveExplicitComparison.lean @@ -0,0 +1,61 @@ +import Mathlib.Tactic.GCongr +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimitiveErrorBound + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +def contourRemainder (B : ℕ) (Q X T : ℝ) : ℝ := + Real.sqrt X*(Q*(T+2))^B+ + X*(Q*(T+2))^B/T^(B+1)*(1+Real.log X)^B + +theorem contourRemainder_nonneg (B : ℕ) {Q X T : ℝ} + (hQ : 0 ≤ Q) (hX : 1 ≤ X) (hT : 0 ≤ T) : + 0 ≤ contourRemainder B Q X T := by + have hl := Real.log_nonneg hX + unfold contourRemainder + positivity + +theorem contourRemainder_mono (B : ℕ) {q Q X T : ℝ} + (hq : 0 ≤ q) (hqQ : q ≤ Q) (hX : 1 ≤ X) (hT : 0 ≤ T) : + contourRemainder B q X T ≤ contourRemainder B Q X T := by + have hl := Real.log_nonneg hX + unfold contourRemainder + gcongr + +theorem zero_decay_weight_le {q : ℕ} [NeZero q] + (χ : DirichletCharacter ℂ q) (S : Finset ℂ) (A : ℕ) {X : ℝ} (hX : 0 ≤ X) : + (∑ p ∈ S, (Ostmann.Dirichlet.zeroMultiplicity χ p : ℝ)*X^p.re/(1+|p.im|)^A) ≤ + ∑ p ∈ S, (Ostmann.Dirichlet.zeroMultiplicity χ p : ℝ)*X^p.re := by + apply Finset.sum_le_sum + intro p hp + apply div_le_self (by positivity) + exact one_le_pow₀ (by linarith [abs_nonneg p.im] : (1 : ℝ) ≤ 1+|p.im|) + +theorem totalPrimitiveError_le_of_truncated_formula (Q : ℕ) (hQ : 0 < Q) + (φ : ℝ → ℝ) {X T C : ℝ} (B : ℕ) (hX : 1 ≤ X) (hT : 0 ≤ T) (hC : 0 ≤ C) + (hcharacters : ∀ χ : NonprincipalPrimitiveFamily Q, + ‖smoothError χ.val.2.val φ X‖ ≤ C* + ((∑ p ∈ (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 (T+1)).toFinset.filter + (fun p => (1 : ℝ)/2 ≤ p.re), + (Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 p : ℝ)*X^p.re/(1+|p.im|)^(B+1))+ + contourRemainder B (χ.val.1.val+1 : ℝ) X T)) : + totalPrimitiveError Q none φ X ≤ + ‖smoothError (1 : DirichletCharacter ℂ 1) φ X‖+ + C*((∑ z ∈ retainedZeros Q none (1/2) (T+1), X^z.point.re)+ + (Q : ℝ)^2*contourRemainder B Q X T) := by + apply totalPrimitiveError_le_of_explicit_bounds Q hQ φ X (T+1) hC + (contourRemainder_nonneg B (Nat.cast_nonneg Q) hX hT) (le_refl _) + intro χ + refine (hcharacters χ).trans (mul_le_mul_of_nonneg_left (add_le_add ?_ ?_) hC) + · exact zero_decay_weight_le χ.val.2.val _ (B+1) (by linarith) + · apply contourRemainder_mono B (by positivity) _ hX hT + exact_mod_cast (show χ.val.1.val+1 ≤ Q from χ.val.1.isLt) + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveRieszComparison.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveRieszComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..862ed427c5cc9d7c4cdd07dc692b60540b993c17 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveRieszComparison.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszCoprimeComparison +import OAI.NumberTheory.Ostmann.Characters.PrimitiveCharacterReduction + +namespace OAI + +/-! # Riesz means after passage to the actual primitive character -/ + +namespace Ostmann + +noncomputable def reducedRieszMean (e : Option PrimitiveComplexCharacter) (X : ℝ) : ℂ := + match e with + | none => principalRieszMean X + | some χ => characterRieszMean χ X + +theorem primitiveReduction_divides {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) + (ρ : PrimitiveComplexCharacter) (hρ : primitiveCharacterReduction χ = some ρ) : ρ.modulus ∣ q := by + rw [primitiveCharacterReduction_modulus χ ρ hρ] + exact χ.conductor_dvd_level + +theorem primitiveReduction_agrees {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) + (ρ : PrimitiveComplexCharacter) (hρ : primitiveCharacterReduction χ = some ρ) + (n : ℕ) (hn : n.Coprime q) : χ (n : ZMod q) = ρ.character (n : ZMod ρ.modulus) := by + have hd := primitiveReduction_divides χ ρ hρ + have he := lift_primitiveCharacterReduction χ + rw [hρ] at he + simp only [liftPrimitiveCharacter, dite_eq_left hd] at he + rw [← he] + obtain ⟨u, hu⟩ := (ZMod.isUnit_iff_coprime n q).mpr hn + rw [← hu, DirichletCharacter.changeLevel_eq_cast_of_dvd, hu, ZMod.cast_natCast hd] + +theorem rieszTwistMean_primitive_comparison {q : ℕ} [NeZero q] + (χ : DirichletCharacter ℂ q) (X : ℝ) (hX : 1 ≤ X) : + ‖rieszTwistMean (fun n => χ (n : ZMod q)) X - + reducedRieszMean (primitiveCharacterReduction χ) X‖ ≤ + 2 * q * Real.log X + 4 * Real.sqrt X * Real.log X := by + have hq : 0 < q := Nat.pos_of_ne_zero (NeZero.ne q) + have hXp : 0 < X := by linarith + cases he : primitiveCharacterReduction χ with + | none => + have hχ : χ = 1 := by + have hh := lift_primitiveCharacterReduction χ + rw [he] at hh + exact hh.symm + simp only [reducedRieszMean] + rw [← rieszTwistMean_eq_principal X hXp] + apply rieszTwistMean_coprime_comparison _ _ q X hq hX + (fun n => χ.norm_le_one _) (by intro n; simp) + intro n hn + rw [hχ] + exact MulChar.one_apply ((ZMod.isUnit_iff_coprime n q).mpr hn) + | some ρ => + simp only [reducedRieszMean] + rw [← rieszTwistMean_eq_character ρ X hXp] + exact rieszTwistMean_coprime_comparison _ _ q X hq hX + (fun n => χ.norm_le_one _) (fun n => ρ.character.norm_le_one _) + (primitiveReduction_agrees χ ρ he) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveRieszErrorDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveRieszErrorDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..91d6e3da10b5adf6342d027cccf68bbcf868c4c6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrimitiveRieszErrorDecay.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimitiveRieszComparison + +namespace OAI + +/-! # The primitive-reduction error is smaller than the Riesz contour error -/ + +namespace Ostmann + +open Filter + +theorem primitive_riesz_error_decay_log (d : ℝ) (hd : 0 < d) : + ∀ᶠ y : ℝ in atTop, ∀ q : ℕ, (q : ℝ) ≤ Real.exp y → + 2 * q * Real.log (Real.exp (y ^ 2)) + + 4 * Real.sqrt (Real.exp (y ^ 2)) * Real.log (Real.exp (y ^ 2)) ≤ + Real.exp (y ^ 2) * Real.exp (-d * y) := by + filter_upwards [riesz_polynomial_absorption 6 1 (by norm_num), + eventually_ge_atTop (2 * (d + 1)), eventually_ge_atTop (2 : ℝ)] with y hp hy hy2 + intro q hq + simp only [one_mul] at hp + have he : (q : ℝ) ≤ Real.exp (y ^ 2 / 2) := hq.trans + (Real.exp_le_exp.mpr (by nlinarith)) + have hp' : 6 * y ^ 2 ≤ Real.exp y := by linarith + have hmul := mul_le_mul_of_nonneg_left hp' (Real.exp_nonneg (y ^ 2 / 2)) + have hqmul := mul_le_mul_of_nonneg_right he (sq_nonneg y) + rw [Real.log_exp, ← Real.exp_half] + calc + _ ≤ Real.exp (y ^ 2 / 2) * (6 * y ^ 2) := by nlinarith + _ ≤ Real.exp (y ^ 2 / 2) * Real.exp y := hmul + _ = Real.exp (y ^ 2 / 2 + y) := (Real.exp_add _ _).symm + _ ≤ Real.exp (y ^ 2 - d * y) := Real.exp_le_exp.mpr (by nlinarith) + _ = _ := by simp only [Real.exp_sub, neg_mul, Real.exp_neg, div_eq_mul_inv] + +theorem primitive_riesz_error_decay (d : ℝ) (hd : 0 < d) : + ∀ᶠ X : ℝ in atTop, ∀ q : ℕ, (q : ℝ) ≤ Real.exp (Real.sqrt (Real.log X)) → + 2 * q * Real.log X + 4 * Real.sqrt X * Real.log X ≤ + X * Real.exp (-d * Real.sqrt (Real.log X)) := by + have ht := Real.tendsto_sqrt_atTop.comp Real.tendsto_log_atTop + filter_upwards [ht.eventually (primitive_riesz_error_decay_log d hd), + eventually_ge_atTop (1 : ℝ)] with X hX hX1 + intro q hq + have hx : 0 < X := by linarith + have heq : Real.exp ((Real.sqrt (Real.log X)) ^ 2) = X := by + rw [Real.sq_sqrt (Real.log_nonneg hX1), Real.exp_log hx] + have hh := hX q hq + dsimp only [Function.comp_apply] at hh + simpa only [heq] using hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalChebyshevEstimate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalChebyshevEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3109bd07237b6573a8c66a4d89bb15c9cd91ef6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalChebyshevEstimate.lean @@ -0,0 +1,74 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszNearby +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszPositiveRecovery + +namespace OAI + +/-! # The quantitative principal Chebyshev estimate from positive unsmoothing -/ + +namespace Ostmann + +open Filter + +theorem principal_chebyshev_error : ∃ c : ℝ, 0 < c ∧ ∀ᶠ X : ℝ in atTop, + |Chebyshev.psi X - X| ≤ 25 * X * Real.exp (-c * Real.sqrt (Real.log X)) := by + obtain ⟨d, hd, hdecay⟩ := principal_riesz_sqrt_decay + obtain ⟨X0, hX0⟩ := eventually_atTop.mp hdecay + refine ⟨d / 4, by positivity, ?_⟩ + have ht := Real.tendsto_sqrt_atTop.comp Real.tendsto_log_atTop + filter_upwards [eventually_ge_atTop (max 4 (2 * X0)), + ht.eventually (eventually_ge_atTop ((4 / d) * Real.log 2))] with X hXlarge hscale + have hX : 4 ≤ X := (le_max_left _ _).trans hXlarge + have hX0' : 2 * X0 ≤ X := (le_max_right _ _).trans hXlarge + have hXp : 0 < X := by linarith + dsimp only [Function.comp_apply] at hscale + let y := Real.sqrt (Real.log X) + let h := X * Real.exp (-(d / 4) * y) + let E := 12 * X ^ 2 * Real.exp (-(d / 2) * y) + let N := ⌈2 * X⌉₊ + have hN : 2 * X ≤ (N : ℝ) := Nat.le_ceil _ + have hh : 0 < h := by dsimp [h]; positivity + have hlog : Real.log 2 ≤ (d / 4) * y := by + have hm := mul_le_mul_of_nonneg_left hscale (show 0 ≤ d / 4 by positivity) + have he : (d / 4) * ((4 / d) * Real.log 2) = Real.log 2 := by field_simp + rw [he] at hm + exact hm + have hexp : Real.exp (-(d / 4) * y) ≤ 1 / 2 := by + calc + _ ≤ Real.exp (-Real.log 2) := Real.exp_le_exp.mpr (by linarith) + _ = 1 / 2 := by rw [Real.exp_neg, Real.exp_log (by norm_num)]; norm_num + have hhalf : h ≤ X / 2 := by + have hm := mul_le_mul_of_nonneg_left hexp hXp.le + dsimp [h] + linarith + have herr (Y : ℝ) (hlo : X / 2 ≤ Y) (hhi : Y ≤ 2 * X) : + |finiteRieszSum (Finset.range (N + 1)) ArithmeticFunction.vonMangoldt Y - Y ^ 2 / 2| ≤ E := by + exact principalRiesz_nearby_error N d X Y hd hX hlo hhi (hhi.trans hN) + (hX0 Y (by linarith)) + have hzero := herr X (by linarith) (by linarith) + have hplus := herr (X + h) (by linarith) (by linarith) + have hminus := herr (X - h) (by linarith) (by linarith) + have hrec := finiteRieszSum_quadratic_recovery (Finset.range (N + 1)) + ArithmeticFunction.vonMangoldt X h E hh + (fun n _ => ArithmeticFunction.vonMangoldt_nonneg (n := n)) hzero hplus hminus + rw [principal_finite_count_eq_psi N X hXp.le (by linarith)] at hrec + have hexp2 : Real.exp (-(d / 2) * y) = (Real.exp (-(d / 4) * y)) ^ 2 := by + rw [← Real.exp_nat_mul] + congr 1 + norm_num + ring + have hE : E = 12 * h ^ 2 := by + dsimp [E, h] + rw [hexp2] + ring + have hratio : 2 * E / h = 24 * h := by + rw [hE] + field_simp + ring + have hfinal : |Chebyshev.psi X - X| ≤ 25 * h := by + rw [hratio] at hrec + linarith + simpa only [h, y, mul_assoc] using hfinal + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalFourierGrid.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalFourierGrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..460da8f342088225e3b7bc1d7db76f99e8f3f977 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalFourierGrid.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.Construction.OriginalKernelDecomposition +import OAI.NumberTheory.Ostmann.QuadraticCenter.SmallKernelFamily +import OAI.NumberTheory.Ostmann.QuadraticCenter.LargeKernelFamily + +namespace OAI + +/-! # Principal Fourier terms in finite frequency families -/ + +namespace Ostmann + +open Filter +open scoped BigOperators SchwartzMap + +theorem smallKernelParameters_principal (T : ℝ) (L : ℕ) : + smallKernelParameters T L ⊆ principalQuadraticParameters T L := by + intro i hi + obtain ⟨hi, hp, _⟩ := Finset.mem_filter.mp hi + exact Finset.mem_filter.mpr ⟨hi, hp⟩ + +theorem squarefreeKernelSupport_card_le (L N : ℕ) : + (squarefreeKernelSupport L N).card ≤ N := by + apply (Finset.card_le_card (Finset.filter_subset _ _)).trans + simp only [Nat.card_Icc] + omega + +theorem smallSquarefreeKernels_spec (L N s : ℕ) (hs : s ∈ smallSquarefreeKernels L N) : + 1 ≤ s ∧ s ≤ N ∧ Squarefree s ∧ s.Coprime L ∧ s ≤ L ^ 4 := by + obtain ⟨hs, hsmall⟩ := Finset.mem_filter.mp hs + exact ⟨(mem_squarefreeKernelSupport L N s).mp hs |>.1, + (mem_squarefreeKernelSupport L N s).mp hs |>.2.1, + (mem_squarefreeKernelSupport L N s).mp hs |>.2.2.1, + (mem_squarefreeKernelSupport L N s).mp hs |>.2.2.2, hsmall⟩ + +theorem largeSquarefreeKernels_spec (L N s : ℕ) (hL : 2 ≤ L) + (hs : s ∈ largeSquarefreeKernels L N) : + 1 ≤ s ∧ s ≤ N ∧ Squarefree s ∧ s.Coprime L ∧ 4 * L ^ 2 ≤ s := by + obtain ⟨hs, hlarge⟩ := Finset.mem_filter.mp hs + obtain ⟨hs1, hsN, hsf, hcp⟩ := (mem_squarefreeKernelSupport L N s).mp hs + refine ⟨hs1, hsN, hsf, hcp, ?_⟩ + have hpow : 4 ≤ L ^ 2 := by nlinarith + have hh : 4 * L ^ 2 ≤ L ^ 4 := by nlinarith [Nat.zero_le ((L ^ 2 - 4) * L ^ 2)] + exact hh.trans (Nat.le_of_lt hlarge) + +theorem filteredKernel_card_le (L N : ℕ) (pred : ℕ → Prop) [DecidablePred pred] : + ((squarefreeKernelSupport L N).filter pred).card ≤ N := + (Finset.card_le_card (Finset.filter_subset _ _)).trans (squarefreeKernelSupport_card_le L N) + +/-- One common index approximates both principal pieces. Its outer parameter +is one, and its scale remains in the small-kernel range. -/ +theorem eventual_principalFourier_grid (H : ℝ) (Φ : 𝓢(ℝ, ℂ)) + (hH : 0 ≤ H) (hΦ : ∀ x : ℝ, H < x → Φ x = 0) : + ∀ᶠ T : ℝ in atTop, ∀ (Q : Finset ℕ) (hQ : ∀ p ∈ Q, p.Prime) + (D : ∀ p : ℕ, Finset (ZMod p)) (M N h₀ : ℕ) (θ R : ℝ), + (Q.card : ℝ) ≤ T → (∀ p ∈ Q, 1000000 ≤ p) → + (Q.toList.prod : ℝ) ≤ Real.exp T → Odd M → h₀ < Q.toList.prod → + 0 ≤ θ → θ ≤ 1 → 1 ≤ R → R ≤ Real.exp (14 * T) → + (Q.toList.prod : ℝ) ^ 6 + Real.exp (-200 * T) ≤ R → + (N : ℝ) ≤ Real.exp (14 * T) → + ∃ i ∈ smallKernelParameters T Q.toList.prod, + ‖principalSmallFourier Q hQ D M N h₀ θ R Φ - + quadraticArrayStatistic (smallSquarefreeKernels Q.toList.prod N) M + (fixedQuadraticCoefficient T Q hQ D Φ i)‖ ≤ Real.exp (-113 * T) ∧ + ‖principalLargeFourier Q hQ D M N h₀ θ R Φ - + quadraticArrayStatistic (largeSquarefreeKernels Q.toList.prod N) M + (fixedQuadraticCoefficient T Q hQ D Φ i)‖ ≤ Real.exp (-113 * T) := by + filter_upwards [eventual_small_kernel_family_covers H Φ hH hΦ] with T hc + intro Q hQ D M N h₀ θ R hcard hlarge hL hM hh₀ hθ0 hθ1 hR hRU hmargin hN + obtain ⟨i, hi, he⟩ := hc Q hQ D M h₀ θ R hcard hlarge hL hM hh₀ hθ0 hθ1 hR hRU hmargin + have happ (pred : ℕ → Prop) [DecidablePred pred] : + ‖quadraticArrayStatistic ((squarefreeKernelSupport Q.toList.prod N).filter pred) M + (arithmeticQuadraticCoefficient Q hQ D Φ R 1 M h₀ θ) - + quadraticArrayStatistic ((squarefreeKernelSupport Q.toList.prod N).filter pred) M + (fixedQuadraticCoefficient T Q hQ D Φ i)‖ ≤ Real.exp (-113 * T) := by + apply quadraticArrayStatistic_grid_error + · intro s hs + exact (mem_squarefreeKernelSupport _ _ _ |>.mp (Finset.mem_filter.mp hs).1).1 + · exact (Nat.cast_le.mpr (filteredKernel_card_le _ _ pred)).trans hN + · intro s hs + obtain ⟨hs1, hsN, _⟩ := (mem_squarefreeKernelSupport _ _ _).mp (Finset.mem_filter.mp hs).1 + exact he s hs1 ((Nat.cast_le.mpr hsN).trans hN) + exact ⟨i, hi, happ _, happ _⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalFourthMoment.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalFourthMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..39edeecea264b9751c3b9c150f500644a754acf7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalFourthMoment.lean @@ -0,0 +1,72 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterFourthBound + +namespace OAI + +/-! +# Removing the principal character from the fourth moment + +Its contribution cancels the leading fourth power of the total mass. +This leaves the second-moment term required by the two-bad quartet case. +-/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable local instance principalFourthFintype {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +noncomputable local instance principalFourthDecidableEq {p : ℕ} : DecidableEq (MulChar (ZMod p) ℂ) := Classical.decEq _ + +theorem weightedCharacterSum_principal {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (a : ZMod p) : + weightedCharacterSum w 1 a = ((∑ b : ZMod p, w b) - w a : ℝ) := by + classical + have hterm (b : ZMod p) : (w b : ℂ) * (1 : MulChar (ZMod p) ℂ) (a - b) = + (w b : ℂ) - if b = a then (w a : ℂ) else 0 := by + by_cases hb : b = a + · simp [hb, MulChar.map_zero] + · have hab : a - b ≠ 0 := sub_ne_zero.mpr (Ne.symm hb) + rw [MulChar.one_apply (isUnit_iff_ne_zero.mpr hab)] + simp only [hb, ite_false, sub_zero, mul_one] + simp only [weightedCharacterSum, hterm, Finset.sum_sub_distrib, + Finset.sum_ite_eq', Finset.mem_univ, ite_true, Complex.ofReal_sub, Complex.ofReal_sum] + +private theorem fourth_tangent (J x : ℝ) : J ^ 4 - 4 * J ^ 3 * x ≤ (J - x) ^ 4 := by + have h : 0 ≤ x ^ 2 * ((x - 2 * J) ^ 2 + 2 * J ^ 2) := by positivity + nlinarith + +theorem principal_fourth_moment_lower {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) : + ((p : ℝ) - 4) * (∑ b : ZMod p, w b) ^ 4 ≤ + ∑ a : ZMod p, ‖weightedCharacterSum w 1 a‖ ^ 4 := by + simp_rw [weightedCharacterSum_principal, Complex.norm_real, Real.norm_eq_abs, + (show Even (4 : ℕ) by decide).pow_abs] + have h := Finset.sum_le_sum (s := Finset.univ) + (fun (a : ZMod p) _ => fourth_tangent (∑ b : ZMod p, w b) (w a)) + simp only [Finset.sum_sub_distrib, Finset.sum_const, Finset.card_univ, ZMod.card, + nsmul_eq_mul, ← Finset.mul_sum] at h + convert h using 1 + ring + +/-- The leading `J⁴` cancels after removing the principal character. -/ +theorem nonprincipal_fourth_moment_bound {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (hw : ∀ b, 0 ≤ w b) : + (∑ χ ∈ (Finset.univ : Finset (MulChar (ZMod p) ℂ)).erase 1, + ∑ a : ZMod p, ‖weightedCharacterSum w χ a‖ ^ 4) ≤ + 2 * (p : ℝ) * (Fintype.card (ZMod p)ˣ : ℝ) * + (∑ b : ZMod p, w b ^ 2) ^ 2 + 3 * (∑ b : ZMod p, w b) ^ 4 := by + classical + have hc : 0 < (Fintype.card (ZMod p)ˣ : ℝ) := by exact_mod_cast Fintype.card_pos + have hcard : (Fintype.card (ZMod p)ˣ : ℝ) = (p : ℝ) - 1 := by + rw [ZMod.card_units, Nat.cast_sub (Fact.out : p.Prime).one_lt.le, Nat.cast_one] + have htotal := (div_le_iff₀ hc).mp (weightedCharacterSum_fourth_bound w hw) + have hprincipal := principal_fourth_moment_lower w + have hsplit := Finset.sum_erase_add (Finset.univ : Finset (MulChar (ZMod p) ℂ)) + (fun χ => ∑ a : ZMod p, ‖weightedCharacterSum w χ a‖ ^ 4) (Finset.mem_univ 1) + rw [hcard] at htotal ⊢ + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb57aef65b42c6b13d9159da116ad697fa953c81 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszBound.lean @@ -0,0 +1,126 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszRectangle +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaAbsoluteRightBound +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszResidueTruncation + +namespace OAI + +/-! # The principal Riesz error from the regularized zeta rectangle -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped Interval + +theorem zeta_logDeriv_from_regularized (s : ℂ) (hs : s ≠ 1) + (hz : regularizedZeta s ≠ 0) (δ : ℝ) (hδ : 0 < δ) (hd : δ ≤ ‖s - 1‖) : + ‖logDeriv riemannZeta s‖ ≤ ‖logDeriv regularizedZeta s‖ + 1 / δ := by + have hzne : riemannZeta s ≠ 0 := by + intro he + apply hz + rw [regularizedZeta_eq s hs, he, mul_zero] + have he : logDeriv riemannZeta s = logDeriv regularizedZeta s - (s - 1)⁻¹ := by + rw [regularizedZeta_logDeriv_off_one s hs hzne] + ring + rw [he] + apply (norm_sub_le _ _).trans + apply add_le_add le_rfl + rw [norm_inv, ← one_div] + exact div_le_div_of_nonneg_left zero_le_one hδ hd + +theorem zeta_logDeriv_right_continuous (b : ℝ) (hb : 1 < b) : + Continuous (fun t : ℝ => -logDeriv riemannZeta (rieszMellinLine b t)) := by + apply continuous_iff_continuousAt.mpr + intro t + have hs : rieszMellinLine b t ≠ 1 := by + intro he + have hh := congrArg Complex.re he + simp only [rieszMellinLine_re, Complex.one_re] at hh + linarith + have ha := analyticOn_riemannZeta (rieszMellinLine b t) hs + have hn := riemannZeta_ne_zero_of_one_le_re (by simpa using hb.le : 1 ≤ (rieszMellinLine b t).re) + exact (((ha.deriv.div ha hn).neg).continuousAt).comp (rieszMellinLine_continuous b).continuousAt + +theorem principalRieszMean_rectangle_bound : ∃ K C : ℝ, 0 < K ∧ 0 < C ∧ + ∀ X a b T M : ℝ, 1 ≤ X → 1 / 2 ≤ a → a < 1 → 1 < b → b ≤ 2 → 0 < T → 0 ≤ M → + (∀ s ∈ uIcc a b ×ℂ uIcc (-T) T, regularizedZeta s ≠ 0) → + (∀ s ∈ uIcc a b ×ℂ uIcc (-T) T, ‖logDeriv regularizedZeta s‖ ≤ M) → + ‖principalRieszMean X - (X / 2 : ℝ)‖ ≤ + K * (M + 1 / (1 - a)) * X ^ a + + 2 * ((M + 1 / T) * X ^ b / T ^ 2) * (b - a) + + 2 * (1 / (b - 1) + C) * X ^ b / T := by + obtain ⟨K, hK, hleft⟩ := weightedRiesz_left_segment_bound + obtain ⟨C, hC, hright⟩ := zeta_logDeriv_right_pole_bound + refine ⟨K, C, hK, hC, ?_⟩ + intro X a b T M hX ha ha1 hb hb2 hT hM hne hbound + have hXp : 0 < X := by linarith + have hab : a ≤ b := by linarith + have hmem (σ t : ℝ) (hσ : σ ∈ Icc a b) (ht : t ∈ Icc (-T) T) : + (σ : ℂ) + (t : ℂ) * I ∈ uIcc a b ×ℂ uIcc (-T) T := by + constructor + · simpa [uIcc_of_le hab] using hσ + · simpa [uIcc_of_le (show -T ≤ T by linarith)] using ht + have hlow (t : ℝ) (ht : t ∈ Icc (-T) T) : + ‖-logDeriv riemannZeta (rieszMellinLine a t)‖ ≤ M + 1 / (1 - a) := by + have hs : rieszMellinLine a t ≠ 1 := by + intro he + have hh := congrArg Complex.re he + simp only [rieszMellinLine_re, Complex.one_re] at hh + linarith + have hd : 1 - a ≤ ‖rieszMellinLine a t - 1‖ := by + have hh := Complex.abs_re_le_norm (rieszMellinLine a t - 1) + simpa [abs_of_neg (show a - 1 < 0 by linarith)] using hh + have hm := hmem a t ⟨le_rfl, hab⟩ ht + simpa only [norm_neg] using (zeta_logDeriv_from_regularized _ hs (hne _ hm) + (1 - a) (by linarith) hd).trans (add_le_add (hbound _ hm) le_rfl) + have hedge (σ t : ℝ) (hσ : σ ∈ Icc a b) (ht : |t| = T) : + ‖-logDeriv riemannZeta ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M + 1 / T := by + have hi : (((σ : ℂ) + (t : ℂ) * I) - 1).im = t := by simp + have hd : T ≤ ‖((σ : ℂ) + (t : ℂ) * I) - 1‖ := by + have hh := Complex.abs_im_le_norm (((σ : ℂ) + (t : ℂ) * I) - 1) + rwa [hi, ht] at hh + have hs : (σ : ℂ) + (t : ℂ) * I ≠ 1 := by + intro he + rw [he, sub_self, norm_zero] at hd + linarith + have hm := hmem σ t hσ (abs_le.mp (le_of_eq ht)) + simpa only [norm_neg] using (zeta_logDeriv_from_regularized _ hs (hne _ hm) + T hT hd).trans (add_le_add (hbound _ hm) le_rfl) + have hl := hleft (fun s => -logDeriv riemannZeta s) X a T (M + 1 / (1 - a)) + hXp ha (by positivity) hlow + have hl' : ‖∫ t in -T..T, principalRieszContour X ((a : ℂ) + (t : ℂ) * I)‖ ≤ + K * (M + 1 / (1 - a)) * X ^ a := by + simpa only [intervalIntegral.integral_of_le (show -T ≤ T by linarith), + integral_Icc_eq_integral_Ioc, principalRieszContour, rieszContourWeight, + rieszVerticalWeight, rieszMellinLine] using hl + have hu := weightedRiesz_horizontal_segment_bound (fun s => -logDeriv riemannZeta s) + X a b T (M + 1 / T) hX hab (by simpa [abs_of_pos hT]) (by positivity) + (fun σ hσ => hedge σ T hσ (abs_of_pos hT)) + have hd := weightedRiesz_horizontal_segment_bound (fun s => -logDeriv riemannZeta s) + X a b (-T) (M + 1 / T) hX hab (by simpa [abs_neg, abs_of_pos hT]) (by positivity) + (fun σ hσ => hedge σ (-T) hσ (by rw [abs_neg, abs_of_pos hT])) + rw [neg_sq] at hd + have hr := principalRieszContour_rectangle X hXp a b (-T) T (by linarith) ha1 hb + (by linarith) hT hne + have hr' : rectangleBoundaryIntegral (principalRieszContour X) a b (-T) T = + I * (((2 * Real.pi : ℝ) : ℂ) * (X / 2 : ℝ)) := by + rw [hr] + push_cast + ring + have hv := rectangle_vertical_shift_residue_norm_bound _ a b (-T) T _ hr' + have hrightBound (t : ℝ) : ‖-logDeriv riemannZeta (rieszMellinLine b t)‖ ≤ 1 / (b - 1) + C := by + simpa only [norm_neg, rieszMellinLine_re] using hright (rieszMellinLine b t) (by simpa using hb) (by simpa using hb2) + have ht := riesz_residue_truncation (fun s => -logDeriv riemannZeta s) X b + (1 / (b - 1) + C) T (X / 2 : ℝ) hXp hb.le (by positivity) hT + (zeta_logDeriv_right_continuous b hb) hrightBound + rw [← principalRieszMean_eq_vertical_logDerivative X b hXp hb] at ht + change ‖(∫ t in -T..T, principalRieszContour X ((b : ℂ) + (t : ℂ) * I)) - _‖ ≤ _ at hv + change ‖principalRieszMean X - (X / 2 : ℝ)‖ ≤ + ‖(∫ t in -T..T, principalRieszContour X ((b : ℂ) + (t : ℂ) * I)) - + ((2 * Real.pi : ℝ) : ℂ) * (X / 2 : ℝ)‖ + _ at ht + change ‖∫ σ in a..b, principalRieszContour X ((σ : ℂ) + (T : ℂ) * I)‖ ≤ _ at hu + change ‖∫ σ in a..b, principalRieszContour X ((σ : ℂ) + ((-T : ℝ) : ℂ) * I)‖ ≤ _ at hd + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..130b6db39a8338e8eb3b541a894b46c0141b62dc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszDecay.lean @@ -0,0 +1,61 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszSupply +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszExponentialParameters + +namespace OAI + +/-! # Exponential decay of the principal Riesz error -/ + +namespace Ostmann + +open Filter + +theorem principal_riesz_height_log_bound (y : ℝ) (hy : 5 ≤ y) : + 0 < Real.log (Real.exp y + 4) + 1 ∧ Real.log (Real.exp y + 4) + 1 ≤ 3 * y := by + have he : 4 ≤ Real.exp y := by linarith [Real.add_one_le_exp y] + have hlog : 0 ≤ Real.log (Real.exp y + 4) := Real.log_nonneg (by linarith) + refine ⟨by linarith, ?_⟩ + have hh : Real.log (Real.exp y + 4) ≤ Real.log 2 + y := by + calc + _ ≤ Real.log (2 * Real.exp y) := Real.log_le_log (by positivity) (by linarith) + _ = _ := by rw [Real.log_mul (by norm_num) (by positivity), Real.log_exp] + have htwo := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 2) + linarith + +theorem principal_riesz_decay : ∃ d : ℝ, 0 < d ∧ ∀ᶠ y : ℝ in atTop, + ‖principalRieszMean (Real.exp (y ^ 2)) - (Real.exp (y ^ 2) / 2 : ℝ)‖ ≤ + 3 * Real.exp (y ^ 2 - d * y) := by + obtain ⟨c, A, B, E, hc, hc4, hA, hB, hE, hbound⟩ := principal_riesz_general_bound + refine ⟨c / 6, by positivity, ?_⟩ + filter_upwards [riesz_exponential_error c A B E hc hc4 hA.le hB.le hE.le, + eventually_ge_atTop (5 : ℝ)] with y hy hy5 + have hy0 : 0 < y := by linarith + have hT : 2 ≤ Real.exp y := by linarith [Real.add_one_le_exp y] + have hb1 : 1 < 1 + 1 / y ^ 2 := by + have hh : 0 < 1 / y ^ 2 := by positivity + linarith + have hb2 : 1 + 1 / y ^ 2 ≤ 2 := by + have hys : 1 ≤ y ^ 2 := by nlinarith + have hh : 1 / y ^ 2 ≤ 1 := (div_le_one (by positivity)).mpr hys + linarith + have hh := hbound (Real.exp y) (Real.exp (y ^ 2)) (1 + 1 / y ^ 2) hT + (Real.one_le_exp (sq_nonneg y)) hb1 hb2 + obtain ⟨hH, hHy⟩ := principal_riesz_height_log_bound y hy5 + exact hh.trans (hy _ hH hHy) + +theorem principal_riesz_sqrt_decay : ∃ d : ℝ, 0 < d ∧ ∀ᶠ X : ℝ in atTop, + ‖principalRieszMean X - (X / 2 : ℝ)‖ ≤ + 3 * X * Real.exp (-d * Real.sqrt (Real.log X)) := by + obtain ⟨d, hd, h⟩ := principal_riesz_decay + refine ⟨d, hd, ?_⟩ + have ht := Real.tendsto_sqrt_atTop.comp Real.tendsto_log_atTop + filter_upwards [ht.eventually h, eventually_ge_atTop (1 : ℝ)] with X hX hX1 + have hx : 0 < X := by linarith + have heq : Real.exp ((Real.sqrt (Real.log X)) ^ 2) = X := by + rw [Real.sq_sqrt (Real.log_nonneg hX1), Real.exp_log hx] + dsimp only [Function.comp_apply] at hX + rw [heq, Real.exp_sub, Real.sq_sqrt (Real.log_nonneg hX1), Real.exp_log hx] at hX + simpa only [div_eq_mul_inv, ← Real.exp_neg, mul_assoc, neg_mul] using hX + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszFinite.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..339c4dee5a93ffe447aae26af022766ce480b0f5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszFinite.lean @@ -0,0 +1,62 @@ +import Mathlib.NumberTheory.Chebyshev +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszIntegral +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszFiniteSum + +namespace OAI + +/-! # Literal finite Mangoldt sums underlying the principal Riesz mean -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +theorem principalRieszMean_finite (N : ℕ) (X : ℝ) (hX : 0 < X) (hXN : X ≤ N) : + (X : ℂ) * principalRieszMean X = + (finiteRieszSum (Finset.range (N + 1)) ArithmeticFunction.vonMangoldt X : ℝ) := by + have hsupport (n : ℕ) (hn : n ∉ Finset.range (N + 1)) : + principalMangoldtCoefficient n * rieszPrimeTest (n / X) = 0 := by + have hNn : N < n := by simpa using hn + have hxn : X < n := hXN.trans_lt (by exact_mod_cast hNn) + rw [rieszPrimeTest_scale X n hX, max_eq_right (by linarith : X - (n : ℝ) ≤ 0)] + simp + rw [principalRieszMean, tsum_eq_sum hsupport, Finset.mul_sum] + unfold finiteRieszSum + push_cast + apply Finset.sum_congr rfl + intro n _ + rw [rieszPrimeTest_scale X n hX] + dsimp [principalMangoldtCoefficient] + push_cast + field_simp [show (X : ℂ) ≠ 0 by exact_mod_cast hX.ne'] + +theorem principalRieszMean_finite_error (N : ℕ) (X : ℝ) (hX : 0 < X) (hXN : X ≤ N) : + |finiteRieszSum (Finset.range (N + 1)) ArithmeticFunction.vonMangoldt X - X ^ 2 / 2| = + X * ‖principalRieszMean X - (X / 2 : ℝ)‖ := by + have hf := principalRieszMean_finite N X hX hXN + have he : ((finiteRieszSum (Finset.range (N + 1)) ArithmeticFunction.vonMangoldt X - + X ^ 2 / 2 : ℝ) : ℂ) = (X : ℂ) * (principalRieszMean X - (X / 2 : ℝ)) := by + rw [mul_sub, hf] + push_cast + ring + rw [← Real.norm_eq_abs, ← Complex.norm_real, he, norm_mul, Complex.norm_real, + Real.norm_eq_abs, abs_of_pos hX] + +theorem principal_finite_count_eq_psi (N : ℕ) (X : ℝ) (hX : 0 ≤ X) (hXN : X ≤ N) : + (∑ n ∈ (Finset.range (N + 1)).filter (fun n : ℕ => (n : ℝ) ≤ X), + ArithmeticFunction.vonMangoldt n) = Chebyshev.psi X := by + rw [Chebyshev.psi_eq_sum_Icc] + apply Finset.sum_congr _ (fun _ _ => rfl) + ext n + simp only [Finset.mem_filter, Finset.mem_range, Finset.mem_Icc] + constructor + · intro hn + exact ⟨Nat.zero_le _, (Nat.le_floor_iff hX).mpr hn.2⟩ + · intro hn + have hnx := (Nat.le_floor_iff hX).mp hn.2 + have hnN : n ≤ N := by exact_mod_cast (hnx.trans hXN) + exact ⟨by omega, hnx⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszIntegral.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..80e4c101260628e0c997a994133212f53920e6f6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszIntegral.lean @@ -0,0 +1,125 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszVerticalWeight +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothDirichletIntegral + +namespace OAI + +/-! # The exact starting contour for the principal Riesz mean -/ + +namespace Ostmann + +open Complex MeasureTheory +open scoped BigOperators + +noncomputable def principalMangoldtCoefficient (n : ℕ) : ℂ := ArithmeticFunction.vonMangoldt n + +theorem principalMangoldt_riesz_term_norm (σ t : ℝ) (n : ℕ) : + ‖LSeries.term principalMangoldtCoefficient (rieszMellinLine σ t) n‖ = + ‖LSeries.term principalMangoldtCoefficient (σ : ℂ) n‖ := by + simp [LSeries.norm_term_eq] + +theorem principalMangoldt_riesz_term_continuous (σ : ℝ) (n : ℕ) : + Continuous (fun t => LSeries.term principalMangoldtCoefficient (rieszMellinLine σ t) n) := by + by_cases hn : n = 0 + · subst n + simp only [LSeries.term_zero] + exact continuous_const + · simp only [LSeries.term_of_ne_zero hn] + exact continuous_const.div ((rieszMellinLine_continuous σ).const_cpow + (.inl (by exact_mod_cast hn))) (fun _ => Complex.cpow_ne_zero_iff.mpr + (.inl (by exact_mod_cast hn))) + +noncomputable def principalRieszMean (X : ℝ) : ℂ := + ∑' n : ℕ, principalMangoldtCoefficient n * rieszPrimeTest (n / X) + +noncomputable def principalRieszVerticalTerm + (X σ : ℝ) (n : ℕ) (t : ℝ) : ℂ := + LSeries.term (principalMangoldtCoefficient) (rieszMellinLine σ t) n * + rieszVerticalWeight X σ t + +theorem principalRieszVerticalTerm_norm + (X σ : ℝ) (n : ℕ) (t : ℝ) : + ‖principalRieszVerticalTerm X σ n t‖ = + ‖LSeries.term (principalMangoldtCoefficient) (σ : ℂ) n‖ * + ‖rieszVerticalWeight X σ t‖ := by + rw [principalRieszVerticalTerm, norm_mul, principalMangoldt_riesz_term_norm] + +theorem principalRieszVerticalTerm_integrable + (X σ : ℝ) (hX : 0 < X) (hσ : 1 ≤ σ) (n : ℕ) : + Integrable (principalRieszVerticalTerm X σ n) := by + apply ((rieszVerticalWeight_integrable X σ hX hσ).norm.const_mul + ‖LSeries.term (principalMangoldtCoefficient) (σ : ℂ) n‖).mono' + · exact ((principalMangoldt_riesz_term_continuous σ n).mul + (rieszVerticalWeight_continuous X σ hX (by linarith))).aestronglyMeasurable + · exact Filter.Eventually.of_forall (fun t => (principalRieszVerticalTerm_norm X σ n t).le) + +theorem principalRieszVerticalTerm_summable_norm + (X σ : ℝ) (hσ : 1 < σ) : + Summable (fun n => ∫ t : ℝ, ‖principalRieszVerticalTerm X σ n t‖) := by + have hsum : LSeriesSummable (principalMangoldtCoefficient) (σ : ℂ) := + ArithmeticFunction.LSeriesSummable_vonMangoldt (by simpa using hσ) + have hs := hsum.norm.mul_right (∫ t : ℝ, ‖rieszVerticalWeight X σ t‖) + apply hs.congr + intro n + simp only [principalRieszVerticalTerm_norm, integral_const_mul] + +theorem principalMangoldt_riesz_term_inversion + (X σ : ℝ) (hX : 0 < X) (hσ : 1 ≤ σ) (n : ℕ) : + ((1 / (2 * Real.pi) : ℝ) : ℂ) * + (∫ t : ℝ, principalRieszVerticalTerm X σ n t) = + principalMangoldtCoefficient n * rieszPrimeTest (n / X) := by + by_cases hn : n = 0 + · subst n + simp [principalRieszVerticalTerm, principalMangoldtCoefficient] + have hnR : 0 < (n : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero hn + have hkernel (t : ℝ) : principalRieszVerticalTerm X σ n t = + principalMangoldtCoefficient n * + (((n : ℝ) / X : ℝ) : ℂ) ^ (-rieszMellinLine σ t) * + rieszMellinKernel (rieszMellinLine σ t) := by + rw [principalRieszVerticalTerm, LSeries.term_of_ne_zero hn, rieszVerticalWeight, + Complex.cpow_neg, Complex.ofReal_div, + Complex.div_cpow_ofReal_nonneg hnR.le hX.le, inv_div] + push_cast + ring + simp_rw [hkernel, mul_assoc] + rw [integral_const_mul] + have hinv := rieszPrimeTest_mellin_inversion σ ((n : ℝ) / X) hσ (div_pos hnR hX) + change ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, + (((n : ℝ) / X : ℝ) : ℂ) ^ (-rieszMellinLine σ t) * + rieszMellinKernel (rieszMellinLine σ t)) = _ at hinv + rw [← hinv] + ring + +theorem principalRieszMean_eq_vertical_logDerivative + (X σ : ℝ) (hX : 0 < X) (hσ : 1 < σ) : + principalRieszMean X = + ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, + (-logDeriv riemannZeta (rieszMellinLine σ t)) * rieszVerticalWeight X σ t := by + unfold principalRieszMean + calc + _ = ∑' n : ℕ, ((1 / (2 * Real.pi) : ℝ) : ℂ) * + ∫ t : ℝ, principalRieszVerticalTerm X σ n t := + tsum_congr (fun n => (principalMangoldt_riesz_term_inversion X σ hX hσ.le n).symm) + _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * + ∑' n : ℕ, ∫ t : ℝ, principalRieszVerticalTerm X σ n t := tsum_mul_left + _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * + ∫ t : ℝ, ∑' n : ℕ, principalRieszVerticalTerm X σ n t := by + rw [integral_tsum_of_summable_integral_norm + (principalRieszVerticalTerm_integrable X σ hX hσ.le) + (principalRieszVerticalTerm_summable_norm X σ hσ)] + _ = _ := by + congr 1 + apply integral_congr_ae + filter_upwards with t + rw [show (∑' n : ℕ, principalRieszVerticalTerm X σ n t) = + LSeries (principalMangoldtCoefficient) (rieszMellinLine σ t) * rieszVerticalWeight X σ t from tsum_mul_right] + have he := ArithmeticFunction.LSeries_vonMangoldt_eq_deriv_riemannZeta_div + (s := rieszMellinLine σ t) (by simpa using hσ) + have he' : LSeries principalMangoldtCoefficient (rieszMellinLine σ t) = + -logDeriv riemannZeta (rieszMellinLine σ t) := by + change LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) _ = _ + simpa only [logDeriv_apply, neg_div] using he + rw [he'] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszNearby.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszNearby.lean new file mode 100644 index 0000000000000000000000000000000000000000..14c03d99acc5fbd144544479fb9b2b8b1d3e143c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszNearby.lean @@ -0,0 +1,48 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszFinite +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszDecay + +namespace OAI + +/-! # Uniform integrated errors at the nearby points used for unsmoothing -/ + +namespace Ostmann + +open Complex + +theorem sqrt_log_nearby_lower (X Y : ℝ) (hX : 4 ≤ X) (hY : X / 2 ≤ Y) : + Real.sqrt (Real.log X) / 2 ≤ Real.sqrt (Real.log Y) := by + have hXp : 0 < X := by linarith + have hY1 : 1 ≤ Y := by linarith + have hYp : 0 < Y := by linarith + have hsq : X ≤ Y ^ 2 := by nlinarith + have hl := Real.log_le_log hXp hsq + rw [Real.log_pow] at hl + norm_num only [Nat.cast_ofNat] at hl + nlinarith [Real.sq_sqrt (Real.log_nonneg (show 1 ≤ X by linarith)), + Real.sq_sqrt (Real.log_nonneg hY1), Real.sqrt_nonneg (Real.log X), + Real.sqrt_nonneg (Real.log Y)] + +theorem principalRiesz_nearby_error (N : ℕ) (d X Y : ℝ) (hd : 0 < d) + (hX : 4 ≤ X) (hY : X / 2 ≤ Y) (hY2 : Y ≤ 2 * X) (hYN : Y ≤ N) + (herr : ‖principalRieszMean Y - (Y / 2 : ℝ)‖ ≤ + 3 * Y * Real.exp (-d * Real.sqrt (Real.log Y))) : + |finiteRieszSum (Finset.range (N + 1)) ArithmeticFunction.vonMangoldt Y - Y ^ 2 / 2| ≤ + 12 * X ^ 2 * Real.exp (-(d / 2) * Real.sqrt (Real.log X)) := by + have hYp : 0 < Y := by linarith + have hroot := sqrt_log_nearby_lower X Y hX hY + have hexp : Real.exp (-d * Real.sqrt (Real.log Y)) ≤ + Real.exp (-(d / 2) * Real.sqrt (Real.log X)) := by + apply Real.exp_le_exp.mpr + nlinarith + rw [principalRieszMean_finite_error N Y hYp hYN] + calc + _ ≤ Y * (3 * Y * Real.exp (-d * Real.sqrt (Real.log Y))) := + mul_le_mul_of_nonneg_left herr hYp.le + _ = 3 * Y ^ 2 * Real.exp (-d * Real.sqrt (Real.log Y)) := by ring + _ ≤ 12 * X ^ 2 * Real.exp (-(d / 2) * Real.sqrt (Real.log X)) := by + apply mul_le_mul _ hexp (Real.exp_nonneg _) (by positivity) + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszRectangle.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszRectangle.lean new file mode 100644 index 0000000000000000000000000000000000000000..376ac165263cefa3bcf9a73d027c734588babedc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszRectangle.lean @@ -0,0 +1,71 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszIntegral +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszPoleRectangle +import OAI.NumberTheory.Ostmann.ZeroDensity.RegularizedZeta + +namespace OAI + +/-! # The principal Riesz rectangle, including zeta's actual pole -/ + +namespace Ostmann + +open Complex Filter Set +open scoped Topology Interval + +theorem regularizedZeta_logDeriv_off_one (s : ℂ) (hs : s ≠ 1) (hz : riemannZeta s ≠ 0) : + logDeriv regularizedZeta s = (s - 1)⁻¹ + logDeriv riemannZeta s := by + have he : regularizedZeta =ᶠ[𝓝 s] ((fun z : ℂ => z - 1) * riemannZeta) := by + filter_upwards [isOpen_ne.mem_nhds hs] with z hz + exact regularizedZeta_eq z hz + rw [(logDeriv_congr_nhds he).self_of_nhds, + logDeriv_mul (f := fun z : ℂ => z - 1) (g := riemannZeta) s + (sub_ne_zero.mpr hs) hz (differentiableAt_id.sub_const _) (differentiableAt_riemannZeta hs)] + simp [logDeriv_apply] + +noncomputable def principalRieszContour (X : ℝ) (s : ℂ) : ℂ := + -logDeriv riemannZeta s * rieszContourWeight X s + +theorem principalRieszContour_rectangle (X : ℝ) (hX : 0 < X) (a b c d : ℝ) + (ha : 0 < a) (ha1 : a < 1) (hb : 1 < b) (hc : c < 0) (hd : 0 < d) + (hne : ∀ s ∈ uIcc a b ×ℂ uIcc c d, regularizedZeta s ≠ 0) : + rectangleBoundaryIntegral (principalRieszContour X) a b c d = + (2 * (Real.pi : ℂ) * I) * (X / 2 : ℝ) := by + let g : ℂ → ℂ := fun s => -logDeriv regularizedZeta s * rieszContourWeight X s + let p : ℂ → ℂ := fun s => rieszContourWeight X s / (s - 1) + have hspos (s : ℂ) (hs : s ∈ uIcc a b ×ℂ uIcc c d) : 0 < s.re := + ha.trans_le ((uIcc_of_le (ha1.trans hb).le) ▸ hs.1).1 + have hg : ∀ s ∈ uIcc a b ×ℂ uIcc c d, AnalyticAt ℂ g s := by + intro s hs + exact (((regularizedZeta_analytic s).deriv.div (regularizedZeta_analytic s) + (hne s hs)).neg).mul (rieszContourWeight_analyticAt X hX s (hspos s hs)) + have hnot (s : ℂ) (hs : s ∈ contourRectangleBoundary a b c d) : s ≠ 1 := + contourBoundary_ne_interior ⟨ha1, hb, hc, hd⟩ hs + have hgI : RectangleIntegrable g a b c d := rectangleIntegrable_of_continuousOn + (fun s hs => (hg s ⟨hs.1, hs.2.1⟩).continuousAt.continuousWithinAt) + have hpI : RectangleIntegrable p a b c d := by + apply rectangleIntegrable_of_continuousOn + intro s hs + exact ((rieszContourWeight_analyticAt X hX s (hspos s ⟨hs.1, hs.2.1⟩)).div + (analyticAt_id.sub analyticAt_const) (sub_ne_zero.mpr (hnot s hs))).continuousAt.continuousWithinAt + have heq : rectangleBoundaryIntegral (principalRieszContour X) a b c d = + rectangleBoundaryIntegral (fun s => g s + p s) a b c d := by + apply rectangleBoundaryIntegral_congr + intro s hs + have hz : riemannZeta s ≠ 0 := by + intro he + apply hne s ⟨hs.1, hs.2.1⟩ + rw [regularizedZeta_eq s (hnot s hs), he, mul_zero] + have hh := regularizedZeta_logDeriv_off_one s (hnot s hs) hz + dsimp [principalRieszContour, g, p] + rw [hh] + ring + rw [heq, rectangleBoundaryIntegral_add hgI hpI, rectangleBoundaryIntegral_eq_zero hg, zero_add] + have hp := riesz_pole_rectangle X hX 1 a b c d ha ha1 hb hc hd + change rectangleBoundaryIntegral (fun s => rieszContourWeight X s / (s - 1)) a b c d = _ at hp + have hweight : rieszContourWeight X (1 : ℂ) = (X / 2 : ℝ) := by + simp [rieszContourWeight, rieszMellinKernel] + ring + simpa only [p, Complex.ofReal_one, hweight] using hp + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszSupply.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszSupply.lean new file mode 100644 index 0000000000000000000000000000000000000000..025c1361e4337187ce0e8f02bb3b2d3b0564e4ff --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalRieszSupply.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszBound +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaZeroFreeLogDerivative + +namespace OAI + +/-! # A quantitative principal Riesz estimate with no prime-distribution input -/ + +namespace Ostmann + +open Complex Set +open scoped Interval + +theorem principal_riesz_general_bound : ∃ c A B E : ℝ, + 0 < c ∧ c ≤ 1 / 4 ∧ 0 < A ∧ 0 < B ∧ 0 < E ∧ + ∀ T X b : ℝ, 2 ≤ T → 1 ≤ X → 1 < b → b ≤ 2 → + let H := Real.log (T + 4) + 1 + ‖principalRieszMean X - (X / 2 : ℝ)‖ ≤ + A * H ^ 2 * X ^ (1 - c / H) + B * H ^ 2 * X ^ b / T ^ 2 + + 2 * (1 / (b - 1) + E) * X ^ b / T := by + obtain ⟨c, M0, hc, hc4, hM0, hdata⟩ := zeta_zero_free_logDeriv_data + obtain ⟨K, E, hK, hE, hrect⟩ := principalRieszMean_rectangle_bound + refine ⟨c, K * (M0 + c⁻¹), 4 * (M0 + 1), E, hc, hc4, + by positivity, by positivity, hE, ?_⟩ + intro T X b hT hX hb hb2 + dsimp only + let H := Real.log (T + 4) + 1 + let a := 1 - c / H + have hH : 1 ≤ H := by + have hh := Real.log_nonneg (show 1 ≤ T + 4 by linarith) + dsimp [H] + linarith + have hHp : 0 < H := by linarith + have hfrac : 0 < c / H := div_pos hc hHp + have hfrac4 : c / H ≤ 1 / 4 := by + calc + c / H ≤ c / 1 := div_le_div_of_nonneg_left hc.le (by norm_num) hH + _ ≤ 1 / 4 := by simpa using hc4 + have ha : 1 / 2 ≤ a := by dsimp [a]; linarith + have ha1 : a < 1 := by dsimp [a]; linarith + have hab : a ≤ b := by linarith + have hpoint (s : ℂ) (hs : s ∈ uIcc a b ×ℂ uIcc (-T) T) : + regularizedZeta s ≠ 0 ∧ ‖logDeriv regularizedZeta s‖ ≤ M0 * H ^ 2 := by + have hre : a ≤ s.re ∧ s.re ≤ b := by simpa [uIcc_of_le hab] using hs.1 + have him : -T ≤ s.im ∧ s.im ≤ T := by + simpa [uIcc_of_le (show -T ≤ T by linarith)] using hs.2 + exact hdata T hT s hre.1 (hre.2.trans hb2) (abs_le.mpr him) + have hh := hrect X a b T (M0 * H ^ 2) hX ha ha1 hb hb2 (by linarith) (by positivity) + (fun s hs => (hpoint s hs).1) (fun s hs => (hpoint s hs).2) + have hinv : 1 / (1 - a) = H * c⁻¹ := by + dsimp [a] + rw [show 1 - (1 - c / H) = c / H by ring, one_div, inv_div] + ring + have hlow : M0 * H ^ 2 + 1 / (1 - a) ≤ (M0 + c⁻¹) * H ^ 2 := by + rw [hinv] + have hh := mul_nonneg (inv_nonneg.mpr hc.le) (show 0 ≤ H ^ 2 - H by nlinarith) + nlinarith + have hhigh : M0 * H ^ 2 + 1 / T ≤ (M0 + 1) * H ^ 2 := by + have hi : 1 / T ≤ 1 := (div_le_one (by linarith)).mpr (by linarith) + nlinarith + have hlength : b - a ≤ 2 := by linarith + have hfirst := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hlow hK.le) + (Real.rpow_nonneg (by linarith : 0 ≤ X) a) + have hsecond : 2 * ((M0 * H ^ 2 + 1 / T) * X ^ b / T ^ 2) * (b - a) ≤ + 4 * (M0 + 1) * H ^ 2 * X ^ b / T ^ 2 := by + have hmult := mul_le_mul_of_nonneg_right hhigh + (show 0 ≤ X ^ b / T ^ 2 by positivity) + have hprod := mul_le_mul hmult hlength (sub_nonneg.mpr hab) + (show 0 ≤ (M0 + 1) * H ^ 2 * (X ^ b / T ^ 2) by positivity) + convert mul_le_mul_of_nonneg_left hprod (by norm_num : (0 : ℝ) ≤ 2) using 1 <;> ring + have hfirst' : K * (M0 * H ^ 2 + 1 / (1 - a)) * X ^ a ≤ + (K * (M0 + c⁻¹)) * H ^ 2 * X ^ a := by + convert hfirst using 1 + ring + calc + _ ≤ K * (M0 * H ^ 2 + 1 / (1 - a)) * X ^ a + + 2 * ((M0 * H ^ 2 + 1 / T) * X ^ b / T ^ 2) * (b - a) + + 2 * (1 / (b - 1) + E) * X ^ b / T := hh + _ ≤ (K * (M0 + c⁻¹)) * H ^ 2 * X ^ a + + 4 * (M0 + 1) * H ^ 2 * X ^ b / T ^ 2 + + 2 * (1 / (b - 1) + E) * X ^ b / T := by linarith + _ = _ := rfl + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothing.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothing.lean new file mode 100644 index 0000000000000000000000000000000000000000..54ae750590f04a37d2c30c59933bdba0d95aa939 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothing.lean @@ -0,0 +1,84 @@ +import Mathlib.Analysis.Complex.Basic +import Mathlib.Analysis.Normed.Group.Bounded +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalSmoothingIdentity +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalSmoothingPNT + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open Set MeasureTheory Filter +open scoped BigOperators Topology ContDiff +namespace Ostmann.ZeroDensity + +theorem principal_smoothing_real_bound {φ : ℝ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hcompact : HasCompactSupport φ) + (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) : + ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ ∀ᶠ X : ℝ in atTop, + |(∑' n : ℕ, ArithmeticFunction.vonMangoldt n * φ ((n : ℝ)/X)) - + X * (∫ t in Ioi (0 : ℝ), φ t)| ≤ C*X*Real.exp (-c*Real.sqrt (Real.log X)) := by + obtain ⟨c, K, hc, hK, hPNT⟩ := principal_cumulative_uniform_PNT + obtain ⟨A, hA⟩ := hcompact.deriv.exists_bound_of_continuous (hφ.continuous_deriv (by simp)) + let M : ℝ := |A| + 1 + have hM : 0 < M := by dsimp [M]; positivity + have hderiv (t : ℝ) : ‖deriv φ t‖ ≤ M := by + exact (hA t).trans (by dsimp [M]; linarith [le_abs_self A]) + refine ⟨c, M*K, hc, mul_pos hM hK, ?_⟩ + filter_upwards [hPNT, eventually_gt_atTop (0 : ℝ)] with X hPX hX + rw [principal_smoothing_error_identity ArithmeticFunction.vonMangoldt hφ hs hX, abs_neg, + ← Real.norm_eq_abs] + have hbound : ‖∫ t in X/2..X, + (deriv φ (t/X)/X) * (principalCumulative ArithmeticFunction.vonMangoldt t-t)‖ ≤ + (M*K*Real.exp (-c*Real.sqrt (Real.log X))) * |X-X/2| := by + apply intervalIntegral.norm_integral_le_of_norm_le_const + intro t ht + rw [uIoc_of_le (by linarith : X/2 ≤ X)] at ht + have herror : ‖principalCumulative ArithmeticFunction.vonMangoldt t-t‖ ≤ + K*X*Real.exp (-c*Real.sqrt (Real.log X)) := by + simpa only [Real.norm_eq_abs] using hPX t ⟨ht.1.le, ht.2⟩ + rw [norm_mul, norm_div, Real.norm_eq_abs X, abs_of_pos hX] + calc + _ ≤ (M/X) * (K*X*Real.exp (-c*Real.sqrt (Real.log X))) := + mul_le_mul (div_le_div_of_nonneg_right (hderiv (t/X)) hX.le) herror + (norm_nonneg _) (div_nonneg hM.le hX.le) + _ = _ := by field_simp + calc + _ ≤ (M*K*Real.exp (-c*Real.sqrt (Real.log X))) * |X-X/2| := hbound + _ ≤ (M*K*Real.exp (-c*Real.sqrt (Real.log X))) * X := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + rw [abs_of_nonneg (by linarith : 0 ≤ X-X/2)] + linarith + _ = _ := by ring + +theorem principal_mod_one_apply (n : ℕ) : (1 : DirichletCharacter ℂ 1) n = 1 := by + have hn : (n : ZMod 1) = 1 := Subsingleton.elim _ _ + rw [hn, map_one] + +theorem smoothError_principal_one_eq (φ : ℝ → ℝ) (X : ℝ) : + smoothError (1 : DirichletCharacter ℂ 1) φ X = + (((∑' n : ℕ, ArithmeticFunction.vonMangoldt n * φ ((n : ℝ)/X)) - + X * (∫ t in Ioi (0 : ℝ), φ t) : ℝ) : ℂ) := by + classical + unfold smoothError + simp only [principal_mod_one_apply, mul_one, ite_true, ← Complex.ofReal_mul, + ← Complex.ofReal_tsum, Complex.ofReal_sub] + +theorem principal_smoothError_bound {φ : ℝ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hcompact : HasCompactSupport φ) + (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) : + ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ ∀ᶠ X : ℝ in atTop, + ‖smoothError (1 : DirichletCharacter ℂ 1) φ X‖ ≤ + C*X*Real.exp (-c*Real.sqrt (Real.log X)) := by + obtain ⟨c, C, hc, hC, h⟩ := principal_smoothing_real_bound hφ hcompact hs + refine ⟨c, C, hc, hC, ?_⟩ + filter_upwards [h] with X hX + simpa only [smoothError_principal_one_eq, Complex.norm_real, Real.norm_eq_abs] using hX + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothingAbel.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothingAbel.lean new file mode 100644 index 0000000000000000000000000000000000000000..e1eb15fddd120f16bec6066761a13cde1827815e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothingAbel.lean @@ -0,0 +1,91 @@ +import Mathlib.Analysis.Calculus.ContDiff.Deriv +import Mathlib.Analysis.Calculus.Deriv.Support +import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts +import Mathlib.NumberTheory.AbelSummation +import Mathlib.Tactic +import OAI.NumberTheory.Ostmann.ZeroDensity.Target + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter +open scoped BigOperators Topology ContDiff +namespace Ostmann.ZeroDensity + +def principalCumulative (c : ℕ → ℝ) (t : ℝ) : ℝ := + ∑ n ∈ Finset.Icc 0 ⌊t⌋₊, c n + +theorem principal_weight_nonzero_interval {φ : ℝ → ℝ} + (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) {X t : ℝ} (hX : 0 < X) + (ht : φ (t/X) ≠ 0) : t ∈ Ioo (X/2) X := by + have h := hs (subset_tsupport φ (Function.mem_support.mpr ht)) + constructor + · have h' := (lt_div_iff₀ hX).mp h.1 + linarith + · have h' := (div_lt_iff₀ hX).mp h.2 + simpa using h' + +theorem principal_weight_endpoints {φ : ℝ → ℝ} + (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) {X : ℝ} (hX : 0 < X) : + φ ((X/2)/X) = 0 ∧ φ (X/X) = 0 := by + constructor + · by_contra h + have h' := (principal_weight_nonzero_interval hs hX h).1 + exact lt_irrefl _ h' + · by_contra h + have h' := (principal_weight_nonzero_interval hs hX h).2 + exact lt_irrefl _ h' + +theorem principal_tsum_eq_finite (c : ℕ → ℝ) {φ : ℝ → ℝ} + (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) {X : ℝ} (hX : 0 < X) : + (∑' n : ℕ, c n * φ ((n : ℝ)/X)) = + ∑ n ∈ Finset.Ioc ⌊X/2⌋₊ ⌊X⌋₊, c n * φ ((n : ℝ)/X) := by + apply tsum_eq_sum + intro n hn + have hzero : φ ((n : ℝ)/X) = 0 := by + by_contra h + have hi := principal_weight_nonzero_interval hs hX h + apply hn + exact Finset.mem_Ioc.mpr ⟨(Nat.floor_lt (by positivity : 0 ≤ X/2)).mpr hi.1, + Nat.le_floor hi.2.le⟩ + simp only [hzero, mul_zero] + +theorem principal_weight_hasDerivAt {φ : ℝ → ℝ} (hφ : ContDiff ℝ ∞ φ) + (X t : ℝ) : HasDerivAt (fun u : ℝ => φ (u/X)) (deriv φ (t/X) / X) t := by + have hd : HasDerivAt φ (deriv φ (t/X)) (t/X) := + (hφ.differentiable (by simp) (t/X)).hasDerivAt + simpa only [one_div, div_eq_mul_inv, Function.comp_def, id_eq, one_mul] using + hd.comp t ((hasDerivAt_id t).div_const X) + +theorem principal_weight_deriv {φ : ℝ → ℝ} (hφ : ContDiff ℝ ∞ φ) (X : ℝ) : + deriv (fun u : ℝ => φ (u/X)) = fun u => deriv φ (u/X) / X := by + funext t + exact (principal_weight_hasDerivAt hφ X t).deriv + +theorem principal_weight_deriv_continuous {φ : ℝ → ℝ} (hφ : ContDiff ℝ ∞ φ) (X : ℝ) : + Continuous (fun u : ℝ => deriv φ (u/X) / X) := + ((hφ.continuous_deriv (by simp)).comp (continuous_id.div_const X)).div_const X + +theorem principal_smoothing_abel (c : ℕ → ℝ) {φ : ℝ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) + {X : ℝ} (hX : 0 < X) : + (∑' n : ℕ, c n * φ ((n : ℝ)/X)) = + -(∫ t in X/2..X, (deriv φ (t/X) / X) * principalCumulative c t) := by + have hdiff : ∀ t ∈ Icc (X/2) X, DifferentiableAt ℝ (fun u : ℝ => φ (u/X)) t := + fun t _ => (principal_weight_hasDerivAt hφ X t).differentiableAt + have hint : IntegrableOn (deriv (fun u : ℝ => φ (u/X))) (Icc (X/2) X) := by + rw [principal_weight_deriv hφ X] + exact (principal_weight_deriv_continuous hφ X).continuousOn.integrableOn_Icc + have h := sum_mul_eq_sub_sub_integral_mul c (by positivity : 0 ≤ X/2) + (by linarith : X/2 ≤ X) hdiff hint + have he := principal_weight_endpoints hs hX + simp only [he.1, he.2, zero_mul, sub_self, zero_sub, + principal_weight_deriv hφ X] at h + rw [principal_tsum_eq_finite c hs hX, intervalIntegral.integral_of_le (by linarith : X/2 ≤ X)] + simpa only [principalCumulative, mul_comm] using h + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothingIdentity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothingIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce9722ee579ec7d1140bee30463b43868e7ad585 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothingIdentity.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalSmoothingAbel + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter +open scoped BigOperators Topology ContDiff +namespace Ostmann.ZeroDensity + +theorem principal_integral_Ioi_eq_interval {φ : ℝ → ℝ} + (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) : + (∫ t in Ioi (0 : ℝ), φ t) = ∫ t in (1/2 : ℝ)..1, φ t := by + rw [intervalIntegral.integral_of_le (by norm_num : (1/2 : ℝ) ≤ 1)] + have hmem {x : ℝ} (hx : φ x ≠ 0) : x ∈ Ioo (1/2 : ℝ) 1 := + hs (subset_tsupport φ (Function.mem_support.mpr hx)) + calc + _ = ∫ t : ℝ, φ t := setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx => by + by_contra h + have h' := (hmem h).1 + exact hx (by change 0 < x; linarith)) + _ = _ := (setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx => by + by_contra h + exact hx ⟨(hmem h).1, (hmem h).2.le⟩)).symm + +theorem principal_smoothing_main_term {φ : ℝ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) + {X : ℝ} (hX : 0 < X) : + -(∫ t in X/2..X, (deriv φ (t/X) / X) * t) = + X * ∫ t in Ioi (0 : ℝ), φ t := by + have h := intervalIntegral.integral_mul_deriv_eq_deriv_mul + (a := X/2) (b := X) + (fun t _ => principal_weight_hasDerivAt hφ X t) + (fun t _ => hasDerivAt_id t) + ((principal_weight_deriv_continuous hφ X).intervalIntegrable _ _) + (intervalIntegrable_const : IntervalIntegrable (fun _ : ℝ => (1 : ℝ)) volume (X/2) X) + have he := principal_weight_endpoints hs hX + simp only [id_eq, mul_one, he.1, he.2, zero_mul, sub_self, zero_sub] at h + rw [← h, intervalIntegral.integral_comp_div _ hX.ne'] + have hhalf : X/2/X = (1/2 : ℝ) := by field_simp + rw [hhalf, div_self hX.ne', smul_eq_mul, ← principal_integral_Ioi_eq_interval hs] + +theorem principal_cumulative_deriv_integrable (c : ℕ → ℝ) {φ : ℝ → ℝ} + (hφ : ContDiff ℝ ∞ φ) {X : ℝ} (hX : 0 < X) : + IntervalIntegrable (fun t => (deriv φ (t/X)/X) * principalCumulative c t) + volume (X/2) X := by + apply (intervalIntegrable_iff_integrableOn_Icc_of_le (by linarith : X/2 ≤ X)).mpr + exact integrableOn_mul_sum_Icc c (by positivity : 0 ≤ X/2) + (principal_weight_deriv_continuous hφ X).continuousOn.integrableOn_Icc + +theorem principal_smoothing_error_identity (c : ℕ → ℝ) {φ : ℝ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) + {X : ℝ} (hX : 0 < X) : + (∑' n : ℕ, c n * φ ((n : ℝ)/X)) - X * (∫ t in Ioi (0 : ℝ), φ t) = + -(∫ t in X/2..X, (deriv φ (t/X)/X) * (principalCumulative c t-t)) := by + rw [principal_smoothing_abel c hφ hs hX, ← principal_smoothing_main_term hφ hs hX] + simp_rw [mul_sub] + have hcont : Continuous (fun t : ℝ => (deriv φ (t/X)/X)*t) := by + apply Continuous.mul + · exact principal_weight_deriv_continuous hφ X + · exact continuous_id + have ht : IntervalIntegrable (fun t : ℝ => (deriv φ (t/X)/X)*t) volume (X/2) X := + hcont.intervalIntegrable (X/2) X + rw [intervalIntegral.integral_sub (principal_cumulative_deriv_integrable c hφ hX) ht] + ring + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothingPNT.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothingPNT.lean new file mode 100644 index 0000000000000000000000000000000000000000..d8fffc951486a3c6b8f80fd6f22de623ecdc8a51 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSmoothingPNT.lean @@ -0,0 +1,88 @@ +import Mathlib.Analysis.MellinInversion +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +import Mathlib.Tactic +import OAI.NumberTheory.Ostmann.Dirichlet.ZetaCompactStrip +import OAI.NumberTheory.Ostmann.Dirichlet.ZetaStrip +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalSmoothingAbel +import StrongPNT.Erdos970.PNT5_Strong + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open Set MeasureTheory Filter +open scoped BigOperators Topology ContDiff +namespace Ostmann.ZeroDensity + +theorem principalCumulative_vonMangoldt_eq {t : ℝ} (ht : 0 ≤ t) : + principalCumulative ArithmeticFunction.vonMangoldt t = ChebyshevPsi t := by + unfold principalCumulative ChebyshevPsi + rw [Nat.floor_add_one ht, Nat.range_succ_eq_Icc_zero] + +theorem principal_cumulative_strong_PNT : + ∃ c K : ℝ, 0 < c ∧ 0 < K ∧ ∀ᶠ t : ℝ in atTop, + |principalCumulative ArithmeticFunction.vonMangoldt t-t| ≤ + K*t*Real.exp (-c*Real.sqrt (Real.log t)) := by + obtain ⟨c, hc, hPNT⟩ := Strong_PNT + obtain ⟨K, hK, hbound⟩ := hPNT.exists_pos + refine ⟨c, K, hc, hK, ?_⟩ + filter_upwards [hbound.bound, eventually_ge_atTop (0 : ℝ)] with t ht ht0 + change ‖ChebyshevPsi t-t‖ ≤ K*‖t*Real.exp (-c*(Real.log t)^(1/2 : ℝ))‖ at ht + rw [principalCumulative_vonMangoldt_eq ht0] + simp only [Real.norm_eq_abs] at ht + rw [abs_of_nonneg (by positivity : 0 ≤ t*Real.exp (-c*(Real.log t)^(1/2 : ℝ))), + ← Real.sqrt_eq_rpow] at ht + nlinarith [ht] + +theorem half_sqrt_log_le_sqrt_log {X t : ℝ} (hX : 4 ≤ X) (ht : X/2 ≤ t) : + Real.sqrt (Real.log X) / 2 ≤ Real.sqrt (Real.log t) := by + have hXpos : 0 < X := by linarith + have htpos : 0 < t := by linarith + have hlog4 := Real.log_le_log (by norm_num : (0 : ℝ) < 4) hX + have hlogt := Real.log_le_log (by positivity : 0 < X/2) ht + rw [Real.log_div hXpos.ne' (by norm_num : (2 : ℝ) ≠ 0)] at hlogt + have hlog4eq : Real.log (4 : ℝ) = 2 * Real.log 2 := by + calc + Real.log (4 : ℝ) = Real.log ((2 : ℝ)^2) := by norm_num + _ = 2 * Real.log 2 := by rw [Real.log_pow]; norm_num + rw [hlog4eq] at hlog4 + have hXlog : 0 ≤ Real.log X := Real.log_nonneg (by linarith) + have htlog : 0 ≤ Real.log t := Real.log_nonneg (by linarith) + have hXs := Real.sq_sqrt hXlog + have hts := Real.sq_sqrt htlog + have hXr := Real.sqrt_nonneg (Real.log X) + have htr := Real.sqrt_nonneg (Real.log t) + nlinarith + +theorem principal_cumulative_uniform_PNT : + ∃ c K : ℝ, 0 < c ∧ 0 < K ∧ ∀ᶠ X : ℝ in atTop, + ∀ t ∈ Icc (X/2) X, + |principalCumulative ArithmeticFunction.vonMangoldt t-t| ≤ + K*X*Real.exp (-c*Real.sqrt (Real.log X)) := by + obtain ⟨c, K, hc, hK, h⟩ := principal_cumulative_strong_PNT + obtain ⟨T, hT⟩ := eventually_atTop.1 h + refine ⟨c/2, K, by positivity, hK, ?_⟩ + filter_upwards [eventually_ge_atTop (max (2*T) (4 : ℝ))] with X hX + intro t ht + have hX4 : 4 ≤ X := (le_max_right _ _).trans hX + have htT : T ≤ t := by have := (le_max_left (2*T) (4 : ℝ)).trans hX; linarith [ht.1] + have ht0 : 0 ≤ t := by linarith [ht.1] + have hr := half_sqrt_log_le_sqrt_log hX4 ht.1 + have he : Real.exp (-c*Real.sqrt (Real.log t)) ≤ + Real.exp (-(c/2)*Real.sqrt (Real.log X)) := by + apply Real.exp_le_exp.mpr + nlinarith + calc + _ ≤ K*t*Real.exp (-c*Real.sqrt (Real.log t)) := hT t htT + _ ≤ K*X*Real.exp (-(c/2)*Real.sqrt (Real.log X)) := by + exact mul_le_mul (mul_le_mul_of_nonneg_left ht.2 hK.le) he + (Real.exp_nonneg _) (mul_nonneg hK.le (by linarith)) + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSupplyDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSupplyDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc30c5339563789d2dca2c66a229deffbb19ed2c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PrincipalSupplyDecay.lean @@ -0,0 +1,58 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalSmoothing +import OAI.NumberTheory.Ostmann.ZeroDensity.RemainderDecay +import OAI.NumberTheory.Ostmann.ZeroDensity.SupplyPrimeScales + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open Filter Set +open scoped Topology ContDiff +namespace Ostmann.ZeroDensity + +theorem supplyPrimeSample_tendsto : + Tendsto (fun L : ℝ => (supplyPrimeSample L : ℝ)) atTop atTop := by + have hr : Tendsto (fun L : ℝ => (Ostmann.Supply.supplyRadius L : ℝ)) atTop atTop := + tendsto_natCast_atTop_atTop.comp Ostmann.Supply.supplyRadius_tendsto + simpa only [supplyPrimeSample,Nat.cast_pow,Function.comp_def] using + (tendsto_pow_atTop (by norm_num : (2 : ℕ) ≠ 0)).comp hr + +theorem eventually_principal_supply_decay {φ : ℝ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hcompact : HasCompactSupport φ) + (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) (D : ℝ) : + ∀ᶠ L : ℝ in atTop, + ‖smoothError (1 : DirichletCharacter ℂ 1) φ (supplyPrimeSample L : ℝ)‖ ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-D*L) := by + obtain ⟨c,C,hc,hC,hmain⟩ := principal_smoothError_bound hφ hcompact hs + have hlin := eventually_linear_mul_exp_le (a := 0) (b := (1 : ℝ)/2) + (by norm_num) ((D+1)/c) + have hconst := eventually_constant_exp_decay hC D + filter_upwards [supplyPrimeSample_tendsto.eventually hmain,hlin,hconst] with L hm hl hCdec + simp only [zero_mul,Real.exp_zero,mul_one] at hl + have hroot : Real.exp ((1 : ℝ)/2*L) ≤ Real.sqrt (Real.log (supplyPrimeSample L : ℝ)) := by + have hh := Real.sqrt_le_sqrt (log_supplyPrimeSample_lower L) + have he : Real.sqrt (Real.exp L) = Real.exp ((1 : ℝ)/2*L) := by + rw [Real.sqrt_eq_rpow,Real.rpow_def_of_pos (Real.exp_pos _),Real.log_exp] + congr 1 + ring + rwa [he] at hh + have hlin' : (D+1)*L ≤ c*Real.sqrt (Real.log (supplyPrimeSample L : ℝ)) := by + have hh := mul_le_mul_of_nonneg_left (hl.trans hroot) hc.le + have he : c*((D+1)/c*L) = (D+1)*L := by field_simp + rwa [he] at hh + calc + _ ≤ C*(supplyPrimeSample L : ℝ)*Real.exp (-c*Real.sqrt (Real.log (supplyPrimeSample L : ℝ))) := hm + _ ≤ C*(supplyPrimeSample L : ℝ)*Real.exp (-(D+1)*L) := by + apply mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (by linarith)) + positivity + _ = (supplyPrimeSample L : ℝ)*(C*Real.exp (-(D+1)*L)) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hCdec (Nat.cast_nonneg _) + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionCharacterCancellation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionCharacterCancellation.lean new file mode 100644 index 0000000000000000000000000000000000000000..0a92147abfd3fb4f9e8634b764d4673b722b227c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionCharacterCancellation.lean @@ -0,0 +1,135 @@ +import Mathlib.Algebra.Group.Units.Equiv +import OAI.NumberTheory.Ostmann.Characters.PeriodicCharacterSum +import OAI.NumberTheory.Ostmann.Characters.WeightedPhaseExtraction + +namespace OAI + +/-! # Exact cancellation of distinct short characters on a fixed progression -/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate + +private theorem complex_periodic_blocks (f : ℕ → ℂ) (q : ℕ) + (hp : Function.Periodic f q) (hz : ∑ a ∈ Finset.range q, f a = 0) + (k r : ℕ) : ∑ a ∈ Finset.range (k * q + r), f a = ∑ a ∈ Finset.range r, f a := by + induction k with + | zero => simp + | succ k ih => + rw [show (k + 1) * q + r = q + (k * q + r) by ring, Finset.sum_range_add, hz, zero_add] + have hp' (a : ℕ) : f (q + a) = f a := by simpa only [Nat.add_comm] using hp a + simpa only [hp'] using ih + +theorem complex_periodic_zero_sum_bound (f : ℕ → ℂ) (q : ℕ) (hq : 0 < q) + (hp : Function.Periodic f q) (hz : ∑ a ∈ Finset.range q, f a = 0) + (hb : ∀ a, ‖f a‖ ≤ 1) (N : ℕ) : ‖∑ a ∈ Finset.range N, f a‖ ≤ q := by + have he : N / q * q + N % q = N := by simpa only [Nat.mul_comm] using Nat.div_add_mod N q + rw [← he, complex_periodic_blocks f q hp hz] + calc + _ ≤ ∑ a ∈ Finset.range (N % q), ‖f a‖ := norm_sum_le _ _ + _ ≤ ∑ _a ∈ Finset.range (N % q), (1 : ℝ) := Finset.sum_le_sum (fun a _ => hb a) + _ = (N % q : ℕ) := by simp + _ ≤ q := by exact_mod_cast (Nat.mod_lt N hq).le + +theorem sum_range_residues {M : ℕ} [NeZero M] (F : ZMod M → ℂ) : + (∑ a ∈ Finset.range M, F (a : ZMod M)) = ∑ a : ZMod M, F a := by + have he := (ZMod.finEquiv M).toEquiv.sum_comp F + have hval (a : Fin M) : (ZMod.finEquiv M).toEquiv a = (a.val : ZMod M) := by + cases M with + | zero => exact Fin.elim0 a + | succ M => + apply Fin.ext + exact (Nat.mod_eq_of_lt a.isLt).symm + simp_rw [hval] at he + exact (Fin.sum_univ_eq_sum_range (fun a => F (a : ZMod M)) M).symm.trans he + +noncomputable def characterPairValue {q r : ℕ} (hqr : q.Coprime r) + (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (x : ZMod (q * r)) : ℂ := + χ ((ZMod.chineseRemainder hqr x).1) * conj (ψ ((ZMod.chineseRemainder hqr x).2)) + +theorem characterPairValue_nat {q r : ℕ} (hqr : q.Coprime r) + (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (a : ℕ) : + characterPairValue hqr χ ψ (a : ZMod (q * r)) = χ (a : ZMod q) * conj (ψ (a : ZMod r)) := by + simp only [characterPairValue, map_natCast, Prod.fst_natCast, Prod.snd_natCast] + +theorem characterPairValue_sum_zero {q r : ℕ} [NeZero q] [NeZero r] + (hqr : q.Coprime r) (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) + (hχ : χ ≠ 1) : (∑ x : ZMod (q * r), characterPairValue hqr χ ψ x) = 0 := by + have he := (ZMod.chineseRemainder hqr).toEquiv.sum_comp + (fun x : ZMod q × ZMod r => χ x.1 * conj (ψ x.2)) + change (∑ x, characterPairValue hqr χ ψ x) = _ at he + rw [he, Fintype.sum_prod_type] + simp only [← Finset.mul_sum, ← Finset.sum_mul, MulChar.sum_eq_zero_of_ne_one hχ, zero_mul] + +theorem characterPairValue_norm_le_one {q r : ℕ} (hqr : q.Coprime r) + (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (x : ZMod (q * r)) : + ‖characterPairValue hqr χ ψ x‖ ≤ 1 := by + rw [characterPairValue, norm_mul, Complex.norm_conj] + exact (mul_le_mul (χ.norm_le_one _) (ψ.norm_le_one _) (norm_nonneg _) (by norm_num)).trans_eq (one_mul 1) + +/-- A step coprime to the two short moduli permutes the complete period. +This remains exact after fixing any residue class of the frequency modulus. -/ +theorem character_progression_sum_bound {q r : ℕ} [NeZero q] [NeZero r] + (hqr : q.Coprime r) (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) + (hχ : χ ≠ 1) (a M N : ℕ) (hM : M.Coprime (q * r)) : + ‖∑ j ∈ Finset.range N, χ ((a + M * j : ℕ) : ZMod q) * + conj (ψ ((a + M * j : ℕ) : ZMod r))‖ ≤ q * r := by + let F := characterPairValue hqr χ ψ + let f : ℕ → ℂ := fun j => F ((a + M * j : ℕ) : ZMod (q * r)) + have hp : Function.Periodic f (q * r) := by + intro j + simp only [f, Nat.cast_add, Nat.cast_mul] + congr 1 + simp only [mul_add] + have hz : ((q * r : ℕ) : ZMod (q * r)) = 0 := ZMod.natCast_self _ + simp only [Nat.cast_mul] at hz + rw [hz, mul_zero, add_zero] + have hz : (∑ j ∈ Finset.range (q * r), f j) = 0 := by + have : NeZero (q * r) := ⟨mul_ne_zero (NeZero.ne q) (NeZero.ne r)⟩ + let e := (ZMod.unitOfCoprime M hM).mulLeft.trans (Equiv.addLeft (a : ZMod (q * r))) + have he := e.sum_comp F + have hev (z : ZMod (q * r)) : e z = (a : ZMod (q * r)) + (M : ZMod (q * r)) * z := by + simp [e, Equiv.trans_apply, ZMod.coe_unitOfCoprime] + simp_rw [hev] at he + simp only [f, Nat.cast_add, Nat.cast_mul] + have hs := sum_range_residues (M := q * r) + (fun z => F ((a : ZMod (q * r)) + (M : ZMod (q * r)) * z)) + exact (hs.trans he).trans (characterPairValue_sum_zero hqr χ ψ hχ) + have hb := complex_periodic_zero_sum_bound f (q * r) + (Nat.mul_pos (NeZero.pos q) (NeZero.pos r)) hp hz + (fun j => characterPairValue_norm_le_one hqr χ ψ _) N + simpa only [f, F, characterPairValue_nat, Nat.cast_mul] using hb + +theorem weighted_character_progression_bound {q r : ℕ} [NeZero q] [NeZero r] + (hqr : q.Coprime r) (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) + (hχ : χ ≠ 1) (a M N : ℕ) (hM : M.Coprime (q * r)) (w : ℕ → ℂ) : + ‖∑ j ∈ Finset.range N, w j * (χ ((a + M * j : ℕ) : ZMod q) * + conj (ψ ((a + M * j : ℕ) : ZMod r)))‖ ≤ discreteVariation w N * (q * r) := by + apply weighted_sum_le_variation + intro n _ + exact character_progression_sum_bound hqr χ ψ hχ a M n hM + +/-- Sum the exact progression bounds over all interval/residue pieces. +The total variation budget includes the reciprocal-integer weight. -/ +theorem character_interval_pieces_bound {I : Type*} [Fintype I] + {q r : ℕ} [NeZero q] [NeZero r] (hqr : q.Coprime r) + (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (hχ : χ ≠ 1) + (a M N : I → ℕ) (hM : ∀ i, (M i).Coprime (q * r)) + (w : I → ℕ → ℂ) (V : ℝ) (hvar : ∑ i, discreteVariation (w i) (N i) ≤ V) : + ‖∑ i, ∑ j ∈ Finset.range (N i), w i j * + (χ ((a i + M i * j : ℕ) : ZMod q) * conj (ψ ((a i + M i * j : ℕ) : ZMod r)))‖ ≤ + V * (q * r) := by + calc + _ ≤ ∑ i, ‖∑ j ∈ Finset.range (N i), w i j * + (χ ((a i + M i * j : ℕ) : ZMod q) * conj (ψ ((a i + M i * j : ℕ) : ZMod r)))‖ := + norm_sum_le _ _ + _ ≤ ∑ i, discreteVariation (w i) (N i) * (q * r) := + Finset.sum_le_sum (fun i _ => weighted_character_progression_bound hqr χ ψ hχ + (a i) (M i) (N i) (hM i) (w i)) + _ ≤ _ := by + rw [← Finset.sum_mul] + exact mul_le_mul_of_nonneg_right hvar (by positivity) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionConstantRestriction.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionConstantRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..abd3811e32e8bf0f76e03a2cf9df1772398285cd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionConstantRestriction.lean @@ -0,0 +1,40 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedProgressionInputs + +namespace OAI + +/-! # Decreasing the common exceptional-zero constant -/ + +namespace Ostmann + +/-- Completeness and Page uniqueness persist when the exceptional strip is +narrowed. The prime-progression estimate and its actual zero are unchanged. -/ +noncomputable def PublishedProgressionInput.restrictKappa (P : PublishedProgressionInput) + (κ : ℝ) (hκ : 0 < κ) (hκP : κ ≤ P.kappa) : PublishedProgressionInput where + kappa := κ + decay := P.decay + errorConstant := P.errorConstant + kappa_pos := hκ + decay_pos := P.decay_pos + errorConstant_nonneg := P.errorConstant_nonneg + localZero := P.localZero + divides := P.divides + complete := by + intro q hq e he hβ + apply P.complete q hq e he + have hq' : (1 : ℝ) ≤ q := by exact_mod_cast hq + have hl : 0 < Real.log (4 * (q : ℝ)) := Real.log_pos (by linarith) + have hh := div_le_div_of_nonneg_right hκP hl.le + linarith + unique := by + intro Q hQ e f he hf hβ hγ + apply P.unique Q hQ e f he hf + all_goals + have hQ' : (2 : ℝ) ≤ Q := by exact_mod_cast hQ + have hl : 0 < Real.log (4 * (Q : ℝ)) := Real.log_pos (by linarith) + have hh := div_le_div_of_nonneg_right hκP hl.le + linarith + theta := P.theta + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionErrorRates.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionErrorRates.lean new file mode 100644 index 0000000000000000000000000000000000000000..d2dbf47aeec8fdf23ebf003472908d4dc0cbbe1c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionErrorRates.lean @@ -0,0 +1,92 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.UniformPrimeProgressions +import OAI.NumberTheory.Ostmann.Arithmetic.ArithmeticErrorRates + +namespace OAI + +/-! # The two arithmetic progression precision scales + +The published square-root-log theta error is sufficient on both rows of +Section 8. The discarded Page zeros have the stronger exponent `a₀ - μ`. +-/ + +namespace Ostmann + +open Filter + +theorem constant_mul_double_exp_le (K c b d : ℝ) (hK : 0 ≤ K) + (hc : 0 < c) (hb : 0 < b) (hdb : d < b) : + ∀ᶠ L : ℝ in atTop, K * Real.exp (-c * Real.exp (b * L)) ≤ + Real.exp (-Real.exp (d * L)) := by + filter_upwards [arithmetic_error_absorption 0 b d K c 0 hb hb hdb hc, + eventually_ge_atTop (0 : ℝ)] with L hL hL0 + apply le_trans _ hL + apply mul_le_mul_of_nonneg_right _ (Real.exp_pos _).le + have hKe : K ≤ Real.exp K := by linarith [Real.add_one_le_exp K] + apply hKe.trans + apply Real.exp_le_exp.mpr + simp only [pow_zero, mul_one, zero_mul, Real.exp_zero] + nlinarith + +theorem sqrt_ge_log_scale {a L s : ℝ} (hs : Real.exp (a * L) ≤ s) : + Real.exp ((a / 2) * L) ≤ Real.sqrt s := by + have h := Real.sqrt_le_sqrt hs + rw [← Real.exp_half] at h + exact (congrArg Real.exp (by ring : (a / 2) * L = a * L / 2)).trans_le h + +theorem page_gap_ge_log_scale (κ a μ L H s : ℝ) (hκ : 0 ≤ κ) + (hH0 : 0 < H) (hH : H ≤ 2 * Real.exp (μ * L)) (hs : Real.exp (a * L) ≤ s) : + (κ / 2) * Real.exp ((a - μ) * L) ≤ κ * s / H := by + apply (le_div_iff₀ hH0).mpr + calc + _ ≤ ((κ / 2) * Real.exp ((a - μ) * L)) * (2 * Real.exp (μ * L)) := + mul_le_mul_of_nonneg_left hH (by positivity) + _ = κ * Real.exp (a * L) := by + have he : Real.exp ((a - μ) * L) * Real.exp (μ * L) = Real.exp (a * L) := by + rw [← Real.exp_add] + congr 1 + ring + calc + _ = κ * (Real.exp ((a - μ) * L) * Real.exp (μ * L)) := by ring + _ = _ := by rw [he] + _ ≤ κ * s := mul_le_mul_of_nonneg_left hs hκ + +/-- Uniform in the modulus, residue and endpoints. The factor two is an +absolute constant, and no upper endpoint scale is required. -/ +theorem PublishedProgressionInput.log_interval_rate (P : PublishedProgressionInput) + (a₀ μ δ : ℝ) (ha : 0 < a₀) (hδa : δ < a₀ / 2) (hδμ : δ < a₀ - μ) + (haμ : 0 < a₀ - μ) : + ∀ᶠ L : ℝ in atTop, ∀ (q Q a : ℕ), 2 ≤ Q → 1 ≤ q → q ≤ Q → a.Coprime q → + Real.log (4 * (Q : ℝ)) ≤ 2 * Real.exp (μ * L) → + ∀ s t : ℝ, 1 ≤ s → Real.exp (a₀ * L) ≤ s → s ≤ t → t ≤ s + 1 → + |reciprocalPrimeInterval q a (Real.exp s) (Real.exp t) - + ∫ y in Set.Ioc s t, primeLogDensity (Nat.totient q) + (pageCoefficient (pageAtModulus q (selectedPageZero P Q)) a) + (pageBeta (pageAtModulus q (selectedPageZero P Q))) y| ≤ + 2 * Real.exp (-Real.exp (δ * L)) := by + filter_upwards [constant_mul_double_exp_le (18 * P.errorConstant) P.decay (a₀ / 2) δ + (mul_nonneg (by norm_num) P.errorConstant_nonneg) P.decay_pos (by positivity) hδa, + constant_mul_double_exp_le 1 (P.kappa / 2) (a₀ - μ) δ (by norm_num) + (div_pos P.kappa_pos (by norm_num)) haμ hδμ] with L htheta hpage + intro q Q a hQ hq hqQ ha hH s t hs hscale hst hshort + have hlog : 0 < Real.log (4 * (Q : ℝ)) := by + apply Real.log_pos + have : (2 : ℝ) ≤ Q := by exact_mod_cast hQ + linarith + have ht' : 18 * P.errorConstant * Real.exp (-P.decay * Real.sqrt s) ≤ + Real.exp (-Real.exp (δ * L)) := by + apply le_trans _ htheta + apply mul_le_mul_of_nonneg_left _ (mul_nonneg (by norm_num) P.errorConstant_nonneg) + apply Real.exp_le_exp.mpr + nlinarith [sqrt_ge_log_scale hscale, P.decay_pos] + have hp' : Real.exp (-P.kappa * s / Real.log (4 * (Q : ℝ))) ≤ + Real.exp (-Real.exp (δ * L)) := by + apply le_trans _ (by simpa only [one_mul] using hpage) + apply Real.exp_le_exp.mpr + have hg := page_gap_ge_log_scale P.kappa a₀ μ L (Real.log (4 * (Q : ℝ))) s + P.kappa_pos.le hlog hH hscale + simpa only [neg_mul, neg_div] using neg_le_neg hg + exact (P.uniform_log_interval hQ hq hqQ ha hs hst hshort).trans (by linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionLiftCount.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionLiftCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..e711af00abc967dd73baea6d0b5febe9cf1a33fb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionLiftCount.lean @@ -0,0 +1,38 @@ +import Mathlib.Data.Int.CardIntervalMod +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +/-! # Uniform integer-lift counts in a residue class -/ + +namespace Ostmann + +/-- A residue class has at most interval length / modulus + 1 representatives. +This form is uniform in the residue and works across zero. -/ +theorem progression_Ico_card_le (lo hi q r : ℤ) (hlo : lo ≤ hi) (hq : 0 < q) : + (((Finset.Ico lo hi).filter fun n => n ≡ r [ZMOD q]).card : ℚ) ≤ + ((hi : ℚ) - lo) / q + 1 := by + let A : ℚ := ((lo : ℚ) - r) / q + let B : ℚ := ((hi : ℚ) - r) / q + have hcard := Int.Ico_filter_modEq_card lo hi hq r + have hcast : (((Finset.Ico lo hi).filter fun n => n ≡ r [ZMOD q]).card : ℚ) = + max (((⌈B⌉ : ℤ) : ℚ) - ((⌈A⌉ : ℤ) : ℚ)) 0 := by + dsimp [A, B] + exact_mod_cast hcard + have ha : A ≤ (⌈A⌉ : ℤ) := Int.le_ceil A + have hb : ((⌈B⌉ : ℤ) : ℚ) < B + 1 := Int.ceil_lt_add_one B + have hdiff : ((⌈B⌉ : ℤ) : ℚ) - ((⌈A⌉ : ℤ) : ℚ) ≤ + ((hi : ℚ) - lo) / q + 1 := by + calc + _ ≤ B - A + 1 := by linarith + _ = _ := by dsimp [A, B]; ring + have hq' : (0 : ℚ) < q := by exact_mod_cast hq + have hwidth : (0 : ℚ) ≤ (hi : ℚ) - lo := by exact_mod_cast sub_nonneg.mpr hlo + rw [hcast] + exact max_le hdiff (by positivity) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionPrincipalPNT.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionPrincipalPNT.lean new file mode 100644 index 0000000000000000000000000000000000000000..535aeefa7c8b092b72f4b5353e582b56b7b1d8d5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionPrincipalPNT.lean @@ -0,0 +1,83 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothPrincipalPNTBridge +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedProgressionInputs + +namespace OAI + +/-! # The conductor-one consequence of the progression input + +The principal smooth PNT is not an independent input: the conductor-one +theta estimate, elementary prime-power removal and partial summation suffice. +-/ + +namespace Ostmann + +open Filter +open scoped Classical BigOperators + +theorem primeProgressionTheta_one (x : ℝ) : + primeProgressionTheta 1 0 x = Chebyshev.theta x := by + rw [Chebyshev.theta_eq_sum_Icc] + simp [primeProgressionTheta, primeProgressionLog, Finset.sum_filter, Nat.ModEq, Nat.mod_one] + +theorem PublishedProgressionInput.principal_theta_bound (P : PublishedProgressionInput) + (x : ℝ) (hx : 2 ≤ x) : + |Chebyshev.theta x - x| ≤ + P.errorConstant * x * Real.exp (-P.decay * Real.sqrt (Real.log x)) := by + have h := P.theta 1 le_rfl 0 (by norm_num) x hx + simpa only [primeProgressionTheta_one, P.localZero_one, pageCoefficient, pageBeta, + Nat.totient_one, Nat.cast_one, thetaMainTerm, zero_mul, zero_div, sub_zero, div_one] + using h + +private theorem prime_power_error_log_scale (d : ℝ) (hd : 0 < d) : + ∀ᶠ y : ℝ in atTop, + 2 * Real.sqrt (Real.exp y) * y ≤ Real.exp y * Real.exp (-d * Real.sqrt y) := by + have hpoly := ((isLittleO_pow_exp_pos_mul_atTop 1 + (by norm_num : (0 : ℝ) < 1 / 4)).const_mul_left (2 : ℝ)).bound (by norm_num : (0 : ℝ) < 1) + filter_upwards [hpoly, eventually_ge_atTop ((4 * d) ^ 2), + eventually_ge_atTop (0 : ℝ)] with y hy hlarge hy0 + have hpoly' : 2 * y ≤ Real.exp (y / 4) := by + apply (le_abs_self (2 * y)).trans + simpa only [pow_one, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _), one_mul, + show (1 / 4 : ℝ) * y = y / 4 by ring] using hy + have hroot : 4 * d ≤ Real.sqrt y := by + have hs := Real.sqrt_le_sqrt hlarge + rwa [Real.sqrt_sq (by positivity)] at hs + have hcost : d * Real.sqrt y ≤ y / 4 := by + nlinarith [Real.sq_sqrt hy0] + calc + _ = Real.exp (y / 2) * (2 * y) := by rw [← Real.exp_half]; ring + _ ≤ Real.exp (y / 2) * Real.exp (y / 4) := + mul_le_mul_of_nonneg_left hpoly' (Real.exp_nonneg _) + _ = Real.exp (3 * y / 4) := by rw [← Real.exp_add]; congr 1; ring + _ ≤ Real.exp (y - d * Real.sqrt y) := Real.exp_le_exp.mpr (by linarith) + _ = _ := by rw [← Real.exp_add]; congr 1; ring + +theorem PublishedProgressionInput.principal_chebyshev_pnt (P : PublishedProgressionInput) : + ∃ c > 0, (Chebyshev.psi - id) =O[atTop] + (fun x : ℝ => x * Real.exp (-c * (Real.log x) ^ ((1 : ℝ) / 2))) := by + refine ⟨P.decay, P.decay_pos, ?_⟩ + apply Asymptotics.IsBigO.of_bound (P.errorConstant + 1) + have hsmall := Real.tendsto_log_atTop.eventually + (prime_power_error_log_scale P.decay P.decay_pos) + filter_upwards [hsmall, eventually_ge_atTop (2 : ℝ)] with x hsmall hx + have hx0 : 0 < x := by linarith + have hpow : |Chebyshev.psi x - Chebyshev.theta x| ≤ + x * Real.exp (-P.decay * Real.sqrt (Real.log x)) := by + refine (Chebyshev.abs_psi_sub_theta_le_sqrt_mul_log (by linarith)).trans ?_ + simpa only [Real.exp_log hx0] using hsmall + have htheta := P.principal_theta_bound x hx + have hh := abs_sub_le (Chebyshev.psi x) (Chebyshev.theta x) x + have hsum : |Chebyshev.psi x - x| ≤ + (P.errorConstant + 1) * (x * Real.exp (-P.decay * Real.sqrt (Real.log x))) := by + nlinarith + simpa only [Pi.sub_apply, id_eq, Real.norm_eq_abs, Real.sqrt_eq_rpow, + abs_of_pos (mul_pos hx0 (Real.exp_pos _))] using hsum + +theorem PublishedProgressionInput.smoothPrincipalPNT (P : PublishedProgressionInput) : + PublishedSmoothPrincipalPNT := + publishedSmoothPrincipalPNT_of_chebyshev P.principal_chebyshev_pnt + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionWithoutPage.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionWithoutPage.lean new file mode 100644 index 0000000000000000000000000000000000000000..dced6d7762a5761699997bb6c5dd342c8e3987cb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ProgressionWithoutPage.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualPageUniqueness + +namespace OAI + +/-! # Progression estimates and the Page theorem + +The fields specify exceptional zeros and the prime progression estimate from +Montgomery–Vaughan, Theorem 11.3 and Corollary 11.20. Page uniqueness is +Corollary 11.10. +-/ + +namespace Ostmann + +structure PublishedProgressionEstimate where + kappa : ℝ + decay : ℝ + errorConstant : ℝ + kappa_pos : 0 < kappa + decay_pos : 0 < decay + errorConstant_nonneg : 0 ≤ errorConstant + localZero : ℕ → Option PrimitiveRealZero + divides : ∀ q e, localZero q = some e → e.modulus ∣ q + complete : ∀ q, 1 ≤ q → ∀ e : PrimitiveRealZero, e.modulus ∣ q → + 1 - kappa / Real.log (4 * (q : ℝ)) ≤ e.beta → localZero q = some e + theta : ∀ q, 1 ≤ q → ∀ a, a.Coprime q → ∀ x : ℝ, 2 ≤ x → + |primeProgressionTheta q a x - + thetaMainTerm (Nat.totient q) (pageCoefficient (localZero q) a) + (pageBeta (localZero q)) x| ≤ + errorConstant * x * Real.exp (-decay * Real.sqrt (Real.log x)) + +noncomputable def PublishedProgressionEstimate.toPublished + (P : PublishedProgressionEstimate) : PublishedProgressionInput := by + let κ := Classical.choose exists_actual_page_uniqueness + have hκ := (Classical.choose_spec exists_actual_page_uniqueness).1 + have hpage := (Classical.choose_spec exists_actual_page_uniqueness).2 + exact { + kappa := min P.kappa κ + decay := P.decay + errorConstant := P.errorConstant + kappa_pos := lt_min P.kappa_pos hκ + decay_pos := P.decay_pos + errorConstant_nonneg := P.errorConstant_nonneg + localZero := P.localZero + divides := P.divides + complete := by + intro q hq e he hβ + apply P.complete q hq e he + have hq' : (1 : ℝ) ≤ q := by exact_mod_cast hq + have hl : 0 < Real.log (4 * (q : ℝ)) := Real.log_pos (by linarith) + have hh := div_le_div_of_nonneg_right (min_le_left P.kappa κ) hl.le + linarith + unique := by + intro Q hQ e f he hf hβ hγ + apply hpage Q hQ e f he hf + all_goals + have hQ' : (2 : ℝ) ≤ Q := by exact_mod_cast hQ + have hl : 0 < Real.log (4 * (Q : ℝ)) := Real.log_pos (by linarith) + have hh := div_le_div_of_nonneg_right (min_le_right P.kappa κ) hl.le + linarith + theta := P.theta } + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedComplexZeroDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedComplexZeroDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..231020d5b9f496bcb44f6d198ed777834c7e291d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedComplexZeroDensity.lean @@ -0,0 +1,76 @@ +import Mathlib.NumberTheory.DirichletCharacter.Orthogonality +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedProgressionInputs + +namespace OAI + +/-! # Published zero-density and zero-free inputs for the smooth prime mean + +H. L. Montgomery, *Zeros of L-functions*, Invent. Math. 8 (1969), 346–354, +Theorem 1, in the explicit form of S. Inoue, *Some explicit formulas for +partial sums of Möbius functions*, JTNB 33 (2021), 273–315, Lemma 1, p. 282: +https://jtnb.centre-mersenne.org/item/10.5802/jtnb.1162.pdf . + +The region below is the bounded-height consequence of K. Ford, B. Green, +S. Konyagin, J. Maynard and T. Tao, *Long gaps between primes*, JAMS 31 +(2018), 65–105, Lemma 7.1. Deleting the whole exceptional primitive character +and replacing `Q*(1+|t|)` by `2*Q*T` only weakens that statement. +https://doi.org/10.1090/jams/876 . + +These are explicit conditional parameters. The zero enumeration is shared +with the explicit-formula input; no smooth-prime-mean estimate is assumed. +-/ + +namespace Ostmann +open scoped Classical BigOperators + +structure PrimitiveComplexCharacter where + modulus : ℕ + positive : 0 < modulus + character : DirichletCharacter ℂ modulus + primitive : character.IsPrimitive + nontrivial : character ≠ 1 + +noncomputable def PrimitiveComplexCharacter.L (χ : PrimitiveComplexCharacter) : ℂ → ℂ := + @DirichletCharacter.LFunction χ.modulus ⟨χ.positive.ne'⟩ χ.character + +/-- A fixed enumeration with multiplicities used by the published density +and explicit-formula statements. Bounded ordinate ranges are finite. -/ +structure ComplexZeroEnumeration (χ : PrimitiveComplexCharacter) where + zeros : ℕ → ℂ + in_strip : ∀ i, 0 < (zeros i).re ∧ (zeros i).re < 1 + actual_zero : ∀ i, χ.L (zeros i) = 0 + finite_height : ∀ T : ℝ, {i | |(zeros i).im| ≤ T}.Finite + +noncomputable def ComplexZeroEnumeration.heightIndices {χ : PrimitiveComplexCharacter} + (Z : ComplexZeroEnumeration χ) (T : ℝ) : Finset ℕ := (Z.finite_height T).toFinset + +@[simp] theorem ComplexZeroEnumeration.mem_heightIndices {χ : PrimitiveComplexCharacter} + (Z : ComplexZeroEnumeration χ) (T : ℝ) (i : ℕ) : + i ∈ Z.heightIndices T ↔ |(Z.zeros i).im| ≤ T := Set.Finite.mem_toFinset _ + +noncomputable def ComplexZeroEnumeration.count {χ : PrimitiveComplexCharacter} + (Z : ComplexZeroEnumeration χ) (σ T : ℝ) : ℕ := + ((Z.heightIndices T).filter (fun i => σ ≤ (Z.zeros i).re)).card + +/-- The exact Montgomery–Inoue estimate, restricted to an arbitrary finite +subfamily of the primitive nonprincipal characters of conductor at most Q. -/ +def PublishedComplexZeroDensity (Z : ∀ χ, ComplexZeroEnumeration χ) : Prop := + ∃ C : ℝ, 0 < C ∧ ∀ (Q : ℕ), 1 ≤ Q → ∀ (T σ : ℝ), 2 ≤ T → + 1 / 2 ≤ σ → σ ≤ 1 → ∀ F : Finset PrimitiveComplexCharacter, + (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ((Z χ).count σ T : ℝ)) ≤ + C * ((Q : ℝ) ^ 2 * T) ^ (3 * (1 - σ) / (2 - σ)) * + (Real.log ((Q : ℝ) * T)) ^ 13 + +/-- Bounded-height Landau–Page, with the entire possible exceptional +character removed. The exception can be avoided by one prime deletion. -/ +def PublishedComplexZeroRegion (Z : ∀ χ, ComplexZeroEnumeration χ) : Prop := + ∃ c : ℝ, 0 < c ∧ ∀ (Q : ℕ), 101 ≤ Q → ∀ T : ℝ, 2 ≤ T → + ∃ exception : Option PrimitiveComplexCharacter, + ∀ χ : PrimitiveComplexCharacter, χ.modulus ≤ Q → some χ ≠ exception → + ∀ i : ℕ, |((Z χ).zeros i).im| ≤ T → + c / Real.log (2 * (Q : ℝ) * T) ≤ 1 - ((Z χ).zeros i).re + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedProgressionInputs.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedProgressionInputs.lean new file mode 100644 index 0000000000000000000000000000000000000000..daa0a134fce3a1eff1abda78f44fdda976c46b1f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedProgressionInputs.lean @@ -0,0 +1,112 @@ +import Mathlib.NumberTheory.DirichletCharacter.Bounds +import Mathlib.NumberTheory.LSeries.DirichletContinuation +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimeLogDensity + +namespace OAI + +/-! # Precisely stated published inputs for primes in progressions + +Reference: H. L. Montgomery and R. C. Vaughan, *Multiplicative Number +Theory I: Classical Theory*, Cambridge Studies in Advanced Mathematics 97, +Chapter 11, DOI 10.1017/CBO9780511618314.013. + +`PublishedProgressionInput.theta` is Corollary 11.20, equations (11.32) and +(11.34), p. 381. `complete` specifies the exceptional zero in Theorem 11.3, +p. 360. `unique` is the real-zero specialization of Corollary 11.10 (Page), +p. 369. The positive zero-free constant can be decreased so these use one +constant and the harmless denominator `log (4*q)` throughout. + +These are explicit conditional inputs. In particular, no logarithmic +interval estimate or arithmetic comparison is assumed here. +-/ + +namespace Ostmann + +/-- An actual primitive real character and an actual zero of its continued +Dirichlet L-function, rather than an unrestricted correction coefficient. -/ +structure PrimitiveRealZero where + modulus : ℕ + positive : 0 < modulus + character : DirichletCharacter ℝ modulus + primitive : character.IsPrimitive + nontrivial : character ≠ 1 + beta : ℝ + beta_pos : 0 < beta + beta_lt_one : beta < 1 + zero : @DirichletCharacter.LFunction modulus ⟨Nat.ne_of_gt positive⟩ + (character.ringHomComp Complex.ofRealHom) (beta : ℂ) = 0 + +noncomputable def pageCoefficient (z : Option PrimitiveRealZero) (a : ℕ) : ℝ := + match z with + | none => 0 + | some e => e.character (a : ZMod e.modulus) + +noncomputable def pageBeta (z : Option PrimitiveRealZero) : ℝ := + match z with + | none => 1 + | some e => e.beta + +theorem pageCoefficient_abs_le_one (z : Option PrimitiveRealZero) (a : ℕ) : + |pageCoefficient z a| ≤ 1 := by + cases z with + | none => simp [pageCoefficient] + | some e => exact (Real.norm_eq_abs _).symm ▸ e.character.norm_le_one _ + +theorem pageBeta_pos (z : Option PrimitiveRealZero) : 0 < pageBeta z := by + cases z with + | none => norm_num [pageBeta] + | some e => exact e.beta_pos + +theorem pageBeta_le_one (z : Option PrimitiveRealZero) : pageBeta z ≤ 1 := by + cases z with + | none => exact le_rfl + | some e => exact e.beta_lt_one.le + +/-- The restricted classical analytic input. The family chooses the local +exceptional primitive character, if one exists, for each modulus. -/ +structure PublishedProgressionInput where + kappa : ℝ + decay : ℝ + errorConstant : ℝ + kappa_pos : 0 < kappa + decay_pos : 0 < decay + errorConstant_nonneg : 0 ≤ errorConstant + localZero : ℕ → Option PrimitiveRealZero + divides : ∀ q e, localZero q = some e → e.modulus ∣ q + /-- Theorem 11.3: any zero in the stated exceptional region is retained. -/ + complete : ∀ q, 1 ≤ q → ∀ e : PrimitiveRealZero, e.modulus ∣ q → + 1 - kappa / Real.log (4 * (q : ℝ)) ≤ e.beta → localZero q = some e + /-- Corollary 11.10, restricted to positive real zeros. -/ + unique : ∀ Q, 2 ≤ Q → ∀ e f : PrimitiveRealZero, + e.modulus ≤ Q → f.modulus ≤ Q → + 1 - kappa / Real.log (4 * (Q : ℝ)) ≤ e.beta → + 1 - kappa / Real.log (4 * (Q : ℝ)) ≤ f.beta → e = f + /-- Corollary 11.20, with absolute constants uniform in the modulus. -/ + theta : ∀ q, 1 ≤ q → ∀ a, a.Coprime q → ∀ x : ℝ, 2 ≤ x → + |primeProgressionTheta q a x - + thetaMainTerm (Nat.totient q) (pageCoefficient (localZero q) a) + (pageBeta (localZero q)) x| ≤ + errorConstant * x * Real.exp (-decay * Real.sqrt (Real.log x)) + +/-- The logarithmic prime estimate is derived by partial summation; it is +not included among the published assumptions. -/ +theorem PublishedProgressionInput.local_log_interval (P : PublishedProgressionInput) + (q a : ℕ) (hq : 1 ≤ q) (ha : a.Coprime q) {s t : ℝ} + (hs : 1 ≤ s) (hst : s ≤ t) (hshort : t ≤ s + 1) : + |reciprocalPrimeInterval q a (Real.exp s) (Real.exp t) - + ∫ y in Set.Ioc s t, primeLogDensity (Nat.totient q) + (pageCoefficient (P.localZero q) a) (pageBeta (P.localZero q)) y| ≤ + 18 * P.errorConstant * Real.exp (-P.decay * Real.sqrt s) := by + apply prime_log_interval_error q a _ _ _ _ _ (ne_of_gt (pageBeta_pos _)) + P.decay_pos.le P.errorConstant_nonneg hs hst hshort + intro x hx + apply P.theta q hq a ha x + have hs0 : 0 < s := lt_of_lt_of_le zero_lt_one hs + have htwo : (2 : ℝ) ≤ Real.exp s := by + have h := Real.add_one_le_exp s + linarith + exact htwo.trans hx.1 + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedRealZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedRealZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..23134f5a471f587582b79a9672bdc88a944e7e5a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedRealZeros.lean @@ -0,0 +1,92 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedProgressionInputs +import OAI.NumberTheory.Ostmann.ZeroDensity.RealZeroSum +import OAI.NumberTheory.Ostmann.ZeroDensity.RealPrimeSeries + +namespace OAI + +/-! # Published inputs for the real-character zero argument + +The Hadamard input is the real-axis specialization of H. A. Helfgott, +*The ternary Goldbach problem*, Part I, 15 December 2019, section 3.7.4, +equations (3.97)--(3.102), printed pp. 86--87: +https://webusers.imj-prg.fr/~harald.helfgott/anglais/PartI.pdf . +The bounded gamma term on 1 < s <= 2 is included in the absolute constant. + +The low-height region and single simple exception are H. L. Montgomery and +R. C. Vaughan, *Multiplicative Number Theory I*, Theorem 11.3 and Corollary +11.10, pp. 360 and 369, using the same decreased constant as +`PublishedProgressionInput`. The separate Siegel specialization is Corollary +11.15 of that book. All these are explicit conditional parameters. +-/ + +namespace Ostmann + +open scoped BigOperators + +structure PrimitiveRealCharacter where + modulus : ℕ + positive : 0 < modulus + character : DirichletCharacter ℝ modulus + primitive : character.IsPrimitive + nontrivial : character ≠ 1 + +noncomputable def PrimitiveRealCharacter.complexCharacter (χ : PrimitiveRealCharacter) : + DirichletCharacter ℂ χ.modulus := χ.character.ringHomComp Complex.ofRealHom + +noncomputable def PrimitiveRealCharacter.L (χ : PrimitiveRealCharacter) : ℂ → ℂ := + @DirichletCharacter.LFunction χ.modulus ⟨χ.positive.ne'⟩ χ.complexCharacter + +noncomputable def PrimitiveRealCharacter.logDerivative (χ : PrimitiveRealCharacter) (s : ℝ) : ℝ := + (deriv χ.L (s : ℂ) / χ.L (s : ℂ)).re + +/-- A genuine zero sequence, indexed with multiplicities. The Hadamard +identity specifies its sum; no downstream prime-mass bound is included. -/ +structure RealCharacterZeroExpansion (χ : PrimitiveRealCharacter) (C : ℝ) where + zeros : ℕ → ℂ + in_strip : ∀ i, 0 < (zeros i).re ∧ (zeros i).re < 1 + actual_zero : ∀ i, χ.L (zeros i) = 0 + summable : ∀ s : ℝ, 1 < s → s ≤ 2 → + Summable (fun i => realZeroKernel (s - (zeros i).re) (zeros i).im) + hadamard : ∀ s : ℝ, 1 < s → s ≤ 2 → + |(∑' i, realZeroKernel (s - (zeros i).re) (zeros i).im) - + χ.logDerivative s - (1 / 2) * Real.log χ.modulus| ≤ C + +/-- Hadamard factorization and the full low-height zero-free region. Page +uniqueness for the resulting actual real zeros is already in P. -/ +structure PublishedRealZeroInput (P : PublishedProgressionInput) where + errorConstant : ℝ + errorConstant_nonneg : 0 ≤ errorConstant + expansion : ∀ χ : PrimitiveRealCharacter, RealCharacterZeroExpansion χ errorConstant + region : ∀ (χ : PrimitiveRealCharacter) (Q : ℕ), 2 ≤ Q → χ.modulus ≤ Q → + ∃ E : Finset ℕ, E.card ≤ 1 ∧ + (∀ i ∈ E, ((expansion χ).zeros i).im = 0 ∧ + 1 - P.kappa / Real.log (4 * (Q : ℝ)) ≤ ((expansion χ).zeros i).re) ∧ + (∀ i ∉ E, ((expansion χ).zeros i).im ^ 2 < 1 → + ((expansion χ).zeros i).re ≤ 1 - P.kappa / Real.log (4 * (Q : ℝ))) + +/-- The one-sided real-zero consequence of Siegel's theorem, for every fixed +positive exponent. Its constant is allowed to be ineffective. -/ +def PublishedSiegelBound : Prop := + ∀ ε : ℝ, 0 < ε → ∃ C : ℝ, 0 < C ∧ ∀ e : PrimitiveRealZero, + (1 - e.beta)⁻¹ ≤ C * (e.modulus : ℝ) ^ ε + +noncomputable def RealCharacterZeroExpansion.realZero {χ : PrimitiveRealCharacter} {C : ℝ} + (Z : RealCharacterZeroExpansion χ C) (i : ℕ) (hi : (Z.zeros i).im = 0) : PrimitiveRealZero where + modulus := χ.modulus + positive := χ.positive + character := χ.character + primitive := χ.primitive + nontrivial := χ.nontrivial + beta := (Z.zeros i).re + beta_pos := (Z.in_strip i).1 + beta_lt_one := (Z.in_strip i).2 + zero := by + have he : ((Z.zeros i).re : ℂ) = Z.zeros i := by + apply Complex.ext <;> simp [hi] + change χ.L _ = 0 + rw [he] + exact Z.actual_zero i + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedSmoothExplicitFormula.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedSmoothExplicitFormula.lean new file mode 100644 index 0000000000000000000000000000000000000000..30fed0a535730e728456be2ab0773864c7d2f717 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/PublishedSmoothExplicitFormula.lean @@ -0,0 +1,53 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedComplexZeroDensity +import OAI.NumberTheory.Ostmann.Construction.SmoothPrimeMeanTest + +namespace OAI + +/-! # The published smooth explicit formula, for one fixed test function + +H. L. Montgomery and R. C. Vaughan, *Multiplicative Number Theory I* (2007), +Chapter 10: the functional equation, ordinary zero count and explicit formula. +See also H. A. Helfgott, *The ternary Goldbach problem*, Part I (15 December +2019), §§3.7.1 and 3.7.3. We use only the fixed `primeMeanTest`, supported +in [5/8,7/8]. Its Mellin transform has eighth-order decay in the fixed strip. + +The formula shifts to Re(s)=-1/2, retaining the even-character residue at +zero. Its error has no dependence on an exceptional zero's distance from 1. +The count is the ordinary individual zero count summed over a finite +primitive family; there are at most Q² Dirichlet characters of conductor ≤Q. +This input contains no prime-average or favorable-prime conclusion. +-/ + +namespace Ostmann +open scoped Classical BigOperators + +noncomputable def smoothZeroTerm (Z : ∀ χ, ComplexZeroEnumeration χ) + (χ : PrimitiveComplexCharacter) (X : ℝ) (i : ℕ) : ℂ := + Complex.exp (((Z χ).zeros i) * (Real.log X : ℂ)) * primeMeanMellin ((Z χ).zeros i) + +noncomputable def smoothTrivialZeroTerm (χ : PrimitiveComplexCharacter) : ℂ := + if χ.character (-1) = 1 then primeMeanMellin 0 else 0 + +structure PublishedSmoothExplicitFormula (Z : ∀ χ, ComplexZeroEnumeration χ) where + errorConstant : ℝ + errorConstant_pos : 0 < errorConstant + mellinConstant : ℝ + mellinConstant_pos : 0 < mellinConstant + zeroCountConstant : ℝ + zeroCountConstant_pos : 0 < zeroCountConstant + mellin_decay : ∀ s : ℂ, -(1 / 2 : ℝ) ≤ s.re → s.re ≤ 2 → + ‖primeMeanMellin s‖ ≤ mellinConstant * Real.exp (-8 * Real.log (1 + |s.im|)) + zero_count : ∀ Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 0 ≤ T → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ((Z χ).count 0 T : ℝ)) ≤ + zeroCountConstant * (Q : ℝ) ^ 2 * (T + 1) * Real.log ((Q : ℝ) * (T + 2)) + absolute_summability : ∀ χ : PrimitiveComplexCharacter, ∀ X : ℝ, 2 ≤ X → + Summable (fun i => ‖smoothZeroTerm Z χ X i‖) + explicit_formula : ∀ χ : PrimitiveComplexCharacter, ∀ X : ℝ, 2 ≤ X → + ‖smoothMangoldtMean χ.modulus χ.character X + + (∑' i, smoothZeroTerm Z χ X i) + smoothTrivialZeroTerm χ‖ ≤ + errorConstant / Real.sqrt X * Real.log (2 * (χ.modulus : ℝ)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RationalNodeDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RationalNodeDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..72f43c13e4d816056781a063b3f35fcaffbdb06e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RationalNodeDensity.lean @@ -0,0 +1,97 @@ +import OAI.NumberTheory.Ostmann.Characters.TreeCoordinates +import OAI.NumberTheory.Ostmann.ZeroDensity.PairDensity + +namespace OAI + +/-! +# The density bound for an actual reconstructed node + +The fixed parent product makes its argument independent of the split. +The reconstructed entry vanishes exactly when the child ratio is one. +Thus the inverse-square density estimate applies to the actual formulas, +with the manuscript's invalid-node convention. +-/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable def rationalNodeArgument {p : ℕ} [Fact p.Prime] + (s D XL XR CL CR P : (ZMod p)ˣ) : (ZMod p)ˣ := + s / (D * XL * CL * XR * CR * P) + +noncomputable def rationalNodeRatioConstant {p : ℕ} [Fact p.Prime] + (sL sR XL XR CL CR P : (ZMod p)ˣ) : (ZMod p)ˣ := + (sL / sR) * (XR * CR * P / (XL * CL)) + +noncomputable def rationalNodeValue {p : ℕ} [Fact p.Prime] + (s sL sR D u XL XR CL CR P : (ZMod p)ˣ) + (f g : ZMod p → ℝ) (m : (ZMod p)ˣ) : ℝ := + let HL : (ZMod p)ˣ := XL * CL * m + let HR : (ZMod p)ˣ := XR * CR * (P / m) + let v := reconstructedEntry (s : ZMod p) sL sR u HL HR + if v = 0 then 0 else + f (childArgument sL D u HL v) * g (childArgument sR D u HR v) + +theorem rationalNodeValue_eq_ratio {p : ℕ} [Fact p.Prime] + (s sL sR D u XL XR CL CR P : (ZMod p)ˣ) + (f g : ZMod p → ℝ) (m : (ZMod p)ˣ) : + rationalNodeValue s sL sR D u XL XR CL CR P f g m = + let d := rationalNodeArgument s D XL XR CL CR P + let t := rationalNodeRatioConstant sL sR XL XR CL CR P * (m⁻¹) ^ 2 + if t = 1 then 0 else + f ((d : ZMod p) * (t : ZMod p) / ((t : ZMod p) - 1)) * + g ((d : ZMod p) / ((t : ZMod p) - 1)) := by + classical + let HL : (ZMod p)ˣ := XL * CL * m + let HR : (ZMod p)ˣ := XR * CR * (P / m) + let v := reconstructedEntry (s : ZMod p) sL sR u HL HR + let d := rationalNodeArgument s D XL XR CL CR P + let t := rationalNodeRatioConstant sL sR XL XR CL CR P * (m⁻¹) ^ 2 + have ht : (sL : ZMod p) / sR * ((HR : ZMod p) / HL) = (t : ZMod p) := by + have h : (sL / sR) * (HR / HL) = t := + tree_product_ratio sL sR XL XR CL CR P m + exact_mod_cast h + have hd : parentArgument (s : ZMod p) D HL HR = (d : ZMod p) := by + dsimp [HL, HR, d, rationalNodeArgument] + simp only [Units.val_mul, Units.val_div_eq_div_val] + exact tree_parent_fixed_product (s : ZMod p) D XL XR CL CR P m (Units.ne_zero m) + have hv : v = 0 ↔ t = 1 := by + have h := reconstructedEntry_zero_iff_ratio_one (s : ZMod p) sL sR u HL HR + (Units.ne_zero s) (Units.ne_zero sR) (Units.ne_zero u) (Units.ne_zero HL) + rw [ht] at h + constructor + · intro hz + exact Units.ext (h.mp hz) + · intro h1 + apply h.mpr + simp only [h1, Units.val_one] + change (if v = 0 then 0 else + f (childArgument sL D u HL v) * g (childArgument sR D u HR v)) = + if t = 1 then 0 else + f ((d : ZMod p) * (t : ZMod p) / ((t : ZMod p) - 1)) * + g ((d : ZMod p) / ((t : ZMod p) - 1)) + by_cases hv0 : v = 0 + · simp only [hv0, hv.mp hv0, ite_true] + · have ht1 : t ≠ 1 := fun h => hv0 (hv.mpr h) + simp only [hv0, ht1, ite_false] + have hpair := tree_children_eq_pair_coordinates (s : ZMod p) sL sR D u HL HR v + (Units.ne_zero s) (Units.ne_zero sR) (Units.ne_zero D) (Units.ne_zero u) + (Units.ne_zero HL) (Units.ne_zero HR) hv0 + (reconstructedEntry_relation (s : ZMod p) sL sR u HL HR (Units.ne_zero s) (Units.ne_zero u)) + rw [ht, hd] at hpair + exact congrArg (fun xz : ZMod p × ZMod p => f xz.1 * g xz.2) hpair + +/-- Conditional counting density of one actual rational tree split. -/ +theorem rationalNodeValue_sum_le {p : ℕ} [Fact p.Prime] + (s sL sR D u XL XR CL CR P : (ZMod p)ˣ) + (f g : ZMod p → ℝ) (hf : f 0 = 0) (hg : g 0 = 0) + (hfn : ∀ x, 0 ≤ f x) (hgn : ∀ x, 0 ≤ g x) : + (∑ m : (ZMod p)ˣ, rationalNodeValue s sL sR D u XL XR CL CR P f g m) ≤ + 2 * ∑ x : ZMod p, f x * g (x - rationalNodeArgument s D XL XR CL CR P) := by + simp_rw [rationalNodeValue_eq_ratio] + exact pair_inverse_square_density _ _ f g hf hg hfn hgn + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterComplexification.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterComplexification.lean new file mode 100644 index 0000000000000000000000000000000000000000..423358c615dd1a271cbac7298e04af1bdbb232a4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterComplexification.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedRealZeros +import OAI.NumberTheory.Ostmann.Characters.CharacterFaithfulEnumeration + +namespace OAI + +/-! # Real characters inside the actual complex-character zero development -/ + +namespace Ostmann + +open scoped Classical + +theorem PrimitiveRealCharacter.complex_factorsThrough_iff + (χ : PrimitiveRealCharacter) (d : ℕ) : + χ.complexCharacter.FactorsThrough d ↔ χ.character.FactorsThrough d := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + by_cases hd : d ∣ χ.modulus + · rw [DirichletCharacter.factorsThrough_iff_ker_unitsMap hd, + DirichletCharacter.factorsThrough_iff_ker_unitsMap hd] + constructor <;> intro h x hx + · have hh := h hx + rw [MonoidHom.mem_ker, Units.ext_iff, MulChar.coe_toUnitHom, Units.val_one] at hh ⊢ + simpa [PrimitiveRealCharacter.complexCharacter] using hh + · have hh := h hx + rw [MonoidHom.mem_ker, Units.ext_iff, MulChar.coe_toUnitHom, Units.val_one] at hh ⊢ + simp [PrimitiveRealCharacter.complexCharacter, hh] + · constructor <;> intro h <;> exact (hd h.dvd).elim + +theorem PrimitiveRealCharacter.complex_conductor (χ : PrimitiveRealCharacter) : + χ.complexCharacter.conductor = χ.character.conductor := by + unfold DirichletCharacter.conductor + congr 1 + ext d + exact χ.complex_factorsThrough_iff d + +/-- The coercion to complex values preserves the actual conductor and character. -/ +noncomputable def PrimitiveRealCharacter.asComplex (χ : PrimitiveRealCharacter) : + PrimitiveComplexCharacter where + modulus := χ.modulus + positive := χ.positive + character := χ.complexCharacter + primitive := by + rw [DirichletCharacter.isPrimitive_def, χ.complex_conductor] + exact χ.primitive + nontrivial := (MulChar.ringHomComp_ne_one_iff Complex.ofReal_injective).mpr χ.nontrivial + +@[simp] theorem PrimitiveRealCharacter.asComplex_L (χ : PrimitiveRealCharacter) : + χ.asComplex.L = χ.L := rfl + +noncomputable def realCharacterActualZeros (χ : PrimitiveRealCharacter) : + ComplexZeroEnumeration χ.asComplex := actualCharacterZeros χ.asComplex + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterConjugateZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterConjugateZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..7cb6c6d833b855bdf116452b0201c9bc9dc1dc25 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterConjugateZeros.lean @@ -0,0 +1,76 @@ +import Mathlib.Analysis.Calculus.Deriv.Star +import Mathlib.Analysis.Analytic.Uniqueness +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterComplexification + +namespace OAI + +/-! # Conjugate partners in the actual real-character zero family -/ + +namespace Ostmann + +open Complex Filter Set +open scoped Topology ComplexConjugate + +theorem PrimitiveRealCharacter.L_conj_right (χ : PrimitiveRealCharacter) + (s : ℂ) (hs : 1 < s.re) : χ.L (conj s) = conj (χ.L s) := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + change DirichletCharacter.LFunction χ.complexCharacter (conj s) = + conj (DirichletCharacter.LFunction χ.complexCharacter s) + rw [χ.complexCharacter.LFunction_eq_LSeries (by simpa using hs), + χ.complexCharacter.LFunction_eq_LSeries hs] + change (∑' n, LSeries.term _ (conj s) n) = conj (∑' n, LSeries.term _ s n) + rw [Complex.conj_tsum] + apply tsum_congr + intro n + by_cases hn : n = 0 + · subst n; simp + · rw [LSeries.term_of_ne_zero hn, LSeries.term_of_ne_zero hn] + have ha : (n : ℂ).arg ≠ Real.pi := by + rw [show (n : ℂ) = ((n : ℝ) : ℂ) from rfl, + Complex.arg_ofReal_of_nonneg (Nat.cast_nonneg n)] + exact Real.pi_pos.ne + rw [Complex.cpow_conj _ _ ha] + simp [PrimitiveRealCharacter.complexCharacter] + +theorem PrimitiveRealCharacter.L_conj (χ : PrimitiveRealCharacter) (s : ℂ) : + χ.L (conj s) = conj (χ.L s) := by + let g : ℂ → ℂ := conj ∘ χ.L ∘ conj + have hd : Differentiable ℂ g := by + intro z + have hh := (χ.asComplex.L_analytic (conj z)).differentiableAt + rw [PrimitiveRealCharacter.asComplex_L] at hh + simpa only [g, Complex.conj_conj] using hh.conj_conj + have hg : AnalyticOnNhd ℂ g univ := hd.differentiableOn.analyticOnNhd isOpen_univ + have hf : AnalyticOnNhd ℂ χ.L univ := fun z _ => χ.asComplex.L_analytic z + have he : g =ᶠ[𝓝 (2 : ℂ)] χ.L := by + filter_upwards [(isOpen_lt continuous_const Complex.continuous_re).mem_nhds + (show (1 : ℝ) < (2 : ℂ).re by norm_num)] with z hz + simp only [g, Function.comp_apply, χ.L_conj_right z hz, Complex.conj_conj] + have heq : g = χ.L := hg.eq_of_eventuallyEq hf he + have hh := congrFun heq s + change conj (χ.L (conj s)) = χ.L s at hh + simpa using congrArg conj hh + +theorem actualCharacterZeros_complete (χ : PrimitiveComplexCharacter) (z : ℂ) + (hz : z ∈ complexCharacterZeros χ) : ∃ i, (actualCharacterZeros χ).zeros i = z := by + have hp : 0 < analyticOrderNatAt χ.L z := by + have h := (characterZeroOrder_pos_iff χ z).mpr hz.2.2 + rwa [characterZeroOrder_eq_nat, Int.natCast_pos] at h + let c : CharacterZeroCopy χ := ⟨(z, 0), hz, hp⟩ + refine ⟨(faithfulCharacterZeroEquiv χ).symm c, ?_⟩ + change ((faithfulCharacterZeroEquiv χ) ((faithfulCharacterZeroEquiv χ).symm c)).val.1 = z + simp [c] + +theorem realCharacterActualZeros_conjugate (χ : PrimitiveRealCharacter) (i : ℕ) : + ∃ j, (realCharacterActualZeros χ).zeros j = conj ((realCharacterActualZeros χ).zeros i) := by + apply actualCharacterZeros_complete χ.asComplex + have hi := (realCharacterActualZeros χ).in_strip i + refine ⟨by simpa using hi.1, by simpa using hi.2, ?_⟩ + change χ.L (conj ((realCharacterActualZeros χ).zeros i)) = 0 + have hz := (realCharacterActualZeros χ).actual_zero i + change χ.L _ = 0 at hz + rw [χ.L_conj, hz, map_zero] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterPairEuler.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterPairEuler.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d3356d008d85c45b5cb7cbfc272792e4cc0be1c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterPairEuler.lean @@ -0,0 +1,78 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ComplexCharacterTrigonometric +import OAI.NumberTheory.Ostmann.Characters.PrimitiveCharacterLifts + +namespace OAI + +/-! # The positive Euler combination for two real characters -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +theorem self_inverse_character_im_zero {N : ℕ} [NeZero N] + (a : DirichletCharacter ℂ N) (ha : a⁻¹ = a) (n : ℕ) : (a n).im = 0 := by + have hh : star a = a := (MulChar.star_eq_inv a).trans ha + have hv := congrArg (fun χ : DirichletCharacter ℂ N => (χ n).im) hh + simp at hv + linarith + +theorem real_character_pair_term_nonneg {N : ℕ} (a b : DirichletCharacter ℂ N) + (ha : ∀ n : ℕ, (a n).im = 0) (hb : ∀ n : ℕ, (b n).im = 0) (σ : ℝ) (n : ℕ) : + 0 ≤ (LSeries.term (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ) n).re + + (LSeries.term (fun n => a n * (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ) n).re + + (LSeries.term (fun n => b n * (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ) n).re + + (LSeries.term (fun n => (a * b) n * (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ) n).re := by + by_cases hn : n = 0 + · subst n; simp + have h1 : 0 ≤ 1 + (a n).re := by linarith [(Complex.abs_re_le_norm (a n)).trans (a.norm_le_one n), neg_abs_le (a n).re] + have h2 : 0 ≤ 1 + (b n).re := by linarith [(Complex.abs_re_le_norm (b n)).trans (b.norm_le_one n), neg_abs_le (b n).re] + have hw : 0 ≤ ArithmeticFunction.vonMangoldt n * (n : ℝ) ^ (-σ) := + mul_nonneg ArithmeticFunction.vonMangoldt_nonneg (Real.rpow_nonneg (Nat.cast_nonneg n) _) + have he (f : ℕ → ℂ) : LSeries.term f (σ : ℂ) n = f n * ((n : ℝ) ^ (-σ) : ℝ) := by + simpa using LSeries_term_vertical f n hn σ 0 + rw [he, he, he, he] + simp only [MulChar.mul_apply, Complex.mul_re, Complex.mul_im, Complex.ofReal_re, + Complex.ofReal_im, ha, hb, mul_zero, zero_mul, sub_zero, add_zero] + convert mul_nonneg hw (mul_nonneg h1 h2) using 1 + ring + +theorem real_character_pair_sum_nonneg {N : ℕ} (a b : DirichletCharacter ℂ N) + (ha : ∀ n : ℕ, (a n).im = 0) (hb : ∀ n : ℕ, (b n).im = 0) (σ : ℝ) (hσ : 1 < σ) : + 0 ≤ (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ)).re + + (LSeries (fun n => a n * (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ)).re + + (LSeries (fun n => b n * (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ)).re + + (LSeries (fun n => (a * b) n * (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ)).re := by + have h0 := ArithmeticFunction.LSeriesSummable_vonMangoldt (s := (σ : ℂ)) hσ + have h1 := a.LSeriesSummable_twist_vonMangoldt (s := (σ : ℂ)) hσ + have h2 := b.LSeriesSummable_twist_vonMangoldt (s := (σ : ℂ)) hσ + have h3 := (a * b).LSeriesSummable_twist_vonMangoldt (s := (σ : ℂ)) hσ + change LSeriesSummable (fun n => a n * (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ) at h1 + change LSeriesSummable (fun n => b n * (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ) at h2 + change LSeriesSummable (fun n => (a * b) n * (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ) at h3 + have hh := tsum_nonneg (L := SummationFilter.unconditional ℕ) (real_character_pair_term_nonneg a b ha hb σ) + have h0r := (Complex.hasSum_re h0.hasSum).summable + have h1r := (Complex.hasSum_re h1.hasSum).summable + have h2r := (Complex.hasSum_re h2.hasSum).summable + have h3r := (Complex.hasSum_re h3.hasSum).summable + rw [Summable.tsum_add ((h0r.add h1r).add h2r) h3r, + Summable.tsum_add (h0r.add h1r) h2r, Summable.tsum_add h0r h1r, + ← Complex.re_tsum h0, ← Complex.re_tsum h1, ← Complex.re_tsum h2, + ← Complex.re_tsum h3] at hh + exact hh + +theorem real_character_pair_logDeriv_le {N : ℕ} [NeZero N] (a b : DirichletCharacter ℂ N) + (ha : a⁻¹ = a) (hb : b⁻¹ = b) (σ : ℝ) (hσ : 1 < σ) : + (logDeriv (DirichletCharacter.LFunction a) (σ : ℂ)).re + + (logDeriv (DirichletCharacter.LFunction b) (σ : ℂ)).re ≤ + (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ)).re - + (logDeriv (DirichletCharacter.LFunction (a * b)) (σ : ℂ)).re := by + have hh := real_character_pair_sum_nonneg a b (self_inverse_character_im_zero a ha) + (self_inverse_character_im_zero b hb) σ hσ + rw [dirichlet_mangoldt_LSeries_eq a _ hσ, dirichlet_mangoldt_LSeries_eq b _ hσ, + dirichlet_mangoldt_LSeries_eq (a * b) _ hσ, Complex.neg_re, Complex.neg_re, Complex.neg_re] at hh + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterPairZeroBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterPairZeroBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..662d52cf49d6c302763d9d3d1c9637dc83a5a1b8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterPairZeroBound.lean @@ -0,0 +1,53 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterPairEuler +import OAI.NumberTheory.Ostmann.ZeroDensity.NonprincipalLogDerivative + +namespace OAI + +/-! # One zeta pole controls the two distinct real-character zero sums -/ + +namespace Ostmann + +open Complex + +theorem exists_distinct_real_zero_sum_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (χ ψ : PrimitiveRealCharacter), χ ≠ ψ → ∀ σ : ℝ, 1 < σ → σ ≤ 2 → + shiftedRealCharacterZeroSum χ (σ : ℂ) + shiftedRealCharacterZeroSum ψ (σ : ℂ) ≤ + 1 / (σ - 1) + 4 * (Real.log χ.modulus + Real.log ψ.modulus) + C := by + obtain ⟨B, hB, hb⟩ := exists_nonprincipal_logDeriv_real_lower + obtain ⟨G, hG, hg⟩ := exists_low_height_zero_sum_error + obtain ⟨R, hR, hr⟩ := exists_vonMangoldt_series_bound + refine ⟨R + B * Real.log 2 + 2 * G, by positivity, ?_⟩ + intro χ ψ hne σ hσ hσ2 + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + let : NeZero ψ.modulus := ⟨ψ.positive.ne'⟩ + let N := χ.modulus * ψ.modulus + let : NeZero N := ⟨Nat.mul_ne_zero χ.positive.ne' ψ.positive.ne'⟩ + have hχN : χ.modulus ∣ N := Nat.dvd_mul_right _ _ + have hψN : ψ.modulus ∣ N := Nat.dvd_mul_left _ _ + let a := DirichletCharacter.changeLevel hχN χ.complexCharacter + let b := DirichletCharacter.changeLevel hψN ψ.complexCharacter + have hab : a * b ≠ 1 := distinct_real_lifts_product_nonprincipal χ ψ hne hχN hψN + have hp := real_character_pair_logDeriv_le a b (χ.lift_inverse_eq hχN) + (ψ.lift_inverse_eq hψN) σ hσ + have hprod := hb N (a * b) hab (σ : ℂ) hσ hσ2 + simp only [Complex.ofReal_im, abs_zero, zero_add] at hprod + have hvr := (Complex.re_le_norm _).trans (hr σ hσ hσ2) + have hχdiff := logDeriv_changeLevel_bound χ.complexCharacter hχN (σ : ℂ) hσ + have hψdiff := logDeriv_changeLevel_bound ψ.complexCharacter hψN (σ : ℂ) hσ + have hχre := Complex.re_le_norm (-(logDeriv (DirichletCharacter.LFunction a) (σ : ℂ) - logDeriv χ.L (σ : ℂ))) + have hψre := Complex.re_le_norm (-(logDeriv (DirichletCharacter.LFunction b) (σ : ℂ) - logDeriv ψ.L (σ : ℂ))) + simp only [Complex.neg_re, Complex.sub_re, norm_neg] at hχre hψre + have hx := hg χ (σ : ℂ) hσ hσ2 (by simp) + have hy := hg ψ (σ : ℂ) hσ hσ2 (by simp) + have hlog : Real.log N = Real.log χ.modulus + Real.log ψ.modulus := by + rw [show (N : ℝ) = (χ.modulus : ℝ) * ψ.modulus by simp [N], Real.log_mul] + · exact_mod_cast χ.positive.ne' + · exact_mod_cast ψ.positive.ne' + change ‖logDeriv (DirichletCharacter.LFunction a) (σ : ℂ) - logDeriv χ.L (σ : ℂ)‖ ≤ _ at hχdiff + change ‖logDeriv (DirichletCharacter.LFunction b) (σ : ℂ) - logDeriv ψ.L (σ : ℂ)‖ ≤ _ at hψdiff + rw [hlog] at hχdiff hψdiff hprod + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterReflection.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterReflection.lean new file mode 100644 index 0000000000000000000000000000000000000000..577e12dd1a25212c0065c2c837ee05a902a7977e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterReflection.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterComplexification +import OAI.NumberTheory.Ostmann.Characters.CharacterCompletedLogDerivative +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroReflection + +namespace OAI + +/-! # The actual functional equation for a real primitive character -/ + +namespace Ostmann + +open Complex +open scoped Classical + +theorem PrimitiveRealCharacter.complex_inv_eq (χ : PrimitiveRealCharacter) : + χ.complexCharacter⁻¹ = χ.complexCharacter := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + rw [← MulChar.star_eq_inv] + ext x + simp [PrimitiveRealCharacter.complexCharacter] + +theorem PrimitiveRealCharacter.inverse_completed_eq (χ : PrimitiveRealCharacter) : + χ.asComplex.inverse.completed = χ.asComplex.completed := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + funext s + change DirichletCharacter.completedLFunction (χ.complexCharacter⁻¹) s = + DirichletCharacter.completedLFunction χ.complexCharacter s + rw [χ.complex_inv_eq] + +theorem PrimitiveRealCharacter.inverse_L_eq (χ : PrimitiveRealCharacter) : + χ.asComplex.inverse.L = χ.asComplex.L := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + funext s + change DirichletCharacter.LFunction (χ.complexCharacter⁻¹) s = + DirichletCharacter.LFunction χ.complexCharacter s + rw [χ.complex_inv_eq] + +theorem PrimitiveRealCharacter.completed_logDeriv_reflection + (χ : PrimitiveRealCharacter) (s : ℂ) (hs : 1 ≤ s.re) : + logDeriv χ.asComplex.completed (1 - s) = + -Complex.log (χ.modulus : ℂ) - logDeriv χ.asComplex.completed s := by + have hh := χ.asComplex.completed_logDeriv_reflection s hs + rw [χ.inverse_completed_eq] at hh + exact hh + +theorem PrimitiveRealCharacter.zero_reflection_order (χ : PrimitiveRealCharacter) + (z : ℂ) (hz : 0 < z.re) (hz1 : z.re < 1) : + analyticOrderNatAt χ.L (1 - z) = analyticOrderNatAt χ.L z := by + have hh := χ.asComplex.L_order_reflection z hz hz1 + rw [χ.inverse_L_eq] at hh + exact congrArg ENat.toNat hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterTrigonometric.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterTrigonometric.lean new file mode 100644 index 0000000000000000000000000000000000000000..9494ea6a7606993cf98347867cdf3443cbe898b4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterTrigonometric.lean @@ -0,0 +1,95 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.LowHeightZeroBounds + +namespace OAI + +/-! # The positive trigonometric polynomial for real characters -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +theorem real_character_unit_polynomial (a : ℝ) (ha : |a| ≤ 1) (u : ℂ) + (hu : ‖u‖ = 1) : 0 ≤ 3 + 4 * a * u.re + (u * u).re := by + have hsq := Complex.sq_norm u + rw [hu] at hsq + simp only [one_pow, Complex.normSq_apply] at hsq + rw [Complex.mul_re] + rcases le_total 0 u.re with hr | hr + · have hm := mul_nonneg (show 0 ≤ a + 1 by linarith [(abs_le.mp ha).1]) hr + nlinarith [sq_nonneg (u.re - 1)] + · have hm := mul_nonneg (show 0 ≤ 1 - a by linarith [(abs_le.mp ha).2]) (neg_nonneg.mpr hr) + nlinarith [sq_nonneg (u.re + 1)] + +theorem LSeries_term_vertical (c : ℕ → ℂ) (n : ℕ) (hn : n ≠ 0) (σ t : ℝ) : + LSeries.term c ((σ : ℂ) + (t : ℂ) * I) n = + c n * ((n : ℝ) ^ (-σ) : ℝ) * (n : ℂ) ^ (-(t : ℂ) * I) := by + rw [LSeries.term_of_ne_zero hn, div_eq_mul_inv, ← Complex.cpow_neg] + rw [show -((σ : ℂ) + (t : ℂ) * I) = (-(σ : ℝ) : ℂ) + (-(t : ℂ) * I) by ring, + Complex.cpow_add _ _ (by exact_mod_cast hn)] + have hr : (n : ℂ) ^ (-(σ : ℂ)) = ((n : ℝ) ^ (-σ) : ℝ) := by + simpa using (Complex.ofReal_cpow (Nat.cast_nonneg n) (-σ)).symm + rw [hr] + ring + +theorem real_character_trigonometric_term_nonneg (χ : PrimitiveRealCharacter) (σ t : ℝ) (n : ℕ) : + 0 ≤ 3 * (LSeries.term (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ) n).re + + 4 * (LSeries.term (fun n => χ.complexCharacter n * (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + (t : ℂ) * I) n).re + + (LSeries.term (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + ((2 * t : ℝ) : ℂ) * I) n).re := by + by_cases hn : n = 0 + · subst n; simp + let u : ℂ := (n : ℂ) ^ (-(t : ℂ) * I) + have hu : ‖u‖ = 1 := by + dsimp [u] + rw [Complex.norm_natCast_cpow_of_pos (Nat.pos_of_ne_zero hn)] + simp + have ha : |χ.character n| ≤ 1 := by simpa [Real.norm_eq_abs] using χ.character.norm_le_one n + have hp := real_character_unit_polynomial (χ.character n) ha u hu + have hb : 0 ≤ ArithmeticFunction.vonMangoldt n * (n : ℝ) ^ (-σ) := + mul_nonneg ArithmeticFunction.vonMangoldt_nonneg (Real.rpow_nonneg (Nat.cast_nonneg n) _) + have hphase : (n : ℂ) ^ (-((2 * t : ℝ) : ℂ) * I) = u * u := by + rw [show -((2 * t : ℝ) : ℂ) * I = -(t : ℂ) * I + -(t : ℂ) * I by push_cast; ring] + exact Complex.cpow_add _ _ (by exact_mod_cast hn) + have hzero := LSeries_term_vertical (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) n hn σ 0 + simp only [Complex.ofReal_zero, neg_zero, zero_mul, Complex.cpow_zero, mul_one, add_zero] at hzero + rw [hzero, LSeries_term_vertical _ n hn, LSeries_term_vertical _ n hn, hphase] + simp only [PrimitiveRealCharacter.complexCharacter, MulChar.ringHomComp_apply, + Complex.ofRealHom_eq_coe, Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, + mul_zero, sub_zero, add_zero] + change 0 ≤ 3 * (ArithmeticFunction.vonMangoldt n * (n : ℝ) ^ (-σ)) + + 4 * (χ.character n * ArithmeticFunction.vonMangoldt n * (n : ℝ) ^ (-σ) * u.re) + + ArithmeticFunction.vonMangoldt n * (n : ℝ) ^ (-σ) * (u * u).re + convert mul_nonneg hb hp using 1 + ring + +/-- The Euler series inherits positivity term by term; no prime distribution +input or zero-free assumption is used. -/ +theorem real_character_trigonometric_sum_nonneg (χ : PrimitiveRealCharacter) + (σ t : ℝ) (hσ : 1 < σ) : + 0 ≤ 3 * (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ)).re + + 4 * (LSeries (fun n => χ.complexCharacter n * (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + (t : ℂ) * I)).re + + (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + ((2 * t : ℝ) : ℂ) * I)).re := by + have h0 := ArithmeticFunction.LSeriesSummable_vonMangoldt (s := (σ : ℂ)) hσ + have h1 := χ.complexCharacter.LSeriesSummable_twist_vonMangoldt + (s := (σ : ℂ) + (t : ℂ) * I) (by simpa using hσ) + change LSeriesSummable (fun n => χ.complexCharacter n * (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + (t : ℂ) * I) at h1 + have h2 := ArithmeticFunction.LSeriesSummable_vonMangoldt + (s := (σ : ℂ) + ((2 * t : ℝ) : ℂ) * I) (by simpa using hσ) + have hh := tsum_nonneg (L := SummationFilter.unconditional ℕ) + (real_character_trigonometric_term_nonneg χ σ t) + have h0r := (Complex.hasSum_re h0.hasSum).summable + have h1r := (Complex.hasSum_re h1.hasSum).summable + have h2r := (Complex.hasSum_re h2.hasSum).summable + rw [Summable.tsum_add ((h0r.mul_left 3).add (h1r.mul_left 4)) h2r, + Summable.tsum_add (h0r.mul_left 3) (h1r.mul_left 4), tsum_mul_left, tsum_mul_left, + ← Complex.re_tsum h0, ← Complex.re_tsum h1, ← Complex.re_tsum h2] at hh + exact hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterZeroConvergence.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterZeroConvergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b1f7f7db6bfa04833e2a1f0f6fa0148f2f70afa --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCharacterZeroConvergence.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterComplexification +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroInverseSquare + +namespace OAI + +/-! # Absolute convergence of the real-axis zero kernel -/ + +namespace Ostmann + +theorem real_zero_kernel_square_bound (a y δ : ℝ) (hδ : 0 < δ) + (ha : δ ≤ a) (ha2 : a ≤ 2) : + realZeroKernel a y ≤ (8 + 4 * δ⁻¹) * ((1 + |y|) ^ 2)⁻¹ := by + have ha0 : 0 < a := hδ.trans_le ha + have hw : 0 < (1 + |y|) ^ 2 := sq_pos_of_pos (by positivity) + by_cases hy : |y| ≤ 1 + · have hk := (realZeroKernel_le_inv (y := y) ha0).trans (inv_anti₀ hδ ha) + have hwle : (1 + |y|) ^ 2 ≤ 4 := by nlinarith [abs_nonneg y] + have hwi : (1 / 4 : ℝ) ≤ ((1 + |y|) ^ 2)⁻¹ := by + simpa using (inv_anti₀ hw hwle) + have hm := mul_le_mul_of_nonneg_left hwi (by positivity : 0 ≤ 4 * δ⁻¹) + have hn := mul_le_mul_of_nonneg_right (show 4 * δ⁻¹ ≤ 8 + 4 * δ⁻¹ by linarith) + (inv_nonneg.mpr hw.le) + nlinarith + · have hy1 : 1 < |y| := lt_of_not_ge hy + have hy2 : 0 < y ^ 2 := by nlinarith [sq_abs y] + have hden : 0 < a ^ 2 + y ^ 2 := by positivity + have hk : realZeroKernel a y ≤ 2 / y ^ 2 := by + unfold realZeroKernel + apply div_le_div₀ (by norm_num : (0 : ℝ) ≤ 2) ha2 hy2 + nlinarith [sq_nonneg a] + have hwle : (1 + |y|) ^ 2 ≤ 4 * y ^ 2 := by nlinarith [sq_abs y] + have hfrac : 2 / y ^ 2 ≤ 8 * ((1 + |y|) ^ 2)⁻¹ := by + rw [← div_eq_mul_inv, div_le_div_iff₀ hy2 hw] + linarith + exact (hk.trans hfrac).trans (mul_le_mul_of_nonneg_right (by have := inv_pos.mpr hδ; linarith) + (inv_nonneg.mpr hw.le)) + +/-- The actual faithful zero family supplies the convergence field of the +published real-character Hadamard expansion. -/ +theorem real_character_zero_kernel_summable (χ : PrimitiveRealCharacter) (s : ℝ) + (hs : 1 < s) (hs2 : s ≤ 2) : + Summable (fun i => realZeroKernel (s - ((realCharacterActualZeros χ).zeros i).re) + ((realCharacterActualZeros χ).zeros i).im) := by + let Z := realCharacterActualZeros χ + have hh := character_zero_inverse_square_summable χ.asComplex + apply Summable.of_nonneg_of_le + (fun i => realZeroKernel_nonneg (by linarith [(Z.in_strip i).2])) + (fun i => real_zero_kernel_square_bound _ _ (s - 1) (by linarith) + (by linarith [(Z.in_strip i).2]) (by linarith [(Z.in_strip i).1])) + (hh.mul_left (8 + 4 * (s - 1)⁻¹)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCompletedHadamard.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCompletedHadamard.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e2f43d3622d9622405e254fc7b9a91e1ba9034a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealCompletedHadamard.lean @@ -0,0 +1,87 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CompletedPartialFractionLimit +import OAI.NumberTheory.Ostmann.Characters.CharacterDiskIndices +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterZeroConvergence +import OAI.NumberTheory.Ostmann.ZeroDensity.RealZeroReflectionPermutation + +namespace OAI + +/-! # The real-axis Hadamard identity from actual disk sums -/ + +namespace Ostmann + +open Complex Filter +open scoped Topology BigOperators + +noncomputable def realCharacterZeroSum (χ : PrimitiveRealCharacter) (s : ℝ) : ℝ := + ∑' i, realZeroKernel (s - ((realCharacterActualZeros χ).zeros i).re) + ((realCharacterActualZeros χ).zeros i).im + +theorem completed_partial_real_limit (χ : PrimitiveRealCharacter) (s : ℝ) + (hsum : Summable (fun i => realZeroKernel (s - ((realCharacterActualZeros χ).zeros i).re) + ((realCharacterActualZeros χ).zeros i).im)) : + Tendsto (fun n : ℕ => (completedZeroPartialFraction χ.asComplex ((n : ℝ) + 1) (s : ℂ)).re) + atTop (𝓝 (realCharacterZeroSum χ s)) := by + let Z := realCharacterActualZeros χ + have hn : Tendsto (fun n : ℕ => (n : ℝ) + 1) atTop atTop := + tendsto_atTop_add_const_right _ _ tendsto_natCast_atTop_atTop + have hh := hsum.hasSum.comp (Z.tendsto_diskIndices.comp hn) + unfold realCharacterZeroSum + convert hh using 1 + funext n + rw [completedZeroPartialFraction_index_sum χ.asComplex (faithfulCharacterZeroEquiv χ.asComplex), + Complex.re_sum] + exact Finset.sum_congr rfl (fun i _ => realZeroKernel_complex s _) + +theorem real_zero_kernel_reflection (χ : PrimitiveRealCharacter) (s : ℝ) (i : ℕ) : + realZeroKernel (1 - s - ((realCharacterActualZeros χ).zeros i).re) + ((realCharacterActualZeros χ).zeros i).im = + -realZeroKernel (s - ((realCharacterActualZeros χ).zeros (realZeroIndexReflection χ i)).re) + ((realCharacterActualZeros χ).zeros (realZeroIndexReflection χ i)).im := by + rw [realZeroIndexReflection_zeros] + rw [← realZeroKernel_complex s] + have he : (s : ℂ) - (1 - (realCharacterActualZeros χ).zeros i) = + -(((1 - s : ℝ) : ℂ) - (realCharacterActualZeros χ).zeros i) := by push_cast; ring + rw [he, inv_neg, Complex.neg_re, neg_neg, realZeroKernel_complex] + +theorem real_zero_sum_reflection (χ : PrimitiveRealCharacter) (s : ℝ) + (hs : 1 < s) (hs2 : s ≤ 2) : + Summable (fun i => realZeroKernel (1 - s - ((realCharacterActualZeros χ).zeros i).re) + ((realCharacterActualZeros χ).zeros i).im) ∧ + realCharacterZeroSum χ (1 - s) = -realCharacterZeroSum χ s := by + have hp := real_character_zero_kernel_summable χ s hs hs2 + have hr := hp.comp_injective (realZeroIndexReflection χ).injective + constructor + · simpa only [real_zero_kernel_reflection, Function.comp_def] using hr.neg + · unfold realCharacterZeroSum + simp_rw [real_zero_kernel_reflection] + rw [tsum_neg] + congr 1 + exact (realZeroIndexReflection χ).tsum_eq + (fun i => realZeroKernel (s - ((realCharacterActualZeros χ).zeros i).re) + ((realCharacterActualZeros χ).zeros i).im) + +/-- Reflection cancels the constant term in the canonical product. -/ +theorem real_completed_hadamard_identity (χ : PrimitiveRealCharacter) (s : ℝ) + (hs : 1 < s) (hs2 : s ≤ 2) : + realCharacterZeroSum χ s = (logDeriv χ.asComplex.completed (s : ℂ)).re + + (1 / 2) * Real.log χ.modulus := by + have hp := completed_partial_real_limit χ s (real_character_zero_kernel_summable χ s hs hs2) + obtain ⟨hn, heq⟩ := real_zero_sum_reflection χ s hs hs2 + have hm := completed_partial_real_limit χ (1 - s) hn + have hc := completed_partial_fraction_difference_tendsto χ.asComplex + (1 - (s : ℂ)) (s : ℂ) + (χ.asComplex.completed_ne_zero_left _ (by simp; linarith)) + (χ.asComplex.completed_ne_zero_right _ (by simp; linarith)) + have hr := Complex.continuous_re.continuousAt.tendsto.comp hc + have hd := hp.sub hm + have hlim : realCharacterZeroSum χ s - realCharacterZeroSum χ (1 - s) = + (logDeriv χ.asComplex.completed (s : ℂ) - logDeriv χ.asComplex.completed (1 - (s : ℂ))).re := by + apply tendsto_nhds_unique hd + simpa only [Function.comp_def, Complex.sub_re, Complex.ofReal_sub, Complex.ofReal_one] using hr + rw [heq, χ.completed_logDeriv_reflection (s : ℂ) (by simp; linarith)] at hlim + simp only [Complex.sub_re, Complex.neg_re, Complex.log_re, Complex.norm_natCast] at hlim + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealPrimeSeries.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealPrimeSeries.lean new file mode 100644 index 0000000000000000000000000000000000000000..3dde3f9da4a388312f6b2d89729da0d052cdbd32 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealPrimeSeries.lean @@ -0,0 +1,56 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimeLogDerivative + +namespace OAI + +/-! # The real prime series for a real Dirichlet character -/ + +namespace Ostmann + +open scoped BigOperators +open Complex LSeries + +noncomputable def realPrimeTerm {q : ℕ} (χ : DirichletCharacter ℝ q) (s : ℝ) (n : ℕ) : ℝ := + if n.Prime then χ n * Real.log n / (n : ℝ) ^ s else 0 + +theorem primeLogTerm_ofReal {q : ℕ} (χ : DirichletCharacter ℝ q) (s : ℝ) (n : ℕ) : + LSeries.term (primeLogCoefficients (χ.ringHomComp Complex.ofRealHom)) (s : ℂ) n = + (realPrimeTerm χ s n : ℂ) := by + by_cases hn : n = 0 + · subst n + simp [realPrimeTerm] + · rw [LSeries.term_of_ne_zero hn] + by_cases hp : n.Prime + · simp only [primeLogCoefficients, hp, ite_true, realPrimeTerm, + MulChar.ringHomComp_apply, + Complex.ofReal_div, Complex.ofReal_mul] + change (χ n : ℂ) * (Real.log n : ℂ) / (n : ℂ) ^ (s : ℂ) = _ + rw [← Complex.ofReal_natCast n, ← Complex.ofReal_cpow (Nat.cast_nonneg n)] + · simp [primeLogCoefficients, realPrimeTerm, hp] + +/-- The uniform prime-power error is retained for the actual real weighted +prime sum. This result requires no analytic input beyond proved Mathlib. -/ +theorem exists_realPrimeSeries_error : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℝ q) (s : ℝ), 1 < s → + Summable (realPrimeTerm χ s) ∧ + |(∑' n, realPrimeTerm χ s n) + + (deriv (DirichletCharacter.LFunction (χ.ringHomComp Complex.ofRealHom)) (s : ℂ) / + DirichletCharacter.LFunction (χ.ringHomComp Complex.ofRealHom) (s : ℂ)).re| ≤ C := by + obtain ⟨C, hC, herror⟩ := exists_primeLogDerivative_error + refine ⟨C, hC, ?_⟩ + intro q hq χ s hs + obtain ⟨hseries, hbound⟩ := herror q (χ.ringHomComp Complex.ofRealHom) s hs + have hcast : Summable (fun n => (realPrimeTerm χ s n : ℂ)) := + hseries.congr (primeLogTerm_ofReal χ s) + have hsum : LSeries (primeLogCoefficients (χ.ringHomComp Complex.ofRealHom)) (s : ℂ) = + (((∑' n, realPrimeTerm χ s n) : ℝ) : ℂ) := by + calc + _ = ∑' n, (realPrimeTerm χ s n : ℂ) := tsum_congr (primeLogTerm_ofReal χ s) + _ = _ := (Complex.ofReal_tsum _).symm + refine ⟨Complex.summable_ofReal.mp hcast, ?_⟩ + rw [hsum] at hbound + have hb := (Complex.abs_re_le_norm _).trans hbound + simpa only [Complex.add_re, Complex.ofReal_re] using hb + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroKernel.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c7b2092eb1b76f6a9be724b44e33dc9cbafaa35 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroKernel.lean @@ -0,0 +1,68 @@ +import Mathlib.Basic.Complex.Basic +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith + +namespace OAI + +/-! # Comparing the real parts of zero contributions at two real points -/ + +namespace Ostmann + +noncomputable def realZeroKernel (a y : ℝ) : ℝ := a / (a ^ 2 + y ^ 2) + +theorem realZeroKernel_nonneg {a y : ℝ} (ha : 0 ≤ a) : 0 ≤ realZeroKernel a y := + div_nonneg ha (add_nonneg (sq_nonneg _) (sq_nonneg _)) + +theorem realZeroKernel_complex (s : ℝ) (ρ : ℂ) : + ((s : ℂ) - ρ)⁻¹.re = realZeroKernel (s - ρ.re) ρ.im := by + rw [Complex.inv_re] + simp only [Complex.sub_re, Complex.ofReal_re, Complex.normSq_apply, + Complex.sub_im, Complex.ofReal_im, zero_sub, neg_mul_neg, realZeroKernel, pow_two] + +/-- The universal ratio bound used for zeros near the real axis. -/ +theorem realZeroKernel_ratio {a b y : ℝ} (ha : 0 < a) (hab : a ≤ b) : + realZeroKernel a y ≤ (b / a) * realZeroKernel b y := by + have hb : 0 < b := ha.trans_le hab + have hda : 0 < a ^ 2 + y ^ 2 := add_pos_of_pos_of_nonneg (sq_pos_of_pos ha) (sq_nonneg y) + have hdb : 0 < b ^ 2 + y ^ 2 := add_pos_of_pos_of_nonneg (sq_pos_of_pos hb) (sq_nonneg y) + have hs : 0 ≤ (b ^ 2 - a ^ 2) * y ^ 2 := by + apply mul_nonneg _ (sq_nonneg y) + nlinarith + unfold realZeroKernel + rw [← mul_div_assoc, div_le_div_iff₀ hda hdb] + apply (mul_le_mul_iff_left₀ ha).mp + field_simp + nlinarith + +/-- At imaginary height at least one, bounded real parts give an absolute +constant independent of the zero-free region. -/ +theorem realZeroKernel_high {a b y : ℝ} (ha : 0 < a) (hab : a ≤ b) + (hb : b ≤ 2) (hy : 1 ≤ y ^ 2) : + realZeroKernel a y ≤ 5 * realZeroKernel b y := by + have hb0 : 0 < b := ha.trans_le hab + have hda : 0 < a ^ 2 + y ^ 2 := add_pos_of_pos_of_nonneg (sq_pos_of_pos ha) (sq_nonneg y) + have hdb : 0 < b ^ 2 + y ^ 2 := add_pos_of_pos_of_nonneg (sq_pos_of_pos hb0) (sq_nonneg y) + have hd : b ^ 2 + y ^ 2 ≤ 5 * (a ^ 2 + y ^ 2) := by nlinarith [sq_nonneg a] + have h1 := mul_le_mul_of_nonneg_right hab hdb.le + have h2 := mul_le_mul_of_nonneg_left hd hb0.le + unfold realZeroKernel + rw [← mul_div_assoc, div_le_div_iff₀ hda hdb] + nlinarith + +theorem realZeroKernel_gap {a b y c δ : ℝ} (ha : 0 < a) (hab : a ≤ b) + (hc : 0 < c) (hgap : b - a ≤ δ) (hregion : c * δ ≤ a) : + realZeroKernel a y ≤ (1 + c⁻¹) * realZeroKernel b y := by + have hδ : δ / a ≤ 1 / c := by + apply (div_le_div_iff₀ ha hc).mpr + nlinarith + have hratio : b / a ≤ 1 + c⁻¹ := by + have hg := div_le_div_of_nonneg_right (show b ≤ a + δ by linarith) ha.le + rw [add_div, div_self ha.ne'] at hg + exact hg.trans (by simpa only [one_div] using add_le_add (show (1 : ℝ) ≤ 1 from le_rfl) hδ) + exact (realZeroKernel_ratio ha hab).trans + (mul_le_mul_of_nonneg_right hratio (realZeroKernel_nonneg (ha.le.trans hab))) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroPairExclusion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroPairExclusion.lean new file mode 100644 index 0000000000000000000000000000000000000000..926ce7cb28ebc76f4e426f8c49ec10b881adc30d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroPairExclusion.lean @@ -0,0 +1,56 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualRealZeroIndices +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterPairZeroBound + +namespace OAI + +/-! # The real Page exclusion from one-pole bounds -/ + +namespace Ostmann + +open Complex + +theorem near_real_zero_inverse_mass (δ β : ℝ) (hδ : 0 < δ) (hβ : β < 1) + (hnear : 1 - δ / 20 ≤ β) : 9 / 10 < δ * (1 / (1 + δ - β)) := by + have hh := real_zero_shifted_mass δ (1 + δ - β) hδ (by linarith) (by linarith) + simp only [div_eq_mul_inv] at hh ⊢ + nlinarith + +theorem real_zero_pair_exclusion (e f : PrimitiveRealZero) (δ R S : ℝ) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hR : δ * R ≤ 1 / 10) (hS : δ * S ≤ 1 / 10) + (he : 1 - δ / 20 ≤ e.beta) (hf : 1 - δ / 20 ≤ f.beta) + (hsingle : shiftedRealCharacterZeroSum e.asRealCharacter ((1 + δ : ℝ) : ℂ) ≤ 1 / δ + R) + (hpair : e.asRealCharacter ≠ f.asRealCharacter → + shiftedRealCharacterZeroSum e.asRealCharacter ((1 + δ : ℝ) : ℂ) + + shiftedRealCharacterZeroSum f.asRealCharacter ((1 + δ : ℝ) : ℂ) ≤ 1 / δ + S) : e = f := by + have hme := near_real_zero_inverse_mass δ e.beta hδ e.beta_lt_one he + have hmf := near_real_zero_inverse_mass δ f.beta hδ f.beta_lt_one hf + have heterm := e.kernel_le_zero_sum (1 + δ) (by linarith) (by linarith) + have hfterm := f.kernel_le_zero_sum (1 + δ) (by linarith) (by linarith) + have hcancel (C : ℝ) : δ * (1 / δ + C) = 1 + δ * C := by field_simp + by_cases hχ : e.asRealCharacter = f.asRealCharacter + · apply PrimitiveRealZero.eq_of_character_beta hχ + by_contra hβ + obtain ⟨i, hi⟩ := e.has_actual_index + obtain ⟨j, hj⟩ := f.has_actual_index + rw [← hχ] at hj + have hij : i ≠ j := by + intro hij + apply hβ + apply Complex.ofReal_injective + rw [← hi, ← hj, hij] + have hh := shifted_real_zero_pair_le e.asRealCharacter ((1 + δ : ℝ) : ℂ) + (by simp; linarith) (by simp; linarith) i j hij + rw [hi, hj, ← Complex.ofReal_sub, ← Complex.ofReal_sub, + ← Complex.ofReal_inv, ← Complex.ofReal_inv, Complex.ofReal_re, Complex.ofReal_re] at hh + have hp := mul_le_mul_of_nonneg_left (hh.trans hsingle) hδ.le + rw [hcancel] at hp + simp only [one_div] at hme hmf + nlinarith + · have hh := (add_le_add heterm hfterm).trans (hpair hχ) + have hp := mul_le_mul_of_nonneg_left hh hδ.le + rw [hcancel] at hp + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroReflectionPermutation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroReflectionPermutation.lean new file mode 100644 index 0000000000000000000000000000000000000000..6be2d3426e0b50af870f3b4a6d5b25115d18d70c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroReflectionPermutation.lean @@ -0,0 +1,53 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RealCharacterReflection + +namespace OAI + +/-! # Reflection as an actual permutation of all zero multiplicity labels -/ + +namespace Ostmann + +open scoped Classical + +theorem PrimitiveRealCharacter.zero_reflection (χ : PrimitiveRealCharacter) + (z : ℂ) (hz : z ∈ complexCharacterZeros χ.asComplex) : + 1 - z ∈ complexCharacterZeros χ.asComplex := by + refine ⟨by simp only [Complex.sub_re, Complex.one_re]; linarith [hz.2.1], + by simp only [Complex.sub_re, Complex.one_re]; linarith [hz.1], ?_⟩ + have hh := (characterZeroOrder_pos_iff χ.asComplex z).mpr hz.2.2 + rw [characterZeroOrder_eq_nat, Int.natCast_pos] at hh + have hr := χ.zero_reflection_order z hz.1 hz.2.1 + apply (characterZeroOrder_pos_iff χ.asComplex (1 - z)).mp + rw [characterZeroOrder_eq_nat, Int.natCast_pos] + change 0 < analyticOrderNatAt χ.L (1 - z) + rw [hr] + exact hh + +noncomputable def realZeroCopyReflection (χ : PrimitiveRealCharacter) : + CharacterZeroCopy χ.asComplex ≃ CharacterZeroCopy χ.asComplex := by + let f : CharacterZeroCopy χ.asComplex → CharacterZeroCopy χ.asComplex := fun c => + ⟨(1 - c.val.1, c.val.2), χ.zero_reflection c.val.1 c.property.1, by + change c.val.2 < analyticOrderNatAt χ.L (1 - c.val.1) + rw [χ.zero_reflection_order _ c.property.1.1 c.property.1.2.1] + exact c.property.2⟩ + apply Function.Involutive.toPerm (f := f) + intro c + apply Subtype.ext + apply Prod.ext + · change 1 - (1 - c.val.1) = c.val.1 + ring + · rfl + +noncomputable def realZeroIndexReflection (χ : PrimitiveRealCharacter) : ℕ ≃ ℕ := + (faithfulCharacterZeroEquiv χ.asComplex).trans + ((realZeroCopyReflection χ).trans (faithfulCharacterZeroEquiv χ.asComplex).symm) + +theorem realZeroIndexReflection_zeros (χ : PrimitiveRealCharacter) (i : ℕ) : + (realCharacterActualZeros χ).zeros (realZeroIndexReflection χ i) = + 1 - (realCharacterActualZeros χ).zeros i := by + simp [realCharacterActualZeros, actualCharacterZeros, characterZeroEnumeration, + realZeroIndexReflection, realZeroCopyReflection, Function.Involutive.toPerm] + rfl + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroSum.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..a58ec9671e668dbb2bfd02a56d6d09e5f7dcaec4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RealZeroSum.lean @@ -0,0 +1,78 @@ +import Mathlib.Topology.Algebra.InfiniteSum.ENNReal +import Mathlib.Topology.Algebra.InfiniteSum.Ring +import OAI.NumberTheory.Ostmann.ZeroDensity.RealZeroKernel + +namespace OAI + +/-! # Summing the zero-free comparison with a finite exceptional set -/ + +namespace Ostmann + +open scoped BigOperators Classical + +theorem realZeroKernel_le_inv {a y : ℝ} (ha : 0 < a) : + realZeroKernel a y ≤ a⁻¹ := by + have ha2 : 0 < a ^ 2 := sq_pos_of_pos ha + calc + _ ≤ a / a ^ 2 := div_le_div_of_nonneg_left ha.le ha2 (by nlinarith [sq_nonneg y]) + _ = _ := by field_simp + +theorem realZeroKernel_zero_free (ρ : ℂ) (s s₀ c δ C : ℝ) + (hρ : 0 ≤ ρ.re ∧ ρ.re < 1) (hs : 1 < s) (hss : s ≤ s₀) (hs₀ : s₀ ≤ 2) + (hc : 0 < c) (hC5 : 5 ≤ C) (hCc : 1 + c⁻¹ ≤ C) + (hgap : s₀ - s ≤ δ) (hregion : ρ.im ^ 2 < 1 → c * δ ≤ s - ρ.re) : + realZeroKernel (s - ρ.re) ρ.im ≤ C * realZeroKernel (s₀ - ρ.re) ρ.im := by + have ha : 0 < s - ρ.re := by linarith [hρ.2] + have hab : s - ρ.re ≤ s₀ - ρ.re := by linarith + have hb : s₀ - ρ.re ≤ 2 := by linarith [hρ.1] + have hn : 0 ≤ realZeroKernel (s₀ - ρ.re) ρ.im := realZeroKernel_nonneg (by linarith) + by_cases hy : 1 ≤ ρ.im ^ 2 + · exact (realZeroKernel_high ha hab hb hy).trans (mul_le_mul_of_nonneg_right hC5 hn) + · exact (realZeroKernel_gap ha hab hc (by linarith) (hregion (lt_of_not_ge hy))).trans + (mul_le_mul_of_nonneg_right hCc hn) + +/-- An arbitrary zero family may retain finitely many exceptions. The +comparison proves summability at s as well as the bound; summability at s +is not assumed. Multiplicities are represented by repeated indices. -/ +theorem realZeroKernel_sum_bound {ι : Type*} (ρ : ι → ℂ) (E : Finset ι) + (s s₀ c δ C : ℝ) (hρ : ∀ i, 0 ≤ (ρ i).re ∧ (ρ i).re < 1) + (hs : 1 < s) (hss : s ≤ s₀) (hs₀ : s₀ ≤ 2) (hc : 0 < c) + (hC5 : 5 ≤ C) (hCc : 1 + c⁻¹ ≤ C) (hgap : s₀ - s ≤ δ) + (hregion : ∀ i ∉ E, (ρ i).im ^ 2 < 1 → c * δ ≤ s - (ρ i).re) + (hsum : Summable (fun i => realZeroKernel (s₀ - (ρ i).re) (ρ i).im)) : + Summable (fun i => realZeroKernel (s - (ρ i).re) (ρ i).im) ∧ + (∑' i, realZeroKernel (s - (ρ i).re) (ρ i).im) ≤ + C * (∑' i, realZeroKernel (s₀ - (ρ i).re) (ρ i).im) + + ∑ i ∈ E, (s - (ρ i).re)⁻¹ := by + let e : ι → ℝ := fun i => if i ∈ E then (s - (ρ i).re)⁻¹ else 0 + have he : Summable e := summable_of_ne_finset_zero (s := E) (by + intro i hi + simp only [e, ite_eq_right hi]) + have hE : ∑' i, e i = ∑ i ∈ E, (s - (ρ i).re)⁻¹ := by + rw [tsum_eq_sum (s := E) (by intro i hi; simp only [e, ite_eq_right hi])] + apply Finset.sum_congr rfl + intro i hi + simp only [e, ite_eq_left hi] + have hmaj := (hsum.mul_left C).add he + have hp (i : ι) : realZeroKernel (s - (ρ i).re) (ρ i).im ≤ + C * realZeroKernel (s₀ - (ρ i).re) (ρ i).im + e i := by + have ha : 0 < s - (ρ i).re := by linarith [(hρ i).2] + have hn : 0 ≤ C * realZeroKernel (s₀ - (ρ i).re) (ρ i).im := by + apply mul_nonneg (by linarith) + apply realZeroKernel_nonneg + linarith [(hρ i).2] + by_cases hi : i ∈ E + · have hb := realZeroKernel_le_inv (y := (ρ i).im) ha + simp only [e, ite_eq_left hi] + linarith + · simpa only [e, ite_eq_right hi, add_zero] using + realZeroKernel_zero_free (ρ i) s s₀ c δ C (hρ i) hs hss hs₀ hc hC5 hCc hgap (hregion i hi) + have hsnew : Summable (fun i => realZeroKernel (s - (ρ i).re) (ρ i).im) := + Summable.of_nonneg_of_le (fun i => realZeroKernel_nonneg (by linarith [(hρ i).2])) hp hmaj + refine ⟨hsnew, ?_⟩ + have hb := hsnew.tsum_le_tsum hp hmaj + rwa [Summable.tsum_add (hsum.mul_left C) he, hsum.tsum_mul_left, hE] at hb + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ReciprocalProgressionVariation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ReciprocalProgressionVariation.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c8406eb9cc36329363c27fbca2deb867628e87b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ReciprocalProgressionVariation.lean @@ -0,0 +1,75 @@ +import OAI.NumberTheory.Ostmann.Characters.ProductWeightVariation + +namespace OAI + +/-! # The original reciprocal-integer weight in partial summation -/ + +namespace Ostmann + +open scoped BigOperators + +theorem discreteVariation_nonneg (f : ℕ → ℂ) (N : ℕ) : 0 ≤ discreteVariation f N := by + exact add_nonneg (norm_nonneg _) (Finset.sum_nonneg (fun _ _ => norm_nonneg _)) + +theorem discreteVariation_congr {f g : ℕ → ℂ} {N : ℕ} + (h : ∀ j ≤ N - 1, f j = g j) : discreteVariation f N = discreteVariation g N := by + unfold discreteVariation + rw [h (N - 1) le_rfl] + congr 1 + apply Finset.sum_congr rfl + intro j hj + have hj' := Finset.mem_range.mp hj + rw [h j (by omega), h (j + 1) (by omega)] + +theorem discreteVariation_ofReal_antitone (u : ℕ → ℝ) (N : ℕ) + (hu : ∀ j, 0 ≤ u j) (hanti : Antitone u) : + discreteVariation (fun j => (u j : ℂ)) N = u 0 := by + have hs (j : ℕ) : ‖(u (j + 1) : ℂ) - (u j : ℂ)‖ = u j - u (j + 1) := by + rw [← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonpos (sub_nonpos.mpr (hanti (by omega)))] + ring + unfold discreteVariation + simp only [Complex.norm_real, Real.norm_of_nonneg (hu _), hs] + rw [Finset.sum_range_sub'] + ring + +theorem reciprocal_progression_antitone (b d : ℝ) (hb : 0 < b) (hd : 0 ≤ d) : + Antitone (fun j : ℕ => (b + d * j)⁻¹) := by + intro i j hij + have hi : 0 < b + d * i := lt_of_lt_of_le hb (le_add_of_nonneg_right (mul_nonneg hd (Nat.cast_nonneg _))) + have hijR : (i : ℝ) ≤ (j : ℝ) := by exact_mod_cast hij + have hj : b + d * i ≤ b + d * j := + add_le_add le_rfl (mul_le_mul_of_nonneg_left hijR hd) + exact inv_anti₀ hi hj + +theorem reciprocal_progression_variation (b d : ℝ) (hb : 0 < b) (hd : 0 ≤ d) (N : ℕ) : + discreteVariation (fun j => Complex.ofReal ((b + d * (j : ℝ))⁻¹)) N = b⁻¹ := by + simpa using discreteVariation_ofReal_antitone (fun j => (b + d * j)⁻¹) N + (fun j => inv_nonneg.mpr (by positivity)) (reciprocal_progression_antitone b d hb hd) + +theorem reciprocal_progression_norm (b d : ℝ) (hb : 0 < b) (hd : 0 ≤ d) (j : ℕ) : + ‖Complex.ofReal ((b + d * (j : ℝ))⁻¹)‖ ≤ b⁻¹ := by + rw [Complex.norm_real, Real.norm_of_nonneg (inv_nonneg.mpr (by positivity))] + simpa using reciprocal_progression_antitone b d hb hd (Nat.zero_le j) + +/-- Multiplying by 1/n costs only twice the endpoint bound divided by the +left endpoint, with no dependence on the progression length. -/ +theorem reciprocal_progression_product_variation (b d : ℝ) (hb : 0 < b) (hd : 0 ≤ d) + (f : ℕ → ℂ) (N : ℕ) (B V : ℝ) (hBV : B ≤ V) + (hf : ∀ j, ‖f j‖ ≤ B) (hv : discreteVariation f N ≤ V) : + discreteVariation (fun j => Complex.ofReal ((b + d * (j : ℝ))⁻¹) * f j) N ≤ 2 * b⁻¹ * V := by + have hB : 0 ≤ B := (norm_nonneg (f 0)).trans (hf 0) + have ht := discreteVariation_mul (fun j => Complex.ofReal ((b + d * (j : ℝ))⁻¹)) f b⁻¹ B N hB + (reciprocal_progression_norm b d hb hd) hf + rw [reciprocal_progression_variation b d hb hd] at ht + apply ht.trans + nlinarith [mul_le_mul_of_nonneg_left hv (inv_nonneg.mpr hb.le), + mul_le_mul_of_nonneg_right hBV (inv_nonneg.mpr hb.le)] + +theorem discreteVariation_const_mul (c : ℂ) (f : ℕ → ℂ) (N : ℕ) : + discreteVariation (fun j => c * f j) N = ‖c‖ * discreteVariation f N := by + simp only [discreteVariation, ← mul_sub, norm_mul, Finset.mul_sum, mul_add] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleAnalyticPole.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleAnalyticPole.lean new file mode 100644 index 0000000000000000000000000000000000000000..64753faeee7ca1f46765f8e398f7d065485f36f9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleAnalyticPole.lean @@ -0,0 +1,58 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszPoleRectangle + +namespace OAI + +/-! # A single pole under an analytic rectangle integral -/ + +namespace Ostmann + +open Complex Filter Set +open scoped Topology + + theorem analytic_dslope_of_analytic (f : ℂ → ℂ) (z s : ℂ) + (hz : AnalyticAt ℂ f z) (hs : AnalyticAt ℂ f s) : AnalyticAt ℂ (dslope f z) s := by + by_cases he : s = z + · subst s + obtain ⟨p, hp⟩ := hz + exact ⟨p.fslope, hp.has_fpower_series_dslope_fslope⟩ + · have hh : dslope f z =ᶠ[𝓝 s] fun w => (w - z)⁻¹ * (f w - f z) := by + filter_upwards [isOpen_ne.mem_nhds he] with w hw + rw [dslope_of_ne f hw] + rfl + exact (((analyticAt_id.sub analyticAt_const).inv (sub_ne_zero.mpr he)).mul + (hs.sub analyticAt_const)).congr hh.symm + + theorem rectangle_analytic_pole (f : ℂ → ℂ) (a b c d : ℝ) + (ha : a < 0) (hb : 0 < b) (hc : c < 0) (hd : 0 < d) + (hf : ∀ z ∈ uIcc a b ×ℂ uIcc c d, AnalyticAt ℂ f z) : + rectangleBoundaryIntegral (fun z => f z / z) a b c d = + (2 * (Real.pi : ℂ) * I) * f 0 := by + have hz : (0 : ℂ) ∈ uIcc a b ×ℂ uIcc c d := by + simp only [mem_reProdIm, zero_re, zero_im, uIcc_of_le (ha.trans hb).le, + uIcc_of_le (hc.trans hd).le, mem_Icc] + exact ⟨⟨ha.le, hb.le⟩, hc.le, hd.le⟩ + let g := dslope f 0 + have hg : ∀ z ∈ uIcc a b ×ℂ uIcc c d, AnalyticAt ℂ g z := + fun z hz' => analytic_dslope_of_analytic f 0 z (hf 0 hz) (hf z hz') + have hn (z : ℂ) (hz' : z ∈ contourRectangleBoundary a b c d) : z ≠ 0 := + contourBoundary_ne_interior ⟨ha, hb, hc, hd⟩ hz' + have hgI : RectangleIntegrable g a b c d := rectangleIntegrable_of_continuousOn + (fun z hz' => (hg z ⟨hz'.1, hz'.2.1⟩).continuousAt.continuousWithinAt) + have hpI : RectangleIntegrable (fun z => f 0 * (z - 0)⁻¹) a b c d := + (rectangleIntegrable_sub_inv ⟨ha, hb, hc, hd⟩).const_mul _ + have he : rectangleBoundaryIntegral (fun z => f z / z) a b c d = + rectangleBoundaryIntegral (fun z => g z + f 0 * (z - 0)⁻¹) a b c d := by + apply rectangleBoundaryIntegral_congr + intro z hz' + dsimp [g] + rw [dslope_of_ne f (hn z hz')] + simp only [slope, smul_eq_mul, vsub_eq_sub, sub_zero] + ring + rw [he, rectangleBoundaryIntegral_add hgI hpI, rectangleBoundaryIntegral_eq_zero hg, + zero_add, rectangleBoundaryIntegral_const_mul, + rectangleBoundaryIntegral_sub_inv 0 a b c d ha hb hc hd] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleBoundary.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleBoundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..807f94ad5641cefe84f587d76e8c663d8ce30e8f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleBoundary.lean @@ -0,0 +1,98 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RectangleLogIntegrals + +namespace OAI + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped Interval BigOperators + +structure RectangleIntegrable (f : ℂ → ℂ) (a b c d : ℝ) : Prop where + bottom : IntervalIntegrable (fun x : ℝ => f (x + c * I)) volume a b + top : IntervalIntegrable (fun x : ℝ => f (x + d * I)) volume a b + right : IntervalIntegrable (fun y : ℝ => f (b + y * I)) volume c d + left : IntervalIntegrable (fun y : ℝ => f (a + y * I)) volume c d + +theorem RectangleIntegrable.add {f g : ℂ → ℂ} {a b c d : ℝ} + (hf : RectangleIntegrable f a b c d) (hg : RectangleIntegrable g a b c d) : + RectangleIntegrable (fun z => f z + g z) a b c d := + ⟨hf.bottom.add hg.bottom, hf.top.add hg.top, hf.right.add hg.right, hf.left.add hg.left⟩ + +theorem rectangleBoundaryIntegral_add {f g : ℂ → ℂ} {a b c d : ℝ} + (hf : RectangleIntegrable f a b c d) (hg : RectangleIntegrable g a b c d) : + rectangleBoundaryIntegral (fun z => f z + g z) a b c d = + rectangleBoundaryIntegral f a b c d + rectangleBoundaryIntegral g a b c d := by + simp only [rectangleBoundaryIntegral, intervalIntegral.integral_add hf.bottom hg.bottom, + intervalIntegral.integral_add hf.top hg.top, intervalIntegral.integral_add hf.right hg.right, + intervalIntegral.integral_add hf.left hg.left] + ring + +theorem RectangleIntegrable.const_mul {f : ℂ → ℂ} {a b c d : ℝ} + (hf : RectangleIntegrable f a b c d) (v : ℂ) : + RectangleIntegrable (fun z => v * f z) a b c d := + ⟨hf.bottom.const_mul v, hf.top.const_mul v, hf.right.const_mul v, hf.left.const_mul v⟩ + +theorem rectangleBoundaryIntegral_const_mul (f : ℂ → ℂ) (v : ℂ) (a b c d : ℝ) : + rectangleBoundaryIntegral (fun z => v * f z) a b c d = v * rectangleBoundaryIntegral f a b c d := by + simp only [rectangleBoundaryIntegral, intervalIntegral.integral_const_mul] + ring + +theorem RectangleIntegrable.sum {ι : Type*} (S : Finset ι) {f : ι → ℂ → ℂ} {a b c d : ℝ} + (h : ∀ i ∈ S, RectangleIntegrable (f i) a b c d) : + RectangleIntegrable (fun z => ∑ i ∈ S, f i z) a b c d := by + classical + induction S using Finset.induction_on with + | empty => simp only [Finset.sum_empty]; exact ⟨by simp, by simp, by simp, by simp⟩ + | @insert i S hi ih => + simp only [Finset.sum_insert hi] + exact (h i (Finset.mem_insert_self _ _)).add + (ih fun j hj => h j (Finset.mem_insert_of_mem hj)) + +theorem rectangleBoundaryIntegral_sum {ι : Type*} (S : Finset ι) {f : ι → ℂ → ℂ} + {a b c d : ℝ} (h : ∀ i ∈ S, RectangleIntegrable (f i) a b c d) : + rectangleBoundaryIntegral (fun z => ∑ i ∈ S, f i z) a b c d = + ∑ i ∈ S, rectangleBoundaryIntegral (f i) a b c d := by + classical + induction S using Finset.induction_on with + | empty => simp [rectangleBoundaryIntegral] + | @insert i S hi ih => + simp only [Finset.sum_insert hi] + rw [rectangleBoundaryIntegral_add (h i (Finset.mem_insert_self _ _)) + (RectangleIntegrable.sum S (fun j hj => h j (Finset.mem_insert_of_mem hj))), + ih (fun j hj => h j (Finset.mem_insert_of_mem hj))] + +theorem rectangleBoundaryIntegral_translate (f : ℂ → ℂ) (z : ℂ) (a b c d : ℝ) : + rectangleBoundaryIntegral (fun s => f (s - z)) a b c d = + rectangleBoundaryIntegral f (a - z.re) (b - z.re) (c - z.im) (d - z.im) := by + have hh (h : ℝ) (x : ℝ) : (x : ℂ) + h * I - z = + ((x - z.re : ℝ) : ℂ) + (h - z.im) * I := by + apply Complex.ext <;> simp + have hv (h : ℝ) (y : ℝ) : (h : ℂ) + y * I - z = + ((h - z.re : ℝ) : ℂ) + (y - z.im) * I := by + apply Complex.ext <;> simp + have hi (h : ℝ) : (∫ x in a..b, f ((x : ℂ) + h * I - z)) = + ∫ x in a - z.re..b - z.re, f ((x : ℂ) + (h - z.im) * I) := by + rw [← intervalIntegral.integral_comp_sub_right (fun x : ℝ => f ((x : ℂ) + (h - z.im) * I)) z.re] + apply intervalIntegral.integral_congr + intro x _ + exact congrArg f (hh h x) + have hj (h : ℝ) : (∫ y in c..d, f ((h : ℂ) + y * I - z)) = + ∫ y in c - z.im..d - z.im, f (((h - z.re : ℝ) : ℂ) + y * I) := by + rw [← intervalIntegral.integral_comp_sub_right (fun y : ℝ => f (((h - z.re : ℝ) : ℂ) + y * I)) z.im] + apply intervalIntegral.integral_congr + intro y _ + simpa only [Complex.ofReal_sub] using congrArg f (hv h y) + unfold rectangleBoundaryIntegral + rw [hi, hi, hj, hj] + simp only [Complex.ofReal_sub] + +theorem rectangleBoundaryIntegral_sub_inv (z : ℂ) (a b c d : ℝ) + (ha : a < z.re) (hb : z.re < b) (hc : c < z.im) (hd : z.im < d) : + rectangleBoundaryIntegral (fun s => (s - z)⁻¹) a b c d = 2 * (Real.pi : ℂ) * I := by + rw [rectangleBoundaryIntegral_translate] + exact rectangleBoundaryIntegral_reciprocal _ _ _ _ (sub_neg.mpr ha) (sub_pos.mpr hb) + (sub_neg.mpr hc) (sub_pos.mpr hd) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleGeometry.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..22e4fbd9f99bc98cf98ab8ad529b22d12a575e1c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleGeometry.lean @@ -0,0 +1,75 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RectangleBoundary + +namespace OAI + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped Interval + +def contourRectangleBoundary (a b c d : ℝ) : Set ℂ := + {z | z.re ∈ uIcc a b ∧ z.im ∈ uIcc c d ∧ + (z.re = a ∨ z.re = b ∨ z.im = c ∨ z.im = d)} + +theorem contourBoundary_bottom {a b c d x : ℝ} (hx : x ∈ uIcc a b) : + (x : ℂ) + c * I ∈ contourRectangleBoundary a b c d := by + simpa [contourRectangleBoundary] using hx + +theorem contourBoundary_top {a b c d x : ℝ} (hx : x ∈ uIcc a b) : + (x : ℂ) + d * I ∈ contourRectangleBoundary a b c d := by + simpa [contourRectangleBoundary] using hx + +theorem contourBoundary_right {a b c d y : ℝ} (hy : y ∈ uIcc c d) : + (b : ℂ) + y * I ∈ contourRectangleBoundary a b c d := by + simpa [contourRectangleBoundary] using hy + +theorem contourBoundary_left {a b c d y : ℝ} (hy : y ∈ uIcc c d) : + (a : ℂ) + y * I ∈ contourRectangleBoundary a b c d := by + simpa [contourRectangleBoundary] using hy + +theorem rectangleIntegrable_of_continuousOn {f : ℂ → ℂ} {a b c d : ℝ} + (hf : ContinuousOn f (contourRectangleBoundary a b c d)) : + RectangleIntegrable f a b c d := by + refine ⟨?_, ?_, ?_, ?_⟩ + · exact (hf.comp (continuous_ofReal.add continuous_const).continuousOn + (fun _ hx => contourBoundary_bottom hx)).intervalIntegrable + · exact (hf.comp (continuous_ofReal.add continuous_const).continuousOn + (fun _ hx => contourBoundary_top hx)).intervalIntegrable + · exact (hf.comp (continuous_const.add (continuous_ofReal.mul continuous_const)).continuousOn + (fun _ hy => contourBoundary_right hy)).intervalIntegrable + · exact (hf.comp (continuous_const.add (continuous_ofReal.mul continuous_const)).continuousOn + (fun _ hy => contourBoundary_left hy)).intervalIntegrable + +theorem rectangleBoundaryIntegral_congr {f g : ℂ → ℂ} {a b c d : ℝ} + (h : EqOn f g (contourRectangleBoundary a b c d)) : + rectangleBoundaryIntegral f a b c d = rectangleBoundaryIntegral g a b c d := by + unfold rectangleBoundaryIntegral + rw [intervalIntegral.integral_congr (fun x hx => h (contourBoundary_bottom hx)), + intervalIntegral.integral_congr (fun x hx => h (contourBoundary_top hx)), + intervalIntegral.integral_congr (fun y hy => h (contourBoundary_right hy)), + intervalIntegral.integral_congr (fun y hy => h (contourBoundary_left hy))] + +theorem contourBoundary_ne_interior {a b c d : ℝ} {z w : ℂ} + (hz : a < z.re ∧ z.re < b ∧ c < z.im ∧ z.im < d) + (hw : w ∈ contourRectangleBoundary a b c d) : w ≠ z := by + intro he + subst w + rcases hw.2.2 with ha | hb | hc | hd <;> linarith [hz.1, hz.2.1, hz.2.2.1, hz.2.2.2] + +theorem rectangleIntegrable_sub_inv {a b c d : ℝ} {z : ℂ} + (hz : a < z.re ∧ z.re < b ∧ c < z.im ∧ z.im < d) : + RectangleIntegrable (fun w => (w - z)⁻¹) a b c d := by + apply rectangleIntegrable_of_continuousOn + exact (continuous_id.sub continuous_const).continuousOn.inv₀ + (fun w hw => sub_ne_zero.mpr (contourBoundary_ne_interior hz hw)) + +theorem rectangleBoundaryIntegral_eq_zero {f : ℂ → ℂ} {a b c d : ℝ} + (hf : AnalyticOnNhd ℂ f (uIcc a b ×ℂ uIcc c d)) : + rectangleBoundaryIntegral f a b c d = 0 := by + have h := Complex.integral_boundary_rect_eq_zero_of_differentiableOn f + ((a : ℂ) + c * I) ((b : ℂ) + d * I) (by simpa using hf.differentiableOn) + simpa [rectangleBoundaryIntegral, smul_eq_mul] using h + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleLogIntegrals.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleLogIntegrals.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b6ecc80dc1a3c0930195a552e68e435262b822f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleLogIntegrals.lean @@ -0,0 +1,103 @@ +import Mathlib.Analysis.Complex.CauchyIntegral +import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv + +namespace OAI + +/-! # The reciprocal integral around a rectangle + +These explicit logarithmic primitives fix the orientation and the factor +`2 * pi * I` used by the character contour shift. +-/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped Interval + +noncomputable def rectangleBoundaryIntegral (f : ℂ → ℂ) (a b c d : ℝ) : ℂ := + (∫ x in a..b, f (x + c * I)) - (∫ x in a..b, f (x + d * I)) + + I * (∫ y in c..d, f (b + y * I)) - I * (∫ y in c..d, f (a + y * I)) + +theorem reciprocal_horizontal_integral (a b h : ℝ) (hh : h ≠ 0) : + (∫ x in a..b, ((x : ℂ) + h * I)⁻¹) = log (b + h * I) - log (a + h * I) := by + have hne (x : ℝ) : (x : ℂ) + h * I ≠ 0 := by + intro he + have := congrArg Complex.im he + simp only [add_im, ofReal_im, mul_im, I_im, I_re, ofReal_re, mul_one, + mul_zero, add_zero, zero_add, zero_im] at this + exact hh this + have hc : Continuous (fun x : ℝ => ((x : ℂ) + h * I)⁻¹) := + (Complex.continuous_ofReal.add continuous_const).inv₀ hne + apply intervalIntegral.integral_eq_sub_of_hasDerivAt _ (hc.intervalIntegrable _ _) + intro x _ + have hp := (Complex.ofRealCLM.hasDerivAt (x := x)).add_const ((h : ℂ) * I) + have hs : (x : ℂ) + h * I ∈ slitPlane := by + rw [mem_slitPlane_iff] + right + simpa using hh + simpa using hp.clog_real hs + +theorem reciprocal_vertical_integral_right (x c d : ℝ) (hx : 0 < x) : + I * (∫ y in c..d, ((x : ℂ) + y * I)⁻¹) = + log (x + d * I) - log (x + c * I) := by + have hne (y : ℝ) : (x : ℂ) + y * I ≠ 0 := by + intro he + have := congrArg Complex.re he + simp at this + linarith + have hc : Continuous (fun y : ℝ => I * ((x : ℂ) + y * I)⁻¹) := + continuous_const.mul ((continuous_const.add (Complex.continuous_ofReal.mul continuous_const)).inv₀ hne) + rw [← intervalIntegral.integral_const_mul] + apply intervalIntegral.integral_eq_sub_of_hasDerivAt _ (hc.intervalIntegrable _ _) + intro y _ + have hp := ((Complex.ofRealCLM.hasDerivAt (x := y)).mul_const I).const_add (x : ℂ) + have hs : (x : ℂ) + y * I ∈ slitPlane := by + rw [mem_slitPlane_iff] + left + simpa using hx + simpa [div_eq_mul_inv] using hp.clog_real hs + +theorem reciprocal_vertical_integral_left (x c d : ℝ) (hx : x < 0) : + I * (∫ y in c..d, ((x : ℂ) + y * I)⁻¹) = + log (-(x + d * I)) - log (-(x + c * I)) := by + have hne (y : ℝ) : (x : ℂ) + y * I ≠ 0 := by + intro he + have := congrArg Complex.re he + simp at this + linarith + have hc : Continuous (fun y : ℝ => I * ((x : ℂ) + y * I)⁻¹) := + continuous_const.mul ((continuous_const.add (Complex.continuous_ofReal.mul continuous_const)).inv₀ hne) + rw [← intervalIntegral.integral_const_mul] + apply intervalIntegral.integral_eq_sub_of_hasDerivAt _ (hc.intervalIntegrable _ _) + intro y _ + have hp := (((Complex.ofRealCLM.hasDerivAt (x := y)).mul_const I).const_add (x : ℂ)).neg + have hs : -((x : ℂ) + y * I) ∈ slitPlane := by + rw [mem_slitPlane_iff] + left + simpa using neg_pos.mpr hx + simpa only [Pi.neg_apply, Complex.ofRealCLM_apply, Complex.ofReal_one, mul_one, one_mul, neg_div_neg_eq, div_eq_mul_inv, inv_neg, neg_mul_neg] using hp.clog_real hs + +theorem log_neg_of_im_pos {z : ℂ} (hz : 0 < z.im) : + log (-z) = log z - (Real.pi : ℂ) * I := by + apply Complex.ext + · simp [log_re] + · simpa only [log_im, sub_im, add_im, mul_im, ofReal_im, ofReal_re, I_re, I_im, mul_one, mul_zero, add_zero, zero_mul] using arg_neg_eq_arg_sub_pi_of_im_pos hz + +theorem log_neg_of_im_neg {z : ℂ} (hz : z.im < 0) : + log (-z) = log z + (Real.pi : ℂ) * I := by + apply Complex.ext + · simp [log_re] + · simpa only [log_im, sub_im, add_im, mul_im, ofReal_im, ofReal_re, I_re, I_im, mul_one, mul_zero, add_zero, zero_mul] using arg_neg_eq_arg_add_pi_of_im_neg hz + +theorem rectangleBoundaryIntegral_reciprocal (a b c d : ℝ) + (ha : a < 0) (hb : 0 < b) (hc : c < 0) (hd : 0 < d) : + rectangleBoundaryIntegral (fun z => z⁻¹) a b c d = 2 * (Real.pi : ℂ) * I := by + rw [rectangleBoundaryIntegral, reciprocal_horizontal_integral a b c hc.ne, + reciprocal_horizontal_integral a b d hd.ne', reciprocal_vertical_integral_right b c d hb, + reciprocal_vertical_integral_left a c d ha, + log_neg_of_im_pos (by simpa using hd), log_neg_of_im_neg (by simpa using hc)] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleVerticalLimit.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleVerticalLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e710e0e264a32435c1f789c0d6e3be2422136ae --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RectangleVerticalLimit.lean @@ -0,0 +1,31 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.GaussianContourShift + +namespace OAI + +/-! # Passing a zero rectangle identity to its two convergent vertical lines -/ + +namespace Ostmann + +open Complex Filter MeasureTheory +open scoped Topology Interval + + theorem rectangle_vertical_limit (f : ℂ → ℂ) (a b : ℝ) + (ha : Integrable (fun u : ℝ => f ((a : ℂ) + u * I))) + (hb : Integrable (fun u : ℝ => f ((b : ℂ) + u * I))) + (ht : Tendsto (fun u : ℝ => ∫ x in a..b, f ((x : ℂ) + u * I)) atTop (𝓝 0)) + (hd : Tendsto (fun u : ℝ => ∫ x in a..b, f ((x : ℂ) + (-u) * I)) atTop (𝓝 0)) + (hz : ∀ᶠ T : ℝ in atTop, rectangleBoundaryIntegral f a b (-T) T = 0) : + (∫ u : ℝ, f ((a : ℂ) + u * I)) = ∫ u : ℝ, f ((b : ℂ) + u * I) := by + have hr := intervalIntegral_tendsto_integral hb tendsto_neg_atTop_atBot tendsto_id + have hl := intervalIntegral_tendsto_integral ha tendsto_neg_atTop_atBot tendsto_id + have hbd : Tendsto (fun T : ℝ => rectangleBoundaryIntegral f a b (-T) T) atTop + (𝓝 (I * (∫ u : ℝ, f ((b : ℂ) + u * I)) - I * ∫ u : ℝ, f ((a : ℂ) + u * I))) := by + simpa [rectangleBoundaryIntegral] using ((hd.sub ht).add (hr.const_mul I)).sub (hl.const_mul I) + have hzero : Tendsto (fun T : ℝ => rectangleBoundaryIntegral f a b (-T) T) atTop (𝓝 0) := + tendsto_const_nhds.congr' (hz.mono fun _ h => h.symm) + have he := tendsto_nhds_unique hbd hzero + exact (mul_left_cancel₀ I_ne_zero (sub_eq_zero.mp he)).symm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RegularizedZeta.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RegularizedZeta.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f20bc0bc38684f5694893490204a35ef3fab8fa --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RegularizedZeta.lean @@ -0,0 +1,76 @@ +import Mathlib.Analysis.Complex.RemovableSingularity +import OAI.NumberTheory.Ostmann.Characters.CharacterRightHalfPlane +import PrimeNumberTheoremAnd.Mathlib.NumberTheory.LSeries.RiemannZetaAbelContinuation + +namespace OAI + +/-! # Removing the zeta pole and bounding the resulting entire function -/ + +namespace Ostmann + +open Complex Filter Metric Set +open scoped Topology + +noncomputable def regularizedZeta : ℂ → ℂ := + Function.update (fun s : ℂ => (s - 1) * riemannZeta s) 1 1 + +@[simp] theorem regularizedZeta_one : regularizedZeta 1 = 1 := by simp [regularizedZeta] + +theorem regularizedZeta_eq (s : ℂ) (hs : s ≠ 1) : + regularizedZeta s = (s - 1) * riemannZeta s := by + simp [regularizedZeta, hs] + +theorem regularizedZeta_analytic (s : ℂ) : AnalyticAt ℂ regularizedZeta s := by + have hoff (z : ℂ) (hz : z ≠ 1) : AnalyticAt ℂ regularizedZeta z := by + have he : regularizedZeta =ᶠ[𝓝 z] (fun w => (w - 1) * riemannZeta w) := by + filter_upwards [isOpen_ne.mem_nhds hz] with w hw + exact regularizedZeta_eq w hw + exact ((analyticAt_id.sub analyticAt_const).mul (analyticOn_riemannZeta z hz)).congr he.symm + by_cases hs : s = 1 + · subst s + apply Complex.analyticAt_of_differentiable_on_punctured_nhds_of_continuousAt + · filter_upwards [self_mem_nhdsWithin] with z hz + exact (hoff z hz).differentiableAt + · exact continuousAt_update_same.mpr riemannZeta_residue_one + · exact hoff s hs + +theorem regularizedZeta_ne_zero_right (s : ℂ) (hs : 1 ≤ s.re) : regularizedZeta s ≠ 0 := by + by_cases he : s = 1 + · simp [he] + · rw [regularizedZeta_eq s he] + exact mul_ne_zero (sub_ne_zero.mpr he) (riemannZeta_ne_zero_of_one_le_re hs) + +theorem regularizedZeta_logDeriv (s : ℂ) (hs : 1 < s.re) : + logDeriv regularizedZeta s = (s - 1)⁻¹ + logDeriv riemannZeta s := by + have hne : s ≠ 1 := by intro he; simp [he] at hs + have he : regularizedZeta =ᶠ[𝓝 s] ((fun z : ℂ => z - 1) * riemannZeta) := by + filter_upwards [isOpen_ne.mem_nhds hne] with z hz + exact regularizedZeta_eq z hz + rw [(logDeriv_congr_nhds he).self_of_nhds, + logDeriv_mul (f := fun z : ℂ => z - 1) (g := riemannZeta) s + (sub_ne_zero.mpr hne) (riemannZeta_ne_zero_of_one_le_re hs.le) + (differentiableAt_id.sub_const _) (differentiableAt_riemannZeta hne)] + simp [logDeriv_apply] + +theorem regularizedZeta_norm_bound (s : ℂ) (hs : 1 / 4 ≤ s.re) : + ‖regularizedZeta s‖ ≤ ‖s - 1‖ + 1 + 4 * ‖s - 1‖ * ‖s‖ := by + by_cases he : s = 1 + · simp [he] + · have hdomain : s ∈ zetaAbelContinuationDomain := ⟨he, by + change (1 / 10 : ℝ) < s.re + linarith⟩ + have hb := norm_zetaAbelContinuationFormula_le s hdomain + rw [← riemannZeta_eq_zetaAbelContinuationFormula s hdomain] at hb + rw [regularizedZeta_eq s he, norm_mul] + have hn : 0 < ‖s - 1‖ := norm_pos_iff.mpr (sub_ne_zero.mpr he) + have hsr : 0 < s.re := by linarith + have hc : ‖s‖ / s.re ≤ 4 * ‖s‖ := by + apply (div_le_iff₀ hsr).mpr + nlinarith [norm_nonneg s] + have hm := mul_le_mul_of_nonneg_left hb (norm_nonneg (s - 1)) + rw [one_div, norm_inv, mul_add, mul_add, mul_one, mul_inv_cancel₀ hn.ne'] at hm + nlinarith [mul_le_mul_of_nonneg_left hc (norm_nonneg (s - 1))] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RemainderDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RemainderDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd280c2ecb7ed218892bd4932bc784549d2691c8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RemainderDecay.lean @@ -0,0 +1,57 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import OAI.NumberTheory.Ostmann.ZeroDensity.Scales + +namespace OAI + +noncomputable section +open Filter +open scoped Topology +namespace Ostmann.ZeroDensity + +theorem eventually_sqrt_subpower_decay (K D : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ X : ℝ, 1 < X → Real.exp L ≤ Real.log X → + Real.sqrt X*Real.exp (K*L*Real.exp (9*L/10)) ≤ X*Real.exp (-D*L) := by + have hh := eventually_linear_mul_exp_le (a := (9 : ℝ)/10) (b := 1) + (by norm_num) (2*(K+|D|)) + filter_upwards [hh,eventually_ge_atTop (1 : ℝ)] with L hh hL + intro X hX hMX + have hXp : 0 < X := by linarith + have he : 1 ≤ Real.exp (9*L/10) := Real.one_le_exp (by positivity) + have hDL : D*L ≤ |D| *L*Real.exp (9*L/10) := by + calc + D*L ≤ |D| *L := mul_le_mul_of_nonneg_right (le_abs_self D) (by linarith) + _ ≤ _ := by simpa only [mul_one] using + mul_le_mul_of_nonneg_left he (show 0 ≤ |D| *L by positivity) + have heq : (9 : ℝ)/10*L = 9*L/10 := by ring + rw [heq,one_mul] at hh + have hexponent : Real.log X/2+K*L*Real.exp (9*L/10) ≤ Real.log X-D*L := by + nlinarith + calc + Real.sqrt X*Real.exp (K*L*Real.exp (9*L/10)) = + Real.exp (Real.log X/2+K*L*Real.exp (9*L/10)) := by + rw [Real.sqrt_eq_rpow, Real.rpow_def_of_pos hXp, ← Real.exp_add] + congr 1 + ring + _ ≤ Real.exp (Real.log X-D*L) := Real.exp_le_exp.mpr hexponent + _ = X*Real.exp (-D*L) := by + rw [sub_eq_add_neg,Real.exp_add,Real.exp_log hXp] + congr 2 + ring + +theorem eventually_constant_exp_decay {C : ℝ} (hC : 0 < C) (D : ℝ) : + ∀ᶠ L : ℝ in atTop, C*Real.exp (-(D+1)*L) ≤ Real.exp (-D*L) := by + filter_upwards [eventually_ge_atTop (Real.log C)] with L hL + have hCe : C ≤ Real.exp L := by + calc + C = Real.exp (Real.log C) := (Real.exp_log hC).symm + _ ≤ _ := Real.exp_le_exp.mpr hL + calc + _ ≤ Real.exp L*Real.exp (-(D+1)*L) := + mul_le_mul_of_nonneg_right hCe (Real.exp_pos _).le + _ = _ := by rw [← Real.exp_add]; congr 1; ring + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResidueCountingBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResidueCountingBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..e042dabfc8312d8febf3a72c532fc17e4b21aae3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResidueCountingBound.lean @@ -0,0 +1,74 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ResidueRieszFinite + +namespace OAI + +/-! # An elementary bound for residue-class Mangoldt sums -/ + +namespace Ostmann + +open scoped BigOperators + +theorem residue_index_card_bound (q a N : ℕ) (_hq : 0 < q) : + ((Finset.Icc 0 N).filter (fun n : ℕ => (n : ZMod q) = (a : ZMod q))).card ≤ N / q + 1 := by + classical + let S := (Finset.Icc 0 N).filter (fun n : ℕ => (n : ZMod q) = (a : ZMod q)) + have hinj : Set.InjOn (fun n : ℕ => n / q) S := by + intro n hn m hm hnm + have hnmod : n % q = a % q := by + exact (ZMod.natCast_eq_natCast_iff n a q).mp (Finset.mem_filter.mp hn).2 + have hmmod : m % q = a % q := by + exact (ZMod.natCast_eq_natCast_iff m a q).mp (Finset.mem_filter.mp hm).2 + have he := Nat.div_add_mod n q + have he' := Nat.div_add_mod m q + change n / q = m / q at hnm + rw [hnm, hnmod] at he + rw [hmmod] at he' + omega + have hsub : S.image (fun n => n / q) ⊆ Finset.range (N / q + 1) := by + intro k hk + obtain ⟨n, hn, rfl⟩ := Finset.mem_image.mp hk + apply Finset.mem_range.mpr + have hnN := (Finset.mem_Icc.mp (Finset.mem_filter.mp hn).1).2 + exact Nat.lt_succ_of_le (Nat.div_le_div_right hnN) + calc + _ = (S.image (fun n => n / q)).card := (Finset.card_image_of_injOn hinj).symm + _ ≤ (Finset.range (N / q + 1)).card := Finset.card_le_card hsub + _ = _ := Finset.card_range _ + +theorem residuePsi_nonneg (q a : ℕ) (X : ℝ) : 0 ≤ residuePsi q a X := + Finset.sum_nonneg (fun n _ => residueMangoldtWeight_nonneg q a n) + +theorem residuePsi_counting_bound (q a : ℕ) (X : ℝ) (hq : 0 < q) (hX : 1 ≤ X) : + residuePsi q a X ≤ (X / q + 1) * Real.log X := by + classical + let S := (Finset.Icc 0 ⌊X⌋₊).filter (fun n : ℕ => (n : ZMod q) = (a : ZMod q)) + have he : residuePsi q a X = ∑ n ∈ S, ArithmeticFunction.vonMangoldt n := by + simp only [residuePsi, residueMangoldtWeight, S, Finset.sum_filter] + have hlog : 0 ≤ Real.log X := Real.log_nonneg hX + have hb (n : ℕ) (hn : n ∈ S) : ArithmeticFunction.vonMangoldt n ≤ Real.log X := by + by_cases hn0 : n = 0 + · subst n; simpa using hlog + have hnX : (n : ℝ) ≤ X := (Nat.le_floor_iff (by linarith : 0 ≤ X)).mp + (Finset.mem_Icc.mp (Finset.mem_filter.mp hn).1).2 + exact ArithmeticFunction.vonMangoldt_le_log.trans + (Real.log_le_log (by exact_mod_cast Nat.pos_of_ne_zero hn0) hnX) + have hcard : (S.card : ℝ) ≤ X / q + 1 := by + have hc : (S.card : ℝ) ≤ (⌊X⌋₊ / q : ℕ) + 1 := by + exact_mod_cast residue_index_card_bound q a ⌊X⌋₊ hq + have hqR : (0 : ℝ) < q := by exact_mod_cast hq + have hquot : ((⌊X⌋₊ / q : ℕ) : ℝ) ≤ X / q := by + apply (le_div_iff₀ hqR).mpr + have hh : (((⌊X⌋₊ / q) * q : ℕ) : ℝ) ≤ (⌊X⌋₊ : ℝ) := by + exact_mod_cast Nat.div_mul_le_self ⌊X⌋₊ q + simp only [Nat.cast_mul] at hh + exact hh.trans (Nat.floor_le (by linarith)) + linarith + rw [he] + calc + _ ≤ ∑ _n ∈ S, Real.log X := Finset.sum_le_sum hb + _ = (S.card : ℝ) * Real.log X := by simp + _ ≤ (X / q + 1) * Real.log X := mul_le_mul_of_nonneg_right hcard hlog + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePrimePowerRemoval.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePrimePowerRemoval.lean new file mode 100644 index 0000000000000000000000000000000000000000..e58402bfabf5dee59bd766c63c82845b598d154f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePrimePowerRemoval.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ResidueRieszFinite +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothPrimePowerRemoval + +namespace OAI + +/-! # Removing higher prime powers from sharp residue sums -/ + +namespace Ostmann + +open scoped BigOperators + +theorem residue_mangoldt_prime_difference (q a n : ℕ) : + |residueMangoldtWeight q a n - primeProgressionLog q a n| ≤ + if ¬n.Prime then ArithmeticFunction.vonMangoldt n else 0 := by + have he : ((n : ZMod q) = (a : ZMod q)) ↔ Nat.ModEq q n a := by + rw [ZMod.natCast_eq_natCast_iff] + by_cases hp : n.Prime + · rw [residueMangoldtWeight, primeProgressionLog, ArithmeticFunction.vonMangoldt_apply_prime hp] + by_cases hn : Nat.ModEq q n a + · simp [hp, hn, he.mpr hn] + · simp [hp, hn, mt he.mp hn] + · rw [residueMangoldtWeight, primeProgressionLog] + simp only [hp, false_and, ↓reduceIte, sub_zero, not_false_eq_true] + split_ifs <;> simp [abs_of_nonneg ArithmeticFunction.vonMangoldt_nonneg, + ArithmeticFunction.vonMangoldt_nonneg] + +theorem residuePsi_prime_error (q a : ℕ) (X : ℝ) (hX : 1 ≤ X) : + |residuePsi q a X - primeProgressionTheta q a X| ≤ + 2 * Real.sqrt X * Real.log X := by + have hzero : (if ¬Nat.Prime 0 then ArithmeticFunction.vonMangoldt 0 else 0) = (0 : ℝ) := by simp + calc + _ = |∑ n ∈ Finset.Icc 0 ⌊X⌋₊, + (residueMangoldtWeight q a n - primeProgressionLog q a n)| := by + rw [Finset.sum_sub_distrib]; rfl + _ ≤ ∑ n ∈ Finset.Icc 0 ⌊X⌋₊, + |residueMangoldtWeight q a n - primeProgressionLog q a n| := + Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ n ∈ Finset.Icc 0 ⌊X⌋₊, + if ¬n.Prime then ArithmeticFunction.vonMangoldt n else 0 := + Finset.sum_le_sum (fun n _ => residue_mangoldt_prime_difference q a n) + _ = ∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter (fun n => ¬n.Prime), + ArithmeticFunction.vonMangoldt n := by + rw [← Finset.add_sum_Ioc_eq_sum_Icc (Nat.zero_le _), hzero, zero_add, + Finset.sum_filter] + _ = Chebyshev.psi X - Chebyshev.theta X := nonprime_mangoldt_sum X + _ ≤ _ := (le_abs_self _).trans (Chebyshev.abs_psi_sub_theta_le_sqrt_mul_log hX) + +theorem primeProgressionLog_bounds (q a n : ℕ) : + 0 ≤ primeProgressionLog q a n ∧ + primeProgressionLog q a n ≤ residueMangoldtWeight q a n := by + by_cases hp : n.Prime ∧ Nat.ModEq q n a + · have he : (n : ZMod q) = (a : ZMod q) := + (ZMod.natCast_eq_natCast_iff n a q).mpr hp.2 + rw [primeProgressionLog, ite_eq_left hp, residueMangoldtWeight, ite_eq_left he, + ArithmeticFunction.vonMangoldt_apply_prime hp.1] + exact ⟨Real.log_nonneg (by exact_mod_cast hp.1.one_le), le_rfl⟩ + · rw [primeProgressionLog, ite_eq_right hp] + exact ⟨le_rfl, residueMangoldtWeight_nonneg q a n⟩ + +theorem primeProgressionTheta_bounds (q a : ℕ) (X : ℝ) : + 0 ≤ primeProgressionTheta q a X ∧ primeProgressionTheta q a X ≤ residuePsi q a X := by + constructor + · exact Finset.sum_nonneg (fun n _ => (primeProgressionLog_bounds q a n).1) + · exact Finset.sum_le_sum (fun n _ => (primeProgressionLog_bounds q a n).2) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePsiEstimate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePsiEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..1bd409b8ea506c7ddd1e7ef96152ba4d1fb0cec1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePsiEstimate.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ResiduePsiSmallModulus +import OAI.NumberTheory.Ostmann.ZeroDensity.ResiduePsiLargeModulus + +namespace OAI + +/-! # Uniform sharp Mangoldt estimate with the canonical Page term -/ + +namespace Ostmann + +open Filter + +theorem residuePsi_eventual_bound : ∃ c C : ℝ, 0 < c ∧ 0 ≤ C ∧ + ∀ᶠ X : ℝ in atTop, ∀ q : ℕ, 1 ≤ q → ∀ a : ℕ, a.Coprime q → + |residuePsi q a X - thetaMainTerm q.totient + (pageCoefficient (actualLocalZero q) a) (pageBeta (actualLocalZero q)) X| ≤ + C * X * Real.exp (-c * Real.sqrt (Real.log X)) := by + obtain ⟨d, hd, hsmall⟩ := residuePsi_small_modulus_bound + obtain ⟨D, hD, hlarge⟩ := residuePsi_large_modulus_bound + let c := min d (1 / 4) + refine ⟨c, 35 + D, lt_min hd (by norm_num), by positivity, ?_⟩ + filter_upwards [hsmall, hlarge, eventually_ge_atTop (1 : ℝ)] with X hs hl hX + intro q hq a ha + have hc : 0 ≤ Real.sqrt (Real.log X) := Real.sqrt_nonneg _ + have hexp1 : Real.exp (-d * Real.sqrt (Real.log X)) ≤ + Real.exp (-c * Real.sqrt (Real.log X)) := + Real.exp_le_exp.mpr (by dsimp [c]; nlinarith [min_le_left d (1 / 4)]) + have hexp2 : Real.exp (-(1 / 4 : ℝ) * Real.sqrt (Real.log X)) ≤ + Real.exp (-c * Real.sqrt (Real.log X)) := + Real.exp_le_exp.mpr (by dsimp [c]; nlinarith [min_le_right d (1 / 4)]) + by_cases hqX : (q : ℝ) ≤ Real.exp (Real.sqrt (Real.log X) / 2) + · exact (hs q hq hqX a ha).trans (by + have hm := mul_le_mul_of_nonneg_left hexp1 (show 0 ≤ 35 * X by positivity) + exact hm.trans (mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_right (by linarith) (by linarith : 0 ≤ X)) + (Real.exp_nonneg _))) + · exact (hl q (by omega) (le_of_not_ge hqX) a).trans (by + have hm := mul_le_mul_of_nonneg_left hexp2 (show 0 ≤ D * X by positivity) + exact hm.trans (mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_right (by linarith) (by linarith : 0 ≤ X)) + (Real.exp_nonneg _))) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePsiLargeModulus.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePsiLargeModulus.lean new file mode 100644 index 0000000000000000000000000000000000000000..6780024fb8c746d7010d9cd31e2fc46fa8e1bcd1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePsiLargeModulus.lean @@ -0,0 +1,91 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ResidueCountingBound +import OAI.NumberTheory.Ostmann.ZeroDensity.CanonicalThetaSize +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszExponentialParameters + +namespace OAI + +/-! # Elementary control of the complementary large-modulus range -/ + +namespace Ostmann + +open Filter + +theorem residuePsi_large_modulus_bound_log : ∃ C : ℝ, 0 < C ∧ + ∀ᶠ y : ℝ in atTop, ∀ q : ℕ, 0 < q → Real.exp (y / 2) ≤ (q : ℝ) → + ∀ a : ℕ, + |residuePsi q a (Real.exp (y ^ 2)) - thetaMainTerm q.totient + (pageCoefficient (actualLocalZero q) a) (pageBeta (actualLocalZero q)) + (Real.exp (y ^ 2))| ≤ + C * Real.exp (y ^ 2) * Real.exp (-(1 / 4 : ℝ) * y) := by + obtain ⟨D, hD, hmain⟩ := canonical_theta_sqrt_bound + refine ⟨D + 2, by positivity, ?_⟩ + filter_upwards [riesz_polynomial_absorption 1 (1 / 4) (by norm_num), + eventually_ge_atTop (1 : ℝ)] with y hp hy + intro q hq hqy a + let X := Real.exp (y ^ 2) + have hX : 1 ≤ X := Real.one_le_exp (sq_nonneg y) + have hXp : 0 < X := Real.exp_pos _ + have hpoly : y ^ 2 ≤ Real.exp (y / 4) := by + rw [show (1 / 4 : ℝ) * y = y / 4 by ring] at hp + linarith + have hquot : y ^ 2 / q ≤ Real.exp (-y / 4) := by + calc + _ ≤ Real.exp (y / 4) / Real.exp (y / 2) := + div_le_div₀ (Real.exp_nonneg _) hpoly (Real.exp_pos _) hqy + _ = _ := by rw [← Real.exp_sub]; congr 1; ring + have hpoly' : y ^ 2 ≤ X * Real.exp (-y / 4) := by + calc + _ ≤ Real.exp (y / 4) := hpoly + _ ≤ Real.exp (y ^ 2 - y / 4) := Real.exp_le_exp.mpr (by nlinarith) + _ = _ := by + dsimp [X] + rw [Real.exp_sub, show -y / 4 = -(y / 4) by ring, Real.exp_neg] + rfl + have hcount := residuePsi_counting_bound q a X hq hX + have hlog : Real.log X = y ^ 2 := Real.log_exp _ + rw [hlog] at hcount + have hcount' : residuePsi q a X ≤ 2 * X * Real.exp (-y / 4) := by + have hm := mul_le_mul_of_nonneg_left hquot hXp.le + have hid : (X / (q : ℝ) + 1) * y ^ 2 = X * (y ^ 2 / q) + y ^ 2 := by ring + rw [hid] at hcount + linarith + have hsqrt : Real.exp (y / 4) ≤ Real.sqrt q := by + have hh := Real.sqrt_le_sqrt hqy + rw [← Real.exp_half] at hh + convert hh using 1; congr 1; ring + have hm := hmain q a X hq hX + have hmain' : |thetaMainTerm q.totient (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) X| ≤ D * X * Real.exp (-y / 4) := by + calc + _ ≤ D * X / Real.sqrt q := hm + _ ≤ D * X / Real.exp (y / 4) := + div_le_div_of_nonneg_left (by positivity) (Real.exp_pos _) hsqrt + _ = _ := by rw [div_eq_mul_inv, ← Real.exp_neg]; congr 2; ring + have htri := abs_sub (residuePsi q a X) + (thetaMainTerm q.totient (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) X) + rw [abs_of_nonneg (residuePsi_nonneg q a X)] at htri + have he : -(1 / 4 : ℝ) * y = -y / 4 := by ring + rw [he] + change |residuePsi q a X - thetaMainTerm q.totient + (pageCoefficient (actualLocalZero q) a) (pageBeta (actualLocalZero q)) X| ≤ _ + nlinarith + +theorem residuePsi_large_modulus_bound : ∃ C : ℝ, 0 < C ∧ + ∀ᶠ X : ℝ in atTop, ∀ q : ℕ, 0 < q → + Real.exp (Real.sqrt (Real.log X) / 2) ≤ (q : ℝ) → ∀ a : ℕ, + |residuePsi q a X - thetaMainTerm q.totient + (pageCoefficient (actualLocalZero q) a) (pageBeta (actualLocalZero q)) X| ≤ + C * X * Real.exp (-(1 / 4 : ℝ) * Real.sqrt (Real.log X)) := by + obtain ⟨C, hC, hbound⟩ := residuePsi_large_modulus_bound_log + refine ⟨C, hC, ?_⟩ + have ht := Real.tendsto_sqrt_atTop.comp Real.tendsto_log_atTop + filter_upwards [ht.eventually hbound, eventually_ge_atTop (1 : ℝ)] with X hX hX1 + have he : Real.exp ((Real.sqrt (Real.log X)) ^ 2) = X := by + rw [Real.sq_sqrt (Real.log_nonneg hX1), Real.exp_log (by linarith)] + dsimp only [Function.comp_apply] at hX + simpa only [he] using hX + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePsiSmallModulus.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePsiSmallModulus.lean new file mode 100644 index 0000000000000000000000000000000000000000..1015883e1f3e77080a6a565fef2ff28c38844113 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResiduePsiSmallModulus.lean @@ -0,0 +1,108 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ResidueRieszFinite +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszNearby + +namespace OAI + +/-! # Sharp residue-class Mangoldt sums for the small-modulus range -/ + +namespace Ostmann + +open Filter + +theorem residuePsi_small_modulus_bound : ∃ c : ℝ, 0 < c ∧ + ∀ᶠ X : ℝ in atTop, ∀ q : ℕ, 1 ≤ q → + (q : ℝ) ≤ Real.exp (Real.sqrt (Real.log X) / 2) → + ∀ a : ℕ, a.Coprime q → + |residuePsi q a X - thetaMainTerm q.totient + (pageCoefficient (actualLocalZero q) a) (pageBeta (actualLocalZero q)) X| ≤ + 35 * X * Real.exp (-c * Real.sqrt (Real.log X)) := by + obtain ⟨d, hd, hdecay⟩ := canonical_riesz_residue_decay + obtain ⟨X0, hX0⟩ := eventually_atTop.mp hdecay + refine ⟨d / 4, by positivity, ?_⟩ + have ht := Real.tendsto_sqrt_atTop.comp Real.tendsto_log_atTop + filter_upwards [eventually_ge_atTop (max 4 (2 * X0)), + ht.eventually (eventually_ge_atTop ((4 / d) * Real.log 2))] with X hXL hscale + intro q hq hqX a ha + let : NeZero q := ⟨by omega⟩ + have hX : 4 ≤ X := (le_max_left _ _).trans hXL + have hXX0 : 2 * X0 ≤ X := (le_max_right _ _).trans hXL + have hXp : 0 < X := by linarith + dsimp only [Function.comp_apply] at hscale + let y := Real.sqrt (Real.log X) + let h := X * Real.exp (-(d / 4) * y) + let E := 16 * X ^ 2 * Real.exp (-(d / 2) * y) + let N := ⌈2 * X⌉₊ + let w := residueMangoldtWeight q a + let F := integratedThetaMain q.totient (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) + let m := thetaMainTerm q.totient (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) X + have hN : 2 * X ≤ (N : ℝ) := Nat.le_ceil _ + have hh : 0 < h := by dsimp [h]; positivity + have hlog : Real.log 2 ≤ (d / 4) * y := by + have hm := mul_le_mul_of_nonneg_left hscale (show 0 ≤ d / 4 by positivity) + have he : (d / 4) * ((4 / d) * Real.log 2) = Real.log 2 := by field_simp + rw [he] at hm + exact hm + have hexphalf : Real.exp (-(d / 4) * y) ≤ 1 / 2 := by + calc + _ ≤ Real.exp (-Real.log 2) := Real.exp_le_exp.mpr (by linarith) + _ = 1 / 2 := by rw [Real.exp_neg, Real.exp_log (by norm_num)]; norm_num + have hhalf : h ≤ X / 2 := by + have hm := mul_le_mul_of_nonneg_left hexphalf hXp.le + dsimp [h] + linarith + have herr (Y : ℝ) (hlo : X / 2 ≤ Y) (hhi : Y ≤ 2 * X) : + |finiteRieszSum (Finset.range (N + 1)) w Y - F Y| ≤ E := by + have hYp : 0 < Y := by linarith + have hroot := sqrt_log_nearby_lower X Y hX hlo + have hqY : (q : ℝ) ≤ Real.exp (Real.sqrt (Real.log Y)) := + hqX.trans (Real.exp_le_exp.mpr hroot) + have hraw := hX0 Y (by linarith) q hq hqY a ha + have he : Real.exp (-d * Real.sqrt (Real.log Y)) ≤ + Real.exp (-(d / 2) * y) := Real.exp_le_exp.mpr (by dsimp [y]; nlinarith) + change |finiteRieszSum (Finset.range (N + 1)) (residueMangoldtWeight q a) Y - + integratedThetaMain q.totient (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) Y| ≤ E + rw [residueRieszMean_finite_error q a N Y hYp (hhi.trans hN)] + calc + _ ≤ Y * (4 * Y * Real.exp (-d * Real.sqrt (Real.log Y))) := + mul_le_mul_of_nonneg_left hraw hYp.le + _ = 4 * Y ^ 2 * Real.exp (-d * Real.sqrt (Real.log Y)) := by ring + _ ≤ 16 * X ^ 2 * Real.exp (-(d / 2) * y) := by + apply mul_le_mul _ he (Real.exp_nonneg _) (by positivity) + nlinarith + have hφ : (1 : ℝ) ≤ q.totient := by + exact_mod_cast Nat.totient_pos.mpr (show 0 < q by omega) + have hmain := integratedThetaMain_remainder_pair (q.totient : ℝ) + (pageCoefficient (actualLocalZero q) a) (pageBeta (actualLocalZero q)) X h + hφ (pageCoefficient_abs_le_one _ _) (pageBeta_pos _) (pageBeta_le_one _) hh (by linarith) + have hrec := finiteRieszSum_smooth_recovery (Finset.range (N + 1)) w F X h m E hh + (fun n _ => residueMangoldtWeight_nonneg q a n) + (herr X (by linarith) (by linarith)) + (herr (X + h) (by linarith) (by linarith)) + (herr (X - h) (by linarith) (by linarith)) hmain.1 hmain.2 + change |(∑ n ∈ (Finset.range (N + 1)).filter (fun n : ℕ => (n : ℝ) ≤ X), + residueMangoldtWeight q a n) - m| ≤ _ at hrec + rw [residue_finite_count q a N X hXp.le (by linarith)] at hrec + have hexp2 : Real.exp (-(d / 2) * y) = (Real.exp (-(d / 4) * y)) ^ 2 := by + rw [← Real.exp_nat_mul] + congr 1 + norm_num + ring + have hE : E = 16 * h ^ 2 := by + dsimp [E, h] + rw [hexp2] + ring + have hratio : 2 * E / h = 32 * h := by + rw [hE] + field_simp + ring + have hfinal : |residuePsi q a X - m| ≤ 35 * h := by + rw [hratio] at hrec + linarith + simpa only [m, h, y, mul_assoc] using hfinal + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResidueRieszFinite.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResidueRieszFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..ac29a27b04ea0b5b5be0f05690608f5c298251e6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ResidueRieszFinite.lean @@ -0,0 +1,117 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszCanonicalResidueMain +import OAI.NumberTheory.Ostmann.ZeroDensity.IntegratedThetaMain +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalRieszFinite + +namespace OAI + +/-! # Exact real finite sums underlying the residue-class contour -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +noncomputable def residueMangoldtWeight (q a n : ℕ) : ℝ := + if (n : ZMod q) = (a : ZMod q) then ArithmeticFunction.vonMangoldt n else 0 + +noncomputable def residuePsi (q a : ℕ) (X : ℝ) : ℝ := + ∑ n ∈ Finset.Icc 0 ⌊X⌋₊, residueMangoldtWeight q a n + +theorem residueMangoldtWeight_nonneg (q a n : ℕ) : 0 ≤ residueMangoldtWeight q a n := by + unfold residueMangoldtWeight + split_ifs <;> positivity + +@[simp] theorem residueMangoldtWeight_zero (q a : ℕ) : residueMangoldtWeight q a 0 = 0 := by + simp [residueMangoldtWeight] + +theorem rieszResidueMean_eq_tsum (q a : ℕ) (X : ℝ) (hX : 0 < X) : + rieszResidueMean q (a : ZMod q) X = + ∑' n : ℕ, (residueMangoldtWeight q a n : ℂ) * rieszPrimeTest (n / X) := by + have hs (n : ℕ) (hn : n ∉ Finset.Ioc 0 ⌊X⌋₊) : + (residueMangoldtWeight q a n : ℂ) * rieszPrimeTest (n / X) = 0 := by + by_cases hn0 : n = 0 + · subst n; simp + · have hlarge : X < n := Nat.lt_of_floor_lt (by simp only [Finset.mem_Ioc] at hn; omega) + have hdiv : 1 < (n : ℝ) / X := (one_lt_div hX).mpr hlarge + simp only [rieszPrimeTest, max_eq_right (by linarith : 1 - (n : ℝ) / X ≤ 0), + Complex.ofReal_zero, mul_zero] + rw [tsum_eq_sum hs] + unfold rieszResidueMean rieszTwistMean + apply Finset.sum_congr rfl + intro n _ + by_cases hn : (n : ZMod q) = (a : ZMod q) + · simp only [residueMangoldtWeight, hn, ite_true, mul_one] + · simp only [residueMangoldtWeight, hn, ite_false, mul_zero, Complex.ofReal_zero, zero_mul] + +theorem rieszResidueMean_finite (q a N : ℕ) (X : ℝ) (hX : 0 < X) (hXN : X ≤ N) : + (X : ℂ) * rieszResidueMean q (a : ZMod q) X = + (finiteRieszSum (Finset.range (N + 1)) (residueMangoldtWeight q a) X : ℝ) := by + have hs (n : ℕ) (hn : n ∉ Finset.range (N + 1)) : + (residueMangoldtWeight q a n : ℂ) * rieszPrimeTest (n / X) = 0 := by + have hNn : N < n := by simpa using hn + have hxn : X < n := hXN.trans_lt (by exact_mod_cast hNn) + rw [rieszPrimeTest_scale X n hX, max_eq_right (by linarith : X - (n : ℝ) ≤ 0)] + simp + rw [rieszResidueMean_eq_tsum q a X hX, tsum_eq_sum hs, Finset.mul_sum] + unfold finiteRieszSum + push_cast + apply Finset.sum_congr rfl + intro n _ + rw [rieszPrimeTest_scale X n hX] + push_cast + field_simp [show (X : ℂ) ≠ 0 by exact_mod_cast hX.ne'] + +theorem rieszContourWeight_real (X β : ℝ) (hX : 0 < X) : + rieszContourWeight X (β : ℂ) = (X ^ β / (β * (β + 1)) : ℝ) := by + rw [rieszContourWeight, ← Complex.ofReal_cpow hX.le] + unfold rieszMellinKernel + push_cast + ring + +theorem riesz_residue_main_scale (φ χ β X : ℝ) (hX : 0 < X) : + (X : ℂ) * ((φ : ℂ)⁻¹ * ((X / 2 : ℝ) - (χ : ℂ) * rieszContourWeight X (β : ℂ))) = + (integratedThetaMain φ χ β X : ℝ) := by + rw [rieszContourWeight_real X β hX] + unfold integratedThetaMain + rw [Real.rpow_add hX, Real.rpow_one] + push_cast + ring + +theorem residueRieszMean_finite_error (q a N : ℕ) (X : ℝ) (hX : 0 < X) (hXN : X ≤ N) : + |finiteRieszSum (Finset.range (N + 1)) (residueMangoldtWeight q a) X - + integratedThetaMain q.totient (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) X| = + X * ‖rieszResidueMean q (a : ZMod q) X - (q.totient : ℂ)⁻¹ * + ((X / 2 : ℝ) - (pageCoefficient (actualLocalZero q) a : ℂ) * + rieszContourWeight X (pageBeta (actualLocalZero q) : ℂ))‖ := by + have he : ((finiteRieszSum (Finset.range (N + 1)) (residueMangoldtWeight q a) X - + integratedThetaMain q.totient (pageCoefficient (actualLocalZero q) a) + (pageBeta (actualLocalZero q)) X : ℝ) : ℂ) = + (X : ℂ) * (rieszResidueMean q (a : ZMod q) X - (q.totient : ℂ)⁻¹ * + ((X / 2 : ℝ) - (pageCoefficient (actualLocalZero q) a : ℂ) * + rieszContourWeight X (pageBeta (actualLocalZero q) : ℂ))) := by + have hs := riesz_residue_main_scale (q.totient : ℝ) + (pageCoefficient (actualLocalZero q) a) (pageBeta (actualLocalZero q)) X hX + simp only [Complex.ofReal_natCast] at hs + rw [mul_sub, rieszResidueMean_finite q a N X hX hXN, hs, Complex.ofReal_sub] + rw [← Real.norm_eq_abs, ← Complex.norm_real, he, norm_mul, Complex.norm_real, + Real.norm_eq_abs, abs_of_pos hX] + +theorem residue_finite_count (q a N : ℕ) (X : ℝ) (hX : 0 ≤ X) (hXN : X ≤ N) : + (∑ n ∈ (Finset.range (N + 1)).filter (fun n : ℕ => (n : ℝ) ≤ X), residueMangoldtWeight q a n) = + residuePsi q a X := by + unfold residuePsi + apply Finset.sum_congr _ (fun _ _ => rfl) + ext n + simp only [Finset.mem_filter, Finset.mem_range, Finset.mem_Icc] + constructor + · intro hn + exact ⟨Nat.zero_le _, (Nat.le_floor_iff hX).mpr hn.2⟩ + · intro hn + have hnx := (Nat.le_floor_iff hX).mp hn.2 + have hnN : n ≤ N := by exact_mod_cast (hnx.trans hXN) + exact ⟨by omega, hnx⟩ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RestrictedGiantDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RestrictedGiantDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..928d3548574da8621ce6bf2e19e795f1f154d30d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RestrictedGiantDensity.lean @@ -0,0 +1,135 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.GiantDensitySum + +namespace OAI + +/-! # Bounded densities on the common real giant rectangle -/ + +namespace Ostmann +open MeasureTheory +open scoped Classical BigOperators + +noncomputable def restrictedPrimeGiantDensity (P : PublishedProgressionInput) (Q q a : ℕ) + (u v : ℝ) : ℝ → ℂ := + (Set.Ioc u v).indicator (fun x => (selectedPrimeLogDensity P Q q a x : ℂ)) + +theorem measurable_restrictedPrimeGiantDensity (P : PublishedProgressionInput) (Q q a : ℕ) + (u v : ℝ) : Measurable (restrictedPrimeGiantDensity P Q q a u v) := + (Complex.continuous_ofReal.measurable.comp (measurable_selectedPrimeLogDensity P Q q a)).indicator + measurableSet_Ioc + +theorem restrictedPrimeGiantDensity_norm (P : PublishedProgressionInput) (Q q a : ℕ) + (hq : 0 < q) (u v : ℝ) (hu : 1 ≤ u) (x : ℝ) : + ‖restrictedPrimeGiantDensity P Q q a u v x‖ ≤ 2 := by + by_cases hx : x ∈ Set.Ioc u v + · simp only [restrictedPrimeGiantDensity, Set.indicator_of_mem hx, + Complex.norm_real, Real.norm_eq_abs] + exact primeLogDensity_abs_le_two _ _ _ + (by exact_mod_cast Nat.totient_pos.mpr hq) (pageCoefficient_abs_le_one _ _) + (pageBeta_le_one _) (hu.trans hx.1.le) + · simp only [restrictedPrimeGiantDensity, Set.indicator_of_notMem hx, norm_zero] + norm_num + +theorem primeGiantMeasure_restrict_integral (P : PublishedProgressionInput) (Q q a : ℕ) + (u v : ℝ) (hu : 0 ≤ u) (f : ℝ → ℂ) : + (∫ x, f x ∂primeGiantMeasure P Q q a u v) = + ∫ x in Set.Ioc u v, f x * restrictedPrimeGiantDensity P Q q a u v x := by + rw [primeGiantMeasure_integral P Q q a u v hu] + apply setIntegral_congr_fun measurableSet_Ioc + intro x hx + simp only [restrictedPrimeGiantDensity, Set.indicator_of_mem hx] + +theorem primeGiantMeasure_pair_integral (P : PublishedProgressionInput) (Q q a b : ℕ) + (u v r s : ℝ) (hu : 0 ≤ u) (hr : 0 ≤ r) (H : ℝ → ℝ → ℂ) : + (∫ x, ∫ y, H x y ∂primeGiantMeasure P Q q b r s ∂primeGiantMeasure P Q q a u v) = + ∫ x in Set.Ioc u v, ∫ y in Set.Ioc r s, + H x y * restrictedPrimeGiantDensity P Q q a u v x * + restrictedPrimeGiantDensity P Q q b r s y := by + rw [primeGiantMeasure_restrict_integral P Q q a u v hu] + apply setIntegral_congr_fun measurableSet_Ioc + intro x _ + dsimp only + rw [primeGiantMeasure_restrict_integral P Q q b r s hr, ← integral_mul_const] + apply setIntegral_congr_fun measurableSet_Ioc + intro y _ + ring + +theorem primeGiantMeasure_residue_integral (P : PublishedProgressionInput) (Q q : ℕ) + (hq : 0 < q) (A B : Finset ℕ) (u v r s : ℝ) (hu : 1 ≤ u) (hr : 1 ≤ r) + (H : ℝ → ℝ → ℂ) (hH : Measurable (Function.uncurry H)) (K : ℝ) + (hK : ∀ x y, ‖H x y‖ ≤ K) (c : ℕ → ℕ → ℂ) : + (∑ a ∈ A, ∑ b ∈ B, + ∫ x, ∫ y, c a b * H x y ∂primeGiantMeasure P Q q b r s ∂primeGiantMeasure P Q q a u v) = + ∫ x in Set.Ioc u v, ∫ y in Set.Ioc r s, H x y * + (∑ a ∈ A, ∑ b ∈ B, c a b * restrictedPrimeGiantDensity P Q q a u v x * + restrictedPrimeGiantDensity P Q q b r s y) := by + simp_rw [primeGiantMeasure_pair_integral P Q q _ _ u v r s (by linarith) (by linarith)] + exact bounded_density_pair_sum A B (volume.restrict (Set.Ioc u v)) (volume.restrict (Set.Ioc r s)) + H hH K hK (fun a => restrictedPrimeGiantDensity P Q q a u v) + (fun b => restrictedPrimeGiantDensity P Q q b r s) + (fun a _ => measurable_restrictedPrimeGiantDensity P Q q a u v) + (fun b _ => measurable_restrictedPrimeGiantDensity P Q q b r s) + 2 2 (by norm_num) (by norm_num) + (fun a _ x => restrictedPrimeGiantDensity_norm P Q q a hq u v hu x) + (fun b _ x => restrictedPrimeGiantDensity_norm P Q q b hq r s hr x) c + +noncomputable def restrictedIntegerGiantDensity (q : ℕ) (J u v : ℝ) : ℝ → ℂ := + (Set.Ioc u v).indicator (fun x => (integerLogDensity q J x : ℂ)) + +theorem measurable_restrictedIntegerGiantDensity (q : ℕ) (J u v : ℝ) : + Measurable (restrictedIntegerGiantDensity q J u v) := + (Complex.continuous_ofReal.comp (continuous_integerLogDensity q J)).measurable.indicator + measurableSet_Ioc + +theorem restrictedIntegerGiantDensity_norm (q : ℕ) (hq : 0 < q) (J u v x : ℝ) : + ‖restrictedIntegerGiantDensity q J u v x‖ ≤ Real.exp (v - J) := by + by_cases hx : x ∈ Set.Ioc u v + · simp only [restrictedIntegerGiantDensity, Set.indicator_of_mem hx, + Complex.norm_real, Real.norm_eq_abs] + exact integerLogDensity_abs_le q hq J hx.2 + · simp only [restrictedIntegerGiantDensity, Set.indicator_of_notMem hx, norm_zero] + exact (Real.exp_pos _).le + +theorem integerGiantMeasure_restrict_integral (q : ℕ) (J u v : ℝ) (f : ℝ → ℂ) : + (∫ x, f x ∂integerGiantMeasure q J u v) = + ∫ x in Set.Ioc u v, f x * restrictedIntegerGiantDensity q J u v x := by + rw [integerGiantMeasure_integral q J u v] + apply setIntegral_congr_fun measurableSet_Ioc + intro x hx + simp only [restrictedIntegerGiantDensity, Set.indicator_of_mem hx] + +theorem mixedGiantMeasure_pair_integral (P : PublishedProgressionInput) (Q q b : ℕ) + (u v r s J : ℝ) (hr : 0 ≤ r) (H : ℝ → ℝ → ℂ) : + (∫ x, ∫ y, H x y ∂primeGiantMeasure P Q q b r s ∂integerGiantMeasure q J u v) = + ∫ x in Set.Ioc u v, ∫ y in Set.Ioc r s, + H x y * restrictedIntegerGiantDensity q J u v x * restrictedPrimeGiantDensity P Q q b r s y := by + rw [integerGiantMeasure_restrict_integral q J u v] + apply setIntegral_congr_fun measurableSet_Ioc + intro x _ + dsimp only + rw [primeGiantMeasure_restrict_integral P Q q b r s hr, ← integral_mul_const] + apply setIntegral_congr_fun measurableSet_Ioc + intro y _ + ring + +theorem mixedGiantMeasure_residue_integral (P : PublishedProgressionInput) (Q q : ℕ) + (hq : 0 < q) (A B : Finset ℕ) (u v r s J : ℝ) (hr : 1 ≤ r) + (H : ℝ → ℝ → ℂ) (hH : Measurable (Function.uncurry H)) (K : ℝ) + (hK : ∀ x y, ‖H x y‖ ≤ K) (c : ℕ → ℕ → ℂ) : + (∑ a ∈ A, ∑ b ∈ B, + ∫ x, ∫ y, c a b * H x y ∂primeGiantMeasure P Q q b r s ∂integerGiantMeasure q J u v) = + ∫ x in Set.Ioc u v, ∫ y in Set.Ioc r s, H x y * + (∑ a ∈ A, ∑ b ∈ B, c a b * restrictedIntegerGiantDensity q J u v x * + restrictedPrimeGiantDensity P Q q b r s y) := by + simp_rw [mixedGiantMeasure_pair_integral P Q q _ u v r s J (by linarith)] + exact bounded_density_pair_sum A B (volume.restrict (Set.Ioc u v)) (volume.restrict (Set.Ioc r s)) + H hH K hK (fun _ => restrictedIntegerGiantDensity q J u v) + (fun b => restrictedPrimeGiantDensity P Q q b r s) + (fun _ _ => measurable_restrictedIntegerGiantDensity q J u v) + (fun b _ => measurable_restrictedPrimeGiantDensity P Q q b r s) + (Real.exp (v - J)) 2 (by positivity) (by norm_num) + (fun _ _ x => restrictedIntegerGiantDensity_norm q hq J u v x) + (fun b _ x => restrictedPrimeGiantDensity_norm P Q q b hq r s hr x) c + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RetainedLowZeroDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RetainedLowZeroDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..e834fe4a2a5fabe369a02dee8f25a9b3c5b28560 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RetainedLowZeroDecay.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.LowZeroDecayRate + +namespace OAI + +/-! # Uniform low-zero decay in the manuscript's conductor range -/ + +namespace Ostmann +open Filter +open scoped Classical BigOperators + +theorem retained_low_zero_decay (Z : ∀ χ, ComplexZeroEnumeration χ) + (hD : PublishedComplexZeroDensity Z) (hR : PublishedComplexZeroRegion Z) + (a D : ℝ) (ha : 0 < a) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 101 ≤ Q → + Real.log Q ≤ a * L * Real.exp ((9 / 10 : ℝ) * L) → + ∃ exception : Option PrimitiveComplexCharacter, + ∀ F : Finset PrimitiveComplexCharacter, + (∀ χ ∈ F, χ.modulus ≤ Q) → (∀ χ ∈ F, some χ ≠ exception) → + (∑ χ ∈ F, ∑ i ∈ ((Z χ).heightIndices ((Q : ℝ) ^ 5)).filter + (fun i => 1 / 2 ≤ ((Z χ).zeros i).re), + Real.exp (-Real.exp L * (1 - ((Z χ).zeros i).re))) ≤ Real.exp (-D * L) := by + obtain ⟨C, c, _, hc, hzero⟩ := retained_low_zero_estimate Z hD hR + have hsmall := ((isLittleO_pow_exp_pos_mul_atTop 1 + (show (0 : ℝ) < 1 / 10 by norm_num)).const_mul_left (84 * a)).bound + (show (0 : ℝ) < 1 by norm_num) + filter_upwards [eventual_low_zero_error C c a D hc ha, hsmall, + eventually_ge_atTop (1 : ℝ)] with L herr hsmall hL + intro Q hQ hQL + have hQr : (1 : ℝ) ≤ Q := by exact_mod_cast (show 1 ≤ Q by omega) + have hQp : (0 : ℝ) < Q := by linarith + have hT : (2 : ℝ) ≤ (Q : ℝ) ^ 5 := by + calc + 2 ≤ (Q : ℝ) := by exact_mod_cast (show 2 ≤ Q by omega) + _ ≤ (Q : ℝ) * (Q : ℝ) ^ 4 := + le_mul_of_one_le_right hQp.le (one_le_pow₀ hQr) + _ = _ := by ring + have hlogQT : Real.log ((Q : ℝ) * (Q : ℝ) ^ 5) = 6 * Real.log Q := by + rw [Real.log_mul hQp.ne' (pow_ne_zero _ hQp.ne'), Real.log_pow] + ring + have hlogQ2T : Real.log ((Q : ℝ) ^ 2 * (Q : ℝ) ^ 5) = 7 * Real.log Q := by + rw [Real.log_mul (pow_ne_zero _ hQp.ne') (pow_ne_zero _ hQp.ne'), Real.log_pow, + Real.log_pow] + ring + have hlog2QT : Real.log (2 * (Q : ℝ) * (Q : ℝ) ^ 5) = + Real.log 2 + 6 * Real.log Q := by + rw [Real.log_mul (mul_ne_zero (by norm_num) hQp.ne') (pow_ne_zero _ hQp.ne'), + Real.log_mul (by norm_num) hQp.ne', Real.log_pow] + ring + have hg : 84 * a * L ≤ Real.exp ((1 / 10 : ℝ) * L) := by + simpa only [pow_one, Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ 84 * a * L), + abs_of_pos (Real.exp_pos _), one_mul] using hsmall + have hM : 12 * Real.log ((Q : ℝ) ^ 2 * (Q : ℝ) ^ 5) ≤ Real.exp L := by + rw [hlogQ2T] + have hm := mul_le_mul_of_nonneg_right hg (Real.exp_nonneg ((9 / 10 : ℝ) * L)) + have he : Real.exp ((1 / 10 : ℝ) * L) * Real.exp ((9 / 10 : ℝ) * L) = + Real.exp L := by rw [← Real.exp_add]; congr 1; ring + rw [he] at hm + linarith + obtain ⟨exception, he⟩ := hzero Q hQ ((Q : ℝ) ^ 5) hT + refine ⟨exception, ?_⟩ + intro F hF hFE + have hh := he F hF hFE (Real.exp L) hM + rw [hlogQT, hlog2QT] at hh + exact hh.trans (herr (Real.log Q) (Real.log_nonneg hQr) hQL) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RetainedLowZeroEstimate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RetainedLowZeroEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..3104d78eec7abdeb2d45c6eefbdc34e48340ca70 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RetainedLowZeroEstimate.lean @@ -0,0 +1,51 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ComplexLowZeroBound + +namespace OAI + +/-! # The retained low-zero sum, derived from two published inputs -/ + +namespace Ostmann +open scoped Classical BigOperators + +theorem retained_low_zero_estimate (Z : ∀ χ, ComplexZeroEnumeration χ) + (hD : PublishedComplexZeroDensity Z) (hR : PublishedComplexZeroRegion Z) : + ∃ C c : ℝ, 0 < C ∧ 0 < c ∧ + ∀ Q : ℕ, 101 ≤ Q → ∀ T : ℝ, 2 ≤ T → + ∃ exception : Option PrimitiveComplexCharacter, + ∀ F : Finset PrimitiveComplexCharacter, + (∀ χ ∈ F, χ.modulus ≤ Q) → + (∀ χ ∈ F, some χ ≠ exception) → + ∀ M : ℝ, 12 * Real.log ((Q : ℝ) ^ 2 * T) ≤ M → + (∑ χ ∈ F, ∑ i ∈ ((Z χ).heightIndices T).filter + (fun i => 1 / 2 ≤ ((Z χ).zeros i).re), + Real.exp (-M * (1 - ((Z χ).zeros i).re))) ≤ + 2 * (C * (Real.log ((Q : ℝ) * T)) ^ 13) ^ 2 * + Real.exp (-(M * (c / Real.log (2 * (Q : ℝ) * T))) / 2) := by + obtain ⟨C, hC, hD⟩ := hD + obtain ⟨c, hc, hR⟩ := hR + refine ⟨C, c, hC, hc, ?_⟩ + intro Q hQ T hT + obtain ⟨exception, hexc⟩ := hR Q hQ T hT + refine ⟨exception, ?_⟩ + intro F hF hFE M hM + have hQr : (1 : ℝ) ≤ Q := by exact_mod_cast (show 1 ≤ Q by omega) + have hbase : 1 ≤ (Q : ℝ) ^ 2 * T := by nlinarith + have hlog : 0 ≤ Real.log ((Q : ℝ) * T) := Real.log_nonneg (by nlinarith) + have hden : 0 < Real.log (2 * (Q : ℝ) * T) := Real.log_pos (by nlinarith) + apply low_zero_laplace_bound Z F T + (3 * Real.log ((Q : ℝ) ^ 2 * T)) + (C * (Real.log ((Q : ℝ) * T)) ^ 13) M + (c / Real.log (2 * (Q : ℝ) * T)) + · exact mul_nonneg (by norm_num) (Real.log_nonneg hbase) + · exact mul_nonneg hC.le (pow_nonneg hlog _) + · linarith + · exact (div_pos hc hden).le + · intro χ hχ i hi + exact hexc χ (hF χ hχ) (hFE χ hχ) i + (((Z χ).mem_heightIndices T i).mp hi) + · intro y hy hy' + exact complex_zero_density_exponential Z hC.le hD Q (by omega) T y hT hy hy' F hF + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszCanonicalResidueMain.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszCanonicalResidueMain.lean new file mode 100644 index 0000000000000000000000000000000000000000..73aac2721f5c0a07ca3aeeb7be95459adbac703a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszCanonicalResidueMain.lean @@ -0,0 +1,62 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszCharacterMainSum +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszResidueError + +namespace OAI + +/-! # The canonical Page correction in the actual residue-class Riesz mean -/ + +namespace Ostmann + +open Complex Filter +open scoped BigOperators + +theorem real_zero_lift_inverse_nat (e : PrimitiveRealZero) (q a : ℕ) [NeZero q] + (hd : e.modulus ∣ q) (ha : a.Coprime q) : + (DirichletCharacter.changeLevel hd e.asRealCharacter.asComplex.character) (a : ZMod q)⁻¹ = + (e.character (a : ZMod e.modulus) : ℂ) := by + let τ := DirichletCharacter.changeLevel hd e.asRealCharacter.asComplex.character + have hself : τ⁻¹ = τ := e.asRealCharacter.lift_inverse_eq hd + have hi : τ (a : ZMod q)⁻¹ = τ (a : ZMod q) := by + obtain ⟨u, hu⟩ := (ZMod.isUnit_iff_coprime a q).mpr ha + have hh := congrArg (fun χ : DirichletCharacter ℂ q => χ (u : ZMod q)) hself + rw [MulChar.inv_apply, Ring.inverse_unit] at hh + rw [← hu, ZMod.inv_coe_unit] + exact hh + change τ (a : ZMod q)⁻¹ = _ + rw [hi] + have hr := primitiveCharacterReduction_lift q e.asRealCharacter.asComplex hd + exact primitiveReduction_agrees τ e.asRealCharacter.asComplex hr a ha + +theorem rieszCharacterMainSum_canonical (q a : ℕ) [NeZero q] (ha : a.Coprime q) (X : ℝ) : + (∑ χ : DirichletCharacter ℂ q, χ (a : ZMod q)⁻¹ * + reducedRieszMain q (primitiveCharacterReduction χ) X) = + (X / 2 : ℝ) - (pageCoefficient (actualLocalZero q) a : ℂ) * + rieszContourWeight X (pageBeta (actualLocalZero q) : ℂ) := by + have hua := (ZMod.isUnit_iff_coprime a q).mpr ha + cases he : actualLocalZero q with + | none => + rw [rieszCharacterMainSum_no_exception q _ hua X he] + simp [pageCoefficient] + | some e => + rw [rieszCharacterMainSum_exception q _ hua X e he] + rw [real_zero_lift_inverse_nat e q a (actualLocalZero_spec q e he).1 ha] + rfl + +theorem canonical_riesz_residue_decay : ∃ d : ℝ, 0 < d ∧ + ∀ᶠ X : ℝ in atTop, ∀ q : ℕ, 1 ≤ q → + (q : ℝ) ≤ Real.exp (Real.sqrt (Real.log X)) → + ∀ [NeZero q] (a : ℕ), a.Coprime q → + ‖rieszResidueMean q (a : ZMod q) X - (q.totient : ℂ)⁻¹ * + ((X / 2 : ℝ) - (pageCoefficient (actualLocalZero q) a : ℂ) * + rieszContourWeight X (pageBeta (actualLocalZero q) : ℂ))‖ ≤ + 4 * X * Real.exp (-d * Real.sqrt (Real.log X)) := by + obtain ⟨d, hd, h⟩ := rieszResidueMean_reduced_error + refine ⟨d, hd, ?_⟩ + filter_upwards [h] with X hX + intro q hq hqX inst a ha + have hh := hX q hq hqX (a : ZMod q) ((ZMod.isUnit_iff_coprime a q).mpr ha) + rwa [rieszCharacterMainSum_canonical q a ha X] at hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszCharacterMainSum.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszCharacterMainSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..26bbe2fec58a02f5ea40f914c14fe6792f8c819b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszCharacterMainSum.lean @@ -0,0 +1,100 @@ +import OAI.NumberTheory.Ostmann.Characters.PrimitiveLiftReduction +import OAI.NumberTheory.Ostmann.ZeroDensity.InducedCharacterRieszDecay + +namespace OAI + +/-! # The exact principal and exceptional terms after character summation -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +theorem reducedRieszMain_no_exception (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q) + (X : ℝ) (he : actualLocalZero q = none) : + reducedRieszMain q (primitiveCharacterReduction χ) X = + if χ = 1 then ((X / 2 : ℝ) : ℂ) else 0 := by + classical + cases hr : primitiveCharacterReduction χ with + | none => + have hχ := (primitiveCharacterReduction_eq_none_iff q χ).mp hr + simp only [reducedRieszMain, hχ, ↓reduceIte] + | some ρ => + have hχ : χ ≠ 1 := by + intro h + have hn := (primitiveCharacterReduction_eq_none_iff q χ).mpr h + rw [hr] at hn + cases hn + simp only [reducedRieszMain, canonicalCharacterRieszTerm, he, hχ, ↓reduceIte] + +theorem reducedRieszMain_exception (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q) + (X : ℝ) (e : PrimitiveRealZero) (he : actualLocalZero q = some e) : + let hd := (actualLocalZero_spec q e he).1 + let τ := DirichletCharacter.changeLevel hd e.asRealCharacter.asComplex.character + reducedRieszMain q (primitiveCharacterReduction χ) X = + (if χ = 1 then ((X / 2 : ℝ) : ℂ) else 0) - + (if χ = τ then rieszContourWeight X (e.beta : ℂ) else 0) := by + classical + dsimp only + let R := e.asRealCharacter.asComplex + let hd := (actualLocalZero_spec q e he).1 + let τ := DirichletCharacter.changeLevel hd R.character + have hτ : τ ≠ 1 := mt (DirichletCharacter.changeLevel_eq_one_iff hd).mp R.nontrivial + change reducedRieszMain q (primitiveCharacterReduction χ) X = + (if χ = 1 then ((X / 2 : ℝ) : ℂ) else 0) - + (if χ = τ then rieszContourWeight X (e.beta : ℂ) else 0) + cases hr : primitiveCharacterReduction χ with + | none => + have hχ := (primitiveCharacterReduction_eq_none_iff q χ).mp hr + simp only [reducedRieszMain, hχ, ↓reduceIte, Ne.symm hτ, sub_zero] + | some ρ => + have hχ : χ ≠ 1 := by + intro h + have hn := (primitiveCharacterReduction_eq_none_iff q χ).mpr h + rw [hr] at hn + cases hn + by_cases hρ : ρ = R + · have hχτ : χ = τ := by + apply (primitiveCharacterReduction_eq_some_iff q χ R hd).mp + simpa only [hρ] using hr + simp only [reducedRieszMain, canonicalCharacterRieszTerm, he, hρ, R, hχτ, hτ, + ↓reduceIte, zero_sub] + · have hχτ : χ ≠ τ := by + intro h + have hh := primitiveCharacterReduction_lift q R hd + change primitiveCharacterReduction τ = some R at hh + rw [← h, hr] at hh + exact hρ (Option.some.inj hh) + simp only [reducedRieszMain, canonicalCharacterRieszTerm, he, + show e.asRealCharacter.asComplex ≠ ρ from Ne.symm hρ, hχ, hχτ, ↓reduceIte, sub_zero] + +theorem principal_character_inverse_value (q : ℕ) (a : ZMod q) (ha : IsUnit a) : + (1 : DirichletCharacter ℂ q) a⁻¹ = 1 := by + obtain ⟨u, rfl⟩ := ha + rw [ZMod.inv_coe_unit] + exact MulChar.one_apply_coe _ + +theorem rieszCharacterMainSum_no_exception (q : ℕ) [NeZero q] (a : ZMod q) + (ha : IsUnit a) (X : ℝ) (he : actualLocalZero q = none) : + (∑ χ : DirichletCharacter ℂ q, χ a⁻¹ * reducedRieszMain q (primitiveCharacterReduction χ) X) = + (X / 2 : ℝ) := by + classical + simp_rw [reducedRieszMain_no_exception q _ X he] + simp only [mul_ite, mul_zero, Finset.sum_ite_eq', Finset.mem_univ, ↓reduceIte, + principal_character_inverse_value q a ha, one_mul] + +theorem rieszCharacterMainSum_exception (q : ℕ) [NeZero q] (a : ZMod q) + (ha : IsUnit a) (X : ℝ) (e : PrimitiveRealZero) (he : actualLocalZero q = some e) : + let hd := (actualLocalZero_spec q e he).1 + let τ := DirichletCharacter.changeLevel hd e.asRealCharacter.asComplex.character + (∑ χ : DirichletCharacter ℂ q, χ a⁻¹ * reducedRieszMain q (primitiveCharacterReduction χ) X) = + (X / 2 : ℝ) - τ a⁻¹ * rieszContourWeight X (e.beta : ℂ) := by + classical + dsimp only + simp_rw [reducedRieszMain_exception q _ X e he] + simp only [mul_sub, Finset.sum_sub_distrib, mul_ite, mul_zero, Finset.sum_ite_eq', + Finset.mem_univ, ↓reduceIte, principal_character_inverse_value q a ha, one_mul] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszContourRectangle.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszContourRectangle.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a6fb5d51a3ca9bae36914d4abd00210d3ad0cd1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszContourRectangle.lean @@ -0,0 +1,36 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszVerticalWeight +import OAI.NumberTheory.Ostmann.ZeroDensity.RectangleGeometry +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroMultiplicity + +namespace OAI + +/-! # The finite Riesz contour displacement when the rectangle is zero-free -/ + +namespace Ostmann + +open Complex Set +open scoped Interval + +noncomputable def rieszContourWeight (X : ℝ) (s : ℂ) : ℂ := + (X : ℂ) ^ s * rieszMellinKernel s + +theorem rieszContourWeight_analyticAt (X : ℝ) (hX : 0 < X) (s : ℂ) (hs : 0 < s.re) : + AnalyticAt ℂ (rieszContourWeight X) s := by + exact ((differentiable_id.const_cpow (.inl (by exact_mod_cast hX.ne'))).analyticAt s).mul + (rieszMellinKernel_analyticAt_pos s hs) + +theorem rieszContour_rectangle_zero (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (a b c d : ℝ) (ha : 0 < a) (hab : a ≤ b) + (hne : ∀ s ∈ uIcc a b ×ℂ uIcc c d, χ.L s ≠ 0) : + rectangleBoundaryIntegral (fun s => -logDeriv χ.L s * rieszContourWeight X s) + a b c d = 0 := by + apply rectangleBoundaryIntegral_eq_zero + intro s hs + have hspos : 0 < s.re := ha.trans_le ((uIcc_of_le hab) ▸ hs.1).1 + have hl : AnalyticAt ℂ (fun s => -logDeriv χ.L s) s := by + exact ((χ.L_analytic s).deriv.div (χ.L_analytic s) (hne s hs)).neg + exact hl.mul (rieszContourWeight_analyticAt X hX s hspos) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszCoprimeComparison.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszCoprimeComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..359490682bac927c5d06b5c5ba16d8f4695fa5b3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszCoprimeComparison.lean @@ -0,0 +1,89 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszPrimeRemoval + +namespace OAI + +/-! # The Riesz cost of changing coefficients only at primes dividing the modulus -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +theorem rieszPrimeMean_norm_le_of_coprime_zero (g : ℕ → ℂ) (q : ℕ) (X B : ℝ) + (hq : 0 < q) (hX : 1 ≤ X) (hB : 0 ≤ B) + (hg : ∀ n, ‖g n‖ ≤ B) (hz : ∀ n, n.Coprime q → g n = 0) : + ‖rieszPrimeMean g X‖ ≤ B * q * Real.log X := by + classical + let S := (Finset.Ioc 0 ⌊X⌋₊).filter Nat.Prime + let D := S.filter (fun n => ¬n.Coprime q) + have hsub : D ⊆ Finset.Ioc 0 q := by + intro n hn + obtain ⟨hnS, hnq⟩ := Finset.mem_filter.mp hn + obtain ⟨_, hnp⟩ := Finset.mem_filter.mp hnS + have hd : n ∣ q := by + by_contra hd + exact hnq (hnp.coprime_iff_not_dvd.mpr hd) + exact Finset.mem_Ioc.mpr ⟨hnp.pos, Nat.le_of_dvd hq hd⟩ + have hcard : D.card ≤ q := by + simpa using Finset.card_le_card hsub + have heq : rieszPrimeMean g X = ∑ n ∈ D, + (Real.log n : ℂ) * g n * rieszPrimeTest (n / X) := by + symm + apply Finset.sum_subset (Finset.filter_subset _ _) + intro n hn hnd + have hnq : n.Coprime q := by + by_contra hh + exact hnd (Finset.mem_filter.mpr ⟨hn, hh⟩) + rw [hz n hnq, mul_zero, zero_mul] + have hlog : 0 ≤ Real.log X := Real.log_nonneg hX + have hb (n : ℕ) (hn : n ∈ D) : + ‖(Real.log n : ℂ) * g n * rieszPrimeTest (n / X)‖ ≤ B * Real.log X := by + obtain ⟨hnS, _⟩ := Finset.mem_filter.mp hn + obtain ⟨hnI, _⟩ := Finset.mem_filter.mp hnS + obtain ⟨hn0, hnX⟩ := Finset.mem_Ioc.mp hnI + have hnR : (0 : ℝ) < n := by exact_mod_cast hn0 + have hnX' : (n : ℝ) ≤ X := (Nat.le_floor_iff (by linarith : 0 ≤ X)).mp hnX + have hlogn : 0 ≤ Real.log n := Real.log_nonneg (by exact_mod_cast hn0) + have hlogle : Real.log n ≤ Real.log X := Real.log_le_log hnR hnX' + rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hlogn] + calc + _ ≤ (Real.log n * B) * 1 := mul_le_mul + (mul_le_mul_of_nonneg_left (hg n) hlogn) + (rieszPrimeTest_norm_le_one (n / X) (by positivity)) (norm_nonneg _) (by positivity) + _ ≤ B * Real.log X := by nlinarith + rw [heq] + calc + _ ≤ ∑ n ∈ D, ‖(Real.log n : ℂ) * g n * rieszPrimeTest (n / X)‖ := norm_sum_le _ _ + _ ≤ ∑ _n ∈ D, B * Real.log X := Finset.sum_le_sum hb + _ = (D.card : ℝ) * (B * Real.log X) := by simp + _ ≤ B * q * Real.log X := by + have hc : (D.card : ℝ) ≤ q := by exact_mod_cast hcard + have hh := mul_le_mul_of_nonneg_right hc (mul_nonneg hB hlog) + convert hh using 1 + ring + +theorem rieszTwistMean_norm_le_of_coprime_zero (g : ℕ → ℂ) (q : ℕ) (X B : ℝ) + (hq : 0 < q) (hX : 1 ≤ X) (hB : 0 ≤ B) + (hg : ∀ n, ‖g n‖ ≤ B) (hz : ∀ n, n.Coprime q → g n = 0) : + ‖rieszTwistMean g X‖ ≤ B * q * Real.log X + B * (2 * Real.sqrt X * Real.log X) := by + have hp := rieszPrimeMean_norm_le_of_coprime_zero g q X B hq hX hB hg hz + have he := rieszTwistMean_prime_error g X B hX hB hg + have ht := norm_le_norm_sub_add (rieszTwistMean g X) (rieszPrimeMean g X) + linarith + +theorem rieszTwistMean_coprime_comparison (g h : ℕ → ℂ) (q : ℕ) (X : ℝ) + (hq : 0 < q) (hX : 1 ≤ X) (hg : ∀ n, ‖g n‖ ≤ 1) (hh : ∀ n, ‖h n‖ ≤ 1) + (he : ∀ n, n.Coprime q → g n = h n) : + ‖rieszTwistMean g X - rieszTwistMean h X‖ ≤ + 2 * q * Real.log X + 4 * Real.sqrt X * Real.log X := by + rw [rieszTwistMean_sub] + have hb (n : ℕ) : ‖g n - h n‖ ≤ 2 := (norm_sub_le _ _).trans (by linarith [hg n, hh n]) + have hz (n : ℕ) (hn : n.Coprime q) : g n - h n = 0 := by rw [he n hn, sub_self] + have ht := rieszTwistMean_norm_le_of_coprime_zero (fun n => g n - h n) q X 2 + hq hX (by norm_num) hb hz + convert ht using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszDirichletIntegral.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszDirichletIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e37a69db2671293ea3e9881d768433fc6237489 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszDirichletIntegral.lean @@ -0,0 +1,102 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszVerticalWeight +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothDirichletIntegral + +namespace OAI + +/-! # The exact starting contour for the integrated Chebyshev sum -/ + +namespace Ostmann + +open Complex MeasureTheory +open scoped BigOperators + +noncomputable def characterRieszMean (χ : PrimitiveComplexCharacter) (X : ℝ) : ℂ := + ∑' n : ℕ, characterMangoldtCoefficient χ n * rieszPrimeTest (n / X) + +noncomputable def characterRieszVerticalTerm (χ : PrimitiveComplexCharacter) + (X σ : ℝ) (n : ℕ) (t : ℝ) : ℂ := + LSeries.term (characterMangoldtCoefficient χ) (rieszMellinLine σ t) n * + rieszVerticalWeight X σ t + +theorem characterRieszVerticalTerm_norm (χ : PrimitiveComplexCharacter) + (X σ : ℝ) (n : ℕ) (t : ℝ) : + ‖characterRieszVerticalTerm χ X σ n t‖ = + ‖LSeries.term (characterMangoldtCoefficient χ) (σ : ℂ) n‖ * + ‖rieszVerticalWeight X σ t‖ := by + rw [characterRieszVerticalTerm, norm_mul, characterMangoldt_riesz_term_norm] + +theorem characterRieszVerticalTerm_integrable (χ : PrimitiveComplexCharacter) + (X σ : ℝ) (hX : 0 < X) (hσ : 1 ≤ σ) (n : ℕ) : + Integrable (characterRieszVerticalTerm χ X σ n) := by + apply ((rieszVerticalWeight_integrable X σ hX hσ).norm.const_mul + ‖LSeries.term (characterMangoldtCoefficient χ) (σ : ℂ) n‖).mono' + · exact ((characterMangoldt_riesz_term_continuous χ σ n).mul + (rieszVerticalWeight_continuous X σ hX (by linarith))).aestronglyMeasurable + · exact Filter.Eventually.of_forall (fun t => (characterRieszVerticalTerm_norm χ X σ n t).le) + +theorem characterRieszVerticalTerm_summable_norm (χ : PrimitiveComplexCharacter) + (X σ : ℝ) (hσ : 1 < σ) : + Summable (fun n => ∫ t : ℝ, ‖characterRieszVerticalTerm χ X σ n t‖) := by + have hsum : LSeriesSummable (characterMangoldtCoefficient χ) (σ : ℂ) := + DirichletCharacter.LSeriesSummable_twist_vonMangoldt χ.character (by simpa using hσ) + have hs := hsum.norm.mul_right (∫ t : ℝ, ‖rieszVerticalWeight X σ t‖) + apply hs.congr + intro n + simp only [characterRieszVerticalTerm_norm, integral_const_mul] + +theorem characterMangoldt_riesz_term_inversion (χ : PrimitiveComplexCharacter) + (X σ : ℝ) (hX : 0 < X) (hσ : 1 ≤ σ) (n : ℕ) : + ((1 / (2 * Real.pi) : ℝ) : ℂ) * + (∫ t : ℝ, characterRieszVerticalTerm χ X σ n t) = + characterMangoldtCoefficient χ n * rieszPrimeTest (n / X) := by + by_cases hn : n = 0 + · subst n + simp [characterRieszVerticalTerm, characterMangoldtCoefficient] + have hnR : 0 < (n : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero hn + have hkernel (t : ℝ) : characterRieszVerticalTerm χ X σ n t = + characterMangoldtCoefficient χ n * + (((n : ℝ) / X : ℝ) : ℂ) ^ (-rieszMellinLine σ t) * + rieszMellinKernel (rieszMellinLine σ t) := by + rw [characterRieszVerticalTerm, LSeries.term_of_ne_zero hn, rieszVerticalWeight, + Complex.cpow_neg, Complex.ofReal_div, + Complex.div_cpow_ofReal_nonneg hnR.le hX.le, inv_div] + push_cast + ring + simp_rw [hkernel, mul_assoc] + rw [integral_const_mul] + have hinv := rieszPrimeTest_mellin_inversion σ ((n : ℝ) / X) hσ (div_pos hnR hX) + change ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, + (((n : ℝ) / X : ℝ) : ℂ) ^ (-rieszMellinLine σ t) * + rieszMellinKernel (rieszMellinLine σ t)) = _ at hinv + rw [← hinv] + ring + +theorem characterRieszMean_eq_vertical_logDerivative (χ : PrimitiveComplexCharacter) + (X σ : ℝ) (hX : 0 < X) (hσ : 1 < σ) : + characterRieszMean χ X = + ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, + (-logDeriv χ.L (rieszMellinLine σ t)) * rieszVerticalWeight X σ t := by + unfold characterRieszMean + calc + _ = ∑' n : ℕ, ((1 / (2 * Real.pi) : ℝ) : ℂ) * + ∫ t : ℝ, characterRieszVerticalTerm χ X σ n t := + tsum_congr (fun n => (characterMangoldt_riesz_term_inversion χ X σ hX hσ.le n).symm) + _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * + ∑' n : ℕ, ∫ t : ℝ, characterRieszVerticalTerm χ X σ n t := tsum_mul_left + _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * + ∫ t : ℝ, ∑' n : ℕ, characterRieszVerticalTerm χ X σ n t := by + rw [integral_tsum_of_summable_integral_norm + (characterRieszVerticalTerm_integrable χ X σ hX hσ.le) + (characterRieszVerticalTerm_summable_norm χ X σ hσ)] + _ = _ := by + congr 1 + apply integral_congr_ae + filter_upwards with t + rw [show (∑' n : ℕ, characterRieszVerticalTerm χ X σ n t) = + LSeries (characterMangoldtCoefficient χ) (rieszMellinLine σ t) * rieszVerticalWeight X σ t from tsum_mul_right] + rw [χ.mangoldt_LSeries_eq _ (by simpa using hσ)] + simp only [logDeriv_apply, neg_div] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszExponentialParameters.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszExponentialParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..982bbd2d7c57e6b0e3ff8c892960c0c43727b712 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszExponentialParameters.lean @@ -0,0 +1,103 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +import OAI.NumberTheory.Ostmann.ZeroDensity.NonexceptionalRieszBound + +namespace OAI + +/-! # Exponential parameter choice for the Riesz contour + +The height is `exp y`, the length is `exp (y²)` and the right abscissa is +`1 + 1/y²`. Fixed polynomial losses are absorbed into a smaller decay rate. +-/ + +namespace Ostmann + +open Filter Asymptotics + +theorem riesz_polynomial_absorption (C d : ℝ) (hd : 0 < d) : + ∀ᶠ y : ℝ in atTop, C * (y ^ 2 + 1) ≤ Real.exp (d * y) := by + have hp := (isLittleO_pow_exp_pos_mul_atTop 2 hd).const_mul_left C + have hc := (isLittleO_pow_exp_pos_mul_atTop 0 hd).const_mul_left C + have hb := (hp.add hc).bound (by norm_num : (0 : ℝ) < 1) + filter_upwards [hb] with y hy + have hh := (le_abs_self (C * y ^ 2 + C)).trans (by + simpa only [pow_zero, mul_one, Real.norm_eq_abs, + abs_of_pos (Real.exp_pos _), one_mul] using hy) + nlinarith + +theorem riesz_exponential_error (c A B E : ℝ) (hc : 0 < c) (hc4 : c ≤ 1 / 4) + (hA : 0 ≤ A) (hB : 0 ≤ B) (hE : 0 ≤ E) : + ∀ᶠ y : ℝ in atTop, ∀ H : ℝ, 0 < H → H ≤ 3 * y → + A * H ^ 2 * (Real.exp (y ^ 2)) ^ (1 - c / H) + + B * H ^ 2 * (Real.exp (y ^ 2)) ^ (1 + 1 / y ^ 2) / (Real.exp y) ^ 2 + + 2 * (1 / ((1 + 1 / y ^ 2) - 1) + E) * + (Real.exp (y ^ 2)) ^ (1 + 1 / y ^ 2) / Real.exp y ≤ + 3 * Real.exp (y ^ 2 - (c / 6) * y) := by + let d := c / 6 + have hd : 0 < d := by dsimp [d]; positivity + have hd1 : 2 * d ≤ 1 := by dsimp [d]; linarith + have hp1 := riesz_polynomial_absorption (9 * A) d hd + have hp2 := riesz_polynomial_absorption (9 * B * Real.exp 1) d hd + have hp3 := riesz_polynomial_absorption (2 * (1 + E) * Real.exp 1) d hd + filter_upwards [hp1, hp2, hp3, eventually_ge_atTop (1 : ℝ)] with y hyA hyB hyE hy1 + intro H hH hHy + have hy0 : 0 < y := by linarith + have hy2 : y ^ 2 ≠ 0 := pow_ne_zero 2 hy0.ne' + have hH2 : H ^ 2 ≤ 9 * y ^ 2 := by nlinarith + have h1 : A * H ^ 2 ≤ Real.exp (d * y) := by + apply le_trans _ hyA + nlinarith [mul_le_mul_of_nonneg_left hH2 hA] + have h2 : B * H ^ 2 * Real.exp 1 ≤ Real.exp (d * y) := by + apply le_trans _ hyB + have he := Real.exp_pos (1 : ℝ) + nlinarith [mul_le_mul_of_nonneg_left hH2 (mul_nonneg hB he.le)] + have h3 : 2 * (y ^ 2 + E) * Real.exp 1 ≤ Real.exp (d * y) := by + apply le_trans _ hyE + have he := Real.exp_pos (1 : ℝ) + nlinarith [mul_nonneg hE (sq_nonneg y), + mul_nonneg (mul_nonneg hE (sq_nonneg y)) he.le] + have hrpow (r : ℝ) : (Real.exp (y ^ 2)) ^ r = Real.exp (y ^ 2 * r) := by + rw [Real.rpow_def_of_pos (Real.exp_pos _), Real.log_exp] + have hr : (Real.exp (y ^ 2)) ^ (1 + 1 / y ^ 2) = + Real.exp (y ^ 2) * Real.exp 1 := by + rw [hrpow, show y ^ 2 * (1 + 1 / y ^ 2) = y ^ 2 + 1 by field_simp, + Real.exp_add] + have hgap : y ^ 2 * (1 - c / H) ≤ y ^ 2 - 2 * d * y := by + have hh : c * y / 3 ≤ c / H * y ^ 2 := by + have hm := mul_le_mul_of_nonneg_left hHy (show 0 ≤ c * y by positivity) + rw [show c / H * y ^ 2 = c * y ^ 2 / H by ring] + apply (le_div_iff₀ hH).mpr + nlinarith + dsimp [d] + nlinarith + have ht1 : A * H ^ 2 * (Real.exp (y ^ 2)) ^ (1 - c / H) ≤ + Real.exp (y ^ 2 - d * y) := by + rw [hrpow] + calc + _ ≤ Real.exp (d * y) * Real.exp (y ^ 2 - 2 * d * y) := + mul_le_mul h1 (Real.exp_le_exp.mpr hgap) (by positivity) (Real.exp_nonneg _) + _ = _ := by rw [← Real.exp_add]; congr 1; ring + have ht2 : B * H ^ 2 * (Real.exp (y ^ 2)) ^ (1 + 1 / y ^ 2) / (Real.exp y) ^ 2 ≤ + Real.exp (y ^ 2 - d * y) := by + rw [hr, ← Real.exp_nat_mul] + calc + _ = (B * H ^ 2 * Real.exp 1) * Real.exp (y ^ 2 - 2 * y) := by + rw [Real.exp_sub]; ring_nf + _ ≤ Real.exp (d * y) * Real.exp (y ^ 2 - 2 * y) := + mul_le_mul_of_nonneg_right h2 (Real.exp_nonneg _) + _ ≤ _ := by rw [← Real.exp_add]; apply Real.exp_le_exp.mpr; nlinarith + have ht3 : 2 * (1 / ((1 + 1 / y ^ 2) - 1) + E) * + (Real.exp (y ^ 2)) ^ (1 + 1 / y ^ 2) / Real.exp y ≤ + Real.exp (y ^ 2 - d * y) := by + rw [hr, show 1 / ((1 + 1 / y ^ 2) - 1) = y ^ 2 by field_simp; ring] + calc + _ = (2 * (y ^ 2 + E) * Real.exp 1) * Real.exp (y ^ 2 - y) := by + rw [Real.exp_sub]; ring + _ ≤ Real.exp (d * y) * Real.exp (y ^ 2 - y) := + mul_le_mul_of_nonneg_right h3 (Real.exp_nonneg _) + _ ≤ _ := by rw [← Real.exp_add]; apply Real.exp_le_exp.mpr; nlinarith + dsimp [d] at ht1 ht2 ht3 + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszFiniteSum.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszFiniteSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..bba4fdcf9cc015e074ff48d36f4ae0ceeef1815b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszFiniteSum.lean @@ -0,0 +1,45 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszDirichletIntegral +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszUnsmoothing + +namespace OAI + +/-! # Identifying the Riesz contour with the finite arithmetic sum -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +theorem rieszPrimeTest_scale (X y : ℝ) (hX : 0 < X) : + rieszPrimeTest (y / X) = ((max (X - y) 0 / X : ℝ) : ℂ) := by + by_cases hy : y ≤ X + · have hdiv : y / X ≤ 1 := (div_le_one hX).mpr hy + rw [rieszPrimeTest, max_eq_left (by linarith : 0 ≤ 1 - y / X), + max_eq_left (sub_nonneg.mpr hy)] + push_cast + field_simp [show (X : ℂ) ≠ 0 by exact_mod_cast hX.ne'] + · have hdiv : 1 < y / X := (one_lt_div hX).mpr (lt_of_not_ge hy) + rw [rieszPrimeTest, max_eq_right (by linarith : 1 - y / X ≤ 0), + max_eq_right (by linarith : X - y ≤ 0)] + simp + +theorem characterRieszMean_finite (χ : PrimitiveComplexCharacter) (X : ℝ) (hX : 0 < X) : + (X : ℂ) * characterRieszMean χ X = + ∑ n ∈ Finset.range (⌊X⌋₊ + 1), characterMangoldtCoefficient χ n * + (max (X - (n : ℝ)) 0 : ℝ) := by + have hsupport (n : ℕ) (hn : n ∉ Finset.range (⌊X⌋₊ + 1)) : + characterMangoldtCoefficient χ n * rieszPrimeTest (n / X) = 0 := by + have hfloor : ⌊X⌋₊ < n := by simpa using hn + have hxn : X < n := Nat.lt_of_floor_lt hfloor + rw [rieszPrimeTest_scale X n hX, max_eq_right (by linarith : X - (n : ℝ) ≤ 0)] + simp + rw [characterRieszMean, tsum_eq_sum hsupport, Finset.mul_sum] + apply Finset.sum_congr rfl + intro n _ + rw [rieszPrimeTest_scale X n hX] + push_cast + field_simp [show (X : ℂ) ≠ 0 by exact_mod_cast hX.ne'] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszHorizontalEstimate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszHorizontalEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3b19c1c4fc43054d0fd0bfb1f16afbced115711 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszHorizontalEstimate.lean @@ -0,0 +1,65 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszContourRectangle +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszTailEstimate + +namespace OAI + +/-! # Horizontal errors in the finite Riesz contour displacement -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped Interval + +theorem riesz_horizontal_segment_bound (χ : PrimitiveComplexCharacter) + (X a b t M : ℝ) (hX : 1 ≤ X) (hab : a ≤ b) (ht : 0 < |t|) (hM : 0 ≤ M) + (hb : ∀ σ ∈ Icc a b, ‖logDeriv χ.L ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M) : + ‖∫ σ in a..b, -logDeriv χ.L ((σ : ℂ) + (t : ℂ) * I) * + rieszContourWeight X ((σ : ℂ) + (t : ℂ) * I)‖ ≤ + (M * X ^ b / t ^ 2) * (b - a) := by + have hXp : 0 < X := by linarith + have hpoint : ∀ σ ∈ Ι a b, + ‖-logDeriv χ.L ((σ : ℂ) + (t : ℂ) * I) * + rieszContourWeight X ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M * X ^ b / t ^ 2 := by + intro σ hσ + have hσ' : σ ∈ Icc a b := by + have hh := uIoc_subset_uIcc hσ + rwa [uIcc_of_le hab] at hh + have hk := rieszMellinKernel_im_bound ((σ : ℂ) + (t : ℂ) * I) (by simpa using ht) + simp only [Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, + Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, zero_add, sq_abs] at hk + have hx : X ^ σ ≤ X ^ b := Real.rpow_le_rpow_of_exponent_le hX hσ'.2 + rw [norm_mul, norm_neg, rieszContourWeight, norm_mul, + Complex.norm_cpow_eq_rpow_re_of_pos hXp] + simp only [Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, + mul_zero, Complex.ofReal_im, Complex.I_im, zero_mul, sub_zero, add_zero] + have hh := mul_le_mul (hb σ hσ') (mul_le_mul hx hk (norm_nonneg _) (Real.rpow_nonneg hXp.le _)) + (by positivity) hM + exact hh.trans_eq (by ring) + have hi := intervalIntegral.norm_integral_le_of_norm_le_const hpoint + simpa only [abs_of_nonneg (sub_nonneg.mpr hab)] using hi + +theorem rectangle_vertical_shift_norm_bound (f : ℂ → ℂ) (a b c d : ℝ) + (hzero : rectangleBoundaryIntegral f a b c d = 0) : + ‖∫ y in c..d, f ((b : ℂ) + (y : ℂ) * I)‖ ≤ + ‖∫ y in c..d, f ((a : ℂ) + (y : ℂ) * I)‖ + + ‖∫ x in a..b, f ((x : ℂ) + (d : ℂ) * I)‖ + + ‖∫ x in a..b, f ((x : ℂ) + (c : ℂ) * I)‖ := by + let R := ∫ y in c..d, f ((b : ℂ) + (y : ℂ) * I) + let L := ∫ y in c..d, f ((a : ℂ) + (y : ℂ) * I) + let U := ∫ x in a..b, f ((x : ℂ) + (d : ℂ) * I) + let D := ∫ x in a..b, f ((x : ℂ) + (c : ℂ) * I) + have he : I * R = I * L + U - D := by + dsimp [rectangleBoundaryIntegral] at hzero + dsimp [R, L, U, D] + linear_combination hzero + change ‖R‖ ≤ ‖L‖ + ‖U‖ + ‖D‖ + calc + ‖R‖ = ‖I * R‖ := by rw [norm_mul, Complex.norm_I, one_mul] + _ = ‖I * L + U - D‖ := by rw [he] + _ ≤ ‖I * L + U‖ + ‖D‖ := norm_sub_le _ _ + _ ≤ (‖I * L‖ + ‖U‖) + ‖D‖ := add_le_add (norm_add_le _ _) le_rfl + _ = _ := by rw [norm_mul, Complex.norm_I, one_mul] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszLeftEstimate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszLeftEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ef7e2c4adb3ccc468e2f5a48b1374f9dc511eb9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszLeftEstimate.lean @@ -0,0 +1,77 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszTailEstimate + +namespace OAI + +/-! # The bounded left vertical segment of the Riesz contour -/ + +namespace Ostmann + +open Complex MeasureTheory Set + +noncomputable def rieszLineMajorant (t : ℝ) : ℝ := 9 * (1 + |t|) ^ (-(2 : ℝ)) + +theorem rieszLineMajorant_nonneg (t : ℝ) : 0 ≤ rieszLineMajorant t := by + unfold rieszLineMajorant + positivity + +theorem rieszLineMajorant_integrable : Integrable rieszLineMajorant := by + have hp : Integrable (fun t : ℝ => (1 + ‖t‖) ^ (-(2 : ℝ))) := + integrable_one_add_norm (μ := volume) (E := ℝ) + (by norm_num : (Module.finrank ℝ ℝ : ℝ) < 2) + change Integrable (fun t : ℝ => 9 * (1 + |t|) ^ (-(2 : ℝ))) + simpa only [Real.norm_eq_abs] using hp.const_mul 9 + +theorem rieszMellinKernel_half_strip (s : ℂ) (hs : 1 / 2 ≤ s.re) : + ‖rieszMellinKernel s‖ ≤ rieszLineMajorant s.im := by + have h1 : 1 ≤ 2 * ‖s‖ := by linarith [Complex.re_le_norm s] + have h2 : 1 ≤ 2 * ‖s + 1‖ := by + have hh := Complex.re_le_norm (s + 1) + simp only [Complex.add_re, Complex.one_re] at hh + linarith + have hsp : 0 < ‖s‖ := by linarith + have hsp1 : 0 < ‖s + 1‖ := by linarith + have ht1 := Complex.abs_im_le_norm s + have ht2 : |s.im| ≤ ‖s + 1‖ := by simpa using Complex.abs_im_le_norm (s + 1) + have ha : 0 < 1 + |s.im| := by positivity + have hp : (1 + |s.im|) ^ 2 ≤ 9 * (‖s‖ * ‖s + 1‖) := by + have hh := mul_le_mul (show 1 + |s.im| ≤ 3 * ‖s‖ by linarith) + (show 1 + |s.im| ≤ 3 * ‖s + 1‖ by linarith) (by positivity) (by positivity) + nlinarith + rw [rieszMellinKernel, norm_div, norm_one, norm_mul, rieszLineMajorant, + Real.rpow_neg (by positivity : 0 ≤ 1 + |s.im|), Real.rpow_two, ← div_eq_mul_inv] + apply (div_le_div_iff₀ (by positivity : 0 < ‖s‖ * ‖s + 1‖) (sq_pos_of_pos ha)).mpr + nlinarith + +theorem leftRieszIntegrand_segment_bound : ∃ K : ℝ, 0 < K ∧ + ∀ (χ : PrimitiveComplexCharacter) (X a T M : ℝ), 0 < X → 1 / 2 ≤ a → 0 ≤ M → + (∀ t ∈ Icc (-T) T, ‖logDeriv χ.L (rieszMellinLine a t)‖ ≤ M) → + ‖∫ t in Icc (-T) T, rightRieszIntegrand χ X a t‖ ≤ K * M * X ^ a := by + let J := ∫ t : ℝ, rieszLineMajorant t + have hJ : 0 ≤ J := integral_nonneg rieszLineMajorant_nonneg + refine ⟨J + 1, by linarith, ?_⟩ + intro χ X a T M hX ha hM hb + have hg : Integrable (fun t : ℝ => (M * X ^ a) * rieszLineMajorant t) := + rieszLineMajorant_integrable.const_mul _ + have hnorm : ‖∫ t in Icc (-T) T, rightRieszIntegrand χ X a t‖ ≤ + ∫ t in Icc (-T) T, (M * X ^ a) * rieszLineMajorant t := by + apply norm_integral_le_of_norm_le hg.integrableOn + filter_upwards [ae_restrict_mem measurableSet_Icc] with t ht + have hk := rieszMellinKernel_half_strip (rieszMellinLine a t) (by simpa using ha) + simp only [rieszMellinLine, Complex.add_im, Complex.ofReal_im, Complex.mul_im, + Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, + zero_add] at hk + rw [rightRieszIntegrand, norm_mul, norm_neg, rieszVerticalWeight_norm X a t hX] + have hh := mul_le_mul (hb t ht) (mul_le_mul_of_nonneg_left hk (Real.rpow_nonneg hX.le a)) + (by positivity) hM + exact hh.trans_eq (by ring) + have hfull := setIntegral_le_integral hg + (Filter.Eventually.of_forall (fun t => mul_nonneg (by positivity) (rieszLineMajorant_nonneg t))) + (s := Icc (-T) T) + simp only [integral_const_mul] at hnorm hfull + apply (hnorm.trans hfull).trans + dsimp only [J] at hJ ⊢ + nlinarith [mul_nonneg hM (Real.rpow_nonneg hX.le a)] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszMellinInversion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszMellinInversion.lean new file mode 100644 index 0000000000000000000000000000000000000000..496adcee289ad11c93dda91555714b9f6bf7c45e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszMellinInversion.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszMellinKernel + +namespace OAI + +/-! # Mellin inversion for the one-sided Riesz weight -/ + +namespace Ostmann + +open Complex MeasureTheory + +theorem rieszMellinKernel_verticalIntegrable (σ : ℝ) (hσ : 1 ≤ σ) : + Complex.VerticalIntegrable rieszMellinKernel σ := by + have hmajor : Integrable (fun t : ℝ => 4 * (1 + ‖t‖) ^ (-(2 : ℝ))) := + (integrable_one_add_norm (E := ℝ) (by norm_num : (Module.finrank ℝ ℝ : ℝ) < 2)).const_mul 4 + have hc : Continuous (fun t : ℝ => rieszMellinKernel ((σ : ℂ) + (t : ℂ) * I)) := by + unfold rieszMellinKernel + apply continuous_const.div + · fun_prop + · intro t + apply mul_ne_zero + · intro h + have hh := congrArg Complex.re h + simp at hh + linarith + · intro h + have hh := congrArg Complex.re h + simp at hh + linarith + apply hmajor.mono' hc.aestronglyMeasurable + filter_upwards with t + simpa only [Real.norm_eq_abs] using rieszMellinKernel_line_bound σ t hσ + +theorem rieszPrimeTest_mellin_inversion (σ x : ℝ) (hσ : 1 ≤ σ) (hx : 0 < x) : + mellinInv σ rieszMellinKernel x = rieszPrimeTest x := by + have hσp : 0 < σ := by linarith + have hF : Complex.VerticalIntegrable (mellin rieszPrimeTest) σ := by + have hfun : (fun t : ℝ => mellin rieszPrimeTest ((σ : ℂ) + (t : ℂ) * I)) = + (fun t : ℝ => rieszMellinKernel ((σ : ℂ) + (t : ℂ) * I)) := by + funext t + exact (rieszPrimeTest_hasMellin _ (by simpa using hσp)).2 + change Integrable (fun t : ℝ => mellin rieszPrimeTest ((σ : ℂ) + (t : ℂ) * I)) + rw [hfun] + exact rieszMellinKernel_verticalIntegrable σ hσ + have hi := mellinInv_mellin_eq σ rieszPrimeTest hx + (rieszPrimeTest_hasMellin (σ : ℂ) hσp).1 hF rieszPrimeTest_continuous.continuousAt + rw [← hi] + unfold mellinInv + congr 1 + apply integral_congr_ae + filter_upwards with t + rw [(rieszPrimeTest_hasMellin ((σ : ℂ) + (t : ℂ) * I) (by simpa using hσp)).2] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszMellinKernel.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszMellinKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..075e307522966cd084fbbbbecb0ccd5b0ae68f9b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszMellinKernel.lean @@ -0,0 +1,88 @@ +import Mathlib.Analysis.MellinInversion +import Mathlib.Analysis.SpecialFunctions.JapaneseBracket +import Mathlib.Tactic + +namespace OAI + +/-! # A single integral of the Chebyshev sum + +The continuous weight max(1-u,0) has Mellin transform 1/(s(s+1)). This is the +one-sided smoothing needed to recover the sharp progression count. +-/ + +namespace Ostmann + +open Complex MeasureTheory Set + +noncomputable def rieszPrimeTest (u : ℝ) : ℂ := (max (1 - u) 0 : ℝ) + +noncomputable def rieszMellinKernel (s : ℂ) : ℂ := 1 / (s * (s + 1)) + +theorem rieszPrimeTest_continuous : Continuous rieszPrimeTest := by + unfold rieszPrimeTest + fun_prop + +theorem rieszPrimeTest_hasMellin (s : ℂ) (hs : 0 < s.re) : + HasMellin rieszPrimeTest s (rieszMellinKernel s) := by + let f : ℝ → ℂ := indicator (Ioc 0 1) (fun _ => 1) + let g : ℝ → ℂ := indicator (Ioc 0 1) (fun u => (u : ℂ) ^ (1 : ℂ)) + have hf : HasMellin f s (1 / s) := hasMellin_one_Ioc hs + have hg : HasMellin g s (1 / (s + 1)) := + hasMellin_cpow_Ioc 1 (by simpa using (show 0 < s.re + 1 by linarith)) + have hsub := hasMellin_sub hf.1 hg.1 + rw [hf.2, hg.2] at hsub + have heq : EqOn (fun u => f u - g u) rieszPrimeTest (Ioi 0) := by + intro u hu + change 0 < u at hu + by_cases hle : u ≤ 1 + · have hm : u ∈ Ioc (0 : ℝ) 1 := ⟨hu, hle⟩ + simp [f, g, hm, rieszPrimeTest, + max_eq_left (sub_nonneg.mpr hle), Complex.ofReal_sub] + · have hn : u ∉ Ioc (0 : ℝ) 1 := fun h => hle h.2 + simp [f, g, indicator_of_notMem hn, rieszPrimeTest, + max_eq_right (by linarith : 1 - u ≤ 0)] + refine ⟨hsub.1.congr_fun (fun u hu => + congrArg (fun a : ℂ => (u : ℂ) ^ (s - 1) • a) (heq hu)) measurableSet_Ioi, ?_⟩ + have hi : mellin rieszPrimeTest s = mellin (fun u => f u - g u) s := by + apply setIntegral_congr_fun measurableSet_Ioi + intro u hu + exact congrArg (fun a : ℂ => (u : ℂ) ^ (s - 1) • a) (heq hu).symm + rw [hi, hsub.2] + have hsn : s ≠ 0 := by intro h; simp [h] at hs + have hs1 : s + 1 ≠ 0 := by + intro h + have hh := congrArg Complex.re h + simp only [Complex.add_re, Complex.one_re, Complex.zero_re] at hh + linarith + dsimp [rieszMellinKernel] + field_simp + ring + +theorem rieszMellinKernel_line_bound (σ t : ℝ) (hσ : 1 ≤ σ) : + ‖rieszMellinKernel ((σ : ℂ) + (t : ℂ) * I)‖ ≤ + 4 * (1 + |t|) ^ (-(2 : ℝ)) := by + let s : ℂ := (σ : ℂ) + (t : ℂ) * I + have hsre : s.re = σ := by simp [s] + have hsim : s.im = t := by simp [s] + have h1 : 1 ≤ ‖s‖ := by linarith [Complex.re_le_norm s] + have h2 : 1 ≤ ‖s + 1‖ := by + have hh := Complex.re_le_norm (s + 1) + simp only [Complex.add_re, Complex.one_re, hsre] at hh + linarith + have ht1 : |t| ≤ ‖s‖ := by simpa only [hsim] using Complex.abs_im_le_norm s + have ht2 : |t| ≤ ‖s + 1‖ := by simpa [hsim] using Complex.abs_im_le_norm (s + 1) + have ha : 0 < 1 + |t| := by positivity + have hp : (1 + |t|) ^ 2 ≤ 4 * (‖s‖ * ‖s + 1‖) := by + have hh := mul_le_mul (show 1 + |t| ≤ 2 * ‖s‖ by linarith) + (show 1 + |t| ≤ 2 * ‖s + 1‖ by linarith) (by positivity) (by positivity) + nlinarith + change ‖1 / (s * (s + 1))‖ ≤ _ + rw [norm_div, norm_one, norm_mul, Real.rpow_neg (by positivity : 0 ≤ 1 + |t|), + Real.rpow_two] + rw [← div_eq_mul_inv] + apply (div_le_div_iff₀ (by positivity : 0 < ‖s‖ * ‖s + 1‖) (sq_pos_of_pos ha)).mpr + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszNegativeTail.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszNegativeTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..1330fe357dd945b098cb19228b20e78dfbbe415f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszNegativeTail.lean @@ -0,0 +1,52 @@ +import Mathlib.MeasureTheory.Measure.Lebesgue.Integral +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszTailEstimate + +namespace OAI + +/-! # The lower right-contour tail -/ + +namespace Ostmann + +open Complex MeasureTheory Set + +theorem rightRieszIntegrand_negative_tail : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (X σ T : ℝ), 0 < X → 1 < σ → σ ≤ 2 → 0 < T → + ‖∫ t in Iic (-T), rightRieszIntegrand χ X σ t‖ ≤ + (1 / (σ - 1) + C) * X ^ σ / T := by + obtain ⟨C, hC, hb⟩ := character_logDeriv_right_pole_bound + refine ⟨C, hC, ?_⟩ + intro χ X σ T hX hσ hσ2 hT + rw [← integral_comp_neg_Ioi T (rightRieszIntegrand χ X σ)] + let K := (1 / (σ - 1) + C) * X ^ σ + have hK : 0 ≤ K := by dsimp [K]; positivity + have hg : IntegrableOn (fun t : ℝ => K * t ^ (-(2 : ℝ))) (Ioi T) := + (integrableOn_Ioi_rpow_of_lt (by norm_num) hT).const_mul K + have hn : ‖∫ t in Ioi T, rightRieszIntegrand χ X σ (-t)‖ ≤ + ∫ t in Ioi T, K * t ^ (-(2 : ℝ)) := by + apply norm_integral_le_of_norm_le hg + filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht + have htp : 0 < t := hT.trans ht + have hlog := hb χ (rieszMellinLine σ (-t)) (by simpa using hσ) (by simpa using hσ2) + simp only [rieszMellinLine_re] at hlog + have hkernel := rieszMellinKernel_im_bound (rieszMellinLine σ (-t)) (by simpa [rieszMellinLine, abs_neg, abs_of_pos htp] using htp) + simp only [rieszMellinLine, Complex.add_im, Complex.ofReal_im, Complex.mul_im, + Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, + zero_add, abs_neg, abs_of_pos htp] at hkernel + rw [rightRieszIntegrand, norm_mul, norm_neg, rieszVerticalWeight_norm X σ (-t) hX] + calc + _ ≤ (1 / (σ - 1) + C) * (X ^ σ * (1 / t ^ 2)) := by + exact mul_le_mul hlog (mul_le_mul_of_nonneg_left hkernel (Real.rpow_nonneg hX.le _)) + (by positivity) (by positivity) + _ = K * t ^ (-(2 : ℝ)) := by + rw [Real.rpow_neg htp.le, Real.rpow_two] + dsimp [K] + ring + apply hn.trans_eq + rw [integral_const_mul, integral_Ioi_rpow_of_lt (by norm_num : -(2 : ℝ) < -1) hT] + norm_num only [neg_add_cancel_left, neg_div_neg_eq, div_one, Real.rpow_neg_one] + dsimp [K] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszPoleRectangle.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszPoleRectangle.lean new file mode 100644 index 0000000000000000000000000000000000000000..40fa068be9c0ec5bbd6eaa4257515438e7e860e4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszPoleRectangle.lean @@ -0,0 +1,58 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszContourRectangle +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothContourRegularPart + +namespace OAI + +/-! # The exact contribution of a real pole to the Riesz rectangle -/ + +namespace Ostmann + +open Complex Filter Set +open scoped Topology Interval + +theorem rieszWeight_dslope_analytic (X : ℝ) (hX : 0 < X) (β : ℂ) (hβ : 0 < β.re) + (s : ℂ) (hs : 0 < s.re) : AnalyticAt ℂ (dslope (rieszContourWeight X) β) s := by + by_cases he : s = β + · subst s + obtain ⟨p, hp⟩ := rieszContourWeight_analyticAt X hX β hβ + exact ⟨p.fslope, hp.has_fpower_series_dslope_fslope⟩ + · have hh : dslope (rieszContourWeight X) β =ᶠ[𝓝 s] + (fun z => (z - β)⁻¹ * (rieszContourWeight X z - rieszContourWeight X β)) := by + filter_upwards [isOpen_ne.mem_nhds he] with z hz + rw [dslope_of_ne _ hz] + rfl + exact (((analyticAt_id.sub analyticAt_const).inv (sub_ne_zero.mpr he)).mul + ((rieszContourWeight_analyticAt X hX s hs).sub analyticAt_const)).congr hh.symm + +theorem riesz_pole_rectangle (X : ℝ) (hX : 0 < X) (β a b c d : ℝ) + (ha : 0 < a) (hab : a < β) (hβb : β < b) (hc : c < 0) (hd : 0 < d) : + rectangleBoundaryIntegral (fun s => rieszContourWeight X s / (s - (β : ℂ))) a b c d = + (2 * (Real.pi : ℂ) * I) * rieszContourWeight X (β : ℂ) := by + let W := rieszContourWeight X + let g := dslope W (β : ℂ) + have hg : ∀ s ∈ uIcc a b ×ℂ uIcc c d, AnalyticAt ℂ g s := by + intro s hs + apply rieszWeight_dslope_analytic X hX (β : ℂ) (by simpa using ha.trans hab) s + exact ha.trans_le ((uIcc_of_le (hab.trans hβb).le) ▸ hs.1).1 + have hnot (s : ℂ) (hs : s ∈ contourRectangleBoundary a b c d) : s ≠ (β : ℂ) := + contourBoundary_ne_interior ⟨hab, hβb, hc, hd⟩ hs + have hgI : RectangleIntegrable g a b c d := rectangleIntegrable_of_continuousOn + (fun s hs => (hg s ⟨hs.1, hs.2.1⟩).continuousAt.continuousWithinAt) + have hpI : RectangleIntegrable (fun s => W (β : ℂ) * (s - (β : ℂ))⁻¹) a b c d := + (rectangleIntegrable_sub_inv ⟨hab, hβb, hc, hd⟩).const_mul _ + have heq : rectangleBoundaryIntegral (fun s => W s / (s - (β : ℂ))) a b c d = + rectangleBoundaryIntegral (fun s => g s + W (β : ℂ) * (s - (β : ℂ))⁻¹) a b c d := by + apply rectangleBoundaryIntegral_congr + intro s hs + dsimp [g] + rw [dslope_of_ne _ (hnot s hs)] + simp only [slope, smul_eq_mul, vsub_eq_sub] + ring + rw [heq, rectangleBoundaryIntegral_add hgI hpI, + rectangleBoundaryIntegral_eq_zero hg, zero_add, rectangleBoundaryIntegral_const_mul, + rectangleBoundaryIntegral_sub_inv (β : ℂ) a b c d hab hβb hc hd] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszPositiveRecovery.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszPositiveRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..b6d556d3ca2e8103cb7bf2a47a8e5d7177d18ed4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszPositiveRecovery.lean @@ -0,0 +1,39 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszUnsmoothing + +namespace OAI + +/-! # Positive finite differences recover the sharp arithmetic count -/ + +namespace Ostmann + +open scoped BigOperators + +theorem finiteRieszSum_recover (S : Finset ℕ) (w : ℕ → ℝ) (x h m D : ℝ) + (hh : 0 < h) (hw : ∀ n ∈ S, 0 ≤ w n) + (hplus : finiteRieszSum S w (x + h) - finiteRieszSum S w x ≤ h * m + D) + (hminus : h * m - D ≤ finiteRieszSum S w x - finiteRieszSum S w (x - h)) : + |(∑ n ∈ S.filter (fun n : ℕ => (n : ℝ) ≤ x), w n) - m| ≤ D / h := by + have hupper := (finiteRieszSum_step S w x h hh.le hw).1 + have hlower := (finiteRieszSum_step S w (x - h) h hh.le hw).2 + rw [sub_add_cancel] at hlower + have habs : |h * ((∑ n ∈ S.filter (fun n : ℕ => (n : ℝ) ≤ x), w n) - m)| ≤ D := by + rw [abs_le] + constructor <;> nlinarith + rw [abs_mul, abs_of_pos hh] at habs + exact (le_div_iff₀ hh).mpr (by nlinarith) + +theorem finiteRieszSum_quadratic_recovery (S : Finset ℕ) (w : ℕ → ℝ) (x h E : ℝ) + (hh : 0 < h) (hw : ∀ n ∈ S, 0 ≤ w n) + (hzero : |finiteRieszSum S w x - x ^ 2 / 2| ≤ E) + (hplus : |finiteRieszSum S w (x + h) - (x + h) ^ 2 / 2| ≤ E) + (hminus : |finiteRieszSum S w (x - h) - (x - h) ^ 2 / 2| ≤ E) : + |(∑ n ∈ S.filter (fun n : ℕ => (n : ℝ) ≤ x), w n) - x| ≤ h / 2 + 2 * E / h := by + have hb := finiteRieszSum_recover S w x h x (h ^ 2 / 2 + 2 * E) hh hw + (by have ha := (abs_le.mp hplus).2; have hc := (abs_le.mp hzero).1; nlinarith) + (by have ha := (abs_le.mp hminus).2; have hc := (abs_le.mp hzero).1; nlinarith) + convert hb using 1 + field_simp + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszPrimeRemoval.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszPrimeRemoval.lean new file mode 100644 index 0000000000000000000000000000000000000000..b9f4762772eb3651906b6c990981aa4ed1b42da3 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszPrimeRemoval.lean @@ -0,0 +1,65 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ArithmeticRieszMean +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothPrimePowerRemoval + +namespace OAI + +/-! # Higher prime powers in the literal Riesz mean -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +noncomputable def rieszPrimeMean (g : ℕ → ℂ) (X : ℝ) : ℂ := + ∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter Nat.Prime, + (Real.log n : ℂ) * g n * rieszPrimeTest (n / X) + +theorem rieszTwistMean_sub (g h : ℕ → ℂ) (X : ℝ) : + rieszTwistMean g X - rieszTwistMean h X = rieszTwistMean (fun n => g n - h n) X := by + simp only [rieszTwistMean, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro n _ + ring + +theorem rieszTwistMean_sub_prime (g : ℕ → ℂ) (X : ℝ) : + rieszTwistMean g X - rieszPrimeMean g X = + ∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter (fun n => ¬ n.Prime), + (ArithmeticFunction.vonMangoldt n : ℂ) * g n * rieszPrimeTest (n / X) := by + have hh := Finset.sum_filter_add_sum_filter_not (Finset.Ioc 0 ⌊X⌋₊) Nat.Prime + (fun n => (ArithmeticFunction.vonMangoldt n : ℂ) * g n * rieszPrimeTest (n / X)) + have hp : (∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter Nat.Prime, + (ArithmeticFunction.vonMangoldt n : ℂ) * g n * rieszPrimeTest (n / X)) = rieszPrimeMean g X := by + apply Finset.sum_congr rfl + intro n hn + rw [ArithmeticFunction.vonMangoldt_apply_prime (Finset.mem_filter.mp hn).2] + rw [hp] at hh + change rieszPrimeMean g X + _ = rieszTwistMean g X at hh + linear_combination -hh + +theorem rieszTwistMean_prime_error (g : ℕ → ℂ) (X B : ℝ) + (hX : 1 ≤ X) (hB : 0 ≤ B) (hg : ∀ n, ‖g n‖ ≤ B) : + ‖rieszTwistMean g X - rieszPrimeMean g X‖ ≤ B * (2 * Real.sqrt X * Real.log X) := by + rw [rieszTwistMean_sub_prime] + calc + _ ≤ ∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter (fun n => ¬ n.Prime), + ‖(ArithmeticFunction.vonMangoldt n : ℂ) * g n * rieszPrimeTest (n / X)‖ := norm_sum_le _ _ + _ ≤ ∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter (fun n => ¬ n.Prime), + B * ArithmeticFunction.vonMangoldt n := by + apply Finset.sum_le_sum + intro n _ + rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg ArithmeticFunction.vonMangoldt_nonneg] + have hw := rieszPrimeTest_norm_le_one (n / X) (by positivity) + calc + _ ≤ (ArithmeticFunction.vonMangoldt n * B) * 1 := + mul_le_mul (mul_le_mul_of_nonneg_left (hg n) ArithmeticFunction.vonMangoldt_nonneg) + hw (norm_nonneg _) (by positivity) + _ = _ := by ring + _ = B * (Chebyshev.psi X - Chebyshev.theta X) := by + rw [← Finset.mul_sum, nonprime_mangoldt_sum] + _ ≤ B * (2 * Real.sqrt X * Real.log X) := mul_le_mul_of_nonneg_left + ((le_abs_self _).trans (Chebyshev.abs_psi_sub_theta_le_sqrt_mul_log hX)) hB + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszRectangleBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszRectangleBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..d23558f324886f9701c603cf26d6af77ba89d2d2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszRectangleBound.lean @@ -0,0 +1,49 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszTruncation +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszLeftEstimate + +namespace OAI + +/-! # A quantitative Riesz estimate from a zero-free rectangle -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped Interval + +theorem characterRieszMean_rectangle_bound : ∃ K C : ℝ, 0 < K ∧ 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (X a b T M : ℝ), + 1 ≤ X → 1 / 2 ≤ a → a ≤ b → 1 < b → b ≤ 2 → 0 < T → 0 ≤ M → + (∀ z ∈ uIcc a b ×ℂ uIcc (-T) T, χ.L z ≠ 0) → + (∀ z ∈ uIcc a b ×ℂ uIcc (-T) T, ‖logDeriv χ.L z‖ ≤ M) → + ‖characterRieszMean χ X‖ ≤ K * M * X ^ a + + 2 * (M * X ^ b / T ^ 2) * (b - a) + + 2 * (1 / (b - 1) + C) * X ^ b / T := by + obtain ⟨K, hK, hleft⟩ := leftRieszIntegrand_segment_bound + obtain ⟨C, hC, htrunc⟩ := characterRieszMean_truncation + refine ⟨K, C, hK, hC, ?_⟩ + intro χ X a b T M hX ha hab hb hb2 hT hM hne hbound + have hXp : 0 < X := by linarith + have hpt (σ t : ℝ) (hσ : σ ∈ Icc a b) (ht : t ∈ Icc (-T) T) : + ‖logDeriv χ.L ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M := by + apply hbound _ ⟨?_, ?_⟩ + · simpa [uIcc_of_le hab] using hσ + · simpa [uIcc_of_le (show -T ≤ T by linarith)] using ht + have hl := hleft χ X a T M hXp ha hM (fun t ht => hpt a t ⟨le_rfl, hab⟩ ht) + have hl' : ‖∫ t in -T..T, rightRieszIntegrand χ X a t‖ ≤ K * M * X ^ a := by + simpa only [intervalIntegral.integral_of_le (show -T ≤ T by linarith), + integral_Icc_eq_integral_Ioc] using hl + have hu := riesz_horizontal_segment_bound χ X a b T M hX hab + (by rwa [abs_of_pos hT]) hM (fun σ hσ => hpt σ T hσ ⟨by linarith, le_rfl⟩) + have hd := riesz_horizontal_segment_bound χ X a b (-T) M hX hab + (by rwa [abs_neg, abs_of_pos hT]) hM (fun σ hσ => hpt σ (-T) hσ ⟨le_rfl, by linarith⟩) + rw [neg_sq] at hd + have hz := rieszContour_rectangle_zero χ X hXp a b (-T) T (by linarith) hab hne + have hv := rectangle_vertical_shift_norm_bound _ a b (-T) T hz + change ‖∫ t in -T..T, rightRieszIntegrand χ X b t‖ ≤ + ‖∫ t in -T..T, rightRieszIntegrand χ X a t‖ + _ + _ at hv + have hm := htrunc χ X b T hXp hb hb2 hT + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszResidueError.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszResidueError.lean new file mode 100644 index 0000000000000000000000000000000000000000..a81560fec7c47ac2788a4b1d94842860499620d9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszResidueError.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.InducedCharacterRieszDecay + +namespace OAI + +/-! # Passing uniform character errors to a single residue class -/ + +namespace Ostmann + +open Complex Filter +open scoped BigOperators + +theorem rieszResidueMean_error_bound (q : ℕ) [NeZero q] (a : ZMod q) + (ha : IsUnit a) (X E : ℝ) (_hE : 0 ≤ E) (M : DirichletCharacter ℂ q → ℂ) + (herror : ∀ χ, ‖rieszTwistMean (fun n => χ (n : ZMod q)) X - M χ‖ ≤ E) : + ‖(q.totient : ℂ) * rieszResidueMean q a X - ∑ χ, χ a⁻¹ * M χ‖ ≤ (q.totient : ℝ) * E := by + rw [rieszResidueMean_orthogonality q a ha X, ← Finset.sum_sub_distrib] + calc + _ ≤ ∑ χ : DirichletCharacter ℂ q, + ‖χ a⁻¹ * rieszTwistMean (fun n => χ (n : ZMod q)) X - χ a⁻¹ * M χ‖ := norm_sum_le _ _ + _ ≤ ∑ _χ : DirichletCharacter ℂ q, E := by + apply Finset.sum_le_sum + intro χ _ + rw [← mul_sub, norm_mul] + exact (mul_le_mul (χ.norm_le_one _) (herror χ) (norm_nonneg _) zero_le_one).trans_eq (one_mul E) + _ = (q.totient : ℝ) * E := by + rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, ← Nat.card_eq_fintype_card, + DirichletCharacter.card_eq_totient_of_hasEnoughRootsOfUnity] + +theorem rieszResidueMean_average_error_bound (q : ℕ) [NeZero q] (a : ZMod q) + (ha : IsUnit a) (X E : ℝ) (hE : 0 ≤ E) (M : DirichletCharacter ℂ q → ℂ) + (herror : ∀ χ, ‖rieszTwistMean (fun n => χ (n : ZMod q)) X - M χ‖ ≤ E) : + ‖rieszResidueMean q a X - (q.totient : ℂ)⁻¹ * ∑ χ, χ a⁻¹ * M χ‖ ≤ E := by + have ht := rieszResidueMean_error_bound q a ha X E hE M herror + have hpos : 0 < (q.totient : ℝ) := by + exact_mod_cast Nat.totient_pos.mpr (Nat.pos_of_ne_zero (NeZero.ne q)) + have hne : (q.totient : ℂ) ≠ 0 := by exact_mod_cast hpos.ne' + have heq : (q.totient : ℂ) * (rieszResidueMean q a X - + (q.totient : ℂ)⁻¹ * ∑ χ, χ a⁻¹ * M χ) = + (q.totient : ℂ) * rieszResidueMean q a X - ∑ χ, χ a⁻¹ * M χ := by + field_simp + rw [← heq, norm_mul, Complex.norm_natCast] at ht + exact (mul_le_mul_iff_right₀ hpos).mp (by simpa only [mul_comm] using ht) + +theorem rieszResidueMean_reduced_error : ∃ d : ℝ, 0 < d ∧ + ∀ᶠ X : ℝ in atTop, ∀ q : ℕ, 1 ≤ q → + (q : ℝ) ≤ Real.exp (Real.sqrt (Real.log X)) → + ∀ [NeZero q] (a : ZMod q), IsUnit a → + ‖rieszResidueMean q a X - (q.totient : ℂ)⁻¹ * + ∑ χ : DirichletCharacter ℂ q, χ a⁻¹ * + reducedRieszMain q (primitiveCharacterReduction χ) X‖ ≤ + 4 * X * Real.exp (-d * Real.sqrt (Real.log X)) := by + obtain ⟨d, hd, h⟩ := induced_character_riesz_decay + refine ⟨d, hd, ?_⟩ + filter_upwards [h, eventually_ge_atTop (1 : ℝ)] with X hX hX1 + intro q hq hqX inst a ha + exact rieszResidueMean_average_error_bound q a ha X _ (by positivity) _ (hX q hq hqX) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszResidueTruncation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszResidueTruncation.lean new file mode 100644 index 0000000000000000000000000000000000000000..4af0b3ac38fcf8c770071a03770c7b2cdda8abdf --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszResidueTruncation.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.WeightedRieszTails +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszTruncation + +namespace OAI + +/-! # Truncation while retaining the precise main residue -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped Interval + +theorem riesz_residue_truncation (f : ℂ → ℂ) (X b M T : ℝ) (v : ℂ) + (hX : 0 < X) (hb : 1 ≤ b) (hM : 0 ≤ M) (hT : 0 < T) + (hc : Continuous (fun t : ℝ => f (rieszMellinLine b t))) + (hbound : ∀ t : ℝ, ‖f (rieszMellinLine b t)‖ ≤ M) : + ‖((1 / (2 * Real.pi) : ℝ) : ℂ) * + (∫ t : ℝ, f (rieszMellinLine b t) * rieszVerticalWeight X b t) - v‖ ≤ + ‖(∫ t in -T..T, f (rieszMellinLine b t) * rieszVerticalWeight X b t) - + ((2 * Real.pi : ℝ) : ℂ) * v‖ + 2 * M * X ^ b / T := by + let F : ℝ → ℂ := fun t => f (rieszMellinLine b t) * rieszVerticalWeight X b t + let τ : ℂ := ((1 / (2 * Real.pi) : ℝ) : ℂ) + let q : ℂ := ((2 * Real.pi : ℝ) : ℂ) + have hnorm : ‖τ‖ ≤ 1 := by + dsimp [τ] + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (by positivity)] + exact (div_le_one (by positivity : 0 < 2 * Real.pi)).mpr (by linarith [Real.pi_gt_three]) + have hτ : τ * q = 1 := by + dsimp [τ, q] + norm_cast + exact div_mul_cancel₀ 1 (by positivity : 2 * Real.pi ≠ 0) + have hi : Integrable F := weightedRiesz_integrable f X b M hX hb hc hbound + obtain ⟨hp, hn⟩ := weightedRiesz_both_tails f X b M T hX hM hT hbound + have he : τ * (∫ t : ℝ, F t) - v = τ * + ((∫ t in Iic (-T), F t) + ((∫ t in -T..T, F t) - q * v) + (∫ t in Ioi T, F t)) := by + rw [integral_three_parts F hi T] + linear_combination (congrArg (fun z : ℂ => z * v) hτ) + change ‖τ * (∫ t : ℝ, F t) - v‖ ≤ ‖(∫ t in -T..T, F t) - q * v‖ + _ + rw [he, norm_mul] + apply (mul_le_of_le_one_left (norm_nonneg _) hnorm).trans + have hh := (norm_add_le ((∫ t in Iic (-T), F t) + ((∫ t in -T..T, F t) - q * v)) + (∫ t in Ioi T, F t)).trans + (add_le_add (norm_add_le (∫ t in Iic (-T), F t) ((∫ t in -T..T, F t) - q * v)) le_rfl) + change ‖∫ t in Ioi T, F t‖ ≤ _ at hp + change ‖∫ t in Iic (-T), F t‖ ≤ _ at hn + calc + _ ≤ ‖∫ t in Iic (-T), F t‖ + ‖(∫ t in -T..T, F t) - q * v‖ + + ‖∫ t in Ioi T, F t‖ := hh + _ ≤ M * X ^ b / T + ‖(∫ t in -T..T, F t) - q * v‖ + M * X ^ b / T := + add_le_add (add_le_add hn le_rfl) hp + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszSingleZeroRectangle.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszSingleZeroRectangle.lean new file mode 100644 index 0000000000000000000000000000000000000000..747a37ef20b97cb17d221d4f76d8b77433e8c1ca --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszSingleZeroRectangle.lean @@ -0,0 +1,103 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszPoleRectangle +import OAI.NumberTheory.Ostmann.Characters.CharacterLogDerivativePole + +namespace OAI + +/-! # The actual one-zero contribution to a character Riesz rectangle -/ + +namespace Ostmann + +open Complex Filter Set +open scoped Topology Interval + +theorem rieszContour_regular_part (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (z : ℂ) (hz : 0 < z.re) : + ∃ R : ℂ → ℂ, AnalyticAt ℂ R z ∧ + (fun s => -logDeriv χ.L s * rieszContourWeight X s + + (analyticOrderNatAt χ.L z : ℂ) * rieszContourWeight X z / (s - z)) =ᶠ[𝓝[≠] z] R := by + obtain ⟨g, hg, hgne, hsplit⟩ := χ.logDeriv_local_split z + let W := rieszContourWeight X + have hW : AnalyticAt ℂ W z := rieszContourWeight_analyticAt X hX z hz + have hds := rieszWeight_dslope_analytic X hX z hz z hz + have hlog : AnalyticAt ℂ (logDeriv g) z := hg.deriv.div hg hgne + let R : ℂ → ℂ := fun s => -(analyticOrderNatAt χ.L z : ℂ) * dslope W z s - logDeriv g s * W s + refine ⟨R, (analyticAt_const.mul hds).sub (hlog.mul hW), ?_⟩ + filter_upwards [hsplit, self_mem_nhdsWithin] with s hs hsz + rw [hs] + dsimp only [R] + rw [dslope_of_ne W hsz] + simp only [slope, smul_eq_mul, vsub_eq_sub] + ring + +theorem rieszContour_single_regularization (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (K : Set ℂ) (z : ℂ) (hz : 0 < z.re) + (hK : ∀ s ∈ K, 0 < s.re) (hzeros : ∀ s ∈ K, χ.L s = 0 → s = z) : + ∃ F : ℂ → ℂ, AnalyticOnNhd ℂ F K ∧ ∀ s ≠ z, + F s = -logDeriv χ.L s * rieszContourWeight X s + + (analyticOrderNatAt χ.L z : ℂ) * rieszContourWeight X z / (s - z) := by + classical + obtain ⟨R, hR, heR⟩ := rieszContour_regular_part χ X hX z hz + let f : ℂ → ℂ := fun s => -logDeriv χ.L s * rieszContourWeight X s + + (analyticOrderNatAt χ.L z : ℂ) * rieszContourWeight X z / (s - z) + let F : ℂ → ℂ := fun s => if s = z then R z else f s + refine ⟨F, ?_, fun s hs => by simp [F, hs, f]⟩ + intro s hsK + by_cases hs : s = z + · subst s + apply hR.congr + have he : ∀ᶠ s in 𝓝 z, s ≠ z → f s = R s := by + simpa only [mem_compl_iff, mem_singleton_iff, f] using (eventually_nhdsWithin_iff.mp heR) + filter_upwards [he] with s hs + by_cases hsz : s = z + · simp [F, hsz] + · simpa only [F, ite_eq_right hsz] using (hs hsz).symm + · have hn : χ.L s ≠ 0 := fun he => hs (hzeros s hsK he) + have hf : AnalyticAt ℂ f s := by + apply (((χ.L_analytic s).deriv.div (χ.L_analytic s) hn).neg.mul + (rieszContourWeight_analyticAt X hX s (hK s hsK))).add + exact analyticAt_const.div (analyticAt_id.sub analyticAt_const) (sub_ne_zero.mpr hs) + apply hf.congr + filter_upwards [isOpen_ne.mem_nhds hs] with t ht + simp [F, ht] + +theorem rieszContour_single_zero_rectangle (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (a b c d : ℝ) (z : ℂ) + (ha : 0 < a) (haz : a < z.re) (hzb : z.re < b) (hcz : c < z.im) (hzd : z.im < d) + (hzeros : ∀ s ∈ uIcc a b ×ℂ uIcc c d, χ.L s = 0 → s = z) : + rectangleBoundaryIntegral (fun s => -logDeriv χ.L s * rieszContourWeight X s) a b c d = + -(2 * (Real.pi : ℂ) * I) * + ((analyticOrderNatAt χ.L z : ℂ) * rieszContourWeight X z) := by + let f : ℂ → ℂ := fun s => -logDeriv χ.L s * rieszContourWeight X s + let v : ℂ := (analyticOrderNatAt χ.L z : ℂ) * rieszContourWeight X z + let p : ℂ → ℂ := fun s => v * (s - z)⁻¹ + have hpos (s : ℂ) (hs : s ∈ uIcc a b ×ℂ uIcc c d) : 0 < s.re := + ha.trans_le ((uIcc_of_le (haz.trans hzb).le) ▸ hs.1).1 + obtain ⟨F, hF, heF⟩ := rieszContour_single_regularization χ X hX + (uIcc a b ×ℂ uIcc c d) z (ha.trans haz) hpos hzeros + have hnot (s : ℂ) (hs : s ∈ contourRectangleBoundary a b c d) : s ≠ z := + contourBoundary_ne_interior ⟨haz, hzb, hcz, hzd⟩ hs + have hf : RectangleIntegrable f a b c d := by + apply rectangleIntegrable_of_continuousOn + intro s hs + have hn : χ.L s ≠ 0 := fun he => hnot s hs (hzeros s ⟨hs.1, hs.2.1⟩ he) + exact ((((χ.L_analytic s).deriv.div (χ.L_analytic s) hn).neg).mul + (rieszContourWeight_analyticAt X hX s (hpos s ⟨hs.1, hs.2.1⟩))).continuousAt.continuousWithinAt + have hp : RectangleIntegrable p a b c d := + (rectangleIntegrable_sub_inv ⟨haz, hzb, hcz, hzd⟩).const_mul v + have he : rectangleBoundaryIntegral F a b c d = + rectangleBoundaryIntegral (fun s => f s + p s) a b c d := by + apply rectangleBoundaryIntegral_congr + intro s hs + simpa only [f, p, v, div_eq_mul_inv] using heF s (hnot s hs) + have hzero := rectangleBoundaryIntegral_eq_zero hF + have hpval : rectangleBoundaryIntegral p a b c d = (2 * (Real.pi : ℂ) * I) * v := by + rw [show p = (fun s => v * (s - z)⁻¹) from rfl, rectangleBoundaryIntegral_const_mul, + rectangleBoundaryIntegral_sub_inv z a b c d haz hzb hcz hzd] + ring + rw [he, rectangleBoundaryIntegral_add hf hp, hpval] at hzero + change rectangleBoundaryIntegral f a b c d = -(2 * (Real.pi : ℂ) * I) * v + linear_combination hzero + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszSmoothRecovery.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszSmoothRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc667e027731788b1bd36e4d04e78fdc09f0393b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszSmoothRecovery.lean @@ -0,0 +1,65 @@ +import Mathlib.Analysis.Calculus.MeanValue +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszPositiveRecovery + +namespace OAI + +/-! # Positive unsmoothing with a twice differentiable main term -/ + +namespace Ostmann + +open Set +open scoped BigOperators + +theorem smooth_main_remainder_pair (F f f' : ℝ → ℝ) (x h : ℝ) (hh : 0 < h) + (hF : ∀ t ∈ Icc (x - h) (x + h), HasDerivAt F (f t) t) + (hf : ∀ t ∈ Icc (x - h) (x + h), HasDerivAt f (f' t) t) + (hb : ∀ t ∈ Icc (x - h) (x + h), |f' t| ≤ 2) : + |F (x + h) - F x - h * f x| ≤ 2 * h ^ 2 ∧ + |F x - F (x - h) - h * f x| ≤ 2 * h ^ 2 := by + let K := Icc (x - h) (x + h) + have hx : x ∈ K := ⟨by linarith, by linarith⟩ + have hp : x + h ∈ K := ⟨by linarith, le_rfl⟩ + have hm : x - h ∈ K := ⟨le_rfl, by linarith⟩ + have hlocal (t : ℝ) (ht : t ∈ K) : ‖f t - f x‖ ≤ 2 * h := by + have hl := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le + (fun y hy => (hf y hy).hasDerivWithinAt) + (fun y hy => by simpa only [Real.norm_eq_abs] using hb y hy) + (convex_Icc (x - h) (x + h)) hx ht + have ha : |t - x| ≤ h := abs_le.mpr ⟨by have := ht.1; linarith, by have := ht.2; linarith⟩ + simpa only [Real.norm_eq_abs] using hl.trans (mul_le_mul_of_nonneg_left ha (by norm_num)) + let G : ℝ → ℝ := fun t => F t - f x * t + have hg (t : ℝ) (ht : t ∈ K) : HasDerivAt G (f t - f x) t := by + have hh := (hF t ht).sub ((hasDerivAt_id t).const_mul (f x)) + change HasDerivAt (fun y => F y - f x * y) (f t - f x * 1) t at hh + simpa only [mul_one] using hh + have hplus := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le + (fun t ht => (hg t ht).hasDerivWithinAt) hlocal (convex_Icc (x - h) (x + h)) hx hp + have hminus := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le + (fun t ht => (hg t ht).hasDerivWithinAt) hlocal (convex_Icc (x - h) (x + h)) hm hx + have hep : G (x + h) - G x = F (x + h) - F x - h * f x := by dsimp [G]; ring + have hem : G x - G (x - h) = F x - F (x - h) - h * f x := by dsimp [G]; ring + rw [hep, Real.norm_eq_abs, show x + h - x = h by ring, Real.norm_eq_abs, + abs_of_pos hh] at hplus + rw [hem, Real.norm_eq_abs, show x - (x - h) = h by ring, Real.norm_eq_abs, + abs_of_pos hh] at hminus + exact ⟨by nlinarith, by nlinarith⟩ + +theorem finiteRieszSum_smooth_recovery (S : Finset ℕ) (w : ℕ → ℝ) + (F : ℝ → ℝ) (x h m E : ℝ) (hh : 0 < h) (hw : ∀ n ∈ S, 0 ≤ w n) + (hzero : |finiteRieszSum S w x - F x| ≤ E) + (hplus : |finiteRieszSum S w (x + h) - F (x + h)| ≤ E) + (hminus : |finiteRieszSum S w (x - h) - F (x - h)| ≤ E) + (hFplus : |F (x + h) - F x - h * m| ≤ 2 * h ^ 2) + (hFminus : |F x - F (x - h) - h * m| ≤ 2 * h ^ 2) : + |(∑ n ∈ S.filter (fun n : ℕ => (n : ℝ) ≤ x), w n) - m| ≤ 2 * h + 2 * E / h := by + have hb := finiteRieszSum_recover S w x h m (2 * h ^ 2 + 2 * E) hh hw + (by have ha := (abs_le.mp hplus).2; have hc := (abs_le.mp hzero).1 + have hf := (abs_le.mp hFplus).2; linarith) + (by have ha := (abs_le.mp hminus).2; have hc := (abs_le.mp hzero).1 + have hf := (abs_le.mp hFminus).1; linarith) + convert hb using 1 + field_simp + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszTailEstimate.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszTailEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3862ea20d63be219364a015af79ff97f97e4f18 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszTailEstimate.lean @@ -0,0 +1,65 @@ +import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszDirichletIntegral +import OAI.NumberTheory.Ostmann.Characters.CharacterAbsoluteRightBound + +namespace OAI + +/-! # Explicit right-contour tails for the Riesz integral -/ + +namespace Ostmann + +open Complex MeasureTheory Set + +theorem rieszMellinKernel_im_bound (s : ℂ) (ht : 0 < |s.im|) : + ‖rieszMellinKernel s‖ ≤ 1 / |s.im| ^ 2 := by + have hs : 0 < ‖s‖ := ht.trans_le (Complex.abs_im_le_norm s) + have hs1 : |s.im| ≤ ‖s + 1‖ := by simpa using Complex.abs_im_le_norm (s + 1) + have hprod : |s.im| ^ 2 ≤ ‖s‖ * ‖s + 1‖ := by + simpa only [pow_two] using mul_le_mul (Complex.abs_im_le_norm s) hs1 ht.le (norm_nonneg s) + rw [rieszMellinKernel, norm_div, norm_one, norm_mul] + exact div_le_div_of_nonneg_left zero_le_one (sq_pos_of_pos ht) hprod + +noncomputable def rightRieszIntegrand (χ : PrimitiveComplexCharacter) + (X σ t : ℝ) : ℂ := + -logDeriv χ.L (rieszMellinLine σ t) * rieszVerticalWeight X σ t + +theorem rightRieszIntegrand_tail : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (X σ T : ℝ), 0 < X → 1 < σ → σ ≤ 2 → 0 < T → + ‖∫ t in Ioi T, rightRieszIntegrand χ X σ t‖ ≤ + (1 / (σ - 1) + C) * X ^ σ / T := by + obtain ⟨C, hC, hb⟩ := character_logDeriv_right_pole_bound + refine ⟨C, hC, ?_⟩ + intro χ X σ T hX hσ hσ2 hT + let K := (1 / (σ - 1) + C) * X ^ σ + have hK : 0 ≤ K := by dsimp [K]; positivity + have hg : IntegrableOn (fun t : ℝ => K * t ^ (-(2 : ℝ))) (Ioi T) := + (integrableOn_Ioi_rpow_of_lt (by norm_num) hT).const_mul K + have hn : ‖∫ t in Ioi T, rightRieszIntegrand χ X σ t‖ ≤ + ∫ t in Ioi T, K * t ^ (-(2 : ℝ)) := by + apply norm_integral_le_of_norm_le hg + filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht + have htp : 0 < t := hT.trans ht + have hlog := hb χ (rieszMellinLine σ t) (by simpa using hσ) (by simpa using hσ2) + simp only [rieszMellinLine_re] at hlog + have hkernel := rieszMellinKernel_im_bound (rieszMellinLine σ t) (by simpa [rieszMellinLine, abs_of_pos htp] using htp) + simp only [rieszMellinLine, Complex.add_im, Complex.ofReal_im, Complex.mul_im, + Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, + zero_add, abs_of_pos htp] at hkernel + rw [rightRieszIntegrand, norm_mul, norm_neg, rieszVerticalWeight_norm X σ t hX] + calc + _ ≤ (1 / (σ - 1) + C) * (X ^ σ * (1 / t ^ 2)) := by + exact mul_le_mul hlog (mul_le_mul_of_nonneg_left hkernel (Real.rpow_nonneg hX.le _)) + (by positivity) (by positivity) + _ = K * t ^ (-(2 : ℝ)) := by + rw [Real.rpow_neg htp.le, Real.rpow_two] + dsimp [K] + ring + apply hn.trans_eq + rw [integral_const_mul, integral_Ioi_rpow_of_lt (by norm_num : -(2 : ℝ) < -1) hT] + norm_num only [neg_add_cancel_left, neg_div_neg_eq, div_one, Real.rpow_neg_one] + dsimp [K] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszTruncation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszTruncation.lean new file mode 100644 index 0000000000000000000000000000000000000000..441f826a1b54298ddb8729444f546984e46efa1f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszTruncation.lean @@ -0,0 +1,87 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszNegativeTail +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszHorizontalEstimate +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterContourZeros + +namespace OAI + +/-! # The exact finite-rectangle truncation of the Riesz integral -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped Interval + +theorem rightRieszIntegrand_integrable (χ : PrimitiveComplexCharacter) + (X b : ℝ) (hX : 0 < X) (hb : 1 < b) (hb2 : b ≤ 2) : + Integrable (rightRieszIntegrand χ X b) := by + obtain ⟨C, hC, hbound⟩ := character_logDeriv_right_pole_bound + have hcL : Continuous χ.L := continuous_iff_continuousAt.mpr + (fun s => (χ.L_analytic s).continuousAt) + have hcD : Continuous (deriv χ.L) := continuous_iff_continuousAt.mpr + (fun s => (χ.L_analytic s).deriv.continuousAt) + have hn (t : ℝ) : χ.L (rieszMellinLine b t) ≠ 0 := + χ.L_ne_zero_one_le_re _ (by simpa using hb.le) + have hcont : Continuous (rightRieszIntegrand χ X b) := by + change Continuous (fun t => -(deriv χ.L (rieszMellinLine b t) / + χ.L (rieszMellinLine b t)) * rieszVerticalWeight X b t) + exact ((hcD.comp (rieszMellinLine_continuous b)).div + (hcL.comp (rieszMellinLine_continuous b)) hn).neg.mul + (rieszVerticalWeight_continuous X b hX (by linarith)) + apply ((rieszVerticalWeight_integrable X b hX hb.le).norm.const_mul + (1 / (b - 1) + C)).mono' hcont.aestronglyMeasurable + filter_upwards with t + rw [rightRieszIntegrand, norm_mul, norm_neg] + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + simpa only [rieszMellinLine_re] using hbound χ (rieszMellinLine b t) + (by simpa using hb) (by simpa using hb2) + +theorem integral_three_parts (f : ℝ → ℂ) (hf : Integrable f) (T : ℝ) : + (∫ t : ℝ, f t) = (∫ t in Iic (-T), f t) + (∫ t in -T..T, f t) + + (∫ t in Ioi T, f t) := by + have hfull := intervalIntegral.integral_Iic_add_Ioi (b := T) hf.integrableOn hf.integrableOn + have hseg := intervalIntegral.integral_Iic_sub_Iic (a := -T) (b := T) + hf.integrableOn hf.integrableOn + linear_combination hseg - hfull + +theorem characterRieszMean_truncation : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (X b T : ℝ), 0 < X → 1 < b → b ≤ 2 → 0 < T → + ‖characterRieszMean χ X‖ ≤ + ‖∫ t in -T..T, rightRieszIntegrand χ X b t‖ + + 2 * (1 / (b - 1) + C) * X ^ b / T := by + obtain ⟨C1, hC1, hpos⟩ := rightRieszIntegrand_tail + obtain ⟨C2, hC2, hneg⟩ := rightRieszIntegrand_negative_tail + refine ⟨C1 + C2, by positivity, ?_⟩ + intro χ X b T hX hb hb2 hT + have hp := hpos χ X b T hX hb hb2 hT + have hn := hneg χ X b T hX hb hb2 hT + have hf := rightRieszIntegrand_integrable χ X b hX hb hb2 + have hnorm : ‖characterRieszMean χ X‖ ≤ ‖∫ t : ℝ, rightRieszIntegrand χ X b t‖ := by + rw [characterRieszMean_eq_vertical_logDerivative χ X b hX hb, norm_mul] + have hc : ‖((1 / (2 * Real.pi) : ℝ) : ℂ)‖ ≤ 1 := by + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (by positivity)] + exact (div_le_one (by positivity : 0 < 2 * Real.pi)).mpr (by linarith [Real.pi_gt_three]) + exact mul_le_of_le_one_left (norm_nonneg _) hc + have hsum : ‖∫ t : ℝ, rightRieszIntegrand χ X b t‖ ≤ + ‖∫ t in Iic (-T), rightRieszIntegrand χ X b t‖ + + ‖∫ t in -T..T, rightRieszIntegrand χ X b t‖ + + ‖∫ t in Ioi T, rightRieszIntegrand χ X b t‖ := by + rw [integral_three_parts _ hf T] + exact (norm_add_le _ _).trans (add_le_add (norm_add_le _ _) le_rfl) + have hbase : 0 ≤ X ^ b / T := div_nonneg (Real.rpow_nonneg hX.le _) hT.le + have hslack := mul_nonneg (show 0 ≤ C1 + C2 by positivity) hbase + calc + _ ≤ ‖∫ t in Iic (-T), rightRieszIntegrand χ X b t‖ + + ‖∫ t in -T..T, rightRieszIntegrand χ X b t‖ + + ‖∫ t in Ioi T, rightRieszIntegrand χ X b t‖ := hnorm.trans hsum + _ ≤ ((1 / (b - 1) + C2) * X ^ b / T) + + ‖∫ t in -T..T, rightRieszIntegrand χ X b t‖ + + ((1 / (b - 1) + C1) * X ^ b / T) := + add_le_add (add_le_add hn le_rfl) hp + _ ≤ _ := by + apply sub_nonneg.mp + convert hslack using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszUnsmoothing.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszUnsmoothing.lean new file mode 100644 index 0000000000000000000000000000000000000000..3815ed19281a9d548c2f5df321d553a31bcd32db --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszUnsmoothing.lean @@ -0,0 +1,55 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Tactic + +namespace OAI + +/-! # Recovering sharp positive counts from the integrated count -/ + +namespace Ostmann + +open scoped BigOperators + +noncomputable def finiteRieszSum (S : Finset ℕ) (w : ℕ → ℝ) (x : ℝ) : ℝ := + ∑ n ∈ S, w n * max (x - n) 0 + +theorem positivePart_step_lower (x y h : ℝ) (hh : 0 ≤ h) : + (if y ≤ x then h else 0) ≤ max (x + h - y) 0 - max (x - y) 0 := by + split_ifs with hy + · rw [max_eq_left (by linarith : 0 ≤ x + h - y), max_eq_left (sub_nonneg.mpr hy)] + linarith + · have hm : max (x - y) 0 ≤ max (x + h - y) 0 := max_le_max_right 0 (by linarith) + linarith + +theorem positivePart_step_upper (x y h : ℝ) (hh : 0 ≤ h) : + max (x + h - y) 0 - max (x - y) 0 ≤ (if y ≤ x + h then h else 0) := by + split_ifs with hy + · by_cases hxy : y ≤ x + · rw [max_eq_left (by linarith : 0 ≤ x + h - y), max_eq_left (sub_nonneg.mpr hxy)] + linarith + · rw [max_eq_left (sub_nonneg.mpr hy), max_eq_right (by linarith : x - y ≤ 0)] + linarith + · rw [max_eq_right (by linarith : x + h - y ≤ 0), max_eq_right (by linarith : x - y ≤ 0)] + norm_num + +theorem finiteRieszSum_step (S : Finset ℕ) (w : ℕ → ℝ) (x h : ℝ) + (hh : 0 ≤ h) (hw : ∀ n ∈ S, 0 ≤ w n) : + h * (∑ n ∈ S.filter (fun n : ℕ => (n : ℝ) ≤ x), w n) ≤ + finiteRieszSum S w (x + h) - finiteRieszSum S w x ∧ + finiteRieszSum S w (x + h) - finiteRieszSum S w x ≤ + h * (∑ n ∈ S.filter (fun n : ℕ => (n : ℝ) ≤ x + h), w n) := by + have hdiff : finiteRieszSum S w (x + h) - finiteRieszSum S w x = + ∑ n ∈ S, w n * (max (x + h - n) 0 - max (x - n) 0) := by + simp only [finiteRieszSum, mul_sub, Finset.sum_sub_distrib] + rw [hdiff] + constructor + · have hb := Finset.sum_le_sum (s := S) (fun n hn => + mul_le_mul_of_nonneg_left (positivePart_step_lower x n h hh) (hw n hn)) + simpa only [mul_ite, mul_zero, Finset.sum_filter, Finset.mul_sum, mul_comm] using hb + · have hb := Finset.sum_le_sum (s := S) (fun n hn => + mul_le_mul_of_nonneg_left (positivePart_step_upper x n h hh) (hw n hn)) + simpa only [mul_ite, mul_zero, Finset.sum_filter, Finset.mul_sum, mul_comm] using hb + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszVerticalWeight.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszVerticalWeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe1821c1be99bd7d3779cb520354d09070b66903 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RieszVerticalWeight.lean @@ -0,0 +1,79 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszMellinInversion +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothVerticalKernel + +namespace OAI + +/-! # The absolutely convergent Riesz contour weight -/ + +namespace Ostmann + +open Complex MeasureTheory + +noncomputable def rieszMellinLine (σ t : ℝ) : ℂ := (σ : ℂ) + (t : ℂ) * I + +@[simp] theorem rieszMellinLine_re (σ t : ℝ) : (rieszMellinLine σ t).re = σ := by + simp [rieszMellinLine] + +@[fun_prop] theorem rieszMellinLine_continuous (σ : ℝ) : Continuous (rieszMellinLine σ) := by + unfold rieszMellinLine + fun_prop + +theorem rieszMellinKernel_analyticAt_pos (s : ℂ) (hs : 0 < s.re) : + AnalyticAt ℂ rieszMellinKernel s := by + apply analyticAt_const.div (analyticAt_id.mul (analyticAt_id.add analyticAt_const)) + apply mul_ne_zero + · intro h + change s = 0 at h + simp [h] at hs + · intro h + change s + 1 = 0 at h + have hh := congrArg Complex.re h + simp only [Complex.add_re, Complex.one_re, Complex.zero_re] at hh + linarith + +noncomputable def rieszVerticalWeight (X σ t : ℝ) : ℂ := + (X : ℂ) ^ rieszMellinLine σ t * rieszMellinKernel (rieszMellinLine σ t) + +theorem rieszVerticalWeight_continuous (X σ : ℝ) (hX : 0 < X) (hσ : 0 < σ) : + Continuous (rieszVerticalWeight X σ) := by + apply Continuous.mul + · exact (rieszMellinLine_continuous σ).const_cpow (.inl (by exact_mod_cast hX.ne')) + · apply continuous_iff_continuousAt.mpr + intro t + exact ((rieszMellinKernel_analyticAt_pos _ (by simpa using hσ)).continuousAt).comp + (rieszMellinLine_continuous σ).continuousAt + +theorem rieszVerticalWeight_norm (X σ t : ℝ) (hX : 0 < X) : + ‖rieszVerticalWeight X σ t‖ = X ^ σ * ‖rieszMellinKernel (rieszMellinLine σ t)‖ := by + rw [rieszVerticalWeight, norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hX, + rieszMellinLine_re] + +theorem rieszVerticalWeight_integrable (X σ : ℝ) (hX : 0 < X) (hσ : 1 ≤ σ) : + Integrable (rieszVerticalWeight X σ) := by + have hk : Integrable (fun t => rieszMellinKernel (rieszMellinLine σ t)) := + rieszMellinKernel_verticalIntegrable σ hσ + apply (hk.norm.const_mul (X ^ σ)).mono' + (rieszVerticalWeight_continuous X σ hX (by linarith)).aestronglyMeasurable + exact Filter.Eventually.of_forall (fun t => (rieszVerticalWeight_norm X σ t hX).le) + +theorem characterMangoldt_riesz_term_norm (χ : PrimitiveComplexCharacter) + (σ t : ℝ) (n : ℕ) : + ‖LSeries.term (characterMangoldtCoefficient χ) (rieszMellinLine σ t) n‖ = + ‖LSeries.term (characterMangoldtCoefficient χ) (σ : ℂ) n‖ := by + simp [LSeries.norm_term_eq] + +theorem characterMangoldt_riesz_term_continuous (χ : PrimitiveComplexCharacter) + (σ : ℝ) (n : ℕ) : + Continuous (fun t => LSeries.term (characterMangoldtCoefficient χ) (rieszMellinLine σ t) n) := by + by_cases hn : n = 0 + · subst n + simp only [LSeries.term_zero] + exact continuous_const + · simp only [LSeries.term_of_ne_zero hn] + exact continuous_const.div ((rieszMellinLine_continuous σ).const_cpow + (.inl (by exact_mod_cast hn))) (fun _ => Complex.cpow_ne_zero_iff.mpr + (.inl (by exact_mod_cast hn))) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RootFreeSmoothWeight.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RootFreeSmoothWeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..13b68643ea8b588193e6e000874025caccbe0176 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/RootFreeSmoothWeight.lean @@ -0,0 +1,82 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.SmoothPrimeComparison + +namespace OAI + +/-! # Smooth variation when roots are retained at the cell endpoints -/ + +namespace Ostmann +open scoped BigOperators + +theorem polynomial_monotoneOn_no_roots (P : Polynomial ℝ) (a b : ℝ) + (hroots : ∀ r ∈ P.derivative.roots, r ∉ Set.Ioo a b) : + MonotoneOn P.eval (Set.Icc a b) ∨ AntitoneOn P.eval (Set.Icc a b) := by + by_cases hd : P.derivative = 0 + · left + have hp := Polynomial.eq_C_of_derivative_eq_zero hd + intro x hx y hy hxy + have hv (t : ℝ) : P.eval t = P.coeff 0 := by + have hh := congrArg (fun Q : Polynomial ℝ => Q.eval t) hp + simpa only [Polynomial.eval_C] using hh + change P.eval x ≤ P.eval y + rw [hv x, hv y] + · have hn : ∀ x ∈ Set.Ioo a b, P.derivative.eval x ≠ 0 := by + intro x hx hz + exact hroots x ((Polynomial.mem_roots hd).mpr hz) hx + rcases continuous_sign_on_interval P.derivative.eval a b + P.derivative.continuous.continuousOn hn with hpos | hneg + · left + apply monotoneOn_of_deriv_nonneg (convex_Icc a b) P.continuous.continuousOn + P.differentiable.differentiableOn + intro x hx + rw [interior_Icc] at hx + simpa only [P.deriv] using hpos x hx + · right + apply antitoneOn_of_deriv_nonpos (convex_Icc a b) P.continuous.continuousOn + P.differentiable.differentiableOn + intro x hx + rw [interior_Icc] at hx + simpa only [P.deriv] using hneg x hx + +theorem ClippedPolynomialFactor.variation_no_roots (f : ClippedPolynomialFactor) + (u : ℕ → ℝ) (hu : Monotone u) (N : ℕ) + (hroots : ∀ r ∈ f.polynomial.derivative.roots, r ∉ Set.Ioo (u 0) (u (N - 1))) : + discreteVariation (fun j => f.value (u j)) N ≤ f.bound + f.lip * (f.hi - f.lo) := by + let v : ℕ → ℝ := fun j => clipRealInterval f.lo f.hi (f.polynomial.eval (u j)) + have hr (j : ℕ) (_hj : j ≤ N - 1) : v j ∈ Set.Icc f.lo f.hi := + clipRealInterval_bounds f.lo f.hi _ f.lo_le_hi + have hu' (j : ℕ) (hj : j ≤ N - 1) : u j ∈ Set.Icc (u 0) (u (N - 1)) := + ⟨hu (Nat.zero_le _), hu hj⟩ + change discreteVariation (fun j => f.profile (v j)) N ≤ _ + rcases polynomial_monotoneOn_no_roots f.polynomial (u 0) (u (N - 1)) hroots with hm | hm + · apply discreteVariation_comp_monotoneOn f.profile v f.lo f.hi f.bound f.lip N + f.lip_nonneg f.norm_le f.lipschitz hr + intro j hj + exact clipRealInterval_monotone f.lo f.hi + (hm (hu' j hj.le) (hu' (j + 1) (by omega)) (hu (by omega))) + · apply discreteVariation_comp_antitoneOn f.profile v f.lo f.hi f.bound f.lip N + f.lip_nonneg f.norm_le f.lipschitz hr + intro j hj + exact clipRealInterval_monotone f.lo f.hi + (hm (hu' j hj.le) (hu' (j + 1) (by omega)) (hu (by omega))) + +theorem smoothPolynomialWeight_variation_no_roots {n : ℕ} (F : Fin n → ClippedPolynomialFactor) + (u : ℕ → ℝ) (hu : Monotone u) (N : ℕ) + (hroots : ∀ i r, r ∈ (F i).polynomial.derivative.roots → + r ∉ Set.Ioo (u 0) (u (N - 1))) : + discreteVariation (fun j => smoothPolynomialWeight F (u j)) N ≤ smoothPolynomialBudget F := by + have hV (i : Fin n) : 0 ≤ (F i).bound + (F i).lip * ((F i).hi - (F i).lo) := + add_nonneg (F i).bound_nonneg + (mul_nonneg (F i).lip_nonneg (sub_nonneg.mpr (F i).lo_le_hi)) + have ht := discreteVariation_prod n (fun i j => (F i).value (u j)) + (fun i => (F i).bound) (fun i => (F i).bound + (F i).lip * ((F i).hi - (F i).lo)) N + (fun i => (F i).bound_nonneg) hV (fun i j => (F i).norm_value (u j)) + (fun i => (F i).variation_no_roots u hu N (hroots i)) + change discreteVariation (fun j => ∏ i, (F i).value (u j)) N ≤ _ + apply ht.trans_eq + apply Finset.prod_congr rfl + intro i _ + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Scales.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Scales.lean new file mode 100644 index 0000000000000000000000000000000000000000..6faa71166263fd733ceff895414b90c01bd0f1cc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Scales.lean @@ -0,0 +1,101 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteDecay + +namespace OAI + +open Filter +open scoped Topology + +namespace Ostmann.ZeroDensity + +theorem eventually_linear_mul_exp_le {a b : ℝ} (hab : a < b) (C : ℝ) : + ∀ᶠ L : ℝ in atTop, C * L * Real.exp (a * L) ≤ Real.exp (b * L) := by + have hlim : Tendsto (fun L : ℝ => Real.exp ((b - a) * L) / L) atTop atTop := by + simpa only [Real.rpow_one] using + tendsto_exp_mul_div_rpow_atTop (1 : ℝ) (b - a) (sub_pos.mpr hab) + filter_upwards [(tendsto_atTop.1 hlim) C, eventually_gt_atTop (0 : ℝ)] with L h hL + have hc : C * L ≤ Real.exp ((b - a) * L) := (le_div_iff₀ hL).mp h + calc + C * L * Real.exp (a * L) ≤ Real.exp ((b - a) * L) * Real.exp (a * L) := by + gcongr + _ = Real.exp (b * L) := by + rw [← Real.exp_add] + congr 1 + ring + +theorem eventually_supply_density_exponent (CK : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ K : ℝ, K ≤ CK * L → + 2 * (42 * K * Real.exp (9 * L / 10)) ≤ Real.exp L := by + have h := eventually_linear_mul_exp_le (a := (9 : ℝ) / 10) (b := 1) + (by norm_num) (84 * CK) + filter_upwards [h] with L h K hK + have he := Real.exp_pos (9 * L / 10) + have hmul := mul_le_mul_of_nonneg_right hK he.le + have heq : 9 / 10 * L = 9 * L / 10 := by ring + rw [heq, one_mul] at h + nlinarith + +theorem supply_gap_gain {c CK K L : ℝ} (hc : 0 < c) (_hCK : 0 < CK) + (hK : 0 < K) (_hL : 0 < L) (hKL : K ≤ CK * L) : + (c / (24 * CK)) * Real.exp (L / 10) / L ≤ + Real.exp L * (c / (12 * K * Real.exp (9 * L / 10))) / 2 := by + have he : Real.exp L = Real.exp (L / 10) * Real.exp (9 * L / 10) := by + rw [← Real.exp_add] + congr 1 + ring + calc + c / (24 * CK) * Real.exp (L / 10) / L = + c * Real.exp (L / 10) / (24 * CK * L) := by ring + _ ≤ c * Real.exp (L / 10) / (24 * K) := by + apply div_le_div_of_nonneg_left (by positivity) (by positivity) + nlinarith + _ = Real.exp L * (c / (12 * K * Real.exp (9 * L / 10))) / 2 := by + rw [he] + field_simp + ring + +theorem eventually_prefactor_decay {a c : ℝ} (ha : 0 < a) (hc : 0 < c) + (C D : ℝ) : + ∀ᶠ L : ℝ in atTop, + (Real.exp L + 1) * Real.exp (C * L) * + Real.exp (1 - c * Real.exp (a * L) / L) ≤ Real.exp (-D * L) := by + have hlim : Tendsto (fun L : ℝ => c * Real.exp (a * L) / L ^ 2) atTop atTop := by + simpa only [Real.rpow_two, mul_div_assoc] using + (tendsto_exp_mul_div_rpow_atTop (2 : ℝ) a ha).const_mul_atTop hc + filter_upwards [(tendsto_atTop.1 hlim) (C + D + 3), eventually_ge_atTop (1 : ℝ)] + with L hlarge hL + have hLpos : 0 < L := lt_of_lt_of_le zero_lt_one hL + have hlarge' : (C + D + 3) * L ^ 2 ≤ c * Real.exp (a * L) := + (le_div_iff₀ (sq_pos_of_pos hLpos)).mp hlarge + have hlinear : (C + D + 3) * L ≤ c * Real.exp (a * L) / L := by + apply (le_div_iff₀ hLpos).mpr + nlinarith only [hlarge'] + have hexp : 2 ≤ Real.exp L := by + have := Real.add_one_le_exp L + linarith + have hfactor : Real.exp L + 1 ≤ Real.exp (2 * L) := by + rw [show 2 * L = L + L by ring, Real.exp_add] + nlinarith + calc + (Real.exp L + 1) * Real.exp (C * L) * + Real.exp (1 - c * Real.exp (a * L) / L) ≤ + Real.exp (2 * L) * Real.exp (C * L) * + Real.exp (1 - c * Real.exp (a * L) / L) := by gcongr + _ = Real.exp ((2 + C) * L + 1 - c * Real.exp (a * L) / L) := by + rw [← Real.exp_add, ← Real.exp_add] + congr 1 + ring + _ ≤ Real.exp (-D * L) := by + apply Real.exp_le_exp.mpr + linarith + +theorem eventually_supply_prefactor_decay {c : ℝ} (hc : 0 < c) (C D : ℝ) : + ∀ᶠ L : ℝ in atTop, + (Real.exp L + 1) * Real.exp (C * L) * + Real.exp (1 - c * Real.exp (L / 10) / L) ≤ Real.exp (-D * L) := by + simpa only [one_div_mul_eq_div] using + eventually_prefactor_decay (a := (1 : ℝ) / 10) (by norm_num) hc C D + +end Ostmann.ZeroDensity + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SchwartzDensityCorrelation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SchwartzDensityCorrelation.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b023a9f315fb7dd53d6f8c4b3e14100c2544e89 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SchwartzDensityCorrelation.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.PeriodicIntervalPhase +import OAI.NumberTheory.Ostmann.Characters.CorrelationWeightVariation + +namespace OAI + +/-! # The single expanded pair in the large-kernel correlation -/ + +namespace Ostmann + +open scoped BigOperators ComplexConjugate SchwartzMap + +noncomputable def correlationWeightBudget (Φ Ψ : 𝓢(ℝ, ℂ)) (C D : ℝ) : ℝ := + SchwartzMap.seminorm ℝ 0 0 Φ * + (SchwartzMap.seminorm ℝ 0 0 Ψ + SchwartzMap.seminorm ℝ 0 1 Ψ * D) + + SchwartzMap.seminorm ℝ 0 0 Ψ * + (SchwartzMap.seminorm ℝ 0 0 Φ + SchwartzMap.seminorm ℝ 0 1 Φ * C) + +/-- Each expanded pair is bounded by its exact exclusive-prime factor times +the interval length and a fixed Schwartz seminorm budget. -/ +theorem schwartz_density_correlation_bound (ps qs rs : List ℕ) + (hp : ∀ p ∈ ps, p.Prime) (hq : ∀ p ∈ qs, p.Prime) (hr : ∀ p ∈ rs, p.Prime) + (hcp : ps.Pairwise Nat.Coprime) (hcq : qs.Pairwise Nat.Coprime) (hcr : rs.Pairwise Nat.Coprime) + (hrs : rs.toFinset = ps.toFinset ∪ qs.toFinset) + (vp : (ZMod ps.prod)ˣ) (vq : (ZMod qs.prod)ˣ) + (f : ∀ p : ℕ, ZMod p → ℂ) (hf : ∀ p ∈ rs, ∀ x, ‖f p x‖ ≤ 1) + (Φ Ψ : 𝓢(ℝ, ℂ)) (α β Y Z C D : ℝ) (M N : ℕ) + (hY : 0 < Y) (hZ : 0 < Z) (hNY : (N : ℝ) ≤ C * Y) (hNZ : (N : ℝ) ≤ D * Z) + (hN : rs.prod ^ 2 ≤ N) : + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + let : NeZero qs.prod := ⟨(prime_list_prod_pos qs hq).ne'⟩ + ‖∑ n ∈ Finset.range N, + (Φ (((n + M : ℕ) : ℝ) / Y) * + densityFourier (primeCRTFunction ps hp hcp f) ((vp : ZMod ps.prod) * (n + M : ℕ)) * + realAdditivePhase α ^ (n + M)) * + conj (Ψ (((n + M : ℕ) : ℝ) / Z) * + densityFourier (primeCRTFunction qs hq hcq f) ((vq : ZMod qs.prod) * (n + M : ℕ)) * + realAdditivePhase β ^ (n + M))‖ ≤ + correlationWeightBudget Φ Ψ C D * + (4 * (rs.map (correlationPrimeBound (supportCorrelationSide ps.toFinset qs.toFinset))).prod * N) := by + intro _ _ + let : NeZero ps.prod := ⟨(prime_list_prod_pos ps hp).ne'⟩ + let : NeZero qs.prod := ⟨(prime_list_prod_pos qs hq).ne'⟩ + let : NeZero rs.prod := ⟨(prime_list_prod_pos rs hr).ne'⟩ + obtain ⟨F, hF, hbound⟩ := original_density_correlation_model ps qs rs hp hq hr hcp hcq hcr hrs vp vq f hf + let w : ℕ → ℂ := fun n => Φ (((n + M : ℕ) : ℝ) / Y) * conj (Ψ (((n + M : ℕ) : ℝ) / Z)) + have he (n : ℕ) : densityFourier (primeCRTFunction ps hp hcp f) + ((vp : ZMod ps.prod) * (n + M : ℕ)) * + conj (densityFourier (primeCRTFunction qs hq hcq f) + ((vq : ZMod qs.prod) * (n + M : ℕ))) = F (n + M : ℕ) := by + simpa only [Int.cast_natCast] using hF ((n + M : ℕ) : ℤ) + have hphase (n : ℕ) : realAdditivePhase α ^ n * conj (realAdditivePhase β ^ n) = + realAdditivePhase (α - β) ^ n := by + rw [realAdditivePhase_sub, mul_pow, map_pow] + have hsum : (∑ n ∈ Finset.range N, + (Φ (((n + M : ℕ) : ℝ) / Y) * + densityFourier (primeCRTFunction ps hp hcp f) ((vp : ZMod ps.prod) * (n + M : ℕ)) * + realAdditivePhase α ^ (n + M)) * + conj (Ψ (((n + M : ℕ) : ℝ) / Z) * + densityFourier (primeCRTFunction qs hq hcq f) ((vq : ZMod qs.prod) * (n + M : ℕ)) * + realAdditivePhase β ^ (n + M))) = + ∑ n ∈ Finset.range N, w n * (F (n + M : ℕ) * realAdditivePhase (α - β) ^ (n + M)) := by + apply Finset.sum_congr rfl + intro n hn + calc + _ = w n * (densityFourier (primeCRTFunction ps hp hcp f) ((vp : ZMod ps.prod) * (n + M : ℕ)) * + conj (densityFourier (primeCRTFunction qs hq hcq f) ((vq : ZMod qs.prod) * (n + M : ℕ)))) * + (realAdditivePhase α ^ (n + M) * conj (realAdditivePhase β ^ (n + M))) := by + simp only [w, map_mul] + ring + _ = _ := by rw [he, hphase]; ring + have hA : 0 ≤ (rs.map (correlationPrimeBound (supportCorrelationSide ps.toFinset qs.toFinset))).prod := by + apply List.prod_nonneg + intro x hx + obtain ⟨p, _, rfl⟩ := List.mem_map.mp hx + exact correlationPrimeBound_nonneg _ p + have hvar : discreteVariation w N ≤ correlationWeightBudget Φ Ψ C D := by + simpa only [w, correlationWeightBudget, Nat.cast_add] using + schwartz_correlation_variation Φ Ψ M M Y Z C D N hY hZ hNY hNZ + rw [hsum] + exact (weighted_periodic_linear_shift_long_bound rs.prod F _ (α - β) hA hbound w M N hN).trans + (mul_le_mul_of_nonneg_right hvar (by positivity)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SelectedDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SelectedDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..63a6bd20c220812ff3148e4e0bb5d10a31c2ac49 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SelectedDensity.lean @@ -0,0 +1,92 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualDetector +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualZeros +import OAI.NumberTheory.Ostmann.ZeroDensity.DyadicDetector +import OAI.NumberTheory.Ostmann.ZeroDensity.VaryingSampling + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +theorem exists_selected_zero_density_constant : + ∃ C : ℝ, 0 < C ∧ ∀ (Q H : ℕ) (exception : Option (PrimitiveFamily Q)) + (σ : ℝ) (r : Finset (ZeroOccurrence Q (H : ℝ))), + 0 < Q → 0 < H → 1/2 ≤ σ → σ ≤ 1 → + r ⊆ retainedZeros Q exception σ H → + (∀ z ∈ r, ∀ w ∈ r, z ≠ w → z.1 = w.1 → 1 ≤ |z.point.im-w.point.im|) → + (r.card : ℝ) ≤ + 4*C*(detectorBlockCount (detectorLength Q H (Q^2*H)) : ℝ) * + ∑ j ∈ Finset.range (detectorBlockCount (detectorLength Q H (Q^2*H))), + (((2^j*(Q^2*H) : ℕ) : ℝ)+(Q : ℝ)^2*H) * (1+Real.log Q) * + (1+Real.log (2*(2^j*(Q^2*H) : ℕ) : ℝ))^7 * + (2^j*(Q^2*H) : ℕ) * ((2^j*(Q^2*H) : ℕ) : ℝ)^(-2*σ) := by + classical + obtain ⟨C,hC,hsample⟩ := exists_mollifier_varying_sampling_constant + refine ⟨C,hC,?_⟩ + intro Q H exception σ r hQ hH hσ hσ1 hrs hsep + let X : ℕ := Q^2*H + let N : ℕ := detectorLength Q H X + let J : ℕ := detectorBlockCount N + have hX : 1 ≤ X := by + have hxpos : 0 < X := by dsimp [X]; positivity + omega + have hHR : (1 : ℝ) ≤ H := by exact_mod_cast hH + let χ : r → Ostmann.HybridSieve.PrimitiveFamily Q := fun z => z.val.1.1 + let β : r → ℝ := fun z => z.val.point.re + let γ : r → ℝ := fun z => z.val.point.im + have hβ (z : r) : β z ∈ Set.Icc σ 1 := + ⟨(Finset.mem_filter.mp (hrs z.property)).2.2, z.val.isNontrivialZero.2.2.le⟩ + have hγ (z : r) : |γ z| ≤ (H : ℝ) := z.val.2.1.property.2 + have hspacing (z w : r) (hne : z ≠ w) (hc : χ z = χ w) : 1 ≤ |γ z-γ w| := by + exact hsep z.val z.property w.val w.property + (fun heq => hne (Subtype.ext heq)) (Subtype.ext hc) + have hblock (j : ℕ) : + (∑ z : r, ‖detectorBlock (χ z).2.val X N j z.val.point‖^2) ≤ + C * (((2^j*X : ℕ) : ℝ)+(Q : ℝ)^2*H) * (1+Real.log Q) * + (1+Real.log (2*(2^j*X : ℕ) : ℝ))^7 * + (2^j*X : ℕ) * ((2^j*X : ℕ) : ℝ)^(-2*σ) := by + have hU : 0 < 2^j*X := by positivity + have hb := hsample (2^j*X) Q X N σ H χ β γ hU hQ hHR + (by linarith) hσ1 hβ hγ hspacing + have heq (z : r) : + finiteCharacterPolynomial (χ z).2.val (mollifierCoefficient X N) + (Finset.Ioc (2^j*X) (2*(2^j*X))) ((β z : ℂ)+(γ z : ℂ)*Complex.I) = + detectorBlock (χ z).2.val X N j z.val.point := by + have hp : 2*(2^j*X) = 2^(j+1)*X := by ring + simp only [finiteCharacterPolynomial, detectorBlock, hp, β, γ, Complex.re_add_im] + simpa only [heq] using hb + have hdetect := detected_family_card_le (Finset.univ : Finset r) J + (fun z j => detectorBlock (χ z).2.val X N j z.val.point) (by + intro z hz + rw [← detector_eq_sum_blocks (χ z).2.val X N J (detectorBlockCount_covers N)] + apply actual_zero_detector (χ z).2.val z.val.1.property + (by have ht := z.val.1.1.1.isLt; omega) hH hX z.val.isNontrivialZero.1 + · exact hσ.trans (hβ z).1 + · exact (hβ z).2 + · exact hγ z) + have hsum := Finset.sum_le_sum (fun j (_hj : j ∈ Finset.range J) => hblock j) + have hJ : (0 : ℝ) ≤ 4*J := by positivity + calc + (r.card : ℝ) ≤ 4*J*∑ j ∈ Finset.range J, + ∑ z : r, ‖detectorBlock (χ z).2.val X N j z.val.point‖^2 := by + simpa using hdetect + _ ≤ 4*J*∑ j ∈ Finset.range J, + C * (((2^j*X : ℕ) : ℝ)+(Q : ℝ)^2*H) * (1+Real.log Q) * + (1+Real.log (2*(2^j*X : ℕ) : ℝ))^7 * + (2^j*X : ℕ) * ((2^j*X : ℕ) : ℝ)^(-2*σ) := + mul_le_mul_of_nonneg_left hsum hJ + _ = _ := by + dsimp [X, N, J] + simp only [mul_assoc, ← Finset.mul_sum] + ring + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SeparatedSelection.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SeparatedSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..120c6b1b6a649bb27d217457de415b3ef44fe05d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SeparatedSelection.lean @@ -0,0 +1,101 @@ +import Mathlib + +namespace OAI + +namespace Ostmann.ZeroDensity +open scoped BigOperators + +variable {ι κ : Type*} [DecidableEq ι] [DecidableEq κ] + +theorem neighbor_card_le_two_local (s : Finset ι) (c : ι → κ) (γ : ι → ℝ) (j : ι) + {B : ℝ} + (hlocal : ∀ χ t, ((s.filter (fun i => c i = χ ∧ |γ i - t| ≤ 1 / 2)).card : ℝ) ≤ B) : + ((s.filter (fun i => c i = c j ∧ |γ i - γ j| < 1)).card : ℝ) ≤ 2 * B := by + classical + let L := s.filter (fun i => c i = c j ∧ |γ i - (γ j - 1 / 2)| ≤ 1 / 2) + let R := s.filter (fun i => c i = c j ∧ |γ i - (γ j + 1 / 2)| ≤ 1 / 2) + have hsub : s.filter (fun i => c i = c j ∧ |γ i - γ j| < 1) ⊆ L ∪ R := by + intro i hi + obtain ⟨his, hic, hid⟩ := Finset.mem_filter.mp hi + have hd := abs_lt.mp hid + by_cases hleft : γ i ≤ γ j + · apply Finset.mem_union.mpr + left + apply Finset.mem_filter.mpr + exact ⟨his, hic, abs_le.mpr ⟨by linarith, by linarith⟩⟩ + · apply Finset.mem_union.mpr + right + apply Finset.mem_filter.mpr + exact ⟨his, hic, abs_le.mpr ⟨by linarith, by linarith⟩⟩ + have hcard : ((s.filter (fun i => c i = c j ∧ |γ i - γ j| < 1)).card : ℝ) ≤ + (L.card : ℝ) + R.card := by + exact_mod_cast (Finset.card_le_card hsub).trans (Finset.card_union_le L R) + have hL : (L.card : ℝ) ≤ B := hlocal (c j) (γ j - 1 / 2) + have hR : (R.card : ℝ) ≤ B := hlocal (c j) (γ j + 1 / 2) + linarith + +theorem exists_separated_cover (s : Finset ι) (c : ι → κ) (γ : ι → ℝ) : + ∃ r : Finset ι, r ⊆ s ∧ + (∀ i ∈ r, ∀ j ∈ r, i ≠ j → c i = c j → 1 ≤ |γ i - γ j|) ∧ + ∀ i ∈ s, ∃ j ∈ r, c i = c j ∧ |γ i - γ j| < 1 := by + classical + let good : Finset (Finset ι) := s.powerset.filter (fun r => + ∀ i ∈ r, ∀ j ∈ r, i ≠ j → c i = c j → 1 ≤ |γ i - γ j|) + have hgood : good.Nonempty := by + refine ⟨∅, ?_⟩ + simp [good] + obtain ⟨r, hr, hmax⟩ := Finset.exists_max_image good Finset.card hgood + obtain ⟨hrs, hsep⟩ := Finset.mem_filter.mp hr + have hsub : r ⊆ s := Finset.mem_powerset.mp hrs + refine ⟨r, hsub, hsep, ?_⟩ + intro i his + by_contra hcover + have hin : i ∉ r := by + intro hir + exact hcover ⟨i, hir, rfl, by norm_num⟩ + have hpair : ∀ j ∈ r, c i = c j → 1 ≤ |γ i - γ j| := by + intro j hj hc + by_contra hd + exact hcover ⟨j, hj, hc, lt_of_not_ge hd⟩ + have hnew : insert i r ∈ good := by + apply Finset.mem_filter.mpr + refine ⟨Finset.mem_powerset.mpr (Finset.insert_subset his hsub), ?_⟩ + intro a ha b hb hab hc + rcases Finset.mem_insert.mp ha with hai | har + · rcases Finset.mem_insert.mp hb with hbi | hbr + · subst a + subst b + exact (hab rfl).elim + · subst a + exact hpair b hbr hc + · rcases Finset.mem_insert.mp hb with hbi | hbr + · subst b + simpa only [abs_sub_comm] using hpair a har hc.symm + · exact hsep a har b hbr hab hc + have hcard := hmax (insert i r) hnew + rw [Finset.card_insert_of_notMem hin] at hcard + omega + +theorem exists_separated_selection (s : Finset ι) (c : ι → κ) (γ : ι → ℝ) {B : ℝ} + (hlocal : ∀ χ t, ((s.filter (fun i => c i = χ ∧ |γ i - t| ≤ 1 / 2)).card : ℝ) ≤ B) : + ∃ r : Finset ι, r ⊆ s ∧ + (∀ i ∈ r, ∀ j ∈ r, i ≠ j → c i = c j → 1 ≤ |γ i - γ j|) ∧ + (s.card : ℝ) ≤ 2 * B * r.card := by + classical + obtain ⟨r, hrs, hsep, hcover⟩ := exists_separated_cover s c γ + refine ⟨r, hrs, hsep, ?_⟩ + let U : ι → Finset ι := fun j => s.filter (fun i => c i = c j ∧ |γ i - γ j| < 1) + have hsub : s ⊆ r.biUnion U := by + intro i hi + obtain ⟨j, hj, hic, hid⟩ := hcover i hi + exact Finset.mem_biUnion.mpr ⟨j, hj, Finset.mem_filter.mpr ⟨hi, hic, hid⟩⟩ + have hcount : (s.card : ℝ) ≤ ∑ j ∈ r, ((U j).card : ℝ) := by + exact_mod_cast (Finset.card_le_card hsub).trans (Finset.card_biUnion_le) + calc + (s.card : ℝ) ≤ ∑ j ∈ r, ((U j).card : ℝ) := hcount + _ ≤ ∑ _j ∈ r, 2 * B := Finset.sum_le_sum (fun j _ => neighbor_card_le_two_local s c γ j hlocal) + _ = 2 * B * r.card := by simp [mul_comm] + +end Ostmann.ZeroDensity + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpDigammaStrip.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpDigammaStrip.lean new file mode 100644 index 0000000000000000000000000000000000000000..2726f8a2966b8b1660162bb7e07278a5f35ec954 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpDigammaStrip.lean @@ -0,0 +1,111 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DigammaTailEstimate + +namespace OAI + +/-! # The leading logarithm of digamma on the required positive strip + +The bounded remainder, rather than a multiple of the logarithm, preserves the +correct length in the approximate functional equation for the fourth moment. +-/ + +namespace Ostmann + +open Complex +open scoped BigOperators + + theorem sharp_digamma_strip (z : ℂ) (hz : 1 / 8 ≤ z.re) (hz3 : z.re ≤ 3) : + ‖Complex.digamma z - (Real.log (|z.im| + 2) : ℂ)‖ ≤ + 59 + |Real.eulerMascheroniConstant| := by + let Y := |z.im| + let N : ℕ := ⌈Y⌉₊ + 1 + let H : ℝ := harmonic N + have hY : 0 ≤ Y := abs_nonneg _ + have hN : 1 ≤ N := by dsimp [N]; omega + have hNR : (1 : ℝ) ≤ N := by exact_mod_cast hN + have hNpos : (0 : ℝ) < N := by linarith + have hNlo : Y + 1 ≤ (N : ℝ) := by + have h := Nat.le_ceil Y + dsimp [N] + push_cast + linarith + have hNhi : (N : ℝ) ≤ Y + 2 := by + have h := Nat.ceil_lt_add_one hY + dsimp [N] + push_cast + linarith + have hpos : 0 < z.re := by linarith + have hnorm (m : ℕ) : (Y + 1) / 9 ≤ ‖z + m‖ := by + have hr := Complex.re_le_norm (z + m) + have hi := Complex.abs_im_le_norm (z + m) + simp only [Complex.add_re, Complex.natCast_re, Complex.add_im, Complex.natCast_im, add_zero] at hr hi + dsimp [Y] + have hm : (0 : ℝ) ≤ m := Nat.cast_nonneg m + linarith + have hhead : ‖∑ m ∈ Finset.range N, (z + m)⁻¹‖ ≤ 18 := by + have hp (m : ℕ) : ‖(z + m)⁻¹‖ ≤ 9 / (Y + 1) := by + rw [norm_inv] + have hh := one_div_le_one_div_of_le (by positivity : 0 < (Y + 1) / 9) (hnorm m) + rw [← one_div (‖z + m‖)] + simpa only [one_div_div] using hh + apply (norm_sum_le _ _).trans + have hs := Finset.sum_le_sum (s := Finset.range N) (fun m _ => hp m) + simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul] at hs + apply hs.trans + have hn : (N : ℝ) * 9 ≤ 18 * (Y + 1) := by nlinarith + have hdiv := (div_le_iff₀ (by positivity : 0 < Y + 1)).mpr hn + convert hdiv using 1 + ring + have htail : ‖∑' i : ℕ, densityDigammaTerm z (i + N)‖ ≤ 40 := by + apply (density_digamma_tail_bound z hz N hN).trans + apply (div_le_iff₀ hNpos).mpr + have hzn := Complex.norm_le_abs_re_add_abs_im z + rw [abs_of_pos hpos] at hzn + dsimp [Y] at hNlo hY ⊢ + nlinarith + have hHlo : Real.log (Y + 2) ≤ H := by + have h := log_add_one_le_harmonic N + have hle : Real.log (Y + 2) ≤ Real.log (N + 1 : ℕ) := by + apply Real.log_le_log (by positivity) + push_cast + linarith + exact hle.trans h + have hHhi : H ≤ 1 + Real.log (Y + 2) := by + exact (harmonic_le_one_add_log N).trans + (add_le_add_right (Real.log_le_log hNpos hNhi) 1) + have hHnorm : ‖((H : ℂ) - (Real.log (Y + 2) : ℂ))‖ ≤ 1 := by + rw [← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (by linarith)] + linarith + have hsum := density_digamma_hasSum z hpos + have hsplit := hsum.summable.sum_add_tsum_nat_add N + have hfirst : (∑ m ∈ Finset.range N, densityDigammaTerm z m) = + (H : ℂ) - ∑ m ∈ Finset.range N, (z + m)⁻¹ := by + simp only [densityDigammaTerm, Finset.sum_sub_distrib] + rw [Complex.sum_inv_natCast_add_one] + norm_cast + rw [hfirst, hsum.tsum_eq] at hsplit + have hid : Complex.digamma z - (Real.log (Y + 2) : ℂ) = + (((H : ℂ) - (Real.log (Y + 2) : ℂ)) - + ∑ m ∈ Finset.range N, (z + m)⁻¹) + + (∑' i : ℕ, densityDigammaTerm z (i + N)) - (Real.eulerMascheroniConstant : ℂ) := by + linear_combination -hsplit + change ‖Complex.digamma z - (Real.log (Y + 2) : ℂ)‖ ≤ _ + rw [hid] + calc + _ ≤ (‖(H : ℂ) - (Real.log (Y + 2) : ℂ)‖ + + ‖∑ m ∈ Finset.range N, (z + m)⁻¹‖) + + ‖∑' i : ℕ, densityDigammaTerm z (i + N)‖ + ‖(Real.eulerMascheroniConstant : ℂ)‖ := by + calc + _ ≤ (‖((H : ℂ) - (Real.log (Y + 2) : ℂ)) - + ∑ m ∈ Finset.range N, (z + m)⁻¹‖ + + ‖∑' i : ℕ, densityDigammaTerm z (i + N)‖) + + ‖(Real.eulerMascheroniConstant : ℂ)‖ := + (norm_sub_le _ _).trans (add_le_add_left (norm_add_le _ _) _) + _ ≤ _ := add_le_add_left (add_le_add_left (norm_sub_le _ _) _) _ + _ ≤ _ := by + rw [Complex.norm_real, Real.norm_eq_abs] + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpGammaHorizontal.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpGammaHorizontal.lean new file mode 100644 index 0000000000000000000000000000000000000000..0316c8ce309bfc4f8186a49340109a1094110410 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpGammaHorizontal.lean @@ -0,0 +1,67 @@ +import Mathlib.Analysis.Calculus.MeanValue +import OAI.NumberTheory.Ostmann.ZeroDensity.GammaNormDerivative + +namespace OAI + +/-! # Gamma quotients with the exact horizontal power -/ + +namespace Ostmann + +open Complex Set + + theorem sharp_gamma_log_horizontal_ordered (a b t : ℝ) + (ha : 1 / 8 ≤ a) (hab : a ≤ b) (hb : b ≤ 3) : + |Real.log ‖Complex.Gamma ((b : ℂ) + t * I)‖ - + Real.log ‖Complex.Gamma ((a : ℂ) + t * I)‖ - + (b - a) * Real.log (|t| + 2)| ≤ + (59 + |Real.eulerMascheroniConstant|) * (b - a) := by + let F : ℝ → ℝ := fun x => Real.log ‖Complex.Gamma ((x : ℂ) + t * I)‖ - + x * Real.log (|t| + 2) + let F' : ℝ → ℝ := fun x => (Complex.digamma ((x : ℂ) + t * I)).re - + Real.log (|t| + 2) + have hd (x : ℝ) (hx : x ∈ Icc a b) : HasDerivAt F (F' x) x := by + convert! (gamma_log_norm_horizontal x t (by linarith [hx.1])).sub + ((hasDerivAt_id x).mul_const (Real.log (|t| + 2))) using 1 + simp only [F', one_mul] + have hbound (x : ℝ) (hx : x ∈ Ico a b) : ‖F' x‖ ≤ + 59 + |Real.eulerMascheroniConstant| := by + have he := sharp_digamma_strip ((x : ℂ) + t * I) + (by simp; linarith [hx.1]) (by simp; linarith [hx.2]) + have hr := (Complex.abs_re_le_norm + (Complex.digamma ((x : ℂ) + t * I) - (Real.log (|t| + 2) : ℂ))).trans + (by simpa using he) + simpa [F', Real.norm_eq_abs] using hr + have hm := norm_image_sub_le_of_norm_deriv_le_segment' + (fun x hx => (hd x hx).hasDerivWithinAt) hbound b (right_mem_Icc.mpr hab) + change ‖F b - F a‖ ≤ _ at hm + have he : F b - F a = Real.log ‖Complex.Gamma ((b : ℂ) + t * I)‖ - + Real.log ‖Complex.Gamma ((a : ℂ) + t * I)‖ - + (b - a) * Real.log (|t| + 2) := by dsimp [F]; ring + simpa only [he, Real.norm_eq_abs] using hm + + theorem sharp_gamma_horizontal_ordered (a b t : ℝ) + (ha : 1 / 8 ≤ a) (hab : a ≤ b) (hb : b ≤ 3) : + ‖Complex.Gamma ((b : ℂ) + t * I)‖ / ‖Complex.Gamma ((a : ℂ) + t * I)‖ ≤ + Real.exp ((59 + |Real.eulerMascheroniConstant|) * (b - a)) * + (|t| + 2) ^ (b - a) := by + have hGa : 0 < ‖Complex.Gamma ((a : ℂ) + t * I)‖ := + norm_pos_iff.mpr (Complex.Gamma_ne_zero_of_re_pos (by simp; linarith)) + have hGb : 0 < ‖Complex.Gamma ((b : ℂ) + t * I)‖ := + norm_pos_iff.mpr (Complex.Gamma_ne_zero_of_re_pos (by simp; linarith)) + have hh := le_abs_self (Real.log ‖Complex.Gamma ((b : ℂ) + t * I)‖ - + Real.log ‖Complex.Gamma ((a : ℂ) + t * I)‖ - (b - a) * Real.log (|t| + 2)) + have h := sharp_gamma_log_horizontal_ordered a b t ha hab hb + have hlog : Real.log (‖Complex.Gamma ((b : ℂ) + t * I)‖ / + ‖Complex.Gamma ((a : ℂ) + t * I)‖) ≤ + (59 + |Real.eulerMascheroniConstant|) * (b - a) + + Real.log (|t| + 2) * (b - a) := by + rw [Real.log_div hGb.ne' hGa.ne'] + nlinarith + have hexp := Real.exp_le_exp.mpr hlog + rw [Real.exp_log (div_pos hGb hGa), Real.exp_add, + ← Real.rpow_def_of_pos (by positivity : 0 < |t| + 2)] at hexp + exact hexp + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpGammaRealShift.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpGammaRealShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..70aaa43f313801b8db599945f01fb29af73c28b8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpGammaRealShift.lean @@ -0,0 +1,59 @@ +import Mathlib.Analysis.Real.Pi.Bounds +import OAI.NumberTheory.Ostmann.ZeroDensity.SharpGammaVertical + +namespace OAI + +/-! # The Gamma factor along the smoothed functional-equation contour -/ + +namespace Ostmann + +open Complex + + theorem gammaReal_shift_quotient (z w : ℂ) : + Complex.Gammaℝ (z + w) / Complex.Gammaℝ z = + (Real.pi : ℂ) ^ (-w / 2) * (Complex.Gamma ((z + w) / 2) / Complex.Gamma (z / 2)) := by + have hp : (Real.pi : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr Real.pi_ne_zero + rw [Complex.Gammaℝ_def, Complex.Gammaℝ_def, + show -(z + w) / 2 = -z / 2 + -w / 2 by ring, Complex.cpow_add _ _ hp, + mul_assoc, mul_div_mul_left _ _ (Complex.cpow_ne_zero_iff.mpr (Or.inl hp)), mul_div_assoc] + + theorem sharp_gammaReal_shift (z w : ℂ) + (hz : 1 / 4 ≤ z.re) (hz3 : z.re ≤ 3 / 2) + (hw : 0 ≤ w.re) (hw2 : w.re ≤ 2) : + ‖Complex.Gammaℝ (z + w) / Complex.Gammaℝ z‖ ≤ + Real.exp ((59 + |Real.eulerMascheroniConstant|) * (1 + |w.im|)) * + (|z.im| + 2) ^ (w.re / 2) := by + have he (s : ℂ) : ((s.re / 2 : ℝ) : ℂ) + (s.im / 2 : ℝ) * I = s / 2 := by + apply Complex.ext <;> simp + have he' : (((z.re / 2 + w.re / 2 : ℝ)) : ℂ) + + ((z.im / 2 : ℝ) + (w.im / 2 : ℝ)) * I = (z + w) / 2 := by + apply Complex.ext <;> simp <;> ring + have hg := sharp_gamma_quotient (z.re / 2) (z.re / 2 + w.re / 2) + (z.im / 2) (w.im / 2) (by linarith) (by linarith) (by linarith) + rw [he', he, show z.re / 2 + w.re / 2 - z.re / 2 = w.re / 2 by ring] at hg + have hp : ‖(Real.pi : ℂ) ^ (-w / 2)‖ ≤ 1 := by + rw [Complex.norm_cpow_eq_rpow_re_of_pos Real.pi_pos] + apply Real.rpow_le_one_of_one_le_of_nonpos (by linarith [Real.pi_gt_three]) + simp only [div_ofNat_re, neg_re] + linarith + rw [gammaReal_shift_quotient, norm_mul, norm_div] + calc + _ ≤ 1 * (Real.exp ((59 + |Real.eulerMascheroniConstant|) * (w.re / 2 + |w.im / 2|)) * + (|z.im / 2| + 2) ^ (w.re / 2)) := mul_le_mul hp hg (by positivity) (by norm_num) + _ ≤ _ := by + rw [one_mul] + apply mul_le_mul + · apply Real.exp_le_exp.mpr + apply mul_le_mul_of_nonneg_left _ (by positivity) + rw [abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 2)] + linarith [abs_nonneg w.im] + · apply Real.rpow_le_rpow (by positivity) + · rw [abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 2)] + linarith [abs_nonneg z.im] + · positivity + · positivity + · positivity + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpGammaVertical.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpGammaVertical.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ec9835e95802c0e547dc1b32f85dcf5f2c6fc3a --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SharpGammaVertical.lean @@ -0,0 +1,80 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SharpGammaHorizontal + +namespace OAI + +/-! # Bounded vertical logarithmic variation of Gamma -/ + +namespace Ostmann + +open Complex Set + + theorem sharp_gamma_log_vertical_ordered (a u v : ℝ) + (ha : 1 / 8 ≤ a) (ha3 : a ≤ 3) (huv : u ≤ v) : + |Real.log ‖Complex.Gamma ((a : ℂ) + v * I)‖ - + Real.log ‖Complex.Gamma ((a : ℂ) + u * I)‖| ≤ + (59 + |Real.eulerMascheroniConstant|) * (v - u) := by + let F : ℝ → ℝ := fun y => Real.log ‖Complex.Gamma ((a : ℂ) + y * I)‖ + let F' : ℝ → ℝ := fun y => -(Complex.digamma ((a : ℂ) + y * I)).im + have hd (y : ℝ) : HasDerivAt F (F' y) y := + gamma_log_norm_vertical a y (by linarith) + have hb (y : ℝ) : ‖F' y‖ ≤ 59 + |Real.eulerMascheroniConstant| := by + have h := sharp_digamma_strip ((a : ℂ) + y * I) (by simpa using ha) (by simpa using ha3) + have hi := (Complex.abs_im_le_norm + (Complex.digamma ((a : ℂ) + y * I) - (Real.log (|y| + 2) : ℂ))).trans + (by simpa using h) + simpa [F', Real.norm_eq_abs] using hi + exact norm_image_sub_le_of_norm_deriv_le_segment' + (fun y _ => (hd y).hasDerivWithinAt) (fun y _ => hb y) v + (right_mem_Icc.mpr huv) + + theorem sharp_gamma_log_vertical (a u v : ℝ) + (ha : 1 / 8 ≤ a) (ha3 : a ≤ 3) : + |Real.log ‖Complex.Gamma ((a : ℂ) + v * I)‖ - + Real.log ‖Complex.Gamma ((a : ℂ) + u * I)‖| ≤ + (59 + |Real.eulerMascheroniConstant|) * |v - u| := by + rcases le_total u v with huv | hvu + · simpa only [abs_of_nonneg (sub_nonneg.mpr huv)] using + sharp_gamma_log_vertical_ordered a u v ha ha3 huv + · have h := sharp_gamma_log_vertical_ordered a v u ha ha3 hvu + calc + _ = |Real.log ‖Complex.Gamma ((a : ℂ) + u * I)‖ - + Real.log ‖Complex.Gamma ((a : ℂ) + v * I)‖| := abs_sub_comm _ _ + _ ≤ _ := h + _ = _ := by rw [abs_of_nonpos (sub_nonpos.mpr hvu)]; ring + + theorem sharp_gamma_vertical (a u v : ℝ) (ha : 1 / 8 ≤ a) (ha3 : a ≤ 3) : + ‖Complex.Gamma ((a : ℂ) + v * I)‖ / ‖Complex.Gamma ((a : ℂ) + u * I)‖ ≤ + Real.exp ((59 + |Real.eulerMascheroniConstant|) * |v - u|) := by + have hGu : 0 < ‖Complex.Gamma ((a : ℂ) + u * I)‖ := + norm_pos_iff.mpr (Complex.Gamma_ne_zero_of_re_pos (by simp; linarith)) + have hGv : 0 < ‖Complex.Gamma ((a : ℂ) + v * I)‖ := + norm_pos_iff.mpr (Complex.Gamma_ne_zero_of_re_pos (by simp; linarith)) + have h := (le_abs_self _).trans (sharp_gamma_log_vertical a u v ha ha3) + rw [← Real.log_div hGv.ne' hGu.ne'] at h + have he := Real.exp_le_exp.mpr h + rwa [Real.exp_log (div_pos hGv hGu)] at he + + theorem sharp_gamma_quotient (a b t u : ℝ) + (ha : 1 / 8 ≤ a) (hab : a ≤ b) (hb : b ≤ 3) : + ‖Complex.Gamma ((b : ℂ) + (t + u) * I)‖ / ‖Complex.Gamma ((a : ℂ) + t * I)‖ ≤ + Real.exp ((59 + |Real.eulerMascheroniConstant|) * (b - a + |u|)) * + (|t| + 2) ^ (b - a) := by + have hn : ‖Complex.Gamma ((b : ℂ) + t * I)‖ ≠ 0 := + norm_ne_zero_iff.mpr (Complex.Gamma_ne_zero_of_re_pos (by simp; linarith)) + have hv := sharp_gamma_vertical b t (t + u) (ha.trans hab) hb + simp only [add_sub_cancel_left] at hv + calc + _ = (‖Complex.Gamma ((b : ℂ) + (t + u) * I)‖ / ‖Complex.Gamma ((b : ℂ) + t * I)‖) * + (‖Complex.Gamma ((b : ℂ) + t * I)‖ / ‖Complex.Gamma ((a : ℂ) + t * I)‖) := by + field_simp + _ ≤ Real.exp ((59 + |Real.eulerMascheroniConstant|) * |u|) * + (Real.exp ((59 + |Real.eulerMascheroniConstant|) * (b - a)) * + (|t| + 2) ^ (b - a)) := + by simpa only [Complex.ofReal_add] using + mul_le_mul hv (sharp_gamma_horizontal_ordered a b t ha hab hb) + (by positivity) (by positivity) + _ = _ := by rw [← mul_assoc, ← Real.exp_add]; congr 2; ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ShiftedRealHadamard.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ShiftedRealHadamard.lean new file mode 100644 index 0000000000000000000000000000000000000000..7bb6ad7d694cbd1ef44b25a5ca849db2be31cd82 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ShiftedRealHadamard.lean @@ -0,0 +1,116 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ActualRealZeroExpansion + +namespace OAI + +/-! # Real parts of the Hadamard identity off the real axis -/ + +namespace Ostmann + +open Complex Filter +open scoped Topology BigOperators + +theorem realZeroKernel_complex_sub (s ρ : ℂ) : + ((s - ρ)⁻¹).re = realZeroKernel (s.re - ρ.re) (s.im - ρ.im) := by + simp only [Complex.inv_re, Complex.normSq_apply, Complex.sub_re, Complex.sub_im, + realZeroKernel, pow_two] + +theorem inverse_square_shift_bound (y t : ℝ) : + ((1 + |t - y|) ^ 2)⁻¹ ≤ (1 + |t|) ^ 2 * ((1 + |y|) ^ 2)⁻¹ := by + have htri : |y| ≤ |t| + |t - y| := by + have hh := abs_add_le (t - y) (-t) + have he : t - y + -t = -y := by ring + rw [he, abs_neg, abs_neg] at hh + linarith + have hb : 1 + |y| ≤ (1 + |t|) * (1 + |t - y|) := by + nlinarith [mul_nonneg (abs_nonneg t) (abs_nonneg (t - y))] + have hs : (1 + |y|) ^ 2 ≤ (1 + |t|) ^ 2 * (1 + |t - y|) ^ 2 := by + calc + _ ≤ ((1 + |t|) * (1 + |t - y|)) ^ 2 := by gcongr + _ = _ := by ring + have hy : 0 < (1 + |y|) ^ 2 := by positivity + have ht : 0 < (1 + |t - y|) ^ 2 := by positivity + rw [← div_eq_mul_inv, ← one_div, div_le_div_iff₀ ht hy] + simpa using hs + +noncomputable def shiftedRealCharacterZeroSum (χ : PrimitiveRealCharacter) (s : ℂ) : ℝ := + ∑' i, ((s - (realCharacterActualZeros χ).zeros i)⁻¹).re + +theorem shifted_real_zero_summable (χ : PrimitiveRealCharacter) (s : ℂ) + (hs : 1 < s.re) (hs2 : s.re ≤ 2) : + Summable (fun i => ((s - (realCharacterActualZeros χ).zeros i)⁻¹).re) := by + let Z := realCharacterActualZeros χ + have hh := character_zero_inverse_square_summable χ.asComplex + let C := 8 + 4 * (s.re - 1)⁻¹ + have hC : 0 ≤ C := by dsimp [C]; positivity + apply Summable.of_nonneg_of_le + (fun i => by rw [realZeroKernel_complex_sub]; exact realZeroKernel_nonneg (by linarith [(Z.in_strip i).2])) + (fun i => ?_) (hh.mul_left (C * (1 + |s.im|) ^ 2)) + rw [realZeroKernel_complex_sub] + calc + _ ≤ C * ((1 + |s.im - (Z.zeros i).im|) ^ 2)⁻¹ := + real_zero_kernel_square_bound _ _ (s.re - 1) (by linarith) + (by linarith [(Z.in_strip i).2]) (by linarith [(Z.in_strip i).1]) + _ ≤ C * ((1 + |s.im|) ^ 2 * ((1 + |(Z.zeros i).im|) ^ 2)⁻¹) := + mul_le_mul_of_nonneg_left (inverse_square_shift_bound _ _) hC + _ = _ := by dsimp [Z, realCharacterActualZeros]; ring + +theorem shifted_completed_partial_real_limit (χ : PrimitiveRealCharacter) (s : ℂ) + (hsum : Summable (fun i => ((s - (realCharacterActualZeros χ).zeros i)⁻¹).re)) : + Tendsto (fun n : ℕ => (completedZeroPartialFraction χ.asComplex ((n : ℝ) + 1) s).re) + atTop (𝓝 (shiftedRealCharacterZeroSum χ s)) := by + let Z := realCharacterActualZeros χ + have hn : Tendsto (fun n : ℕ => (n : ℝ) + 1) atTop atTop := + tendsto_atTop_add_const_right _ _ tendsto_natCast_atTop_atTop + have hh := hsum.hasSum.comp (Z.tendsto_diskIndices.comp hn) + unfold shiftedRealCharacterZeroSum + convert hh using 1 + funext n + rw [completedZeroPartialFraction_index_sum χ.asComplex (faithfulCharacterZeroEquiv χ.asComplex), + Complex.re_sum] + rfl + +theorem shifted_real_zero_reflection (χ : PrimitiveRealCharacter) (s : ℂ) + (hs : 1 < s.re) (hs2 : s.re ≤ 2) : + Summable (fun i => ((1 - s - (realCharacterActualZeros χ).zeros i)⁻¹).re) ∧ + shiftedRealCharacterZeroSum χ (1 - s) = -shiftedRealCharacterZeroSum χ s := by + have he (i : ℕ) : ((1 - s - (realCharacterActualZeros χ).zeros i)⁻¹).re = + -((s - (realCharacterActualZeros χ).zeros (realZeroIndexReflection χ i))⁻¹).re := by + rw [realZeroIndexReflection_zeros] + have ha : 1 - s - (realCharacterActualZeros χ).zeros i = + -(s - (1 - (realCharacterActualZeros χ).zeros i)) := by ring + rw [ha, inv_neg, Complex.neg_re] + have hsum := shifted_real_zero_summable χ s hs hs2 + constructor + · simpa only [he, Function.comp_def] using + (hsum.comp_injective (realZeroIndexReflection χ).injective).neg + · unfold shiftedRealCharacterZeroSum + simp_rw [he] + rw [tsum_neg] + congr 1 + exact (realZeroIndexReflection χ).tsum_eq + (fun i => ((s - (realCharacterActualZeros χ).zeros i)⁻¹).re) + +/-- The shifted identity supplies the actual zero terms used in the +low-height zero-free-region argument. -/ +theorem shifted_real_hadamard_identity (χ : PrimitiveRealCharacter) (s : ℂ) + (hs : 1 < s.re) (hs2 : s.re ≤ 2) : + shiftedRealCharacterZeroSum χ s = (logDeriv χ.asComplex.completed s).re + + (1 / 2) * Real.log χ.modulus := by + have hp := shifted_completed_partial_real_limit χ s (shifted_real_zero_summable χ s hs hs2) + obtain ⟨hn, heq⟩ := shifted_real_zero_reflection χ s hs hs2 + have hm := shifted_completed_partial_real_limit χ (1 - s) hn + have hc := completed_partial_fraction_difference_tendsto χ.asComplex (1 - s) s + (χ.asComplex.completed_ne_zero_left _ (by simp; linarith)) + (χ.asComplex.completed_ne_zero_right _ hs.le) + have hr := Complex.continuous_re.continuousAt.tendsto.comp hc + have hlim : shiftedRealCharacterZeroSum χ s - shiftedRealCharacterZeroSum χ (1 - s) = + (logDeriv χ.asComplex.completed s - logDeriv χ.asComplex.completed (1 - s)).re := by + apply tendsto_nhds_unique (hp.sub hm) + simpa only [Function.comp_def, Complex.sub_re] using hr + rw [heq, χ.completed_logDeriv_reflection s hs.le] at hlim + simp only [Complex.sub_re, Complex.neg_re, Complex.log_re, Complex.norm_natCast] at hlim + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SiegelBoundProof.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SiegelBoundProof.lean new file mode 100644 index 0000000000000000000000000000000000000000..64e4da34654fd71795454480eb9e67a98f424ba9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SiegelBoundProof.lean @@ -0,0 +1,89 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterSiegelTools + +namespace OAI + +/-! # Siegel's bound for the actual primitive real zeros + +The proved quadratic L-value estimate is combined with a small-power bound +for the derivative in a fixed strip. Constants may depend on the exponent. +-/ + +namespace Ostmann + +open Complex + + theorem publishedSiegelBound : PublishedSiegelBound := by + intro ε hε + let η : ℝ := min (ε / 4) (1 / 4) + have hη : 0 < η := lt_min (by positivity) (by norm_num) + have hη4 : η ≤ 1 / 4 := min_le_right _ _ + have hηε : 3 * η ≤ ε := by have := min_le_left (ε / 4) (1 / 4); dsimp [η]; linarith + obtain ⟨c, hc, hL⟩ := LargePrimeGaps.quadratic_siegel hη (by linarith : η ≤ 1) + obtain ⟨K, hK, hd⟩ := character_deriv_small_power hη (by linarith : η ≤ 1 / 2) + let D : ℝ := K * 4 ^ (2 * η) + let C : ℝ := max (D * 3 ^ ε / c) (2 / η) + have hD : 0 < D := mul_pos hK (Real.rpow_pos_of_pos (by norm_num) _) + have hC : 0 < C := lt_max_of_lt_right (by positivity) + refine ⟨C, hC, ?_⟩ + intro e + let : NeZero e.modulus := ⟨e.positive.ne'⟩ + have hq : (1 : ℝ) ≤ e.modulus := by exact_mod_cast e.positive + have hqpow : 1 ≤ (e.modulus : ℝ) ^ ε := Real.one_le_rpow hq hε.le + have hgap : 0 < 1 - e.beta := sub_pos.mpr e.beta_lt_one + by_cases hnear : 1 - η / 2 ≤ e.beta + · let rc : PrimitiveRealCharacter := ⟨e.modulus, e.positive, e.character, e.primitive, e.nontrivial⟩ + let χ := rc.complexCharacter + have hχ : χ ≠ 1 := rc.asComplex.nontrivial + have hχprim : χ.IsPrimitive := rc.asComplex.primitive + have hχquad : χ ^ 2 = 1 := + ((real_character_quadratic e.character).comp Complex.ofRealHom).sq_eq_one + have hlow := hL e.modulus χ hχprim hχ hχquad + have hzero : χ.LFunction (e.beta : ℂ) = 0 := e.zero + have hu := character_zero_value_bound hη (by linarith) hK e.modulus χ hχ + (hd e.modulus χ hχ) hnear e.beta_lt_one hzero + let R : ℝ := e.modulus + 2 + have hR : 0 < R := by dsimp [R]; positivity + have hR1 : 1 ≤ R := by dsimp [R]; linarith + have hlowR : c * R ^ (-η) ≤ ‖χ.LFunction 1‖ := by + apply le_trans ?_ hlow + apply mul_le_mul_of_nonneg_left ?_ hc.le + exact Real.rpow_le_rpow_of_nonpos (by positivity) (by dsimp [R]; linarith) (by linarith) + have hm := mul_le_mul_of_nonneg_right (hlowR.trans hu) (Real.rpow_nonneg hR.le η) + have he : R ^ (-η) * R ^ η = 1 := by rw [← Real.rpow_add hR]; simp + have huR : c ≤ (1 - e.beta) * D * R ^ (3 * η) := by + have hr : R ^ (2 * η) * R ^ η = R ^ (3 * η) := by + rw [← Real.rpow_add hR] + congr 1 + ring + calc + c = c * R ^ (-η) * R ^ η := by rw [mul_assoc c, he, mul_one] + _ ≤ (1 - e.beta) * (D * R ^ (2 * η)) * R ^ η := hm + _ = (1 - e.beta) * D * (R ^ (2 * η) * R ^ η) := by ring + _ = _ := by rw [hr] + have hpow : R ^ (3 * η) ≤ 3 ^ ε * (e.modulus : ℝ) ^ ε := by + calc + _ ≤ R ^ ε := Real.rpow_le_rpow_of_exponent_le hR1 hηε + _ ≤ (3 * (e.modulus : ℝ)) ^ ε := + Real.rpow_le_rpow hR.le (by dsimp [R]; linarith) hε.le + _ = _ := Real.mul_rpow (by norm_num) (by positivity) + have hraw : c ≤ (1 - e.beta) * D * (3 ^ ε * (e.modulus : ℝ) ^ ε) := + huR.trans (mul_le_mul_of_nonneg_left hpow (mul_nonneg hgap.le hD.le)) + have hone : 1 ≤ (D * 3 ^ ε / c * (e.modulus : ℝ) ^ ε) * (1 - e.beta) := by + calc + 1 = c / c := (div_self hc.ne').symm + _ ≤ ((1 - e.beta) * D * (3 ^ ε * (e.modulus : ℝ) ^ ε)) / c := + div_le_div_of_nonneg_right hraw hc.le + _ = _ := by ring + have hbound : (1 - e.beta)⁻¹ ≤ D * 3 ^ ε / c * (e.modulus : ℝ) ^ ε := by + rw [← one_div] + exact (div_le_iff₀ hgap).mpr hone + exact hbound.trans (mul_le_mul_of_nonneg_right (le_max_left _ _) (by positivity)) + · have hfar : (1 - e.beta)⁻¹ ≤ 2 / η := by + have hh := one_div_le_one_div_of_le (by positivity : 0 < η / 2) + (show η / 2 ≤ 1 - e.beta by linarith) + simpa only [one_div, inv_div] using hh + exact hfar.trans ((le_max_right _ _).trans (le_mul_of_one_le_right hC.le hqpow)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmallDiskLogDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmallDiskLogDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..9cd083d9a204ae42f797eec98c13974b3cb9cce4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmallDiskLogDerivative.lean @@ -0,0 +1,99 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.LogDerivativeDiskBound + +namespace OAI + +/-! # A fixed small-disk logarithmic-derivative estimate -/ + +namespace Ostmann + +open Complex Metric Set + +theorem logDeriv_norm_le_small_disk (g : ℂ → ℂ) (A : ℝ) (hA : 0 < A) + (hg : AnalyticOnNhd ℂ g (ball 0 (3 / 2))) + (hne : ∀ z ∈ ball 0 (3 / 2), g z ≠ 0) + (hlog : ∀ z ∈ ball 0 (3 / 2), Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A) + (w : ℂ) (hw : ‖w‖ ≤ 1) : ‖logDeriv g w‖ ≤ 48 * A := by + obtain ⟨F, hF0, hF, heF⟩ := exists_normalized_log_on_ball g (3 / 2) + (by norm_num) hg hne + have hd : DifferentiableOn ℂ F (ball 0 (3 / 2)) := fun z hz => + (hF z hz).differentiableAt.differentiableWithinAt + have hreal : MapsTo F (ball 0 (3 / 2)) {z : ℂ | z.re ≤ A} := by + intro z hz + change (F z).re ≤ A + rw [normalized_log_re g F z (hne 0 (mem_ball_self (by norm_num))) (heF z hz)] + exact hlog z hz + have hv (v : ℂ) (hv : v ∈ closedBall w (1 / 8)) : ‖v‖ ≤ 9 / 8 := by + have hh := norm_le_norm_sub_add v w + have hdist : ‖v - w‖ ≤ 1 / 8 := by simpa only [mem_closedBall, dist_eq_norm] using hv + linarith + have hvball (v : ℂ) (h : v ∈ closedBall w (1 / 8)) : v ∈ ball 0 (3 / 2) := by + rw [mem_ball, dist_zero_right] + linarith [hv v h] + have hdc : DiffContOnCl ℂ F (ball w (1 / 8)) := by + apply DiffContOnCl.mk_ball + · intro v hv' + exact (hF v (hvball v (ball_subset_closedBall hv'))).differentiableAt.differentiableWithinAt + · exact fun v hv' => (hF v (hvball v hv')).continuousAt.continuousWithinAt + have hbound : ∀ v ∈ sphere w (1 / 8), ‖F v‖ ≤ 6 * A := by + intro v hv' + have hvC := sphere_subset_closedBall hv' + have hnv := hv v hvC + have hden : 0 < 3 / 2 - ‖v‖ := by linarith + have hh := Complex.borelCaratheodory_zero hA hd hreal (by norm_num) + (hvball v hvC) hF0 + apply hh.trans + apply (div_le_iff₀ hden).mpr + nlinarith + have hh := Complex.norm_deriv_le_of_forall_mem_sphere_norm_le + (by norm_num : (0 : ℝ) < 1 / 8) hdc hbound + have hwball : w ∈ ball 0 (3 / 2) := by rw [mem_ball, dist_zero_right]; linarith + rw [(hF w hwball).deriv] at hh + convert hh using 1 + ring + +theorem logDeriv_norm_le_five_quarters_disk (g : ℂ → ℂ) (A : ℝ) (hA : 0 < A) + (hg : AnalyticOnNhd ℂ g (ball 0 (3 / 2))) + (hne : ∀ z ∈ ball 0 (3 / 2), g z ≠ 0) + (hlog : ∀ z ∈ ball 0 (3 / 2), Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A) + (w : ℂ) (hw : ‖w‖ ≤ 5 / 4) : ‖logDeriv g w‖ ≤ 352 * A := by + obtain ⟨F, hF0, hF, heF⟩ := exists_normalized_log_on_ball g (3 / 2) + (by norm_num) hg hne + have hd : DifferentiableOn ℂ F (ball 0 (3 / 2)) := fun z hz => + (hF z hz).differentiableAt.differentiableWithinAt + have hreal : MapsTo F (ball 0 (3 / 2)) {z : ℂ | z.re ≤ A} := by + intro z hz + change (F z).re ≤ A + rw [normalized_log_re g F z (hne 0 (mem_ball_self (by norm_num))) (heF z hz)] + exact hlog z hz + have hv (v : ℂ) (hv : v ∈ closedBall w (1 / 16)) : ‖v‖ ≤ 21 / 16 := by + have hh := norm_le_norm_sub_add v w + have hdist : ‖v - w‖ ≤ 1 / 16 := by simpa only [mem_closedBall, dist_eq_norm] using hv + linarith + have hvball (v : ℂ) (h : v ∈ closedBall w (1 / 16)) : v ∈ ball 0 (3 / 2) := by + rw [mem_ball, dist_zero_right] + linarith [hv v h] + have hdc : DiffContOnCl ℂ F (ball w (1 / 16)) := by + apply DiffContOnCl.mk_ball + · intro v hv' + exact (hF v (hvball v (ball_subset_closedBall hv'))).differentiableAt.differentiableWithinAt + · exact fun v hv' => (hF v (hvball v hv')).continuousAt.continuousWithinAt + have hbound : ∀ v ∈ sphere w (1 / 16), ‖F v‖ ≤ 22 * A := by + intro v hv' + have hvC := sphere_subset_closedBall hv' + have hnv := hv v hvC + have hden : 0 < 3 / 2 - ‖v‖ := by linarith + have hh := Complex.borelCaratheodory_zero hA hd hreal (by norm_num) + (hvball v hvC) hF0 + apply hh.trans + apply (div_le_iff₀ hden).mpr + nlinarith + have hh := Complex.norm_deriv_le_of_forall_mem_sphere_norm_le + (by norm_num : (0 : ℝ) < 1 / 16) hdc hbound + have hwball : w ∈ ball 0 (3 / 2) := by rw [mem_ball, dist_zero_right]; linarith + rw [(hF w hwball).deriv] at hh + convert hh using 1 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothActualExplicitFormula.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothActualExplicitFormula.lean new file mode 100644 index 0000000000000000000000000000000000000000..115f9183bb379c6cfc15ea07d09596d6587425fb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothActualExplicitFormula.lean @@ -0,0 +1,38 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothExplicitIdentity +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothZeroCountFamily + +namespace OAI + +/-! # Discharging the fixed-test smooth explicit-formula input -/ + +namespace Ostmann + +open Complex MeasureTheory +open scoped BigOperators + +theorem actual_smooth_explicit_formula (e : ∀ χ, ℕ ≃ CharacterZeroCopy χ) : + ∃ E : ℝ, 0 < E ∧ ∀ (χ : PrimitiveComplexCharacter) (X : ℝ), 2 ≤ X → + ‖smoothMangoldtMean χ.modulus χ.character X + + (∑' i, smoothZeroTerm (fun ψ => characterZeroEnumeration ψ (e ψ)) χ X i) + + smoothTrivialZeroTerm χ‖ ≤ E / Real.sqrt X * Real.log (2 * (χ.modulus : ℝ)) := by + obtain ⟨E, hE, hbound⟩ := leftContour_integral_bound + refine ⟨E, hE, ?_⟩ + intro χ X hX + rw [smooth_explicit_identity e χ X hX, norm_mul] + have hc : ‖((1 / (2 * Real.pi) : ℝ) : ℂ)‖ ≤ 1 := by + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (by positivity)] + apply (div_le_one (by positivity)).mpr + linarith [Real.pi_gt_three] + exact (mul_le_of_le_one_left (norm_nonneg _) hc).trans (hbound χ X (by linarith)) + +noncomputable def actualSmoothExplicitFormula (e : ∀ χ, ℕ ≃ CharacterZeroCopy χ) : + PublishedSmoothExplicitFormula (fun χ => characterZeroEnumeration χ (e χ)) := by + let E := Classical.choose (actual_smooth_explicit_formula e) + have hE := (Classical.choose_spec (actual_smooth_explicit_formula e)).1 + have hformula := (Classical.choose_spec (actual_smooth_explicit_formula e)).2 + exact smoothExplicitFormula_of_multiplicity + (fun χ => characterZeroEnumeration_respectsMultiplicity χ (e χ)) E hE hformula + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothActualZeroSum.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothActualZeroSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..8019796b76053712f1faf8d8abc37e9e18db67c1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothActualZeroSum.lean @@ -0,0 +1,69 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroPartialSums + +namespace OAI + +/-! # Convergence of the actual contour zero sum -/ + +namespace Ostmann + +open Filter Finset +open scoped Topology BigOperators Classical + +theorem smoothZeroTerm_summable_of_multiplicity {Z : ∀ χ, ComplexZeroEnumeration χ} + (χ : PrimitiveComplexCharacter) (hZ : (Z χ).RespectsMultiplicity) + (X : ℝ) (hX : 2 ≤ X) : Summable (fun i => ‖smoothZeroTerm Z χ X i‖) := by + obtain ⟨C, hC, hM⟩ := primeMeanMellin_decay + let D : ℝ := 32 / Real.log (14 / 13) + have hD : 0 ≤ D := le_of_lt (div_pos (by norm_num) (Real.log_pos (by norm_num))) + have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive + have hcount (S : Finset ℕ) (T : ℝ) (hT : 0 ≤ T) : + ((S.filter (fun i => |((Z χ).zeros i).im| ≤ T)).card : ℝ) ≤ + D * (T + 1) * Real.log ((χ.modulus : ℝ) * (T + 2)) := by + have hsub : (S.filter fun i => |((Z χ).zeros i).im| ≤ T) ⊆ (Z χ).heightIndices T := by + intro i hi + exact ((Z χ).mem_heightIndices T i).mpr (mem_filter.mp hi).2 + calc + _ ≤ ((Z χ).count 0 T : ℝ) := by + rw [(Z χ).count_zero_eq_card] + exact_mod_cast card_le_card hsub + _ ≤ _ := (Z χ).count_bound_of_multiplicity hZ T hT + apply summable_of_sum_le (fun i => norm_nonneg _) + (c := (X * C) * (2 * (2 * D * (Real.log χ.modulus + 3)) ^ 2)) + intro S + have hh := finite_high_zero_tail_bound S (fun i => |((Z χ).zeros i).im|) + (χ.modulus : ℝ) D 0 hq hD le_rfl (fun _ _ => abs_nonneg _) (hcount S) + simp only [add_zero, Real.log_one, mul_zero, Real.exp_zero, mul_one] at hh + calc + _ ≤ ∑ i ∈ S, (X * C) * Real.exp (-8 * Real.log (1 + |((Z χ).zeros i).im|)) := + sum_le_sum (fun i _ => smoothZeroTerm_bound_of_mellin C hM χ X (by linarith) i) + _ = (X * C) * ∑ i ∈ S, Real.exp (-8 * Real.log (1 + |((Z χ).zeros i).im|)) := + (mul_sum ..).symm + _ ≤ _ := mul_le_mul_of_nonneg_left hh (by positivity) + +theorem smoothContourWeight_eq_zeroTerm (Z : ∀ χ, ComplexZeroEnumeration χ) + (χ : PrimitiveComplexCharacter) (X : ℝ) (hX : 0 < X) (i : ℕ) : + smoothContourWeight X ((Z χ).zeros i) = smoothZeroTerm Z χ X i := by + rw [smoothContourWeight, smoothZeroTerm, Complex.cpow_def_of_ne_zero (by exact_mod_cast hX.ne')] + rw [← Complex.ofReal_log hX.le] + congr 2 + ring + +theorem smoothActualZeroSum_tendsto (e : ∀ χ, ℕ ≃ CharacterZeroCopy χ) + (χ : PrimitiveComplexCharacter) (X : ℝ) (hX : 2 ≤ X) : + Tendsto (fun T : ℝ => ∑ z ∈ criticalZerosUpTo χ T, + (analyticOrderNatAt χ.L z : ℂ) * smoothContourWeight X z) atTop + (𝓝 (∑' i, smoothZeroTerm (fun ψ => characterZeroEnumeration ψ (e ψ)) χ X i)) := by + let Z := fun ψ => characterZeroEnumeration ψ (e ψ) + have hs := (smoothZeroTerm_summable_of_multiplicity (Z := Z) χ + (characterZeroEnumeration_respectsMultiplicity χ (e χ)) X hX).of_norm + have ht := (Z χ).tendsto_height_sum (fun i => smoothZeroTerm Z χ X i) hs + convert ht using 1 + funext T + rw [characterZeroEnumeration_height_sum] + apply Finset.sum_congr rfl + intro i _ + exact smoothContourWeight_eq_zeroTerm Z χ X (by linarith) i + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothCharacterFamily.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothCharacterFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7d0e91e251c16edbcd2604ad5ac78c9dd954352 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothCharacterFamily.lean @@ -0,0 +1,101 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothZeroSplit + +namespace OAI + +/-! # The smooth character mean with all zero contributions displayed -/ + +namespace Ostmann +open scoped Classical BigOperators + +theorem smoothTrivialZeroTerm_norm_le {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : PublishedSmoothExplicitFormula Z) (χ : PrimitiveComplexCharacter) : + ‖smoothTrivialZeroTerm χ‖ ≤ P.mellinConstant := by + have hh := P.mellin_decay 0 (by norm_num) (by norm_num) + simp only [Complex.zero_im, abs_zero, add_zero, Real.log_one, mul_zero, + Real.exp_zero, mul_one] at hh + unfold smoothTrivialZeroTerm + split_ifs + · exact hh + · simpa only [norm_zero] using P.mellinConstant_pos.le + +theorem smooth_character_bounded_height {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : PublishedSmoothExplicitFormula Z) (χ : PrimitiveComplexCharacter) + (X T : ℝ) (hX : 2 ≤ X) : + ‖smoothMangoldtMean χ.modulus χ.character X‖ ≤ + (∑ i ∈ (Z χ).heightIndices T, ‖smoothZeroTerm Z χ X i‖) + + (∑' i, if T ≤ |((Z χ).zeros i).im| then ‖smoothZeroTerm Z χ X i‖ else 0) + + P.mellinConstant + P.errorConstant / Real.sqrt X * Real.log (2 * (χ.modulus : ℝ)) := by + have htri : ‖smoothMangoldtMean χ.modulus χ.character X‖ ≤ + ‖smoothMangoldtMean χ.modulus χ.character X + + (∑' i, smoothZeroTerm Z χ X i) + smoothTrivialZeroTerm χ‖ + + ‖∑' i, smoothZeroTerm Z χ X i‖ + ‖smoothTrivialZeroTerm χ‖ := by + have he : smoothMangoldtMean χ.modulus χ.character X = + (smoothMangoldtMean χ.modulus χ.character X + + (∑' i, smoothZeroTerm Z χ X i) + smoothTrivialZeroTerm χ) - + (∑' i, smoothZeroTerm Z χ X i) - smoothTrivialZeroTerm χ := by ring + calc + _ = ‖(smoothMangoldtMean χ.modulus χ.character X + + (∑' i, smoothZeroTerm Z χ X i) + smoothTrivialZeroTerm χ) - + (∑' i, smoothZeroTerm Z χ X i) - smoothTrivialZeroTerm χ‖ := congrArg norm he + _ ≤ _ := (norm_sub_le _ _).trans (by gcongr; exact norm_sub_le _ _) + have hn := norm_tsum_le_tsum_norm (P.absolute_summability χ X hX) + have hz := nonnegative_tsum_finite_tail_bound (fun i => ‖smoothZeroTerm Z χ X i‖) + (fun _ => norm_nonneg _) (P.absolute_summability χ X hX) ((Z χ).heightIndices T) + (fun i => T ≤ |((Z χ).zeros i).im|) (fun i hi => by + have hh : ¬ |((Z χ).zeros i).im| ≤ T := by + simpa only [ComplexZeroEnumeration.mem_heightIndices] using hi + exact (lt_of_not_ge hh).le) + linarith [P.explicit_formula χ X hX, smoothTrivialZeroTerm_norm_le P χ] + +theorem smooth_nonprincipal_family_bound {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : PublishedSmoothExplicitFormula Z) (Q : ℕ) (hQ : 1 ≤ Q) + (F : Finset PrimitiveComplexCharacter) (hF : ∀ χ ∈ F, χ.modulus ≤ Q) + (T X : ℝ) (hT : 0 ≤ T) (hX : 2 ≤ X) : + (∑ χ ∈ F, ‖smoothMangoldtMean χ.modulus χ.character X‖) ≤ + (X * P.mellinConstant) * + (∑ χ ∈ F, ∑ i ∈ ((Z χ).heightIndices T).filter + (fun i => 1 / 2 ≤ ((Z χ).zeros i).re), + Real.exp (-Real.log X * (1 - ((Z χ).zeros i).re))) + + (Real.exp ((1 / 2 : ℝ) * Real.log X) * P.mellinConstant) * + (P.zeroCountConstant * (Q : ℝ) ^ 2 * (T + 1) * Real.log ((Q : ℝ) * (T + 2))) + + (X * P.mellinConstant) * + (2 * (2 * (P.zeroCountConstant * (Q : ℝ) ^ 2) * (Real.log Q + 3)) ^ 2 * + Real.exp (-4 * Real.log (1 + T))) + + (F.card : ℝ) * (P.mellinConstant + P.errorConstant / Real.sqrt X * Real.log (2 * (Q : ℝ))) := by + have hQp : (0 : ℝ) < Q := by exact_mod_cast (show 0 < Q by omega) + have hX1 : 1 ≤ X := by linarith + have hpoint (χ) (hχ : χ ∈ F) : + ‖smoothMangoldtMean χ.modulus χ.character X‖ ≤ + (X * P.mellinConstant) * + (∑ i ∈ ((Z χ).heightIndices T).filter (fun i => 1 / 2 ≤ ((Z χ).zeros i).re), + Real.exp (-Real.log X * (1 - ((Z χ).zeros i).re))) + + (Real.exp ((1 / 2 : ℝ) * Real.log X) * P.mellinConstant) * + ((Z χ).heightIndices T).card + + (∑' i, if T ≤ |((Z χ).zeros i).im| then ‖smoothZeroTerm Z χ X i‖ else 0) + + (P.mellinConstant + P.errorConstant / Real.sqrt X * Real.log (2 * (Q : ℝ))) := by + have ht := smooth_character_bounded_height P χ X T hX + have hz := bounded_height_zero_norm_sum P χ T X hX1 + have hlog : Real.log (2 * (χ.modulus : ℝ)) ≤ Real.log (2 * (Q : ℝ)) := by + apply Real.log_le_log (by have hp := χ.positive; positivity) + exact mul_le_mul_of_nonneg_left (by exact_mod_cast hF χ hχ) (by norm_num) + have he := mul_le_mul_of_nonneg_left hlog + (div_nonneg P.errorConstant_pos.le (Real.sqrt_nonneg X)) + linarith + have hh := Finset.sum_le_sum hpoint + simp only [Finset.sum_add_distrib, ← Finset.mul_sum, Finset.sum_const, nsmul_eq_mul] at hh + have hc : (∑ χ ∈ F, (((Z χ).heightIndices T).card : ℝ)) ≤ + P.zeroCountConstant * (Q : ℝ) ^ 2 * (T + 1) * Real.log ((Q : ℝ) * (T + 2)) := by + have he (χ : PrimitiveComplexCharacter) : ((Z χ).heightIndices T).card = + (Z χ).count 0 T := by + unfold ComplexZeroEnumeration.count + rw [Finset.filter_eq_self.mpr (fun i _ => ((Z χ).in_strip i).1.le)] + simp only [he] + exact P.zero_count Q hQ T hT F hF + have hc' := mul_le_mul_of_nonneg_left hc + (mul_nonneg (Real.exp_nonneg ((1 / 2 : ℝ) * Real.log X)) P.mellinConstant_pos.le) + have hhigh := high_smooth_zero_tsum_bound P Q hQ F hF T X hT hX1 + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothContourLimit.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothContourLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..98d8a468571c935758476e87d3e6a9d381a1c296 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothContourLimit.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothHorizontalLimit +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothRightContour +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothActualZeroSum + +namespace OAI + +/-! # Passing the actual finite contour identity to infinite height -/ + +namespace Ostmann + +open Complex Filter MeasureTheory +open scoped Topology BigOperators Interval + +theorem smooth_contour_limit (e : ∀ χ, ℕ ≃ CharacterZeroCopy χ) + (χ : PrimitiveComplexCharacter) (X : ℝ) (hX : 2 ≤ X) : + I * (∫ y : ℝ, rightContourIntegrand χ X y) - + I * (∫ y : ℝ, leftContourIntegrand χ X y) = + -(2 * (Real.pi : ℂ) * I) * + ((∑' i, smoothZeroTerm (fun ψ => characterZeroEnumeration ψ (e ψ)) χ X i) + + smoothTrivialZeroTerm χ) := by + obtain ⟨t, htpos, htlim, hzero, htop, hbot⟩ := smooth_horizontal_integrals_tendsto χ X hX + have htneg : Tendsto (fun n => -t n) atTop atBot := tendsto_neg_atTop_atBot.comp htlim + have hr := intervalIntegral_tendsto_integral + (rightContourIntegrand_integrable χ X (by linarith)) htneg htlim + have hl := intervalIntegral_tendsto_integral + (leftContourIntegrand_integrable χ X (by linarith)) htneg htlim + let f : ℂ → ℂ := fun z => (-deriv χ.L z / χ.L z) * smoothContourWeight X z + have hbd : Tendsto (fun n => rectangleBoundaryIntegral f (-(1 / 2)) 2 (-t n) (t n)) + atTop (𝓝 (I * (∫ y : ℝ, rightContourIntegrand χ X y) - + I * (∫ y : ℝ, leftContourIntegrand χ X y))) := by + have hh := ((hbot.sub htop).add (hr.const_mul I)).sub (hl.const_mul I) + simpa [rectangleBoundaryIntegral, f, smoothHorizontalIntegral, + rightContourIntegrand, leftContourIntegrand, primeMellinLine, primeVerticalWeight, + leftContourLine, smoothContourWeight] using hh + have hs := (smoothActualZeroSum_tendsto e χ X hX).comp htlim + have hres : Tendsto (fun n => -(2 * (Real.pi : ℂ) * I) * + ((∑ z ∈ criticalZerosUpTo χ (t n), (analyticOrderNatAt χ.L z : ℂ) * smoothContourWeight X z) + + smoothTrivialZeroTerm χ)) atTop + (𝓝 (-(2 * (Real.pi : ℂ) * I) * + ((∑' i, smoothZeroTerm (fun ψ => characterZeroEnumeration ψ (e ψ)) χ X i) + + smoothTrivialZeroTerm χ))) := + tendsto_const_nhds.mul (hs.add_const (smoothTrivialZeroTerm χ)) + apply tendsto_nhds_unique hbd + apply hres.congr + intro n + exact (smoothContour_truncated χ X (by linarith) (t n) (htpos n) (hzero n)).symm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothContourRegularPart.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothContourRegularPart.lean new file mode 100644 index 0000000000000000000000000000000000000000..760aa683d716b2974c8ebac45ea9b27e58f36de1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothContourRegularPart.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothContourResidue + +namespace OAI + +/-! # Removing each actual simple logarithmic-derivative pole + +After adding back the zero's exact principal part, the smooth contour +integrand agrees locally with an analytic function. +-/ + +namespace Ostmann + +open Filter +open scoped Topology + +theorem smoothContour_regular_part (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (z : ℂ) : + ∃ R : ℂ → ℂ, AnalyticAt ℂ R z ∧ + (fun s => (-deriv χ.L s / χ.L s) * smoothContourWeight X s + + (analyticOrderNatAt χ.L z : ℂ) * smoothContourWeight X z / (s - z)) =ᶠ[𝓝[≠] z] R := by + obtain ⟨g, hg, hgne, hsplit⟩ := χ.logDeriv_local_split z + let W := smoothContourWeight X + have hW : AnalyticAt ℂ W z := (smoothContourWeight_differentiable X hX).analyticAt z + have hds : AnalyticAt ℂ (dslope W z) z := by + obtain ⟨p, hp⟩ := hW + exact ⟨p.fslope, hp.has_fpower_series_dslope_fslope⟩ + have hlog : AnalyticAt ℂ (logDeriv g) z := hg.deriv.div hg hgne + let R : ℂ → ℂ := fun s => -(analyticOrderNatAt χ.L z : ℂ) * dslope W z s - logDeriv g s * W s + refine ⟨R, (analyticAt_const.mul hds).sub (hlog.mul hW), ?_⟩ + filter_upwards [hsplit, self_mem_nhdsWithin] with s hs hsz + have hneg : -deriv χ.L s / χ.L s = -logDeriv χ.L s := by + rw [logDeriv_apply, neg_div] + rw [hneg, hs] + dsimp only [R] + rw [dslope_of_ne W hsz] + simp only [slope, smul_eq_mul] + change -((analyticOrderNatAt χ.L z : ℂ) / (s - z) + logDeriv g s) * W s + + (analyticOrderNatAt χ.L z : ℂ) * W z / (s - z) = + -(analyticOrderNatAt χ.L z : ℂ) * ((s - z)⁻¹ * (W s - W z)) - logDeriv g s * W s + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothContourResidue.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothContourResidue.lean new file mode 100644 index 0000000000000000000000000000000000000000..a69d78468b70dfd567e7cbdb3029d88d57f6356f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothContourResidue.lean @@ -0,0 +1,41 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterLogDerivativePole +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothDirichletIntegral + +namespace OAI + +/-! # The exact local zero contributions in the smooth contour integral -/ + +namespace Ostmann + +open Filter +open scoped Topology + +noncomputable def smoothContourWeight (X : ℝ) (s : ℂ) : ℂ := + (X : ℂ) ^ s * primeMeanMellin s + +theorem smoothContourWeight_differentiable (X : ℝ) (hX : 0 < X) : + Differentiable ℂ (smoothContourWeight X) := + (differentiable_id.const_cpow (.inl (by exact_mod_cast hX.ne'))).mul + primeMeanMellin_differentiable + +theorem smoothContourWeight_vertical (X t : ℝ) : + smoothContourWeight X (primeMellinLine t) = primeVerticalWeight X t := rfl + +/-- Every zero contributes its negative analytic multiplicity times the +literal Mellin weight. No zero is replaced by a formal pole label. -/ +theorem smoothContour_zero_residue (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (z : ℂ) : + Tendsto (fun s => (s - z) * + ((-deriv χ.L s / χ.L s) * smoothContourWeight X s)) (𝓝[≠] z) + (𝓝 (-(analyticOrderNatAt χ.L z : ℂ) * smoothContourWeight X z)) := by + have hW : Tendsto (smoothContourWeight X) (𝓝 z) (𝓝 (smoothContourWeight X z)) := + (smoothContourWeight_differentiable X hX).continuous.continuousAt.tendsto + have h := (χ.logDeriv_residue_limit z).neg.mul (hW.mono_left nhdsWithin_le_nhds) + convert h using 1 + funext s + simp only [logDeriv_apply] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothDirichletIntegral.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothDirichletIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..a62865334b3c05bb51a360d91ac6fa9afdc637dc --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothDirichletIntegral.lean @@ -0,0 +1,89 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothVerticalKernel + +namespace OAI + +/-! # The initial vertical-line formula for the smooth Mangoldt sum -/ + +namespace Ostmann + +open MeasureTheory +open scoped BigOperators + +noncomputable def characterVerticalTerm (χ : PrimitiveComplexCharacter) (X : ℝ) + (n : ℕ) (t : ℝ) : ℂ := + LSeries.term (characterMangoldtCoefficient χ) (primeMellinLine t) n * primeVerticalWeight X t + +theorem characterVerticalTerm_norm (χ : PrimitiveComplexCharacter) (X : ℝ) (n : ℕ) (t : ℝ) : + ‖characterVerticalTerm χ X n t‖ = + ‖LSeries.term (characterMangoldtCoefficient χ) 2 n‖ * ‖primeVerticalWeight X t‖ := by + rw [characterVerticalTerm, norm_mul, characterMangoldt_term_norm] + +theorem characterVerticalTerm_integrable (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (n : ℕ) : Integrable (characterVerticalTerm χ X n) := by + apply ((primeVerticalWeight_integrable X hX).norm.const_mul + ‖LSeries.term (characterMangoldtCoefficient χ) 2 n‖).mono' + · exact ((characterMangoldt_term_continuous χ n).mul + (primeVerticalWeight_continuous X hX)).aestronglyMeasurable + · exact Filter.Eventually.of_forall (fun t => (characterVerticalTerm_norm χ X n t).le) + +theorem characterVerticalTerm_summable_norm (χ : PrimitiveComplexCharacter) + (X : ℝ) : + Summable (fun n => ∫ t : ℝ, ‖characterVerticalTerm χ X n t‖) := by + have hs := (characterMangoldtCoefficient_summable χ).norm.mul_right + (∫ t : ℝ, ‖primeVerticalWeight X t‖) + apply hs.congr + intro n + simp only [characterVerticalTerm_norm, integral_const_mul] + +theorem smoothMangoldtMean_eq_vertical_LSeries (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) : + smoothMangoldtMean χ.modulus χ.character X = + ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, + LSeries (characterMangoldtCoefficient χ) (primeMellinLine t) * primeVerticalWeight X t := by + calc + _ = ∑' n : ℕ, characterMangoldtCoefficient χ n * (primeMeanTest (n / X) : ℂ) := by + apply tsum_congr + intro n + simp only [characterMangoldtCoefficient] + ring + _ = ∑' n : ℕ, ((1 / (2 * Real.pi) : ℝ) : ℂ) * + ∫ t : ℝ, characterVerticalTerm χ X n t := + tsum_congr (fun n => (characterMangoldt_term_inversion χ X hX n).symm) + _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * + ∑' n : ℕ, ∫ t : ℝ, characterVerticalTerm χ X n t := tsum_mul_left + _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * + ∫ t : ℝ, ∑' n : ℕ, characterVerticalTerm χ X n t := by + rw [integral_tsum_of_summable_integral_norm + (characterVerticalTerm_integrable χ X hX) (characterVerticalTerm_summable_norm χ X)] + _ = _ := by + congr 1 + apply integral_congr_ae + filter_upwards with t + exact tsum_mul_right + +theorem PrimitiveComplexCharacter.mangoldt_LSeries_eq (χ : PrimitiveComplexCharacter) + (s : ℂ) (hs : 1 < s.re) : + LSeries (characterMangoldtCoefficient χ) s = -deriv χ.L s / χ.L s := by + let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ + change LSeries (characterMangoldtCoefficient χ) s = + -deriv (DirichletCharacter.LFunction χ.character) s / DirichletCharacter.LFunction χ.character s + rw [DirichletCharacter.deriv_LFunction_eq_deriv_LSeries χ.character hs, + DirichletCharacter.LFunction_eq_LSeries χ.character hs] + exact DirichletCharacter.LSeries_twist_vonMangoldt_eq χ.character hs + +/-- The exact starting contour for the published explicit formula. -/ +theorem smoothMangoldtMean_eq_vertical_logDerivative (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) : + smoothMangoldtMean χ.modulus χ.character X = + ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, + (-deriv χ.L (primeMellinLine t) / χ.L (primeMellinLine t)) * + primeVerticalWeight X t := by + rw [smoothMangoldtMean_eq_vertical_LSeries χ X hX] + congr 1 + apply integral_congr_ae + filter_upwards with t + rw [χ.mangoldt_LSeries_eq (primeMellinLine t) (by simp)] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothExplicitFormulaCore.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothExplicitFormulaCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..edb258f7f8990956e166540f9315c7131b55e5a6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothExplicitFormulaCore.lean @@ -0,0 +1,111 @@ +import Mathlib.Topology.Algebra.InfiniteSum.Real +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedSmoothExplicitFormula +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothMellinBounds +import OAI.NumberTheory.Ostmann.ZeroDensity.HighZeroTailBound + +namespace OAI + +/-! # Removing the elementary fields of the smooth explicit-formula input + +The analytic input is only the zero count and fixed-test explicit formula. +The Mellin decay and absolute summability are derived for the actual test. +-/ + +namespace Ostmann + +open Finset +open scoped Classical BigOperators + +/-- The fixed-test explicit formula. -/ +structure SmoothExplicitFormulaCore (Z : ∀ χ, ComplexZeroEnumeration χ) where + errorConstant : ℝ + errorConstant_pos : 0 < errorConstant + zeroCountConstant : ℝ + zeroCountConstant_pos : 0 < zeroCountConstant + zero_count : ∀ Q : ℕ, 1 ≤ Q → ∀ T : ℝ, 0 ≤ T → + ∀ F : Finset PrimitiveComplexCharacter, (∀ χ ∈ F, χ.modulus ≤ Q) → + (∑ χ ∈ F, ((Z χ).count 0 T : ℝ)) ≤ + zeroCountConstant * (Q : ℝ) ^ 2 * (T + 1) * Real.log ((Q : ℝ) * (T + 2)) + explicit_formula : ∀ χ : PrimitiveComplexCharacter, ∀ X : ℝ, 2 ≤ X → + ‖smoothMangoldtMean χ.modulus χ.character X + + (∑' i, smoothZeroTerm Z χ X i) + smoothTrivialZeroTerm χ‖ ≤ + errorConstant / Real.sqrt X * Real.log (2 * (χ.modulus : ℝ)) + +theorem SmoothExplicitFormulaCore.finite_height_count {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : SmoothExplicitFormulaCore Z) (χ : PrimitiveComplexCharacter) (S : Finset ℕ) + (T : ℝ) (hT : 0 ≤ T) : + (((S.filter fun i => |((Z χ).zeros i).im| ≤ T).card : ℝ)) ≤ + (P.zeroCountConstant * (χ.modulus : ℝ) ^ 2) * (T + 1) * + Real.log ((χ.modulus : ℝ) * (T + 2)) := by + have hsub : (S.filter fun i => |((Z χ).zeros i).im| ≤ T) ⊆ (Z χ).heightIndices T := by + intro i hi + exact ((Z χ).mem_heightIndices T i).mpr (mem_filter.mp hi).2 + have hcard : ((Z χ).heightIndices T).card = (Z χ).count 0 T := by + unfold ComplexZeroEnumeration.count + rw [filter_eq_self.mpr (fun i _ => ((Z χ).in_strip i).1.le)] + have h := P.zero_count χ.modulus (Nat.succ_le_iff.mpr χ.positive) T hT {χ} (by simp) + simp only [sum_singleton] at h + calc + _ ≤ (((Z χ).heightIndices T).card : ℝ) := by exact_mod_cast card_le_card hsub + _ = ((Z χ).count 0 T : ℝ) := by rw [hcard] + _ ≤ _ := h + +theorem smoothZeroTerm_bound_of_mellin {Z : ∀ χ, ComplexZeroEnumeration χ} + (C : ℝ) + (hM : ∀ s : ℂ, -(1 / 2 : ℝ) ≤ s.re → s.re ≤ 2 → + ‖primeMeanMellin s‖ ≤ C * Real.exp (-8 * Real.log (1 + |s.im|))) + (χ : PrimitiveComplexCharacter) (X : ℝ) (hX : 1 ≤ X) (i : ℕ) : + ‖smoothZeroTerm Z χ X i‖ ≤ + (X * C) * Real.exp (-8 * Real.log (1 + |((Z χ).zeros i).im|)) := by + have hs := (Z χ).in_strip i + have hm := hM ((Z χ).zeros i) (by linarith) (by linarith) + have hX0 : 0 < X := by linarith + have he : Real.exp (((Z χ).zeros i).re * Real.log X) ≤ X := by + calc + _ ≤ Real.exp (Real.log X) := Real.exp_le_exp.mpr (by + simpa only [one_mul] using mul_le_mul_of_nonneg_right hs.2.le (Real.log_nonneg hX)) + _ = X := Real.exp_log hX0 + rw [smoothZeroTerm, norm_mul, Complex.norm_exp] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] + calc + _ ≤ X * (C * Real.exp (-8 * Real.log (1 + |((Z χ).zeros i).im|))) := + mul_le_mul he hm (norm_nonneg _) hX0.le + _ = _ := by ring + +theorem SmoothExplicitFormulaCore.absolute_summability {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : SmoothExplicitFormulaCore Z) (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 2 ≤ X) : Summable (fun i => ‖smoothZeroTerm Z χ X i‖) := by + obtain ⟨C, hC, hM⟩ := primeMeanMellin_decay + have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive + apply summable_of_sum_le (fun i => norm_nonneg _) + (c := (X * C) * (2 * (2 * (P.zeroCountConstant * (χ.modulus : ℝ) ^ 2) * + (Real.log χ.modulus + 3)) ^ 2)) + intro S + have hh := finite_high_zero_tail_bound S (fun i => |((Z χ).zeros i).im|) + (χ.modulus : ℝ) (P.zeroCountConstant * (χ.modulus : ℝ) ^ 2) 0 hq + (mul_nonneg P.zeroCountConstant_pos.le (sq_nonneg _)) le_rfl + (fun _ _ => abs_nonneg _) (P.finite_height_count χ S) + simp only [add_zero, Real.log_one, mul_zero, Real.exp_zero, mul_one] at hh + calc + _ ≤ ∑ i ∈ S, (X * C) * Real.exp (-8 * Real.log (1 + |((Z χ).zeros i).im|)) := + sum_le_sum (fun i _ => smoothZeroTerm_bound_of_mellin C hM χ X (by linarith) i) + _ = (X * C) * ∑ i ∈ S, Real.exp (-8 * Real.log (1 + |((Z χ).zeros i).im|)) := + (mul_sum ..).symm + _ ≤ _ := mul_le_mul_of_nonneg_left hh (by positivity) + +noncomputable def SmoothExplicitFormulaCore.toPublished {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : SmoothExplicitFormulaCore Z) : PublishedSmoothExplicitFormula Z where + errorConstant := P.errorConstant + errorConstant_pos := P.errorConstant_pos + mellinConstant := Classical.choose primeMeanMellin_decay + mellinConstant_pos := (Classical.choose_spec primeMeanMellin_decay).1 + mellin_decay := (Classical.choose_spec primeMeanMellin_decay).2 + zeroCountConstant := P.zeroCountConstant + zeroCountConstant_pos := P.zeroCountConstant_pos + zero_count := P.zero_count + absolute_summability := P.absolute_summability + explicit_formula := P.explicit_formula + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothExplicitIdentity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothExplicitIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..b13034b6303cf0c876288075d2326ec070d2188e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothExplicitIdentity.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothContourLimit + +namespace OAI + +/-! # The actual smooth explicit formula with its left-contour remainder -/ + +namespace Ostmann + +open Complex MeasureTheory +open scoped BigOperators + +/-- The exact contour remainder. A faithful numbering of the actual zero +multiplicities is the only enumeration data used in the formula. -/ +theorem smooth_explicit_identity (e : ∀ χ, ℕ ≃ CharacterZeroCopy χ) + (χ : PrimitiveComplexCharacter) (X : ℝ) (hX : 2 ≤ X) : + smoothMangoldtMean χ.modulus χ.character X + + (∑' i, smoothZeroTerm (fun ψ => characterZeroEnumeration ψ (e ψ)) χ X i) + + smoothTrivialZeroTerm χ = + ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ y : ℝ, leftContourIntegrand χ X y := by + let R := ∫ y : ℝ, rightContourIntegrand χ X y + let L := ∫ y : ℝ, leftContourIntegrand χ X y + let S := ∑' i, smoothZeroTerm (fun ψ => characterZeroEnumeration ψ (e ψ)) χ X i + let c : ℂ := ((1 / (2 * Real.pi) : ℝ) : ℂ) + have hcont := smooth_contour_limit e χ X hX + change I * R - I * L = -(2 * (Real.pi : ℂ) * I) * (S + smoothTrivialZeroTerm χ) at hcont + have hrel : R - L = -(2 * (Real.pi : ℂ)) * (S + smoothTrivialZeroTerm χ) := by + apply mul_left_cancel₀ (show (I : ℂ) ≠ 0 by simp) + calc + I * (R - L) = I * R - I * L := mul_sub _ _ _ + _ = _ := hcont + _ = _ := by ring + have hc : c * (2 * (Real.pi : ℂ)) = 1 := by + dsimp [c] + push_cast + field_simp + have hmean : smoothMangoldtMean χ.modulus χ.character X = c * R := + smoothMangoldtMean_eq_vertical_logDerivative χ X (by linarith) + have hsum : R + (2 * (Real.pi : ℂ)) * (S + smoothTrivialZeroTerm χ) = L := by + linear_combination hrel + change smoothMangoldtMean χ.modulus χ.character X + S + smoothTrivialZeroTerm χ = c * L + rw [hmean, ← hsum, mul_add, ← mul_assoc, hc, one_mul] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothFamilyEnvelopes.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothFamilyEnvelopes.lean new file mode 100644 index 0000000000000000000000000000000000000000..b47761404ecad631a249cf06e86f19a3cebf93f6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothFamilyEnvelopes.lean @@ -0,0 +1,126 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothCharacterFamily +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimitiveCharacterCard + +namespace OAI + +/-! # Elementary exponential envelopes for the non-low-zero errors -/ +namespace Ostmann +open scoped Classical BigOperators + +private theorem exponential_split (X t : ℝ) (hX : 0 < X) : + X * Real.exp (t - Real.log X / 2) = Real.exp (Real.log X / 2 + t) := by + calc + _ = Real.exp (Real.log X) * Real.exp (t - Real.log X / 2) := by + rw [Real.exp_log hX] + _ = _ := by rw [← Real.exp_add]; congr 1; ring + +private theorem log_height_bound (Q : ℝ) (hQ : 1 ≤ Q) : + Real.log (Q * (Q ^ 5 + 2)) ≤ 8 * Q := by + have hp : 0 < Q := by linarith + have hpow : 1 ≤ Q ^ 5 := one_le_pow₀ hQ + calc + _ ≤ Real.log (3 * Q ^ 6) := by + apply Real.log_le_log (by positivity) + nlinarith + _ = Real.log 3 + 6 * Real.log Q := by + rw [Real.log_mul (by norm_num) (pow_ne_zero _ hp.ne'), Real.log_pow] + norm_num + _ ≤ 8 * Q := by + have h3 := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 3) + have hh := Real.log_le_self hp.le + linarith + +/-- The zeros with real part below one half. -/ +theorem smooth_middle_zero_envelope (Cm Cz Q X : ℝ) + (hm : 0 ≤ Cm) (hz : 0 ≤ Cz) (hQ : 1 ≤ Q) (hX : 0 < X) : + (Real.exp ((1 / 2 : ℝ) * Real.log X) * Cm) * + (Cz * Q ^ 2 * (Q ^ 5 + 1) * Real.log (Q * (Q ^ 5 + 2))) ≤ + X * ((16 * Cm * Cz) * Real.exp (8 * Real.log Q - Real.log X / 2)) := by + have hp : 0 < Q := by linarith + have hp5 : 1 ≤ Q ^ 5 := one_le_pow₀ hQ + have he : Q ^ 8 = Real.exp (8 * Real.log Q) := by + simpa only [Nat.cast_ofNat, Real.exp_log hp] using (Real.exp_nat_mul (Real.log Q) 8).symm + calc + _ ≤ (Real.exp ((1 / 2 : ℝ) * Real.log X) * Cm) * + (Cz * Q ^ 2 * (2 * Q ^ 5) * (8 * Q)) := by + have hl : 0 ≤ Real.log (Q * (Q ^ 5 + 2)) := + Real.log_nonneg (by nlinarith) + gcongr + · linarith + · exact log_height_bound Q hQ + _ = (16 * Cm * Cz) * (Real.exp ((1 / 2 : ℝ) * Real.log X) * Q ^ 8) := by ring + _ = _ := by + rw [he, ← Real.exp_add] + calc + _ = (16 * Cm * Cz) * (X * Real.exp (8 * Real.log Q - Real.log X / 2)) := by + rw [exponential_split X _ hX] + congr 2 + ring + _ = _ := by ring + +/-- The complete high-ordinate tail, including all its zeros. -/ +theorem smooth_high_zero_envelope (Cm Cz Q X : ℝ) + (hm : 0 ≤ Cm) (hz : 0 ≤ Cz) (hQ : 1 ≤ Q) (hX : 0 ≤ X) : + (X * Cm) * (2 * (2 * (Cz * Q ^ 2) * (Real.log Q + 3)) ^ 2 * + Real.exp (-4 * Real.log (1 + Q ^ 5))) ≤ + X * ((128 * Cm * Cz ^ 2) * Real.exp (-Real.log Q)) := by + have hp : 0 < Q := by linarith + have hl0 := Real.log_nonneg hQ + have hl : Real.log Q + 3 ≤ 4 * Q := by + have hh := Real.log_le_self hp.le + linarith + have htail : Real.exp (-4 * Real.log (1 + Q ^ 5)) ≤ + Real.exp (-20 * Real.log Q) := by + apply Real.exp_le_exp.mpr + have hh := Real.log_le_log (pow_pos hp 5) (show Q ^ 5 ≤ 1 + Q ^ 5 by linarith) + rw [Real.log_pow] at hh + norm_num at hh + linarith + have hpow : Q ^ 6 = Real.exp (6 * Real.log Q) := by + simpa only [Nat.cast_ofNat, Real.exp_log hp] using (Real.exp_nat_mul (Real.log Q) 6).symm + calc + _ ≤ (X * Cm) * (2 * (2 * (Cz * Q ^ 2) * (4 * Q)) ^ 2 * + Real.exp (-20 * Real.log Q)) := by + gcongr + _ = X * ((128 * Cm * Cz ^ 2) * + (Q ^ 6 * Real.exp (-20 * Real.log Q))) := by ring + _ = X * ((128 * Cm * Cz ^ 2) * Real.exp (-14 * Real.log Q)) := by + rw [hpow, ← Real.exp_add] + congr 3 + ring + _ ≤ _ := by gcongr; linarith + +/-- The trivial-zero and shifted-contour remainders, summed over the family. -/ +theorem smooth_family_remainder_envelope (Cm E Q X : ℝ) (N : ℕ) + (hm : 0 ≤ Cm) (hE : 0 ≤ E) (hQ : 1 ≤ Q) (hX : 1 ≤ X) + (hN : (N : ℝ) ≤ Q ^ 2) : + (N : ℝ) * (Cm + E / Real.sqrt X * Real.log (2 * Q)) ≤ + X * ((Cm + 2 * E) * Real.exp (3 * Real.log Q - Real.log X / 2)) := by + have hp : 0 < Q := by linarith + have hXp : 0 < X := by linarith + have hs : 1 ≤ Real.sqrt X := (Real.le_sqrt (by norm_num) (by linarith)).mpr (by simpa) + have hi : E / Real.sqrt X ≤ E := (div_le_self hE hs) + have hl0 : 0 ≤ Real.log (2 * Q) := Real.log_nonneg (by linarith) + have hl : Real.log (2 * Q) ≤ 2 * Q := Real.log_le_self (by positivity) + have hpow : Q ^ 3 = Real.exp (3 * Real.log Q) := by + simpa only [Nat.cast_ofNat, Real.exp_log hp] using (Real.exp_nat_mul (Real.log Q) 3).symm + have hexp : 1 ≤ Real.exp (Real.log X / 2) := + Real.one_le_exp (by have hh := Real.log_nonneg hX; linarith) + calc + _ ≤ Q ^ 2 * (Cm + E * (2 * Q)) := by gcongr + _ ≤ (Cm + 2 * E) * Q ^ 3 := by + have hh := mul_le_mul_of_nonneg_left hQ (mul_nonneg hm (sq_nonneg Q)) + nlinarith + _ ≤ (Cm + 2 * E) * (Real.exp (Real.log X / 2) * Q ^ 3) := by + gcongr + exact le_mul_of_one_le_left (by positivity) hexp + _ = _ := by + rw [hpow, ← Real.exp_add] + calc + _ = (Cm + 2 * E) * (X * Real.exp (3 * Real.log Q - Real.log X / 2)) := by + rw [exponential_split X _ hXp] + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothFiniteRegularization.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothFiniteRegularization.lean new file mode 100644 index 0000000000000000000000000000000000000000..6be8ec8f0140cfd91db118ac4e21f7029d6e43e6 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothFiniteRegularization.lean @@ -0,0 +1,66 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothContourRegularPart + +namespace OAI + +/-! # Removing finitely many actual character poles simultaneously -/ + +namespace Ostmann + +open Filter Set +open scoped Topology BigOperators Classical + +/-- Fill in the removable values after subtracting the principal parts of all +zeros in a prescribed region. The pole set is the actual zero set in that region. -/ +theorem smoothContour_finite_regularization (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (K : Set ℂ) (S : Finset ℂ) + (hzeros : ∀ z ∈ K, χ.L z = 0 → z ∈ S) : + ∃ F : ℂ → ℂ, AnalyticOnNhd ℂ F K ∧ + ∀ z ∉ S, F z = (-deriv χ.L z / χ.L z) * smoothContourWeight X z + + ∑ w ∈ S, (analyticOrderNatAt χ.L w : ℂ) * smoothContourWeight X w / (z - w) := by + choose R hR heR using fun z => smoothContour_regular_part χ X hX z + let f : ℂ → ℂ := fun z => (-deriv χ.L z / χ.L z) * smoothContourWeight X z + let C : ℂ → ℂ := fun w => (analyticOrderNatAt χ.L w : ℂ) * smoothContourWeight X w + let F : ℂ → ℂ := fun z => if z ∈ S then + R z z + ∑ w ∈ S.erase z, C w / (z - w) + else f z + ∑ w ∈ S, C w / (z - w) + refine ⟨F, ?_, fun z hz => by simp [F, hz, f, C]⟩ + intro z hzK + by_cases hz : z ∈ S + · have hsum : AnalyticAt ℂ (fun s => ∑ w ∈ S.erase z, C w / (s - w)) z := by + apply (S.erase z).analyticAt_fun_sum + intro w hw + exact analyticAt_const.div (analyticAt_id.sub analyticAt_const) + (sub_ne_zero.mpr (Finset.ne_of_mem_erase hw).symm) + apply ((hR z).add hsum).congr + have hav : ∀ᶠ s in 𝓝 z, s ∉ S.erase z := + (S.erase z).finite_toSet.isClosed.isOpen_compl.mem_nhds (by simp) + have he : ∀ᶠ s in 𝓝 z, s ≠ z → f s + C z / (s - z) = R z s := by + simpa only [mem_compl_iff, mem_singleton_iff, f, C] using + (eventually_nhdsWithin_iff.mp (heR z)) + filter_upwards [hav, he] with s hs hreg + by_cases hsz : s = z + · subst s + simp [F, hz] + · have hsS : s ∉ S := fun hsS => hs (Finset.mem_erase.mpr ⟨hsz, hsS⟩) + simp only [F, ite_eq_right hsS] + rw [← Finset.sum_erase_add _ _ hz] + simp only [Pi.add_apply] + rw [← hreg hsz] + ring + · have hnz : χ.L z ≠ 0 := fun he => hz (hzeros z hzK he) + have hf : AnalyticAt ℂ f z := + (((χ.L_analytic z).deriv.neg.div (χ.L_analytic z) hnz).mul + ((smoothContourWeight_differentiable X hX).analyticAt z)) + have hsum : AnalyticAt ℂ (fun s => ∑ w ∈ S, C w / (s - w)) z := by + apply S.analyticAt_fun_sum + intro w hw + exact analyticAt_const.div (analyticAt_id.sub analyticAt_const) + (sub_ne_zero.mpr (fun he => hz (he ▸ hw))) + apply (hf.add hsum).congr + have hav : ∀ᶠ s in 𝓝 z, s ∉ S := S.finite_toSet.isClosed.isOpen_compl.mem_nhds hz + filter_upwards [hav] with s hs + simp [F, hs] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothHorizontalBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothHorizontalBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..2560666ab6158663bdf7d04fd951578ad5bad0fd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothHorizontalBound.lean @@ -0,0 +1,94 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterHorizontalGrowth +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothContourResidue +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothMellinBounds + +namespace OAI + +/-! # Fifth-order decay of the actual horizontal contour integrals -/ + +namespace Ostmann + +open Complex Set MeasureTheory +open scoped Interval + +noncomputable def smoothHorizontalIntegral (χ : PrimitiveComplexCharacter) + (X y : ℝ) : ℂ := + ∫ σ in (-(1 / 2 : ℝ))..2, + (-deriv χ.L ((σ : ℂ) + y * I) / χ.L ((σ : ℂ) + y * I)) * + smoothContourWeight X ((σ : ℂ) + y * I) + +theorem primeMeanMellin_decay_pow : ∃ C : ℝ, 0 < C ∧ + ∀ s : ℂ, -(1 / 2 : ℝ) ≤ s.re → s.re ≤ 2 → + ‖primeMeanMellin s‖ ≤ C / (1 + |s.im|) ^ 8 := by + obtain ⟨C, hC, hbound⟩ := primeMeanMellin_decay + refine ⟨C, hC, ?_⟩ + intro s hs hs' + have he : Real.exp (-8 * Real.log (1 + |s.im|)) = ((1 + |s.im|) ^ 8)⁻¹ := by + rw [show -(8 : ℝ) * Real.log (1 + |s.im|) = + -((8 : ℕ) * Real.log (1 + |s.im|)) by norm_num, Real.exp_neg, + Real.exp_nat_mul, Real.exp_log (by positivity : 0 < 1 + |s.im|)] + simpa only [he, div_eq_mul_inv] using hbound s hs hs' + +/-- The local logarithmic derivative is at most cubic, while the fixed test +has eighth-order Mellin decay. The resulting horizontal integrals decay to zero. -/ +theorem exists_smooth_horizontal_bound (χ : PrimitiveComplexCharacter) (X : ℝ) (hX : 2 ≤ X) : + ∃ D : ℝ, 0 < D ∧ ∀ T : ℝ, 3 ≤ T → ∃ t : ℝ, + T < t ∧ t < T + 1 ∧ (∀ z ∈ complexCharacterZeros χ, |z.im| ≠ t) ∧ + ∀ y : ℝ, y = t ∨ y = -t → + ‖smoothHorizontalIntegral χ X y‖ ≤ D / (T + 1) ^ 5 := by + obtain ⟨K, hK, hheight⟩ := exists_character_horizontal_bound χ + obtain ⟨C, hC, hmellin⟩ := primeMeanMellin_decay_pow + refine ⟨20 * K * X ^ 2 * C, by positivity, ?_⟩ + intro T hT + obtain ⟨t, ht, ht', hzero, hlog⟩ := hheight T hT + refine ⟨t, ht, ht', hzero, ?_⟩ + intro y hy + have hTpos : 0 < T + 1 := by linarith + have htpos : 0 < t := by linarith + have hyabs : |y| = t := by rcases hy with rfl | rfl <;> simp [abs_of_pos htpos] + have hpoint (σ : ℝ) (hσ : σ ∈ uIcc (-(1 / 2 : ℝ)) 2) : + ‖(-deriv χ.L ((σ : ℂ) + y * I) / χ.L ((σ : ℂ) + y * I)) * + smoothContourWeight X ((σ : ℂ) + y * I)‖ ≤ + 8 * K * X ^ 2 * C / (T + 1) ^ 5 := by + rw [uIcc_of_le (by norm_num : -(1 / 2 : ℝ) ≤ 2)] at hσ + let s : ℂ := (σ : ℂ) + y * I + have hsre : s.re = σ := by simp [s] + have hsim : s.im = y := by simp [s] + have hcp : ‖(X : ℂ) ^ s‖ ≤ X ^ 2 := by + rw [norm_cpow_eq_rpow_re_of_pos (by linarith : 0 < X), hsre] + exact (Real.rpow_le_rpow_of_exponent_le (by linarith : 1 ≤ X) hσ.2).trans_eq + (Real.rpow_two X) + have hm : ‖primeMeanMellin s‖ ≤ C / (T + 1) ^ 8 := by + apply (hmellin s (by rw [hsre]; exact hσ.1) (by rw [hsre]; exact hσ.2)).trans + rw [hsim, hyabs] + exact div_le_div_of_nonneg_left hC.le (pow_pos hTpos 8) + (pow_le_pow_left₀ hTpos.le (by linarith) 8) + have hl : ‖logDeriv χ.L s‖ ≤ 8 * K * (T + 1) ^ 3 := by + apply (hlog y hy σ hσ).trans + have hp : (T + 5) ^ 3 ≤ 8 * (T + 1) ^ 3 := by + calc + _ ≤ (2 * (T + 1)) ^ 3 := pow_le_pow_left₀ (by linarith) (by linarith) 3 + _ = _ := by ring + nlinarith + change ‖(-deriv χ.L s / χ.L s) * smoothContourWeight X s‖ ≤ _ + rw [norm_mul, smoothContourWeight, norm_mul] + have hn : ‖-deriv χ.L s / χ.L s‖ = ‖logDeriv χ.L s‖ := by + simp [logDeriv_apply, neg_div] + rw [hn] + calc + _ ≤ (8 * K * (T + 1) ^ 3) * (X ^ 2 * (C / (T + 1) ^ 8)) := + mul_le_mul hl (mul_le_mul hcp hm (norm_nonneg _) (by positivity)) (by positivity) (by positivity) + _ = _ := by field_simp + have hi := intervalIntegral.norm_integral_le_of_norm_le_const + (a := -(1 / 2 : ℝ)) (b := 2) + (C := 8 * K * X ^ 2 * C / (T + 1) ^ 5) + (f := fun σ : ℝ => (-deriv χ.L ((σ : ℂ) + y * I) / χ.L ((σ : ℂ) + y * I)) * + smoothContourWeight X ((σ : ℂ) + y * I)) + (fun σ hσ => hpoint σ (uIoc_subset_uIcc hσ)) + change ‖smoothHorizontalIntegral χ X y‖ ≤ _ at hi + norm_num at hi + convert hi using 1; ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothHorizontalLimit.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothHorizontalLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..f73f39a6dc7ae506c2242a89221b6b95d523acae --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothHorizontalLimit.lean @@ -0,0 +1,37 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothHorizontalBound + +namespace OAI + +/-! # A zero-avoiding sequence along which both horizontal integrals vanish -/ + +namespace Ostmann + +open Filter +open scoped Topology + +theorem smooth_horizontal_integrals_tendsto (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 2 ≤ X) : ∃ t : ℕ → ℝ, + (∀ n, 0 < t n) ∧ Tendsto t atTop atTop ∧ + (∀ n, ∀ z ∈ complexCharacterZeros χ, |z.im| ≠ t n) ∧ + Tendsto (fun n => smoothHorizontalIntegral χ X (t n)) atTop (𝓝 0) ∧ + Tendsto (fun n => smoothHorizontalIntegral χ X (-t n)) atTop (𝓝 0) := by + obtain ⟨D, hD, hheight⟩ := exists_smooth_horizontal_bound χ X hX + choose t ht ht' hzero hbound using fun n : ℕ => + hheight ((n : ℝ) + 3) (by linarith [Nat.cast_nonneg (α := ℝ) n]) + have hbase : Tendsto (fun n : ℕ => (n : ℝ) + 3) atTop atTop := + tendsto_atTop_add_const_right _ _ tendsto_natCast_atTop_atTop + have htlim : Tendsto t atTop atTop := tendsto_atTop_mono (fun n => (ht n).le) hbase + have hpower : Tendsto (fun n : ℕ => ((n : ℝ) + 3 + 1) ^ 5) atTop atTop := + (tendsto_pow_atTop (by norm_num : (5 : ℕ) ≠ 0)).comp + (tendsto_atTop_add_const_right _ _ hbase) + have hdecay : Tendsto (fun n : ℕ => D / ((n : ℝ) + 3 + 1) ^ 5) atTop (𝓝 0) := + tendsto_const_nhds.div_atTop hpower + refine ⟨t, fun n => by linarith [ht n, Nat.cast_nonneg (α := ℝ) n], htlim, hzero, ?_, ?_⟩ + · rw [tendsto_zero_iff_norm_tendsto_zero] + exact squeeze_zero (fun _ => norm_nonneg _) (fun n => hbound n (t n) (.inl rfl)) hdecay + · rw [tendsto_zero_iff_norm_tendsto_zero] + exact squeeze_zero (fun _ => norm_nonneg _) (fun n => hbound n (-t n) (.inr rfl)) hdecay + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothLeftContourBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothLeftContourBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..c421844373ac8b4121185225cc7b9936cbda7a4f --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothLeftContourBound.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothLeftContourWeight + +namespace OAI + +/-! # The uniform error from the left vertical contour -/ + +namespace Ostmann + +open Complex MeasureTheory Filter + +private theorem one_add_log_le_log_twice (q : ℝ) (hq : 1 ≤ q) : + 1 + Real.log q ≤ (1 + 1 / Real.log 2) * Real.log (2 * q) := by + have hq0 : 0 < q := by linarith + have h2 : 0 < Real.log 2 := Real.log_pos (by norm_num) + have hlogq : 0 ≤ Real.log q := Real.log_nonneg hq + have hlog : Real.log (2 * q) = Real.log 2 + Real.log q := Real.log_mul (by norm_num) hq0.ne' + have hfirst : 1 ≤ Real.log (2 * q) / Real.log 2 := by + rw [le_div_iff₀ h2] + rw [hlog] + linarith + have hsecond : Real.log q ≤ Real.log (2 * q) := by rw [hlog]; linarith + calc + _ ≤ Real.log (2 * q) / Real.log 2 + Real.log (2 * q) := add_le_add hfirst hsecond + _ = _ := by ring + +theorem leftContourIntegrand_integrable (χ : PrimitiveComplexCharacter) (X : ℝ) (hX : 0 < X) : + Integrable (leftContourIntegrand χ X) := by + obtain ⟨C, hC, hbound⟩ := leftContourIntegrand_bound + have hm := leftContourMajorant_integrable.const_mul + (C * (1 + Real.log (χ.modulus : ℝ)) / Real.sqrt X) + apply hm.mono' (leftContourIntegrand_continuous χ X hX).aestronglyMeasurable + exact Eventually.of_forall (hbound χ X hX) + +theorem leftContour_integral_bound : ∃ E : ℝ, 0 < E ∧ + ∀ (χ : PrimitiveComplexCharacter) (X : ℝ), 0 < X → + ‖∫ t : ℝ, leftContourIntegrand χ X t‖ ≤ + E / Real.sqrt X * Real.log (2 * (χ.modulus : ℝ)) := by + obtain ⟨C, hC, hbound⟩ := leftContourIntegrand_bound + let R : ℝ := |∫ t : ℝ, leftContourMajorant t| + 1 + let A : ℝ := 1 + 1 / Real.log 2 + have hR : 0 < R := by dsimp [R]; positivity + have hA : 0 < A := by dsimp [A]; have hh : 0 < Real.log 2 := Real.log_pos (by norm_num); positivity + refine ⟨C * R * A, by positivity, ?_⟩ + intro χ X hX + have hq : 1 ≤ (χ.modulus : ℝ) := by exact_mod_cast χ.positive + have hlogq : 0 ≤ Real.log (χ.modulus : ℝ) := Real.log_nonneg hq + let D := C * (1 + Real.log (χ.modulus : ℝ)) / Real.sqrt X + have hD : 0 ≤ D := by dsimp [D]; positivity + have hi := leftContourIntegrand_integrable χ X hX + calc + _ ≤ ∫ t : ℝ, ‖leftContourIntegrand χ X t‖ := norm_integral_le_integral_norm _ + _ ≤ ∫ t : ℝ, D * leftContourMajorant t := + integral_mono_ae hi.norm (leftContourMajorant_integrable.const_mul D) + (Eventually.of_forall (hbound χ X hX)) + _ = D * ∫ t : ℝ, leftContourMajorant t := integral_const_mul _ _ + _ ≤ D * R := mul_le_mul_of_nonneg_left (by dsimp [R]; linarith [le_abs_self (∫ t : ℝ, leftContourMajorant t)]) hD + _ = (C * R / Real.sqrt X) * (1 + Real.log (χ.modulus : ℝ)) := by dsimp [D]; ring + _ ≤ (C * R / Real.sqrt X) * (A * Real.log (2 * (χ.modulus : ℝ))) := + mul_le_mul_of_nonneg_left (one_add_log_le_log_twice _ hq) (by positivity) + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothLeftContourWeight.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothLeftContourWeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..c9a67e2b625edc9c9c7cc26b5fb0501260901150 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothLeftContourWeight.lean @@ -0,0 +1,96 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterLogDerivativeLeft +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothContourResidue + +namespace OAI + +/-! # An integrable majorant for the left vertical contour -/ + +namespace Ostmann + +open Complex MeasureTheory Filter +open scoped Topology + +noncomputable def leftContourLine (t : ℝ) : ℂ := -(1 / 2) + (t : ℂ) * I + +@[simp] theorem leftContourLine_re (t : ℝ) : (leftContourLine t).re = -(1 / 2 : ℝ) := by + simp [leftContourLine] + +@[simp] theorem leftContourLine_im (t : ℝ) : (leftContourLine t).im = t := by + simp [leftContourLine] + +@[fun_prop] theorem leftContourLine_continuous : Continuous leftContourLine := by + unfold leftContourLine + fun_prop + +noncomputable def leftContourIntegrand (χ : PrimitiveComplexCharacter) (X t : ℝ) : ℂ := + (-deriv χ.L (leftContourLine t) / χ.L (leftContourLine t)) * + smoothContourWeight X (leftContourLine t) + +noncomputable def leftContourMajorant (t : ℝ) : ℝ := (1 + |t|) ^ (-(7 : ℝ)) + +theorem leftContourMajorant_nonneg (t : ℝ) : 0 ≤ leftContourMajorant t := Real.rpow_nonneg (by positivity) _ + +theorem leftContourMajorant_integrable : Integrable leftContourMajorant := by + have hp : Integrable (fun t : ℝ => (1 + ‖t‖) ^ (-(7 : ℝ))) := + integrable_one_add_norm (μ := volume) (E := ℝ) + (by norm_num : (Module.finrank ℝ ℝ : ℝ) < 7) + change Integrable (fun t : ℝ => (1 + |t|) ^ (-(7 : ℝ))) + simpa only [Real.norm_eq_abs] using hp + +theorem leftContourWeight_norm (X t : ℝ) (hX : 0 < X) : + ‖smoothContourWeight X (leftContourLine t)‖ = + ‖primeMeanMellin (leftContourLine t)‖ / Real.sqrt X := by + rw [smoothContourWeight, norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hX, + leftContourLine_re, Real.rpow_neg hX.le, ← Real.sqrt_eq_rpow] + ring + +theorem leftContourIntegrand_continuous (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) : Continuous (leftContourIntegrand χ X) := by + have hcL : Continuous χ.L := continuous_iff_continuousAt.mpr (fun z => (χ.L_analytic z).continuousAt) + have hcd : Continuous (deriv χ.L) := continuous_iff_continuousAt.mpr (fun z => (χ.L_analytic z).deriv.continuousAt) + have hn (t : ℝ) : χ.L (leftContourLine t) ≠ 0 := by + apply χ.L_ne_zero_left_ne_origin _ (by simp) (by simp) + intro he + have hh := congrArg Complex.re he + norm_num at hh + exact ((hcd.comp leftContourLine_continuous).neg.div (hcL.comp leftContourLine_continuous) hn).mul + ((smoothContourWeight_differentiable X hX).continuous.comp leftContourLine_continuous) + +theorem leftContourIntegrand_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (X : ℝ), 0 < X → ∀ t : ℝ, + ‖leftContourIntegrand χ X t‖ ≤ + (C * (1 + Real.log (χ.modulus : ℝ)) / Real.sqrt X) * leftContourMajorant t := by + obtain ⟨A, hA, hbound⟩ := character_logDeriv_left_bound + obtain ⟨M, hM, hmellin⟩ := primeMeanMellin_decay + refine ⟨A * M, mul_pos hA hM, ?_⟩ + intro χ X hX t + have hq : 0 ≤ Real.log (χ.modulus : ℝ) := Real.log_nonneg (by exact_mod_cast χ.positive) + have hl := hbound χ (leftContourLine t) (by simp) + have hm := hmellin (leftContourLine t) (by norm_num) (by norm_num) + simp only [leftContourLine_im] at hl hm + have hscalar : 1 + Real.log (χ.modulus : ℝ) + |t| ≤ + (1 + Real.log (χ.modulus : ℝ)) * (1 + |t|) := by nlinarith [abs_nonneg t] + have hexp : (1 + |t|) * Real.exp (-8 * Real.log (1 + |t|)) = leftContourMajorant t := by + rw [leftContourMajorant, Real.rpow_def_of_pos (by positivity)] + conv_lhs => arg 1; rw [← Real.exp_log (by positivity : 0 < 1 + |t|)] + rw [← Real.exp_add] + congr 1 + ring + have hnorm : ‖leftContourIntegrand χ X t‖ = + ‖logDeriv χ.L (leftContourLine t)‖ * + (‖primeMeanMellin (leftContourLine t)‖ / Real.sqrt X) := by + rw [leftContourIntegrand, norm_mul, leftContourWeight_norm X t hX] + simp [logDeriv_apply, neg_div] + rw [hnorm] + calc + _ ≤ (A * ((1 + Real.log (χ.modulus : ℝ)) * (1 + |t|))) * + (M * Real.exp (-8 * Real.log (1 + |t|)) / Real.sqrt X) := by + gcongr + exact hl.trans (mul_le_mul_of_nonneg_left hscalar hA.le) + _ = (A * M * (1 + Real.log (χ.modulus : ℝ)) / Real.sqrt X) * leftContourMajorant t := by + rw [← hexp] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothLocalContour.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothLocalContour.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef9f92746181a8739c426e9a208cca792010f26b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothLocalContour.lean @@ -0,0 +1,60 @@ +import Mathlib.Analysis.Complex.CauchyIntegral +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothContourResidue + +namespace OAI + +/-! # Small-circle integrals around the actual character zeros -/ + +namespace Ostmann + +open Filter Metric Set MeasureTheory +open scoped Topology + +theorem PrimitiveComplexCharacter.exists_zero_free_punctured_ball + (χ : PrimitiveComplexCharacter) (z : ℂ) : + ∃ r : ℝ, 0 < r ∧ ∀ w ∈ closedBall z r, w ≠ z → χ.L w ≠ 0 := by + obtain ⟨g, hg, hgne, he⟩ := (χ.L_analytic z).analyticOrderAt_ne_top.mp (χ.L_order_ne_top z) + have hgood : ∀ᶠ w in 𝓝 z, w ≠ z → χ.L w ≠ 0 := by + filter_upwards [he, hg.continuousAt.eventually_ne hgne] with w hw hgw hwz + rw [hw, smul_eq_mul] + exact mul_ne_zero (pow_ne_zero _ (sub_ne_zero.mpr hwz)) hgw + obtain ⟨r, hr, hball⟩ := Metric.eventually_nhds_iff.mp hgood + refine ⟨r / 2, by positivity, ?_⟩ + intro w hw hwz + apply hball (lt_of_le_of_lt (mem_closedBall.mp hw) (by linarith)) hwz + +theorem smoothContour_small_circle (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (z : ℂ) : + ∃ r : ℝ, 0 < r ∧ + (∮ s in C(z, r), (-deriv χ.L s / χ.L s) * smoothContourWeight X s) = + (2 * (Real.pi : ℂ) * Complex.I) * + (-(analyticOrderNatAt χ.L z : ℂ) * smoothContourWeight X z) := by + obtain ⟨r, hr, hno⟩ := χ.exists_zero_free_punctured_ball z + let F : ℂ → ℂ := fun s => (s - z) * ((-deriv χ.L s / χ.L s) * smoothContourWeight X s) + have hF (w : ℂ) (hw : w ∈ closedBall z r) (hwz : w ≠ z) : AnalyticAt ℂ F w := by + have hL := χ.L_analytic w + have hW := (smoothContourWeight_differentiable X hX).analyticAt w + exact (analyticAt_id.sub analyticAt_const).mul ((hL.deriv.neg.div hL (hno w hw hwz)).mul hW) + have hc : ContinuousOn F (closedBall z r \ {z}) := fun w hw => + (hF w hw.1 hw.2).continuousAt.continuousWithinAt + have hd : ∀ w ∈ (ball z r \ {z}) \ (∅ : Set ℂ), DifferentiableAt ℂ F w := by + intro w hw + exact (hF w (ball_subset_closedBall hw.1.1) hw.1.2).differentiableAt + have hi := Complex.circleIntegral_sub_center_inv_smul_of_differentiable_on_off_countable_of_tendsto + hr Set.countable_empty hc hd (smoothContour_zero_residue χ X hX z) + refine ⟨r, hr, ?_⟩ + calc + _ = ∮ s in C(z, r), (s - z)⁻¹ • F s := by + apply circleIntegral.integral_congr hr.le + intro s hs + have hsz : s - z ≠ 0 := sub_ne_zero.mpr (by + intro he + subst s + have hh : (0 : ℝ) = r := by simpa using hs + linarith) + simp [F, smul_eq_mul, ← mul_assoc, hsz] + _ = _ := by simpa only [smul_eq_mul] using hi + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothMellinBounds.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothMellinBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..06a67c3448296568e54a20ee9c487fe145987da7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothMellinBounds.lean @@ -0,0 +1,120 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothMellinDerivatives + +namespace OAI + +/-! # Uniform Mellin decay of the fixed test in the required strip -/ + +namespace Ostmann + +open MeasureTheory Finset +open scoped BigOperators Interval + +theorem shiftedPrimeMeanMellin_product (n : ℕ) (s : ℂ) : + shiftedPrimeMeanMellin n s = + (-1 : ℂ) ^ n * (∏ j ∈ range n, (s + j)) * primeMeanMellin s := by + induction n with + | zero => simp [shiftedPrimeMeanMellin_zero] + | succ n ih => + rw [shiftedPrimeMeanMellin_succ, ih, pow_succ, prod_range_succ] + ring + +/-- All shifted integrals needed below have a uniform bound on the fixed +half-unit interval. The power of t is bounded using only Re(s) >= -1/2. -/ +theorem shiftedPrimeMeanMellin_norm_bound (n : ℕ) (s : ℂ) (D : ℝ) + (hD : 0 ≤ D) (hd : ∀ t : ℝ, |iteratedDeriv n primeMeanTest t| ≤ D) + (hs : -(1 / 2 : ℝ) ≤ s.re) : + ‖shiftedPrimeMeanMellin n s‖ ≤ 4 * D := by + have hi := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (1 / 2 : ℝ)) (b := 1) (C := 4 * D) + (f := fun t : ℝ => ((iteratedDeriv n primeMeanTest t : ℝ) : ℂ) * + Complex.exp ((s + n - 1) * (Real.log t : ℂ))) (fun t ht => ?_) + · change ‖shiftedPrimeMeanMellin n s‖ ≤ _ at hi + norm_num at hi + nlinarith + rw [Set.uIoc_of_le (by norm_num : (1 / 2 : ℝ) ≤ 1)] at ht + have ht0 : 0 < t := by linarith [ht.1] + have hloglo : -Real.log 2 ≤ Real.log t := by + have h := Real.log_le_log (by norm_num : (0 : ℝ) < 1 / 2) ht.1.le + rw [Real.log_div (by norm_num : (1 : ℝ) ≠ 0) (by norm_num : (2 : ℝ) ≠ 0), + Real.log_one, zero_sub] at h + exact h + have hloghi : Real.log t ≤ 0 := Real.log_nonpos ht0.le ht.2 + have hcoef : -2 ≤ s.re + (n : ℝ) - 1 := by linarith [Nat.cast_nonneg (α := ℝ) n] + have hcost : (s.re + (n : ℝ) - 1) * Real.log t ≤ 2 * Real.log 2 := by + have h := mul_le_mul_of_nonpos_right hcoef hloghi + linarith + have he : ‖Complex.exp ((s + n - 1) * (Real.log t : ℂ))‖ ≤ 4 := by + rw [Complex.norm_exp] + simp only [Complex.mul_re, Complex.sub_re, Complex.add_re, Complex.natCast_re, + Complex.one_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] + calc + _ ≤ Real.exp (2 * Real.log 2) := Real.exp_le_exp.mpr hcost + _ = 4 := by rw [show (2 : ℝ) * Real.log 2 = Real.log 2 + Real.log 2 by ring, + Real.exp_add, Real.exp_log (by norm_num : (0 : ℝ) < 2)]; norm_num + rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] + calc + _ ≤ D * 4 := mul_le_mul (hd t) he (norm_nonneg _) hD + _ = _ := by ring + +/-- The product introduced by eight integrations by parts controls the +imaginary height without excluding real s. -/ +theorem primeMeanMellin_height_bound (s : ℂ) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ t : ℝ, |iteratedDeriv 8 primeMeanTest t| ≤ D) + (hs : -(1 / 2 : ℝ) ≤ s.re) : + |s.im| ^ 8 * ‖primeMeanMellin s‖ ≤ 4 * D := by + have hp : |s.im| ^ 8 ≤ ∏ j ∈ range 8, ‖s + (j : ℕ)‖ := by + have h := prod_le_prod₀ (f := fun _ : ℕ => |s.im|) + (g := fun j : ℕ => ‖s + (j : ℂ)‖) (s := range 8) + (fun j _ => abs_nonneg s.im) (fun j _ => ?_) + · simpa using h + simpa only [Complex.add_im, Complex.natCast_im, add_zero] using + Complex.abs_im_le_norm (s + (j : ℂ)) + calc + _ ≤ (∏ j ∈ range 8, ‖s + (j : ℕ)‖) * ‖primeMeanMellin s‖ := + mul_le_mul_of_nonneg_right hp (norm_nonneg _) + _ = ‖shiftedPrimeMeanMellin 8 s‖ := by + rw [shiftedPrimeMeanMellin_product, norm_mul, norm_mul, norm_pow, norm_neg, norm_one] + simp only [one_pow, one_mul, norm_prod] + _ ≤ _ := shiftedPrimeMeanMellin_norm_bound 8 s D hD hd hs + +/-- The precise eighth-order decay field needed in the published explicit +formula structure is unconditional for the actual fixed test. -/ +theorem primeMeanMellin_decay : ∃ C : ℝ, 0 < C ∧ + ∀ s : ℂ, -(1 / 2 : ℝ) ≤ s.re → s.re ≤ 2 → + ‖primeMeanMellin s‖ ≤ C * Real.exp (-8 * Real.log (1 + |s.im|)) := by + obtain ⟨D, hD, hd⟩ := primeMeanTest_iteratedDeriv_bound 8 + refine ⟨1024 * (D + 1), by positivity, ?_⟩ + intro s hs hs2 + have hb : ‖primeMeanMellin s‖ ≤ 4 := by + have h := shiftedPrimeMeanMellin_norm_bound 0 s 1 (by norm_num) (fun t => ?_) hs + · simpa only [shiftedPrimeMeanMellin_zero, mul_one] using h + simp only [iteratedDeriv_zero] + rw [abs_of_nonneg (primeMeanTest_nonneg t)] + exact primeMeanTest_le_one t + have hh := primeMeanMellin_height_bound s D hD.le hd hs + have hm : ‖primeMeanMellin s‖ * (1 + |s.im|) ^ 8 ≤ 1024 * (D + 1) := by + by_cases hsmall : |s.im| ≤ 1 + · have hpow : (1 + |s.im|) ^ 8 ≤ 256 := by + calc + _ ≤ (2 : ℝ) ^ 8 := pow_le_pow_left₀ (by positivity) (by linarith) 8 + _ = _ := by norm_num + have h := mul_le_mul hb hpow (by positivity) (by norm_num : (0 : ℝ) ≤ 4) + nlinarith + · have hlarge : 1 ≤ |s.im| := le_of_lt (lt_of_not_ge hsmall) + have hpow : (1 + |s.im|) ^ 8 ≤ 256 * |s.im| ^ 8 := by + calc + _ ≤ (2 * |s.im|) ^ 8 := pow_le_pow_left₀ (by positivity) (by linarith) 8 + _ = _ := by ring + have h := mul_le_mul_of_nonneg_left hpow (norm_nonneg (primeMeanMellin s)) + nlinarith + have hx : 0 < 1 + |s.im| := by positivity + have he : Real.exp (-8 * Real.log (1 + |s.im|)) = ((1 + |s.im|) ^ 8)⁻¹ := by + rw [show -(8 : ℝ) * Real.log (1 + |s.im|) = + -((8 : ℕ) * Real.log (1 + |s.im|)) by norm_num, Real.exp_neg, + Real.exp_nat_mul, Real.exp_log hx] + rw [he, ← div_eq_mul_inv] + exact (le_div_iff₀ (pow_pos hx 8)).mpr hm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothMellinDerivatives.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothMellinDerivatives.lean new file mode 100644 index 0000000000000000000000000000000000000000..d726b26b2b20208578b62ea1b82f48515b3299de --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothMellinDerivatives.lean @@ -0,0 +1,122 @@ +import Mathlib.Analysis.Calculus.IteratedDeriv.Defs +import Mathlib.Analysis.Calculus.Deriv.Support +import Mathlib.Analysis.Complex.RealDeriv +import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts +import OAI.NumberTheory.Ostmann.Construction.SmoothPrimeMeanTest + +namespace OAI + +namespace Ostmann + +open MeasureTheory +open scoped BigOperators Interval + +theorem primeMeanTest_iteratedDeriv_continuous (n : ℕ) : + Continuous (iteratedDeriv n primeMeanTest) := + (primeMeanTest_contDiff (n := (n : ℕ∞))).continuous_iteratedDeriv' n + +theorem primeMeanTest_iteratedDeriv_zero_outside (n : ℕ) (t : ℝ) + (ht : t ∉ Set.Icc (5 / 8 : ℝ) (7 / 8)) : iteratedDeriv n primeMeanTest t = 0 := by + induction n generalizing t with + | zero => simpa using primeMeanTest_zero_outside t ht + | succ n ih => + rw [iteratedDeriv_succ] + have hs : tsupport (iteratedDeriv n primeMeanTest) ⊆ + Set.Icc (5 / 8 : ℝ) (7 / 8) := by + apply closure_minimal _ isClosed_Icc + intro x hx + by_contra hn + exact hx (ih x hn) + exact deriv_of_notMem_tsupport (fun h => ht (hs h)) + +theorem primeMeanTest_iteratedDeriv_bound (n : ℕ) : + ∃ D : ℝ, 0 < D ∧ ∀ t : ℝ, |iteratedDeriv n primeMeanTest t| ≤ D := by + obtain ⟨D, hD⟩ := isCompact_Icc.exists_bound_of_continuousOn + (primeMeanTest_iteratedDeriv_continuous n).continuousOn + refine ⟨|D| + 1, by positivity, ?_⟩ + intro t + by_cases ht : t ∈ Set.Icc (5 / 8 : ℝ) (7 / 8) + · have h := hD t ht + rw [Real.norm_eq_abs] at h + linarith [le_abs_self D] + · rw [primeMeanTest_iteratedDeriv_zero_outside n t ht, abs_zero] + positivity + +theorem exp_log_shift (z : ℂ) {t : ℝ} (ht : 0 < t) : + Complex.exp (z * (Real.log t : ℂ)) = + (t : ℂ) * Complex.exp ((z - 1) * (Real.log t : ℂ)) := by + have he : z * (Real.log t : ℂ) = (Real.log t : ℂ) + + (z - 1) * (Real.log t : ℂ) := by ring + rw [he, Complex.exp_add, ← Complex.ofReal_exp, Real.exp_log ht] + +theorem hasDerivAt_exp_log (z : ℂ) {t : ℝ} (ht : 0 < t) : + HasDerivAt (fun t : ℝ => Complex.exp (z * (Real.log t : ℂ))) + (z * Complex.exp ((z - 1) * (Real.log t : ℂ))) t := by + have h := (((Real.hasDerivAt_log ht.ne').ofReal_comp).const_mul z).cexp + convert h using 1 + rw [exp_log_shift z ht, Complex.ofReal_inv] + field_simp [Complex.ofReal_ne_zero.mpr ht.ne'] + +noncomputable def shiftedPrimeMeanMellin (n : ℕ) (s : ℂ) : ℂ := + ∫ t in (1 / 2 : ℝ)..1, + ((iteratedDeriv n primeMeanTest t : ℝ) : ℂ) * + Complex.exp ((s + n - 1) * (Real.log t : ℂ)) + +theorem shiftedPrimeMeanMellin_zero (s : ℂ) : + shiftedPrimeMeanMellin 0 s = primeMeanMellin s := by + simp only [shiftedPrimeMeanMellin, iteratedDeriv_zero, Nat.cast_zero, add_zero, + primeMeanMellin] + rw [setIntegral_eq_integral_of_forall_compl_eq_zero] + · apply intervalIntegral.integral_eq_integral_of_support_subset + intro t ht + have hmem : t ∈ Set.Icc (5 / 8 : ℝ) (7 / 8) := by + by_contra hn + exact ht (by simp only [primeMeanTest_zero_outside t hn, Complex.ofReal_zero, zero_mul]) + exact ⟨by linarith [hmem.1], by linarith [hmem.2]⟩ + · intro t ht + rw [primeMeanTest_zero_outside t (by + intro hm + exact ht (by linarith [hm.1] : 0 < t)), Complex.ofReal_zero, zero_mul] + +theorem shiftedPrimeMeanMellin_succ (n : ℕ) (s : ℂ) : + shiftedPrimeMeanMellin (n + 1) s = -(s + n) * shiftedPrimeMeanMellin n s := by + have hu (t : ℝ) : HasDerivAt (fun x : ℝ => ((iteratedDeriv n primeMeanTest x : ℝ) : ℂ)) + ((iteratedDeriv (n + 1) primeMeanTest t : ℝ) : ℂ) t := by + have hd := (primeMeanTest_contDiff (n := ((n + 1 : ℕ) : ℕ∞))).differentiable_iteratedDeriv' n + have h := (hd t).hasDerivAt.ofReal_comp + simpa only [iteratedDeriv_succ] using h + have hv (t : ℝ) (ht : t ∈ Set.uIcc (1 / 2 : ℝ) 1) : + HasDerivAt (fun x : ℝ => Complex.exp ((s + n) * (Real.log x : ℂ))) + ((s + n) * Complex.exp ((s + n - 1) * (Real.log t : ℂ))) t := + hasDerivAt_exp_log _ (by rw [Set.uIcc_of_le (by norm_num)] at ht; linarith [ht.1]) + have hui : IntervalIntegrable (fun t : ℝ => + ((iteratedDeriv (n + 1) primeMeanTest t : ℝ) : ℂ)) volume (1 / 2) 1 := + (Complex.continuous_ofReal.comp (primeMeanTest_iteratedDeriv_continuous _)).intervalIntegrable _ _ + have hvi : IntervalIntegrable (fun t : ℝ => + (s + n) * Complex.exp ((s + n - 1) * (Real.log t : ℂ))) volume (1 / 2) 1 := by + apply ContinuousOn.intervalIntegrable + rw [Set.uIcc_of_le (by norm_num : (1 / 2 : ℝ) ≤ 1)] + fun_prop (disch := grind) + have hi := intervalIntegral.integral_mul_deriv_eq_deriv_mul (fun t _ => hu t) hv hui hvi + have hleft : (∫ t in (1 / 2 : ℝ)..1, + ((iteratedDeriv n primeMeanTest t : ℝ) : ℂ) * + ((s + n) * Complex.exp ((s + n - 1) * (Real.log t : ℂ)))) = + (s + n) * shiftedPrimeMeanMellin n s := by + rw [shiftedPrimeMeanMellin, ← intervalIntegral.integral_const_mul] + apply intervalIntegral.integral_congr + intro t ht + ring + rw [hleft, primeMeanTest_iteratedDeriv_zero_outside n 1 (by norm_num), + primeMeanTest_iteratedDeriv_zero_outside n (1 / 2) (by norm_num), + Complex.ofReal_zero] at hi + simp only [zero_mul, sub_self, zero_sub] at hi + have hr : (∫ t in (1 / 2 : ℝ)..1, + ((iteratedDeriv (n + 1) primeMeanTest t : ℝ) : ℂ) * + Complex.exp ((s + n) * (Real.log t : ℂ))) = shiftedPrimeMeanMellin (n + 1) s := by + simp only [shiftedPrimeMeanMellin, Nat.cast_add, Nat.cast_one, ← add_assoc, add_sub_cancel_right] + rw [hr] at hi + linear_combination hi + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothMellinInversion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothMellinInversion.lean new file mode 100644 index 0000000000000000000000000000000000000000..21335318ee53ddbdb41958e65e93a8e4873ec282 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothMellinInversion.lean @@ -0,0 +1,82 @@ +import Mathlib.Analysis.MellinInversion +import Mathlib.Analysis.SpecialFunctions.JapaneseBracket +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothMellinBounds + +namespace OAI + +/-! # Mellin inversion for the concrete prime-mean test -/ + +namespace Ostmann + +open MeasureTheory Set Filter +open scoped Topology + +noncomputable def complexPrimeMeanTest (t : ℝ) : ℂ := primeMeanTest t + +theorem complexPrimeMeanTest_continuous : Continuous complexPrimeMeanTest := + Complex.continuous_ofReal.comp (primeMeanTest_contDiff (n := 0)).continuous + +theorem primeMeanMellin_eq_mellin : primeMeanMellin = mellin complexPrimeMeanTest := by + funext s + unfold primeMeanMellin mellin + apply setIntegral_congr_fun measurableSet_Ioi + intro t ht + change (primeMeanTest t : ℂ) * Complex.exp ((s - 1) * (Real.log t : ℂ)) = + (t : ℂ) ^ (s - 1) * complexPrimeMeanTest t + rw [Complex.cpow_def_of_ne_zero (by exact_mod_cast ne_of_gt ht), + ← Complex.ofReal_log (le_of_lt ht)] + simp only [complexPrimeMeanTest, mul_comm] + +theorem complexPrimeMeanTest_bigO_atTop (a : ℝ) : + complexPrimeMeanTest =O[atTop] (fun t : ℝ => t ^ (-a)) := by + apply Asymptotics.IsBigO.of_bound 0 + filter_upwards [eventually_gt_atTop (1 : ℝ)] with t ht + have hz := primeMeanTest_zero_outside t (by intro h; linarith [h.2]) + simp [complexPrimeMeanTest, hz] + +theorem complexPrimeMeanTest_bigO_zero (b : ℝ) : + complexPrimeMeanTest =O[𝓝[>] 0] (fun t : ℝ => t ^ (-b)) := by + apply Asymptotics.IsBigO.of_bound 0 + filter_upwards [(eventually_lt_nhds (show (0 : ℝ) < 1 / 2 by norm_num)).filter_mono + nhdsWithin_le_nhds] with t ht + have hz := primeMeanTest_zero_outside t (by intro h; linarith [h.1]) + simp [complexPrimeMeanTest, hz] + +theorem primeMeanMellin_differentiable : Differentiable ℂ primeMeanMellin := by + rw [primeMeanMellin_eq_mellin] + intro s + exact mellin_differentiableAt_of_isBigO_rpow + (complexPrimeMeanTest_continuous.locallyIntegrable.locallyIntegrableOn (Ioi 0)) + (complexPrimeMeanTest_bigO_atTop (s.re + 1)) (by linarith) + (complexPrimeMeanTest_bigO_zero (s.re - 1)) (by linarith) + +theorem complexPrimeMeanTest_mellinConvergent (s : ℂ) : + MellinConvergent complexPrimeMeanTest s := + mellinConvergent_of_isBigO_rpow + (complexPrimeMeanTest_continuous.locallyIntegrable.locallyIntegrableOn (Ioi 0)) + (complexPrimeMeanTest_bigO_atTop (s.re + 1)) (by linarith) + (complexPrimeMeanTest_bigO_zero (s.re - 1)) (by linarith) + +theorem primeMeanMellin_verticalIntegrable : Complex.VerticalIntegrable primeMeanMellin 2 := by + obtain ⟨C, hC, hbound⟩ := primeMeanMellin_decay + have hmajor : Integrable (fun y : ℝ => C * (1 + ‖y‖) ^ (-(8 : ℝ))) := + (integrable_one_add_norm (E := ℝ) (by norm_num : (Module.finrank ℝ ℝ : ℝ) < 8)).const_mul C + apply hmajor.mono' + (primeMeanMellin_differentiable.continuous.comp (by fun_prop)).aestronglyMeasurable + filter_upwards with y + have hh := hbound ((2 : ℂ) + (y : ℂ) * Complex.I) (by norm_num) (by norm_num) + simpa [Real.norm_eq_abs, Real.rpow_def_of_pos (show 0 < 1 + |y| by positivity), + mul_comm] using hh + +/-- Inversion on Re(s)=2, used before shifting the explicit-formula contour. -/ +theorem primeMeanTest_mellin_inversion (x : ℝ) (hx : 0 < x) : + mellinInv 2 primeMeanMellin x = (primeMeanTest x : ℂ) := by + rw [primeMeanMellin_eq_mellin] + exact mellinInv_mellin_eq 2 complexPrimeMeanTest hx + (complexPrimeMeanTest_mellinConvergent 2) + (by rw [← primeMeanMellin_eq_mellin]; exact primeMeanMellin_verticalIntegrable) + complexPrimeMeanTest_continuous.continuousAt + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothNonprincipalDecay.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothNonprincipalDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..fca9b62064e5c2db0dee0e3932a87bf4fe920bf4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothNonprincipalDecay.lean @@ -0,0 +1,80 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothFamilyEnvelopes +import OAI.NumberTheory.Ostmann.Construction.SmoothMeanDecayRates +import OAI.NumberTheory.Ostmann.ZeroDensity.RetainedLowZeroDecay + +namespace OAI + +/-! # The nonprincipal part of manuscript Lemma 5.3 + +This is derived from the three precisely recorded analytic inputs. The +exception is one entire primitive character, uniformly for every finite family. +-/ +namespace Ostmann +open Filter +open scoped Classical BigOperators + +theorem smooth_nonprincipal_decay (Z : ∀ χ, ComplexZeroEnumeration χ) + (hD : PublishedComplexZeroDensity Z) (hR : PublishedComplexZeroRegion Z) + (P : PublishedSmoothExplicitFormula Z) (a D : ℝ) (ha : 0 < a) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 101 ≤ Q → + L ^ 2 ≤ Real.log Q → Real.log Q ≤ a * L * Real.exp ((9 / 10 : ℝ) * L) → + ∃ exception : Option PrimitiveComplexCharacter, + ∀ F : Finset PrimitiveComplexCharacter, + (∀ χ ∈ F, χ.modulus ≤ Q) → (∀ χ ∈ F, some χ ≠ exception) → + (∑ χ ∈ F, ‖smoothMangoldtMean χ.modulus χ.character (Real.exp (Real.exp L))‖) ≤ + Real.exp (Real.exp L) * Real.exp (-D * L) := by + have hm := P.mellinConstant_pos.le + have hz := P.zeroCountConstant_pos.le + have he := P.errorConstant_pos.le + filter_upwards [retained_low_zero_decay Z hD hR a (D + 1) ha, + eventual_conductor_exponential_decay a 8 (16 * P.mellinConstant * P.zeroCountConstant) + (D + 1) ha (by norm_num), + eventual_conductor_negative_decay (128 * P.mellinConstant * P.zeroCountConstant ^ 2) (D + 1), + eventual_conductor_exponential_decay a 3 (P.mellinConstant + 2 * P.errorConstant) + (D + 1) ha (by norm_num), + Real.tendsto_exp_atTop.eventually_ge_atTop (P.mellinConstant + 3), + eventually_ge_atTop (1 : ℝ)] with L hlow hmid hhigh hrem hcoef hL + intro Q hQ hQL hQU + have hQ1 : (1 : ℝ) ≤ Q := by exact_mod_cast (show 1 ≤ Q by omega) + have hq : 0 ≤ Real.log Q := Real.log_nonneg hQ1 + have hX1 : 1 ≤ Real.exp (Real.exp L) := Real.one_le_exp (Real.exp_nonneg _) + have hX2 : 2 ≤ Real.exp (Real.exp L) := by + have hh := Real.add_one_le_exp (Real.exp L) + have hh' : 1 ≤ Real.exp L := Real.one_le_exp (by linarith) + linarith + obtain ⟨exception, hlow⟩ := hlow Q hQ hQU + refine ⟨exception, ?_⟩ + intro F hF hFE + have hmain := smooth_nonprincipal_family_bound P Q (by omega) F hF + ((Q : ℝ) ^ 5) (Real.exp (Real.exp L)) (by positivity) hX2 + have hl := hlow F hF hFE + have hl' := mul_le_mul_of_nonneg_left hl + (mul_nonneg (Real.exp_nonneg (Real.exp L)) hm) + have hmid0 := smooth_middle_zero_envelope P.mellinConstant P.zeroCountConstant + (Q : ℝ) (Real.exp (Real.exp L)) hm hz hQ1 (Real.exp_pos _) + have hhigh0 := smooth_high_zero_envelope P.mellinConstant P.zeroCountConstant + (Q : ℝ) (Real.exp (Real.exp L)) hm hz hQ1 (Real.exp_nonneg _) + have hrem0 := smooth_family_remainder_envelope P.mellinConstant P.errorConstant + (Q : ℝ) (Real.exp (Real.exp L)) F.card hm he hQ1 hX1 + (by exact_mod_cast primitive_character_family_card F Q hF) + simp only [Real.log_exp] at hmain hmid0 hrem0 + have hmid1 := mul_le_mul_of_nonneg_left (hmid (Real.log Q) hq hQU) + (Real.exp_nonneg (Real.exp L)) + have hhigh1 := mul_le_mul_of_nonneg_left (hhigh (Real.log Q) hQL) + (Real.exp_nonneg (Real.exp L)) + have hrem1 := mul_le_mul_of_nonneg_left (hrem (Real.log Q) hq hQU) + (Real.exp_nonneg (Real.exp L)) + have hsum : (∑ χ ∈ F, ‖smoothMangoldtMean χ.modulus χ.character + (Real.exp (Real.exp L))‖) ≤ Real.exp (Real.exp L) * + ((P.mellinConstant + 3) * Real.exp (-(D + 1) * L)) := by + nlinarith [hmain, hl', hmid0, hmid1, hhigh0, hhigh1, hrem0, hrem1] + apply hsum.trans + apply mul_le_mul_of_nonneg_left _ (Real.exp_nonneg _) + calc + _ ≤ Real.exp L * Real.exp (-(D + 1) * L) := + mul_le_mul_of_nonneg_right hcoef (Real.exp_nonneg _) + _ = _ := by rw [← Real.exp_add]; congr 1; ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothOriginResidue.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothOriginResidue.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a48b695912ba81e600eaac822eaf733e62cbd40 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothOriginResidue.lean @@ -0,0 +1,41 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothLocalContour +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterTrivialZero +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedSmoothExplicitFormula + +namespace OAI + +/-! # Identification of the literal even-character residue at zero -/ + +namespace Ostmann + +open Filter +open scoped Topology Classical + +theorem smoothContour_origin_residue_value (χ : PrimitiveComplexCharacter) + (X : ℝ) : + -(analyticOrderNatAt χ.L 0 : ℂ) * smoothContourWeight X 0 = -smoothTrivialZeroTerm χ := by + rw [χ.L_multiplicity_at_zero] + by_cases hχ : χ.character (-1) = 1 + · simp [hχ, smoothContourWeight, smoothTrivialZeroTerm] + · simp [hχ, smoothTrivialZeroTerm] + +theorem smoothContour_origin_residue (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) : + Tendsto (fun s => s * ((-deriv χ.L s / χ.L s) * smoothContourWeight X s)) (𝓝[≠] 0) + (𝓝 (-smoothTrivialZeroTerm χ)) := by + simpa only [sub_zero, smoothContour_origin_residue_value] using + smoothContour_zero_residue χ X hX 0 + +theorem smoothContour_origin_circle (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) : + ∃ r : ℝ, 0 < r ∧ + (∮ s in C(0, r), (-deriv χ.L s / χ.L s) * smoothContourWeight X s) = + -(2 * (Real.pi : ℂ) * Complex.I) * smoothTrivialZeroTerm χ := by + obtain ⟨r, hr, hc⟩ := smoothContour_small_circle χ X hX 0 + refine ⟨r, hr, ?_⟩ + rw [smoothContour_origin_residue_value] at hc + simpa only [mul_neg, neg_mul] using hc + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrimePowerRemoval.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrimePowerRemoval.lean new file mode 100644 index 0000000000000000000000000000000000000000..247fc25527b89214787b9dc6478b4c0a13700ea1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrimePowerRemoval.lean @@ -0,0 +1,99 @@ +import Mathlib.NumberTheory.Chebyshev +import OAI.NumberTheory.Ostmann.Construction.SmoothPrimeMeanTest + +namespace OAI + +/-! # Removing higher prime powers from the fixed smooth mean -/ +namespace Ostmann +open scoped Classical BigOperators + + theorem primeMeanTest_nat_support (X : ℝ) (hX : 0 < X) (n : ℕ) + (hn : n ∉ Finset.Ioc 0 ⌊X⌋₊) : primeMeanTest (n / X) = 0 := by + apply primeMeanTest_zero_outside + intro h + apply hn + rw [Finset.mem_Ioc] + constructor + · by_contra hz + have : n = 0 := by omega + subst n + norm_num at h + · apply (Nat.le_floor_iff hX.le).mpr + have hh := (div_le_iff₀ hX).mp h.2 + linarith + + theorem smoothMangoldtMean_eq_sum (q : ℕ) (χ : DirichletCharacter ℂ q) + (X : ℝ) (hX : 0 < X) : + smoothMangoldtMean q χ X = ∑ n ∈ Finset.Ioc 0 ⌊X⌋₊, + (ArithmeticFunction.vonMangoldt n : ℂ) * χ (n : ZMod q) * primeMeanTest (n / X) := by + apply tsum_eq_sum + intro n hn + rw [primeMeanTest_nat_support X hX n hn, Complex.ofReal_zero, mul_zero] + + theorem nonprime_mangoldt_sum (X : ℝ) : + (∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter (fun n => ¬ n.Prime), + ArithmeticFunction.vonMangoldt n) = Chebyshev.psi X - Chebyshev.theta X := by + have h := Finset.sum_filter_add_sum_filter_not (Finset.Ioc 0 ⌊X⌋₊) + Nat.Prime (fun n => ArithmeticFunction.vonMangoldt n) + have hp : (∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter Nat.Prime, + ArithmeticFunction.vonMangoldt n) = Chebyshev.theta X := by + apply Finset.sum_congr rfl + intro n hn + exact ArithmeticFunction.vonMangoldt_apply_prime (Finset.mem_filter.mp hn).2 + rw [hp] at h + change Chebyshev.theta X + _ = Chebyshev.psi X at h + linarith + +noncomputable def smoothPrimeSum (g : ℕ → ℂ) (X : ℝ) : ℂ := + ∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter Nat.Prime, + (Real.log n : ℂ) * g n * primeMeanTest (n / X) + + theorem smooth_mangoldt_prime_error (g : ℕ → ℂ) (X B : ℝ) + (hX : 1 ≤ X) (hB : 0 ≤ B) + (hg : ∀ n ∈ Finset.Ioc 0 ⌊X⌋₊, ‖g n‖ ≤ B) : + ‖(∑ n ∈ Finset.Ioc 0 ⌊X⌋₊, + (ArithmeticFunction.vonMangoldt n : ℂ) * g n * primeMeanTest (n / X)) - + smoothPrimeSum g X‖ ≤ B * (2 * Real.sqrt X * Real.log X) := by + have he : (∑ n ∈ Finset.Ioc 0 ⌊X⌋₊, + (ArithmeticFunction.vonMangoldt n : ℂ) * g n * primeMeanTest (n / X)) - + smoothPrimeSum g X = + ∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter (fun n => ¬ n.Prime), + (ArithmeticFunction.vonMangoldt n : ℂ) * g n * primeMeanTest (n / X) := by + have h := Finset.sum_filter_add_sum_filter_not (Finset.Ioc 0 ⌊X⌋₊) Nat.Prime + (fun n => (ArithmeticFunction.vonMangoldt n : ℂ) * g n * primeMeanTest (n / X)) + have hp : (∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter Nat.Prime, + (ArithmeticFunction.vonMangoldt n : ℂ) * g n * primeMeanTest (n / X)) = + smoothPrimeSum g X := by + apply Finset.sum_congr rfl + intro n hn + rw [ArithmeticFunction.vonMangoldt_apply_prime (Finset.mem_filter.mp hn).2] + rw [hp] at h + exact (eq_sub_iff_add_eq.mpr (by simpa only [add_comm] using h)).symm + rw [he] + calc + _ ≤ ∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter (fun n => ¬ n.Prime), + ‖(ArithmeticFunction.vonMangoldt n : ℂ) * g n * primeMeanTest (n / X)‖ := + norm_sum_le _ _ + _ ≤ ∑ n ∈ (Finset.Ioc 0 ⌊X⌋₊).filter (fun n => ¬ n.Prime), + B * ArithmeticFunction.vonMangoldt n := by + apply Finset.sum_le_sum + intro n hn + rw [norm_mul, norm_mul, Complex.norm_real, Complex.norm_real, + Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg ArithmeticFunction.vonMangoldt_nonneg, + abs_of_nonneg (primeMeanTest_nonneg _)] + calc + _ ≤ ArithmeticFunction.vonMangoldt n * B * 1 := + mul_le_mul (mul_le_mul_of_nonneg_left (hg n (Finset.mem_filter.mp hn).1) + ArithmeticFunction.vonMangoldt_nonneg) (primeMeanTest_le_one _) + (primeMeanTest_nonneg _) (mul_nonneg ArithmeticFunction.vonMangoldt_nonneg hB) + _ = _ := by ring + _ = B * (Chebyshev.psi X - Chebyshev.theta X) := by + rw [← Finset.mul_sum, nonprime_mangoldt_sum] + _ ≤ B * (2 * Real.sqrt X * Real.log X) := + mul_le_mul_of_nonneg_left + ((le_abs_self _).trans (Chebyshev.abs_psi_sub_theta_le_sqrt_mul_log hX)) hB + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrincipalMean.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrincipalMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..c7a988b5bfb328f9b7026ce50d3e6540c0bcfac2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrincipalMean.lean @@ -0,0 +1,89 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothNonprincipalDecay + +namespace OAI + +/-! # The principal term of the smooth character estimate + +Published input: the conductor-one case of Montgomery–Vaughan (2007), +Corollary 11.20, equations (11.32)/(11.34), p.381, with the usual smooth +partial summation. This is the classical prime number theorem with its +zero-free-region error, specialized to our single fixed compactly supported +smooth function. It makes no assertion about a growing character family. +-/ +namespace Ostmann +open Filter MeasureTheory +open scoped Classical BigOperators + +noncomputable def smoothPrincipalMain (X : ℝ) : ℂ := + ((X * ∫ t : ℝ, primeMeanTest t : ℝ) : ℂ) + +noncomputable def smoothPrincipalError (X : ℝ) : ℝ := + ‖smoothMangoldtMean 1 1 X - smoothPrincipalMain X‖ + +/-- The fixed-test, conductor-one consequence of the classical PNT. -/ +def PublishedSmoothPrincipalPNT : Prop := + ∃ C c : ℝ, 0 < C ∧ 0 < c ∧ ∀ X : ℝ, 2 ≤ X → + smoothPrincipalError X ≤ C * X * Real.exp (-c * Real.sqrt (Real.log X)) + +theorem smooth_principal_decay (hPNT : PublishedSmoothPrincipalPNT) (D : ℝ) : + ∀ᶠ L : ℝ in atTop, smoothPrincipalError (Real.exp (Real.exp L)) ≤ + Real.exp (Real.exp L) * Real.exp (-D * L) := by + obtain ⟨C, c, _, hc, hPNT⟩ := hPNT + have hsmall := ((isLittleO_pow_exp_pos_mul_atTop 1 + (show (0 : ℝ) < 1 / 2 by norm_num)).const_mul_left |D + 1|).bound hc + filter_upwards [hsmall, Real.tendsto_exp_atTop.eventually_ge_atTop C, + eventually_ge_atTop (1 : ℝ)] with L hs hC hL + have hL0 : 0 ≤ L := by linarith + have hX : 2 ≤ Real.exp (Real.exp L) := by + have hh := Real.add_one_le_exp (Real.exp L) + have hh' := Real.one_le_exp hL0 + linarith + have hs' : |D + 1| * L ≤ c * Real.exp (L / 2) := by + simpa only [pow_one, Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (abs_nonneg _) hL0), + abs_of_pos (Real.exp_pos _), show (1 / 2 : ℝ) * L = L / 2 by ring] using hs + have hr : C * Real.exp (-c * Real.sqrt (Real.log (Real.exp (Real.exp L)))) ≤ + Real.exp (-D * L) := by + rw [Real.log_exp, ← Real.exp_half] + calc + _ ≤ Real.exp L * Real.exp (-c * Real.exp (L / 2)) := + mul_le_mul_of_nonneg_right hC (Real.exp_nonneg _) + _ = Real.exp (L - c * Real.exp (L / 2)) := by rw [← Real.exp_add]; congr 1; ring + _ ≤ _ := Real.exp_le_exp.mpr (by + have hh := mul_le_mul_of_nonneg_right (le_abs_self (D + 1)) hL0 + linarith) + calc + _ ≤ C * Real.exp (Real.exp L) * + Real.exp (-c * Real.sqrt (Real.log (Real.exp (Real.exp L)))) := hPNT _ hX + _ = Real.exp (Real.exp L) * + (C * Real.exp (-c * Real.sqrt (Real.log (Real.exp (Real.exp L))))) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hr (Real.exp_nonneg _) + +/-- Lemma 5.3, including the conductor-one term. -/ +theorem smooth_primitive_family_decay (Z : ∀ χ, ComplexZeroEnumeration χ) + (hD : PublishedComplexZeroDensity Z) (hR : PublishedComplexZeroRegion Z) + (P : PublishedSmoothExplicitFormula Z) (hPNT : PublishedSmoothPrincipalPNT) + (a D : ℝ) (ha : 0 < a) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 101 ≤ Q → + L ^ 2 ≤ Real.log Q → Real.log Q ≤ a * L * Real.exp ((9 / 10 : ℝ) * L) → + ∃ exception : Option PrimitiveComplexCharacter, + ∀ F : Finset PrimitiveComplexCharacter, + (∀ χ ∈ F, χ.modulus ≤ Q) → (∀ χ ∈ F, some χ ≠ exception) → + smoothPrincipalError (Real.exp (Real.exp L)) + + (∑ χ ∈ F, ‖smoothMangoldtMean χ.modulus χ.character (Real.exp (Real.exp L))‖) ≤ + Real.exp (Real.exp L) * Real.exp (-D * L) := by + filter_upwards [smooth_nonprincipal_decay Z hD hR P a (D + 1) ha, + smooth_principal_decay hPNT (D + 1), eventually_ge_atTop (1 : ℝ)] with L hn hp hL + intro Q hQ hl hu + obtain ⟨exception, hn⟩ := hn Q hQ hl hu + refine ⟨exception, ?_⟩ + intro F hF he + have htwo : 2 ≤ Real.exp L := by linarith [Real.add_one_le_exp L] + calc + _ ≤ Real.exp (Real.exp L) * (2 * Real.exp (-(D + 1) * L)) := by + linarith [hn F hF he] + _ ≤ Real.exp (Real.exp L) * (Real.exp L * Real.exp (-(D + 1) * L)) := by gcongr + _ = _ := by rw [← Real.exp_add]; congr 2; ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrincipalPNTBridge.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrincipalPNTBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3792966b7bdabff28eb2039a1ee4abca7f0bfab --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrincipalPNTBridge.lean @@ -0,0 +1,169 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothPrincipalPartialSummation + +namespace OAI + +/-! # Quantitative PNT for the fixed smooth principal test + +Only the classical quantitative Chebyshev estimate is used here. The +smoothing bounds are proved for the concrete test retained in the main proof. +-/ + +namespace Ostmann + +open Filter MeasureTheory +open scoped BigOperators Interval + +theorem smoothPrincipalError_rough_bound (D X : ℝ) (hD : 0 ≤ D) (hX : 0 < X) + (hd : ∀ t : ℝ, |deriv primeMeanTest t| ≤ D) : + smoothPrincipalError X ≤ D * (Real.log 4 + 5) * X := by + rw [smoothPrincipalError_integral X hX] + have hi := intervalIntegral.norm_integral_le_of_norm_le_const + (a := 0) (b := X) (C := D * (Real.log 4 + 5)) + (f := fun t : ℝ => deriv primeMeanTest (t / X) / X * (Chebyshev.psi t - t)) + (fun t ht => ?_) + · simpa only [Real.norm_eq_abs, sub_zero, abs_of_pos hX] using hi + rw [Set.uIoc_of_le hX.le] at ht + have ht0 : 0 ≤ t := ht.1.le + have hpsi : |Chebyshev.psi t - t| ≤ (Real.log 4 + 5) * t := by + have hh := abs_sub_le (Chebyshev.psi t) 0 t + simp only [sub_zero, zero_sub, abs_neg, abs_of_nonneg (Chebyshev.psi_nonneg t), + abs_of_nonneg ht0] at hh + linarith [Chebyshev.psi_le_const_mul_self ht0] + rw [Real.norm_eq_abs, abs_mul, abs_div, abs_of_pos hX] + calc + _ ≤ D / X * ((Real.log 4 + 5) * t) := + mul_le_mul (div_le_div_of_nonneg_right (hd _) hX.le) hpsi (abs_nonneg _) + (div_nonneg hD hX.le) + _ ≤ D / X * ((Real.log 4 + 5) * X) := by + gcongr + exact ht.2 + _ = _ := by field_simp + +theorem smoothPrincipalError_of_psi_bound (C c D x0 X : ℝ) + (hC : 0 ≤ C) (hc : 0 < c) (hD : 0 ≤ D) + (hd : ∀ t : ℝ, |deriv primeMeanTest t| ≤ D) + (hpsi : ∀ t : ℝ, x0 ≤ t → + |Chebyshev.psi t - t| ≤ C * t * Real.exp (-c * Real.sqrt (Real.log t))) + (hX : 4 ≤ X) (hx0 : 2 * x0 ≤ X) : + smoothPrincipalError X ≤ C * D * X * + Real.exp (-(c / 2) * Real.sqrt (Real.log X)) := by + have hX0 : 0 < X := by linarith + rw [smoothPrincipalError_integral X hX0] + have hi := intervalIntegral.norm_integral_le_of_norm_le_const + (a := 0) (b := X) + (C := C * D * Real.exp (-(c / 2) * Real.sqrt (Real.log X))) + (f := fun t : ℝ => deriv primeMeanTest (t / X) / X * (Chebyshev.psi t - t)) + (fun t ht => ?_) + · have hh : |X - 0| = X := by simpa using abs_of_pos hX0 + rw [hh, Real.norm_eq_abs] at hi + calc + _ ≤ C * D * Real.exp (-(c / 2) * Real.sqrt (Real.log X)) * X := hi + _ = _ := by ring + rw [Set.uIoc_of_le hX0.le] at ht + by_cases hsmall : t < X / 2 + · have hz : deriv primeMeanTest (t / X) = 0 := by + apply primeMeanTest_deriv_zero_outside + intro hmem + have hh := (le_div_iff₀ hX0).mp hmem.1 + linarith + rw [hz, zero_div, zero_mul, norm_zero] + positivity + have ht0 : 0 < t := ht.1 + have htlo : X / 2 ≤ t := le_of_not_gt hsmall + have hlogX : 0 ≤ Real.log X := Real.log_nonneg (by linarith) + have hlog2 : 0 ≤ Real.log 2 := Real.log_nonneg (by norm_num) + have hlog4 : Real.log 4 = 2 * Real.log 2 := by + rw [show (4 : ℝ) = 2 ^ (2 : ℕ) by norm_num, Real.log_pow] + norm_num + have hloglarge : 2 * Real.log 2 ≤ Real.log X := by + rw [← hlog4] + exact Real.log_le_log (by norm_num) hX + have hlogt : Real.log X - Real.log 2 ≤ Real.log t := by + have h := Real.log_le_log (show 0 < X / 2 by positivity) htlo + rwa [Real.log_div hX0.ne' (by norm_num : (2 : ℝ) ≠ 0)] at h + have hsqrt : Real.sqrt (Real.log X) / 2 ≤ Real.sqrt (Real.log t) := by + calc + _ = Real.sqrt (Real.log X / 4) := by rw [Real.sqrt_div hlogX]; norm_num + _ ≤ _ := Real.sqrt_le_sqrt (by linarith) + have hexp : Real.exp (-c * Real.sqrt (Real.log t)) ≤ + Real.exp (-(c / 2) * Real.sqrt (Real.log X)) := by + apply Real.exp_le_exp.mpr + nlinarith + have herr : |Chebyshev.psi t - t| ≤ + C * X * Real.exp (-(c / 2) * Real.sqrt (Real.log X)) := by + calc + _ ≤ C * t * Real.exp (-c * Real.sqrt (Real.log t)) := + hpsi t (by linarith) + _ ≤ _ := by gcongr; exact ht.2 + rw [Real.norm_eq_abs, abs_mul, abs_div, abs_of_pos hX0] + calc + _ ≤ D / X * (C * X * Real.exp (-(c / 2) * Real.sqrt (Real.log X))) := + mul_le_mul (div_le_div_of_nonneg_right (hd _) hX0.le) herr (abs_nonneg _) + (div_nonneg hD hX0.le) + _ = _ := by field_simp + +/-- The fixed-test PNT follows from the classical quantitative Chebyshev PNT. -/ +theorem publishedSmoothPrincipalPNT_of_chebyshev + (hPNT : ∃ c > 0, + (Chebyshev.psi - id) =O[atTop] + (fun x : ℝ => x * Real.exp (-c * (Real.log x) ^ ((1 : ℝ) / 2)))) : + PublishedSmoothPrincipalPNT := by + obtain ⟨c, hc, hp⟩ := hPNT + obtain ⟨C, hC, hbound⟩ := hp.exists_pos + obtain ⟨x0, hx0⟩ := eventually_atTop.mp hbound.bound + obtain ⟨D, hD, hd⟩ := primeMeanTest_deriv_bound + let x1 := max x0 2 + have hpsi : ∀ t : ℝ, x1 ≤ t → + |Chebyshev.psi t - t| ≤ C * t * Real.exp (-c * Real.sqrt (Real.log t)) := by + intro t ht + have ht0 : 0 ≤ t := le_trans (by dsimp only [x1]; positivity) ht + have hh := hx0 t ((le_max_left _ _).trans ht) + simpa only [Pi.sub_apply, id_eq, Real.norm_eq_abs, Real.sqrt_eq_rpow, + abs_of_nonneg (mul_nonneg ht0 (Real.exp_nonneg _)), mul_assoc] using hh + let T : ℝ := max 4 (2 * x1) + let K0 : ℝ := D * (Real.log 4 + 5) + let K : ℝ := max (C * D) + (K0 * Real.exp ((c / 2) * Real.sqrt (Real.log T))) + 1 + have hK0 : 0 ≤ K0 := by dsimp only [K0]; positivity + have hK : 0 < K := by + dsimp only [K] + have hh : 0 ≤ C * D := mul_nonneg hC.le hD.le + linarith [le_max_left (C * D) (K0 * Real.exp ((c / 2) * Real.sqrt (Real.log T)))] + refine ⟨K, c / 2, hK, by linarith, ?_⟩ + intro X hX + have hX0 : 0 < X := by linarith + by_cases hTX : T ≤ X + · have hh := smoothPrincipalError_of_psi_bound C c D x1 X hC.le hc hD.le hd hpsi + ((le_max_left _ _).trans hTX) ((le_max_right _ _).trans hTX) + refine hh.trans ?_ + have hCK : C * D ≤ K := by + dsimp only [K] + have hm := le_max_left (C * D) (K0 * Real.exp ((c / 2) * Real.sqrt (Real.log T))) + linarith + exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hCK hX0.le) + (Real.exp_nonneg _) + · have hXT : X ≤ T := le_of_not_ge hTX + have hsqrt : Real.sqrt (Real.log X) ≤ Real.sqrt (Real.log T) := + Real.sqrt_le_sqrt (Real.log_le_log hX0 hXT) + have hscale : K0 * Real.exp ((c / 2) * Real.sqrt (Real.log X)) ≤ K := by + calc + _ ≤ K0 * Real.exp ((c / 2) * Real.sqrt (Real.log T)) := by gcongr + _ ≤ _ := by + dsimp only [K] + have hm := le_max_right (C * D) (K0 * Real.exp ((c / 2) * Real.sqrt (Real.log T))) + linarith + have hsmall : K0 ≤ K * Real.exp (-(c / 2) * Real.sqrt (Real.log X)) := by + have hh := mul_le_mul_of_nonneg_right hscale + (Real.exp_nonneg (-(c / 2) * Real.sqrt (Real.log X))) + have he : (c / 2) * Real.sqrt (Real.log X) + + -(c / 2) * Real.sqrt (Real.log X) = 0 := by ring + simpa only [mul_assoc, ← Real.exp_add, he, Real.exp_zero, mul_one] using hh + calc + _ ≤ K0 * X := smoothPrincipalError_rough_bound D X hD.le hX0 hd + _ ≤ (K * Real.exp (-(c / 2) * Real.sqrt (Real.log X))) * X := + mul_le_mul_of_nonneg_right hsmall hX0.le + _ = _ := by ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrincipalPartialSummation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrincipalPartialSummation.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd84b90c194bbba840fa6611d8294193789af7af --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothPrincipalPartialSummation.lean @@ -0,0 +1,154 @@ +import Mathlib.NumberTheory.AbelSummation +import Mathlib.Analysis.Calculus.Deriv.Support +import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothPrincipalMean +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothPrimePowerRemoval + +namespace OAI + +/-! # The fixed principal-character mean by partial summation + +This identifies the literal smooth mean with a compactly supported integral +of the Chebyshev function, for use with the quantitative PNT. +-/ + +namespace Ostmann + +open MeasureTheory Finset +open scoped Classical BigOperators Interval + +theorem primeMeanTest_deriv_continuous : Continuous (deriv primeMeanTest) := + (primeMeanTest_contDiff (n := 1)).continuous_deriv_one + +theorem primeMeanTest_deriv_zero_outside (t : ℝ) + (ht : t ∉ Set.Icc (5 / 8 : ℝ) (7 / 8)) : deriv primeMeanTest t = 0 := by + have hs : tsupport primeMeanTest ⊆ Set.Icc (5 / 8 : ℝ) (7 / 8) := by + apply closure_minimal _ isClosed_Icc + intro x hx + by_contra hn + exact hx (primeMeanTest_zero_outside x hn) + exact deriv_of_notMem_tsupport (fun h => ht (hs h)) + +theorem primeMeanTest_deriv_bound : + ∃ D : ℝ, 0 < D ∧ ∀ t : ℝ, |deriv primeMeanTest t| ≤ D := by + obtain ⟨D, hD⟩ := isCompact_Icc.exists_bound_of_continuousOn + primeMeanTest_deriv_continuous.continuousOn + refine ⟨|D| + 1, by positivity, ?_⟩ + intro t + by_cases ht : t ∈ Set.Icc (5 / 8 : ℝ) (7 / 8) + · have h := hD t ht + rw [Real.norm_eq_abs] at h + linarith [le_abs_self D] + · rw [primeMeanTest_deriv_zero_outside t ht, abs_zero] + positivity + +theorem scaledPrimeMeanTest_hasDerivAt (X t : ℝ) : + HasDerivAt (fun s : ℝ => primeMeanTest (s / X)) + (deriv primeMeanTest (t / X) / X) t := by + have h := (((primeMeanTest_contDiff (n := 1)).differentiable + (by norm_num)) (t / X)).hasDerivAt |>.comp t ((hasDerivAt_id t).div_const X) + simpa only [one_div, div_eq_mul_inv, Function.comp_def, id_eq, one_mul] using h + +theorem smoothPrincipalMean_eq_real_sum (X : ℝ) (hX : 0 < X) : + smoothMangoldtMean 1 1 X = + ((∑ n ∈ Icc 0 ⌊X⌋₊, ArithmeticFunction.vonMangoldt n * + primeMeanTest (n / X) : ℝ) : ℂ) := by + rw [smoothMangoldtMean_eq_sum 1 1 X hX] + have heq : (∑ n ∈ Ioc 0 ⌊X⌋₊, ArithmeticFunction.vonMangoldt n * + primeMeanTest (n / X)) = + ∑ n ∈ Icc 0 ⌊X⌋₊, ArithmeticFunction.vonMangoldt n * primeMeanTest (n / X) := by + rw [← sum_Ioc_add_eq_sum_Icc (Nat.zero_le ⌊X⌋₊)] + simp + rw [← heq] + push_cast + apply sum_congr rfl + intro n hn + have hn1 : (n : ZMod 1) = 1 := Subsingleton.elim _ _ + rw [hn1] + simp + +theorem smoothPrincipalMean_partial_summation (X : ℝ) (hX : 0 < X) : + smoothMangoldtMean 1 1 X = + ((-(∫ t in (0 : ℝ)..X, + deriv primeMeanTest (t / X) / X * Chebyshev.psi t) : ℝ) : ℂ) := by + have hf : Continuous (fun t : ℝ => deriv primeMeanTest (t / X) / X) := + (primeMeanTest_deriv_continuous.comp (continuous_id.div_const X)).div_const X + have hd : deriv (fun t : ℝ => primeMeanTest (t / X)) = + fun t : ℝ => deriv primeMeanTest (t / X) / X := by + funext t + exact (scaledPrimeMeanTest_hasDerivAt X t).deriv + have hi : IntegrableOn (deriv (fun t : ℝ => primeMeanTest (t / X))) + (Set.Icc 0 X) := by rw [hd]; exact hf.continuousOn.integrableOn_Icc + have hs := sum_mul_eq_sub_integral_mul ArithmeticFunction.vonMangoldt hX.le + (f := fun t : ℝ => primeMeanTest (t / X)) + (fun t _ => (scaledPrimeMeanTest_hasDerivAt X t).differentiableAt) hi + rw [hd] at hs + simp_rw [← Chebyshev.psi_eq_sum_Icc] at hs + rw [show primeMeanTest (X / X) = 0 by + rw [div_self hX.ne']; exact primeMeanTest_zero_outside 1 (by norm_num), zero_mul, + zero_sub, ← intervalIntegral.integral_of_le hX.le] at hs + rw [smoothPrincipalMean_eq_real_sum X hX] + congr 1 + simpa only [mul_comm] using hs + +theorem primeMeanTest_integral_unit : + (∫ t in (0 : ℝ)..1, primeMeanTest t) = ∫ t : ℝ, primeMeanTest t := by + apply intervalIntegral.integral_eq_integral_of_support_subset + intro t ht + have hmem : t ∈ Set.Icc (5 / 8 : ℝ) (7 / 8) := by + by_contra hn + exact ht (primeMeanTest_zero_outside t hn) + exact ⟨by linarith [hmem.1], by linarith [hmem.2]⟩ + +theorem scaledPrimeMean_main_integral (X : ℝ) (hX : 0 < X) : + (∫ t in (0 : ℝ)..X, deriv primeMeanTest (t / X) / X * t) = + -(X * ∫ t : ℝ, primeMeanTest t) := by + have hf : Continuous (fun t : ℝ => deriv primeMeanTest (t / X) / X) := + (primeMeanTest_deriv_continuous.comp (continuous_id.div_const X)).div_const X + have hs := intervalIntegral.integral_mul_deriv_eq_deriv_mul + (u := fun t : ℝ => t) (u' := fun _ : ℝ => 1) + (v := fun t : ℝ => primeMeanTest (t / X)) + (v' := fun t : ℝ => deriv primeMeanTest (t / X) / X) + (fun t _ => hasDerivAt_id t) (fun t _ => scaledPrimeMeanTest_hasDerivAt X t) + (intervalIntegrable_const) (hf.intervalIntegrable 0 X) + have hzero : primeMeanTest (X / X) = 0 := by + rw [div_self hX.ne'] + exact primeMeanTest_zero_outside 1 (by norm_num) + simp only [hzero, one_mul, zero_mul, mul_zero, sub_zero, zero_sub] at hs + rw [intervalIntegral.integral_comp_div primeMeanTest hX.ne'] at hs + simpa only [mul_comm, zero_div, div_self hX.ne', smul_eq_mul, + primeMeanTest_integral_unit] using hs + +private theorem scaledPrimeMean_psi_integrable (X : ℝ) (hX : 0 < X) : + IntervalIntegrable (fun t : ℝ => deriv primeMeanTest (t / X) / X * + Chebyshev.psi t) volume 0 X := by + have hf : Continuous (fun t : ℝ => deriv primeMeanTest (t / X) / X) := + (primeMeanTest_deriv_continuous.comp (continuous_id.div_const X)).div_const X + rw [intervalIntegrable_iff_integrableOn_Icc_of_le hX.le] + simpa only [Chebyshev.psi_eq_sum_Icc] using + (integrableOn_mul_sum_Icc ArithmeticFunction.vonMangoldt (m := 0) + (show (0 : ℝ) ≤ 0 by rfl) hf.continuousOn.integrableOn_Icc) + +/-- The exact principal error is the integral of the unsmoothed PNT error. -/ +theorem smoothPrincipalError_integral (X : ℝ) (hX : 0 < X) : + smoothPrincipalError X = + |∫ t in (0 : ℝ)..X, deriv primeMeanTest (t / X) / X * + (Chebyshev.psi t - t)| := by + have hf : Continuous (fun t : ℝ => deriv primeMeanTest (t / X) / X * t) := + ((primeMeanTest_deriv_continuous.comp (continuous_id.div_const X)).div_const X).mul + continuous_id + have hi : (∫ t in (0 : ℝ)..X, deriv primeMeanTest (t / X) / X * + (Chebyshev.psi t - t)) = + (∫ t in (0 : ℝ)..X, deriv primeMeanTest (t / X) / X * Chebyshev.psi t) + + X * ∫ t : ℝ, primeMeanTest t := by + simp_rw [mul_sub] + rw [intervalIntegral.integral_sub (scaledPrimeMean_psi_integrable X hX) + (hf.intervalIntegrable 0 X), scaledPrimeMean_main_integral X hX, sub_neg_eq_add] + rw [smoothPrincipalError, smoothPrincipalMean_partial_summation X hX, + smoothPrincipalMain, ← Complex.ofReal_sub, Complex.norm_real] + rw [hi] + rw [Real.norm_eq_abs, sub_eq_add_neg, ← neg_add, abs_neg] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothRectangleResidues.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothRectangleResidues.lean new file mode 100644 index 0000000000000000000000000000000000000000..6846af085878de3da86cb7797d507ec52e47595c --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothRectangleResidues.lean @@ -0,0 +1,66 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothFiniteRegularization +import OAI.NumberTheory.Ostmann.ZeroDensity.RectangleGeometry + +namespace OAI + +/-! # The finite rectangle identity for the actual smooth character integrand -/ + +namespace Ostmann + +open Complex Set +open scoped Interval BigOperators Classical + +/-- The finite contour-shift identity, with the genuine analytic zero orders. +The hypotheses specify only which finite set contains the rectangle's zeros +and that its points are interior; no residue or integral identity is assumed. -/ +theorem smoothContour_rectangle_residues (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (a b c d : ℝ) (S : Finset ℂ) + (hinside : ∀ z ∈ S, a < z.re ∧ z.re < b ∧ c < z.im ∧ z.im < d) + (hzeros : ∀ z ∈ uIcc a b ×ℂ uIcc c d, χ.L z = 0 → z ∈ S) : + rectangleBoundaryIntegral + (fun z => (-deriv χ.L z / χ.L z) * smoothContourWeight X z) a b c d = + -(2 * (Real.pi : ℂ) * I) * + ∑ z ∈ S, (analyticOrderNatAt χ.L z : ℂ) * smoothContourWeight X z := by + let f : ℂ → ℂ := fun z => (-deriv χ.L z / χ.L z) * smoothContourWeight X z + let C : ℂ → ℂ := fun z => (analyticOrderNatAt χ.L z : ℂ) * smoothContourWeight X z + let g : ℂ → ℂ := fun s => ∑ z ∈ S, C z * (s - z)⁻¹ + obtain ⟨F, hF, heF⟩ := smoothContour_finite_regularization χ X hX + (uIcc a b ×ℂ uIcc c d) S hzeros + have hnot (w : ℂ) (hw : w ∈ contourRectangleBoundary a b c d) : w ∉ S := by + intro hmem + exact contourBoundary_ne_interior (hinside w hmem) hw rfl + have hnonzero (w : ℂ) (hw : w ∈ contourRectangleBoundary a b c d) : χ.L w ≠ 0 := by + intro hzero + exact hnot w hw (hzeros w ⟨hw.1, hw.2.1⟩ hzero) + have hf : RectangleIntegrable f a b c d := by + apply rectangleIntegrable_of_continuousOn + intro w hw + exact (((χ.L_analytic w).deriv.neg.div (χ.L_analytic w) (hnonzero w hw)).mul + ((smoothContourWeight_differentiable X hX).analyticAt w)).continuousAt.continuousWithinAt + have hterm (z : ℂ) (hz : z ∈ S) : + RectangleIntegrable (fun s => C z * (s - z)⁻¹) a b c d := + (rectangleIntegrable_sub_inv (hinside z hz)).const_mul (C z) + have hg : RectangleIntegrable g a b c d := RectangleIntegrable.sum S hterm + have hfg : rectangleBoundaryIntegral F a b c d = + rectangleBoundaryIntegral (fun z => f z + g z) a b c d := by + apply rectangleBoundaryIntegral_congr + intro z hz + simpa only [f, g, C, div_eq_mul_inv] using heF z (hnot z hz) + have hgvalue : rectangleBoundaryIntegral g a b c d = + (2 * (Real.pi : ℂ) * I) * ∑ z ∈ S, C z := by + rw [show g = (fun s => ∑ z ∈ S, C z * (s - z)⁻¹) from rfl, + rectangleBoundaryIntegral_sum S hterm, Finset.mul_sum] + apply Finset.sum_congr rfl + intro z hz + rw [rectangleBoundaryIntegral_const_mul, + rectangleBoundaryIntegral_sub_inv z a b c d (hinside z hz).1 + (hinside z hz).2.1 (hinside z hz).2.2.1 (hinside z hz).2.2.2] + ring + have hzero := rectangleBoundaryIntegral_eq_zero hF + rw [hfg, rectangleBoundaryIntegral_add hf hg, hgvalue] at hzero + change rectangleBoundaryIntegral f a b c d = -(2 * (Real.pi : ℂ) * I) * ∑ z ∈ S, C z + linear_combination hzero + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothRightContour.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothRightContour.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e92f3e24936710f9f0935739d2207579bfa54a5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothRightContour.lean @@ -0,0 +1,67 @@ +import Mathlib.MeasureTheory.Integral.IntegralEqImproper +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothLeftContourBound + +namespace OAI + +/-! # Integrability of the starting vertical line in the contour shift -/ + +namespace Ostmann + +open Complex MeasureTheory Filter +open scoped Topology BigOperators + +noncomputable def rightContourIntegrand (χ : PrimitiveComplexCharacter) (X t : ℝ) : ℂ := + (-deriv χ.L (primeMellinLine t) / χ.L (primeMellinLine t)) * primeVerticalWeight X t + +theorem character_logDeriv_re_two_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), s.re = 2 → ‖logDeriv χ.L s‖ ≤ C := by + let f : ℕ → ℂ := fun n => (ArithmeticFunction.vonMangoldt n : ℂ) + let C : ℝ := ∑' n, ‖LSeries.term f (2 : ℂ) n‖ + have hsum : LSeriesSummable f (2 : ℂ) := + ArithmeticFunction.LSeriesSummable_vonMangoldt (by norm_num) + have hC : 0 ≤ C := tsum_nonneg (fun _ => norm_nonneg _) + refine ⟨C + 1, by positivity, ?_⟩ + intro χ s hs + have hcs : LSeriesSummable (characterMangoldtCoefficient χ) s := + DirichletCharacter.LSeriesSummable_twist_vonMangoldt χ.character (by rw [hs]; norm_num) + have hterm (n : ℕ) : ‖LSeries.term (characterMangoldtCoefficient χ) s n‖ ≤ + ‖LSeries.term f (2 : ℂ) n‖ := by + rw [LSeries.norm_term_eq, LSeries.norm_term_eq, hs] + rw [show (2 : ℂ).re = (2 : ℝ) by norm_num] + split_ifs with hn + · exact le_rfl + · apply div_le_div_of_nonneg_right _ (Real.rpow_nonneg (Nat.cast_nonneg _) _) + dsimp only [characterMangoldtCoefficient, f] + rw [norm_mul] + exact mul_le_of_le_one_left (norm_nonneg _) (χ.character.norm_le_one _) + calc + ‖logDeriv χ.L s‖ = ‖LSeries (characterMangoldtCoefficient χ) s‖ := by + rw [χ.mangoldt_LSeries_eq s (by rw [hs]; norm_num), logDeriv_apply, neg_div, norm_neg] + _ ≤ ∑' n, ‖LSeries.term (characterMangoldtCoefficient χ) s n‖ := + norm_tsum_le_tsum_norm hcs.norm + _ ≤ C := hcs.norm.tsum_le_tsum hterm hsum.norm + _ ≤ C + 1 := by linarith + +theorem rightContourIntegrand_integrable (χ : PrimitiveComplexCharacter) (X : ℝ) + (hX : 0 < X) : Integrable (rightContourIntegrand χ X) := by + obtain ⟨C, hC, hbound⟩ := character_logDeriv_re_two_bound + have hcn : Continuous (rightContourIntegrand χ X) := by + have hL : Continuous χ.L := continuous_iff_continuousAt.mpr + (fun z => (χ.L_analytic z).continuousAt) + have hL' : Continuous (deriv χ.L) := continuous_iff_continuousAt.mpr + (fun z => (χ.L_analytic z).deriv.continuousAt) + have hn (t : ℝ) : χ.L (primeMellinLine t) ≠ 0 := + χ.L_ne_zero_one_le_re _ (by simp) + exact ((hL'.comp primeMellinLine_continuous).neg.div + (hL.comp primeMellinLine_continuous) hn).mul (primeVerticalWeight_continuous X hX) + apply ((primeVerticalWeight_integrable X hX).norm.const_mul C).mono' hcn.aestronglyMeasurable + filter_upwards with t + rw [rightContourIntegrand, norm_mul] + have hn : ‖-deriv χ.L (primeMellinLine t) / χ.L (primeMellinLine t)‖ = + ‖logDeriv χ.L (primeMellinLine t)‖ := by simp [logDeriv_apply, neg_div] + rw [hn] + exact mul_le_mul_of_nonneg_right (hbound χ _ (by simp)) (norm_nonneg _) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothTruncatedContour.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothTruncatedContour.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3120d8d804fe283b47a22df0aa826d968ec23ac --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothTruncatedContour.lean @@ -0,0 +1,64 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothRectangleResidues +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterContourZeros +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothOriginResidue + +namespace OAI + +/-! # The exact truncated smooth explicit formula + +The contour encloses all actual critical zeros of bounded height and the +origin. Its zero sum is a finite sum with analytic multiplicities. +-/ + +namespace Ostmann + +open Complex Set +open scoped BigOperators Classical Interval + +noncomputable def criticalZerosUpTo (χ : PrimitiveComplexCharacter) (T : ℝ) : Finset ℂ := + (χ.strip_zeros_finite T).toFinset + +@[simp] theorem mem_criticalZerosUpTo {χ : PrimitiveComplexCharacter} {T : ℝ} {z : ℂ} : + z ∈ criticalZerosUpTo χ T ↔ z ∈ complexCharacterZeros χ ∧ |z.im| ≤ T := by + exact Set.Finite.mem_toFinset _ + +theorem smoothContour_truncated (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (T : ℝ) (hT : 0 < T) + (hheight : ∀ z ∈ complexCharacterZeros χ, |z.im| ≠ T) : + rectangleBoundaryIntegral + (fun z => (-deriv χ.L z / χ.L z) * smoothContourWeight X z) + (-(1 / 2)) 2 (-T) T = + -(2 * (Real.pi : ℂ) * I) * + ((∑ z ∈ criticalZerosUpTo χ T, + (analyticOrderNatAt χ.L z : ℂ) * smoothContourWeight X z) + smoothTrivialZeroTerm χ) := by + let S := insert (0 : ℂ) (criticalZerosUpTo χ T) + have hinside : ∀ z ∈ S, -(1 / 2 : ℝ) < z.re ∧ z.re < 2 ∧ -T < z.im ∧ z.im < T := by + intro z hz + rcases Finset.mem_insert.mp hz with rfl | hz + · change -(1 / 2 : ℝ) < 0 ∧ (0 : ℝ) < 2 ∧ -T < 0 ∧ 0 < T + exact ⟨by norm_num, by norm_num, by linarith, hT⟩ + · obtain ⟨hz, hi⟩ := mem_criticalZerosUpTo.mp hz + have hi' := lt_of_le_of_ne hi (hheight z hz) + have hab := abs_lt.mp hi' + exact ⟨by linarith [hz.1], by linarith [hz.2.1], hab.1, hab.2⟩ + have hzeros : ∀ z ∈ uIcc (-(1 / 2 : ℝ)) 2 ×ℂ uIcc (-T) T, χ.L z = 0 → z ∈ S := by + intro z hz hzero + have hr : -(1 / 2 : ℝ) ≤ z.re := (show z.re ∈ Icc (-(1 / 2 : ℝ)) 2 by + simpa only [uIcc_of_le (by norm_num : -(1 / 2 : ℝ) ≤ 2), mem_preimage] using hz.1).1 + rcases χ.contour_zero_location z hr hzero with rfl | hcrit + · exact Finset.mem_insert_self _ _ + · apply Finset.mem_insert_of_mem + apply mem_criticalZerosUpTo.mpr + refine ⟨hcrit, abs_le.mpr ?_⟩ + simpa only [uIcc_of_le (by linarith : -T ≤ T), mem_preimage, mem_Icc] using hz.2 + have hzero : (0 : ℂ) ∉ criticalZerosUpTo χ T := by + simp [complexCharacterZeros] + have hmain := smoothContour_rectangle_residues χ X hX (-(1 / 2)) 2 (-T) T S hinside hzeros + have horigin : (analyticOrderNatAt χ.L 0 : ℂ) * smoothContourWeight X 0 = smoothTrivialZeroTerm χ := by + have hh := smoothContour_origin_residue_value χ X + linear_combination -hh + simpa only [S, Finset.sum_insert hzero, horigin, add_comm] using hmain + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothVerticalKernel.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothVerticalKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..e32614546be7ce61b57b68e7e9f7fbbde8522de2 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothVerticalKernel.lean @@ -0,0 +1,98 @@ +import Mathlib.MeasureTheory.Integral.DominatedConvergence +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothMellinInversion +import OAI.NumberTheory.Ostmann.Characters.CharacterRightHalfPlane + +namespace OAI + +/-! # The absolutely convergent vertical kernel before contour shifting -/ + +namespace Ostmann + +open MeasureTheory +open scoped BigOperators + +noncomputable def primeMellinLine (t : ℝ) : ℂ := 2 + (t : ℂ) * Complex.I + +@[simp] theorem primeMellinLine_re (t : ℝ) : (primeMellinLine t).re = 2 := by + simp [primeMellinLine] + +@[fun_prop] theorem primeMellinLine_continuous : Continuous primeMellinLine := by + unfold primeMellinLine + fun_prop + +noncomputable def primeVerticalWeight (X t : ℝ) : ℂ := + (X : ℂ) ^ primeMellinLine t * primeMeanMellin (primeMellinLine t) + +theorem primeVerticalWeight_continuous (X : ℝ) (hX : 0 < X) : + Continuous (primeVerticalWeight X) := by + apply Continuous.mul + · exact (show Continuous primeMellinLine by fun_prop).const_cpow + (.inl (by exact_mod_cast hX.ne')) + · exact primeMeanMellin_differentiable.continuous.comp (by fun_prop) + +theorem primeVerticalWeight_norm (X t : ℝ) (hX : 0 < X) : + ‖primeVerticalWeight X t‖ = X ^ 2 * ‖primeMeanMellin (primeMellinLine t)‖ := by + rw [primeVerticalWeight, norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hX] + simp only [primeMellinLine_re, Real.rpow_two] + +theorem primeVerticalWeight_integrable (X : ℝ) (hX : 0 < X) : + Integrable (primeVerticalWeight X) := by + have hm : Integrable (fun t => primeMeanMellin (primeMellinLine t)) := + primeMeanMellin_verticalIntegrable + apply (hm.norm.const_mul (X ^ 2)).mono' + (primeVerticalWeight_continuous X hX).aestronglyMeasurable + exact Filter.Eventually.of_forall (fun t => (primeVerticalWeight_norm X t hX).le) + +noncomputable def characterMangoldtCoefficient (χ : PrimitiveComplexCharacter) (n : ℕ) : ℂ := + χ.character (n : ZMod χ.modulus) * (ArithmeticFunction.vonMangoldt n : ℂ) + +theorem characterMangoldtCoefficient_summable (χ : PrimitiveComplexCharacter) : + LSeriesSummable (characterMangoldtCoefficient χ) 2 := + DirichletCharacter.LSeriesSummable_twist_vonMangoldt χ.character (by norm_num) + +theorem characterMangoldt_term_norm (χ : PrimitiveComplexCharacter) (n : ℕ) (t : ℝ) : + ‖LSeries.term (characterMangoldtCoefficient χ) (primeMellinLine t) n‖ = + ‖LSeries.term (characterMangoldtCoefficient χ) 2 n‖ := by + simp [LSeries.norm_term_eq, primeMellinLine_re] + +theorem characterMangoldt_term_continuous (χ : PrimitiveComplexCharacter) (n : ℕ) : + Continuous (fun t => LSeries.term (characterMangoldtCoefficient χ) (primeMellinLine t) n) := by + by_cases hn : n = 0 + · subst n + simp only [LSeries.term_zero] + exact continuous_const + · simp only [LSeries.term_of_ne_zero hn] + exact continuous_const.div ((show Continuous primeMellinLine by fun_prop).const_cpow + (.inl (by exact_mod_cast hn))) (fun _ => Complex.cpow_ne_zero_iff.mpr + (.inl (by exact_mod_cast hn))) + +/-- Termwise inversion, including the zero coefficient at n=0. -/ +theorem characterMangoldt_term_inversion (χ : PrimitiveComplexCharacter) + (X : ℝ) (hX : 0 < X) (n : ℕ) : + ((1 / (2 * Real.pi) : ℝ) : ℂ) * + (∫ t : ℝ, LSeries.term (characterMangoldtCoefficient χ) (primeMellinLine t) n * + primeVerticalWeight X t) = + characterMangoldtCoefficient χ n * (primeMeanTest (n / X) : ℂ) := by + by_cases hn : n = 0 + · subst n + simp [characterMangoldtCoefficient] + have hnR : 0 < (n : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero hn + have hkernel (t : ℝ) : + LSeries.term (characterMangoldtCoefficient χ) (primeMellinLine t) n * + primeVerticalWeight X t = characterMangoldtCoefficient χ n * + (((n : ℝ) / X : ℝ) : ℂ) ^ (-primeMellinLine t) * primeMeanMellin (primeMellinLine t) := by + rw [LSeries.term_of_ne_zero hn, primeVerticalWeight, Complex.cpow_neg, + Complex.ofReal_div, Complex.div_cpow_ofReal_nonneg hnR.le hX.le, inv_div] + push_cast + ring + simp_rw [hkernel, mul_assoc] + rw [integral_const_mul] + have hinv := primeMeanTest_mellin_inversion ((n : ℝ) / X) (div_pos hnR hX) + change ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, + (((n : ℝ) / X : ℝ) : ℂ) ^ (-primeMellinLine t) * primeMeanMellin (primeMellinLine t)) = _ at hinv + rw [← hinv] + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothZeroCountFamily.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothZeroCountFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..c60237d51eabaa0e66b0d998d66ba4af660bf993 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothZeroCountFamily.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothExplicitFormulaCore +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimitiveCharacterCard + +namespace OAI + +/-! # The ordinary individual zero count supplies the family count -/ + +namespace Ostmann + +open Finset +open scoped Classical BigOperators + +theorem family_zero_count_of_individual {Z : ∀ χ, ComplexZeroEnumeration χ} + (C : ℝ) (hC : 0 ≤ C) + (hcount : ∀ χ : PrimitiveComplexCharacter, ∀ T : ℝ, 0 ≤ T → + ((Z χ).count 0 T : ℝ) ≤ C * (T + 1) * Real.log ((χ.modulus : ℝ) * (T + 2))) + (Q : ℕ) (hQ : 1 ≤ Q) (T : ℝ) (hT : 0 ≤ T) + (F : Finset PrimitiveComplexCharacter) (hF : ∀ χ ∈ F, χ.modulus ≤ Q) : + (∑ χ ∈ F, ((Z χ).count 0 T : ℝ)) ≤ + C * (Q : ℝ) ^ 2 * (T + 1) * Real.log ((Q : ℝ) * (T + 2)) := by + have hQR : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hlog : 0 ≤ Real.log ((Q : ℝ) * (T + 2)) := + Real.log_nonneg (by nlinarith) + have hB : 0 ≤ C * (T + 1) * Real.log ((Q : ℝ) * (T + 2)) := by positivity + calc + _ ≤ ∑ χ ∈ F, C * (T + 1) * Real.log ((Q : ℝ) * (T + 2)) := by + apply sum_le_sum + intro χ hχ + apply (hcount χ T hT).trans + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Real.log_le_log (mul_pos (by exact_mod_cast χ.positive) (by linarith)) + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hF χ hχ) (by linarith) + _ = (F.card : ℝ) * (C * (T + 1) * Real.log ((Q : ℝ) * (T + 2))) := by simp + _ ≤ (Q : ℝ) ^ 2 * (C * (T + 1) * Real.log ((Q : ℝ) * (T + 2))) := + mul_le_mul_of_nonneg_right (by exact_mod_cast primitive_character_family_card F Q hF) hB + _ = _ := by ring + +/-- Only the ordinary individual count and the explicit formula are needed. +The family count, Mellin decay and absolute convergence are already proved. -/ +noncomputable def smoothExplicitFormula_of_individual {Z : ∀ χ, ComplexZeroEnumeration χ} + (E C : ℝ) (hE : 0 < E) (hC : 0 < C) + (hcount : ∀ χ : PrimitiveComplexCharacter, ∀ T : ℝ, 0 ≤ T → + ((Z χ).count 0 T : ℝ) ≤ C * (T + 1) * Real.log ((χ.modulus : ℝ) * (T + 2))) + (hformula : ∀ χ : PrimitiveComplexCharacter, ∀ X : ℝ, 2 ≤ X → + ‖smoothMangoldtMean χ.modulus χ.character X + + (∑' i, smoothZeroTerm Z χ X i) + smoothTrivialZeroTerm χ‖ ≤ + E / Real.sqrt X * Real.log (2 * (χ.modulus : ℝ))) : + PublishedSmoothExplicitFormula Z := + SmoothExplicitFormulaCore.toPublished { + errorConstant := E + errorConstant_pos := hE + zeroCountConstant := C + zeroCountConstant_pos := hC + zero_count := family_zero_count_of_individual C hC.le hcount + explicit_formula := hformula + } + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothZeroSplit.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothZeroSplit.lean new file mode 100644 index 0000000000000000000000000000000000000000..47a698da8d74ae72696c72fe7f6592dca8221914 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothZeroSplit.lean @@ -0,0 +1,93 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.InfiniteHighZeroBound + +namespace OAI + +/-! # Separating bounded-height and high-ordinate terms of the explicit formula -/ + +namespace Ostmann +open scoped Classical BigOperators + +theorem nonnegative_tsum_finite_tail_bound {ι : Type*} (f : ι → ℝ) + (hf : ∀ i, 0 ≤ f i) (hs : Summable f) (S : Finset ι) (P : ι → Prop) + [DecidablePred P] (hcover : ∀ i ∉ S, P i) : + (∑' i, f i) ≤ (∑ i ∈ S, f i) + ∑' i, if P i then f i else 0 := by + let g := fun i => if i ∈ S then f i else 0 + let h := fun i => if P i then f i else 0 + have hg0 (i) : 0 ≤ g i := by dsimp [g]; split_ifs <;> simp_all + have hh0 (i) : 0 ≤ h i := by dsimp [h]; split_ifs <;> simp_all + have hg : Summable g := Summable.of_nonneg_of_le hg0 + (fun i => by dsimp [g]; split_ifs <;> simp_all) hs + have hh : Summable h := Summable.of_nonneg_of_le hh0 + (fun i => by dsimp [h]; split_ifs <;> simp_all) hs + have hpoint (i) : f i ≤ g i + h i := by + by_cases hi : i ∈ S + · simp only [g, hi, ite_true] + exact le_add_of_nonneg_right (hh0 i) + · simp only [g, hi, ite_false, zero_add, h, hcover i hi, ite_true, le_refl] + have hsumg : (∑' i, g i) = ∑ i ∈ S, f i := by + rw [tsum_eq_sum (s := S) (fun i hi => by simp [g, hi])] + apply Finset.sum_congr rfl + intro i hi + simp [g, hi] + have hbound := hs.tsum_le_tsum hpoint (hg.add hh) + rw [hg.tsum_add hh, hsumg] at hbound + exact hbound + +theorem smoothZeroTerm_norm_coarse {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : PublishedSmoothExplicitFormula Z) (χ : PrimitiveComplexCharacter) (X : ℝ) (i : ℕ) : + ‖smoothZeroTerm Z χ X i‖ ≤ + Real.exp (((Z χ).zeros i).re * Real.log X) * P.mellinConstant := by + have hlog : 0 ≤ Real.log (1 + |((Z χ).zeros i).im|) := + Real.log_nonneg (by linarith [abs_nonneg ((Z χ).zeros i).im]) + have he : Real.exp (-8 * Real.log (1 + |((Z χ).zeros i).im|)) ≤ 1 := by + rw [Real.exp_le_one_iff] + linarith + exact (smoothZeroTerm_norm_bound P χ X i).trans (by + simpa only [mul_one] using mul_le_mul_of_nonneg_left he + (mul_nonneg (Real.exp_nonneg _) P.mellinConstant_pos.le)) + +theorem bounded_height_zero_norm_sum {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : PublishedSmoothExplicitFormula Z) (χ : PrimitiveComplexCharacter) + (T X : ℝ) (hX : 1 ≤ X) : + (∑ i ∈ (Z χ).heightIndices T, ‖smoothZeroTerm Z χ X i‖) ≤ + (X * P.mellinConstant) * + (∑ i ∈ ((Z χ).heightIndices T).filter (fun i => 1 / 2 ≤ ((Z χ).zeros i).re), + Real.exp (-Real.log X * (1 - ((Z χ).zeros i).re))) + + (Real.exp ((1 / 2 : ℝ) * Real.log X) * P.mellinConstant) * + ((Z χ).heightIndices T).card := by + have hXp : 0 < X := by linarith + have hlogX : 0 ≤ Real.log X := Real.log_nonneg hX + have hpoint (i : ℕ) : ‖smoothZeroTerm Z χ X i‖ ≤ + (if 1 / 2 ≤ ((Z χ).zeros i).re then + X * P.mellinConstant * Real.exp (-Real.log X * (1 - ((Z χ).zeros i).re)) else 0) + + Real.exp ((1 / 2 : ℝ) * Real.log X) * P.mellinConstant := by + by_cases hi : 1 / 2 ≤ ((Z χ).zeros i).re + · simp only [hi, ite_true] + have he : Real.exp (((Z χ).zeros i).re * Real.log X) = + X * Real.exp (-Real.log X * (1 - ((Z χ).zeros i).re)) := by + calc + _ = Real.exp (Real.log X + (-Real.log X * (1 - ((Z χ).zeros i).re))) := by + congr 1 + ring + _ = Real.exp (Real.log X) * Real.exp (-Real.log X * (1 - ((Z χ).zeros i).re)) := + Real.exp_add _ _ + _ = _ := by rw [Real.exp_log hXp] + have hh := smoothZeroTerm_norm_coarse P χ X i + rw [he] at hh + have hh' : ‖smoothZeroTerm Z χ X i‖ ≤ + X * P.mellinConstant * Real.exp (-Real.log X * (1 - ((Z χ).zeros i).re)) := by + convert hh using 1 + ring + exact hh'.trans (le_add_of_nonneg_right (mul_nonneg (Real.exp_nonneg _) P.mellinConstant_pos.le)) + · simp only [hi, ite_false, zero_add] + apply (smoothZeroTerm_norm_coarse P χ X i).trans + apply mul_le_mul_of_nonneg_right _ P.mellinConstant_pos.le + exact Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right (le_of_not_ge hi) hlogX) + have hh := Finset.sum_le_sum (s := (Z χ).heightIndices T) (fun i _ => hpoint i) + rw [Finset.sum_add_distrib] at hh + simpa only [← Finset.sum_filter, ← Finset.mul_sum, Finset.sum_const, nsmul_eq_mul, + mul_comm (((Z χ).heightIndices T).card : ℝ), mul_assoc] using hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothZeroTermBounds.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothZeroTermBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..66fd4c9818050876a9591d96649912c14847e6ed --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SmoothZeroTermBounds.lean @@ -0,0 +1,87 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PublishedSmoothExplicitFormula +import OAI.NumberTheory.Ostmann.ZeroDensity.HighZeroTailBound + +namespace OAI + +/-! # Explicit-formula zero terms and their high-ordinate tail -/ + +namespace Ostmann +open scoped Classical BigOperators + +theorem smoothZeroTerm_norm_bound {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : PublishedSmoothExplicitFormula Z) (χ : PrimitiveComplexCharacter) + (X : ℝ) (i : ℕ) : + ‖smoothZeroTerm Z χ X i‖ ≤ + Real.exp (((Z χ).zeros i).re * Real.log X) * P.mellinConstant * + Real.exp (-8 * Real.log (1 + |((Z χ).zeros i).im|)) := by + have hs := (Z χ).in_strip i + have hm := P.mellin_decay ((Z χ).zeros i) (by linarith) (by linarith) + rw [smoothZeroTerm, norm_mul, Complex.norm_exp] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] + exact (mul_le_mul_of_nonneg_left hm (Real.exp_nonneg _)).trans_eq (by ring) + +theorem selected_zero_height_count {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : PublishedSmoothExplicitFormula Z) (Q : ℕ) (hQ : 1 ≤ Q) + (F : Finset PrimitiveComplexCharacter) (hF : ∀ χ ∈ F, χ.modulus ≤ Q) + (S : Finset (Σ _χ : PrimitiveComplexCharacter, ℕ)) + (hS : ∀ z ∈ S, z.1 ∈ F) (T : ℝ) (hT : 0 ≤ T) : + ((S.filter (fun z => |((Z z.1).zeros z.2).im| ≤ T)).card : ℝ) ≤ + (P.zeroCountConstant * (Q : ℝ) ^ 2) * (T + 1) * Real.log ((Q : ℝ) * (T + 2)) := by + have hsub : S.filter (fun z => |((Z z.1).zeros z.2).im| ≤ T) ⊆ + F.sigma (fun χ => (Z χ).heightIndices T) := by + intro z hz + obtain ⟨hzS, ht⟩ := Finset.mem_filter.mp hz + exact Finset.mem_sigma.mpr ⟨hS z hzS, ((Z z.1).mem_heightIndices T z.2).mpr ht⟩ + have hcard (χ : PrimitiveComplexCharacter) : + ((Z χ).heightIndices T).card = (Z χ).count 0 T := by + unfold ComplexZeroEnumeration.count + rw [Finset.filter_eq_self.mpr (fun i _ => ((Z χ).in_strip i).1.le)] + calc + _ ≤ ((F.sigma (fun χ => (Z χ).heightIndices T)).card : ℝ) := by + exact_mod_cast Finset.card_le_card hsub + _ = ∑ χ ∈ F, ((Z χ).count 0 T : ℝ) := by + rw [Finset.card_sigma, Nat.cast_sum] + simp only [hcard] + _ ≤ _ := P.zero_count Q hQ T hT F hF + +theorem finite_high_smooth_zero_bound {Z : ∀ χ, ComplexZeroEnumeration χ} + (P : PublishedSmoothExplicitFormula Z) (Q : ℕ) (hQ : 1 ≤ Q) + (F : Finset PrimitiveComplexCharacter) (hF : ∀ χ ∈ F, χ.modulus ≤ Q) + (S : Finset (Σ _χ : PrimitiveComplexCharacter, ℕ)) + (hS : ∀ z ∈ S, z.1 ∈ F) (T X : ℝ) (hT : 0 ≤ T) (hX : 1 ≤ X) + (hheight : ∀ z ∈ S, T ≤ |((Z z.1).zeros z.2).im|) : + (∑ z ∈ S, ‖smoothZeroTerm Z z.1 X z.2‖) ≤ + (X * P.mellinConstant) * + (2 * (2 * (P.zeroCountConstant * (Q : ℝ) ^ 2) * (Real.log Q + 3)) ^ 2 * + Real.exp (-4 * Real.log (1 + T))) := by + have hQr : (1 : ℝ) ≤ Q := by exact_mod_cast hQ + have hX0 : 0 < X := by linarith + have hlogX : 0 ≤ Real.log X := Real.log_nonneg hX + have hpoint (z) (hz : z ∈ S) : + ‖smoothZeroTerm Z z.1 X z.2‖ ≤ (X * P.mellinConstant) * + Real.exp (-8 * Real.log (1 + |((Z z.1).zeros z.2).im|)) := by + apply (smoothZeroTerm_norm_bound P z.1 X z.2).trans + have he : Real.exp (((Z z.1).zeros z.2).re * Real.log X) ≤ X := by + calc + _ ≤ Real.exp (Real.log X) := Real.exp_le_exp.mpr (by + simpa only [one_mul] using + mul_le_mul_of_nonneg_right ((Z z.1).in_strip z.2).2.le hlogX) + _ = X := Real.exp_log hX0 + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_right he P.mellinConstant_pos.le) (Real.exp_nonneg _) + have htail := finite_high_zero_tail_bound S (fun z => |((Z z.1).zeros z.2).im|) + (Q : ℝ) (P.zeroCountConstant * (Q : ℝ) ^ 2) T hQr + (mul_nonneg P.zeroCountConstant_pos.le (sq_nonneg _)) hT hheight + (selected_zero_height_count P Q hQ F hF S hS) + calc + _ ≤ ∑ z ∈ S, (X * P.mellinConstant) * + Real.exp (-8 * Real.log (1 + |((Z z.1).zeros z.2).im|)) := + Finset.sum_le_sum hpoint + _ = (X * P.mellinConstant) * + ∑ z ∈ S, Real.exp (-8 * Real.log (1 + |((Z z.1).zeros z.2).im|)) := + (Finset.mul_sum ..).symm + _ ≤ _ := mul_le_mul_of_nonneg_left htail (mul_nonneg hX0.le P.mellinConstant_pos.le) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SparsePrincipalCoefficients.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SparsePrincipalCoefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..152c891b51ae59736d7760e2c674fd5d911f45fb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SparsePrincipalCoefficients.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.Characters.SparseMellinCoefficients + +namespace OAI + +/-! # The smaller principal coefficients of the sparse kernel -/ +namespace Ostmann +open scoped Classical BigOperators ComplexConjugate + +theorem sparse_mellin_principal {p : ℕ} [Fact p.Prime] + (E : Finset (ZMod p)) (hE : 0 ∉ E) (t : ℝ) : + mellinCoefficient (fun x : (ZMod p)ˣ => sparseAdditiveKernel E t x) 1 = + (((p : ℝ) - 1)⁻¹ * (-t * E.card / p) : ℝ) := by + have hc : (Fintype.card (ZMod p)ˣ : ℂ) = (p : ℂ) - 1 := by + rw [ZMod.card_units, Nat.cast_sub (Fact.out : p.Prime).one_lt.le, Nat.cast_one] + simp only [mellinCoefficient, MulChar.one_apply_coe, map_one, mul_one] + rw [sum_units_eq_sum_nonzero, sparseAdditiveKernel_sum_nonzero E hE, hc] + push_cast + ring + +theorem sparse_square_mellin_principal {p : ℕ} [Fact p.Prime] + (E : Finset (ZMod p)) (hsym : ∀ b, -b ∈ E ↔ b ∈ E) (t : ℝ) : + mellinCoefficient (fun x : (ZMod p)ˣ => sparseAdditiveKernel E t x ^ 2) 1 = + (((p : ℝ) - 1)⁻¹ * (t ^ 2 * ((E.card : ℝ) / p - ((E.card : ℝ) / p) ^ 2)) : ℝ) := by + have hc : (Fintype.card (ZMod p)ˣ : ℂ) = (p : ℂ) - 1 := by + rw [ZMod.card_units, Nat.cast_sub (Fact.out : p.Prime).one_lt.le, Nat.cast_one] + simp only [mellinCoefficient, MulChar.one_apply_coe, map_one, mul_one] + rw [sum_units_eq_sum_nonzero (fun x : ZMod p => sparseAdditiveKernel E t x ^ 2)] + simp_rw [pow_two] + rw [sparseAdditiveKernel_square_sum_nonzero E hsym, hc] + push_cast + ring + +theorem sparse_principal_coefficients_le {p : ℕ} [Fact p.Prime] + (E : Finset (ZMod p)) (hE : 0 ∉ E) (hsym : ∀ b, -b ∈ E ↔ b ∈ E) + (t : ℝ) (ht : 0 ≤ t) (ht1 : t ≤ 1) (j : ℕ) (hj : j = 1 ∨ j = 2) : + ‖mellinCoefficient (fun x : (ZMod p)ˣ => sparseAdditiveKernel E t x ^ j) 1‖ ≤ + 2 / p := by + have hp : (2 : ℝ) ≤ p := by exact_mod_cast (Fact.out : p.Prime).two_le + have hp0 : (0 : ℝ) < p := by linarith + have hp1 : 0 < (p : ℝ) - 1 := by linarith + have hc : (E.card : ℝ) ≤ p := by + have hh := Finset.card_le_card (Finset.subset_univ E) + have hh' : E.card ≤ p := by simpa only [Finset.card_univ, ZMod.card] using hh + exact_mod_cast hh' + have he0 : 0 ≤ (E.card : ℝ) / p := by positivity + have he1 : (E.card : ℝ) / p ≤ 1 := (div_le_one hp0).mpr hc + have hi : ((p : ℝ) - 1)⁻¹ ≤ 2 / p := by + rw [inv_eq_one_div] + apply (div_le_div_iff₀ hp1 hp0).mpr + linarith + apply le_trans _ hi + rcases hj with rfl | rfl + · simp only [pow_one, sparse_mellin_principal E hE t, Complex.norm_real, + Real.norm_eq_abs, abs_mul, abs_of_pos (inv_pos.mpr hp1), abs_div, abs_neg, + abs_of_nonneg ht, abs_of_nonneg (show (0 : ℝ) ≤ E.card from Nat.cast_nonneg _), abs_of_pos hp0] + have hh : t * E.card / p ≤ 1 := by + calc + _ = t * ((E.card : ℝ) / p) := by ring + _ ≤ 1 * 1 := mul_le_mul ht1 he1 he0 (by norm_num) + _ = 1 := by ring + exact mul_le_of_le_one_right (inv_nonneg.mpr hp1.le) hh + · rw [sparse_square_mellin_principal E hsym t, Complex.norm_real, Real.norm_eq_abs] + have hn : 0 ≤ (E.card : ℝ) / p - ((E.card : ℝ) / p) ^ 2 := by nlinarith + rw [abs_of_nonneg (mul_nonneg (inv_nonneg.mpr hp1.le) (mul_nonneg (sq_nonneg _) hn))] + have ht2 : t ^ 2 ≤ 1 := by nlinarith + have hh : t ^ 2 * ((E.card : ℝ) / p - ((E.card : ℝ) / p) ^ 2) ≤ 1 := by + nlinarith [mul_le_mul ht2 (show (E.card : ℝ) / p - ((E.card : ℝ) / p) ^ 2 ≤ 1 by nlinarith) + hn (by norm_num : (0 : ℝ) ≤ 1)] + exact mul_le_of_le_one_right (inv_nonneg.mpr hp1.le) hh + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SparsePrincipalMean.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SparsePrincipalMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..e1f3142808a266f3215f1eb32602b8da334d4734 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SparsePrincipalMean.lean @@ -0,0 +1,100 @@ +import OAI.NumberTheory.Ostmann.Characters.SparsePrimitiveExpansion +import OAI.NumberTheory.Ostmann.Characters.SparseWeightUnitMean + +namespace OAI + +/-! # The principal coefficient is the exact unit-residue mean -/ +namespace Ostmann +open scoped Classical BigOperators + +noncomputable local instance {p : ℕ} [Fact p.Prime] : + Fintype (MulChar (ZMod p) ℂ) := Fintype.ofFinite _ + +theorem sparsePrimitiveCoefficient_principal {n : ℕ} (p : Fin n → ℕ) + [∀ i, Fact (p i).Prime] [NeZero (∏ i, p i)] + (hc : Pairwise (fun i j => (p i).Coprime (p j))) + (E : ∀ i, Finset (ZMod (p i))) (t : ℝ) (K : ℕ) : + sparsePrimitiveCoefficient p E t K none = + sparseTruncatedMellinCoefficient p E t K (fun _ => 1) := by + have hlabel : sparsePrimitiveLabel p (fun _ => 1) = none := by + simp [sparsePrimitiveLabel, sparseProductCharacter, primitiveCharacterReduction] + rw [← hlabel] + exact injectiveCoefficient_apply _ (sparsePrimitiveLabel_injective p hc) _ _ + +theorem productCharacter_unit_sum {n : ℕ} (p : Fin n → ℕ) [∀ i, Fact (p i).Prime] + (χ : ∀ i, MulChar (ZMod (p i)) ℂ) : + (∑ x : (∀ i, (ZMod (p i))ˣ), ∏ i, χ i (x i)) = + if χ = (fun _ => 1) then ∏ i, (Fintype.card (ZMod (p i))ˣ : ℂ) else 0 := by + rw [← Fintype.prod_sum (fun i (x : (ZMod (p i))ˣ) => χ i x)] + simp_rw [sum_mulChar_units_eq_ite] + by_cases hχ : χ = (fun _ => 1) + · subst χ + simp + · rw [ite_eq_right hχ] + obtain ⟨i, hi⟩ : ∃ i, χ i ≠ 1 := by + by_contra! hh + exact hχ (funext hh) + exact Finset.prod_eq_zero (Finset.mem_univ i) (by simp [hi]) + +theorem sparsePrimitiveCoefficient_unit_mean {n : ℕ} (p : Fin n → ℕ) + [∀ i, Fact (p i).Prime] [NeZero (∏ i, p i)] + (hc : Pairwise (fun i j => (p i).Coprime (p j))) + (E : ∀ i, Finset (ZMod (p i))) (t : ℝ) (K : ℕ) : + sparsePrimitiveCoefficient p E t K none = + (∏ i, (Fintype.card (ZMod (p i))ˣ : ℂ)⁻¹) * + ∑ x : (∀ i, (ZMod (p i))ˣ), + elementaryTruncation (fun i => sparseAdditiveKernel (E i) t (x i)) K ^ 2 := by + have hsum : (∑ x : (∀ i, (ZMod (p i))ˣ), + elementaryTruncation (fun i => sparseAdditiveKernel (E i) t (x i)) K ^ 2) = + sparseTruncatedMellinCoefficient p E t K (fun _ => 1) * + ∏ i, (Fintype.card (ZMod (p i))ˣ : ℂ) := by + simp_rw [sparseWeight_mellin_expansion] + rw [Finset.sum_comm] + simp_rw [← Finset.mul_sum, productCharacter_unit_sum] + simp + rw [hsum, sparsePrimitiveCoefficient_principal p hc, Finset.prod_inv_distrib] + have hd : (∏ i, (Fintype.card (ZMod (p i))ˣ : ℂ)) ≠ 0 := by + apply Finset.prod_ne_zero_iff.mpr + intro i _ + exact_mod_cast Fintype.card_ne_zero + field_simp + +noncomputable def unitNonzeroResidueEquiv (p : ℕ) [Fact p.Prime] : + (ZMod p)ˣ ≃ NonzeroResidue p where + toFun u := ⟨u, Finset.mem_erase.mpr ⟨Units.ne_zero u, Finset.mem_univ _⟩⟩ + invFun x := Units.mk0 x.val (Finset.mem_erase.mp x.property).1 + left_inv u := by apply Units.ext; rfl + right_inv x := by apply Subtype.ext; rfl + +theorem sparsePrimitiveCoefficient_tensor_mean {n : ℕ} (p : Fin n → ℕ) + [∀ i, Fact (p i).Prime] [NeZero (∏ i, p i)] + (hc : Pairwise (fun i j => (p i).Coprime (p j))) + (E : ∀ i, Finset (ZMod (p i))) (t : ℝ) (K : ℕ) : + sparsePrimitiveCoefficient p E t K none = + tensorUnitMean p (fun x => elementaryTruncation + (fun i => sparseAdditiveKernel (E i) t (x i)) K ^ 2) := by + rw [sparsePrimitiveCoefficient_unit_mean p hc] + unfold tensorUnitMean + have hcard (i : Fin n) : (Fintype.card (ZMod (p i))ˣ : ℂ) = (p i : ℂ) - 1 := by + rw [ZMod.card_units, Nat.cast_sub (Fact.out : (p i).Prime).one_lt.le, Nat.cast_one] + simp only [hcard] + congr 1 + let e := Equiv.piCongrRight (fun i : Fin n => unitNonzeroResidueEquiv (p i)) + have he := e.sum_comp (fun x => elementaryTruncation + (fun i => sparseAdditiveKernel (E i) t ((x i : NonzeroResidue (p i)) : ZMod (p i))) K ^ 2) + exact he + +theorem sparsePrimitiveCoefficient_real_mean {n : ℕ} (p : Fin n → ℕ) + [∀ i, Fact (p i).Prime] [NeZero (∏ i, p i)] + (hc : Pairwise (fun i j => (p i).Coprime (p j))) + (S : ∀ i, Finset (ZMod (p i))) (K : ℕ) : + sparsePrimitiveCoefficient p (fun i => largeTransformSpectrum (normalizedResidueTransform (S i))) + (17 / 20) K none = (tensorRealUnitMean p (sparseSubsetWeight p S K) : ℂ) := by + rw [sparsePrimitiveCoefficient_tensor_mean p hc, ← tensorUnitMean_ofReal] + apply congrArg (tensorUnitMean p) + funext x + exact (sparseSubsetWeight_complex p S K x).symm + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyContourScales.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyContourScales.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c0d9c6b3acbfe84f1ca29b48a051bc5130e7914 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyContourScales.lean @@ -0,0 +1,103 @@ +import Mathlib.Tactic +import OAI.NumberTheory.Jacobsthal.Estimates.NonquadraticZeroFree +import OAI.NumberTheory.Ostmann.ZeroDensity.SupplyPrimeScales + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +namespace Ostmann.ZeroDensity + +def supplyContourHeight (P : ℕ) (E L : ℝ) : ℕ := + 2*(supplyConductorCutoff L)^P*⌈Real.exp (E*L)⌉₊ + +theorem supplyContourHeight_ge_two (P : ℕ) (E L : ℝ) : + 2 ≤ supplyContourHeight P E L := by + have hQ := supplyConductorCutoff_pos L + have he := Nat.ceil_pos.mpr (Real.exp_pos (E*L)) + have hp : 0 < (supplyConductorCutoff L)^P*⌈Real.exp (E*L)⌉₊ := by positivity + unfold supplyContourHeight + nlinarith + +theorem supplyContourHeight_lower (P : ℕ) (E L : ℝ) : + 2*(supplyConductorCutoff L : ℝ)^P*Real.exp (E*L) ≤ supplyContourHeight P E L := by + unfold supplyContourHeight + push_cast + exact mul_le_mul_of_nonneg_left (Nat.le_ceil (Real.exp (E*L))) (by positivity) + +theorem supplyContourHeight_log_le (P : ℕ) {E L : ℝ} (hE : 0 ≤ E) (hL : 1 ≤ L) : + Real.log (supplyContourHeight P E L : ℝ) ≤ + P*Real.log (supplyConductorCutoff L : ℝ)+(E+2)*L := by + have hQ : (0 : ℝ) < supplyConductorCutoff L := + Nat.cast_pos.mpr (supplyConductorCutoff_pos L) + have hCeil : (0 : ℝ) < (⌈Real.exp (E*L)⌉₊ : ℕ) := by + exact_mod_cast Nat.ceil_pos.mpr (Real.exp_pos (E*L)) + have hceil := Nat.ceil_lt_add_one (Real.exp_pos (E*L)).le + have he : 1 ≤ Real.exp (E*L) := Real.one_le_exp (by positivity) + have hupper : (⌈Real.exp (E*L)⌉₊ : ℝ) ≤ 2*Real.exp (E*L) := by linarith + have hlogceil := Real.log_le_log hCeil hupper + rw [Real.log_mul (by norm_num) (Real.exp_pos _).ne', Real.log_exp] at hlogceil + have hlog2 := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ)<2) + unfold supplyContourHeight + push_cast + rw [Real.log_mul (by positivity) hCeil.ne', + Real.log_mul (by norm_num) (pow_pos hQ P).ne', Real.log_pow] + linarith + +theorem supplyContourHeight_modulus_budget (P : ℕ) {E L : ℝ} + (hE : 0 ≤ E) (hL : 1 ≤ L) : + Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight (supplyConductorCutoff L) + (supplyContourHeight P E L : ℝ) ≤ + (20003*((P : ℝ)+1)+E+8)*L*Real.exp (9*L/10) := by + have hH : (2 : ℝ) ≤ supplyContourHeight P E L := by + exact_mod_cast supplyContourHeight_ge_two P E L + have hHp : (0 : ℝ) < supplyContourHeight P E L := by linarith + have hlog := Real.log_le_log (show (0 : ℝ) < supplyContourHeight P E L+6 by positivity) + (show (supplyContourHeight P E L : ℝ)+6 ≤ 7*supplyContourHeight P E L by linarith) + rw [Real.log_mul (by norm_num) hHp.ne'] at hlog + have hlog7 := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ)<7) + have hHL := supplyContourHeight_log_le P hE hL + have hQL := log_supplyConductorCutoff_bound hL + have he : 1 ≤ Real.exp (9*L/10) := Real.one_le_exp (by positivity) + unfold Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight + rw [abs_of_pos hHp] + have hP : (0 : ℝ) ≤ P := Nat.cast_nonneg P + have hmul := mul_le_mul_of_nonneg_left hQL (show 0 ≤ (P : ℝ)+1 by positivity) + have hExtra : (E+8)*L ≤ (E+8)*L*Real.exp (9*L/10) := by + simpa only [mul_one] using mul_le_mul_of_nonneg_left he + (show 0 ≤ (E+8)*L by positivity) + nlinarith + +theorem modulusHeight_nat_succ_le (Q H : ℕ) : + Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q ((H+1 : ℕ) : ℝ) ≤ + Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q (H : ℝ)+1 := by + have hH : (0 : ℝ) ≤ H := Nat.cast_nonneg H + have hl := Real.log_le_log (show (0 : ℝ)<(H : ℝ)+7 by positivity) + (show (H : ℝ)+7 ≤ 2*((H : ℝ)+6) by linarith) + rw [Real.log_mul (by norm_num) (by positivity)] at hl + have hlog2 := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ)<2) + unfold Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight + rw [abs_of_nonneg (Nat.cast_nonneg (H+1)), abs_of_nonneg hH] + push_cast + have he : (H : ℝ)+1+6 = H+7 := by ring + rw [he] + linarith + +theorem supplyContourHeight_succ_modulus_budget (P : ℕ) {E L : ℝ} + (hE : 0 ≤ E) (hL : 1 ≤ L) : + Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight (supplyConductorCutoff L) + ((supplyContourHeight P E L+1 : ℕ) : ℝ) ≤ + (20003*((P : ℝ)+1)+E+9)*L*Real.exp (9*L/10) := by + have h1 := modulusHeight_nat_succ_le (supplyConductorCutoff L) (supplyContourHeight P E L) + have h2 := supplyContourHeight_modulus_budget P hE hL + have he : 1 ≤ Real.exp (9*L/10) := Real.one_le_exp (by positivity) + nlinarith + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyErrorAssembly.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyErrorAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf88d79979e362ffc2e4a40f51dd16f4cb760d80 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyErrorAssembly.lean @@ -0,0 +1,93 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ContourPolynomial +import OAI.NumberTheory.Ostmann.ZeroDensity.LiteralSupplyZeros +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimitiveExplicitComparison +import OAI.NumberTheory.Ostmann.ZeroDensity.PrincipalSupplyDecay +import OAI.NumberTheory.Ostmann.ZeroDensity.SupplyTailDecay + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open Filter Set +open scoped BigOperators Topology ContDiff +namespace Ostmann.ZeroDensity + +theorem eventually_totalPrimitiveError_of_truncated_formula {φ : ℝ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hcompact : HasCompactSupport φ) + (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) + (B : ℕ) {C : ℝ} (hC : 0 < C) + (hformula : ∀ (Q : ℕ) (χ : NonprincipalPrimitiveFamily Q) (X T : ℝ), + Real.exp 2 ≤ X → 2 ≤ T → + ‖smoothError χ.val.2.val φ X‖ ≤ C* + ((∑ p ∈ (Ostmann.Dirichlet.zerosUpTo_finite χ.1.2.1 χ.2 (T+1)).toFinset.filter + (fun p => (1 : ℝ)/2 ≤ p.re), + (Ostmann.Dirichlet.zeroMultiplicity χ.1.2.1 p : ℝ)*X^p.re/(1+|p.im|)^(B+1))+ + contourRemainder B (χ.val.1.val+1 : ℝ) X T)) + (D : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 0 < Q → Q ≤ supplyConductorCutoff L → + totalPrimitiveError Q none φ (supplyPrimeSample L : ℝ) ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-D*L) := by + let E : ℝ := B+|D|+3 + have hE : 0 ≤ E := by dsimp [E]; positivity + have hE' : (B : ℝ)+(D+1)+1 ≤ E := by dsimp [E]; linarith [le_abs_self D] + have hpr := eventually_principal_supply_decay hφ hcompact hs (D+1) + have hz := eventually_uniform_supply_zero_decay_succ (B+2) hE (D+1) + have hl := eventually_supply_left_edge_decay B (B+2) hE (D+1) + have ht := eventually_supply_tail_decay B (D+1) E hE' + have hconst := eventually_constant_exp_decay + (show (0 : ℝ) < 1+3*C by positivity) D + filter_upwards [hpr,hz,hl,ht,hconst, + supplyPrimeSample_tendsto.eventually (eventually_ge_atTop (Real.exp (2 : ℝ)))] + with L hpr hz hl ht hconst hXlarge + intro Q hQ hQQ + have hX : (1 : ℝ) ≤ supplyPrimeSample L := + (Real.one_le_exp (by norm_num : (0 : ℝ) ≤ 2)).trans hXlarge + have hT : (2 : ℝ) ≤ supplyContourHeight (B+2) E L := by + exact_mod_cast supplyContourHeight_ge_two (B+2) E L + have hmain := totalPrimitiveError_le_of_truncated_formula Q hQ φ B hX + (show (0 : ℝ) ≤ supplyContourHeight (B+2) E L by positivity) hC.le + (fun χ => hformula Q χ _ _ hXlarge hT) + have hzero : (∑ z ∈ retainedZeros Q none (1/2) + ((supplyContourHeight (B+2) E L : ℝ)+1), (supplyPrimeSample L : ℝ)^z.point.re) ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-(D+1)*L) := by + have heq := congrArg (fun t : ℝ => + ∑ z ∈ retainedZeros Q none (1/2) t, (supplyPrimeSample L : ℝ)^z.point.re) + (show (supplyContourHeight (B+2) E L : ℝ)+1 = + ((supplyContourHeight (B+2) E L+1 : ℕ) : ℝ) by push_cast; rfl) + exact heq.trans_le (hz Q hQ hQQ none) + have hleft := hl Q hQ hQQ + have htail := ht Q hQ hQQ + have hrem : (Q : ℝ)^2*contourRemainder B Q (supplyPrimeSample L) + (supplyContourHeight (B+2) E L) ≤ + 2*((supplyPrimeSample L : ℝ)*Real.exp (-(D+1)*L)) := by + calc + _ = (Q : ℝ)^2*Real.sqrt (supplyPrimeSample L : ℝ)* + ((Q : ℝ)*((supplyContourHeight (B+2) E L : ℝ)+2))^B+ + (Q : ℝ)^2*(supplyPrimeSample L : ℝ)* + ((Q : ℝ)*((supplyContourHeight (B+2) E L : ℝ)+2))^B / + (supplyContourHeight (B+2) E L : ℝ)^(B+1)* + (1+Real.log (supplyPrimeSample L : ℝ))^B := by + unfold contourRemainder + ring + _ ≤ _ := by linarith only [hleft,htail] + have hfinal := mul_le_mul_of_nonneg_left hconst + (Nat.cast_nonneg (supplyPrimeSample L) : (0 : ℝ) ≤ supplyPrimeSample L) + calc + _ ≤ ‖smoothError (1 : DirichletCharacter ℂ 1) φ (supplyPrimeSample L : ℝ)‖+ + C*((∑ z ∈ retainedZeros Q none (1/2) + ((supplyContourHeight (B+2) E L : ℝ)+1), (supplyPrimeSample L : ℝ)^z.point.re)+ + (Q : ℝ)^2*contourRemainder B Q (supplyPrimeSample L) (supplyContourHeight (B+2) E L)) := hmain + _ ≤ (supplyPrimeSample L : ℝ)*Real.exp (-(D+1)*L)+ + C*((supplyPrimeSample L : ℝ)*Real.exp (-(D+1)*L)+ + 2*((supplyPrimeSample L : ℝ)*Real.exp (-(D+1)*L))) := by gcongr + _ = (supplyPrimeSample L : ℝ)*((1+3*C)*Real.exp (-(D+1)*L)) := by ring + _ ≤ _ := hfinal + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyPrimeError.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyPrimeError.lean new file mode 100644 index 0000000000000000000000000000000000000000..bdd64dd0a429d4dad5f278b3380b538eef7627ca --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyPrimeError.lean @@ -0,0 +1,42 @@ +import OAI.NumberTheory.Ostmann.Dirichlet.SmoothedExplicitFormula +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimePowerSupplyDecay +import OAI.NumberTheory.Ostmann.ZeroDensity.SupplyErrorAssembly + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open Filter Set +open scoped BigOperators Topology ContDiff +namespace Ostmann.ZeroDensity + +theorem eventually_totalPrimitiveError_supply {φ : ℝ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hcompact : HasCompactSupport φ) + (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) (D : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 0 < Q → Q ≤ supplyConductorCutoff L → + totalPrimitiveError Q none φ (supplyPrimeSample L : ℝ) ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-D*L) := by + obtain ⟨C,hC,hformula⟩ := Ostmann.Dirichlet.exists_smoothed_explicit_formula φ hφ hcompact 8 + apply eventually_totalPrimitiveError_of_truncated_formula hφ hcompact hs 7 hC ?_ D + intro Q χ X T hX hT + have hh := hformula (χ.val.1.val+1) χ.val.2.val χ.property X T hX hT + simpa only [Ostmann.Dirichlet.upperZeroWeight,contourRemainder,Nat.cast_add, + Nat.cast_one,add_assoc,show (7+1 : ℕ)=8 by norm_num] using hh + +theorem eventually_totalPrimitivePrimeError_supply {φ : ℝ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hcompact : HasCompactSupport φ) + (hs : tsupport φ ⊆ Ioo (1/2 : ℝ) 1) (D : ℝ) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 0 < Q → Q ≤ supplyConductorCutoff L → + Ostmann.Supply.totalPrimitivePrimeError Q none φ (supplyPrimeSample L : ℝ) ≤ + (supplyPrimeSample L : ℝ)*Real.exp (-D*L) := + prime_error_supply_decay_of_vonMangoldt hφ.continuous hs + (eventually_totalPrimitiveError_supply hφ hcompact hs) D + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyPrimeScales.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyPrimeScales.lean new file mode 100644 index 0000000000000000000000000000000000000000..885d53dd549986029a2cc467a45126bead6fe659 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/SupplyPrimeScales.lean @@ -0,0 +1,87 @@ +import Mathlib.Tactic.FieldSimp +import OAI.NumberTheory.Ostmann.Supply.RetainedBandScales + +namespace OAI + +noncomputable section +namespace Ostmann.ZeroDensity + +def supplyConductorCutoff (L : ℝ) : ℕ := + ⌈Real.exp (2*(Ostmann.Supply.supplyTruncation L : ℝ)*Real.exp (9*L/10))⌉₊ + +def supplyPrimeSample (L : ℝ) : ℕ := (Ostmann.Supply.supplyRadius L)^2 + +theorem supplyConductorCutoff_pos (L : ℝ) : 0 < supplyConductorCutoff L := + Nat.ceil_pos.mpr (Real.exp_pos _) + +theorem supplyPrimeSample_pos (L : ℝ) : 0 < supplyPrimeSample L := by + exact pow_pos (Ostmann.Supply.supplyRadius_pos L) _ + +theorem log_supplyConductorCutoff_bound {L : ℝ} (hL : 1 ≤ L) : + Real.log (supplyConductorCutoff L : ℝ) ≤ 20003*L*Real.exp (9*L/10) := by + let A : ℝ := 2*(Ostmann.Supply.supplyTruncation L : ℝ)*Real.exp (9*L/10) + have hA : 0 ≤ A := by dsimp [A]; positivity + have heA : 1 ≤ Real.exp A := Real.one_le_exp hA + have hceil := Nat.ceil_lt_add_one (Real.exp_pos A).le + have hcut : (supplyConductorCutoff L : ℝ) ≤ 2*Real.exp A := by + change (⌈Real.exp A⌉₊ : ℝ) ≤ _ + linarith + have hp : (0 : ℝ) < supplyConductorCutoff L := Nat.cast_pos.mpr (supplyConductorCutoff_pos L) + have hlog := Real.log_le_log hp hcut + rw [Real.log_mul (by norm_num) (Real.exp_pos A).ne', Real.log_exp] at hlog + have hkceil := Nat.ceil_lt_add_one (show 0 ≤ 10000*L by positivity) + have hk : (Ostmann.Supply.supplyTruncation L : ℝ) ≤ 10001*L := by + unfold Ostmann.Supply.supplyTruncation + linarith + have he : 1 ≤ Real.exp (9*L/10) := Real.one_le_exp (by positivity) + have hlog2 : Real.log (2 : ℝ) ≤ 1 := by + have hh := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ)<2) + linarith + dsimp [A] at hlog + nlinarith [mul_le_mul_of_nonneg_right hk (Real.exp_pos (9*L/10)).le] + +theorem log_supplyPrimeSample_lower (L : ℝ) : + Real.exp L ≤ Real.log (supplyPrimeSample L : ℝ) := by + have hlower := Nat.le_ceil (Real.exp (Real.exp L/2)) + have hlog := Real.log_le_log (Real.exp_pos (Real.exp L/2)) hlower + rw [Real.log_exp] at hlog + unfold supplyPrimeSample + push_cast + rw [Real.log_pow] + change Real.exp L ≤ 2*Real.log (Ostmann.Supply.supplyRadius L : ℝ) + change Real.exp L/2 ≤ Real.log (Ostmann.Supply.supplyRadius L : ℝ) at hlog + linarith + +theorem log_supplyPrimeSample_upper (L : ℝ) : + Real.log (supplyPrimeSample L : ℝ) ≤ Real.exp L+2*Real.log 2 := by + have hceil := Nat.ceil_lt_add_one (Real.exp_pos (Real.exp L/2)).le + have hexp : 1 ≤ Real.exp (Real.exp L/2) := Real.one_le_exp (by positivity) + have hrad : (Ostmann.Supply.supplyRadius L : ℝ) ≤ 2*Real.exp (Real.exp L/2) := by + unfold Ostmann.Supply.supplyRadius + linarith + have hp : (0 : ℝ) (r : ZMod p) + +theorem tailDensityMask_card (A : Set ℕ) (N p : ℕ) : + (tailDensityMask A N p).card = (tailSupport A N p).card := by + apply Finset.card_image_of_injOn + intro r hr s hs he + have hrp := Finset.mem_range.mp (tailSupport_subset A N p hr) + have hsp := Finset.mem_range.mp (tailSupport_subset A N p hs) + have hmod := (ZMod.natCast_eq_natCast_iff' r s p).mp he + simpa only [Nat.mod_eq_of_lt hrp, Nat.mod_eq_of_lt hsp] using hmod + +theorem positiveSummandTail_mem_mask (A : Set ℕ) (N lo hi p : ℕ) (hp : 0 < p) + (hlo : N + p ≤ lo) {x : ℤ} (hx : x ∈ positiveSummandTail A lo hi) : + (x : ZMod p) ∈ tailDensityMask A N p := by + obtain ⟨a, ha, rfl⟩ := Finset.mem_image.mp hx + obtain ⟨haA, halo, _⟩ := (mem_summandTail A lo hi a).mp ha + apply Finset.mem_image.mpr + refine ⟨a % p, mod_mem_tailSupport hp haA (lt_of_le_of_lt hlo halo), ?_⟩ + simp + +theorem tailDensityMask_density (A : Set ℕ) (N p : ℕ) (hp : 0 < p) + (hcard : ((tailSupport A N p).card : ℝ) ≤ 2 * p / 3) : + (tailDensityMask A N p).card / (p : ℝ) ≤ 2 / 3 := by + rw [tailDensityMask_card] + apply (div_le_iff₀ (show (0 : ℝ) < p by exact_mod_cast hp)).mpr + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Target.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Target.lean new file mode 100644 index 0000000000000000000000000000000000000000..84db43a4bd3185f73a9ff22016fcb4f35ebf1d18 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/Target.lean @@ -0,0 +1,80 @@ +import Mathlib.MeasureTheory.Integral.Bochner.Set +import Mathlib.NumberTheory.ArithmeticFunction.VonMangoldt +import Mathlib.NumberTheory.DirichletCharacter.Orthogonality +import Mathlib.NumberTheory.LSeries.DirichletContinuation + +namespace OAI + +noncomputable section +open scoped BigOperators +open MeasureTheory + +namespace Ostmann.ZeroDensity + +def PrimitiveFamily (Q : ℕ) := + Σ q : Fin Q, {χ : DirichletCharacter ℂ (q.val + 1) // χ.IsPrimitive} + +instance (Q : ℕ) : Fintype (PrimitiveFamily Q) := by + classical + unfold PrimitiveFamily + infer_instance + +instance (Q : ℕ) : DecidableEq (PrimitiveFamily Q) := Classical.decEq _ + +theorem card_primitiveFamily_le (Q : ℕ) : Fintype.card (PrimitiveFamily Q) ≤ Q ^ 2 := by + classical + change Fintype.card (Σ q : Fin Q, + {χ : DirichletCharacter ℂ (q.val + 1) // χ.IsPrimitive}) ≤ Q ^ 2 + rw [Fintype.card_sigma] + calc + ∑ q : Fin Q, Fintype.card {χ : DirichletCharacter ℂ (q.val + 1) // χ.IsPrimitive} ≤ + ∑ q : Fin Q, Fintype.card (DirichletCharacter ℂ (q.val + 1)) := by + apply Finset.sum_le_sum + intro q _ + exact Fintype.card_subtype_le _ + _ = ∑ q : Fin Q, (q.val + 1).totient := by + apply Finset.sum_congr rfl + intro q _ + rw [← Nat.card_eq_fintype_card] + exact DirichletCharacter.card_eq_totient_of_hasEnoughRootsOfUnity ℂ (q.val + 1) + _ ≤ ∑ _q : Fin Q, Q := by + apply Finset.sum_le_sum + intro q _ + exact (Nat.totient_le _).trans (by omega) + _ = Q ^ 2 := by simp [pow_two] + +def smoothError {q : ℕ} (χ : DirichletCharacter ℂ q) (φ : ℝ → ℝ) (X : ℝ) : ℂ := by + classical + exact (∑' n : ℕ, (ArithmeticFunction.vonMangoldt n : ℂ) * χ n * (φ ((n : ℝ) / X) : ℂ)) - + if χ = 1 then ((X * ∫ t in Set.Ioi (0 : ℝ), φ t : ℝ) : ℂ) else 0 + +def totalPrimitiveError (Q : ℕ) (exception : Option (PrimitiveFamily Q)) + (φ : ℝ → ℝ) (X : ℝ) : ℝ := by + classical + exact ∑ χ : PrimitiveFamily Q, + if some χ = exception then 0 else ‖smoothError χ.2.1 φ X‖ + +theorem totalPrimitiveError_nonneg (Q : ℕ) (exception : Option (PrimitiveFamily Q)) + (φ : ℝ → ℝ) (X : ℝ) : 0 ≤ totalPrimitiveError Q exception φ X := by + classical + unfold totalPrimitiveError + exact Finset.sum_nonneg fun χ _ => by split <;> positivity + +theorem totalPrimitiveError_none (Q : ℕ) (φ : ℝ → ℝ) (X : ℝ) : + totalPrimitiveError Q none φ X = + ∑ χ : PrimitiveFamily Q, ‖smoothError χ.2.1 φ X‖ := by + classical + simp [totalPrimitiveError] + +theorem totalPrimitiveError_some (Q : ℕ) (exception : PrimitiveFamily Q) + (φ : ℝ → ℝ) (X : ℝ) : + totalPrimitiveError Q (some exception) φ X = + ∑ χ ∈ Finset.univ.erase exception, ‖smoothError χ.2.1 φ X‖ := by + classical + simp [totalPrimitiveError, Finset.sum_ite, Finset.filter_ne'] + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ThetaMainTerm.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ThetaMainTerm.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9b4addbae173c1ae5b4fea0d90564b4d35162b0 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ThetaMainTerm.lean @@ -0,0 +1,64 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Deriv +import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimePartialSummation + +namespace OAI + +/-! # The exceptional theta term and its harmonic density + +Differentiating the published theta main term cancels its factor `β`. +The corresponding harmonic density is retained exactly. +-/ + +namespace Ostmann + +open MeasureTheory + +noncomputable def thetaMainTerm (φ χ β x : ℝ) : ℝ := + (x - χ * x ^ β / β) / φ + +noncomputable def thetaMainDensity (φ χ β x : ℝ) : ℝ := + (1 - χ * x ^ (β - 1)) / φ + +theorem hasDerivAt_thetaMainTerm (φ χ β : ℝ) (hβ : β ≠ 0) + {x : ℝ} (hx : 0 < x) : + HasDerivAt (thetaMainTerm φ χ β) (thetaMainDensity φ χ β x) x := by + have h := ((hasDerivAt_id x).sub + (((Real.hasDerivAt_rpow_const (p := β) (Or.inl hx.ne')).const_mul χ).div_const β)).div_const φ + change HasDerivAt (fun y : ℝ => (y - χ * y ^ β / β) / φ) + ((1 - χ * (β * x ^ (β - 1)) / β) / φ) x at h + change HasDerivAt (fun y : ℝ => (y - χ * y ^ β / β) / φ) + ((1 - χ * x ^ (β - 1)) / φ) x + have he : (1 - χ * (β * x ^ (β - 1)) / β) / φ = + (1 - χ * x ^ (β - 1)) / φ := by + congr 1 + field_simp + exact he ▸ h + +theorem continuousOn_thetaMainDensity (φ χ β : ℝ) {u v : ℝ} (hu : 0 < u) : + ContinuousOn (thetaMainDensity φ χ β) (Set.Icc u v) := by + intro x hx + have hx0 : x ≠ 0 := ne_of_gt (lt_of_lt_of_le hu hx.1) + exact ((continuousAt_const.sub ((Real.continuousAt_rpow_const x (β - 1) + (Or.inl hx0)).const_mul χ)).div_const φ).continuousWithinAt + +theorem thetaMain_harmonic_integral (φ χ β : ℝ) (hβ : β ≠ 0) + {u v : ℝ} (hu : 1 < u) (huv : u ≤ v) : + (∫ t in Set.Ioc u v, primeHarmonicWeight t * thetaMainDensity φ χ β t) = + primeHarmonicWeight v * thetaMainTerm φ χ β v - + primeHarmonicWeight u * thetaMainTerm φ χ β u - + ∫ t in Set.Ioc u v, primeHarmonicDerivative t * thetaMainTerm φ χ β t := by + have hi1 : IntervalIntegrable primeHarmonicDerivative volume u v := + (continuousOn_primeHarmonicDerivative hu).intervalIntegrable_of_Icc huv + have hi2 : IntervalIntegrable (thetaMainDensity φ χ β) volume u v := + (continuousOn_thetaMainDensity φ χ β (lt_trans zero_lt_one hu)).intervalIntegrable_of_Icc huv + have h := intervalIntegral.integral_mul_deriv_eq_deriv_mul + (fun x hx => hasDerivAt_primeHarmonicWeight + (lt_of_lt_of_le hu ((Set.uIcc_of_le huv) ▸ hx).1)) + (fun x hx => hasDerivAt_thetaMainTerm φ χ β hβ + (lt_trans zero_lt_one (lt_of_lt_of_le hu ((Set.uIcc_of_le huv) ▸ hx).1))) hi1 hi2 + simpa only [intervalIntegral.integral_of_le huv] using h + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ThetaToHarmonic.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ThetaToHarmonic.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e987ecd5bcf2b6ff4c4baf25b75657c74b88ea9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ThetaToHarmonic.lean @@ -0,0 +1,74 @@ +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Analysis.Complex.ExponentialBounds +import OAI.NumberTheory.Ostmann.Construction.PrimeHarmonicWeightBounds + +namespace OAI + +/-! # Reciprocal-prime estimates derived from the published theta bound -/ + +namespace Ostmann + +open MeasureTheory + +/-- The classical theta error on a multiplicative interval transfers with +an absolute factor of eighteen, uniformly in the modulus and residue. -/ +theorem theta_to_harmonic_error (q a : ℕ) (φ χ β c C : ℝ) (hβ : β ≠ 0) + (hc : 0 ≤ c) (hC : 0 ≤ C) {u v : ℝ} (hu : 1 < u) + (hlogu : 1 ≤ Real.log u) (huv : u ≤ v) (hshort : v ≤ 3 * u) + (hθ : ∀ t ∈ Set.Icc u v, + |primeProgressionTheta q a t - thetaMainTerm φ χ β t| ≤ + C * t * Real.exp (-c * Real.sqrt (Real.log t))) : + |reciprocalPrimeInterval q a u v - + ∫ t in Set.Ioc u v, primeHarmonicWeight t * thetaMainDensity φ χ β t| ≤ + 18 * C * Real.exp (-c * Real.sqrt (Real.log u)) := by + have hu0 : 0 < u := lt_trans zero_lt_one hu + have hv0 : 0 < v := hu0.trans_le huv + let E := C * v * Real.exp (-c * Real.sqrt (Real.log u)) + have hE : 0 ≤ E := by dsimp [E]; positivity + have hθ' (t : ℝ) (ht : t ∈ Set.Icc u v) : + |primeProgressionTheta q a t - thetaMainTerm φ χ β t| ≤ E := by + apply (hθ t ht).trans + dsimp [E] + apply mul_le_mul + · exact mul_le_mul_of_nonneg_left ht.2 hC + · apply Real.exp_le_exp.mpr + have hs := Real.sqrt_le_sqrt (Real.log_le_log hu0 ht.1) + nlinarith + · positivity + · positivity + apply (primeHarmonic_short_interval_error q a φ χ β hβ hu hlogu huv hshort E hE hθ').trans + dsimp [E] + apply (div_le_iff₀ hu0).mpr + nlinarith [mul_le_mul_of_nonneg_right hshort + (mul_nonneg hC (Real.exp_pos (-c * Real.sqrt (Real.log u))).le)] + +/-- A log interval of length at most one is a multiplicative interval with +ratio less than three, as required by the uniform partial-summation bound. -/ +theorem exp_short_interval_le_three {s t : ℝ} (hst : t ≤ s + 1) : + Real.exp t ≤ 3 * Real.exp s := by + calc + _ ≤ Real.exp (s + 1) := Real.exp_le_exp.mpr hst + _ = Real.exp s * Real.exp 1 := Real.exp_add s 1 + _ ≤ Real.exp s * 3 := mul_le_mul_of_nonneg_left Real.exp_one_lt_three.le (Real.exp_pos s).le + _ = _ := mul_comm _ _ + +/-- The form used in the finite log-cell partition, before the harmless +change of variables in the main integral. -/ +theorem theta_to_log_interval_error (q a : ℕ) (φ χ β c C : ℝ) (hβ : β ≠ 0) + (hc : 0 ≤ c) (hC : 0 ≤ C) {s t : ℝ} (hs : 1 ≤ s) + (hst : s ≤ t) (hshort : t ≤ s + 1) + (hθ : ∀ x ∈ Set.Icc (Real.exp s) (Real.exp t), + |primeProgressionTheta q a x - thetaMainTerm φ χ β x| ≤ + C * x * Real.exp (-c * Real.sqrt (Real.log x))) : + |reciprocalPrimeInterval q a (Real.exp s) (Real.exp t) - + ∫ x in Set.Ioc (Real.exp s) (Real.exp t), + primeHarmonicWeight x * thetaMainDensity φ χ β x| ≤ + 18 * C * Real.exp (-c * Real.sqrt s) := by + have hs0 : 0 < s := lt_of_lt_of_le zero_lt_one hs + simpa only [Real.log_exp] using theta_to_harmonic_error q a φ χ β c C hβ hc hC + (Real.one_lt_exp_iff.mpr hs0) (by simpa only [Real.log_exp] using hs) + (Real.exp_le_exp.mpr hst) (exp_short_interval_le_three hshort) hθ + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/TotientSqrtBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/TotientSqrtBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..119d394c903be414006fd3a4e803347168296ad1 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/TotientSqrtBound.lean @@ -0,0 +1,34 @@ +import Mathlib.Analysis.SpecialFunctions.Sqrt +import OAI.NumberTheory.Ostmann.Arithmetic.SquareRootProbability +import OAI.NumberTheory.Ostmann.Preliminaries.DivisorPowerBound + +namespace OAI + +/-! # A sufficient reciprocal-totient bound for the large-modulus range -/ + +namespace Ostmann + +theorem reciprocal_totient_sqrt_bound : ∃ C : ℝ, 0 < C ∧ ∀ q : ℕ, 0 < q → + 1 / (q.totient : ℝ) ≤ C / Real.sqrt q := by + obtain ⟨D, hD, hdiv⟩ := exists_divisors_power_bound 2 + refine ⟨Real.sqrt D, Real.sqrt_pos.mpr (by exact_mod_cast (show 0 < D by omega)), ?_⟩ + intro q hq + have hqpos : (0 : ℝ) < q := by exact_mod_cast hq + have hφ : (0 : ℝ) < q.totient := by exact_mod_cast Nat.totient_pos.mpr hq + have hτ : (q : ℝ) ≤ q.divisors.card * (q.totient : ℝ) := by + exact_mod_cast le_divisors_card_mul_totient q hq.ne' + have hdiv' : (q.divisors.card : ℝ) ^ 2 ≤ D * (q : ℝ) := by exact_mod_cast hdiv q hq.ne' + have hq2 : (q : ℝ) ^ 2 ≤ (D : ℝ) * q * (q.totient : ℝ) ^ 2 := by + have hs : (q : ℝ) ^ 2 ≤ (q.divisors.card * (q.totient : ℝ)) ^ 2 := by + nlinarith + have hm := mul_le_mul_of_nonneg_right hdiv' (sq_nonneg (q.totient : ℝ)) + nlinarith + have hqD : (q : ℝ) ≤ (D : ℝ) * (q.totient : ℝ) ^ 2 := by nlinarith + have hs := Real.sqrt_le_sqrt hqD + rw [Real.sqrt_mul (Nat.cast_nonneg D), Real.sqrt_sq_eq_abs, + abs_of_pos hφ] at hs + exact (div_le_div_iff₀ hφ (Real.sqrt_pos.mpr hqpos)).mpr (by simpa using hs) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/TreeDensity.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/TreeDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e6e727a98632f2acc7da4933361e0bb6947639b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/TreeDensity.lean @@ -0,0 +1,196 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PairDensity +import OAI.NumberTheory.Ostmann.Characters.DifferenceMoment + +namespace OAI + +/-! +# Iterating the elementary tree density estimate + +A split plan allows the remaining unit parameters to depend on every +previous split coordinate. The bound is uniform over those choices. +The separate rational-coordinate lemmas identify the manuscript's tree +with this inverse-square split law on valid ancestor data. +-/ + +namespace Ostmann + +open scoped BigOperators + +/-- Parameters for an ordered binary tree, with adaptive descendant data. -/ +def BinarySplitPlan (U : Type) : ℕ → Type + | 0 => Unit + | n + 1 => U × (U → BinarySplitPlan U n) × (U → BinarySplitPlan U n) + +noncomputable def splitTreeMoment {p : ℕ} [Fact p.Prime] (w : ZMod p → ℝ) : + (n : ℕ) → BinarySplitPlan (ZMod p)ˣ n → ZMod p → ℝ + | 0, _, d => if d = 0 then 0 else w d + | n + 1, plan, d => if d = 0 then 0 else + (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * ∑ m : (ZMod p)ˣ, + let t := plan.1 * (m⁻¹) ^ 2 + if t = 1 then 0 else + splitTreeMoment w n (plan.2.1 m) + (d * (t : ZMod p) / ((t : ZMod p) - 1)) * + splitTreeMoment w n (plan.2.2 m) + (d / ((t : ZMod p) - 1)) + +/-- Parameter-free density majorant, including the zero convention. -/ +noncomputable def treeDensityMajorant {p : ℕ} [Fact p.Prime] (w : ZMod p → ℝ) : + ℕ → ZMod p → ℝ + | 0, d => if d = 0 then 0 else w d + | n + 1, d => if d = 0 then 0 else + (2 / (Fintype.card (ZMod p)ˣ : ℝ)) * + differenceMoment (treeDensityMajorant w n) (treeDensityMajorant w n) d + +/-- The successive bounds are `E`, `2 E²`, `8 E⁴`, and so on. -/ +def binaryMomentBound (E : ℝ) : ℕ → ℝ + | 0 => E + | n + 1 => 2 * binaryMomentBound E n ^ 2 + +theorem treeDensityMajorant_zero {p : ℕ} [Fact p.Prime] (w : ZMod p → ℝ) (n : ℕ) : + treeDensityMajorant w n 0 = 0 := by + cases n <;> simp [treeDensityMajorant] + +theorem treeDensityMajorant_nonneg {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (hw : ∀ x, 0 ≤ w x) (n : ℕ) (d : ZMod p) : + 0 ≤ treeDensityMajorant w n d := by + induction n generalizing d with + | zero => simp only [treeDensityMajorant]; split_ifs; exact le_rfl; exact hw d + | succ n ih => + simp only [treeDensityMajorant] + split_ifs + · exact le_rfl + · exact mul_nonneg (by positivity) (differenceMoment_nonneg _ _ ih ih d) + +theorem splitTreeMoment_nonneg {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (hw : ∀ x, 0 ≤ w x) (n : ℕ) + (plan : BinarySplitPlan (ZMod p)ˣ n) (d : ZMod p) : + 0 ≤ splitTreeMoment w n plan d := by + induction n generalizing d with + | zero => simp only [splitTreeMoment]; split_ifs; exact le_rfl; exact hw d + | succ n ih => + simp only [splitTreeMoment] + split_ifs + · exact le_rfl + · apply mul_nonneg (by positivity) + apply Finset.sum_nonneg + intro m _ + dsimp + split_ifs + · exact le_rfl + · exact mul_nonneg (ih _ _) (ih _ _) + +/-- Each valid split costs at most the factor two in the square-fiber bound. -/ +theorem splitTreeMoment_le_majorant {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (hw : ∀ x, 0 ≤ w x) (n : ℕ) + (plan : BinarySplitPlan (ZMod p)ˣ n) (d : ZMod p) : + splitTreeMoment w n plan d ≤ treeDensityMajorant w n d := by + induction n generalizing d with + | zero => rfl + | succ n ih => + by_cases hd : d = 0 + · simp [hd, splitTreeMoment, treeDensityMajorant] + · simp only [splitTreeMoment, treeDensityMajorant, hd, ite_false] + have h := pair_inverse_square_density (Units.mk0 d hd) plan.1 + (treeDensityMajorant w n) (treeDensityMajorant w n) + (treeDensityMajorant_zero w n) (treeDensityMajorant_zero w n) + (treeDensityMajorant_nonneg w hw n) (treeDensityMajorant_nonneg w hw n) + calc + _ ≤ (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * ∑ m : (ZMod p)ˣ, + let t := plan.1 * (m⁻¹) ^ 2 + if t = 1 then 0 else + treeDensityMajorant w n (d * (t : ZMod p) / ((t : ZMod p) - 1)) * + treeDensityMajorant w n (d / ((t : ZMod p) - 1)) := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Finset.sum_le_sum + intro m _ + dsimp + split_ifs + · exact le_rfl + · exact mul_le_mul (ih _ _) (ih _ _) + (splitTreeMoment_nonneg w hw n _ _) (treeDensityMajorant_nonneg w hw n _) + _ ≤ (Fintype.card (ZMod p)ˣ : ℝ)⁻¹ * + (2 * differenceMoment (treeDensityMajorant w n) (treeDensityMajorant w n) d) := + mul_le_mul_of_nonneg_left h (by positivity) + _ = _ := by ring + +theorem treeDensityMajorant_mean_le {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (hw : ∀ x, 0 ≤ w x) (E : ℝ) + (hE : (∑ d : (ZMod p)ˣ, w d) / (Fintype.card (ZMod p)ˣ : ℝ) ≤ E) (n : ℕ) : + (∑ d : (ZMod p)ˣ, treeDensityMajorant w n d) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ binaryMomentBound E n := by + have hU : 0 < (Fintype.card (ZMod p)ˣ : ℝ) := by exact_mod_cast Fintype.card_pos + induction n with + | zero => + simpa only [treeDensityMajorant, Units.ne_zero, ite_false, binaryMomentBound] using hE + | succ n ih => + have hzero := treeDensityMajorant_zero w n + have hsum := sum_units_eq_sum_of_zero (treeDensityMajorant w n) hzero + have hnn : 0 ≤ (∑ d : (ZMod p)ˣ, treeDensityMajorant w n d) / + (Fintype.card (ZMod p)ˣ : ℝ) := by + apply div_nonneg _ hU.le + exact Finset.sum_nonneg fun d _ => treeDensityMajorant_nonneg w hw n d + calc + _ = (2 / (Fintype.card (ZMod p)ˣ : ℝ)) * + (∑ d : (ZMod p)ˣ, + differenceMoment (treeDensityMajorant w n) (treeDensityMajorant w n) d) / + (Fintype.card (ZMod p)ˣ : ℝ) := by + simp only [treeDensityMajorant, Units.ne_zero, ite_false, ← Finset.mul_sum] + _ ≤ (2 / (Fintype.card (ZMod p)ˣ : ℝ)) * + ((∑ x : ZMod p, treeDensityMajorant w n x) ^ 2) / + (Fintype.card (ZMod p)ˣ : ℝ) := by + apply div_le_div_of_nonneg_right _ hU.le + apply mul_le_mul_of_nonneg_left _ (by positivity) + simpa only [pow_two] using sum_units_differenceMoment_le + (treeDensityMajorant w n) (treeDensityMajorant w n) + (treeDensityMajorant_nonneg w hw n) (treeDensityMajorant_nonneg w hw n) + _ = 2 * ((∑ d : (ZMod p)ˣ, treeDensityMajorant w n d) / + (Fintype.card (ZMod p)ˣ : ℝ)) ^ 2 := by rw [← hsum]; ring + _ ≤ 2 * binaryMomentBound E n ^ 2 := by + exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hnn ih 2) (by norm_num) + _ = _ := rfl + +/-- Uniform root averaging permits a different descendant plan at each root value. -/ +theorem splitTreeMoment_mean_le {p : ℕ} [Fact p.Prime] + (w : ZMod p → ℝ) (hw : ∀ x, 0 ≤ w x) (E : ℝ) + (hE : (∑ d : (ZMod p)ˣ, w d) / (Fintype.card (ZMod p)ˣ : ℝ) ≤ E) + (n : ℕ) (plans : (ZMod p)ˣ → BinarySplitPlan (ZMod p)ˣ n) : + (∑ d : (ZMod p)ˣ, splitTreeMoment w n (plans d) d) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ binaryMomentBound E n := by + apply le_trans _ (treeDensityMajorant_mean_le w hw E hE n) + apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg _) + exact Finset.sum_le_sum fun d _ => splitTreeMoment_le_majorant w hw n (plans d) d + +/-- The recursive density bound in closed form. -/ +theorem binaryMomentBound_eq (E : ℝ) (n : ℕ) : + binaryMomentBound E n = (2 * E) ^ (2 ^ n) / 2 := by + induction n with + | zero => simp [binaryMomentBound] + | succ n ih => + rw [binaryMomentBound, ih, pow_succ (2 : ℕ), pow_mul] + ring + +/-- The `3^r` estimate for an `L²`-normalized test at an odd prime. -/ +theorem splitTreeMoment_l2_bound {p : ℕ} [Fact p.Prime] + (hp : 3 ≤ p) (g : ZMod p → ℂ) (hg : g 0 = 0) + (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) + (n : ℕ) (plans : (ZMod p)ˣ → BinarySplitPlan (ZMod p)ˣ n) : + (∑ d : (ZMod p)ˣ, splitTreeMoment (fun x => ‖g x‖ ^ 2) n (plans d) d) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ (3 : ℝ) ^ (2 ^ n) := by + have hpr : (3 : ℝ) ≤ p := by exact_mod_cast hp + have hU : (Fintype.card (ZMod p)ˣ : ℝ) = (p : ℝ) - 1 := by + rw [ZMod.card_units, Nat.cast_sub (Fact.out : p.Prime).one_lt.le, Nat.cast_one] + have hsum := sum_units_eq_sum_of_zero (fun x => ‖g x‖ ^ 2) (by simp [hg]) + have hE : (∑ d : (ZMod p)ˣ, ‖g d‖ ^ 2) / + (Fintype.card (ZMod p)ˣ : ℝ) ≤ 3 / 2 := by + rw [hU, hsum] + apply (div_le_iff₀ (by linarith : (0 : ℝ) < p - 1)).mpr + linarith + have h := splitTreeMoment_mean_le (fun x => ‖g x‖ ^ 2) (fun _ => sq_nonneg _) + (3 / 2) hE n plans + rw [binaryMomentBound_eq] at h + norm_num only [show (2 : ℝ) * (3 / 2) = 3 by norm_num] at h + exact h.trans (by have := pow_nonneg (by norm_num : (0 : ℝ) ≤ 3) (2 ^ n); linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/UniformPrimeProgressions.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/UniformPrimeProgressions.lean new file mode 100644 index 0000000000000000000000000000000000000000..0a646343bbca617e3cea3d9af9c27222bc4b98c9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/UniformPrimeProgressions.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.PageSelection +import OAI.NumberTheory.Ostmann.ZeroDensity.PrimeLogDensityBounds + +namespace OAI + +/-! # Uniform prime intervals with one retained Page character + +The second error below accounts for local exceptional zeros outside Page's +common region. This derives simultaneous compatibility across moduli from +the published zero uniqueness, rather than assuming compatibility of the +short-interval estimates. +-/ + +namespace Ostmann + +open MeasureTheory + +theorem PublishedProgressionInput.uniform_log_interval (P : PublishedProgressionInput) + {q Q a : ℕ} (hQ : 2 ≤ Q) (hq : 1 ≤ q) (hqQ : q ≤ Q) (ha : a.Coprime q) + {s t : ℝ} (hs : 1 ≤ s) (hst : s ≤ t) (hshort : t ≤ s + 1) : + |reciprocalPrimeInterval q a (Real.exp s) (Real.exp t) - + ∫ y in Set.Ioc s t, primeLogDensity (Nat.totient q) + (pageCoefficient (pageAtModulus q (selectedPageZero P Q)) a) + (pageBeta (pageAtModulus q (selectedPageZero P Q))) y| ≤ + 18 * P.errorConstant * Real.exp (-P.decay * Real.sqrt s) + + Real.exp (-P.kappa * s / Real.log (4 * (Q : ℝ))) := by + have hlocal := P.local_log_interval q a hq ha hs hst hshort + rcases localZero_selected_alternative P hQ hq hqQ with heq | ⟨e, he, hfar, hn⟩ + · rw [heq] at hlocal + exact hlocal.trans (le_add_of_nonneg_right (Real.exp_pos _).le) + · have hφ : (1 : ℝ) ≤ Nat.totient q := by + exact_mod_cast Nat.totient_pos.mpr (by omega : 0 < q) + have hlog : 0 < Real.log (4 * (Q : ℝ)) := by + apply Real.log_pos + have : (2 : ℝ) ≤ Q := by exact_mod_cast hQ + linarith + have hcorr := primeLogDensity_integral_correction_le (Nat.totient q) + (pageCoefficient (some e) a) e.beta (P.kappa / Real.log (4 * (Q : ℝ))) + hφ (pageCoefficient_abs_le_one _ _) (div_nonneg P.kappa_pos.le hlog.le) + hfar.le hs hst hshort + rw [he] at hlocal + rw [hn] + have htri := norm_sub_le_norm_sub_add_norm_sub + (reciprocalPrimeInterval q a (Real.exp s) (Real.exp t)) + (∫ y in Set.Ioc s t, primeLogDensity (Nat.totient q) + (pageCoefficient (some e) a) e.beta y) + (∫ y in Set.Ioc s t, primeLogDensity (Nat.totient q) 0 1 y) + simp only [Real.norm_eq_abs] at htri + have hbound := htri.trans (add_le_add hlocal hcorr) + have hexp : Real.exp (-(P.kappa / Real.log (4 * (Q : ℝ))) * s) = + Real.exp (-P.kappa * s / Real.log (4 * (Q : ℝ))) := by + congr 1 + ring + rw [hexp] at hbound + exact hbound + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/UnsignedPrimeMass.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/UnsignedPrimeMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..c20cc22ea27b60a107e2ee30d1c9a6ac00812b2d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/UnsignedPrimeMass.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.VonMangoldtPole +import OAI.NumberTheory.Ostmann.ZeroDensity.RealPrimeSeries + +namespace OAI + +/-! # The total logarithmic prime mass near one, from the proved zeta pole -/ + +namespace Ostmann + +open scoped BigOperators +open Complex LSeries + +noncomputable def unsignedPrimeTerm (s : ℝ) (n : ℕ) : ℝ := + if n.Prime then Real.log n / (n : ℝ) ^ s else 0 + +theorem unsignedPrimeTerm_nonneg (s : ℝ) (n : ℕ) : 0 ≤ unsignedPrimeTerm s n := by + unfold unsignedPrimeTerm + split_ifs with h + · exact div_nonneg (Real.log_nonneg (by exact_mod_cast h.one_lt.le)) + (Real.rpow_nonneg (Nat.cast_nonneg _) _) + · exact le_refl _ + +theorem unsignedPrimeTerm_eq_principal (s : ℝ) : + unsignedPrimeTerm s = realPrimeTerm (1 : DirichletCharacter ℝ 1) s := by + funext n + have hn : (n : ZMod 1) = 1 := Subsingleton.elim _ _ + simp only [unsignedPrimeTerm, realPrimeTerm, hn, map_one, one_mul] + +private theorem principal_logDerivative_eq (s : ℝ) (hs : 1 < s) : + deriv (DirichletCharacter.LFunction (1 : DirichletCharacter ℂ 1)) (s : ℂ) / + DirichletCharacter.LFunction (1 : DirichletCharacter ℂ 1) (s : ℂ) = + -LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ) := by + let χ : DirichletCharacter ℂ 1 := 1 + have hs' : 1 < (s : ℂ).re := hs + have he := χ.LSeries_twist_vonMangoldt_eq hs' + rw [← χ.deriv_LFunction_eq_deriv_LSeries hs', ← χ.LFunction_eq_LSeries hs'] at he + have hf : (fun n : ℕ => χ n * (ArithmeticFunction.vonMangoldt n : ℂ)) = + (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) := by + funext n + rw [Subsingleton.elim (n : ZMod 1) 1, map_one, one_mul] + change LSeries (fun n : ℕ => χ n * (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ) = _ at he + rw [hf] at he + simpa only [neg_div, neg_neg] using congrArg Neg.neg he.symm + +theorem exists_unsignedPrimeMass_error : + ∃ C : ℝ, 0 < C ∧ ∀ s : ℝ, 1 < s → s ≤ 2 → + Summable (unsignedPrimeTerm s) ∧ + |(∑' n, unsignedPrimeTerm s n) - 1 / (s - 1)| ≤ C := by + obtain ⟨Cp, hCp, hprime⟩ := exists_realPrimeSeries_error + obtain ⟨Cv, hCv, hvon⟩ := exists_vonMangoldt_pole_error + refine ⟨Cp + Cv, by positivity, ?_⟩ + intro s hs hs2 + have hc : (1 : DirichletCharacter ℝ 1).ringHomComp Complex.ofRealHom = + (1 : DirichletCharacter ℂ 1) := by + apply MulChar.ext + intro a + rw [Subsingleton.elim a 1, Units.val_one, map_one, map_one] + obtain ⟨hsum, hp⟩ := hprime 1 1 s hs + rw [hc, principal_logDerivative_eq s hs, Complex.neg_re, + ← unsignedPrimeTerm_eq_principal] at hp + have hv := (Complex.abs_re_le_norm _).trans (hvon s hs hs2) + simp only [Complex.sub_re, Complex.ofReal_re] at hv + refine ⟨by rwa [unsignedPrimeTerm_eq_principal], ?_⟩ + have he : (∑' n, unsignedPrimeTerm s n) - 1 / (s - 1) = + ((∑' n, unsignedPrimeTerm s n) - + (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ)).re) + + ((LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ)).re - 1 / (s - 1)) := by ring + rw [he] + exact (abs_add_le _ _).trans (add_le_add hp hv) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/UnsignedPrimeTail.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/UnsignedPrimeTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e5230ee3656b45e0d289077332ff7be76b838eb --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/UnsignedPrimeTail.lean @@ -0,0 +1,79 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.UnsignedPrimeMass + +namespace OAI + +/-! # A sufficient tail estimate from the prime mass at a smaller exponent -/ + +namespace Ostmann + +open scoped BigOperators Classical + +noncomputable def unsignedPrimeTail (Q : ℕ) (s : ℝ) (n : ℕ) : ℝ := + if Q < n then unsignedPrimeTerm s n else 0 + +theorem unsignedPrimeTail_nonneg (Q : ℕ) (s : ℝ) (n : ℕ) : + 0 ≤ unsignedPrimeTail Q s n := by + unfold unsignedPrimeTail + split_ifs + · exact unsignedPrimeTerm_nonneg s n + · exact le_refl _ + +theorem unsignedPrimeTail_pointwise (Q : ℕ) (s : ℝ) (hQ : 0 < Q) (hs : 1 < s) (n : ℕ) : + unsignedPrimeTail Q s n ≤ + (Q : ℝ) ^ (-(s - 1) / 2) * unsignedPrimeTerm ((s + 1) / 2) n := by + by_cases hnQ : Q < n + · rw [unsignedPrimeTail, ite_eq_left hnQ] + by_cases hp : n.Prime + · rw [unsignedPrimeTerm, unsignedPrimeTerm, ite_eq_left hp, ite_eq_left hp] + have hn : (0 : ℝ) < n := by exact_mod_cast hp.pos + have hq : (0 : ℝ) < Q := by exact_mod_cast hQ + have hlog : 0 ≤ Real.log n := Real.log_nonneg (by exact_mod_cast hp.one_lt.le) + have ha : 0 ≤ (s - 1) / 2 := by linarith + have hpow : (Q : ℝ) ^ ((s - 1) / 2) ≤ (n : ℝ) ^ ((s - 1) / 2) := + Real.rpow_le_rpow hq.le (by exact_mod_cast hnQ.le) ha + have heq : s = (s + 1) / 2 + (s - 1) / 2 := by ring + calc + Real.log n / (n : ℝ) ^ s = + (Real.log n / (n : ℝ) ^ ((s + 1) / 2)) / (n : ℝ) ^ ((s - 1) / 2) := by + conv_lhs => rw [heq, Real.rpow_add hn] + exact div_mul_eq_div_div _ _ _ + _ ≤ (Real.log n / (n : ℝ) ^ ((s + 1) / 2)) / (Q : ℝ) ^ ((s - 1) / 2) := + div_le_div_of_nonneg_left (div_nonneg hlog (Real.rpow_nonneg hn.le _)) + (Real.rpow_pos_of_pos hq _) hpow + _ = _ := by + rw [show -(s - 1) / 2 = -((s - 1) / 2) by ring, Real.rpow_neg hq.le] + ring + · simp only [unsignedPrimeTerm, ite_eq_right hp, mul_zero, le_refl] + · rw [unsignedPrimeTail, ite_eq_right hnQ] + exact mul_nonneg (Real.rpow_nonneg (Nat.cast_nonneg Q) _) (unsignedPrimeTerm_nonneg _ n) + +theorem exists_unsignedPrimeTail_bound : + ∃ C : ℝ, 0 < C ∧ ∀ (Q : ℕ) (s : ℝ), 0 < Q → 1 < s → s ≤ 2 → + Summable (unsignedPrimeTail Q s) ∧ + (∑' n, unsignedPrimeTail Q s n) ≤ + (Q : ℝ) ^ (-(s - 1) / 2) * (2 / (s - 1) + C) := by + obtain ⟨C, hC, hmass⟩ := exists_unsignedPrimeMass_error + refine ⟨C, hC, ?_⟩ + intro Q s hQ hs hs2 + have hs0 : 1 < (s + 1) / 2 := by linarith + have hs02 : (s + 1) / 2 ≤ 2 := by linarith + obtain ⟨hm, hb⟩ := hmass ((s + 1) / 2) hs0 hs02 + have hmaj := hm.mul_left ((Q : ℝ) ^ (-(s - 1) / 2)) + have htail : Summable (unsignedPrimeTail Q s) := + Summable.of_nonneg_of_le (unsignedPrimeTail_nonneg Q s) + (unsignedPrimeTail_pointwise Q s hQ hs) hmaj + refine ⟨htail, ?_⟩ + have htotal : (∑' n, unsignedPrimeTerm ((s + 1) / 2) n) ≤ 2 / (s - 1) + C := by + have hh := (abs_le.mp hb).2 + have hfrac : 1 / ((s + 1) / 2 - 1) = 2 / (s - 1) := by + rw [show (s + 1) / 2 - 1 = (s - 1) / 2 by ring, div_div_eq_mul_div] + norm_num + rw [hfrac] at hh + linarith + have ht := htail.tsum_le_tsum (unsignedPrimeTail_pointwise Q s hQ hs) hmaj + rw [hm.tsum_mul_left] at ht + exact ht.trans (mul_le_mul_of_nonneg_left htotal (Real.rpow_nonneg (Nat.cast_nonneg Q) _)) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/VaryingSampling.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/VaryingSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..50ab064586fbcbde6a5f51ec31c09688f2c03fda --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/VaryingSampling.lean @@ -0,0 +1,86 @@ +import OAI.NumberTheory.Ostmann.HybridSieve.SamplingLog +import OAI.NumberTheory.Ostmann.ZeroDensity.CoefficientEnergy + +namespace OAI + +noncomputable section +open scoped BigOperators +open Set +namespace Ostmann.ZeroDensity + +theorem exists_mollifier_varying_sampling_constant : + ∃ C : ℝ, 0 < C ∧ ∀ {ι : Type} [Fintype ι], + ∀ (U Q X N : ℕ) (σ H : ℝ) (character : ι → Ostmann.HybridSieve.PrimitiveFamily Q) + (β γ : ι → ℝ), + 0 < U → 0 < Q → 1 ≤ H → 0 ≤ σ → σ ≤ 1 → + (∀ j, β j ∈ Icc σ 1) → (∀ j, |γ j| ≤ H) → + (∀ j k, j ≠ k → character j = character k → 1 ≤ |γ j - γ k|) → + (∑ j, ‖finiteCharacterPolynomial (character j).2.val (mollifierCoefficient X N) + (Finset.Ioc U (2 * U)) ((β j : ℂ) + (γ j : ℂ) * Complex.I)‖ ^ 2) ≤ + C * ((U : ℝ) + (Q : ℝ) ^ 2 * H) * (1 + Real.log Q) * + (1 + Real.log (2 * U : ℝ)) ^ 7 * U * (U : ℝ) ^ (-2 * σ) := by + obtain ⟨C, hC, hsampling⟩ := + Ostmann.HybridSieve.exists_unweighted_character_polynomial_sampling_log_constant + refine ⟨6 * C, by positivity, ?_⟩ + intro ι _ U Q X N σ H character β γ hU hQ hH hσ hσ1 hβ hγ hsep + have hU1 : 1 ≤ U := hU + have hUR : (1 : ℝ) ≤ U := by exact_mod_cast hU + have hQl : 0 ≤ Real.log Q := Real.log_nonneg (by exact_mod_cast hQ) + have hl : 0 ≤ Real.log (2 * U : ℝ) := Real.log_nonneg (by linarith) + let A : ℝ := C * ((U : ℝ) + (Q : ℝ) ^ 2 * H) * (1 + Real.log Q) * + (1 + Real.log (2 * U : ℝ)) ^ 2 + let E : ℝ := 2 * U * (1 + Real.log (2 * U : ℝ)) ^ 3 * (U : ℝ) ^ (-2 * σ) + have hA : 0 ≤ A := by dsimp [A]; positivity + have hE : 0 ≤ E := by dsimp [E]; positivity + have horder (k : ℕ) (u : ℝ) (hu : u ∈ Icc σ 1) : + (∑ j, ‖finiteCharacterPolynomial (character j).2.val + (logPowerCoefficients k (mollifierCoefficient X N)) + (Finset.Ioc U (2 * U)) ((u : ℂ) + (γ j : ℂ) * Complex.I)‖ ^ 2) ≤ + A * ((Real.log (2 * U : ℝ)) ^ (2 * k) * E) := by + have he := mollifier_logPower_dyadic_energy_le X N k (hσ.trans hu.1) hU1 + have hp : (U : ℝ) ^ (-2 * u) ≤ (U : ℝ) ^ (-2 * σ) := + Real.rpow_le_rpow_of_exponent_le hUR (by linarith [hu.1]) + have he' : (∑ n ∈ Finset.Ioc U (2 * U), + ‖logPowerCoefficients k (mollifierCoefficient X N) n‖ ^ 2 * + (n : ℝ) ^ (-2 * u)) ≤ (Real.log (2 * U : ℝ)) ^ (2 * k) * E := by + apply he.trans + dsimp [E] + gcongr + exact (hsampling U Q _ u H character γ hU hQ hH hγ hsep).trans + (mul_le_mul_of_nonneg_left he' hA) + let f : ι → ℝ → ℂ := fun j u => + finiteCharacterPolynomial (character j).2.val (mollifierCoefficient X N) + (Finset.Ioc U (2 * U)) ((u : ℂ) + (γ j : ℂ) * Complex.I) + let g : ι → ℝ → ℂ := fun j u => + finiteCharacterPolynomial (character j).2.val + (logDerivativeCoefficients (mollifierCoefficient X N)) + (Finset.Ioc U (2 * U)) ((u : ℂ) + (γ j : ℂ) * Complex.I) + have hpos : ∀ n ∈ Finset.Ioc U (2 * U), 0 < n := by + intro n hn + exact hU.trans (Finset.mem_Ioc.mp hn).1 + have hcoeff : logPowerCoefficients 1 (mollifierCoefficient X N) = + logDerivativeCoefficients (mollifierCoefficient X N) := by + funext n + simp only [logPowerCoefficients, logDerivativeCoefficients, pow_one] + have hv := sum_norm_sq_varying_parameter_le_of_uniform Finset.univ f g β hσ1 + (by linarith : 1 - σ ≤ 1) (mul_nonneg hA hE) + (mul_nonneg hA (mul_nonneg (sq_nonneg (Real.log (2 * U : ℝ))) hE)) (by simpa using hβ) + (fun j _ => finite_polynomial_beta_continuous _ _ _ hpos _) + (fun j _ => finite_polynomial_beta_continuous _ _ _ hpos _) + (fun j _ u => finite_polynomial_beta_derivative _ _ _ hpos _ u) + (fun u hu => by simpa [f] using horder 0 u hu) + (fun u hu => by simpa only [g, hcoeff, Nat.mul_one] using horder 1 u hu) + change (∑ j, ‖f j (β j)‖ ^ 2) ≤ _ + calc + _ ≤ 2 * (A * E) + A * ((Real.log (2 * U : ℝ)) ^ 2 * E) := hv + _ ≤ 3 * (1 + Real.log (2 * U : ℝ)) ^ 2 * (A * E) := by + have hf : 2 + (Real.log (2 * U : ℝ)) ^ 2 ≤ + 3 * (1 + Real.log (2 * U : ℝ)) ^ 2 := by nlinarith + nlinarith [mul_le_mul_of_nonneg_right hf (mul_nonneg hA hE)] + _ = _ := by dsimp [A, E]; ring + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/VonMangoldtLogarithmicBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/VonMangoldtLogarithmicBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf16820096a5b9a3841f590f82ae173e0ed3097d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/VonMangoldtLogarithmicBound.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaLocalLogDerivative +import OAI.NumberTheory.Ostmann.ZeroDensity.ShiftedRealHadamard + +namespace OAI + +/-! # The zeta-pole upper bound with logarithmic dependence on height -/ + +namespace Ostmann + +open Complex + +theorem regularizedZeta_logDeriv_lower (s : ℂ) (hs : 1 < s.re) (hs2 : s.re ≤ 2) : + -(logDeriv regularizedZeta s).re ≤ + 48 * (Real.log (96 * (|s.im| + 2) ^ 2) + + (Real.log (96 * (|s.im| + 2) ^ 2) / Real.log (7 / 6)) * Real.log 6 + 1) := by + have hh := zetaAtHeight_logDeriv_lower s.im s.re hs hs2 + have hcomp : logDeriv (zetaAtHeight s.im) ((s.re - 2 : ℝ) : ℂ) = + logDeriv regularizedZeta s := by + change logDeriv (regularizedZeta ∘ (fun z : ℂ => z + characterZeroCenter s.im)) _ = _ + rw [logDeriv_comp (g := fun z : ℂ => z + characterZeroCenter s.im) + (regularizedZeta_analytic _).differentiableAt + (differentiableAt_id.add_const _)] + have he : ((s.re - 2 : ℝ) : ℂ) + characterZeroCenter s.im = s := by + apply Complex.ext <;> simp [characterZeroCenter] + convert congrArg (logDeriv regularizedZeta) he using 1 + simp + rwa [hcomp] at hh + +theorem exists_regularizedZeta_log_bound : ∃ C : ℝ, 0 < C ∧ + ∀ s : ℂ, 1 < s.re → s.re ≤ 2 → + -(logDeriv regularizedZeta s).re ≤ C * Real.log (|s.im| + 2) := by + let D := 1 + Real.log 6 / Real.log (7 / 6 : ℝ) + let E := Real.log 96 / Real.log 2 + 2 + have h2 : 0 < Real.log (2 : ℝ) := Real.log_pos (by norm_num) + have h6 : 0 < Real.log (6 : ℝ) := Real.log_pos (by norm_num) + have h76 : 0 < Real.log (7 / 6 : ℝ) := Real.log_pos (by norm_num) + have h96 : 0 < Real.log (96 : ℝ) := Real.log_pos (by norm_num) + have hD : 0 < D := by dsimp [D]; positivity + have hE : 0 < E := by dsimp [E]; positivity + refine ⟨48 * (D * E + 1 / Real.log 2), by positivity, ?_⟩ + intro s hs hs2 + let L := Real.log (|s.im| + 2) + have hL : Real.log 2 ≤ L := Real.log_le_log (by norm_num) + (show (2 : ℝ) ≤ |s.im| + 2 by linarith [abs_nonneg s.im]) + have hone : 1 ≤ (1 / Real.log 2) * L := by + rw [one_div, inv_mul_eq_div] + exact (le_div_iff₀ h2).mpr (by simpa using hL) + have hconst : Real.log 96 ≤ (Real.log 96 / Real.log 2) * L := by + have hh := mul_le_mul_of_nonneg_left hone h96.le + convert hh using 1 <;> ring + have hlog : Real.log (96 * (|s.im| + 2) ^ 2) = Real.log 96 + 2 * L := by + rw [Real.log_mul (by norm_num) (by positivity), Real.log_pow] + rfl + have he : Real.log (96 * (|s.im| + 2) ^ 2) ≤ E * L := by + rw [hlog] + dsimp [E] + nlinarith + have hh := regularizedZeta_logDeriv_lower s hs hs2 + have hm := mul_le_mul_of_nonneg_left he hD.le + have hform : Real.log (96 * (|s.im| + 2) ^ 2) + + (Real.log (96 * (|s.im| + 2) ^ 2) / Real.log (7 / 6)) * Real.log 6 = + D * Real.log (96 * (|s.im| + 2) ^ 2) := by dsimp [D]; ring + rw [hform] at hh + change _ ≤ 48 * (D * E + 1 / Real.log 2) * L + nlinarith + +/-- Uniform zeta-pole estimate, without any zero-free-region assumption. -/ +theorem exists_vonMangoldt_logarithmic_upper : ∃ C : ℝ, 0 < C ∧ + ∀ s : ℂ, 1 < s.re → s.re ≤ 2 → + (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) s).re ≤ + realZeroKernel (s.re - 1) s.im + C * Real.log (|s.im| + 2) := by + obtain ⟨C, hC, hb⟩ := exists_regularizedZeta_log_bound + refine ⟨C, hC, ?_⟩ + intro s hs hs2 + have hh := hb s hs hs2 + rw [regularizedZeta_logDeriv s hs, Complex.add_re] at hh + have he := ArithmeticFunction.LSeries_vonMangoldt_eq_deriv_riemannZeta_div hs + change LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) s = _ at he + rw [he, neg_div, Complex.neg_re] + have hk : ((s - 1)⁻¹).re = realZeroKernel (s.re - 1) s.im := by + simpa using realZeroKernel_complex_sub s 1 + rw [hk] at hh + simp only [logDeriv_apply] at hh + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/VonMangoldtPole.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/VonMangoldtPole.lean new file mode 100644 index 0000000000000000000000000000000000000000..84dc44014d94cc0aa46afe7b0d1f7dc8a456a101 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/VonMangoldtPole.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.DirichletLogDerivativeBound + +namespace OAI + +/-! # The bounded remainder at the pole of the von Mangoldt series -/ + +namespace Ostmann + +open scoped BigOperators ComplexOrder +open Complex LSeries + +theorem exists_vonMangoldt_pole_error : + ∃ C : ℝ, 0 < C ∧ ∀ s : ℝ, 1 < s → s ≤ 2 → + ‖LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ) - + (1 / (s - 1) : ℝ)‖ ≤ C := by + let F := ArithmeticFunction.vonMangoldt.LFunctionResidueClassAux (0 : ZMod 1) + have hcont : ContinuousOn (fun s : ℝ => F (s : ℂ)) (Set.Icc 1 2) := by + apply ArithmeticFunction.vonMangoldt.continuousOn_LFunctionResidueClassAux (0 : ZMod 1) |>.comp + Complex.continuous_ofReal.continuousOn + intro s hs + exact hs.1 + obtain ⟨M, hM⟩ := isCompact_Icc.exists_bound_of_continuousOn hcont + refine ⟨|M| + 1, by positivity, ?_⟩ + intro s hs hs2 + have hunit : IsUnit (0 : ZMod 1) := by + rw [Subsingleton.elim (0 : ZMod 1) 1] + exact isUnit_one + have heq := ArithmeticFunction.vonMangoldt.eqOn_LFunctionResidueClassAux hunit + (show (s : ℂ) ∈ {z : ℂ | 1 < z.re} by exact hs) + rw [residue_one_eq_vonMangoldt] at heq + simp only [Nat.totient_one, Nat.cast_one, inv_one] at heq + have he : LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ) - + (1 / (s - 1) : ℝ) = F (s : ℂ) := by + change F (s : ℂ) = _ at heq + rw [heq] + push_cast + ring + rw [he] + have hb := hM s ⟨hs.le, hs2⟩ + linarith [le_abs_self M] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedPowers.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedPowers.lean new file mode 100644 index 0000000000000000000000000000000000000000..23aac1e5f3286846ee5d049d28e77539492971e8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedPowers.lean @@ -0,0 +1,49 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.OccurrenceSum +import OAI.NumberTheory.Ostmann.ZeroDensity.ZeroFreeWeights + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +theorem exists_unconditional_zero_power_constants : + ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ ∀ (Q H : ℕ) + (exception : Option (PrimitiveFamily Q)) (X : ℝ), + 0 < Q → 0 < H → 1 < X → + 2*(10*Real.log ((Q^2*H : ℕ) : ℝ)) ≤ Real.log X → + (∑ z ∈ retainedZeros Q exception (1/2) (H : ℝ), X^z.point.re) ≤ + X*(⌊Real.log X/2⌋₊+1 : ℝ)*(C*(1+Real.log (Q*H : ℕ))^11)* + Real.exp (1-Real.log X*(c/Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q (H : ℝ))/2) := by + obtain ⟨c,C,hc,hC,hweighted⟩ := exists_unconditional_weighted_zero_constants + refine ⟨c,C,hc,hC,?_⟩ + intro Q H exception X hQ hH hX hscale + have hXp : 0 < X := by linarith + have hw := hweighted Q H exception (Real.log X) hQ hH (Real.log_pos hX) hscale + have he (z : ZeroOccurrence Q (H : ℝ)) : + X^z.point.re = X*Real.exp (-Real.log X*(1-z.point.re)) := by + rw [Real.rpow_def_of_pos hXp] + calc + Real.exp (Real.log X*z.point.re) = + Real.exp (Real.log X)*Real.exp (-Real.log X*(1-z.point.re)) := by + rw [← Real.exp_add] + congr 1 + ring + _ = _ := by rw [Real.exp_log hXp] + simp_rw [he] + rw [← Finset.mul_sum] + calc + _ ≤ X*((⌊Real.log X/2⌋₊+1 : ℝ)*(C*(1+Real.log (Q*H : ℕ))^11)* + Real.exp (1-Real.log X*(c/Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q (H : ℝ))/2)) := + mul_le_mul_of_nonneg_left hw hXp.le + _ = _ := by ring + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedProgressionRates.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedProgressionRates.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b0becc803e305781d38dd31ef436bb6631e5116 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedProgressionRates.lean @@ -0,0 +1,82 @@ +import OAI.NumberTheory.Ostmann.Arithmetic.ContinuousPrimeComparison +import OAI.NumberTheory.Ostmann.ZeroDensity.ProgressionErrorRates + +namespace OAI + +/-! # Numerical error budgets for the weighted giant comparison -/ + +namespace Ostmann +open Filter + +/-- The explicit published-input error bound itself has the required uniform +rate, before a continuous weight or residue-cell count is inserted. -/ +theorem PublishedProgressionInput.log_interval_budget_rate (P : PublishedProgressionInput) + (a₀ μ δ : ℝ) (hδa : δ < a₀ / 2) (hδμ : δ < a₀ - μ) + (ha : 0 < a₀) (haμ : 0 < a₀ - μ) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 2 ≤ Q → + Real.log (4 * (Q : ℝ)) ≤ 2 * Real.exp (μ * L) → + ∀ u : ℝ, Real.exp (a₀ * L) ≤ u → + 18 * P.errorConstant * Real.exp (-P.decay * Real.sqrt u) + + Real.exp (-P.kappa * u / Real.log (4 * (Q : ℝ))) ≤ + 2 * Real.exp (-Real.exp (δ * L)) := by + filter_upwards [constant_mul_double_exp_le (18 * P.errorConstant) P.decay (a₀ / 2) δ + (mul_nonneg (by norm_num) P.errorConstant_nonneg) P.decay_pos (by positivity) hδa, + constant_mul_double_exp_le 1 (P.kappa / 2) (a₀ - μ) δ (by norm_num) + (div_pos P.kappa_pos (by norm_num)) haμ hδμ] with L htheta hpage + intro Q hQ hH u hu + have hlog : 0 < Real.log (4 * (Q : ℝ)) := by + apply Real.log_pos + have : (2 : ℝ) ≤ Q := by exact_mod_cast hQ + linarith + have ht : 18 * P.errorConstant * Real.exp (-P.decay * Real.sqrt u) ≤ + Real.exp (-Real.exp (δ * L)) := by + apply le_trans _ htheta + apply mul_le_mul_of_nonneg_left _ (mul_nonneg (by norm_num) P.errorConstant_nonneg) + apply Real.exp_le_exp.mpr + nlinarith [sqrt_ge_log_scale hu, P.decay_pos] + have hp : Real.exp (-P.kappa * u / Real.log (4 * (Q : ℝ))) ≤ + Real.exp (-Real.exp (δ * L)) := by + apply le_trans _ (by simpa only [one_mul] using hpage) + apply Real.exp_le_exp.mpr + have hg := page_gap_ge_log_scale P.kappa a₀ μ L (Real.log (4 * (Q : ℝ))) u + P.kappa_pos.le hlog hH hu + simpa only [neg_mul, neg_div] using neg_le_neg hg + linarith + +/-- The giant row of Section 8.2 absorbs all fixed-depth variation, +normalization and residue-count costs. The threshold precedes every modulus, +endpoint and weight budget. -/ +theorem PublishedProgressionInput.weighted_giant_budget_rate (P : PublishedProgressionInput) + (C : ℝ) (d : ℕ) : + ∀ᶠ L : ℝ in atTop, ∀ Q : ℕ, 2 ≤ Q → + Real.log (4 * (Q : ℝ)) ≤ 2 * Real.exp ((12 / 1000 : ℝ) * L) → + ∀ u V : ℝ, Real.exp ((49 / 1000 : ℝ) * L) ≤ u → + V ≤ Real.exp (C * L ^ d + C * L * Real.exp ((12 / 1000 : ℝ) * L)) → + V * (18 * P.errorConstant * Real.exp (-P.decay * Real.sqrt u) + + Real.exp (-P.kappa * u / Real.log (4 * (Q : ℝ)))) ≤ + Real.exp (-Real.exp ((13 / 1000 : ℝ) * L)) := by + filter_upwards [P.log_interval_budget_rate (49 / 1000) (12 / 1000) (18 / 1000) + (by norm_num) (by norm_num) (by norm_num) (by norm_num), + arithmetic_error_absorption (12 / 1000) (18 / 1000) (14 / 1000) C 1 d + (by norm_num) (by norm_num) (by norm_num) (by norm_num), + constant_mul_double_exp_le 2 1 (14 / 1000) (13 / 1000) + (by norm_num) (by norm_num) (by norm_num) (by norm_num)] with L hE hcost htwo + intro Q hQ hlog u V hu hV + have hnonneg : 0 ≤ 18 * P.errorConstant * Real.exp (-P.decay * Real.sqrt u) + + Real.exp (-P.kappa * u / Real.log (4 * (Q : ℝ))) := + add_nonneg (mul_nonneg (mul_nonneg (by norm_num) P.errorConstant_nonneg) + (Real.exp_pos _).le) (Real.exp_pos _).le + calc + _ ≤ Real.exp (C * L ^ d + C * L * Real.exp ((12 / 1000 : ℝ) * L)) * + (2 * Real.exp (-Real.exp ((18 / 1000 : ℝ) * L))) := + mul_le_mul hV (hE Q hQ hlog u hu) hnonneg (Real.exp_pos _).le + _ = 2 * (Real.exp (C * L ^ d + C * L * Real.exp ((12 / 1000 : ℝ) * L)) * + Real.exp (-Real.exp ((18 / 1000 : ℝ) * L))) := by ring + _ ≤ 2 * Real.exp (-Real.exp ((14 / 1000 : ℝ) * L)) := by + apply mul_le_mul_of_nonneg_left _ (by norm_num) + simpa only [neg_mul, one_mul] using hcost + _ ≤ _ := by simpa only [neg_mul, one_mul] using htwo + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedRieszRectangle.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedRieszRectangle.lean new file mode 100644 index 0000000000000000000000000000000000000000..216a01fa7c8274c32b3c5f822d9b085b12a159e8 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedRieszRectangle.lean @@ -0,0 +1,95 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszLeftEstimate +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszHorizontalEstimate + +namespace OAI + +/-! # Weighted Riesz edge bounds and a retained residue -/ + +namespace Ostmann + +open Complex MeasureTheory Set +open scoped Interval + +theorem weightedRiesz_left_segment_bound : ∃ K : ℝ, 0 < K ∧ + ∀ (f : ℂ → ℂ) (X a T M : ℝ), 0 < X → 1 / 2 ≤ a → 0 ≤ M → + (∀ t ∈ Icc (-T) T, ‖f (rieszMellinLine a t)‖ ≤ M) → + ‖∫ t in Icc (-T) T, f (rieszMellinLine a t) * rieszVerticalWeight X a t‖ ≤ K * M * X ^ a := by + let J := ∫ t : ℝ, rieszLineMajorant t + have hJ : 0 ≤ J := integral_nonneg rieszLineMajorant_nonneg + refine ⟨J + 1, by linarith, ?_⟩ + intro f X a T M hX ha hM hb + have hg : Integrable (fun t : ℝ => (M * X ^ a) * rieszLineMajorant t) := + rieszLineMajorant_integrable.const_mul _ + have hnorm : ‖∫ t in Icc (-T) T, f (rieszMellinLine a t) * rieszVerticalWeight X a t‖ ≤ + ∫ t in Icc (-T) T, (M * X ^ a) * rieszLineMajorant t := by + apply norm_integral_le_of_norm_le hg.integrableOn + filter_upwards [ae_restrict_mem measurableSet_Icc] with t ht + have hk := rieszMellinKernel_half_strip (rieszMellinLine a t) (by simpa using ha) + simp only [rieszMellinLine, Complex.add_im, Complex.ofReal_im, Complex.mul_im, + Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, + zero_add] at hk + rw [norm_mul, rieszVerticalWeight_norm X a t hX] + have hh := mul_le_mul (hb t ht) (mul_le_mul_of_nonneg_left hk (Real.rpow_nonneg hX.le a)) + (by positivity) hM + exact hh.trans_eq (by ring) + have hfull := setIntegral_le_integral hg + (Filter.Eventually.of_forall (fun t => mul_nonneg (by positivity) (rieszLineMajorant_nonneg t))) + (s := Icc (-T) T) + simp only [integral_const_mul] at hnorm hfull + apply (hnorm.trans hfull).trans + dsimp only [J] at hJ ⊢ + nlinarith [mul_nonneg hM (Real.rpow_nonneg hX.le a)] + +theorem weightedRiesz_horizontal_segment_bound (f : ℂ → ℂ) + (X a b t M : ℝ) (hX : 1 ≤ X) (hab : a ≤ b) (ht : 0 < |t|) (hM : 0 ≤ M) + (hb : ∀ σ ∈ Icc a b, ‖f ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M) : + ‖∫ σ in a..b, f ((σ : ℂ) + (t : ℂ) * I) * + rieszContourWeight X ((σ : ℂ) + (t : ℂ) * I)‖ ≤ + (M * X ^ b / t ^ 2) * (b - a) := by + have hXp : 0 < X := by linarith + have hpoint : ∀ σ ∈ Ι a b, + ‖f ((σ : ℂ) + (t : ℂ) * I) * + rieszContourWeight X ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M * X ^ b / t ^ 2 := by + intro σ hσ + have hσ' : σ ∈ Icc a b := by + have hh := uIoc_subset_uIcc hσ + rwa [uIcc_of_le hab] at hh + have hk := rieszMellinKernel_im_bound ((σ : ℂ) + (t : ℂ) * I) (by simpa using ht) + simp only [Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, + Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, zero_add, sq_abs] at hk + have hx : X ^ σ ≤ X ^ b := Real.rpow_le_rpow_of_exponent_le hX hσ'.2 + rw [norm_mul, rieszContourWeight, norm_mul, + Complex.norm_cpow_eq_rpow_re_of_pos hXp] + simp only [Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, + mul_zero, Complex.ofReal_im, Complex.I_im, zero_mul, sub_zero, add_zero] + have hh := mul_le_mul (hb σ hσ') (mul_le_mul hx hk (norm_nonneg _) (Real.rpow_nonneg hXp.le _)) + (by positivity) hM + exact hh.trans_eq (by ring) + have hi := intervalIntegral.norm_integral_le_of_norm_le_const hpoint + simpa only [abs_of_nonneg (sub_nonneg.mpr hab)] using hi + +theorem rectangle_vertical_shift_residue_norm_bound (f : ℂ → ℂ) (a b c d : ℝ) + (z : ℂ) (hzero : rectangleBoundaryIntegral f a b c d = I * z) : + ‖(∫ y in c..d, f ((b : ℂ) + (y : ℂ) * I)) - z‖ ≤ + ‖∫ y in c..d, f ((a : ℂ) + (y : ℂ) * I)‖ + + ‖∫ x in a..b, f ((x : ℂ) + (d : ℂ) * I)‖ + + ‖∫ x in a..b, f ((x : ℂ) + (c : ℂ) * I)‖ := by + let R := ∫ y in c..d, f ((b : ℂ) + (y : ℂ) * I) + let L := ∫ y in c..d, f ((a : ℂ) + (y : ℂ) * I) + let U := ∫ x in a..b, f ((x : ℂ) + (d : ℂ) * I) + let D := ∫ x in a..b, f ((x : ℂ) + (c : ℂ) * I) + have he : I * (R - z) = I * L + U - D := by + dsimp [rectangleBoundaryIntegral] at hzero + dsimp [R, L, U, D] + linear_combination hzero + change ‖R - z‖ ≤ ‖L‖ + ‖U‖ + ‖D‖ + calc + ‖R - z‖ = ‖I * (R - z)‖ := by rw [norm_mul, Complex.norm_I, one_mul] + _ = ‖I * L + U - D‖ := by rw [he] + _ ≤ ‖I * L + U‖ + ‖D‖ := norm_sub_le _ _ + _ ≤ (‖I * L‖ + ‖U‖) + ‖D‖ := add_le_add (norm_add_le _ _) le_rfl + _ = _ := by rw [norm_mul, Complex.norm_I, one_mul] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedRieszTails.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedRieszTails.lean new file mode 100644 index 0000000000000000000000000000000000000000..2063c3650ec74d5fa98f5f51d20e9428981dd929 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedRieszTails.lean @@ -0,0 +1,66 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.WeightedRieszRectangle +import OAI.NumberTheory.Ostmann.ZeroDensity.RieszNegativeTail + +namespace OAI + +/-! # Both tails for a bounded vertical coefficient in the Riesz integral -/ + +namespace Ostmann + +open Complex MeasureTheory Set + +theorem inverse_square_tail_bound (f : ℝ → ℂ) (K T : ℝ) (hT : 0 < T) + (hb : ∀ t > T, ‖f t‖ ≤ K / t ^ 2) : + ‖∫ t in Ioi T, f t‖ ≤ K / T := by + have hg : IntegrableOn (fun t : ℝ => K * t ^ (-(2 : ℝ))) (Ioi T) := + (integrableOn_Ioi_rpow_of_lt (by norm_num) hT).const_mul K + have hn : ‖∫ t in Ioi T, f t‖ ≤ ∫ t in Ioi T, K * t ^ (-(2 : ℝ)) := by + apply norm_integral_le_of_norm_le hg + filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht + have hp : 0 < t := hT.trans ht + simpa only [Real.rpow_neg hp.le, Real.rpow_two, div_eq_mul_inv] using hb t ht + apply hn.trans_eq + rw [integral_const_mul, integral_Ioi_rpow_of_lt (by norm_num : -(2 : ℝ) < -1) hT] + norm_num only [neg_add_cancel_left, neg_div_neg_eq, div_one, Real.rpow_neg_one] + ring + +theorem weightedRiesz_integrable (f : ℂ → ℂ) (X b M : ℝ) (hX : 0 < X) (hb : 1 ≤ b) + (hc : Continuous (fun t : ℝ => f (rieszMellinLine b t))) + (hbound : ∀ t : ℝ, ‖f (rieszMellinLine b t)‖ ≤ M) : + Integrable (fun t => f (rieszMellinLine b t) * rieszVerticalWeight X b t) := by + apply ((rieszVerticalWeight_integrable X b hX hb).norm.const_mul M).mono' + ((hc.mul (rieszVerticalWeight_continuous X b hX (by linarith))).aestronglyMeasurable) + filter_upwards with t + rw [Pi.mul_apply, norm_mul] + exact mul_le_mul_of_nonneg_right (hbound t) (norm_nonneg _) + +theorem weightedRiesz_both_tails (f : ℂ → ℂ) (X b M T : ℝ) + (hX : 0 < X) (hM : 0 ≤ M) (hT : 0 < T) + (hbound : ∀ t : ℝ, ‖f (rieszMellinLine b t)‖ ≤ M) : + ‖∫ t in Ioi T, f (rieszMellinLine b t) * rieszVerticalWeight X b t‖ ≤ M * X ^ b / T ∧ + ‖∫ t in Iic (-T), f (rieszMellinLine b t) * rieszVerticalWeight X b t‖ ≤ M * X ^ b / T := by + have hpoint (t : ℝ) (ht : t ≠ 0) : + ‖f (rieszMellinLine b t) * rieszVerticalWeight X b t‖ ≤ M * X ^ b / t ^ 2 := by + have hi : 0 < |(rieszMellinLine b t).im| := by + simpa [rieszMellinLine] using abs_pos.mpr ht + have hk := rieszMellinKernel_im_bound (rieszMellinLine b t) hi + simp only [rieszMellinLine, Complex.add_im, Complex.ofReal_im, Complex.mul_im, + Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, + zero_add, sq_abs] at hk + rw [norm_mul, rieszVerticalWeight_norm X b t hX] + calc + _ ≤ M * (X ^ b * (1 / t ^ 2)) := + mul_le_mul (hbound t) (mul_le_mul_of_nonneg_left hk (Real.rpow_nonneg hX.le _)) + (by positivity) hM + _ = _ := by ring + constructor + · exact inverse_square_tail_bound _ (M * X ^ b) T hT + (fun t ht => hpoint t (ne_of_gt (hT.trans ht))) + · rw [← integral_comp_neg_Ioi T (fun t => f (rieszMellinLine b t) * rieszVerticalWeight X b t)] + apply inverse_square_tail_bound _ (M * X ^ b) T hT + intro t ht + simpa only [neg_sq] using hpoint (-t) (neg_ne_zero.mpr (ne_of_gt (hT.trans ht))) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedSmoothCharacterMean.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedSmoothCharacterMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa6a6896ae6559dccd296f0ddac0385cdefdcafa --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedSmoothCharacterMean.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.SmoothPrincipalMean +import OAI.NumberTheory.Ostmann.Characters.SparseConductorCutoff + +namespace OAI + +/-! # Weighted smooth character means at the actual truncation cutoff -/ +namespace Ostmann +open Filter +open scoped Classical BigOperators + +/-- A finite coefficient bound costs no factor equal to the number of characters. -/ +theorem weighted_smooth_character_error (F : Finset PrimitiveComplexCharacter) + (c : PrimitiveComplexCharacter → ℂ) (c₀ : ℂ) (B X : ℝ) + (hc₀ : ‖c₀‖ ≤ B) (hc : ∀ χ ∈ F, ‖c χ‖ ≤ B) : + ‖c₀ * smoothMangoldtMean 1 1 X + + ∑ χ ∈ F, c χ * smoothMangoldtMean χ.modulus χ.character X - + c₀ * smoothPrincipalMain X‖ ≤ + B * (smoothPrincipalError X + + ∑ χ ∈ F, ‖smoothMangoldtMean χ.modulus χ.character X‖) := by + have he : c₀ * smoothMangoldtMean 1 1 X + + ∑ χ ∈ F, c χ * smoothMangoldtMean χ.modulus χ.character X - + c₀ * smoothPrincipalMain X = + c₀ * (smoothMangoldtMean 1 1 X - smoothPrincipalMain X) + + ∑ χ ∈ F, c χ * smoothMangoldtMean χ.modulus χ.character X := by ring + rw [he] + calc + _ ≤ ‖c₀ * (smoothMangoldtMean 1 1 X - smoothPrincipalMain X)‖ + + ∑ χ ∈ F, ‖c χ * smoothMangoldtMean χ.modulus χ.character X‖ := + (norm_add_le _ _).trans (add_le_add_right (norm_sum_le _ _) _) + _ ≤ B * smoothPrincipalError X + + ∑ χ ∈ F, B * ‖smoothMangoldtMean χ.modulus χ.character X‖ := by + simp only [norm_mul, smoothPrincipalError] + gcongr + exact hc _ (by assumption) + _ = _ := by rw [← Finset.mul_sum, mul_add] + +theorem weighted_sparse_character_decay (Z : ∀ χ, ComplexZeroEnumeration χ) + (hD : PublishedComplexZeroDensity Z) (hR : PublishedComplexZeroRegion Z) + (P : PublishedSmoothExplicitFormula Z) (hPNT : PublishedSmoothPrincipalPNT) + (C A D : ℝ) (hC : 0 < C) : + ∀ᶠ L : ℝ in atTop, ∃ exception : Option PrimitiveComplexCharacter, + ∀ (F : Finset PrimitiveComplexCharacter) (c : PrimitiveComplexCharacter → ℂ) (c₀ : ℂ), + (∀ χ ∈ F, χ.modulus ≤ sparseConductorCutoff C L) → + (∀ χ ∈ F, some χ ≠ exception) → ‖c₀‖ ≤ Real.exp (A * L) → + (∀ χ ∈ F, ‖c χ‖ ≤ Real.exp (A * L)) → + ‖c₀ * smoothMangoldtMean 1 1 (Real.exp (Real.exp L)) + + ∑ χ ∈ F, c χ * smoothMangoldtMean χ.modulus χ.character (Real.exp (Real.exp L)) - + c₀ * smoothPrincipalMain (Real.exp (Real.exp L))‖ ≤ + Real.exp (Real.exp L) * Real.exp (-D * L) := by + filter_upwards [smooth_primitive_family_decay Z hD hR P hPNT (2 * C + 3) (D + A) + (by linarith), eventual_sparseConductorCutoff C hC] with L hmean hcut + obtain ⟨exception, hmean⟩ := hmean (sparseConductorCutoff C L) hcut.1 hcut.2.1 hcut.2.2 + refine ⟨exception, ?_⟩ + intro F c c₀ hF hFE hc₀ hc + have hh := weighted_smooth_character_error F c c₀ (Real.exp (A * L)) + (Real.exp (Real.exp L)) hc₀ hc + calc + _ ≤ _ := hh + _ ≤ Real.exp (A * L) * (Real.exp (Real.exp L) * Real.exp (-(D + A) * L)) := + mul_le_mul_of_nonneg_left (hmean F hF hFE) (Real.exp_nonneg _) + _ = _ := by + rw [mul_left_comm (Real.exp (A * L)), ← Real.exp_add] + congr 2 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb320e212f598c72e6656dbe80b6fb3718b3f350 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/WeightedZeros.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.Density + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +theorem exists_actual_zero_density_exponential_constant : + ∃ C : ℝ, 0 < C ∧ ∀ (Q H : ℕ) (exception : Option (PrimitiveFamily Q)) (y : ℝ), + 0 < Q → 0 < H → 0 ≤ y → y ≤ 1/2 → + (totalZeroCount Q exception (1-y) (H : ℝ) : ℝ) ≤ + (C*(1+Real.log (Q*H : ℕ))^11) * + Real.exp ((10*Real.log ((Q^2*H : ℕ) : ℝ))*y) := by + obtain ⟨C,hC,hdensity⟩ := exists_actual_zero_density_constant + refine ⟨C,hC,?_⟩ + intro Q H exception y hQ hH hy hy1 + have hp : (0 : ℝ) < (Q^2*H : ℕ) := by exact_mod_cast (by positivity : 0 < Q^2*H) + have hd := hdensity Q H exception (1-y) hQ hH (by linarith) (by linarith) + rw [Real.rpow_def_of_pos hp] at hd + have he : Real.log ((Q^2*H : ℕ) : ℝ)*(10*(1-(1-y))) = + (10*Real.log ((Q^2*H : ℕ) : ℝ))*y := by ring + rw [he] at hd + convert hd using 1 + ring + +theorem exists_actual_weighted_zero_constant : + ∃ C : ℝ, 0 < C ∧ ∀ (Q H : ℕ) (exception : Option (PrimitiveFamily Q)) (M u : ℝ), + 0 < Q → 0 < H → 0 < M → 0 ≤ u → u ≤ 1/2 → + 2*(10*Real.log ((Q^2*H : ℕ) : ℝ)) ≤ M → + (∀ z ∈ retainedZeros Q exception (1/2) (H : ℝ), u ≤ 1-z.point.re) → + (∑ z ∈ retainedZeros Q exception (1/2) (H : ℝ), + Real.exp (-M*(1-z.point.re))) ≤ + (⌊M/2⌋₊+1 : ℝ)*(C*(1+Real.log (Q*H : ℕ))^11)*Real.exp (1-M*u/2) := by + obtain ⟨C,hC,hcum⟩ := exists_actual_zero_density_exponential_constant + refine ⟨C,hC,?_⟩ + intro Q H exception M u hQ hH hM hu hu1 hscale hstrip + have hbase : (1 : ℝ) ≤ (Q^2*H : ℕ) := by + have hp : 0 < Q^2*H := by positivity + exact_mod_cast hp + have hlog : 0 ≤ Real.log ((Q^2*H : ℕ) : ℝ) := Real.log_nonneg hbase + have hlogQH : 0 ≤ Real.log (Q*H : ℕ) := by + apply Real.log_nonneg + have hp : 0 < Q*H := by positivity + exact_mod_cast hp + apply actual_zero_density_exp_sum_le Q exception hM (by positivity) (by positivity) + hscale hu1 hstrip + intro y hy + exact hcum Q H exception y hQ hH (hu.trans hy.1) hy.2 + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZeroFreeNumerics.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZeroFreeNumerics.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b37d398e18328c658d65b8d6be7410d1b0517ea --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZeroFreeNumerics.lean @@ -0,0 +1,38 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RealZeroKernel + +namespace OAI + +/-! # Concrete kernel comparisons for the low-height zero-free region -/ + +namespace Ostmann + +theorem real_zero_near_mass (δ a y : ℝ) (hδ : 0 < δ) (ha : δ ≤ a) + (ha' : a ≤ (21 / 20) * δ) (hy : |y| ≤ δ / 2) : + 7 / 10 ≤ δ * realZeroKernel a y := by + have ha0 : 0 < a := hδ.trans_le ha + have hden : 0 < a ^ 2 + y ^ 2 := by positivity + have hasq : a ^ 2 ≤ ((21 / 20) * δ) ^ 2 := by nlinarith + have hysq : y ^ 2 ≤ (δ / 2) ^ 2 := by + nlinarith [sq_abs y, abs_nonneg y] + have had : δ ^ 2 ≤ δ * a := by nlinarith + unfold realZeroKernel + rw [← mul_div_assoc, le_div_iff₀ hden] + nlinarith [sq_pos_of_pos hδ] + +theorem real_zero_double_height_mass (δ t : ℝ) (hδ : 0 < δ) (ht : δ / 2 ≤ |t|) : + δ * realZeroKernel δ (2 * t) ≤ 1 / 2 := by + have hden : 0 < δ ^ 2 + (2 * t) ^ 2 := by positivity + have htsq : δ ^ 2 / 4 ≤ t ^ 2 := by nlinarith [sq_abs t] + unfold realZeroKernel + rw [← mul_div_assoc, div_le_iff₀ hden] + nlinarith + +theorem real_zero_shifted_mass (δ a : ℝ) (hδ : 0 < δ) (ha : δ ≤ a) + (ha' : a ≤ (21 / 20) * δ) : 18 / 5 < δ * (4 / a) := by + have ha0 : 0 < a := hδ.trans_le ha + rw [← mul_div_assoc, lt_div_iff₀ ha0] + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZeroFreeWeights.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZeroFreeWeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..7cda2fcc2b417ed6285711378dee93e16aa18bbd --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZeroFreeWeights.lean @@ -0,0 +1,74 @@ +import OAI.NumberTheory.Ostmann.Dirichlet.LogZeroFree +import OAI.NumberTheory.Ostmann.ZeroDensity.WeightedZeros + +namespace OAI + +open _root_.Erdos970 _root_.OAI.Erdos970 + +open Erdos970.Erdos970Dependency.SiegelWalfisz + +noncomputable section +open scoped BigOperators +namespace Ostmann.ZeroDensity + +theorem exists_actual_zero_gap_constant : + ∃ c : ℝ, 0 < c ∧ c ≤ 1/4 ∧ ∀ (Q H : ℕ), 0 < Q → 0 < H → + ∀ z : ZeroOccurrence Q (H : ℝ), + c/Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q (H : ℝ) ≤ 1-z.point.re := by + obtain ⟨c0,hc0,hregion⟩ := Ostmann.Dirichlet.exists_nonprincipal_log_zero_free_region + let c := min c0 (1/4) + have hc : 0 < c := lt_min hc0 (by norm_num) + have hcc : c ≤ c0 := min_le_left _ _ + refine ⟨c,hc,min_le_right _ _,?_⟩ + intro Q H hQ hH z + let : NeZero Q := ⟨by omega⟩ + let q : ℕ := z.1.1.1.val+1 + have hqQ : q ≤ Q := by have ht := z.1.1.1.isLt; dsimp [q]; omega + have hqp : (0 : ℝ) < q := by dsimp [q]; positivity + have hglobal : Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight q z.point.im ≤ + Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q (H : ℝ) := by + unfold Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight + apply add_le_add + · exact Real.log_le_log hqp (by exact_mod_cast hqQ) + · apply Real.log_le_log (by positivity) + rw [abs_of_nonneg (show (0 : ℝ) ≤ (H : ℝ) from Nat.cast_nonneg H)] + have ht : |z.point.im| ≤ (H : ℝ) := z.2.1.property.2 + linarith + have hlocalpos : 0 < Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight q z.point.im := + lt_of_lt_of_le zero_lt_one (Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight_ge_one q z.point.im) + have hglobalpos : 0 < Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q (H : ℝ) := + lt_of_lt_of_le zero_lt_one (Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight_ge_one Q (H : ℝ)) + have hgap : c0/Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight q z.point.im < 1-z.point.re := by + by_contra! hh + exact hregion q z.1.1.2.val z.1.property z.point (by linarith) z.isNontrivialZero.1 + exact ((div_le_div_of_nonneg_right hcc hglobalpos.le).trans + (div_le_div_of_nonneg_left hc0.le hlocalpos hglobal)).trans hgap.le + +theorem exists_unconditional_weighted_zero_constants : + ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ ∀ (Q H : ℕ) + (exception : Option (PrimitiveFamily Q)) (M : ℝ), + 0 < Q → 0 < H → 0 < M → + 2*(10*Real.log ((Q^2*H : ℕ) : ℝ)) ≤ M → + (∑ z ∈ retainedZeros Q exception (1/2) (H : ℝ), + Real.exp (-M*(1-z.point.re))) ≤ + (⌊M/2⌋₊+1 : ℝ)*(C*(1+Real.log (Q*H : ℕ))^11)* + Real.exp (1-M*(c/Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q (H : ℝ))/2) := by + obtain ⟨c,hc,hc4,hgap⟩ := exists_actual_zero_gap_constant + obtain ⟨C,hC,hweighted⟩ := exists_actual_weighted_zero_constant + refine ⟨c,C,hc,hC,?_⟩ + intro Q H exception M hQ hH hM hscale + let : NeZero Q := ⟨by omega⟩ + have hheight := Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight_ge_one Q (H : ℝ) + have hheightpos : 0 < Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q (H : ℝ) := by linarith + refine hweighted Q H exception M (c/Erdos970.Erdos970Dependency.SiegelWalfisz.modulusHeight Q (H : ℝ)) + hQ hH hM (div_nonneg hc.le hheightpos.le) ?_ hscale ?_ + · apply (div_le_iff₀ hheightpos).mpr + linarith + · intro z hz + exact hgap Q H hQ hH z + +end Ostmann.ZeroDensity + +end + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZeroVariableHistory.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZeroVariableHistory.lean new file mode 100644 index 0000000000000000000000000000000000000000..5163ce90570e58d91993dca48a3df63b149e0d92 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZeroVariableHistory.lean @@ -0,0 +1,108 @@ +import Mathlib.Algebra.MvPolynomial.Monad +import OAI.NumberTheory.Ostmann.Construction.HistoryResidueGate +import OAI.NumberTheory.Ostmann.Arithmetic.SampledPrimeCoincidence + +namespace OAI + +/-! # Removing reconstructed-pivot coprimalities to actual prime slots -/ + +namespace Ostmann + +open scoped BigOperators Classical + +noncomputable def zeroHistoryVariable {σ : Type*} (i : σ) : + MvPolynomial σ ℤ →ₐ[ℤ] MvPolynomial σ ℤ := + MvPolynomial.bind₁ (fun j => if j = i then 0 else MvPolynomial.X j) + +theorem zeroHistoryVariable_absent {σ : Type*} (i : σ) (P : MvPolynomial σ ℤ) : + i ∉ (zeroHistoryVariable i P).vars := by + intro h + obtain ⟨j, _, hj⟩ := MvPolynomial.mem_vars_bind₁ _ P h + by_cases hji : j = i <;> simp_all + +theorem zeroHistoryVariable_eval {σ : Type*} (i : σ) (P : MvPolynomial σ ℤ) (x : σ → ℤ) : + MvPolynomial.eval₂Hom (RingHom.id ℤ) x (zeroHistoryVariable i P) = + MvPolynomial.eval₂Hom (RingHom.id ℤ) (Function.update x i 0) P := by + rw [zeroHistoryVariable, MvPolynomial.hom_bind₁, MvPolynomial.eval₂Hom_comp_C] + congr 1 + congr 1 + funext j + by_cases hji : j = i <;> simp [hji, Function.update] + +theorem zeroHistoryVariable_degree {σ : Type*} (i : σ) (P : MvPolynomial σ ℤ) : + (zeroHistoryVariable i P).totalDegree ≤ P.totalDegree := by + let v : σ → MvPolynomial σ ℤ := fun j => if j = i then 0 else MvPolynomial.X j + have hv (j : σ) : (v j).totalDegree ≤ 1 := by + dsimp only [v] + split_ifs <;> simp + have hs : zeroHistoryVariable i P = + ∑ d ∈ P.support, zeroHistoryVariable i (MvPolynomial.monomial d (P.coeff d)) := by + rw [← map_sum] + exact congrArg (zeroHistoryVariable i) P.as_sum + rw [hs] + apply MvPolynomial.totalDegree_finsetSum_le + intro d hd + have hp : (d.prod fun j k => v j ^ k).totalDegree ≤ d.sum (fun _ k => k) := by + change (∏ j ∈ d.support, v j ^ d j).totalDegree ≤ ∑ j ∈ d.support, d j + refine (MvPolynomial.totalDegree_finsetProd _ _).trans ?_ + apply Finset.sum_le_sum + intro j _ + exact ((MvPolynomial.totalDegree_pow _ _).trans + (Nat.mul_le_mul_left (d j) (hv j))).trans_eq (Nat.mul_one _) + simp only [zeroHistoryVariable, MvPolynomial.bind₁_monomial] + change (MvPolynomial.C (P.coeff d) * d.prod (fun j k => v j ^ k)).totalDegree ≤ _ + exact (MvPolynomial.totalDegree_mul _ _).trans (by + simpa only [MvPolynomial.totalDegree_C, zero_add] using hp.trans (MvPolynomial.le_totalDegree hd)) + +/-- Divisibility by the sampled prime is unchanged on setting that variable +to zero in the cleared numerator. -/ +theorem zeroHistoryVariable_dvd_iff {σ : Type*} (i : σ) (P : MvPolynomial σ ℤ) + (x : σ → ℤ) (p : ℕ) (hxi : x i = p) : + p ∣ (MvPolynomial.eval₂Hom (RingHom.id ℤ) x P).natAbs ↔ + p ∣ (MvPolynomial.eval₂Hom (RingHom.id ℤ) x (zeroHistoryVariable i P)).natAbs := by + rw [← Int.natCast_dvd, ← Int.natCast_dvd, zeroHistoryVariable_eval] + apply Int.ModEq.dvd_iff + apply integerPolynomial_eval_modEq + intro j + by_cases hji : j = i + · subst j + simp only [Function.update_self, hxi] + exact Int.modEq_zero_iff_dvd.mpr (dvd_refl _) + · simp [Function.update, hji] + +theorem zeroHistoryVariable_identically_bad {σ : Type*} (i : σ) (P : MvPolynomial σ ℤ) + (hP : zeroHistoryVariable i P = 0) (x : σ → ℤ) (p : ℕ) (hxi : x i = p) : + p ∣ (MvPolynomial.eval₂Hom (RingHom.id ℤ) x P).natAbs := by + rw [zeroHistoryVariable_dvd_iff i P x p hxi, hP, map_zero, Int.natAbs_zero] + exact dvd_zero p + +theorem reconstructed_prime_coprimality_error {A : Type*} [Fintype A] [Nonempty A] + {n : ℕ} (prime : A → ℕ) (hpInj : Function.Injective prime) (hprime : ∀ a, (prime a).Prime) + (P : MvPolynomial (Fin (n + 1)) ℤ) (i : Fin (n + 1)) + (hP : zeroHistoryVariable i P ≠ 0) + (μ : Fin (n + 1) → A → ℝ) (hμ : ∀ j a, 0 ≤ μ j a) (hmass : ∀ j, ∑ a, μ j a = 1) + (α β V H : ℝ) (hα : 0 ≤ α) (hβ : 0 ≤ β) (hV : 0 < V) (hH : 1 ≤ H) + (hmax : ∀ j a, μ j a ≤ α) (hpmax : ∀ a, μ i a ≤ β) + (hsize : ∀ a, V ≤ Real.log (prime a : ℝ)) + (hvalue : ∀ x, |(integerTestValue (fun a => (prime a : ℤ)) (zeroHistoryVariable i P) x : ℝ)| ≤ H) : + (∑ x, productPrior μ x * + if prime (x i) ∣ (integerTestValue (fun a => (prime a : ℤ)) P x).natAbs then 1 else 0) ≤ + (P.totalDegree : ℝ) * α + (Real.log H / V) * β := by + have hinj : Function.Injective (fun a => (prime a : ℤ)) := by + intro a b h + exact hpInj (Int.natCast_inj.mp h) + have he (x : Fin (n + 1) → A) : + prime (x i) ∣ (integerTestValue (fun a => (prime a : ℤ)) P x).natAbs ↔ + prime (x i) ∣ (integerTestValue (fun a => (prime a : ℤ)) (zeroHistoryVariable i P) x).natAbs := + zeroHistoryVariable_dvd_iff i P (fun j => (prime (x j) : ℤ)) (prime (x i)) rfl + simp_rw [he] + apply (sampled_coordinate_prime_coincidence_le (fun a => (prime a : ℤ)) hinj prime hpInj hprime + (zeroHistoryVariable i P) hP i (zeroHistoryVariable_absent i P) + μ hμ hmass α β V H hα hβ hV hH hmax hpmax (fun a _ => hsize a) hvalue).trans + have hd : ((zeroHistoryVariable i P).totalDegree : ℝ) ≤ P.totalDegree := by + exact_mod_cast zeroHistoryVariable_degree i P + exact add_le_add (mul_le_mul_of_nonneg_right hd hα) le_rfl + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaAbsoluteRightBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaAbsoluteRightBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b1f60e325c4e841ff0eb4bd7a348ea96c47b37b --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaAbsoluteRightBound.lean @@ -0,0 +1,40 @@ +import OAI.NumberTheory.Ostmann.Characters.CharacterAbsoluteRightBound + +namespace OAI + +/-! # Absolute zeta logarithmic-derivative control on right vertical lines -/ + +namespace Ostmann + +open Complex LSeries +open scoped ComplexOrder + +theorem zeta_logDeriv_right_pole_bound : ∃ C : ℝ, 0 < C ∧ + ∀ s : ℂ, 1 < s.re → s.re ≤ 2 → ‖logDeriv riemannZeta s‖ ≤ 1 / (s.re - 1) + C := by + obtain ⟨C, hC, hb⟩ := exists_vonMangoldt_series_bound + refine ⟨C, hC, ?_⟩ + intro s hs hs2 + let a : ℕ → ℂ := fun n => (ArithmeticFunction.vonMangoldt n : ℂ) + have ha : LSeriesSummable a (s.re : ℂ) := ArithmeticFunction.LSeriesSummable_vonMangoldt hs + have ht : LSeriesSummable a s := ArithmeticFunction.LSeriesSummable_vonMangoldt hs + have hn (n : ℕ) : ‖LSeries.term a s n‖ = ‖LSeries.term a (s.re : ℂ) n‖ := by + simp only [LSeries.norm_term_eq, Complex.ofReal_re] + have hr (n : ℕ) : ‖LSeries.term a (s.re : ℂ) n‖ = (LSeries.term a (s.re : ℂ) n).re := by + have hp : (0 : ℂ) ≤ a n := by + change (0 : ℂ) ≤ (ArithmeticFunction.vonMangoldt n : ℂ) + exact_mod_cast ArithmeticFunction.vonMangoldt_nonneg (n := n) + have hh := congrArg Complex.re (Complex.eq_coe_norm_of_nonneg (LSeries.term_nonneg hp s.re)) + simpa only [Complex.ofReal_re] using hh.symm + have he := ArithmeticFunction.LSeries_vonMangoldt_eq_deriv_riemannZeta_div hs + change LSeries a s = _ at he + calc + _ = ‖LSeries a s‖ := by rw [he, logDeriv_apply, neg_div, norm_neg] + _ ≤ ∑' n, ‖LSeries.term a s n‖ := norm_tsum_le_tsum_norm ht.norm + _ = ∑' n, ‖LSeries.term a (s.re : ℂ) n‖ := tsum_congr hn + _ = (LSeries a (s.re : ℂ)).re := by simp_rw [hr]; exact (Complex.re_tsum ha).symm + _ ≤ ‖LSeries a (s.re : ℂ)‖ := Complex.re_le_norm _ + _ ≤ _ := hb s.re hs hs2 + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaDiskBounds.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaDiskBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..87502c4a771308357e5326fbbf5abb32b0a435c5 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaDiskBounds.lean @@ -0,0 +1,61 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.RegularizedZeta +import OAI.NumberTheory.Ostmann.ZeroDensity.CharacterLocalZeroCount + +namespace OAI + +/-! # Polynomial bounds for the pole-removed zeta function on right-half-plane disks -/ + +namespace Ostmann + +open Complex Metric Set + +theorem riemannZeta_lower_re_two (s : ℂ) (hs : s.re = 2) : + 1 / 3 ≤ ‖riemannZeta s‖ := by + let f : ℕ → ℂ := fun n => (ArithmeticFunction.moebius n : ℂ) + have hf (n : ℕ) (_hn : n ≠ 0) : ‖f n‖ ≤ 1 := by + dsimp [f] + norm_cast + exact ArithmeticFunction.abs_moebius_le_one + have hb := lSeries_norm_bound_re_two f hf s hs + have he : riemannZeta s * LSeries f s = 1 := by + rw [← ArithmeticFunction.LSeries_zeta_eq_riemannZeta (by rw [hs]; norm_num)] + exact ArithmeticFunction.LSeries_zeta_mul_Lseries_moebius (by rw [hs]; norm_num) + have hn := congrArg norm he + rw [norm_mul, norm_one] at hn + have hpi : Real.pi ^ 2 / 6 ≤ 3 := by + nlinarith [Real.pi_lt_four, Real.pi_pos] + have hm := mul_le_mul_of_nonneg_left (hb.trans hpi) (norm_nonneg (riemannZeta s)) + rw [hn] at hm + linarith + +theorem regularizedZeta_lower_center (t : ℝ) : + 1 / 3 ≤ ‖regularizedZeta (characterZeroCenter t)‖ := by + have hne : characterZeroCenter t ≠ 1 := by + intro he + have hh := congrArg Complex.re he + simp at hh + have hlo := riemannZeta_lower_re_two (characterZeroCenter t) (characterZeroCenter_re t) + have hnorm : 1 ≤ ‖characterZeroCenter t - 1‖ := by + have hh := Complex.re_le_norm (characterZeroCenter t - 1) + norm_num only [Complex.sub_re, characterZeroCenter_re, Complex.one_re, Nat.reduceSub, + show (2 : ℝ) - 1 = 1 by norm_num] at hh + exact hh + rw [regularizedZeta_eq _ hne, norm_mul] + nlinarith [norm_nonneg (riemannZeta (characterZeroCenter t))] + +theorem regularizedZeta_disk_bound (t : ℝ) (z : ℂ) + (hz : z ∈ closedBall (characterZeroCenter t) (7 / 4 : ℝ)) : + ‖regularizedZeta z‖ ≤ 32 * (|t| + 2) ^ 2 := by + have hbound := regularizedZeta_norm_bound z (character_disk_re t z hz) + have hn := character_disk_norm t z hz + have hsub : ‖z - 1‖ ≤ |t| + 5 := by + have hh := norm_sub_le z 1 + rw [norm_one] at hh + linarith + have hprod : ‖z - 1‖ * ‖z‖ ≤ (|t| + 5) * (|t| + 4) := + mul_le_mul hsub hn (norm_nonneg _) (by positivity) + nlinarith [abs_nonneg t, sq_nonneg t] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaDiskQuotient.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaDiskQuotient.lean new file mode 100644 index 0000000000000000000000000000000000000000..153876d0606c6d2d27fc4c0ac5094e0fe28532f7 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaDiskQuotient.lean @@ -0,0 +1,94 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaDiskZeros +import OAI.NumberTheory.Ostmann.ZeroDensity.SmallDiskLogDerivative +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteZeroPolynomialLogDerivative +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteZeroQuotientDisk + +namespace OAI + +/-! # Removing the actual local zeta zeros, with a logarithmic error -/ + +namespace Ostmann + +open Complex Metric Set +open scoped BigOperators + +theorem zeta_disk_quotient_exists (t : ℝ) : + ∃ g : ℂ → ℂ, (∀ z, AnalyticAt ℂ g z) ∧ + (∀ z, zetaAtHeight t z = finiteZeroPolynomial (zetaAtHeight t) (zetaDiskZeros t) z * g z) ∧ + (∀ z ∈ closedBall 0 (3 / 2 : ℝ), g z ≠ 0) := by + obtain ⟨g, hg, he, hne⟩ := remove_finite_analytic_zeros (zetaAtHeight t) + (zetaAtHeight_analytic t) (zetaAtHeight_order_ne_top t) (zetaDiskZeros t) + refine ⟨g, hg, he, ?_⟩ + intro z hz + by_cases hS : z ∈ zetaDiskZeros t + · exact hne z hS + · intro hzero + apply hS + apply (mem_zetaDiskZeros t z).mpr + exact ⟨by simpa using hz, by rw [he, hzero, mul_zero]⟩ + +theorem zeta_disk_quotient_bound (t M : ℝ) (hM : 32 * (|t| + 2) ^ 2 ≤ M) + (g : ℂ → ℂ) (hg : ∀ z, AnalyticAt ℂ g z) + (he : ∀ z, zetaAtHeight t z = finiteZeroPolynomial (zetaAtHeight t) (zetaDiskZeros t) z * g z) + (z : ℂ) (hz : ‖z‖ ≤ 7 / 4) : + ‖g z‖ ≤ M * 4 ^ (∑ w ∈ zetaDiskZeros t, analyticOrderNatAt (zetaAtHeight t) w) := by + let N := ∑ w ∈ zetaDiskZeros t, analyticOrderNatAt (zetaAtHeight t) w + have hb : ∀ u ∈ sphere (0 : ℂ) (7 / 4), ‖g u‖ ≤ M * 4 ^ N := by + intro u hu + have hnu : ‖u‖ = 7 / 4 := by simpa using hu + have hp : (1 / 4 : ℝ) ^ N ≤ ‖finiteZeroPolynomial (zetaAtHeight t) (zetaDiskZeros t) u‖ := by + apply finiteZeroPolynomial_norm_ge _ _ _ _ (by norm_num) + intro w hw + have hnw := ((mem_zetaDiskZeros t w).mp hw).1 + have htri := norm_le_norm_sub_add u w + linarith + have hm := (zetaAtHeight_disk_bound t u hnu.le).trans hM + rw [he, norm_mul] at hm + have hprod := (mul_le_mul_of_nonneg_right hp (norm_nonneg (g u))).trans hm + have hh := (le_div_iff₀ (pow_pos (by norm_num : (0 : ℝ) < 1 / 4) N)).mpr + (by simpa only [mul_comm] using hprod) + simpa only [one_div, inv_pow, div_inv_eq_mul] using hh + apply Complex.norm_le_of_forall_mem_frontier_norm_le (U := ball (0 : ℂ) (7 / 4)) isBounded_ball + · exact DiffContOnCl.mk_ball (fun u _ => (hg u).differentiableAt.differentiableWithinAt) + (fun u _ => (hg u).continuousAt.continuousWithinAt) + · rw [frontier_ball (0 : ℂ) (by norm_num : (7 / 4 : ℝ) ≠ 0)] + exact hb + · simpa [closure_ball (0 : ℂ) (by norm_num : (7 / 4 : ℝ) ≠ 0)] using hz + +theorem zeta_disk_quotient_log_bound (t M : ℝ) (hM : 32 * (|t| + 2) ^ 2 ≤ M) + (g : ℂ → ℂ) (hg : ∀ z, AnalyticAt ℂ g z) + (he : ∀ z, zetaAtHeight t z = finiteZeroPolynomial (zetaAtHeight t) (zetaDiskZeros t) z * g z) + (hne : ∀ z ∈ closedBall 0 (3 / 2 : ℝ), g z ≠ 0) + (z : ℂ) (hz : ‖z‖ ≤ 3 / 2) : + Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ Real.log (3 * M) + + (∑ w ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) w : ℝ)) * Real.log 6 := by + let N := ∑ w ∈ zetaDiskZeros t, analyticOrderNatAt (zetaAtHeight t) w + have hMp : 0 < M := lt_of_lt_of_le (by positivity) hM + have hgc : 0 < ‖g 0‖ := norm_pos_iff.mpr (hne 0 (mem_closedBall_self (by norm_num))) + have hp : ‖finiteZeroPolynomial (zetaAtHeight t) (zetaDiskZeros t) 0‖ ≤ (3 / 2 : ℝ) ^ N := by + apply finiteZeroPolynomial_norm_le _ _ _ _ (by norm_num) + intro w hw + simpa only [zero_sub, norm_neg] using ((mem_zetaDiskZeros t w).mp hw).1 + have hlo : (1 / 3 : ℝ) ≤ (3 / 2 : ℝ) ^ N * ‖g 0‖ := by + have hh := zetaAtHeight_lower_zero t + rw [he, norm_mul] at hh + exact hh.trans (mul_le_mul_of_nonneg_right hp (norm_nonneg _)) + have hpow : (4 : ℝ) ^ N * (3 / 2 : ℝ) ^ N = 6 ^ N := by rw [← mul_pow]; norm_num + have hm : M * 4 ^ N ≤ 3 * M * 6 ^ N * ‖g 0‖ := by + calc + _ = (3 * M * 4 ^ N) * (1 / 3) := by ring + _ ≤ (3 * M * 4 ^ N) * ((3 / 2) ^ N * ‖g 0‖) := + mul_le_mul_of_nonneg_left hlo (by positivity) + _ = 3 * M * (4 ^ N * (3 / 2) ^ N) * ‖g 0‖ := by ring + _ = _ := by rw [hpow] + have hu := zeta_disk_quotient_bound t M hM g hg he z (by linarith) + have hratio : ‖g z‖ / ‖g 0‖ ≤ 3 * M * 6 ^ N := (div_le_iff₀ hgc).mpr (hu.trans hm) + have hgz : 0 < ‖g z‖ := norm_pos_iff.mpr (hne z (by simpa using hz)) + rw [← Real.log_div hgz.ne' hgc.ne'] + apply (Real.log_le_log (div_pos hgz hgc) hratio).trans_eq + rw [Real.log_mul (by positivity : 3 * M ≠ 0) (by positivity : (6 : ℝ) ^ N ≠ 0), Real.log_pow] + simp only [N, Nat.cast_sum] + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaDiskZeros.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaDiskZeros.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f2ed2aca911a5dff62f25bba2edea0cc2a683e9 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaDiskZeros.lean @@ -0,0 +1,108 @@ +import Mathlib.Analysis.Complex.JensenFormula +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaDiskBounds +import OAI.NumberTheory.Ostmann.ZeroDensity.FiniteAnalyticZeroFactors + +namespace OAI + +/-! # The actual finite zeta zero factors in a small right-half-plane disk -/ + +namespace Ostmann + +open Complex Filter Metric Set MeromorphicOn +open scoped Classical BigOperators + +noncomputable def zetaAtHeight (t : ℝ) (w : ℂ) : ℂ := + regularizedZeta (w + characterZeroCenter t) + +theorem zetaAtHeight_analytic (t : ℝ) (w : ℂ) : AnalyticAt ℂ (zetaAtHeight t) w := + (regularizedZeta_analytic _).comp (analyticAt_id.add analyticAt_const) + +theorem zetaAtHeight_lower_zero (t : ℝ) : 1 / 3 ≤ ‖zetaAtHeight t 0‖ := by + simpa [zetaAtHeight] using regularizedZeta_lower_center t + +theorem zetaAtHeight_order_ne_top (t : ℝ) (w : ℂ) : + analyticOrderAt (zetaAtHeight t) w ≠ ⊤ := by + intro he + have hz := (AnalyticOnNhd.analyticOrderAt_eq_top_iff_eq_zero w (zetaAtHeight_analytic t)).mp he + have hl := zetaAtHeight_lower_zero t + rw [hz] at hl + norm_num at hl + +noncomputable def zetaDiskDivisor (t : ℝ) := + divisor (zetaAtHeight t) (closedBall 0 (3 / 2 : ℝ)) + +noncomputable def zetaDiskZeros (t : ℝ) : Finset ℂ := + ((zetaDiskDivisor t).finiteSupport (isCompact_closedBall 0 (3 / 2 : ℝ))).toFinset + +theorem zetaDiskDivisor_eq (t : ℝ) (w : ℂ) (hw : ‖w‖ ≤ 3 / 2) : + zetaDiskDivisor t w = (analyticOrderNatAt (zetaAtHeight t) w : ℤ) := by + obtain ⟨n, hn⟩ := ENat.ne_top_iff_exists.mp (zetaAtHeight_order_ne_top t w) + rw [zetaDiskDivisor, AnalyticOnNhd.divisor_apply + (fun z _ => zetaAtHeight_analytic t z) (by simpa using hw)] + simp [analyticOrderNatAt, ← hn] + +theorem mem_zetaDiskZeros (t : ℝ) (w : ℂ) : + w ∈ zetaDiskZeros t ↔ ‖w‖ ≤ 3 / 2 ∧ zetaAtHeight t w = 0 := by + change w ∈ ((zetaDiskDivisor t).finiteSupport (isCompact_closedBall _ _)).toFinset ↔ _ + rw [Set.Finite.mem_toFinset] + change zetaDiskDivisor t w ≠ 0 ↔ _ + have hord : analyticOrderNatAt (zetaAtHeight t) w ≠ 0 ↔ zetaAtHeight t w = 0 := by + have hh := (zetaAtHeight_analytic t w).analyticOrderAt_ne_zero + rw [← Nat.cast_analyticOrderNatAt (zetaAtHeight_order_ne_top t w)] at hh + simpa only [Nat.cast_ne_zero] using hh + constructor + · intro hn + have hw : ‖w‖ ≤ 3 / 2 := by + simpa using (zetaDiskDivisor t).supportWithinDomain hn + exact ⟨hw, hord.mp (by simpa only [zetaDiskDivisor_eq t w hw, Int.natCast_ne_zero] using hn)⟩ + · rintro ⟨hw, hz⟩ + rw [zetaDiskDivisor_eq t w hw, Int.natCast_ne_zero] + exact hord.mpr hz + +theorem zetaAtHeight_disk_bound (t : ℝ) (w : ℂ) (hw : ‖w‖ ≤ 7 / 4) : + ‖zetaAtHeight t w‖ ≤ 32 * (|t| + 2) ^ 2 := by + apply regularizedZeta_disk_bound + simpa [dist_eq_norm] using hw + +theorem zetaDiskZeros_mass_bound (t : ℝ) : + (∑ w ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) w : ℝ)) ≤ + Real.log (96 * (|t| + 2) ^ 2) / Real.log (7 / 6) := by + let M := 32 * (|t| + 2) ^ 2 + have hM : 1 ≤ M := by dsimp [M]; nlinarith [abs_nonneg t, sq_nonneg (|t| + 2)] + have hlo := zetaAtHeight_lower_zero t + have hne : zetaAtHeight t 0 ≠ 0 := by intro he; rw [he, norm_zero] at hlo; linarith + have ha : AnalyticOnNhd ℂ (zetaAtHeight t) (closedBall 0 |(7 / 4 : ℝ)|) := + fun z _ => zetaAtHeight_analytic t z + have hj := ha.sum_divisor_le (r := (3 / 2 : ℝ)) (R := (7 / 4 : ℝ)) + (by norm_num) (by norm_num) hM hne (fun z hz => + zetaAtHeight_disk_bound t z (by + simpa only [mem_closedBall, dist_zero_right, abs_of_pos (by norm_num : (0 : ℝ) < 7 / 4)] + using sphere_subset_closedBall hz)) + have hratio : M / ‖zetaAtHeight t 0‖ ≤ 3 * M := by + apply (div_le_iff₀ (by linarith : 0 < ‖zetaAtHeight t 0‖)).mpr + nlinarith + have hlog := Real.log_le_log (div_pos (by linarith : 0 < M) (norm_pos_iff.mpr hne)) hratio + have hlogp : 0 < Real.log (7 / 6 : ℝ) := Real.log_pos (by norm_num) + have hmass : (∑ w ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) w : ℝ)) = + ((∑ᶠ w, zetaDiskDivisor t w : ℤ) : ℝ) := by + rw [finsum_eq_sum_of_support_subset (s := zetaDiskZeros t) _ (by + intro w hw + exact ((zetaDiskDivisor t).finiteSupport (isCompact_closedBall _ _)).mem_toFinset.mpr hw), + Int.cast_sum] + apply Finset.sum_congr rfl + intro w hw + rw [zetaDiskDivisor_eq t w ((mem_zetaDiskZeros t w).mp hw).1] + simp + rw [hmass] + change ((∑ᶠ w, divisor (zetaAtHeight t) (closedBall 0 (3 / 2 : ℝ)) w : ℤ) : ℝ) ≤ _ + rw [show |(3 / 2 : ℝ)| = 3 / 2 by norm_num, + show (7 / 4 : ℝ) / (3 / 2) = 7 / 6 by norm_num] at hj + apply hj.trans + convert div_le_div_of_nonneg_right hlog hlogp.le using 1 + dsimp [M] + congr 2 + ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaLocalFactorBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaLocalFactorBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d1b0b2adf1122341e83dcef8e847cf4d543ca8d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaLocalFactorBound.lean @@ -0,0 +1,99 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.VonMangoldtLogarithmicBound + +namespace OAI + +/-! # Keeping the actual local zeta factors in the logarithmic-derivative bound -/ + +namespace Ostmann + +open Complex Metric Set +open scoped BigOperators + +theorem zeta_local_log_budget : ∃ C : ℝ, 0 < C ∧ ∀ t : ℝ, + 352 * (Real.log (96 * (|t| + 2) ^ 2) + + (Real.log (96 * (|t| + 2) ^ 2) / Real.log (7 / 6)) * Real.log 6 + 1) ≤ + C * Real.log (|t| + 2) := by + let D := 1 + Real.log 6 / Real.log (7 / 6 : ℝ) + let E := Real.log 96 / Real.log 2 + 2 + have h2 : 0 < Real.log (2 : ℝ) := Real.log_pos (by norm_num) + have h6 : 0 < Real.log (6 : ℝ) := Real.log_pos (by norm_num) + have h76 : 0 < Real.log (7 / 6 : ℝ) := Real.log_pos (by norm_num) + have h96 : 0 < Real.log (96 : ℝ) := Real.log_pos (by norm_num) + have hD : 0 < D := by dsimp [D]; positivity + have hE : 0 < E := by dsimp [E]; positivity + refine ⟨352 * (D * E + 1 / Real.log 2), by positivity, ?_⟩ + intro t + let L := Real.log (|t| + 2) + have hL : Real.log 2 ≤ L := Real.log_le_log (by norm_num) + (show (2 : ℝ) ≤ |t| + 2 by linarith [abs_nonneg t]) + have hone : 1 ≤ (1 / Real.log 2) * L := by + rw [one_div, inv_mul_eq_div] + exact (le_div_iff₀ h2).mpr (by simpa using hL) + have hconst : Real.log 96 ≤ (Real.log 96 / Real.log 2) * L := by + have hh := mul_le_mul_of_nonneg_left hone h96.le + convert hh using 1 <;> ring + have hlog : Real.log (96 * (|t| + 2) ^ 2) = Real.log 96 + 2 * L := by + rw [Real.log_mul (by norm_num) (by positivity), Real.log_pow] + rfl + have he : Real.log (96 * (|t| + 2) ^ 2) ≤ E * L := by + rw [hlog] + dsimp [E] + nlinarith + have hm := mul_le_mul_of_nonneg_left he hD.le + have hform : Real.log (96 * (|t| + 2) ^ 2) + + (Real.log (96 * (|t| + 2) ^ 2) / Real.log (7 / 6)) * Real.log 6 = + D * Real.log (96 * (|t| + 2) ^ 2) := by dsimp [D]; ring + rw [hform] + change _ ≤ 352 * (D * E + 1 / Real.log 2) * L + nlinarith + +theorem zeta_local_factor_bound : ∃ C : ℝ, 0 < C ∧ ∀ (t : ℝ) (w : ℂ), + ‖w‖ ≤ 5 / 4 → zetaAtHeight t w ≠ 0 → + ‖logDeriv (zetaAtHeight t) w - + ∑ z ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) z : ℂ) / (w - z)‖ ≤ + C * Real.log (|t| + 2) := by + obtain ⟨C, hC, hbudget⟩ := zeta_local_log_budget + refine ⟨C, hC, ?_⟩ + intro t w hw hfne + obtain ⟨g, hg, he, hne⟩ := zeta_disk_quotient_exists t + let M := 32 * (|t| + 2) ^ 2 + let N := ∑ z ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) z : ℝ) + let A := Real.log (3 * M) + N * Real.log 6 + 1 + have hA : 0 < A := by + have hM : 1 ≤ M := by dsimp [M]; nlinarith [abs_nonneg t, sq_nonneg (|t| + 2)] + have hl : 0 ≤ Real.log (3 * M) := Real.log_nonneg (by linarith) + have hl6 : 0 ≤ Real.log (6 : ℝ) := Real.log_nonneg (by norm_num) + have hN : 0 ≤ N := Finset.sum_nonneg (fun _ _ => Nat.cast_nonneg _) + dsimp [A] + positivity + have hgb := logDeriv_norm_le_five_quarters_disk g A hA (fun z _ => hg z) + (fun z hz => hne z (ball_subset_closedBall hz)) (fun z hz => ?_) w hw + · have hwball : w ∈ closedBall 0 (3 / 2 : ℝ) := by + simpa using hw.trans (by norm_num : (5 / 4 : ℝ) ≤ 3 / 2) + have hwS : w ∉ zetaDiskZeros t := fun hh => hfne ((mem_zetaDiskZeros t w).mp hh).2 + have hsplit : logDeriv (zetaAtHeight t) w = + (∑ z ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) z : ℂ) / (w - z)) + + logDeriv g w := by + have hfun := funext he + conv_lhs => rw [hfun] + rw [logDeriv_fun_mul w (finiteZeroPolynomial_ne_zero _ _ w hwS) (hne w hwball) + (finiteZeroPolynomial_analytic _ _ w).differentiableAt (hg w).differentiableAt, + finiteZeroPolynomial_logDeriv _ _ w hwS] + rw [hsplit, add_sub_cancel_left] + have hmass := zetaDiskZeros_mass_bound t + have hprod := mul_le_mul_of_nonneg_right hmass (Real.log_nonneg (by norm_num : (1 : ℝ) ≤ 6)) + have hlog : Real.log (3 * M) = Real.log (96 * (|t| + 2) ^ 2) := by + congr 1 + dsimp [M] + ring + apply hgb.trans + apply le_trans _ (hbudget t) + dsimp [A, N] + rw [hlog] + linarith + · exact (zeta_disk_quotient_log_bound t M le_rfl g hg he hne z + (by simpa using (mem_ball_iff_norm.mp hz).le)).trans (by dsimp [A, N]; linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaLocalLogDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaLocalLogDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca907e2f22b2bfc3e88e963e1516d2fa1a1ee0c4 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaLocalLogDerivative.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaDiskQuotient + +namespace OAI + +/-! # A logarithmic error for the zeta pole throughout the right-hand strip -/ + +namespace Ostmann + +open Complex Metric Set +open scoped BigOperators + +theorem zetaAtHeight_zero_left (t : ℝ) (z : ℂ) (hz : zetaAtHeight t z = 0) : z.re < -1 := by + have hn : ¬ 1 ≤ (z + characterZeroCenter t).re := by + intro h + exact regularizedZeta_ne_zero_right _ h hz + simp only [Complex.add_re, characterZeroCenter_re] at hn + linarith + +theorem zetaAtHeight_logDeriv_lower (t σ : ℝ) (hσ : 1 < σ) (hσ2 : σ ≤ 2) : + -(logDeriv (zetaAtHeight t) ((σ - 2 : ℝ) : ℂ)).re ≤ + 48 * (Real.log (96 * (|t| + 2) ^ 2) + + (Real.log (96 * (|t| + 2) ^ 2) / Real.log (7 / 6)) * Real.log 6 + 1) := by + obtain ⟨g, hg, he, hne⟩ := zeta_disk_quotient_exists t + let M := 32 * (|t| + 2) ^ 2 + let N := ∑ z ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) z : ℝ) + let A := Real.log (3 * M) + N * Real.log 6 + 1 + let w : ℂ := ((σ - 2 : ℝ) : ℂ) + have hM : 1 ≤ M := by dsimp [M]; nlinarith [abs_nonneg t, sq_nonneg (|t| + 2)] + have hA : 0 < A := by + have hl : 0 ≤ Real.log (3 * M) := Real.log_nonneg (by linarith) + have hl6 : 0 ≤ Real.log (6 : ℝ) := Real.log_nonneg (by norm_num) + have hN : 0 ≤ N := Finset.sum_nonneg (fun _ _ => Nat.cast_nonneg _) + dsimp [A] + positivity + have hw : ‖w‖ ≤ 1 := by + change ‖((σ - 2 : ℝ) : ℂ)‖ ≤ 1 + rw [Complex.norm_real, Real.norm_eq_abs] + rw [abs_of_nonpos (by linarith)] + linarith + have hgb := logDeriv_norm_le_small_disk g A hA (fun z _ => hg z) + (fun z hz => hne z (ball_subset_closedBall hz)) (fun z hz => ?_) w hw + · have hwball : w ∈ closedBall 0 (3 / 2 : ℝ) := by + simpa using hw.trans (by norm_num : (1 : ℝ) ≤ 3 / 2) + have hfne : zetaAtHeight t w ≠ 0 := by + apply regularizedZeta_ne_zero_right + simp only [w, Complex.add_re, Complex.ofReal_re, characterZeroCenter_re] + linarith + have hwS : w ∉ zetaDiskZeros t := fun hh => hfne ((mem_zetaDiskZeros t w).mp hh).2 + have hsplit : logDeriv (zetaAtHeight t) w = + (∑ z ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) z : ℂ) / (w - z)) + + logDeriv g w := by + have hfun := funext he + conv_lhs => rw [hfun] + rw [logDeriv_fun_mul w (finiteZeroPolynomial_ne_zero _ _ w hwS) (hne w hwball) + (finiteZeroPolynomial_analytic _ _ w).differentiableAt (hg w).differentiableAt, + finiteZeroPolynomial_logDeriv _ _ w hwS] + have hsum : 0 ≤ (∑ z ∈ zetaDiskZeros t, + (analyticOrderNatAt (zetaAtHeight t) z : ℂ) / (w - z)).re := by + rw [Complex.re_sum] + apply Finset.sum_nonneg + intro z hz + have hzleft := zetaAtHeight_zero_left t z ((mem_zetaDiskZeros t z).mp hz).2 + have hd : 0 ≤ (w - z).re := by + simp only [Complex.sub_re, w, Complex.ofReal_re] + linarith + rw [div_eq_mul_inv, Complex.mul_re] + simp only [Complex.natCast_re, Complex.natCast_im, zero_mul, sub_zero] + exact mul_nonneg (Nat.cast_nonneg _) (by + rw [Complex.inv_re] + exact div_nonneg hd (Complex.normSq_nonneg _)) + have hre := Complex.re_le_norm (-logDeriv g w) + rw [Complex.neg_re, norm_neg] at hre + have hmass := zetaDiskZeros_mass_bound t + have hprod := mul_le_mul_of_nonneg_right hmass (Real.log_nonneg (by norm_num : (1 : ℝ) ≤ 6)) + have hlog : Real.log (3 * M) = Real.log (96 * (|t| + 2) ^ 2) := by + congr 1 + dsimp [M] + ring + rw [hsplit, Complex.add_re] + dsimp only [A, N] at hgb + rw [hlog] at hgb + linarith + · exact (zeta_disk_quotient_log_bound t M le_rfl g hg he hne z + (by simpa using (mem_ball_iff_norm.mp hz).le)).trans (by dsimp [A, N]; linarith) + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaLocalSeparation.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaLocalSeparation.lean new file mode 100644 index 0000000000000000000000000000000000000000..170db5ae382e2823c82a9d7cd240fc389acf410e --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaLocalSeparation.lean @@ -0,0 +1,71 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaLocalFactorBound + +namespace OAI + +/-! # Quantitative local zeta bounds away from its actual zeros -/ + +namespace Ostmann + +open Complex +open scoped BigOperators + +theorem zeta_local_mass_bound : ∃ D : ℝ, 0 < D ∧ ∀ t : ℝ, + (∑ z ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) z : ℝ)) ≤ + D * Real.log (|t| + 2) := by + let D := (Real.log 96 / Real.log 2 + 2) / Real.log (7 / 6) + have h2 : 0 < Real.log (2 : ℝ) := Real.log_pos (by norm_num) + have h96 : 0 < Real.log (96 : ℝ) := Real.log_pos (by norm_num) + have h76 : 0 < Real.log (7 / 6 : ℝ) := Real.log_pos (by norm_num) + refine ⟨D, by dsimp [D]; positivity, ?_⟩ + intro t + have hL : Real.log 2 ≤ Real.log (|t| + 2) := + Real.log_le_log (by norm_num) (by linarith [abs_nonneg t]) + have hconst : Real.log 96 ≤ (Real.log 96 / Real.log 2) * Real.log (|t| + 2) := by + have hm := mul_le_mul_of_nonneg_left hL (div_nonneg h96.le h2.le) + have he : (Real.log 96 / Real.log 2) * Real.log 2 = Real.log 96 := by field_simp + rwa [he] at hm + apply (zetaDiskZeros_mass_bound t).trans + have hlog : Real.log (96 * (|t| + 2) ^ 2) = Real.log 96 + 2 * Real.log (|t| + 2) := by + rw [Real.log_mul (by norm_num) (by positivity), Real.log_pow] + rfl + rw [hlog] + dsimp [D] + apply (div_le_iff₀ h76).mpr + have he : (Real.log 96 / Real.log 2 + 2) / Real.log (7 / 6) * + Real.log (|t| + 2) * Real.log (7 / 6) = + (Real.log 96 / Real.log 2 + 2) * Real.log (|t| + 2) := by field_simp + rw [he] + nlinarith + +theorem zeta_local_logDeriv_separated : ∃ C : ℝ, 0 < C ∧ + ∀ (t : ℝ) (w : ℂ) (δ : ℝ), ‖w‖ ≤ 5 / 4 → zetaAtHeight t w ≠ 0 → 0 < δ → + (∀ z ∈ zetaDiskZeros t, δ ≤ ‖w - z‖) → + ‖logDeriv (zetaAtHeight t) w‖ ≤ + C * Real.log (|t| + 2) * (1 + δ⁻¹) := by + obtain ⟨A, hA, ha⟩ := zeta_local_factor_bound + obtain ⟨D, hD, hd⟩ := zeta_local_mass_bound + refine ⟨A + D, by positivity, ?_⟩ + intro t w δ hw hne hδ hsep + have hsum : ‖∑ z ∈ zetaDiskZeros t, + (analyticOrderNatAt (zetaAtHeight t) z : ℂ) / (w - z)‖ ≤ + (∑ z ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) z : ℝ)) / δ := by + apply (norm_sum_le _ _).trans + rw [Finset.sum_div] + apply Finset.sum_le_sum + intro z hz + rw [norm_div, Complex.norm_natCast] + exact div_le_div_of_nonneg_left (Nat.cast_nonneg _) hδ (hsep z hz) + have hmass := div_le_div_of_nonneg_right (hd t) hδ.le + have he := norm_le_norm_sub_add (logDeriv (zetaAtHeight t) w) + (∑ z ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) z : ℂ) / (w - z)) + have herr := ha t w hw hne + have hlog : 0 ≤ Real.log (|t| + 2) := Real.log_nonneg (by linarith [abs_nonneg t]) + have hAlog := mul_nonneg hA.le hlog + have hDlog := mul_nonneg hD.le hlog + have hAinv := mul_nonneg hAlog (inv_nonneg.mpr hδ.le) + simp only [div_eq_mul_inv] at hmass hsum he herr + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaNearZeroBound.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaNearZeroBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..323bcaedb26d12e869b0b3b99009279e46596241 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaNearZeroBound.lean @@ -0,0 +1,95 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaLocalFactorBound + +namespace OAI + +/-! # A near-one zeta zero contributes its full reciprocal gap -/ + +namespace Ostmann + +open Complex Metric Set +open scoped BigOperators + +theorem zetaAtHeight_logDeriv_translate (t : ℝ) (w : ℂ) : + logDeriv (zetaAtHeight t) w = logDeriv regularizedZeta (w + characterZeroCenter t) := by + change logDeriv (regularizedZeta ∘ (fun z : ℂ => z + characterZeroCenter t)) w = _ + rw [logDeriv_comp (g := fun z : ℂ => z + characterZeroCenter t) + (regularizedZeta_analytic _).differentiableAt (differentiableAt_id.add_const _)] + simp + +theorem regularizedZeta_zero_re_lt_one (ρ : ℂ) (hρ : regularizedZeta ρ = 0) : ρ.re < 1 := by + by_contra h + exact regularizedZeta_ne_zero_right ρ (le_of_not_gt h) hρ + +theorem zeta_near_zero_gap_bound : ∃ C : ℝ, 0 < C ∧ ∀ (ρ : ℂ), + regularizedZeta ρ = 0 → 1 / 2 ≤ ρ.re → ∀ σ : ℝ, 1 < σ → σ ≤ 2 → + 1 / (σ - ρ.re) ≤ + (logDeriv regularizedZeta ((σ : ℂ) + (ρ.im : ℂ) * I)).re + + C * Real.log (|ρ.im| + 2) := by + obtain ⟨C, hC, hbound⟩ := zeta_local_factor_bound + refine ⟨C, hC, ?_⟩ + intro ρ hρ hρhalf σ hσ hσ2 + have hρ1 := regularizedZeta_zero_re_lt_one ρ hρ + let t := ρ.im + let w : ℂ := ((σ - 2 : ℝ) : ℂ) + let z : ℂ := ρ - characterZeroCenter t + have hzval : z = ((ρ.re - 2 : ℝ) : ℂ) := by + apply Complex.ext <;> simp [z, t, characterZeroCenter] + have hz : z ∈ zetaDiskZeros t := by + apply (mem_zetaDiskZeros t z).mpr + refine ⟨?_, ?_⟩ + · rw [hzval, Complex.norm_real, Real.norm_eq_abs, abs_of_nonpos (by linarith)] + linarith + · simpa only [zetaAtHeight, z, sub_add_cancel] using hρ + have hw : ‖w‖ ≤ 5 / 4 := by + rw [show w = ((σ - 2 : ℝ) : ℂ) from rfl, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonpos (by linarith)] + linarith + have hwne : zetaAtHeight t w ≠ 0 := by + apply regularizedZeta_ne_zero_right + simp only [w, Complex.add_re, Complex.ofReal_re, characterZeroCenter_re] + linarith + have hb := hbound t w hw hwne + have hnonneg (v : ℂ) (hv : v ∈ zetaDiskZeros t) : + 0 ≤ ((analyticOrderNatAt (zetaAtHeight t) v : ℂ) / (w - v)).re := by + have hvre := zetaAtHeight_zero_left t v ((mem_zetaDiskZeros t v).mp hv).2 + rw [div_eq_mul_inv, Complex.mul_re] + simp only [Complex.natCast_re, Complex.natCast_im, zero_mul, sub_zero] + apply mul_nonneg (Nat.cast_nonneg _) + rw [Complex.inv_re] + apply div_nonneg _ (Complex.normSq_nonneg _) + simp only [Complex.sub_re, w, Complex.ofReal_re] + linarith + have hsingle := Finset.single_le_sum hnonneg hz + have hord : 1 ≤ analyticOrderNatAt (zetaAtHeight t) z := by + have he := (zetaAtHeight_analytic t z).analyticOrderAt_ne_zero.mpr + ((mem_zetaDiskZeros t z).mp hz).2 + rw [← Nat.cast_analyticOrderNatAt (zetaAtHeight_order_ne_top t z)] at he + have hn : analyticOrderNatAt (zetaAtHeight t) z ≠ 0 := by simpa using he + omega + have hdiff : w - z = ((σ - ρ.re : ℝ) : ℂ) := by + rw [hzval] + simp only [w] + push_cast + ring + have hterm : ((analyticOrderNatAt (zetaAtHeight t) z : ℂ) / (w - z)).re = + (analyticOrderNatAt (zetaAtHeight t) z : ℝ) / (σ - ρ.re) := by + rw [hdiff] + exact (Complex.ofReal_div _ _).symm ▸ rfl + rw [hterm] at hsingle + have hone : 1 / (σ - ρ.re) ≤ (analyticOrderNatAt (zetaAtHeight t) z : ℝ) / (σ - ρ.re) := by + apply div_le_div_of_nonneg_right _ (by linarith) + exact_mod_cast hord + have herr := Complex.re_le_norm + (-(logDeriv (zetaAtHeight t) w - + ∑ v ∈ zetaDiskZeros t, (analyticOrderNatAt (zetaAtHeight t) v : ℂ) / (w - v))) + rw [norm_neg, Complex.neg_re, Complex.sub_re, Complex.re_sum] at herr + have htranslate : w + characterZeroCenter t = (σ : ℂ) + (ρ.im : ℂ) * I := by + apply Complex.ext <;> simp [w, t, characterZeroCenter] + rw [zetaAtHeight_logDeriv_translate, htranslate] at herr + rw [zetaAtHeight_logDeriv_translate, htranslate] at hb + dsimp only [t] at hb herr hsingle + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaTrigonometric.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaTrigonometric.lean new file mode 100644 index 0000000000000000000000000000000000000000..b6787ba6ecc9f0ed31235d32c5e6fea237cc9d98 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaTrigonometric.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaNearZeroBound +import OAI.NumberTheory.Ostmann.ZeroDensity.ComplexCharacterTrigonometric +import OAI.NumberTheory.Ostmann.ZeroDensity.NonquadraticZeroBound + +namespace OAI + +/-! # The zeta 3-4-1 inequality and the reciprocal-gap bound -/ + +namespace Ostmann + +open Complex + +theorem zeta_trigonometric_nonneg (σ t : ℝ) (hσ : 1 < σ) : + 0 ≤ 3 * (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (σ : ℂ)).re + + 4 * (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + (t : ℂ) * I)).re + + (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) + ((σ : ℂ) + ((2 * t : ℝ) : ℂ) * I)).re := by + have hprincipal (n : ℕ) : (1 : DirichletCharacter ℂ 1) n = 1 := by + rw [Subsingleton.elim (n : ZMod 1) 1] + exact map_one _ + simpa only [one_pow, hprincipal, one_mul] using + complex_character_trigonometric_sum_nonneg (1 : DirichletCharacter ℂ 1) σ t hσ + +theorem zeta_near_zero_trigonometric_bound : ∃ C : ℝ, 0 < C ∧ + ∀ (ρ : ℂ), regularizedZeta ρ = 0 → 1 / 2 ≤ ρ.re → + ∀ σ : ℝ, 1 < σ → σ ≤ 2 → + 4 / (σ - ρ.re) ≤ 3 / (σ - 1) + + 4 * realZeroKernel (σ - 1) ρ.im + + realZeroKernel (σ - 1) (2 * ρ.im) + C * (Real.log (|ρ.im| + 2) + 1) := by + obtain ⟨A, hA, ha⟩ := zeta_near_zero_gap_bound + obtain ⟨B, hB, hb⟩ := exists_vonMangoldt_logarithmic_upper + obtain ⟨V, hV, hv⟩ := exists_vonMangoldt_series_bound + refine ⟨4 * A + 2 * B + 3 * V, by positivity, ?_⟩ + intro ρ hρ hρhalf σ hσ hσ2 + let s : ℂ := (σ : ℂ) + (ρ.im : ℂ) * I + have ht := zeta_trigonometric_nonneg σ ρ.im hσ + have hgap := ha ρ hρ hρhalf σ hσ hσ2 + have hright := hb ((σ : ℂ) + ((2 * ρ.im : ℝ) : ℂ) * I) + (by simpa using hσ) (by simpa using hσ2) + have hreal := (Complex.re_le_norm _).trans (hv σ hσ hσ2) + have hformula := ArithmeticFunction.LSeries_vonMangoldt_eq_deriv_riemannZeta_div + (s := s) (by simpa [s] using hσ) + change LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) s = _ at hformula + have hreg := regularizedZeta_logDeriv s (by simpa [s] using hσ) + have hker : ((s - 1)⁻¹).re = realZeroKernel (σ - 1) ρ.im := by + simpa [s] using realZeroKernel_complex_sub s 1 + have hid : (logDeriv regularizedZeta s).re = realZeroKernel (σ - 1) ρ.im - + (LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) s).re := by + rw [hreg, Complex.add_re, hker, hformula, neg_div, Complex.neg_re] + simp only [logDeriv_apply] + ring + change 1 / (σ - ρ.re) ≤ (logDeriv regularizedZeta s).re + _ at hgap + rw [hid] at hgap + have hdouble := log_double_abs_height_le ρ.im + have hlog : 0 ≤ Real.log (|ρ.im| + 2) := Real.log_nonneg (by linarith [abs_nonneg ρ.im]) + have hBdouble := mul_le_mul_of_nonneg_left hdouble hB.le + have hAlog := mul_nonneg hA.le hlog + have hBlog := mul_nonneg hB.le hlog + have hVlog := mul_nonneg hV.le hlog + simp only [Complex.add_re, Complex.add_im, Complex.mul_re, Complex.mul_im, + Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, + mul_zero, mul_one, add_zero, zero_add, sub_zero] at hright + dsimp only [s] at hgap + simp only [div_eq_mul_inv] at hreal hgap ⊢ + nlinarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaZeroFreeLogDerivative.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaZeroFreeLogDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..28010e3eb6a4207dddced6433a46f49292c22721 --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaZeroFreeLogDerivative.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaZeroFreeRegion +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaLocalSeparation + +namespace OAI + +/-! # A logarithmic-squared bound for the regularized zeta function -/ + +namespace Ostmann + +open Complex + +theorem zeta_zero_free_logDeriv_data : ∃ c C : ℝ, + 0 < c ∧ c ≤ 1 / 4 ∧ 0 < C ∧ ∀ T : ℝ, 2 ≤ T → + ∀ s : ℂ, 1 - c / (Real.log (T + 4) + 1) ≤ s.re → s.re ≤ 2 → |s.im| ≤ T → + regularizedZeta s ≠ 0 ∧ ‖logDeriv regularizedZeta s‖ ≤ + C * (Real.log (T + 4) + 1) ^ 2 := by + obtain ⟨c0, hc0, _, hregion⟩ := regularizedZeta_zero_free_region + obtain ⟨B, hB, hbound⟩ := zeta_local_logDeriv_separated + let c := min (c0 / 4) (1 / 4) + have hc : 0 < c := lt_min (by positivity) (by norm_num) + have hcc : 4 * c ≤ c0 := by + have hh := min_le_left (c0 / 4) (1 / 4) + dsimp [c] + linarith + have hc4 : c ≤ 1 / 4 := min_le_right _ _ + refine ⟨c, B * (1 + c⁻¹), hc, hc4, by positivity, ?_⟩ + intro T hT s hs hs2 ht + let H := Real.log (T + 4) + 1 + have hH : 1 ≤ H := by + have hh := Real.log_nonneg (show 1 ≤ T + 4 by linarith) + dsimp [H] + linarith + have hHp : 0 < H := by linarith + let δ := c / H + have hδ : 0 < δ := div_pos hc hHp + have hδ4 : δ ≤ 1 / 4 := by + calc + c / H ≤ c / 1 := div_le_div_of_nonneg_left hc.le (by norm_num) hH + _ ≤ 1 / 4 := by simpa using hc4 + change 1 - δ ≤ s.re at hs + have hgap (ρ : ℂ) (hρ : regularizedZeta ρ = 0) (hρt : |ρ.im| ≤ T + 2) : + 4 * δ ≤ 1 - ρ.re := by + have hden : 0 < Real.log (|ρ.im| + 2) + 1 := by + have hh := Real.log_nonneg (show 1 ≤ |ρ.im| + 2 by linarith [abs_nonneg ρ.im]) + linarith + have hd : Real.log (|ρ.im| + 2) + 1 ≤ H := by + dsimp [H] + exact add_le_add (Real.log_le_log (by positivity) (by linarith)) le_rfl + calc + 4 * δ ≤ c0 / H := by + dsimp [δ] + rw [← mul_div_assoc] + exact div_le_div_of_nonneg_right hcc hHp.le + _ ≤ c0 / (Real.log (|ρ.im| + 2) + 1) := div_le_div_of_nonneg_left hc0.le hden hd + _ ≤ 1 - ρ.re := hregion ρ hρ + have hne : regularizedZeta s ≠ 0 := by + intro he + have hh := hgap s he (by linarith) + linarith + refine ⟨hne, ?_⟩ + let w : ℂ := s - characterZeroCenter s.im + have hwval : w = ((s.re - 2 : ℝ) : ℂ) := by + apply Complex.ext <;> simp [w, characterZeroCenter] + have hw : ‖w‖ ≤ 5 / 4 := by + rw [hwval, Complex.norm_real, Real.norm_eq_abs, abs_of_nonpos (by linarith)] + linarith + have hf : zetaAtHeight s.im w ≠ 0 := by + simpa only [zetaAtHeight, w, sub_add_cancel] using hne + have hsep (z : ℂ) (hz : z ∈ zetaDiskZeros s.im) : δ ≤ ‖w - z‖ := by + have hzero : regularizedZeta (z + characterZeroCenter s.im) = 0 := + ((mem_zetaDiskZeros s.im z).mp hz).2 + have hzi := Complex.abs_im_le_norm z + have hzn := ((mem_zetaDiskZeros s.im z).mp hz).1 + have htri := abs_add_le z.im s.im + have hzt : |(z + characterZeroCenter s.im).im| ≤ T + 2 := by + simp only [Complex.add_im, characterZeroCenter_im] + linarith + have hh := hgap (z + characterZeroCenter s.im) hzero hzt + have hre : δ ≤ (w - z).re := by + rw [hwval] + simp only [Complex.sub_re, Complex.ofReal_re] + simp only [Complex.add_re, characterZeroCenter_re] at hh + linarith + exact hre.trans (Complex.re_le_norm _) + have hb := hbound s.im w δ hw hf hδ hsep + rw [zetaAtHeight_logDeriv_translate, show w + characterZeroCenter s.im = s by + dsimp [w]; abel] at hb + have hlog : Real.log (|s.im| + 2) ≤ H := by + have hh : Real.log (|s.im| + 2) ≤ Real.log (T + 4) := + Real.log_le_log (by positivity) (by linarith) + dsimp [H] + linarith + have hcost : 1 + δ⁻¹ ≤ H * (1 + c⁻¹) := by + have he : δ⁻¹ = H * c⁻¹ := by dsimp [δ]; rw [inv_div]; ring + rw [he] + nlinarith + calc + _ ≤ B * H * (H * (1 + c⁻¹)) := hb.trans + (mul_le_mul (mul_le_mul_of_nonneg_left hlog hB.le) hcost (by positivity) (by positivity)) + _ = _ := by dsimp [H]; ring + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaZeroFreeRegion.lean b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaZeroFreeRegion.lean new file mode 100644 index 0000000000000000000000000000000000000000..d99028d05eef4ae4423e3ed0ca260a4ae56e224d --- /dev/null +++ b/lean/OAI/NumberTheory/Ostmann/ZeroDensity/ZetaZeroFreeRegion.lean @@ -0,0 +1,117 @@ +import OAI.NumberTheory.Ostmann.ZeroDensity.ZetaTrigonometric +import OAI.NumberTheory.Ostmann.ZeroDensity.ZeroFreeNumerics + +namespace OAI + +/-! # A logarithmic zero-free region for the regularized zeta function -/ + +namespace Ostmann + +open Complex Filter Metric +open scoped Topology + +theorem regularizedZeta_small_height_gap : ∃ r : ℝ, 0 < r ∧ r ≤ 1 / 4 ∧ + ∀ ρ : ℂ, regularizedZeta ρ = 0 → 1 - r ≤ ρ.re → r ≤ |ρ.im| := by + have hn := (regularizedZeta_analytic 1).continuousAt.eventually_ne + (show regularizedZeta 1 ≠ 0 by simp) + obtain ⟨R, hR, hball⟩ := Metric.eventually_nhds_iff.mp hn + let r := min (R / 4) (1 / 4) + have hr : 0 < r := lt_min (by positivity) (by norm_num) + have hrR : r ≤ R / 4 := min_le_left _ _ + refine ⟨r, hr, min_le_right _ _, ?_⟩ + intro ρ hρ hnear + have hρ1 := regularizedZeta_zero_re_lt_one ρ hρ + by_contra hnot + have hi : |ρ.im| < r := lt_of_not_ge hnot + have hdist : dist ρ 1 < R := by + rw [dist_eq_norm] + have hb := Complex.norm_le_abs_re_add_abs_im (ρ - 1) + simp only [Complex.sub_re, Complex.one_re, Complex.sub_im, Complex.one_im, + sub_zero, abs_of_neg (show ρ.re - 1 < 0 by linarith)] at hb + linarith + exact hball hdist hρ + +theorem realZeroKernel_away_bound (r δ t : ℝ) (hr : 0 < r) (hδ : 0 < δ) + (hδ1 : δ ≤ 1) (ht : r ≤ |t|) : realZeroKernel δ t ≤ 1 / r ^ 2 := by + have ht2 : r ^ 2 ≤ t ^ 2 := by nlinarith [sq_abs t] + unfold realZeroKernel + calc + δ / (δ ^ 2 + t ^ 2) ≤ 1 / (δ ^ 2 + t ^ 2) := + div_le_div_of_nonneg_right hδ1 (by positivity) + _ ≤ 1 / r ^ 2 := div_le_div_of_nonneg_left (by norm_num) (by positivity) (by nlinarith) + +theorem regularizedZeta_zero_free_region : ∃ c : ℝ, 0 < c ∧ c ≤ 1 / 4 ∧ + ∀ ρ : ℂ, regularizedZeta ρ = 0 → + c / (Real.log (|ρ.im| + 2) + 1) ≤ 1 - ρ.re := by + obtain ⟨r, hr, hr4, hsmall⟩ := regularizedZeta_small_height_gap + obtain ⟨C, hC, hbound⟩ := zeta_near_zero_trigonometric_bound + let D := C + 5 / r ^ 2 + have hD : 0 < D := by dsimp [D]; positivity + let c := min r (1 / (2000 * (D + 1))) + have hc : 0 < c := lt_min hr (by positivity) + have hcr : c ≤ r := min_le_left _ _ + have hcc : c ≤ 1 / (2000 * (D + 1)) := min_le_right _ _ + refine ⟨c, hc, hcr.trans hr4, ?_⟩ + intro ρ hρ + let H := Real.log (|ρ.im| + 2) + 1 + have hH : 1 ≤ H := by + have hh := Real.log_nonneg (show 1 ≤ |ρ.im| + 2 by linarith [abs_nonneg ρ.im]) + dsimp [H] + linarith + have hHp : 0 < H := by linarith + let δ := 1 / (100 * (D + 1) * H) + have hδ : 0 < δ := by dsimp [δ]; positivity + have hδ1 : δ ≤ 1 := by + dsimp [δ] + apply (div_le_iff₀ (by positivity)).mpr + nlinarith + have hbudget : δ * (D * H) ≤ 1 / 100 := by + dsimp [δ] + have he : (1 / (100 * (D + 1) * H)) * (D * H) = D / (100 * (D + 1)) := by + field_simp + rw [he] + apply (div_le_iff₀ (by positivity)).mpr + linarith + have hcut : c / H ≤ δ / 20 := by + have hh := div_le_div_of_nonneg_right hcc hHp.le + apply hh.trans_eq + dsimp [δ] + field_simp + ring + have hcrH : c / H ≤ r := by + calc + c / H ≤ c / 1 := div_le_div_of_nonneg_left hc.le (by norm_num) hH + _ ≤ r := by simpa using hcr + by_contra hnot + have hnear : 1 - δ / 20 ≤ ρ.re := by + change ¬c / H ≤ 1 - ρ.re at hnot + linarith [lt_of_not_ge hnot] + have hnearR : 1 - r ≤ ρ.re := by + change ¬c / H ≤ 1 - ρ.re at hnot + linarith [lt_of_not_ge hnot] + have hhalf : 1 / 2 ≤ ρ.re := by linarith + have hi := hsmall ρ hρ hnearR + have hk1 := realZeroKernel_away_bound r δ ρ.im hr hδ hδ1 hi + have hk2 := realZeroKernel_away_bound r δ (2 * ρ.im) hr hδ hδ1 (by + rw [abs_mul] + norm_num + linarith) + have hupper := hbound ρ hρ hhalf (1 + δ) (by linarith) (by linarith) + simp only [add_sub_cancel_left] at hupper + have hcost : 5 / r ^ 2 ≤ (5 / r ^ 2) * H := by + exact le_mul_of_one_le_right (by positivity) hH + have hup : 4 / (1 + δ - ρ.re) ≤ 3 / δ + D * H := by + dsimp [D, H] + dsimp [H] at hcost + simp only [div_eq_mul_inv] at hk1 hk2 hupper hcost ⊢ + nlinarith + have hρ1 := regularizedZeta_zero_re_lt_one ρ hρ + have hmass := real_zero_shifted_mass δ (1 + δ - ρ.re) hδ (by linarith) (by linarith) + have hp := mul_le_mul_of_nonneg_left hup hδ.le + have he : δ * (3 / δ + D * H) = 3 + δ * (D * H) := by field_simp + rw [he] at hp + linarith + +end Ostmann + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupAmple.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupAmple.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef689a9fe02216d4659cb107ed1dec0147e1ca9c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupAmple.lean @@ -0,0 +1,19 @@ +import OAI.NumberTheory.PiExponent.Ampleness.NumericalAmplenessTheorem +import OAI.NumberTheory.PiExponent.Geometry.AdmissibleCurveDegreeData + +namespace OAI + +noncomputable section +namespace PiExponent.AdmissibleBlowupGeometry +variable {ν Λ D : ℝ} (d : AdmissibleParameters ν Λ D) + +theorem interpolationBundle_ample : (interpolationBundle d).IsAmple := + NumericalAmpleness.isAmple_of_uniform_curve_margin (structureMap d) + (H d) (interpolationBundle d) (H_ample d) (uniformMargin d) + (uniformMargin_pos d) (uniform_curve_margin d) + +end PiExponent.AdmissibleBlowupGeometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupGeometry.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..d81138931efefd547c1703b61389a644d97fa19b --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupGeometry.lean @@ -0,0 +1,181 @@ +import OAI.NumberTheory.PiExponent.Ampleness.BlowupProperIntegral +import OAI.NumberTheory.PiExponent.Ampleness.WeightedProjectiveAmple +import OAI.NumberTheory.PiExponent.Approximation.WeightedGeometryScale +import OAI.NumberTheory.PiExponent.Geometry.AdmissibleCurveInequality +import OAI.NumberTheory.PiExponent.Geometry.CurveMonomialMap +import OAI.NumberTheory.PiExponent.Jets.CompactLogJetIdeal + +namespace OAI + +noncomputable section +namespace PiExponent.AdmissibleBlowupGeometry +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry +open WeightedGeometryScale +variable {ν Λ D : ℝ} (d : AdmissibleParameters ν Λ D) + +def scale : Scale d.curveDegreeWeights d.curveJetWeights := + chooseScale d.curveDegreeWeights d.curveJetWeights + d.curveDegreeWeights_pos d.curveJetWeights_pos + +abbrev Index := (scale d).Index +abbrev exponents : Index d → Fin (d.m+1) →₀ ℕ := (scale d).exponents +abbrev constantIndex : Index d := (scale d).constantIndex d.curveDegreeWeights_pos +abbrev coordinateIndex : Fin (d.m+1) → Index d := + (scale d).coordinateIndex d.curveDegreeWeights_pos +abbrev pureIndex : Fin (d.m+1) → Index d := + (scale d).pureIndex d.curveDegreeWeights_pos + +instance index_nonempty : Nonempty (Index d) := ⟨constantIndex d⟩ + +abbrev compactification : Scheme := Proj (WeightedCompactification.imageGrade (R := ℂ) (exponents d)) + +def compactificationStructureMap : compactification d ⟶ Spec (.of ℂ) := + WeightedCompactification.projection (exponents d) + +instance compactificationStructureMap_proper : IsProper (compactificationStructureMap d) := by + dsimp [compactificationStructureMap] + infer_instance + +def affineChart : CompactLogJetIdeal.affineSpace d.m ⟶ compactification d := + WeightedCompactification.affineChartMap (exponents d) (constantIndex d) + ((scale d).exponents_constant d.curveDegreeWeights_pos) + (coordinateIndex d) ((scale d).exponents_coordinate d.curveDegreeWeights_pos) + +instance affineChart_isOpenImmersion : IsOpenImmersion (affineChart d) := by + dsimp [affineChart] + infer_instance + +def origin : CompactLogJetIdeal.affineSpace d.m := + ⟨WeightedBezout.pointIdeal (0 : Fin (d.m+1) → ℂ),inferInstance⟩ + +instance compactification_nonempty : Nonempty (compactification d) := ⟨affineChart d (origin d)⟩ +instance compactification_isIntegral : IsIntegral (compactification d) := by infer_instance +instance compactification_isLocallyNoetherian : IsLocallyNoetherian (compactification d) := + LocallyOfFiniteType.isLocallyNoetherian (compactificationStructureMap d) +instance compactification_compact : CompactSpace (compactification d) := + QuasiCompact.compactSpace_of_compactSpace (compactificationStructureMap d) +instance compactification_isNoetherian : IsNoetherian (compactification d) := {} +instance affineChart_quasiCompact : QuasiCompact (affineChart d) := by infer_instance + +theorem affineChart_over : affineChart d ≫ compactificationStructureMap d = + CompactLogJetIdeal.structureMap d.m := + CurveMonomialMap.affineChartMap_projection (exponents d) (constantIndex d) + ((scale d).exponents_constant d.curveDegreeWeights_pos) + (coordinateIndex d) ((scale d).exponents_coordinate d.curveDegreeWeights_pos) + +def hyperplane : LineBundle (compactification d) := WeightedCompactification.lineBundle (exponents d) +theorem hyperplane_ample : (hyperplane d).IsAmple := + WeightedCompactification.lineBundle_ample (exponents d) + +def logCutoff : Fin d.m → ℕ := + (exists_log_cutoff d.curveJetWeights (d.curveJetWeights_pos 0)).choose + +theorem logCutoff_strict (i : Fin d.m) : + d.curveJetWeights i.succ < (logCutoff d i : ℚ) * d.curveJetWeights 0 := + (exists_log_cutoff d.curveJetWeights (d.curveJetWeights_pos 0)).choose_spec i + +def centerIdeal : (compactification d).IdealSheafData := + CompactLogJetIdeal.compactIdeal d.curveCenters (logCutoff d) (scale d).jetPowers (affineChart d) + +theorem centerIdeal_restrict : (centerIdeal d).comap (affineChart d) = + CompactLogJetIdeal.affineIdeal d.curveCenters (logCutoff d) (scale d).jetPowers := + CompactLogJetIdeal.restrict_compactIdeal _ _ _ _ + +theorem centerIdeal_support : ((centerIdeal d).support : Set (compactification d)) = + ⋃ j : Fin d.K, Set.range (CompactLogJetIdeal.point (d.curveCenters j) ≫ affineChart d) := + CompactLogJetIdeal.support_compactIdeal _ _ _ (scale d).jetPowers_pos _ + (compactificationStructureMap d) (affineChart_over d) + +theorem centerIdeal_support_finite : + ((centerIdeal d).support : Set (compactification d)).Finite := by + rw [centerIdeal_support] + exact Set.finite_iUnion (fun _ => Set.finite_range _) + +theorem centerIdeal_support_subset_chart : + ((centerIdeal d).support : Set (compactification d)) ⊆ (affineChart d).opensRange := by + rw [centerIdeal_support] + intro x hx + obtain ⟨j,z,rfl⟩ := Set.mem_iUnion.mp hx + exact ⟨CompactLogJetIdeal.point (d.curveCenters j) z,rfl⟩ + +theorem centerIdeal_coherent : + (PiExponentSeshadri.IdealModule.closedModule (centerIdeal d)).IsFinitePresentation := + CompactLogJetIdeal.compactIdeal_isFinitePresentation _ _ _ _ + +theorem origin_ne_center (c : Fin d.m → ℂ) : origin d ≠ CompactJetPolynomial.centerPoint c := by + intro h + have hx : MvPolynomial.X (0 : Fin (d.m+1)) ∈ (origin d).asIdeal := by + change MvPolynomial.aeval (0 : Fin (d.m+1) → ℂ) (MvPolynomial.X 0) = 0 + simp + rw [h] at hx + change MvPolynomial.aeval (CompactJetPolynomial.center c) (MvPolynomial.X 0) = 0 at hx + simp [CompactJetPolynomial.center] at hx + +theorem origin_avoids_center : affineChart d (origin d) ∉ (centerIdeal d).support := by + change affineChart d (origin d) ∉ ((centerIdeal d).support : Set (compactification d)) + rw [centerIdeal_support] + intro h + obtain ⟨j,hj⟩ := Set.mem_iUnion.mp h + obtain ⟨z,hz⟩ := hj + have he : CompactLogJetIdeal.point (d.curveCenters j) z = origin d := + (affineChart d).isOpenEmbedding.injective hz + have hc : CompactLogJetIdeal.point (d.curveCenters j) z = + CompactJetPolynomial.centerPoint (d.curveCenters j) := by + apply Set.mem_singleton_iff.mp + erw [← CompactLogJetIdeal.range_point] + exact ⟨z,rfl⟩ + exact origin_ne_center d _ (he.symm.trans hc) + +theorem centerIdeal_support_ne_top : (centerIdeal d).support ≠ ⊤ := by + intro h + exact origin_avoids_center d (by rw [h]; trivial) + +abbrev blowup : Scheme := PiExponentSeshadri.BlowupGluing.scheme (centerIdeal d) +abbrev projection : blowup d ⟶ compactification d := + PiExponentSeshadri.BlowupGluing.projection (centerIdeal d) +def structureMap : blowup d ⟶ Spec (.of ℂ) := projection d ≫ compactificationStructureMap d + +instance projection_proper : IsProper (projection d) := by infer_instance +instance structureMap_proper : IsProper (structureMap d) := by + dsimp [structureMap] + infer_instance +instance blowup_isIntegral : IsIntegral (blowup d) := + PiExponentSeshadri.BlowupGluing.scheme_isIntegral (centerIdeal d) (centerIdeal_support_ne_top d) +instance blowup_isLocallyNoetherian : IsLocallyNoetherian (blowup d) := + LocallyOfFiniteType.isLocallyNoetherian (structureMap d) +instance blowup_compact : CompactSpace (blowup d) := + QuasiCompact.compactSpace_of_compactSpace (structureMap d) +instance blowup_isNoetherian : IsNoetherian (blowup d) := {} + +def A : LineBundle (blowup d) := (hyperplane d).pullback (projection d) +abbrev J : LineBundle (blowup d) := + PiExponentSeshadri.BlowupGluing.exceptionalLineBundle (centerIdeal d) +abbrev exceptionalInclusion : (J d).sheaf ⟶ structureSheaf (blowup d) := + PiExponentSeshadri.BlowupGluing.exceptionalInclusion (centerIdeal d) + +theorem exceptional_presents : + PresentsPullbackIdeal (centerIdeal d) (projection d) (J d) (exceptionalInclusion d) := + PiExponentSeshadri.BlowupGluing.exceptional_presents (centerIdeal d) + +theorem isBlowup : IsBlowup (centerIdeal d) (projection d) := + PiExponentSeshadri.BlowupGluing.isBlowup (centerIdeal d) + +abbrev affinePolynomialIdeal := + CompactLogJetIdeal.polynomialIdeal d.curveCenters (logCutoff d) (scale d).jetPowers + +theorem formalJet_packet_zero (n : ℕ) (P : CompactLogJetIdeal.coordinateRing d.m) + (hP : P ∈ affinePolynomialIdeal d ^ n) (j : Fin d.K) : + JetGeometry.rationalCoefficientPacket d.curveJetWeights (n * (scale d).radius) + (FormalLogJet.formalJet (d.curveCenters j) P) = (fun _ => (0 : ℂ)) := by + apply CompactLogJetIdeal.formalJet_packet_zero_of_mem_polynomialIdeal_pow + d.curveCenters (logCutoff d) (scale d).jetPowers d.curveJetWeights + (fun i => (d.curveJetWeights_pos i).le) (fun i => (logCutoff_strict d i).le) + (scale d).radius (fun i => ?_) n P hP j + rw [mul_comm, (scale d).jetPowers_eq] + +end PiExponent.AdmissibleBlowupGeometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupMargin.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupMargin.lean new file mode 100644 index 0000000000000000000000000000000000000000..960bd07dc438ed286b259f386b86331429789764 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupMargin.lean @@ -0,0 +1,77 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AdmissibleBlowupGeometry +import OAI.NumberTheory.PiExponent.Ampleness.BlowupCurveMargin +import OAI.NumberTheory.PiExponent.Geometry.CurveNormalizedDegreeTransfer + +namespace OAI + +noncomputable section +namespace PiExponent.AdmissibleBlowupMargin +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry NumericalAmpleness +open AdmissibleBlowupGeometry BlowupCurveMargin +variable {ν Λ D : ℝ} (d : AdmissibleParameters ν Λ D) + +structure AffineCurveDegreeData (C : IntegralCurve (blowup d)) where + E : Type + [field : Field E] + [algebra : Algebra ℂ E] + [essFiniteType : Algebra.EssFiniteType ℂ E] + y : E + x : Fin d.m → E + coordinates_generate : IntermediateField.adjoin ℂ + (Set.range (Fin.cases y x : Fin (d.m+1) → E)) = ⊤ + trdeg_one : Algebra.trdeg ℂ E = 1 + hyperplane_degree : (curveDegree (structureMap d) (A d) C : ℝ) = + ((scale d).radius : ℝ) * poleDegree d y x trdeg_one + exceptional_degree : (curveDegree (structureMap d) (J d) C : ℝ) = + -((scale d).radius : ℝ) * contactSum d y x coordinates_generate trdeg_one + +theorem uniform_margin_of_affine_curve_data + (a : ℕ) (ha : 1 < a) (hample : (((A d).pow a).tensor (J d)).IsAmple) + (hdata : ∀ C : IntegralCurve (blowup d), + (¬ ∃ x : compactification d, Set.range (C.embedding ≫ projection d) ⊆ ({x} : Set _)) → + (∃ c : C.scheme, (C.embedding ≫ projection d) c ∈ (affineChart d).opensRange) → + Nonempty (AffineCurveDegreeData d C)) : + ∀ C : IntegralCurve (blowup d), + marginCoefficient a d.sigma * + (curveDegree (structureMap d) (((A d).pow a).tensor (J d)) C : ℝ) ≤ + (curveDegree (structureMap d) ((A d).tensor (J d)) C : ℝ) := by + classical + intro C + by_cases hc : ∃ x : compactification d, + Set.range (C.embedding ≫ projection d) ⊆ ({x} : Set _) + · obtain ⟨x,hx⟩ := hc + exact margin_of_contracted (structureMap d) (projection d) (hyperplane d) (J d) + a ha hample d.sigma d.sigma_pos C x hx + · by_cases hm : ∃ c : C.scheme, + (C.embedding ≫ projection d) c ∈ (affineChart d).opensRange + · obtain ⟨r⟩ := hdata C hc hm + let := r.field + let := r.algebra + let := r.essFiniteType + exact margin_of_actual_contact_degrees d (structureMap d) (A d) (J d) + a ha hample C r.y r.x r.coordinates_generate r.trdeg_one + (scale d).radius (by exact_mod_cast (scale d).radius_pos) + r.hyperplane_degree r.exceptional_degree + · exact margin_of_image_outside_chart (structureMap d) (centerIdeal d) + (projection d) (A d) (J d) (exceptionalInclusion d) (exceptional_presents d) + a ha hample d.sigma d.sigma_pos C (affineChart d).opensRange + (centerIdeal_support_subset_chart d) (fun c hh => hm ⟨c,hh⟩) + +theorem exists_positive_uniform_margin_of_affine_curve_data + (a : ℕ) (ha : 1 < a) (hample : (((A d).pow a).tensor (J d)).IsAmple) + (hdata : ∀ C : IntegralCurve (blowup d), + (¬ ∃ x : compactification d, Set.range (C.embedding ≫ projection d) ⊆ ({x} : Set _)) → + (∃ c : C.scheme, (C.embedding ≫ projection d) c ∈ (affineChart d).opensRange) → + Nonempty (AffineCurveDegreeData d C)) : + ∃ ε : ℝ, 0 < ε ∧ ∀ C : IntegralCurve (blowup d), + ε * (curveDegree (structureMap d) (((A d).pow a).tensor (J d)) C : ℝ) ≤ + (curveDegree (structureMap d) ((A d).tensor (J d)) C : ℝ) := + ⟨marginCoefficient a d.sigma,marginCoefficient_pos ha d.sigma_pos, + uniform_margin_of_affine_curve_data d a ha hample hdata⟩ + +end PiExponent.AdmissibleBlowupMargin + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupPolarization.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupPolarization.lean new file mode 100644 index 0000000000000000000000000000000000000000..b37f135c926df84bbf9dda0a444df9b3873430d0 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleBlowupPolarization.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AdmissibleBlowupMargin +import OAI.NumberTheory.PiExponent.Ampleness.BlowupAmpleTwist + +namespace OAI + +noncomputable section +namespace PiExponent.AdmissibleBlowupGeometry +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry NumericalAmpleness +variable {ν Λ D : ℝ} (d : AdmissibleParameters ν Λ D) + +theorem exists_ampleExponent : ∃ a : ℕ, 1 < a ∧ (((A d).pow a).tensor (J d)).IsAmple := + PiExponentSeshadri.BlowupGluing.exists_ample_exceptional_power_gt_one + (centerIdeal d) (centerIdeal_support_ne_top d) (hyperplane d) (hyperplane_ample d) + +def ampleExponent : ℕ := (exists_ampleExponent d).choose + +theorem ampleExponent_gt_one : 1 < ampleExponent d := (exists_ampleExponent d).choose_spec.1 + +def H : LineBundle (blowup d) := ((A d).pow (ampleExponent d)).tensor (J d) + +theorem H_ample : (H d).IsAmple := (exists_ampleExponent d).choose_spec.2 + +def interpolationBundle : LineBundle (blowup d) := (A d).tensor (J d) + +def uniformMargin : ℝ := BlowupCurveMargin.marginCoefficient (ampleExponent d) d.sigma + +theorem uniformMargin_pos : 0 < uniformMargin d := + BlowupCurveMargin.marginCoefficient_pos (ampleExponent_gt_one d) d.sigma_pos + +theorem uniform_curve_margin_of_affine_curve_data + (hdata : ∀ C : IntegralCurve (blowup d), + (¬ ∃ x : compactification d, Set.range (C.embedding ≫ projection d) ⊆ ({x} : Set _)) → + (∃ c : C.scheme, (C.embedding ≫ projection d) c ∈ (affineChart d).opensRange) → + Nonempty (AdmissibleBlowupMargin.AffineCurveDegreeData d C)) : + ∀ C : IntegralCurve (blowup d), + uniformMargin d * (curveDegree (structureMap d) (H d) C : ℝ) ≤ + (curveDegree (structureMap d) (interpolationBundle d) C : ℝ) := + AdmissibleBlowupMargin.uniform_margin_of_affine_curve_data d (ampleExponent d) + (ampleExponent_gt_one d) (H_ample d) hdata + +end PiExponent.AdmissibleBlowupGeometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleCurveModelDegrees.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleCurveModelDegrees.lean new file mode 100644 index 0000000000000000000000000000000000000000..09727389518d699ff4f31a6f0cbf922fac5cf00f --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleCurveModelDegrees.lean @@ -0,0 +1,83 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalCurveDegree +import OAI.NumberTheory.PiExponent.Geometry.AdmissibleCurveModel + +namespace OAI + +noncomputable section +namespace PiExponent.AdmissibleCurveModel +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry +open AdmissibleBlowupGeometry CurveNormalizationModel +variable {ν Λ D : ℝ} (d : AdmissibleParameters ν Λ D) + +def degreeData (C : NumericalAmpleness.IntegralCurve (blowup d)) + (r : ModelData d C) : AdmissibleBlowupMargin.AffineCurveDegreeData d C := by + letI := r.field + letI := r.algebra + letI := r.essFiniteType + letI := r.parameterFinite + letI := r.normalizationFinite + letI := r.chartIso + let y := r.coordinates 0 + let x := fun i : Fin d.m => r.coordinates i.succ + have htuple : (Fin.cases y x : Fin (d.m+1) → r.E) = r.coordinates := by + funext i + cases i using Fin.cases <;> rfl + have hgen : IntermediateField.adjoin ℂ + (Set.range (Fin.cases y x : Fin (d.m+1) → r.E)) = ⊤ := by + rw [htuple] + exact r.coordinates_generate + let hfinite := CurveParameterFinite.finite_over_every_parameter ℂ r.E r.trdeg_one + have hA : (NumericalAmpleness.curveDegree (structureMap d) (A d) C : ℝ) = + ((scale d).radius : ℝ) * BlowupCurveMargin.poleDegree d y x r.trdeg_one := by + change _ = ((scale d).radius : ℝ) * + CurveContactSum.weightedDegree hfinite (Fin.cases y x) d.curveDegreeWeights + rw [htuple] + exact CurveNormalizedDegreeTransfer.weighted_curveDegree + (exponents d) r.coordinates (constantIndex d) + ((scale d).exponents_constant d.curveDegreeWeights_pos) + (coordinateIndex d) ((scale d).exponents_coordinate d.curveDegreeWeights_pos) + (structureMap d) (H d) (H_ample d) C r.parameter r.parameter_transcendental + r.normalization r.normalization_over r.chart r.chart_nonempty + (projection d) r.generic_coordinates d.curveDegreeWeights d.curveDegreeWeights_pos + (by exact_mod_cast (scale d).radius_pos) (scale d).degreePowers + (scale d).degreePowers_eq (pureIndex d) + ((scale d).exponents_pure d.curveDegreeWeights_pos) + ((scale d).budget d.curveDegreeWeights_pos) hfinite + have hgeneric : parameterCurveGenericPoint r.parameter r.parameter_transcendental ≫ + (r.normalization ≫ C.embedding) ≫ projection d = + Spec.map (CommRingCat.ofHom (MvPolynomial.aeval (Fin.cases y x)).toRingHom) ≫ + affineChart d := by + have heval : (MvPolynomial.aeval r.coordinates).toRingHom = + MvPolynomial.eval₂Hom (algebraMap ℂ r.E) r.coordinates := by + apply RingHom.ext + intro P + exact MvPolynomial.aeval_def r.coordinates P + rw [htuple, heval] + simpa only [Category.assoc, CurveMonomialMap.genericMonomialMap, affineChart] using + r.generic_coordinates + have hJ : (NumericalAmpleness.curveDegree (structureMap d) (J d) C : ℝ) = + -((scale d).radius : ℝ) * BlowupCurveMargin.contactSum d y x hgen r.trdeg_one := by + have hd := CurveNormalizedDegreeTransfer.curveDegree_eq_normalized + (structureMap d) (H d) (H_ample d) C r.parameter r.parameter_transcendental + r.normalization r.normalization_over r.chart r.chart_nonempty (J d) + have hn := ExceptionalCurveDegree.admissible_degree_eq_neg_contactSum + d y x hgen r.trdeg_one r.parameter r.parameter_transcendental + (r.normalization ≫ C.embedding) hgeneric + exact (congrArg (fun n : ℤ => (n : ℝ)) hd).trans hn + exact { E := r.E + field := r.field + algebra := r.algebra + essFiniteType := r.essFiniteType + y := y + x := x + coordinates_generate := hgen + trdeg_one := r.trdeg_one + hyperplane_degree := hA + exceptional_degree := hJ } + +end PiExponent.AdmissibleCurveModel + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleJetAmpleness.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleJetAmpleness.lean new file mode 100644 index 0000000000000000000000000000000000000000..03a5ae784d9f355b07d3c6c3c8305ebf08230c45 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AdmissibleJetAmpleness.lean @@ -0,0 +1,25 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AdmissibleBlowupAmple +import OAI.NumberTheory.PiExponent.Ampleness.GlobalBlowupJetSurjectivity + +namespace OAI + +namespace PiExponent.AdmissibleJetSurjectivity +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry +open PiExponent.AdmissibleBlowupGeometry PiExponent.BlowupJetSurjectivity +attribute [local irreducible] AdmissibleBlowupGeometry.centerIdeal + AdmissibleBlowupGeometry.hyperplane +variable {ν Λ D : ℝ} (d : AdmissibleParameters ν Λ D) + +theorem blowupBundle_ample : + (blowupBundle (centerIdeal d) (hyperplane d)).IsAmple := by + apply PiExponent.AmpleIso.isAmple_of_sheaf_iso (interpolationBundle d) + (blowupBundle (centerIdeal d) (hyperplane d)) + (moduleTensorComm (A d).sheaf (J d).sheaf) + exact interpolationBundle_ample d + +end +end PiExponent.AdmissibleJetSurjectivity + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AffineBlowupUniversal.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AffineBlowupUniversal.lean new file mode 100644 index 0000000000000000000000000000000000000000..40becbcdd170d5ffaa59034d45cd334f9d0e014d --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AffineBlowupUniversal.lean @@ -0,0 +1,91 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesPrincipalLift +import OAI.NumberTheory.PiExponent.Ampleness.ReesUniversalUniqueness +import OAI.NumberTheory.PiExponent.LocalAlgebra.InvertibleIdealLocal + +namespace OAI + +namespace PiExponentSeshadri.IdealPullback +noncomputable section +open CategoryTheory AlgebraicGeometry +variable {R : Type} [CommRing R] (I : Ideal R) + +lemma specIdeal_coordinate {Y : Scheme} [IsAffine Y] + (f : Y ⟶ Spec (CommRingCat.of R)) : + ((specIdeal I).comap f).ideal ⟨⊤, isAffineOpen_top Y⟩ = + I.map (SpecMaps.coordinate f).hom := by + rw [comap_top, specIdeal_top, Ideal.map_map] + rfl + +end +end PiExponentSeshadri.IdealPullback + +namespace PiExponentSeshadri.ReesGrading +noncomputable section +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Geometry +open SpecMaps +variable {R : Type} [CommRing R] (I : Ideal R) + +lemma invertible_unique {Y : Scheme} (g h : Y ⟶ affineBlowup I) + (f : Y ⟶ Spec (CommRingCat.of R)) + (hg : g ≫ projection I = f) (hh : h ≫ projection I = f) + (hf : InvertiblePullbackIdeal (IdealPullback.specIdeal I) f) : g = h := by + apply Scheme.hom_ext_of_forall g h + intro y + obtain ⟨U, hyU, r, hr, hIr⟩ := + InvertibleLocal.affine_local_equation (IdealPullback.specIdeal I) f hf y + refine ⟨U.1, hyU, ?_⟩ + apply principal_unique I (U.1.ι ≫ g) (U.1.ι ≫ h) (U.1.ι ≫ f) + (by rw [Category.assoc, hg]) (by rw [Category.assoc, hh]) r _ hr + rwa [← Scheme.IdealSheafData.comap_comp, IdealPullback.specIdeal_coordinate] at hIr + +lemma local_lift {Y : Scheme} (f : Y ⟶ Spec (CommRingCat.of R)) + (hf : InvertiblePullbackIdeal (IdealPullback.specIdeal I) f) (y : Y) : + ∃ U : Y.Opens, y ∈ U ∧ ∃ h : U.toScheme ⟶ affineBlowup I, + h ≫ projection I = U.ι ≫ f := by + obtain ⟨U, hyU, r, hr, hIr⟩ := + InvertibleLocal.affine_local_equation (IdealPullback.specIdeal I) f hf y + rw [← Scheme.IdealSheafData.comap_comp, IdealPullback.specIdeal_coordinate] at hIr + refine ⟨U.1, hyU, principalScheme I U.1.toScheme (coordinate (U.1.ι ≫ f)).hom r hIr hr, ?_⟩ + rw [principalScheme_projection] + exact factor (U.1.ι ≫ f) + + +theorem affineBlowup_universal {Y : Scheme} (f : Y ⟶ Spec (CommRingCat.of R)) + (hf : InvertiblePullbackIdeal (IdealPullback.specIdeal I) f) : + ∃! h : Y ⟶ affineBlowup I, h ≫ projection I = f := by + classical + choose U hyU g hg using local_lift I f hf + let C : Y.OpenCover := { + I₀ := Y + X y := (U y).toScheme + f y := (U y).ι + mem₀ := by + rw [Scheme.presieve₀_mem_precoverage_iff] + refine ⟨fun y => ⟨y, ?_⟩, inferInstance⟩ + simpa using hyU y } + have hcompat (x y : C.I₀) : pullback.fst (C.f x) (C.f y) ≫ g x = + pullback.snd (C.f x) (C.f y) ≫ g y := by + let j := pullback.fst (C.f x) (C.f y) ≫ C.f x + apply invertible_unique I _ _ (j ≫ f) + · rw [Category.assoc, hg x] + rfl + · rw [Category.assoc, hg y] + exact (pullback.condition_assoc f).symm + · exact InvertibleLocal.invertible_restrict (IdealPullback.specIdeal I) f hf j + refine ⟨C.glueMorphisms g hcompat, ?_, ?_⟩ + · apply C.hom_ext + intro y + rw [← Category.assoc, C.ι_glueMorphisms] + exact hg y + · intro h hh + exact invertible_unique I h _ f hh (by + apply C.hom_ext + intro y + rw [← Category.assoc, C.ι_glueMorphisms] + exact hg y) hf + +end +end PiExponentSeshadri.ReesGrading + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AffineFunctionFieldCompatibility.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AffineFunctionFieldCompatibility.lean new file mode 100644 index 0000000000000000000000000000000000000000..9999999eff02cb0d5176ed7ec368525395b739bf --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AffineFunctionFieldCompatibility.lean @@ -0,0 +1,114 @@ +import Mathlib.RingTheory.Localization.LocalizationLocalization +import OAI.NumberTheory.PiExponent.Geometry.CurveFunctionFieldCompatibility + +namespace OAI + +noncomputable section +namespace PiExponent.CurveNormalizationModel +open CategoryTheory AlgebraicGeometry +universe u +variable (A E : Type u) [CommRing A] [IsDomain A] [Field E] + [Algebra A E] [IsFractionRing A E] + +theorem isFractionRing_of_intermediate_domain + (B : Type u) [CommRing B] [IsDomain B] [Algebra A B] + [Algebra B E] [IsScalarTower A B E] + (hB : Function.Injective (algebraMap B E)) : IsFractionRing B E where + map_units b := isUnit_iff_ne_zero.mpr (by + intro h + exact (mem_nonZeroDivisors_iff_ne_zero.mp b.2) (hB (by simpa using h))) + surj z := by + obtain ⟨⟨a, s⟩, hs⟩ := IsLocalization.surj (nonZeroDivisors A) z + have hn : algebraMap A B s ≠ 0 := by + intro he + have he' : algebraMap A E s = 0 := by + rw [IsScalarTower.algebraMap_apply A B E, he, map_zero] + exact (mem_nonZeroDivisors_iff_ne_zero.mp s.2) + ((IsFractionRing.injective A E) (by simp at he')) + refine ⟨⟨algebraMap A B a, ⟨algebraMap A B s, mem_nonZeroDivisors_iff_ne_zero.mpr hn⟩⟩, ?_⟩ + simpa only [← IsScalarTower.algebraMap_apply A B E] using hs + exists_of_eq {a b} h := ⟨1, by simpa using hB h⟩ + +def affineFunctionFieldEquiv : (Spec (.of A)).functionField ≃+* E := by + letI : Algebra A (Spec (.of A)).functionField := + AlgebraicGeometry.instAlgebraCarrierFunctionFieldSpec (.of A) + letI : IsFractionRing A (Spec (.of A)).functionField := + functionField_isFractionRing_of_affine (.of A) + exact (IsLocalization.algEquiv (nonZeroDivisors A) (Spec (.of A)).functionField E).toRingEquiv + +@[simp] theorem affineFunctionFieldEquiv_toStalk (a : A) : + affineFunctionFieldEquiv A E (StructureSheaf.toStalk A + (genericPoint (Spec (.of A))) a) = algebraMap A E a := by + let : Algebra A (Spec (.of A)).functionField := + AlgebraicGeometry.instAlgebraCarrierFunctionFieldSpec (.of A) + let : IsFractionRing A (Spec (.of A)).functionField := + functionField_isFractionRing_of_affine (.of A) + exact (IsLocalization.algEquiv (nonZeroDivisors A) + (Spec (.of A)).functionField E).commutes a + +theorem affineFunctionFieldEquiv_stalk (q : PrimeSpectrum A) + [Algebra (Localization.AtPrime q.asIdeal) E] + [IsScalarTower A (Localization.AtPrime q.asIdeal) E] + (a : (Spec (.of A)).presheaf.stalk q) : + affineFunctionFieldEquiv A E + ((Spec (.of A)).presheaf.stalkSpecializes (genericPoint_specializes q) a) = + algebraMap (Localization.AtPrime q.asIdeal) E ((Spec.stalkIso (.of A) q).hom a) := by + let : Algebra A ((Spec (.of A)).presheaf.stalk q) := StructureSheaf.stalkAlgebra A q + let : IsLocalization.AtPrime ((Spec (.of A)).presheaf.stalk q) q.asIdeal := + StructureSheaf.IsLocalization.to_stalk A q + have heq : (affineFunctionFieldEquiv A E).toRingHom.comp + ((Spec (.of A)).presheaf.stalkSpecializes (genericPoint_specializes q)).hom = + (algebraMap (Localization.AtPrime q.asIdeal) E).comp + (Spec.stalkIso (.of A) q).hom.hom := by + apply IsLocalization.ringHom_ext q.asIdeal.primeCompl + apply RingHom.ext + intro b + change affineFunctionFieldEquiv A E + ((Spec (.of A)).presheaf.stalkSpecializes (genericPoint_specializes q) + (StructureSheaf.toStalk A q b)) = + algebraMap (Localization.AtPrime q.asIdeal) E + ((Spec.stalkIso (.of A) q).hom (StructureSheaf.toStalk A q b)) + have hs : (Spec (.of A)).presheaf.stalkSpecializes (genericPoint_specializes q) + (StructureSheaf.toStalk A q b) = + StructureSheaf.toStalk A (genericPoint (Spec (.of A))) b := by + exact congrArg (fun h => h b) + (StructureSheaf.toStalk_stalkSpecializes (R := A) (genericPoint_specializes q)) + have ht : (Spec.stalkIso (.of A) q).hom (StructureSheaf.toStalk A q b) = + algebraMap A (Localization.AtPrime q.asIdeal) b := + (StructureSheaf.stalkIso A q).symm.commutes b + rw [hs, ht, affineFunctionFieldEquiv_toStalk] + exact IsScalarTower.algebraMap_apply A (Localization.AtPrime q.asIdeal) E b + exact RingHom.congr_fun heq a + +theorem affineFunctionFieldEquiv_naturality + (B : Type u) [CommRing B] [IsDomain B] [Algebra A B] + [Algebra B E] [IsFractionRing B E] [IsScalarTower A B E] + [IsOpenImmersion (Spec.map (CommRingCat.ofHom (algebraMap A B)))] : + (affineFunctionFieldEquiv B E).toRingHom.comp + (functionFieldRestriction (Spec.map (CommRingCat.ofHom (algebraMap A B)))).hom = + (affineFunctionFieldEquiv A E).toRingHom := by + let : Algebra A (Spec (.of A)).functionField := + AlgebraicGeometry.instAlgebraCarrierFunctionFieldSpec (.of A) + let : IsFractionRing A (Spec (.of A)).functionField := + functionField_isFractionRing_of_affine (.of A) + apply IsLocalization.ringHom_ext (nonZeroDivisors A) + apply RingHom.ext + intro a + change affineFunctionFieldEquiv B E + (functionFieldRestriction (Spec.map (CommRingCat.ofHom (algebraMap A B))) + (StructureSheaf.toStalk A (genericPoint (Spec (.of A))) a)) = + affineFunctionFieldEquiv A E + (StructureSheaf.toStalk A (genericPoint (Spec (.of A))) a) + have h := congrArg (fun h => h a) + (functionFieldRestriction_toStalk (CommRingCat.ofHom (algebraMap A B))) + change functionFieldRestriction (Spec.map (CommRingCat.ofHom (algebraMap A B))) + (StructureSheaf.toStalk A (genericPoint (Spec (.of A))) a) = + StructureSheaf.toStalk B (genericPoint (Spec (.of B))) (algebraMap A B a) at h + rw [h, affineFunctionFieldEquiv_toStalk, affineFunctionFieldEquiv_toStalk] + exact (IsScalarTower.algebraMap_apply A B E a).symm + +end PiExponent.CurveNormalizationModel + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AffineReesCanonicalRecovery.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AffineReesCanonicalRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..887587304bb78cc0a91d6fe7294e71e68e9829c1 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AffineReesCanonicalRecovery.lean @@ -0,0 +1,33 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesSheafCanonicalValue +import OAI.NumberTheory.PiExponent.Approximation.CanonicalAffineRecovery +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealFiniteGenerators + +namespace OAI + +noncomputable section +namespace PiExponent.AffineReesCanonicalRecovery +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry PiExponentSeshadri.ReesGrading PiExponentSeshadri.IdealPullback +open CanonicalRecoveryProperties +attribute [local irreducible] affineBlowup projection exceptionalLineBundle exceptionalInclusion + ReesSheafCechRecovery.ordinaryGlobalSection + +theorem eventually_comap_bijective {R : Type} [CommRing R] [IsNoetherianRing R] + (I : Ideal R) : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ComapBijective (projection I) (specIdeal (I^n)) ⊤ := by + classical + obtain ⟨m,a,ha⟩ := IdealFiniteGenerators.exists_generators I + obtain ⟨N,hN⟩ := ReesSheafCechRecovery.eventually_recovery_and_cohomology I a ha + refine ⟨N, ?_⟩ + intro n hn + exact (CanonicalAffineRecovery.power_bijective_iff_comap I (projection I) + (exceptionalLineBundle I) (exceptionalInclusion I) (exceptional_presents I) n + (ReesSheafCechRecovery.ordinaryGlobalSection I a ha n) + (ReesSheafCechRecovery.ordinaryGlobalSection_inclusion I a ha n)).mp (hN n hn).1 + +end PiExponent.AffineReesCanonicalRecovery + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleAllPowersGeneration.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleAllPowersGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..3dc216b79d780a945e2a014f29cd17ae5299b734 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleAllPowersGeneration.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleGlobalGeneration +import OAI.NumberTheory.PiExponent.Approximation.ModuleLinePowerLaws +import OAI.NumberTheory.PiExponent.Geometry.LineBundleCoherent + +namespace OAI + +namespace PiExponent.AmpleGlobalGeneration +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} + +theorem ample_eventual_global_generators [NoetherianSpace X] + (L : LineBundle X) (hL : L.IsAmple) (M : X.Modules) [M.IsFinitePresentation] : + ∃ N : ℕ, ∀ n ≥ N, + ∃ G : ((moduleTwistFunctor L n).obj M).GeneratingSections, G.IsFiniteType := by + classical + obtain ⟨d, hd, l, s, hcover, haffine, _⟩ := L.ample_common_degree_cover hL + have hresidue (r : Fin d) : ∃ N : ℕ, ∀ n ≥ N, + ∃ G : ((moduleTwistFunctor (L.pow d) n).obj + ((moduleTwistFunctor L r.val).obj M)).GeneratingSections, G.IsFiniteType := by + let := PiExponent.FiniteGlobalPresentation.moduleTwist_isFinitePresentation L r.val M + exact eventual_global_generators_of_section_cover (L.pow d) + ((moduleTwistFunctor L r.val).obj M) s hcover haffine + choose N hN using hresidue + let B := Finset.univ.sup N + refine ⟨d * B, fun n hn => ?_⟩ + let r : Fin d := ⟨n % d, Nat.mod_lt n hd⟩ + have hB : B ≤ n / d := (Nat.le_div_iff_mul_le hd).mpr (by + simpa only [Nat.mul_comm] using hn) + have hr : N r ≤ n / d := (Finset.le_sup (f := N) (Finset.mem_univ r)).trans hB + obtain ⟨G, hG⟩ := hN r (n / d) hr + let : G.IsFiniteType := hG + let e : ((moduleTwistFunctor (L.pow d) (n / d)).obj + ((moduleTwistFunctor L r.val).obj M)) ≅ (moduleTwistFunctor L n).obj M := + moduleTwistPowerMulIso L ((moduleTwistFunctor L r.val).obj M) d (n / d) ≪≫ + eqToIso (by + change (moduleTwistFunctor L (n % d) ⋙ + moduleTwistFunctor L (d * (n / d))).obj M = _ + rw [← moduleTwistFunctor_add, Nat.mod_add_div]) + exact ⟨SheafOfModules.GeneratingSections.equivOfIso e G, ⟨hG.finite⟩⟩ + +theorem ample_eventual_power_global_generators [NoetherianSpace X] + (L : LineBundle X) (hL : L.IsAmple) : + ∃ N : ℕ, ∀ n ≥ N, + ∃ G : (modulePow X L.sheaf n).GeneratingSections, G.IsFiniteType := by + let : (structureSheaf X).IsFinitePresentation := + PiExponent.GeometrySupport.LineBundleCoherent.structureSheaf_isFinitePresentation + obtain ⟨N, hN⟩ := ample_eventual_global_generators L hL (structureSheaf X) + refine ⟨N, fun n hn => ?_⟩ + obtain ⟨G, hG⟩ := hN n hn + let : G.IsFiniteType := hG + exact ⟨SheafOfModules.GeneratingSections.equivOfIso (moduleTwistUnitIso L n) G, + ⟨hG.finite⟩⟩ + +end +end PiExponent.AmpleGlobalGeneration + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleCommonDegree.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleCommonDegree.lean new file mode 100644 index 0000000000000000000000000000000000000000..e98db7e140b5da372540b28e4b21f905284b6db2 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleCommonDegree.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.PiExponent.Approximation.LinePowerLaws +import OAI.NumberTheory.PiExponent.Approximation.SectionPowerOpens + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace TopologicalSpace.Opens +open scoped AlgebraicGeometry +variable {X : Scheme} + +theorem LineBundle.common_degree (L : LineBundle X) {ι : Type} [Fintype ι] + (d : ι → ℕ) (hd : ∀ i, 0 < d i) + (s : ∀ i, GlobalSections X (modulePow X L.sheaf (d i))) : + ∃ n : ℕ, 0 < n ∧ ∃ t : ι → GlobalSections X (modulePow X L.sheaf n), + ∀ i, sectionOpen X (t i) = sectionOpen X (s i) := by + classical + let n := ∏ i, d i + have hn : 0 < n := Finset.prod_pos (fun i _ => hd i) + have hdiv (i : ι) : d i ∣ n := Finset.dvd_prod_of_mem d (Finset.mem_univ i) + have heq (i : ι) : d i * (n / d i) = n := Nat.mul_div_cancel' (hdiv i) + let e (i : ι) : modulePow X (modulePow X L.sheaf (d i)) (n / d i) ≅ + modulePow X L.sheaf n := + linePowerMul L (d i) (n / d i) ≪≫ eqToIso (congrArg (modulePow X L.sheaf) (heq i)) + refine ⟨n, hn, fun i => powerSection (s i) (n / d i) ≫ (e i).hom, ?_⟩ + intro i + change SectionOpens.isoOpen (powerSection (s i) (n / d i) ≫ (e i).hom) = _ + rw [SectionOpens.isoOpen_postcomp] + exact (L.pow (d i)).sectionOpen_power (s i) + (Nat.div_pos (Nat.le_of_dvd hn (hdiv i)) (hd i)) + +theorem LineBundle.ample_common_degree_cover [CompactSpace X] (L : LineBundle X) + (hL : L.IsAmple) : + ∃ n : ℕ, 0 < n ∧ ∃ l : ℕ, + ∃ s : Fin l → GlobalSections X (modulePow X L.sheaf n), + (⨆ i, sectionOpen X (s i)) = ⊤ ∧ + (∀ i, IsAffineOpen (sectionOpen X (s i))) ∧ + (∀ i, (sectionOpen X (s i) : Set X).Nonempty) := by + classical + have hex (x : X) := hL x ⊤ (by trivial) + choose d hd s hs hst ha using hex + obtain ⟨I, hI⟩ := isCompact_univ.elim_finite_subcover + (fun x => (sectionOpen X (s x) : Set X)) (fun x => (sectionOpen X (s x)).isOpen) + (by intro x _; exact Set.mem_iUnion.mpr ⟨x, hs x⟩) + obtain ⟨n, hn, t, ht⟩ := L.common_degree (fun i : I => d i.val) + (fun i => hd i.val) (fun i => s i.val) + let e := (Fintype.equivFin I).symm + refine ⟨n, hn, Fintype.card I, fun i => t (e i), ?_, ?_, ?_⟩ + · apply top_unique + intro x _ + obtain ⟨i, hi⟩ := Set.mem_iUnion.mp (hI (show x ∈ Set.univ from trivial)) + obtain ⟨hi, hx⟩ := Set.mem_iUnion.mp hi + apply Opens.mem_iSup.mpr + refine ⟨e.symm ⟨i, hi⟩, ?_⟩ + change x ∈ sectionOpen X (t (e (e.symm ⟨i, hi⟩))) + rw [Equiv.apply_symm_apply, ht] + exact hx + · intro i + rw [ht] + exact ha (e i).val + · intro i + rw [ht] + exact ⟨(e i).val, hs (e i).val⟩ + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleCurveDegreePositive.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleCurveDegreePositive.lean new file mode 100644 index 0000000000000000000000000000000000000000..8dcbda180d1b3964c5db815fe39ea8bc4d827683 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleCurveDegreePositive.lean @@ -0,0 +1,155 @@ +import OAI.NumberTheory.PiExponent.Approximation.SectionZeroSupport +import OAI.NumberTheory.PiExponent.Cohomology.AmpleCohomologyFinite +import OAI.NumberTheory.PiExponent.Cohomology.LineCohomologyDimension +import OAI.NumberTheory.PiExponent.Geometry.CurveDegreeAdditivity +import OAI.NumberTheory.PiExponent.Geometry.CurveMorphismFinite + +namespace OAI + +noncomputable section +namespace PiExponent.CurveDegree +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open PiExponent.SectionZeroIdeal +variable {X : Scheme.{0}} + +theorem exists_ample_section_with_zero [IsIntegral X] + (hdim : topologicalKrullDim X = 1) (L : LineBundle X) (hL : L.IsAmple) : + ∃ n : ℕ, 0 < n ∧ ∃ s : GlobalSections X (L.pow n).sheaf, + s ≠ 0 ∧ ∃ y : X, y ∉ sectionOpen X s := by + classical + have : Nontrivial X := by + by_contra h + have : Subsingleton X := not_nontrivial_iff_subsingleton.mp h + have hz := topologicalKrullDim_zero_of_discreteTopology X + rw [hdim] at hz + norm_num at hz + obtain ⟨y, hy⟩ := exists_ne (genericPoint X) + have hclosed := CurveMorphismFinite.isClosed_singleton_of_ne_genericPoint X hdim.le y hy + let U : X.Opens := ⟨({y} : Set X)ᶜ, hclosed.isOpen_compl⟩ + have hη : genericPoint X ∈ U := by + change genericPoint X ≠ y + exact Ne.symm hy + obtain ⟨n, hn, s, hsη, hsub, -⟩ := hL (genericPoint X) U hη + refine ⟨n, hn, s, section_ne_zero_of_mem_isoOpen (L.pow n) s (genericPoint X) hsη, + y, ?_⟩ + intro hys + exact hsub hys rfl + +theorem finite_nonempty_euler_pos [Finite X] [Nonempty X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] (d : ℕ) : + 0 < eulerCharacteristic p d (structureSheaf X) := by + classical + let : Algebra ℂ Γ(X, ⊤) := (baseScalars p).toAlgebra + have : FiniteDimensional ℂ Γ(X, ⊤) := proper_finite_functions p + obtain ⟨x⟩ : Nonempty X := inferInstance + have : Nontrivial Γ(X, ⊤) := (X.presheaf.germ ⊤ x trivial).hom.domain_nontrivial + rw [proper_finite_euler] + change (0 : ℤ) < (Module.finrank ℂ Γ(X, ⊤) : ℤ) + exact_mod_cast (Module.finrank_pos (R := ℂ) (M := Γ(X, ⊤))) + +theorem section_euler_degree_pos [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (hdim : topologicalKrullDim X ≤ 1) + (L : LineBundle X) (s : GlobalSections X L.sheaf) (hs : s ≠ 0) + (hzero : ∃ y : X, y ∉ sectionOpen X s) + (hfiniteO : ∀ n ≤ 1, + letI := Module.compHom (cohomology (structureSheaf X) n) (baseScalars p) + FiniteDimensional ℂ (cohomology (structureSheaf X) n)) + (hfiniteL : ∀ n ≤ 1, + letI := Module.compHom (cohomology L.sheaf n) (baseScalars p) + FiniteDimensional ℂ (cohomology L.sheaf n)) + [Subsingleton (cohomology (structureSheaf X) 2)] : + 0 < eulerCharacteristic p 1 L.sheaf - + eulerCharacteristic p 1 (structureSheaf X) := by + classical + have hsMono : Mono s := L.mono_section s hs + let I := zeroIdeal L s + have hI : I ≠ ⊥ := zeroIdeal_ne_bot L s hs + let : Finite I.subscheme := finite_subscheme_of_curve p hdim I hI + let : Fintype I.subscheme := Fintype.ofFinite _ + obtain ⟨y, hy⟩ := hzero + have hyI : y ∈ I.support := by + change y ∈ ((zeroIdeal L s).support : Set X) + rw [zeroIdeal_support] + exact hy + have hyrange : y ∈ Set.range I.subschemeι := by + rw [Scheme.IdealSheafData.range_subschemeι] + exact hyI + obtain ⟨z, -⟩ := hyrange + have : Nonempty I.subscheme := ⟨z⟩ + have heq : ∀ x : X, ∃ U : X.affineOpens, x ∈ U.1 ∧ + ∃ f : (L.pow 0).sheaf.restrict U.1.ι ≅ O U.1.toScheme, + ∃ e : L.sheaf.restrict U.1.ι ≅ O U.1.toScheme, + I.ideal U = Ideal.span {U.1.topIso.hom + (endValue (f.inv ≫ (Scheme.Modules.restrictFunctor U.1.ι).map s ≫ e.hom))} := by + intro x + obtain ⟨U, hx, ⟨e⟩, -⟩ := common_affine_frames L L x + refine ⟨U, hx, Scheme.Modules.restrictUnitIso U.1.ι, e, ?_⟩ + simpa only [coefficient, restrictSection, Category.assoc] using! zeroIdeal_on_frame L s U e + have : Subsingleton (cohomology (L.pow 0).sheaf 2) := by + change Subsingleton (cohomology (structureSheaf X) 2) + infer_instance + have hdegree := @CartierDegreeLength.cartier_euler_difference_eq_sum_local_lengths + X inferInstance p inferInstance hdim (L.pow 0) L s hsMono I hI heq hfiniteO hfiniteL inferInstance + change eulerCharacteristic p 1 L.sheaf - + eulerCharacteristic p 1 (structureSheaf X) = _ at hdegree + have hsum := proper_finite_euler_eq_sum_stalk_lengths (I.subschemeι ≫ p) 1 + have hpos := finite_nonempty_euler_pos (I.subschemeι ≫ p) 1 + rw [hdegree] + rwa [hsum] at hpos + +theorem ample_euler_degree_pos [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (hdim : topologicalKrullDim X = 1) + (L : LineBundle X) (hL : L.IsAmple) + (hfinite : FiniteLineCohomology p) : + 0 < eulerCharacteristic p 1 L.sheaf - + eulerCharacteristic p 1 (structureSheaf X) := by + have hH2 : LineCohomologyTwoZero X := by + intro M + exact ⟨fun a b => + (NumericalAmpleness.lineBundle_cohomology_zero_of_dimension_le 1 p L hL M + hdim.le 2 (by omega) a).trans + (NumericalAmpleness.lineBundle_cohomology_zero_of_dimension_le 1 p L hL M + hdim.le 2 (by omega) b).symm⟩ + obtain ⟨n, hn, s, hs, hzero⟩ := exists_ample_section_with_zero hdim L hL + have : Subsingleton (cohomology (structureSheaf X) 2) := hH2 (L.pow 0) + have hpos := section_euler_degree_pos p hdim.le (L.pow n) s hs hzero + (hfinite (L.pow 0)) (hfinite (L.pow n)) + rw [power_euler p hdim.le L hL hfinite hH2 L n] at hpos + have hnz : (0 : ℤ) < n := by exact_mod_cast hn + exact (mul_pos_iff_of_pos_left hnz).mp hpos + +theorem finite_line_cohomology_of_ample [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (H : LineBundle X) (hH : H.IsAmple) : FiniteLineCohomology p := by + intro M q _ + let := GeometrySupport.LineBundleCoherent.lineBundle_isFinitePresentation M + exact AmpleCohomologyFinite.cohomology_finite_of_ample p H hH M.sheaf q + +theorem euler_degree_pos_of_ample [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (hdim : topologicalKrullDim X = 1) (L : LineBundle X) (hL : L.IsAmple) : + 0 < eulerCharacteristic p 1 L.sheaf - + eulerCharacteristic p 1 (structureSheaf X) := + ample_euler_degree_pos p hdim L hL (finite_line_cohomology_of_ample p L hL) + +end PiExponent.CurveDegree + +namespace PiExponent.NumericalAmpleness +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry + +theorem curveDegree_pos_of_ample + {X : Scheme.{0}} (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (L : LineBundle X) (hL : L.IsAmple) (C : IntegralCurve X) : + 0 < curveDegree p L C := by + exact CurveDegree.euler_degree_pos_of_ample (C.embedding ≫ p) C.dimension + (L.pullback C.embedding) (LineBundle.IsAmple.pullback_closedImmersion L hL C.embedding) + +end PiExponent.NumericalAmpleness + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleDivisorDimension.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleDivisorDimension.lean new file mode 100644 index 0000000000000000000000000000000000000000..0aba9ad0ad6a9168ea4b50e83cf785800bd0666e --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleDivisorDimension.lean @@ -0,0 +1,96 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleDivisorDimensionBase +import OAI.NumberTheory.PiExponent.LocalAlgebra.IntegralAffineOpenDimension +import OAI.NumberTheory.PiExponent.LocalAlgebra.PrincipalQuotientDimension + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames PiExponentSeshadri.SectionOpens +open PiExponent.SectionZeroIdeal + +variable {X Y : Scheme.{0}} + +theorem sectionZero_pullback_dimension_le (H : LineBundle X) + (s : GlobalSections X H.sheaf) (i : Y ⟶ X) [IsClosedImmersion i] : + topologicalKrullDim (zeroIdeal (H.pullback i) (pullbackSection i s)).subscheme ≤ + topologicalKrullDim (zeroIdeal H s).subscheme := by + let I := zeroIdeal H s + let J := zeroIdeal (H.pullback i) (pullbackSection i s) + have hmap (z : J.subscheme) : i (J.subschemeι z) ∈ (I.support : Set X) := by + have hz := z.property + change J.subschemeι z ∈ (J.support : Set Y) at hz + erw [zeroIdeal_support] at hz ⊢ + change J.subschemeι z ∉ isoOpen (pullbackSection i s) at hz + rw [pullback_isoOpen_eq H s i] at hz + exact hz + have he := (i.isEmbedding.comp J.subschemeι.isEmbedding).codRestrict + (I.support : Set X) hmap + exact he.isInducing.topologicalKrullDim_le + +theorem sectionZero_dimension_succ_ge_of_zero [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [LocallyOfFiniteType p] + (H : LineBundle X) (s : GlobalSections X H.sheaf) + (y : X) (hy : y ∉ sectionOpen X s) : + topologicalKrullDim X ≤ topologicalKrullDim (zeroIdeal H s).subscheme + 1 := by + obtain ⟨V, hyV, ⟨eV⟩⟩ := H.locallyRankOne y + obtain ⟨W, hW, hyW, hWV⟩ := exists_isAffineOpen_mem_and_subset hyV + let U : X.affineOpens := ⟨W, hW⟩ + let e := restrictOpenFrame hWV eV + let : Nonempty U.1 := ⟨⟨y, hyW⟩⟩ + let a : Γ(X,U) := U.1.topIso.hom (coefficient e (restrictSection U.1.ι s)) + have ha : ¬ IsUnit a := by + intro ha + have hc : IsUnit (coefficient e (restrictSection U.1.ι s)) := by + have hh := ha.map U.1.topIso.inv.hom + simpa only [a, ← CommRingCat.comp_apply, Iso.hom_inv_id, + CommRingCat.id_apply] using hh + have hopen := preimage_isoOpen s U.1.ι e + rw [U.1.toScheme.basicOpen_of_isUnit hc] at hopen + have hm : (⟨y,hyW⟩ : U.1.toScheme) ∈ U.1.ι ⁻¹ᵁ isoOpen s := + hopen.ge trivial + exact hy hm + let := IntegralAffineOpenDimension.chartAlgebra p U + let := IntegralAffineOpenDimension.chart_finiteType p U + have hdrop := GeometrySupport.PrincipalQuotientDimension.le_quotient_succ + ℂ Γ(X,U) a ha + rw [← zeroIdeal_on_frame H s U e] at hdrop + rw [IntegralAffineOpenDimension.affine_ring_dimension_eq p U] at hdrop + let I := zeroIdeal H s + have hquot : ringKrullDim (Γ(X,U) ⧸ I.ideal U) ≤ + topologicalKrullDim I.subscheme := by + rw [← PrimeSpectrum.topologicalKrullDim_eq_ringKrullDim] + let : IsOpenImmersion (I.subschemeCover.f U) := I.subschemeCover.map_prop U + exact (I.subschemeCover.f U).isOpenEmbedding.isEmbedding.isInducing.topologicalKrullDim_le + exact hdrop.trans (add_le_add hquot le_rfl) + +theorem regular_ample_sectionZero_dimension + [IsNoetherian X] [Nonempty X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (H : LineBundle X) (hH : H.IsAmple) + (s : GlobalSections X H.sheaf) [Mono s] (d : ℕ) + (hdim : topologicalKrullDim X = ((d+1 : ℕ) : WithBot ℕ∞)) : + Nonempty (zeroIdeal H s).subscheme ∧ + topologicalKrullDim (zeroIdeal H s).subscheme = d := by + refine ⟨ample_section_zero_nonempty p H hH s (d+1) hdim (Nat.succ_pos d), ?_⟩ + apply le_antisymm + · apply regular_sectionZero_dimension_le H s d + simpa only [Nat.cast_add, Nat.cast_one] using hdim.le + · obtain ⟨Y, i, hi, hY, hdimY⟩ := exists_integral_closed_full_dimension X (d+1) hdim + let := hi + let := hY + have hample := LineBundle.IsAmple.pullback_closedImmersion H hH i + obtain ⟨y, hy⟩ := ample_section_has_zero (i ≫ p) (H.pullback i) hample + (pullbackSection i s) (d+1) hdimY (Nat.succ_pos d) + have hlow := sectionZero_dimension_succ_ge_of_zero (i ≫ p) + (H.pullback i) (pullbackSection i s) y hy + rw [hdimY] at hlow + have hbound := hlow.trans (add_le_add (sectionZero_pullback_dimension_le H s i) le_rfl) + apply ENat.WithBot.add_le_add_one_right_iff.mp + simpa only [Nat.cast_add, Nat.cast_one] using hbound + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleDivisorDimensionBase.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleDivisorDimensionBase.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7a9fc11867aa82e1b66e89c138d402b1dbac0cc --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleDivisorDimensionBase.lean @@ -0,0 +1,91 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleCurveDegreePositive +import OAI.NumberTheory.PiExponent.Cohomology.EulerSupportDimension +import OAI.NumberTheory.PiExponent.Geometry.IntegralCurveExistence + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Order +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames PiExponentSeshadri.SectionOpens +open PiExponent.SectionZeroIdeal + +theorem exists_irreducibleClosed_full_dimension (T : Type*) [TopologicalSpace T] + (n : ℕ) (hdim : topologicalKrullDim T = n) : + ∃ Z : IrreducibleCloseds T, topologicalKrullDim (Z : Set T) = n := by + have hdim' : Order.krullDim (IrreducibleCloseds T) = n := hdim + obtain ⟨p, hp⟩ := Order.le_krullDim_iff.mp (le_of_eq hdim'.symm) + have hlast : (p.length : ℕ∞) = Order.height p.last := by + apply le_antisymm (Order.length_le_height_last (p := p)) + have hh := Order.height_le_krullDim p.last + rw [hdim', ← hp] at hh + exact_mod_cast hh + refine ⟨p.last, ?_⟩ + rw [topologicalKrullDim_irreducibleClosed, ← hlast, hp] + rfl + +theorem exists_integral_closed_full_dimension (X : Scheme.{0}) + (n : ℕ) (hdim : topologicalKrullDim X = n) : + ∃ Y : Scheme.{0}, ∃ i : Y ⟶ X, + IsClosedImmersion i ∧ IsIntegral Y ∧ topologicalKrullDim Y = n := by + obtain ⟨Z, hZ⟩ := exists_irreducibleClosed_full_dimension X n hdim + let C : Closeds X := ⟨Z, Z.isClosed⟩ + let I := Scheme.IdealSheafData.vanishingIdeal C + have hs : (I.support : Set X) = (Z : Set X) := by + simp only [I, Scheme.IdealSheafData.coe_support_vanishingIdeal] + rfl + have : IsReduced I.subscheme := isReduced_vanishingIdeal_subscheme C + have : IrreducibleSpace I.subscheme := by + change IrreducibleSpace (I.support : Set X) + rw [hs] + exact Subtype.irreducibleSpace Z.isIrreducible + refine ⟨I.subscheme, I.subschemeι, inferInstance, + isIntegral_of_irreducibleSpace_of_isReduced _, ?_⟩ + change topologicalKrullDim (I.support : Set X) = n + rw [hs] + exact hZ + +variable {X : Scheme.{0}} + +theorem ample_section_has_zero + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (H : LineBundle X) (hH : H.IsAmple) + (s : GlobalSections X H.sheaf) (n : ℕ) + (hdim : topologicalKrullDim X = n) (hn : 0 < n) : + ∃ y : X, y ∉ sectionOpen X s := by + by_contra h + push Not at h + have : IsIso s := isIso_of_locally_isIso s (by + intro x + exact ⟨isoOpen s, h x, isIso_restrict_isoOpen s⟩) + obtain ⟨C⟩ := nonempty_integralCurve_of_dimension_pos X n hdim hn + have hpos := curveDegree_pos_of_ample p H hH C + let e : H.sheaf ≅ structureSheaf X := (asIso s).symm + have he := eulerCharacteristic_iso (C.embedding ≫ p) + ((Scheme.Modules.pullback C.embedding).mapIso e ≪≫ pullbackUnitIso C.embedding) 1 + have hz : curveDegree p H C = 0 := by + unfold curveDegree + change eulerCharacteristic (C.embedding ≫ p) 1 + ((Scheme.Modules.pullback C.embedding).obj H.sheaf) = + eulerCharacteristic (C.embedding ≫ p) 1 (structureSheaf C.scheme) at he + rw [he] + exact sub_self _ + omega + +theorem ample_section_zero_nonempty + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (H : LineBundle X) (hH : H.IsAmple) + (s : GlobalSections X H.sheaf) (n : ℕ) + (hdim : topologicalKrullDim X = n) (hn : 0 < n) : + Nonempty (zeroIdeal H s).subscheme := by + obtain ⟨y, hy⟩ := ample_section_has_zero p H hH s n hdim hn + have hm : y ∈ Set.range (zeroIdeal H s).subschemeι := by + rw [Scheme.IdealSheafData.range_subschemeι, zeroIdeal_support] + exact hy + obtain ⟨z, -⟩ := hm + exact ⟨z⟩ + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleFiniteProjectiveEmbedding.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleFiniteProjectiveEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..9089f6840d90254a52ed4ac340cdcfb6f8e129c6 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleFiniteProjectiveEmbedding.lean @@ -0,0 +1,49 @@ +import OAI.NumberTheory.PiExponent.Ampleness.NoetherianAmpleProjectiveSections +import OAI.NumberTheory.PiExponent.Cohomology.AmpleCohomologyFinite +import OAI.NumberTheory.PiExponent.Geometry.ProjectiveSectionReindex + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.Projective +open PiExponent.ProjectiveO1 +variable {X : Scheme.{0}} + +theorem ample_finite_projective_embedding [Nonempty X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (H : LineBundle X) (hH : H.IsAmple) : + ∃ r : ℕ, ∃ i : X ⟶ projectiveSpace ℂ (Fin (r+1)), + IsClosedImmersion i ∧ i ≫ polynomialProjectiveProjection ℂ (Fin (r+1)) = p := by + classical + let : IsLocallyNoetherian X := LocallyOfFiniteType.isLocallyNoetherian p + let : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace p + let : IsNoetherian X := {} + obtain ⟨n, _, σ, hσ, s, hs, hc⟩ := H.ample_projective_sections_noetherian p hH + let : Fintype σ := hσ + have hne : Nonempty σ := by + obtain ⟨x⟩ : Nonempty X := inferInstance + have hx : x ∈ ⨆ i, PiExponentSeshadri.SectionOpens.isoOpen (s i) := by + rw [hs] + trivial + obtain ⟨i, _⟩ := Opens.mem_iSup.mp hx + exact ⟨i⟩ + have hpos : 0 < Fintype.card σ := Fintype.card_pos_iff.mpr hne + obtain ⟨r, hr⟩ := Nat.exists_eq_succ_of_ne_zero (ne_of_gt hpos) + let e : Fin (r+1) ≃ σ := ((Fintype.equivFin σ).trans (finCongr hr)).symm + let t : Fin (r+1) → GlobalSections X (modulePow X H.sheaf n) := s ∘ e + have ht : (⨆ i, PiExponentSeshadri.SectionOpens.isoOpen (t i)) = ⊤ := + (e.iSup_comp (g := fun j => PiExponentSeshadri.SectionOpens.isoOpen (s j))).trans hs + let k := baseScalars p + let : IsClosedImmersion (sectionsMorphism k s hs) := hc + let i : X ⟶ projectiveSpace ℂ (Fin (r+1)) := sectionsMorphism k t ht + have hclosed : IsClosedImmersion i := sectionsMorphism_reindex_closed k s hs e ht + refine ⟨r, i, hclosed, ?_⟩ + rw [← AmpleCohomologyFinite.projectiveBase_eq_polynomialProjectiveProjection] + exact (sectionsMorphism_over k t ht).trans (toSpec_scalarMap p) + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleFromCover.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleFromCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..366ce95cfe26bba32d11d68cd8dda5eef977c982 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleFromCover.lean @@ -0,0 +1,62 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleProjectiveSections +import OAI.NumberTheory.PiExponent.Approximation.TensorSectionOpen + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Frames PiExponentSeshadri.Projective PiExponentSeshadri.TensorPure +variable {X : Scheme.{0}} + +theorem LineBundle.section_basicOpen [IsIntegral X] [CompactSpace X] + (L : LineBundle X) (s : O X ⟶ L.sheaf) + (hne : (sectionOpen X s : Set X).Nonempty) (f : Γ(X,sectionOpen X s)) : + ∃ n : ℕ, 0 < n ∧ ∃ t : O X ⟶ (L.pow n).sheaf, + sectionOpen X t = X.basicOpen f := by + let U := sectionOpen X s + obtain ⟨N,hN⟩ := L.power_extension_ratio s hne (U.topIso.inv f) + let n := max N 1 + have hn : 0 < n := lt_of_lt_of_le (by decide : 0<1) (le_max_right N 1) + obtain ⟨t,ht⟩ := hN n (le_max_left N 1) + let q := tensorSection s t + have hsub : SectionOpens.isoOpen q ≤ U := by + exact (section_open L (L.pow n) s t).le.trans inf_le_left + have hi : IsIso (restrictSection U.ι (powerSection s n)) := + isIso_restricted_section _ _ (L.sectionOpen_power s hn) + let e : (L.pow n).sheaf.restrict U.ι ≅ O U.toScheme := + (asIso (restrictSection U.ι (powerSection s n))).symm + have hcoef : coefficient e (restrictSection U.ι t) = U.topIso.inv f := by + apply coefficient_ratio e (powerSection s n) t + · exact coefficient_frame e + · exact ht + have hnorm : coefficient (sectionFrame s) (restrictSection U.ι s) = 1 := + sectionFrame_normalized s + have hpre : U.ι ⁻¹ᵁ SectionOpens.isoOpen q = U.toScheme.basicOpen (U.topIso.inv f) := by + refine (preimage_isoOpen q U.ι (tensorFrame L (L.pow n) U (sectionFrame s) e)).trans ?_ + apply congrArg U.toScheme.basicOpen + exact (local_section_coefficient L (L.pow n) U (sectionFrame s) e s t).trans + ((congrArg₂ (fun (a b : Γ(U.toScheme, ⊤)) => a * b) hnorm hcoef).trans + (one_mul _)) + refine ⟨n+1,by omega,q,?_⟩ + change SectionOpens.isoOpen q = _ + calc + _ = U.ι ''ᵁ (U.ι ⁻¹ᵁ SectionOpens.isoOpen q) := by + rw [Scheme.Hom.image_preimage_eq_opensRange_inf,Scheme.Opens.opensRange_ι,inf_eq_right.mpr hsub] + _ = _ := by rw [hpre,U.ι_image_basicOpen_topIso_inv] + +theorem LineBundle.ample_of_affine_section_cover [IsIntegral X] [CompactSpace X] + (L : LineBundle X) {ι : Type*} (s : ι → (O X ⟶ L.sheaf)) + (hc : (⨆ i, sectionOpen X (s i)) = ⊤) + (ha : ∀ i, IsAffineOpen (sectionOpen X (s i))) : L.IsAmple := by + intro x V hx + have hc' : x ∈ ⨆ i, sectionOpen X (s i) := by rw [hc]; trivial + obtain ⟨i,hi⟩ := Opens.mem_iSup.mp hc' + obtain ⟨f,hf,hxf⟩ := (ha i).exists_basicOpen_le ⟨x,hx⟩ hi + obtain ⟨n,hn,t,ht⟩ := L.section_basicOpen (s i) ⟨x,hi⟩ f + exact ⟨n,hn,t,ht.symm ▸ hxf,ht.le.trans hf,ht.symm ▸ (ha i).basicOpen f⟩ + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleGeneratedTensor.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleGeneratedTensor.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7c56fdbb6c9996e02a983907fb43f0c68b83c89 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleGeneratedTensor.lean @@ -0,0 +1,89 @@ +import OAI.NumberTheory.PiExponent.Ampleness.FinitePullbackAmple +import OAI.NumberTheory.PiExponent.Ampleness.LineAmpleOperations +import OAI.NumberTheory.PiExponent.Approximation.GeneratorsSectionCover +import OAI.NumberTheory.PiExponent.Geometry.LineBundleInverse + +namespace OAI + +noncomputable section +namespace PiExponentSeshadri.Geometry + +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Frames PiExponentSeshadri.TensorPure + + +variable {X : Scheme.{0}} + +theorem LineBundle.IsAmple.tensor_of_section_cover {H M : LineBundle X} + (hH : H.IsAmple) {ι : Type} (s : ι → GlobalSections X M.sheaf) + (hc : (⨆ i, sectionOpen X (s i)) = ⊤) : (H.tensor M).IsAmple := by + intro x V hx + obtain ⟨i, hi⟩ := Opens.mem_iSup.mp + (show x ∈ ⨆ i, sectionOpen X (s i) by rw [hc]; trivial) + obtain ⟨n, hn, a, hxa, haV, haa⟩ := + hH x (V ⊓ sectionOpen X (s i)) ⟨hx, hi⟩ + let b : GlobalSections X (M.pow n).sheaf := powerSection (s i) n + have hb : sectionOpen X b = sectionOpen X (s i) := M.sectionOpen_power (s i) hn + let q : GlobalSections X ((H.tensor M).pow n).sheaf := + tensorSection a b ≫ (lineTensorPow H M n).inv + have hq : sectionOpen X q = sectionOpen X a := by + change SectionOpens.isoOpen + (tensorSection a b ≫ (lineTensorPow H M n).symm.hom) = _ + erw [SectionOpens.isoOpen_postcomp] + calc + SectionOpens.isoOpen (tensorSection a b) = + sectionOpen X a ⊓ sectionOpen X b := section_open (H.pow n) (M.pow n) a b + _ = sectionOpen X a := by + rw [hb, inf_eq_left.mpr (haV.trans inf_le_right)] + exact ⟨n, hn, q, hq.symm ▸ hxa, hq.le.trans (haV.trans inf_le_left), hq.symm ▸ haa⟩ + +theorem LineBundle.IsAmple.tensor_of_generatingSections {H M : LineBundle X} + (hH : H.IsAmple) (G : M.sheaf.GeneratingSections) [G.IsFiniteType] : + (H.tensor M).IsAmple := + hH.tensor_of_section_cover (PiExponent.GeneratorsSectionCover.generatorSection M G) + (PiExponent.GeneratorsSectionCover.generators_sectionOpen_cover M G) + +theorem LineBundle.isAmple_of_generated_factor (L H M : LineBundle X) + (hH : H.IsAmple) {n : ℕ} (hn : 0 < n) + (e : (H.tensor M).sheaf ≅ (L.pow n).sheaf) + (G : M.sheaf.GeneratingSections) [G.IsFiniteType] : L.IsAmple := + LineBundle.IsAmple.of_pow L hn + (PiExponent.AmpleIso.isAmple_of_sheaf_iso (H.tensor M) (L.pow n) e + (hH.tensor_of_generatingSections G)) + +def ampleInverseTwistCancel (H L : LineBundle X) (n : ℕ) : + (H.tensor (H.inverse.tensor (L.pow n))).sheaf ≅ (L.pow n).sheaf := + (lineTensorAssoc H H.inverse (L.pow n)).symm ≪≫ + moduleTensorIso (lineTensorInverseIso H) (Iso.refl (L.pow n).sheaf) ≪≫ + moduleTensorUnit (L.pow n).sheaf + +theorem LineBundle.isAmple_of_inverse_twist_section_cover (L H : LineBundle X) + (hH : H.IsAmple) {n : ℕ} (hn : 0 < n) {ι : Type} + (s : ι → GlobalSections X (H.inverse.tensor (L.pow n)).sheaf) + (hc : (⨆ i, sectionOpen X (s i)) = ⊤) : L.IsAmple := + LineBundle.IsAmple.of_pow L hn + (PiExponent.AmpleIso.isAmple_of_sheaf_iso + (H.tensor (H.inverse.tensor (L.pow n))) (L.pow n) + (ampleInverseTwistCancel H L n) (hH.tensor_of_section_cover s hc)) + +theorem LineBundle.isAmple_of_inverse_twist_generatingSections (L H : LineBundle X) + (hH : H.IsAmple) {n : ℕ} (hn : 0 < n) + (G : (H.inverse.tensor (L.pow n)).sheaf.GeneratingSections) [G.IsFiniteType] : + L.IsAmple := + L.isAmple_of_generated_factor H (H.inverse.tensor (L.pow n)) hH hn + (ampleInverseTwistCancel H L n) G + +theorem LineBundle.isAmple_of_inverse_moduleTwist_generatingSections (L H : LineBundle X) + (hH : H.IsAmple) {n : ℕ} (hn : 0 < n) + (G : ((moduleTwistFunctor L n).obj H.inverse.sheaf).GeneratingSections) + [G.IsFiniteType] : L.IsAmple := by + let e := moduleTwistPowerIso L H.inverse.sheaf n + let G' := SheafOfModules.GeneratingSections.equivOfIso e G + exact @LineBundle.isAmple_of_inverse_twist_generatingSections X L H hH n hn G' + ⟨(inferInstance : G.IsFiniteType).finite⟩ + +end PiExponentSeshadri.Geometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleGlobalGeneration.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleGlobalGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..909ccea0943ece8b82651396fd01e4c68d8faf6b --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleGlobalGeneration.lean @@ -0,0 +1,132 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleCommonDegree +import OAI.NumberTheory.PiExponent.Approximation.GlueGlobalGenerators +import OAI.NumberTheory.PiExponent.Approximation.TwistGlobalExtension +import OAI.NumberTheory.PiExponent.LocalAlgebra.FiniteGlobalPresentation + +namespace OAI + +namespace PiExponent.AmpleGlobalGeneration +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open PiExponent.CoherentAffineFinite +variable {X : Scheme.{0}} + +theorem sectionMultiply_isIso_restrict (M : X.Modules) {L : X.Modules} + (s : structureSheaf X ⟶ L) (U : X.Opens) + [IsIso ((Scheme.Modules.restrictFunctor U.ι).map s)] : + IsIso ((Scheme.Modules.restrictFunctor U.ι).map (moduleSectionMultiplyRight M s)) := by + let R := Scheme.Modules.restrictFunctor U.ι + have h : IsIso (R.map (moduleTensorMap (𝟙 M) s)) := by + apply (isIso_comp_right_iff _ (moduleTensorRestrict U M L).hom).mp + rw [moduleTensorRestrict_natural] + infer_instance + change IsIso (R.map ((moduleTensorRightUnit M).inv ≫ moduleTensorMap (𝟙 M) s)) + rw [Functor.map_comp] + infer_instance + +theorem twistSection_isIso_restrict (L : LineBundle X) + (s : structureSheaf X ⟶ L.sheaf) (M : X.Modules) (n : ℕ) : + IsIso ((Scheme.Modules.restrictFunctor (sectionOpen X s).ι).map + ((moduleTwistSection L s n).app M)) := by + have : IsIso ((Scheme.Modules.restrictFunctor (sectionOpen X s).ι).map s) := + PiExponentSeshadri.SectionOpens.isIso_restrict_isoOpen s + induction n with + | zero => change IsIso ((Scheme.Modules.restrictFunctor (sectionOpen X s).ι).map (𝟙 M)); infer_instance + | succ n ih => + change IsIso ((Scheme.Modules.restrictFunctor (sectionOpen X s).ι).map + (((moduleTwistSection L s n).app M) ≫ + moduleSectionMultiplyRight ((moduleTwistFunctor L n).obj M) s)) + rw [Functor.map_comp] + have := sectionMultiply_isIso_restrict ((moduleTwistFunctor L n).obj M) s (sectionOpen X s) + infer_instance + +lemma openSectionEquiv_restrict_from_top (M : X.Modules) (U : X.Opens) + (z : Γ(M,⊤)) : + openSectionEquiv M U (restrictSection U.ι ((moduleSectionEquiv M).symm z)) = + M.presheaf.map (homOfLE (show U ≤ ⊤ from le_top)).op z := by + rw [openSectionEquiv_restrict] + have h := section_value_natural ((moduleSectionEquiv M).symm z) + (homOfLE (show U ≤ ⊤ from le_top)) + rw [← moduleSectionEquiv_apply, Equiv.apply_symm_apply] at h + exact h.symm + +lemma openSectionEquiv_postcomp {M N : X.Modules} (f : M ⟶ N) (U : X.Opens) + (a : structureSheaf U.toScheme ⟶ M.restrict U.ι) : + openSectionEquiv N U (a ≫ (Scheme.Modules.restrictFunctor U.ι).map f) = + f.app U (openSectionEquiv M U a) := by + change N.presheaf.map (eqToHom U.ι_image_top.symm).op + (f.app (U.ι ''ᵁ ⊤) (a.app ⊤ (1 : Γ(U.toScheme,⊤)))) = + f.app U (M.presheaf.map (eqToHom U.ι_image_top.symm).op + (a.app ⊤ (1 : Γ(U.toScheme,⊤)))) + exact (congr($(f.mapPresheaf.naturality (eqToHom U.ι_image_top.symm).op) + (a.app ⊤ (1 : Γ(U.toScheme,⊤))))).symm + +theorem affine_local_generators (M : X.Modules) [M.IsFinitePresentation] + (U : X.Opens) (hU : IsAffineOpen U) : + ∃ σ : (M.restrict U.ι).GeneratingSections, σ.IsFiniteType := by + have : IsAffine U.toScheme := hU + let : M.IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData M).choose.isQuasicoherent + have := affine_sections_finite_of_localGenerators (M.restrict U.ι) + ((locallyFinitelyGenerated_of_finitePresentation M).restrict U.ι) + exact affine_exists_finite_generators (M.restrict U.ι) + +theorem eventual_global_generators_of_section_cover [NoetherianSpace X] + (L : LineBundle X) (M : X.Modules) [M.IsFinitePresentation] + {ι : Type} [Finite ι] (s : ι → (structureSheaf X ⟶ L.sheaf)) + (hcover : (⨆ i, sectionOpen X (s i)) = ⊤) + (haffine : ∀ i, IsAffineOpen (sectionOpen X (s i))) : + ∃ N : ℕ, ∀ n ≥ N, + ∃ G : ((moduleTwistFunctor L n).obj M).GeneratingSections, G.IsFiniteType := by + classical + let : M.IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData M).choose.isQuasicoherent + let U (i : ι) := sectionOpen X (s i) + choose σ hσ using fun i => affine_local_generators M (U i) (haffine i) + let (i : ι) : (σ i).IsFiniteType := hσ i + let (i : ι) : Finite (σ i).I := (hσ i).finite + let a (i : ι) (j : (σ i).I) := + (M.restrict (U i).ι).unitHomEquiv.symm ((σ i).s j) + let x (i : ι) (j : (σ i).I) : Γ(M,U i) := openSectionEquiv M (U i) (a i j) + choose d hd using fun ij : Σ i, (σ i).I => + PiExponent.TwistGlobalExtension.global_twist_extension_native L (s ij.1) M (x ij.1 ij.2) + let : Fintype (Σ i, (σ i).I) := Fintype.ofFinite _ + let N := Finset.univ.sup d + refine ⟨N, fun n hn => ?_⟩ + let Q := (moduleTwistFunctor L n).obj M + have hn' (ij : Σ i, (σ i).I) : d ij ≤ n := + (Finset.le_sup (f := d) (Finset.mem_univ ij)).trans hn + choose z hz using fun ij : Σ i, (σ i).I => hd ij n (hn' ij) + let f (i : ι) : M.restrict (U i).ι ⟶ Q.restrict (U i).ι := + (Scheme.Modules.restrictFunctor (U i).ι).map ((moduleTwistSection L (s i) n).app M) + have hf (i : ι) : IsIso (f i) := twistSection_isIso_restrict L (s i) M n + let τ (i : ι) : (Q.restrict (U i).ι).GeneratingSections := + SheafOfModules.GeneratingSections.equivOfIso + (@asIso _ _ _ _ (f i) (hf i)) (σ i) + let (i : ι) : (τ i).IsFiniteType := ⟨(hσ i).finite⟩ + let t (i : ι) (j : (τ i).I) : GlobalSections X Q := + (moduleSectionEquiv Q).symm (z ⟨i,j⟩) + have ht (i : ι) (j : (τ i).I) : restrictSection (U i).ι (t i j) = + (Q.restrict (U i).ι).unitHomEquiv.symm ((τ i).s j) := by + apply (openSectionEquiv Q (U i)).injective + change openSectionEquiv Q (U i) + (restrictSection (U i).ι ((moduleSectionEquiv Q).symm (z ⟨i,j⟩))) = + openSectionEquiv Q (U i) ((Q.restrict (U i).ι).unitHomEquiv.symm + (SheafOfModules.sectionsMap (f i) ((σ i).s j))) + erw [openSectionEquiv_restrict_from_top, ← SheafOfModules.unitHomEquiv_symm_comp] + erw [openSectionEquiv_postcomp] + exact hz ⟨i,j⟩ + exact PiExponent.GlueGlobalGenerators.exists_finite_global_generators Q U hcover τ t ht + +theorem ample_power_eventual_global_generators [NoetherianSpace X] + (L : LineBundle X) (hL : L.IsAmple) (M : X.Modules) [M.IsFinitePresentation] : + ∃ d : ℕ, 0 < d ∧ ∃ N : ℕ, ∀ n ≥ N, + ∃ G : ((moduleTwistFunctor (L.pow d) n).obj M).GeneratingSections, G.IsFiniteType := by + obtain ⟨d, hd, l, s, hcover, haffine, _⟩ := L.ample_common_degree_cover hL + exact ⟨d, hd, eventual_global_generators_of_section_cover (L.pow d) M s hcover haffine⟩ + +end +end PiExponent.AmpleGlobalGeneration + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleIso.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleIso.lean new file mode 100644 index 0000000000000000000000000000000000000000..53b75e00de31a870d190fdda15cb5337d0b67dda --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleIso.lean @@ -0,0 +1,37 @@ +import OAI.NumberTheory.PiExponent.Geometry.LineBundleTensor + +namespace OAI + +namespace PiExponent.AmpleIso + +noncomputable section + +open CategoryTheory AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Geometry + +variable {X : Scheme} + +theorem sectionOpen_postcomp_iso {M N : X.Modules} + (s : GlobalSections X M) (e : M ≅ N) : + sectionOpen X (s ≫ e.hom) = sectionOpen X s := by + simp only [sectionOpen, Functor.map_comp, isIso_comp_right_iff] + +theorem isAmple_of_sheaf_iso (L M : LineBundle X) (e : L.sheaf ≅ M.sheaf) + (hL : L.IsAmple) : M.IsAmple := by + intro x V hx + obtain ⟨n, hn, s, hsx, hsV, hsa⟩ := hL x V hx + let ePow : modulePow X L.sheaf n ≅ modulePow X M.sheaf n := + (modulePowFunctor n).mapIso e + refine ⟨n, hn, s ≫ ePow.hom, ?_, ?_, ?_⟩ + · rwa [sectionOpen_postcomp_iso] + · rwa [sectionOpen_postcomp_iso] + · rwa [sectionOpen_postcomp_iso] + +theorem isAmple_iff_sheaf_iso (L M : LineBundle X) (e : L.sheaf ≅ M.sheaf) : + L.IsAmple ↔ M.IsAmple := + ⟨isAmple_of_sheaf_iso L M e, isAmple_of_sheaf_iso M L e.symm⟩ + +end +end PiExponent.AmpleIso + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmplePositiveTwist.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmplePositiveTwist.lean new file mode 100644 index 0000000000000000000000000000000000000000..eaaad05abcf6484859444541c478fe09a19dd168 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmplePositiveTwist.lean @@ -0,0 +1,80 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleFromCover +import OAI.NumberTheory.PiExponent.Approximation.FrameSubopens +import OAI.NumberTheory.PiExponent.Approximation.MixedFrameExtension + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite +open PiExponentSeshadri.Frames PiExponentSeshadri.TensorPure PiExponentSeshadri.Projective +variable {X : Scheme.{0}} + +theorem LineBundle.ample_framed_cover [CompactSpace X] (L M : LineBundle X) + (hL : L.IsAmple) (a : ℕ) (ha : 0 < a) : + ∃ d : ℕ, 0 < d ∧ a ∣ d ∧ ∃ ι : Type, ∃ _ : Fintype ι, + ∃ s : ι → GlobalSections X (L.pow d).sheaf, + (⨆ i, sectionOpen X (s i)) = ⊤ ∧ + (∀ i, IsAffineOpen (sectionOpen X (s i))) ∧ + (∀ i, (sectionOpen X (s i) : Set X).Nonempty) ∧ + (∀ i, Nonempty (M.sheaf.restrict (sectionOpen X (s i)).ι ≅ O (sectionOpen X (s i)).toScheme)) := by + classical + choose V hV e using M.locallyRankOne + have hh (x : X) := hL x (V x) (hV x) + choose d hd s hs hsub haff using hh + obtain ⟨I,hI⟩ := isCompact_univ.elim_finite_subcover + (fun x => (sectionOpen X (s x) : Set X)) (fun x => (sectionOpen X (s x)).isOpen) + (by intro x _; exact Set.mem_iUnion.mpr ⟨x,hs x⟩) + obtain ⟨n,hn,t,ht⟩ := L.common_degree (fun i : I => d i.val) + (fun i => hd i.val) (fun i => s i.val) + let f := linePowerMul L n a + let q (i : I) : GlobalSections X (L.pow (n*a)).sheaf := + powerSection (t i) a ≫ f.hom + have hq (i : I) : sectionOpen X (q i) = sectionOpen X (s i.val) := by + change SectionOpens.isoOpen (powerSection (t i) a ≫ f.hom) = _ + erw [SectionOpens.isoOpen_postcomp] + exact ((L.pow n).sectionOpen_power (t i) ha).trans (ht i) + refine ⟨n*a,Nat.mul_pos hn ha,dvd_mul_left a n,I,inferInstance,q,?_,?_,?_,?_⟩ + · apply top_unique + intro x _ + obtain ⟨i,hi⟩ := Set.mem_iUnion.mp (hI (show x ∈ Set.univ from trivial)) + obtain ⟨hi,hx⟩ := Set.mem_iUnion.mp hi + refine Opens.mem_iSup.mpr ⟨⟨i,hi⟩,?_⟩ + rw [hq] + exact hx + · intro i + rw [hq] + exact haff i.val + · intro i + rw [hq] + exact ⟨i.val,hs i.val⟩ + · intro i + exact ⟨Frames.restrictOpenFrame ((hq i).le.trans (hsub i.val)) (Classical.choice (e i.val))⟩ + +theorem LineBundle.exists_ample_twist [IsIntegral X] [CompactSpace X] + (L M : LineBundle X) (hL : L.IsAmple) : + ∃ d : ℕ, 0 < d ∧ ((L.pow d).tensor M).IsAmple := by + classical + obtain ⟨a,ha,-,ι,hi,s,hs,hsa,hsn,he⟩ := L.ample_framed_cover M hL 1 (by decide) + choose N hN using fun i => (L.pow a).mixed_frame_extension M (s i) (hsn i) + (Classical.choice (he i)) + let n := Finset.univ.sup N + choose t ht hval using fun i => hN i n (Finset.le_sup (Finset.mem_univ i)) + let e := moduleTensorIso (linePowerMul L a (n+1)) (Iso.refl M.sheaf) + let q (i : ι) : GlobalSections X ((L.pow (a*(n+1))).tensor M).sheaf := + t i ≫ e.hom + have hq (i : ι) : sectionOpen X (q i) = sectionOpen X (s i) := by + change SectionOpens.isoOpen (t i ≫ e.hom) = _ + erw [SectionOpens.isoOpen_postcomp] + exact ht i + refine ⟨a*(n+1),Nat.mul_pos ha (by omega), + ((L.pow (a*(n+1))).tensor M).ample_of_affine_section_cover q ?_ ?_⟩ + · simpa only [hq] using hs + · intro i + rw [hq] + exact hsa i + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleProjectiveSections.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleProjectiveSections.lean new file mode 100644 index 0000000000000000000000000000000000000000..386f47bd726be6b8c7d71d6db8ec34fe4067de69 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleProjectiveSections.lean @@ -0,0 +1,153 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleCommonDegree +import OAI.NumberTheory.PiExponent.Approximation.PowerSectionExtension +import OAI.NumberTheory.PiExponent.Geometry.ProjectiveFramedSections + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.Geometry + +section +open CategoryTheory AlgebraicGeometry TopologicalSpace +open scoped AlgebraicGeometry +open PiExponentSeshadri.Frames PiExponentSeshadri.Projective +variable {X : Scheme} + +lemma isIso_restricted_section {M : X.Modules} (s : O X ⟶ M) (U : X.Opens) + (hU : SectionOpens.isoOpen s = U) : IsIso (restrictSection U.ι s) := by + subst U + change IsIso (sectionFrame s).inv + exact (sectionFrame s).isIso_inv + +theorem LineBundle.power_extension_ratio [IsIntegral X] [CompactSpace X] (L : LineBundle X) + (s : GlobalSections X L.sheaf) (hD : (sectionOpen X s : Set X).Nonempty) + (f : Γ((sectionOpen X s).toScheme, ⊤)) : + ∃ N : ℕ, ∀ n ≥ N, ∃ t : GlobalSections X (modulePow X L.sheaf n), + restrictSection (sectionOpen X s).ι t = scalarEnd f ≫ + restrictSection (sectionOpen X s).ι (powerSection s n) := by + obtain ⟨N, hN⟩ := L.power_extension s hD ((sectionOpen X s).topIso.hom f) + refine ⟨N, fun n hn => ?_⟩ + obtain ⟨t, ht⟩ := hN n hn + refine ⟨t, ?_⟩ + apply (openSectionEquiv (modulePow X L.sheaf n) (sectionOpen X s)).injective + erw [openSectionEquiv_restrict, openSectionEquiv_scalar, openSectionEquiv_restrict] + exact ht + +lemma coefficient_ratio {M : X.Modules} {U : X.Opens} + (e : M.restrict U.ι ≅ O U.toScheme) (s t : O X ⟶ M) + (f : Γ(U.toScheme, ⊤)) (hs : coefficient e (restrictSection U.ι s) = 1) + (ht : restrictSection U.ι t = scalarEnd f ≫ restrictSection U.ι s) : + coefficient e (restrictSection U.ι t) = f := by + rw [ht] + change endValue (scalarEnd f ≫ restrictSection U.ι s ≫ e.hom) = f + rw [endValue_comp, endValue_scalarEnd] + change f * coefficient e (restrictSection U.ι s) = f + rw [hs, mul_one] + +end + +section +open CategoryTheory AlgebraicGeometry TopologicalSpace MvPolynomial +open scoped AlgebraicGeometry +open PiExponentSeshadri.Frames PiExponentSeshadri.Projective +variable {X : Scheme} {K ι : Type} [CommRing K] [Fintype ι] + +theorem LineBundle.power_section_embedding [IsIntegral X] [CompactSpace X] + (p : X ⟶ Spec (CommRingCat.of K)) [IsProper p] (L : LineBundle X) + (s : ι → GlobalSections X L.sheaf) + (hc : (⨆ i, sectionOpen X (s i)) = ⊤) + (haff : ∀ i, IsAffineOpen (sectionOpen X (s i))) + (hne : ∀ i, (sectionOpen X (s i) : Set X).Nonempty) : + ∃ n : ℕ, 0 < n ∧ ∃ σ : Type, ∃ _ : Fintype σ, + ∃ t : σ → GlobalSections X (modulePow X L.sheaf n), + ∃ ht : (⨆ i, SectionOpens.isoOpen (t i)) = ⊤, + IsClosedImmersion (sectionsMorphism + (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of K)).inv.hom) t ht) := by + classical + let k := p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of K)).inv.hom + let U (i : ι) := sectionOpen X (s i) + have hfinite (i : ι) : ∃ m : ℕ, ∃ b : Fin m → Γ((U i).toScheme, ⊤), + Function.Surjective (eval₂Hom ((U i).ι.appTop.hom.comp k) b) := by + let : IsAffine (U i).toScheme := haff i + obtain ⟨m, b, hb⟩ := affine_coordinate_generators ((U i).ι ≫ p) + refine ⟨m, b, ?_⟩ + simpa only [Scheme.Hom.comp_appTop, CommRingCat.hom_comp, RingHom.comp_assoc, k] using hb + choose m b hb using hfinite + choose N hN using fun i j => L.power_extension_ratio (s i) (hne i) (b i j) + let n := max 1 (Finset.univ.sup (fun v : (i : ι) × Fin (m i) => N v.1 v.2)) + have hn : 0 < n := lt_of_lt_of_le Nat.zero_lt_one (le_max_left _ _) + have hn' (i : ι) (j : Fin (m i)) : N i j ≤ n := + (Finset.le_sup (f := fun v : (i : ι) × Fin (m i) => N v.1 v.2) + (Finset.mem_univ ⟨i, j⟩)).trans (le_max_right _ _) + choose t ht using fun i j => hN i j n (hn' i j) + let σ := ι ⊕ ((i : ι) × Fin (m i)) + let S : σ → GlobalSections X (modulePow X L.sheaf n) := + Sum.elim (fun i => powerSection (s i) n) (fun v => t v.1 v.2) + have hU (i : ι) : SectionOpens.isoOpen (S (Sum.inl i)) = U i := + L.sectionOpen_power (s i) hn + have hSn (i : ι) : IsIso (restrictSection (U i).ι (S (Sum.inl i))) := + isIso_restricted_section _ _ (hU i) + let e (i : ι) : (modulePow X L.sheaf n).restrict (U i).ι ≅ O (U i).toScheme := + (asIso (restrictSection (U i).ι (S (Sum.inl i)))).symm + have hnorm (i : ι) : coefficient (e i) (restrictSection (U i).ι (S (Sum.inl i))) = 1 := + coefficient_frame (e i) + have hS : (⨆ v, SectionOpens.isoOpen (S v)) = ⊤ := by + apply top_unique + rw [← hc] + apply iSup_le + intro i + exact (le_of_eq (hU i).symm).trans (le_iSup (fun v : σ => SectionOpens.isoOpen (S v)) (Sum.inl i)) + have hproper : IsProper (X.toSpecΓ ≫ Spec.map (CommRingCat.ofHom k)) := by + rw [toSpec_scalarMap] + infer_instance + have hgen (i : ι) : Function.Surjective + (eval₂Hom ((U i).ι.appTop.hom.comp k) + (fun v => coefficient (e i) (restrictSection (U i).ι (S v)))) := by + have heq : (fun v => coefficient (e i) (restrictSection (U i).ι (S v))) ∘ + (fun j : Fin (m i) => Sum.inr (⟨i, j⟩ : (i : ι) × Fin (m i))) = b i := by + funext j + exact coefficient_ratio (e i) (S (Sum.inl i)) (S (Sum.inr ⟨i, j⟩)) (b i j) + (hnorm i) (ht i j) + intro r + obtain ⟨q, hq⟩ := hb i r + refine ⟨rename (fun j : Fin (m i) => Sum.inr (⟨i, j⟩ : (i : ι) × Fin (m i))) q, ?_⟩ + rw [eval₂Hom_rename, heq] + exact hq + have hclosed := framedSectionsMorphism_closed k S U hc e Sum.inl hnorm hU + (fun i => haff i) hgen + rw [framedSectionsMorphism_eq_sectionsMorphism k S hS U hc e Sum.inl hnorm] at hclosed + exact ⟨n, hn, σ, inferInstance, S, hS, hclosed⟩ + +end + +open AlgebraicGeometry CategoryTheory TopologicalSpace +open scoped AlgebraicGeometry +open PiExponentSeshadri.Frames PiExponentSeshadri.Projective +variable {X : Scheme} {K : Type} [CommRing K] + +theorem LineBundle.ample_projective_sections [IsIntegral X] [CompactSpace X] + (p : X ⟶ Spec (CommRingCat.of K)) [IsProper p] + (L : LineBundle X) (hL : L.IsAmple) : + ∃ n : ℕ, 0 < n ∧ ∃ σ : Type, ∃ _ : Fintype σ, + ∃ t : σ → GlobalSections X (modulePow X L.sheaf n), + ∃ ht : (⨆ i, SectionOpens.isoOpen (t i)) = ⊤, + IsClosedImmersion (sectionsMorphism + (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of K)).inv.hom) t ht) := by + obtain ⟨d, hd, l, s, hc, ha, hn⟩ := L.ample_common_degree_cover hL + obtain ⟨n, hn', σ, hσ, t, ht, he⟩ := (L.pow d).power_section_embedding p s hc ha hn + let e : modulePow X (L.pow d).sheaf n ≅ modulePow X L.sheaf (d * n) := + linePowerMul L d n + let T : σ → GlobalSections X (modulePow X L.sheaf (d*n)) := fun i => t i ≫ e.hom + have hT : (⨆ i, SectionOpens.isoOpen (T i)) = ⊤ := by + exact (iSup_congr (fun i => SectionOpens.isoOpen_postcomp (t i) e)).trans ht + refine ⟨d*n, Nat.mul_pos hd hn', σ, hσ, T, hT, ?_⟩ + have htransport := sectionsMorphism_transport + (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of K)).inv.hom) t ht e hT + exact htransport.symm ▸ he + +end PiExponentSeshadri.Geometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleSlopeAlgebra.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleSlopeAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb88c203b48dcbd5f3a28fed4291f540a599fcd3 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleSlopeAlgebra.lean @@ -0,0 +1,103 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmplePositiveTwist +import OAI.NumberTheory.PiExponent.Ampleness.FinitePullbackAmple +import OAI.NumberTheory.PiExponent.Ampleness.LineAmpleOperations +import OAI.NumberTheory.PiExponent.Geometry.LineBundleInverse + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} + +def slopeBundle (L H : LineBundle X) (a b : ℕ) : LineBundle X := + (L.pow b).tensor (H.pow a) + +def slopeBundlePowIso (L H : LineBundle X) (a b n : ℕ) : + ((slopeBundle L H a b).pow n).sheaf ≅ (slopeBundle L H (a*n) (b*n)).sheaf := + lineTensorPow (L.pow b) (H.pow a) n ≪≫ + moduleTensorIso (linePowerMul L b n) (linePowerMul H a n) + +def slopeBundleAddIso (L H : LineBundle X) (a b e : ℕ) : + ((slopeBundle L H a b).tensor (H.pow e)).sheaf ≅ (slopeBundle L H (a+e) b).sheaf := + lineTensorAssoc (L.pow b) (H.pow a) (H.pow e) ≪≫ + moduleTensorIso (Iso.refl _) (linePowerAdd H a e).symm + +def slopeBundleCongrIso (L H : LineBundle X) (a b c d : ℕ) + (ha : a = c) (hb : b = d) : + (slopeBundle L H a b).sheaf ≅ (slopeBundle L H c d).sheaf := by + subst c + subst d + exact Iso.refl _ + +def slopeBundleCrossIso (L H : LineBundle X) (a b c d : ℕ) (h : a*d ≤ c*b) : + (((slopeBundle L H a b).pow d).tensor (H.pow (c*b-a*d))).sheaf ≅ + ((slopeBundle L H c d).pow b).sheaf := + moduleTensorIso (slopeBundlePowIso L H a b d) (Iso.refl _) ≪≫ + slopeBundleAddIso L H (a*d) (b*d) (c*b-a*d) ≪≫ + slopeBundleCongrIso L H (a*d+(c*b-a*d)) (b*d) (c*b) (d*b) + (Nat.add_sub_of_le h) (Nat.mul_comm b d) ≪≫ + (slopeBundlePowIso L H c d b).symm + +theorem ample_tensor_nonnegative_power (A H : LineBundle X) + (hA : A.IsAmple) (hH : H.IsAmple) (n : ℕ) : (A.tensor (H.pow n)).IsAmple := by + cases n with + | zero => + exact PiExponent.AmpleIso.isAmple_of_sheaf_iso A (A.tensor (H.pow 0)) + (moduleTensorRightUnit A.sheaf).symm hA + | succ n => exact hA.tensor (hH.pow (n+1) (by omega)) + +theorem ample_slope_of_cross_le (L H : LineBundle X) (hH : H.IsAmple) + (a b c d : ℕ) (hb : 0 < b) (hd : 0 < d) (hcross : a*d ≤ c*b) + (hA : (slopeBundle L H a b).IsAmple) : (slopeBundle L H c d).IsAmple := by + have hp := ample_tensor_nonnegative_power ((slopeBundle L H a b).pow d) H + (hA.pow d hd) hH (c*b-a*d) + apply LineBundle.IsAmple.of_pow (slopeBundle L H c d) hb + exact PiExponent.AmpleIso.isAmple_of_sheaf_iso _ _ (slopeBundleCrossIso L H a b c d hcross) hp + +def linePowerTensorInverseIso (H : LineBundle X) (a : ℕ) (ha : 0 < a) : + ((H.pow a).tensor H.inverse).sheaf ≅ (H.pow (a-1)).sheaf := + moduleTensorIso + (eqToIso (congrArg (fun n => (H.pow n).sheaf) (by omega : a = a-1+1)) ≪≫ + linePowerAdd H (a-1) 1 ≪≫ + moduleTensorIso (Iso.refl _) (moduleTensorRightUnit H.sheaf)) + (Iso.refl _) ≪≫ moduleTensorInverseCancelIso (H.pow (a-1)).sheaf H + +def slopeBundleSubtractIso (L H : LineBundle X) (a b : ℕ) (ha : 0 < a) : + ((slopeBundle L H a b).tensor H.inverse).sheaf ≅ (slopeBundle L H (a-1) b).sheaf := + lineTensorAssoc (L.pow b) (H.pow a) H.inverse ≪≫ + moduleTensorIso (Iso.refl _) (linePowerTensorInverseIso H a ha) + +theorem exists_smaller_ample_slope [IsIntegral X] [CompactSpace X] + (L H : LineBundle X) (a b : ℕ) (ha : 0 < a) (hb : 0 < b) + (hA : (slopeBundle L H a b).IsAmple) : + ∃ n : ℕ, 0 < n ∧ (slopeBundle L H (a*n-1) (b*n)).IsAmple ∧ + ((a*n-1 : ℕ) : ℚ) / (b*n : ℕ) < (a:ℚ)/b := by + obtain ⟨n,hn,hamp⟩ := (slopeBundle L H a b).exists_ample_twist H.inverse hA + have han := Nat.mul_pos ha hn + have ham : (slopeBundle L H (a*n-1) (b*n)).IsAmple := + PiExponent.AmpleIso.isAmple_of_sheaf_iso _ _ + (moduleTensorIso (slopeBundlePowIso L H a b n) (Iso.refl _) ≪≫ + slopeBundleSubtractIso L H (a*n) (b*n) han) hamp + refine ⟨n,hn,ham,?_⟩ + have hbq : (0:ℚ) < b := by exact_mod_cast hb + have hnq : (0:ℚ) < n := by exact_mod_cast hn + have hsub : ((a*n-1:ℕ):ℚ) = (a:ℚ)*n-1 := by + rw [Nat.cast_sub (by omega : 1 ≤ a*n), Nat.cast_mul, Nat.cast_one] + rw [hsub, Nat.cast_mul] + apply (div_lt_div_iff₀ (mul_pos hbq hnq) hbq).mpr + nlinarith + +theorem exists_ample_slope [IsIntegral X] [CompactSpace X] + (L H : LineBundle X) (hH : H.IsAmple) : + ∃ a : ℕ, 0 < a ∧ (slopeBundle L H a 1).IsAmple := by + obtain ⟨a,ha,hA⟩ := H.exists_ample_twist L hH + refine ⟨a,ha,PiExponent.AmpleIso.isAmple_of_sheaf_iso _ _ ?_ hA⟩ + exact moduleTensorComm (H.pow a).sheaf L.sheaf ≪≫ + moduleTensorIso (moduleTensorRightUnit L.sheaf).symm (Iso.refl _) + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleSlopeTopology.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleSlopeTopology.lean new file mode 100644 index 0000000000000000000000000000000000000000..82f0474aa8be79ffdbada0a2be766ff50923ce54 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/AmpleSlopeTopology.lean @@ -0,0 +1,73 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleSlopeAlgebra + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory Set +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} + +def ampleSlopes (L H : LineBundle X) : Set ℝ := + {t | ∃ a b : ℕ, 0 < b ∧ t = (a : ℝ)/b ∧ (slopeBundle L H a b).IsAmple} + +def ampleThreshold (L H : LineBundle X) : ℝ := sInf (ampleSlopes L H) + +lemma ampleSlopes_bddBelow (L H : LineBundle X) : BddBelow (ampleSlopes L H) := by + refine ⟨0, ?_⟩ + rintro t ⟨a,b,hb,rfl,ha⟩ + exact div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _) + +lemma ampleSlopes_nonempty [IsIntegral X] [CompactSpace X] + (L H : LineBundle X) (hH : H.IsAmple) : (ampleSlopes L H).Nonempty := by + obtain ⟨a,ha,hA⟩ := exists_ample_slope L H hH + exact ⟨(a:ℝ)/1,a,1,by decide,by norm_num,hA⟩ + +lemma ampleThreshold_nonneg [IsIntegral X] [CompactSpace X] + (L H : LineBundle X) (hH : H.IsAmple) : 0 ≤ ampleThreshold L H := by + apply le_csInf (ampleSlopes_nonempty L H hH) + rintro t ⟨a,b,hb,rfl,ha⟩ + exact div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _) + +theorem ample_of_threshold_lt [IsIntegral X] [CompactSpace X] + (L H : LineBundle X) (hH : H.IsAmple) (a b : ℕ) (hb : 0 < b) + (ht : ampleThreshold L H < (a:ℝ)/b) : (slopeBundle L H a b).IsAmple := by + obtain ⟨t,htmem,htt⟩ := exists_lt_of_csInf_lt (ampleSlopes_nonempty L H hH) ht + obtain ⟨c,e,he,rfl,hA⟩ := htmem + apply ample_slope_of_cross_le L H hH c e a b he hb _ hA + have hcross := (div_lt_div_iff₀ (by exact_mod_cast he : (0:ℝ) P.eval t / (t+ε)^d + have hbase (x : ℝ) (hx : x ∈ Icc r b) : 0 < x+ε := by + have := hx.1 + linarith + have hderiv (x : ℝ) (hx : x ∈ Icc r b) : + HasDerivAt Q + ((P.derivative.eval x * (x+ε)^d - + P.eval x * ((d:ℝ) * (x+ε)^(d-1))) / ((x+ε)^d)^2) x := by + convert! (P.hasDerivAt x).div (((hasDerivAt_id x).add_const ε).pow d) + (pow_ne_zero d (ne_of_gt (hbase x hx))) using 1 + simp + have hanti : AntitoneOn Q (Icc r b) := by + apply antitoneOn_of_deriv_nonpos (convex_Icc r b) + · exact P.continuousOn.div ((continuous_id.add continuous_const).pow d).continuousOn + (fun x hx => pow_ne_zero d (ne_of_gt (hbase x hx))) + · intro x hx + exact (hderiv x (interior_subset hx)).differentiableAt.differentiableWithinAt + · intro x hx + have hx' : r < x := (show x ∈ Ioo r b by simpa only [interior_Icc] using hx).1 + have h := hderivative x hx' + rw [(hderiv x (interior_subset hx)).deriv] + apply div_nonpos_of_nonpos_of_nonneg _ (sq_nonneg _) + cases d with + | zero => + simp only [Nat.cast_zero, zero_mul, pow_zero, mul_one, mul_zero, sub_zero] at h ⊢ + exact nonpos_of_mul_nonpos_left (by simpa only [mul_comm] using h) + (hbase x (interior_subset hx)) + | succ n => + have he : P.derivative.eval x * (x+ε)^(n+1) - + P.eval x * ((n+1:ℕ):ℝ) * (x+ε)^n = + (x+ε)^n * ((x+ε)*P.derivative.eval x - ((n+1:ℕ):ℝ)*P.eval x) := by + rw [pow_succ] + ring + have hn : (x+ε)^n * ((x+ε)*P.derivative.eval x - + ((n+1:ℕ):ℝ)*P.eval x) ≤ 0 := + mul_nonpos_of_nonneg_of_nonpos (le_of_lt (pow_pos (hbase x (interior_subset hx)) n)) + (sub_nonpos.mpr h) + simpa only [Nat.succ_eq_add_one, Nat.add_sub_cancel, ← mul_assoc, he] using hn + have hle : Q b ≤ Q r := hanti ⟨le_rfl,hrb.le⟩ ⟨hrb.le,le_rfl⟩ hrb.le + have hq : 0 < Q b := div_pos hpositive + (pow_pos (by linarith) d) + exact (div_pos_iff_of_pos_right (pow_pos (by linarith : 0 < r+ε) d)).mp (hq.trans_le hle) + +theorem polynomial_pos_at_boundary_of_margin + (P : Polynomial ℝ) (d : ℕ) (r ε : ℝ) (hr : 0 ≤ r) (hε : 0 < ε) + (hpositive : ∀ t : ℝ, r < t → 0 < P.eval t) + (hderivative : ∀ t : ℝ, r < t → + (t+ε) * P.derivative.eval t ≤ (d:ℝ) * P.eval t) : 0 < P.eval r := + polynomial_pos_at_left_of_margin P d r ε (r+1) hr hε (by linarith) + (hpositive (r+1) (by linarith)) hderivative + +theorem polynomial_pos_at_boundary_of_rational_margin + (P : Polynomial ℝ) (d : ℕ) (r ε : ℝ) (hr : 0 ≤ r) (hε : 0 < ε) + (hpositive : ∀ t : ℚ, r < (t:ℝ) → 0 < P.eval (t:ℝ)) + (hderivative : ∀ t : ℚ, r < (t:ℝ) → + ((t:ℝ)+ε) * P.derivative.eval (t:ℝ) ≤ (d:ℝ) * P.eval (t:ℝ)) : + 0 < P.eval r := by + have hreal (x : ℝ) : x ≤ r ∨ (x+ε)*P.derivative.eval x ≤ (d:ℝ)*P.eval x := by + refine DenseRange.induction_on + (Rat.denseRange_cast : DenseRange (fun q : ℚ => (q:ℝ))) x ?_ ?_ + · exact isClosed_le continuous_id continuous_const |>.union + (isClosed_le ((continuous_id.add continuous_const).mul P.derivative.continuous) + (continuous_const.mul P.continuous)) + · intro q + by_cases hq : (q:ℝ) ≤ r + · exact Or.inl hq + · exact Or.inr (hderivative q (lt_of_not_ge hq)) + obtain ⟨b,hrb,hb⟩ := exists_rat_btwn (show r < r+1 by linarith) + exact polynomial_pos_at_left_of_margin P d r ε (b:ℝ) hr hε hrb (hpositive b hrb) + (fun x hx => (hreal x).resolve_left (not_le_of_gt hx)) + +theorem nonnegative_rat_nat_ratio (q : ℚ) (hq : 0 ≤ q) : + ∃ a b : ℕ, 0 < b ∧ (q:ℝ) = (a:ℝ)/b := by + refine ⟨q.num.natAbs,q.den,q.pos,?_⟩ + have hn : 0 ≤ q.num := Rat.num_nonneg.mpr hq + rw [Rat.cast_def, Nat.cast_natAbs, abs_of_nonneg hn] + +theorem exists_positive_rational_below_of_polynomial_pos + (P : Polynomial ℝ) (r : ℝ) (hr : 0 < r) (hP : 0 < P.eval r) : + ∃ q : ℚ, 0 < (q:ℝ) ∧ (q:ℝ) < r ∧ 0 < P.eval (q:ℝ) := by + have hn : {t : ℝ | 0 < P.eval t} ∈ 𝓝 r := + P.continuousAt.preimage_mem_nhds (Ioi_mem_nhds hP) + obtain ⟨a,ha,hsub⟩ := exists_Ioc_subset_of_mem_nhds' hn hr + obtain ⟨q,haq,hqr⟩ := exists_rat_btwn ha.2 + exact ⟨q,ha.1.trans_lt haq,hqr,hsub ⟨haq,hqr.le⟩⟩ + +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupAffineSections.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupAffineSections.lean new file mode 100644 index 0000000000000000000000000000000000000000..d458c2b5d0cd0add65f62270259dae77b1fdbdd2 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupAffineSections.lean @@ -0,0 +1,28 @@ +import OAI.NumberTheory.PiExponent.Ampleness.BlowupPresentationRestriction +import OAI.NumberTheory.PiExponent.Ampleness.BlowupUniversalBaseChange +import OAI.NumberTheory.PiExponent.Ampleness.ReesRelativeSections + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Frames +variable {X B : Scheme.{0}} {I : X.IdealSheafData} {π : B ⟶ X} + +theorem IsBlowup.affine_section_cover [IsAffine X] (hπ : IsBlowup I π) + (J : LineBundle B) (ι : J.sheaf ⟶ O B) (hJ : PresentsPullbackIdeal I π J ι) : + ∃ (α : Type) (s : α → (O B ⟶ J.sheaf)), + (⨆ a, SectionOpens.isoOpen (s a)) = ⊤ ∧ + ∀ a, IsAffineOpen (SectionOpens.isoOpen (s a)) := by + let A := I.ideal ⟨⊤,isAffineOpen_top X⟩ + have hp := hπ.postIso X.isoSpec (IdealPullback.specIdeal A) + (IdealPullback.specIdeal_comap_toSpec I) + obtain ⟨s,hs,ha⟩ := ReesGrading.relative_affine_section_cover A + (π ≫ X.isoSpec.hom) J ι (presents_post_toSpec J ι hJ) hp + exact ⟨A,s,hs,ha⟩ + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupAmpleTwist.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupAmpleTwist.lean new file mode 100644 index 0000000000000000000000000000000000000000..a93b437bd8edb18cf8e9ab6f7136f310ac1fec27 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupAmpleTwist.lean @@ -0,0 +1,86 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleFromCover +import OAI.NumberTheory.PiExponent.Ampleness.AmpleIso +import OAI.NumberTheory.PiExponent.Ampleness.BlowupAffineSections +import OAI.NumberTheory.PiExponent.Ampleness.BlowupProperIntegral +import OAI.NumberTheory.PiExponent.Ampleness.ClosedAmpleRestriction +import OAI.NumberTheory.PiExponent.Ampleness.RelativeAffineSectionAmple +import OAI.NumberTheory.PiExponent.Geometry.ProjectiveSectionsPullback + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.Geometry +section +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Frames PiExponentSeshadri.SectionOpens PiExponentSeshadri.Projective +variable {X : Scheme.{0}} + +variable {B : Scheme.{0}} {I : X.IdealSheafData} {π : B ⟶ X} + +theorem IsBlowup.eventual_ample_exceptional_twist [IsIntegral B] [CompactSpace B] + [CompactSpace X] (hπ : IsBlowup I π) (L : LineBundle X) (hL : L.IsAmple) + (J : LineBundle B) (ι : J.sheaf ⟶ O B) (hJ : PresentsPullbackIdeal I π J ι) : + ∃ a N : ℕ, 0 < a ∧ ∀ n : ℕ, N ≤ n → + ((((L.pow a).pullback π).pow (n+1)).tensor J).IsAmple := by + classical + obtain ⟨a,ha,l,s,hs,hsa,-⟩ := L.ample_common_degree_cover hL + let P := (L.pow a).pullback π + let t (i : Fin l) : O B ⟶ P.sheaf := pullbackSection π (s i) + have ht i : isoOpen (t i) = π ⁻¹ᵁ isoOpen (s i) := pullback_isoOpen_eq (L.pow a) (s i) π + have hc : (⨆ i,isoOpen (t i)) = ⊤ := pullback_sections_cover s hs π + have hloc (i : Fin l) : ∃ (α : Type) + (w : α → (O (isoOpen (t i)).toScheme ⟶ J.sheaf.restrict (isoOpen (t i)).ι)), + (⨆ a,isoOpen (w a)) = ⊤ ∧ ∀ a, IsAffineOpen (isoOpen (w a)) := by + rw [ht] + let U : X.affineOpens := ⟨isoOpen (s i),hsa i⟩ + let : IsAffine U.1.toScheme := U.2 + exact (hπ.morphismRestrict U.1).affine_section_cover (J.restrict (π ⁻¹ᵁ U.1).ι) + (InvertibleLocal.restrictedInclusion J ι (π ⁻¹ᵁ U.1).ι) + (presents_morphismRestrict J ι hJ U) + obtain ⟨N,hN⟩ := P.eventual_twist_affine_cover J t hc hloc + refine ⟨a,N,ha,fun n hn => ?_⟩ + obtain ⟨σ,hσ,q,hq,hqa,-⟩ := hN n hn + exact ((P.pow (n+1)).tensor J).ample_of_affine_section_cover q hq hqa + +end + +open CategoryTheory AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Frames +variable {X B : Scheme.{0}} {I : X.IdealSheafData} {π : B ⟶ X} + +theorem IsBlowup.exists_ample_exceptional_power_gt_one + [IsIntegral B] [CompactSpace B] [CompactSpace X] + (hπ : IsBlowup I π) (L : LineBundle X) (hL : L.IsAmple) + (J : LineBundle B) (ι : J.sheaf ⟶ O B) (hJ : PresentsPullbackIdeal I π J ι) : + ∃ a : ℕ, 1 < a ∧ (((L.pullback π).pow a).tensor J).IsAmple := by + obtain ⟨a,N,ha,h⟩ := hπ.eventual_ample_exceptional_twist L hL J ι hJ + refine ⟨a*(N+2), ?_, ?_⟩ + · have hmul := Nat.mul_le_mul_right (N+2) (Nat.succ_le_of_lt ha) + omega + · apply PiExponent.AmpleIso.isAmple_of_sheaf_iso _ _ _ (h (N+1) (by omega)) + exact moduleTensorIso + ((modulePowFunctor (N+2)).mapIso (PullbackTensor.powIso π L a) ≪≫ + linePowerMul (L.pullback π) a (N+2)) (Iso.refl _) + +end PiExponentSeshadri.Geometry + +namespace PiExponentSeshadri.BlowupGluing +open CategoryTheory AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} [IsIntegral X] [IsLocallyNoetherian X] [CompactSpace X] + +theorem exists_ample_exceptional_power_gt_one (I : X.IdealSheafData) + (hI : I.support ≠ ⊤) (L : LineBundle X) (hL : L.IsAmple) : + ∃ a : ℕ, 1 < a ∧ + (((L.pullback (projection I)).pow a).tensor (exceptionalLineBundle I)).IsAmple := by + let := scheme_isIntegral I hI + let : CompactSpace (scheme I) := QuasiCompact.compactSpace_of_compactSpace (projection I) + exact (isBlowup I).exists_ample_exceptional_power_gt_one L hL + (exceptionalLineBundle I) (exceptionalInclusion I) (exceptional_presents I) + +end PiExponentSeshadri.BlowupGluing + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupComplement.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupComplement.lean new file mode 100644 index 0000000000000000000000000000000000000000..f40d09f5c331ffa5832e4b09c50d24319cd78671 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupComplement.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.PiExponent.Ampleness.GlobalBlowupGluing + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry +variable {X Y B : Scheme.{0}} {I : X.IdealSheafData} {π : B ⟶ X} + +lemma invertible_top (f : Y ⟶ X) : InvertiblePullbackIdeal ⊤ f := by + apply InvertibleLocal.invertible_of_local_equations + intro y + obtain ⟨U, hU, hyU, _⟩ := exists_isAffineOpen_mem_and_subset + (show y ∈ (⊤ : Y.Opens) from trivial) + refine ⟨⟨U, hU⟩, hyU, 1, isRegular_one, ?_⟩ + simp + +lemma isBlowup_id (hI : InvertiblePullbackIdeal I (𝟙 X)) : + IsBlowup I (𝟙 X) := by + refine ⟨hI, fun Y f _ => ⟨f, by simp, ?_⟩⟩ + intro g hg + simpa using hg + +lemma IsBlowup.isIso_of_invertible (hπ : IsBlowup I π) + (hI : InvertiblePullbackIdeal I (𝟙 X)) : IsIso π := by + have hπe : (hπ.iso (isBlowup_id hI)).hom = π := by + simpa using hπ.iso_hom_comp (isBlowup_id hI) + rw [← hπe] + infer_instance + +lemma IsBlowup.isIso_over_complement (hπ : IsBlowup I π) : + IsIso (pullback.fst (Scheme.Opens.ι (X := X) I.support.compl) π) := by + apply (hπ.open_baseChange (Scheme.Opens.ι (X := X) I.support.compl)).isIso_of_invertible + have he : I.comap (Scheme.Opens.ι (X := X) I.support.compl) = ⊤ := by + apply (Scheme.IdealSheafData.support_eq_bot_iff _).mp + rw [Scheme.IdealSheafData.support_comap] + ext x + change (x.val ∈ I.support ↔ False) + exact iff_false_intro x.property + rw [he] + exact invertible_top _ + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupCurveMargin.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupCurveMargin.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c5c7abc5ea3cd2f2a7a3e94fb2dd6e0617f69d2 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupCurveMargin.lean @@ -0,0 +1,176 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleCurveDegreePositive +import OAI.NumberTheory.PiExponent.Ampleness.NefAmple +import OAI.NumberTheory.PiExponent.Approximation.ConstantPullbackDegree +import OAI.NumberTheory.PiExponent.Geometry.AdmissibleCurveInequality +import OAI.NumberTheory.PiExponent.LocalAlgebra.InvertibleIdealAway + +namespace OAI + +noncomputable section +namespace PiExponent.BlowupCurveMargin +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry +open NumericalAmpleness +variable {B X : Scheme.{0}} + +theorem curve_degree_laws (p : B ⟶ Spec (.of ℂ)) [IsProper p] + (H : LineBundle B) (hH : H.IsAmple) (C : IntegralCurve B) : + (∀ L M : LineBundle B, curveDegree p (L.tensor M) C = + curveDegree p L C + curveDegree p M C) ∧ + (∀ (L : LineBundle B) (n : ℕ), curveDegree p (L.pow n) C = + (n : ℤ) * curveDegree p L C) := by + let HC := H.pullback C.embedding + have hHC : HC.IsAmple := LineBundle.IsAmple.pullback_closedImmersion H hH C.embedding + have hfinite := CurveDegree.finite_line_cohomology_of_ample (C.embedding ≫ p) HC hHC + have hH2 : CurveDegree.LineCohomologyTwoZero C.scheme := by + intro M + exact ⟨fun a b => + (lineBundle_cohomology_zero_of_dimension_le 1 (C.embedding ≫ p) HC hHC M + C.dimension.le 2 (by omega) a).trans + (lineBundle_cohomology_zero_of_dimension_le 1 (C.embedding ≫ p) HC hHC M + C.dimension.le 2 (by omega) b).symm⟩ + exact ⟨fun L M => curveDegree_tensor p H hH L M C hfinite hH2, + fun L n => curveDegree_pow p H hH L C hfinite hH2 n⟩ + +def marginCoefficient (a : ℕ) (σ : ℝ) : ℝ := σ / ((a : ℝ) * (1 + σ) - 1) + +theorem marginCoefficient_pos {a : ℕ} (ha : 1 < a) {σ : ℝ} (hσ : 0 < σ) : + 0 < marginCoefficient a σ := by + apply div_pos hσ + exact NefAmple.combination_denominator_pos (by exact_mod_cast ha) hσ + +theorem margin_of_nonnegative_degree + (p : B ⟶ Spec (.of ℂ)) [IsProper p] (A J : LineBundle B) + (a : ℕ) (ha : 1 < a) (hample : ((A.pow a).tensor J).IsAmple) + (σ : ℝ) (hσ : 0 < σ) (C : IntegralCurve B) + (hn : 0 ≤ (curveDegree p A C : ℝ) + (1 + σ) * (curveDegree p J C : ℝ)) : + marginCoefficient a σ * (curveDegree p ((A.pow a).tensor J) C : ℝ) ≤ + (curveDegree p (A.tensor J) C : ℝ) := by + obtain ⟨ht,hp⟩ := curve_degree_laws p ((A.pow a).tensor J) hample C + rw [ht, hp, ht] + push_cast + unfold marginCoefficient + have ha' : 1 < (a : ℝ) := by exact_mod_cast ha + have hd := NefAmple.combination_denominator_pos ha' hσ + rw [div_mul_eq_mul_div] + apply (div_le_iff₀ hd).mpr + have hn' := mul_nonneg (sub_pos.mpr ha').le hn + nlinarith + +theorem curveDegree_zero_of_frame (p : B ⟶ Spec (.of ℂ)) + (J : LineBundle B) (C : IntegralCurve B) + (e : (J.pullback C.embedding).sheaf ≅ structureSheaf C.scheme) : + curveDegree p J C = 0 := by + unfold curveDegree + change eulerCharacteristic (C.embedding ≫ p) 1 (J.pullback C.embedding).sheaf - _ = 0 + rw [eulerCharacteristic_iso (C.embedding ≫ p) e 1] + exact sub_self _ + +theorem margin_of_exceptional_frame + (p : B ⟶ Spec (.of ℂ)) [IsProper p] (A J : LineBundle B) + (a : ℕ) (ha : 1 < a) (hample : ((A.pow a).tensor J).IsAmple) + (σ : ℝ) (hσ : 0 < σ) (C : IntegralCurve B) + (e : (J.pullback C.embedding).sheaf ≅ structureSheaf C.scheme) : + marginCoefficient a σ * (curveDegree p ((A.pow a).tensor J) C : ℝ) ≤ + (curveDegree p (A.tensor J) C : ℝ) := by + have hj := curveDegree_zero_of_frame p J C e + have hpos := curveDegree_pos_of_ample p ((A.pow a).tensor J) hample C + obtain ⟨ht,hp⟩ := curve_degree_laws p ((A.pow a).tensor J) hample C + rw [ht, hp, hj, add_zero] at hpos + have ha' : (0 : ℤ) < a := by exact_mod_cast (Nat.zero_lt_of_lt ha) + have hA := (mul_pos_iff_of_pos_left ha').mp hpos + apply margin_of_nonnegative_degree p A J a ha hample σ hσ C + rw [hj] + simpa using (show (0 : ℝ) ≤ (curveDegree p A C : ℝ) by exact_mod_cast hA.le) + +theorem margin_of_avoids_center + (p : B ⟶ Spec (.of ℂ)) [IsProper p] + (I : X.IdealSheafData) (π : B ⟶ X) (A J : LineBundle B) + (ι : J.sheaf ⟶ structureSheaf B) (hJ : PresentsPullbackIdeal I π J ι) + (a : ℕ) (ha : 1 < a) (hample : ((A.pow a).tensor J).IsAmple) + (σ : ℝ) (hσ : 0 < σ) (C : IntegralCurve B) + (havoid : ∀ c : C.scheme, (C.embedding ≫ π) c ∉ I.support) : + marginCoefficient a σ * (curveDegree p ((A.pow a).tensor J) C : ℝ) ≤ + (curveDegree p (A.tensor J) C : ℝ) := + margin_of_exceptional_frame p A J a ha hample σ hσ C + (InvertibleIdealAway.pullbackIsoOfAvoids I π J ι hJ C.embedding havoid) + +theorem margin_of_image_outside_chart + (p : B ⟶ Spec (.of ℂ)) [IsProper p] + (I : X.IdealSheafData) (π : B ⟶ X) (A J : LineBundle B) + (ι : J.sheaf ⟶ structureSheaf B) (hJ : PresentsPullbackIdeal I π J ι) + (a : ℕ) (ha : 1 < a) (hample : ((A.pow a).tensor J).IsAmple) + (σ : ℝ) (hσ : 0 < σ) (C : IntegralCurve B) + (U : X.Opens) (hsupport : (I.support : Set X) ⊆ U) + (hmiss : ∀ c : C.scheme, (C.embedding ≫ π) c ∉ U) : + marginCoefficient a σ * (curveDegree p ((A.pow a).tensor J) C : ℝ) ≤ + (curveDegree p (A.tensor J) C : ℝ) := + margin_of_avoids_center p I π A J ι hJ a ha hample σ hσ C + (fun c hc => hmiss c (hsupport hc)) + +theorem margin_of_contracted + (p : B ⟶ Spec (.of ℂ)) [IsProper p] (π : B ⟶ X) + (L : LineBundle X) (J : LineBundle B) + (a : ℕ) (ha : 1 < a) (hample : (((L.pullback π).pow a).tensor J).IsAmple) + (σ : ℝ) (hσ : 0 < σ) (C : IntegralCurve B) + (x : X) (hc : Set.range (C.embedding ≫ π) ⊆ ({x} : Set X)) : + marginCoefficient a σ * (curveDegree p (((L.pullback π).pow a).tensor J) C : ℝ) ≤ + (curveDegree p ((L.pullback π).tensor J) C : ℝ) := by + have hA := ConstantPullbackDegree.curveDegree_eq_zero_of_contracted p L π C x hc + have hpos := curveDegree_pos_of_ample p (((L.pullback π).pow a).tensor J) hample C + obtain ⟨ht,hp⟩ := curve_degree_laws p (((L.pullback π).pow a).tensor J) hample C + rw [ht, hp, hA, mul_zero, zero_add] at hpos + apply margin_of_nonnegative_degree p (L.pullback π) J a ha hample σ hσ C + rw [hA] + exact add_nonneg (by norm_num) (mul_nonneg (by linarith) + (by exact_mod_cast hpos.le)) + +variable {ν Λ D : ℝ} (d : AdmissibleParameters ν Λ D) +variable {E : Type*} [Field E] [Algebra ℂ E] [Algebra.EssFiniteType ℂ E] + +def contactSum (y : E) (x : Fin d.m → E) + (hgen : IntermediateField.adjoin ℂ + (Set.range (Fin.cases y x : Fin (d.m+1) → E)) = ⊤) + (htrdeg : Algebra.trdeg ℂ E = 1) : ℝ := + let hres := PlaceLocalRing.residue_integral htrdeg.le + let hfinite := CurveParameterFinite.finite_over_every_parameter ℂ E htrdeg + let z : Fin (d.m+1) → E := Fin.cases y x + let hz := CurveInequality.nonconstant_coordinates z hgen htrdeg + ∑ q ∈ CurveContactFamily.places hfinite z d.curveCenters hz, + (CurveContactFamily.contact hres hfinite z d.curveCenters hz d.curveJetWeights q : ℝ) + +def poleDegree (y : E) (x : Fin d.m → E) (htrdeg : Algebra.trdeg ℂ E = 1) : ℝ := + CurveContactSum.weightedDegree + (CurveParameterFinite.finite_over_every_parameter ℂ E htrdeg) + (Fin.cases y x : Fin (d.m+1) → E) d.curveDegreeWeights + +theorem actual_contact_bound (y : E) (x : Fin d.m → E) + (hgen : IntermediateField.adjoin ℂ + (Set.range (Fin.cases y x : Fin (d.m+1) → E)) = ⊤) + (htrdeg : Algebra.trdeg ℂ E = 1) : + (1 + (d.sigma : ℝ)) * contactSum d y x hgen htrdeg ≤ poleDegree d y x htrdeg := + d.exact_weighted_curve_inequality y x hgen htrdeg + +theorem margin_of_actual_contact_degrees + (p : B ⟶ Spec (.of ℂ)) [IsProper p] (A J : LineBundle B) + (a : ℕ) (ha : 1 < a) (hample : ((A.pow a).tensor J).IsAmple) + (C : IntegralCurve B) (y : E) (x : Fin d.m → E) + (hgen : IntermediateField.adjoin ℂ + (Set.range (Fin.cases y x : Fin (d.m+1) → E)) = ⊤) + (htrdeg : Algebra.trdeg ℂ E = 1) (R : ℚ) (hR : 0 < R) + (hA : (curveDegree p A C : ℝ) = (R : ℝ) * poleDegree d y x htrdeg) + (hJ : (curveDegree p J C : ℝ) = -(R : ℝ) * contactSum d y x hgen htrdeg) : + marginCoefficient a d.sigma * (curveDegree p ((A.pow a).tensor J) C : ℝ) ≤ + (curveDegree p (A.tensor J) C : ℝ) := by + apply margin_of_nonnegative_degree p A J a ha hample d.sigma d.sigma_pos C + rw [hA, hJ] + have hR' : (0 : ℝ) ≤ R := by exact_mod_cast hR.le + have h := mul_le_mul_of_nonneg_left (actual_contact_bound d y x hgen htrdeg) hR' + nlinarith + + +end PiExponent.BlowupCurveMargin + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupIdeal.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupIdeal.lean new file mode 100644 index 0000000000000000000000000000000000000000..d754d4844e410f8002b5e3c67a0eb53d41c050cb --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupIdeal.lean @@ -0,0 +1,313 @@ +import OAI.NumberTheory.PiExponent.Cohomology.FiniteCoverCohomology +import OAI.NumberTheory.PiExponent.Geometry.LineBundleTensor +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealModule + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri + +namespace Geometry +open CategoryTheory AlgebraicGeometry + +def sectionImageIdeal {X : Scheme} (J : LineBundle X) + (ι : J.sheaf ⟶ structureSheaf X) (U : X.Opens) : Ideal Γ(X, U) := by + letI : Module Γ(X, U) (J.sheaf.val.obj (Opposite.op U)) := + (J.sheaf.val.obj (Opposite.op U)).isModule + let φ : J.sheaf.val.obj (Opposite.op U) →ₗ[Γ(X, U)] Γ(X, U) := + (ι.val.app (Opposite.op U)).hom + exact φ.range + +def PresentsPullbackIdeal {X Y : Scheme} (I : X.IdealSheafData) (f : Y ⟶ X) + (J : LineBundle Y) (ι : J.sheaf ⟶ structureSheaf Y) : Prop := + Mono ι ∧ ∀ (U : Y.affineOpens) (V : X.affineOpens) + (e : U.1 ≤ f ⁻¹ᵁ V.1), + sectionImageIdeal J ι U.1 = (I.ideal V).map (f.appLE V.1 U.1 e).hom + +def InvertiblePullbackIdeal {X Y : Scheme} (I : X.IdealSheafData) (f : Y ⟶ X) : Prop := + ∃ (J : LineBundle Y) (ι : J.sheaf ⟶ structureSheaf Y), PresentsPullbackIdeal I f J ι + +def IsBlowup {X B : Scheme} (I : X.IdealSheafData) (π : B ⟶ X) : Prop := + InvertiblePullbackIdeal I π ∧ ∀ (Y : Scheme) (f : Y ⟶ X), + InvertiblePullbackIdeal I f → ∃! h : Y ⟶ B, h ≫ π = f + +end Geometry + +namespace IdealModule + +section +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite +universe u +variable {X : Scheme.{u}} + +def sectionFamily {M : X.Modules} (s : Γ(M, ⊤)) : M.sections where + val U := M.presheaf.map (homOfLE (show U.unop ≤ ⊤ from le_top)).op s + property {U V} i := by + change (M.presheaf.map (homOfLE le_top).op ≫ M.presheaf.map i) s = _ + rw [← Functor.map_comp] + rfl + +def fromSection {M : X.Modules} (s : Γ(M, ⊤)) : unit X ⟶ M := + M.unitHomEquiv.symm (sectionFamily s) + +@[simp] lemma fromSection_app {M : X.Modules} (s : Γ(M, ⊤)) + (U : X.Opens) (a : Γ(X, U)) : + (fromSection s).val.app (op U) a = a • M.presheaf.map (homOfLE le_top).op s := rfl + +lemma fromSection_inclusion_app {M : X.Modules} (g : M ⟶ unit X) + (s : Γ(M, ⊤)) (r : Γ(X, ⊤)) (hs : g.val.app (op ⊤) s = r) + (U : X.Opens) (a : Γ(X, U)) : + g.val.app (op U) ((fromSection s).val.app (op U) a) = + X.presheaf.map (homOfLE le_top).op r * a := by + rw [fromSection_app] + have hn := PresheafOfModules.naturality_apply g.val (homOfLE (show U ≤ ⊤ from le_top)).op s + change g.val.app (op U) (M.presheaf.map (homOfLE le_top).op s) = + X.presheaf.map (homOfLE le_top).op (g.val.app (op ⊤) s) at hn + have he := ((g.val.app (op U)).hom).map_smul a (M.presheaf.map (homOfLE le_top).op s) + change _ = a * (show Γ(X, U) from g.val.app (op U) (M.presheaf.map (homOfLE le_top).op s)) at he + exact he.trans ((congrArg (fun b : Γ(X, U) => a * b) + (hn.trans (congrArg (fun b : Γ(X, ⊤) => X.presheaf.map (homOfLE le_top).op b) hs))).trans + (mul_comm _ _)) + +lemma isIso_fromSection {M : X.Modules} (g : M ⟶ unit X) [Mono g] + (s : Γ(M, ⊤)) (r : Γ(X, ⊤)) (hs : g.val.app (op ⊤) s = r) + (hprincipal : ∀ U : X.affineOpens, + (g.val.app (op U.1)).hom.range = Ideal.span {X.presheaf.map (homOfLE le_top).op r}) + (hregular : ∀ U : X.affineOpens, + IsLeftRegular (X.presheaf.map (homOfLE (show U.1 ≤ ⊤ from le_top)).op r)) : + IsIso (fromSection s) := by + apply isIso_of_affine_app + intro U + have hinj : Function.Injective (g.val.app (op U.1)) := by + let : Mono g.val := inferInstanceAs (Mono ((Scheme.Modules.toPresheafOfModules X).map g)) + exact PresheafOfModules.injective_of_mono g.val (op U.1) + apply (ConcreteCategory.isIso_iff_bijective _).mpr + constructor + · intro a b hab + apply hregular U + have he := congrArg (g.val.app (op U.1)) hab + change g.val.app (op U.1) ((fromSection s).val.app (op U.1) a) = + g.val.app (op U.1) ((fromSection s).val.app (op U.1) b) at he + exact (fromSection_inclusion_app g s r hs U.1 a).symm.trans + (he.trans (fromSection_inclusion_app g s r hs U.1 b)) + · intro y + have hy : (show Γ(X, U.1) from g.val.app (op U.1) y) ∈ + Ideal.span {X.presheaf.map (homOfLE le_top).op r} := by + rw [← hprincipal U] + exact ⟨y, rfl⟩ + obtain ⟨a, ha⟩ := Ideal.mem_span_singleton.mp hy + refine ⟨a, hinj ?_⟩ + exact (fromSection_inclusion_app g s r hs U.1 a).trans ha.symm + +end + +section +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite +universe u +variable {X Y : Scheme.{u}} + +def restrictedInclusion (I : Y.IdealSheafData) (f : X ⟶ Y) [IsOpenImmersion f] : + (closedModule I).restrict f ⟶ unit X := + (Scheme.Modules.restrictFunctor f).map (closedInclusion I) ≫ + (Scheme.Modules.restrictUnitIso f).hom + +instance restrictedInclusion_mono (I : Y.IdealSheafData) (f : X ⟶ Y) + [IsOpenImmersion f] : Mono (restrictedInclusion I f) := by + let : Mono (closedInclusion I) := inferInstanceAs (Mono (inclusion I.subschemeι)) + let : Mono ((Scheme.Modules.restrictFunctor f).map (closedInclusion I)) := + PiExponentSeshadri.RestrictionExact.restriction_mono f (closedInclusion I) + exact mono_comp' (C := X.Modules) inferInstance + ⟨fun a b h => (Iso.cancel_iso_hom_right a b (Scheme.Modules.restrictUnitIso f)).mp h⟩ + +lemma restrictedInclusion_app (I : Y.IdealSheafData) (f : X ⟶ Y) + [IsOpenImmersion f] (U : X.Opens) (s : Γ((closedModule I).restrict f, U)) : + (restrictedInclusion I f).val.app (op U) s = + (f.appIso U).hom ((closedInclusion I).val.app (op (f ''ᵁ U)) s) := rfl + +lemma restricted_image (I : Y.IdealSheafData) (f : X ⟶ Y) + [IsOpenImmersion f] (U : X.affineOpens) : + ((restrictedInclusion I f).val.app (op U.1)).hom.range = (I.comap f).ideal U := by + rw [I.ideal_comap_of_isOpenImmersion f U] + ext r + change Γ(X, U.1) at r + change (∃ s, (restrictedInclusion I f).val.app (op U.1) s = r) ↔ + (f.appIso U.1).inv r ∈ I.ideal ⟨f ''ᵁ U.1, U.2.image_of_isOpenImmersion f⟩ + rw [← closed_image I ⟨f ''ᵁ U.1, U.2.image_of_isOpenImmersion f⟩] + change (∃ s, _) ↔ ∃ s, (closedInclusion I).val.app (op (f ''ᵁ U.1)) s = (f.appIso U.1).inv r + constructor + · rintro ⟨s, hs⟩ + refine ⟨s, ?_⟩ + exact (congrArg (fun k : Γ(Y, f ''ᵁ U.1) ⟶ Γ(Y, f ''ᵁ U.1) => k ((closedInclusion I).val.app (op (f ''ᵁ U.1)) s)) + (f.appIso U.1).hom_inv_id).symm.trans + (congrArg (fun z : Γ(X, U.1) => (f.appIso U.1).inv z) + ((restrictedInclusion_app I f U.1 s).symm.trans hs)) + · rintro ⟨s, hs⟩ + refine ⟨s, ?_⟩ + exact (restrictedInclusion_app I f U.1 s).trans + ((congrArg (fun z : Γ(Y, f ''ᵁ U.1) => (f.appIso U.1).hom z) hs).trans + (congrArg (fun k : Γ(X, U.1) ⟶ Γ(X, U.1) => k r) (f.appIso U.1).inv_hom_id)) + +lemma frame_restriction (I : Y.IdealSheafData) (f : X ⟶ Y) + [IsOpenImmersion f] [IsAffine X] (r : Γ(X, ⊤)) + (hprincipal : (I.comap f).ideal ⟨⊤, isAffineOpen_top X⟩ = Ideal.span {r}) + (hregular : IsLeftRegular r) : + Nonempty ((closedModule I).restrict f ≅ unit X) := by + have hr' : r ∈ (I.comap f).ideal ⟨⊤, isAffineOpen_top X⟩ := by + rw [hprincipal] + exact Ideal.subset_span (Set.mem_singleton r) + have hr : r ∈ ((restrictedInclusion I f).val.app (op ⊤)).hom.range := by + rw [restricted_image I f ⟨⊤, isAffineOpen_top X⟩] + exact hr' + obtain ⟨s, hs⟩ := hr + have hi : IsIso (fromSection (M := (closedModule I).restrict f) s) := isIso_fromSection (restrictedInclusion I f) s r hs + (fun U => ?_) (restriction_regular r hregular) + · exact ⟨(asIso (fromSection (M := (closedModule I).restrict f) s)).symm⟩ + · rw [restricted_image I f U, ← (I.comap f).map_ideal (U := U) + (V := ⟨⊤, isAffineOpen_top X⟩) (by change U.1 ≤ ⊤; exact le_top), hprincipal] + simp only [Ideal.map_span, Set.image_singleton] + rfl + +end +open CategoryTheory AlgebraicGeometry +universe u +variable {X Y : Scheme.{u}} + +def frameOnRange (M : Y.Modules) (f : X ⟶ Y) [IsOpenImmersion f] + (e : M.restrict f ≅ unit X) : M.restrict f.opensRange.ι ≅ unit f.opensRange.toScheme := + ((Scheme.Modules.restrictFunctorCongr f.isoOpensRange_inv_comp).app M).symm ≪≫ + (Scheme.Modules.restrictFunctorComp f.isoOpensRange.inv f).app M ≪≫ + (Scheme.Modules.restrictFunctor f.isoOpensRange.inv).mapIso e ≪≫ + Scheme.Modules.restrictUnitIso f.isoOpensRange.inv + +end IdealModule +namespace IdealPullback + +section +open CategoryTheory AlgebraicGeometry +universe u +variable {X Y : Scheme.{u}} [IsAffine X] [IsAffine Y] + +lemma map_top (J : X.IdealSheafData) (f : X ⟶ Y) : + (J.map f).ideal ⟨⊤, isAffineOpen_top Y⟩ = + (J.ideal ⟨⊤, isAffineOpen_top X⟩).comap f.appTop.hom := + J.ideal_map f ⟨⊤, isAffineOpen_top Y⟩ (isAffineOpen_top X) + +lemma comap_top (I : Y.IdealSheafData) (f : X ⟶ Y) : + (I.comap f).ideal ⟨⊤, isAffineOpen_top X⟩ = + (I.ideal ⟨⊤, isAffineOpen_top Y⟩).map f.appTop.hom := by + apply le_antisymm + · let J : X.IdealSheafData := Scheme.IdealSheafData.ofIdealTop + ((I.ideal ⟨⊤, isAffineOpen_top Y⟩).map f.appTop.hom) + have h : I ≤ J.map f := by + apply Scheme.IdealSheafData.le_of_isAffine + rw [map_top] + simpa [J] using Ideal.le_comap_map + have hh := (Scheme.IdealSheafData.le_map_iff_comap_le.mp h) ⟨⊤, isAffineOpen_top X⟩ + simpa [J] using hh + · rw [Ideal.map_le_iff_le_comap] + have h := (I.le_map_comap f) ⟨⊤, isAffineOpen_top Y⟩ + rwa [map_top] at h + +end +section +open CategoryTheory AlgebraicGeometry Opposite +universe u +variable {R S : Type u} [CommRing R] [CommRing S] + +def specIdeal (I : Ideal R) : (Spec (CommRingCat.of R)).IdealSheafData := + Scheme.IdealSheafData.ofIdealTop (I.map (Scheme.ΓSpecIso (CommRingCat.of R)).inv.hom) + +@[simp] lemma specIdeal_top (I : Ideal R) : + (specIdeal I).ideal ⟨⊤, isAffineOpen_top _⟩ = + I.map (Scheme.ΓSpecIso (CommRingCat.of R)).inv.hom := by + simp [specIdeal] + +lemma specIdeal_comap (I : Ideal R) (f : R →+* S) : + (specIdeal I).comap (Spec.map (CommRingCat.ofHom f)) = specIdeal (I.map f) := by + apply Scheme.IdealSheafData.ext_of_isAffine + rw [comap_top, specIdeal_top, specIdeal_top, Ideal.map_map, Ideal.map_map] + congr 1 + exact congrArg CommRingCat.Hom.hom (Scheme.ΓSpecIso_inv_naturality (CommRingCat.ofHom f)).symm + +end +open CategoryTheory AlgebraicGeometry +universe u +variable {X Y : Scheme.{u}} + +lemma comap_ι_top (I : X.IdealSheafData) (U : X.affineOpens) : + (I.comap U.1.ι).ideal ⟨⊤, isAffineOpen_top _⟩ = + (I.ideal U).map U.1.topIso.inv.hom := by + rw [I.ideal_comap_of_isOpenImmersion] + simp only [Scheme.Opens.ι_appIso, Iso.refl_inv] + exact (I.map_ideal (U := ⟨U.1.ι ''ᵁ ⊤, (isAffineOpen_top U.1.toScheme).image_of_isOpenImmersion U.1.ι⟩) + (V := U) (show U.1.ι ''ᵁ ⊤ ≤ U.1 from U.1.ι_image_top.le)).symm + +lemma comap_ideal (I : Y.IdealSheafData) (f : X ⟶ Y) + (U : X.affineOpens) (V : Y.affineOpens) (e : U.1 ≤ f ⁻¹ᵁ V.1) : + (I.comap f).ideal U = (I.ideal V).map (f.appLE V.1 U.1 e).hom := by + suffices hh : ((I.comap f).ideal U).map U.1.topIso.inv.hom = + ((I.ideal V).map (f.appLE V.1 U.1 e).hom).map U.1.topIso.inv.hom by + have hh' := congrArg (Ideal.map U.1.topIso.hom.hom) hh + simpa only [Ideal.map_map, ← CommRingCat.hom_comp, Iso.inv_hom_id, Iso.inv_hom_id_assoc, Category.assoc, Category.comp_id, CommRingCat.hom_id, + Ideal.map_id] using hh' + rw [← comap_ι_top, ← Scheme.IdealSheafData.comap_comp, + ← Scheme.Hom.resLE_comp_ι f e, Scheme.IdealSheafData.comap_comp, + comap_top, comap_ι_top, Ideal.map_map, Ideal.map_map] + simp only [Scheme.Hom.appTop, Scheme.Hom.resLE_app_top, ← CommRingCat.hom_comp, + Iso.inv_hom_id_assoc] + +end IdealPullback +namespace InvertibleLocal + +section +open CategoryTheory AlgebraicGeometry Opposite +open PiExponentSeshadri.Geometry +variable {X Y : Scheme} {I : X.IdealSheafData} {f : Y ⟶ X} +lemma invertible_of_local_equations + (hf : ∀ y : Y, ∃ U : Y.affineOpens, y ∈ U.1 ∧ + ∃ r : Γ(U.1.toScheme, ⊤), IsRegular r ∧ + ((I.comap f).comap U.1.ι).ideal ⟨⊤, isAffineOpen_top _⟩ = Ideal.span {r}) : + InvertiblePullbackIdeal I f := by + let J : LineBundle Y := { + sheaf := IdealModule.closedModule (I.comap f) + locallyRankOne y := by + obtain ⟨U, hyU, r, hr, hIr⟩ := hf y + exact ⟨U.1, hyU, IdealModule.frame_restriction (I.comap f) U.1.ι r hIr hr.1⟩ } + have : Mono (IdealModule.closedInclusion (I.comap f)) := + inferInstanceAs (Mono (IdealModule.inclusion (I.comap f).subschemeι)) + refine ⟨J, IdealModule.closedInclusion (I.comap f), this, ?_⟩ + intro U V e + change ((IdealModule.closedInclusion (I.comap f)).val.app (op U.1)).hom.range = _ + rw [IdealModule.closed_image] + exact IdealPullback.comap_ideal I f U V e + +end +open CategoryTheory AlgebraicGeometry Opposite +open PiExponentSeshadri.Geometry + +theorem invertible_of_affine_equations {X : Scheme} (I : X.IdealSheafData) + (hI : ∀ x : X, ∃ U : X.affineOpens, x ∈ U.1 ∧ ∃ r : Γ(X, U.1), + IsRegular r ∧ I.ideal U = Ideal.span {r}) : + InvertiblePullbackIdeal I (𝟙 X) := by + apply invertible_of_local_equations + intro x + obtain ⟨U, hx, r, hr, he⟩ := hI x + let e := U.1.topIso.commRingCatIsoToRingEquiv + have hreg : IsLeftRegular (e.symm r) := by + intro a b hab + apply e.injective + apply hr.1 + simpa only [map_mul, e.apply_symm_apply] using congrArg e hab + refine ⟨U, hx, e.symm r, ⟨hreg, hreg.right_of_commute (fun a => mul_comm _ a)⟩, ?_⟩ + rw [Scheme.IdealSheafData.comap_id, IdealPullback.comap_ι_top, he, + Ideal.map_span, Set.image_singleton] + rfl + +end InvertibleLocal + +end PiExponentSeshadri + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupJetReesReduction.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupJetReesReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..8340613addb33b7777b729cfbcef951cf14cac29 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupJetReesReduction.lean @@ -0,0 +1,40 @@ +import OAI.NumberTheory.PiExponent.Ampleness.FiniteReesComparison +import OAI.NumberTheory.PiExponent.Ampleness.GlobalBlowupJetSurjectivity + +namespace OAI + +namespace PiExponent.BlowupJetSurjectivity +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace +open PiExponentSeshadri.Geometry +open PiExponent.GeometrySupport +variable {X : Scheme.{0}} {R : Type} [CommRing R] [IsNoetherianRing R] + +theorem eventual_blowup_jetRestriction_surjective_of_affine_recovery + (p : X ⟶ Spec (CommRingCat.of R)) [IsProper p] [IsLocallyNoetherian X] + (I : X.IdealSheafData) (A : LineBundle X) + (hample : LineBundle.IsAmple _ (blowupBundle I A)) + (hrecover : ∀ U : X.affineOpens, ∃ N, ∀ n, N ≤ n → Function.Bijective + ((ExceptionalRecoveryMap.ordinaryMap (PiExponentSeshadri.BlowupGluing.projection I) + I (PiExponentSeshadri.BlowupGluing.exceptionalLineBundle I) + (PiExponentSeshadri.BlowupGluing.exceptionalInclusion I) + (PiExponentSeshadri.BlowupGluing.exceptional_presents I) n).app U.1)) : + ∃ N, ∀ n, N ≤ n → Function.Surjective (jetRestriction I A n) := by + let : IsLocallyNoetherian X := LocallyOfFiniteType.isLocallyNoetherian p + let : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace p + let : X.IsSeparated := ⟨by + have h : IsSeparated (p ≫ terminal.from (Spec (CommRingCat.of R))) := inferInstance + simpa only [terminal.comp_from] using h⟩ + obtain ⟨k,U,hcover,N,hN⟩ := + ExceptionalRecoveryMap.eventual_comparison_of_affine_recovery + (PiExponentSeshadri.BlowupGluing.projection I) I + (PiExponentSeshadri.BlowupGluing.exceptionalLineBundle I) + (PiExponentSeshadri.BlowupGluing.exceptionalInclusion I) + (PiExponentSeshadri.BlowupGluing.exceptional_presents I) A hrecover + exact eventual_blowup_jetRestriction_surjective_of_section_comparison + p I A hample (fun i => (U i).1) (fun i => (U i).2) hcover ⟨N,hN⟩ + +end +end PiExponent.BlowupJetSurjectivity + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupJetSurjectivity.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupJetSurjectivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..c230a2b166c472600f5f8cfc58b15875cf89e339 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupJetSurjectivity.lean @@ -0,0 +1,74 @@ +import OAI.NumberTheory.PiExponent.Approximation.SerreSectionLifting +import OAI.NumberTheory.PiExponent.Cohomology.CechH1Transfer +import OAI.NumberTheory.PiExponent.Jets.CompactJetIdealCoherent + +namespace OAI + +namespace PiExponent.BlowupJetSurjectivity +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace +open PiExponentSeshadri.Geometry +open PiExponent.GeometrySupport + +variable {X B : Scheme.{0}} {R : Type} [CommRing R] [IsNoetherianRing R] + +def jetQuotient (I : X.IdealSheafData) : X.Modules := + (Scheme.Modules.pushforward I.subschemeι).obj (PiExponentSeshadri.IdealModule.unit I.subscheme) + +def twistedIdeal (I : X.IdealSheafData) (A : LineBundle X) (n : ℕ) : X.Modules := + (moduleTwistFunctor A n).obj (PiExponentSeshadri.IdealModule.closedModule (I ^ n)) + +def jetRestriction (I : X.IdealSheafData) (A : LineBundle X) (n : ℕ) + (s : GlobalSections X (modulePow X A.sheaf n)) : + GlobalSections X ((moduleTwistFunctor A n).obj (jetQuotient (I ^ n))) := + s ≫ (moduleTwistUnitIso A n).inv ≫ + (moduleTwistFunctor A n).map (PiExponentSeshadri.IdealModule.structureMap (I ^ n).subschemeι) + +theorem jetRestriction_surjective_of_h1_zero + (I : X.IdealSheafData) (A : LineBundle X) (n : ℕ) + (hzero : ∀ x : cohomology (twistedIdeal I A n) 1, x = 0) : + Function.Surjective (jetRestriction I A n) := by + let S := ShortComplex.mk (PiExponentSeshadri.IdealModule.inclusion (I ^ n).subschemeι) + (PiExponentSeshadri.IdealModule.structureMap (I ^ n).subschemeι) (kernel.condition _) + have hS : S.ShortExact := PiExponentSeshadri.IdealModule.closedSequence_exact (I ^ n).subschemeι + have hsurj := SerreSectionLifting.globalSections_surjective_of_h1_zero + (S.map (moduleTwistFunctor A n)) (moduleTwistFunctor_shortExact A n S hS) hzero + intro s + obtain ⟨t, ht⟩ := hsurj s + refine ⟨t ≫ (moduleTwistUnitIso A n).hom, ?_⟩ + change t ≫ (moduleTwistFunctor A n).map + (PiExponentSeshadri.IdealModule.structureMap (I ^ n).subschemeι) = s at ht + change (t ≫ (moduleTwistUnitIso A n).hom) ≫ (moduleTwistUnitIso A n).inv ≫ _ = s + erw [Category.assoc, Iso.hom_inv_id_assoc] + exact ht + +theorem eventual_jetRestriction_surjective_of_ample_comparison + [IsNoetherian X] + (f : B ⟶ X) (p : B ⟶ Spec (CommRingCat.of R)) [IsProper p] + (I : X.IdealSheafData) (A : LineBundle X) + (F : LineBundle B) (hF : LineBundle.IsAmple B F) + {J : Type} (U : J → X.Opens) (hU : ∀ i, IsAffineOpen (U i)) + (hcover : (⨆ i, U i) = ⊤) + (hcomparison : ∃ N, ∀ n, N ≤ n → Nonempty + (CechH1Transfer.SectionComparison U (fun i => f ⁻¹ᵁ U i) + (twistedIdeal I A n) (modulePow B F.sheaf n))) : + ∃ N, ∀ n, N ≤ n → Function.Surjective (jetRestriction I A n) := by + obtain ⟨N₁, hN₁⟩ := NoetherianAmpleSerreVanishing.ample_power_cohomology_zero p F hF + obtain ⟨N₂, hN₂⟩ := hcomparison + refine ⟨max N₁ N₂, fun n hn => ?_⟩ + apply jetRestriction_surjective_of_h1_zero I A n + let : (PiExponentSeshadri.IdealModule.closedModule (I ^ n)).IsFinitePresentation := + CompactJetIdeal.closedModule_isFinitePresentation (I ^ n) + let : (twistedIdeal I A n).IsFinitePresentation := + FiniteGlobalPresentation.moduleTwist_isFinitePresentation A n _ + let : (twistedIdeal I A n).IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData + (twistedIdeal I A n)).choose.isQuasicoherent + obtain ⟨P⟩ := hN₂ n ((le_max_right _ _).trans hn) + apply P.cohomology_one_zero hU hcover _ (hN₁ n ((le_max_left _ _).trans hn) 1 (by decide)) + exact f.iSup_preimage_eq_top hcover + +end +end PiExponent.BlowupJetSurjectivity + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupJetSurjectivityComplete.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupJetSurjectivityComplete.lean new file mode 100644 index 0000000000000000000000000000000000000000..496cbf1c58a197e7fd6ea161e302154a06333118 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupJetSurjectivityComplete.lean @@ -0,0 +1,24 @@ +import OAI.NumberTheory.PiExponent.Ampleness.BlowupJetReesReduction +import OAI.NumberTheory.PiExponent.Ampleness.GlobalReesCanonicalRecovery + +namespace OAI + +namespace PiExponent.BlowupJetSurjectivity +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} {R : Type} [CommRing R] [IsNoetherianRing R] + +theorem eventual_blowup_jetRestriction_surjective + (p : X ⟶ Spec (CommRingCat.of R)) [IsProper p] + (I : X.IdealSheafData) (A : LineBundle X) + (hample : LineBundle.IsAmple _ (blowupBundle I A)) : + ∃ N, ∀ n, N ≤ n → Function.Surjective (jetRestriction I A n) := by + let : IsLocallyNoetherian X := LocallyOfFiniteType.isLocallyNoetherian p + exact eventual_blowup_jetRestriction_surjective_of_affine_recovery p I A hample + (fun U => GlobalReesRecoveryComparison.eventually_ordinaryMap_app_bijective I U) + +end +end PiExponent.BlowupJetSurjectivity + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupPresentationRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupPresentationRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..e77ba87156104fe43d84e570f211479f9d327490 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupPresentationRestriction.lean @@ -0,0 +1,42 @@ +import OAI.NumberTheory.PiExponent.Ampleness.GlobalBlowupRestriction +import OAI.NumberTheory.PiExponent.Cohomology.PencilCohomologySections + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Frames +variable {X B : Scheme.{0}} {I : X.IdealSheafData} {π : B ⟶ X} + +lemma presents_post_toSpec [IsAffine X] (J : LineBundle B) + (ι : J.sheaf ⟶ O B) (hJ : PresentsPullbackIdeal I π J ι) : + PresentsPullbackIdeal (IdealPullback.specIdeal (I.ideal ⟨⊤,isAffineOpen_top X⟩)) + (π ≫ X.isoSpec.hom) J ι := by + refine ⟨hJ.1,?_⟩ + intro U V e + rw [InvertibleLocal.image_eq_comap I π J ι hJ U, + ← IdealPullback.comap_ideal _ (π ≫ X.isoSpec.hom) U V e, + Scheme.IdealSheafData.comap_comp] + rw [show (IdealPullback.specIdeal (I.ideal ⟨⊤,isAffineOpen_top X⟩)).comap + X.isoSpec.hom = I from IdealPullback.specIdeal_comap_toSpec I] + +lemma presents_morphismRestrict (J : LineBundle B) (ι : J.sheaf ⟶ O B) + (hJ : PresentsPullbackIdeal I π J ι) (U : X.affineOpens) : + PresentsPullbackIdeal (I.comap U.1.ι) (π ∣_ U.1) + (J.restrict (π ⁻¹ᵁ U.1).ι) (InvertibleLocal.restrictedInclusion J ι (π ⁻¹ᵁ U.1).ι) := by + refine ⟨@InvertibleLocal.restrictedInclusion_mono _ _ J ι + (π ⁻¹ᵁ U.1).ι inferInstance hJ.1, ?_⟩ + intro V W hVW + change ((InvertibleLocal.restrictedInclusion J ι (π ⁻¹ᵁ U.1).ι).val.app + (Opposite.op V.1)).hom.range = _ + rw [InvertibleLocal.restricted_image_on_chart J ι hJ (π ⁻¹ᵁ U.1).ι V U (by + rintro _ ⟨x,hx,rfl⟩; exact x.property), + ← Scheme.IdealSheafData.comap_comp,← morphismRestrict_ι π U.1, + Scheme.IdealSheafData.comap_comp] + exact IdealPullback.comap_ideal _ (π ∣_ U.1) V W hVW + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupProperIntegral.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupProperIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2a06bebcd0c4db43752ea84eb82c1df1560ccc4 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupProperIntegral.lean @@ -0,0 +1,273 @@ +import OAI.NumberTheory.PiExponent.Ampleness.BlowupComplement +import OAI.NumberTheory.PiExponent.Ampleness.GlobalBlowupGluing +import OAI.NumberTheory.PiExponent.Ampleness.GlobalBlowupRestriction + +namespace OAI + + +noncomputable section + +namespace PiExponentSeshadri +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry + +instance AffineBlowup.projection_proper {X : Scheme.{0}} [IsAffine X] + [IsLocallyNoetherian X] (I : X.IdealSheafData) : IsProper (AffineBlowup.projection I) := by + let : IsNoetherianRing Γ(X,⊤) := IsLocallyNoetherian.component_noetherian ⟨⊤,isAffineOpen_top X⟩ + unfold AffineBlowup.projection + infer_instance + +instance BlowupGluing.projection_proper {X : Scheme.{0}} [IsLocallyNoetherian X] + (I : X.IdealSheafData) : IsProper (BlowupGluing.projection I) := by + apply IsZariskiLocalAtTarget.of_openCover (P := @IsProper) (BlowupGluing.baseCover I) + intro U + let he := (BlowupGluing.local_pullback I U).flip.isoPullback + have hh : he.hom ≫ pullback.snd (BlowupGluing.projection I) U.toOpens.ι = + BlowupGluing.localProjection I U := by + exact (BlowupGluing.local_pullback I U).flip.isoPullback_hom_snd + have h : IsProper (BlowupGluing.localProjection I U) := by infer_instance + rw [← hh] at h + exact (MorphismProperty.cancel_left_of_respectsIso (@IsProper) he.hom _).mp h + +end PiExponentSeshadri + + + +namespace PiExponentSeshadri.ProjectiveGeometry +open AlgebraicGeometry +universe u v +variable {A : Type u} {σ : Type v} [CommRing A] + [SetLike σ A] [AddSubgroupClass σ A] (𝒜 : ℕ → σ) [GradedRing 𝒜] + +instance homogeneous_isReduced (S : Submonoid A) [_root_.IsReduced A] : + _root_.IsReduced (HomogeneousLocalization 𝒜 S) := + isReduced_of_injective (algebraMap (HomogeneousLocalization 𝒜 S) (Localization S)) + (HomogeneousLocalization.val_injective S) + +instance proj_isReduced [_root_.IsReduced A] : IsReduced (Proj 𝒜) := by + have (x : Proj 𝒜) : _root_.IsReduced ((Proj 𝒜).presheaf.stalk x) := + isReduced_of_injective (Proj.stalkIso' 𝒜 x) (Proj.stalkIso' 𝒜 x).injective + exact isReduced_of_isReduced_stalk _ + +def genericPoint [IsDomain A] [Nonempty (Proj 𝒜)] : ProjectiveSpectrum 𝒜 where + asHomogeneousIdeal := ⊥ + isPrime := Ideal.isPrime_bot + not_irrelevant_le h := by + obtain ⟨x⟩ := ‹Nonempty (Proj 𝒜)› + exact x.not_irrelevant_le (h.trans bot_le) + +lemma genericPoint_dense [IsDomain A] [Nonempty (Proj 𝒜)] : + closure ({genericPoint 𝒜} : Set (ProjectiveSpectrum 𝒜)) = Set.univ := by + apply Set.eq_univ_of_forall + intro x + exact (ProjectiveSpectrum.le_iff_mem_closure 𝒜 _ _).mp + (show (genericPoint 𝒜).asHomogeneousIdeal ≤ x.asHomogeneousIdeal from bot_le) + +instance proj_irreducible [IsDomain A] [Nonempty (Proj 𝒜)] : + IrreducibleSpace (Proj 𝒜) := by + apply (irreducibleSpace_def _).mpr + change IsIrreducible (Set.univ : Set (ProjectiveSpectrum 𝒜)) + rw [← genericPoint_dense 𝒜] + exact (isIrreducible_singleton).closure + +instance proj_isIntegral [IsDomain A] [Nonempty (Proj 𝒜)] : IsIntegral (Proj 𝒜) := + (isIntegral_iff_irreducibleSpace_and_isReduced _).mpr ⟨inferInstance, inferInstance⟩ + +end PiExponentSeshadri.ProjectiveGeometry + +namespace PiExponentSeshadri.Geometry +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace +variable {X B : Scheme.{0}} {I : X.IdealSheafData} {π : B ⟶ X} + +abbrev centreComplement (I : X.IdealSheafData) : X.Opens := I.support.compl + +lemma ideal_comap_complement (I : X.IdealSheafData) : + I.comap (centreComplement I).ι = ⊤ := by + apply (Scheme.IdealSheafData.support_eq_bot_iff _).mp + rw [Scheme.IdealSheafData.support_comap] + ext x + change (x.val ∈ I.support ↔ False) + exact iff_false_intro x.property + +lemma complement_nonempty (hI : I.support ≠ ⊤) : Nonempty (centreComplement I).toScheme := by + by_contra h + apply hI + ext x + change x ∈ I.support ↔ True + rw [iff_true] + by_contra hx + exact h ⟨⟨x, hx⟩⟩ + +def IsBlowup.complementLift (hπ : IsBlowup I π) : (centreComplement I).toScheme ⟶ B := by + let := hπ.isIso_over_complement + exact inv (pullback.fst (centreComplement I).ι π) ≫ + pullback.snd (centreComplement I).ι π + +@[reassoc (attr := simp)] +lemma IsBlowup.complementLift_comp (hπ : IsBlowup I π) : + hπ.complementLift ≫ π = (centreComplement I).ι := by + let := hπ.isIso_over_complement + dsimp only [IsBlowup.complementLift] + rw [Category.assoc, ← pullback.condition, ← Category.assoc, IsIso.inv_hom_id, + Category.id_comp] + +instance (hπ : IsBlowup I π) : IsOpenImmersion hπ.complementLift := by + let := hπ.isIso_over_complement + dsimp only [IsBlowup.complementLift] + infer_instance + +lemma IsBlowup.complementLift_range (hπ : IsBlowup I π) : + Set.range hπ.complementLift = π ⁻¹' (centreComplement I : Set X) := by + let := hπ.isIso_over_complement + change Set.range ((pullback.snd (centreComplement I).ι π) ∘ + (inv (pullback.fst (centreComplement I).ι π))) = _ + rw [Set.range_comp] + rw [(inv (pullback.fst (centreComplement I).ι π)).surjective.range_eq, + Set.image_univ, Scheme.Pullback.range_snd] + simp + +lemma IsBlowup.nonempty_of_support_ne_top (hπ : IsBlowup I π) (hI : I.support ≠ ⊤) : + Nonempty B := + (complement_nonempty hI).map hπ.complementLift + +end PiExponentSeshadri.Geometry + +namespace PiExponentSeshadri.ReesGrading +open AlgebraicGeometry Polynomial +variable {R : Type} [CommRing R] (I : Ideal R) + +instance polynomial_isReduced [_root_.IsReduced R] : _root_.IsReduced R[X] where + eq_zero p hp := by + ext n + exact (Polynomial.isNilpotent_iff.mp hp n).eq_zero + +instance affineBlowup_isReduced [_root_.IsReduced R] : IsReduced (affineBlowup I) := by + let : _root_.IsReduced (reesAlgebra I) := + isReduced_of_injective (reesAlgebra I).val Subtype.val_injective + exact ProjectiveGeometry.proj_isReduced (piece I) + +instance affineBlowup_isIntegral [IsDomain R] [Nonempty (affineBlowup I)] : + IsIntegral (affineBlowup I) := by + let : IsDomain (reesAlgebra I) := + Function.Injective.isDomain (reesAlgebra I).val Subtype.val_injective + let : Nonempty (Proj (piece I)) := ‹Nonempty (affineBlowup I)› + exact ProjectiveGeometry.proj_isIntegral (piece I) + +end PiExponentSeshadri.ReesGrading + +namespace PiExponentSeshadri.AffineBlowup +open AlgebraicGeometry +variable {X : Scheme.{0}} [IsAffine X] (I : X.IdealSheafData) + +instance scheme_isReduced [IsReduced X] : IsReduced (scheme I) := by + dsimp only [scheme] + infer_instance + +instance scheme_isIntegral [IsIntegral X] [Nonempty (scheme I)] : IsIntegral (scheme I) := by + dsimp only [scheme] + infer_instance + +end PiExponentSeshadri.AffineBlowup + +namespace PiExponentSeshadri.BlowupGluing +open AlgebraicGeometry +variable {X : Scheme.{0}} (I : X.IdealSheafData) + +instance scheme_isReduced [IsReduced X] : IsReduced (scheme I) := by + let : ∀ U : (cover I).I₀, IsReduced ((cover I).X U) := fun U => by + change IsReduced (localScheme I U) + infer_instance + exact IsReduced.of_openCover _ (cover I) + +end PiExponentSeshadri.BlowupGluing + +namespace PiExponentSeshadri.Geometry +open AlgebraicGeometry TopologicalSpace +variable {X Y : Scheme.{0}} [IrreducibleSpace X] (I : X.IdealSheafData) + +lemma support_comap_ne_top_of_open (hI : I.support ≠ ⊤) (j : Y ⟶ X) + [IsOpenImmersion j] [Nonempty Y] : (I.comap j).support ≠ ⊤ := by + have hc : (centreComplement I : Set X).Nonempty := by + obtain ⟨x⟩ := complement_nonempty hI + exact ⟨x.val, x.property⟩ + obtain ⟨_, ⟨y, rfl⟩, hy⟩ := nonempty_preirreducible_inter + j.isOpenEmbedding.isOpen_range (centreComplement I).isOpen (Set.range_nonempty j) hc + intro he + have hyn : y ∈ (I.comap j).support := by rw [he]; trivial + rw [Scheme.IdealSheafData.support_comap] at hyn + exact hy hyn + +end PiExponentSeshadri.Geometry + +namespace PiExponentSeshadri.BlowupGluing +open AlgebraicGeometry CategoryTheory TopologicalSpace PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} [IsIntegral X] (I : X.IdealSheafData) + +lemma localScheme_isIntegral (hI : I.support ≠ ⊤) (U : X.AffineZariskiSite) + [Nonempty U.toOpens.toScheme] : IsIntegral (localScheme I U) := by + let : IsIntegral U.toOpens.toScheme := isIntegral_of_isOpenImmersion U.toOpens.ι + let : Nonempty (localScheme I U) := (local_isBlowup I U).nonempty_of_support_ne_top + (support_comap_ne_top_of_open I hI U.toOpens.ι) + infer_instance + +omit [IsIntegral X] in +lemma cover_range (U : X.AffineZariskiSite) : + Set.range ((cover I).f U) = projection I ⁻¹' (U.toOpens : Set X) := by + have h := ((gluing I).preimage_toBase_eq_range_ι U).symm + change Set.range ((cover I).f U) = projection I ⁻¹' Set.range U.toOpens.ι at h + simpa only [Scheme.Opens.range_ι] using h + +lemma complement_dense (hI : I.support ≠ ⊤) : + Dense (projection I ⁻¹' (centreComplement I : Set X)) := by + rw [dense_iff_inter_open] + intro V hV ⟨y, hyV⟩ + obtain ⟨U, z, rfl⟩ := (cover I).exists_eq y + let : Nonempty U.toOpens.toScheme := ⟨localProjection I U z⟩ + let : IsIntegral ((cover I).X U) := localScheme_isIntegral I hI U + have hc : (centreComplement I : Set X).Nonempty := by + obtain ⟨x⟩ := complement_nonempty hI + exact ⟨x.val, x.property⟩ + have hU : (U.toOpens : Set X).Nonempty := by + obtain ⟨x⟩ := ‹Nonempty U.toOpens.toScheme› + exact ⟨x.val, x.property⟩ + obtain ⟨x, hxU, hxc⟩ := nonempty_preirreducible_inter + U.toOpens.isOpen (centreComplement I).isOpen hU hc + let b : scheme I := (isBlowup I).complementLift ⟨x, hxc⟩ + have hpb : projection I b = x := + congrArg (fun f : (centreComplement I).toScheme ⟶ X => f ⟨x, hxc⟩) + (isBlowup I).complementLift_comp + have hbr : b ∈ Set.range ((cover I).f U) := by + erw [cover_range I U] + change projection I b ∈ U.toOpens + rwa [hpb] + obtain ⟨w, hw⟩ := hbr + have hwc : (cover I).f U w ∈ projection I ⁻¹' (centreComplement I : Set X) := by + change projection I ((cover I).f U w) ∈ centreComplement I + rwa [hw, hpb] + obtain ⟨q, hqV, hqc⟩ := nonempty_preirreducible_inter + (hV.preimage ((cover I).f U).continuous) + (((centreComplement I).isOpen.preimage (projection I).continuous).preimage + ((cover I).f U).continuous) ⟨z, hyV⟩ ⟨w, hwc⟩ + exact ⟨(cover I).f U q, hqV, hqc⟩ + +lemma scheme_isIntegral (hI : I.support ≠ ⊤) : IsIntegral (scheme I) := by + let : Nonempty (centreComplement I).toScheme := complement_nonempty hI + let : IsIntegral (centreComplement I).toScheme := + isIntegral_of_isOpenImmersion (centreComplement I).ι + have hi : IsIrreducible (Set.range (isBlowup I).complementLift) := by + simpa only [Set.image_univ] using + (IrreducibleSpace.isIrreducible_univ (X := (centreComplement I).toScheme)).image + (isBlowup I).complementLift (isBlowup I).complementLift.continuous.continuousOn + have hd : Dense (Set.range (isBlowup I).complementLift) := by + rw [Geometry.IsBlowup.complementLift_range] + exact complement_dense I hI + let : IrreducibleSpace (scheme I) := (irreducibleSpace_def _).mpr (by + change IsIrreducible (Set.univ : Set (scheme I)) + rw [← hd.closure_eq] + exact hi.closure) + exact isIntegral_of_irreducibleSpace_of_isReduced _ + +end PiExponentSeshadri.BlowupGluing + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupSchemeExt.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupSchemeExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..dfc31229ac2ce9dbc4655efec0140488ff0f4141 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupSchemeExt.lean @@ -0,0 +1,122 @@ +import Mathlib + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri + +namespace SpecMaps +open CategoryTheory AlgebraicGeometry +universe u +variable {X Y : Scheme.{u}} {R S : CommRingCat.{u}} + +def coordinate (f : X ⟶ Spec R) : R ⟶ Γ(X, ⊤) := + (Scheme.ΓSpecIso R).inv ≫ f.appTop + +lemma coordinate_ext {f g : X ⟶ Spec R} (h : coordinate f = coordinate g) : f = g := + (ΓSpec.adjunction.homEquiv X (Opposite.op R)).symm.injective + (Opposite.unop_injective h) + +@[simp] lemma coordinate_comp (f : X ⟶ Y) (g : Y ⟶ Spec R) : + coordinate (f ≫ g) = coordinate g ≫ f.appTop := by + simp [coordinate] + +@[simp] lemma coordinate_spec (f : R ⟶ S) : coordinate (Spec.map f) = f ≫ (Scheme.ΓSpecIso S).inv := by + simp [coordinate] + +@[simp] lemma coordinate_comp_spec (f : X ⟶ Spec S) (g : R ⟶ S) : + coordinate (f ≫ Spec.map g) = g ≫ coordinate f := by + simp [coordinate] + +lemma factor (f : X ⟶ Spec R) : + X.toSpecΓ ≫ Spec.map (coordinate f) = f := by + unfold coordinate + rw [Spec.map_comp, ← Scheme.toSpecΓ_naturality_assoc, toSpecΓ_SpecMap_ΓSpecIso_inv, + Category.comp_id] + +lemma preimage_basicOpen (f : X ⟶ Spec R) (a : R) : + f ⁻¹ᵁ PrimeSpectrum.basicOpen a = X.basicOpen (coordinate f a) := by + conv_lhs => rw [← factor f] + erw [Scheme.Hom.comp_preimage, SpecMap_preimage_basicOpen] + exact Scheme.toSpecΓ_preimage_basicOpen _ _ + +lemma isUnit_of_basicOpen_eq_top (a : Γ(X, ⊤)) (h : X.basicOpen a = ⊤) : IsUnit a := by + apply RingedSpace.isUnit_of_isUnit_germ X.toLocallyRingedSpace.toRingedSpace ⊤ a + intro x hx + apply (Scheme.mem_basicOpen X a x hx).mp + rw [h] + trivial + +lemma isUnit_coordinate_of_preimage_top (f : X ⟶ Spec R) (a : R) + (h : f ⁻¹ᵁ PrimeSpectrum.basicOpen a = ⊤) : IsUnit (coordinate f a) := by + apply isUnit_of_basicOpen_eq_top + rwa [preimage_basicOpen] at h + +lemma ideal_unit_generator (I : Ideal R) (f : X ⟶ Spec R) + (hI : I.map (coordinate f).hom = ⊤) (x : X) : + ∃ a : I, x ∈ f ⁻¹ᵁ PrimeSpectrum.basicOpen a.val := by + by_contra! hn + have hle : I ≤ (f x).asIdeal := by + intro a ha + exact not_not.mp (hn ⟨a, ha⟩) + have hmap : I.map (coordinate f).hom ≤ (X.toSpecΓ x).asIdeal := by + rw [Ideal.map_le_iff_le_comap] + intro a ha + have hm := hle ha + rw [← factor f, Scheme.Hom.comp_apply, Spec.map_apply] at hm + exact hm + rw [hI] at hmap + exact (X.toSpecΓ x).isPrime.ne_top (top_unique hmap) + +end SpecMaps + +namespace SchematicExt +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry +universe u +variable {W X Y Z : Scheme.{u}} + +lemma ext_of_ker_eq_bot_of_isSeparated {f g : X ⟶ Y} + (s : Y ⟶ Z) [IsSeparated s] (h : f ≫ s = g ≫ s) + (ι : W ⟶ X) (hι : ι.ker = ⊥) (hU : ι ≫ f = ι ≫ g) : f = g := by + let X' : Over Z := Over.mk (f ≫ s) + let Y' : Over Z := Over.mk s + let U' : Over Z := Over.mk (ι ≫ f ≫ s) + let f' : X' ⟶ Y' := Over.homMk f + let g' : X' ⟶ Y' := Over.homMk g h.symm + let ι' : U' ⟶ X' := Over.homMk ι + have : IsSeparated Y'.hom := ‹_› + let l : U' ⟶ equalizer f' g' := equalizer.lift ι' (by ext1; exact hU) + have hl : l.left ≫ (equalizer.ι f' g').left = ι := by + change (l ≫ equalizer.ι f' g').left = ι + exact congrArg (fun k : U' ⟶ X' => k.left) (equalizer.lift_ι ι' _) + have hk : (equalizer.ι f' g').left.ker = ⊥ := by + apply bot_unique + calc _ ≤ (l.left ≫ (equalizer.ι f' g').left).ker := l.left.le_ker_comp _ + _ = ⊥ := by rw [hl, hι] + have : IsIso (equalizer.ι f' g').left := IsClosedImmersion.isIso_iff_ker_eq_bot.mpr hk + rw [← cancel_epi (equalizer.ι f' g').left] + exact congr($(equalizer.condition f' g').left) + +lemma basicOpen_ker_eq_bot [IsAffine X] (r : Γ(X, ⊤)) (hr : IsRegular r) : + (X.basicOpen r).ι.ker = ⊥ := by + apply Scheme.IdealSheafData.ext_of_isAffine + apply bot_unique + apply ((X.basicOpen r).ι.ideal_ker_le ⟨⊤, isAffineOpen_top X⟩).trans + apply le_of_eq + rw [RingHom.ker_eq_bot_iff_eq_zero] + intro x hx + have hinj : Function.Injective (algebraMap Γ(X, ⊤) Γ(X.basicOpen r, ⊤)) := + IsLocalization.injective (Γ(X.basicOpen r, ⊤)) + (Submonoid.powers_le.mpr (isRegular_iff_mem_nonZeroDivisors.mp hr)) + apply hinj + change (algebraMap Γ(X, ⊤) Γ(X.basicOpen r, ⊤)) x = 0 at hx + simpa only [map_zero] using hx + +end SchematicExt + +end PiExponentSeshadri + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupUniversalBaseChange.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupUniversalBaseChange.lean new file mode 100644 index 0000000000000000000000000000000000000000..9cf8667544c94234a2f4995fa9883919a1aafff8 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/BlowupUniversalBaseChange.lean @@ -0,0 +1,121 @@ +import OAI.NumberTheory.PiExponent.LocalAlgebra.GlobalInvertibleIdeal + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry + +section +variable {X B Y Z : Scheme} {I : X.IdealSheafData} {π : B ⟶ X} + +lemma IsBlowup.hom_ext (hπ : IsBlowup I π) (f : Y ⟶ X) + (hf : InvertiblePullbackIdeal I f) {g h : Y ⟶ B} + (hg : g ≫ π = f) (hh : h ≫ π = f) : g = h := by + obtain ⟨l, _, hl⟩ := hπ.2 Y f hf + exact (hl g hg).trans (hl h hh).symm + +lemma IsBlowup.postIso (hπ : IsBlowup I π) (e : X ≅ Z) + (J : Z.IdealSheafData) (he : J.comap e.hom = I) : + IsBlowup J (π ≫ e.hom) := by + have hcongr (W : Scheme) (f : W ⟶ X) : + InvertiblePullbackIdeal J (f ≫ e.hom) ↔ InvertiblePullbackIdeal I f := + InvertibleLocal.invertible_congr (by rw [Scheme.IdealSheafData.comap_comp, he]) + refine ⟨(hcongr B π).mpr hπ.1, ?_⟩ + intro W f hf + have hf' : InvertiblePullbackIdeal I (f ≫ e.inv) := by + apply (hcongr W (f ≫ e.inv)).mp + simpa only [Category.assoc, Iso.inv_hom_id, Category.comp_id] using hf + obtain ⟨l, hl, huniq⟩ := hπ.2 W (f ≫ e.inv) hf' + refine ⟨l, ?_, ?_⟩ + · change l ≫ π ≫ e.hom = f + rw [← Category.assoc, hl, Category.assoc, Iso.inv_hom_id, Category.comp_id] + · intro m hm + apply huniq m + rw [← cancel_mono e.hom, Category.assoc, hm, Category.assoc, + Iso.inv_hom_id, Category.comp_id] + +lemma IsBlowup.open_baseChange (hπ : IsBlowup I π) (j : Z ⟶ X) + [IsOpenImmersion j] : + IsBlowup (I.comap j) (pullback.fst j π) := by + have hcongr {W : Scheme} (g : W ⟶ Z) : + InvertiblePullbackIdeal (I.comap j) g ↔ InvertiblePullbackIdeal I (g ≫ j) := + InvertibleLocal.invertible_congr (Scheme.IdealSheafData.comap_comp I g j).symm + have hpic : InvertiblePullbackIdeal (I.comap j) (pullback.fst j π) := by + apply (hcongr _).mpr + rw [pullback.condition] + exact InvertibleLocal.invertible_restrict_general I π hπ.1 (pullback.snd j π) + refine ⟨hpic, ?_⟩ + intro W f hf + obtain ⟨l, hl, huniq⟩ := hπ.2 W (f ≫ j) ((hcongr f).mp hf) + refine ⟨pullback.lift f l hl.symm, pullback.lift_fst _ _ _, ?_⟩ + intro m hm + apply pullback.hom_ext + · simpa only [pullback.lift_fst] using hm + · rw [pullback.lift_snd] + apply huniq + rw [Category.assoc, ← pullback.condition, ← Category.assoc, hm] + +def IsBlowup.iso {B' : Scheme} {π' : B' ⟶ X} (hπ : IsBlowup I π) + (hπ' : IsBlowup I π') : B ≅ B' where + hom := (hπ'.2 B π hπ.1).choose + inv := (hπ.2 B' π' hπ'.1).choose + hom_inv_id := by + apply hπ.hom_ext π hπ.1 + · rw [Category.assoc, (hπ.2 B' π' hπ'.1).choose_spec.1] + exact (hπ'.2 B π hπ.1).choose_spec.1 + · simp + inv_hom_id := by + apply hπ'.hom_ext π' hπ'.1 + · rw [Category.assoc, (hπ'.2 B π hπ.1).choose_spec.1] + exact (hπ.2 B' π' hπ'.1).choose_spec.1 + · simp + +@[reassoc (attr := simp)] +lemma IsBlowup.iso_hom_comp {B' : Scheme} {π' : B' ⟶ X} (hπ : IsBlowup I π) + (hπ' : IsBlowup I π') : (hπ.iso hπ').hom ≫ π' = π := + (hπ'.2 B π hπ.1).choose_spec.1 + +end + +section +variable {X B B' Z : Scheme} {I : X.IdealSheafData} {π : B ⟶ X} + +lemma IsBlowup.baseChangeSquare (hπ : IsBlowup I π) (j : Z ⟶ X) + [IsOpenImmersion j] (ρ : B' ⟶ Z) (hρ : IsBlowup (I.comap j) ρ) + (β : B' ⟶ B) (hβ : β ≫ π = ρ ≫ j) : IsPullback ρ β j π := by + let e := hρ.iso (hπ.open_baseChange j) + refine IsPullback.of_iso_pullback ⟨hβ.symm⟩ e + (hρ.iso_hom_comp (hπ.open_baseChange j)) ?_ + apply hπ.hom_ext (ρ ≫ j) + · exact (InvertibleLocal.invertible_congr + (Scheme.IdealSheafData.comap_comp I ρ j)).mpr hρ.1 + · rw [Category.assoc, ← pullback.condition, ← Category.assoc, + hρ.iso_hom_comp (hπ.open_baseChange j)] + · exact hβ + +end + +open TopologicalSpace +open PiExponentSeshadri.Frames +variable {X B B' : Scheme.{0}} {I : X.IdealSheafData} {π : B ⟶ X} + +lemma IsBlowup.preIso (hπ : IsBlowup I π) (e : B' ≅ B) : + IsBlowup I (e.hom ≫ π) := by + refine ⟨InvertibleLocal.invertible_restrict_general I π hπ.1 e.hom,?_⟩ + intro Y f hf + obtain ⟨g,hg,huniq⟩ := hπ.2 Y f hf + refine ⟨g ≫ e.inv,by simp only [Category.assoc,Iso.inv_hom_id_assoc,hg],?_⟩ + intro g' hg' + rw [← cancel_mono e.hom] + simpa only [Category.assoc,Iso.inv_hom_id,Category.comp_id] using huniq (g' ≫ e.hom) hg' + +lemma IsBlowup.morphismRestrict (hπ : IsBlowup I π) (U : X.Opens) : + IsBlowup (I.comap U.ι) (π ∣_ U) := by + have H := (hπ.open_baseChange U.ι).preIso (isPullback_morphismRestrict π U).isoPullback + rwa [(isPullback_morphismRestrict π U).isoPullback_hom_fst] at H + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ClosedAmpleBaseChange.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ClosedAmpleBaseChange.lean new file mode 100644 index 0000000000000000000000000000000000000000..a4146181d17f581a5775dd5d6c5f38b00e111526 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ClosedAmpleBaseChange.lean @@ -0,0 +1,45 @@ +import Mathlib.AlgebraicGeometry.IdealSheaf.Functorial +import OAI.NumberTheory.PiExponent.Ampleness.ClosedAmpleRestriction + +namespace OAI + +noncomputable section +namespace PiExponent.ReducedComponentAmple +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits +open PiExponentSeshadri.Geometry + +variable {X Y : Scheme.{0}} + +def closedBaseChange (I : X.IdealSheafData) (f : Y ⟶ X) : + (I.comap f).subscheme ⟶ I.subscheme := + (I.comapIso f).hom ≫ pullback.snd f I.subschemeι + +instance closedBaseChange_isClosedImmersion (I : X.IdealSheafData) + (f : Y ⟶ X) [IsClosedImmersion f] : IsClosedImmersion (closedBaseChange I f) := by + unfold closedBaseChange + infer_instance + +@[reassoc] +theorem closedBaseChange_condition (I : X.IdealSheafData) (f : Y ⟶ X) : + closedBaseChange I f ≫ I.subschemeι = (I.comap f).subschemeι ≫ f := by + simp only [closedBaseChange, Category.assoc, ← pullback.condition, + Scheme.IdealSheafData.comapIso_hom_fst_assoc] + +def closedBaseChangeLineIso (I : X.IdealSheafData) (f : Y ⟶ X) (L : LineBundle X) : + ((L.pullback I.subschemeι).pullback (closedBaseChange I f)).sheaf ≅ + ((L.pullback f).pullback (I.comap f).subschemeι).sheaf := + (Scheme.Modules.pullbackComp (closedBaseChange I f) I.subschemeι).app L.sheaf ≪≫ + (Scheme.Modules.pullbackCongr (closedBaseChange_condition I f)).app L.sheaf ≪≫ + ((Scheme.Modules.pullbackComp (I.comap f).subschemeι f).app L.sheaf).symm + +theorem isAmple_comap_restriction (I : X.IdealSheafData) (f : Y ⟶ X) + [IsClosedImmersion f] (L : LineBundle X) (hL : (L.pullback I.subschemeι).IsAmple) : + ((L.pullback f).pullback (I.comap f).subschemeι).IsAmple := + PiExponent.AmpleIso.isAmple_of_sheaf_iso _ _ (closedBaseChangeLineIso I f L) + (LineBundle.IsAmple.pullback_closedImmersion _ hL (closedBaseChange I f)) + +end PiExponent.ReducedComponentAmple + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ClosedAmpleRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ClosedAmpleRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..c690b847fbb4ff0fed683acedc7ed8a18fc50a96 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ClosedAmpleRestriction.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleIso +import OAI.NumberTheory.PiExponent.Approximation.FramedPullback +import OAI.NumberTheory.PiExponent.Approximation.LinePullbackPowers + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Frames PiExponentSeshadri.SectionOpens +variable {X Y : Scheme.{0}} + +theorem pullback_isoOpen_eq (L : LineBundle X) (s : O X ⟶ L.sheaf) (f : Y ⟶ X) : + isoOpen (pullbackSection f s) = f ⁻¹ᵁ isoOpen s := by + ext y + obtain ⟨U,hy,⟨e⟩⟩ := L.locallyRankOne (f y) + obtain ⟨eF,he⟩ := exists_restricted_pullback_frame f U e s + calc + y ∈ isoOpen (pullbackSection f s) ↔ + (⟨y,hy⟩ : (f ⁻¹ᵁ U).toScheme) ∈ (f ⁻¹ᵁ U).toScheme.basicOpen + (coefficient eF (restrictSection (f ⁻¹ᵁ U).ι (pullbackSection f s))) := + (congrArg (fun V => (⟨y,hy⟩ : (f ⁻¹ᵁ U).toScheme) ∈ V) + (preimage_isoOpen (pullbackSection f s) (f ⁻¹ᵁ U).ι eF)).to_iff + _ ↔ (⟨f y,hy⟩ : U.toScheme) ∈ U.toScheme.basicOpen + (coefficient e (restrictSection U.ι s)) := by + rw [he,← Scheme.preimage_basicOpen_top] + change (f ∣_ U) ⟨y,hy⟩ ∈ U.toScheme.basicOpen + (coefficient e (restrictSection U.ι s)) ↔ _ + rw [morphismRestrict_base] + rfl + _ ↔ f y ∈ isoOpen s := + (congrArg (fun V => (⟨f y,hy⟩ : U.toScheme) ∈ V) + (preimage_isoOpen s U.ι e)).to_iff.symm + +def pullbackPowerSection (L : LineBundle X) (f : Y ⟶ X) (n : ℕ) + (s : GlobalSections X (modulePow X L.sheaf n)) : + GlobalSections Y (modulePow Y (L.pullback f).sheaf n) := + pullbackSection f s ≫ (PiExponentSeshadri.PullbackTensor.powIso f L n).hom + +theorem sectionOpen_pullbackPowerSection (L : LineBundle X) (f : Y ⟶ X) (n : ℕ) + (s : GlobalSections X (modulePow X L.sheaf n)) : + sectionOpen Y (pullbackPowerSection L f n s) = f ⁻¹ᵁ sectionOpen X s := by + unfold pullbackPowerSection + erw [PiExponent.AmpleIso.sectionOpen_postcomp_iso] + exact pullback_isoOpen_eq (L.pow n) s f + +theorem LineBundle.IsAmple.pullback_closedImmersion (L : LineBundle X) (hL : L.IsAmple) + (f : Y ⟶ X) [IsClosedImmersion f] : (L.pullback f).IsAmple := by + intro y V hy + obtain ⟨W,hW,hWV⟩ := f.isClosedEmbedding.isInducing.isOpen_iff.mp V.isOpen + let U : X.Opens := ⟨W,hW⟩ + have hfV : f ⁻¹ᵁ U = V := TopologicalSpace.Opens.ext hWV + have hfy : f y ∈ U := by + change y ∈ f ⁻¹ᵁ U + rwa [hfV] + obtain ⟨n,hn,s,hys,hsU,hsa⟩ := hL (f y) U hfy + refine ⟨n,hn,pullbackPowerSection L f n s,?_,?_,?_⟩ + · rw [sectionOpen_pullbackPowerSection] + exact hys + · rw [sectionOpen_pullbackPowerSection, ← hfV] + exact (Opens.map f.base).monotone hsU + · rw [sectionOpen_pullbackPowerSection] + exact hsa.preimage f + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/CoherentAffineFinite.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/CoherentAffineFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..93cb8007903ecd4fe5b643c6bade79e709171df8 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/CoherentAffineFinite.lean @@ -0,0 +1,308 @@ +import Mathlib + +namespace OAI + +namespace PiExponent.CoherentAffineFinite +noncomputable section +universe u +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite + +private theorem epi_iso_comp_iso {C : Type*} [Category C] {A B D E : C} + (i : A ≅ B) (p : B ⟶ D) (hp : Epi p) (j : D ≅ E) : + Epi (i.hom ≫ p ≫ j.hom) := by + let : Epi p := hp + infer_instance + +private theorem finitePresentation_quasicoherent {X : Scheme.{u}} + (M : X.Modules) [M.IsFinitePresentation] : M.IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData M).choose.isQuasicoherent + +theorem spec_sections_finite_of_generators {R : CommRingCat.{u}} + (M : (Spec R).Modules) [M.IsQuasicoherent] + (s : M.GeneratingSections) [hs : s.IsFiniteType] : + Module.Finite R ((modulesSpecToSheaf.obj M).obj.obj (op ⊤)) := by + let : Finite s.I := hs.finite + let : Fintype s.I := Fintype.ofFinite s.I + let N : ModuleCat R := (modulesSpecToSheaf.obj M).obj.obj (op ⊤) + let a : tilde (ModuleCat.of R (s.I →₀ R)) ⟶ tilde N := + (tildeFinsupp s.I).hom ≫ s.π ≫ (asIso M.fromTildeΓ).inv + let f : ModuleCat.of R (s.I →₀ R) ⟶ N := (tilde.functor R).preimage a + have : Epi s.π := s.epi + have : Epi (asIso M.fromTildeΓ).inv := inferInstance + have ha : Epi a := by + change Epi ((tildeFinsupp s.I).hom ≫ s.π ≫ (asIso M.fromTildeΓ).inv) + exact epi_iso_comp_iso (tildeFinsupp s.I) s.π s.epi (asIso M.fromTildeΓ).symm + have hf : Epi f := (tilde.functor R).epi_of_epi_map (by + change Epi ((tilde.functor R).map ((tilde.functor R).preimage a)) + exact (Functor.map_preimage (tilde.functor R) a).symm ▸ ha) + exact Module.Finite.of_surjective f.hom ((ModuleCat.epi_iff_surjective f).mp hf) + +theorem affine_sections_finite_of_generators {X : Scheme.{u}} [IsAffine X] + (M : X.Modules) [M.IsQuasicoherent] + (s : M.GeneratingSections) [hs : s.IsFiniteType] : Module.Finite Γ(X,⊤) Γ(M,⊤) := by + let f := X.isoSpec.inv + let F : SheafOfModules X.ringCatSheaf ⥤ SheafOfModules (Spec Γ(X,⊤)).ringCatSheaf := + Scheme.Modules.restrictFunctor f + let : Limits.PreservesColimitsOfSize.{u, u} F := + (Scheme.Modules.restrictAdjunction f).leftAdjoint_preservesColimits + let J := M.restrict f + let t := s.map F (Scheme.Modules.restrictUnitIso f).symm + let : t.IsFiniteType := ⟨hs.finite⟩ + let R := Γ(X,⊤) + let N := (modulesSpecToSheaf.obj J).obj.obj (op ⊤) + let : Module.Finite R N := spec_sections_finite_of_generators J t + let σ : R →+* Γ(X,f ''ᵁ ⊤) := (f.appIso ⊤).inv.hom.comp (Scheme.ΓSpecIso R).inv.hom + let φ : N →ₛₗ[σ] Γ(M,f ''ᵁ ⊤) := { + toFun := (M.restrictAppIso f ⊤).hom + map_add' := map_add _ + map_smul' := by intro r m; rfl } + have hφ : Function.Surjective φ := + (ConcreteCategory.bijective_of_isIso (M.restrictAppIso f ⊤).hom).surjective + have hf : f ''ᵁ (⊤ : (Spec R).Opens) = ⊤ := by + ext x + change (∃ y : Spec R, y ∈ (⊤ : (Spec R).Opens) ∧ f y = x) ↔ True + simp only [Opens.mem_top, true_and, iff_true] + exact (ConcreteCategory.bijective_of_isIso f.base).surjective x + have h := Module.Finite.of_surjective φ hφ + rw [hf] at h + exact h + +def LocallyFinitelyGenerated {X : Scheme.{u}} (M : X.Modules) : Prop := + ∀ x : X, ∃ U : X.Opens, x ∈ U ∧ + ∃ s : (M.restrict U.ι).GeneratingSections, s.IsFiniteType + +theorem locallyFinitelyGenerated_of_finitePresentation {X : Scheme.{u}} + (M : X.Modules) [M.IsFinitePresentation] : LocallyFinitelyGenerated M := by + obtain ⟨q, hq⟩ := SheafOfModules.IsFinitePresentation.exists_quasicoherentData M + intro x + have hcov := q.coversTop + rw [Opens.coversTop_iff] at hcov + obtain ⟨i, hi⟩ := Opens.mem_iSup.mp (show x ∈ ⨆ i, q.X i by rw [hcov]; trivial) + refine ⟨q.X i, hi, ?_⟩ + let F : SheafOfModules (Sheaf.over X.ringCatSheaf (q.X i)) ⥤ + SheafOfModules (Scheme.Opens.toScheme (X := X) (q.X i)).ringCatSheaf := + (Scheme.Modules.overEquiv (q.X i)).functor + let : Limits.PreservesColimitsOfSize.{u, u} F := + (Scheme.Modules.overEquiv (q.X i)).toAdjunction.leftAdjoint_preservesColimits + let t := (q.presentation i).generators.map F (Iso.refl _) + let e := (Scheme.Modules.overFunctorEquiv (q.X i)).app M + exact ⟨SheafOfModules.GeneratingSections.equivOfIso e t, + ⟨(hq.isFinite_presentation i).isFiniteType_generators.finite⟩⟩ + +theorem finite_generators_of_le {X : Scheme.{u}} (M : X.Modules) {U V : X.Opens} + (h : V ≤ U) (s : (M.restrict U.ι).GeneratingSections) [s.IsFiniteType] : + ∃ t : (M.restrict V.ι).GeneratingSections, t.IsFiniteType := by + let F : SheafOfModules U.toScheme.ringCatSheaf ⥤ SheafOfModules V.toScheme.ringCatSheaf := + Scheme.Modules.restrictFunctor (X.homOfLE h) + let : Limits.PreservesColimitsOfSize.{u, u} F := + (Scheme.Modules.restrictAdjunction (X.homOfLE h)).leftAdjoint_preservesColimits + let t := s.map F + (Scheme.Modules.restrictUnitIso (X.homOfLE h)).symm + let e := (Scheme.Modules.restrictFunctorComp (X.homOfLE h) U.ι).app M + simp only [X.homOfLE_ι h] at e + exact ⟨SheafOfModules.GeneratingSections.equivOfIso e.symm t, + ⟨SheafOfModules.GeneratingSections.IsFiniteType.finite (σ := s)⟩⟩ + +theorem affine_open_sections_finite_of_generators {X : Scheme.{u}} + (M : X.Modules) [M.IsQuasicoherent] (U : X.Opens) (hU : IsAffineOpen U) + (s : (M.restrict U.ι).GeneratingSections) [s.IsFiniteType] : + Module.Finite Γ(X,U) Γ(M,U) := by + let : IsAffine U.toScheme := hU + let : Module.Finite Γ(U.toScheme,⊤) Γ(M.restrict U.ι,⊤) := + affine_sections_finite_of_generators (M.restrict U.ι) s + let σ := (U.ι.appIso ⊤).inv.hom + let φ : Γ(M.restrict U.ι,⊤) →ₛₗ[σ] Γ(M,U.ι ''ᵁ ⊤) := { + toFun := (M.restrictAppIso U.ι ⊤).hom + map_add' := map_add _ + map_smul' := by intro r m; rfl } + have hφ : Function.Surjective φ := + (ConcreteCategory.bijective_of_isIso (M.restrictAppIso U.ι ⊤).hom).surjective + have h := Module.Finite.of_surjective φ hφ + rwa [U.ι_image_top] at h + +theorem spec_sections_finite_of_localGenerators {R : CommRingCat.{u}} + (M : (Spec R).Modules) [M.IsQuasicoherent] (hM : LocallyFinitelyGenerated M) : + Module.Finite R ((modulesSpecToSheaf.obj M).obj.obj (op ⊤)) := by + classical + let D (r : R) : (Spec R).Opens := PrimeSpectrum.basicOpen r + let t : Set R := {r | ∃ s : (M.restrict (D r).ι).GeneratingSections, s.IsFiniteType} + have ht : Ideal.span t = ⊤ := by + rw [← PrimeSpectrum.iSup_basicOpen_eq_top_iff'] + apply top_unique + intro x hx + obtain ⟨U,hxU,s,hs⟩ := hM x + obtain ⟨_,⟨_,⟨r,rfl⟩,rfl⟩,hxr,hrU⟩ := + PrimeSpectrum.isBasis_basic_opens.exists_subset_of_mem_open hxU U.isOpen + exact Opens.mem_iSup.mpr ⟨r, Opens.mem_iSup.mpr + ⟨finite_generators_of_le M hrU s,hxr⟩⟩ + let N := (modulesSpecToSheaf.obj M).obj.obj (op ⊤) + let A (r : t) := Γ(Spec R, PrimeSpectrum.basicOpen r.val) + let P (r : t) := Γ(M, PrimeSpectrum.basicOpen r.val) + let (r : t) : Algebra R (A r) := StructureSheaf.openAlgebra (R := R) (op (PrimeSpectrum.basicOpen r.val)) + let (r : t) : IsLocalization.Away r.val (A r) := inferInstanceAs + (IsLocalization.Away r.val ((Spec.structureSheaf R).obj.obj (op (PrimeSpectrum.basicOpen r.val)))) + let (r : t) : Module (A r) (P r) := + (M.val.obj (op (PrimeSpectrum.basicOpen r.val))).isModule + let (r : t) : Module R (P r) := + ((modulesSpecToSheaf.obj M).obj.obj (op (PrimeSpectrum.basicOpen r.val))).isModule + let (r : t) : IsScalarTower R (A r) (P r) := + IsScalarTower.of_compHom R (A r) (P r) + let f (r : t) : N →ₗ[R] P r := + ((modulesSpecToSheaf.obj M).obj.map (homOfLE le_top).op).hom + have hloc := (isIso_fromTildeΓ_iff_isLocalizing M).mp inferInstance + let (r : t) : IsLocalizedModule.Away r.val (f r) := hloc r.val + have hfin (r : t) : Module.Finite (A r) (P r) := by + obtain ⟨s, hs⟩ := r.property + exact affine_open_sections_finite_of_generators M (D r.val) + (IsAffineOpen.Spec_basicOpen r.val) s + exact Module.Finite.of_localizationSpan' t ht f hfin + +theorem LocallyFinitelyGenerated.restrict {X Y : Scheme.{u}} {M : Y.Modules} + (hM : LocallyFinitelyGenerated M) (f : X ⟶ Y) [IsOpenImmersion f] : + LocallyFinitelyGenerated (M.restrict f) := by + intro x + obtain ⟨U, hxU, s, hs⟩ := hM (f x) + let V := f ⁻¹ᵁ U + let F : SheafOfModules U.toScheme.ringCatSheaf ⥤ SheafOfModules V.toScheme.ringCatSheaf := + Scheme.Modules.restrictFunctor (f ∣_ U) + let : Limits.PreservesColimitsOfSize.{u, u} F := + (Scheme.Modules.restrictAdjunction (f ∣_ U)).leftAdjoint_preservesColimits + let t := s.map F + (Scheme.Modules.restrictUnitIso (f ∣_ U)).symm + let e := (Scheme.Modules.restrictFunctorComp (f ∣_ U) U.ι).app M + have e' : M.restrict (V.ι ≫ f) ≅ (M.restrict U.ι).restrict (f ∣_ U) := by + change M.restrict ((f ∣_ U) ≫ U.ι) ≅ (M.restrict U.ι).restrict (f ∣_ U) at e + simpa only [V, morphismRestrict_ι] using e + let e'' := ((Scheme.Modules.restrictFunctorComp V.ι f).app M).symm ≪≫ e' + exact ⟨V, hxU, SheafOfModules.GeneratingSections.equivOfIso e''.symm t, + ⟨SheafOfModules.GeneratingSections.IsFiniteType.finite (σ := s)⟩⟩ + +theorem affine_sections_finite_of_localGenerators {X : Scheme.{u}} [IsAffine X] + (M : X.Modules) [M.IsQuasicoherent] (hM : LocallyFinitelyGenerated M) : + Module.Finite Γ(X,⊤) Γ(M,⊤) := by + let f := X.isoSpec.inv + let J := M.restrict f + let R := Γ(X,⊤) + let N := (modulesSpecToSheaf.obj J).obj.obj (op ⊤) + let : Module.Finite R N := spec_sections_finite_of_localGenerators J + (hM.restrict f) + let σ : R →+* Γ(X,f ''ᵁ ⊤) := (f.appIso ⊤).inv.hom.comp (Scheme.ΓSpecIso R).inv.hom + let φ : N →ₛₗ[σ] Γ(M,f ''ᵁ ⊤) := { + toFun := (M.restrictAppIso f ⊤).hom + map_add' := map_add _ + map_smul' := by intro r m; rfl } + have hφ : Function.Surjective φ := + (ConcreteCategory.bijective_of_isIso (M.restrictAppIso f ⊤).hom).surjective + have hf : f ''ᵁ (⊤ : (Spec R).Opens) = ⊤ := by + ext x + change (∃ y : Spec R, y ∈ (⊤ : (Spec R).Opens) ∧ f y = x) ↔ True + simp only [Opens.mem_top, true_and, iff_true] + exact (ConcreteCategory.bijective_of_isIso f.base).surjective x + have h := Module.Finite.of_surjective φ hφ + rw [hf] at h + exact h + +theorem affine_sections_finite {X : Scheme.{u}} [IsAffine X] + (M : X.Modules) [M.IsFinitePresentation] : Module.Finite Γ(X,⊤) Γ(M,⊤) := by + let := finitePresentation_quasicoherent M + exact affine_sections_finite_of_localGenerators M (locallyFinitelyGenerated_of_finitePresentation M) + +theorem finite_isoSpec_sections {X : Scheme.{u}} [IsAffine X] + (M : X.Modules) [Module.Finite Γ(X,⊤) Γ(M,⊤)] : + Module.Finite Γ(X,⊤) + ((modulesSpecToSheaf.obj (M.restrict X.isoSpec.inv)).obj.obj (op ⊤)) := by + let f := X.isoSpec.inv + let R := Γ(X,⊤) + let N : ModuleCat R := (modulesSpecToSheaf.obj (M.restrict f)).obj.obj (op ⊤) + have hf : f ''ᵁ (⊤ : (Spec R).Opens) = ⊤ := by + ext x + change (∃ y : Spec R, y ∈ (⊤ : (Spec R).Opens) ∧ f y = x) ↔ True + simp only [Opens.mem_top, true_and, iff_true] + exact (ConcreteCategory.bijective_of_isIso f.base).surjective x + have : Module.Finite Γ(X,f ''ᵁ ⊤) Γ(M,f ''ᵁ ⊤) := by + rw [hf] + infer_instance + let σ : Γ(X,f ''ᵁ ⊤) →+* R := (Scheme.ΓSpecIso R).hom.hom.comp (f.appIso ⊤).hom.hom + let φ : Γ(M,f ''ᵁ ⊤) →ₛₗ[σ] N := { + toFun := (M.restrictAppIso f ⊤).inv + map_add' := map_add _ + map_smul' := by + intro r m + change (M.restrictAppIso f ⊤).inv (r • m) = + ((Scheme.ΓSpecIso R).inv ((Scheme.ΓSpecIso R).hom ((f.appIso ⊤).hom r))) • + (M.restrictAppIso f ⊤).inv m + rw [Iso.hom_inv_id_apply] + exact congr($(M.smul_restrictAppIso_inv f ⊤ r) m) } + exact Module.Finite.of_surjective φ + (ConcreteCategory.bijective_of_isIso (M.restrictAppIso f ⊤).inv).surjective + +theorem spec_exists_finite_generators {R : CommRingCat.{u}} + (M : (Spec R).Modules) [M.IsQuasicoherent] + [Module.Finite R ((modulesSpecToSheaf.obj M).obj.obj (op ⊤))] : + ∃ s : M.GeneratingSections, s.IsFiniteType := by + let N : ModuleCat R := (modulesSpecToSheaf.obj M).obj.obj (op ⊤) + obtain ⟨I,hI,v,hv⟩ : ∃ (I : Type u) (_ : Finite I) (v : I → N), + Submodule.span R (Set.range v) = ⊤ := + Submodule.fg_iff_exists_finite_generating_family.mp (Module.Finite.fg_top (R := R) (M := N)) + let f : ModuleCat.of R (I →₀ R) ⟶ N := ModuleCat.ofHom (X := I →₀ R) (Y := N) (Finsupp.linearCombination (M := N) R v) + have : Epi f := (ModuleCat.epi_iff_surjective f).mpr <| by + change Function.Surjective (Finsupp.linearCombination (M := N) R v) + rw [← LinearMap.range_eq_top, Finsupp.range_linearCombination, hv] + let p : SheafOfModules.free I ⟶ M := + (tildeFinsupp I).inv ≫ (tilde.functor R).map f ≫ M.fromTildeΓ + have hmap : Epi ((tilde.functor R).map f) := inferInstance + have : Epi M.fromTildeΓ := inferInstance + have hp : Epi p := by + change Epi ((tildeFinsupp I).inv ≫ (tilde.functor R).map f ≫ M.fromTildeΓ) + let hΓ := Scheme.Modules.isIso_fromTildeΓ_of_isQuasicoherent M + exact epi_iso_comp_iso (tildeFinsupp I).symm ((tilde.functor R).map f) hmap + (@asIso _ _ _ _ M.fromTildeΓ hΓ) + let s : M.GeneratingSections := { + I := I + s := M.freeHomEquiv p + epi := by simpa only [Equiv.symm_apply_apply] using hp } + exact ⟨s, ⟨hI⟩⟩ + +theorem affine_exists_finite_generators {X : Scheme.{u}} [IsAffine X] + (M : X.Modules) [M.IsQuasicoherent] [Module.Finite Γ(X,⊤) Γ(M,⊤)] : + ∃ s : M.GeneratingSections, s.IsFiniteType := by + let f := X.isoSpec.inv + let J := M.restrict f + let : Module.Finite Γ(X,⊤) ((modulesSpecToSheaf.obj J).obj.obj (op ⊤)) := + finite_isoSpec_sections M + obtain ⟨s,hs⟩ := spec_exists_finite_generators J + let g := X.isoSpec.hom + let F : SheafOfModules (Spec Γ(X,⊤)).ringCatSheaf ⥤ SheafOfModules X.ringCatSheaf := + Scheme.Modules.restrictFunctor g + let : Limits.PreservesColimitsOfSize.{u, u} F := + (Scheme.Modules.restrictAdjunction g).leftAdjoint_preservesColimits + let t := s.map F (Scheme.Modules.restrictUnitIso g).symm + let e₁ := (Scheme.Modules.restrictFunctorComp g f).app M + have e₂ : M.restrict (𝟙 X) ≅ J.restrict g := by + change M.restrict (g ≫ f) ≅ J.restrict g at e₁ + simpa only [g, f, Iso.hom_inv_id] using e₁ + let e := e₂.symm ≪≫ Scheme.Modules.restrictFunctorId.app M + exact ⟨SheafOfModules.GeneratingSections.equivOfIso e t, + ⟨hs.finite⟩⟩ + +theorem affine_exists_finite_generators_of_finitePresentation {X : Scheme.{u}} [IsAffine X] + (M : X.Modules) [M.IsFinitePresentation] : + ∃ s : M.GeneratingSections, s.IsFiniteType := by + let := finitePresentation_quasicoherent M + have := affine_sections_finite M + exact affine_exists_finite_generators M + +theorem affine_open_sections_finite {X : Scheme.{u}} (M : X.Modules) + [M.IsFinitePresentation] (U : X.Opens) (hU : IsAffineOpen U) : + Module.Finite Γ(X,U) Γ(M,U) := by + let : IsAffine U.toScheme := hU + let := finitePresentation_quasicoherent M + have := affine_sections_finite_of_localGenerators (M.restrict U.ι) + ((locallyFinitelyGenerated_of_finitePresentation M).restrict U.ι) + obtain ⟨s,hs⟩ := affine_exists_finite_generators (M.restrict U.ι) + exact affine_open_sections_finite_of_generators M U hU s + +end +end PiExponent.CoherentAffineFinite + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescent.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescent.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd81637235a8935e35215b706467564cb393c99a --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescent.lean @@ -0,0 +1,60 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ComponentAmpleDescentCover +import OAI.NumberTheory.PiExponent.Ampleness.ComponentAmpleDescentLocal +import OAI.NumberTheory.PiExponent.Ampleness.ComponentAmpleDescentSupported +import OAI.NumberTheory.PiExponent.Approximation.ClosedUnitKernel +import OAI.NumberTheory.PiExponent.Approximation.GlobalClosedAnnihilatedDescent + +namespace OAI + +namespace PiExponentSeshadri.ComponentAmpleDescent +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.IdealModule +variable {X : Scheme.{0}} [IsNoetherian X] [IsReduced X] +variable {R : Type} [CommRing R] [IsNoetherianRing R] + +theorem exists_complementary_ideal_descent + (I J : X.IdealSheafData) (hcover : I.support ⊔ J.support = ⊤) : + ∃ N : J.subscheme.Modules, N.IsFinitePresentation ∧ + Nonempty ((Scheme.Modules.pushforward J.subschemeι).obj N ≅ closedModule I) := by + have : (closedModule I).IsFinitePresentation := closedModule_isFinitePresentation I + apply ClosedAnnihilatedDescent.exists_closed_coherent_descent J.subschemeι (closedModule I) + intro U + exact closedModule_restrict_annihilated hcover U + +theorem eventual_restriction_surjective_of_complement_ample + (p : X ⟶ Spec (CommRingCat.of R)) [IsProper p] + (K L : LineBundle X) (I J : X.IdealSheafData) + (hcover : I.support ⊔ J.support = ⊤) (hJ : (L.pullback J.subschemeι).IsAmple) : + ∃ B : ℕ, ∀ n ≥ B, Function.Surjective + (fun s : GlobalSections X (K.tensor (L.pow n)).sheaf => pullbackSection I.subschemeι s) := by + obtain ⟨N,hN,⟨e⟩⟩ := exists_complementary_ideal_descent I J hcover + let : N.IsFinitePresentation := hN + obtain ⟨B,hB⟩ := eventual_tensor_cohomology_zero_of_closed_pushforward p J.subschemeι + (closedModule I) N e K L hJ + refine ⟨B,fun n hn => ?_⟩ + exact pullbackSection_surjective_of_idealTensor_cohomology_zero I.subschemeι + (K.tensor (L.pow n)) (hB n hn 1 (by decide)) + +theorem isAmple_of_reduced_closed_cover + (p : X ⟶ Spec (CommRingCat.of R)) [IsProper p] + (L H : LineBundle X) (hH : H.IsAmple) + (I J : X.IdealSheafData) (hcover : I.support ⊔ J.support = ⊤) + (hI : (L.pullback I.subschemeι).IsAmple) (hJ : (L.pullback J.subschemeι).IsAmple) : + L.IsAmple := by + let : NoetherianSpace I.subscheme := + I.subschemeι.isClosedEmbedding.isEmbedding.isInducing.noetherianSpace + let : NoetherianSpace J.subscheme := + J.subschemeι.isClosedEmbedding.isEmbedding.isInducing.noetherianSpace + have hc : Set.range I.subschemeι ∪ Set.range J.subschemeι = Set.univ := by + rw [I.range_subschemeι,J.range_subschemeι] + exact congrArg (fun Z : Closeds X => (Z : Set X)) hcover + exact isAmple_of_eventual_restriction_surjective I.subschemeι J.subschemeι L H hH hc hI hJ + (eventual_restriction_surjective_of_complement_ample p H.inverse L I J hcover hJ) + (eventual_restriction_surjective_of_complement_ample p H.inverse L J I + (by simpa only [sup_comm] using hcover) hI) + +end +end PiExponentSeshadri.ComponentAmpleDescent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentCover.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..83e2f77d46aca7ac4816f3da2aa13b3c3a7596ad --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentCover.lean @@ -0,0 +1,92 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleGeneratedTensor +import OAI.NumberTheory.PiExponent.Ampleness.ClosedAmpleRestriction +import OAI.NumberTheory.PiExponent.Geometry.LineBundleProduct + +namespace OAI + +namespace PiExponentSeshadri.ComponentAmpleDescent +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open _root_.OAI.PiExponentSeshadri.Geometry +variable {X Y Z : Scheme.{0}} + +def pullbackTwistIso (f : Y ⟶ X) (K L : LineBundle X) (n : ℕ) : + ((K.tensor (L.pow n)).pullback f).sheaf ≅ + (moduleTwistFunctor (L.pullback f) n).obj (K.pullback f).sheaf := + PullbackTensor.iso f K (L.pow n) ≪≫ + moduleTensorIso (Iso.refl _) (PullbackTensor.powIso f L n) ≪≫ + (moduleTwistPowerIso (L.pullback f) (K.pullback f).sheaf n).symm + +theorem eventual_pullback_twist_sections [NoetherianSpace Y] + (f : Y ⟶ X) (K L : LineBundle X) (hL : (L.pullback f).IsAmple) : + ∃ N : ℕ, ∀ n ≥ N, ∀ y : Y, + ∃ s : GlobalSections Y ((K.tensor (L.pow n)).pullback f).sheaf, + y ∈ sectionOpen Y s := by + have : (K.pullback f).sheaf.IsFinitePresentation := + PiExponent.GeometrySupport.LineBundleCoherent.lineBundle_isFinitePresentation _ + obtain ⟨N,hN⟩ := PiExponent.AmpleGlobalGeneration.ample_eventual_global_generators + (L.pullback f) hL (K.pullback f).sheaf + refine ⟨N, fun n hn y => ?_⟩ + obtain ⟨G,hG⟩ := hN n hn + let : G.IsFiniteType := hG + let D := SheafOfModules.GeneratingSections.equivOfIso (pullbackTwistIso f K L n).symm G + have hc := @PiExponent.GeneratorsSectionCover.generators_sectionOpen_cover Y + ((K.tensor (L.pow n)).pullback f) D ⟨hG.finite⟩ + obtain ⟨i,hi⟩ := Opens.mem_iSup.mp + (show y ∈ ⨆ i, sectionOpen Y + (PiExponent.GeneratorsSectionCover.generatorSection _ D i) by rw [hc]; trivial) + exact ⟨_,hi⟩ + +theorem section_cover_of_jointly_surjective + (f : Y ⟶ X) (g : Z ⟶ X) (M : LineBundle X) + (hcover : Set.range f ∪ Set.range g = Set.univ) + (hf : Function.Surjective (fun s : GlobalSections X M.sheaf => pullbackSection f s)) + (hg : Function.Surjective (fun s : GlobalSections X M.sheaf => pullbackSection g s)) + (hY : ∀ y : Y, ∃ s : GlobalSections Y (M.pullback f).sheaf, y ∈ sectionOpen Y s) + (hZ : ∀ z : Z, ∃ s : GlobalSections Z (M.pullback g).sheaf, z ∈ sectionOpen Z s) : + (⨆ s : GlobalSections X M.sheaf, sectionOpen X s) = ⊤ := by + apply top_unique + intro x _ + have hx : x ∈ Set.range f ∪ Set.range g := by rw [hcover]; trivial + rcases hx with ⟨y,rfl⟩ | ⟨z,rfl⟩ + · obtain ⟨s,hs⟩ := hY y + obtain ⟨t,rfl⟩ := hf s + apply Opens.mem_iSup.mpr + refine ⟨t,?_⟩ + change y ∈ f ⁻¹ᵁ SectionOpens.isoOpen t + exact (pullback_isoOpen_eq M t f).le hs + · obtain ⟨s,hs⟩ := hZ z + obtain ⟨t,rfl⟩ := hg s + apply Opens.mem_iSup.mpr + refine ⟨t,?_⟩ + change z ∈ g ⁻¹ᵁ SectionOpens.isoOpen t + exact (pullback_isoOpen_eq M t g).le hs + +theorem isAmple_of_eventual_restriction_surjective + [NoetherianSpace Y] [NoetherianSpace Z] + (f : Y ⟶ X) (g : Z ⟶ X) (L H : LineBundle X) (hH : H.IsAmple) + (hcover : Set.range f ∪ Set.range g = Set.univ) + (hY : (L.pullback f).IsAmple) (hZ : (L.pullback g).IsAmple) + (hf : ∃ N : ℕ, ∀ n ≥ N, Function.Surjective + (fun s : GlobalSections X (H.inverse.tensor (L.pow n)).sheaf => pullbackSection f s)) + (hg : ∃ N : ℕ, ∀ n ≥ N, Function.Surjective + (fun s : GlobalSections X (H.inverse.tensor (L.pow n)).sheaf => pullbackSection g s)) : + L.IsAmple := by + obtain ⟨A,hA⟩ := eventual_pullback_twist_sections f H.inverse L hY + obtain ⟨B,hB⟩ := eventual_pullback_twist_sections g H.inverse L hZ + obtain ⟨C,hC⟩ := hf + obtain ⟨D,hD⟩ := hg + let n := A+B+C+D+1 + have hn : 0 < n := by omega + have hAn : A ≤ n := by omega + have hBn : B ≤ n := by omega + have hCn : C ≤ n := by omega + have hDn : D ≤ n := by omega + exact L.isAmple_of_inverse_twist_section_cover H hH hn (fun s => s) + (section_cover_of_jointly_surjective f g (H.inverse.tensor (L.pow n)) hcover + (hC n hCn) (hD n hDn) (hA n hAn) (hB n hBn)) + +end +end PiExponentSeshadri.ComponentAmpleDescent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentIdeal.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentIdeal.lean new file mode 100644 index 0000000000000000000000000000000000000000..a88ac8959a68f4d5b0977931caf7c99dd8ae2d9f --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentIdeal.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealPowerFiltration + +namespace OAI + +namespace PiExponentSeshadri.ComponentAmpleDescent +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits Opposite +open IdealModule +variable {X : Scheme.{0}} + +theorem ideal_le_annihilator_closedModule {I J : X.IdealSheafData} + (h : I * J = ⊥) (U : X.affineOpens) : + J.ideal U ≤ Module.annihilator Γ(X,U.1) Γ(closedModule I,U.1) := by + intro a ha + apply Module.mem_annihilator.mpr + intro m + have hinj : Function.Injective ((closedInclusion I).val.app (op U.1)) := by + let : Mono (closedInclusion I).val := + inferInstanceAs (Mono ((Scheme.Modules.toPresheafOfModules X).map (closedInclusion I))) + exact PresheafOfModules.injective_of_mono (closedInclusion I).val (op U.1) + apply hinj + have hm : (closedInclusion I).app U.1 m ∈ I.ideal U := by + rw [← closed_image I U] + exact ⟨m,rfl⟩ + have hp := Ideal.mul_mem_mul_rev (R := Γ(X,U.1)) hm ha + let b : Γ(X,U.1) := (closedInclusion I).app U.1 m + have hz : a * b = 0 := by + have hh : I.ideal U * J.ideal U = ⊥ := congrArg (fun K : X.IdealSheafData => K.ideal U) h + simpa only [hh,Ideal.mem_bot] using hp + exact (((closedInclusion I).app_smul (r := a) (x := m)).trans hz).trans + ((closedInclusion I).app U.1).hom.map_zero.symm + +theorem ideal_mul_eq_bot_of_reduced_cover [IsReduced X] + {I J : X.IdealSheafData} (h : I.support ⊔ J.support = ⊤) : I * J = ⊥ := by + apply Scheme.IdealSheafData.support_eq_top_iff.mp + simpa only [Scheme.IdealSheafData.support_mul] using h + +theorem ideal_le_annihilator_closedModule_of_reduced_cover [IsReduced X] + {I J : X.IdealSheafData} (h : I.support ⊔ J.support = ⊤) (U : X.affineOpens) : + J.ideal U ≤ Module.annihilator Γ(X,U.1) Γ(closedModule I,U.1) := + ideal_le_annihilator_closedModule (ideal_mul_eq_bot_of_reduced_cover h) U + +end +end PiExponentSeshadri.ComponentAmpleDescent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentLocal.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentLocal.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f32c124eee02530bfea046065ae6d3c6597ad0c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentLocal.lean @@ -0,0 +1,40 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ComponentAmpleDescentIdeal +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealPowerRestriction + +namespace OAI + +namespace PiExponentSeshadri.ComponentAmpleDescent +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite +open PiExponentSeshadri.IdealModule +variable {X : Scheme.{0}} + +theorem closedModule_restrict_annihilated [IsReduced X] + {I J : X.IdealSheafData} (h : I.support ⊔ J.support = ⊤) (U : X.affineOpens) : + RingHom.ker (J.subschemeι ∣_ U.1).appTop.hom ≤ + Module.annihilator Γ(U.1.toScheme,⊤) Γ((closedModule I).restrict U.1.ι,⊤) := by + let : IsAffine U.1.toScheme := U.2 + have hcover : (I.comap U.1.ι).support ⊔ (J.comap U.1.ι).support = ⊤ := by + rw [Scheme.IdealSheafData.support_comap, Scheme.IdealSheafData.support_comap] + ext x + change U.1.ι x ∈ (I.support : Set X) ∪ (J.support : Set X) ↔ True + have hx : U.1.ι x ∈ (I.support ⊔ J.support : Closeds X) := by rw [h]; trivial + exact iff_true_intro hx + intro a ha + apply Module.mem_annihilator.mpr + intro m + let e := closedModuleRestrictIso I U.1.ι + have hj : a ∈ (J.comap U.1.ι).ideal ⟨⊤,isAffineOpen_top _⟩ := by + erw [← (J.comap U.1.ι).ker_subschemeι_app ⟨⊤,isAffineOpen_top _⟩, + ← ker_appTop_subscheme_morphismRestrict J U] + exact ha + have hz := Module.mem_annihilator.mp + (ideal_le_annihilator_closedModule_of_reduced_cover hcover + ⟨⊤,isAffineOpen_top _⟩ hj) (e.hom.app ⊤ m) + apply (ConcreteCategory.bijective_of_isIso (e.hom.app ⊤)).injective + exact (e.hom.app_smul a m).trans (hz.trans (map_zero _).symm) + +end +end PiExponentSeshadri.ComponentAmpleDescent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentSupported.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentSupported.lean new file mode 100644 index 0000000000000000000000000000000000000000..df804a41de7388b09eeaf77da1aed4874933394e --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ComponentAmpleDescentSupported.lean @@ -0,0 +1,42 @@ +import OAI.NumberTheory.PiExponent.Approximation.ModuleLinePowerLaws +import OAI.NumberTheory.PiExponent.Cohomology.NoetherianAmpleSerreVanishing + +namespace OAI + +namespace PiExponentSeshadri.ComponentAmpleDescent +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Abelian +open PiExponentSeshadri.Geometry +variable {X Y : Scheme.{0}} {R : Type} [CommRing R] [IsNoetherianRing R] + +theorem eventual_tensor_cohomology_zero_of_closed_pushforward + (p : X ⟶ Spec (CommRingCat.of R)) [IsProper p] + (f : Y ⟶ X) [IsClosedImmersion f] + (M : X.Modules) (N : Y.Modules) [N.IsFinitePresentation] + (e : (Scheme.Modules.pushforward f).obj N ≅ M) + (K L : LineBundle X) (hL : (L.pullback f).IsAmple) : + ∃ B : ℕ, ∀ n ≥ B, ∀ q, 0 < q → + ∀ x : cohomology (moduleTensor X M (K.tensor (L.pow n)).sheaf) q, x = 0 := by + let D : Y.Modules := moduleTensor Y N (K.pullback f).sheaf + have : D.IsFinitePresentation := + PiExponent.FiniteGlobalPresentation.moduleTwist_isFinitePresentation (K.pullback f) 1 N + obtain ⟨B,hB⟩ := + PiExponent.GeometrySupport.NoetherianAmpleSerreVanishing.ample_serre_vanishing + (f ≫ p) (L.pullback f) hL D + let e₀ : (Scheme.Modules.pushforward f).obj D ≅ moduleTensor X M K.sheaf := + (PiExponent.ProjectionFormula.iso f N K).symm ≪≫ + moduleTensorIso e (Iso.refl K.sheaf) + refine ⟨B,fun n hn q hq => ?_⟩ + have hz := (PiExponent.ClosedImmersionSerreTransfer.twist_ext_zero_iff f D L n q).mp + (hB n hn q hq) + let eₙ : (moduleTwistFunctor L n).obj ((Scheme.Modules.pushforward f).obj D) ≅ + moduleTensor X M (K.tensor (L.pow n)).sheaf := + (moduleTwistFunctor L n).mapIso e₀ ≪≫ + moduleTwistPowerIso L (moduleTensor X M K.sheaf) n ≪≫ + moduleLineTensorAssoc M K (L.pow n) + exact PiExponent.GeometrySupport.SerrePowerDescent.ext_zero_of_iso eₙ q hz + +end +end PiExponentSeshadri.ComponentAmpleDescent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/CurveBlowupImage.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/CurveBlowupImage.lean new file mode 100644 index 0000000000000000000000000000000000000000..89eb8be4bb01bbd1546d834c1758ea13f98683c0 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/CurveBlowupImage.lean @@ -0,0 +1,117 @@ +import OAI.NumberTheory.PiExponent.Ampleness.BlowupComplement +import OAI.NumberTheory.PiExponent.Geometry.CurveImageOpenLocus +import OAI.NumberTheory.PiExponent.Geometry.CurveProperImageDimension +import OAI.NumberTheory.PiExponent.LocalAlgebra.OpenIsoFunctionField + +namespace OAI + +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace + +namespace PiExponent.CurveBlowupImage +open PiExponentSeshadri.Geometry +variable {X B : Scheme.{0}} + +def imageCurve (π : B ⟶ X) [IsProper π] + (C : NumericalAmpleness.IntegralCurve B) + (hn : ¬ ∃ x : X, Set.range (C.embedding ≫ π) ⊆ {x}) : + NumericalAmpleness.IntegralCurve X := + let f := C.embedding ≫ π + letI := integral_scheme_image f + { scheme := f.image + embedding := f.imageι + closedImmersion := inferInstance + integral := inferInstance + dimension := CurveProperImageDimension.image_dimension_eq_one_of_nonconstant + f C.dimension hn } + +def imageMap (π : B ⟶ X) [IsProper π] + (C : NumericalAmpleness.IntegralCurve B) + (hn : ¬ ∃ x : X, Set.range (C.embedding ≫ π) ⊆ {x}) : + C.scheme ⟶ (imageCurve π C hn).scheme := (C.embedding ≫ π).toImage + +@[simp] theorem imageMap_comp (π : B ⟶ X) [IsProper π] + (C : NumericalAmpleness.IntegralCurve B) + (hn : ¬ ∃ x : X, Set.range (C.embedding ≫ π) ⊆ {x}) : + imageMap π C hn ≫ (imageCurve π C hn).embedding = C.embedding ≫ π := + (C.embedding ≫ π).toImage_imageι + +instance imageMap_isProper (π : B ⟶ X) [IsProper π] + (C : NumericalAmpleness.IntegralCurve B) + (hn : ¬ ∃ x : X, Set.range (C.embedding ≫ π) ⊆ {x}) : + IsProper (imageMap π C hn) := toImage_isProper _ + +instance imageMap_isDominant (π : B ⟶ X) [IsProper π] + (C : NumericalAmpleness.IntegralCurve B) + (hn : ¬ ∃ x : X, Set.range (C.embedding ≫ π) ⊆ {x}) : + IsDominant (imageMap π C hn) := by + change IsDominant (C.embedding ≫ π).toImage + infer_instance + +theorem imageMap_isFinite (π : B ⟶ X) [IsProper π] + (C : NumericalAmpleness.IntegralCurve B) [NoetherianSpace C.scheme] + (hn : ¬ ∃ x : X, Set.range (C.embedding ≫ π) ⊆ {x}) : + IsFinite (imageMap π C hn) := by + let : Nontrivial (imageCurve π C hn).scheme := + CurveProperImageDimension.image_nontrivial_of_nonconstant (C.embedding ≫ π) hn + exact CurveMorphismFinite.isFinite_of_proper_dominant (imageMap π C hn) C.dimension.le + +theorem imageMap_restrict_isIso (π : B ⟶ X) [IsProper π] + (C : NumericalAmpleness.IntegralCurve B) + (hn : ¬ ∃ x : X, Set.range (C.embedding ≫ π) ⊆ {x}) + (U : X.Opens) [IsIso (π ∣_ U)] : + IsIso (imageMap π C hn ∣_ ((imageCurve π C hn).embedding ⁻¹ᵁ U)) := by + let := restricted_curve_isClosedImmersion π C U + exact toImage_restrict_isIso (C.embedding ≫ π) U + +theorem imageMap_preimage_nonempty (π : B ⟶ X) [IsProper π] + (C : NumericalAmpleness.IntegralCurve B) + (hn : ¬ ∃ x : X, Set.range (C.embedding ≫ π) ⊆ {x}) + (U : X.Opens) (hU : ∃ c : C.scheme, (C.embedding ≫ π) c ∈ U) : + Nonempty (imageMap π C hn ⁻¹ᵁ ((imageCurve π C hn).embedding ⁻¹ᵁ U)) := by + obtain ⟨c, hc⟩ := hU + refine ⟨⟨c, ?_⟩⟩ + change (imageCurve π C hn).embedding (imageMap π C hn c) ∈ U + simpa only [← Scheme.Hom.comp_apply, imageMap_comp] using hc + +def imageFunctionFieldIso (π : B ⟶ X) [IsProper π] + (C : NumericalAmpleness.IntegralCurve B) + (hn : ¬ ∃ x : X, Set.range (C.embedding ≫ π) ⊆ {x}) + (U : X.Opens) [IsIso (π ∣_ U)] + (hU : ∃ c : C.scheme, (C.embedding ≫ π) c ∈ U) : + (imageCurve π C hn).scheme.functionField ≅ C.scheme.functionField := + letI := imageMap_restrict_isIso π C hn U + functionFieldIso (imageMap π C hn) ((imageCurve π C hn).embedding ⁻¹ᵁ U) + (imageMap_preimage_nonempty π C hn U hU) + +theorem imageFunctionFieldIso_generic (π : B ⟶ X) [IsProper π] + (C : NumericalAmpleness.IntegralCurve B) + (hn : ¬ ∃ x : X, Set.range (C.embedding ≫ π) ⊆ {x}) + (U : X.Opens) [IsIso (π ∣_ U)] + (hU : ∃ c : C.scheme, (C.embedding ≫ π) c ∈ U) : + Spec.map (imageFunctionFieldIso π C hn U hU).hom ≫ + (imageCurve π C hn).scheme.fromSpecStalk + (genericPoint (imageCurve π C hn).scheme) ≫ + (imageCurve π C hn).embedding = + C.scheme.fromSpecStalk (genericPoint C.scheme) ≫ C.embedding ≫ π := by + have h := functionFieldMap_fromSpecStalk (imageMap π C hn) + change Spec.map (functionFieldMap (imageMap π C hn)) ≫ _ ≫ _ = _ + rw [← Category.assoc, h, Category.assoc, imageMap_comp] + +theorem blowup_restrict_isIso {I : X.IdealSheafData} {π : B ⟶ X} + (hπ : IsBlowup I π) : IsIso (π ∣_ I.support.compl) := by + apply (hπ.morphismRestrict I.support.compl).isIso_of_invertible + have he : I.comap (Scheme.Opens.ι (X := X) I.support.compl) = ⊤ := by + apply (Scheme.IdealSheafData.support_eq_bot_iff _).mp + rw [Scheme.IdealSheafData.support_comap] + ext x + change (x.val ∈ I.support ↔ False) + exact iff_false_intro x.property + rw [he] + exact invertible_top _ + +end PiExponent.CurveBlowupImage + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/CurveBlowupImageBase.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/CurveBlowupImageBase.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ac6dc662c47c74352a6d0c7adca831a7ad3ebb6 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/CurveBlowupImageBase.lean @@ -0,0 +1,89 @@ +import Mathlib +import OAI.NumberTheory.PiExponent.Ampleness.NumericalAmpleness +import OAI.NumberTheory.PiExponent.Geometry.CurveFunctionFieldCompatibility + +namespace OAI + +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace + +namespace PiExponentSeshadri.Geometry +variable {X Y : Scheme.{0}} + +theorem integral_scheme_image (f : X ⟶ Y) [QuasiCompact f] [IsIntegral X] : IsIntegral f.image := by + let hred (U : Y.affineOpens) : _root_.IsReduced (Γ(Y,U.1) ⧸ f.ker.ideal U) := by + rw [Scheme.Hom.ker_apply] + exact isReduced_of_injective (RingHom.kerLift (f.app U.1).hom) + (RingHom.kerLift_injective (f.app U.1).hom) + let : ∀ U, AlgebraicGeometry.IsReduced (f.ker.subschemeCover.openCover.X U) := by + intro U + change IsReduced (Spec (.of (Γ(Y,U.1) ⧸ f.ker.ideal U))) + exact (affine_isReduced_iff _).mpr (hred U) + let : IsReduced f.image := IsReduced.of_openCover f.image f.ker.subschemeCover.openCover + have hi : IsIrreducible (Set.range f.toImage) := by + simpa only [Set.image_univ] using + (IrreducibleSpace.isIrreducible_univ (X := X)).image f.toImage + f.toImage.continuous.continuousOn + let : IrreducibleSpace f.image := (irreducibleSpace_def _).mpr (by + change IsIrreducible (Set.univ : Set f.image) + rw [← f.toImage.denseRange.closure_range] + exact hi.closure) + exact isIntegral_of_irreducibleSpace_of_isReduced _ + +end PiExponentSeshadri.Geometry + +namespace PiExponent.CurveBlowupImage +open PiExponentSeshadri.Geometry +variable {C X B : Scheme.{0}} + +theorem toImage_isProper (f : C ⟶ X) [IsProper f] : IsProper f.toImage := by + let : IsProper (f.toImage ≫ f.imageι) := by rw [f.toImage_imageι]; infer_instance + exact IsProper.of_comp f.toImage f.imageι + +theorem toImage_restrict_isIso (f : C ⟶ X) [IsProper f] [IsIntegral C] + (U : X.Opens) [IsClosedImmersion (f ∣_ U)] : + IsIso (f.toImage ∣_ (f.imageι ⁻¹ᵁ U)) := by + let := integral_scheme_image f + let : IsClosedImmersion + ((f.toImage ∣_ (f.imageι ⁻¹ᵁ U)) ≫ (f.imageι ∣_ U)) := by + rw [← morphismRestrict_comp] + exact Eq.mpr (congrArg (fun k : C ⟶ X => IsClosedImmersion (k ∣_ U)) + f.toImage_imageι) (inferInstance : IsClosedImmersion (f ∣_ U)) + let := IsClosedImmersion.of_comp_isClosedImmersion + (f.toImage ∣_ (f.imageι ⁻¹ᵁ U)) (f.imageι ∣_ U) + let : IsDominant (f.toImage ∣_ (f.imageι ⁻¹ᵁ U)) := + IsZariskiLocalAtTarget.restrict (inferInstance : IsDominant f.toImage) _ + exact isIso_of_isClosedImmersion_of_surjective _ + +theorem restricted_curve_isClosedImmersion (π : B ⟶ X) + (C : NumericalAmpleness.IntegralCurve B) (U : X.Opens) [IsIso (π ∣_ U)] : + IsClosedImmersion ((C.embedding ≫ π) ∣_ U) := by + rw [morphismRestrict_comp] + exact IsClosedImmersion.comp (C.embedding ∣_ π ⁻¹ᵁ U) (π ∣_ U) + +theorem genericPoint_eq_of_isDominant (f : C ⟶ X) + [IsIntegral C] [IsIntegral X] [IsDominant f] : + f (genericPoint C) = genericPoint X := by + apply IsGenericPoint.eq _ (genericPoint_spec X) + simpa only [Set.image_univ, f.denseRange.closure_range] using + (genericPoint_spec C).image f.continuous + +theorem stalkMap_isIso_of_restrict (f : C ⟶ X) (U : X.Opens) + [IsIso (f ∣_ U)] (x : C) (hx : f x ∈ U) : IsIso (f.stalkMap x) := by + let q : (f ⁻¹ᵁ U).toScheme := ⟨x, hx⟩ + have hi : IsIso (((f ⁻¹ᵁ U).ι ≫ f).stalkMap q) := by + rw [← morphismRestrict_ι] + infer_instance + rw [Scheme.Hom.stalkMap_comp] at hi + change IsIso (f.stalkMap x ≫ (f ⁻¹ᵁ U).ι.stalkMap q) at hi + have hq : IsIso ((f ⁻¹ᵁ U).ι.stalkMap q) := + (IsOpenImmersion.iff_isIso_stalkMap.mp + (inferInstance : IsOpenImmersion (f ⁻¹ᵁ U).ι)).2 q + exact @IsIso.of_isIso_comp_right CommRingCat _ _ _ _ + (f.stalkMap x) ((f ⁻¹ᵁ U).ι.stalkMap q) hq hi + +end PiExponent.CurveBlowupImage + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/CurveNormalizationPolarization.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/CurveNormalizationPolarization.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd708d8dfc73a79f54ec201fcf44cea497e5739c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/CurveNormalizationPolarization.lean @@ -0,0 +1,69 @@ +import OAI.NumberTheory.PiExponent.Ampleness.FinitePullbackAmple +import OAI.NumberTheory.PiExponent.Ampleness.ProjectiveO1Ample +import OAI.NumberTheory.PiExponent.Cohomology.CurveNormalizationCohomology +import OAI.NumberTheory.PiExponent.Geometry.CurveDegreeAdditivity +import OAI.NumberTheory.PiExponent.Geometry.CurveNormalizationNonaffine +import OAI.NumberTheory.PiExponent.Geometry.ProjectiveFinitePencil + +namespace OAI + +noncomputable section +namespace PiExponent.CurveNormalizationModel +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry +variable {E : Type} [Field E] [Algebra ℂ E] +variable (f : E) (hf : Transcendental ℂ f) +variable [FiniteDimensional (IntermediateField.adjoin ℂ {f}) E] + +def parameterCurvePolarization : LineBundle (parameterCurve f hf) := + (ProjectiveO1.lineBundle (R := ℂ) (σ := Bool)).pullback (parameterCurveProjection f hf) + +theorem parameterCurvePolarization_ample : (parameterCurvePolarization f hf).IsAmple := by + let : CompactSpace (ProjectiveO1.projectiveSpace ℂ Bool) := + QuasiCompact.compactSpace_of_compactSpace (polynomialProjectiveProjection ℂ Bool) + exact LineBundle.IsAmple.pullback_finite _ ProjectiveO1.lineBundle_ample + (parameterCurveProjection f hf) + +theorem parameterCurve_finiteLineCohomology : + CurveDegree.FiniteLineCohomology (parameterCurveStructureMap f hf) := by + intro L n hn + have h0 := ProjectivePencil.H0_finite_complex (parameterCurveProjection f hf) + (parameterCurve_not_isAffine f hf) L + have h1 := ProjectivePencil.H1_finite_complex (parameterCurveProjection f hf) L + rcases Nat.le_one_iff_eq_zero_or_eq_one.mp hn with rfl | rfl + · exact h0 + · exact h1 + +theorem parameterCurve_lineCohomologyTwoZero : + CurveDegree.LineCohomologyTwoZero (parameterCurve f hf) := by + intro L + apply subsingleton_of_forall_eq 0 + intro x + exact parameterCurve_lineBundle_ext_zero f hf L 2 (by omega) x + +theorem parameterCurve_tensor_euler_add (L M : LineBundle (parameterCurve f hf)) : + eulerCharacteristic (parameterCurveStructureMap f hf) 1 (L.tensor M).sheaf - + eulerCharacteristic (parameterCurveStructureMap f hf) 1 M.sheaf = + eulerCharacteristic (parameterCurveStructureMap f hf) 1 L.sheaf - + eulerCharacteristic (parameterCurveStructureMap f hf) 1 + (structureSheaf (parameterCurve f hf)) := + CurveDegree.tensor_euler_add _ (parameterCurve_dimension_le_one f hf) + (parameterCurvePolarization f hf) (parameterCurvePolarization_ample f hf) + (parameterCurve_finiteLineCohomology f hf) (parameterCurve_lineCohomologyTwoZero f hf) L M + +theorem parameterCurve_power_euler (L : LineBundle (parameterCurve f hf)) (n : ℕ) : + eulerCharacteristic (parameterCurveStructureMap f hf) 1 (L.pow n).sheaf - + eulerCharacteristic (parameterCurveStructureMap f hf) 1 + (structureSheaf (parameterCurve f hf)) = + (n : ℤ) * (eulerCharacteristic (parameterCurveStructureMap f hf) 1 L.sheaf - + eulerCharacteristic (parameterCurveStructureMap f hf) 1 + (structureSheaf (parameterCurve f hf))) := + CurveDegree.power_euler _ (parameterCurve_dimension_le_one f hf) + (parameterCurvePolarization f hf) (parameterCurvePolarization_ample f hf) + (parameterCurve_finiteLineCohomology f hf) (parameterCurve_lineCohomologyTwoZero f hf) L n + +end PiExponent.CurveNormalizationModel + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalAffineChart.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalAffineChart.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a279c75702cb4ad17fb747950992c75acc01f73 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalAffineChart.lean @@ -0,0 +1,121 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalPowerSections +import OAI.NumberTheory.PiExponent.Geometry.IdealSheafPowers + +namespace OAI + +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +namespace PiExponent.ExceptionalAffineChart +open PiExponentSeshadri.IdealPullback +variable {R A : Type} [CommRing R] [CommRing A] {Y : Scheme} +variable (I : Ideal R) (f : Y ⟶ Spec (CommRingCat.of R)) + (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (φ : R →+* A) (hf : j ≫ f = Spec.map (CommRingCat.ofHom φ)) + +def chartOpen : Y.affineOpens := + ⟨j.opensRange, isAffineOpen_opensRange _⟩ + +def affineGammaEquiv {Y : Scheme} {A : CommRingCat} (g : Y ≅ Spec A) : + Γ(Y,⊤) ≃+* A := + (Scheme.Γ.mapIso g.symm.op ≪≫ Scheme.ΓSpecIso A).commRingCatIsoToRingEquiv + +def chartFunctionsEquiv : Γ((chartOpen j).1.toScheme, ⊤) ≃+* A := + affineGammaEquiv (j.isoOpensRange.symm) + +def chartPowerIdeal (n : ℕ) : Ideal Γ((chartOpen j).1.toScheme, ⊤) := + powerChartIdeal (f) (specIdeal I) n (chartOpen j) + ⟨⊤, isAffineOpen_top _⟩ (by simp) + +theorem chartPowerIdeal_eq (n : ℕ) : + chartPowerIdeal I f j n = + ((((specIdeal I).comap f)^n).comap (chartOpen j).1.ι).ideal + ⟨⊤, isAffineOpen_top _⟩ := by + change powerChartIdeal f (specIdeal I) n (chartOpen j) + ⟨⊤, isAffineOpen_top _⟩ _ = _ + simp only [powerChartIdeal] + have hlocal := PiExponentSeshadri.IdealPullback.comap_ideal ((specIdeal I)^n) + f (chartOpen j) ⟨⊤, isAffineOpen_top _⟩ (by simp) + have hpow := congrArg (fun K : Y.IdealSheafData => K.ideal (chartOpen j)) + (PiExponentSeshadri.IdealPullback.comap_pow (specIdeal I) f n) + exact (congrArg (Ideal.map (chartOpen j).1.topIso.inv.hom) + (hlocal.symm.trans hpow)).trans + (PiExponentSeshadri.IdealPullback.comap_ι_top + (((specIdeal I).comap f)^n) (chartOpen j)).symm + +include hf in + +theorem map_chartPowerIdeal (n : ℕ) : + (chartPowerIdeal I f j n).map (chartFunctionsEquiv j).toRingHom = + (I^n).map (φ) := by + let : IsAffine j.opensRange.toScheme := isAffineOpen_opensRange j + have hlocal : ((((specIdeal I).comap f)^n).comap j).ideal + ⟨⊤, isAffineOpen_top _⟩ = + ((I^n).map (φ)).map + (Scheme.ΓSpecIso (CommRingCat.of (A))).inv.hom := by + rw [← PiExponentSeshadri.IdealPullback.comap_pow, + ← PiExponentSeshadri.IdealPullback.specIdeal_pow, + ← Scheme.IdealSheafData.comap_comp, hf, + specIdeal_comap, specIdeal_top] + have hmap : (chartPowerIdeal I f j n).map + (j.isoOpensRange.hom.appTop.hom) = + ((((specIdeal I).comap f)^n).comap j).ideal + ⟨⊤, isAffineOpen_top _⟩ := by + erw [chartPowerIdeal_eq, ← PiExponentSeshadri.IdealPullback.comap_top, + ← Scheme.IdealSheafData.comap_comp] + change (((specIdeal I).comap f ^ n).comap (j.isoOpensRange.hom ≫ j.opensRange.ι)).ideal _ = _ + rw [j.isoOpensRange_hom_ι] + change (chartPowerIdeal I f j n).map + ((Scheme.ΓSpecIso (CommRingCat.of (A))).hom.hom.comp + (j.isoOpensRange.hom.appTop.hom)) = _ + erw [← Ideal.map_map, hmap, hlocal, Ideal.map_map] + have hi : (Scheme.ΓSpecIso (CommRingCat.of (A))).hom.hom.comp + (Scheme.ΓSpecIso (CommRingCat.of (A))).inv.hom = RingHom.id _ := by + apply RingHom.ext + intro r + exact (Scheme.ΓSpecIso (CommRingCat.of A)).inv_hom_id_apply r + rw [hi, Ideal.map_id] + +def idealMapAddEquiv {A B : Type*} [CommRing A] [CommRing B] + (e : A ≃+* B) (J : Ideal A) : J ≃+ J.map e.toRingHom := + AddEquiv.ofBijective + (show J →+ J.map e.toRingHom from + { toFun := fun x => ⟨e x, Ideal.mem_map_of_mem _ x.property⟩ + map_zero' := by ext; exact e.map_zero + map_add' := by intro x y; ext; exact e.map_add x y }) + ⟨by intro x y h; exact Subtype.ext (e.injective (congrArg Subtype.val h)), by + intro y + obtain ⟨x, hx, he⟩ := (Ideal.mem_map_iff_of_surjective e.toRingHom e.surjective).mp y.property + exact ⟨⟨x, hx⟩, Subtype.ext he⟩⟩ + +def sectionsEquiv (L : LineBundle Y) (ι : L.sheaf ⟶ O Y) + (hL : PresentsPullbackIdeal (specIdeal I) f L ι) + (e : L.sheaf.restrict (chartOpen j).1.ι ≅ O (chartOpen j).1.toScheme) (n : ℕ) : + ((L.pow n).sheaf.restrict (chartOpen j).1.ι).val.obj (.op ⊤) ≃+ ↥((I^n).map φ) := + (idealPowerSectionsEquiv f (specIdeal I) L ι hL n (chartOpen j) + ⟨⊤, isAffineOpen_top _⟩ (by simp) e).toAddEquiv |>.trans + ((idealMapAddEquiv (chartFunctionsEquiv j) (chartPowerIdeal I f j n)).trans + ((LinearEquiv.ofEq _ _ (map_chartPowerIdeal I f j φ hf n)).toAddEquiv)) + +theorem sectionsEquiv_apply (L : LineBundle Y) (ι : L.sheaf ⟶ O Y) + (hL : PresentsPullbackIdeal (specIdeal I) f L ι) + (e : L.sheaf.restrict (chartOpen j).1.ι ≅ O (chartOpen j).1.toScheme) (n : ℕ) + (s : ((L.pow n).sheaf.restrict (chartOpen j).1.ι).val.obj (.op ⊤)) : + (sectionsEquiv I f j φ hf L ι hL e n s).val = + chartFunctionsEquiv j + ((PiExponentSeshadri.InvertibleLocal.restrictedInclusion (L.pow n) + (idealPowerInclusion L ι n) (chartOpen j).1.ι).val.app (.op ⊤) s) := rfl + +def idealChartFrame (L : Y.IdealSheafData) + (r : Γ(Spec (CommRingCat.of A), ⊤)) + (hprincipal : (L.comap j).ideal ⟨⊤, isAffineOpen_top _⟩ = Ideal.span {r}) + (hregular : IsLeftRegular r) : + (PiExponentSeshadri.IdealModule.closedModule L).restrict (chartOpen j).1.ι ≅ + O (chartOpen j).1.toScheme := + PiExponentSeshadri.IdealModule.frameOnRange _ j + (PiExponentSeshadri.IdealModule.frame_restriction L j r hprincipal hregular).some + +end PiExponent.ExceptionalAffineChart +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalAffineChartRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalAffineChartRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..603f27fd0bf72511abd1b59c78115eca55ecd04b --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalAffineChartRestriction.lean @@ -0,0 +1,155 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalAffineChart +import OAI.NumberTheory.PiExponent.Cohomology.FiniteCoverCohomology + +namespace OAI + +namespace PiExponent.ExceptionalAffineChart +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open PiExponentSeshadri.ModuleFlasque PiExponentSeshadri.RestrictionCohomology +open PiExponentSeshadri.IdealPullback + + +private abbrev schemeFreeOpen (Y : Scheme) (U : Y.Opens) : Y.Modules := + freeOpen Y.ringCatSheaf U + +section Functions +variable {A B : Type} [CommRing A] [CommRing B] {Y : Scheme} +variable (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (j' : Spec (CommRingCat.of B) ⟶ Y) [IsOpenImmersion j'] + (θ : A →+* B) (h : Spec.map (CommRingCat.ofHom θ) ≫ j = j') + +include h in +lemma opensRange_le : j'.opensRange ≤ j.opensRange := by + change Set.range j' ⊆ Set.range j + rintro y ⟨b,rfl⟩ + refine ⟨Spec.map (CommRingCat.ofHom θ) b, ?_⟩ + exact congr($(h) b) + +lemma chart_square : + j'.isoOpensRange.hom ≫ Y.homOfLE (opensRange_le j j' θ h) = + Spec.map (CommRingCat.ofHom θ) ≫ j.isoOpensRange.hom := by + apply (cancel_mono j.opensRange.ι).mp + simp only [Category.assoc, Scheme.homOfLE_ι, Scheme.Hom.isoOpensRange_hom_ι, h] + +def functionsOnOpenEquiv : Γ(Y,j.opensRange) ≃+* A := + j.opensRange.topIso.symm.commRingCatIsoToRingEquiv.trans (chartFunctionsEquiv j) + +lemma chartFunctions_naturality (s : Γ(j.opensRange.toScheme,⊤)) : + chartFunctionsEquiv j' ((Y.homOfLE (opensRange_le j j' θ h)).appTop s) = + θ (chartFunctionsEquiv j s) := by + change (Scheme.ΓSpecIso (CommRingCat.of B)).hom + (j'.isoOpensRange.hom.appTop ((Y.homOfLE (opensRange_le j j' θ h)).appTop s)) = + θ ((Scheme.ΓSpecIso (CommRingCat.of A)).hom (j.isoOpensRange.hom.appTop s)) + have hc := congrArg (fun g => g.appTop) (chart_square j j' θ h) + simp only [Scheme.Hom.comp_appTop] at hc + have he : (Y.homOfLE (opensRange_le j j' θ h)).appTop ≫ + j'.isoOpensRange.hom.appTop ≫ (Scheme.ΓSpecIso (CommRingCat.of B)).hom = + j.isoOpensRange.hom.appTop ≫ (Scheme.ΓSpecIso (CommRingCat.of A)).hom ≫ + CommRingCat.ofHom θ := by + rw [← Category.assoc, hc, Category.assoc, Scheme.ΓSpecIso_naturality] + exact CategoryTheory.congr_fun he s + +lemma topIso_restriction {U V : Y.Opens} (hUV : U ≤ V) (s : Γ(Y,V)) : + U.topIso.inv (Y.presheaf.map (homOfLE hUV).op s) = + (Y.homOfLE hUV).appTop (V.topIso.inv s) := by + change (Y.presheaf.map (homOfLE hUV).op ≫ U.topIso.inv) s = + (V.topIso.inv ≫ (Y.homOfLE hUV).appTop) s + congr 1 + simp only [Scheme.Opens.topIso_inv, Scheme.homOfLE_appTop] + congr 1 + exact (Y.presheaf.map_comp _ _).symm.trans + ((congrArg (fun g => Y.presheaf.map g) (Subsingleton.elim _ _)).trans + (Y.presheaf.map_comp _ _)) + +lemma functionsOnOpenEquiv_naturality (s : Γ(Y,j.opensRange)) : + functionsOnOpenEquiv j' (Y.presheaf.map (homOfLE (opensRange_le j j' θ h)).op s) = + θ (functionsOnOpenEquiv j s) := by + change chartFunctionsEquiv j' (j'.opensRange.topIso.inv + (Y.presheaf.map (homOfLE (opensRange_le j j' θ h)).op s)) = + θ (chartFunctionsEquiv j (j.opensRange.topIso.inv s)) + rw [topIso_restriction] + exact chartFunctions_naturality j j' θ h _ + +end Functions + +variable {R A : Type} [CommRing R] [CommRing A] {Y : Scheme} + +theorem restrictedInclusion_value (L : LineBundle Y) (ι : L.sheaf ⟶ O Y) + (U : Y.Opens) (s : Γ(L.sheaf, U)) : + (PiExponentSeshadri.InvertibleLocal.restrictedInclusion L ι U.ι).app ⊤ + ((restrictionSectionsIso U L.sheaf).inv s) = U.topIso.inv (ι.app U s) := by + change (U.ι.appIso ⊤).hom + (ι.app (U.ι ''ᵁ ⊤) (L.sheaf.presheaf.map (eqToHom U.ι_image_top).op s)) = _ + rw [Scheme.Opens.ι_appIso] + change ι.app (U.ι ''ᵁ ⊤) (L.sheaf.presheaf.map (eqToHom U.ι_image_top).op s) = + Y.presheaf.map (eqToHom U.ι_image_top).op (ι.app U s) + exact CategoryTheory.congr_fun (ι.mapPresheaf.naturality (eqToHom U.ι_image_top).op) s + +variable (I : Ideal R) (f : Y ⟶ Spec (CommRingCat.of R)) + (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (φ : R →+* A) (hf : j ≫ f = Spec.map (CommRingCat.ofHom φ)) + (L : LineBundle Y) (ι : L.sheaf ⟶ O Y) + (hL : PresentsPullbackIdeal (specIdeal I) f L ι) + (e : L.sheaf.restrict (chartOpen j).1.ι ≅ O (chartOpen j).1.toScheme) + +def sectionsOnOpenEquiv (n : ℕ) : + Γ((L.pow n).sheaf, j.opensRange) ≃+ ↥((I^n).map φ) := + (restrictionSectionsIso (chartOpen j).1 (L.pow n).sheaf).addCommGroupIsoToAddEquiv.symm.trans + (sectionsEquiv I f j φ hf L ι hL e n) + +theorem sectionsOnOpenEquiv_apply (n : ℕ) (s : Γ((L.pow n).sheaf, j.opensRange)) : + (sectionsOnOpenEquiv I f j φ hf L ι hL e n s).val = + chartFunctionsEquiv j ((chartOpen j).1.topIso.inv + ((idealPowerInclusion L ι n).app j.opensRange s)) := by + change (sectionsEquiv I f j φ hf L ι hL e n + ((restrictionSectionsIso (chartOpen j).1 (L.pow n).sheaf).inv s)).val = _ + erw [sectionsEquiv_apply] + exact congrArg (chartFunctionsEquiv j) + (restrictedInclusion_value (L.pow n) (idealPowerInclusion L ι n) (chartOpen j).1 s) + +def representedSectionsEquiv (n : ℕ) : + (schemeFreeOpen Y j.opensRange ⟶ (L.pow n).sheaf) ≃+ ↥((I^n).map φ) := + ({ freeOpenEquiv Y.ringCatSheaf (L.pow n).sheaf j.opensRange with + map_add' := fun _ _ => rfl } : + (schemeFreeOpen Y j.opensRange ⟶ (L.pow n).sheaf) ≃+ + Γ((L.pow n).sheaf, j.opensRange)).trans + (sectionsOnOpenEquiv I f j φ hf L ι hL e n) + +variable {B : Type} [CommRing B] + (j' : Spec (CommRingCat.of B) ⟶ Y) [IsOpenImmersion j'] + (θ : A →+* B) (h : Spec.map (CommRingCat.ofHom θ) ≫ j = j') + (φ' : R →+* B) (hf' : j' ≫ f = Spec.map (CommRingCat.ofHom φ')) + (e' : L.sheaf.restrict (chartOpen j').1.ι ≅ O (chartOpen j').1.toScheme) + +theorem sectionsOnOpenEquiv_restrict (n : ℕ) (s : Γ((L.pow n).sheaf, j.opensRange)) : + (sectionsOnOpenEquiv I f j' φ' hf' L ι hL e' n + ((L.pow n).sheaf.presheaf.map (homOfLE (opensRange_le j j' θ h)).op s)).val = + θ (sectionsOnOpenEquiv I f j φ hf L ι hL e n s).val := by + rw [sectionsOnOpenEquiv_apply, sectionsOnOpenEquiv_apply] + have hn := CategoryTheory.congr_fun + ((idealPowerInclusion L ι n).mapPresheaf.naturality + (homOfLE (opensRange_le j j' θ h)).op) s + change (idealPowerInclusion L ι n).app j'.opensRange + ((L.pow n).sheaf.presheaf.map (homOfLE (opensRange_le j j' θ h)).op s) = + Y.presheaf.map (homOfLE (opensRange_le j j' θ h)).op + ((idealPowerInclusion L ι n).app j.opensRange s) at hn + rw [hn] + exact functionsOnOpenEquiv_naturality j j' θ h _ + +theorem representedSectionsEquiv_restrict (n : ℕ) + (s : schemeFreeOpen Y j.opensRange ⟶ (L.pow n).sheaf) : + (representedSectionsEquiv I f j' φ' hf' L ι hL e' n + (freeOpenMap Y.ringCatSheaf (homOfLE (opensRange_le j j' θ h)) ≫ s)).val = + θ (representedSectionsEquiv I f j φ hf L ι hL e n s).val := by + change (sectionsOnOpenEquiv I f j' φ' hf' L ι hL e' n + (freeOpenEquiv Y.ringCatSheaf (L.pow n).sheaf j'.opensRange + (freeOpenMap Y.ringCatSheaf (homOfLE (opensRange_le j j' θ h)) ≫ s))).val = _ + erw [freeOpenEquiv_naturality] + exact sectionsOnOpenEquiv_restrict I f j φ hf L ι hL e j' θ h φ' hf' e' n _ + +end +end PiExponent.ExceptionalAffineChart + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalChartPullbackValue.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalChartPullbackValue.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef01e12d645ab83ce832699b8e6915d8e2fbfe62 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalChartPullbackValue.lean @@ -0,0 +1,55 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalRepresentedValue + +namespace OAI + +namespace PiExponent.ExceptionalAffineChart +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace +variable {R A : Type} [CommRing R] [CommRing A] {Y : Scheme} + +theorem functionsOnOpenEquiv_global + (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] (s : Γ(Y, ⊤)) : + functionsOnOpenEquiv j (Y.presheaf.map (homOfLE le_top).op s) = + (Scheme.ΓSpecIso (CommRingCat.of A)).hom (j.appTop s) := by + change (Scheme.ΓSpecIso (CommRingCat.of A)).hom + (j.isoOpensRange.hom.appTop + (j.opensRange.topIso.inv (Y.presheaf.map (homOfLE le_top).op s))) = _ + have ht : j.opensRange.topIso.inv (Y.presheaf.map (homOfLE le_top).op s) = + j.opensRange.ι.appTop s := by + change (Y.presheaf.map (homOfLE le_top).op ≫ + j.opensRange.topIso.inv) s = _ + simp only [Scheme.Opens.topIso_inv] + erw [← Functor.map_comp, ← op_comp] + rfl + rw [ht] + have hj := congrArg (fun f => f.appTop) j.isoOpensRange_hom_ι + rw [Scheme.Hom.comp_appTop] at hj + exact congrArg (fun f => (Scheme.ΓSpecIso (CommRingCat.of A)).hom (f s)) hj + +theorem functionsOnOpenEquiv_pullback + (f : Y ⟶ Spec (CommRingCat.of R)) + (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (φ : R →+* A) (hf : j ≫ f = Spec.map (CommRingCat.ofHom φ)) (r : R) : + functionsOnOpenEquiv j (Y.presheaf.map (homOfLE le_top).op + (f.appTop ((Scheme.ΓSpecIso (CommRingCat.of R)).inv r))) = φ r := by + rw [functionsOnOpenEquiv_global] + have h := congrArg (fun g => g.appTop) hf + rw [Scheme.Hom.comp_appTop] at h + have hv := congrArg (fun g => (Scheme.ΓSpecIso (CommRingCat.of A)).hom + (g ((Scheme.ΓSpecIso (CommRingCat.of R)).inv r))) h + refine hv.trans ?_ + have hn := CategoryTheory.congr_fun + (Scheme.ΓSpecIso_naturality (CommRingCat.ofHom φ)) + ((Scheme.ΓSpecIso (CommRingCat.of R)).inv r) + change (Scheme.ΓSpecIso (CommRingCat.of A)).hom + ((Spec.map (CommRingCat.ofHom φ)).appTop + ((Scheme.ΓSpecIso (CommRingCat.of R)).inv r)) = + φ ((Scheme.ΓSpecIso (CommRingCat.of R)).hom + ((Scheme.ΓSpecIso (CommRingCat.of R)).inv r)) at hn + exact hn.trans (congrArg φ + (CategoryTheory.congr_fun (Scheme.ΓSpecIso (CommRingCat.of R)).inv_hom_id r)) + +end +end PiExponent.ExceptionalAffineChart + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalCurveDegree.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalCurveDegree.lean new file mode 100644 index 0000000000000000000000000000000000000000..a8e23daf99c73c47b93a5bd0ca6c076ee82e065a --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalCurveDegree.lean @@ -0,0 +1,519 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AdmissibleBlowupGeometry +import OAI.NumberTheory.PiExponent.Ampleness.BlowupCurveMargin +import OAI.NumberTheory.PiExponent.Geometry.CurveContactFamily +import OAI.NumberTheory.PiExponent.Geometry.CurvePlaceSectionDivisor +import OAI.NumberTheory.PiExponent.Geometry.CurvePlaceSectionOrder +import OAI.NumberTheory.PiExponent.Geometry.PlaceCenteredBranch +import OAI.NumberTheory.PiExponent.Geometry.ProjectivePullbackFrames +import OAI.NumberTheory.PiExponent.Jets.CompactLogJetIdeal +import OAI.NumberTheory.PiExponent.Jets.JetCenterIdentification +import OAI.NumberTheory.PiExponent.Jets.JetProductLocalization +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealTensorPowers +import OAI.NumberTheory.PiExponent.LocalAlgebra.PresentedIdealIso +import OAI.NumberTheory.PiExponent.LocalAlgebra.SectionZeroIdeal + +namespace OAI + +namespace PiExponent.ExceptionalCurveDegree +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open PiExponent.SectionZeroIdeal PiExponent.SectionImageIdeal +variable {X Y : Scheme.{0}} + +def inverseSection (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) : + GlobalSections Y J.inverse.sheaf := + (lineTensorInverseIso J).inv ≫ tensorInclusion J J.inverse ι + +theorem inverseSection_zeroIdeal (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) + [J.sheaf.IsQuasicoherent] : + zeroIdeal J.inverse (inverseSection J ι) = imageIdealSheaf ι := by + classical + have hc (y : Y) := common_affine_frames J J.inverse y + choose U hy e f using hc + let e' y := (e y).some + let f' y := (f y).some + apply Scheme.IdealSheafData.ext_of_iSup_eq_top U + · apply top_unique + intro y _ + exact Opens.mem_iSup.mpr ⟨y, hy y⟩ + · intro y + let V := U y + let a := Scheme.Modules.restrictUnitIso V.1.ι + let b := tensorFrame J J.inverse V.1 (e' y) (f' y) + rw [zeroIdeal_on_frame J.inverse (inverseSection J ι) V (f' y), + imageIdealSheaf_on_frame ι V (e' y)] + change Ideal.span {affineMapCoefficient V a (f' y) + ((lineTensorInverseIso J).inv ≫ tensorInclusion J J.inverse ι)} = _ + erw [affineMapCoefficient_comp V a b (f' y), + ← Ideal.span_singleton_mul_span_singleton] + have hu : IsUnit (affineMapCoefficient V a b (lineTensorInverseIso J).inv) := by + apply IsUnit.map V.1.topIso.hom.hom + exact (end_isIso_iff _).mp + (a.symm ≪≫ ((Scheme.Modules.restrictFunctor V.1.ι).mapIso + (lineTensorInverseIso J)).symm ≪≫ b).isIso_hom + rw [Ideal.span_singleton_eq_top.mpr hu, Ideal.top_mul] + exact tensor_inclusion_ideal J J.inverse ι V (e' y) (f' y) + +theorem inverseSection_zeroIdeal_eq_comap + (I : X.IdealSheafData) (π : Y ⟶ X) + (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) + (hJ : PresentsPullbackIdeal I π J ι) : + zeroIdeal J.inverse (inverseSection J ι) = I.comap π := by + let := GeometrySupport.LineBundleCoherent.lineBundle_isFinitePresentation J + rw [inverseSection_zeroIdeal, PresentedIdealIso.imageIdealSheaf_eq_comap I π J ι hJ] + +theorem zeroIdeal_pullback (L : LineBundle X) (s : GlobalSections X L.sheaf) + (f : Y ⟶ X) : + zeroIdeal (L.pullback f) (pullbackSection f s) = (zeroIdeal L s).comap f := by + classical + have hlocal (y : Y) : ∃ V : Y.affineOpens, y ∈ V.1 ∧ + (zeroIdeal (L.pullback f) (pullbackSection f s)).ideal V = + ((zeroIdeal L s).comap f).ideal V := by + obtain ⟨U, hU, ⟨e⟩⟩ := PiExponentSeshadri.InvertibleLocal.affine_frame L (f y) + obtain ⟨V, hV, hyV, hVU⟩ := exists_isAffineOpen_mem_and_subset + (show y ∈ f ⁻¹ᵁ U.1 from hU) + let g := f.resLE U.1 V hVU + obtain ⟨eF, he⟩ := exists_restricted_pullback_frame_all_of_factor f U.1 V g + (Scheme.Hom.resLE_comp_ι f hVU).symm e + refine ⟨⟨V, hV⟩, hyV, ?_⟩ + rw [zeroIdeal_on_frame (L.pullback f) (pullbackSection f s) ⟨V, hV⟩ eF, + PiExponentSeshadri.IdealPullback.comap_ideal (zeroIdeal L s) f ⟨V, hV⟩ U hVU, + zeroIdeal_on_frame L s U e, Ideal.map_span, Set.image_singleton] + erw [he s] + congr 2 + change V.topIso.hom ((f.resLE U.1 V hVU).appTop _) = _ + have ht : (f.resLE U.1 V hVU).appTop = U.1.topIso.hom ≫ + f.appLE U.1 V hVU ≫ V.topIso.inv := by + simpa only [Scheme.Hom.appTop, Scheme.Hom.appLE_eq_app] using! + (Scheme.Hom.resLE_app_top f hVU) + rw [ht] + simp only [CommRingCat.comp_apply, Iso.inv_hom_id_apply] + choose V hy hV using hlocal + apply Scheme.IdealSheafData.ext_of_iSup_eq_top V + · apply top_unique + intro y _ + exact Opens.mem_iSup.mpr ⟨y, hy y⟩ + · exact hV + +theorem zeroIdeal_zero (L : LineBundle X) : zeroIdeal L 0 = ⊥ := by + classical + choose U hx e using fun x : X => PiExponentSeshadri.InvertibleLocal.affine_frame L x + apply Scheme.IdealSheafData.ext_of_iSup_eq_top U + · apply top_unique + intro x _ + exact Opens.mem_iSup.mpr ⟨x, hx x⟩ + · intro x + rw [zeroIdeal_on_frame L 0 (U x) (e x).some] + erw [restrictSection_zero, coefficient_zero, map_zero, Ideal.span_singleton_zero] + rfl + +theorem pullback_inverseSection_zeroIdeal + (I : X.IdealSheafData) (π : Y ⟶ X) + (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) + (hJ : PresentsPullbackIdeal I π J ι) + {Z : Scheme.{0}} (g : Z ⟶ Y) : + zeroIdeal (J.inverse.pullback g) (pullbackSection g (inverseSection J ι)) = + I.comap (g ≫ π) := by + rw [zeroIdeal_pullback, inverseSection_zeroIdeal_eq_comap I π J ι hJ, + Scheme.IdealSheafData.comap_comp] + +theorem pullback_inverseSection_ne_zero + (I : X.IdealSheafData) (π : Y ⟶ X) + (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) + (hJ : PresentsPullbackIdeal I π J ι) + {Z : Scheme.{0}} (g : Z ⟶ Y) (hg : I.comap (g ≫ π) ≠ ⊥) : + pullbackSection g (inverseSection J ι) ≠ 0 := by + intro hs + have h := pullback_inverseSection_zeroIdeal I π J ι hJ g + rw [hs] at h + exact hg (h.symm.trans (zeroIdeal_zero _)) + +theorem zeroIdeal_spec_top {A : Type} [CommRing A] + (L : LineBundle (Spec (CommRingCat.of A))) + (s : GlobalSections _ L.sheaf) (e : L.sheaf ≅ O (Spec (CommRingCat.of A))) : + ((zeroIdeal L s).ideal ⟨⊤, isAffineOpen_top _⟩).map + (Scheme.ΓSpecIso (CommRingCat.of A)).hom.hom = + Ideal.span {LocalSectionOrder.localCoefficient e s} := by + change (imageIdeal (L.dualSection s) ⊤).map _ = _ + rw [imageIdeal_top_of_frame (L.dualSection s) + (InverseFrames.pairingFrame (lineTensorInverseIso L) e)] + change (Ideal.span {endValue ((InverseFrames.pairingFrame (lineTensorInverseIso L) e).inv ≫ + InverseFrames.dualMap (lineTensorInverseIso L) s)}).map _ = _ + erw [InverseFrames.dualMap_coefficient] + rw [Ideal.map_span, Set.image_singleton] + rfl + +def localIdeal {A : Type} [CommRing A] (I : X.IdealSheafData) + (q : Spec (CommRingCat.of A) ⟶ X) : Ideal A := + ((I.comap q).ideal ⟨⊤, isAffineOpen_top _⟩).map + (Scheme.ΓSpecIso (CommRingCat.of A)).hom.hom + +theorem localIdeal_specIdeal {A B : Type} [CommRing A] [CommRing B] + (I : Ideal B) (φ : B →+* A) : + localIdeal (PiExponentSeshadri.IdealPullback.specIdeal I) + (Spec.map (CommRingCat.ofHom φ)) = I.map φ := by + unfold localIdeal + rw [PiExponentSeshadri.IdealPullback.specIdeal_comap, + PiExponentSeshadri.IdealPullback.specIdeal_top, Ideal.map_map] + have he : (Scheme.ΓSpecIso (CommRingCat.of A)).hom.hom.comp + (Scheme.ΓSpecIso (CommRingCat.of A)).inv.hom = RingHom.id A := by + ext a + exact (Scheme.ΓSpecIso (CommRingCat.of A)).inv_hom_id_apply a + rw [he, Ideal.map_id] + +theorem localIdeal_compactIdeal {A : Type} [CommRing A] + {m : ℕ} {K : Type} [Fintype K] (c : K → Fin m → ℂ) + (T : Fin m → ℕ) (e : Fin (m+1) → ℕ) + (j : CompactLogJetIdeal.affineSpace m ⟶ X) [IsOpenImmersion j] [QuasiCompact j] + (φ : CompactLogJetIdeal.coordinateRing m →+* A) : + localIdeal (CompactLogJetIdeal.compactIdeal c T e j) + (Spec.map (CommRingCat.ofHom φ) ≫ j) = + (CompactLogJetIdeal.polynomialIdeal c T e).map φ := by + unfold localIdeal + rw [Scheme.IdealSheafData.comap_comp, CompactLogJetIdeal.restrict_compactIdeal] + exact localIdeal_specIdeal _ φ + +theorem localIdeal_eq_top_of_not_mem {A : Type} [CommRing A] [IsLocalRing A] + (I : X.IdealSheafData) (q : Spec (CommRingCat.of A) ⟶ X) + (hq : q (IsLocalRing.closedPoint A) ∉ I.support) : localIdeal I q = ⊤ := by + have havoid (a : Spec (CommRingCat.of A)) : q a ∉ I.support := + ((IsLocalRing.specializes_closedPoint a).map q.continuous).mem_open + I.support.isClosed.isOpen_compl hq + have ht := CompactJetIdeal.restrict_eq_top_of_disjoint I q havoid + unfold localIdeal + rw [ht] + exact Ideal.map_top _ + +section Curve +open CurveNormalizationModel CurveValuationCenter CurvePlaceCenter +open LocalSectionOrder +variable {E : Type} [Field E] [Algebra ℂ E] +variable (f : E) (hf : Transcendental ℂ f) +variable [FiniteDimensional (IntermediateField.adjoin ℂ {f}) E] + +theorem map_powerIdeal_eq_top_of_transcendental {m : ℕ} + (z : Fin (m+1) → E) (hz : ∃ i, Transcendental ℂ (z i)) + (c : Fin m → ℂ) (T : Fin m → ℕ) (e : Fin (m+1) → ℕ) : + (CompactJetPolynomial.powerIdeal c (CompactJetPolynomial.logPolynomials T) e).map + (MvPolynomial.aeval z).toRingHom = ⊤ := by + classical + have hn : ∃ i, MvPolynomial.aeval z + (CompactJetPolynomial.coordinates c (CompactJetPolynomial.logPolynomials T) i) ≠ 0 := by + by_contra h + push Not at h + have hle : Ideal.span (Set.range + (CompactJetPolynomial.coordinates c (CompactJetPolynomial.logPolynomials T))) ≤ + RingHom.ker (MvPolynomial.aeval z).toRingHom := by + apply Ideal.span_le.mpr + rintro _ ⟨i, rfl⟩ + exact h i + rw [CompactJetPolynomial.span_coordinates c _ + (CompactJetPolynomial.logPolynomials_eval_zero T)] at hle + obtain ⟨i, hi⟩ := hz + have hc : MvPolynomial.X i - MvPolynomial.C (CompactJetPolynomial.center c i) ∈ + WeightedBezout.pointIdeal (CompactJetPolynomial.center c) := by + change MvPolynomial.aeval (CompactJetPolynomial.center c) _ = 0 + simp + have he := hle hc + change MvPolynomial.aeval z _ = 0 at he + simp only [map_sub, MvPolynomial.aeval_X, MvPolynomial.aeval_C, sub_eq_zero] at he + exact hi (he ▸ isAlgebraic_algebraMap (CompactJetPolynomial.center c i)) + obtain ⟨i, hi⟩ := hn + apply Ideal.eq_top_of_isUnit_mem _ + (Ideal.mem_map_of_mem _ (show + CompactJetPolynomial.coordinates c (CompactJetPolynomial.logPolynomials T) i ^ e i ∈ + CompactJetPolynomial.powerIdeal c (CompactJetPolynomial.logPolynomials T) e from + Ideal.subset_span (Set.mem_range_self i))) + simp only [AlgHom.toRingHom_eq_coe, RingHom.coe_coe, map_pow] + exact (isUnit_iff_ne_zero.mpr hi).pow (e i) + +theorem compactIdeal_comap_ne_bot_of_generic {m : ℕ} {K : Type} [Fintype K] + (c : K → Fin m → ℂ) (T : Fin m → ℕ) (e : Fin (m+1) → ℕ) + (j : CompactLogJetIdeal.affineSpace m ⟶ X) [IsOpenImmersion j] [QuasiCompact j] + (g : parameterCurve f hf ⟶ X) (z : Fin (m+1) → E) + (hz : ∃ i, Transcendental ℂ (z i)) + (hgeneric : parameterCurveGenericPoint f hf ≫ g = + Spec.map (CommRingCat.ofHom (MvPolynomial.aeval z).toRingHom) ≫ j) : + (CompactLogJetIdeal.compactIdeal c T e j).comap g ≠ ⊥ := by + have htop : localIdeal (CompactLogJetIdeal.compactIdeal c T e j) + (parameterCurveGenericPoint f hf ≫ g) = ⊤ := by + rw [hgeneric, localIdeal_compactIdeal] + unfold CompactLogJetIdeal.polynomialIdeal + change Ideal.mapHom (MvPolynomial.aeval z).toRingHom _ = _ + rw [map_prod] + have ht : ∀ k : K, (CompactJetPolynomial.powerIdeal (c k) + (CompactJetPolynomial.logPolynomials T) e).map (MvPolynomial.aeval z).toRingHom = ⊤ := + fun k => map_powerIdeal_eq_top_of_transcendental z hz (c k) T e + simp only [Ideal.mapHom_apply, ht] + rw [← Ideal.one_eq_top] + exact Finset.prod_const_one + intro hzero + have hb : localIdeal (CompactLogJetIdeal.compactIdeal c T e j) + (parameterCurveGenericPoint f hf ≫ g) = ⊥ := by + simp only [localIdeal, Scheme.IdealSheafData.comap_comp, hzero, + Scheme.IdealSheafData.comap_bot] + exact Ideal.map_bot + exact bot_ne_top (hb.symm.trans htop) + +theorem centerMorphism_eq_centeredLift [X.IsSeparated] + {m : ℕ} (j : CompactLogJetIdeal.affineSpace m ⟶ X) + (g : parameterCurve f hf ⟶ X) (z : Fin (m+1) → E) + (hgeneric : parameterCurveGenericPoint f hf ≫ g = + Spec.map (CommRingCat.ofHom (MvPolynomial.aeval z).toRingHom) ≫ j) + (p : NormalizedPlace ℂ E) (c : Fin m → ℂ) + (hc : CurveCenters.Centered z (Fin.cases 1 c) p) : + centerMorphism f hf p ≫ g = + Spec.map (CommRingCat.ofHom + (MvPolynomial.aeval (PlaceCenteredBranch.lift p z (Fin.cases 1 c) hc)).toRingHom) ≫ j := by + apply centerMorphism_comp_eq_of_generic f hf p g + rw [hgeneric, ← Category.assoc, ← Spec.map_comp, ← CommRingCat.ofHom_comp] + congr 2 + apply CommRingCat.hom_ext + apply RingHom.ext + intro P + exact PlaceCenteredBranch.lift_aeval p z (Fin.cases 1 c) hc P + +theorem localIdeal_length_eq_logContact [X.IsSeparated] + {m K : ℕ} (c : Fin K → Fin m → ℂ) (hc : Function.Injective c) + (T : Fin m → ℕ) (e : Fin (m+1) → ℕ) + (v : Fin (m+1) → ℚ) (hv : ∀ i, 0 < v i) + (R : ℚ) (he : ∀ i, v i * (e i : ℚ) = R) + (hT : ∀ i, v i.succ < (T i : ℚ) * v 0) + (j : CompactLogJetIdeal.affineSpace m ⟶ X) [IsOpenImmersion j] [QuasiCompact j] + (g : parameterCurve f hf ⟶ X) (z : Fin (m+1) → E) + (hz : ∃ i, Transcendental ℂ (z i)) + (hgeneric : parameterCurveGenericPoint f hf ≫ g = + Spec.map (CommRingCat.ofHom (MvPolynomial.aeval z).toRingHom) ≫ j) + (p : NormalizedPlace ℂ E) + [Algebra.IsIntegral ℂ (IsLocalRing.ResidueField (PlaceValuationRing.ring p))] + (k : Fin K) (hcenter : CurveCenters.Centered z (Fin.cases 1 (c k)) p) : + ((Module.length (PlaceValuationRing.ring p) + ((PlaceValuationRing.ring p) ⧸ + localIdeal (CompactLogJetIdeal.compactIdeal c T e j) + (centerMorphism f hf p ≫ g))).toNat : ℚ) = + R * PlaceCenteredBranch.logContact p z (c k) hcenter + (CurveContactFamily.nonconstant z (c k) hz) v := by + let a := PlaceCenteredBranch.lift p z (Fin.cases 1 (c k)) hcenter + have ha : (Fin.cases (a 0) (fun i => a i.succ) : Fin (m+1) → PlaceValuationRing.ring p) = a := by + funext i + cases i using Fin.cases <;> rfl + have hy := PlaceCenteredBranch.lift_residue p z (Fin.cases 1 (c k)) hcenter 0 + have hx := fun i : Fin m => + PlaceCenteredBranch.lift_residue p z (Fin.cases 1 (c k)) hcenter i.succ + rw [centerMorphism_eq_centeredLift f hf j g z hgeneric p (c k) hcenter, + localIdeal_compactIdeal] + have hm := JetProductLocalization.map_polynomialIdeal_eq_selected + c hc T e (a 0) (fun i => a i.succ) k hy hx + rw [ha] at hm + rw [hm] + exact LogarithmicContactIdeal.logarithmicIdeal_colength_eq_contact v hv (c k) + (a 0) (fun i => a i.succ) hy hx + (PlaceCenteredBranch.logLift_nonconstant p z (c k) hcenter + (CurveContactFamily.nonconstant z (c k) hz)) T hT R e he + +theorem divisor_eq_localIdeal_length + (L : LineBundle (parameterCurve f hf)) + (s : GlobalSections _ L.sheaf) (hs : s ≠ 0) (p : NormalizedPlace ℂ E) : + CurvePlaceSectionDivisor.divisor f hf L s hs p = + (Module.length (PlaceValuationRing.ring p) + ((PlaceValuationRing.ring p) ⧸ localIdeal (zeroIdeal L s) (centerMorphism f hf p))).toNat := by + let q := centerMorphism f hf p + obtain ⟨e, he⟩ := LocalPullbackSectionOrder.exists_frame_coefficient_germ q L + have hn : localCoefficient e (pullbackSection q s) ≠ 0 := by + rw [he s] + apply (map_ne_zero_iff _ + (ConcreteCategory.bijective_of_isIso (Scheme.stalkClosedPointTo q)).injective).mpr + exact SectionZeroStalk.sectionGerm_ne_zero L s hs + (CurveSectionDegree.affineFrameAt L (q (IsLocalRing.closedPoint _))).openSet + (CurveSectionDegree.affineFrameAt L (q (IsLocalRing.closedPoint _))).frame _ + (CurveSectionDegree.affineFrameAt L (q (IsLocalRing.closedPoint _))).mem + have hi : localIdeal (zeroIdeal L s) q = + Ideal.span {localCoefficient e (pullbackSection q s)} := by + unfold localIdeal + rw [← zeroIdeal_pullback L s q] + exact zeroIdeal_spec_top (L.pullback q) (pullbackSection q s) e + rw [CurvePlaceSectionOrder.divisor_eq_local_order f hf L s hs p e, hi, + CurveLocalOrder.length_quotient_span_eq_addVal hn] + rfl + +variable (I : X.IdealSheafData) (π : Y ⟶ X) +variable (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) +variable (hJ : PresentsPullbackIdeal I π J ι) +variable (g : parameterCurve f hf ⟶ Y) (hg : I.comap (g ≫ π) ≠ ⊥) + +def idealDivisor : NormalizedPlace ℂ E →₀ ℕ := + CurvePlaceSectionDivisor.divisor f hf (J.inverse.pullback g) + (pullbackSection g (inverseSection J ι)) + (pullback_inverseSection_ne_zero I π J ι hJ g hg) + +theorem idealDivisor_apply (p : NormalizedPlace ℂ E) : + idealDivisor f hf I π J ι hJ g hg p = + (Module.length (PlaceValuationRing.ring p) + ((PlaceValuationRing.ring p) ⧸ + localIdeal I (centerMorphism f hf p ≫ g ≫ π))).toNat := by + erw [idealDivisor, divisor_eq_localIdeal_length] + have hi : localIdeal + (zeroIdeal (J.inverse.pullback g) (pullbackSection g (inverseSection J ι))) + (centerMorphism f hf p) = localIdeal I (centerMorphism f hf p ≫ g ≫ π) := by + simp only [localIdeal, pullback_inverseSection_zeroIdeal I π J ι hJ g, + Scheme.IdealSheafData.comap_comp] + rw [hi] + +theorem degree_eq_neg_idealDivisor_sum : + eulerCharacteristic (parameterCurveStructureMap f hf) 1 (J.pullback g).sheaf - + eulerCharacteristic (parameterCurveStructureMap f hf) 1 + (structureSheaf (parameterCurve f hf)) = + -(idealDivisor f hf I π J ι hJ g hg).sum (fun _ n => (n : ℤ)) := by + have hd := CurvePlaceSectionDivisor.degree_eq_euler_difference_full f hf + (J.inverse.pullback g) (pullbackSection g (inverseSection J ι)) + (pullback_inverseSection_ne_zero I π J ι hJ g hg) + have ht := parameterCurve_tensor_euler_add f hf (J.pullback g) (J.inverse.pullback g) + let e : ((J.pullback g).tensor (J.inverse.pullback g)).sheaf ≅ + structureSheaf (parameterCurve f hf) := + (PiExponentSeshadri.PullbackTensor.iso g J J.inverse).symm ≪≫ + (Scheme.Modules.pullback g).mapIso (lineTensorInverseIso J) ≪≫ pullbackUnitIso g + have he := eulerCharacteristic_iso (parameterCurveStructureMap f hf) e 1 + change _ = -(CurvePlaceSectionDivisor.divisor f hf (J.inverse.pullback g) + (pullbackSection g (inverseSection J ι)) _).sum (fun _ n => (n : ℤ)) + omega + +theorem compactIdeal_degree_eq_neg_contact_sum [X.IsSeparated] + {m K : ℕ} (c : Fin K → Fin m → ℂ) (hc : Function.Injective c) + (T : Fin m → ℕ) (e : Fin (m+1) → ℕ) (hepos : ∀ i, 0 < e i) + (v : Fin (m+1) → ℚ) (hv : ∀ i, 0 < v i) + (R : ℚ) (he : ∀ i, v i * (e i : ℚ) = R) + (hT : ∀ i, v i.succ < (T i : ℚ) * v 0) + (j : CompactLogJetIdeal.affineSpace m ⟶ X) [IsOpenImmersion j] [QuasiCompact j] + (pX : X ⟶ Spec (CommRingCat.of ℂ)) [IsSeparated pX] + (hj : j ≫ pX = CompactLogJetIdeal.structureMap m) + (π : Y ⟶ X) (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) + (hJ : PresentsPullbackIdeal (CompactLogJetIdeal.compactIdeal c T e j) π J ι) + (g : parameterCurve f hf ⟶ Y) (z : Fin (m+1) → E) + (hz : ∃ i, Transcendental ℂ (z i)) + (hgeneric : parameterCurveGenericPoint f hf ≫ g ≫ π = + Spec.map (CommRingCat.ofHom (MvPolynomial.aeval z).toRingHom) ≫ j) + (hres : ∀ p : NormalizedPlace ℂ E, + Algebra.IsIntegral ℂ (IsLocalRing.ResidueField (PlaceValuationRing.ring p))) + (hfinite : ∀ t : E, Transcendental ℂ t → + FiniteDimensional (IntermediateField.adjoin ℂ {t}) E) : + ((eulerCharacteristic (parameterCurveStructureMap f hf) 1 (J.pullback g).sheaf - + eulerCharacteristic (parameterCurveStructureMap f hf) 1 + (structureSheaf (parameterCurve f hf)) : ℤ) : ℚ) = + -R * ∑ p ∈ CurveContactFamily.places hfinite z c hz, + CurveContactFamily.contact hres hfinite z c hz v p := by + classical + let I := CompactLogJetIdeal.compactIdeal c T e j + have hg : I.comap (g ≫ π) ≠ ⊥ := + compactIdeal_comap_ne_bot_of_generic f hf c T e j (g ≫ π) z hz hgeneric + let D := idealDivisor f hf I π J ι hJ g hg + let P := CurveContactFamily.places hfinite z c hz + have hzero (p : NormalizedPlace ℂ E) (hp : p ∉ P) : D p = 0 := by + have havoid : (centerMorphism f hf p ≫ g ≫ π) + (IsLocalRing.closedPoint (PlaceValuationRing.ring p)) ∉ I.support := by + intro hmem + change _ ∈ ((CompactLogJetIdeal.compactIdeal c T e j).support : Set X) at hmem + rw [CompactLogJetIdeal.support_compactIdeal c T e hepos j pX hj] at hmem + obtain ⟨k, hk⟩ := Set.mem_iUnion.mp hmem + obtain ⟨a, ha⟩ := hk + have hap : CompactLogJetIdeal.point (c k) a = CompactJetPolynomial.centerPoint (c k) := by + have h := Set.mem_range_self (f := CompactLogJetIdeal.point (c k)) a + rw [CompactLogJetIdeal.range_point] at h + exact h + have hclosed : (centerMorphism f hf p ≫ g ≫ π) + (IsLocalRing.closedPoint (PlaceValuationRing.ring p)) = + j (CompactJetPolynomial.centerPoint (c k)) := by + exact ha.symm.trans (congrArg j hap) + have hfield : Spec.map (CommRingCat.ofHom + (algebraMap (PlaceValuationRing.ring p) E)) ≫ + (centerMorphism f hf p ≫ g ≫ π) = + Spec.map (CommRingCat.ofHom (MvPolynomial.aeval z).toRingHom) ≫ j := by + rw [← Category.assoc, centerMorphism_generic] + exact hgeneric + apply hp + exact (CurveContactFamily.mem_places hfinite z c hz p).mpr + ⟨k, JetCenterIdentification.centered_of_closedPoint_eq p z (c k) j _ hfield hclosed⟩ + change idealDivisor f hf I π J ι hJ g hg p = 0 + rw [idealDivisor_apply, localIdeal_eq_top_of_not_mem I _ havoid] + simp + have hsupport : D.support ⊆ P := by + intro p hp + by_contra h + exact (Finsupp.mem_support_iff.mp hp) (hzero p h) + have hvalue (p : NormalizedPlace ℂ E) (hp : p ∈ P) : + (D p : ℚ) = R * CurveContactFamily.contact hres hfinite z c hz v p := by + let := hres p + have hp' : p ∈ CurveContactFamily.places hfinite z c hz := hp + let k := CurveContactFamily.center hfinite z c hz p hp + have hcenter := CurveContactFamily.centered hfinite z c hz p hp + have h := localIdeal_length_eq_logContact f hf c hc T e v hv R he hT j (g ≫ π) + z hz hgeneric p k hcenter + change (idealDivisor f hf I π J ι hJ g hg p : ℚ) = _ + rw [idealDivisor_apply] + simpa only [CurveContactFamily.contact, dite_eq_left hp', I, k] using h + have hsum : D.sum (fun _ n => (n : ℚ)) = + R * ∑ p ∈ P, CurveContactFamily.contact hres hfinite z c hz v p := by + rw [D.sum_of_support_subset hsupport (fun _ n => (n : ℚ)) (by simp)] + rw [Finset.mul_sum] + exact Finset.sum_congr rfl (fun p hp => hvalue p hp) + have hd := degree_eq_neg_idealDivisor_sum f hf I π J ι hJ g hg + have hdq : ((eulerCharacteristic (parameterCurveStructureMap f hf) 1 (J.pullback g).sheaf - + eulerCharacteristic (parameterCurveStructureMap f hf) 1 + (structureSheaf (parameterCurve f hf)) : ℤ) : ℚ) = + -D.sum (fun _ n => (n : ℚ)) := by + simpa only [Int.cast_neg, Finsupp.sum, Int.cast_sum, Int.cast_natCast] using + congrArg (fun a : ℤ => (a : ℚ)) hd + rw [hsum] at hdq + simpa only [neg_mul, P] using hdq + +end Curve + +theorem admissible_degree_eq_neg_contactSum + {ν Λ D : ℝ} (d : AdmissibleParameters ν Λ D) + {E : Type} [Field E] [Algebra ℂ E] [Algebra.EssFiniteType ℂ E] + (y : E) (x : Fin d.m → E) + (hgen : IntermediateField.adjoin ℂ + (Set.range (Fin.cases y x : Fin (d.m+1) → E)) = ⊤) + (htrdeg : Algebra.trdeg ℂ E = 1) + (f : E) (hf : Transcendental ℂ f) : + letI := CurveParameterFinite.finite_over_every_parameter ℂ E htrdeg f hf + ∀ (g : CurveNormalizationModel.parameterCurve f hf ⟶ AdmissibleBlowupGeometry.blowup d), + CurveNormalizationModel.parameterCurveGenericPoint f hf ≫ g ≫ + AdmissibleBlowupGeometry.projection d = + Spec.map (CommRingCat.ofHom (MvPolynomial.aeval (Fin.cases y x)).toRingHom) ≫ + AdmissibleBlowupGeometry.affineChart d → + ((eulerCharacteristic (CurveNormalizationModel.parameterCurveStructureMap f hf) 1 + ((AdmissibleBlowupGeometry.J d).pullback g).sheaf - + eulerCharacteristic (CurveNormalizationModel.parameterCurveStructureMap f hf) 1 + (structureSheaf (CurveNormalizationModel.parameterCurve f hf)) : ℤ) : ℝ) = + -((AdmissibleBlowupGeometry.scale d).radius : ℝ) * + BlowupCurveMargin.contactSum d y x hgen htrdeg := by + let hfinite := CurveParameterFinite.finite_over_every_parameter ℂ E htrdeg + let := hfinite f hf + intro g hgeneric + let hres := PlaceLocalRing.residue_integral htrdeg.le + let z : Fin (d.m+1) → E := Fin.cases y x + let hz := CurveInequality.nonconstant_coordinates z hgen htrdeg + have hc : Function.Injective d.curveCenters := by + let i : Fin d.m := ⟨0, by have := d.m_pos; omega⟩ + intro j k h + exact d.curveCenters_injective i (congrFun h i) + have h := compactIdeal_degree_eq_neg_contact_sum f hf d.curveCenters hc + (AdmissibleBlowupGeometry.logCutoff d) (AdmissibleBlowupGeometry.scale d).jetPowers + (AdmissibleBlowupGeometry.scale d).jetPowers_pos d.curveJetWeights d.curveJetWeights_pos + (AdmissibleBlowupGeometry.scale d).radius (AdmissibleBlowupGeometry.scale d).jetPowers_eq + (AdmissibleBlowupGeometry.logCutoff_strict d) (AdmissibleBlowupGeometry.affineChart d) + (AdmissibleBlowupGeometry.compactificationStructureMap d) + (AdmissibleBlowupGeometry.affineChart_over d) + (AdmissibleBlowupGeometry.projection d) (AdmissibleBlowupGeometry.J d) + (AdmissibleBlowupGeometry.exceptionalInclusion d) + (AdmissibleBlowupGeometry.exceptional_presents d) g z hz hgeneric hres hfinite + change _ = -((AdmissibleBlowupGeometry.scale d).radius : ℝ) * + ∑ p ∈ CurveContactFamily.places hfinite z d.curveCenters hz, + (CurveContactFamily.contact hres hfinite z d.curveCenters hz d.curveJetWeights p : ℝ) + exact_mod_cast h + +end +end PiExponent.ExceptionalCurveDegree + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalPowerPresentation.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalPowerPresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..334c401b63a889b69faea9a67d79f3d2094064b8 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalPowerPresentation.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalPowerSections +import OAI.NumberTheory.PiExponent.Approximation.FrameSubopens +import OAI.NumberTheory.PiExponent.Geometry.IdealSheafPowers +import OAI.NumberTheory.PiExponent.LocalAlgebra.PresentedIdealIso + +namespace OAI + +noncomputable section +namespace PiExponent.PresentedIdealIso +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.IdealModule PiExponentSeshadri.Frames +open PiExponent.SectionImageIdeal +variable {X Y : Scheme.{0}} + +theorem imageIdealSheaf_idealPowerInclusion + (J : LineBundle Y) (ι : J.sheaf ⟶ structureSheaf Y) (n : ℕ) + [J.sheaf.IsQuasicoherent] [(J.pow n).sheaf.IsQuasicoherent] : + imageIdealSheaf (idealPowerInclusion J ι n) = (imageIdealSheaf ι)^n := by + classical + have hlocal (y : Y) : ∃ U : Y.affineOpens, y ∈ U.1 ∧ + Nonempty (J.sheaf.restrict U.1.ι ≅ structureSheaf U.1.toScheme) := by + obtain ⟨V, hyV, ⟨e⟩⟩ := J.locallyRankOne y + obtain ⟨U, hU, hyU, hUV⟩ := exists_isAffineOpen_mem_and_subset hyV + exact ⟨⟨U,hU⟩,hyU,⟨restrictOpenFrame hUV e⟩⟩ + choose U hy he using hlocal + apply Scheme.IdealSheafData.ext_of_iSup_eq_top U + · apply top_unique + intro y _ + exact Opens.mem_iSup.mpr ⟨y, hy y⟩ + · intro y + let e := Classical.choice (he y) + rw [Scheme.IdealSheafData.ideal_pow] + change (imageIdealSheaf (idealPowerInclusion J ι n)).ideal (U y) = + ((imageIdealSheaf ι).ideal (U y))^n + erw [imageIdealSheaf_on_frame (idealPowerInclusion J ι n) (U y) + (idealPowerFrame J (U y).1 e n), + imageIdealSheaf_on_frame ι (U y) e] + exact idealPowerInclusion_ideal J ι (U y) e n + +theorem idealPower_presents + (I : X.IdealSheafData) (f : Y ⟶ X) + (J : LineBundle Y) (ι : J.sheaf ⟶ structureSheaf Y) + (hJ : PresentsPullbackIdeal I f J ι) (n : ℕ) : + PresentsPullbackIdeal (I^n) f (J.pow n) (idealPowerInclusion J ι n) := by + let := GeometrySupport.LineBundleCoherent.lineBundle_isFinitePresentation J + let := GeometrySupport.LineBundleCoherent.lineBundle_isFinitePresentation (J.pow n) + let : J.sheaf.IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData J.sheaf).choose.isQuasicoherent + let : (J.pow n).sheaf.IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData + (J.pow n).sheaf).choose.isQuasicoherent + let : Mono ι := hJ.1 + refine ⟨@idealPowerInclusion_mono Y J ι hJ.1 n, ?_⟩ + intro U V hUV + have h := imageIdealSheaf_idealPowerInclusion J ι n + rw [imageIdealSheaf_eq_comap I f J ι hJ, + ← PiExponentSeshadri.IdealPullback.comap_pow] at h + have hu := congrArg (fun K : Y.IdealSheafData => K.ideal U) h + exact hu.trans (PiExponentSeshadri.IdealPullback.comap_ideal (I^n) f U V hUV) + +def powerIso + (I : X.IdealSheafData) (f : Y ⟶ X) + (J : LineBundle Y) (ι : J.sheaf ⟶ structureSheaf Y) + (hJ : PresentsPullbackIdeal I f J ι) (n : ℕ) : + (J.pow n).sheaf ≅ closedModule ((I^n).comap f) := + @asIso Y.Modules _ _ _ + (toIdealModule (I^n) f (J.pow n) (idealPowerInclusion J ι n) + (idealPower_presents I f J ι hJ n)) + (toIdealModule_isIso (I^n) f (J.pow n) (idealPowerInclusion J ι n) + (idealPower_presents I f J ι hJ n)) + +@[reassoc (attr := simp)] theorem powerIso_hom_inclusion + (I : X.IdealSheafData) (f : Y ⟶ X) + (J : LineBundle Y) (ι : J.sheaf ⟶ structureSheaf Y) + (hJ : PresentsPullbackIdeal I f J ι) (n : ℕ) : + (powerIso I f J ι hJ n).hom ≫ closedInclusion ((I^n).comap f) = + idealPowerInclusion J ι n := + toIdealModule_inclusion (I^n) f (J.pow n) (idealPowerInclusion J ι n) + (idealPower_presents I f J ι hJ n) + +end PiExponent.PresentedIdealIso + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalPowerSections.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalPowerSections.lean new file mode 100644 index 0000000000000000000000000000000000000000..749b1ce545e23added0da7440a7f1ffedc642b5c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalPowerSections.lean @@ -0,0 +1,130 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesExceptional +import OAI.NumberTheory.PiExponent.LocalAlgebra.GlobalInvertibleIdeal +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealTensorPowers + +namespace OAI + +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Frames PiExponentSeshadri.Geometry +namespace PiExponentSeshadri.Geometry +variable {X Y : Scheme} + +lemma InvertibleLocal.pullback_frame_equation {I : X.IdealSheafData} {f : Y ⟶ X} + (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) (hJ : PresentsPullbackIdeal I f J ι) + (U : Y.affineOpens) (V : X.affineOpens) (hUV : U.1 ≤ f ⁻¹ᵁ V.1) + (e : J.sheaf.restrict U.1.ι ≅ O U.1.toScheme) : + (I.ideal V).map (f.appLE V.1 U.1 hUV).hom = + Ideal.span {affineMapCoefficient U e (Scheme.Modules.restrictUnitIso U.1.ι) ι} := by + let g : O U.1.toScheme ⟶ O U.1.toScheme := + e.inv ≫ PiExponentSeshadri.InvertibleLocal.restrictedInclusion J ι U.1.ι + have H : ((I.comap f).comap U.1.ι).ideal ⟨⊤,isAffineOpen_top _⟩ = + Ideal.span {endValue g} := by + change _ = Ideal.span {UnitEndomorphism.equation g ⊤} + rw [← UnitEndomorphism.image_principal g ⊤, + ← PiExponentSeshadri.InvertibleLocal.restricted_image_on_chart J ι hJ U.1.ι + ⟨⊤,isAffineOpen_top _⟩ V (by simpa only [Scheme.Opens.ι_image_top] using hUV)] + ext r + change (∃ s, (PiExponentSeshadri.InvertibleLocal.restrictedInclusion J ι U.1.ι).val.app (.op ⊤) s = r) ↔ + ∃ s, (PiExponentSeshadri.InvertibleLocal.restrictedInclusion J ι U.1.ι).val.app (.op ⊤) + (e.inv.val.app (.op ⊤) s) = r + constructor + · rintro ⟨s,hs⟩ + refine ⟨e.hom.val.app (.op ⊤) s,?_⟩ + have ht : e.inv.val.app (.op ⊤) (e.hom.val.app (.op ⊤) s) = s := + congrArg (fun k : J.sheaf.restrict U.1.ι ⟶ J.sheaf.restrict U.1.ι => + k.val.app (.op ⊤) s) e.hom_inv_id + rw [ht]; exact hs + · rintro ⟨s,hs⟩; exact ⟨e.inv.val.app (.op ⊤) s,hs⟩ + rw [IdealPullback.comap_ι_top,IdealPullback.comap_ideal I f U V hUV] at H + have H' := congrArg (Ideal.map U.1.topIso.hom.hom) H + rw [Ideal.map_map,Ideal.map_span,Set.image_singleton] at H' + have hi : U.1.topIso.hom.hom.comp U.1.topIso.inv.hom = RingHom.id _ := by + ext x; exact U.1.topIso.inv_hom_id_apply x + rw [hi,Ideal.map_id] at H' + exact H' + +theorem framed_section_range {Z : Scheme} {M : Z.Modules} + (e : M ≅ O Z) (a : M ⟶ O Z) : + (a.val.app (.op ⊤)).hom.range = + Ideal.span {endValue (e.inv ≫ a)} := by + rw [show endValue (e.inv ≫ a) = + UnitEndomorphism.equation (e.inv ≫ a) ⊤ from rfl, + ← UnitEndomorphism.image_principal] + ext r + change (∃ s, a.val.app (.op ⊤) s = r) ↔ + ∃ s, a.val.app (.op ⊤) (e.inv.val.app (.op ⊤) s) = r + constructor + · rintro ⟨s, hs⟩ + refine ⟨e.hom.val.app (.op ⊤) s, ?_⟩ + have h : e.inv.val.app (.op ⊤) (e.hom.val.app (.op ⊤) s) = s := by + exact congrArg (fun k : M ⟶ M => k.val.app (.op ⊤) s) e.hom_inv_id + rw [h] + exact hs + · rintro ⟨s, hs⟩ + exact ⟨e.inv.val.app (.op ⊤) s, hs⟩ + +theorem idealPower_restricted_range (f : Y ⟶ X) (I : X.IdealSheafData) + (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) (hJ : PresentsPullbackIdeal I f J ι) + (n : ℕ) (U : Y.affineOpens) (V : X.affineOpens) + (hUV : U.1 ≤ f ⁻¹ᵁ V.1) + (e : J.sheaf.restrict U.1.ι ≅ O U.1.toScheme) : + ((PiExponentSeshadri.InvertibleLocal.restrictedInclusion (J.pow n) + (idealPowerInclusion J ι n) U.1.ι).val.app (.op ⊤)).hom.range = + (((I.ideal V)^n).map (f.appLE V.1 U.1 hUV).hom).map U.1.topIso.inv.hom := by + erw [framed_section_range (idealPowerFrame J U.1 e n)] + have h := idealPowerInclusion_ideal J ι U e n + rw [← InvertibleLocal.pullback_frame_equation J ι hJ U V hUV, ← Ideal.map_pow] at h + have h' := congrArg (Ideal.map U.1.topIso.inv.hom) h + rw [Ideal.map_span, Set.image_singleton] at h' + simpa only [affineMapCoefficient, U.1.topIso.hom_inv_id_apply, + PiExponentSeshadri.InvertibleLocal.restrictedInclusion, Category.assoc] using! h' + +def powerChartIdeal (f : Y ⟶ X) (I : X.IdealSheafData) (n : ℕ) + (U : Y.affineOpens) (V : X.affineOpens) (hUV : U.1 ≤ f ⁻¹ᵁ V.1) : + Ideal Γ(U.1.toScheme, ⊤) := + (((I.ideal V)^n).map (f.appLE V.1 U.1 hUV).hom).map U.1.topIso.inv.hom + +private abbrev powerSections (J : LineBundle Y) (n : ℕ) (U : Y.Opens) : + ModuleCat Γ(U.toScheme, ⊤) := ((J.pow n).sheaf.restrict U.ι).val.obj (.op ⊤) + +def idealPowerSectionsEquiv (f : Y ⟶ X) (I : X.IdealSheafData) + (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) (hJ : PresentsPullbackIdeal I f J ι) + (n : ℕ) (U : Y.affineOpens) (V : X.affineOpens) + (hUV : U.1 ≤ f ⁻¹ᵁ V.1) + (e : J.sheaf.restrict U.1.ι ≅ O U.1.toScheme) : + powerSections J n U.1 ≃ₗ[Γ(U.1.toScheme, ⊤)] + ↥(powerChartIdeal f I n U V hUV) := by + letI : Mono ι := hJ.1 + letI := idealPowerInclusion_mono J ι n + let a := PiExponentSeshadri.InvertibleLocal.restrictedInclusion (J.pow n) + (idealPowerInclusion J ι n) U.1.ι + have ha : Mono (C := U.1.toScheme.Modules) a := + @PiExponentSeshadri.InvertibleLocal.restrictedInclusion_mono Y U.1.toScheme + (J.pow n) (idealPowerInclusion J ι n) U.1.ι inferInstance + (@idealPowerInclusion_mono Y J ι hJ.1 n) + have hinj : Function.Injective (a.val.app (.op ⊤)) := by + let : Mono a.val := + @Functor.map_mono _ _ _ _ (Scheme.Modules.toPresheafOfModules U.1.toScheme) + inferInstance _ _ a ha + exact PresheafOfModules.injective_of_mono a.val (.op ⊤) + let φ : powerSections J n U.1 →ₗ[Γ(U.1.toScheme, ⊤)] + Γ(U.1.toScheme, ⊤) := (a.val.app (.op ⊤)).hom + have hr : φ.range = (powerChartIdeal f I n U V hUV : Submodule Γ(U.1.toScheme, ⊤) _) := + idealPower_restricted_range f I J ι hJ n U V hUV e + exact (LinearEquiv.ofInjective φ hinj).trans (LinearEquiv.ofEq _ _ hr) + +theorem idealPowerSectionsEquiv_apply (f : Y ⟶ X) (I : X.IdealSheafData) + (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) (hJ : PresentsPullbackIdeal I f J ι) + (n : ℕ) (U : Y.affineOpens) (V : X.affineOpens) + (hUV : U.1 ≤ f ⁻¹ᵁ V.1) + (e : J.sheaf.restrict U.1.ι ≅ O U.1.toScheme) + (s : powerSections J n U.1) : + (idealPowerSectionsEquiv f I J ι hJ n U V hUV e s).val = + (PiExponentSeshadri.InvertibleLocal.restrictedInclusion (J.pow n) + (idealPowerInclusion J ι n) U.1.ι).val.app (.op ⊤) s := rfl + +end PiExponentSeshadri.Geometry +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRecoveryMap.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRecoveryMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3d3e1adf01f0922e3533f9995f4a0cb92fb505a --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRecoveryMap.lean @@ -0,0 +1,52 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalPowerPresentation +import OAI.NumberTheory.PiExponent.Ampleness.LineAmpleOperations +import OAI.NumberTheory.PiExponent.Approximation.ModuleLinePowerLaws +import OAI.NumberTheory.PiExponent.Approximation.ProjectionFormula +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealPullbackMap + +namespace OAI + +namespace PiExponent.GeometrySupport.ExceptionalRecoveryMap +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.IdealModule +variable {X Y : Scheme.{0}} (f : Y ⟶ X) [QuasiCompact f] + (I : X.IdealSheafData) (E : LineBundle Y) + (ι : E.sheaf ⟶ structureSheaf Y) (hE : PresentsPullbackIdeal I f E ι) + +def ordinaryMap (n : ℕ) : closedModule (I^n) ⟶ + (Scheme.Modules.pushforward f).obj (modulePow Y E.sheaf n) := + IdealPullbackMap.comap f (I^n) ≫ + (Scheme.Modules.pushforward f).map (PresentedIdealIso.powerIso I f E ι hE n).inv + +@[reassoc (attr := simp)] theorem ordinaryMap_inclusion (n : ℕ) : + ordinaryMap f I E ι hE n ≫ + (Scheme.Modules.pushforward f).map (idealPowerInclusion E ι n) = + closedInclusion (I^n) ≫ structureMap f := by + have he : (PresentedIdealIso.powerIso I f E ι hE n).inv ≫ + idealPowerInclusion E ι n = closedInclusion ((I^n).comap f) := by + rw [← PresentedIdealIso.powerIso_hom_inclusion I f E ι hE n] + exact Iso.inv_hom_id_assoc _ _ + rw [ordinaryMap, Category.assoc] + erw [← Functor.map_comp, he] + exact IdealPullbackMap.comap_inclusion f (I^n) + +theorem ordinaryMap_app_inclusion (n : ℕ) (U : X.Opens) (s : Γ(closedModule (I^n), U)) : + (idealPowerInclusion E ι n).app (f ⁻¹ᵁ U) + ((ordinaryMap f I E ι hE n).app U s) = + f.app U ((closedInclusion (I^n)).app U s) := + congrArg (fun g => g.app U s) (ordinaryMap_inclusion f I E ι hE n) + +def twistedMap (A : LineBundle X) (n : ℕ) : + (moduleTwistFunctor A n).obj (closedModule (I^n)) ⟶ + (Scheme.Modules.pushforward f).obj ((E.tensor (A.pullback f)).pow n).sheaf := + (moduleTwistFunctor A n).map (ordinaryMap f I E ι hE n) ≫ + (ProjectionFormula.twistIso f (modulePow Y E.sheaf n) A n).inv ≫ + (Scheme.Modules.pushforward f).map + ((moduleTwistPowerIso (A.pullback f) (modulePow Y E.sheaf n) n).hom ≫ + (lineTensorPow E (A.pullback f) n).inv) + +end +end PiExponent.GeometrySupport.ExceptionalRecoveryMap + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRecoveryTwist.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRecoveryTwist.lean new file mode 100644 index 0000000000000000000000000000000000000000..65527aee42b8562aa19c4e7d6a1b11222f3e6260 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRecoveryTwist.lean @@ -0,0 +1,31 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalRecoveryMap +import OAI.NumberTheory.PiExponent.LocalAlgebra.TwistLocalSections + +namespace OAI + +namespace PiExponent.GeometrySupport.ExceptionalRecoveryMap +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.IdealModule +variable {X Y : Scheme.{0}} (f : Y ⟶ X) [QuasiCompact f] + (I : X.IdealSheafData) (E : LineBundle Y) + (ι : E.sheaf ⟶ structureSheaf Y) (hE : PresentsPullbackIdeal I f E ι) + +theorem twistedMap_app_bijective (A : LineBundle X) (n : ℕ) (U : X.Opens) + (e : A.sheaf.restrict U.ι ≅ structureSheaf U.toScheme) + (h : Function.Bijective ((ordinaryMap f I E ι hE n).app U)) : + Function.Bijective ((twistedMap f I E ι hE A n).app U) := by + let a := (ProjectionFormula.twistIso f (modulePow Y E.sheaf n) A n).symm ≪≫ + (Scheme.Modules.pushforward f).mapIso + (moduleTwistPowerIso (A.pullback f) (modulePow Y E.sheaf n) n ≪≫ + (lineTensorPow E (A.pullback f) n).symm) + let : IsIso ((SheafOfModules.evaluation X.ringCatSheaf (op U)).map a.hom) := + ((SheafOfModules.evaluation X.ringCatSheaf (op U)).mapIso a).isIso_hom + have ha := ConcreteCategory.bijective_of_isIso + ((SheafOfModules.evaluation X.ringCatSheaf (op U)).map a.hom) + exact ha.comp (moduleTwist_app_bijective A U e (ordinaryMap f I E ι hE n) n h) + +end +end PiExponent.GeometrySupport.ExceptionalRecoveryMap + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRepresentedOpaque.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRepresentedOpaque.lean new file mode 100644 index 0000000000000000000000000000000000000000..914541d30e7448eaff1bd6f3c0cca2f78e9d1e18 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRepresentedOpaque.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalRepresentedValue + +namespace OAI + +namespace PiExponent.ExceptionalAffineChart +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open PiExponentSeshadri.ModuleFlasque PiExponentSeshadri.IdealPullback +private abbrev schemeFreeOpen (Y : Scheme) (U : Y.Opens) : Y.Modules := + freeOpen Y.ringCatSheaf U + +variable {R A : Type} [CommRing R] [CommRing A] {Y : Scheme} +variable (I : Ideal R) (f : Y ⟶ Spec (CommRingCat.of R)) + (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (φ : R →+* A) (hf : j ≫ f = Spec.map (CommRingCat.ofHom φ)) + (L : LineBundle Y) (ι : L.sheaf ⟶ O Y) + (hL : PresentsPullbackIdeal (specIdeal I) f L ι) + (e : L.sheaf.restrict (chartOpen j).1.ι ≅ O (chartOpen j).1.toScheme) + +theorem exists_representedSectionsOpaque (n : ℕ) : + ∃ E : (schemeFreeOpen Y j.opensRange ⟶ (L.pow n).sheaf) ≃+ + ↥((I^n).map φ), E = representedSectionsEquiv I f j φ hf L ι hL e n := + ⟨_, rfl⟩ + +def representedSectionsOpaque (n : ℕ) : + (schemeFreeOpen Y j.opensRange ⟶ (L.pow n).sheaf) ≃+ ↥((I^n).map φ) := + (exists_representedSectionsOpaque I f j φ hf L ι hL e n).choose + +theorem representedSectionsOpaque_eq (n : ℕ) : + representedSectionsOpaque I f j φ hf L ι hL e n = + representedSectionsEquiv I f j φ hf L ι hL e n := + (exists_representedSectionsOpaque I f j φ hf L ι hL e n).choose_spec + +theorem representedSectionsOpaque_apply (n : ℕ) + (b : schemeFreeOpen Y j.opensRange ⟶ (L.pow n).sheaf) : + representedSectionsOpaque I f j φ hf L ι hL e n b = + representedSectionsEquiv I f j φ hf L ι hL e n b := + congrArg (fun E => E b) (representedSectionsOpaque_eq I f j φ hf L ι hL e n) + +end +end PiExponent.ExceptionalAffineChart + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRepresentedTypes.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRepresentedTypes.lean new file mode 100644 index 0000000000000000000000000000000000000000..8fa6adc0c93d8079ab1ab4c7aeb2b560a4e5645c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRepresentedTypes.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalRepresentedOpaque + +namespace OAI + +namespace PiExponent.ExceptionalRepresentedTypes +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open PiExponentSeshadri.ModuleFlasque PiExponentSeshadri.IdealPullback +variable {R A : Type} [CommRing R] [CommRing A] {Y : Scheme} + +def Frame (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (L : LineBundle Y) : Type := + L.sheaf.restrict (ExceptionalAffineChart.chartOpen j).1.ι ≅ + O (ExceptionalAffineChart.chartOpen j).1.toScheme + +def Sections (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (L : LineBundle Y) (n : ℕ) : Type := + freeOpen Y.ringCatSheaf j.opensRange ⟶ (L.pow n).sheaf + +instance (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (L : LineBundle Y) (n : ℕ) : AddCommGroup (Sections j L n) := + Preadditive.homGroup (C := Y.Modules) + (freeOpen Y.ringCatSheaf j.opensRange) (L.pow n).sheaf + +variable (I : Ideal R) (f : Y ⟶ Spec (CommRingCat.of R)) + (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (φ : R →+* A) (hf : j ≫ f = Spec.map (CommRingCat.ofHom φ)) + (L : LineBundle Y) (ι : L.sheaf ⟶ O Y) + (hL : PresentsPullbackIdeal (specIdeal I) f L ι) + (e : Frame j L) + +def representedSectionsTyped (n : ℕ) : Sections j L n ≃+ ↥((I^n).map φ) := + ExceptionalAffineChart.representedSectionsOpaque I f j φ hf L ι hL e n + +theorem representedSectionsTyped_apply (n : ℕ) (b : Sections j L n) : + representedSectionsTyped I f j φ hf L ι hL e n b = + ExceptionalAffineChart.representedSectionsEquiv I f j φ hf L ι hL e n b := + ExceptionalAffineChart.representedSectionsOpaque_apply I f j φ hf L ι hL e n b + +end +end PiExponent.ExceptionalRepresentedTypes + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRepresentedValue.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRepresentedValue.lean new file mode 100644 index 0000000000000000000000000000000000000000..8d9097978f420959947b4e5a91adaa2663a2a463 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalRepresentedValue.lean @@ -0,0 +1,29 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalAffineChartRestriction + +namespace OAI + +namespace PiExponent.ExceptionalAffineChart +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open PiExponentSeshadri.ModuleFlasque PiExponentSeshadri.IdealPullback +variable {R A : Type} [CommRing R] [CommRing A] {Y : Scheme} +variable (I : Ideal R) (f : Y ⟶ Spec (CommRingCat.of R)) + (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (φ : R →+* A) (hf : j ≫ f = Spec.map (CommRingCat.ofHom φ)) + (L : LineBundle Y) (ι : L.sheaf ⟶ O Y) + (hL : PresentsPullbackIdeal (specIdeal I) f L ι) + (e : L.sheaf.restrict (chartOpen j).1.ι ≅ O (chartOpen j).1.toScheme) + +theorem representedSectionsEquiv_apply (n : ℕ) + (b : freeOpen Y.ringCatSheaf j.opensRange ⟶ (L.pow n).sheaf) : + (representedSectionsEquiv I f j φ hf L ι hL e n b).val = + functionsOnOpenEquiv j + ((idealPowerInclusion L ι n).app j.opensRange + (freeOpenEquiv Y.ringCatSheaf (L.pow n).sheaf j.opensRange b)) := by + exact sectionsOnOpenEquiv_apply I f j φ hf L ι hL e n _ + +end +end PiExponent.ExceptionalAffineChart + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalTypedRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalTypedRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..cadc6b82543aa2faff8b779c6bd7eda778a46de0 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalTypedRestriction.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalRepresentedTypes + +namespace OAI + +namespace PiExponent.ExceptionalRepresentedTypes +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open PiExponentSeshadri.ModuleFlasque PiExponentSeshadri.IdealPullback +variable {R A B : Type} [CommRing R] [CommRing A] [CommRing B] {Y : Scheme} +variable (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (j' : Spec (CommRingCat.of B) ⟶ Y) [IsOpenImmersion j'] + (θ : A →+* B) (h : Spec.map (CommRingCat.ofHom θ) ≫ j = j') + +def restrictSections (L : LineBundle Y) (n : ℕ) : + Sections j L n →+ Sections j' L n where + toFun b := freeOpenMap Y.ringCatSheaf + (homOfLE (ExceptionalAffineChart.opensRange_le j j' θ h)) ≫ b + map_zero' := Limits.HasZeroMorphisms.comp_zero (C := Y.Modules) _ _ + map_add' b c := Preadditive.comp_add _ _ _ _ b c + +theorem restrictSections_apply (L : LineBundle Y) (n : ℕ) (b : Sections j L n) : + restrictSections j j' θ h L n b = + freeOpenMap Y.ringCatSheaf + (homOfLE (ExceptionalAffineChart.opensRange_le j j' θ h)) ≫ b := rfl + +variable (I : Ideal R) (f : Y ⟶ Spec (CommRingCat.of R)) + (φ : R →+* A) (hf : j ≫ f = Spec.map (CommRingCat.ofHom φ)) + (L : LineBundle Y) (ι : L.sheaf ⟶ O Y) + (hL : PresentsPullbackIdeal (specIdeal I) f L ι) + (e : Frame j L) + (φ' : R →+* B) (hf' : j' ≫ f = Spec.map (CommRingCat.ofHom φ')) + (e' : Frame j' L) + +theorem representedSectionsTyped_restrict (n : ℕ) (b : Sections j L n) : + (representedSectionsTyped I f j' φ' hf' L ι hL e' n + (restrictSections j j' θ h L n b)).val = + θ (representedSectionsTyped I f j φ hf L ι hL e n b).val := by + rw [representedSectionsTyped_apply, representedSectionsTyped_apply] + exact ExceptionalAffineChart.representedSectionsEquiv_restrict + I f j φ hf L ι hL e j' θ h φ' hf' e' n b + +end +end PiExponent.ExceptionalRepresentedTypes + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalTypedTransport.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalTypedTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..27dcf49ec1c3a5378323383b76dbc648c828fc26 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalTypedTransport.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalRepresentedTypes + +namespace OAI + +namespace PiExponent.ExceptionalRepresentedTypes +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open PiExponentSeshadri.ModuleFlasque +private abbrev schemeFreeOpen (Y : Scheme) (U : Y.Opens) : Y.Modules := + freeOpen Y.ringCatSheaf U + +variable {A : Type} [CommRing A] {Y : Scheme} +variable (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (L : LineBundle Y) + +theorem frame_nonempty_of_open {U : Y.Opens} (h : U = j.opensRange) + (he : Nonempty (L.sheaf.restrict U.ι ≅ O U.toScheme)) : + Nonempty (Frame j L) := by + subst U + exact he + +def transportSections (n : ℕ) {V : Y.Opens} (h : j.opensRange = V) : + (schemeFreeOpen Y V ⟶ (L.pow n).sheaf) ≃+ Sections j L n where + toFun b := freeOpenMap Y.ringCatSheaf (eqToHom h) ≫ b + invFun b := freeOpenMap Y.ringCatSheaf (eqToHom h.symm) ≫ b + left_inv b := by + subst V + simp [freeOpenMap] + exact (Category.id_comp _).trans (Category.id_comp b) + right_inv b := by + subst V + simp [freeOpenMap] + exact (Category.id_comp _).trans (Category.id_comp b) + map_add' b c := Preadditive.comp_add _ _ _ _ b c + +theorem transportSections_apply (n : ℕ) {V : Y.Opens} (h : j.opensRange = V) + (b : schemeFreeOpen Y V ⟶ (L.pow n).sheaf) : + transportSections j L n h b = freeOpenMap Y.ringCatSheaf (eqToHom h) ≫ b := rfl + +end +end PiExponent.ExceptionalRepresentedTypes + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalTypedTransportNaturality.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalTypedTransportNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..093327687002118fca978fee75ad75fe5281214c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ExceptionalTypedTransportNaturality.lean @@ -0,0 +1,31 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalTypedRestriction +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalTypedTransport + +namespace OAI + +namespace PiExponent.ExceptionalRepresentedTypes +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.Geometry PiExponentSeshadri.ModuleFlasque +variable {A B : Type} [CommRing A] [CommRing B] {Y : Scheme} +variable (j : Spec (CommRingCat.of A) ⟶ Y) [IsOpenImmersion j] + (j' : Spec (CommRingCat.of B) ⟶ Y) [IsOpenImmersion j'] + (θ : A →+* B) (hchart : Spec.map (CommRingCat.ofHom θ) ≫ j = j') + +theorem transportSections_restrict (L : LineBundle Y) (n : ℕ) + {U V : Y.Opens} (hU : j.opensRange = U) (hV : j'.opensRange = V) + (hVU : V ≤ U) (b : freeOpen Y.ringCatSheaf U ⟶ (L.pow n).sheaf) : + transportSections j' L n hV (freeOpenMap Y.ringCatSheaf (homOfLE hVU) ≫ b) = + restrictSections j j' θ hchart L n (transportSections j L n hU b) := by + subst U V + simp [transportSections, restrictSections, freeOpenMap] + change (𝟙 _ ≫ (freeOpenMap Y.ringCatSheaf (homOfLE hVU) ≫ b)) = + freeOpenMap Y.ringCatSheaf (homOfLE hVU) ≫ (𝟙 _ ≫ b) + exact (Category.id_comp _).trans + (congrArg (fun c => freeOpenMap Y.ringCatSheaf (homOfLE hVU) ≫ c) + (Category.id_comp b).symm) + +end +end PiExponent.ExceptionalRepresentedTypes + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/FiniteAffineFrames.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/FiniteAffineFrames.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ee7e79dd6b15672a2e92fed339bb5ea7a1a1e0c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/FiniteAffineFrames.lean @@ -0,0 +1,31 @@ +import OAI.NumberTheory.PiExponent.Geometry.LineBundleProduct + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +variable {X : Scheme.{0}} + +theorem LineBundle.finite_affine_frame_cover [CompactSpace X] (L : LineBundle X) : + ∃ k : ℕ, ∃ U : Fin k → X.affineOpens, + (⨆ i, (U i).1) = ⊤ ∧ + ∀ i, Nonempty (L.sheaf.restrict (U i).1.ι ≅ structureSheaf (U i).1.toScheme) := by + classical + have hex (x : X) := common_affine_frames L L x + choose V hx he _ using hex + obtain ⟨s, hs⟩ := isCompact_univ.elim_finite_subcover + (fun x => ((V x).1 : Set X)) (fun x => (V x).1.isOpen) + (by intro x _; exact Set.mem_iUnion.mpr ⟨x, hx x⟩) + let e := (Fintype.equivFin s).symm + refine ⟨Fintype.card s, fun i => V (e i).val, ?_, fun i => he (e i).val⟩ + apply top_unique + intro x _ + obtain ⟨i, hi⟩ := Set.mem_iUnion.mp (hs (show x ∈ Set.univ from trivial)) + obtain ⟨hi, hx⟩ := Set.mem_iUnion.mp hi + exact Opens.mem_iSup.mpr ⟨e.symm ⟨i, hi⟩, by simpa using hx⟩ + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/FinitePullbackAmple.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/FinitePullbackAmple.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8a33369ebc4f134f77572e5538ef2d6285594bc --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/FinitePullbackAmple.lean @@ -0,0 +1,43 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleCommonDegree +import OAI.NumberTheory.PiExponent.Ampleness.AmpleFromCover +import OAI.NumberTheory.PiExponent.Ampleness.ClosedAmpleRestriction + +namespace OAI + +noncomputable section +namespace PiExponentSeshadri.Geometry +open AlgebraicGeometry CategoryTheory TopologicalSpace +variable {X Y : Scheme.{0}} + +theorem LineBundle.IsAmple.of_pow (L : LineBundle X) {d : ℕ} (hd : 0 < d) + (hL : (L.pow d).IsAmple) : L.IsAmple := by + intro x V hx + obtain ⟨n, hn, s, hxs, hsV, hsa⟩ := hL x V hx + have he := PiExponent.AmpleIso.sectionOpen_postcomp_iso s (linePowerMul L d n) + exact ⟨d*n, Nat.mul_pos hd hn, s ≫ (linePowerMul L d n).hom, + he.symm ▸ hxs, he.le.trans hsV, he.symm ▸ hsa⟩ + +theorem LineBundle.IsAmple.pullback_finite [CompactSpace X] [IsIntegral Y] [CompactSpace Y] + (L : LineBundle X) (hL : L.IsAmple) (f : Y ⟶ X) [IsFinite f] : + (L.pullback f).IsAmple := by + obtain ⟨d, hd, l, s, hc, ha, _⟩ := L.ample_common_degree_cover hL + let t (i : Fin l) := pullbackPowerSection L f d (s i) + have ht (i : Fin l) : sectionOpen Y (t i) = f ⁻¹ᵁ sectionOpen X (s i) := + sectionOpen_pullbackPowerSection L f d (s i) + have htc : (⨆ i, sectionOpen Y (t i)) = ⊤ := by + apply top_le_iff.mp + intro y _ + have hy : f y ∈ ⨆ i, sectionOpen X (s i) := by rw [hc]; trivial + obtain ⟨i, hi⟩ := Opens.mem_iSup.mp hy + exact Opens.mem_iSup.mpr ⟨i, by rw [ht]; exact hi⟩ + have hta (i : Fin l) : IsAffineOpen (sectionOpen Y (t i)) := by + rw [ht] + exact (ha i).preimage f + exact LineBundle.IsAmple.of_pow (L.pullback f) hd + (((L.pullback f).pow d).ample_of_affine_section_cover t htc hta) + +end PiExponentSeshadri.Geometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/FiniteReesComparison.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/FiniteReesComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd852615f31bc1a254ccd0e3c0d5f1d7b6f49d23 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/FiniteReesComparison.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalRecoveryTwist +import OAI.NumberTheory.PiExponent.Ampleness.FiniteAffineFrames +import OAI.NumberTheory.PiExponent.Approximation.PushforwardSectionComparison + +namespace OAI + +namespace PiExponent.GeometrySupport.ExceptionalRecoveryMap +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.IdealModule PiExponentSeshadri.Frames +open PiExponentSeshadri.ModuleFlasque +open CechHigher +variable {X Y : Scheme.{0}} (f : Y ⟶ X) [QuasiCompact f] + (I : X.IdealSheafData) (E : LineBundle Y) + (ι : E.sheaf ⟶ structureSheaf Y) (hE : PresentsPullbackIdeal I f E ι) + +private theorem intersection_one {J : Type} (U : J → X.Opens) (t : Fin 1 → J) : + intersection U t = U (t 0) := by + apply le_antisymm (iInf_le _ 0) + apply le_iInf + intro i + exact le_of_eq (congrArg (fun j => U (t j)) (Subsingleton.elim 0 i)) + +private theorem intersection_two {J : Type} (U : J → X.Opens) (t : Fin 2 → J) : + intersection U t = U (t 0) ⊓ U (t 1) := by + apply le_antisymm (le_inf (iInf_le _ 0) (iInf_le _ 1)) + apply le_iInf + intro i + fin_cases i + · exact inf_le_left + · exact inf_le_right + +theorem eventual_comparison_of_affine_recovery [CompactSpace X] [X.IsSeparated] + (A : LineBundle X) + (hrecover : ∀ U : X.affineOpens, ∃ N, ∀ n, N ≤ n → + Function.Bijective ((ordinaryMap f I E ι hE n).app U.1)) : + ∃ k : ℕ, ∃ U : Fin k → X.affineOpens, (⨆ i, (U i).1) = ⊤ ∧ + ∃ N, ∀ n, N ≤ n → Nonempty + (CechH1Transfer.SectionComparison (fun i => (U i).1) + (fun i => f ⁻¹ᵁ (U i).1) + ((moduleTwistFunctor A n).obj (closedModule (I^n))) + ((E.tensor (A.pullback f)).pow n).sheaf) := by + classical + obtain ⟨k,U,hcover,hframe⟩ := A.finite_affine_frame_cover + let V : Fin k → X.Opens := fun i => (U i).1 + have ha1 (t : Fin 1 → Fin k) : IsAffineOpen (intersection V t) := + (intersection_one V t).symm ▸ (U (t 0)).2 + have ha2 (t : Fin 2 → Fin k) : IsAffineOpen (intersection V t) := + (intersection_two V t).symm ▸ (U (t 0)).2.inf (U (t 1)).2 + choose Nv hv using fun t : Fin 1 → Fin k => hrecover ⟨intersection V t, ha1 t⟩ + choose Np hp using fun t : Fin 2 → Fin k => hrecover ⟨intersection V t, ha2 t⟩ + let Bv := Finset.univ.sup Nv + let Bp := Finset.univ.sup Np + refine ⟨k,U,hcover,Bv ⊔ Bp,?_⟩ + intro n hn + let β := twistedMap f I E ι hE A n + have hvn (t : Fin 1 → Fin k) : Function.Bijective (β.app (intersection V t)) := by + exact twistedMap_app_bijective f I E ι hE A n (intersection V t) + (restrictOpenFrame (iInf_le _ 0) (Classical.choice (hframe (t 0)))) + (hv t n ((Finset.le_sup (Finset.mem_univ t)).trans (le_sup_left.trans hn))) + have hpn (t : Fin 2 → Fin k) : Function.Injective (β.app (intersection V t)) := by + exact (twistedMap_app_bijective f I E ι hE A n (intersection V t) + (restrictOpenFrame (iInf_le _ 0) (Classical.choice (hframe (t 0)))) + (hp t n ((Finset.le_sup (Finset.mem_univ t)).trans (le_sup_right.trans hn)))).injective + exact ⟨PushforwardOpenSections.comparison f β V hvn hpn⟩ + +end +end PiExponent.GeometrySupport.ExceptionalRecoveryMap + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupAffineSquare.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupAffineSquare.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb8e3a854a88c78ae7cec4467eca5209a01bbd49 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupAffineSquare.lean @@ -0,0 +1,52 @@ +import OAI.NumberTheory.PiExponent.Ampleness.GlobalExceptionalComparison + +namespace OAI + +namespace PiExponentSeshadri.BlowupGluing +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +variable {X : Scheme.{0}} (I : X.IdealSheafData) (U : X.affineOpens) + +def baseChart : Spec (CommRingCat.of Γ(U.1.toScheme, ⊤)) ⟶ X := + U.1.toScheme.isoSpec.inv ≫ U.1.ι + +def totalChart : ReesGrading.affineBlowup (affineCenterIdeal I U) ⟶ scheme I := + (affineRestrictionIso I U).inv ≫ ((projection I) ⁻¹ᵁ U.1).ι + +instance baseChart_isOpenImmersion : IsOpenImmersion (baseChart (X := X) U) := by + dsimp [baseChart] + infer_instance + +instance totalChart_isOpenImmersion : IsOpenImmersion (totalChart I U) := by + dsimp [totalChart] + infer_instance + +@[reassoc (attr := simp)] theorem totalChart_projection : + totalChart I U ≫ projection I = + ReesGrading.projection (affineCenterIdeal I U) ≫ baseChart U := by + have he : (affineRestrictionIso I U).inv ≫ ((projection I) ∣_ U.1) = + ReesGrading.projection (affineCenterIdeal I U) ≫ U.1.toScheme.isoSpec.inv := by + apply (cancel_mono U.1.toScheme.isoSpec.hom).mp + rw [Category.assoc, Category.assoc, Iso.inv_hom_id, Category.comp_id, + ← affineRestrictionIso_hom_reesProjection I U, Iso.inv_hom_id_assoc] + rw [totalChart, Category.assoc, ← morphismRestrict_ι, ← Category.assoc, he, + Category.assoc] + rfl + +@[simp] theorem baseChart_opensRange : (baseChart (X := X) U).opensRange = U.1 := by + change (U.1.toScheme.isoSpec.inv ≫ U.1.ι).opensRange = U.1 + rw [Scheme.Hom.opensRange_comp_of_isIso, Scheme.Opens.opensRange_ι] + +@[simp] theorem totalChart_opensRange : + (totalChart I U).opensRange = projection I ⁻¹ᵁ U.1 := by + change ((affineRestrictionIso I U).inv ≫ ((projection I) ⁻¹ᵁ U.1).ι).opensRange = _ + rw [Scheme.Hom.opensRange_comp_of_isIso, Scheme.Opens.opensRange_ι] + +@[simp] theorem center_comap_baseChart : + I.comap (baseChart U) = IdealPullback.specIdeal (affineCenterIdeal I U) := by + rw [baseChart, Scheme.IdealSheafData.comap_comp, IdealPullback.comap_isoSpec_inv] + +end +end PiExponentSeshadri.BlowupGluing + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupGluing.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupGluing.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3b53fc1a1ae614b7e55bd8552119a9fbe26f89e --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupGluing.lean @@ -0,0 +1,241 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AffineBlowupUniversal +import OAI.NumberTheory.PiExponent.Ampleness.BlowupUniversalBaseChange + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.Geometry +open CategoryTheory AlgebraicGeometry + +theorem rees_isBlowup {R : Type} [CommRing R] (I : Ideal R) : + IsBlowup (IdealPullback.specIdeal I) (ReesGrading.projection I) := + ⟨ReesGrading.exceptional_invertible I, fun _ f hf => + ReesGrading.affineBlowup_universal I f hf⟩ + +end PiExponentSeshadri.Geometry + +namespace PiExponentSeshadri.IdealPullback +open CategoryTheory AlgebraicGeometry +variable {X : Scheme.{0}} [IsAffine X] + +lemma specIdeal_comap_toSpec (I : X.IdealSheafData) : + (specIdeal (I.ideal ⟨⊤, isAffineOpen_top X⟩)).comap X.toSpecΓ = I := by + apply Scheme.IdealSheafData.ext_of_isAffine + rw [comap_top, specIdeal_top, Scheme.toSpecΓ_appTop, Ideal.map_map] + change Ideal.map ((Scheme.ΓSpecIso Γ(X, ⊤)).hom.hom.comp + (Scheme.ΓSpecIso Γ(X, ⊤)).inv.hom) _ = _ + simp only [← CommRingCat.hom_comp, Iso.inv_hom_id, CommRingCat.hom_id, Ideal.map_id] + +lemma comap_isoSpec_inv (I : X.IdealSheafData) : + I.comap X.isoSpec.inv = specIdeal (I.ideal ⟨⊤, isAffineOpen_top X⟩) := by + conv_lhs => rw [← specIdeal_comap_toSpec I] + rw [← Scheme.IdealSheafData.comap_comp] + change (specIdeal _).comap (X.isoSpec.inv ≫ X.isoSpec.hom) = _ + rw [Iso.inv_hom_id, Scheme.IdealSheafData.comap_id] + +end PiExponentSeshadri.IdealPullback + +namespace PiExponentSeshadri.AffineBlowup +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} [IsAffine X] (I : X.IdealSheafData) + +abbrev scheme : Scheme := ReesGrading.affineBlowup (I.ideal ⟨⊤, isAffineOpen_top X⟩) + +def projection : scheme I ⟶ X := + ReesGrading.projection (I.ideal ⟨⊤, isAffineOpen_top X⟩) ≫ X.isoSpec.inv + +theorem isBlowup : IsBlowup I (projection I) := + (rees_isBlowup (I.ideal ⟨⊤, isAffineOpen_top X⟩)).postIso X.isoSpec.symm I + (IdealPullback.comap_isoSpec_inv I) + +end PiExponentSeshadri.AffineBlowup + +namespace PiExponentSeshadri.BlowupGluing + +section +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} (I : X.IdealSheafData) + +abbrev baseCover (_I : X.IdealSheafData) : X.OpenCover := Scheme.AffineZariskiSite.directedCover X + +local instance localAffine (U : X.AffineZariskiSite) : IsAffine U.toOpens.toScheme := U.2 + +abbrev localCentre (U : X.AffineZariskiSite) : U.toOpens.toScheme.IdealSheafData := I.comap U.toOpens.ι + +abbrev localScheme (U : X.AffineZariskiSite) : Scheme := + AffineBlowup.scheme (localCentre I U) + +abbrev localProjection (U : X.AffineZariskiSite) : localScheme I U ⟶ U.toOpens.toScheme := + AffineBlowup.projection (localCentre I U) + +lemma local_isBlowup (U : X.AffineZariskiSite) : + IsBlowup (localCentre I U) (localProjection I U) := + AffineBlowup.isBlowup (localCentre I U) + +lemma centre_transition {U V : X.AffineZariskiSite} (h : U ⟶ V) : + (localCentre I V).comap ((baseCover I).trans h) = localCentre I U := by + rw [localCentre, ← Scheme.IdealSheafData.comap_comp] + change I.comap ((baseCover I).trans h ≫ (baseCover I).f V) = _ + rw [Scheme.Cover.trans_map] + +lemma local_invertible {U V : X.AffineZariskiSite} (h : U ⟶ V) : + InvertiblePullbackIdeal (localCentre I V) + (localProjection I U ≫ (baseCover I).trans h) := by + apply (InvertibleLocal.invertible_congr (I' := localCentre I U) + (f' := localProjection I U) ?_).mpr (local_isBlowup I U).1 + rw [Scheme.IdealSheafData.comap_comp, centre_transition] + +def transition {U V : X.AffineZariskiSite} (h : U ⟶ V) : + localScheme I U ⟶ localScheme I V := + ((local_isBlowup I V).2 _ _ (local_invertible I h)).choose + +@[reassoc (attr := simp)] +lemma transition_projection {U V : X.AffineZariskiSite} (h : U ⟶ V) : + transition I h ≫ localProjection I V = localProjection I U ≫ (baseCover I).trans h := + ((local_isBlowup I V).2 _ _ (local_invertible I h)).choose_spec.1 + +lemma transition_id (U : X.AffineZariskiSite) : transition I (𝟙 U) = 𝟙 (localScheme I U) := by + apply (local_isBlowup I U).hom_ext (localProjection I U) (local_isBlowup I U).1 + · rw [transition_projection, Scheme.Cover.trans_id (baseCover I) U, Category.comp_id] + · simp + +lemma transition_comp {U V W : X.AffineZariskiSite} (h : U ⟶ V) (k : V ⟶ W) : + transition I (h ≫ k) = transition I h ≫ transition I k := by + apply (local_isBlowup I W).hom_ext _ (local_invertible I (h ≫ k)) + · exact transition_projection I (h ≫ k) + · rw [Category.assoc, transition_projection, ← Category.assoc, transition_projection, + Category.assoc, Scheme.Cover.trans_comp (baseCover I) h k] + +def diagram : X.AffineZariskiSite ⥤ Scheme where + obj := localScheme I + map := transition I + map_id := transition_id I + map_comp := transition_comp I + +def diagramMap : diagram I ⟶ (baseCover I).functorOfLocallyDirected where + app := localProjection I + naturality _ _ h := transition_projection I h + +lemma diagramMap_equifibered : (diagramMap I).Equifibered := by + intro U V h + apply IsPullback.flip + change IsPullback (localProjection I U) (transition I h) + ((baseCover I).trans h) (localProjection I V) + apply (local_isBlowup I V).baseChangeSquare ((baseCover I).trans h) + (localProjection I U) + · rw [centre_transition] + exact local_isBlowup I U + · exact transition_projection I h + +def gluing : (baseCover I).RelativeGluingData where + functor := diagram I + natTrans := diagramMap I + equifibered := diagramMap_equifibered I + +abbrev scheme : Scheme := (gluing I).glued +abbrev projection : scheme I ⟶ X := (gluing I).toBase +abbrev cover : (scheme I).OpenCover := (gluing I).cover + +@[reassoc (attr := simp)] +lemma cover_projection (U : X.AffineZariskiSite) : + (cover I).f U ≫ projection I = localProjection I U ≫ U.toOpens.ι := + (gluing I).ι_toBase U + +lemma local_pullback (U : X.AffineZariskiSite) : + IsPullback (localProjection I U) ((cover I).f U) U.toOpens.ι (projection I) := + (gluing I).isPullback_natTrans_ι_toBase U + +end + +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} (I : X.IdealSheafData) + +lemma projection_invertible : InvertiblePullbackIdeal I (projection I) := by + apply InvertibleLocal.invertible_of_cover I (projection I) (cover I) + intro U + erw [cover_projection] + apply (InvertibleLocal.invertible_congr + (Scheme.IdealSheafData.comap_comp I (localProjection I U) U.toOpens.ι)).mpr + exact (local_isBlowup I U).1 + +lemma test_invertible {Y : Scheme.{0}} (f : Y ⟶ X) + (hf : InvertiblePullbackIdeal I f) (U : X.AffineZariskiSite) : + InvertiblePullbackIdeal (localCentre I U) (pullback.snd f U.toOpens.ι) := by + apply (InvertibleLocal.invertible_congr (I' := I) + (f' := pullback.fst f U.toOpens.ι ≫ f) ?_).mpr + · exact InvertibleLocal.invertible_restrict_general I f hf (pullback.fst f U.toOpens.ι) + · change ((I.comap U.toOpens.ι).comap (pullback.snd f U.toOpens.ι)) = _ + rw [← Scheme.IdealSheafData.comap_comp, pullback.condition] + +lemma hom_ext {Y : Scheme.{0}} (f : Y ⟶ X) (hf : InvertiblePullbackIdeal I f) + (g h : Y ⟶ scheme I) (hg : g ≫ projection I = f) (hh : h ≫ projection I = f) : g = h := by + let C : Y.OpenCover := (baseCover I).pullback₁ f + apply C.hom_ext + intro U + let s := pullback.snd f U.toOpens.ι + let t := pullback.fst f U.toOpens.ι + have eg : s ≫ U.toOpens.ι = (t ≫ g) ≫ projection I := by + rw [Category.assoc, hg] + exact (pullback.condition (f := f) (g := U.toOpens.ι)).symm + have eh : s ≫ U.toOpens.ι = (t ≫ h) ≫ projection I := by + rw [Category.assoc, hh] + exact (pullback.condition (f := f) (g := U.toOpens.ι)).symm + let g' := (local_pullback I U).lift s (t ≫ g) eg + let h' := (local_pullback I U).lift s (t ≫ h) eh + have he : g' = h' := (local_isBlowup I U).hom_ext s (test_invertible I f hf U) + ((local_pullback I U).lift_fst _ _ _) ((local_pullback I U).lift_fst _ _ _) + have he' := congrArg (fun k : C.X U ⟶ localScheme I U => k ≫ (cover I).f U) he + change t ≫ g = t ≫ h + exact ((local_pullback I U).lift_snd s (t ≫ g) eg).symm.trans + (he'.trans ((local_pullback I U).lift_snd s (t ≫ h) eh)) + +theorem universal {Y : Scheme.{0}} (f : Y ⟶ X) (hf : InvertiblePullbackIdeal I f) : + ∃! h : Y ⟶ scheme I, h ≫ projection I = f := by + classical + let C : Y.OpenCover := (baseCover I).pullback₁ f + let l (U : X.AffineZariskiSite) : C.X U ⟶ localScheme I U := + ((local_isBlowup I U).2 _ _ (test_invertible I f hf U)).choose + have hl (U : X.AffineZariskiSite) : l U ≫ localProjection I U = pullback.snd f U.toOpens.ι := + ((local_isBlowup I U).2 _ _ (test_invertible I f hf U)).choose_spec.1 + let g (U : C.I₀) : C.X U ⟶ scheme I := l U ≫ (cover I).f U + have hg (U : C.I₀) : g U ≫ projection I = C.f U ≫ f := by + dsimp only [g] + exact (Category.assoc (l U) ((cover I).f U) (projection I)).trans + ((congrArg (fun q : localScheme I U ⟶ X => l U ≫ q) + (cover_projection I U)).trans + ((Category.assoc (l U) (localProjection I U) U.toOpens.ι).symm.trans + ((congrArg (fun q : C.X U ⟶ U.toOpens.toScheme => q ≫ U.toOpens.ι) + (hl U)).trans (pullback.condition (f := f) (g := U.toOpens.ι)).symm))) + have hcompat (U V : C.I₀) : pullback.fst (C.f U) (C.f V) ≫ g U = + pullback.snd (C.f U) (C.f V) ≫ g V := by + let j := pullback.fst (C.f U) (C.f V) ≫ C.f U + apply hom_ext I (j ≫ f) + · exact InvertibleLocal.invertible_restrict_general I f hf j + · rw [Category.assoc, hg] + rfl + · rw [Category.assoc, hg] + exact (pullback.condition_assoc f).symm + refine ⟨C.glueMorphisms g hcompat, ?_, ?_⟩ + · apply C.hom_ext + intro U + rw [← Category.assoc, Scheme.Cover.ι_glueMorphisms C] + exact hg U + · intro h hh + apply hom_ext I f hf h _ hh + apply C.hom_ext + intro U + rw [← Category.assoc, Scheme.Cover.ι_glueMorphisms C] + exact hg U + +theorem isBlowup : IsBlowup I (projection I) := + ⟨projection_invertible I, fun _ f hf => universal I f hf⟩ + +end PiExponentSeshadri.BlowupGluing + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupJetSurjectivity.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupJetSurjectivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..287d750d3cd0e3b7383baf5a68a5134a4ae5161e --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupJetSurjectivity.lean @@ -0,0 +1,42 @@ +import OAI.NumberTheory.PiExponent.Ampleness.BlowupJetSurjectivity +import OAI.NumberTheory.PiExponent.Ampleness.BlowupProperIntegral +import OAI.NumberTheory.PiExponent.Geometry.LineBundleProduct + +namespace OAI + +namespace PiExponent.BlowupJetSurjectivity +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry +open PiExponent.GeometrySupport +variable {X : Scheme.{0}} {R : Type} [CommRing R] [IsNoetherianRing R] + +def blowupBundle (I : X.IdealSheafData) (A : LineBundle X) : + LineBundle (PiExponentSeshadri.BlowupGluing.scheme I) := + (PiExponentSeshadri.BlowupGluing.exceptionalLineBundle I).tensor + (A.pullback (PiExponentSeshadri.BlowupGluing.projection I)) + +theorem eventual_blowup_jetRestriction_surjective_of_section_comparison + (p : X ⟶ Spec (CommRingCat.of R)) [IsProper p] + (I : X.IdealSheafData) (A : LineBundle X) + (hample : LineBundle.IsAmple _ (blowupBundle I A)) + {J : Type} (U : J → X.Opens) (hU : ∀ i, IsAffineOpen (U i)) + (hcover : (⨆ i, U i) = ⊤) + (hcomparison : ∃ N, ∀ n, N ≤ n → Nonempty + (CechH1Transfer.SectionComparison U + (fun i => PiExponentSeshadri.BlowupGluing.projection I ⁻¹ᵁ U i) + (twistedIdeal I A n) + (modulePow (PiExponentSeshadri.BlowupGluing.scheme I) (blowupBundle I A).sheaf n))) : + ∃ N, ∀ n, N ≤ n → Function.Surjective (jetRestriction I A n) := by + let : IsLocallyNoetherian X := LocallyOfFiniteType.isLocallyNoetherian p + let : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace p + let : IsNoetherian X := {} + exact eventual_jetRestriction_surjective_of_ample_comparison + (PiExponentSeshadri.BlowupGluing.projection I) + (PiExponentSeshadri.BlowupGluing.projection I ≫ p) I A (blowupBundle I A) + hample U hU hcover hcomparison + +end +end PiExponent.BlowupJetSurjectivity + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..e6782b427aa273a708ae78d29d1ba0394b9dc89a --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalBlowupRestriction.lean @@ -0,0 +1,43 @@ +import OAI.NumberTheory.PiExponent.Ampleness.GlobalBlowupGluing + +namespace OAI + +noncomputable section +namespace PiExponentSeshadri.BlowupGluing +open CategoryTheory AlgebraicGeometry PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} (I : X.IdealSheafData) + +def exceptionalLineBundle : LineBundle (scheme I) := (projection_invertible I).choose + +def exceptionalInclusion : (exceptionalLineBundle I).sheaf ⟶ structureSheaf (scheme I) := + (projection_invertible I).choose_spec.choose + +theorem exceptional_presents : + PresentsPullbackIdeal I (projection I) (exceptionalLineBundle I) (exceptionalInclusion I) := + (projection_invertible I).choose_spec.choose_spec + +def restrictionIso (U : X.Opens) : + ((projection I) ⁻¹ᵁ U).toScheme ≅ scheme (I.comap U.ι) := + ((isBlowup I).morphismRestrict U).iso (isBlowup (I.comap U.ι)) + +@[reassoc (attr := simp)] +theorem restrictionIso_hom_projection (U : X.Opens) : + (restrictionIso I U).hom ≫ projection (I.comap U.ι) = (projection I) ∣_ U := + ((isBlowup I).morphismRestrict U).iso_hom_comp (isBlowup (I.comap U.ι)) + +def affineRestrictionIso (U : X.affineOpens) : + ((projection I) ⁻¹ᵁ U.1).toScheme ≅ AffineBlowup.scheme (I.comap U.1.ι) := + ((isBlowup I).morphismRestrict U.1).iso (AffineBlowup.isBlowup (I.comap U.1.ι)) + +@[reassoc (attr := simp)] +theorem affineRestrictionIso_hom_projection (U : X.affineOpens) : + (affineRestrictionIso I U).hom ≫ AffineBlowup.projection (I.comap U.1.ι) = + (projection I) ∣_ U.1 := + ((isBlowup I).morphismRestrict U.1).iso_hom_comp + (AffineBlowup.isBlowup (I.comap U.1.ι)) + +end PiExponentSeshadri.BlowupGluing + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalExceptionalComparison.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalExceptionalComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..d91ef9b6d214d35de468febddef86c161ee4aea9 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalExceptionalComparison.lean @@ -0,0 +1,97 @@ +import OAI.NumberTheory.PiExponent.Ampleness.BlowupPresentationRestriction +import OAI.NumberTheory.PiExponent.Approximation.TensorPowerRestriction +import OAI.NumberTheory.PiExponent.LocalAlgebra.PresentedIdealIso + +namespace OAI + +noncomputable section +namespace PiExponentSeshadri.BlowupGluing +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} (I : X.IdealSheafData) (U : X.affineOpens) + +abbrev affineCenterIdeal := + (I.comap U.1.ι).ideal ⟨⊤, isAffineOpen_top U.1.toScheme⟩ + +@[reassoc (attr := simp)] theorem affineRestrictionIso_hom_reesProjection : + (affineRestrictionIso I U).hom ≫ ReesGrading.projection (affineCenterIdeal I U) = + ((projection I) ∣_ U.1) ≫ U.1.toScheme.isoSpec.hom := by + have h := congrArg (fun f => f ≫ U.1.toScheme.isoSpec.hom) + (affineRestrictionIso_hom_projection I U) + simpa only [AffineBlowup.projection, Category.assoc, Iso.inv_hom_id, + Category.comp_id] using h + +def restrictedExceptionalLineBundle := + (exceptionalLineBundle I).restrict ((projection I) ⁻¹ᵁ U.1).ι + +def restrictedExceptionalInclusion : + (restrictedExceptionalLineBundle I U).sheaf ⟶ + structureSheaf (((projection I) ⁻¹ᵁ U.1).toScheme) := + InvertibleLocal.restrictedInclusion (exceptionalLineBundle I) + (exceptionalInclusion I) ((projection I) ⁻¹ᵁ U.1).ι + +def affineExceptionalOnRestriction := + InvertibleLocal.restrictLineBundle + (ReesGrading.exceptionalLineBundle (affineCenterIdeal I U)) + (affineRestrictionIso I U).hom + +def affineExceptionalInclusionOnRestriction : + (affineExceptionalOnRestriction I U).sheaf ⟶ + structureSheaf (((projection I) ⁻¹ᵁ U.1).toScheme) := + InvertibleLocal.restrictedInclusion + (ReesGrading.exceptionalLineBundle (affineCenterIdeal I U)) + (ReesGrading.exceptionalInclusion (affineCenterIdeal I U)) + (affineRestrictionIso I U).hom + +theorem restrictedExceptional_presents : + PresentsPullbackIdeal (IdealPullback.specIdeal (affineCenterIdeal I U)) + (((projection I) ∣_ U.1) ≫ U.1.toScheme.isoSpec.hom) + (restrictedExceptionalLineBundle I U) (restrictedExceptionalInclusion I U) := + presents_post_toSpec _ _ + (presents_morphismRestrict _ _ (exceptional_presents I) U) + +theorem affineExceptionalOnRestriction_presents : + PresentsPullbackIdeal (IdealPullback.specIdeal (affineCenterIdeal I U)) + (((projection I) ∣_ U.1) ≫ U.1.toScheme.isoSpec.hom) + (affineExceptionalOnRestriction I U) (affineExceptionalInclusionOnRestriction I U) := by + have h := InvertibleLocal.presents_restrict_general _ _ _ _ + (ReesGrading.exceptional_presents (affineCenterIdeal I U)) + (affineRestrictionIso I U).hom + rw [affineRestrictionIso_hom_reesProjection] at h + exact h + +def exceptionalAffineIso : + (restrictedExceptionalLineBundle I U).sheaf ≅ + (affineExceptionalOnRestriction I U).sheaf := + PiExponent.PresentedIdealIso.iso _ _ _ _ _ _ + (restrictedExceptional_presents I U) (affineExceptionalOnRestriction_presents I U) + +@[reassoc (attr := simp)] theorem exceptionalAffineIso_hom_inclusion : + (exceptionalAffineIso I U).hom ≫ affineExceptionalInclusionOnRestriction I U = + restrictedExceptionalInclusion I U := + PiExponent.PresentedIdealIso.iso_hom_inclusion _ _ _ _ _ _ _ _ + +def exceptionalAffinePowerIso (n : ℕ) : + ((restrictedExceptionalLineBundle I U).pow n).sheaf ≅ + ((affineExceptionalOnRestriction I U).pow n).sheaf := + (modulePowFunctor n).mapIso (exceptionalAffineIso I U) + +@[reassoc (attr := simp)] theorem exceptionalAffinePowerIso_hom_inclusion (n : ℕ) : + (exceptionalAffinePowerIso I U n).hom ≫ + modulePowMap (affineExceptionalInclusionOnRestriction I U) n = + modulePowMap (restrictedExceptionalInclusion I U) n := by + change modulePowMap (exceptionalAffineIso I U).hom n ≫ + modulePowMap (affineExceptionalInclusionOnRestriction I U) n = _ + rw [← modulePowMap_comp, exceptionalAffineIso_hom_inclusion] + +def restrictedExceptionalPowerAffineIso (n : ℕ) : + ((exceptionalLineBundle I).pow n).sheaf.restrict ((projection I) ⁻¹ᵁ U.1).ι ≅ + ((affineExceptionalOnRestriction I U).pow n).sheaf := + modulePowRestrict ((projection I) ⁻¹ᵁ U.1) (exceptionalLineBundle I).sheaf n ≪≫ + exceptionalAffinePowerIso I U n + +end PiExponentSeshadri.BlowupGluing + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalReesCanonicalRecovery.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalReesCanonicalRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..255a11fce865ff4f179aa9e49fd6cfbd829dea08 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalReesCanonicalRecovery.lean @@ -0,0 +1,29 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AffineReesCanonicalRecovery +import OAI.NumberTheory.PiExponent.Ampleness.GlobalReesRecoveryComparison + +namespace OAI + +noncomputable section +namespace PiExponent.GlobalReesRecoveryComparison +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry PiExponentSeshadri.BlowupGluing +open CanonicalRecoveryProperties + +theorem eventually_ordinaryMap_app_bijective {X : Scheme.{0}} [IsLocallyNoetherian X] + (I : X.IdealSheafData) (U : X.affineOpens) : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + OrdinaryBijective (projection I) I (exceptionalLineBundle I) + (exceptionalInclusion I) (exceptional_presents I) n U.1 := by + let : IsAffine U.1.toScheme := U.2 + let : IsNoetherianRing Γ(U.1.toScheme,⊤) := + IsLocallyNoetherian.component_noetherian ⟨⊤, isAffineOpen_top U.1.toScheme⟩ + obtain ⟨N,hN⟩ := AffineReesCanonicalRecovery.eventually_comap_bijective (affineCenterIdeal I U) + exact ⟨N, fun n hn => (ordinary_iff_comap (projection I) I + (exceptionalLineBundle I) (exceptionalInclusion I) (exceptional_presents I) n U.1).mpr + ((comap_app_bijective_iff_affine I U n).mpr (hN n hn))⟩ + +end PiExponent.GlobalReesRecoveryComparison + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalReesRecoveryComparison.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalReesRecoveryComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..900d8b3b136b7c61d19c74c28c2074d7df9335a6 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/GlobalReesRecoveryComparison.lean @@ -0,0 +1,85 @@ +import OAI.NumberTheory.PiExponent.Ampleness.BlowupProperIntegral +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalRecoveryMap +import OAI.NumberTheory.PiExponent.Ampleness.GlobalBlowupAffineSquare +import OAI.NumberTheory.PiExponent.Ampleness.GlobalExceptionalComparison +import OAI.NumberTheory.PiExponent.Geometry.CanonicalRecoveryProperties +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealModuleRestriction +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealPullbackOpenSquare + +namespace OAI + +noncomputable section +namespace PiExponent.GlobalReesRecoveryComparison +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.IdealModule +open GeometrySupport CanonicalRecoveryProperties + +theorem ordinaryMap_bijective_iff_comap {X Y : Scheme.{0}} + (f : Y ⟶ X) [QuasiCompact f] (I : X.IdealSheafData) + (E : LineBundle Y) (ι : E.sheaf ⟶ structureSheaf Y) + (hE : PresentsPullbackIdeal I f E ι) (n : ℕ) (U : X.Opens) : + Function.Bijective ((ExceptionalRecoveryMap.ordinaryMap f I E ι hE n).app U) ↔ + Function.Bijective ((IdealPullbackMap.comap f (I^n)).app U) := by + have hb := ConcreteCategory.bijective_of_isIso + ((PresentedIdealIso.powerIso I f E ι hE n).inv.app (f ⁻¹ᵁ U)) + change Function.Bijective + (((PresentedIdealIso.powerIso I f E ι hE n).inv.app (f ⁻¹ᵁ U)) ∘ + ((IdealPullbackMap.comap f (I^n)).app U)) ↔ _ + exact hb.of_comp_iff' _ + +attribute [local irreducible] PiExponentSeshadri.BlowupGluing.affineRestrictionIso + PiExponentSeshadri.ReesGrading.affineBlowup PiExponentSeshadri.ReesGrading.projection + IdealPullbackMap.map IdealPullbackMap.comap + +local instance affineChartNoetherian {X : Scheme.{0}} [IsLocallyNoetherian X] + (U : X.affineOpens) : IsNoetherianRing Γ(U.1.toScheme, ⊤) := by + let : IsAffine U.1.toScheme := U.2 + exact IsLocallyNoetherian.component_noetherian ⟨⊤, isAffineOpen_top U.1.toScheme⟩ + +instance affineProjection_quasiCompact {X : Scheme.{0}} [IsLocallyNoetherian X] + (I : X.IdealSheafData) (U : X.affineOpens) : + QuasiCompact (PiExponentSeshadri.ReesGrading.projection + (PiExponentSeshadri.BlowupGluing.affineCenterIdeal I U)) := by infer_instance + +theorem comap_app_bijective_iff_affine_raw {X : Scheme.{0}} [IsLocallyNoetherian X] + (I J : X.IdealSheafData) (U : X.affineOpens) : + ComapBijective (PiExponentSeshadri.BlowupGluing.projection I) J U.1 ↔ + ComapBijective (PiExponentSeshadri.ReesGrading.projection + (PiExponentSeshadri.BlowupGluing.affineCenterIdeal I U)) + (J.comap (PiExponentSeshadri.BlowupGluing.baseChart U)) ⊤ := + CanonicalRecoveryProperties.comap_open_square + (PiExponentSeshadri.BlowupGluing.projection I) + (PiExponentSeshadri.BlowupGluing.baseChart U) + (PiExponentSeshadri.BlowupGluing.totalChart I U) + (PiExponentSeshadri.ReesGrading.projection + (PiExponentSeshadri.BlowupGluing.affineCenterIdeal I U)) + (PiExponentSeshadri.BlowupGluing.totalChart_projection I U) J U.1 ⊤ ⊤ + (by simp only [Scheme.Hom.image_top_eq_opensRange, + PiExponentSeshadri.BlowupGluing.baseChart_opensRange]) + (by simp only [Scheme.Hom.image_top_eq_opensRange, + PiExponentSeshadri.BlowupGluing.totalChart_opensRange]) + (by simp) + +theorem comap_app_bijective_iff_affine {X : Scheme.{0}} [IsLocallyNoetherian X] + (I : X.IdealSheafData) (U : X.affineOpens) (n : ℕ) : + ComapBijective (PiExponentSeshadri.BlowupGluing.projection I) (I^n) U.1 ↔ + ComapBijective (PiExponentSeshadri.ReesGrading.projection + (PiExponentSeshadri.BlowupGluing.affineCenterIdeal I U)) + (PiExponentSeshadri.IdealPullback.specIdeal + ((PiExponentSeshadri.BlowupGluing.affineCenterIdeal I U)^n)) ⊤ := by + have hh := comap_app_bijective_iff_affine_raw I (I^n) U + have he : (I^n).comap (PiExponentSeshadri.BlowupGluing.baseChart U) = + PiExponentSeshadri.IdealPullback.specIdeal + ((PiExponentSeshadri.BlowupGluing.affineCenterIdeal I U)^n) := by + rw [PiExponentSeshadri.IdealPullback.comap_pow, + PiExponentSeshadri.BlowupGluing.center_comap_baseChart, + PiExponentSeshadri.IdealPullback.specIdeal_pow] + exact hh.trans (iff_of_eq (congrArg (fun J => ComapBijective + (PiExponentSeshadri.ReesGrading.projection + (PiExponentSeshadri.BlowupGluing.affineCenterIdeal I U)) J ⊤) he)) + +end PiExponent.GlobalReesRecoveryComparison + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/IntegralComponentAmple.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/IntegralComponentAmple.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc197a0c74cde5264a862b80cd2477e5240acf83 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/IntegralComponentAmple.lean @@ -0,0 +1,39 @@ +import OAI.NumberTheory.PiExponent.Ampleness.NilpotentAmpleDescent +import OAI.NumberTheory.PiExponent.Ampleness.ReducedComponentAmple + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} + +theorem isAmple_of_integral_closed_restrictions [IsNoetherian X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (L H : LineBundle X) (hH : H.IsAmple) + (hints : ∀ {Y : Scheme.{0}} [IsIntegral Y] (j : Y ⟶ X) [IsClosedImmersion j], + (L.pullback j).IsAmple) : L.IsAmple := by + let I : X.IdealSheafData := Scheme.IdealSheafData.vanishingIdeal (⊤ : Closeds X) + have hI : I.support = ⊤ := by + ext x + simp only [I, Scheme.IdealSheafData.coe_support_vanishingIdeal] + let : IsLocallyNoetherian I.subscheme := + LocallyOfFiniteType.isLocallyNoetherian I.subschemeι + let : CompactSpace I.subscheme := QuasiCompact.compactSpace_of_compactSpace I.subschemeι + let : IsNoetherian I.subscheme := {} + let : IsReduced I.subscheme := isReduced_vanishingIdeal_subscheme ⊤ + apply LineBundle.isAmple_of_fullSupport p I hI L + apply ReducedComponentAmple.isAmple_of_reduced_components (I.subschemeι ≫ p) + (L.pullback I.subschemeι) (H.pullback I.subschemeι) + (hH.pullback_closedImmersion H I.subschemeι) + intro C + let j := CurveCycle.reducedComponentι I.subscheme C + have hc : (L.pullback (j ≫ I.subschemeι)).IsAmple := hints (j ≫ I.subschemeι) + exact AmpleIso.isAmple_of_sheaf_iso _ _ + ((Scheme.Modules.pullbackComp j I.subschemeι).app L.sheaf).symm hc + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/LineAmpleOperations.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/LineAmpleOperations.lean new file mode 100644 index 0000000000000000000000000000000000000000..98f3ee44a1374a0a45b01ff7ce8f2905872f7d24 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/LineAmpleOperations.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleCommonDegree +import OAI.NumberTheory.PiExponent.Ampleness.AmpleIso +import OAI.NumberTheory.PiExponent.Approximation.TensorSectionOpen + +namespace OAI + +noncomputable section +namespace PiExponentSeshadri.Geometry +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Frames PiExponentSeshadri.TensorPure +variable {X : Scheme.{0}} + +def lineTensorPow (L M : LineBundle X) : ∀ n : ℕ, + ((L.tensor M).pow n).sheaf ≅ ((L.pow n).tensor (M.pow n)).sheaf + | 0 => (moduleTensorUnit (structureSheaf X)).symm + | n+1 => + moduleTensorIso (Iso.refl _) (lineTensorPow L M n) ≪≫ + lineTensorAssoc L M ((L.pow n).tensor (M.pow n)) ≪≫ + moduleTensorIso (Iso.refl L.sheaf) + ((lineTensorAssoc M (L.pow n) (M.pow n)).symm ≪≫ + moduleTensorIso (moduleTensorComm M.sheaf (L.pow n).sheaf) (Iso.refl _) ≪≫ + lineTensorAssoc (L.pow n) M (M.pow n)) ≪≫ + (lineTensorAssoc L (L.pow n) (M.pow (n+1))).symm + +theorem LineBundle.IsAmple.pow {L : LineBundle X} (hL : L.IsAmple) (d : ℕ) (hd : 0 < d) : + (L.pow d).IsAmple := by + intro x V hx + obtain ⟨n,hn,s,hs,hsub,ha⟩ := hL x V hx + let e : ((L.pow n).pow d).sheaf ≅ ((L.pow d).pow n).sheaf := + linePowerMul L n d ≪≫ eqToIso (congrArg (fun j => (L.pow j).sheaf) (Nat.mul_comm n d)) ≪≫ + (linePowerMul L d n).symm + let t := powerSection s d ≫ e.hom + have ht : sectionOpen X t = sectionOpen X s := by + exact (PiExponent.AmpleIso.sectionOpen_postcomp_iso (powerSection s d) e).trans + ((L.pow n).sectionOpen_power s hd) + exact ⟨n, hn, t, ht.symm ▸ hs, ht.le.trans hsub, ht.symm ▸ ha⟩ + +theorem LineBundle.IsAmple.tensor {L M : LineBundle X} + (hL : L.IsAmple) (hM : M.IsAmple) : (L.tensor M).IsAmple := by + intro x V hx + obtain ⟨n, hn, s, hxs, hsV, _⟩ := hL x V hx + obtain ⟨m, hm, t, hxt, hts, hta⟩ := hM x (sectionOpen X s) hxs + let e : ((M.pow m).pow n).sheaf ≅ (M.pow (n*m)).sheaf := + linePowerMul M m n ≪≫ eqToIso (congrArg (fun j => (M.pow j).sheaf) (Nat.mul_comm m n)) + let a : structureSheaf X ⟶ (L.pow (n*m)).sheaf := + powerSection s m ≫ (linePowerMul L n m).hom + let b : structureSheaf X ⟶ (M.pow (n*m)).sheaf := powerSection t n ≫ e.hom + have ha : sectionOpen X a = sectionOpen X s := by + exact (PiExponent.AmpleIso.sectionOpen_postcomp_iso + (powerSection s m) (linePowerMul L n m)).trans ((L.pow n).sectionOpen_power s hm) + have hb : sectionOpen X b = sectionOpen X t := by + exact (PiExponent.AmpleIso.sectionOpen_postcomp_iso (powerSection t n) e).trans + ((M.pow m).sectionOpen_power t hn) + let q := tensorSection a b ≫ (lineTensorPow L M (n*m)).inv + have hq : sectionOpen X q = sectionOpen X t := by + exact (PiExponent.AmpleIso.sectionOpen_postcomp_iso + (tensorSection a b) (lineTensorPow L M (n*m)).symm).trans + ((section_open (L.pow (n*m)) (M.pow (n*m)) a b).trans + ((congrArg₂ (fun U V : X.Opens => U ⊓ V) ha hb).trans (inf_eq_right.mpr hts))) + exact ⟨n*m, Nat.mul_pos hn hm, q, hq.symm ▸ hxt, + hq.le.trans (hts.trans hsV), hq.symm ▸ hta⟩ + +end PiExponentSeshadri.Geometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/LocalHomogeneousDegrees.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/LocalHomogeneousDegrees.lean new file mode 100644 index 0000000000000000000000000000000000000000..56a4d732043214f4e5e394190d1f7ecd080ac2e4 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/LocalHomogeneousDegrees.lean @@ -0,0 +1,42 @@ +import Mathlib.RingTheory.Localization.AtPrime.Basic +import OAI.NumberTheory.PiExponent.LocalAlgebra.RegularDegreePositivity + +namespace OAI + +namespace PiExponentJets.W22 + +variable {k σ : Type*} [Field k] + +theorem homogeneous_degrees_pos_of_local_regular + (T : Ideal (MvPolynomial σ k)) [T.IsPrime] + (gs : List (MvPolynomial σ k)) (degrees : Fin gs.length → ℕ) + (hhom : ∀ i : Fin gs.length, gs[i].IsHomogeneous (degrees i)) + (hreg : RingTheory.Sequence.IsRegular (Localization.AtPrime T) + (gs.map (algebraMap (MvPolynomial σ k) (Localization.AtPrime T)))) : + ∀ i, 0 < degrees i := by + intro i + let μ := algebraMap (MvPolynomial σ k) (Localization.AtPrime T) + let imap : Fin (gs.map μ).length := ⟨i.val, by simpa only [List.length_map] using i.isLt⟩ + have hn : μ gs[i] ≠ 0 := by + simpa only [List.getElem_map, Fin.getElem_fin] using + PiExponentSiegel.W20.regular_sequence_term_ne_zero (gs.map μ) hreg imap + have hu : ¬ IsUnit (μ gs[i]) := by + simpa only [List.getElem_map, Fin.getElem_fin] using + PiExponentSiegel.W20.regular_sequence_term_not_isUnit (gs.map μ) hreg imap + by_contra hpos + have hd : degrees i = 0 := Nat.eq_zero_of_not_pos hpos + have hh : gs[i].IsHomogeneous 0 := by simpa only [hd] using hhom i + have hg : gs[i] = MvPolynomial.C ((gs[i]).coeff 0) := + MvPolynomial.totalDegree_eq_zero_iff_eq_C.mp + ((MvPolynomial.totalDegree_zero_iff_isHomogeneous (σ := σ)).mpr hh) + have hc : (gs[i]).coeff 0 ≠ 0 := by + intro hc + apply hn + rw [hg, hc, map_zero, map_zero] + apply hu + rw [hg] + exact ((isUnit_iff_ne_zero.mpr hc).map MvPolynomial.C).map μ + +end PiExponentJets.W22 + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiAmpleFromSections.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiAmpleFromSections.lean new file mode 100644 index 0000000000000000000000000000000000000000..d2ae19348794feb9b872ffebbb8897801b034183 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiAmpleFromSections.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleCurveDegreePositive +import OAI.NumberTheory.PiExponent.Ampleness.FinitePullbackAmple +import OAI.NumberTheory.PiExponent.Ampleness.NakaiEffectivity +import OAI.NumberTheory.PiExponent.Approximation.ConstantPullbackDegree +import OAI.NumberTheory.PiExponent.Geometry.FiniteOfNoContractedCurves +import OAI.NumberTheory.PiExponent.Geometry.ProjectiveEmbeddingCharts + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.Projective PiExponentSeshadri.Frames +attribute [local instance] MvPolynomial.gradedAlgebra +variable {X : Scheme.{0}} + +theorem curveDegree_eq_zero_of_sectionsMorphism_contracted + (p : X ⟶ Spec (CommRingCat.of ℂ)) (L : LineBundle X) + (k : ℕ) (s : Fin k → GlobalSections X L.sheaf) + (hs : (⨆ z, sectionOpen X (s z)) = ⊤) + (C : IntegralCurve X) + (y : ProjectiveO1.projectiveSpace ℂ (Fin k)) + (hconstant : ∀ c : C.scheme, sectionsMorphism (baseScalars p) s hs (C.embedding c) = y) : + curveDegree p L C = 0 := by + classical + obtain ⟨c⟩ : Nonempty C.scheme := inferInstance + have hc : C.embedding c ∈ ⨆ z, sectionOpen X (s z) := by rw [hs]; trivial + obtain ⟨z,hz⟩ := Opens.mem_iSup.mp hc + have hpre : sectionsMorphism (baseScalars p) s hs ⁻¹ᵁ + Proj.basicOpen (MvPolynomial.homogeneousSubmodule (Fin k) ℂ) (MvPolynomial.X z) = + sectionOpen X (s z) := sectionsMorphism_preimage (baseScalars p) s hs z + have hy : y ∈ Proj.basicOpen (MvPolynomial.homogeneousSubmodule (Fin k) ℂ) + (MvPolynomial.X z) := by + rw [← hpre] at hz + change sectionsMorphism (baseScalars p) s hs (C.embedding c) ∈ + Proj.basicOpen (MvPolynomial.homogeneousSubmodule (Fin k) ℂ) (MvPolynomial.X z) at hz + rwa [hconstant c] at hz + have hrange : Set.range C.embedding ⊆ (sectionOpen X (s z) : Set X) := by + rintro x ⟨c',rfl⟩ + rw [← hpre] + change sectionsMorphism (baseScalars p) s hs (C.embedding c') ∈ + Proj.basicOpen (MvPolynomial.homogeneousSubmodule (Fin k) ℂ) (MvPolynomial.X z) + rwa [hconstant c'] + let e := ConstantPullbackDegree.pullbackFrame_of_range_subset L C.embedding + (sectionOpen X (s z)) hrange (sectionFrame (s z)) + change eulerCharacteristic (C.embedding ≫ p) 1 (L.pullback C.embedding).sheaf - + eulerCharacteristic (C.embedding ≫ p) 1 (structureSheaf C.scheme) = 0 + rw [eulerCharacteristic_iso (C.embedding ≫ p) e 1] + exact sub_self _ + +theorem isAmple_of_section_cover_of_curveDegree_pos [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (L : LineBundle X) (d : ℕ) (hdim : topologicalKrullDim X ≤ d) + (k : ℕ) (s : Fin k → GlobalSections X L.sheaf) + (hs : (⨆ z, sectionOpen X (s z)) = ⊤) + (hpositive : ∀ C : IntegralCurve X, 0 < curveDegree p L C) : L.IsAmple := by + let : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace p + let : IsProper (X.toSpecΓ ≫ Spec.map (CommRingCat.ofHom (baseScalars p))) := by + change IsProper (X.toSpecΓ ≫ Spec.map (CommRingCat.ofHom + (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of ℂ)).inv.hom))) + rw [toSpec_scalarMap p] + infer_instance + let f : X ⟶ ProjectiveO1.projectiveSpace ℂ (Fin k) := + sectionsMorphism (baseScalars p) s hs + let : IsProper f := sectionsMorphism_proper (baseScalars p) s hs + let : JacobsonSpace (ProjectiveO1.projectiveSpace ℂ (Fin k)) := + LocallyOfFiniteType.jacobsonSpace (polynomialProjectiveProjection ℂ (Fin k)) + let : IsFinite f := isFinite_of_no_contracted_integralCurves f d hdim (by + intro C y hy j hj + have hconstant (c : C.scheme) : f (C.embedding c) = y := by + have hc : f.fiberι y (j c) ∈ Set.range (f.fiberι y) := ⟨j c,rfl⟩ + rw [f.range_fiberι] at hc + change f (f.fiberι y (j c)) = y at hc + have he := congrArg (fun g : C.scheme ⟶ X => g c) hj + simpa only [Scheme.Hom.comp_apply] using he ▸ hc + have hz := curveDegree_eq_zero_of_sectionsMorphism_contracted p L k s hs C y hconstant + have hp := hpositive C + omega) + apply L.ample_of_affine_section_cover s hs + intro z + change IsAffineOpen (PiExponentSeshadri.SectionOpens.isoOpen (s z)) + exact (sectionsMorphism_preimage (baseScalars p) s hs z) ▸ + (standardChart_isAffineOpen (R := ℂ) z).preimage f + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiBasepointFree.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiBasepointFree.lean new file mode 100644 index 0000000000000000000000000000000000000000..5df1d4d7d6ae8f9a9ea182c0cf3c1447c398e262 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiBasepointFree.lean @@ -0,0 +1,89 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ClosedAmpleRestriction +import OAI.NumberTheory.PiExponent.Ampleness.NakaiSectionLifting +import OAI.NumberTheory.PiExponent.Approximation.SectionPowerOpens +import OAI.NumberTheory.PiExponent.Approximation.SectionZeroSupport + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace +open PiExponentSeshadri.Geometry +open PiExponent.SectionZeroIdeal +variable {X : Scheme.{0}} + +theorem power_nonvanishing_sections_of_divisor_lifts + (L : LineBundle X) (s : GlobalSections X L.sheaf) (n : ℕ) + (hlift : Function.Surjective + (fun t : GlobalSections X (L.pow n).sheaf => + pullbackSection (zeroIdeal L s).subschemeι t)) + (hgenerate : ∀ y : (zeroIdeal L s).subscheme, ∃ σ : + GlobalSections (zeroIdeal L s).subscheme + ((Scheme.Modules.pullback (zeroIdeal L s).subschemeι).obj (L.pow n).sheaf), + y ∈ sectionOpen (zeroIdeal L s).subscheme σ) : + ∀ x : X, ∃ t : GlobalSections X (L.pow n).sheaf, x ∈ sectionOpen X t := by + intro x + by_cases hx : x ∈ sectionOpen X s + · exact ⟨powerSection s n, sectionOpen_le_powerSection s n hx⟩ + · have hxI : x ∈ (zeroIdeal L s).support := by + change x ∈ ((zeroIdeal L s).support : Set X) + rw [zeroIdeal_support] + exact hx + have hr : x ∈ Set.range (zeroIdeal L s).subschemeι := by + rwa [Scheme.IdealSheafData.range_subschemeι] + obtain ⟨y,rfl⟩ := hr + obtain ⟨σ,hσ⟩ := hgenerate y + obtain ⟨t,ht⟩ := hlift σ + change pullbackSection (zeroIdeal L s).subschemeι t = σ at ht + refine ⟨t,?_⟩ + have he := pullback_isoOpen_eq (L.pow n) t (zeroIdeal L s).subschemeι + rw [ht] at he + change y ∈ (zeroIdeal L s).subschemeι ⁻¹ᵁ PiExponentSeshadri.SectionOpens.isoOpen t + exact he.le hσ + +theorem finite_section_cover_of_pointwise [CompactSpace X] (L : LineBundle X) + (h : ∀ x : X, ∃ t : GlobalSections X L.sheaf, x ∈ sectionOpen X t) : + ∃ l : ℕ, ∃ t : Fin l → GlobalSections X L.sheaf, + (⨆ j, sectionOpen X (t j)) = ⊤ := by + classical + choose t ht using h + obtain ⟨I,hI⟩ := isCompact_univ.elim_finite_subcover + (fun x => (sectionOpen X (t x) : Set X)) (fun x => (sectionOpen X (t x)).isOpen) + (by intro x _; exact Set.mem_iUnion.mpr ⟨x,ht x⟩) + let e := (Fintype.equivFin I).symm + refine ⟨Fintype.card I,fun j => t (e j).val,?_⟩ + apply top_unique + intro x _ + obtain ⟨i,hi⟩ := Set.mem_iUnion.mp (hI (show x ∈ Set.univ from trivial)) + obtain ⟨hi,hx⟩ := Set.mem_iUnion.mp hi + apply Opens.mem_iSup.mpr + refine ⟨e.symm ⟨i,hi⟩,?_⟩ + change x ∈ sectionOpen X (t (e (e.symm ⟨i,hi⟩)).val) + rw [Equiv.apply_symm_apply] + exact hx + +theorem eventual_power_section_cover_of_divisor [CompactSpace X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) (L : LineBundle X) + (s : GlobalSections X L.sheaf) [Mono s] + (hfinite : ∀ n, letI := Module.compHom (cohomology (L.pow n).sheaf 1) (baseScalars p) + FiniteDimensional ℂ (cohomology (L.pow n).sheaf 1)) + (hzero : ∃ N, ∀ n, N ≤ n → ∀ z : + cohomology ((Scheme.Modules.pullback (zeroIdeal L s).subschemeι).obj (L.pow (n+1)).sheaf) 1, + z = 0) + (hgenerate : ∃ N, ∀ n, N ≤ n → ∀ y : (zeroIdeal L s).subscheme, ∃ σ : + GlobalSections (zeroIdeal L s).subscheme + ((Scheme.Modules.pullback (zeroIdeal L s).subschemeι).obj (L.pow (n+1)).sheaf), + y ∈ sectionOpen (zeroIdeal L s).subscheme σ) : + ∃ N, ∀ n, N ≤ n → ∃ l : ℕ, ∃ t : Fin l → GlobalSections X (L.pow (n+1)).sheaf, + (⨆ j, sectionOpen X (t j)) = ⊤ := by + obtain ⟨N,hN⟩ := eventual_cartier_restriction_section_lifting p L s hfinite hzero + obtain ⟨K,hK⟩ := hgenerate + refine ⟨max N K,fun n hn => ?_⟩ + apply finite_section_cover_of_pointwise (L.pow (n+1)) + exact power_nonvanishing_sections_of_divisor_lifts L s (n+1) + (hN n ((le_max_left N K).trans hn)) (hK n ((le_max_right N K).trans hn)) + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiCartier.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiCartier.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3cb65833801c41c9af1f8eb393d52a89fa85c3b --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiCartier.lean @@ -0,0 +1,94 @@ +import OAI.NumberTheory.PiExponent.Approximation.CoherentTwistPresentation +import OAI.NumberTheory.PiExponent.Approximation.IntegralLineSections +import OAI.NumberTheory.PiExponent.Approximation.SectionOpens +import OAI.NumberTheory.PiExponent.Cohomology.NakaiCohomology +import OAI.NumberTheory.PiExponent.Cohomology.NakaiEulerGrowth + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} + +private lemma mono_iso_inv_comp {C : Type*} [Category C] {A B D : C} + (e : A ≅ B) (f : A ⟶ D) [Mono f] : Mono (e.inv ≫ f) := inferInstance + +def cartierPowerMultiply (L : LineBundle X) (s : GlobalSections X L.sheaf) (n : ℕ) : + modulePow X L.sheaf n ⟶ modulePow X L.sheaf (n+1) := + (moduleTensorUnit (modulePow X L.sheaf n)).inv ≫ + moduleTensorMap s (𝟙 (modulePow X L.sheaf n)) + +theorem cartierPowerMultiply_mono [IsIntegral X] (L : LineBundle X) + (s : GlobalSections X L.sheaf) (hs : s ≠ 0) (n : ℕ) : + Mono (cartierPowerMultiply L s n) := by + let := L.mono_section s hs + have hm : Mono (moduleTensorMap s (𝟙 (modulePow X L.sheaf n))) := + moduleTensorMap_mono s (L.pow n) + exact @mono_iso_inv_comp X.Modules _ _ _ _ + (moduleTensorUnit (modulePow X L.sheaf n)) _ hm + +def cartierPowerQuotient (L : LineBundle X) (s : GlobalSections X L.sheaf) (n : ℕ) : + X.Modules := cokernel (cartierPowerMultiply L s n) + +def cartierPowerSequence (L : LineBundle X) (s : GlobalSections X L.sheaf) (n : ℕ) : + ShortComplex X.Modules := + ShortComplex.mk (cartierPowerMultiply L s n) (cokernel.π _) (cokernel.condition _) + +theorem cartierPowerSequence_shortExact [IsIntegral X] (L : LineBundle X) + (s : GlobalSections X L.sheaf) (hs : s ≠ 0) (n : ℕ) : + (cartierPowerSequence L s n).ShortExact := by + have := cartierPowerMultiply_mono L s hs n + change (ShortComplex.mk (cartierPowerMultiply L s n) (cokernel.π _) + (cokernel.condition _)).ShortExact + exact { exact := ShortComplex.exact_cokernel _ } + +theorem cartierPowerMultiply_restrict_isIso (L : LineBundle X) + (s : GlobalSections X L.sheaf) (n : ℕ) (U : X.Opens) + [IsIso ((Scheme.Modules.restrictFunctor U.ι).map s)] : + IsIso ((Scheme.Modules.restrictFunctor U.ι).map (cartierPowerMultiply L s n)) := by + let R := Scheme.Modules.restrictFunctor U.ι + have h : IsIso (R.map (moduleTensorMap s (𝟙 (modulePow X L.sheaf n)))) := by + apply (isIso_comp_right_iff _ (moduleTensorRestrict U L.sheaf _).hom).mp + rw [moduleTensorRestrict_natural] + infer_instance + change IsIso (R.map ((moduleTensorUnit _).inv ≫ moduleTensorMap s (𝟙 _))) + rw [Functor.map_comp] + infer_instance + +theorem cartierPowerQuotient_restrict_isZero (L : LineBundle X) + (s : GlobalSections X L.sheaf) (n : ℕ) : + IsZero ((cartierPowerQuotient L s n).restrict (sectionOpen X s).ι) := by + let R := Scheme.Modules.restrictFunctor (sectionOpen X s).ι + have : IsIso (R.map s) := PiExponentSeshadri.SectionOpens.isIso_restrict_isoOpen s + have : IsIso (R.map (cartierPowerMultiply L s n)) := + cartierPowerMultiply_restrict_isIso L s n (sectionOpen X s) + have hz : R.map (cokernel.π (cartierPowerMultiply L s n)) = 0 := by + apply (cancel_epi (R.map (cartierPowerMultiply L s n))).mp + rw [← R.map_comp, cokernel.condition, Functor.map_zero, comp_zero] + have hπ : Epi (R.map (cokernel.π (cartierPowerMultiply L s n))) := + R.map_epi (cokernel.π (cartierPowerMultiply L s n)) + exact @IsZero.of_epi_eq_zero (sectionOpen X s).toScheme.Modules _ _ _ _ + (R.map (cokernel.π (cartierPowerMultiply L s n))) hπ hz + +theorem eventual_cartierPower_sections_lift [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) (L : LineBundle X) + (s : GlobalSections X L.sheaf) (hs : s ≠ 0) + (hfinite : ∀ n, + let _ := Module.compHom (cohomology (modulePow X L.sheaf n) 1) (baseScalars p) + FiniteDimensional ℂ (cohomology (modulePow X L.sheaf n) 1)) + (hzero : ∃ N, ∀ n, N ≤ n → ∀ z : cohomology (cartierPowerQuotient L s n) 1, + z = 0) : + ∃ N, ∀ n, N ≤ n → Function.Surjective + (fun t : GlobalSections X (modulePow X L.sheaf (n+1)) => + t ≫ cokernel.π (cartierPowerMultiply L s n)) := by + exact eventual_globalSections_surjective p (fun n => modulePow X L.sheaf n) + (cartierPowerQuotient L s) (cartierPowerMultiply L s) (fun n => cokernel.π _) + (fun n => cokernel.condition _) (fun n => cartierPowerSequence_shortExact L s hs n) + hfinite hzero + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiDivisorAmple.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiDivisorAmple.lean new file mode 100644 index 0000000000000000000000000000000000000000..2146cb23925d7a486217e0135fb50f9f9994a68c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiDivisorAmple.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.PiExponent.Ampleness.NakaiBasepointFree +import OAI.NumberTheory.PiExponent.Approximation.GeneratorsSectionCover +import OAI.NumberTheory.PiExponent.Cohomology.NoetherianAmpleSerreVanishing + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace +open PiExponentSeshadri.Geometry +open PiExponent.SectionZeroIdeal +variable {X : Scheme.{0}} + +theorem eventual_zeroDivisor_power_generation + (L : LineBundle X) (s : GlobalSections X L.sheaf) + [NoetherianSpace (zeroIdeal L s).subscheme] + (hD : (L.pullback (zeroIdeal L s).subschemeι).IsAmple) : + ∃ N, ∀ n, N ≤ n → ∀ y : (zeroIdeal L s).subscheme, ∃ σ : + GlobalSections (zeroIdeal L s).subscheme + ((Scheme.Modules.pullback (zeroIdeal L s).subschemeι).obj (L.pow (n+1)).sheaf), + y ∈ sectionOpen (zeroIdeal L s).subscheme σ := by + let i := (zeroIdeal L s).subschemeι + obtain ⟨N,hN⟩ := GeneratorsSectionCover.ample_eventual_fin_section_cover (L.pullback i) hD + refine ⟨N,fun n hn y => ?_⟩ + obtain ⟨k,t,ht⟩ := hN (n+1) (by omega) + have hy : y ∈ ⨆ j, sectionOpen (zeroIdeal L s).subscheme (t j) := by rw [ht]; trivial + obtain ⟨j,hj⟩ := Opens.mem_iSup.mp hy + let e := PiExponentSeshadri.PullbackTensor.powIso i L (n+1) + refine ⟨t j ≫ e.inv,?_⟩ + change y ∈ PiExponentSeshadri.SectionOpens.isoOpen (t j ≫ e.symm.hom) + exact (PiExponentSeshadri.SectionOpens.isoOpen_postcomp (t j) e.symm).ge hj + +theorem eventual_zeroDivisor_power_cohomology_zero + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (L : LineBundle X) (s : GlobalSections X L.sheaf) + (hD : (L.pullback (zeroIdeal L s).subschemeι).IsAmple) : + ∃ N, ∀ n, N ≤ n → ∀ q, 0 < q → ∀ z : + cohomology ((Scheme.Modules.pullback (zeroIdeal L s).subschemeι).obj (L.pow (n+1)).sheaf) q, + z = 0 := by + let i := (zeroIdeal L s).subschemeι + obtain ⟨N,hN⟩ := GeometrySupport.NoetherianAmpleSerreVanishing.ample_power_cohomology_zero + (i ≫ p) (L.pullback i) hD + refine ⟨N,fun n hn q hq => ?_⟩ + exact GeometrySupport.SerrePowerDescent.ext_zero_of_iso + (PiExponentSeshadri.PullbackTensor.powIso i L (n+1)).symm q (hN (n+1) (by omega) q hq) + +theorem eventual_power_section_cover_of_ample_zeroDivisor + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (L : LineBundle X) (s : GlobalSections X L.sheaf) [Mono s] + (hfinite : ∀ n, letI := Module.compHom (cohomology (L.pow n).sheaf 1) (baseScalars p) + FiniteDimensional ℂ (cohomology (L.pow n).sheaf 1)) + (hD : (L.pullback (zeroIdeal L s).subschemeι).IsAmple) : + ∃ N, ∀ n, N ≤ n → ∃ l : ℕ, ∃ t : Fin l → GlobalSections X (L.pow (n+1)).sheaf, + (⨆ j, sectionOpen X (t j)) = ⊤ := by + let : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace p + let i := (zeroIdeal L s).subschemeι + let : IsLocallyNoetherian (zeroIdeal L s).subscheme := + LocallyOfFiniteType.isLocallyNoetherian (i ≫ p) + let : CompactSpace (zeroIdeal L s).subscheme := + QuasiCompact.compactSpace_of_compactSpace (i ≫ p) + let : IsNoetherian (zeroIdeal L s).subscheme := {} + obtain ⟨N,hN⟩ := eventual_zeroDivisor_power_cohomology_zero p L s hD + exact eventual_power_section_cover_of_divisor p L s hfinite + ⟨N,fun n hn => hN n hn 1 (by decide)⟩ + (eventual_zeroDivisor_power_generation L s hD) + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiEffectivity.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiEffectivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..f55dfda56f4248aff36d80aa6e9b8f94e63df87d --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiEffectivity.lean @@ -0,0 +1,93 @@ +import OAI.NumberTheory.PiExponent.Ampleness.LineAmpleOperations +import OAI.NumberTheory.PiExponent.Ampleness.NakaiDivisorAmple +import OAI.NumberTheory.PiExponent.Ampleness.NakaiStationarity +import OAI.NumberTheory.PiExponent.Approximation.GeneratorsSectionCover +import OAI.NumberTheory.PiExponent.Approximation.RegularSectionChoice +import OAI.NumberTheory.PiExponent.Cohomology.EulerRegularTwists +import OAI.NumberTheory.PiExponent.Cohomology.EulerSupportDimension +import OAI.NumberTheory.PiExponent.Geometry.ProjectiveSpaceFinite + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Filter +open PiExponentSeshadri.Geometry +open PiExponent.SectionZeroIdeal +variable {X : Scheme.{0}} + +theorem exists_nonzero_power_section_of_euler_growth + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (H L : LineBundle X) (hH : H.IsAmple) (d : ℕ) + (hdim : topologicalKrullDim X ≤ d+1) + (hlower : ∀ I : X.IdealSheafData, topologicalKrullDim I.subscheme ≤ d → + (L.pullback I.subschemeι).IsAmple) + (hgrowth : Tendsto (fun n => eulerCharacteristic p (d+1) (L.pow n).sheaf) atTop atTop) : + ∃ a : ℕ, 0 < a ∧ ∃ s : GlobalSections X (L.pow a).sheaf, s ≠ 0 := by + let : IsLocallyNoetherian X := LocallyOfFiniteType.isLocallyNoetherian p + let : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace p + let : IsNoetherian X := {} + obtain ⟨b,G,hG,G',hG'⟩ := exists_common_tensor_generators H L hH + let := hG + let := hG' + let B := H.pow b + obtain ⟨k,u,hu⟩ := GeneratorsSectionCover.exists_fin_section_cover B G + obtain ⟨k',v,hv⟩ := GeneratorsSectionCover.exists_fin_section_cover (L.tensor B) G' + obtain ⟨s,hs⟩ := exists_mono_section_of_finite_cover p (L.tensor B) v hv + obtain ⟨t,ht⟩ := exists_mono_section_of_finite_cover p B u hu + let := hs + let := ht + have hD := hlower (zeroIdeal (L.tensor B) s) + (regular_sectionZero_dimension_le (L.tensor B) s d hdim) + have hE := hlower (zeroIdeal B t) (regular_sectionZero_dimension_le B t d hdim) + have heuler (n : ℕ) : eulerCharacteristic p (d+1) ((L.pow n).tensor (H.pow 0)).sheaf = + eulerCharacteristic p (d+1) (L.pow n).sheaf := + eulerCharacteristic_iso p (moduleTensorRightUnit (L.pow n).sheaf) (d+1) + have hgrowth' : Tendsto + (fun n => eulerCharacteristic p (d+1) ((L.pow n).tensor (H.pow 0)).sheaf) atTop atTop := by + simpa only [heuler] using hgrowth + have hsections := eventually_nonzero_mixedPower_sections_of_growth p L B (H.pow 0) + s t hD hE (d+1) (by omega) hgrowth' + obtain ⟨N,hN⟩ := eventually_atTop.mp hsections + obtain ⟨σ,hσ⟩ := hN (N+1) (by omega) + let e := moduleTensorRightUnit (L.pow (N+1)).sheaf + refine ⟨N+1,by omega,σ ≫ e.hom,?_⟩ + intro hz + apply hσ + apply (cancel_mono e.hom).mp + exact hz.trans (zero_comp (C := X.Modules) (f := e.hom)).symm + +theorem exists_power_section_cover_of_euler_growth [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (r : ℕ) (i : X ⟶ ProjectiveO1.projectiveSpace ℂ (Fin (r+1))) [IsClosedImmersion i] + (hi : i ≫ PiExponent.polynomialProjectiveProjection ℂ (Fin (r+1)) = p) + (H L : LineBundle X) (hH : H.IsAmple) (d : ℕ) + (hdim : topologicalKrullDim X ≤ d+1) + (hlower : ∀ I : X.IdealSheafData, topologicalKrullDim I.subscheme ≤ d → + (L.pullback I.subschemeι).IsAmple) + (hgrowth : Tendsto (fun n => eulerCharacteristic p (d+1) (L.pow n).sheaf) atTop atTop) : + ∃ a : ℕ, 0 < a ∧ ∃ k : ℕ, ∃ s : Fin k → GlobalSections X (L.pow a).sheaf, + (⨆ j, sectionOpen X (s j)) = ⊤ := by + obtain ⟨a,ha,s,hs⟩ := exists_nonzero_power_section_of_euler_growth p H L hH d hdim hlower hgrowth + let A := L.pow a + let := A.mono_section s hs + let j := (zeroIdeal A s).subschemeι + have hL := hlower (zeroIdeal A s) (regular_sectionZero_dimension_le A s d hdim) + have hA : (A.pullback j).IsAmple := + PiExponent.AmpleIso.isAmple_of_sheaf_iso ((L.pullback j).pow a) (A.pullback j) + (PiExponentSeshadri.PullbackTensor.powIso j L a).symm (hL.pow a ha) + have hfinite (n : ℕ) : letI := Module.compHom (cohomology (A.pow n).sheaf 1) (baseScalars p) + FiniteDimensional ℂ (cohomology (A.pow n).sheaf 1) := by + let := PiExponent.GeometrySupport.LineBundleCoherent.lineBundle_isFinitePresentation (A.pow n) + exact ProjectiveSpaceFinite.projectiveOver_cohomology_finite p r i hi (A.pow n).sheaf 1 + obtain ⟨N,hN⟩ := eventual_power_section_cover_of_ample_zeroDivisor p A s hfinite hA + obtain ⟨k,t,ht⟩ := hN N le_rfl + let e := linePowerMul L a (N+1) + refine ⟨a*(N+1),Nat.mul_pos ha (by omega),k,fun z => t z ≫ e.hom,?_⟩ + exact (iSup_congr fun j => + PiExponent.AmpleIso.sectionOpen_postcomp_iso (t j) e).trans ht + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiInductionStep.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiInductionStep.lean new file mode 100644 index 0000000000000000000000000000000000000000..426fb425db0682443486569861eff023b550ece6 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiInductionStep.lean @@ -0,0 +1,72 @@ +import OAI.NumberTheory.PiExponent.Ampleness.NakaiAmpleFromSections +import OAI.NumberTheory.PiExponent.Cohomology.EulerDifferencePolynomial +import OAI.NumberTheory.PiExponent.Cohomology.EulerPolynomialDegree +import OAI.NumberTheory.PiExponent.Geometry.CurveDegreeLaws + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Filter +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} + +theorem isAmple_of_lower_ampleness_of_euler_growth [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (r : ℕ) (i : X ⟶ ProjectiveO1.projectiveSpace ℂ (Fin (r+1))) [IsClosedImmersion i] + (hi : i ≫ polynomialProjectiveProjection ℂ (Fin (r+1)) = p) + (H L : LineBundle X) (hH : H.IsAmple) (d : ℕ) + (hdim : topologicalKrullDim X ≤ d+1) + (hlower : ∀ I : X.IdealSheafData, topologicalKrullDim I.subscheme ≤ d → + (L.pullback I.subschemeι).IsAmple) + (hgrowth : Tendsto (fun n => eulerCharacteristic p (d+1) (L.pow n).sheaf) atTop atTop) + (hpositive : ∀ C : IntegralCurve X, 0 < curveDegree p L C) : L.IsAmple := by + obtain ⟨a,ha,k,s,hs⟩ := exists_power_section_cover_of_euler_growth + p r i hi H L hH d hdim hlower hgrowth + apply LineBundle.IsAmple.of_pow L ha + apply isAmple_of_section_cover_of_curveDegree_pos p (L.pow a) (d+1) (by + simpa only [Nat.cast_add, Nat.cast_one] using hdim) k s hs + intro C + rw [curveDegree_pow_of_ample p H hH L C a] + exact mul_pos (by exact_mod_cast ha) (hpositive C) + +theorem isAmple_of_lower_ampleness_of_topEuler_pos [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (r : ℕ) (i : X ⟶ ProjectiveO1.projectiveSpace ℂ (Fin (r+1))) [IsClosedImmersion i] + (hi : i ≫ polynomialProjectiveProjection ℂ (Fin (r+1)) = p) + (H L : LineBundle X) (hH : H.IsAmple) (d : ℕ) + (hdim : topologicalKrullDim X ≤ d+1) + (hlower : ∀ I : X.IdealSheafData, topologicalKrullDim I.subscheme ≤ d → + (L.pullback I.subschemeι).IsAmple) + (htop : 0 < (fwdDiff (1 : ℕ))^[d+1] + (fun n => eulerCharacteristic p (d+1) (L.pow n).sheaf) 0) + (hpositive : ∀ C : IntegralCurve X, 0 < curveDegree p L C) : L.IsAmple := by + let : IsLocallyNoetherian X := LocallyOfFiniteType.isLocallyNoetherian p + let : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace p + let : IsNoetherian X := {} + have hzero := euler_power_dimension_difference_eq_zero p r i hi L (d+1) (by + simpa only [Nat.cast_add, Nat.cast_one] using hdim) + have hgrowth := tendsto_atTop_of_forwardDifference_eq_zero + (fun n => eulerCharacteristic p (d+1) (L.pow n).sheaf) (d+1) (by omega) hzero htop + exact isAmple_of_lower_ampleness_of_euler_growth p r i hi H L hH d hdim hlower hgrowth hpositive + +theorem isAmple_of_lower_ampleness_of_topEuler_pos_of_margin [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (r : ℕ) (i : X ⟶ ProjectiveO1.projectiveSpace ℂ (Fin (r+1))) [IsClosedImmersion i] + (hi : i ≫ polynomialProjectiveProjection ℂ (Fin (r+1)) = p) + (H L : LineBundle X) (hH : H.IsAmple) (d : ℕ) + (hdim : topologicalKrullDim X ≤ d+1) + (hlower : ∀ I : X.IdealSheafData, topologicalKrullDim I.subscheme ≤ d → + (L.pullback I.subschemeι).IsAmple) + (htop : 0 < (fwdDiff (1 : ℕ))^[d+1] + (fun n => eulerCharacteristic p (d+1) (L.pow n).sheaf) 0) + (ε : ℝ) (hε : 0 < ε) + (hmargin : ∀ C : IntegralCurve X, + ε * (curveDegree p H C : ℝ) ≤ (curveDegree p L C : ℝ)) : L.IsAmple := + isAmple_of_lower_ampleness_of_topEuler_pos p r i hi H L hH d hdim hlower htop + (curveDegree_pos_of_uniform_margin p H L hH ε hε hmargin) + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiSectionLifting.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiSectionLifting.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2693915d8f9a55fd23952b96cea53447cef83ea --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiSectionLifting.lean @@ -0,0 +1,66 @@ +import OAI.NumberTheory.PiExponent.Geometry.SectionCartierRegular + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits +open PiExponentSeshadri.Geometry +open PiExponent.SectionZeroIdeal +variable {X Y : Scheme.{0}} + +theorem pullbackSection_surjective_of_unit_surjective (f : Y ⟶ X) (L : LineBundle X) + (h : Function.Surjective (fun s : GlobalSections X L.sheaf => + s ≫ PiExponentSeshadri.LineClosedUnit.map f L)) : + Function.Surjective (fun s : GlobalSections X L.sheaf => pullbackSection f s) := by + intro σ + let A := Scheme.Modules.pullbackPushforwardAdjunction f + let e := A.homEquiv (structureSheaf X) ((Scheme.Modules.pullback f).obj L.sheaf) + obtain ⟨s,hs⟩ := h (e ((pullbackUnitIso f).hom ≫ σ)) + have he : (Scheme.Modules.pullback f).map s = (pullbackUnitIso f).hom ≫ σ := by + apply e.injective + have hn := A.homEquiv_naturality_left s (𝟙 ((Scheme.Modules.pullback f).obj L.sheaf)) + simpa only [e, Category.comp_id, Adjunction.homEquiv_unit, Functor.map_id, + Category.comp_id] using! hn.trans hs + refine ⟨s,?_⟩ + change (pullbackUnitIso f).inv ≫ (Scheme.Modules.pullback f).map s = σ + exact (congrArg (fun t : (Scheme.Modules.pullback f).obj (structureSheaf X) ⟶ + (Scheme.Modules.pullback f).obj L.sheaf => (pullbackUnitIso f).inv ≫ t) he).trans + ((pullbackUnitIso f).inv_hom_id_assoc σ) + +theorem eventual_cartier_restriction_section_lifting + (p : X ⟶ Spec (CommRingCat.of ℂ)) (L : LineBundle X) + (s : GlobalSections X L.sheaf) [Mono s] + (hfinite : ∀ n, letI := Module.compHom (cohomology (L.pow n).sheaf 1) (baseScalars p) + FiniteDimensional ℂ (cohomology (L.pow n).sheaf 1)) + (hzero : ∃ N, ∀ n, N ≤ n → ∀ z : + cohomology ((Scheme.Modules.pullback (zeroIdeal L s).subschemeι).obj (L.pow (n+1)).sheaf) 1, + z = 0) : + ∃ N, ∀ n, N ≤ n → Function.Surjective + (fun t : GlobalSections X (L.pow (n+1)).sheaf => + pullbackSection (zeroIdeal L s).subschemeι t) := by + let i := (zeroIdeal L s).subschemeι + let F : ℕ → X.Modules := fun n => (L.pow n).sheaf + let Q : ℕ → X.Modules := fun n => (Scheme.Modules.pushforward i).obj + ((Scheme.Modules.pullback i).obj (L.pow (n+1)).sheaf) + let f : ∀ n, F n ⟶ F (n+1) := fun n => cartierPowerMultiply L s n + let g : ∀ n, F (n+1) ⟶ Q n := fun n => PiExponentSeshadri.LineClosedUnit.map i (L.pow (n+1)) + have hex := fun n => regular_cartierPower_restriction_shortExact p L s n + let hz : ∀ n, f n ≫ g n = 0 := fun n => (hex n).choose + have hshort : ∀ n, (ShortComplex.mk (f n) (g n) (hz n)).ShortExact := + fun n => (hex n).choose_spec + have hzero' : ∃ N, ∀ n, N ≤ n → ∀ z : cohomology (Q n) 1, z = 0 := by + obtain ⟨N,hN⟩ := hzero + refine ⟨N,fun n hn z => ?_⟩ + let e := ClosedImmersionSerreTransfer.cohomologyLinearEquiv i p + ((Scheme.Modules.pullback i).obj (L.pow (n+1)).sheaf) 1 + obtain ⟨w,rfl⟩ := e.surjective z + rw [hN n hn w,map_zero] + obtain ⟨N,hN⟩ := eventual_globalSections_surjective p F Q f g hz hshort hfinite hzero' + refine ⟨N,fun n hn => ?_⟩ + exact pullbackSection_surjective_of_unit_surjective i (L.pow (n+1)) (hN n hn) + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiStationarity.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiStationarity.lean new file mode 100644 index 0000000000000000000000000000000000000000..e53b942b54a60fca35b292748f9134a0f84b4f78 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NakaiStationarity.lean @@ -0,0 +1,91 @@ +import OAI.NumberTheory.PiExponent.Cohomology.CartierEulerPair +import OAI.NumberTheory.PiExponent.Cohomology.EulerTwistTransport +import OAI.NumberTheory.PiExponent.Cohomology.NakaiEulerGrowth +import OAI.NumberTheory.PiExponent.Cohomology.NoetherianAmpleSerreVanishing + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Filter +open PiExponentSeshadri.Geometry +open PiExponent.SectionZeroIdeal +variable {X Y : Scheme.{0}} +attribute [local irreducible] CartierEulerPair.middleIso lineTensorAssoc moduleTensorComm + pullbackCartierMiddleIso + +theorem eventual_closed_cartierMiddle_cohomology_zero + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (f : Y ⟶ X) [IsClosedImmersion f] (A L M : LineBundle X) + (hL : (L.pullback f).IsAmple) : + ∃ N, ∀ n, N ≤ n → ∀ q, 0 < q → ∀ z : cohomology + ((Scheme.Modules.pushforward f).obj + ((Scheme.Modules.pullback f).obj (A.tensor ((L.pow n).tensor M)).sheaf)) q, z = 0 := by + let T := (A.pullback f).tensor (M.pullback f) + let := PiExponent.GeometrySupport.LineBundleCoherent.lineBundle_isFinitePresentation T + obtain ⟨N,hN⟩ := GeometrySupport.NoetherianAmpleSerreVanishing.ample_serre_tensor_vanishing + (f ≫ p) (L.pullback f) hL T.sheaf + refine ⟨N,fun n hn q hq => ?_⟩ + apply (ClosedImmersionSerreTransfer.ext_zero_iff f + ((Scheme.Modules.pullback f).obj (A.tensor ((L.pow n).tensor M)).sheaf) q).mp + let e := pullbackCartierMiddleIso f A L M n ≪≫ + moduleTensorComm ((L.pullback f).pow n).sheaf T.sheaf + exact GeometrySupport.SerrePowerDescent.ext_zero_of_iso e.symm q (hN n hn q hq) + +theorem eventual_mixedPower_cohomology_stationary + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (L B M : LineBundle X) + (s : GlobalSections X (L.tensor B).sheaf) (t : GlobalSections X B.sheaf) + [Mono s] [Mono t] + (hD : (L.pullback (zeroIdeal (L.tensor B) s).subschemeι).IsAmple) + (hE : (L.pullback (zeroIdeal B t).subschemeι).IsAmple) + (q : ℕ) (hq : 0 < q) : + ∃ N, ∀ n, N ≤ n → + cohomologyDimension p ((L.pow n).tensor M).sheaf (q+1) = + cohomologyDimension p ((L.pow N).tensor M).sheaf (q+1) := by + obtain ⟨D,hDN⟩ := eventual_closed_cartierMiddle_cohomology_zero p + (zeroIdeal (L.tensor B) s).subschemeι (L.tensor B) L M hD + obtain ⟨E,hEN⟩ := eventual_closed_cartierMiddle_cohomology_zero p + (zeroIdeal B t).subschemeι B L M hE + let N := max D E + have hstep (n : ℕ) (hn : N ≤ n) : + cohomologyDimension p ((L.pow n).tensor M).sheaf (q+1) = + cohomologyDimension p ((L.pow (n+1)).tensor M).sheaf (q+1) := by + have hnD : D ≤ n := (le_max_left D E).trans hn + have hnE : E ≤ n+1 := (le_max_right D E).trans (hn.trans (Nat.le_succ n)) + have hleft := cohomologyDimension_eq_of_quotient_vanishing p + (CartierEulerPair.leftComplex p L B M s n) + (CartierEulerPair.left_shortExact p L B M s n) q + (hDN n hnD q hq) (hDN n hnD (q+1) (by omega)) + have hright := cohomologyDimension_eq_of_quotient_vanishing p + (CartierEulerPair.rightComplex p L B M t n) + (CartierEulerPair.right_shortExact p L B M t n) q + (hEN (n+1) hnE q hq) (hEN (n+1) hnE (q+1) (by omega)) + exact hleft.trans hright.symm + refine ⟨N,fun n hn => ?_⟩ + obtain ⟨j,rfl⟩ := Nat.exists_eq_add_of_le hn + induction j with + | zero => simp + | succ j ih => + exact (hstep (N+j) (by omega)).symm.trans (ih (by omega)) + +theorem eventually_nonzero_mixedPower_sections_of_growth + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (L B M : LineBundle X) + (s : GlobalSections X (L.tensor B).sheaf) (t : GlobalSections X B.sheaf) + [Mono s] [Mono t] + (hD : (L.pullback (zeroIdeal (L.tensor B) s).subschemeι).IsAmple) + (hE : (L.pullback (zeroIdeal B t).subschemeι).IsAmple) + (d : ℕ) (hd : 1 ≤ d) + (hgrowth : Tendsto (fun n => eulerCharacteristic p d ((L.pow n).tensor M).sheaf) atTop atTop) : + ∀ᶠ n in atTop, ∃ s : GlobalSections X ((L.pow n).tensor M).sheaf, s ≠ 0 := by + apply eventually_nonzero_globalSection_of_eventually_stationary p + (fun n => ((L.pow n).tensor M).sheaf) d hd hgrowth + intro j hj hjd + obtain ⟨q,rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : j ≠ 0) + exact eventual_mixedPower_cohomology_stationary p L B M s t hD hE q (by omega) + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NefAmple.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NefAmple.lean new file mode 100644 index 0000000000000000000000000000000000000000..d56285d4403ba7f2ccd94a88deda4b116dcc5a51 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NefAmple.lean @@ -0,0 +1,123 @@ +import Mathlib + +namespace OAI + +open Set +open scoped Pointwise + +namespace PiExponent.NefAmple + +variable {E : Type*} [AddCommGroup E] [Module ℝ E] [TopologicalSpace E] + [IsTopologicalAddGroup E] [ContinuousConstSMul ℝ E] + +def nonnegativeCone {ι : Type*} (degree : ι → E →L[ℝ] ℝ) : ConvexCone ℝ E where + carrier := {x | ∀ i, 0 ≤ degree i x} + smul_mem' := by + intro c hc x hx i + simpa only [map_smul, smul_eq_mul] using mul_nonneg hc.le (hx i) + add_mem' := by + intro x hx y hy i + simpa only [map_add] using add_nonneg (hx i) (hy i) + +omit [IsTopologicalAddGroup E] [ContinuousConstSMul ℝ E] in +@[simp] theorem mem_nonnegativeCone {ι : Type*} (degree : ι → E →L[ℝ] ℝ) (x : E) : + x ∈ nonnegativeCone degree ↔ ∀ i, 0 ≤ degree i x := Iff.rfl + +omit [IsTopologicalAddGroup E] [ContinuousConstSMul ℝ E] in +theorem isClosed_nonnegativeCone {ι : Type*} (degree : ι → E →L[ℝ] ℝ) : + IsClosed (nonnegativeCone degree : Set E) := by + have heq : (nonnegativeCone degree : Set E) = ⋂ i, {x | 0 ≤ degree i x} := by + ext x + simp + rw [heq] + exact isClosed_iInter (fun i => isClosed_le continuous_const (degree i).continuous) + +omit [IsTopologicalAddGroup E] in + +theorem pos_smul_mem_interior (C : ConvexCone ℝ E) {x : E} + (hx : x ∈ interior (C : Set E)) {c : ℝ} (hc : 0 < c) : + c • x ∈ interior (C : Set E) := by + have hs : c • (C : Set E) ⊆ (C : Set E) := by + rintro _ ⟨y, hy, rfl⟩ + exact C.smul_mem hc hy + apply interior_mono hs + rw [interior_smul₀ hc.ne'] + exact smul_mem_smul_set hx + +omit [ContinuousConstSMul ℝ E] in + +theorem add_mem_interior (C : ConvexCone ℝ E) {x y : E} + (hx : x ∈ C) (hy : y ∈ interior (C : Set E)) : + x + y ∈ interior (C : Set E) := by + have hm : x + y ∈ (C : Set E) + interior (C : Set E) := add_mem_add hx hy + have hi : x + y ∈ interior ((C : Set E) + (C : Set E)) := + subset_interior_add_right hm + apply interior_mono (s := (C : Set E) + (C : Set E)) ?_ hi + rintro _ ⟨a, ha, b, hb, rfl⟩ + exact C.add_mem ha hb + +theorem positive_combination_mem_interior (C : ConvexCone ℝ E) {x y : E} + (hx : x ∈ C) (hy : y ∈ interior (C : Set E)) {a b : ℝ} + (ha : 0 < a) (hb : 0 < b) : + a • x + b • y ∈ interior (C : Set E) := + add_mem_interior C (C.smul_mem ha hx) (pos_smul_mem_interior C hy hb) + +theorem combination_denominator_pos {a σ : ℝ} (ha : 1 < a) (hσ : 0 < σ) : + 0 < a * (1 + σ) - 1 := by + have hp : 0 < a * σ := mul_pos (zero_lt_one.trans ha) hσ + nlinarith + +omit [TopologicalSpace E] [IsTopologicalAddGroup E] [ContinuousConstSMul ℝ E] in + +theorem interpolation_divisor_identity (A F : E) {a σ : ℝ} + (ha : 1 < a) (hσ : 0 < σ) : + ((a - 1) / (a * (1 + σ) - 1)) • (A - (1 + σ) • F) + + (σ / (a * (1 + σ) - 1)) • (a • A - F) = A - F := by + have hd : a * (1 + σ) - 1 ≠ 0 := (combination_denominator_pos ha hσ).ne' + have hA : (a - 1) / (a * (1 + σ) - 1) + + σ / (a * (1 + σ) - 1) * a = 1 := by field_simp; ring + have hF : ((a - 1) / (a * (1 + σ) - 1)) * (1 + σ) + + σ / (a * (1 + σ) - 1) = 1 := by field_simp; ring + calc + _ = ((a - 1) / (a * (1 + σ) - 1) + σ / (a * (1 + σ) - 1) * a) • A - + (((a - 1) / (a * (1 + σ) - 1)) * (1 + σ) + σ / (a * (1 + σ) - 1)) • F := by + simp only [smul_sub, smul_smul] + rw [add_smul, add_smul] + abel + _ = A - F := by rw [hA, hF, one_smul, one_smul] + +theorem interpolation_divisor_mem_interior (C : ConvexCone ℝ E) (A F : E) + {a σ : ℝ} (ha : 1 < a) (hσ : 0 < σ) + (hne : A - (1 + σ) • F ∈ C) + (hin : a • A - F ∈ interior (C : Set E)) : + A - F ∈ interior (C : Set E) := by + have hd := combination_denominator_pos ha hσ + rw [← interpolation_divisor_identity A F ha hσ] + exact positive_combination_mem_interior C hne hin + (div_pos (sub_pos.mpr ha) hd) (div_pos hσ hd) + +omit [IsTopologicalAddGroup E] [ContinuousConstSMul ℝ E] in + +theorem interpolation_degree_margin (degree : E →L[ℝ] ℝ) (A F : E) + {a σ : ℝ} (ha : 1 < a) (hσ : 0 < σ) + (hne : 0 ≤ degree (A - (1 + σ) • F)) : + (σ / (a * (1 + σ) - 1)) * degree (a • A - F) ≤ degree (A - F) := by + have hcoef : 0 < (a - 1) / (a * (1 + σ) - 1) := + div_pos (sub_pos.mpr ha) (combination_denominator_pos ha hσ) + have he := congrArg degree (interpolation_divisor_identity A F ha hσ) + simp only [map_add, map_smul, smul_eq_mul] at he + have hn := mul_nonneg hcoef.le hne + linarith + +omit [IsTopologicalAddGroup E] [ContinuousConstSMul ℝ E] in + +theorem interpolation_degree_pos (degree : E →L[ℝ] ℝ) (A F : E) + {a σ : ℝ} (ha : 1 < a) (hσ : 0 < σ) + (hne : 0 ≤ degree (A - (1 + σ) • F)) + (hpos : 0 < degree (a • A - F)) : 0 < degree (A - F) := + (mul_pos (div_pos hσ (combination_denominator_pos ha hσ)) hpos).trans_le + (interpolation_degree_margin degree A F ha hσ hne) + +end PiExponent.NefAmple + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NilpotentAmpleDescent.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NilpotentAmpleDescent.lean new file mode 100644 index 0000000000000000000000000000000000000000..05c2d8ce2b5f0232809a3846a12676879a490efd --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NilpotentAmpleDescent.lean @@ -0,0 +1,83 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleCommonDegree +import OAI.NumberTheory.PiExponent.Approximation.ClosedPowerSectionLifting +import OAI.NumberTheory.PiExponent.Cohomology.NilpotentIdealVanishing + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace +open PiExponentSeshadri.Frames +variable {X : Scheme.{0}} + +theorem isAffineOpen_of_fullSupport_preimage [IsNoetherian X] + (I : X.IdealSheafData) (hI : I.support = ⊤) (U : X.Opens) + (hU : IsAffineOpen (I.subschemeι ⁻¹ᵁ U)) : IsAffineOpen U := by + let : IsLocallyNoetherian U.toScheme := LocallyOfFiniteType.isLocallyNoetherian U.ι + let : NoetherianSpace U.toScheme := U.ι.isOpenEmbedding.isInducing.noetherianSpace + let : CompactSpace U.toScheme := NoetherianSpace.compactSpace U.toScheme + let : IsNoetherian U.toScheme := {} + let J := I.comap U.ι + have hJ : J.support = ⊤ := by + dsimp only [J] + rw [Scheme.IdealSheafData.support_comap, hI] + rfl + let e : J.subscheme ≅ (I.subschemeι ⁻¹ᵁ U).toScheme := + I.comapIso U.ι ≪≫ pullbackSymmetry _ _ ≪≫ pullbackRestrictIsoRestrict I.subschemeι U + let : IsAffine (I.subschemeι ⁻¹ᵁ U).toScheme := hU + let : IsAffine J.subscheme := IsAffine.of_isIso e.hom + exact isAffine_of_fullSupport J hJ + +theorem fullSupport_eventual_powerSection_surjective [IsNoetherian X] + {R : Type} [CommRing R] [IsNoetherianRing R] + (p : X ⟶ Spec (CommRingCat.of R)) [IsProper p] + (I : X.IdealSheafData) (hI : I.support = ⊤) + (L : LineBundle X) (hL : (L.pullback I.subschemeι).IsAmple) : + ∃ B, ∀ n, B ≤ n → Function.Surjective (pullbackPowerSection L I.subschemeι n) := by + obtain ⟨B,hB⟩ := fullSupport_eventual_ideal_twist_ext_zero p I hI L hL + exact ⟨B, fun n hn => pullbackPowerSection_surjective_of_ideal_ext_zero I.subschemeι L n + (hB n hn 1 (by decide))⟩ + +theorem LineBundle.isAmple_of_fullSupport [IsNoetherian X] + {R : Type} [CommRing R] [IsNoetherianRing R] + (p : X ⟶ Spec (CommRingCat.of R)) [IsProper p] + (I : X.IdealSheafData) (hI : I.support = ⊤) + (L : LineBundle X) (hL : (L.pullback I.subschemeι).IsAmple) : L.IsAmple := by + obtain ⟨B,hB⟩ := fullSupport_eventual_powerSection_surjective p I hI L hL + intro x V hx + obtain ⟨y,hy⟩ := subscheme_surjective_of_fullSupport I hI x + have hyV : y ∈ I.subschemeι ⁻¹ᵁ V := by change I.subschemeι y ∈ V; rwa [hy] + obtain ⟨d,hd,s,hys,hsV,hsa⟩ := hL y (I.subschemeι ⁻¹ᵁ V) hyV + let m := B+1 + have hm : 0 < m := Nat.succ_pos B + let σ : GlobalSections I.subscheme ((L.pullback I.subschemeι).pow (d*m)).sheaf := + powerSection s m ≫ (linePowerMul (L.pullback I.subschemeι) d m).hom + have hσ : sectionOpen I.subscheme σ = sectionOpen I.subscheme s := by + exact (PiExponent.AmpleIso.sectionOpen_postcomp_iso + (powerSection s m) (linePowerMul (L.pullback I.subschemeι) d m)).trans + (((L.pullback I.subschemeι).pow d).sectionOpen_power s hm) + have hBd : B ≤ d*m := (Nat.le_succ B).trans (Nat.le_mul_of_pos_left m hd) + obtain ⟨t,ht⟩ := hB (d*m) hBd σ + have hpre : I.subschemeι ⁻¹ᵁ sectionOpen X t = sectionOpen I.subscheme s := by + exact (sectionOpen_pullbackPowerSection L I.subschemeι (d*m) t).symm.trans + ((congrArg (fun u : GlobalSections I.subscheme + ((L.pullback I.subschemeι).pow (d*m)).sheaf => sectionOpen I.subscheme u) ht).trans hσ) + refine ⟨d*m, Nat.mul_pos hd hm, t, ?_, ?_, ?_⟩ + · have hyT : y ∈ I.subschemeι ⁻¹ᵁ sectionOpen X t := by rw [hpre]; exact hys + change I.subschemeι y ∈ sectionOpen X t at hyT + rwa [hy] at hyT + · intro z hz + obtain ⟨w,hw⟩ := subscheme_surjective_of_fullSupport I hI z + have hwT : w ∈ I.subschemeι ⁻¹ᵁ sectionOpen X t := by change I.subschemeι w ∈ sectionOpen X t; rwa [hw] + rw [hpre] at hwT + have hwV := hsV hwT + change I.subschemeι w ∈ V at hwV + rwa [hw] at hwV + · apply isAffineOpen_of_fullSupport_preimage I hI + rw [hpre] + exact hsa + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NoetherianAmpleProjectiveSections.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NoetherianAmpleProjectiveSections.lean new file mode 100644 index 0000000000000000000000000000000000000000..01575c1302e83aea49f79d93f26197381d9d05d3 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NoetherianAmpleProjectiveSections.lean @@ -0,0 +1,112 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleProjectiveSections +import OAI.NumberTheory.PiExponent.Approximation.NoetherianPowerExtension + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.Geometry + +section +open CategoryTheory AlgebraicGeometry TopologicalSpace MvPolynomial +open scoped AlgebraicGeometry +open PiExponentSeshadri.Frames PiExponentSeshadri.Projective +variable {X : Scheme} {K ι : Type} [CommRing K] [Fintype ι] + +theorem LineBundle.power_section_embedding_noetherian [NoetherianSpace X] + (p : X ⟶ Spec (CommRingCat.of K)) [IsProper p] (L : LineBundle X) + (s : ι → GlobalSections X L.sheaf) + (hc : (⨆ i, sectionOpen X (s i)) = ⊤) + (haff : ∀ i, IsAffineOpen (sectionOpen X (s i))) : + ∃ n : ℕ, 0 < n ∧ ∃ σ : Type, ∃ _ : Fintype σ, + ∃ t : σ → GlobalSections X (modulePow X L.sheaf n), + ∃ ht : (⨆ i, SectionOpens.isoOpen (t i)) = ⊤, + IsClosedImmersion (sectionsMorphism + (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of K)).inv.hom) t ht) := by + classical + let k := p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of K)).inv.hom + let U (i : ι) := sectionOpen X (s i) + have hfinite (i : ι) : ∃ m : ℕ, ∃ b : Fin m → Γ((U i).toScheme, ⊤), + Function.Surjective (eval₂Hom ((U i).ι.appTop.hom.comp k) b) := by + let : IsAffine (U i).toScheme := haff i + obtain ⟨m, b, hb⟩ := affine_coordinate_generators ((U i).ι ≫ p) + refine ⟨m, b, ?_⟩ + simpa only [Scheme.Hom.comp_appTop, CommRingCat.hom_comp, RingHom.comp_assoc, k] using hb + choose m b hb using hfinite + choose N hN using fun i j => L.noetherian_power_extension_ratio (s i) (b i j) + let n := max 1 (Finset.univ.sup (fun v : (i : ι) × Fin (m i) => N v.1 v.2)) + have hn : 0 < n := lt_of_lt_of_le Nat.zero_lt_one (le_max_left _ _) + have hn' (i : ι) (j : Fin (m i)) : N i j ≤ n := + (Finset.le_sup (f := fun v : (i : ι) × Fin (m i) => N v.1 v.2) + (Finset.mem_univ ⟨i, j⟩)).trans (le_max_right _ _) + choose t ht using fun i j => hN i j n (hn' i j) + let σ := ι ⊕ ((i : ι) × Fin (m i)) + let S : σ → GlobalSections X (modulePow X L.sheaf n) := + Sum.elim (fun i => powerSection (s i) n) (fun v => t v.1 v.2) + have hU (i : ι) : SectionOpens.isoOpen (S (Sum.inl i)) = U i := + L.sectionOpen_power (s i) hn + have hSn (i : ι) : IsIso (restrictSection (U i).ι (S (Sum.inl i))) := + isIso_restricted_section _ _ (hU i) + let e (i : ι) : (modulePow X L.sheaf n).restrict (U i).ι ≅ O (U i).toScheme := + (asIso (restrictSection (U i).ι (S (Sum.inl i)))).symm + have hnorm (i : ι) : coefficient (e i) (restrictSection (U i).ι (S (Sum.inl i))) = 1 := + coefficient_frame (e i) + have hS : (⨆ v, SectionOpens.isoOpen (S v)) = ⊤ := by + apply top_unique + rw [← hc] + apply iSup_le + intro i + exact (le_of_eq (hU i).symm).trans (le_iSup (fun v : σ => SectionOpens.isoOpen (S v)) (Sum.inl i)) + have hproper : IsProper (X.toSpecΓ ≫ Spec.map (CommRingCat.ofHom k)) := by + rw [toSpec_scalarMap] + infer_instance + have hgen (i : ι) : Function.Surjective + (eval₂Hom ((U i).ι.appTop.hom.comp k) + (fun v => coefficient (e i) (restrictSection (U i).ι (S v)))) := by + have heq : (fun v => coefficient (e i) (restrictSection (U i).ι (S v))) ∘ + (fun j : Fin (m i) => Sum.inr (⟨i, j⟩ : (i : ι) × Fin (m i))) = b i := by + funext j + exact coefficient_ratio (e i) (S (Sum.inl i)) (S (Sum.inr ⟨i, j⟩)) (b i j) + (hnorm i) (ht i j) + intro r + obtain ⟨q, hq⟩ := hb i r + refine ⟨rename (fun j : Fin (m i) => Sum.inr (⟨i, j⟩ : (i : ι) × Fin (m i))) q, ?_⟩ + rw [eval₂Hom_rename, heq] + exact hq + have hclosed := framedSectionsMorphism_closed k S U hc e Sum.inl hnorm hU + (fun i => haff i) hgen + rw [framedSectionsMorphism_eq_sectionsMorphism k S hS U hc e Sum.inl hnorm] at hclosed + exact ⟨n, hn, σ, inferInstance, S, hS, hclosed⟩ + +end + +open AlgebraicGeometry CategoryTheory TopologicalSpace +open scoped AlgebraicGeometry +open PiExponentSeshadri.Frames PiExponentSeshadri.Projective +variable {X : Scheme} {K : Type} [CommRing K] + +theorem LineBundle.ample_projective_sections_noetherian [NoetherianSpace X] + (p : X ⟶ Spec (CommRingCat.of K)) [IsProper p] + (L : LineBundle X) (hL : L.IsAmple) : + ∃ n : ℕ, 0 < n ∧ ∃ σ : Type, ∃ _ : Fintype σ, + ∃ t : σ → GlobalSections X (modulePow X L.sheaf n), + ∃ ht : (⨆ i, SectionOpens.isoOpen (t i)) = ⊤, + IsClosedImmersion (sectionsMorphism + (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of K)).inv.hom) t ht) := by + obtain ⟨d, hd, l, s, hc, ha, -⟩ := L.ample_common_degree_cover hL + obtain ⟨n, hn', σ, hσ, t, ht, he⟩ := (L.pow d).power_section_embedding_noetherian p s hc ha + let e : modulePow X (L.pow d).sheaf n ≅ modulePow X L.sheaf (d * n) := + linePowerMul L d n + let T : σ → GlobalSections X (modulePow X L.sheaf (d*n)) := fun i => t i ≫ e.hom + have hT : (⨆ i, SectionOpens.isoOpen (T i)) = ⊤ := by + exact (iSup_congr (fun i => SectionOpens.isoOpen_postcomp (t i) e)).trans ht + refine ⟨d*n, Nat.mul_pos hd hn', σ, hσ, T, hT, ?_⟩ + have htransport := sectionsMorphism_transport + (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of K)).inv.hom) t ht e hT + exact htransport.symm ▸ he + +end PiExponentSeshadri.Geometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NumericalAmpleness.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NumericalAmpleness.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b8ae47ba3bf8ae732d937f1634eb804277ed044 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NumericalAmpleness.lean @@ -0,0 +1,80 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleIso +import OAI.NumberTheory.PiExponent.Approximation.FrameSections + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section + +open CategoryTheory AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open scoped AlgebraicGeometry + +theorem open_eq_top_of_subsingleton {X : Scheme} [Subsingleton X] + (U : X.Opens) (x : X) (hx : x ∈ U) : U = ⊤ := by + apply top_unique + intro y _ + simpa only [Subsingleton.elim y x] using hx + +theorem exists_global_frame_of_top_frame {X : Scheme} (M : X.Modules) + (e : M.restrict (⊤ : X.Opens).ι ≅ O (⊤ : X.Opens).toScheme) : + ∃ s : GlobalSections X M, sectionOpen X s = ⊤ := by + let s := (moduleSectionEquiv M).symm (openSectionEquiv M ⊤ e.inv) + have hs : restrictSection (⊤ : X.Opens).ι s = e.inv := by + apply (openSectionEquiv M ⊤).injective + rw [openSectionEquiv_restrict] + exact (moduleSectionEquiv M).apply_symm_apply _ + have hi : IsIso (restrictSection (⊤ : X.Opens).ι s) := by rw [hs]; infer_instance + let := (Scheme.Modules.restrictUnitIso (⊤ : X.Opens).ι).isIso_inv + have hi' : IsIso ((Scheme.Modules.restrictFunctor (⊤ : X.Opens).ι).map s) := by + exact (isIso_comp_left_iff (Scheme.Modules.restrictUnitIso (⊤ : X.Opens).ι).inv _).mp hi + refine ⟨s, top_unique ?_⟩ + exact le_iSup_of_le ⊤ (le_iSup_of_le hi' le_rfl) + +theorem isAmple_of_subsingleton {X : Scheme} [Subsingleton X] + (L : LineBundle X) : L.IsAmple := by + intro x V hx + have hV : V = ⊤ := open_eq_top_of_subsingleton V x hx + obtain ⟨U, hxU, ⟨e⟩⟩ := (L.pow 1).locallyRankOne x + have hU : U = ⊤ := open_eq_top_of_subsingleton U x hxU + subst U + obtain ⟨s, hs⟩ := exists_global_frame_of_top_frame (L.pow 1).sheaf e + change GlobalSections X (modulePow X L.sheaf 1) at s + change sectionOpen X s = ⊤ at hs + obtain ⟨W, hWa, hxW, -⟩ := exists_isAffineOpen_mem_and_subset (Opens.mem_top x) + have hW : W = ⊤ := open_eq_top_of_subsingleton W x hxW + refine ⟨1, by decide, s, ?_, ?_, ?_⟩ + · rw [hs]; trivial + · rw [hs, hV] + · rw [hs, ← hW]; exact hWa + +theorem isAmple_of_integral_dimension_zero {X : Scheme} + [IsIntegral X] [IsLocallyNoetherian X] (hdim : topologicalKrullDim X ≤ 0) + (L : LineBundle X) : L.IsAmple := by + let : IsLocallyArtinian X := IsLocallyArtinian.of_topologicalKrullDim_le_zero hdim + let : Subsingleton X := ⟨fun x y => + (PreirreducibleSpace.isPreirreducible_univ (X := X)).subsingleton + (Set.mem_univ x) (Set.mem_univ y)⟩ + exact isAmple_of_subsingleton L + +structure IntegralCurve (X : Scheme) where + scheme : Scheme + embedding : scheme ⟶ X + closedImmersion : IsClosedImmersion embedding + integral : IsIntegral scheme + dimension : topologicalKrullDim scheme = 1 + +attribute [instance] IntegralCurve.closedImmersion IntegralCurve.integral + +theorem no_integralCurve_of_dimension_zero {X : Scheme} + (hdim : topologicalKrullDim X ≤ 0) : IsEmpty (IntegralCurve X) := by + refine ⟨fun C => ?_⟩ + have hh := C.embedding.isClosedEmbedding.isEmbedding.topologicalKrullDim_le + rw [C.dimension] at hh + have : (1 : WithBot ℕ∞) ≤ 0 := hh.trans hdim + norm_num at this + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/NumericalAmplenessTheorem.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/NumericalAmplenessTheorem.lean new file mode 100644 index 0000000000000000000000000000000000000000..91aa1829910410a5a07dc8f9f0facdce21c30075 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/NumericalAmplenessTheorem.lean @@ -0,0 +1,75 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleFiniteProjectiveEmbedding +import OAI.NumberTheory.PiExponent.Ampleness.IntegralComponentAmple +import OAI.NumberTheory.PiExponent.Ampleness.ProperAmpleFiniteDimension +import OAI.NumberTheory.PiExponent.Ampleness.ZeroDimensionalAmple +import OAI.NumberTheory.PiExponent.Cohomology.NumericalEulerSlopeInputs + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry + +theorem isAmple_of_uniform_curve_margin_dimension (d : ℕ) : + ∀ {X : Scheme.{0}} [IsNoetherian X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (H L : LineBundle X), H.IsAmple → topologicalKrullDim X ≤ d → + ∀ ε : ℝ, 0 < ε → + (∀ C : IntegralCurve X, + ε * (curveDegree p H C : ℝ) ≤ (curveDegree p L C : ℝ)) → L.IsAmple := by + induction d with + | zero => + intro X _ p _ H L hH hdim ε hε hmargin + exact isAmple_of_proper_dimension_zero p (by simpa using hdim) L + | succ d ih => + have hintegral : ∀ {Y : Scheme.{0}} [IsNoetherian Y] [IsIntegral Y] + (p : Y ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (H L : LineBundle Y), H.IsAmple → topologicalKrullDim Y ≤ ((d+1:ℕ):WithBot ℕ∞) → + ∀ ε : ℝ, 0 < ε → + (∀ C : IntegralCurve Y, + ε * (curveDegree p H C : ℝ) ≤ (curveDegree p L C : ℝ)) → L.IsAmple := by + intro Y _ _ p _ H L hH hdim ε hε hmargin + by_cases hsmall : topologicalKrullDim Y ≤ d + · exact ih p H L hH hsmall ε hε hmargin + have heq : topologicalKrullDim Y = ((d+1:ℕ):WithBot ℕ∞) := by + apply le_antisymm hdim + have hnot : ¬ topologicalKrullDim Y < (d:WithBot ℕ∞)+1 := by + simpa only [ENat.WithBot.lt_add_one_iff] using hsmall + simpa only [Nat.cast_add, Nat.cast_one] using le_of_not_gt hnot + obtain ⟨r, i, hiClosed, hi⟩ := ample_finite_projective_embedding p H hH + let : IsClosedImmersion i := hiClosed + apply isAmple_of_lower_numerical_criterion p r i hi H L hH d heq _ ε hε hmargin + intro I hI M δ hδ hM + let : IsLocallyNoetherian I.subscheme := + LocallyOfFiniteType.isLocallyNoetherian I.subschemeι + let : CompactSpace I.subscheme := QuasiCompact.compactSpace_of_compactSpace I.subschemeι + let : IsNoetherian I.subscheme := {} + exact ih (I.subschemeι ≫ p) (H.pullback I.subschemeι) M + (hH.pullback_closedImmersion H I.subschemeι) hI δ hδ hM + intro X _ p _ H L hH hdim ε hε hmargin + apply isAmple_of_integral_closed_restrictions p L H hH + intro Y _ j _ + let : IsLocallyNoetherian Y := LocallyOfFiniteType.isLocallyNoetherian j + let : CompactSpace Y := QuasiCompact.compactSpace_of_compactSpace j + let : IsNoetherian Y := {} + apply hintegral (j ≫ p) (H.pullback j) (L.pullback j) + (hH.pullback_closedImmersion H j) + ((ProperAmpleFiniteDimension.closedImmersion_dimension_le j).trans hdim) ε hε + exact uniform_curve_margin_restrict p L H ε hmargin j + +theorem isAmple_of_uniform_curve_margin {X : Scheme.{0}} + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (H L : LineBundle X) (hH : H.IsAmple) (ε : ℝ) (hε : 0 < ε) + (hmargin : ∀ C : IntegralCurve X, + ε * (curveDegree p H C : ℝ) ≤ (curveDegree p L C : ℝ)) : L.IsAmple := by + let : IsLocallyNoetherian X := LocallyOfFiniteType.isLocallyNoetherian p + let : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace p + let : IsNoetherian X := {} + obtain ⟨d,hd⟩ := ProperAmpleFiniteDimension.exists_dimension_bound_of_proper_ample p H hH + exact isAmple_of_uniform_curve_margin_dimension d p H L hH hd ε hε hmargin + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ProjectiveO1Ample.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ProjectiveO1Ample.lean new file mode 100644 index 0000000000000000000000000000000000000000..b855ae5dab8ada8a717729a84dc8f79001911a84 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ProjectiveO1Ample.lean @@ -0,0 +1,26 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleFromCover +import OAI.NumberTheory.PiExponent.Geometry.ProjectiveO1Identity +import OAI.NumberTheory.PiExponent.Geometry.ProjectiveSpaceIntegral + +namespace OAI + +noncomputable section + +namespace PiExponent.ProjectiveO1 + +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry + +variable {R σ : Type} [CommRing R] [IsDomain R] [Finite σ] [Nonempty σ] + +theorem lineBundle_ample : (lineBundle (R := R) (σ := σ)).IsAmple := by + let : CompactSpace (projectiveSpace R σ) := + QuasiCompact.compactSpace_of_compactSpace (polynomialProjectiveProjection R σ) + exact LineBundle.ample_of_affine_section_cover (lineBundle (R := R) (σ := σ)) + coordinateSection coordinateSection_cover coordinateSection_isAffineOpen + +end PiExponent.ProjectiveO1 + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ProperAmpleFiniteDimension.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ProperAmpleFiniteDimension.lean new file mode 100644 index 0000000000000000000000000000000000000000..dcf5d6e433bc4a303943d3f0ebef2e6a60db715e --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ProperAmpleFiniteDimension.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.PiExponent.Ampleness.NoetherianAmpleProjectiveSections +import OAI.NumberTheory.PiExponent.Geometry.ProjectiveSpaceBasics + +namespace OAI + +noncomputable section +namespace PiExponent.ProperAmpleFiniteDimension +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.Projective + +section Graded +variable {A S : Type*} [CommRing A] [SetLike S A] [AddSubmonoidClass S A] + (G : ℕ → S) [GradedRing G] + +def projectivePrime : ProjectiveSpectrum G → PrimeSpectrum A := + fun x => ⟨x.asHomogeneousIdeal.toIdeal, x.isPrime⟩ + +theorem projectivePrime_isInducing : Topology.IsInducing (projectivePrime G) := by + constructor + apply TopologicalSpace.ext_isClosed + intro Z + rw [ProjectiveSpectrum.isClosed_iff_zeroLocus, isClosed_induced_iff] + constructor + · rintro ⟨s,rfl⟩ + exact ⟨PrimeSpectrum.zeroLocus s, PrimeSpectrum.isClosed_zeroLocus s, rfl⟩ + · rintro ⟨T,hT,hTZ⟩ + obtain ⟨s,rfl⟩ := (PrimeSpectrum.isClosed_iff_zeroLocus T).mp hT + exact ⟨s,hTZ.symm⟩ + +theorem projectiveSpectrum_dimension_le : + topologicalKrullDim (ProjectiveSpectrum G) ≤ ringKrullDim A := by + simpa only [PrimeSpectrum.topologicalKrullDim_eq_ringKrullDim] using + (projectivePrime_isInducing G).topologicalKrullDim_le +end Graded + +theorem projectiveSpace_dimension_le_card (K σ : Type) [Field K] [Finite σ] : + topologicalKrullDim (ProjectiveO1.projectiveSpace K σ) ≤ Nat.card σ := by + let := MvPolynomial.gradedAlgebra (R := K) (σ := σ) + change topologicalKrullDim (ProjectiveSpectrum (PolyGrade K σ)) ≤ _ + have h := projectiveSpectrum_dimension_le (PolyGrade K σ) + simpa only [MvPolynomial.ringKrullDim_of_isNoetherianRing_of_finite, + ringKrullDim_eq_zero_of_field, zero_add] using h + +theorem closedImmersion_dimension_le {X Y : Scheme} (i : X ⟶ Y) + [IsClosedImmersion i] : topologicalKrullDim X ≤ topologicalKrullDim Y := + i.isEmbedding.isInducing.topologicalKrullDim_le + +theorem exists_dimension_bound_of_proper_ample {X : Scheme.{0}} + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (H : LineBundle X) (hH : H.IsAmple) : + ∃ d : ℕ, topologicalKrullDim X ≤ (d : WithBot ℕ∞) := by + classical + let : IsLocallyNoetherian X := LocallyOfFiniteType.isLocallyNoetherian p + let : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace p + let : IsNoetherian X := ⟨⟩ + obtain ⟨n, hn, σ, hσ, s, hs, hclosed⟩ := H.ample_projective_sections_noetherian p hH + let : Fintype σ := hσ + let k := p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of ℂ)).inv.hom + let i : X ⟶ ProjectiveO1.projectiveSpace ℂ σ := sectionsMorphism k s hs + have : IsClosedImmersion i := hclosed + exact ⟨Nat.card σ, (closedImmersion_dimension_le i).trans + (projectiveSpace_dimension_le_card ℂ σ)⟩ + +end PiExponent.ProperAmpleFiniteDimension + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReducedComponentAmple.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReducedComponentAmple.lean new file mode 100644 index 0000000000000000000000000000000000000000..0fc685ff6a67e5f58c1ab0ed4aa1e7ae74fbaf17 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReducedComponentAmple.lean @@ -0,0 +1,108 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ClosedAmpleBaseChange +import OAI.NumberTheory.PiExponent.Ampleness.ComponentAmpleDescent +import OAI.NumberTheory.PiExponent.Geometry.CurveComponentMultiplicity + +namespace OAI + +noncomputable section +namespace PiExponent.ReducedComponentAmple +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry + +variable {R : Type} [CommRing R] [IsNoetherianRing R] + +theorem isAmple_of_finite_closed_cover {ι : Type*} (s : Finset ι) : + ∀ {X : Scheme.{0}} [IsNoetherian X] [IsReduced X] + (p : X ⟶ Spec (CommRingCat.of R)) [IsProper p] + (L H : LineBundle X), H.IsAmple → + ∀ I : ι → X.IdealSheafData, + (∀ x : X, ∃ i ∈ s, x ∈ (I i).support) → + (∀ i ∈ s, (L.pullback (I i).subschemeι).IsAmple) → L.IsAmple := by + classical + induction s using Finset.induction_on with + | empty => + intro X _ _ p _ L H hH I hcover hample x U hx + obtain ⟨i,hi,_⟩ := hcover x + simp at hi + | @insert i s hi ih => + intro X _ _ p _ L H hH I hcover hample + let Z : Closeds X := s.sup (fun j => (I j).support) + let J : X.IdealSheafData := Scheme.IdealSheafData.vanishingIdeal Z + have hJsupport : J.support = Z := by + ext x + simp only [J, Scheme.IdealSheafData.coe_support_vanishingIdeal] + let : IsLocallyNoetherian J.subscheme := + LocallyOfFiniteType.isLocallyNoetherian J.subschemeι + let : CompactSpace J.subscheme := + QuasiCompact.compactSpace_of_compactSpace J.subschemeι + let : IsNoetherian J.subscheme := {} + let : IsReduced J.subscheme := NumericalAmpleness.isReduced_vanishingIdeal_subscheme Z + have hH' : (H.pullback J.subschemeι).IsAmple := + LineBundle.IsAmple.pullback_closedImmersion H hH J.subschemeι + have hcoverJ : ∀ x : J.subscheme, ∃ j ∈ s, + x ∈ ((I j).comap J.subschemeι).support := by + intro x + have hx : J.subschemeι x ∈ Z := by + rw [← hJsupport] + exact x.property + have hx' : ∃ j ∈ s, J.subschemeι x ∈ ((I j).support : Set X) := by + change J.subschemeι x ∈ ((s.sup (fun j => (I j).support) : Closeds X) : Set X) at hx + rw [Closeds.coe_finset_sup] at hx + simpa only [Finset.sup_eq_iSup, Function.comp_apply, Set.iSup_eq_iUnion, + Set.mem_iUnion, exists_prop] using hx + obtain ⟨j,hj,hxj⟩ := hx' + refine ⟨j,hj,?_⟩ + rw [Scheme.IdealSheafData.support_comap] + change J.subschemeι x ∈ ((I j).support : Set X) + exact hxj + have hampleJ : ∀ j ∈ s, + ((L.pullback J.subschemeι).pullback ((I j).comap J.subschemeι).subschemeι).IsAmple := by + intro j hj + exact isAmple_comap_restriction (I j) J.subschemeι L + (hample j (Finset.mem_insert_of_mem hj)) + have hJ : (L.pullback J.subschemeι).IsAmple := + ih (J.subschemeι ≫ p) (L.pullback J.subschemeι) (H.pullback J.subschemeι) + hH' (fun j => (I j).comap J.subschemeι) hcoverJ hampleJ + apply PiExponentSeshadri.ComponentAmpleDescent.isAmple_of_reduced_closed_cover + p L H hH (I i) J ?_ (hample i (Finset.mem_insert_self _ _)) hJ + apply top_unique + intro x _ + change x ∈ ((I i).support : Set X) ∪ (J.support : Set X) + obtain ⟨j,hj,hxj⟩ := hcover x + rcases Finset.mem_insert.mp hj with rfl | hj + · exact Or.inl hxj + · apply Or.inr + rw [hJsupport] + exact (Finset.le_sup (f := fun j => (I j).support) hj) hxj + +theorem isAmple_of_reduced_components {X : Scheme.{0}} [IsNoetherian X] [IsReduced X] + (p : X ⟶ Spec (CommRingCat.of R)) [IsProper p] + (L H : LineBundle X) (hH : H.IsAmple) + (hcomponents : ∀ C : irreducibleComponents X, + (L.pullback (CurveCycle.reducedComponentι X C)).IsAmple) : L.IsAmple := by + classical + let : Finite (irreducibleComponents X) := + NoetherianSpace.finite_irreducibleComponents.to_subtype + let : Fintype (irreducibleComponents X) := Fintype.ofFinite _ + let I : irreducibleComponents X → X.IdealSheafData := fun C => + Scheme.IdealSheafData.vanishingIdeal + (⟨C.val, isClosed_of_mem_irreducibleComponents C.val C.property⟩ : Closeds X) + apply isAmple_of_finite_closed_cover Finset.univ p L H hH I + · intro x + have hx : x ∈ ⋃₀ irreducibleComponents X := by + rw [sUnion_irreducibleComponents] + trivial + obtain ⟨C,hC,hxC⟩ := hx + refine ⟨⟨C,hC⟩, Finset.mem_univ _, ?_⟩ + change x ∈ ((I ⟨C,hC⟩).support : Set X) + simp only [I, Scheme.IdealSheafData.coe_support_vanishingIdeal] + change x ∈ C + exact hxC + · intro C _ + exact hcomponents C + +end PiExponent.ReducedComponentAmple + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesExceptional.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesExceptional.lean new file mode 100644 index 0000000000000000000000000000000000000000..be465c3739bc5517317baeda3228cfff5a11e612 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesExceptional.lean @@ -0,0 +1,145 @@ +import OAI.NumberTheory.PiExponent.Ampleness.BlowupIdeal +import OAI.NumberTheory.PiExponent.Ampleness.ReesPushdown + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.ReesGrading +open Polynomial DirectSum AlgebraicGeometry CategoryTheory TopologicalSpace +universe u +variable {R : Type u} [CommRing R] (I : Ideal R) + +lemma generators_adjoin : Algebra.adjoin R (Set.range (generator I)) = ⊤ := by + apply (Subalgebra.map_injective (f := (reesAlgebra I).val) Subtype.val_injective) + rw [AlgHom.map_adjoin] + have hs : (reesAlgebra I).val '' Set.range (generator I) = + (Submodule.map (monomial 1 : R →ₗ[R] R[X]) I : Set R[X]) := by + ext p + constructor + · rintro ⟨_, ⟨a, rfl⟩, rfl⟩ + exact ⟨a.val, a.property, rfl⟩ + · rintro ⟨a, ha, rfl⟩ + exact ⟨generator I ⟨a, ha⟩, ⟨⟨a, ha⟩, rfl⟩, rfl⟩ + rw [hs, adjoin_monomial_eq_reesAlgebra] + rw [Algebra.map_top, Subalgebra.range_val] + +lemma generators_adjoin_zero : + Algebra.adjoin (piece I 0) (Set.range (generator I)) = ⊤ := by + apply top_unique + intro p hp + clear hp + have hh : p ∈ Algebra.adjoin R (Set.range (generator I)) := by + rw [generators_adjoin] + trivial + induction hh using Algebra.adjoin_induction with + | mem x hx => exact Algebra.subset_adjoin hx + | algebraMap r => + exact (Algebra.adjoin (piece I 0) (Set.range (generator I))).algebraMap_mem (zeroEquiv I r) + | add x y _ _ hx hy => exact add_mem hx hy + | mul x y _ _ hx hy => exact mul_mem hx hy + +lemma iSup_generator_basicOpen : + ⨆ a : I, Proj.basicOpen (piece I) (generator I a) = ⊤ := + Proj.iSup_basicOpen_eq_top' (piece I) (generator I) + (fun a => ⟨1, generator_mem I a⟩) (generators_adjoin_zero I) + +def chartCover : (affineBlowup I).AffineOpenCover where + I₀ := I + X a := CommRingCat.of (chart I a) + f a := Proj.awayι (m := 1) (piece I) (generator I a) (generator_mem I a) (show 0 < (1 : ℕ) from Nat.zero_lt_one) + map_prop a := inferInstanceAs (IsOpenImmersion + (Proj.awayι (m := 1) (piece I) (generator I a) (generator_mem I a) (show 0 < (1 : ℕ) from Nat.zero_lt_one))) + idx x := (Opens.mem_iSup.mp ((iSup_generator_basicOpen I).ge (Set.mem_univ x))).choose + covers x := by + change x ∈ (Proj.awayι (m := 1) (piece I) _ _ _).opensRange + rw [Proj.opensRange_awayι] + exact (Opens.mem_iSup.mp ((iSup_generator_basicOpen I).ge (Set.mem_univ x))).choose_spec + +lemma chartCover_projection (a : I) : + (chartCover I).f a ≫ projection I = Spec.map (CommRingCat.ofHom (chartBase I a)) := by + change Proj.awayι (m := 1) (piece I) (generator I a) _ _ ≫ + (Proj.toSpecZero (piece I) ≫ Spec.map (zeroIso I).hom) = _ + rw [← Category.assoc, Proj.awayι_toSpecZero, ← Spec.map_comp] + rfl + +end PiExponentSeshadri.ReesGrading +namespace PiExponentSeshadri.Geometry +open CategoryTheory AlgebraicGeometry + +def lineBundleOfCover {X : Scheme} (M : X.Modules) (C : X.OpenCover) + (h : ∀ i, Nonempty (M.restrict (C.f i) ≅ IdealModule.unit (C.X i))) : LineBundle X where + sheaf := M + locallyRankOne x := by + refine ⟨(C.f (C.idx x)).opensRange, C.covers x, ?_⟩ + exact ⟨IdealModule.frameOnRange M (C.f (C.idx x)) (h (C.idx x)).some⟩ + +def idealLineBundle {X : Scheme} (I : X.IdealSheafData) (C : X.AffineOpenCover) + (r : ∀ i, Γ(Spec (C.X i), ⊤)) + (h : ∀ i, (I.comap (C.f i)).ideal ⟨⊤, isAffineOpen_top _⟩ = Ideal.span {r i}) + (hr : ∀ i, IsLeftRegular (r i)) : LineBundle X := + lineBundleOfCover (IdealModule.closedModule I) C.openCover + (fun i => by + let : IsOpenImmersion (C.f i) := C.map_prop i + exact IdealModule.frame_restriction I (C.f i) (r i) (h i) (hr i)) + +end PiExponentSeshadri.Geometry +namespace PiExponentSeshadri.ReesGrading + +section +open CategoryTheory AlgebraicGeometry +universe u +variable {R : Type u} [CommRing R] (I : Ideal R) + +def exceptionalIdeal : (affineBlowup I).IdealSheafData := + (IdealPullback.specIdeal I).comap (projection I) + +def chartEquation (a : I) : Γ(Spec ((chartCover I).X a), ⊤) := + (Scheme.ΓSpecIso (CommRingCat.of (chart I a))).inv (chartBase I a a.val) + +lemma exceptional_chart (a : I) : + ((exceptionalIdeal I).comap ((chartCover I).f a)).ideal ⟨⊤, isAffineOpen_top _⟩ = + Ideal.span {chartEquation I a} := by + rw [exceptionalIdeal, ← Scheme.IdealSheafData.comap_comp, chartCover_projection] + erw [IdealPullback.specIdeal_comap, IdealPullback.specIdeal_top, map_ideal_principal, + Ideal.map_span, Set.image_singleton] + rfl + +lemma chartEquation_regular (a : I) : IsLeftRegular (chartEquation I a) := by + apply IdealModule.regular_map_flat _ _ (chart_generator_regular I a).left + exact RingHom.Flat.of_bijective (ConcreteCategory.bijective_of_isIso + (Scheme.ΓSpecIso (CommRingCat.of (chart I a))).inv) + +end + +open CategoryTheory AlgebraicGeometry +variable {R : Type} [CommRing R] (I : Ideal R) + +def exceptionalLineBundle : Geometry.LineBundle (affineBlowup I) := + Geometry.idealLineBundle (exceptionalIdeal I) (chartCover I) (chartEquation I) + (exceptional_chart I) (chartEquation_regular I) + +def exceptionalInclusion : (exceptionalLineBundle I).sheaf ⟶ IdealModule.unit (affineBlowup I) := + IdealModule.closedInclusion (exceptionalIdeal I) + +instance exceptionalInclusion_mono : Mono (exceptionalInclusion I) := by + exact inferInstanceAs (Mono (IdealModule.inclusion (exceptionalIdeal I).subschemeι)) + + + +lemma exceptional_presents : Geometry.PresentsPullbackIdeal (IdealPullback.specIdeal I) + (projection I) (exceptionalLineBundle I) (exceptionalInclusion I) := by + refine ⟨exceptionalInclusion_mono I, fun U V e => ?_⟩ + change ((IdealModule.closedInclusion (exceptionalIdeal I)).val.app (Opposite.op U.1)).hom.range = _ + rw [IdealModule.closed_image] + exact IdealPullback.comap_ideal (IdealPullback.specIdeal I) (projection I) U V e + +theorem exceptional_invertible : Geometry.InvertiblePullbackIdeal (IdealPullback.specIdeal I) + (projection I) := + ⟨exceptionalLineBundle I, exceptionalInclusion I, exceptional_presents I⟩ + +end PiExponentSeshadri.ReesGrading + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesExceptionalSheaf.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesExceptionalSheaf.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad3aeea3ae49332f65779b71bd4a55a2b4457c8a --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesExceptionalSheaf.lean @@ -0,0 +1,15 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesExceptional + +namespace OAI + +namespace PiExponentSeshadri.ReesGrading +noncomputable section +variable {R : Type} [CommRing R] (I : Ideal R) + +theorem exceptionalLineBundle_sheaf_eq : + (exceptionalLineBundle I).sheaf = IdealModule.closedModule (exceptionalIdeal I) := rfl + +end +end PiExponentSeshadri.ReesGrading + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFiniteCover.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFiniteCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ef88e08496192102614b7eebf0b81e9aed3a410 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFiniteCover.lean @@ -0,0 +1,63 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesExceptional +import OAI.NumberTheory.PiExponent.Ampleness.ReesPolynomialPresentation + +namespace OAI + +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace +namespace PiExponent.ReesFiniteCover +open PiExponentSeshadri.ReesGrading +variable {R J : Type} [CommRing R] (I : Ideal R) (a : J → I) +variable (ha : Ideal.span (Set.range fun j => (a j).val) = I) +local instance chartOpenImmersion (j : J) : IsOpenImmersion ((chartCover I).f (a j)) := + (chartCover I).map_prop (a j) +include ha + +theorem adjoin_eq_top : Algebra.adjoin R (Set.range fun j => generator I (a j)) = ⊤ := by + rw [Algebra.adjoin_range_eq_range_aeval] + apply top_unique + intro z hz + exact ReesPolynomialPresentation.presentation_surjective I a ha z + +theorem adjoin_zero_eq_top : + Algebra.adjoin (piece I 0) (Set.range fun j => generator I (a j)) = ⊤ := by + apply top_unique + intro z hz + clear hz + have hh : z ∈ Algebra.adjoin R (Set.range fun j => generator I (a j)) := by + rw [adjoin_eq_top I a ha] + trivial + induction hh using Algebra.adjoin_induction with + | mem x hx => exact Algebra.subset_adjoin hx + | algebraMap r => + exact (Algebra.adjoin (piece I 0) (Set.range fun j => generator I (a j))).algebraMap_mem + (zeroEquiv I r) + | add x y _ _ hx hy => exact add_mem hx hy + | mul x y _ _ hx hy => exact mul_mem hx hy + +theorem iSup_generator_basicOpen : + (⨆ j, Proj.basicOpen (piece I) (generator I (a j))) = ⊤ := + Proj.iSup_basicOpen_eq_top' (piece I) (fun j => generator I (a j)) + (fun j => ⟨1, generator_mem I (a j)⟩) (adjoin_zero_eq_top I a ha) + +theorem iSup_generator_opensRange : + (⨆ j, ((chartCover I).f (a j)).opensRange) = ⊤ := by + have h j : ((chartCover I).f (a j)).opensRange = + Proj.basicOpen (piece I) (generator I (a j)) := + Proj.opensRange_awayι (piece I) _ (generator_mem I (a j)) (by decide) + simp_rw [h] + exact iSup_generator_basicOpen I a ha + +def cover : (affineBlowup I).AffineOpenCover where + I₀ := J + X j := CommRingCat.of (chart I (a j)) + f j := (chartCover I).f (a j) + map_prop j := (chartCover I).map_prop (a j) + idx x := (Opens.mem_iSup.mp ((iSup_generator_opensRange I a ha).ge (Set.mem_univ x))).choose + covers x := + (Opens.mem_iSup.mp ((iSup_generator_opensRange I a ha).ge (Set.mem_univ x))).choose_spec + +end PiExponent.ReesFiniteCover +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedChart.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedChart.lean new file mode 100644 index 0000000000000000000000000000000000000000..8cfe8d6b2dbe155883abd52903392165c1abf9f4 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedChart.lean @@ -0,0 +1,72 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalAffineChart +import OAI.NumberTheory.PiExponent.Ampleness.ReesProductFrames + +namespace OAI + +namespace PiExponent.ReesFrozenChart +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.ReesGrading PiExponent.ReesProductChart +attribute [local irreducible] affineBlowup projection exceptionalLineBundle exceptionalInclusion exceptionalIdeal + PiExponentSeshadri.Geometry.LineBundle.pow +variable {R J : Type} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) (s : Finset J) + +omit [Fintype J] [DecidableEq J] in +theorem exists_coordinateRing : ∃ C : CommRingCat, C = CommRingCat.of (Chart I a s) := ⟨_,rfl⟩ +def coordinateRing : CommRingCat := (exists_coordinateRing I a s).choose +omit [Fintype J] [DecidableEq J] in +theorem coordinateRing_eq : coordinateRing I a s = CommRingCat.of (Chart I a s) := + (exists_coordinateRing I a s).choose_spec + +def coordinateEquiv : coordinateRing I a s ≃+* Chart I a s := + (eqToIso (coordinateRing_eq I a s)).commRingCatIsoToRingEquiv + +private abbrev coordinateInv : CommRingCat.of (Chart I a s) ⟶ coordinateRing I a s := + CommRingCat.ofHom (coordinateEquiv I a s).symm.toRingHom + +def base : R →+* coordinateRing I a s := + (coordinateInv I a s).hom.comp (ReesProductChart.chartBase I a s) + +instance coordinateInv_isIso : + IsIso (CommRingCat.ofHom (coordinateEquiv I a s).symm.toRingHom : + CommRingCat.of (Chart I a s) ⟶ coordinateRing I a s) := by + change IsIso (eqToIso (coordinateRing_eq I a s)).inv + infer_instance + +private local instance coordinateSpec_isIso : + IsIso (Spec.map (coordinateInv I a s)) := + inferInstanceAs (IsIso + (Scheme.Spec.mapIso (eqToIso (coordinateRing_eq I a s)).symm.op).hom) + +variable {s} (hs : s.Nonempty) +def chart : Spec (coordinateRing I a s) ⟶ affineBlowup I := + Spec.map (coordinateInv I a s) ≫ + ReesProductPowerSections.chartMorphism I a hs + +instance : IsOpenImmersion (chart I a hs) := by + exact IsOpenImmersion.comp _ _ + +theorem chart_projection : + chart I a hs ≫ projection I = Spec.map (CommRingCat.ofHom (base I a s)) := by + rw [chart, Category.assoc, ReesProductPowerSections.chartMorphism_projection] + exact (Spec.map_comp + (show CommRingCat.of R ⟶ CommRingCat.of (Chart I a s) from + CommRingCat.ofHom (ReesProductChart.chartBase I a s)) + (coordinateInv I a s)).symm + +theorem chart_opensRange : + (chart I a hs).opensRange = (ReesProductPowerSections.chartMorphism I a hs).opensRange := + Scheme.Hom.opensRange_comp_of_isIso _ _ + +def chartOpen : (affineBlowup I).affineOpens := + ⟨(chart I a hs).opensRange, isAffineOpen_opensRange _⟩ + +theorem chartOpen_eq : + (chartOpen I a hs).1 = (ReesProductPowerSections.chartOpen I a hs).1 := + chart_opensRange I a hs + +end +end PiExponent.ReesFrozenChart + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedFrames.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedFrames.lean new file mode 100644 index 0000000000000000000000000000000000000000..78158c6e09dd1dc8ac13a14ee1fc0af64034f9d2 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedFrames.lean @@ -0,0 +1,35 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesFixedChart + +namespace OAI + +namespace PiExponent.ReesFrozenChart +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.ReesGrading PiExponent.ReesProductChart +attribute [local irreducible] affineBlowup projection exceptionalLineBundle exceptionalInclusion exceptionalIdeal + PiExponentSeshadri.Geometry.LineBundle.pow +variable {R J : Type} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) {s : Finset J} (hs : s.Nonempty) + +theorem frame_nonempty_congr {X : Scheme} (M : X.Modules) {U V : X.Opens} + (h : U = V) + (he : Nonempty (M.restrict U.ι ≅ PiExponentSeshadri.Frames.O U.toScheme)) : + Nonempty (M.restrict V.ι ≅ PiExponentSeshadri.Frames.O V.toScheme) := by + subst V + exact he + +theorem chartFrame_nonempty {p : J} (hp : p ∈ s) : + Nonempty ((exceptionalLineBundle I).sheaf.restrict (chartOpen I a hs).1.ι ≅ + PiExponentSeshadri.Frames.O (chartOpen I a hs).1.toScheme) := + frame_nonempty_congr (exceptionalLineBundle I).sheaf (chartOpen_eq I a hs).symm + (ReesProductPowerSections.chartFrame_nonempty I a hs hp) + +def chartFrame {p : J} (hp : p ∈ s) : + (exceptionalLineBundle I).sheaf.restrict (chartOpen I a hs).1.ι ≅ + PiExponentSeshadri.Frames.O (chartOpen I a hs).1.toScheme := + (chartFrame_nonempty I a hs hp).some + +end +end PiExponent.ReesFrozenChart + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedPower.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedPower.lean new file mode 100644 index 0000000000000000000000000000000000000000..ae6013c7111fefb8d9c2259435fdca54966ffe1b --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedPower.lean @@ -0,0 +1,79 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesFixedChart +import OAI.NumberTheory.PiExponent.Ampleness.ReesProductPower + +namespace OAI + +namespace PiExponent.ReesFrozenPower +noncomputable section +open PiExponent.ReesFrozenChart +attribute [local instance] MvPolynomial.weightedGradedAlgebra +variable {R J : Type} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) (s : Finset J) + +omit [Fintype J] [DecidableEq J] in +theorem map_power_eq (n : ℕ) : + ((I^n).map (base I a s)).map (coordinateEquiv I a s).toRingHom = + (I^n).map (ReesProductChart.chartBase I a s) := by + rw [Ideal.map_map] + have he : (coordinateEquiv I a s).toRingHom.comp (base I a s) = + ReesProductChart.chartBase I a s := by + apply RingHom.ext + intro r + exact (coordinateEquiv I a s).apply_symm_apply _ + rw [he] + +omit [Fintype J] [DecidableEq J] in +theorem coordinate_mem_power (n : ℕ) (x : ((I^n).map (base I a s))) : + coordinateEquiv I a s x.val ∈ (I^n).map (ReesProductChart.chartBase I a s) := by + have hx := Ideal.mem_map_of_mem + (show coordinateRing I a s →+* ReesProductChart.Chart I a s from + (coordinateEquiv I a s).toRingHom) x.property + exact (congrArg (fun K : Ideal (ReesProductChart.Chart I a s) => + coordinateEquiv I a s x.val ∈ K) (map_power_eq I a s n)).mp hx + +omit [Fintype J] [DecidableEq J] in +theorem inverse_map_power_eq (n : ℕ) : + ((I^n).map (ReesProductChart.chartBase I a s)).map (coordinateEquiv I a s).symm.toRingHom = + (I^n).map (base I a s) := by + rw [Ideal.map_map] + rfl + +omit [Fintype J] [DecidableEq J] in +theorem inverse_mem_power (n : ℕ) + (y : ((I^n).map (ReesProductChart.chartBase I a s))) : + (coordinateEquiv I a s).symm y.val ∈ (I^n).map (base I a s) := by + have hy := Ideal.mem_map_of_mem + (show ReesProductChart.Chart I a s →+* coordinateRing I a s from + (coordinateEquiv I a s).symm.toRingHom) y.property + exact (congrArg (fun K : Ideal (coordinateRing I a s) => + (coordinateEquiv I a s).symm y.val ∈ K) (inverse_map_power_eq I a s n)).mp hy + +def powerEquiv (n : ℕ) : ((I^n).map (base I a s)) ≃+ + ((I^n).map (ReesProductChart.chartBase I a s)) where + toFun x := ⟨coordinateEquiv I a s x.val, coordinate_mem_power I a s n x⟩ + invFun y := ⟨(coordinateEquiv I a s).symm y.val, inverse_mem_power I a s n y⟩ + left_inv x := Subtype.ext ((coordinateEquiv I a s).symm_apply_apply x.val) + right_inv y := Subtype.ext ((coordinateEquiv I a s).apply_symm_apply y.val) + map_add' x y := Subtype.ext (map_add (coordinateEquiv I a s) x.val y.val) + +omit [Fintype J] [DecidableEq J] in +@[simp] theorem powerEquiv_apply (n : ℕ) (z : ((I^n).map (base I a s))) : + (powerEquiv I a s n z).val = coordinateEquiv I a s z.val := rfl + +variable {s} + +def pieceEquiv {p : J} (hp : p ∈ s) (n : ℕ) : + ReesLocalizedIntersections.Piece I a s n ≃+ ((I^n).map (base I a s)) := + (ReesProductPower.chartPowerEquiv I a hp n).trans (powerEquiv I a s n).symm + +theorem coordinate_pieceEquiv {p : J} (hp : p ∈ s) (n : ℕ) + (z : ReesLocalizedIntersections.Piece I a s n) : + coordinateEquiv I a s (pieceEquiv I a hp n z).val = + (ReesProductPower.chartPowerMap I a hp n z).val := by + change (powerEquiv I a s n (pieceEquiv I a hp n z)).val = _ + exact congrArg Subtype.val ((powerEquiv I a s n).apply_symm_apply _) + +end +end PiExponent.ReesFrozenPower + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedPowerRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedPowerRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..bdcfd41af07b678e93faf854ba2bea37f78fd05e --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedPowerRestriction.lean @@ -0,0 +1,34 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesFixedPower +import OAI.NumberTheory.PiExponent.Ampleness.ReesFixedRestriction + +namespace OAI + +namespace PiExponent.ReesFrozenPower +noncomputable section +open PiExponent.ReesFrozenChart +attribute [local instance] MvPolynomial.weightedGradedAlgebra +variable {R J : Type} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) + +theorem pieceEquiv_restriction {s t : Finset J} {p r : J} (hp : p ∈ s) (hr : r ∈ t) + (hst : s ⊆ t) (n : ℕ) (z : ReesLocalizedIntersections.Piece I a s n) : + letI := ReesPolynomialPresentation.presentationAlgebra I a + letI := ReesGradedModule.gradedScalarAction I a + (pieceEquiv I a hr n (GradedCech.setRestriction + (GradedPolynomialLaurent.grading (J := J) (R := R)) (ReesGradedModule.integerPiece I) + MvPolynomial.X GradedPolynomialLaurent.variable_mem hst n z)).val = + restriction I a hst (pieceEquiv I a hp n z).val := by + let := ReesPolynomialPresentation.presentationAlgebra I a + let := ReesGradedModule.gradedScalarAction I a + apply (coordinateEquiv I a t).injective + rw [coordinate_pieceEquiv, ReesProductRestriction.chartPowerMap_restriction I a hp hr hst n] + change ReesProductRestriction.chartRestriction I a hst + (ReesProductPower.chartPowerMap I a hp n z).val = _ + simp only [restriction, RingHom.comp_apply, RingEquiv.toRingHom_eq_coe, + RingEquiv.coe_toRingHom, RingEquiv.apply_symm_apply] + rw [coordinate_pieceEquiv] + +end +end PiExponent.ReesFrozenPower + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec49ee24b3748c105d277c05f7e16ccc6edef73e --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesFixedRestriction.lean @@ -0,0 +1,54 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesFixedChart +import OAI.NumberTheory.PiExponent.Ampleness.ReesProductSchemeRestriction + +namespace OAI + +namespace PiExponent.ReesFrozenChart +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.ReesGrading PiExponent.ReesProductChart +attribute [local irreducible] affineBlowup projection +variable {R J : Type} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) + +def restriction {s t : Finset J} (hst : s ⊆ t) : coordinateRing I a s →+* coordinateRing I a t := + (coordinateEquiv I a t).symm.toRingHom.comp + ((ReesProductRestriction.chartRestriction I a hst).comp (coordinateEquiv I a s).toRingHom) + +theorem restriction_base {s t : Finset J} (hst : s ⊆ t) (r : R) : + restriction I a hst (base I a s r) = base I a t r := by + simp only [restriction, base, RingHom.comp_apply, RingEquiv.toRingHom_eq_coe, + RingEquiv.coe_toRingHom] + change (coordinateEquiv I a t).symm + (ReesProductRestriction.chartRestriction I a hst + ((coordinateEquiv I a s) + ((coordinateEquiv I a s).symm (ReesProductChart.chartBase I a s r)))) = + (coordinateEquiv I a t).symm (ReesProductChart.chartBase I a t r) + rw [RingEquiv.apply_symm_apply, ReesProductRestriction.chartRestriction_base] + +theorem restriction_chart {s t : Finset J} (hs : s.Nonempty) (ht : t.Nonempty) (hst : s ⊆ t) : + Spec.map (CommRingCat.ofHom (restriction I a hst)) ≫ chart I a hs = chart I a ht := by + have he : (restriction I a hst).comp (coordinateEquiv I a s).symm.toRingHom = + (coordinateEquiv I a t).symm.toRingHom.comp (ReesProductRestriction.chartRestriction I a hst) := by + apply RingHom.ext + intro z + simp only [restriction, RingHom.comp_apply, RingEquiv.toRingHom_eq_coe, + RingEquiv.coe_toRingHom, RingEquiv.apply_symm_apply] + have heCat : + (CommRingCat.ofHom (coordinateEquiv I a s).symm.toRingHom : + CommRingCat.of (Chart I a s) ⟶ coordinateRing I a s) ≫ + CommRingCat.ofHom (restriction I a hst) = + (CommRingCat.ofHom (ReesProductRestriction.chartRestriction I a hst) : + CommRingCat.of (Chart I a s) ⟶ CommRingCat.of (Chart I a t)) ≫ + CommRingCat.ofHom (coordinateEquiv I a t).symm.toRingHom := + congrArg (fun f : Chart I a s →+* coordinateRing I a t => CommRingCat.ofHom f) he + rw [chart, ← Category.assoc, ← Spec.map_comp] + erw [heCat] + rw [Spec.map_comp, Category.assoc, + ReesProductSchemeRestriction.chartRestriction_chartMorphism I a hs ht hst] + rfl + +end +end PiExponent.ReesFrozenChart + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesGradedModule.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesGradedModule.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6adf9238c25018509a90b0d52264d9dbc265f53 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesGradedModule.lean @@ -0,0 +1,75 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesPolynomialPresentation +import OAI.NumberTheory.PiExponent.Cohomology.GradedPolynomialLaurent +import OAI.NumberTheory.PiExponent.Polynomials.NatToIntGrading + +namespace OAI + +namespace PiExponent.ReesGradedModule +noncomputable section +open PiExponentSeshadri.ReesGrading +open PiExponent.ReesPolynomialPresentation PiExponent.GradedPolynomialLaurent +attribute [local instance] MvPolynomial.weightedGradedAlgebra +variable {R J : Type*} [CommRing R] [Fintype J] (I : Ideal R) (a : J → I) + +abbrev integerPiece : ℤ → AddSubgroup (reesAlgebra I) := + NatToIntGrading.piece (piece I) + +instance integerGradedRing : GradedRing (integerPiece I) where + toGradedMonoid := NatToIntGrading.gradedMonoid (piece I) + toDecomposition := NatToIntGrading.decomposition (piece I) + +def ordinaryPowerEquivIntegerPiece (n : ℕ) : ↥(I ^ n : Ideal R) ≃+ integerPiece I (n : ℤ) := + (ReesPushdown.ordinaryPowerEquivPiece I n).toAddEquiv + +theorem polynomial_negative_eq_zero (n : ℕ) (p : MvPolynomial J R) + (hp : p ∈ grading (J := J) (R := R) (.negSucc n)) : p = 0 := by + apply MvPolynomial.IsWeightedHomogeneous.eq_zero_of_no_monomials hp + intro b hb + have hnonneg : 0 ≤ Finsupp.weight (1 : J → ℤ) b := by + rw [Finsupp.weight_eq_sum] + exact Finset.sum_nonneg fun j _ => by simp + omega + +theorem presentation_integer_mem {d : ℤ} {p : MvPolynomial J R} + (hp : p ∈ grading (J := J) (R := R) d) : + presentation I a p ∈ integerPiece I d := by + cases d with + | ofNat n => + change presentation I a p ∈ piece I n + apply presentation_homogeneous_mem I a + change p ∈ MvPolynomial.weightedHomogeneousSubmodule R (1 : J → ℤ) (n : ℤ) at hp + rw [GradedH0.integer_grading_eq_homogeneous (R := R) (ι := J) n] at hp + exact hp + | negSucc n => + rw [polynomial_negative_eq_zero n p hp, map_zero] + exact zero_mem _ + +def gradedPresentation : grading (J := J) (R := R) →+*ᵍ integerPiece I where + __ := (presentation I a).toRingHom + map_mem := presentation_integer_mem I a + +theorem presentation_degree_compatible (d : ℤ) (p : MvPolynomial J R) : + presentation I a (DirectSum.decompose (grading (J := J) (R := R)) p d : MvPolynomial J R) = + (DirectSum.decompose (integerPiece I) (presentation I a p) d : reesAlgebra I) := + (gradedPresentation I a).map_directSumDecompose + +theorem gradedScalarAction : + letI := presentationAlgebra I a + SetLike.GradedSMul (grading (J := J) (R := R)) (integerPiece I) := by + let := presentationAlgebra I a + constructor + intro i j p z hp hz + change presentation I a p * z ∈ integerPiece I (i + j) + exact SetLike.mul_mem_graded (presentation_integer_mem I a hp) hz + +theorem finite_graded_module + (ha : Ideal.span (Set.range fun j => (a j).val) = I) : + letI := presentationAlgebra I a + Module.Finite (MvPolynomial J R) (reesAlgebra I) ∧ + SetLike.GradedSMul (grading (J := J) (R := R)) (integerPiece I) := by + exact ⟨finite_presented_module I a ha, gradedScalarAction I a⟩ + +end +end PiExponent.ReesGradedModule + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesLocalizedChart.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesLocalizedChart.lean new file mode 100644 index 0000000000000000000000000000000000000000..b9ad63cd090d71ab655d278a073df0605a5674d6 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesLocalizedChart.lean @@ -0,0 +1,172 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesGradedModule +import OAI.NumberTheory.PiExponent.LocalAlgebra.LocalizedAlgebraEvaluation + +namespace OAI + +namespace PiExponent.ReesLocalizedChart +noncomputable section +open PiExponentSeshadri.ReesGrading +open PiExponent.ReesGradedModule PiExponent.ReesPolynomialPresentation +open PiExponent.GradedPolynomialLaurent PiExponent.GradedLocalizationExact +attribute [local instance] MvPolynomial.weightedGradedAlgebra +variable {R J : Type*} [CommRing R] [Fintype J] +variable (I : Ideal R) (a : J → I) (j : J) + +abbrev LocalizationModule := + letI := presentationAlgebra I a + LocalizedModule (Submonoid.powers (MvPolynomial.X j : MvPolynomial J R)) (reesAlgebra I) + +def localizationEvaluation : LocalizationModule I a j →+ Localization.Away (a j).val := by + letI := presentationAlgebra I a + exact LocalizedAlgebraEvaluation.evaluation (Submonoid.powers (MvPolynomial.X j)) + (Submonoid.powers (a j).val) (evaluation I) (by + rintro ⟨_, k, rfl⟩ + refine ⟨k, ?_⟩ + change (a j).val ^ k = evaluation I (presentation I a (MvPolynomial.X j ^ k)) + simp only [map_pow, presentation_X, evaluation_generator]) + +omit [Fintype J] in +theorem localizationEvaluation_fraction (m : reesAlgebra I) (k : ℕ) : + letI := presentationAlgebra I a + localizationEvaluation I a j (fraction (MvPolynomial.X j : MvPolynomial J R) m k) = + IsLocalization.mk' (Localization.Away (a j).val) (evaluation I m) + (powerDenominator (a j).val k) := by + let := presentationAlgebra I a + unfold localizationEvaluation fraction + rw [LocalizedAlgebraEvaluation.evaluation_mk] + congr 1 + apply Subtype.ext + change evaluation I (presentation I a (MvPolynomial.X j ^ k)) = (a j).val ^ k + simp only [map_pow, presentation_X, evaluation_generator] + +abbrev Piece (n : ℕ) := + letI := presentationAlgebra I a + letI := gradedScalarAction I a + degreePiece (grading (J := J) (R := R)) (integerPiece I) + (MvPolynomial.X j) 1 (variable_mem j) (n : ℤ) + +def pieceEvaluation (n : ℕ) : Piece I a j n →+ Localization.Away (a j).val := by + letI := presentationAlgebra I a + letI := gradedScalarAction I a + exact (localizationEvaluation I a j).comp (Piece I a j n).subtype + +theorem pieceEvaluation_injective (n : ℕ) : Function.Injective (pieceEvaluation I a j n) := by + let := presentationAlgebra I a + let := gradedScalarAction I a + apply (injective_iff_map_eq_zero _).mpr + intro z hz + obtain ⟨k, m, hm, hrep⟩ := z.property + have hm' : m ∈ piece I (n + k) := by + change m ∈ integerPiece I (↑(n + k)) + simpa only [Nat.cast_add, mul_one] using hm + have heval : evaluation I m = (m : Polynomial R).coeff (n + k) := evaluation_piece I ⟨m, hm'⟩ + change localizationEvaluation I a j z.val = 0 at hz + rw [hrep, localizationEvaluation_fraction] at hz + obtain ⟨⟨b, hb⟩, hbm⟩ := (IsLocalization.mk'_eq_zero_iff + (M := Submonoid.powers (a j).val) (S := Localization.Away (a j).val) _ _).mp hz + obtain ⟨l, rfl⟩ := hb + apply Subtype.ext + change z.val = 0 + rw [hrep, fraction_eq_zero] + refine ⟨l, ?_⟩ + change presentation I a (MvPolynomial.X j ^ l) * m = 0 + rw [map_pow, presentation_X] + apply Subtype.ext + change (generator I (a j) : Polynomial R) ^ l * (m : Polynomial R) = 0 + rw [(mem_piece I (n + k) m).mp hm', generator_val, + Polynomial.monomial_pow, Polynomial.monomial_mul_monomial] + rw [heval] at hbm + simp only [hbm, map_zero] + +theorem pieceEvaluation_mem_chartPower (n : ℕ) (z : Piece I a j n) : + ∃ s : ↥((I ^ n).map (chartBase I (a j))), + chartMap I (a j) s.val = pieceEvaluation I a j n z := by + let := presentationAlgebra I a + let := gradedScalarAction I a + obtain ⟨k, m, hm, hrep⟩ := z.property + have hm' : m ∈ piece I (n + k) := by + change m ∈ integerPiece I (↑(n + k)) + simpa only [Nat.cast_add, mul_one] using hm + let q : chart I (a j) := HomogeneousLocalization.Away.mk (piece I) + (generator_mem I (a j)) (n + k) m (by simpa using hm') + have hmem : (chartBase I (a j) (a j).val) ^ n * q ∈ + (I ^ n).map (chartBase I (a j)) := by + rw [ReesPushdown.chart_ordinaryPower_principal] + exact Ideal.mul_mem_right q _ (Ideal.subset_span (by simp)) + refine ⟨⟨(chartBase I (a j) (a j).val) ^ n * q, hmem⟩, ?_⟩ + change chartMap I (a j) ((chartBase I (a j) (a j).val) ^ n * q) = + localizationEvaluation I a j z.val + have hmap : chartMap I (a j) ((chartBase I (a j) (a j).val) ^ n) = + algebraMap R (Localization.Away (a j).val) ((a j).val ^ n) := by + calc + _ = (chartMap I (a j) (chartBase I (a j) (a j).val)) ^ n := + (chartMap I (a j)).map_pow _ n + _ = _ := by rw [chartMap_base, map_pow] + rw [hrep, localizationEvaluation_fraction, map_mul, hmap] + change (algebraMap R (Localization.Away (a j).val) ((a j).val ^ n)) * + chartMap I (a j) (HomogeneousLocalization.Away.mk (piece I) + (generator_mem I (a j)) (n + k) m _) = _ + rw [chartMap_mk, IsLocalization.mul_mk'_eq_mk'_of_mul] + apply IsLocalization.mk'_eq_of_eq + change (a j).val ^ (n + k) * evaluation I m = + (a j).val ^ k * ((a j).val ^ n * evaluation I m) + rw [pow_add] + ring + +theorem chartPower_mem_pieceEvaluation (n : ℕ) + (s : ↥((I ^ n).map (chartBase I (a j)))) : + ∃ z : Piece I a j n, pieceEvaluation I a j n z = chartMap I (a j) s.val := by + let := presentationAlgebra I a + let := gradedScalarAction I a + obtain ⟨k, b, hb, hs⟩ := ReesPushdown.chart_ordinaryPower_fraction I (a j) n s.val s.property + let m := ReesPushdown.ordinaryPowerEquivPiece I (n + k) ⟨b, hb⟩ + have hm : m.val ∈ integerPiece I ((n : ℤ) + (k : ℤ) * 1) := by + have hm0 : m.val ∈ integerPiece I (↑(n + k)) := m.property + simpa only [Nat.cast_add, mul_one] using hm0 + let z : Piece I a j n := ⟨fraction (MvPolynomial.X j : MvPolynomial J R) m.val k, + k, m.val, hm, rfl⟩ + refine ⟨z, ?_⟩ + change localizationEvaluation I a j (fraction (MvPolynomial.X j : MvPolynomial J R) m.val k) = _ + rw [localizationEvaluation_fraction, hs] + have heval : evaluation I m.val = b := by + rw [evaluation_piece I m] + exact ReesPushdown.ordinaryPowerEquivPiece_apply_coeff I (n + k) ⟨b, hb⟩ + rw [heval] + rfl + +def chartPowerMap (n : ℕ) : Piece I a j n →+ ↥((I ^ n).map (chartBase I (a j))) where + toFun z := (pieceEvaluation_mem_chartPower I a j n z).choose + map_zero' := by + apply Subtype.ext + apply chartMap_injective I (a j) + rw [(pieceEvaluation_mem_chartPower I a j n 0).choose_spec, map_zero] + change 0 = chartMap I (a j) 0 + exact (map_zero _).symm + map_add' z w := by + apply Subtype.ext + apply chartMap_injective I (a j) + change chartMap I (a j) _ = chartMap I (a j) (_ + _) + rw [(pieceEvaluation_mem_chartPower I a j n (z+w)).choose_spec, map_add, map_add, + (pieceEvaluation_mem_chartPower I a j n z).choose_spec, + (pieceEvaluation_mem_chartPower I a j n w).choose_spec] + +theorem chartPowerMap_evaluation (n : ℕ) (z : Piece I a j n) : + chartMap I (a j) (chartPowerMap I a j n z).val = pieceEvaluation I a j n z := + (pieceEvaluation_mem_chartPower I a j n z).choose_spec + +def chartPowerEquiv (n : ℕ) : Piece I a j n ≃+ ↥((I ^ n).map (chartBase I (a j))) := + AddEquiv.ofBijective (chartPowerMap I a j n) ⟨by + intro z w hzw + apply pieceEvaluation_injective I a j n + rw [← chartPowerMap_evaluation, ← chartPowerMap_evaluation, hzw], by + intro s + obtain ⟨z, hz⟩ := chartPower_mem_pieceEvaluation I a j n s + refine ⟨z, ?_⟩ + apply Subtype.ext + apply chartMap_injective I (a j) + rw [chartPowerMap_evaluation, hz]⟩ + +end +end PiExponent.ReesLocalizedChart + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesLocalizedIntersections.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesLocalizedIntersections.lean new file mode 100644 index 0000000000000000000000000000000000000000..5dfe43237ae8bee64b036b942ff33cd367a3bf0d --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesLocalizedIntersections.lean @@ -0,0 +1,182 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesLocalizedChart +import OAI.NumberTheory.PiExponent.Cohomology.GradedCech + +namespace OAI + +namespace PiExponent.ReesLocalizedIntersections +noncomputable section +open PiExponentSeshadri.ReesGrading +open PiExponent.ReesGradedModule PiExponent.ReesPolynomialPresentation +open PiExponent.GradedPolynomialLaurent PiExponent.GradedLocalizationExact PiExponent.GradedCech +attribute [local instance] MvPolynomial.weightedGradedAlgebra +variable {R J : Type*} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) + +def coefficientProduct (s : Finset J) : R := ∏ j ∈ s, (a j).val + +omit [Fintype J] [DecidableEq J] in +theorem evaluation_presentation_product (s : Finset J) : + evaluation I (presentation I a (coverProduct MvPolynomial.X s)) = coefficientProduct I a s := by + simp only [coverProduct, coefficientProduct, map_prod, presentation_X, evaluation_generator] + +abbrev LocalizationModule (s : Finset J) := + letI := presentationAlgebra I a + LocalizedModule (Submonoid.powers (coverProduct (MvPolynomial.X : J → MvPolynomial J R) s)) + (reesAlgebra I) + +def localizationEvaluation (s : Finset J) : + LocalizationModule I a s →+ Localization.Away (coefficientProduct I a s) := by + letI := presentationAlgebra I a + exact LocalizedAlgebraEvaluation.evaluation (Submonoid.powers (coverProduct MvPolynomial.X s)) + (Submonoid.powers (coefficientProduct I a s)) (evaluation I) (by + rintro ⟨_, k, rfl⟩ + refine ⟨k, ?_⟩ + change coefficientProduct I a s ^ k = + evaluation I (presentation I a (coverProduct MvPolynomial.X s ^ k)) + rw [map_pow, map_pow, evaluation_presentation_product]) + +omit [Fintype J] [DecidableEq J] in +theorem localizationEvaluation_fraction (s : Finset J) (m : reesAlgebra I) (k : ℕ) : + letI := presentationAlgebra I a + localizationEvaluation I a s (fraction + (coverProduct (MvPolynomial.X : J → MvPolynomial J R) s) m k) = + IsLocalization.mk' (Localization.Away (coefficientProduct I a s)) (evaluation I m) + (powerDenominator (coefficientProduct I a s) k) := by + let := presentationAlgebra I a + unfold localizationEvaluation fraction + rw [LocalizedAlgebraEvaluation.evaluation_mk] + congr 1 + apply Subtype.ext + change evaluation I (presentation I a (coverProduct MvPolynomial.X s ^ k)) = + coefficientProduct I a s ^ k + rw [map_pow, map_pow, evaluation_presentation_product] + +omit [Fintype J] [DecidableEq J] in +theorem localizationEvaluation_smul (s : Finset J) (p : MvPolynomial J R) + (z : LocalizationModule I a s) : + letI := presentationAlgebra I a + localizationEvaluation I a s (p • z) = + algebraMap R (Localization.Away (coefficientProduct I a s)) + (evaluation I (presentation I a p)) * localizationEvaluation I a s z := by + let := presentationAlgebra I a + exact LocalizedAlgebraEvaluation.evaluation_smul _ _ _ _ p z + +def coefficientRestriction {s t : Finset J} (hst : s ⊆ t) : + Localization.Away (coefficientProduct I a s) →+* + Localization.Away (coefficientProduct I a t) := + IsLocalization.Away.lift (coefficientProduct I a s) + (IsLocalization.Away.isUnit_of_dvd (coefficientProduct I a t) (by + exact Finset.prod_dvd_prod_of_subset s t _ hst)) + +omit [Fintype J] [DecidableEq J] in +@[simp] theorem coefficientRestriction_algebraMap {s t : Finset J} (hst : s ⊆ t) (r : R) : + coefficientRestriction I a hst (algebraMap R (Localization.Away (coefficientProduct I a s)) r) = + algebraMap R (Localization.Away (coefficientProduct I a t)) r := + IsLocalization.Away.lift_eq _ _ _ + +omit [Fintype J] in +theorem localizationEvaluation_restriction {s t : Finset J} (hst : s ⊆ t) + (z : LocalizationModule I a s) : + letI := presentationAlgebra I a + localizationEvaluation I a t + (restriction (coverProduct (MvPolynomial.X : J → MvPolynomial J R) s) + (coverProduct MvPolynomial.X t) + (coverProduct_dvd (grading (J := J) (R := R)) MvPolynomial.X variable_mem hst) z) = + coefficientRestriction I a hst (localizationEvaluation I a s z) := by + let := presentationAlgebra I a + induction z using LocalizedModule.induction_on with + | h m den => + obtain ⟨k, hk⟩ := den.property + have hd : den = powerDenominator (coverProduct MvPolynomial.X s) k := Subtype.ext hk.symm + subst den + change localizationEvaluation I a t (restriction _ _ _ (fraction _ m k)) = + coefficientRestriction I a hst (localizationEvaluation I a s (fraction _ m k)) + have hu : IsUnit (algebraMap R (Localization.Away (coefficientProduct I a t)) + (coefficientProduct I a s)) := + IsLocalization.Away.isUnit_of_dvd (coefficientProduct I a t) (by + exact Finset.prod_dvd_prod_of_subset s t _ hst) + apply (hu.pow k).mul_right_injective + calc + _ = localizationEvaluation I a t + (coverProduct (MvPolynomial.X : J → MvPolynomial J R) s ^ k • + restriction _ _ _ (fraction _ m k)) := by + rw [localizationEvaluation_smul, map_pow, map_pow, + evaluation_presentation_product, map_pow] + _ = localizationEvaluation I a t (fraction (coverProduct MvPolynomial.X t) m 0) := by + rw [← map_smul, power_smul_fraction, restriction_fraction_zero] + _ = algebraMap R (Localization.Away (coefficientProduct I a t)) (evaluation I m) := by + rw [localizationEvaluation_fraction, powerDenominator_zero, IsLocalization.mk'_one] + _ = _ := by + have hspec := congrArg (coefficientRestriction I a hst) + (IsLocalization.mk'_spec' (Localization.Away (coefficientProduct I a s)) + (evaluation I m) (powerDenominator (coefficientProduct I a s) k)) + rw [localizationEvaluation_fraction] + simpa only [map_mul, coefficientRestriction_algebraMap, powerDenominator_val, map_pow] + using hspec.symm + +abbrev Piece (s : Finset J) (n : ℕ) := + letI := presentationAlgebra I a + letI := gradedScalarAction I a + IntersectionPiece (grading (J := J) (R := R)) (integerPiece I) + MvPolynomial.X variable_mem s n + +def pieceEvaluation (s : Finset J) (n : ℕ) : + Piece I a s n →+ Localization.Away (coefficientProduct I a s) := by + letI := presentationAlgebra I a + letI := gradedScalarAction I a + exact (localizationEvaluation I a s).comp (Piece I a s n).subtype + +theorem pieceEvaluation_restriction {s t : Finset J} (hst : s ⊆ t) (n : ℕ) + (z : Piece I a s n) : + letI := presentationAlgebra I a + letI := gradedScalarAction I a + pieceEvaluation I a t n (setRestriction (grading (J := J) (R := R)) (integerPiece I) + MvPolynomial.X variable_mem hst n z) = + coefficientRestriction I a hst (pieceEvaluation I a s n z) := by + let := presentationAlgebra I a + let := gradedScalarAction I a + exact localizationEvaluation_restriction I a hst z.val + +theorem pieceEvaluation_injective (s : Finset J) (n : ℕ) : + Function.Injective (pieceEvaluation I a s n) := by + let := presentationAlgebra I a + let := gradedScalarAction I a + apply (injective_iff_map_eq_zero _).mpr + intro z hz + obtain ⟨k, m, hm, hrep⟩ := z.property + have hm' : m ∈ piece I (n + k * s.card) := by + change m ∈ integerPiece I (↑(n + k * s.card)) + simpa only [Nat.cast_add, Nat.cast_mul] using hm + have hp : presentation I a (coverProduct MvPolynomial.X s) ∈ piece I s.card := + presentation_integer_mem I a + (coverProduct_mem (grading (J := J) (R := R)) MvPolynomial.X variable_mem s) + have heval : evaluation I m = (m : Polynomial R).coeff (n + k * s.card) := + evaluation_piece I ⟨m, hm'⟩ + have hep : evaluation I (presentation I a (coverProduct MvPolynomial.X s)) = + (presentation I a (coverProduct MvPolynomial.X s) : Polynomial R).coeff s.card := + evaluation_piece I ⟨_, hp⟩ + change localizationEvaluation I a s z.val = 0 at hz + rw [hrep, localizationEvaluation_fraction] at hz + obtain ⟨⟨b, hb⟩, hbm⟩ := (IsLocalization.mk'_eq_zero_iff + (M := Submonoid.powers (coefficientProduct I a s)) + (S := Localization.Away (coefficientProduct I a s)) _ _).mp hz + obtain ⟨l, rfl⟩ := hb + apply Subtype.ext + change z.val = 0 + rw [hrep, fraction_eq_zero] + refine ⟨l, ?_⟩ + change presentation I a (coverProduct MvPolynomial.X s ^ l) * m = 0 + rw [map_pow] + apply Subtype.ext + change (presentation I a (coverProduct MvPolynomial.X s) : Polynomial R) ^ l * + (m : Polynomial R) = 0 + rw [(mem_piece I s.card _).mp hp, (mem_piece I (n + k * s.card) m).mp hm', + Polynomial.monomial_pow, Polynomial.monomial_mul_monomial] + rw [← hep, evaluation_presentation_product] + rw [heval] at hbm + simp only [hbm, map_zero] + +end +end PiExponent.ReesLocalizedIntersections + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesPolynomialPresentation.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesPolynomialPresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..f726a7a38fcfabae6de2bf87a856500cac87da74 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesPolynomialPresentation.lean @@ -0,0 +1,122 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesPushdown +import OAI.NumberTheory.PiExponent.Polynomials.GradedSerre + +namespace OAI + +namespace PiExponent.ReesPolynomialPresentation +noncomputable section +open scoped BigOperators +open Polynomial PiExponentSeshadri.ReesGrading +variable {R J : Type*} [CommRing R] (I : Ideal R) (a : J → I) + +def presentation : MvPolynomial J R →ₐ[R] reesAlgebra I := + MvPolynomial.aeval (fun j => generator I (a j)) + +@[simp] theorem presentation_X (j : J) : presentation I a (MvPolynomial.X j) = generator I (a j) := + MvPolynomial.aeval_X _ _ + +theorem presentation_monomial_mem (b : J →₀ ℕ) (r : R) : + presentation I a (MvPolynomial.monomial b r) ∈ piece I b.degree := by + classical + rw [presentation, MvPolynomial.aeval_monomial] + have hp : (∏ j ∈ b.support, generator I (a j) ^ b j) ∈ piece I b.degree := by + have h := SetLike.prod_mem_graded (piece I) (fun j => b j) + (fun j => generator I (a j) ^ b j) (F := b.support) + (fun j _ => by simpa using SetLike.pow_mem_graded (b j) (generator_mem I (a j))) + change (∏ j ∈ b.support, generator I (a j) ^ b j) ∈ piece I (∑ j ∈ b.support, b j) + exact h + have hr : algebraMap R (reesAlgebra I) r ∈ piece I 0 := by + simp [mem_piece] + simpa only [zero_add, Finsupp.prod] using SetLike.mul_mem_graded hr hp + +theorem presentation_homogeneous_mem {n : ℕ} {p : MvPolynomial J R} + (hp : p.IsHomogeneous n) : presentation I a p ∈ piece I n := by + classical + induction hp using MvPolynomial.IsWeightedHomogeneous.induction_on with + | zero => simpa only [map_zero] using (piece I n).zero_mem + | add p q hp hq ihp ihq => simpa only [map_add] using (piece I n).add_mem ihp ihq + | monomial b r hb => + have hb' : b.degree = n := by rw [Finsupp.degree_eq_weight_one, ← Pi.one_def, hb] + simpa only [hb'] using presentation_monomial_mem I a b r + +theorem evaluation_presentation (p : MvPolynomial J R) : + evaluation I (presentation I a p) = MvPolynomial.eval (fun j => (a j).val) p := by + have h : (evaluation I).comp (presentation I a).toRingHom = + (MvPolynomial.eval₂Hom (RingHom.id R) (fun j => (a j).val)) := by + apply MvPolynomial.ringHom_ext + · intro r + simp [presentation, evaluation] + · intro j + simp [presentation, evaluation_generator] + exact DFunLike.congr_fun h p + +theorem homogeneous_piece_surjective + (ha : Ideal.span (Set.range fun j => (a j).val) = I) (n : ℕ) + (z : piece I n) : + ∃ p : MvPolynomial J R, p.IsHomogeneous n ∧ presentation I a p = z.val := by + have hz : (((z.val : reesAlgebra I) : R[X]).coeff n) ∈ + (Ideal.span (Set.range fun j => (a j).val)) ^ n := by + rw [ha] + exact z.val.property n + obtain ⟨p, hp, heval⟩ := (Ideal.mem_span_pow_iff_exists_isHomogeneous + (fun j => (a j).val) _).mp hz + refine ⟨p, hp, ?_⟩ + have hmem := presentation_homogeneous_mem I a hp + apply Subtype.ext + rw [(mem_piece I n _).mp hmem, (mem_piece I n _).mp z.property] + congr 1 + have h := evaluation_presentation I a p + rw [evaluation, RingHom.comp_apply, AlgHom.toRingHom_eq_coe] at h + change Polynomial.eval 1 ((presentation I a p : reesAlgebra I) : R[X]) = _ at h + rw [(mem_piece I n _).mp hmem] at h + simpa only [Polynomial.eval_monomial, one_pow, mul_one] using h.trans heval + +theorem presentation_surjective + (ha : Ideal.span (Set.range fun j => (a j).val) = I) : + Function.Surjective (presentation I a) := by + classical + intro z + have hn (n : ℕ) := homogeneous_piece_surjective I a ha n (component I n z) + choose p hp hpres using hn + refine ⟨∑ n ∈ ((z : reesAlgebra I) : R[X]).support, p n, ?_⟩ + rw [map_sum] + simp_rw [hpres] + apply Subtype.ext + change (reesAlgebra I).val (∑ n ∈ ((z : reesAlgebra I) : R[X]).support, + (component I n z).val) = (z : R[X]) + rw [map_sum] + exact ((z : R[X]).as_sum_support).symm + +@[instance_reducible] +def presentationAlgebra : Algebra (MvPolynomial J R) (reesAlgebra I) := + (presentation I a).toRingHom.toAlgebra + +theorem finite_presented_module + (ha : Ideal.span (Set.range fun j => (a j).val) = I) : + letI := presentationAlgebra I a + Module.Finite (MvPolynomial J R) (reesAlgebra I) := by + let := presentationAlgebra I a + exact Module.Finite.of_surjective + (Algebra.linearMap (MvPolynomial J R) (reesAlgebra I)) (presentation_surjective I a ha) + +theorem exists_finite_presentation [IsNoetherianRing R] : + ∃ (s : Finset R) (a : s → I), + (∀ j : s, (a j).val = j.val) ∧ + Ideal.span (Set.range fun j => (a j).val) = I ∧ + Function.Surjective (presentation I a) ∧ + ∀ n (z : piece I n), ∃ p : MvPolynomial s R, + p.IsHomogeneous n ∧ presentation I a p = z.val := by + classical + obtain ⟨s, hs⟩ := IsNoetherian.noetherian I + let a : s → I := fun j => ⟨j.val, by + rw [← hs] + exact Submodule.subset_span j.property⟩ + have ha : Ideal.span (Set.range fun j => (a j).val) = I := by + simpa only [a, Subtype.range_coe_subtype, Finset.setOfPred_mem] using hs + exact ⟨s, a, fun _ => rfl, ha, presentation_surjective I a ha, + homogeneous_piece_surjective I a ha⟩ + +end +end PiExponent.ReesPolynomialPresentation + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesPrincipalLift.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesPrincipalLift.lean new file mode 100644 index 0000000000000000000000000000000000000000..4121a790e3f1fad4d0fb586294b380f9a9da8b9a --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesPrincipalLift.lean @@ -0,0 +1,183 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesExceptional + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.BlowupLift +universe u v +variable {R : Type u} [CommRing R] (I : Ideal R) +variable {S : Type v} [CommRing S] (f : R →+* S) (r : S) +variable (hI : I.map f = Ideal.span {r}) (hr : IsLeftRegular r) + +def coefficient (a : I) : S := + Classical.choose ((Ideal.mem_span_singleton.mp + (show f a.val ∈ Ideal.span {r} from hI ▸ Ideal.mem_map_of_mem f a.property))) + +lemma mul_coefficient (a : I) : r * coefficient I f r hI a = f a.val := by + exact (Classical.choose_spec ((Ideal.mem_span_singleton.mp + (show f a.val ∈ Ideal.span {r} from hI ▸ Ideal.mem_map_of_mem f a.property)))).symm + +include hr in + +lemma coefficients_span : Ideal.span (Set.range (coefficient I f r hI)) = ⊤ := by + let K : Ideal S := Ideal.span (Set.range (coefficient I f r hI)) + have hmap : I.map f ≤ Submodule.map (LinearMap.mulLeft S r) K := by + rw [Ideal.map_le_iff_le_comap] + intro a ha + change f a ∈ Submodule.map (LinearMap.mulLeft S r) K + exact ⟨coefficient I f r hI ⟨a, ha⟩, + Ideal.subset_span (Set.mem_range_self _), mul_coefficient I f r hI ⟨a, ha⟩⟩ + have hmem : r ∈ Submodule.map (LinearMap.mulLeft S r) K := by + apply hmap + rw [hI] + exact Ideal.subset_span (Set.mem_singleton r) + obtain ⟨s, hs, hrs⟩ := hmem + have hs1 : s = 1 := hr (by simpa using hrs) + refine Ideal.eq_top_of_isUnit_mem (I := K) ?_ isUnit_one + exact hs1 ▸ hs + +end PiExponentSeshadri.BlowupLift + +namespace PiExponentSeshadri.ReesGrading + +section +open Polynomial +universe u v +variable {R : Type u} [CommRing R] (I : Ideal R) +variable {S : Type v} [CommRing S] (f : R →+* S) (r : S) +variable (hI : I.map f = Ideal.span {r}) (hr : IsRegular r) + +def principalToLocalization : reesAlgebra I →+* Localization.Away r := + (Polynomial.eval₂RingHom ((algebraMap S (Localization.Away r)).comp f) + (IsLocalization.Away.invSelf r)).comp (reesAlgebra I).val.toRingHom + +lemma principalToLocalization_base (s : R) : + principalToLocalization I f r (algebraMap R (reesAlgebra I) s) = + algebraMap S (Localization.Away r) (f s) := by + simp [principalToLocalization] + +lemma principalToLocalization_generator (a : I) : + principalToLocalization I f r (generator I a) = + algebraMap S (Localization.Away r) (BlowupLift.coefficient I f r hI a) := by + change (Polynomial.eval₂RingHom ((algebraMap S (Localization.Away r)).comp f) + (IsLocalization.Away.invSelf r)) (monomial 1 a.val) = _ + simp only [coe_eval₂RingHom, eval₂_monomial, RingHom.comp_apply, pow_one] + rw [← BlowupLift.mul_coefficient I f r hI a, map_mul] + calc _ = (algebraMap S (Localization.Away r) r * IsLocalization.Away.invSelf r) * + algebraMap S (Localization.Away r) (BlowupLift.coefficient I f r hI a) := by ring + _ = _ := by rw [IsLocalization.Away.mul_invSelf, one_mul] + +include hI in +lemma principalToLocalization_range (p : reesAlgebra I) : + ∃ s : S, algebraMap S (Localization.Away r) s = principalToLocalization I f r p := by + have hp : p ∈ Algebra.adjoin R (Set.range (generator I)) := by + rw [generators_adjoin] + trivial + induction hp using Algebra.adjoin_induction with + | mem p hp => + obtain ⟨a, rfl⟩ := hp + exact ⟨BlowupLift.coefficient I f r hI a, (principalToLocalization_generator I f r hI a).symm⟩ + | algebraMap s => exact ⟨f s, (principalToLocalization_base I f r s).symm⟩ + | add p q _ _ hp hq => + obtain ⟨s, hs⟩ := hp + obtain ⟨t, ht⟩ := hq + exact ⟨s+t, by rw [map_add, hs, ht, map_add]⟩ + | mul p q _ _ hp hq => + obtain ⟨s, hs⟩ := hp + obtain ⟨t, ht⟩ := hq + exact ⟨s*t, by rw [map_mul, hs, ht, map_mul]⟩ + +include hr in +lemma principalLocalization_injective : Function.Injective (algebraMap S (Localization.Away r)) := + IsLocalization.injective _ (Submonoid.powers_le.mpr (isRegular_iff_mem_nonZeroDivisors.mp hr)) + +def principalMap : reesAlgebra I →+* S where + toFun p := Classical.choose (principalToLocalization_range I f r hI p) + map_zero' := principalLocalization_injective r hr (by + rw [Classical.choose_spec (principalToLocalization_range I f r hI 0), map_zero, map_zero]) + map_one' := principalLocalization_injective r hr (by + rw [Classical.choose_spec (principalToLocalization_range I f r hI 1), map_one, map_one]) + map_add' p q := principalLocalization_injective r hr (by + rw [Classical.choose_spec (principalToLocalization_range I f r hI (p+q)), map_add, + map_add, Classical.choose_spec (principalToLocalization_range I f r hI p), + Classical.choose_spec (principalToLocalization_range I f r hI q)]) + map_mul' p q := principalLocalization_injective r hr (by + rw [Classical.choose_spec (principalToLocalization_range I f r hI (p*q)), map_mul, + map_mul, Classical.choose_spec (principalToLocalization_range I f r hI p), + Classical.choose_spec (principalToLocalization_range I f r hI q)]) + +lemma principalMap_spec (p : reesAlgebra I) : + algebraMap S (Localization.Away r) (principalMap I f r hI hr p) = + principalToLocalization I f r p := + Classical.choose_spec (principalToLocalization_range I f r hI p) + +lemma principalMap_base (s : R) : + principalMap I f r hI hr (algebraMap R (reesAlgebra I) s) = f s := by + apply principalLocalization_injective r hr + rw [principalMap_spec, principalToLocalization_base] + +lemma principalMap_generator (a : I) : + principalMap I f r hI hr (generator I a) = BlowupLift.coefficient I f r hI a := by + apply principalLocalization_injective r hr + rw [principalMap_spec, principalToLocalization_generator] + +lemma principalMap_irrelevant : + (HomogeneousIdeal.irrelevant (piece I)).toIdeal.map (principalMap I f r hI hr) = ⊤ := by + rw [eq_top_iff, ← BlowupLift.coefficients_span I f r hI hr.left] + apply Ideal.span_le.mpr + rintro s ⟨a, rfl⟩ + rw [← principalMap_generator I f r hI hr] + apply Ideal.mem_map_of_mem + exact HomogeneousIdeal.mem_irrelevant_of_mem (piece I) (by decide : 0 < (1 : ℕ)) + (generator_mem I a) + +end + +open CategoryTheory AlgebraicGeometry +universe u +variable {R : Type u} [CommRing R] (I : Ideal R) +variable (X : Scheme.{u}) (f : R →+* Γ(X, ⊤)) (r : Γ(X, ⊤)) +variable (hI : I.map f = Ideal.span {r}) (hr : IsRegular r) + +def principalScheme : X ⟶ affineBlowup I := + Proj.fromOfGlobalSections (piece I) (principalMap I f r hI hr) + (principalMap_irrelevant I f r hI hr) + +@[reassoc] +lemma principalScheme_projection : + principalScheme I X f r hI hr ≫ projection I = + X.toSpecΓ ≫ Spec.map (CommRingCat.ofHom f) := by + let g : CommRingCat.of (piece I 0) ⟶ Γ(X, ⊤) := + CommRingCat.ofHom ((principalMap I f r hI hr).comp (algebraMap _ _)) + have hg : (zeroIso I).hom ≫ g = CommRingCat.ofHom f := by + ext s + exact principalMap_base I f r hI hr s + have h : principalScheme I X f r hI hr ≫ Proj.toSpecZero (piece I) = + X.toSpecΓ ≫ Spec.map g := + Proj.fromOfGlobalSections_toSpecZero (piece I) (principalMap I f r hI hr) + (principalMap_irrelevant I f r hI hr) + change principalScheme I X f r hI hr ≫ + (Proj.toSpecZero (piece I) ≫ Spec.map (zeroIso I).hom) = _ + calc + _ = (principalScheme I X f r hI hr ≫ Proj.toSpecZero (piece I)) ≫ + Spec.map (zeroIso I).hom := (Category.assoc _ _ _).symm + _ = (X.toSpecΓ ≫ Spec.map g) ≫ Spec.map (zeroIso I).hom := + congrArg (fun q : X ⟶ Spec (CommRingCat.of (piece I 0)) => + q ≫ Spec.map (zeroIso I).hom) h + _ = X.toSpecΓ ≫ Spec.map ((zeroIso I).hom ≫ g) := by + rw [Category.assoc, Spec.map_comp] + _ = _ := congrArg (fun q : CommRingCat.of R ⟶ Γ(X, ⊤) => + X.toSpecΓ ≫ Spec.map q) hg + +lemma principalScheme_preimage (a : I) : + principalScheme I X f r hI hr ⁻¹ᵁ Proj.basicOpen (piece I) (generator I a) = + X.basicOpen (BlowupLift.coefficient I f r hI a) := by + erw [principalScheme, Proj.fromOfGlobalSections_preimage_basicOpen _ _ _ + (show 0 < (1 : ℕ) from Nat.zero_lt_one) (generator_mem I a), principalMap_generator] + +end PiExponentSeshadri.ReesGrading + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductAugmentation.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductAugmentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..c245a5dcca07cc50faa894d5459429a72d852417 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductAugmentation.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesProductPower + +namespace OAI + +namespace PiExponent.ReesProductAugmentation +noncomputable section +open PiExponentSeshadri.ReesGrading +open PiExponent.ReesGradedModule PiExponent.ReesPolynomialPresentation +open PiExponent.GradedPolynomialLaurent PiExponent.GradedLocalizationExact PiExponent.GradedCech +open PiExponent.ReesLocalizedIntersections PiExponent.ReesProductChart PiExponent.ReesProductPower +attribute [local instance] MvPolynomial.weightedGradedAlgebra +variable {R J : Type*} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) + +def ordinaryFraction (s : Finset J) (n : ℕ) (b : ↥(I ^ n : Ideal R)) : Piece I a s n := by + letI := presentationAlgebra I a + letI := gradedScalarAction I a + exact ⟨fraction (coverProduct (MvPolynomial.X : J → MvPolynomial J R) s) + (ordinaryPowerEquivIntegerPiece I n b).val 0, + 0, (ordinaryPowerEquivIntegerPiece I n b).val, + by simpa only [Nat.cast_zero, zero_mul, add_zero] using + (ordinaryPowerEquivIntegerPiece I n b).property, rfl⟩ + +theorem ordinaryFraction_evaluation (s : Finset J) (n : ℕ) (b : ↥(I ^ n : Ideal R)) : + pieceEvaluation I a s n (ordinaryFraction I a s n b) = + algebraMap R (Localization.Away (coefficientProduct I a s)) b.val := by + let := presentationAlgebra I a + let := gradedScalarAction I a + change localizationEvaluation I a s + (fraction (coverProduct (MvPolynomial.X : J → MvPolynomial J R) s) + (ordinaryPowerEquivIntegerPiece I n b).val 0) = _ + rw [localizationEvaluation_fraction, powerDenominator_zero, IsLocalization.mk'_one] + congr 1 + change evaluation I (ReesPushdown.ordinaryPowerEquivPiece I n b).val = b.val + rw [evaluation_piece I (ReesPushdown.ordinaryPowerEquivPiece I n b)] + exact ReesPushdown.ordinaryPowerEquivPiece_apply_coeff I n b + +theorem chartPowerMap_ordinaryFraction {s : Finset J} {j : J} (hj : j ∈ s) + (n : ℕ) (b : ↥(I ^ n : Ideal R)) : + (chartPowerMap I a hj n (ordinaryFraction I a s n b)).val = + ReesProductChart.chartBase I a s b.val := by + apply ReesProductChart.chartMap_injective I a s + rw [chartPowerMap_evaluation I a hj, ordinaryFraction_evaluation, + ReesProductChart.chartMap_base] + +theorem augmentation_eq_ordinaryFraction (n : ℕ) (b : ↥(I ^ n : Ideal R)) (t : Fin 1 → J) : + letI := presentationAlgebra I a + letI := gradedScalarAction I a + augmentation (grading (J := J) (R := R)) (integerPiece I) MvPolynomial.X variable_mem n + (ordinaryPowerEquivIntegerPiece I n b) t = ordinaryFraction I a (tupleSet t) n b := by + let := presentationAlgebra I a + let := gradedScalarAction I a + apply Subtype.ext + rfl + +end +end PiExponent.ReesProductAugmentation + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductChart.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductChart.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b889c69d74c333640451997828a192640907ae2 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductChart.lean @@ -0,0 +1,165 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesLocalizedIntersections + +namespace OAI + +namespace PiExponent.ReesProductChart +noncomputable section +open PiExponentSeshadri.ReesGrading +open PiExponent.ReesGradedModule PiExponent.ReesPolynomialPresentation +open PiExponent.GradedPolynomialLaurent PiExponent.GradedLocalizationExact PiExponent.GradedCech +open PiExponent.ReesLocalizedIntersections +attribute [local instance] MvPolynomial.weightedGradedAlgebra +variable {R J : Type*} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) + +def productGenerator (s : Finset J) : reesAlgebra I := + presentation I a (coverProduct MvPolynomial.X s) + +theorem productGenerator_mem (s : Finset J) : productGenerator I a s ∈ piece I s.card := + presentation_integer_mem I a + (coverProduct_mem (grading (J := J) (R := R)) MvPolynomial.X variable_mem s) + +omit [Fintype J] [DecidableEq J] in +theorem evaluation_productGenerator (s : Finset J) : + evaluation I (productGenerator I a s) = coefficientProduct I a s := + evaluation_presentation_product I a s + +omit [Fintype J] [DecidableEq J] in +theorem productGenerator_eq_prod (s : Finset J) : + productGenerator I a s = ∏ j ∈ s, generator I (a j) := by + simp only [productGenerator, coverProduct, map_prod, presentation_X] + +abbrev Chart (s : Finset J) := HomogeneousLocalization.Away (piece I) (productGenerator I a s) + +def chartMap (s : Finset J) : Chart I a s →+* Localization.Away (coefficientProduct I a s) := + (IsLocalization.map (M := Submonoid.powers (productGenerator I a s)) + (S := Localization.Away (productGenerator I a s)) + (T := Submonoid.powers (coefficientProduct I a s)) + (Localization.Away (coefficientProduct I a s)) (evaluation I) + (by rintro _ ⟨k, rfl⟩; exact ⟨k, by simp only [map_pow, evaluation_productGenerator]⟩)).comp + (algebraMap (Chart I a s) (Localization.Away (productGenerator I a s))) + +theorem chartMap_mk (s : Finset J) (k : ℕ) (m : reesAlgebra I) + (hm : m ∈ piece I (k • s.card)) : + chartMap I a s (HomogeneousLocalization.Away.mk (piece I) + (productGenerator_mem I a s) k m hm) = + IsLocalization.mk' (Localization.Away (coefficientProduct I a s)) (evaluation I m) + (powerDenominator (coefficientProduct I a s) k) := by + simp only [chartMap, RingHom.comp_apply, HomogeneousLocalization.algebraMap_apply, + HomogeneousLocalization.Away.val_mk, Localization.mk_eq_mk', IsLocalization.map_mk'] + congr 1 + apply Subtype.ext + simp only [map_pow, evaluation_productGenerator, powerDenominator_val] + +theorem chartMap_injective (s : Finset J) : Function.Injective (chartMap I a s) := by + apply (RingHom.injective_iff_ker_eq_bot _).mpr + apply bot_unique + intro z hz + change z = 0 + obtain ⟨k, m, hm, rfl⟩ := HomogeneousLocalization.Away.mk_surjective (piece I) + (productGenerator_mem I a s) z + have hzero := RingHom.mem_ker.mp hz + rw [chartMap_mk] at hzero + obtain ⟨⟨b, hb⟩, hbm⟩ := (IsLocalization.mk'_eq_zero_iff + (M := Submonoid.powers (coefficientProduct I a s)) + (S := Localization.Away (coefficientProduct I a s)) _ _).mp hzero + obtain ⟨l, rfl⟩ := hb + apply HomogeneousLocalization.val_injective + rw [HomogeneousLocalization.val_zero, HomogeneousLocalization.Away.val_mk, + Localization.mk_eq_mk', IsLocalization.mk'_eq_zero_iff] + refine ⟨⟨productGenerator I a s ^ l, ⟨l, rfl⟩⟩, ?_⟩ + apply Subtype.ext + have he : evaluation I m = (m : Polynomial R).coeff (k • s.card) := evaluation_piece I ⟨m, hm⟩ + have hep : evaluation I (productGenerator I a s) = + (productGenerator I a s : Polynomial R).coeff s.card := + evaluation_piece I ⟨_, productGenerator_mem I a s⟩ + change (productGenerator I a s : Polynomial R) ^ l * (m : Polynomial R) = 0 + rw [(mem_piece I (k • s.card) m).mp hm, + (mem_piece I s.card _).mp (productGenerator_mem I a s), + Polynomial.monomial_pow, Polynomial.monomial_mul_monomial, + ← hep, evaluation_productGenerator] + rw [he] at hbm + simp only [hbm, map_zero] + +def chartBase (s : Finset J) : R →+* Chart I a s := + (HomogeneousLocalization.fromZeroRingHom (piece I) + (Submonoid.powers (productGenerator I a s))).comp (zeroEquiv I).toRingHom + +theorem chartMap_base (s : Finset J) (r : R) : + chartMap I a s (chartBase I a s r) = + algebraMap R (Localization.Away (coefficientProduct I a s)) r := by + have h0 : algebraMap R (reesAlgebra I) r ∈ piece I (0 • s.card) := by + simp [mem_piece] + refine (chartMap_mk I a s 0 (algebraMap R (reesAlgebra I) r) h0).trans ?_ + have he : evaluation I (algebraMap R (reesAlgebra I) r) = r := by simp [evaluation] + rw [he, powerDenominator_zero, IsLocalization.mk'_one] + +variable {s : Finset J} {j : J} (hj : j ∈ s) +include hj + +omit [Fintype J] in +theorem coefficientProduct_eq_pivot : + coefficientProduct I a s = (a j).val * coefficientProduct I a (s.erase j) := by + exact (Finset.mul_prod_erase s (fun i => (a i).val) hj).symm + +def ratio (b : I) : Chart I a s := + HomogeneousLocalization.Away.mk (piece I) (productGenerator_mem I a s) 1 + (generator I b * productGenerator I a (s.erase j)) (by + have h := SetLike.mul_mem_graded (generator_mem I b) + (productGenerator_mem I a (s.erase j)) + simpa only [one_nsmul, Nat.add_comm 1, Finset.card_erase_add_one hj] using h) + +theorem chartMap_ratio (b : I) : + chartMap I a s (ratio I a hj b) = + IsLocalization.mk' (Localization.Away (coefficientProduct I a s)) + (b.val * coefficientProduct I a (s.erase j)) + (powerDenominator (coefficientProduct I a s) 1) := by + rw [ratio, chartMap_mk, map_mul, evaluation_generator, evaluation_productGenerator] + +theorem base_mul_ratio (b : I) : + chartBase I a s (a j).val * ratio I a hj b = chartBase I a s b.val := by + apply chartMap_injective I a s + rw [map_mul, chartMap_base, chartMap_ratio, chartMap_base, + IsLocalization.mul_mk'_eq_mk'_of_mul] + apply IsLocalization.mk'_eq_iff_eq_mul.mpr + rw [← map_mul] + congr 1 + change (a j).val * (b.val * coefficientProduct I a (s.erase j)) = + b.val * coefficientProduct I a s ^ 1 + rw [pow_one, coefficientProduct_eq_pivot I a hj] + ring + +theorem map_ideal_principal : + I.map (chartBase I a s) = Ideal.span {chartBase I a s (a j).val} := by + apply le_antisymm + · rw [Ideal.map_le_iff_le_comap] + intro b hb + change chartBase I a s b ∈ Ideal.span {chartBase I a s (a j).val} + rw [Ideal.mem_span_singleton] + exact ⟨ratio I a hj ⟨b, hb⟩, (base_mul_ratio I a hj ⟨b, hb⟩).symm⟩ + · rw [Ideal.span_singleton_le_iff_mem] + exact Ideal.mem_map_of_mem _ (a j).property + +theorem chart_ordinaryPower_principal (n : ℕ) : + (I ^ n).map (chartBase I a s) = Ideal.span {(chartBase I a s (a j).val) ^ n} := by + rw [Ideal.map_pow, map_ideal_principal I a hj, Ideal.span_singleton_pow] + +theorem chart_generator_regular : IsRegular (chartBase I a s (a j).val) := by + have hu : IsUnit (chartMap I a s (chartBase I a s (a j).val)) := by + rw [chartMap_base] + exact IsLocalization.Away.isUnit_of_dvd (coefficientProduct I a s) + ⟨coefficientProduct I a (s.erase j), coefficientProduct_eq_pivot I a hj⟩ + constructor + · intro x y h + apply chartMap_injective I a s + apply hu.isRegular.left + simpa only [map_mul] using congrArg (chartMap I a s) h + · intro x y h + apply chartMap_injective I a s + apply hu.isRegular.right + simpa only [map_mul] using congrArg (chartMap I a s) h + +end +end PiExponent.ReesProductChart + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductFrames.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductFrames.lean new file mode 100644 index 0000000000000000000000000000000000000000..74b79371c03a1fb17f3320587bf2b0a684d29fe3 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductFrames.lean @@ -0,0 +1,37 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalAffineChart +import OAI.NumberTheory.PiExponent.Ampleness.ReesExceptionalSheaf +import OAI.NumberTheory.PiExponent.Ampleness.ReesProductSchemeChart + +namespace OAI + +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +namespace PiExponent.ReesProductPowerSections +open PiExponentSeshadri.ReesGrading PiExponent.ReesProductChart +variable {R J : Type} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) {s : Finset J} (hs : s.Nonempty) +variable {p : J} (hp : p ∈ s) +attribute [local irreducible] affineBlowup projection exceptionalLineBundle exceptionalInclusion exceptionalIdeal + PiExponentSeshadri.Geometry.LineBundle.pow PiExponentSeshadri.Geometry.PresentsPullbackIdeal + PiExponent.ExceptionalAffineChart.sectionsEquiv PiExponent.ExceptionalAffineChart.idealChartFrame + +include hp in + +theorem chartFrame_nonempty : + Nonempty ((exceptionalLineBundle I).sheaf.restrict (chartOpen I a hs).1.ι ≅ + O (chartOpen I a hs).1.toScheme) := by + rw [exceptionalLineBundle_sheaf_eq] + exact ⟨ExceptionalAffineChart.idealChartFrame (Y := affineBlowup I) (chartMorphism I a hs) (exceptionalIdeal I) + (chartEquation I a (s := s) (p := p)) + (exceptional_chart I a hs hp) (chartEquation_regular I a hp)⟩ + +def chartFrame : + (exceptionalLineBundle I).sheaf.restrict (chartOpen I a hs).1.ι ≅ + O (chartOpen I a hs).1.toScheme := + (chartFrame_nonempty I a hs hp).some + +end PiExponent.ReesProductPowerSections +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductPower.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductPower.lean new file mode 100644 index 0000000000000000000000000000000000000000..4388657a34ffe5f258baaa94056f47623697f5dd --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductPower.lean @@ -0,0 +1,143 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesProductChart + +namespace OAI + +namespace PiExponent.ReesProductPower +noncomputable section +open PiExponentSeshadri.ReesGrading +open PiExponent.ReesGradedModule PiExponent.ReesPolynomialPresentation +open PiExponent.GradedPolynomialLaurent PiExponent.GradedLocalizationExact PiExponent.GradedCech +open PiExponent.ReesLocalizedIntersections PiExponent.ReesProductChart +attribute [local instance] MvPolynomial.weightedGradedAlgebra +variable {R J : Type*} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) {s : Finset J} {j : J} (hj : j ∈ s) +include hj + +theorem pieceEvaluation_mem_chartPower (n : ℕ) (z : Piece I a s n) : + ∃ q : ↥((I ^ n).map (ReesProductChart.chartBase I a s)), + ReesProductChart.chartMap I a s q.val = pieceEvaluation I a s n z := by + let := presentationAlgebra I a + let := gradedScalarAction I a + obtain ⟨k, m, hm, hrep⟩ := z.property + have hm' : m ∈ piece I (n + k * s.card) := by + change m ∈ integerPiece I (↑(n + k * s.card)) + simpa only [Nat.cast_add, Nat.cast_mul] using hm + have hc : s.card = (s.erase j).card + 1 := (Finset.card_erase_add_one hj).symm + have hdeg : (n + k * s.card) + n • (s.erase j).card = (n + k) • s.card := by + rw [hc] + simp only [nsmul_eq_mul, Nat.cast_id] + ring + have hnum : m * productGenerator I a (s.erase j) ^ n ∈ piece I ((n + k) • s.card) := by + have h := SetLike.mul_mem_graded hm' + (SetLike.pow_mem_graded n (productGenerator_mem I a (s.erase j))) + simpa only [hdeg] using h + let q : Chart I a s := HomogeneousLocalization.Away.mk (piece I) + (productGenerator_mem I a s) (n + k) (m * productGenerator I a (s.erase j) ^ n) hnum + have hmem : (ReesProductChart.chartBase I a s (a j).val) ^ n * q ∈ + (I ^ n).map (ReesProductChart.chartBase I a s) := by + rw [chart_ordinaryPower_principal I a hj] + exact Ideal.mul_mem_right q _ (Ideal.subset_span (by simp)) + refine ⟨⟨(ReesProductChart.chartBase I a s (a j).val) ^ n * q, hmem⟩, ?_⟩ + change ReesProductChart.chartMap I a s + ((ReesProductChart.chartBase I a s (a j).val) ^ n * q) = + localizationEvaluation I a s z.val + have hmap : ReesProductChart.chartMap I a s + ((ReesProductChart.chartBase I a s (a j).val) ^ n) = + algebraMap R (Localization.Away (coefficientProduct I a s)) ((a j).val ^ n) := by + calc + _ = (ReesProductChart.chartMap I a s + (ReesProductChart.chartBase I a s (a j).val)) ^ n := + (ReesProductChart.chartMap I a s).map_pow _ n + _ = _ := by rw [ReesProductChart.chartMap_base, map_pow] + rw [hrep, localizationEvaluation_fraction, map_mul, hmap] + change algebraMap R (Localization.Away (coefficientProduct I a s)) ((a j).val ^ n) * + ReesProductChart.chartMap I a s (HomogeneousLocalization.Away.mk (piece I) + (productGenerator_mem I a s) (n + k) (m * productGenerator I a (s.erase j) ^ n) hnum) = _ + rw [ReesProductChart.chartMap_mk, map_mul, (evaluation I).map_pow, evaluation_productGenerator, + IsLocalization.mul_mk'_eq_mk'_of_mul] + apply IsLocalization.mk'_eq_of_eq + change coefficientProduct I a s ^ (n + k) * evaluation I m = + coefficientProduct I a s ^ k * ((a j).val ^ n * + (evaluation I m * coefficientProduct I a (s.erase j) ^ n)) + rw [pow_add, coefficientProduct_eq_pivot I a hj, mul_pow] + ring + +theorem chartPower_mem_pieceEvaluation (n : ℕ) + (q : ↥((I ^ n).map (ReesProductChart.chartBase I a s))) : + ∃ z : Piece I a s n, + pieceEvaluation I a s n z = ReesProductChart.chartMap I a s q.val := by + let := presentationAlgebra I a + let := gradedScalarAction I a + have hq : q.val ∈ Ideal.span {(ReesProductChart.chartBase I a s (a j).val) ^ n} := + (congrArg (fun K : Ideal (Chart I a s) => q.val ∈ K) + (chart_ordinaryPower_principal I a hj n)).mp q.property + rw [Ideal.mem_span_singleton] at hq + obtain ⟨r, hr⟩ := hq + obtain ⟨k, p, hp, hrep⟩ := HomogeneousLocalization.Away.mk_surjective (piece I) + (productGenerator_mem I a s) r + let m : reesAlgebra I := generator I (a j) ^ n * p + have hm' : m ∈ piece I (n + k * s.card) := by + have h := SetLike.mul_mem_graded (SetLike.pow_mem_graded n (generator_mem I (a j))) hp + simpa only [nsmul_eq_mul, mul_one, Nat.cast_id, m] using h + have hm : m ∈ integerPiece I ((n : ℤ) + (k : ℤ) * (s.card : ℤ)) := by + have h : m ∈ integerPiece I (↑(n + k * s.card)) := hm' + simpa only [Nat.cast_add, Nat.cast_mul] using h + let z : Piece I a s n := ⟨fraction + (coverProduct (MvPolynomial.X : J → MvPolynomial J R) s) m k, + k, m, hm, rfl⟩ + refine ⟨z, ?_⟩ + change localizationEvaluation I a s (fraction + (coverProduct (MvPolynomial.X : J → MvPolynomial J R) s) m k) = _ + have hmap : ReesProductChart.chartMap I a s + ((ReesProductChart.chartBase I a s (a j).val) ^ n) = + algebraMap R (Localization.Away (coefficientProduct I a s)) ((a j).val ^ n) := by + calc + _ = (ReesProductChart.chartMap I a s + (ReesProductChart.chartBase I a s (a j).val)) ^ n := + (ReesProductChart.chartMap I a s).map_pow _ n + _ = _ := by rw [ReesProductChart.chartMap_base, map_pow] + rw [localizationEvaluation_fraction, hr, (ReesProductChart.chartMap I a s).map_mul, + hmap, ← hrep, ReesProductChart.chartMap_mk, + IsLocalization.mul_mk'_eq_mk'_of_mul] + congr 1 + change evaluation I (generator I (a j) ^ n * p) = (a j).val ^ n * evaluation I p + rw [map_mul, map_pow, evaluation_generator] + +def chartPowerMap (n : ℕ) : Piece I a s n →+ + ↥((I ^ n).map (ReesProductChart.chartBase I a s)) where + toFun z := (pieceEvaluation_mem_chartPower I a hj n z).choose + map_zero' := by + apply Subtype.ext + apply ReesProductChart.chartMap_injective I a s + rw [(pieceEvaluation_mem_chartPower I a hj n 0).choose_spec, map_zero] + change 0 = ReesProductChart.chartMap I a s 0 + exact (map_zero _).symm + map_add' z w := by + apply Subtype.ext + apply ReesProductChart.chartMap_injective I a s + change ReesProductChart.chartMap I a s _ = ReesProductChart.chartMap I a s (_ + _) + rw [(pieceEvaluation_mem_chartPower I a hj n (z+w)).choose_spec, map_add, map_add, + (pieceEvaluation_mem_chartPower I a hj n z).choose_spec, + (pieceEvaluation_mem_chartPower I a hj n w).choose_spec] + +theorem chartPowerMap_evaluation (n : ℕ) (z : Piece I a s n) : + ReesProductChart.chartMap I a s (chartPowerMap I a hj n z).val = pieceEvaluation I a s n z := + (pieceEvaluation_mem_chartPower I a hj n z).choose_spec + +def chartPowerEquiv (n : ℕ) : Piece I a s n ≃+ + ↥((I ^ n).map (ReesProductChart.chartBase I a s)) := + AddEquiv.ofBijective (chartPowerMap I a hj n) ⟨by + intro z w hzw + apply pieceEvaluation_injective I a s n + rw [← chartPowerMap_evaluation I a hj n z, ← chartPowerMap_evaluation I a hj n w, hzw], by + intro q + obtain ⟨z, hz⟩ := chartPower_mem_pieceEvaluation I a hj n q + refine ⟨z, ?_⟩ + apply Subtype.ext + apply ReesProductChart.chartMap_injective I a s + rw [chartPowerMap_evaluation I a hj n z, hz]⟩ + +end +end PiExponent.ReesProductPower + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..2332d080def7d0c5219c5d515c03080934e8a4ec --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductRestriction.lean @@ -0,0 +1,129 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesProductPower + +namespace OAI + +namespace PiExponent.ReesProductRestriction +noncomputable section +open PiExponentSeshadri.ReesGrading +open PiExponent.ReesGradedModule PiExponent.ReesPolynomialPresentation +open PiExponent.GradedPolynomialLaurent PiExponent.GradedLocalizationExact PiExponent.GradedCech +open PiExponent.ReesLocalizedIntersections PiExponent.ReesProductChart PiExponent.ReesProductPower +attribute [local instance] MvPolynomial.weightedGradedAlgebra +variable {R J : Type*} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) + +omit [Fintype J] in +theorem productGenerator_factor {s t : Finset J} (hst : s ⊆ t) : + productGenerator I a t = productGenerator I a s * productGenerator I a (t \ s) := by + simp only [productGenerator_eq_prod] + exact (Finset.prod_sdiff hst).symm.trans (mul_comm _ _) + +omit [Fintype J] in +theorem coefficientProduct_factor {s t : Finset J} (hst : s ⊆ t) : + coefficientProduct I a t = coefficientProduct I a s * coefficientProduct I a (t \ s) := by + exact (Finset.prod_sdiff hst).symm.trans (mul_comm _ _) + +def chartRestriction {s t : Finset J} (hst : s ⊆ t) : Chart I a s →+* Chart I a t := + HomogeneousLocalization.awayMap (piece I) (productGenerator_mem I a (t \ s)) + (productGenerator_factor I a hst) + +theorem chartRestriction_base {s t : Finset J} (hst : s ⊆ t) (r : R) : + chartRestriction I a hst (ReesProductChart.chartBase I a s r) = + ReesProductChart.chartBase I a t r := + HomogeneousLocalization.awayMap_fromZeroRingHom _ _ _ _ + +omit [Fintype J] [DecidableEq J] in +theorem chartMap_mk_homogeneous (s : Finset J) {d : ℕ} + (hgen : productGenerator I a s ∈ piece I d) (k : ℕ) (m : reesAlgebra I) + (hm : m ∈ piece I (k • d)) : + ReesProductChart.chartMap I a s (HomogeneousLocalization.Away.mk (piece I) hgen k m hm) = + IsLocalization.mk' (Localization.Away (coefficientProduct I a s)) (evaluation I m) + (powerDenominator (coefficientProduct I a s) k) := by + simp only [ReesProductChart.chartMap, RingHom.comp_apply, + HomogeneousLocalization.algebraMap_apply, HomogeneousLocalization.Away.val_mk, + Localization.mk_eq_mk', IsLocalization.map_mk'] + congr 1 + apply Subtype.ext + simp only [map_pow, evaluation_productGenerator, powerDenominator_val] + +omit [Fintype J] in +theorem coefficientRestriction_fraction {s t : Finset J} (hst : s ⊆ t) (r : R) (k : ℕ) : + coefficientRestriction I a hst + (IsLocalization.mk' (Localization.Away (coefficientProduct I a s)) r + (powerDenominator (coefficientProduct I a s) k)) = + IsLocalization.mk' (Localization.Away (coefficientProduct I a t)) + (r * coefficientProduct I a (t \ s) ^ k) + (powerDenominator (coefficientProduct I a t) k) := by + have hu : IsUnit (algebraMap R (Localization.Away (coefficientProduct I a t)) + (coefficientProduct I a s)) := + IsLocalization.Away.isUnit_of_dvd (coefficientProduct I a t) + ⟨coefficientProduct I a (t \ s), coefficientProduct_factor I a hst⟩ + apply (hu.pow k).mul_right_injective + calc + _ = algebraMap R (Localization.Away (coefficientProduct I a t)) r := by + have h := congrArg (coefficientRestriction I a hst) + (IsLocalization.mk'_spec' (Localization.Away (coefficientProduct I a s)) r + (powerDenominator (coefficientProduct I a s) k)) + simpa only [map_mul, coefficientRestriction_algebraMap, powerDenominator_val, map_pow] using h + _ = _ := by + rw [← map_pow] + dsimp only + rw [IsLocalization.mul_mk'_eq_mk'_of_mul] + symm + apply IsLocalization.mk'_eq_iff_eq_mul.mpr + rw [← map_mul] + congr 1 + change coefficientProduct I a s ^ k * (r * coefficientProduct I a (t \ s) ^ k) = + r * coefficientProduct I a t ^ k + rw [coefficientProduct_factor I a hst, mul_pow] + ring + +theorem chartMap_restriction {s t : Finset J} (hst : s ⊆ t) (q : Chart I a s) : + ReesProductChart.chartMap I a t (chartRestriction I a hst q) = + coefficientRestriction I a hst (ReesProductChart.chartMap I a s q) := by + obtain ⟨k, m, hm, rfl⟩ := HomogeneousLocalization.Away.mk_surjective (piece I) + (productGenerator_mem I a s) q + rw [chartRestriction, HomogeneousLocalization.awayMap_mk, chartMap_mk_homogeneous, + ReesProductChart.chartMap_mk, coefficientRestriction_fraction, + map_mul, (evaluation I).map_pow, evaluation_productGenerator] + +theorem chartRestriction_power_mem {s t : Finset J} (hst : s ⊆ t) (n : ℕ) + (q : ↥((I ^ n).map (ReesProductChart.chartBase I a s))) : + chartRestriction I a hst q.val ∈ (I ^ n).map (ReesProductChart.chartBase I a t) := by + have hmap : ((I ^ n).map (ReesProductChart.chartBase I a s)).map (chartRestriction I a hst) = + (I ^ n).map (ReesProductChart.chartBase I a t) := by + rw [Ideal.map_map] + congr 1 + apply RingHom.ext + intro r + exact chartRestriction_base I a hst r + rw [← hmap] + exact Ideal.mem_map_of_mem _ q.property + +def chartPowerRestriction {s t : Finset J} (hst : s ⊆ t) (n : ℕ) : + ↥((I ^ n).map (ReesProductChart.chartBase I a s)) →+ + ↥((I ^ n).map (ReesProductChart.chartBase I a t)) where + toFun q := ⟨chartRestriction I a hst q.val, chartRestriction_power_mem I a hst n q⟩ + map_zero' := Subtype.ext (map_zero _) + map_add' _ _ := Subtype.ext (map_add _ _ _) + +theorem chartPowerMap_restriction {s t : Finset J} {j k : J} + (hj : j ∈ s) (hk : k ∈ t) (hst : s ⊆ t) (n : ℕ) (z : Piece I a s n) : + letI := presentationAlgebra I a + letI := gradedScalarAction I a + chartPowerMap I a hk n (setRestriction (grading (J := J) (R := R)) (integerPiece I) + MvPolynomial.X variable_mem hst n z) = + chartPowerRestriction I a hst n (chartPowerMap I a hj n z) := by + let := presentationAlgebra I a + let := gradedScalarAction I a + apply Subtype.ext + apply ReesProductChart.chartMap_injective I a t + change ReesProductChart.chartMap I a t _ = + ReesProductChart.chartMap I a t (chartRestriction I a hst (chartPowerMap I a hj n z).val) + rw [chartPowerMap_evaluation I a hk, chartMap_restriction, chartPowerMap_evaluation I a hj, + pieceEvaluation_restriction] + +end +end PiExponent.ReesProductRestriction + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductSchemeChart.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductSchemeChart.lean new file mode 100644 index 0000000000000000000000000000000000000000..ff5f05d023b315544dd9f9d2cab8a4a9d4885b74 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductSchemeChart.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalPowerSections +import OAI.NumberTheory.PiExponent.Ampleness.ReesProductChart +import OAI.NumberTheory.PiExponent.Geometry.IdealSheafPowers + +namespace OAI + +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +namespace PiExponent.ReesProductPowerSections +open PiExponentSeshadri.ReesGrading +open PiExponent.ReesProductChart +variable {R J : Type} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) {s : Finset J} (hs : s.Nonempty) + +theorem exists_chartMorphism : + ∃ j : Spec (CommRingCat.of (Chart I a s)) ⟶ affineBlowup I, + j = Proj.awayι (piece I) (productGenerator I a s) (productGenerator_mem I a s) + (Finset.card_pos.mpr hs) := + ⟨_, rfl⟩ + +def chartMorphism : Spec (CommRingCat.of (Chart I a s)) ⟶ affineBlowup I := + (exists_chartMorphism I a hs).choose + +theorem chartMorphism_eq : + chartMorphism I a hs = + Proj.awayι (piece I) (productGenerator I a s) (productGenerator_mem I a s) + (Finset.card_pos.mpr hs) := + (exists_chartMorphism I a hs).choose_spec + +instance chartMorphism_open : IsOpenImmersion (chartMorphism I a hs) := by + rw [chartMorphism_eq] + exact inferInstanceAs (IsOpenImmersion + (Proj.awayι (m := s.card) (piece I) (productGenerator I a s) + (productGenerator_mem I a s) (Finset.card_pos.mpr hs))) + +theorem chartMorphism_projection : + chartMorphism I a hs ≫ projection I = + Spec.map (CommRingCat.ofHom (ReesProductChart.chartBase I a s)) := by + rw [chartMorphism_eq] + change Proj.awayι (piece I) (productGenerator I a s) _ _ ≫ + (Proj.toSpecZero (piece I) ≫ Spec.map (zeroIso I).hom) = _ + rw [← Category.assoc, Proj.awayι_toSpecZero, ← Spec.map_comp] + rfl + +private local instance (q : I) : IsOpenImmersion ((chartCover I).f q) := + (chartCover I).map_prop q + +theorem chartMorphism_opensRange : + (chartMorphism I a hs).opensRange = + s.inf (fun j => ((chartCover I).f (a j)).opensRange) := by + have he : (chartMorphism I a hs).opensRange = + (Proj.awayι (piece I) (productGenerator I a s) (productGenerator_mem I a s) + (Finset.card_pos.mpr hs)).opensRange := by + apply SetLike.coe_injective + simp only [Scheme.Hom.coe_opensRange] + rw [chartMorphism_eq] + rfl + rw [he] + change (Proj.awayι (piece I) (productGenerator I a s) _ _).opensRange = _ + rw [Proj.opensRange_awayι, productGenerator_eq_prod] + have h : ∀ t : Finset J, + Proj.basicOpen (piece I) (∏ j ∈ t, generator I (a j)) = + t.inf (fun j => Proj.basicOpen (piece I) (generator I (a j))) := by + intro t + induction t using Finset.induction_on with + | empty => simp + | @insert j t hj ih => rw [Finset.prod_insert hj, Proj.basicOpen_mul, ih, Finset.inf_insert] + rw [h] + congr 1 + funext j + exact (Proj.opensRange_awayι (piece I) (generator I (a j)) + (generator_mem I (a j)) (by decide)).symm + +def chartOpen : (affineBlowup I).affineOpens := + ⟨(chartMorphism I a hs).opensRange, isAffineOpen_opensRange _⟩ + +variable {p : J} (hp : p ∈ s) + +def chartEquation : Γ(Spec (CommRingCat.of (Chart I a s)), ⊤) := + (Scheme.ΓSpecIso (CommRingCat.of (Chart I a s))).inv + (ReesProductChart.chartBase I a s (a p).val) + +include hp in +theorem exceptional_chart : + ((exceptionalIdeal I).comap (chartMorphism I a hs)).ideal + ⟨⊤, isAffineOpen_top _⟩ = Ideal.span {chartEquation I a (s := s) (p := p)} := by + rw [exceptionalIdeal, ← Scheme.IdealSheafData.comap_comp, chartMorphism_projection, + PiExponentSeshadri.IdealPullback.specIdeal_comap, + PiExponentSeshadri.IdealPullback.specIdeal_top, + ReesProductChart.map_ideal_principal I a hp, Ideal.map_span, Set.image_singleton] + rfl + +include hp in +theorem chartEquation_regular : IsLeftRegular (chartEquation I a (s := s) (p := p)) := by + exact PiExponentSeshadri.IdealModule.regular_map_flat _ + (RingHom.Flat.of_bijective (ConcreteCategory.bijective_of_isIso + (Scheme.ΓSpecIso (CommRingCat.of (Chart I a s))).inv)) + (ReesProductChart.chart_generator_regular I a hp).left + +end PiExponent.ReesProductPowerSections +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductSchemeRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductSchemeRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2d20636c17f8fbe8727fa882d7b4bbe31516833 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesProductSchemeRestriction.lean @@ -0,0 +1,29 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesProductRestriction +import OAI.NumberTheory.PiExponent.Ampleness.ReesProductSchemeChart + +namespace OAI + +namespace PiExponent.ReesProductSchemeRestriction +noncomputable section +open CategoryTheory AlgebraicGeometry +open PiExponentSeshadri.ReesGrading +open PiExponent.ReesProductChart PiExponent.ReesProductRestriction +open PiExponent.ReesProductPowerSections +variable {R J : Type} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) + +theorem chartRestriction_chartMorphism {s t : Finset J} (hs : s.Nonempty) + (ht : t.Nonempty) (hst : s ⊆ t) : + Spec.map (CommRingCat.ofHom (chartRestriction I a hst)) ≫ chartMorphism I a hs = + chartMorphism I a ht := by + have h := Proj.SpecMap_awayMap_awayι (piece I) + (productGenerator_mem I a s) (Finset.card_pos.mpr hs) + (productGenerator_mem I a (t \ s)) (productGenerator_factor I a hst) + rw [chartMorphism_eq, chartMorphism_eq] + unfold chartRestriction + simpa only [Proj.awayι, Proj.basicOpenIsoSpec, affineBlowup] using h + +end +end PiExponent.ReesProductSchemeRestriction + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesPushdown.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesPushdown.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e5c103c90b7564cc1559cbc3a9826a7366e6c71 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesPushdown.lean @@ -0,0 +1,442 @@ +import Mathlib + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.ReesGrading + +section +open Polynomial DirectSum AlgebraicGeometry CategoryTheory +universe u +variable {R : Type u} [CommRing R] (I : Ideal R) + +def piece (n : ℕ) : Submodule R (reesAlgebra I) where + carrier := {p | (p : R[X]) = monomial n ((p : R[X]).coeff n)} + zero_mem' := by simp + add_mem' {p q} hp hq := by + change (p : R[X]) + q = monomial n (((p : R[X]) + q).coeff n) + rw [coeff_add, map_add, ← hp, ← hq] + smul_mem' a p hp := by + change a • (p : R[X]) = monomial n ((a • (p : R[X])).coeff n) + rw [coeff_smul, map_smul, ← hp] + +lemma mem_piece (n : ℕ) (p : reesAlgebra I) : + p ∈ piece I n ↔ (p : R[X]) = monomial n ((p : R[X]).coeff n) := Iff.rfl + +def component (n : ℕ) (p : reesAlgebra I) : piece I n := + ⟨⟨monomial n ((p : R[X]).coeff n), reesAlgebra.monomial_mem.mpr (p.property n)⟩, + by simp [mem_piece]⟩ + +@[simp] lemma component_val (n : ℕ) (p : reesAlgebra I) : + ((component I n p : reesAlgebra I) : R[X]) = monomial n ((p : R[X]).coeff n) := rfl + +def components (p : reesAlgebra I) : ⨁ n, piece I n := + ⟨fun n => component I n p, + Trunc.mk ⟨(p : R[X]).support.val, fun n => by + classical + by_cases hn : n ∈ (p : R[X]).support + · exact Or.inl hn + · right + apply Subtype.ext + apply Subtype.ext + have hc : (p : R[X]).coeff n = 0 := notMem_support_iff.mp hn + simp [component_val, hc]⟩⟩ + +@[simp] lemma components_apply (p : reesAlgebra I) (n : ℕ) : + components I p n = component I n p := rfl + +def componentsAdd : reesAlgebra I →+ ⨁ n, piece I n where + toFun := components I + map_zero' := by ext n : 1; apply Subtype.ext; apply Subtype.ext; simp [component_val] + map_add' p q := by + ext n : 1 + apply Subtype.ext + apply Subtype.ext + change monomial n (((p : R[X]) + q).coeff n) = + monomial n ((p : R[X]).coeff n) + monomial n ((q : R[X]).coeff n) + rw [coeff_add, map_add] + +lemma piece_coeff_ne {n m : ℕ} (hnm : n ≠ m) (p : piece I n) : + ((p : reesAlgebra I) : R[X]).coeff m = 0 := by + rw [(mem_piece I n p.val).mp p.property, coeff_monomial, ite_eq_right hnm] + +lemma components_of_piece (n : ℕ) (p : piece I n) : + components I p.val = DirectSum.of (fun n => piece I n) n p := by + ext m : 1 + by_cases h : n = m + · subst m + rw [DirectSum.of_eq_same] + apply Subtype.ext + apply Subtype.ext + exact ((mem_piece I n p.val).mp p.property).symm + · rw [DirectSum.of_eq_of_ne _ _ _ (Ne.symm h)] + apply Subtype.ext + apply Subtype.ext + simp [component_val, piece_coeff_ne I h p] + +lemma recompose_components (p : reesAlgebra I) : + DirectSum.coeAddMonoidHom (piece I) (components I p) = p := by + let f := DirectSum.coeAddMonoidHom (piece I) + have hc (n : ℕ) : + ((Polynomial.lcoeff R n).toAddMonoidHom.comp + ((reesAlgebra I).val.toAddMonoidHom.comp f)) = + ((Polynomial.lcoeff R n).toAddMonoidHom.comp + ((reesAlgebra I).val.toAddMonoidHom.comp + ((piece I n).subtype.toAddMonoidHom.comp (DFinsupp.evalAddMonoidHom n)))) := by + apply DirectSum.addHom_ext + intro m a + dsimp only [f] + simp only [AddMonoidHom.comp_apply, DirectSum.coeAddMonoidHom_of] + change ((a : reesAlgebra I) : R[X]).coeff n = + (((DirectSum.of (fun i => piece I i) m a) n : reesAlgebra I) : R[X]).coeff n + by_cases h : m = n + · subst m + rw [DirectSum.of_eq_same] + · rw [DirectSum.of_eq_of_ne _ _ _ (Ne.symm h), piece_coeff_ne I h a] + rfl + apply Subtype.ext + ext n + have h := DFunLike.congr_fun (hc n) (components I p) + change ((f (components I p) : reesAlgebra I) : R[X]).coeff n = + ((component I n p : reesAlgebra I) : R[X]).coeff n at h + simpa only [component_val, coeff_monomial, ite_true] using h + +instance gradedMonoid : SetLike.GradedMonoid (piece I) where + one_mem := by simp [mem_piece] + mul_mem {i j} {a b} ha hb := by + change (a : R[X]) * b = monomial (i+j) (((a : R[X]) * b).coeff (i+j)) + rw [(mem_piece I i a).mp ha, (mem_piece I j b).mp hb, + monomial_mul_monomial, coeff_monomial, ite_eq_left rfl] + +instance grading : GradedAlgebra (piece I) where + toGradedMonoid := gradedMonoid I + decompose' := components I + left_inv := recompose_components I + right_inv := by + have h : (componentsAdd I).comp (DirectSum.coeAddMonoidHom (piece I)) = .id _ := by + apply DirectSum.addHom_ext + intro n a + simp only [AddMonoidHom.comp_apply, DirectSum.coeAddMonoidHom_of, + AddMonoidHom.id_apply] + exact components_of_piece I n a + exact DFunLike.congr_fun h + +def affineBlowup : Scheme.{u} := Proj (piece I) + +def zeroEquiv : R ≃+* piece I 0 := + RingEquiv.ofBijective (algebraMap R (piece I 0)) (by + constructor + · intro a b h + have hp := congrArg (fun p : piece I 0 => ((p : reesAlgebra I) : R[X])) h + exact Polynomial.C_injective hp + · intro p + refine ⟨((p : reesAlgebra I) : R[X]).coeff 0, ?_⟩ + apply Subtype.ext + apply Subtype.ext + exact (show ((p : reesAlgebra I) : R[X]) = + C (((p : reesAlgebra I) : R[X]).coeff 0) by + simpa only [monomial_zero_left] using (mem_piece I 0 p.val).mp p.property).symm) + +def zeroIso : CommRingCat.of R ≅ CommRingCat.of (piece I 0) := + (zeroEquiv I).toCommRingCatIso + +def projection : affineBlowup I ⟶ Spec (CommRingCat.of R) := + Proj.toSpecZero (piece I) ≫ Spec.map (zeroIso I).hom + +instance : IsScalarTower R (piece I 0) (reesAlgebra I) := + IsScalarTower.of_algebraMap_eq (R := R) (S := piece I 0) (A := reesAlgebra I) + (fun _ => rfl) + +instance [IsNoetherianRing R] : Algebra.FiniteType (piece I 0) (reesAlgebra I) := + Algebra.FiniteType.of_restrictScalars_finiteType R (piece I 0) (reesAlgebra I) + +instance projection_proper [IsNoetherianRing R] : IsProper (projection I) := by + have hP : IsProper (Proj.toSpecZero (piece I)) := inferInstance + have hS : IsIso (Spec.map (zeroIso I).hom) := inferInstance + have hQ : IsProper (Spec.map (zeroIso I).hom) := by infer_instance + exact MorphismProperty.comp_mem (@IsProper) _ _ hP hQ + +end + +open Polynomial DirectSum AlgebraicGeometry CategoryTheory HomogeneousLocalization +universe u +variable {R : Type u} [CommRing R] (I : Ideal R) + +def generator (a : I) : reesAlgebra I := + ⟨monomial 1 a.val, reesAlgebra.monomial_mem.mpr (by simp [a.property])⟩ + +@[simp] lemma generator_val (a : I) : + (generator I a : R[X]) = monomial 1 a.val := rfl + +lemma generator_mem (a : I) : generator I a ∈ piece I 1 := by + simp [mem_piece] + +def evaluation : reesAlgebra I →+* R := + (Polynomial.evalRingHom 1).comp (reesAlgebra I).val.toRingHom + +@[simp] lemma evaluation_generator (a : I) : evaluation I (generator I a) = a.val := by + simp [evaluation] + +lemma evaluation_piece {n : ℕ} (p : piece I n) : + evaluation I p.val = ((p : reesAlgebra I) : R[X]).coeff n := by + change Polynomial.eval 1 ((p : reesAlgebra I) : R[X]) = _ + conv_lhs => rw [(mem_piece I n p.val).mp p.property] + simp + +abbrev chart (a : I) := HomogeneousLocalization.Away (piece I) (generator I a) + +def chartMap (a : I) : chart I a →+* Localization.Away a.val := + (IsLocalization.map (M := Submonoid.powers (generator I a)) + (S := Localization.Away (generator I a)) (T := Submonoid.powers a.val) + (Localization.Away a.val) (evaluation I) + (by rintro _ ⟨n, rfl⟩; exact ⟨n, by simp⟩)).comp + (algebraMap (chart I a) (Localization.Away (generator I a))) + +lemma chartMap_mk (a : I) (n : ℕ) (p : reesAlgebra I) + (hp : p ∈ piece I (n • (1 : ℕ))) : + chartMap I a (HomogeneousLocalization.Away.mk (piece I) (generator_mem I a) n p hp) = + IsLocalization.mk' (M := Submonoid.powers a.val) (Localization.Away a.val) + (evaluation I p) ⟨a.val ^ n, (Submonoid.powers a.val).pow_mem (Submonoid.mem_powers a.val) n⟩ := by + simp only [chartMap, RingHom.comp_apply, HomogeneousLocalization.algebraMap_apply, + HomogeneousLocalization.Away.val_mk, Localization.mk_eq_mk', IsLocalization.map_mk'] + congr 1 + apply Subtype.ext + simp + +lemma chartMap_injective (a : I) : Function.Injective (chartMap I a) := by + apply (RingHom.injective_iff_ker_eq_bot _).mpr + apply bot_unique + intro x hx + change x = 0 + obtain ⟨n, p, hp, rfl⟩ := HomogeneousLocalization.Away.mk_surjective (piece I) + (generator_mem I a) x + have hzero := RingHom.mem_ker.mp hx + rw [chartMap_mk] at hzero + obtain ⟨⟨b, hb⟩, hbp⟩ := (IsLocalization.mk'_eq_zero_iff (M := Submonoid.powers a.val) + (S := Localization.Away a.val) _ _).mp hzero + obtain ⟨j, rfl⟩ := hb + apply HomogeneousLocalization.val_injective + rw [HomogeneousLocalization.val_zero, HomogeneousLocalization.Away.val_mk, + Localization.mk_eq_mk', IsLocalization.mk'_eq_zero_iff] + refine ⟨⟨generator I a ^ j, ⟨j, rfl⟩⟩, ?_⟩ + apply Subtype.ext + have hpn : p ∈ piece I n := by simpa using hp + have he : evaluation I p = (p : R[X]).coeff n := evaluation_piece I ⟨p, hpn⟩ + change (generator I a : R[X]) ^ j * (p : R[X]) = 0 + rw [(mem_piece I n p).mp hpn, generator_val, monomial_pow, monomial_mul_monomial] + rw [he] at hbp + simp [hbp] + +def chartBase (a : I) : R →+* chart I a := + (HomogeneousLocalization.fromZeroRingHom (piece I) (Submonoid.powers (generator I a))).comp + (zeroEquiv I).toRingHom + +lemma chartMap_base (a : I) (r : R) : + chartMap I a (chartBase I a r) = algebraMap R (Localization.Away a.val) r := by + have h0 : algebraMap R (reesAlgebra I) r ∈ piece I (0 • (1 : ℕ)) := by + simp [mem_piece] + refine (chartMap_mk I a 0 (algebraMap R (reesAlgebra I) r) h0).trans ?_ + have he : evaluation I (algebraMap R (reesAlgebra I) r) = r := by simp [evaluation] + rw [he] + convert IsLocalization.mk'_one (M := Submonoid.powers a.val) + (Localization.Away a.val) r using 1 + congr 1 + apply Subtype.ext + exact pow_zero a.val + +def ratio (a b : I) : chart I a := + HomogeneousLocalization.Away.mk (piece I) (generator_mem I a) 1 + (generator I b) (by simpa using generator_mem I b) + +lemma chartMap_ratio (a b : I) : + chartMap I a (ratio I a b) = + IsLocalization.mk' (M := Submonoid.powers a.val) (Localization.Away a.val) + b.val ⟨a.val, ⟨1, pow_one _⟩⟩ := by + simp only [ratio, chartMap_mk, evaluation_generator, pow_one] + +lemma base_mul_ratio (a b : I) : + chartBase I a a.val * ratio I a b = chartBase I a b.val := by + apply chartMap_injective I a + rw [map_mul, chartMap_base, chartMap_ratio, chartMap_base] + exact IsLocalization.mk'_spec' (M := Submonoid.powers a.val) + (Localization.Away a.val) b.val ⟨a.val, ⟨1, pow_one _⟩⟩ + +lemma map_ideal_principal (a : I) : + I.map (chartBase I a) = Ideal.span {chartBase I a a.val} := by + apply le_antisymm + · rw [Ideal.map_le_iff_le_comap] + intro b hb + change chartBase I a b ∈ Ideal.span {chartBase I a a.val} + rw [Ideal.mem_span_singleton] + exact ⟨ratio I a ⟨b, hb⟩, (base_mul_ratio I a ⟨b, hb⟩).symm⟩ + · rw [Ideal.span_singleton_le_iff_mem] + exact Ideal.mem_map_of_mem _ a.property + +lemma chart_isDomain [IsDomain R] (a : I) (ha : a.val ≠ 0) : IsDomain (chart I a) := by + have : IsDomain (Localization.Away a.val) := IsLocalization.Away.isDomain (Localization.Away a.val) ha + exact Function.Injective.isDomain (chartMap I a) (chartMap_injective I a) + +lemma chartBase_injective [IsDomain R] (a : I) (ha : a.val ≠ 0) : + Function.Injective (chartBase I a) := by + intro r s h + apply IsLocalization.injective (Localization.Away a.val) + (powers_le_nonZeroDivisors_of_noZeroDivisors ha) + simpa only [chartMap_base] using congrArg (chartMap I a) h + +lemma chart_generator_regular (a : I) : + IsRegular (chartBase I a a.val) := by + have hu : IsUnit (chartMap I a (chartBase I a a.val)) := by + rw [chartMap_base] + exact IsLocalization.map_units (Localization.Away a.val) + (⟨a.val, 1, pow_one _⟩ : Submonoid.powers a.val) + constructor + · intro x y h + apply chartMap_injective I a + apply hu.isRegular.left + simpa only [map_mul] using congrArg (chartMap I a) h + · intro x y h + apply chartMap_injective I a + apply hu.isRegular.right + simpa only [map_mul] using congrArg (chartMap I a) h + +end PiExponentSeshadri.ReesGrading + +namespace PiExponent.ReesPushdown + +open Polynomial PiExponentSeshadri.ReesGrading + +variable {R : Type*} [CommRing R] + +def ordinaryPowerEquivPiece (I : Ideal R) (n : ℕ) : ↥(I ^ n : Ideal R) ≃ₗ[R] piece I n where + toFun a := ⟨⟨monomial n a.val, reesAlgebra.monomial_mem.mpr a.property⟩, + by simp [mem_piece]⟩ + invFun p := ⟨((p : reesAlgebra I) : R[X]).coeff n, p.val.property n⟩ + left_inv a := by apply Subtype.ext; simp + right_inv p := by + apply Subtype.ext + apply Subtype.ext + exact ((mem_piece I n p.val).mp p.property).symm + map_add' a b := by apply Subtype.ext; apply Subtype.ext; simp + map_smul' a b := by + apply Subtype.ext + apply Subtype.ext + change monomial n (a • b.val) = a • monomial n b.val + exact (monomial n).map_smul a b.val + +theorem coeff_mem_ordinaryPower (I : Ideal R) (n : ℕ) (p : piece I n) : + ((p : reesAlgebra I) : R[X]).coeff n ∈ I ^ n := p.val.property n + +theorem chart_ordinaryPower_principal (I : Ideal R) (a : I) (n : ℕ) : + (I ^ n).map (chartBase I a) = Ideal.span {(chartBase I a a.val) ^ n} := by + rw [Ideal.map_pow, map_ideal_principal, Ideal.span_singleton_pow] + +theorem ordinaryPowerEquivPiece_apply_coeff (I : Ideal R) (n : ℕ) (a : ↥(I ^ n : Ideal R)) : + (((ordinaryPowerEquivPiece I n a : piece I n) : reesAlgebra I) : R[X]).coeff n = a.val := by + simp [ordinaryPowerEquivPiece] + +theorem chart_ordinaryPower_fraction (I : Ideal R) (a : I) (n : ℕ) + (s : chart I a) (hs : s ∈ (I ^ n).map (chartBase I a)) : + ∃ k : ℕ, ∃ b ∈ I ^ (n + k), + chartMap I a s = IsLocalization.mk' (M := Submonoid.powers a.val) + (Localization.Away a.val) b ⟨a.val ^ k, (Submonoid.powers a.val).pow_mem (Submonoid.mem_powers a.val) k⟩ := by + rw [chart_ordinaryPower_principal, Ideal.mem_span_singleton] at hs + obtain ⟨q, hq⟩ := hs + obtain ⟨k, p, hp, hrep⟩ := HomogeneousLocalization.Away.mk_surjective (piece I) + (generator_mem I a) q + have hpn : p ∈ piece I k := by simpa using hp + have he : evaluation I p = (p : R[X]).coeff k := evaluation_piece I ⟨p, hpn⟩ + have hb : evaluation I p ∈ I ^ k := by rw [he]; exact p.property k + refine ⟨k, a.val ^ n * evaluation I p, ?_, ?_⟩ + · rw [pow_add] + exact Ideal.mul_mem_mul (Ideal.pow_mem_pow a.property n) hb + · have hmap : chartMap I a ((chartBase I a a.val) ^ n) = + algebraMap R (Localization.Away a.val) (a.val ^ n) := by + calc + _ = (chartMap I a (chartBase I a a.val)) ^ n := (chartMap I a).map_pow _ n + _ = _ := by rw [chartMap_base, map_pow] + rw [hq, map_mul, hmap, ← hrep, chartMap_mk] + exact IsLocalization.mul_mk'_eq_mk'_of_mul _ _ _ + +theorem eventually_no_power_torsion [IsNoetherianRing R] (I : Ideal R) : + ∃ N : ℕ, ∀ n ≥ N, ∀ x ∈ I ^ n, + (∃ k : ℕ, ∀ a ∈ I ^ k, a * x = 0) → x = 0 := by + let A : ℕ →o Ideal R := + ⟨fun n => (I ^ n).annihilator, + fun i j hij => Submodule.annihilator_mono (Ideal.pow_le_pow_right hij)⟩ + obtain ⟨e, he⟩ := monotone_stabilizes_iff_noetherian.mpr + (inferInstance : IsNoetherian R R) A + obtain ⟨c, hc⟩ := I.exists_pow_inf_eq_pow_smul (A e) + refine ⟨c + e, ?_⟩ + intro n hn x hxn hx + obtain ⟨k, hk⟩ := hx + have hxA : x ∈ A k := by + apply Submodule.mem_annihilator.mpr + intro a ha + simpa only [smul_eq_mul, mul_comm] using hk a ha + have hxAe : x ∈ A e := by + have hxmax := (A.monotone (Nat.le_max_left k e)) hxA + rw [he (max k e) (Nat.le_max_right k e)] + exact hxmax + have hinter : I ^ n ⊓ A e = I ^ (n - c) * (I ^ c ⊓ A e) := by + simpa only [Ideal.smul_eq_mul, Ideal.mul_top] using hc n (by omega) + have hzero : I ^ n ⊓ A e ≤ ⊥ := by + rw [hinter] + calc + _ ≤ I ^ e * A e := mul_le_mul' (Ideal.pow_le_pow_right (by omega)) inf_le_right + _ = ⊥ := by + change I ^ e * (I ^ e).annihilator = ⊥ + rw [mul_comm, Submodule.annihilator_mul] + exact Ideal.mem_bot.mp (hzero ⟨hxn, hxAe⟩) + +theorem exists_power_annihilating_of_chart_vanish [IsNoetherianRing R] + (I : Ideal R) (x : R) (hx : ∀ a : I, chartBase I a x = 0) : + ∃ k : ℕ, ∀ a ∈ I ^ k, a * x = 0 := by + let J : Ideal R := (Ideal.span {x}).annihilator + have hIJ : I ≤ J.radical := by + intro a ha + have hz : algebraMap R (Localization.Away a) x = 0 := by + calc + _ = chartMap I ⟨a, ha⟩ (chartBase I ⟨a, ha⟩ x) := + (chartMap_base I ⟨a, ha⟩ x).symm + _ = 0 := by rw [hx, map_zero] + obtain ⟨⟨b, hb⟩, hbx⟩ := + (IsLocalization.map_eq_zero_iff (Submonoid.powers a) (Localization.Away a) x).mp hz + obtain ⟨k, rfl⟩ := hb + apply Ideal.mem_radical_iff.mpr + refine ⟨k, ?_⟩ + change a ^ k ∈ (Submodule.span R {x}).annihilator + simpa only [Submodule.mem_annihilator_span_singleton, smul_eq_mul] using hbx + obtain ⟨k, hk⟩ := Ideal.exists_pow_le_of_le_radical_of_fg hIJ + (IsNoetherian.noetherian I) + refine ⟨k, ?_⟩ + intro a ha + have h := hk ha + change a ∈ (Submodule.span R {x}).annihilator at h + simpa only [Submodule.mem_annihilator_span_singleton, smul_eq_mul] using h + +theorem eventually_chart_family_injective_on_ordinaryPowers [IsNoetherianRing R] + (I : Ideal R) : + ∃ N : ℕ, ∀ n ≥ N, ∀ x ∈ I ^ n, + (∀ a : I, chartBase I a x = 0) → x = 0 := by + obtain ⟨N, hN⟩ := eventually_no_power_torsion I + exact ⟨N, fun n hn x hx hzero => hN n hn x hx + (exists_power_annihilating_of_chart_vanish I x hzero)⟩ + +theorem eventually_chart_family_injective [IsNoetherianRing R] (I : Ideal R) : + ∃ N : ℕ, ∀ n ≥ N, Function.Injective + (fun x : ↥(I ^ n : Ideal R) => fun a : I => chartBase I a x.val) := by + obtain ⟨N, hN⟩ := eventually_chart_family_injective_on_ordinaryPowers I + refine ⟨N, fun n hn x y hxy => ?_⟩ + apply Subtype.ext + apply sub_eq_zero.mp + apply hN n hn (x.val - y.val) ((I ^ n).sub_mem x.property y.property) + intro a + have ha : chartBase I a x.val = chartBase I a y.val := congrFun hxy a + rw [map_sub, ha, sub_self] + +end PiExponent.ReesPushdown + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesRelativeSections.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesRelativeSections.lean new file mode 100644 index 0000000000000000000000000000000000000000..60d52fb5cdbf075b1cd74645ff38fdd706510211 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesRelativeSections.lean @@ -0,0 +1,169 @@ +import OAI.NumberTheory.PiExponent.Ampleness.GlobalBlowupGluing +import OAI.NumberTheory.PiExponent.Approximation.SectionDivision +import OAI.NumberTheory.PiExponent.Geometry.LineBundleProduct + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.InvertibleLocal +open CategoryTheory AlgebraicGeometry Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +variable {X Y Z : Scheme.{0}} + +lemma frame_ideal [IsAffine X] {I : X.IdealSheafData} {f : Y ⟶ X} + (J : LineBundle Y) (ι : J.sheaf ⟶ O Y) (h : PresentsPullbackIdeal I f J ι) + (j : Z ⟶ Y) [IsOpenImmersion j] [IsAffine Z] + (e : J.sheaf.restrict j ≅ O Z) : + ((I.comap f).comap j).ideal ⟨⊤,isAffineOpen_top Z⟩ = + Ideal.span {endValue (e.inv ≫ restrictedInclusion J ι j)} := by + change _ = Ideal.span {UnitEndomorphism.equation (e.inv ≫ restrictedInclusion J ι j) ⊤} + rw [← UnitEndomorphism.image_principal _ ⊤, ← restricted_image J ι h j ⟨⊤, isAffineOpen_top Z⟩] + ext r + change (∃ s, (restrictedInclusion J ι j).val.app (op ⊤) s = r) ↔ + ∃ s, (restrictedInclusion J ι j).val.app (op ⊤) (e.inv.val.app (op ⊤) s) = r + constructor + · rintro ⟨s, hs⟩ + refine ⟨e.hom.val.app (op ⊤) s, ?_⟩ + have ht : e.inv.val.app (op ⊤) (e.hom.val.app (op ⊤) s) = s := + congrArg (fun k : J.sheaf.restrict j ⟶ J.sheaf.restrict j => k.val.app (op ⊤) s) e.hom_inv_id + rw [ht]; exact hs + · rintro ⟨s, hs⟩ + exact ⟨e.inv.val.app (op ⊤) s, hs⟩ +end PiExponentSeshadri.InvertibleLocal + +namespace PiExponentSeshadri.ReesGrading +section +open CategoryTheory AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames PiExponentSeshadri.SpecMaps + +private theorem mono_inv_comp {D : Type*} [Category D] {A B C : D} + (e : A ≅ B) (f : A ⟶ C) (hf : Mono f) : Mono (e.inv ≫ f) := by + let := hf + infer_instance + +private theorem map_comp_through {C D : Type*} [Category C] [Category D] + (F : C ⥤ D) {A B T : C} {U V : D} + (u : U ⟶ F.obj A) (s : A ⟶ B) (t : B ⟶ T) (v : F.obj T ⟶ V) : + (u ≫ F.map s) ≫ F.map t ≫ v = (u ≫ F.map (s ≫ t)) ≫ v := by + simp only [Functor.map_comp, Category.assoc] + +variable {R : Type} [CommRing R] (I : Ideal R) +variable {B : Scheme.{0}} (f : B ⟶ Spec (.of R)) + (J : LineBundle B) (ι : J.sheaf ⟶ O B) + (hJ : PresentsPullbackIdeal (IdealPullback.specIdeal I) f J ι) +include hJ + +theorem relative_generator_section (a : I) : + ∃ s : O B ⟶ J.sheaf, + s ≫ ι = scalarEnd ((coordinate f) a.val) := by + let : Mono ι := hJ.1 + obtain ⟨s,hs,-⟩ := global_division_of_local_lifts ι + (scalarEnd ((coordinate f) a.val)) (by + intro x + obtain ⟨U,hx,⟨e⟩,-⟩ := common_affine_frames J J x + let r := endValue (e.inv ≫ InvertibleLocal.restrictedInclusion J ι U.1.ι) + have hI : I.map (coordinate (U.1.ι ≫ f)).hom = Ideal.span {r} := by + rw [← IdealPullback.specIdeal_coordinate,Scheme.IdealSheafData.comap_comp] + exact InvertibleLocal.frame_ideal J ι hJ U.1.ι e + have hmem : coefficient (Scheme.Modules.restrictUnitIso U.1.ι) + (restrictSection U.1.ι (scalarEnd ((coordinate f) a.val))) ∈ Ideal.span {r} := by + rw [← hI] + have he : coefficient (Scheme.Modules.restrictUnitIso U.1.ι) + (restrictSection U.1.ι (scalarEnd ((coordinate f) a.val))) = + coordinate (U.1.ι ≫ f) a.val := by + erw [coefficient, endValue_restrict, endValue_scalarEnd] + rw [coordinate_comp] + rfl + rw [he] + exact Ideal.mem_map_of_mem _ a.property + obtain ⟨t,ht⟩ := framed_local_division e (Scheme.Modules.restrictUnitIso U.1.ι) + ((Scheme.Modules.restrictFunctor U.1.ι).map ι) + (restrictSection U.1.ι (scalarEnd ((coordinate f) a.val))) hmem + exact ⟨U.1,hx,t,ht⟩) + exact ⟨s,hs⟩ + +theorem relative_generator_section_open (β : B ⟶ affineBlowup I) (hβ : β ≫ projection I = f) (a : I) + (s : O B ⟶ J.sheaf) + (hs : s ≫ ι = scalarEnd ((coordinate f) a.val)) : + SectionOpens.isoOpen s = β ⁻¹ᵁ Proj.basicOpen (piece I) (generator I a) := by + let : Mono ι := hJ.1 + ext x + obtain ⟨U,hx,⟨e⟩,-⟩ := common_affine_frames J J x + let g := e.inv ≫ InvertibleLocal.restrictedInclusion J ι U.1.ι + have hg : Mono g := mono_inv_comp e (InvertibleLocal.restrictedInclusion J ι U.1.ι) + (@InvertibleLocal.restrictedInclusion_mono _ _ J ι U.1.ι inferInstance hJ.1) + let r := endValue g + have hr : IsRegular r := @UnitEndomorphism.equation_regular U.1.toScheme g hg ⊤ + have hI : I.map (coordinate (U.1.ι ≫ f)).hom = Ideal.span {r} := by + rw [← IdealPullback.specIdeal_coordinate,Scheme.IdealSheafData.comap_comp] + exact InvertibleLocal.frame_ideal J ι hJ U.1.ι e + let h := principalScheme I U.1.toScheme (coordinate (U.1.ι ≫ f)).hom r hI hr + have hh : h = U.1.ι ≫ β := by + apply invertible_unique I h (U.1.ι ≫ β) (U.1.ι ≫ f) + · exact (principalScheme_projection I U.1.toScheme _ r hI hr).trans (factor _) + · rw [Category.assoc,hβ] + · exact InvertibleLocal.invertible_restrict _ _ ⟨J,ι,hJ⟩ U.1.ι + have hscalar : coefficient e (restrictSection U.1.ι s) * r = + coordinate (U.1.ι ≫ f) a.val := by + have hcomp : (restrictSection U.1.ι s ≫ e.hom) ≫ g = + restrictSection U.1.ι (scalarEnd ((coordinate f) a.val)) ≫ + (Scheme.Modules.restrictUnitIso U.1.ι).hom := by + dsimp [g,InvertibleLocal.restrictedInclusion] + simp only [Category.assoc,Iso.hom_inv_id_assoc] + rw [← hs] + simp only [restrictSection] + exact map_comp_through (Scheme.Modules.restrictFunctor U.1.ι) + (Scheme.Modules.restrictUnitIso U.1.ι).inv s ι + (Scheme.Modules.restrictUnitIso U.1.ι).hom + have H := congrArg (endValue (X := U.1.toScheme)) hcomp + rw [coordinate_comp] + exact ((endValue_comp (restrictSection U.1.ι s ≫ e.hom) g).symm.trans H).trans + ((endValue_restrict U.1.ι (scalarEnd ((coordinate f) a.val))).trans + (congrArg U.1.ι.appTop (endValue_scalarEnd ((coordinate f) a.val)))) + have hc : coefficient e (restrictSection U.1.ι s) = + BlowupLift.coefficient I (coordinate (U.1.ι ≫ f)).hom r hI a := by + apply hr.left + exact (mul_comm _ _).trans (hscalar.trans + (BlowupLift.mul_coefficient I _ r hI a).symm) + have hloc : U.1.ι ⁻¹ᵁ SectionOpens.isoOpen s = + U.1.ι ⁻¹ᵁ β ⁻¹ᵁ Proj.basicOpen (piece I) (generator I a) := by + rw [preimage_isoOpen s U.1.ι e,hc] + have H := principalScheme_preimage I U.1.toScheme _ r hI hr a + change h ⁻¹ᵁ _ = _ at H + rw [hh] at H + exact H.symm + exact SetLike.ext_iff.mp hloc ⟨x,hx⟩ + +end + +open CategoryTheory AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames PiExponentSeshadri.SpecMaps +variable {R : Type} [CommRing R] (I : Ideal R) +variable {B : Scheme.{0}} (f : B ⟶ Spec (.of R)) + (J : LineBundle B) (ι : J.sheaf ⟶ O B) + (hJ : PresentsPullbackIdeal (IdealPullback.specIdeal I) f J ι) +include hJ + +theorem relative_affine_section_cover (hf : IsBlowup (IdealPullback.specIdeal I) f) : + ∃ s : I → (O B ⟶ J.sheaf), + (⨆ a, SectionOpens.isoOpen (s a)) = ⊤ ∧ + ∀ a, IsAffineOpen (SectionOpens.isoOpen (s a)) := by + classical + let e : B ≅ affineBlowup I := hf.iso (rees_isBlowup I) + let : IsIso e.hom := ⟨⟨e.inv,e.hom_inv_id,e.inv_hom_id⟩⟩ + choose s hs using relative_generator_section I f J ι hJ + have ho a := relative_generator_section_open I f J ι hJ e.hom + (hf.iso_hom_comp (rees_isBlowup I)) a (s a) (hs a) + refine ⟨s,?_,fun a => ?_⟩ + · simp only [ho] + exact e.hom.iSup_preimage_eq_top (iSup_generator_basicOpen I) + · rw [ho] + exact @IsAffineOpen.preimage_of_isIso B (affineBlowup I) _ + (Proj.isAffineOpen_basicOpen (piece I) (generator I a) (generator_mem I a) + (by decide : 0 < (1:ℕ))) e.hom e.isIso_hom +end PiExponentSeshadri.ReesGrading + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesSectionInclusion.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesSectionInclusion.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e5e27b6d7aa27f8c4468ad5c257acf13fe27100 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesSectionInclusion.lean @@ -0,0 +1,120 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ExceptionalChartPullbackValue +import OAI.NumberTheory.PiExponent.Cohomology.ReesSheafCechBase + +namespace OAI + +namespace PiExponent.ReesSectionInclusion +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.ReesGrading PiExponentSeshadri.ModuleFlasque +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open PiExponent.GeometrySupport PiExponent.ReesSheafCechBase +open PiExponent.GradedPolynomialLaurent PiExponent.GradedCech +attribute [local irreducible] affineBlowup projection exceptionalLineBundle exceptionalInclusion exceptionalIdeal + PiExponentSeshadri.Geometry.LineBundle.pow PiExponentSeshadri.Geometry.PresentsPullbackIdeal + PiExponent.ExceptionalAffineChart.sectionsEquiv PiExponent.ExceptionalAffineChart.representedSectionsEquiv +variable {R J : Type} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) + +private abbrev chartMap {s : Finset J} (hs : s.Nonempty) : + Spec (CommRingCat.of (ReesFrozenChart.coordinateRing I a s)) ⟶ affineBlowup I := + ReesFrozenChart.chart I a hs + +private local instance chartOpenImmersion {s : Finset J} (hs : s.Nonempty) : + IsOpenImmersion (chartMap I a hs) := + ReesFrozenChart.instIsOpenImmersionChart I a hs + +private theorem transported_augmentation (n : ℕ) + (f : freeOpen (affineBlowup I).ringCatSheaf ⊤ ⟶ exceptionalPower I n) + (t : Fin 1 → J) : + ExceptionalRepresentedTypes.transportSections + (chartMap I a (tuple_nonempty 0 t)) (exceptionalLineBundle I) n + (tupleOpen_eq I a 0 t) + (CechHigher.augmentation (affineBlowup I).ringCatSheaf (opens I a) + (exceptionalPower I n) ⊤ (fun _ => le_top) f t) = + freeOpenMap (affineBlowup I).ringCatSheaf (homOfLE le_top) ≫ f := by + change (PiExponentSeshadri.ModuleMayerVietoris.freeOpenFunctor (affineBlowup I).ringCatSheaf).map + (eqToHom (tupleOpen_eq I a 0 t)) ≫ + (PiExponentSeshadri.ModuleMayerVietoris.freeOpenFunctor (affineBlowup I).ringCatSheaf).map + (homOfLE _) ≫ f = _ + erw [← Category.assoc, ← Functor.map_comp] + rfl + +def HasFrozenValues (n : ℕ) + (u : freeOpen (affineBlowup I).ringCatSheaf ⊤ ⟶ exceptionalPower I n) (r : R) : Prop := + ∀ t : Fin 1 → J, + (ReesFrozenPower.pieceEquiv I a (tuple_mem 0 t 0) n + (tupleHomEquiv I a n 0 t + (CechHigher.augmentation (affineBlowup I).ringCatSheaf (opens I a) + (exceptionalPower I n) ⊤ (fun _ => le_top) u t))).val = + ReesFrozenChart.base I a (tupleSet t) r + +theorem section_chart_inclusion (n : ℕ) + (u : freeOpen (affineBlowup I).ringCatSheaf ⊤ ⟶ exceptionalPower I n) + (r : R) (hvalue : HasFrozenValues I a n u r) (t : Fin 1 → J) : + ExceptionalAffineChart.functionsOnOpenEquiv + (chartMap I a (tuple_nonempty 0 t)) + ((affineBlowup I).presheaf.map (homOfLE le_top).op + ((idealPowerInclusion (exceptionalLineBundle I) (exceptionalInclusion I) n).app ⊤ + (freeOpenSectionsEquiv ⊤ (exceptionalPower I n) u))) = + ReesFrozenChart.base I a (tupleSet t) r := by + have h := hvalue t + change (ReesFrozenPower.pieceEquiv I a (tuple_mem 0 t 0) n + (chartHomEquiv I a (tuple_nonempty 0 t) (tuple_mem 0 t 0) n + (ExceptionalRepresentedTypes.transportSections + (chartMap I a (tuple_nonempty 0 t)) (exceptionalLineBundle I) n + (tupleOpen_eq I a 0 t) + (CechHigher.augmentation (affineBlowup I).ringCatSheaf (opens I a) + (exceptionalPower I n) ⊤ (fun _ => le_top) + (u) t)))).val = _ at h + rw [chartHomEquiv_pieceEquiv] at h + erw [ExceptionalRepresentedTypes.representedSectionsTyped_apply, + ExceptionalAffineChart.representedSectionsEquiv_apply] at h + erw [transported_augmentation I a n u t] at h + erw [freeOpenEquiv_naturality] at h + have hn := CategoryTheory.congr_fun + ((idealPowerInclusion (exceptionalLineBundle I) (exceptionalInclusion I) n).mapPresheaf.naturality + (homOfLE (show (chartMap I a (tuple_nonempty 0 t)).opensRange ≤ ⊤ from le_top)).op) + (freeOpenSectionsEquiv ⊤ (exceptionalPower I n) u) + change (idealPowerInclusion (exceptionalLineBundle I) (exceptionalInclusion I) n).app _ + ((exceptionalPower I n).presheaf.map (homOfLE le_top).op + (freeOpenSectionsEquiv ⊤ (exceptionalPower I n) u)) = + (affineBlowup I).presheaf.map (homOfLE le_top).op + ((idealPowerInclusion (exceptionalLineBundle I) (exceptionalInclusion I) n).app ⊤ + (freeOpenSectionsEquiv ⊤ (exceptionalPower I n) u)) at hn + change ExceptionalAffineChart.functionsOnOpenEquiv _ + ((idealPowerInclusion (exceptionalLineBundle I) (exceptionalInclusion I) n).app _ + ((exceptionalPower I n).presheaf.map (homOfLE le_top).op + (freeOpenSectionsEquiv ⊤ (exceptionalPower I n) u))) = _ at h + rw [hn] at h + exact h + +theorem section_inclusion + (ha : Ideal.span (Set.range fun j => (a j).val) = I) (n : ℕ) + (u : freeOpen (affineBlowup I).ringCatSheaf ⊤ ⟶ exceptionalPower I n) + (r : R) (hvalue : HasFrozenValues I a n u r) : + (idealPowerInclusion (exceptionalLineBundle I) (exceptionalInclusion I) n).app ⊤ + (freeOpenSectionsEquiv ⊤ (exceptionalPower I n) u) = + (projection I).appTop ((Scheme.ΓSpecIso (CommRingCat.of R)).inv r) := by + apply (O (affineBlowup I)).isSheaf.section_ext + intro x hx + obtain ⟨j, hj⟩ := Opens.mem_iSup.mp ((iSup_opens I a ha).ge (Set.mem_univ x)) + let t : Fin 1 → J := fun _ => j + have heq : (chartMap I a (tuple_nonempty 0 t)).opensRange = opens I a j := by + change (ReesFrozenChart.chartOpen I a (tuple_nonempty 0 t)).1 = _ + rw [tupleOpen_eq] + simp only [CechHigher.intersection, t, iInf_const] + refine ⟨(chartMap I a (tuple_nonempty 0 t)).opensRange, le_top, + heq.ge hj, ?_⟩ + apply (ExceptionalAffineChart.functionsOnOpenEquiv + (chartMap I a (tuple_nonempty 0 t))).injective + exact (section_chart_inclusion I a n u r hvalue t).trans + (ExceptionalAffineChart.functionsOnOpenEquiv_pullback (projection I) + (chartMap I a (tuple_nonempty 0 t)) + (ReesFrozenChart.base I a (tupleSet t)) + (ReesFrozenChart.chart_projection I a (tuple_nonempty 0 t)) r).symm + +end +end PiExponent.ReesSectionInclusion + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesSheafCanonicalValue.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesSheafCanonicalValue.lean new file mode 100644 index 0000000000000000000000000000000000000000..c517d1d32251f13c5406cf187326283c071fe06d --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesSheafCanonicalValue.lean @@ -0,0 +1,52 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ReesSectionInclusion +import OAI.NumberTheory.PiExponent.Cohomology.ReesSheafCechRecovery + +namespace OAI + +namespace PiExponent.ReesSheafCechRecovery +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.ReesGrading PiExponentSeshadri.ModuleFlasque +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +open PiExponent.GeometrySupport PiExponent.ReesSheafCechBase +open PiExponent.GradedPolynomialLaurent PiExponent.GradedCech +attribute [local irreducible] affineBlowup projection exceptionalLineBundle exceptionalInclusion exceptionalIdeal + PiExponentSeshadri.Geometry.LineBundle.pow PiExponentSeshadri.Geometry.PresentsPullbackIdeal +variable {R J : Type} [CommRing R] [Fintype J] [DecidableEq J] +variable (I : Ideal R) (a : J → I) + +private abbrev chartMap {s : Finset J} (hs : s.Nonempty) : + Spec (CommRingCat.of (ReesFrozenChart.coordinateRing I a s)) ⟶ affineBlowup I := + ReesFrozenChart.chart I a hs + +private local instance chartOpenImmersion {s : Finset J} (hs : s.Nonempty) : + IsOpenImmersion (chartMap I a hs) := + ReesFrozenChart.instIsOpenImmersionChart I a hs + +theorem ordinaryGlobalSection_chart_inclusion + (ha : Ideal.span (Set.range fun j => (a j).val) = I) (n : ℕ) + (b : ↥(I^n : Ideal R)) (t : Fin 1 → J) : + ExceptionalAffineChart.functionsOnOpenEquiv + (chartMap I a (tuple_nonempty 0 t)) + ((affineBlowup I).presheaf.map (homOfLE le_top).op + ((idealPowerInclusion (exceptionalLineBundle I) (exceptionalInclusion I) n).app ⊤ + (ordinaryGlobalSection I a ha n b))) = + ReesFrozenChart.base I a (tupleSet t) b.val := + ReesSectionInclusion.section_chart_inclusion I a n + (ordinarySectionHom I a ha n b) b.val + (fun t => ordinarySectionHom_frozenChartValue I a ha n b t) t + +theorem ordinaryGlobalSection_inclusion + (ha : Ideal.span (Set.range fun j => (a j).val) = I) (n : ℕ) + (b : ↥(I^n : Ideal R)) : + (idealPowerInclusion (exceptionalLineBundle I) (exceptionalInclusion I) n).app ⊤ + (ordinaryGlobalSection I a ha n b) = + (projection I).appTop ((Scheme.ΓSpecIso (CommRingCat.of R)).inv b.val) := + ReesSectionInclusion.section_inclusion I a ha n + (ordinarySectionHom I a ha n b) b.val + (fun t => ordinarySectionHom_frozenChartValue I a ha n b t) + +end +end PiExponent.ReesSheafCechRecovery + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesUniversalUniqueness.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesUniversalUniqueness.lean new file mode 100644 index 0000000000000000000000000000000000000000..384818c1d0612ff8054db7f70c30769661d1c558 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ReesUniversalUniqueness.lean @@ -0,0 +1,230 @@ +import OAI.NumberTheory.PiExponent.Ampleness.BlowupSchemeExt +import OAI.NumberTheory.PiExponent.Ampleness.ReesExceptional + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.ReesGrading +open Polynomial HomogeneousLocalization +universe u v +variable {R : Type u} [CommRing R] (I : Ideal R) (a : I) +variable {B : Type v} [CommRing B] (f : R →+* B) + +lemma base_pow_mul_mk (n : ℕ) (p : reesAlgebra I) + (hp : p ∈ piece I (n • (1 : ℕ))) : + chartBase I a (a.val ^ n) * + HomogeneousLocalization.Away.mk (piece I) (generator_mem I a) n p hp = + chartBase I a (evaluation I p) := by + apply chartMap_injective I a + rw [map_mul, chartMap_base, chartMap_base, chartMap_mk] + exact IsLocalization.mk'_spec' (M := Submonoid.powers a.val) + (Localization.Away a.val) (evaluation I p) ⟨a.val ^ n, n, rfl⟩ + +end PiExponentSeshadri.ReesGrading + +namespace PiExponentSeshadri.ProjBase +open CategoryTheory AlgebraicGeometry TopologicalSpace +universe u +variable {σ : Type*} {A : Type u} [CommRing A] [SetLike σ A] [AddSubgroupClass σ A] +variable (𝒜 : ℕ → σ) [GradedRing 𝒜] + +lemma basicOpenToSpec_eq (f : A) : + Scheme.forgetToLocallyRingedSpace.map (Proj.basicOpenToSpec 𝒜 f) = + ProjectiveSpectrum.Proj.toSpec 𝒜 f := by + refine Eq.trans ?_ (ΓSpec.locallyRingedSpaceAdjunction.homEquiv_apply _ _ _).symm + dsimp [Proj.basicOpenToSpec, Scheme.Opens.toSpecΓ] + simp only [Category.assoc, ← Spec.map_comp] + rfl + +lemma basicOpenToSpec_mem (f : A) (x : Proj.basicOpen 𝒜 f) + (z : HomogeneousLocalization.NumDenSameDeg 𝒜 (.powers f)) : + HomogeneousLocalization.mk z ∈ ((Proj.basicOpenToSpec 𝒜 f) x).asIdeal ↔ + z.num.val ∈ x.val.asHomogeneousIdeal := by + have he := congr($(basicOpenToSpec_eq 𝒜 f).base x) + change (Proj.basicOpenToSpec 𝒜 f) x = (ProjectiveSpectrum.Proj.toSpec 𝒜 f).base x at he + rw [he] + exact ProjectiveSpectrum.Proj.mk_mem_toSpec_base_apply 𝒜 x z + +lemma toSpecZero_mem (x : Proj 𝒜) (a : 𝒜 0) : + a ∈ ((Proj.toSpecZero 𝒜) x).asIdeal ↔ a.val ∈ x.asHomogeneousIdeal := by + simp only [Proj.toSpecZero, Scheme.Hom.comp_apply, Spec.map_apply] + change HomogeneousLocalization.fromZeroRingHom 𝒜 (.powers (1 : A)) a ∈ + ((Proj.basicOpenToSpec 𝒜 1) _).asIdeal ↔ _ + rw [show HomogeneousLocalization.fromZeroRingHom 𝒜 (.powers (1 : A)) a = + HomogeneousLocalization.mk ⟨0, a, 1, one_mem _⟩ from rfl] + erw [basicOpenToSpec_mem] + change a.val ∈ ((Proj.basicOpen 𝒜 (1 : A)).ι + (((Proj 𝒜).isoOfEq (Proj.basicOpen_one 𝒜)).inv ((Proj 𝒜).topIso.inv x))).asHomogeneousIdeal ↔ _ + rw [← Scheme.Hom.comp_apply, Scheme.isoOfEq_inv_ι, ← Scheme.Hom.comp_apply] + rw [Scheme.toIso_inv_ι]; rfl + +lemma toSpecZero_preimage (a : 𝒜 0) : + Proj.toSpecZero 𝒜 ⁻¹ᵁ PrimeSpectrum.basicOpen a = Proj.basicOpen 𝒜 a.val := by + ext x + change a ∉ ((Proj.toSpecZero 𝒜) x).asIdeal ↔ a.val ∉ x.asHomogeneousIdeal + exact not_congr (toSpecZero_mem 𝒜 x a) + +end PiExponentSeshadri.ProjBase + +namespace PiExponentSeshadri.ReesGrading +open Polynomial CategoryTheory AlgebraicGeometry TopologicalSpace +universe u +variable {R : Type u} [CommRing R] (I : Ideal R) + +instance projection_separated : IsSeparated (projection I) := by + have hP : IsSeparated (Proj.toSpecZero (piece I)) := inferInstance + have hQ : IsSeparated (Spec.map (zeroIso I).hom) := inferInstance + exact MorphismProperty.comp_mem (@IsSeparated) _ _ hP hQ + +lemma projection_mem (x : affineBlowup I) (s : R) : + s ∈ ((projection I) x).asIdeal ↔ + algebraMap R (reesAlgebra I) s ∈ x.asHomogeneousIdeal := by + change zeroEquiv I s ∈ ((Proj.toSpecZero (piece I)) x).asIdeal ↔ _ + exact ProjBase.toSpecZero_mem (piece I) x (zeroEquiv I s) + +lemma projection_preimage (s : R) : + projection I ⁻¹ᵁ PrimeSpectrum.basicOpen s = + Proj.basicOpen (piece I) (algebraMap R (reesAlgebra I) s) := by + ext x + exact not_congr (projection_mem I x s) + +lemma base_generator_comm (a b : I) : + algebraMap R (reesAlgebra I) a.val * generator I b = + algebraMap R (reesAlgebra I) b.val * generator I a := by + apply Subtype.ext + change C a.val * monomial 1 b.val = C b.val * monomial 1 a.val + simp only [C_mul_monomial, mul_comm a.val b.val] + +lemma projection_preimage_le_chart (a : I) : + projection I ⁻¹ᵁ PrimeSpectrum.basicOpen a.val ≤ + Proj.basicOpen (piece I) (generator I a) := by + rw [projection_preimage] + intro x hx + obtain ⟨b, hb⟩ := Opens.mem_iSup.mp ((iSup_generator_basicOpen I).ge (Set.mem_univ x)) + have h : x ∈ Proj.basicOpen (piece I) + (algebraMap R (reesAlgebra I) a.val * generator I b) := by + rw [Proj.basicOpen_mul] + exact ⟨hx, hb⟩ + rw [base_generator_comm, Proj.basicOpen_mul] at h + exact h.2 + +lemma chartHom_ext {S : Type*} [CommRing S] (a : I) + (g h : chart I a →+* S) (he : g.comp (chartBase I a) = h.comp (chartBase I a)) + (hr : IsRegular (g (chartBase I a a.val))) : g = h := by + have hb (s : R) : g (chartBase I a s) = h (chartBase I a s) := RingHom.congr_fun he s + ext x + obtain ⟨n, p, hp, rfl⟩ := HomogeneousLocalization.Away.mk_surjective (piece I) + (generator_mem I a) x + apply (hr.pow n).left + have h₁ := congrArg g (base_pow_mul_mk I a n p hp) + have h₂ := congrArg h (base_pow_mul_mk I a n p hp) + simpa only [map_mul, map_pow, hb] using h₁.trans ((hb ((evaluation I) p)).trans h₂.symm) + +open SpecMaps + +lemma chart_scheme_ext {Y : Scheme.{u}} (a : I) + (g h : Y ⟶ Spec (CommRingCat.of (chart I a))) + (he : g ≫ Spec.map (CommRingCat.ofHom (chartBase I a)) = + h ≫ Spec.map (CommRingCat.ofHom (chartBase I a))) + (hr : IsRegular (coordinate g (chartBase I a a.val))) : g = h := by + apply coordinate_ext + apply CommRingCat.hom_ext + apply chartHom_ext I a _ _ _ hr + have hc := congrArg coordinate he + simp only [coordinate_comp_spec] at hc + exact congrArg CommRingCat.Hom.hom hc + +lemma ext_of_unit_generator {Y : Scheme.{u}} (a : I) + (g h : Y ⟶ affineBlowup I) (f : Y ⟶ Spec (CommRingCat.of R)) + (hg : g ≫ projection I = f) (hh : h ≫ projection I = f) + (hu : IsUnit (coordinate f a.val)) : g = h := by + let hOpen : IsOpenImmersion ((chartCover I).f a) := (chartCover I).map_prop a + have ht : f ⁻¹ᵁ PrimeSpectrum.basicOpen a.val = ⊤ := by + rw [preimage_basicOpen, Scheme.basicOpen_of_isUnit _ hu] + have hrange (k : Y ⟶ affineBlowup I) (hk : k ≫ projection I = f) : + Set.range k ⊆ Set.range ((chartCover I).f a) := by + rintro _ ⟨y, rfl⟩ + change k y ∈ ((chartCover I).f a).opensRange + change k y ∈ (Proj.awayι (piece I) (generator I a) (generator_mem I a) + (show 0 < (1 : ℕ) from Nat.zero_lt_one)).opensRange + rw [Proj.opensRange_awayι] + apply projection_preimage_le_chart I a + change (projection I) (k y) ∈ PrimeSpectrum.basicOpen a.val + rw [← Scheme.Hom.comp_apply, hk] + exact ht.ge (Set.mem_univ y) + let g' : Y ⟶ Spec (CommRingCat.of (chart I a)) := @IsOpenImmersion.lift _ _ _ ((chartCover I).f a) g hOpen (hrange g hg) + let h' : Y ⟶ Spec (CommRingCat.of (chart I a)) := @IsOpenImmersion.lift _ _ _ ((chartCover I).f a) h hOpen (hrange h hh) + have hg' : g' ≫ (chartCover I).f a = g := + @IsOpenImmersion.lift_fac _ _ _ ((chartCover I).f a) g hOpen (hrange g hg) + have hh' : h' ≫ (chartCover I).f a = h := + @IsOpenImmersion.lift_fac _ _ _ ((chartCover I).f a) h hOpen (hrange h hh) + have eg : g' ≫ Spec.map (CommRingCat.ofHom (chartBase I a)) = f := by + exact (congrArg (fun q : Spec (CommRingCat.of (chart I a)) ⟶ Spec (CommRingCat.of R) => + g' ≫ q) (chartCover_projection I a).symm).trans + ((Category.assoc _ _ _).symm.trans + ((congrArg (fun q : Y ⟶ affineBlowup I => q ≫ projection I) hg').trans hg)) + have eh : h' ≫ Spec.map (CommRingCat.ofHom (chartBase I a)) = f := by + exact (congrArg (fun q : Spec (CommRingCat.of (chart I a)) ⟶ Spec (CommRingCat.of R) => + h' ≫ q) (chartCover_projection I a).symm).trans + ((Category.assoc _ _ _).symm.trans + ((congrArg (fun q : Y ⟶ affineBlowup I => q ≫ projection I) hh').trans hh)) + have he : coordinate g' (chartBase I a a.val) = coordinate f a.val := by + have hc := congrArg coordinate eg + rw [coordinate_comp_spec] at hc + exact ConcreteCategory.congr_hom hc a.val + have hgh := chart_scheme_ext I a g' h' (eg.trans eh.symm) (by rw [he]; exact hu.isRegular) + rw [← hg', ← hh', hgh] + + +lemma ext_on_generator_open {Y : Scheme.{u}} (a : I) + (g h : Y ⟶ affineBlowup I) (f : Y ⟶ Spec (CommRingCat.of R)) + (hg : g ≫ projection I = f) (hh : h ≫ projection I = f) : + (f ⁻¹ᵁ PrimeSpectrum.basicOpen a.val).ι ≫ g = + (f ⁻¹ᵁ PrimeSpectrum.basicOpen a.val).ι ≫ h := by + let U : Y.Opens := f ⁻¹ᵁ PrimeSpectrum.basicOpen a.val + apply ext_of_unit_generator I a _ _ (U.ι ≫ f) + · rw [Category.assoc, hg] + · rw [Category.assoc, hh] + · apply isUnit_coordinate_of_preimage_top + erw [Scheme.Hom.comp_preimage] + exact U.ι_preimage_self + +lemma ext_of_unit_ideal {Y : Scheme.{u}} + (g h : Y ⟶ affineBlowup I) (f : Y ⟶ Spec (CommRingCat.of R)) + (hg : g ≫ projection I = f) (hh : h ≫ projection I = f) + (hI : I.map (coordinate f).hom = ⊤) : g = h := by + refine Scheme.hom_ext_of_forall g h ?_ + intro y + have ha : ∃ a : I, y ∈ f ⁻¹ᵁ PrimeSpectrum.basicOpen a.val := + ideal_unit_generator (R := CommRingCat.of R) I f hI y + obtain ⟨a, hay⟩ := ha + refine ⟨f ⁻¹ᵁ PrimeSpectrum.basicOpen a.val, hay, ?_⟩ + exact ext_on_generator_open I a g h f hg hh + +lemma principal_basicOpen_unit_ideal {Y : Scheme.{u}} (f : Y ⟶ Spec (CommRingCat.of R)) + (r : Γ(Y, ⊤)) (hI : I.map (coordinate f).hom = Ideal.span {r}) : + I.map (coordinate ((Y.basicOpen r).ι ≫ f)).hom = ⊤ := by + rw [coordinate_comp] + change I.map ((Y.basicOpen r).ι.appTop.hom.comp (coordinate f).hom) = ⊤ + rw [← Ideal.map_map, hI, Ideal.map_span, Set.image_singleton, Ideal.span_singleton_eq_top] + apply isUnit_of_basicOpen_eq_top + rw [← Scheme.preimage_basicOpen_top] + exact (Y.basicOpen r).ι_preimage_self + +lemma principal_unique {Y : Scheme.{u}} [IsAffine Y] + (g h : Y ⟶ affineBlowup I) (f : Y ⟶ Spec (CommRingCat.of R)) + (hg : g ≫ projection I = f) (hh : h ≫ projection I = f) + (r : Γ(Y, ⊤)) (hI : I.map (coordinate f).hom = Ideal.span {r}) (hr : IsRegular r) : + g = h := by + apply SchematicExt.ext_of_ker_eq_bot_of_isSeparated (projection I) (hg.trans hh.symm) + (Y.basicOpen r).ι (SchematicExt.basicOpen_ker_eq_bot r hr) + exact ext_of_unit_ideal I _ _ ((Y.basicOpen r).ι ≫ f) + (by rw [Category.assoc, hg]) (by rw [Category.assoc, hh]) + (principal_basicOpen_unit_ideal I f r hI) + +end PiExponentSeshadri.ReesGrading + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/RelativeAffineSectionAmple.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/RelativeAffineSectionAmple.lean new file mode 100644 index 0000000000000000000000000000000000000000..c1e0c269d226b0b2dab9182bbed3c16c02430fd3 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/RelativeAffineSectionAmple.lean @@ -0,0 +1,62 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleFromCover +import OAI.NumberTheory.PiExponent.Approximation.MixedSectionOpenExtension + +namespace OAI + + +namespace PiExponentSeshadri.Geometry +noncomputable section +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Frames PiExponentSeshadri.SectionOpens PiExponentSeshadri.Projective +variable {X : Scheme.{0}} + +theorem LineBundle.eventual_twist_affine_cover [IsIntegral X] [CompactSpace X] + (P J : LineBundle X) {κ : Type} (t : κ → (O X ⟶ P.sheaf)) + (ht : (⨆ i,isoOpen (t i)) = ⊤) + (hlocal : ∀ i, ∃ (α : Type) + (w : α → (O (isoOpen (t i)).toScheme ⟶ J.sheaf.restrict (isoOpen (t i)).ι)), + (⨆ a,isoOpen (w a)) = ⊤ ∧ ∀ a, IsAffineOpen (isoOpen (w a))) : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → ∃ (σ : Type) (_ : Fintype σ) + (s : σ → (O X ⟶ ((P.pow (n+1)).tensor J).sheaf)), + (⨆ a,isoOpen (s a)) = ⊤ ∧ + (∀ a, IsAffineOpen (isoOpen (s a))) ∧ + (∀ a, (isoOpen (s a) : Set X).Nonempty) := by + classical + choose α w hw hwa using hlocal + have hex (x : X) : ∃ i, x ∈ isoOpen (t i) := by + apply Opens.mem_iSup.mp + rw [ht]; trivial + choose i hi using hex + have hex' (x : X) : ∃ a, (⟨x,hi x⟩ : (isoOpen (t (i x))).toScheme) ∈ + isoOpen (w (i x) a) := by + apply Opens.mem_iSup.mp + erw [hw]; trivial + choose a ha using hex' + let V (x : X) : X.Opens := (isoOpen (t (i x))).ι ''ᵁ isoOpen (w (i x) (a x)) + have hxV (x : X) : x ∈ V x := ⟨⟨x,hi x⟩,ha x,rfl⟩ + obtain ⟨F,hF⟩ := isCompact_univ.elim_finite_subcover (fun x => (V x : Set X)) + (fun x => (V x).isOpen) (by intro x _; exact Set.mem_iUnion.mpr ⟨x,hxV x⟩) + choose N hN using fun x : F => P.mixed_section_open_extension J (t (i x.val)) + ⟨x.val,hi x.val⟩ (w (i x.val) (a x.val)) + refine ⟨Finset.univ.sup N, fun n hn => ?_⟩ + choose s hs using fun x : F => hN x n ((Finset.le_sup (Finset.mem_univ x)).trans hn) + refine ⟨F,inferInstance,s,?_,?_,?_⟩ + · apply top_unique + intro x _ + obtain ⟨y,hy⟩ := Set.mem_iUnion.mp (hF (show x ∈ Set.univ from trivial)) + obtain ⟨hyF,hxy⟩ := Set.mem_iUnion.mp hy + apply Opens.mem_iSup.mpr + refine ⟨⟨y,hyF⟩,?_⟩ + rw [show isoOpen (s ⟨y,hyF⟩) = V y from hs ⟨y,hyF⟩] + exact hxy + · intro x + rw [show isoOpen (s x) = V x.val from hs x] + exact (hwa (i x.val) (a x.val)).image_of_isOpenImmersion _ + · intro x + rw [show isoOpen (s x) = V x.val from hs x] + exact ⟨x.val,hxV x.val⟩ + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/WeightedAffineFrame.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/WeightedAffineFrame.lean new file mode 100644 index 0000000000000000000000000000000000000000..3353b436e80a0d66fa71be740566def0d7e62b1e --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/WeightedAffineFrame.lean @@ -0,0 +1,42 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AdmissibleBlowupGeometry + +namespace OAI + +namespace PiExponent.WeightedAffineFrame +noncomputable section +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry PiExponentSeshadri.Projective PiExponentSeshadri.Frames +open PiExponent.WeightedCompactification + +theorem frame_nonempty_of_isoOpen_eq {X : Scheme} (M : X.Modules) + (s : O X ⟶ M) (U : X.Opens) (h : PiExponentSeshadri.SectionOpens.isoOpen s = U) : + Nonempty (M.restrict U.ι ≅ O U.toScheme) := by + subst U + exact ⟨sectionFrame s⟩ + +variable {R ι σ : Type} [CommRing R] + +attribute [local irreducible] WeightedCompactification.lineBundle + WeightedCompactification.affineChartMap WeightedCompactification.coordinateSection + +theorem affineChart_isoOpen (a : σ → ι →₀ ℕ) (z : σ) (hz : a z = 0) + (coordinate : ι → σ) (hcoordinate : ∀ i, a (coordinate i) = Finsupp.single i 1) : + PiExponentSeshadri.SectionOpens.isoOpen (coordinateSection (R := R) a z) = + (affineChartMap (R := R) a z hz coordinate hcoordinate).opensRange := by + rw [coordinateSection_isoOpen] + apply TopologicalSpace.Opens.ext + exact (affineChartMap_range (R := R) a z hz coordinate hcoordinate).symm + +theorem affineFrame_nonempty (a : σ → ι →₀ ℕ) (z : σ) (hz : a z = 0) + (coordinate : ι → σ) (hcoordinate : ∀ i, a (coordinate i) = Finsupp.single i 1) : + Nonempty ((lineBundle (R := R) a).sheaf.restrict + (affineChartMap (R := R) a z hz coordinate hcoordinate).opensRange.ι ≅ + O (affineChartMap (R := R) a z hz coordinate hcoordinate).opensRange.toScheme) := + frame_nonempty_of_isoOpen_eq (lineBundle (R := R) a).sheaf (coordinateSection (R := R) a z) + (affineChartMap (R := R) a z hz coordinate hcoordinate).opensRange + (affineChart_isoOpen (R := R) a z hz coordinate hcoordinate) + +end +end PiExponent.WeightedAffineFrame + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/WeightedProjectiveAmple.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/WeightedProjectiveAmple.lean new file mode 100644 index 0000000000000000000000000000000000000000..50453bfb02d4f751652500b7d1c4a55b1964b410 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/WeightedProjectiveAmple.lean @@ -0,0 +1,25 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ClosedAmpleRestriction +import OAI.NumberTheory.PiExponent.Ampleness.ProjectiveO1Ample +import OAI.NumberTheory.PiExponent.Geometry.WeightedProjectiveEmbedding + +namespace OAI + +noncomputable section + +namespace PiExponent.WeightedCompactification + +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames + +variable {R ι σ : Type} [CommRing R] + +theorem lineBundle_ample [IsDomain R] [Finite σ] [Nonempty σ] (a : σ → ι →₀ ℕ) : + (lineBundle (R := R) a).IsAmple := + LineBundle.IsAmple.pullback_closedImmersion (ProjectiveO1.lineBundle (R := R) (σ := σ)) + ProjectiveO1.lineBundle_ample (projectiveMonomialMap a) + +end PiExponent.WeightedCompactification + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Ampleness/ZeroDimensionalAmple.lean b/lean/OAI/NumberTheory/PiExponent/Ampleness/ZeroDimensionalAmple.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d3ccb4423043097a16bd37f4dac9b74b4b8dc48 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Ampleness/ZeroDimensionalAmple.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.PiExponent.Approximation.FrameTensorPowers +import OAI.NumberTheory.PiExponent.Approximation.SectionOpens +import OAI.NumberTheory.PiExponent.Cohomology.FiniteLineEuler + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +variable {X : Scheme.{0}} + +theorem isAmple_of_global_frame_affine [IsAffine X] (L : LineBundle X) + (e : L.sheaf ≅ structureSheaf X) : L.IsAmple := by + intro x V hx + obtain ⟨r,hr,hxr⟩ := (isAffineOpen_top X).exists_basicOpen_le ⟨x,hx⟩ (by trivial) + let E := globalPowerFrame e 1 + let s : GlobalSections X (L.pow 1).sheaf := scalarEnd r ≫ E.inv + have he : coefficient E s = r := by + have hcomp : (scalarEnd r ≫ E.inv) ≫ E.hom = scalarEnd r := by + exact (Category.assoc (scalarEnd r) E.inv E.hom).trans + ((congrArg (fun g : structureSheaf X ⟶ structureSheaf X => scalarEnd r ≫ g) + E.inv_hom_id).trans (Category.comp_id (scalarEnd r))) + exact (congrArg (fun f : structureSheaf X ⟶ structureSheaf X => endValue f) + hcomp).trans (endValue_scalarEnd r) + have hopen : sectionOpen X s = X.basicOpen r := by + change PiExponentSeshadri.SectionOpens.isoOpen s = _ + exact (isoOpen_eq_basicOpen E s).trans (congrArg X.basicOpen he) + exact ⟨1,by decide,s,hopen.symm ▸ hxr,hopen.le.trans hr,hopen.symm ▸ (isAffineOpen_top X).basicOpen r⟩ + +theorem isAmple_of_proper_dimension_zero [IsLocallyNoetherian X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (hdim : topologicalKrullDim X ≤ 0) (L : LineBundle X) : L.IsAmple := by + let : IsLocallyArtinian X := IsLocallyArtinian.of_topologicalKrullDim_le_zero hdim + let : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace p + let : Finite X := finite_of_compact_of_discrete + let : IsAffine X := proper_finite_scheme_isAffine p + obtain ⟨e⟩ := PiExponentSeshadri.FiniteSupport.lineBundle_trivial L + exact isAmple_of_global_frame_affine L e + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/AlgebraicLogarithmicObstruction.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/AlgebraicLogarithmicObstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc9a16561061703bb2841428bd90897be26c314b --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/AlgebraicLogarithmicObstruction.lean @@ -0,0 +1,130 @@ +import Mathlib.FieldTheory.AlgebraicClosure +import Mathlib.RingTheory.Etale.Field +import Mathlib.RingTheory.Etale.Kaehler +import OAI.NumberTheory.PiExponent.Analysis.LogarithmicObstruction +import OAI.NumberTheory.PiExponent.LocalAlgebra.TranscendenceBasisReduction + +namespace OAI + +noncomputable section + +namespace PiExponent + +open KaehlerDifferential +open scoped TensorProduct Polynomial nonZeroDivisors IntermediateField + +def extendDerivation + {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] + [Algebra R S] [Algebra R T] [Algebra S T] [IsScalarTower R S T] + [Algebra.FormallyEtale S T] + (d : Derivation R S S) : Derivation R T T := + ((LinearMap.liftBaseChange T ((Algebra.linearMap S T).comp d.liftKaehlerDifferential)).comp + (tensorKaehlerEquivOfFormallyEtale R S T).symm.toLinearMap).compDer (D R T) + +theorem extendDerivation_algebraMap + {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] + [Algebra R S] [Algebra R T] [Algebra S T] [IsScalarTower R S T] + [Algebra.FormallyEtale S T] + (d : Derivation R S S) (s : S) : + extendDerivation (T := T) d (algebraMap S T s) = algebraMap S T (d s) := by + simp [extendDerivation, LinearMap.compDer, + tensorKaehlerEquivOfFormallyEtale_symm_D_algebraMap, + Derivation.liftKaehlerDifferential_comp_D] + +def ratFuncDerivative {K : Type*} [Field K] : Derivation K (RatFunc K) (RatFunc K) := by + letI : Algebra.FormallyEtale K[X] (RatFunc K) := + Algebra.FormallyEtale.of_isLocalization (K[X]⁰) + exact extendDerivation Polynomial.derivative' + +@[simp] +theorem ratFuncDerivative_X {K : Type*} [Field K] : + ratFuncDerivative (RatFunc.X : RatFunc K) = 1 := by + let : Algebra.FormallyEtale K[X] (RatFunc K) := + Algebra.FormallyEtale.of_isLocalization (K[X]⁰) + change extendDerivation Polynomial.derivative' (RatFunc.X : RatFunc K) = 1 + rw [← RatFunc.algebraMap_X, extendDerivation_algebraMap] + simp [Polynomial.derivative'] + +theorem finite_extension_no_logarithmic_differential + {K E : Type*} [Field K] [CharZero K] [Field E] + [Algebra K E] [Algebra (RatFunc K) E] [IsScalarTower K (RatFunc K) E] + [FiniteDimensional (RatFunc K) E] (x : E) : + D K E x ≠ (algebraMap (RatFunc K) E RatFunc.X)⁻¹ • + D K E (algebraMap (RatFunc K) E RatFunc.X) := by + let : Algebra.FormallyEtale (RatFunc K) E := + Algebra.FormallyEtale.of_isSeparable (RatFunc K) E + let delta : Derivation K E E := extendDerivation ratFuncDerivative + have hcompat (a : RatFunc K) : + delta (algebraMap (RatFunc K) E a) = + algebraMap (RatFunc K) E (ratFuncDerivative a) := + extendDerivation_algebraMap ratFuncDerivative a + intro heq + have hd := congrArg delta.liftKaehlerDifferential heq + simp only [Derivation.liftKaehlerDifferential_comp_D, map_smul, hcompat, + ratFuncDerivative_X, map_one, smul_eq_mul, mul_one] at hd + apply finite_extension_derivation_ne_simple_pole ratFuncDerivative delta + ratFuncDerivative_X hcompat x (c := (1 : K)) one_ne_zero + simpa only [map_div₀, map_one, one_div, map_inv₀] using hd + +theorem adjoin_finite_no_logarithmic_differential + {K E : Type*} [Field K] [CharZero K] [Field E] [Algebra K E] + (y : E) (hy : Transcendental K y) [FiniteDimensional K⟮y⟯ E] (x : E) : + D K E x ≠ y⁻¹ • D K E y := by + let F := K⟮y⟯ + let e : RatFunc K ≃ₐ[K] F := RatFunc.algEquivOfTranscendental y hy + let : Algebra (RatFunc K) F := e.toRingHom.toAlgebra + let : Algebra (RatFunc K) E := + ((algebraMap F E).comp e.toRingHom).toAlgebra + let : IsScalarTower (RatFunc K) F E := IsScalarTower.of_algebraMap_eq' rfl + let : IsScalarTower K (RatFunc K) E := IsScalarTower.of_algebraMap_eq fun a => by + change algebraMap K E a = algebraMap F E (e (algebraMap K (RatFunc K) a)) + rw [e.commutes] + exact IsScalarTower.algebraMap_apply K F E a + have : Module.Finite (RatFunc K) F := + Module.Finite.of_surjective (Algebra.linearMap (RatFunc K) F) e.surjective + have : Module.Finite (RatFunc K) E := Module.Finite.trans F E + have hX : algebraMap (RatFunc K) E RatFunc.X = y := by + change ((RatFunc.algEquivOfTranscendental y hy) RatFunc.X : E) = y + exact RatFunc.algEquivOfTranscendental_X y hy + simpa only [hX] using finite_extension_no_logarithmic_differential (K := K) x + +theorem logarithmic_differential_base_change + {C K E : Type*} [Field C] [Field K] [Field E] + [Algebra C K] [Algebra C E] [Algebra K E] [IsScalarTower C K E] + {x y : E} (h : D C E x = y⁻¹ • D C E y) : + D K E x = y⁻¹ • D K E y := by + have hm := congrArg (KaehlerDifferential.map C K E E) h + simpa only [map_D, map_smul, Algebra.algebraMap_self, RingHom.id_apply] using hm + +theorem no_logarithmic_differential_over_intermediateField + {C E : Type*} [Field C] [CharZero C] [Field E] [Algebra C E] + (K : IntermediateField C E) (y : E) (hy : Transcendental K y) + [FiniteDimensional K⟮y⟯ E] (x : E) : + D C E x ≠ y⁻¹ • D C E y := by + intro h + exact adjoin_finite_no_logarithmic_differential y hy x + (logarithmic_differential_base_change (K := K) h) + +theorem isAlgebraic_of_logarithmic_differential + {C E : Type*} [Field C] [CharZero C] [Field E] [Algebra C E] + [Algebra.EssFiniteType C E] (x y : E) + (h : D C E x = y⁻¹ • D C E y) : IsAlgebraic C y := by + by_contra hy + obtain ⟨K, hKy, hfinite⟩ := exists_intermediateField_finite_over_simple C E hy + have : FiniteDimensional K⟮y⟯ E := hfinite + exact no_logarithmic_differential_over_intermediateField K y hKy x h + +theorem constant_of_logarithmic_differential + {C E : Type*} [Field C] [CharZero C] [IsAlgClosed C] [Field E] [Algebra C E] + [Algebra.EssFiniteType C E] (x y : E) + (h : D C E x = y⁻¹ • D C E y) : ∃ c : C, algebraMap C E c = y := by + have hy := isAlgebraic_of_logarithmic_differential x y h + have hmem : y ∈ algebraicClosure C E := mem_algebraicClosure_iff.mpr hy + rw [IntermediateField.eq_bot_of_isAlgClosed_of_isAlgebraic (algebraicClosure C E)] at hmem + exact IntermediateField.mem_bot.mp hmem + +end PiExponent + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticAggregate.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticAggregate.lean new file mode 100644 index 0000000000000000000000000000000000000000..da5cb6a81800343e91e10e3fcc15a46a64ecac66 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticAggregate.lean @@ -0,0 +1,105 @@ +import OAI.NumberTheory.PiExponent.Analysis.LiteralAnalyticSummand +import OAI.NumberTheory.PiExponent.Analysis.TranslationCountLimit + +namespace OAI + +open scoped BigOperators Topology +open Filter + +namespace PiExponent.LiteralAnalytic +open DeterminantContradiction + +theorem actual_minor_expansion {nu : ℝ} (d : FixedData nu) {H : ℝ} + (selection : Row d H → Column d H) : + (actualMinor d H selection).det = + ∑ f : ChoiceFamily d H, (∏ r, choiceScalar d r (f r)) * (choiceMatrix d selection f).det := by + classical + have hp : ∀ r c : Row d H, + (MatrixTranslation.periodMonomial r.1.val logarithmicPeriod + ((selection c).1 0) (fun i => (selection c).1 i.succ)).support ⊆ + MatrixTranslation.transverseIndices (fixedWeights d) H := by + intro r c + apply MatrixTranslation.periodMonomial_support_subset _ _ _ _ _ _ (fixedWeights_pos d) + have hc := InterpolationMatrix.column_weight_le d.w0_pos (fixedWeights_pos d) (selection c) + have hz : 0 ≤ (d.w0 : ℝ) * ((selection c).1 0 : ℝ) := + mul_nonneg d.w0_pos.le (Nat.cast_nonneg _) + linarith + have he := MatrixTranslation.det_matrix_translation + (MatrixArithmetic.rationalCenters (finiteNumerators d) (finiteDenominators d)) + (MatrixArithmetic.truncationOrders (finiteDenominators d) d.F0 d.v0) + (fun r : Row d H => r.1.val) (fun r => r.2.1 0) logarithmicPeriod + (fun r i => r.2.1 i.succ) (fun c => (selection c).1 0) + (fun c i => (selection c).1 i.succ) (MatrixTranslation.transverseIndices (fixedWeights d) H) hp + convert! he using 1 + +theorem card_choiceFamily_le {nu : ℝ} (d : FixedData nu) (H : ℝ) : + Fintype.card (ChoiceFamily d H) ≤ translationTermCount d.m d.v0 H ^ actualRowCount d H := by + classical + rw [Fintype.card_pi] + calc + _ ≤ ∏ _r : Row d H, translationTermCount d.m d.v0 H := by + apply Finset.prod_le_prod + intro r _ + exact MatrixTranslation.row_term_count (fixedWeights d) H d.v0 + (fun i => by change 1 ≤ MatrixArithmetic.logWeights (finiteDenominators d) i + rw [logWeights_eq]; exact d.x_one_le _) + (beta d r) (r.2.1 0) (rowOrder_le d r) + _ = _ := by simp only [Finset.prod_const, Finset.card_univ, actualRowCount] + +noncomputable def analyticRemainder {nu : ℝ} (d : FixedData nu) (H : ℝ) : ℝ := + Collision.collisionRemainder (actualRowCount d H) H + + Real.log (translationTermCount d.m d.v0 H : ℝ) / H + +theorem actual_minor_analytic_bound {nu : ℝ} (d : FixedData nu) (hnu : 0 ≤ nu) + {H : ℝ} (hH : 0 < H) (selection : Row d H → Column d H) + (hne : (actualMinor d H selection).det ≠ 0) : + Real.log ‖(actualMinor d H selection).det‖ / ((actualRowCount d H : ℝ) * H) ≤ + d.analyticError + analyticRemainder d H + + max (-collisionRate d H) + (-nu * ((d.base.A : ℝ) * (1 - d.base.eta) - actualMean d H)) := by + have hQ : (0 : ℝ) < translationTermCount d.m d.v0 H := by + unfold translationTermCount + positivity + have hc : (Fintype.card (ChoiceFamily d H) : ℝ) ≤ + (translationTermCount d.m d.v0 H : ℝ) ^ actualRowCount d H := by + exact_mod_cast card_choiceFamily_le d H + have hb := DeterminantAnalyticBound.log_norm_sum_le + (fun f : ChoiceFamily d H => (∏ r, choiceScalar d r (f r)) * (choiceMatrix d selection f).det) + (actualMinor d H selection).det (actualRowCount_pos d hH) hH hQ hc + (actual_minor_expansion d selection) hne (norm_actual_summand_le d hnu hH selection) + convert! hb using 1 + unfold analyticRemainder + ring + +theorem tendsto_analyticRemainder {nu : ℝ} (d : FixedData nu) : + Tendsto (analyticRemainder d) atTop (𝓝 0) := by + have hv : 0 < d.v0 := by exact_mod_cast d.v0_pos + have ht : 0 < d.base.theta := by exact_mod_cast d.base.theta_pos + have hcount := MatrixCounting.tendsto_rowCount_normalized d.K d.v0 d.base.theta + (finiteDenominators d) hv ht (finiteDenominators_two_le d) + have hlead : 0 < (d.K : ℝ) * (d.base.theta : ℝ) ^ d.m / + (((d.m + 1).factorial : ℝ) * (d.v0 : ℝ) * + ∏ i, MatrixArithmetic.logWeights (finiteDenominators d) i) := by + apply div_pos + · apply mul_pos + · exact_mod_cast lt_of_lt_of_le Nat.zero_lt_one d.K_pos + · exact pow_pos d.base.theta_pos _ + · apply mul_pos + · exact mul_pos (by positivity) d.v0_pos + · exact Finset.prod_pos (fun i _ => fixedWeights_pos d i) + have hr := tendsto_collisionRemainder_of_normalized_pow + (M := actualRowCount d) hcount hlead + have hq := tendsto_log_translationTermCount_div d.m d.v0_pos + convert! hr.add hq using 1 + norm_num + +theorem analyticAggregate : AnalyticAggregateStatement := by + intro nu hnu d + refine ⟨analyticRemainder d, tendsto_analyticRemainder d, ?_⟩ + filter_upwards [eventually_gt_atTop (0 : ℝ)] with H hH + intro selection hne + exact actual_minor_analytic_bound d (by linarith) hH selection hne + +end PiExponent.LiteralAnalytic + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticCollision.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticCollision.lean new file mode 100644 index 0000000000000000000000000000000000000000..aca00ab38d773049625a7a92205540239377072e --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticCollision.lean @@ -0,0 +1,172 @@ +import Mathlib + +namespace OAI + +open scoped BigOperators +open Complex Finset + +namespace PiExponent.AnalyticCollision + +noncomputable def exponentialMonomial (b h : ℂ) (d : ℕ) (z : ℂ) : ℂ := + b * Complex.exp (h * z) * z ^ d + +theorem differentiable_exponentialMonomial (b h : ℂ) (d : ℕ) : + Differentiable ℂ (exponentialMonomial b h d) := by + exact ((Complex.differentiable_exp.comp (differentiable_id.const_mul h)).const_mul b).mul + (differentiable_id.pow d) + +theorem norm_exponentialMonomial_le (b h : ℂ) (d : ℕ) {z : ℂ} {R : ℝ} + (hR : 0 ≤ R) (hz : ‖z‖ ≤ R) : + ‖exponentialMonomial b h d z‖ ≤ ‖b‖ * Real.exp (‖h‖ * R) * R ^ d := by + unfold exponentialMonomial + simp only [norm_mul, norm_pow] + apply mul_le_mul_of_nonneg + · apply mul_le_mul_of_nonneg_left _ (norm_nonneg b) + exact (Complex.norm_exp_le_exp_norm _).trans + (Real.exp_le_exp.mpr (by simpa only [norm_mul] using mul_le_mul_of_nonneg_left hz (norm_nonneg h))) + · exact pow_le_pow_left₀ (norm_nonneg z) hz d + · positivity + · exact pow_nonneg hR d + +noncomputable def normalizedTaylorCoeff (f : ℂ → ℂ) (R : ℝ) (d : ℕ) : ℂ := + cauchyPowerSeries f 0 R d (fun _ => (R : ℂ)) + +theorem norm_normalizedTaylorCoeff_le {f : ℂ → ℂ} {R D : ℝ} (hR : 0 < R) + (hD : ∀ z ∈ Metric.sphere (0 : ℂ) R, ‖f z‖ ≤ D) (d : ℕ) : + ‖normalizedTaylorCoeff f R d‖ ≤ D := by + unfold normalizedTaylorCoeff + rw [cauchyPowerSeries_apply] + calc + _ ≤ R * (R⁻¹ * D) := by + apply circleIntegral.norm_two_pi_i_inv_smul_integral_le_of_norm_le_const hR.le + intro z hz + have hzR : ‖z‖ = R := by simpa only [Metric.mem_sphere, dist_zero_right] using hz + simp only [sub_zero, norm_smul, norm_pow, norm_div, Complex.norm_real, + Real.norm_eq_abs, abs_of_pos hR, norm_inv, hzR, div_self (ne_of_gt hR), + one_pow, one_mul] + exact mul_le_mul_of_nonneg_left (hD z hz) (inv_nonneg.mpr hR.le) + _ = D := by field_simp + +theorem hasSum_normalizedTaylorCoeff {f : ℂ → ℂ} (hf : Differentiable ℂ f) + {R : NNReal} (hR : 0 < R) (z : ℂ) : + HasSum (fun d => normalizedTaylorCoeff f R d * (z / (R : ℂ)) ^ d) (f z) := by + convert! (hf.hasFPowerSeriesOnBall 0 hR).hasSum (y := z) (by simp) using 1 + · funext d + simp only [normalizedTaylorCoeff, cauchyPowerSeries, + ContinuousMultilinearMap.mkPiRing_apply, Fin.prod_const, smul_eq_mul] + have hr : (R : ℂ) ≠ 0 := by exact_mod_cast ne_of_gt hR + rw [div_pow] + field_simp + · simp + +theorem coefficient_det_eq_zero_of_collision {ι κ : Type*} [Fintype ι] [DecidableEq ι] + (coefficient : κ → ℕ → ι → ℂ) (group : ι → κ) (degree : ι → ℕ) + {i j : ι} (hij : i ≠ j) (hg : group i = group j) (hd : degree i = degree j) : + Matrix.det (fun r c => coefficient (group r) (degree r) c) = 0 := by + apply Matrix.det_zero_of_row_eq hij + simp only [hg, hd] + +theorem norm_det_le_factorial_mul_pow {ι : Type*} [Fintype ι] [DecidableEq ι] + (A : Matrix ι ι ℂ) {D : ℝ} (hD : 0 ≤ D) (hA : ∀ i j, ‖A i j‖ ≤ D) : + ‖A.det‖ ≤ (Fintype.card ι).factorial * D ^ Fintype.card ι := by + rw [Matrix.det_apply] + calc + _ ≤ ∑ σ : Equiv.Perm ι, ‖σ.sign • ∏ i, A (σ i) i‖ := norm_sum_le _ _ + _ = ∑ σ : Equiv.Perm ι, ∏ i, ‖A (σ i) i‖ := by + apply Finset.sum_congr rfl + intro σ _ + rcases Int.units_eq_one_or σ.sign with hs | hs <;> simp [hs, norm_prod] + _ ≤ ∑ _σ : Equiv.Perm ι, D ^ Fintype.card ι := by + apply Finset.sum_le_sum + intro σ _ + calc + _ ≤ ∏ _index : ι, |D| := Finset.prod_le_prod₀ + (fun index _ => norm_nonneg _) (fun index _ => (hA (σ index) index).trans (le_abs_self D)) + _ = D ^ Fintype.card ι := by simp [abs_of_nonneg hD] + _ = _ := by simp [Fintype.card_perm] + +noncomputable def rowTest (ell : ℕ) (f : ℂ → ℂ) : ℂ := + cauchyPowerSeries f 0 (1 / 2) ell (fun _ => 1) + +theorem norm_rowTest_le {f : ℂ → ℂ} {D : ℝ} + (hD : ∀ t ∈ Metric.sphere (0 : ℂ) (1 / 2), ‖f t‖ ≤ D) (ell : ℕ) : + ‖rowTest ell f‖ ≤ (2 : ℝ) ^ ell * D := by + unfold rowTest + rw [cauchyPowerSeries_apply] + calc + _ ≤ (1 / 2 : ℝ) * (2 ^ ell * (2 * D)) := by + apply circleIntegral.norm_two_pi_i_inv_smul_integral_le_of_norm_le_const (by norm_num) + intro z hz + have hzR : ‖z‖ = (1 / 2 : ℝ) := by + simpa only [Metric.mem_sphere, dist_zero_right] using hz + simp only [sub_zero, norm_smul, norm_pow, norm_div, norm_one, norm_inv, hzR] + norm_num only [one_div, inv_div, div_one] + exact mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (hD z hz) (by norm_num)) + (by positivity) + _ = _ := by ring + +theorem norm_shifted_log_div_le_half {center t : ℂ} {R : ℝ} (hR : 0 < R) + (hc : ‖center‖ + 3 / 4 ≤ R / 2) (ht : ‖t‖ ≤ 1 / 2) : + ‖(center + Complex.log (1 + t)) / (R : ℂ)‖ ≤ 1 / 2 := by + rw [norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hR] + apply (div_le_iff₀ hR).mpr + have hlog := Complex.norm_log_one_add_half_le_self ht + have htri := norm_add_le center (Complex.log (1 + t)) + nlinarith + +theorem norm_rowTest_shifted_power_le {center : ℂ} {R : ℝ} (hR : 0 < R) + (hc : ‖center‖ + 3 / 4 ≤ R / 2) (ell d : ℕ) : + ‖rowTest ell (fun t => ((center + Complex.log (1 + t)) / (R : ℂ)) ^ d)‖ ≤ + (2 : ℝ) ^ ell * (1 / 2 : ℝ) ^ d := by + apply norm_rowTest_le + intro t ht + rw [norm_pow] + apply pow_le_pow_left₀ (norm_nonneg _) (norm_shifted_log_div_le_half hR hc _) + simpa only [Metric.mem_sphere, dist_zero_right] using ht.le + +theorem period_center_radius_bound {K j : ℕ} (hK : 0 < K) (hj : j < K) : + ‖(j : ℂ) * (2 * (Real.pi : ℂ) * Complex.I)‖ + 3 / 4 ≤ (100 * (K : ℝ)) / 2 := by + have hK1 : (1 : ℝ) ≤ K := by exact_mod_cast hK + have hjK : (j : ℝ) ≤ K := by exact_mod_cast hj.le + have hnorm : ‖(j : ℂ) * (2 * (Real.pi : ℂ) * Complex.I)‖ = + (j : ℝ) * (2 * Real.pi) := by + simp [Complex.norm_real, Real.norm_eq_abs, abs_of_pos Real.pi_pos] + rw [hnorm] + have hpi : 2 * Real.pi ≤ (8 : ℝ) := by linarith [Real.pi_lt_four] + have hprod : (j : ℝ) * (2 * Real.pi) ≤ (K : ℝ) * 8 := + mul_le_mul hjK hpi (by positivity) (by positivity) + linarith + +theorem norm_exponentialMonomial_le_exp_budget (b h : ℂ) (d A : ℕ) + {z : ℂ} {R H w0 wstar : ℝ} (hR : 1 ≤ R) (hH : 0 ≤ H) + (hw0 : 0 < w0) (hws : 0 < wstar) (hz : ‖z‖ ≤ R) + (hb : ‖b‖ ≤ (2 : ℝ) ^ A) (hh : ‖h‖ ≤ H / w0) + (hd : d ≤ A) (hA : (A : ℝ) ≤ H / wstar) : + ‖exponentialMonomial b h d z‖ ≤ + Real.exp (H * (R / w0 + Real.log (2 * R) / wstar)) := by + have hR0 : 0 ≤ R := le_trans zero_le_one hR + have h2R : 0 < 2 * R := by positivity + have hlog : 0 ≤ Real.log (2 * R) := Real.log_nonneg (by linarith) + calc + _ ≤ ‖b‖ * Real.exp (‖h‖ * R) * R ^ d := norm_exponentialMonomial_le b h d hR0 hz + _ ≤ (2 : ℝ) ^ A * Real.exp ((H / w0) * R) * R ^ A := by + apply mul_le_mul + · exact mul_le_mul hb (Real.exp_le_exp.mpr + (mul_le_mul hh le_rfl hR0 (div_nonneg hH hw0.le))) + (Real.exp_pos _).le (by positivity) + · exact pow_le_pow_right₀ hR hd + · positivity + · positivity + _ = Real.exp ((H / w0) * R + (A : ℝ) * Real.log (2 * R)) := by + rw [Real.exp_add, Real.exp_nat_mul, Real.exp_log h2R, mul_pow] + ring + _ ≤ _ := by + apply Real.exp_le_exp.mpr + have ha := mul_le_mul hA (le_refl _) hlog (div_nonneg hH hws.le) + calc + _ ≤ (H / w0) * R + (H / wstar) * Real.log (2 * R) := add_le_add le_rfl ha + _ = _ := by ring + +end PiExponent.AnalyticCollision + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticDeterminantCollision.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticDeterminantCollision.lean new file mode 100644 index 0000000000000000000000000000000000000000..f290efbf84251e06dc6c62cdc202c1cf70aa4b8e --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticDeterminantCollision.lean @@ -0,0 +1,82 @@ +import OAI.NumberTheory.PiExponent.Analysis.AnalyticRowSeries +import OAI.NumberTheory.PiExponent.Analysis.CollisionExponential +import OAI.NumberTheory.PiExponent.Analysis.CollisionLimit + +namespace OAI + +open scoped BigOperators + +namespace PiExponent.AnalyticCollision + +theorem translated_row_determinant_bound + {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) (f : κ → ι → ℂ → ℂ) + (center : ι → ℂ) (ell : ι → ℕ) + (R : NNReal) (hR : 0 < R) (D s : ℝ) (hD : 0 ≤ D) + (hs0 : 0 ≤ s) (hs1 : s < 1) (hss : s * s = 1 / 2) + (hf : ∀ a j, Differentiable ℂ (f a j)) + (hfD : ∀ a j z, z ∈ Metric.sphere (0 : ℂ) (R : ℝ) → ‖f a j z‖ ≤ D) + (hc : ∀ i, ‖center i‖ + 3 / 4 ≤ (R : ℝ) / 2) : + ‖Matrix.det (fun i j => rowTest (ell i) + (fun t => f (group i) j (center i + Complex.log (1 + t))))‖ ≤ + ((Fintype.card ι).factorial * D ^ Fintype.card ι * (∏ i, (2 : ℝ) ^ ell i)) * + s ^ (∑ a, (Collision.multiplicity Finset.univ group a).choose 2) * + ((1 - s)⁻¹) ^ Fintype.card ι := by + let B : ι → ℕ → ℂ := fun i d => rowTest (ell i) + (fun t => ((center i + Complex.log (1 + t)) / (R : ℂ)) ^ d) + let C : κ → ℕ → ι → ℂ := fun a d j => normalizedTaylorCoeff (f a j) R d + apply Collision.infinite_collision_bound group B C D s (fun i => (2 : ℝ) ^ ell i) + hD hs0 hs1 (fun _ => by positivity) + · intro a d j + exact norm_normalizedTaylorCoeff_le (by exact_mod_cast hR) (hfD a j) d + · intro i d + dsimp [B] + rw [hss] + exact norm_rowTest_shifted_power_le (by exact_mod_cast hR) (hc i) (ell i) d + · intro i j + exact hasSum_translated_row (hf (group i) j) hR hD (hfD (group i) j) (hc i) (ell i) + +theorem translated_row_determinant_bound_sum_order + {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) (f : κ → ι → ℂ → ℂ) + (center : ι → ℂ) (ell : ι → ℕ) + (R : NNReal) (hR : 0 < R) (D s : ℝ) (hD : 0 ≤ D) + (hs0 : 0 ≤ s) (hs1 : s < 1) (hss : s * s = 1 / 2) + (hf : ∀ a j, Differentiable ℂ (f a j)) + (hfD : ∀ a j z, z ∈ Metric.sphere (0 : ℂ) (R : ℝ) → ‖f a j z‖ ≤ D) + (hc : ∀ i, ‖center i‖ + 3 / 4 ≤ (R : ℝ) / 2) : + ‖Matrix.det (fun i j => rowTest (ell i) + (fun t => f (group i) j (center i + Complex.log (1 + t))))‖ ≤ + ((Fintype.card ι).factorial * D ^ Fintype.card ι * (2 : ℝ) ^ (∑ i, ell i)) * + s ^ (∑ a, (Collision.multiplicity Finset.univ group a).choose 2) * + ((1 - s)⁻¹) ^ Fintype.card ι := by + simpa only [Finset.prod_pow_eq_pow_sum] using + translated_row_determinant_bound group f center ell R hR D s hD hs0 hs1 hss hf hfD hc + +theorem translated_row_determinant_exp_bound + {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) (f : κ → ι → ℂ → ℂ) + (center : ι → ℂ) (ell : ι → ℕ) + (R : NNReal) (hR : 0 < R) {H A v : ℝ} (hH : 0 < H) + (hf : ∀ a j, Differentiable ℂ (f a j)) + (hfD : ∀ a j z, z ∈ Metric.sphere (0 : ℂ) (R : ℝ) → + ‖f a j z‖ ≤ Real.exp (H * A)) + (hc : ∀ i, ‖center i‖ + 3 / 4 ≤ (R : ℝ) / 2) + (hell : ((∑ i, ell i : ℕ) : ℝ) ≤ (Fintype.card ι : ℝ) * H / v) : + ‖Matrix.det (fun i j => rowTest (ell i) + (fun t => f (group i) j (center i + Complex.log (1 + t))))‖ ≤ + Real.exp (-(Real.log 2 / 4) * + (∑ a, (Collision.multiplicity Finset.univ group a : ℝ) ^ 2) + + (Fintype.card ι : ℝ) * H * + (A + Real.log 2 / v + Collision.collisionRemainder (Fintype.card ι) H)) := by + have hfinite := translated_row_determinant_bound_sum_order group f center ell R hR + (Real.exp (H * A)) Collision.collisionRatio (Real.exp_pos _).le + Collision.collisionRatio_pos.le Collision.collisionRatio_lt_one + Collision.collisionRatio_mul_self hf hfD hc + exact hfinite.trans (Collision.collision_factor_le_exp_normalized (Fintype.card ι) + (∑ a, (Collision.multiplicity Finset.univ group a).choose 2) (∑ i, ell i) + hH hell (Collision.twice_collision_count_eq group)) + +end PiExponent.AnalyticCollision + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticRowSeries.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticRowSeries.lean new file mode 100644 index 0000000000000000000000000000000000000000..de33a31b6bc73085b2e955e1faf200e3ebc65c0b --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/AnalyticRowSeries.lean @@ -0,0 +1,90 @@ +import OAI.NumberTheory.PiExponent.Analysis.AnalyticCollision + +namespace OAI + +open scoped BigOperators +open Complex Finset MeasureTheory Filter + +namespace PiExponent.AnalyticCollision + +theorem hasSum_rowTest {F : ℕ → ℂ → ℂ} {f : ℂ → ℂ} {bound : ℕ → ℝ} + (hF : ∀ n, Measurable (F n)) + (hbound : ∀ n z, z ∈ Metric.sphere (0 : ℂ) (1 / 2) → ‖F n z‖ ≤ bound n) + (hsum : Summable bound) + (hpoint : ∀ z ∈ Metric.sphere (0 : ℂ) (1 / 2), HasSum (fun n => F n z) (f z)) + (ell : ℕ) : HasSum (fun n => rowTest ell (F n)) (rowTest ell f) := by + simp only [rowTest, cauchyPowerSeries_apply] + apply HasSum.const_smul + change HasSum (fun n => ∫ θ in (0 : ℝ)..2 * Real.pi, + deriv (circleMap 0 (1 / 2)) θ • + ((1 / (circleMap 0 (1 / 2) θ - 0)) ^ ell • + (circleMap 0 (1 / 2) θ - 0)⁻¹ • F n (circleMap 0 (1 / 2) θ))) + (∫ θ in (0 : ℝ)..2 * Real.pi, + deriv (circleMap 0 (1 / 2)) θ • + ((1 / (circleMap 0 (1 / 2) θ - 0)) ^ ell • + (circleMap 0 (1 / 2) θ - 0)⁻¹ • f (circleMap 0 (1 / 2) θ))) + apply intervalIntegral.hasSum_integral_of_dominated_convergence + (fun n _ => (2 : ℝ) ^ ell * bound n) + · intro n + apply Measurable.aestronglyMeasurable + simp only [deriv_circleMap] + exact (by fun_prop) + · intro n + apply Eventually.of_forall + intro θ _ + have hb := hbound n (circleMap 0 (1 / 2) θ) (circleMap_mem_sphere 0 (by norm_num) θ) + simp only [deriv_circleMap, norm_smul, norm_mul, norm_I, mul_one, sub_zero, + norm_pow, norm_div, norm_one, norm_inv, norm_circleMap_zero] + norm_num only [abs_of_pos (by norm_num : (0 : ℝ) < 1 / 2), one_div, inv_div, div_one] + calc + _ = (2 : ℝ) ^ ell * ‖F n (circleMap 0 (1 / 2) θ)‖ := by ring + _ ≤ (2 : ℝ) ^ ell * bound n := mul_le_mul_of_nonneg_left hb (by positivity) + · exact Eventually.of_forall fun _ _ => hsum.mul_left _ + · simpa only [tsum_mul_left] using + (intervalIntegrable_const : IntervalIntegrable (fun _ : ℝ => (2 : ℝ) ^ ell * ∑' n, bound n) + volume 0 (2 * Real.pi)) + · apply Eventually.of_forall + intro θ _ + exact (((hpoint _ (circleMap_mem_sphere 0 (by norm_num) θ)).const_smul _).const_smul _).const_smul _ + +theorem rowTest_const_mul (ell : ℕ) (c : ℂ) (f : ℂ → ℂ) : + rowTest ell (fun t => c * f t) = c * rowTest ell f := by + simp only [rowTest, cauchyPowerSeries_apply, smul_eq_mul] + have heq : (fun z : ℂ => (1 / (z - 0)) ^ ell * ((z - 0)⁻¹ * (c * f z))) = + (fun z : ℂ => c * ((1 / (z - 0)) ^ ell * ((z - 0)⁻¹ * f z))) := by + funext z + ring + rw [heq, circleIntegral.integral_const_mul] + ring + +theorem hasSum_translated_row {f : ℂ → ℂ} (hf : Differentiable ℂ f) + {R : NNReal} (hR : 0 < R) {D : ℝ} (hD : 0 ≤ D) + (hfD : ∀ z ∈ Metric.sphere (0 : ℂ) (R : ℝ), ‖f z‖ ≤ D) + {center : ℂ} (hc : ‖center‖ + 3 / 4 ≤ (R : ℝ) / 2) (ell : ℕ) : + HasSum (fun d => rowTest ell (fun t => ((center + Complex.log (1 + t)) / (R : ℂ)) ^ d) * + normalizedTaylorCoeff f R d) + (rowTest ell (fun t => f (center + Complex.log (1 + t)))) := by + have h := hasSum_rowTest + (F := fun d t => normalizedTaylorCoeff f R d * + ((center + Complex.log (1 + t)) / (R : ℂ)) ^ d) + (f := fun t => f (center + Complex.log (1 + t))) + (bound := fun d => D * (1 / 2 : ℝ) ^ d) + (by intro d; fun_prop) ?_ ?_ ?_ ell + · convert! h using 1 + funext d + rw [rowTest_const_mul, mul_comm] + · intro d t ht + rw [norm_mul, norm_pow] + apply mul_le_mul (norm_normalizedTaylorCoeff_le hR hfD d) + · apply pow_le_pow_left₀ (norm_nonneg _) (norm_shifted_log_div_le_half hR hc _) + simpa only [Metric.mem_sphere, dist_zero_right] using ht.le + · positivity + · exact hD + · exact (summable_geometric_of_lt_one (by norm_num : (0 : ℝ) ≤ 1 / 2) + (by norm_num : (1 / 2 : ℝ) < 1)).mul_left D + · intro t _ + exact hasSum_normalizedTaylorCoeff hf hR _ + +end PiExponent.AnalyticCollision + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/Collision.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/Collision.lean new file mode 100644 index 0000000000000000000000000000000000000000..94779a520822bb61f4303d7853c08cd1c991b73c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/Collision.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.PiExponent.Analysis.AnalyticDeterminantCollision +import OAI.NumberTheory.PiExponent.Analysis.PeriodAnalytic +import OAI.NumberTheory.PiExponent.Polynomials.SimplexLog + +namespace OAI + +open scoped BigOperators Topology +open Filter + +namespace PiExponent + +noncomputable def holomorphicError (K : ℕ) (w0 v0 wstar : ℝ) : ℝ := + 100 * K / w0 + Real.log 2 / v0 + Real.log (200 * K) / wstar + +theorem formal_period_collision_bound + {m : ℕ} {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) (transverse : κ → Fin m →₀ ℕ) + (j ell h : ι → ℕ) (a : ι → Fin m → ℕ) (w : Fin m → ℝ) + {K : ℕ} {H w0 v0 wstar : ℝ} + (hK : 0 < K) (hH : 0 < H) (hw0 : 0 < w0) (hws : 0 < wstar) + (hw : ∀ i, wstar ≤ w i) (hj : ∀ r, j r < K) + (hcol : ∀ c, w0 * h c + ∑ i, w i * a c i ≤ H) + (hell : ((∑ r, ell r : ℕ) : ℝ) ≤ (Fintype.card ι : ℝ) * H / v0) : + ‖Matrix.det (fun r c => PowerSeries.coeff (ell r) + ((MatrixTranslation.periodMonomial (j r) (2 * (Real.pi : ℂ) * Complex.I) + (h c) (a c)).coeff (transverse (group r))))‖ ≤ + Real.exp (-(Real.log 2 / 4) * + (∑ A, (Collision.multiplicity Finset.univ group A : ℝ) ^ 2) + + (Fintype.card ι : ℝ) * H * + (holomorphicError K w0 v0 wstar + Collision.collisionRemainder (Fintype.card ι) H)) := by + let R : NNReal := ⟨100 * (K : ℝ), by positivity⟩ + have hR : 0 < R := by change (0 : ℝ) < 100 * K; positivity + have hR1 : (1 : ℝ) ≤ R := by + have hK1 : (1 : ℝ) ≤ K := by exact_mod_cast hK + change (1 : ℝ) ≤ 100 * K + linarith + have hb := AnalyticCollision.translated_row_determinant_exp_bound + group (fun A c => PeriodAnalytic.columnFunction (h c) (a c) (transverse A)) + (fun r => (j r : ℂ) * (2 * (Real.pi : ℂ) * Complex.I)) ell R hR hH + (fun A c => PeriodAnalytic.differentiable_columnFunction _ _ _) + (A := (R : ℝ) / w0 + Real.log (2 * (R : ℝ)) / wstar) (v := v0) + (fun A c z hz => PeriodAnalytic.norm_columnFunction_le (h c) (a c) (transverse A) w + hR1 hH.le hw0 hws hw (hcol c) + (by simpa only [Metric.mem_sphere, dist_zero_right] using hz.le)) + (fun r => AnalyticCollision.period_center_radius_bound hK (hj r)) hell + have hRv : (R : ℝ) = 100 * K := rfl + rw [hRv] at hb + have he : (2 : ℝ) * (100 * K) = 200 * K := by ring + rw [he] at hb + simp_rw [PeriodAnalytic.periodMonomial_coeff_eq_rowTest] + convert! hb using 1 + congr 1 + unfold holomorphicError + ring + +theorem tendsto_collisionRemainder_of_normalized_pow {M : ℝ → ℕ} {d : ℕ} {L : ℝ} + (hM : Tendsto (fun H : ℝ => (M H : ℝ) / H ^ d) atTop (𝓝 L)) (hL : 0 < L) : + Tendsto (fun H => Collision.collisionRemainder (M H) H) atTop (𝓝 0) := by + convert tendsto_log_add_div_of_normalized_pow hM hL + (Real.log 2 / 4 - Real.log (1 - Collision.collisionRatio)) using 1 + funext H + unfold Collision.collisionRemainder + congr 1 + ring + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionCombinatorics.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionCombinatorics.lean new file mode 100644 index 0000000000000000000000000000000000000000..e6e64acfbdfead43371d0dffc5be5a6d46bde024 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionCombinatorics.lean @@ -0,0 +1,158 @@ +import Mathlib + +namespace OAI + +open scoped BigOperators + +namespace PiExponent.Collision + +theorem choose_card_le_sum (s : Finset ℕ) : + s.card.choose 2 ≤ ∑ d ∈ s, d := by + induction s using Finset.induction_on_max with + | empty => simp + | insert a s hmax ih => + have ha : a ∉ s := by + intro h + exact (lt_irrefl a) (hmax a h) + have hsub : s ⊆ Finset.range a := by + intro x hx + exact Finset.mem_range.mpr (hmax x hx) + have hcard : s.card ≤ a := by + simpa using Finset.card_le_card hsub + rw [Finset.card_insert_of_notMem ha, Finset.sum_insert ha] + rw [show s.card + 1 = s.card.succ from rfl, + Nat.choose_succ_succ s.card 1, Nat.choose_one_right] + exact Nat.add_le_add hcard ih + +theorem choose_card_le_sum_of_injOn {ι : Type*} (s : Finset ι) + (degree : ι → ℕ) (hinj : Set.InjOn degree (s : Set ι)) : + s.card.choose 2 ≤ ∑ i ∈ s, degree i := by + have h := choose_card_le_sum (s.image degree) + rw [Finset.card_image_of_injOn hinj, Finset.sum_image hinj] at h + exact h + +def multiplicity {ι κ : Type*} [DecidableEq κ] + (rows : Finset ι) (group : ι → κ) (a : κ) : ℕ := + (rows.filter fun i => group i = a).card + +theorem sum_multiplicity {ι κ : Type*} [DecidableEq κ] + (rows : Finset ι) (groups : Finset κ) (group : ι → κ) + (hgroups : ∀ i ∈ rows, group i ∈ groups) : + ∑ a ∈ groups, multiplicity rows group a = rows.card := by + simpa only [multiplicity, Finset.sum_const, smul_eq_mul, mul_one] + using Finset.sum_fiberwise_of_maps_to hgroups (fun _ => (1 : ℕ)) + +theorem sum_choose_multiplicity_le_sum_degree {ι κ : Type*} [DecidableEq κ] + (rows : Finset ι) (groups : Finset κ) (group : ι → κ) (degree : ι → ℕ) + (hgroups : ∀ i ∈ rows, group i ∈ groups) + (hinj : Set.InjOn (fun i => (group i, degree i)) (rows : Set ι)) : + (∑ a ∈ groups, (multiplicity rows group a).choose 2) ≤ + ∑ i ∈ rows, degree i := by + calc + (∑ a ∈ groups, (multiplicity rows group a).choose 2) ≤ + ∑ a ∈ groups, ∑ i ∈ rows.filter (fun i => group i = a), degree i := by + apply Finset.sum_le_sum + intro a _ + apply choose_card_le_sum_of_injOn + intro i hi j hj hdegree + have hi' := Finset.mem_filter.mp hi + have hj' := Finset.mem_filter.mp hj + apply hinj hi'.1 hj'.1 + exact Prod.ext (hi'.2.trans hj'.2.symm) hdegree + _ = ∑ i ∈ rows, degree i := + Finset.sum_fiberwise_of_maps_to hgroups degree + +theorem sum_choose_multiplicity_le_sum_degree_univ + {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) (degree : ι → ℕ) + (hinj : Function.Injective (fun i => (group i, degree i))) : + (∑ a, (multiplicity Finset.univ group a).choose 2) ≤ ∑ i, degree i := by + exact sum_choose_multiplicity_le_sum_degree Finset.univ Finset.univ group degree + (by simp) hinj.injOn + +theorem sum_multiplicity_univ + {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) : + ∑ a, multiplicity Finset.univ group a = Fintype.card ι := by + exact sum_multiplicity Finset.univ Finset.univ group (by simp) + +theorem sum_sq_multiplicity_sub_card_le_twice_sum_degree + {ι κ : Type*} [DecidableEq κ] + (rows : Finset ι) (groups : Finset κ) (group : ι → κ) (degree : ι → ℕ) + (hgroups : ∀ i ∈ rows, group i ∈ groups) + (hinj : Set.InjOn (fun i => (group i, degree i)) (rows : Set ι)) : + (∑ a ∈ groups, (multiplicity rows group a : ℝ) ^ 2) - rows.card ≤ + 2 * ∑ i ∈ rows, (degree i : ℝ) := by + have hnat := sum_choose_multiplicity_le_sum_degree rows groups group degree hgroups hinj + have hreal : (∑ a ∈ groups, ((multiplicity rows group a).choose 2 : ℝ)) ≤ + ∑ i ∈ rows, (degree i : ℝ) := by exact_mod_cast hnat + have hsum : (∑ a ∈ groups, (multiplicity rows group a : ℝ)) = rows.card := by + exact_mod_cast sum_multiplicity rows groups group hgroups + have hid : 2 * (∑ a ∈ groups, ((multiplicity rows group a).choose 2 : ℝ)) = + (∑ a ∈ groups, (multiplicity rows group a : ℝ) ^ 2) - rows.card := by + calc + _ = ∑ a ∈ groups, ((multiplicity rows group a : ℝ) ^ 2 - + (multiplicity rows group a : ℝ)) := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro a _ + rw [Nat.cast_choose_two] + ring + _ = _ := by rw [Finset.sum_sub_distrib, hsum] + linarith + +theorem sum_sq_multiplicity_sub_card_le_twice_sum_degree_univ + {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) (degree : ι → ℕ) + (hinj : Function.Injective (fun i => (group i, degree i))) : + (∑ a, (multiplicity Finset.univ group a : ℝ) ^ 2) - Fintype.card ι ≤ + 2 * ∑ i, (degree i : ℝ) := by + exact sum_sq_multiplicity_sub_card_le_twice_sum_degree Finset.univ Finset.univ + group degree (by simp) hinj.injOn + +theorem sum_multiplicity_eq_card_filter {ι κ : Type*} [DecidableEq κ] + (rows : Finset ι) (groups : Finset κ) (group : ι → κ) : + ∑ a ∈ groups, multiplicity rows group a = + (rows.filter fun i => group i ∈ groups).card := by + exact Finset.sum_card_fiberwise_eq_card_filter rows groups group + +theorem cutoff_mul_high_count_le_sum {ι : Type*} + (rows : Finset ι) (weight : ι → ℝ) (cutoff : ℝ) + (hnonneg : ∀ i ∈ rows, 0 ≤ weight i) : + cutoff * ((rows.filter fun i => ¬ weight i ≤ cutoff).card : ℝ) ≤ + ∑ i ∈ rows, weight i := by + classical + calc + _ = ∑ i ∈ rows.filter (fun i => ¬ weight i ≤ cutoff), cutoff := by + simp [mul_comm] + _ ≤ ∑ i ∈ rows.filter (fun i => ¬ weight i ≤ cutoff), weight i := by + apply Finset.sum_le_sum + intro i hi + exact le_of_lt (lt_of_not_ge (Finset.mem_filter.mp hi).2) + _ ≤ ∑ i ∈ rows, weight i := by + apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ rows) + intro i hi _ + exact hnonneg i hi + +theorem sum_weight_ge_of_low_count_le {ι : Type*} + (rows : Finset ι) (weight : ι → ℝ) {cutoff η : ℝ} + (hcutoff : 0 ≤ cutoff) (hnonneg : ∀ i ∈ rows, 0 ≤ weight i) + (hlow : ((rows.filter fun i => weight i ≤ cutoff).card : ℝ) ≤ + η * rows.card) : + cutoff * (1 - η) * rows.card ≤ ∑ i ∈ rows, weight i := by + classical + have hcard : ((rows.filter fun i => weight i ≤ cutoff).card : ℝ) + + ((rows.filter fun i => ¬ weight i ≤ cutoff).card : ℝ) = rows.card := by + exact_mod_cast (Finset.card_filter_add_card_filter_not (s := rows) + (fun i => weight i ≤ cutoff)) + have hhigh : (1 - η) * rows.card ≤ + ((rows.filter fun i => ¬ weight i ≤ cutoff).card : ℝ) := by nlinarith + calc + _ = cutoff * ((1 - η) * rows.card) := by ring + _ ≤ cutoff * ((rows.filter fun i => ¬ weight i ≤ cutoff).card : ℝ) := + mul_le_mul_of_nonneg_left hhigh hcutoff + _ ≤ ∑ i ∈ rows, weight i := cutoff_mul_high_count_le_sum rows weight cutoff hnonneg + +end PiExponent.Collision + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionExponential.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionExponential.lean new file mode 100644 index 0000000000000000000000000000000000000000..9862dc683a7e4d04510f3ab019e696dae107729e --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionExponential.lean @@ -0,0 +1,104 @@ +import OAI.NumberTheory.PiExponent.Analysis.CollisionCombinatorics + +namespace OAI + +open scoped BigOperators + +namespace PiExponent.Collision + +noncomputable def collisionRatio : ℝ := Real.exp (-Real.log 2 / 2) + +theorem collisionRatio_pos : 0 < collisionRatio := Real.exp_pos _ + +theorem collisionRatio_lt_one : collisionRatio < 1 := by + apply Real.exp_lt_one_iff.mpr + have h : 0 < Real.log 2 := Real.log_pos (by norm_num) + linarith + +theorem collisionRatio_mul_self : collisionRatio * collisionRatio = 1 / 2 := by + unfold collisionRatio + rw [← Real.exp_add] + have heq : -Real.log 2 / 2 + -Real.log 2 / 2 = -Real.log 2 := by ring + rw [heq, Real.exp_neg, Real.exp_log (by norm_num)] + simp only [one_div] + +theorem factorial_le_exp_card_log (M : ℕ) : + (M.factorial : ℝ) ≤ Real.exp ((M : ℝ) * Real.log M) := by + by_cases hM : M = 0 + · subst M + norm_num + · rw [Real.exp_nat_mul, Real.exp_log (by exact_mod_cast Nat.pos_of_ne_zero hM)] + exact_mod_cast Nat.factorial_le_pow M + +theorem twice_collision_count_eq + {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq κ] (group : ι → κ) : + 2 * ((∑ a, (multiplicity Finset.univ group a).choose 2 : ℕ) : ℝ) = + (∑ a, (multiplicity Finset.univ group a : ℝ) ^ 2) - Fintype.card ι := by + have hsum : (∑ a, (multiplicity Finset.univ group a : ℝ)) = Fintype.card ι := by + exact_mod_cast sum_multiplicity_univ group + push_cast + rw [Finset.mul_sum] + calc + _ = ∑ a, ((multiplicity Finset.univ group a : ℝ) ^ 2 - + (multiplicity Finset.univ group a : ℝ)) := by + apply Finset.sum_congr rfl + intro a _ + rw [Nat.cast_choose_two] + ring + _ = _ := by rw [Finset.sum_sub_distrib, hsum] + +theorem collision_factor_le_exp (M C ell : ℕ) {H A v S : ℝ} + (hell : (ell : ℝ) ≤ (M : ℝ) * H / v) + (hC : 2 * (C : ℝ) = S - M) : + ((M.factorial : ℝ) * (Real.exp (H * A)) ^ M * (2 : ℝ) ^ ell) * + collisionRatio ^ C * ((1 - collisionRatio)⁻¹) ^ M ≤ + Real.exp (-(Real.log 2 / 4) * S + (M : ℝ) * H * (A + Real.log 2 / v) + + (M : ℝ) * (Real.log M + Real.log 2 / 4 - Real.log (1 - collisionRatio))) := by + have hlog2 : 0 ≤ Real.log 2 := Real.log_nonneg (by norm_num) + have hr : 0 < 1 - collisionRatio := sub_pos.mpr collisionRatio_lt_one + have ht : (2 : ℝ) ^ ell ≤ Real.exp ((M : ℝ) * H / v * Real.log 2) := by + calc + _ = Real.exp ((ell : ℝ) * Real.log 2) := by + rw [Real.exp_nat_mul, Real.exp_log (by norm_num)] + _ ≤ _ := Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right hell hlog2) + calc + _ ≤ (Real.exp ((M : ℝ) * Real.log M) * (Real.exp (H * A)) ^ M * + Real.exp ((M : ℝ) * H / v * Real.log 2)) * + collisionRatio ^ C * ((1 - collisionRatio)⁻¹) ^ M := by + apply mul_le_mul_of_nonneg_right _ (pow_nonneg (inv_nonneg.mpr hr.le) M) + apply mul_le_mul_of_nonneg_right _ (pow_nonneg collisionRatio_pos.le C) + apply mul_le_mul _ ht (by positivity) (by positivity) + exact mul_le_mul_of_nonneg_right (factorial_le_exp_card_log M) (by positivity) + _ = _ := by + rw [← Real.exp_nat_mul, collisionRatio, ← Real.exp_nat_mul] + have hi : (1 - Real.exp (-Real.log 2 / 2))⁻¹ = + Real.exp (-Real.log (1 - collisionRatio)) := by + rw [Real.exp_neg, Real.exp_log hr] + rfl + rw [hi, ← Real.exp_nat_mul] + simp only [← Real.exp_add] + congr 1 + have hc : (C : ℝ) = (S - M) / 2 := by linarith + rw [hc] + unfold collisionRatio + ring + +noncomputable def collisionRemainder (M : ℕ) (H : ℝ) : ℝ := + (Real.log M + Real.log 2 / 4 - Real.log (1 - collisionRatio)) / H + +theorem collision_factor_le_exp_normalized (M C ell : ℕ) {H A v S : ℝ} + (hH : 0 < H) (hell : (ell : ℝ) ≤ (M : ℝ) * H / v) + (hC : 2 * (C : ℝ) = S - M) : + ((M.factorial : ℝ) * (Real.exp (H * A)) ^ M * (2 : ℝ) ^ ell) * + collisionRatio ^ C * ((1 - collisionRatio)⁻¹) ^ M ≤ + Real.exp (-(Real.log 2 / 4) * S + (M : ℝ) * H * + (A + Real.log 2 / v + collisionRemainder M H)) := by + convert collision_factor_le_exp M C ell hell hC using 1 + congr 1 + unfold collisionRemainder + field_simp + ring + +end PiExponent.Collision + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionGeometricSum.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionGeometricSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..4dfc01e15c072232452465d43670af3f9077e7df --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionGeometricSum.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.PiExponent.Analysis.CollisionCombinatorics + +namespace OAI + +open scoped BigOperators + +namespace PiExponent.Collision + +theorem sum_pow_fin_le_inv_one_sub {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s < 1) + (N : ℕ) : (∑ k : Fin N, s ^ (k : ℕ)) ≤ (1 - s)⁻¹ := by + rw [Fin.sum_univ_eq_sum_range (fun k : ℕ => s ^ k), ← one_div] + apply (le_div_iff₀ (sub_pos.mpr hs1)).2 + rw [geom_sum_mul_neg] + exact sub_le_self 1 (pow_nonneg hs0 N) + +theorem sum_pow_degree_assignments_eq {ι : Type*} [Fintype ι] [DecidableEq ι] + (s : ℝ) (N : ℕ) : + (∑ f : ι → Fin N, s ^ (∑ i, (f i : ℕ))) = + (∑ k : Fin N, s ^ (k : ℕ)) ^ Fintype.card ι := by + classical + simp_rw [← Finset.prod_pow_eq_pow_sum] + rw [← Fintype.prod_sum (fun (_ : ι) (k : Fin N) => s ^ (k : ℕ))] + simp + +theorem sum_pow_degree_assignments_le {ι : Type*} [Fintype ι] [DecidableEq ι] + {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s < 1) (N : ℕ) : + (∑ f : ι → Fin N, s ^ (∑ i, (f i : ℕ))) ≤ + ((1 - s)⁻¹) ^ Fintype.card ι := by + rw [sum_pow_degree_assignments_eq] + exact pow_le_pow_left₀ (Finset.sum_nonneg fun k _ => pow_nonneg hs0 _) + (sum_pow_fin_le_inv_one_sub hs0 hs1 N) _ + +theorem collision_geometric_sum_le + {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s < 1) (N : ℕ) : + (∑ f ∈ (Finset.univ : Finset (ι → Fin N)).filter + (fun f => Function.Injective (fun i => (group i, (f i : ℕ)))), + (s * s) ^ (∑ i, (f i : ℕ))) ≤ + s ^ (∑ a, (multiplicity Finset.univ group a).choose 2) * + ((1 - s)⁻¹) ^ Fintype.card ι := by + classical + let good := (Finset.univ : Finset (ι → Fin N)).filter + (fun f => Function.Injective (fun i => (group i, (f i : ℕ)))) + let C := ∑ a, (multiplicity Finset.univ group a).choose 2 + have hpoint : ∀ f ∈ good, + (s * s) ^ (∑ i, (f i : ℕ)) ≤ s ^ C * s ^ (∑ i, (f i : ℕ)) := by + intro f hf + have hinj := (Finset.mem_filter.mp hf).2 + have hdeg : C ≤ ∑ i, (f i : ℕ) := + sum_choose_multiplicity_le_sum_degree_univ group (fun i => (f i : ℕ)) hinj + rw [mul_pow] + exact mul_le_mul_of_nonneg_right (pow_le_pow_of_le_one hs0 hs1.le hdeg) + (pow_nonneg hs0 _) + calc + _ ≤ ∑ f ∈ good, s ^ C * s ^ (∑ i, (f i : ℕ)) := + Finset.sum_le_sum hpoint + _ = s ^ C * ∑ f ∈ good, s ^ (∑ i, (f i : ℕ)) := by rw [Finset.mul_sum] + _ ≤ s ^ C * ∑ f : ι → Fin N, s ^ (∑ i, (f i : ℕ)) := by + apply mul_le_mul_of_nonneg_left _ (pow_nonneg hs0 C) + apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) + intro f _ _ + exact pow_nonneg hs0 _ + _ ≤ _ := mul_le_mul_of_nonneg_left (sum_pow_degree_assignments_le hs0 hs1 N) + (pow_nonneg hs0 C) + +end PiExponent.Collision + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionLimit.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..985924c5a1d2c10ea815880db127a98a167668a6 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionLimit.lean @@ -0,0 +1,68 @@ +import Mathlib +import OAI.NumberTheory.PiExponent.Analysis.FiniteDeterminantCollision + +namespace OAI + +open scoped BigOperators Topology +open Filter + +namespace PiExponent.Collision + +theorem norm_det_le_of_entrywise_limit {ι : Type*} [Fintype ι] [DecidableEq ι] + (A : ℕ → Matrix ι ι ℂ) (T : Matrix ι ι ℂ) {B : ℝ} + (hlim : ∀ i j, Tendsto (fun N => A N i j) atTop (𝓝 (T i j))) + (hbound : ∀ N, ‖(A N).det‖ ≤ B) : ‖T.det‖ ≤ B := by + have hmatrix : Tendsto A atTop (𝓝 T) := by + apply tendsto_pi_nhds.mpr + intro i + exact tendsto_pi_nhds.mpr (hlim i) + have hdet : Tendsto (fun N => (A N).det) atTop (𝓝 T.det) := + (continuous_id.matrix_det.tendsto T).comp hmatrix + exact le_of_tendsto' hdet.norm hbound + +theorem norm_det_le_of_entrywise_hasSum {ι : Type*} [Fintype ι] [DecidableEq ι] + (C : ι → ℕ → ι → ℂ) (T : Matrix ι ι ℂ) {B : ℝ} + (hsum : ∀ i j, HasSum (fun d => C i d j) (T i j)) + (hbound : ∀ N, ‖Matrix.det (fun i j => ∑ d ∈ Finset.range N, C i d j)‖ ≤ B) : + ‖T.det‖ ≤ B := by + exact norm_det_le_of_entrywise_limit + (fun N i j => ∑ d ∈ Finset.range N, C i d j) T + (fun i j => (hsum i j).tendsto_sum_nat) hbound + +theorem norm_det_le_of_tested_series_hasSum + {ι κ : Type*} [Fintype ι] [DecidableEq ι] + (group : ι → κ) (coeff : κ → ℕ → ι → ℂ) (test : ι → ℕ → ℂ) + (T : Matrix ι ι ℂ) {B : ℝ} + (hsum : ∀ i j, HasSum (fun d => test i d * coeff (group i) d j) (T i j)) + (hbound : ∀ N, + ‖Matrix.det (fun i j => ∑ d ∈ Finset.range N, test i d * coeff (group i) d j)‖ ≤ B) : + ‖T.det‖ ≤ B := by + exact norm_det_le_of_entrywise_hasSum + (fun i d j => test i d * coeff (group i) d j) T hsum hbound + +theorem infinite_collision_bound + {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) (B : ι → ℕ → ℂ) (C : κ → ℕ → ι → ℂ) + (D s : ℝ) (L : ι → ℝ) (hD : 0 ≤ D) (hs0 : 0 ≤ s) (hs1 : s < 1) + (hL : ∀ i, 0 ≤ L i) + (hC : ∀ a d j, ‖C a d j‖ ≤ D) + (hB : ∀ i d, ‖B i d‖ ≤ L i * (s * s) ^ d) + (T : Matrix ι ι ℂ) + (hsum : ∀ i j, HasSum (fun d => B i d * C (group i) d j) (T i j)) : + ‖T.det‖ ≤ + ((Fintype.card ι).factorial * D ^ Fintype.card ι * (∏ i, L i)) * + s ^ (∑ a, (multiplicity Finset.univ group a).choose 2) * + ((1 - s)⁻¹) ^ Fintype.card ι := by + apply norm_det_le_of_tested_series_hasSum group C B T hsum + intro N + have hmatrix : (fun i j => ∑ d ∈ Finset.range N, B i d * C (group i) d j) = + (fun i j => ∑ d : Fin N, B i d * C (group i) d j) := by + funext i j + exact (Fin.sum_univ_eq_sum_range (fun d : ℕ => B i d * C (group i) d j) N).symm + rw [hmatrix] + exact FiniteDeterminantCollision.finite_collision_bound group B C D s L hD hs0 hs1 + hL hC hB N + +end PiExponent.Collision + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionOccupancy.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionOccupancy.lean new file mode 100644 index 0000000000000000000000000000000000000000..57be3760f398609dcc1d15c75d2af10b829dbc29 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/CollisionOccupancy.lean @@ -0,0 +1,59 @@ +import Mathlib + +namespace OAI + +namespace PiExponent.Collision + +open scoped BigOperators + +variable {G : Type*} + +theorem sum_sq_le_card_mul_sum_sq (S : Finset G) (n : G → ℝ) : + (∑ a ∈ S, n a) ^ 2 ≤ (S.card : ℝ) * ∑ a ∈ S, n a ^ 2 := by + simpa using Finset.sum_mul_sq_le_sq_mul_sq S (fun _ : G => (1 : ℝ)) n + +theorem sum_sq_le_card_mul_total_sq (S U : Finset G) (hSU : S ⊆ U) + (n : G → ℝ) : + (∑ a ∈ S, n a) ^ 2 ≤ (S.card : ℝ) * ∑ a ∈ U, n a ^ 2 := by + apply (sum_sq_le_card_mul_sum_sq S n).trans + apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) + exact Finset.sum_le_sum_of_subset_of_nonneg hSU (fun a _ _ => sq_nonneg (n a)) + +theorem mass_sq_div_card_le_total_sq (S U : Finset G) (hSU : S ⊆ U) + (n : G → ℝ) {mass : ℝ} (hmass : 0 ≤ mass) + (hlow : mass ≤ ∑ a ∈ S, n a) (hcard : 0 < S.card) : + mass ^ 2 / (S.card : ℝ) ≤ ∑ a ∈ U, n a ^ 2 := by + have hsq : mass ^ 2 ≤ (∑ a ∈ S, n a) ^ 2 := by + exact pow_le_pow_left₀ hmass hlow 2 + have hc : (0 : ℝ) < S.card := by exact_mod_cast hcard + apply (div_le_iff₀ hc).2 + calc + mass ^ 2 ≤ (∑ a ∈ S, n a) ^ 2 := hsq + _ ≤ (S.card : ℝ) * ∑ a ∈ U, n a ^ 2 := + sum_sq_le_card_mul_total_sq S U hSU n + _ = (∑ a ∈ U, n a ^ 2) * (S.card : ℝ) := mul_comm _ _ + +theorem fraction_sq_mul_mass_sq_div_card_le_total_sq + (S U : Finset G) (hSU : S ⊆ U) (n : G → ℝ) + {η M : ℝ} (hη : 0 ≤ η) (hM : 0 ≤ M) + (hlow : η * M ≤ ∑ a ∈ S, n a) (hcard : 0 < S.card) : + η ^ 2 * M ^ 2 / (S.card : ℝ) ≤ ∑ a ∈ U, n a ^ 2 := by + simpa only [mul_pow] using + mass_sq_div_card_le_total_sq S U hSU n (mul_nonneg hη hM) hlow hcard + +variable [Fintype G] + +theorem sum_sq_le_card_mul_univ_sq (S : Finset G) (n : G → ℝ) : + (∑ a ∈ S, n a) ^ 2 ≤ (S.card : ℝ) * ∑ a, n a ^ 2 := by + exact sum_sq_le_card_mul_total_sq S Finset.univ (Finset.subset_univ S) n + +theorem nat_occupancy_square_lower_bound (S : Finset G) (n : G → ℕ) + {η : ℝ} {M : ℕ} (hη : 0 ≤ η) + (hlow : η * (M : ℝ) ≤ ∑ a ∈ S, (n a : ℝ)) (hcard : 0 < S.card) : + η ^ 2 * (M : ℝ) ^ 2 / (S.card : ℝ) ≤ ∑ a, (n a : ℝ) ^ 2 := by + exact fraction_sq_mul_mass_sq_div_card_le_total_sq S Finset.univ + (Finset.subset_univ S) (fun a => (n a : ℝ)) hη (Nat.cast_nonneg M) hlow hcard + +end PiExponent.Collision + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/ColonSeriesTelescope.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/ColonSeriesTelescope.lean new file mode 100644 index 0000000000000000000000000000000000000000..50f1f08caef171c2930ee0e246fdc56a4981d74d --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/ColonSeriesTelescope.lean @@ -0,0 +1,90 @@ +import Mathlib.RingTheory.PowerSeries.WellKnown +import Mathlib.Tactic.LinearCombination +import Mathlib.Tactic.Ring +import OAI.NumberTheory.PiExponent.LocalAlgebra.ColonHilbertStep +import OAI.NumberTheory.PiExponent.Polynomials.HomogeneousPrimeFactor + +namespace OAI + +namespace PiExponentJets.W64 + +open scoped BigOperators +attribute [local instance] MvPolynomial.gradedAlgebra +variable {k σ : Type*} [Field k] + +noncomputable def iteratedColon (I : Ideal (MvPolynomial σ k)) (f : MvPolynomial σ k) : + ℕ → Ideal (MvPolynomial σ k) + | 0 => I + | n+1 => (iteratedColon I f n).colon {f} + +@[simp] theorem iteratedColon_zero (I : Ideal (MvPolynomial σ k)) (f : MvPolynomial σ k) : + iteratedColon I f 0 = I := rfl + +@[simp] theorem iteratedColon_succ (I : Ideal (MvPolynomial σ k)) (f : MvPolynomial σ k) + (n : ℕ) : iteratedColon I f (n+1) = (iteratedColon I f n).colon {f} := rfl + +theorem iteratedColon_homogeneous (I : Ideal (MvPolynomial σ k)) + (hI : I.IsHomogeneous (MvPolynomial.homogeneousSubmodule σ k)) + {d : ℕ} (f : MvPolynomial σ k) (hf : f.IsHomogeneous d) (n : ℕ) : + (iteratedColon I f n).IsHomogeneous (MvPolynomial.homogeneousSubmodule σ k) := by + induction n with + | zero => exact hI + | succ n ih => exact PiExponentJets.W22.homogeneous_colon_singleton _ ih hf + +variable [Finite σ] + +theorem iteratedColon_series_telescope (I : Ideal (MvPolynomial σ k)) + (hI : I.IsHomogeneous (MvPolynomial.homogeneousSubmodule σ k)) + (f : MvPolynomial σ k) (hf : f.IsHomogeneous 1) (m : ℕ) : + sectionHilbertSeries I = + (∑ j ∈ Finset.range m, PowerSeries.X ^ j * + sectionHilbertSeries (Ideal.span {f} ⊔ iteratedColon I f j)) + + PowerSeries.X ^ m * sectionHilbertSeries (iteratedColon I f m) := by + induction m with + | zero => simp + | succ m ih => + have hs := sectionHilbertSeries_colon_step (iteratedColon I f m) + (iteratedColon_homogeneous I hI f hf m) f hf + simp only [pow_one, ← iteratedColon_succ] at hs + rw [ih, hs, Finset.sum_range_succ, pow_succ] + ring + +theorem stableColon_series (I : Ideal (MvPolynomial σ k)) + (hI : I.IsHomogeneous (MvPolynomial.homogeneousSubmodule σ k)) + (f : MvPolynomial σ k) (hf : f.IsHomogeneous 1) + (hstable : I.colon {f} = I) : + sectionHilbertSeries I = sectionHilbertSeries (Ideal.span {f} ⊔ I) * + (PowerSeries.invOneSubPow ℤ 1).val := by + have hs := sectionHilbertSeries_colon_step I hI f hf + rw [hstable, pow_one] at hs + have he : (1 - PowerSeries.X) * sectionHilbertSeries I = + sectionHilbertSeries (Ideal.span {f} ⊔ I) := by + linear_combination hs + have hunit : (1 - (PowerSeries.X : PowerSeries ℤ)) * + (PowerSeries.invOneSubPow ℤ 1).val = 1 := by + rw [← pow_one (1 - (PowerSeries.X : PowerSeries ℤ)), + ← PowerSeries.invOneSubPow_inv_eq_one_sub_pow] + exact (PowerSeries.invOneSubPow ℤ 1).inv_val + calc + sectionHilbertSeries I = ((1-PowerSeries.X) * sectionHilbertSeries I) * + (PowerSeries.invOneSubPow ℤ 1).val := by + rw [mul_right_comm, hunit, one_mul] + _ = _ := by rw [he] + +theorem stabilized_iteratedColon_series (I : Ideal (MvPolynomial σ k)) + (hI : I.IsHomogeneous (MvPolynomial.homogeneousSubmodule σ k)) + (f : MvPolynomial σ k) (hf : f.IsHomogeneous 1) (m : ℕ) + (hstable : iteratedColon I f (m+1) = iteratedColon I f m) : + sectionHilbertSeries I = + (∑ j ∈ Finset.range m, PowerSeries.X ^ j * + sectionHilbertSeries (Ideal.span {f} ⊔ iteratedColon I f j)) + + PowerSeries.X ^ m * + (sectionHilbertSeries (Ideal.span {f} ⊔ iteratedColon I f m) * + (PowerSeries.invOneSubPow ℤ 1).val) := by + rw [iteratedColon_series_telescope I hI f hf m, + stableColon_series (iteratedColon I f m) + (iteratedColon_homogeneous I hI f hf m) f hf hstable] + +end PiExponentJets.W64 + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/DeterminantAnalyticBound.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/DeterminantAnalyticBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..66c07bf55515160c9446126531f0e34cbfe78bca --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/DeterminantAnalyticBound.lean @@ -0,0 +1,134 @@ +import OAI.NumberTheory.PiExponent.Analysis.Collision +import OAI.NumberTheory.PiExponent.Analysis.CollisionOccupancy + +namespace OAI + +open scoped BigOperators + +namespace PiExponent.DeterminantAnalyticBound + +theorem two_alternative_exponent + {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) (weight : κ → ℝ) + {H A eta nu c N bbar E : ℝ} + (hH : 0 < H) (hA : 0 ≤ A) (heta : 0 ≤ eta) (hnu : 0 ≤ nu) + (hc : 0 ≤ c) (hN : 0 < N) (hw : ∀ a, 0 ≤ weight a) + (hbeta : (Fintype.card ι : ℝ) * H * bbar ≤ ∑ i, weight (group i)) + (hcap : (((Finset.univ : Finset κ).filter (fun a => weight a ≤ A * H)).card : ℝ) ≤ N) : + -nu * ((∑ i, weight (group i)) - (Fintype.card ι : ℝ) * H * bbar) - + c * (∑ a, (Collision.multiplicity Finset.univ group a : ℝ) ^ 2) + + (Fintype.card ι : ℝ) * H * E ≤ + (Fintype.card ι : ℝ) * H * + (E + max (-c * eta ^ 2 * (Fintype.card ι : ℝ) / (H * N)) + (-nu * (A * (1 - eta) - bbar))) := by + classical + let S := (Finset.univ : Finset κ).filter (fun a => weight a ≤ A * H) + let M : ℝ := Fintype.card ι + let Z : ℝ := ∑ a, (Collision.multiplicity Finset.univ group a : ℝ) ^ 2 + have hM : 0 ≤ M := Nat.cast_nonneg _ + have hZ : 0 ≤ Z := Finset.sum_nonneg fun _ _ => sq_nonneg _ + have hmass : (∑ a ∈ S, (Collision.multiplicity Finset.univ group a : ℝ)) = + (((Finset.univ : Finset ι).filter (fun i => weight (group i) ≤ A * H)).card : ℝ) := by + have hn := Collision.sum_multiplicity_eq_card_filter (Finset.univ : Finset ι) S group + have hn' : (∑ a ∈ S, Collision.multiplicity Finset.univ group a) = + ((Finset.univ : Finset ι).filter (fun i => weight (group i) ≤ A * H)).card := by + simpa only [S, Finset.mem_filter, Finset.mem_univ, true_and] using hn + exact_mod_cast hn' + by_cases hlow : eta * M ≤ ∑ a ∈ S, (Collision.multiplicity Finset.univ group a : ℝ) + · have hsq : eta ^ 2 * M ^ 2 ≤ N * Z := by + calc + _ = (eta * M) ^ 2 := by ring + _ ≤ (∑ a ∈ S, (Collision.multiplicity Finset.univ group a : ℝ)) ^ 2 := + pow_le_pow_left₀ (mul_nonneg heta hM) hlow 2 + _ ≤ (S.card : ℝ) * Z := Collision.sum_sq_le_card_mul_univ_sq S _ + _ ≤ N * Z := mul_le_mul_of_nonneg_right hcap hZ + have hcollision : -c * Z ≤ M * H * (-c * eta ^ 2 * M / (H * N)) := by + have hz : eta ^ 2 * M ^ 2 / N ≤ Z := (div_le_iff₀ hN).mpr (by nlinarith [hsq]) + have hh := mul_le_mul_of_nonneg_left hz hc + have he : M * H * (-c * eta ^ 2 * M / (H * N)) = -c * (eta ^ 2 * M ^ 2 / N) := by + field_simp + rw [he] + nlinarith [hh] + have hscalar : -nu * ((∑ i, weight (group i)) - M * H * bbar) ≤ 0 := by + have hp := mul_nonneg hnu (sub_nonneg.mpr hbeta) + nlinarith [hp] + have hmax := mul_le_mul_of_nonneg_left + (le_max_left (-c * eta ^ 2 * M / (H * N)) (-nu * (A * (1 - eta) - bbar))) + (mul_nonneg hM hH.le) + change -nu * ((∑ i, weight (group i)) - M * H * bbar) - c * Z + M * H * E ≤ _ + change _ ≤ M * H * (E + max (-c * eta ^ 2 * M / (H * N)) (-nu * (A * (1 - eta) - bbar))) + nlinarith + · have hl : (((Finset.univ : Finset ι).filter (fun i => weight (group i) ≤ A * H)).card : ℝ) ≤ + eta * (Finset.univ : Finset ι).card := by + rw [← hmass] + exact (le_of_not_ge hlow) + have hwgt := Collision.sum_weight_ge_of_low_count_le (Finset.univ : Finset ι) + (fun i => weight (group i)) (mul_nonneg hA hH.le) (fun i _ => hw _) hl + have hwgt' : A * H * (1 - eta) * M ≤ ∑ i, weight (group i) := by + simpa only [Finset.card_univ, M] using hwgt + have hmul := mul_le_mul_of_nonneg_left hwgt' hnu + have hscalar : -nu * ((∑ i, weight (group i)) - M * H * bbar) ≤ + M * H * (-nu * (A * (1 - eta) - bbar)) := by nlinarith [hmul] + have hcollision : -c * Z ≤ 0 := by nlinarith [mul_nonneg hc hZ] + have hmax := mul_le_mul_of_nonneg_left + (le_max_right (-c * eta ^ 2 * M / (H * N)) (-nu * (A * (1 - eta) - bbar))) + (mul_nonneg hM hH.le) + change -nu * ((∑ i, weight (group i)) - M * H * bbar) - c * Z + M * H * E ≤ _ + change _ ≤ M * H * (E + max (-c * eta ^ 2 * M / (H * N)) (-nu * (A * (1 - eta) - bbar))) + nlinarith + +theorem translated_summand_bound + {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) (weight : κ → ℝ) (scalar determinant : ℂ) + {H A eta nu c N bbar Etr Ehol rho : ℝ} + (hH : 0 < H) (hA : 0 ≤ A) (heta : 0 ≤ eta) (hnu : 0 ≤ nu) + (hc : 0 ≤ c) (hN : 0 < N) (hw : ∀ a, 0 ≤ weight a) + (hbeta : (Fintype.card ι : ℝ) * H * bbar ≤ ∑ i, weight (group i)) + (hcap : (((Finset.univ : Finset κ).filter (fun a => weight a ≤ A * H)).card : ℝ) ≤ N) + (hscalar : ‖scalar‖ ≤ Real.exp + (-nu * ((∑ i, weight (group i)) - (Fintype.card ι : ℝ) * H * bbar) + + (Fintype.card ι : ℝ) * H * Etr)) + (hdet : ‖determinant‖ ≤ Real.exp + (-c * (∑ a, (Collision.multiplicity Finset.univ group a : ℝ) ^ 2) + + (Fintype.card ι : ℝ) * H * (Ehol + rho))) : + ‖scalar * determinant‖ ≤ Real.exp ((Fintype.card ι : ℝ) * H * + (Etr + Ehol + rho + max (-c * eta ^ 2 * (Fintype.card ι : ℝ) / (H * N)) + (-nu * (A * (1 - eta) - bbar)))) := by + rw [norm_mul] + apply (mul_le_mul hscalar hdet (norm_nonneg _) (Real.exp_pos _).le).trans + rw [← Real.exp_add] + apply Real.exp_le_exp.mpr + have h := two_alternative_exponent group weight hH hA heta hnu hc hN hw hbeta hcap + (E := Etr + Ehol + rho) + nlinarith [h] + +theorem log_norm_sum_le {Ω : Type*} [Fintype Ω] + (term : Ω → ℂ) (delta : ℂ) {M : ℕ} {H Q E : ℝ} + (hM : 0 < M) (hH : 0 < H) (hQ : 0 < Q) + (hcard : (Fintype.card Ω : ℝ) ≤ Q ^ M) + (hexpansion : delta = ∑ x, term x) (hne : delta ≠ 0) + (hterm : ∀ x, ‖term x‖ ≤ Real.exp ((M : ℝ) * H * E)) : + Real.log ‖delta‖ / ((M : ℝ) * H) ≤ E + Real.log Q / H := by + have hbound : ‖delta‖ ≤ Real.exp ((M : ℝ) * H * (E + Real.log Q / H)) := by + calc + _ = ‖∑ x, term x‖ := by rw [hexpansion] + _ ≤ ∑ x, ‖term x‖ := norm_sum_le _ _ + _ ≤ ∑ _x : Ω, Real.exp ((M : ℝ) * H * E) := Finset.sum_le_sum fun x _ => hterm x + _ = (Fintype.card Ω : ℝ) * Real.exp ((M : ℝ) * H * E) := by simp + _ ≤ Q ^ M * Real.exp ((M : ℝ) * H * E) := + mul_le_mul_of_nonneg_right hcard (Real.exp_pos _).le + _ = _ := by + have he : Q ^ M = Real.exp ((M : ℝ) * Real.log Q) := by + rw [Real.exp_nat_mul, Real.exp_log hQ] + rw [he, ← Real.exp_add] + congr 1 + field_simp + ring + have hlog := Real.log_le_log (norm_pos_iff.mpr hne) hbound + rw [Real.log_exp] at hlog + apply (div_le_iff₀ (mul_pos (by exact_mod_cast hM) hH)).mpr + nlinarith [hlog] + +end PiExponent.DeterminantAnalyticBound + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/DimensionLimits.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/DimensionLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..6300dd86377d1d5fff0ab5b13c0bded82c3529df --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/DimensionLimits.lean @@ -0,0 +1,29 @@ +import Mathlib.Analysis.SpecificLimits.Normed + +namespace OAI + +open Filter Topology + +namespace PiExponent + + theorem tendsto_nat_add_one_div_pow {r : ℝ} (hr : 1 < r) : + Tendsto (fun n : ℕ => ((n : ℝ) + 1) / r ^ n) atTop (𝓝 0) := by + have h₁ := tendsto_pow_const_div_const_pow_of_one_lt 1 hr + have h₀ := tendsto_pow_const_div_const_pow_of_one_lt 0 hr + simpa only [pow_one, pow_zero, ← add_div, zero_add] using h₁.add h₀ + + theorem tendsto_pow_div_nat_add_one {r : ℝ} (hr : 1 < r) : + Tendsto (fun n : ℕ => r ^ n / ((n : ℝ) + 1)) atTop atTop := by + have hpos : ∀ᶠ n : ℕ in atTop, 0 < ((n : ℝ) + 1) / r ^ n := + Filter.Eventually.of_forall fun n => + div_pos (by positivity) (pow_pos (zero_lt_one.trans hr) n) + have hwithin : Tendsto (fun n : ℕ => ((n : ℝ) + 1) / r ^ n) + atTop (𝓝[>] (0 : ℝ)) := + tendsto_nhdsWithin_iff.mpr ⟨tendsto_nat_add_one_div_pow hr, hpos⟩ + have hinv := hwithin.inv_tendsto_nhdsGT_zero + change Tendsto (fun n : ℕ => (((n : ℝ) + 1) / r ^ n)⁻¹) atTop atTop at hinv + simpa only [inv_div] using hinv + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/DyadicPowers.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/DyadicPowers.lean new file mode 100644 index 0000000000000000000000000000000000000000..a5fa0904133033881a6fb20fc16bbcd5939fd76c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/DyadicPowers.lean @@ -0,0 +1,69 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Analysis.SpecificLimits.Normed +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +namespace PiExponent + + theorem dyadic_block_bound_algebra {c K nu : ℝ} (hc : 0 < c) (hK : 0 < K) : + 4 / (K ^ 3 * (c * (2 * K) ^ (1 - nu)) ^ 2) = + (4 / (c ^ 2 * (2 : ℝ) ^ (2 * (1 - nu)))) * K ^ (2 * nu - 5) := by + have hsq (x : ℝ) (hx : 0 ≤ x) : + (x ^ (1 - nu)) ^ (2 : ℕ) = x ^ (2 * (1 - nu)) := by + rw [← Real.rpow_natCast, ← Real.rpow_mul hx] + congr 1 + ring + have hprod : K ^ (3 : ℕ) * K ^ (2 * (1 - nu)) = K ^ (5 - 2 * nu) := by + rw [← Real.rpow_natCast, ← Real.rpow_add hK] + congr 1 + ring + have hden : K ^ 3 * (c * (2 * K) ^ (1 - nu)) ^ 2 = + (c ^ 2 * (2 : ℝ) ^ (2 * (1 - nu))) * K ^ (5 - 2 * nu) := by + rw [Real.mul_rpow (by norm_num : (0 : ℝ) ≤ 2) hK.le, mul_pow, mul_pow, + hsq 2 (by norm_num), hsq K hK.le] + calc + _ = (c ^ 2 * (2 : ℝ) ^ (2 * (1 - nu))) * + (K ^ 3 * K ^ (2 * (1 - nu))) := by ring + _ = _ := by rw [hprod] + have hcoeff : c ^ 2 * (2 : ℝ) ^ (2 * (1 - nu)) ≠ 0 := + (mul_pos (pow_pos hc 2) (Real.rpow_pos_of_pos (by norm_num) _)).ne' + have hKpow : K ^ (5 - 2 * nu) ≠ 0 := (Real.rpow_pos_of_pos hK _).ne' + rw [hden] + apply (div_eq_iff (mul_ne_zero hcoeff hKpow)).2 + rw [mul_mul_mul_comm, div_mul_cancel₀ _ hcoeff, ← Real.rpow_add hK] + have hexponent : 2 * nu - 5 + (5 - 2 * nu) = 0 := by ring + rw [hexponent, Real.rpow_zero, mul_one] + + theorem dyadic_rpow_eq_geometric (nu : ℝ) (k : ℕ) : + ((2 : ℝ) ^ k) ^ (2 * nu - 5) = ((2 : ℝ) ^ (2 * nu - 5)) ^ k := by + rw [← Real.rpow_natCast, ← Real.rpow_mul (by norm_num : (0 : ℝ) ≤ 2), + mul_comm, Real.rpow_mul (by norm_num : (0 : ℝ) ≤ 2), Real.rpow_natCast] + + theorem dyadic_geometric_ratio_pos (nu : ℝ) : + 0 < (2 : ℝ) ^ (2 * nu - 5) := Real.rpow_pos_of_pos (by norm_num) _ + + theorem dyadic_geometric_ratio_lt_one {nu : ℝ} (hnu : nu < 5 / 2) : + (2 : ℝ) ^ (2 * nu - 5) < 1 := by + apply Real.rpow_lt_one_of_one_lt_of_neg + · norm_num + · linarith + + theorem summable_dyadic_block_bound {c nu : ℝ} (hc : 0 < c) (hnu : nu < 5 / 2) : + Summable (fun k : ℕ => + 4 / (((2 : ℝ) ^ k) ^ (3 : ℕ) * + (c * (2 * (2 : ℝ) ^ k) ^ (1 - nu)) ^ (2 : ℕ))) := by + have hg := summable_geometric_of_lt_one (dyadic_geometric_ratio_pos nu).le + (dyadic_geometric_ratio_lt_one hnu) + have hm := hg.mul_left (4 / (c ^ 2 * (2 : ℝ) ^ (2 * (1 - nu)))) + apply hm.congr + intro k + rw [dyadic_block_bound_algebra hc (pow_pos (by norm_num) k), + dyadic_rpow_eq_geometric] + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/DyadicSpacing.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/DyadicSpacing.lean new file mode 100644 index 0000000000000000000000000000000000000000..0fb0694c77dedfb003fe50055024c5f4e1482c50 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/DyadicSpacing.lean @@ -0,0 +1,161 @@ +import Mathlib.Algebra.Order.BigOperators.Group.Finset +import Mathlib.Data.Finset.Interval +import Mathlib.Tactic.FieldSimp +import OAI.NumberTheory.PiExponent.Analysis.DyadicPowers +import OAI.NumberTheory.PiExponent.Analysis.DyadicSummation +import OAI.NumberTheory.PiExponent.Analysis.FiniteSpacing +import OAI.NumberTheory.PiExponent.Analysis.FlintHills + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace PiExponent + +def centeredResidue (alpha : ℝ) (q : ℕ) : ℝ := + (q : ℝ) * alpha - (round ((q : ℝ) * alpha) : ℝ) + +theorem abs_centeredResidue (alpha : ℝ) (q : ℕ) : + |centeredResidue alpha q| = integerDistance ((q : ℝ) * alpha) := rfl + +theorem integerDistance_sub_le (x y : ℝ) : + integerDistance (x - y) ≤ |(x - (round x : ℝ)) - (y - (round y : ℝ))| := by + have h := integerDistance_le (x - y) (round x - round y) + push_cast at h + convert h using 1 + congr 1 + ring + +theorem centeredResidue_separation {alpha c nu : ℝ} (hc : 0 < c) (hnu : 1 < nu) + (hlower : ∀ q : ℕ, 0 < q → + c * (q : ℝ) ^ (1 - nu) ≤ integerDistance ((q : ℝ) * alpha)) + {K q r : ℕ} (hq : q ∈ Finset.Ico K (2 * K)) + (hr : r ∈ Finset.Ico K (2 * K)) (hqr : q < r) : + c * (2 * (K : ℝ)) ^ (1 - nu) ≤ + |centeredResidue alpha r - centeredResidue alpha q| := by + have hdiff : 0 < r - q := Nat.sub_pos_of_lt hqr + have hdiffR : (0 : ℝ) < (r - q : ℕ) := by exact_mod_cast hdiff + have hdiffle : ((r - q : ℕ) : ℝ) ≤ 2 * (K : ℝ) := by + have hqK := (Finset.mem_Ico.mp hq).1 + have hrK := (Finset.mem_Ico.mp hr).2 + have hlt : r - q < K := by omega + exact_mod_cast hlt.le.trans (by omega : K ≤ 2 * K) + have hpower := Real.rpow_le_rpow_of_nonpos hdiffR hdiffle (by linarith : 1 - nu ≤ 0) + have hsep := integerDistance_sub_le ((r : ℝ) * alpha) ((q : ℝ) * alpha) + have hcast : ((r - q : ℕ) : ℝ) * alpha = (r : ℝ) * alpha - (q : ℝ) * alpha := by + rw [Nat.cast_sub hqr.le] + ring + calc + c * (2 * (K : ℝ)) ^ (1 - nu) ≤ c * ((r - q : ℕ) : ℝ) ^ (1 - nu) := + mul_le_mul_of_nonneg_left hpower hc.le + _ ≤ integerDistance (((r - q : ℕ) : ℝ) * alpha) := hlower (r - q) hdiff + _ ≤ |centeredResidue alpha r - centeredResidue alpha q| := by + rw [hcast] + exact hsep + +theorem integerDistance_block_lower {alpha c nu : ℝ} (hc : 0 < c) (hnu : 1 < nu) + (hlower : ∀ q : ℕ, 0 < q → + c * (q : ℝ) ^ (1 - nu) ≤ integerDistance ((q : ℝ) * alpha)) + {K q : ℕ} (hK : 0 < K) (hq : q ∈ Finset.Ico K (2 * K)) : + c * (2 * (K : ℝ)) ^ (1 - nu) ≤ integerDistance ((q : ℝ) * alpha) := by + have hqpos : 0 < q := hK.trans_le (Finset.mem_Ico.mp hq).1 + have hqR : (0 : ℝ) < q := by exact_mod_cast hqpos + have hqle : (q : ℝ) ≤ 2 * (K : ℝ) := by exact_mod_cast (Finset.mem_Ico.mp hq).2.le + exact (mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow_of_nonpos hqR hqle (by linarith : 1 - nu ≤ 0)) hc.le).trans + (hlower q hqpos) + +theorem integerDistance_block_sum {alpha c nu : ℝ} (hc : 0 < c) (hnu : 1 < nu) + (hlower : ∀ q : ℕ, 0 < q → + c * (q : ℝ) ^ (1 - nu) ≤ integerDistance ((q : ℝ) * alpha)) + {K : ℕ} (hK : 0 < K) : + (∑ q ∈ Finset.Ico K (2 * K), 1 / (integerDistance ((q : ℝ) * alpha)) ^ 2) ≤ + 4 / (c * (2 * (K : ℝ)) ^ (1 - nu)) ^ 2 := by + classical + let rows := Finset.Ico K (2 * K) + let d : ℝ := c * (2 * (K : ℝ)) ^ (1 - nu) + have hd : 0 < d := by dsimp [d]; positivity + have hmin : ∀ q ∈ rows, d ≤ integerDistance ((q : ℝ) * alpha) := + fun q hq => integerDistance_block_lower hc hnu hlower hK hq + have hsep : ∀ q ∈ rows, ∀ r ∈ rows, q ≠ r → + d ≤ |centeredResidue alpha q - centeredResidue alpha r| := by + intro q hq r hr hqr + rcases lt_or_gt_of_ne hqr with hqr | hrq + · simpa only [abs_sub_comm] using centeredResidue_separation hc hnu hlower hq hr hqr + · exact centeredResidue_separation hc hnu hlower hr hq hrq + have hpos := FiniteSpacing.sum_inv_sq_le_two_div_sq_indexed + (rows.filter fun q => 0 ≤ centeredResidue alpha q) + (fun q => integerDistance ((q : ℝ) * alpha)) hd + (fun q hq => hmin q (Finset.mem_filter.mp hq).1) + (by + intro q hq r hr hqr + change d ≤ abs (abs (centeredResidue alpha q) - abs (centeredResidue alpha r)) + rw [abs_of_nonneg (Finset.mem_filter.mp hq).2, + abs_of_nonneg (Finset.mem_filter.mp hr).2] + exact hsep q (Finset.mem_filter.mp hq).1 r (Finset.mem_filter.mp hr).1 hqr) + have hneg := FiniteSpacing.sum_inv_sq_le_two_div_sq_indexed + (rows.filter fun q => ¬ 0 ≤ centeredResidue alpha q) + (fun q => integerDistance ((q : ℝ) * alpha)) hd + (fun q hq => hmin q (Finset.mem_filter.mp hq).1) + (by + intro q hq r hr hqr + change d ≤ abs (abs (centeredResidue alpha q) - abs (centeredResidue alpha r)) + rw [abs_of_neg (lt_of_not_ge (Finset.mem_filter.mp hq).2), + abs_of_neg (lt_of_not_ge (Finset.mem_filter.mp hr).2), neg_sub_neg, abs_sub_comm] + exact hsep q (Finset.mem_filter.mp hq).1 r (Finset.mem_filter.mp hr).1 hqr) + change (∑ q ∈ rows, 1 / (integerDistance ((q : ℝ) * alpha)) ^ 2) ≤ 4 / d ^ 2 + rw [← Finset.sum_filter_add_sum_filter_not rows (fun q => 0 ≤ centeredResidue alpha q)] + calc + _ ≤ 2 / d ^ 2 + 2 / d ^ 2 := add_le_add hpos hneg + _ = _ := by ring + +theorem inverse_cube_integerDistance_block_sum {alpha c nu : ℝ} + (hc : 0 < c) (hnu : 1 < nu) + (hlower : ∀ q : ℕ, 0 < q → + c * (q : ℝ) ^ (1 - nu) ≤ integerDistance ((q : ℝ) * alpha)) + {K : ℕ} (hK : 0 < K) : + (∑ q ∈ Finset.Ico K (2 * K), + 1 / ((q : ℝ) ^ 3 * (integerDistance ((q : ℝ) * alpha)) ^ 2)) ≤ + 4 / ((K : ℝ) ^ 3 * (c * (2 * (K : ℝ)) ^ (1 - nu)) ^ 2) := by + have hKR : (0 : ℝ) < K := by exact_mod_cast hK + calc + _ ≤ ∑ q ∈ Finset.Ico K (2 * K), + (1 / (K : ℝ) ^ 3) * (1 / (integerDistance ((q : ℝ) * alpha)) ^ 2) := by + apply Finset.sum_le_sum + intro q hq + have hKq : (K : ℝ) ≤ q := by exact_mod_cast (Finset.mem_Ico.mp hq).1 + have hdist : 0 < integerDistance ((q : ℝ) * alpha) := + (mul_pos hc (Real.rpow_pos_of_pos (by positivity) _)).trans_le + (integerDistance_block_lower hc hnu hlower hK hq) + rw [one_div_mul_one_div] + exact div_le_div_of_nonneg_left (by norm_num) (by positivity) + (mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hKR.le hKq 3) (sq_nonneg _)) + _ = (1 / (K : ℝ) ^ 3) * + ∑ q ∈ Finset.Ico K (2 * K), 1 / (integerDistance ((q : ℝ) * alpha)) ^ 2 := by + rw [Finset.mul_sum] + _ ≤ (1 / (K : ℝ) ^ 3) * (4 / (c * (2 * (K : ℝ)) ^ (1 - nu)) ^ 2) := + mul_le_mul_of_nonneg_left (integerDistance_block_sum hc hnu hlower hK) (by positivity) + _ = _ := by ring + +theorem summable_inverse_cube_integerDistance {alpha c nu : ℝ} + (hc : 0 < c) (hnu1 : 1 < nu) (hnu2 : nu < 5 / 2) + (hlower : ∀ q : ℕ, 0 < q → + c * (q : ℝ) ^ (1 - nu) ≤ integerDistance ((q : ℝ) * alpha)) : + Summable (fun q : ℕ => + 1 / ((q : ℝ) ^ 3 * (integerDistance ((q : ℝ) * alpha)) ^ 2)) := by + apply summable_of_dyadic_blocks (fun q hq => by positivity) + (summable_dyadic_block_bound hc hnu2) + intro k + have hblock := inverse_cube_integerDistance_block_sum hc hnu1 hlower + (pow_pos (by norm_num : (0 : ℕ) < 2) k) + have hend : 2 * 2 ^ k = 2 ^ (k + 1) := by rw [pow_succ, Nat.mul_comm] + rw [hend] at hblock + simpa only [Nat.cast_pow, Nat.cast_ofNat] using hblock + +end PiExponent + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/DyadicSummation.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/DyadicSummation.lean new file mode 100644 index 0000000000000000000000000000000000000000..358523213a42b5add3f8df12faa77f232c1f19a4 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/DyadicSummation.lean @@ -0,0 +1,65 @@ +import Mathlib.Algebra.BigOperators.Intervals +import Mathlib.Analysis.Normed.Group.InfiniteSum +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Topology.Algebra.InfiniteSum.Real + +namespace OAI + +open Finset + +namespace PiExponent + +theorem sum_range_two_pow_eq_dyadic (f : ℕ → ℝ) (k : ℕ) : + ∑ q ∈ range (2 ^ k), f q = + f 0 + ∑ j ∈ range k, ∑ q ∈ Ico (2 ^ j) (2 ^ (j + 1)), f q := by + induction k with + | zero => simp + | succ k ih => + have hk : 2 ^ k ≤ 2 ^ (k + 1) := + Nat.pow_le_pow_right (by decide) (Nat.le_succ k) + rw [← sum_range_add_sum_Ico f hk, ih, sum_range_succ] + rw [add_assoc] + +theorem summable_of_dyadic_norm_blocks {f g : ℕ → ℝ} + (hg : Summable g) + (hblock : ∀ k, ∑ q ∈ Ico (2 ^ k) (2 ^ (k + 1)), ‖f q‖ ≤ g k) : + Summable f := by + have hg0 : ∀ k, 0 ≤ g k := fun k => + (sum_nonneg fun _ _ => norm_nonneg _).trans (hblock k) + apply Summable.of_norm + apply summable_of_sum_range_le (fun _ => norm_nonneg _) (c := ‖f 0‖ + ∑' k, g k) + intro n + calc + ∑ q ∈ range n, ‖f q‖ ≤ ∑ q ∈ range (2 ^ n), ‖f q‖ := + sum_le_sum_of_subset_of_nonneg (range_mono (Nat.le_of_lt n.lt_two_pow_self)) + (fun _ _ _ => norm_nonneg _) + _ = ‖f 0‖ + ∑ k ∈ range n, ∑ q ∈ Ico (2 ^ k) (2 ^ (k + 1)), ‖f q‖ := + sum_range_two_pow_eq_dyadic _ _ + _ ≤ ‖f 0‖ + ∑ k ∈ range n, g k := + add_le_add le_rfl (sum_le_sum fun k _ => hblock k) + _ ≤ ‖f 0‖ + ∑' k, g k := + add_le_add le_rfl (hg.sum_le_tsum (range n) (fun k _ => hg0 k)) + +theorem summable_of_dyadic_blocks {f g : ℕ → ℝ} + (hf : ∀ q, 0 < q → 0 ≤ f q) (hg : Summable g) + (hblock : ∀ k, ∑ q ∈ Ico (2 ^ k) (2 ^ (k + 1)), f q ≤ g k) : + Summable f := by + apply summable_of_dyadic_norm_blocks hg + intro k + calc + ∑ q ∈ Ico (2 ^ k) (2 ^ (k + 1)), ‖f q‖ = + ∑ q ∈ Ico (2 ^ k) (2 ^ (k + 1)), f q := by + apply sum_congr rfl + intro q hq + exact Real.norm_of_nonneg (hf q ((pow_pos (by decide) k).trans_le (mem_Ico.mp hq).1)) + _ ≤ g k := hblock k + +theorem summable_of_dyadic_geometric {f : ℕ → ℝ} {M r : ℝ} + (hf : ∀ q, 0 < q → 0 ≤ f q) (hr0 : 0 ≤ r) (hr1 : r < 1) + (hblock : ∀ k, ∑ q ∈ Ico (2 ^ k) (2 ^ (k + 1)), f q ≤ M * r ^ k) : + Summable f := + summable_of_dyadic_blocks hf ((summable_geometric_of_lt_one hr0 hr1).mul_left M) hblock + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/FiniteDeterminantCollision.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/FiniteDeterminantCollision.lean new file mode 100644 index 0000000000000000000000000000000000000000..4302093d17bf5e50dc782dfa28e732f83bb10649 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/FiniteDeterminantCollision.lean @@ -0,0 +1,116 @@ +import Mathlib +import OAI.NumberTheory.PiExponent.Analysis.CollisionGeometricSum + +namespace OAI + +open scoped BigOperators + +namespace PiExponent.FiniteDeterminantCollision + +theorem det_finite_row_sum {ι κ δ : Type*} [Fintype ι] [DecidableEq ι] + [Fintype δ] (group : ι → κ) (B : ι → δ → ℂ) (C : κ → δ → ι → ℂ) : + Matrix.det (fun i j => ∑ d, B i d * C (group i) d j) = + ∑ f : ι → δ, (∏ i, B i (f i)) * + Matrix.det (fun i j => C (group i) (f i) j) := by + classical + have hm := (Matrix.detRowAlternating : (ι → ℂ) [⋀^ι]→ₗ[ℂ] ℂ).toMultilinearMap.map_sum + (fun i d => B i d • C (group i) d) + calc + _ = Matrix.det (fun i => ∑ d, B i d • C (group i) d) := by + congr 1 + funext i j + simp + _ = ∑ f : ι → δ, Matrix.det (fun i => B i (f i) • C (group i) (f i)) := hm + _ = _ := by + apply Finset.sum_congr rfl + intro f _ + exact Matrix.det_mul_column (fun i => B i (f i)) (fun i j => C (group i) (f i) j) + +theorem norm_det_le_factorial_mul_pow {ι : Type*} [Fintype ι] [DecidableEq ι] + (A : Matrix ι ι ℂ) {D : ℝ} (hD : 0 ≤ D) (hA : ∀ i j, ‖A i j‖ ≤ D) : + ‖A.det‖ ≤ (Fintype.card ι).factorial * D ^ Fintype.card ι := by + rw [Matrix.det_apply] + calc + _ ≤ ∑ σ : Equiv.Perm ι, ‖σ.sign • ∏ i, A (σ i) i‖ := norm_sum_le _ _ + _ = ∑ σ : Equiv.Perm ι, ∏ i, ‖A (σ i) i‖ := by + apply Finset.sum_congr rfl + intro σ _ + rcases Int.units_eq_one_or σ.sign with hs | hs <;> simp [hs, norm_prod] + _ ≤ ∑ _σ : Equiv.Perm ι, D ^ Fintype.card ι := by + apply Finset.sum_le_sum + intro σ _ + calc + _ ≤ ∏ _index : ι, |D| := Finset.prod_le_prod₀ + (fun index _ => norm_nonneg _) + (fun index _ => (hA (σ index) index).trans (le_abs_self D)) + _ = D ^ Fintype.card ι := by simp [abs_of_nonneg hD] + _ = _ := by simp [Fintype.card_perm] + +theorem finite_collision_bound + {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] + (group : ι → κ) (B : ι → ℕ → ℂ) (C : κ → ℕ → ι → ℂ) + (D s : ℝ) (L : ι → ℝ) (hD : 0 ≤ D) (hs0 : 0 ≤ s) (hs1 : s < 1) + (hL : ∀ i, 0 ≤ L i) + (hC : ∀ a d j, ‖C a d j‖ ≤ D) + (hB : ∀ i d, ‖B i d‖ ≤ L i * (s * s) ^ d) (N : ℕ) : + ‖Matrix.det (fun i j => ∑ d : Fin N, B i d * C (group i) d j)‖ ≤ + ((Fintype.card ι).factorial * D ^ Fintype.card ι * (∏ i, L i)) * + s ^ (∑ a, (Collision.multiplicity Finset.univ group a).choose 2) * + ((1 - s)⁻¹) ^ Fintype.card ι := by + classical + let good := (Finset.univ : Finset (ι → Fin N)).filter + (fun f => Function.Injective (fun i => (group i, (f i : ℕ)))) + let Q := (Fintype.card ι).factorial * D ^ Fintype.card ι * (∏ i, L i) + have hQ : 0 ≤ Q := + mul_nonneg (mul_nonneg (Nat.cast_nonneg _) (pow_nonneg hD _)) + (Finset.prod_nonneg fun i _ => hL i) + have hexpand : Matrix.det (fun i j => ∑ d : Fin N, B i d * C (group i) d j) = + ∑ f ∈ good, (∏ i, B i (f i)) * Matrix.det (fun i j => C (group i) (f i) j) := by + rw [det_finite_row_sum group (fun i (d : Fin N) => B i d) + (fun a (d : Fin N) j => C a d j)] + symm + apply Finset.sum_subset (Finset.filter_subset _ _) + intro f _ hf + have hn : ¬ Function.Injective (fun i => (group i, (f i : ℕ))) := by + simpa [good] using hf + obtain ⟨i, j, hij, hne⟩ := Function.not_injective_iff.mp hn + have hg : group i = group j := congrArg Prod.fst hij + have hd : (f i : ℕ) = (f j : ℕ) := congrArg Prod.snd hij + have hz : Matrix.det (fun r c => C (group r) (f r) c) = 0 := by + apply Matrix.det_zero_of_row_eq hne + funext c + simp only [hg, hd] + simp [hz] + have hterm (f : ι → Fin N) : + ‖(∏ i, B i (f i)) * Matrix.det (fun i j => C (group i) (f i) j)‖ ≤ + Q * (s * s) ^ (∑ i, (f i : ℕ)) := by + have hbp : (∏ i, ‖B i (f i)‖) ≤ ∏ i, L i * (s * s) ^ (f i : ℕ) := + Finset.prod_le_prod₀ (fun i _ => norm_nonneg _) (fun i _ => hB i (f i)) + have hcp := norm_det_le_factorial_mul_pow + (fun i j => C (group i) (f i) j) hD (fun i j => hC _ _ _) + rw [norm_mul, norm_prod] + calc + _ ≤ (∏ i, L i * (s * s) ^ (f i : ℕ)) * + ((Fintype.card ι).factorial * D ^ Fintype.card ι) := + mul_le_mul hbp hcp (norm_nonneg _) (Finset.prod_nonneg fun i _ => + mul_nonneg (hL i) (pow_nonneg (mul_self_nonneg s) _)) + _ = _ := by + rw [Finset.prod_mul_distrib, Finset.prod_pow_eq_pow_sum] + dsimp [Q] + ring + rw [hexpand] + calc + _ ≤ ∑ f ∈ good, + ‖(∏ i, B i (f i)) * Matrix.det (fun i j => C (group i) (f i) j)‖ := + norm_sum_le _ _ + _ ≤ ∑ f ∈ good, Q * (s * s) ^ (∑ i, (f i : ℕ)) := + Finset.sum_le_sum (fun f _ => hterm f) + _ = Q * ∑ f ∈ good, (s * s) ^ (∑ i, (f i : ℕ)) := by rw [Finset.mul_sum] + _ ≤ Q * (s ^ (∑ a, (Collision.multiplicity Finset.univ group a).choose 2) * + ((1 - s)⁻¹) ^ Fintype.card ι) := + mul_le_mul_of_nonneg_left (Collision.collision_geometric_sum_le group hs0 hs1 N) hQ + _ = _ := by dsimp [Q]; ring + +end PiExponent.FiniteDeterminantCollision + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/FiniteSpacing.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/FiniteSpacing.lean new file mode 100644 index 0000000000000000000000000000000000000000..5457e7e24f9074974c566826eac066b929bbfe43 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/FiniteSpacing.lean @@ -0,0 +1,124 @@ +import Mathlib + +namespace OAI + +open scoped BigOperators + +namespace PiExponent.FiniteSpacing + +theorem lower_bound_of_spacing {N : ℕ} (x : Fin N → ℝ) {d : ℝ} + (hmin : ∀ i, d ≤ x i) + (hsep : ∀ i j, i < j → d ≤ x j - x i) : + ∀ i, ((i.val : ℝ) + 1) * d ≤ x i := by + have aux : ∀ k (hk : k < N), ((k : ℝ) + 1) * d ≤ x ⟨k, hk⟩ := by + intro k + induction k with + | zero => + intro hk + simpa using hmin ⟨0, hk⟩ + | succ k ih => + intro hk + have hk' : k < N := Nat.lt_trans (Nat.lt_succ_self k) hk + have hp := ih hk' + have hs := hsep ⟨k, hk'⟩ ⟨k + 1, hk⟩ (by simp) + push_cast + linarith + intro i + exact aux i.val i.isLt + +theorem sum_inv_succ_sq_le_two_sub (N : ℕ) : + (∑ k ∈ Finset.range N, 1 / ((k : ℝ) + 1) ^ 2) ≤ + 2 - 2 / ((N : ℝ) + 1) := by + induction N with + | zero => norm_num + | succ N ih => + rw [Finset.sum_range_succ] + have hN : (0 : ℝ) ≤ N := Nat.cast_nonneg _ + have hN1 : (0 : ℝ) < (N : ℝ) + 1 := by positivity + have hN2 : (0 : ℝ) < (N : ℝ) + 2 := by positivity + have hterm : 1 / ((N : ℝ) + 1) ^ 2 ≤ + 2 / ((N : ℝ) + 1) - 2 / ((N : ℝ) + 2) := by + field_simp + nlinarith + push_cast + convert add_le_add ih hterm using 1 + ring + +theorem sum_inv_succ_sq_le_two (N : ℕ) : + (∑ k ∈ Finset.range N, 1 / ((k : ℝ) + 1) ^ 2) ≤ 2 := by + have h := sum_inv_succ_sq_le_two_sub N + have hnonneg : 0 ≤ 2 / ((N : ℝ) + 1) := by positivity + linarith + +theorem sum_inv_sq_le_two_div_sq_of_spacing {N : ℕ} + (x : Fin N → ℝ) {d : ℝ} (hd : 0 < d) + (hmin : ∀ i, d ≤ x i) + (hsep : ∀ i j, i < j → d ≤ x j - x i) : + (∑ i, 1 / (x i) ^ 2) ≤ 2 / d ^ 2 := by + have hlower := lower_bound_of_spacing x hmin hsep + calc + (∑ i, 1 / (x i) ^ 2) ≤ + ∑ i : Fin N, 1 / ((((i.val : ℝ) + 1) * d) ^ 2) := by + apply Finset.sum_le_sum + intro i _ + have hpos : 0 < ((i.val : ℝ) + 1) * d := by positivity + exact one_div_le_one_div_of_le (sq_pos_of_pos hpos) + (pow_le_pow_left₀ hpos.le (hlower i) 2) + _ = (1 / d ^ 2) * ∑ i : Fin N, 1 / ((i.val : ℝ) + 1) ^ 2 := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + rw [mul_pow, one_div_mul_one_div] + ring + _ ≤ (1 / d ^ 2) * 2 := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + rw [Fin.sum_univ_eq_sum_range (fun k : ℕ => 1 / ((k : ℝ) + 1) ^ 2)] + exact sum_inv_succ_sq_le_two N + _ = 2 / d ^ 2 := by ring + +theorem sum_inv_sq_le_two_div_sq (s : Finset ℝ) {d : ℝ} (hd : 0 < d) + (hmin : ∀ x ∈ s, d ≤ x) + (hsep : ∀ x ∈ s, ∀ y ∈ s, x ≠ y → d ≤ |x - y|) : + (∑ x ∈ s, 1 / x ^ 2) ≤ 2 / d ^ 2 := by + classical + let e := s.orderEmbOfFin rfl + have hmem : ∀ i, e i ∈ s := fun i => s.orderEmbOfFin_mem rfl i + have hstep : ∀ i j, i < j → d ≤ e j - e i := by + intro i j hij + have hij' : e i < e j := e.strictMono hij + have h := hsep (e j) (hmem j) (e i) (hmem i) (ne_of_gt hij') + rwa [abs_of_pos (sub_pos.mpr hij')] at h + have hbound := sum_inv_sq_le_two_div_sq_of_spacing e hd + (fun i => hmin (e i) (hmem i)) hstep + have hsum : (∑ i : Fin s.card, 1 / (e i) ^ 2) = ∑ x ∈ s, 1 / x ^ 2 := by + have himage : Finset.univ.image e = s := s.image_orderEmbOfFin_univ rfl + calc + _ = ∑ y ∈ Finset.univ.image e, 1 / y ^ 2 := + (Finset.sum_image e.injective.injOn).symm + _ = _ := congrArg (fun t : Finset ℝ => ∑ y ∈ t, 1 / y ^ 2) himage + rwa [hsum] at hbound + +theorem sum_inv_sq_le_two_div_sq_indexed {ι : Type*} + (rows : Finset ι) (x : ι → ℝ) {d : ℝ} (hd : 0 < d) + (hmin : ∀ i ∈ rows, d ≤ x i) + (hsep : ∀ i ∈ rows, ∀ j ∈ rows, i ≠ j → d ≤ |x i - x j|) : + (∑ i ∈ rows, 1 / (x i) ^ 2) ≤ 2 / d ^ 2 := by + classical + have hinj : Set.InjOn x (rows : Set ι) := by + intro i hi j hj h + by_contra hij + have hs := hsep i hi j hj hij + rw [h, sub_self, abs_zero] at hs + exact (not_le_of_gt hd) hs + have h := sum_inv_sq_le_two_div_sq (rows.image x) hd + (by intro a ha; obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp ha; exact hmin i hi) + (by + intro a ha b hb hab + obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp ha + obtain ⟨j, hj, rfl⟩ := Finset.mem_image.mp hb + exact hsep i hi j hj (fun hij => hab (congrArg x hij))) + rwa [Finset.sum_image hinj] at h + +end PiExponent.FiniteSpacing + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/FlintConsequence.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/FlintConsequence.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd10d7e3738236350386e3b29b10ef80574f19e2 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/FlintConsequence.lean @@ -0,0 +1,31 @@ +import OAI.NumberTheory.PiExponent.Analysis.DyadicSpacing +import OAI.NumberTheory.PiExponent.Analysis.FlintSine +import OAI.NumberTheory.PiExponent.Statement + +namespace OAI + +namespace PiExponent + +theorem uniform_pi_distance_of_eventual_lower_bound (h : PiEventualLowerBound) + {ν : ℝ} (hν : 2 < ν) : + ∃ c : ℝ, 0 < c ∧ c ≤ 1 ∧ ∀ q : ℕ, 0 < q → + c * (q : ℝ) ^ (1 - ν) ≤ integerDistance (q * Real.pi) := by + obtain ⟨Q, hQ, hbound⟩ := h ν hν + apply uniform_integerDistance_lower_bound irrational_pi + exact ⟨Q, fun q hq _ p => hbound p q hq⟩ + +theorem flintHills_summable_of_eventual_lower_bound (h : PiEventualLowerBound) : + Summable (fun n : ℕ => 1 / ((n : ℝ) ^ 3 * Real.sin n ^ 2)) := by + obtain ⟨c, hc, _, hbound⟩ := + uniform_pi_distance_of_eventual_lower_bound h (ν := 9 / 4) (by norm_num) + exact flintHills_summable_of_distance_summable + (summable_inverse_cube_integerDistance hc (by norm_num) (by norm_num) hbound) + +theorem flintHills_positive_summable_of_eventual_lower_bound (h : PiEventualLowerBound) : + Summable (fun n : ℕ => + 1 / (((n + 1 : ℕ) : ℝ) ^ 3 * Real.sin (n + 1 : ℕ) ^ 2)) := + (summable_nat_add_iff 1).mpr (flintHills_summable_of_eventual_lower_bound h) + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/FlintHills.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/FlintHills.lean new file mode 100644 index 0000000000000000000000000000000000000000..05d73992e345d775ba1e060db8df627c641049ff --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/FlintHills.lean @@ -0,0 +1,89 @@ +import Mathlib.Algebra.Order.Round +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.NumberTheory.Real.Irrational +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +namespace PiExponent + +noncomputable def integerDistance (x : ℝ) : ℝ := |x - (round x : ℝ)| + +theorem integerDistance_nonneg (x : ℝ) : 0 ≤ integerDistance x := abs_nonneg _ + +theorem integerDistance_le (x : ℝ) (p : ℤ) : integerDistance x ≤ |x - p| := + round_le x p + +theorem integerDistance_le_half (x : ℝ) : integerDistance x ≤ 1 / 2 := + abs_sub_round x + +theorem integerDistance_mul_pos {α : ℝ} (hα : Irrational α) {q : ℕ} + (hq : 0 < q) : 0 < integerDistance (q * α) := by + exact abs_pos.mpr (sub_ne_zero.mpr ((hα.natCast_mul hq.ne').ne_int _)) + +theorem finite_relative_lower_bound (f g : ℕ → ℝ) + (hf : ∀ n, 0 < f n) (hg : ∀ n, 0 < g n) (N : ℕ) : + ∃ c : ℝ, 0 < c ∧ c ≤ 1 ∧ ∀ n < N, c * g n ≤ f n := by + induction N with + | zero => exact ⟨1, zero_lt_one, le_rfl, by simp⟩ + | succ N ih => + rcases ih with ⟨c, hc, hc1, hbound⟩ + refine ⟨min c (f N / g N), lt_min hc (div_pos (hf N) (hg N)), + (min_le_left _ _).trans hc1, ?_⟩ + intro n hn + rcases Nat.lt_succ_iff_lt_or_eq.mp hn with hn | rfl + · exact (mul_le_mul_of_nonneg_right (min_le_left _ _) (hg n).le).trans (hbound n hn) + · exact (le_div_iff₀ (hg n)).mp (min_le_right _ _) + +theorem uniform_relative_lower_bound (f g : ℕ → ℝ) + (hf : ∀ n, 0 < f n) (hg : ∀ n, 0 < g n) + (htail : ∃ N : ℕ, ∀ n, N ≤ n → g n ≤ f n) : + ∃ c : ℝ, 0 < c ∧ c ≤ 1 ∧ ∀ n, c * g n ≤ f n := by + rcases htail with ⟨N, hN⟩ + rcases finite_relative_lower_bound f g hf hg N with ⟨c, hc, hc1, hbound⟩ + refine ⟨c, hc, hc1, fun n => ?_⟩ + by_cases hn : n < N + · exact hbound n hn + · exact (mul_le_of_le_one_left (hg n).le hc1).trans (hN n (Nat.le_of_not_gt hn)) + +theorem integerDistance_lower_bound {α ν : ℝ} {q : ℕ} (hq : 0 < q) + (h : ∀ p : ℤ, (q : ℝ) ^ (-ν) ≤ |α - p / (q : ℝ)|) : + (q : ℝ) ^ (1 - ν) ≤ integerDistance (q * α) := by + have hqR : (0 : ℝ) < q := by exact_mod_cast hq + have hh := mul_le_mul_of_nonneg_left (h (round ((q : ℝ) * α))) hqR.le + have heq : (q : ℝ) * |α - (round ((q : ℝ) * α) : ℝ) / q| = + integerDistance (q * α) := by + calc + _ = |(q : ℝ) * (α - (round ((q : ℝ) * α) : ℝ) / q)| := by + rw [abs_mul, abs_of_pos hqR] + _ = integerDistance (q * α) := by + unfold integerDistance + congr 1 + field_simp + rw [heq] at hh + simpa only [sub_eq_add_neg, Real.rpow_add hqR, Real.rpow_one] using hh + +theorem uniform_integerDistance_lower_bound {α ν : ℝ} (hα : Irrational α) + (h : ∃ Q : ℕ, ∀ q : ℕ, Q ≤ q → 0 < q → + ∀ p : ℤ, (q : ℝ) ^ (-ν) ≤ |α - p / (q : ℝ)|) : + ∃ c : ℝ, 0 < c ∧ c ≤ 1 ∧ ∀ q : ℕ, 0 < q → + c * (q : ℝ) ^ (1 - ν) ≤ integerDistance (q * α) := by + let f : ℕ → ℝ := fun n => integerDistance ((n + 1 : ℕ) * α) + let g : ℕ → ℝ := fun n => ((n + 1 : ℕ) : ℝ) ^ (1 - ν) + have hf : ∀ n, 0 < f n := fun n => integerDistance_mul_pos hα (Nat.succ_pos n) + have hg : ∀ n, 0 < g n := fun n => Real.rpow_pos_of_pos (by positivity) _ + have htail : ∃ N : ℕ, ∀ n, N ≤ n → g n ≤ f n := by + rcases h with ⟨Q, hQ⟩ + exact ⟨Q, fun n hn => integerDistance_lower_bound (Nat.succ_pos n) + (hQ (n + 1) (Nat.le_trans hn (Nat.le_succ n)) (Nat.succ_pos n))⟩ + rcases uniform_relative_lower_bound f g hf hg htail with ⟨c, hc, hc1, hbound⟩ + refine ⟨c, hc, hc1, ?_⟩ + rintro (_ | q) hq + · exact False.elim (Nat.not_lt_zero _ hq) + · exact hbound q + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/FlintSine.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/FlintSine.lean new file mode 100644 index 0000000000000000000000000000000000000000..bbb8fb4a80d585556f7381b699a4cd89d01b1539 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/FlintSine.lean @@ -0,0 +1,160 @@ +import Mathlib.Analysis.Real.Pi.Bounds +import Mathlib.Analysis.Real.Pi.Irrational +import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds +import Mathlib.Topology.Algebra.InfiniteSum.ENNReal +import Mathlib.Topology.Algebra.InfiniteSum.Real +import OAI.NumberTheory.PiExponent.Analysis.FlintHills + +namespace OAI + +namespace PiExponent + +theorem sin_nat_ne_zero {n : ℕ} (hn : 0 < n) : Real.sin (n : ℝ) ≠ 0 := by + rw [Real.sin_ne_zero_iff] + intro k + by_cases hk : k = 0 + · simpa only [hk, Int.cast_zero, zero_mul, ne_eq, eq_comm, Nat.cast_eq_zero] using hn.ne' + · simpa only [Int.cast_natCast] using (irrational_pi.intCast_mul hk).ne_int (n : ℤ) + +noncomputable def sineGroup (n : ℕ) : ℕ := (round ((n : ℝ) / Real.pi)).toNat + +theorem round_div_pi_nonneg (n : ℕ) : 0 ≤ round ((n : ℝ) / Real.pi) := by + have h := sub_half_lt_round ((n : ℝ) / Real.pi) + have hn : (0 : ℝ) ≤ (n : ℝ) / Real.pi := by positivity + have hh : (-1 : ℝ) < (round ((n : ℝ) / Real.pi) : ℝ) := by linarith + have : (-1 : ℤ) < round ((n : ℝ) / Real.pi) := by exact_mod_cast hh + omega + +theorem sineGroup_cast (n : ℕ) : (sineGroup n : ℝ) = round ((n : ℝ) / Real.pi) := by + unfold sineGroup + rw [← Int.cast_natCast, Int.toNat_of_nonneg (round_div_pi_nonneg n)] + +theorem sineGroup_distance (n : ℕ) : + |(n : ℝ) - sineGroup n * Real.pi| ≤ Real.pi / 2 := by + have hh := mul_le_mul_of_nonneg_right (abs_sub_round ((n : ℝ) / Real.pi)) Real.pi_pos.le + rw [sineGroup_cast] + calc + |(n : ℝ) - (round ((n : ℝ) / Real.pi) : ℝ) * Real.pi| = + |(n : ℝ) / Real.pi - (round ((n : ℝ) / Real.pi) : ℝ)| * Real.pi := by + calc + _ = |((n : ℝ) / Real.pi - (round ((n : ℝ) / Real.pi) : ℝ)) * Real.pi| := by + congr 1 + field_simp + _ = _ := by rw [abs_mul, abs_of_pos Real.pi_pos] + _ ≤ Real.pi / 2 := by linarith + +theorem sineGroup_pos {n : ℕ} (hn : 2 ≤ n) : 0 < sineGroup n := by + have hh := sineGroup_distance n + have hlow := (abs_le.mp hh).2 + have hnR : (2 : ℝ) ≤ n := by exact_mod_cast hn + by_contra h + have hz : sineGroup n = 0 := Nat.eq_zero_of_not_pos h + rw [hz] at hlow + norm_num at hlow + linarith [Real.pi_lt_four] + +theorem sineGroup_lower {n : ℕ} (hn : 2 ≤ n) : + Real.pi * (sineGroup n : ℝ) / 2 ≤ n := by + have hh := (abs_le.mp (sineGroup_distance n)).1 + have hq : (1 : ℝ) ≤ sineGroup n := by exact_mod_cast sineGroup_pos hn + nlinarith [Real.pi_pos] + +theorem abs_sin_lower_integerDistance (n : ℕ) : + (2 / Real.pi) * integerDistance (sineGroup n * Real.pi) ≤ |Real.sin n| := by + have hs := Real.mul_abs_le_abs_sin (sineGroup_distance n) + have hd := integerDistance_le (sineGroup n * Real.pi) (n : ℤ) + have heq : |Real.sin ((n : ℝ) - (sineGroup n : ℝ) * Real.pi)| = |Real.sin n| := by + rw [Real.sin_sub_nat_mul_pi, abs_mul, abs_pow] + norm_num + rw [heq] at hs + have : integerDistance (sineGroup n * Real.pi) ≤ |(n : ℝ) - sineGroup n * Real.pi| := by + simpa only [Int.cast_natCast, abs_sub_comm] using hd + exact (mul_le_mul_of_nonneg_left this (by positivity)).trans hs + +theorem sineGroup_residue_injective : Function.Injective + (fun n : ℕ => (sineGroup n, (⟨n % 4, Nat.mod_lt n (by decide)⟩ : Fin 4))) := by + intro a b hab + have hg : sineGroup a = sineGroup b := congrArg Prod.fst hab + have hm : a % 4 = b % 4 := congrArg (fun x : ℕ × Fin 4 => (x.2 : ℕ)) hab + have ha := abs_le.mp (sineGroup_distance a) + have hb := abs_le.mp (sineGroup_distance b) + rw [hg] at ha + have habR : (a : ℝ) - b < 4 := by linarith [Real.pi_lt_four] + have hbaR : (b : ℝ) - a < 4 := by linarith [Real.pi_lt_four] + have habN : a < b + 4 := by exact_mod_cast (show (a : ℝ) < b + 4 by linarith) + have hbaN : b < a + 4 := by exact_mod_cast (show (b : ℝ) < a + 4 by linarith) + omega + +theorem flint_term_le_distance_term {n : ℕ} (hn : 2 ≤ n) : + 1 / ((n : ℝ) ^ 3 * Real.sin n ^ 2) ≤ + 4 / ((sineGroup n : ℝ) ^ 3 * integerDistance (sineGroup n * Real.pi) ^ 2) := by + have hqN := sineGroup_pos hn + have hq : (0 : ℝ) < sineGroup n := by exact_mod_cast hqN + have hnR : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) + have hd := integerDistance_mul_pos irrational_pi hqN + have hd0 := hd.le + have hs0 := abs_nonneg (Real.sin n) + have hlow := abs_sin_lower_integerDistance n + have h2 : integerDistance (sineGroup n * Real.pi) ≤ 2 * |Real.sin n| := by + have hp : 0 < Real.pi := Real.pi_pos + have hm := (div_le_iff₀ hp).mp (show + 2 * integerDistance (sineGroup n * Real.pi) / Real.pi ≤ |Real.sin n| by + simpa only [div_mul_eq_mul_div] using hlow) + nlinarith [Real.pi_lt_four] + have hs : 0 < Real.sin n ^ 2 := by + have : Real.sin n ≠ 0 := by + intro hzero + rw [hzero, abs_zero, mul_zero] at h2 + linarith + exact sq_pos_of_ne_zero this + have hqle : (sineGroup n : ℝ) ≤ n := by + have h := sineGroup_lower hn + nlinarith [Real.pi_gt_three] + have hcube := pow_le_pow_left₀ hq.le hqle 3 + have hd2 : integerDistance (sineGroup n * Real.pi) ^ 2 ≤ 4 * Real.sin n ^ 2 := by + nlinarith [sq_abs (Real.sin n), sq_nonneg (2 * |Real.sin n| - + integerDistance (sineGroup n * Real.pi))] + have hp : (sineGroup n : ℝ) ^ 3 * integerDistance (sineGroup n * Real.pi) ^ 2 ≤ + 4 * ((n : ℝ) ^ 3 * Real.sin n ^ 2) := by + calc + _ ≤ (sineGroup n : ℝ) ^ 3 * (4 * Real.sin n ^ 2) := + mul_le_mul_of_nonneg_left hd2 (by positivity) + _ ≤ (n : ℝ) ^ 3 * (4 * Real.sin n ^ 2) := + mul_le_mul_of_nonneg_right hcube (by positivity) + _ = _ := by ring + exact (div_le_div_iff₀ (mul_pos (pow_pos hnR 3) hs) + (mul_pos (pow_pos hq 3) (sq_pos_of_pos hd))).mpr (by simpa using hp) + +theorem summable_sineGroup_comp {f : ℕ → ℝ} (hf0 : ∀ n, 0 ≤ f n) + (hf : Summable f) : Summable (fun n => f (sineGroup n)) := by + have hp : Summable (fun p : ℕ × Fin 4 => f p.1) := by + apply (summable_prod_of_nonneg (fun p => hf0 p.1)).mpr + constructor + · intro n + exact Summable.of_finite + · simpa using hf.mul_left 4 + exact hp.comp_injective sineGroup_residue_injective + +theorem flintHills_summable_of_distance_summable + (h : Summable (fun q : ℕ => + 1 / ((q : ℝ) ^ 3 * integerDistance (q * Real.pi) ^ 2))) : + Summable (fun n : ℕ => 1 / ((n : ℝ) ^ 3 * Real.sin n ^ 2)) := by + have hh : Summable (fun q : ℕ => + 4 / ((q : ℝ) ^ 3 * integerDistance (q * Real.pi) ^ 2)) := by + simpa only [mul_one_div] using h.mul_left 4 + have hcomp := summable_sineGroup_comp (fun q => by positivity) hh + have htail := (summable_nat_add_iff 2).mpr hcomp + apply (summable_nat_add_iff 2).mp + exact Summable.of_nonneg_of_le (fun n => by positivity) + (fun n => flint_term_le_distance_term (show 2 ≤ n + 2 by omega)) htail + +theorem flintHills_positive_summable_of_distance_summable + (h : Summable (fun q : ℕ => + 1 / ((q : ℝ) ^ 3 * integerDistance (q * Real.pi) ^ 2))) : + Summable (fun n : ℕ => + 1 / (((n + 1 : ℕ) : ℝ) ^ 3 * Real.sin (n + 1 : ℕ) ^ 2)) := + (summable_nat_add_iff 1).mpr (flintHills_summable_of_distance_summable h) + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/FormalLogTailOrder.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/FormalLogTailOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..7b29c4eb478ba06b4d2d0850826de5b11c587932 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/FormalLogTailOrder.lean @@ -0,0 +1,65 @@ +import OAI.NumberTheory.PiExponent.Analysis.FormalLogTruncation +import OAI.NumberTheory.PiExponent.Jets.BranchContact + +namespace OAI + +noncomputable section + +namespace PiExponent.FormalBranchContact + +open FormalLogTruncation + +theorem logTail_order_ge (T : ℕ) : (T : ℕ∞) ≤ (logTail T).order := + PowerSeries.nat_le_order (logTail T) T (coeff_logTail_eq_zero T) + +theorem composed_logTail_order_ge (T : ℕ) (t : PowerSeries ℂ) + (ht : PowerSeries.constantCoeff t = 0) : + (T : ℕ∞) * t.order ≤ PowerSeries.order (PowerSeries.subst t (logTail T)) := by + calc + (T : ℕ∞) * t.order = MvPowerSeries.order t * T := by + rw [PowerSeries.order_eq_order, mul_comm] + _ ≤ MvPowerSeries.order t * (logTail T).order := + mul_le_mul_right (logTail_order_ge T) _ + _ ≤ MvPowerSeries.order (PowerSeries.subst t (logTail T)) := + PowerSeries.le_order_subst t (PowerSeries.HasSubst.of_constantCoeff_zero' ht) _ + _ = PowerSeries.order (PowerSeries.subst t (logTail T)) := PowerSeries.order_eq_order.symm + +theorem composed_logTail_strict_contact {m : ℕ} + (v : Fin (m+1) → ℚ) (hv : ∀ i, 0 < v i) + (a : Fin (m+1) → PowerSeries ℂ) (hne : ∃ i, a i ≠ 0) + (ha : ∀ i, PowerSeries.constantCoeff (a i) = 0) + (T : Fin m → ℕ) (hT : ∀ i, v i.succ < (T i : ℚ) * v 0) + (i : Fin m) (k : ℕ) + (hk : PowerSeries.order (PowerSeries.subst (a 0) (logTail (T i))) = (k : ℕ∞)) : + BranchContact.contact v a hne * v i.succ < (k : ℚ) := by + have hTi : 0 < T i := by + by_contra h + have hz : T i = 0 := by omega + have hh := hT i + rw [hz, Nat.cast_zero, zero_mul] at hh + exact (not_lt_of_ge (hv i.succ).le) hh + have hb := composed_logTail_order_ge (T i) (a 0) (ha 0) + rw [hk] at hb + have hfinite : (a 0).order ≠ ⊤ := by + intro htop + have hTi0 : (T i : ℕ∞) ≠ 0 := by exact_mod_cast hTi.ne' + simp only [htop, ENat.mul_top hTi0] at hb + simp at hb + obtain ⟨n, hn⟩ := ENat.ne_top_iff_exists.mp hfinite + rw [← hn] at hb + have hnat : T i * n ≤ k := by exact_mod_cast hb + have hcontact := BranchContact.contact_bound v hv a hne 0 n hn.symm + have hμ := BranchContact.contact_pos v hv a hne ha + calc + BranchContact.contact v a hne * v i.succ < + BranchContact.contact v a hne * ((T i : ℚ) * v 0) := + mul_lt_mul_of_pos_left (hT i) hμ + _ = (T i : ℚ) * (BranchContact.contact v a hne * v 0) := by ring + _ ≤ (T i : ℚ) * (n : ℚ) := mul_le_mul_of_nonneg_left hcontact (by positivity) + _ ≤ (k : ℚ) := by exact_mod_cast hnat + +end PiExponent.FormalBranchContact + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/FormalLogTruncation.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/FormalLogTruncation.lean new file mode 100644 index 0000000000000000000000000000000000000000..4d9ff806a344507527f62fb04696b02a8327d126 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/FormalLogTruncation.lean @@ -0,0 +1,386 @@ +import Mathlib.RingTheory.MvPowerSeries.Equiv +import Mathlib.RingTheory.MvPowerSeries.Substitution +import OAI.NumberTheory.PiExponent.Jets.FormalLogJet +import OAI.NumberTheory.PiExponent.Jets.JetGeometry + +namespace OAI + +namespace PiExponent.FormalLogTruncation + +open MvPowerSeries +open scoped BigOperators + +variable {R : Type*} [CommRing R] + +theorem liftSeries_eq_toMvPowerSeries (m : ℕ) (f : PowerSeries R) : + FormalLogJet.liftSeries m f = f.toMvPowerSeries (0 : Fin (m+1)) := by + classical + let e : Unit ↪ Fin (m+1) := ⟨fun _ => 0, fun a b _ => Subsingleton.elim a b⟩ + ext d + rw [FormalLogJet.coeff_liftSeries] + change (if d.tail = 0 then PowerSeries.coeff (d 0) f else 0) = coeff d (rename e f) + by_cases ht : d.tail = 0 + · rw [ite_eq_left ht] + have hd : d = Finsupp.single 0 (d 0) := by + calc + d = Finsupp.cons (d 0) d.tail := (Finsupp.cons_tail d).symm + _ = Finsupp.single 0 (d 0) := by rw [ht, Finsupp.cons_zero_eq_single_zero] + have he : Finsupp.embDomain e (Finsupp.single () (d 0)) = Finsupp.single 0 (d 0) := by + rw [Finsupp.embDomain_single] + rfl + conv_rhs => rw [hd, ← he, coeff_embDomain_rename] + rfl + · rw [ite_eq_right ht] + symm + apply coeff_rename_eq_zero + rintro ⟨x, hx⟩ + have hx' : x = Finsupp.single () (x ()) := by ext; simp + rw [hx', Finsupp.mapDomain_single] at hx + apply ht + rw [← hx] + ext i + change (Finsupp.single (0 : Fin (m+1)) (x ())) i.succ = 0 + exact Finsupp.single_eq_of_ne (Fin.succ_ne_zero i) + +noncomputable def shiftVars {m : ℕ} (tail : Fin m → PowerSeries R) : + Fin (m+1) → MvPowerSeries (Fin (m+1)) R := + Fin.cases (X 0) (fun i => X i.succ + (tail i).toMvPowerSeries 0) + +theorem shiftVars_hasSubst {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) : HasSubst (shiftVars tail) := by + apply hasSubst_of_constantCoeff_zero + intro i + cases i using Fin.cases with + | zero => simp [shiftVars] + | succ i => + simp only [shiftVars, Fin.cases_succ, map_add, constantCoeff_X, + PowerSeries.toMvPowerSeries_apply, constantCoeff_rename, zero_add] + exact ht i + +noncomputable def shiftMap {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) : + MvPowerSeries (Fin (m+1)) R →ₐ[R] MvPowerSeries (Fin (m+1)) R := + substAlgHom (shiftVars_hasSubst tail ht) + +@[simp] theorem shiftMap_X_zero {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) : + shiftMap tail ht (X 0) = X 0 := by + rw [shiftMap, substAlgHom_X] + rfl + +@[simp] theorem shiftMap_X_succ {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) (i : Fin m) : + shiftMap tail ht (X i.succ) = X i.succ + (tail i).toMvPowerSeries 0 := by + rw [shiftMap, substAlgHom_X] + rfl + +@[simp] theorem shiftMap_toMvPowerSeries {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) (f : PowerSeries R) : + shiftMap tail ht (f.toMvPowerSeries (0 : Fin (m+1))) = f.toMvPowerSeries 0 := by + rw [shiftMap, substAlgHom_apply, PowerSeries.subst_toMvPowerSeries (shiftVars_hasSubst tail ht)] + change PowerSeries.subst (X (0 : Fin (m+1))) f = f.toMvPowerSeries 0 + exact PowerSeries.toMvPowerSeries_eq_subst.symm + +@[simp] theorem shiftMap_liftSeries {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) (f : PowerSeries R) : + shiftMap tail ht (FormalLogJet.liftSeries m f) = FormalLogJet.liftSeries m f := by + rw [liftSeries_eq_toMvPowerSeries, shiftMap_toMvPowerSeries] + +@[simp] theorem shiftMap_apply {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) (f) : + shiftMap tail ht f = subst (shiftVars tail) f := substAlgHom_apply _ _ + +theorem shiftMap_inverse {m : ℕ} (s t : Fin m → PowerSeries R) + (hs : ∀ i, PowerSeries.constantCoeff (s i) = 0) + (ht : ∀ i, PowerSeries.constantCoeff (t i) = 0) + (hst : ∀ i, s i + t i = 0) (f : MvPowerSeries (Fin (m+1)) R) : + shiftMap s hs (shiftMap t ht f) = f := by + simp only [shiftMap_apply] + rw [subst_comp_subst_apply (shiftVars_hasSubst t ht) (shiftVars_hasSubst s hs)] + have hvars : (fun i => subst (shiftVars s) (shiftVars t i)) = X := by + funext i + rw [← shiftMap_apply s hs] + cases i using Fin.cases with + | zero => exact shiftMap_X_zero s hs + | succ i => + change shiftMap s hs (X i.succ + (t i).toMvPowerSeries 0) = X i.succ + rw [map_add, shiftMap_X_succ, shiftMap_toMvPowerSeries, add_assoc, + ← map_add, hst i, map_zero, add_zero] + rw [hvars] + exact congrFun subst_self f + +noncomputable def shiftEquiv {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) : + MvPowerSeries (Fin (m+1)) R ≃ₐ[R] MvPowerSeries (Fin (m+1)) R := by + let hn : ∀ i, PowerSeries.constantCoeff (-tail i) = 0 := by simp [ht] + refine AlgEquiv.ofAlgHom (shiftMap tail ht) (shiftMap (fun i => -tail i) hn) ?_ ?_ + · apply AlgHom.ext + intro f + exact shiftMap_inverse tail (fun i => -tail i) ht hn (fun i => add_neg_cancel _) f + · apply AlgHom.ext + intro f + exact shiftMap_inverse (fun i => -tail i) tail hn ht (fun i => neg_add_cancel _) f + +@[simp] theorem shiftEquiv_apply {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) (f) : + shiftEquiv tail ht f = shiftMap tail ht f := rfl + +open JetGeometry + +theorem rationalWeightedIdeal_prod {σ ι : Type*} (v : σ → ℚ) (hv : ∀ i, 0 ≤ v i) + (s : Finset ι) (f : ι → MvPowerSeries σ R) (c : ι → ℚ) + (hf : ∀ i ∈ s, f i ∈ rationalWeightedIdeal v hv (c i)) : + ∏ i ∈ s, f i ∈ rationalWeightedIdeal v hv (∑ i ∈ s, c i) := by + classical + induction s using Finset.induction_on with + | empty => + intro d hd + simp only [Finset.sum_empty] at hd + exact False.elim ((not_lt_of_ge (rational_weight_nonneg v hv d)) hd) + | @insert i s hi ih => + rw [Finset.prod_insert hi, Finset.sum_insert hi] + exact Ideal.mul_le.mp (rationalWeightedIdeal_mul_le v hv (c i) (∑j∈s,c j)) + _ (hf i (Finset.mem_insert_self _ _)) _ + (ih (fun j hj => hf j (Finset.mem_insert_of_mem hj))) + +theorem subst_mem_rationalWeightedIdeal {σ τ : Type*} + (w : σ → ℚ) (v : τ → ℚ) (hw : ∀ i, 0 ≤ w i) (hv : ∀ i, 0 ≤ v i) + (a : σ → MvPowerSeries τ R) (ha : HasSubst a) + (hweight : ∀ i, a i ∈ rationalWeightedIdeal v hv (w i)) + (H : ℚ) (f : MvPowerSeries σ R) (hf : f ∈ rationalWeightedIdeal w hw H) : + subst a f ∈ rationalWeightedIdeal v hv H := by + classical + intro d hd + rw [coeff_subst ha] + apply finsum_eq_zero_of_forall_eq_zero + intro e + by_cases he : coeff e f = 0 + · rw [he, zero_smul] + have hHe : H ≤ Finsupp.weight w e := le_of_not_gt (fun h => he (hf e h)) + have hprod : e.prod (fun i n => a i ^ n) ∈ + rationalWeightedIdeal v hv (Finsupp.weight w e) := by + rw [Finsupp.prod, Finsupp.weight_apply, Finsupp.sum] + apply rationalWeightedIdeal_prod + intro i hi + have hp := Ideal.pow_mem_pow (hweight i) (e i) + have hh := ideal_pow_le_rationalWeightedIdeal v hv + (rationalWeightedIdeal v hv (w i)) (w i) le_rfl (e i) hp + simpa only [nsmul_eq_mul] using hh + rw [hprod d (hd.trans_le hHe), smul_zero] + +theorem X_mem_rationalWeightedIdeal {σ : Type*} (v : σ → ℚ) (hv : ∀ i, 0 ≤ v i) + (i : σ) : (X i : MvPowerSeries σ R) ∈ rationalWeightedIdeal v hv (v i) := by + classical + intro d hd + rw [coeff_X] + split_ifs with he + · subst d + simp only [Finsupp.weight_single, one_nsmul] at hd + exact False.elim (lt_irrefl _ hd) + · rfl + +theorem shiftMap_mem_rationalWeightedIdeal {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) + (v : Fin (m+1) → ℚ) (hv : ∀ i, 0 ≤ v i) + (hweight : ∀ i, (tail i).toMvPowerSeries (0 : Fin (m+1)) ∈ + rationalWeightedIdeal v hv (v i.succ)) (H : ℚ) + (f : MvPowerSeries (Fin (m+1)) R) (hf : f ∈ rationalWeightedIdeal v hv H) : + shiftMap tail ht f ∈ rationalWeightedIdeal v hv H := by + rw [shiftMap_apply] + apply subst_mem_rationalWeightedIdeal v v hv hv _ (shiftVars_hasSubst tail ht) _ H f hf + intro i + cases i using Fin.cases with + | zero => exact X_mem_rationalWeightedIdeal v hv 0 + | succ i => exact Ideal.add_mem _ (X_mem_rationalWeightedIdeal v hv i.succ) (hweight i) + +theorem rationalCoefficientPacket_eq_iff {σ : Type*} (v : σ → ℚ) + (hv : ∀ i, 0 ≤ v i) (H : ℚ) (f g : MvPowerSeries σ R) : + rationalCoefficientPacket v H f = rationalCoefficientPacket v H g ↔ + f - g ∈ rationalWeightedIdeal v hv H := by + constructor + · intro h d hd + exact sub_eq_zero.mpr (congrFun h ⟨d,hd⟩) + · intro h + funext d + exact sub_eq_zero.mp (h d.val d.property) + +theorem rationalCoefficientPacket_surjective {σ : Type*} (v : σ → ℚ) (H : ℚ) : + Function.Surjective (rationalCoefficientPacket (R := R) v H) := by + classical + intro p + refine ⟨fun d => if hd : Finsupp.weight v d < H then p ⟨d,hd⟩ else 0, ?_⟩ + funext d + exact dite_eq_left d.property + +theorem packet_surjective_comp_equiv {σ α : Type*} (v : σ → ℚ) + (hv : ∀ i, 0 ≤ v i) (H : ℚ) + (e : MvPowerSeries σ R ≃ₐ[R] MvPowerSeries σ R) + (he : ∀ f ∈ rationalWeightedIdeal v hv H, e f ∈ rationalWeightedIdeal v hv H) + (f : α → MvPowerSeries σ R) + (hf : Function.Surjective (fun a => rationalCoefficientPacket v H (f a))) : + Function.Surjective (fun a => rationalCoefficientPacket v H (e (f a))) := by + intro p + obtain ⟨F,hF⟩ := rationalCoefficientPacket_surjective (R := R) v H p + obtain ⟨a,ha⟩ := hf (rationalCoefficientPacket v H (e.symm F)) + have hdiff := he _ ((rationalCoefficientPacket_eq_iff v hv H _ _).mp ha) + rw [map_sub, e.apply_symm_apply] at hdiff + exact ⟨a, ((rationalCoefficientPacket_eq_iff v hv H _ _).mpr hdiff).trans hF⟩ + +theorem packet_surjective_comp_equiv_iff {σ α : Type*} (v : σ → ℚ) + (hv : ∀ i, 0 ≤ v i) (H : ℚ) + (e : MvPowerSeries σ R ≃ₐ[R] MvPowerSeries σ R) + (he : ∀ f ∈ rationalWeightedIdeal v hv H, e f ∈ rationalWeightedIdeal v hv H) + (hi : ∀ f ∈ rationalWeightedIdeal v hv H, e.symm f ∈ rationalWeightedIdeal v hv H) + (f : α → MvPowerSeries σ R) : + Function.Surjective (fun a => rationalCoefficientPacket v H (e (f a))) ↔ + Function.Surjective (fun a => rationalCoefficientPacket v H (f a)) := by + constructor + · intro h + simpa only [e.symm_apply_apply] using + packet_surjective_comp_equiv v hv H e.symm hi (fun a => e (f a)) h + · exact packet_surjective_comp_equiv v hv H e he f + +@[simp] theorem shiftEquiv_symm_apply {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) (f) : + (shiftEquiv tail ht).symm f = + shiftMap (fun i => -tail i) (by simp [ht]) f := rfl + +theorem shiftEquiv_mem_iff {m : ℕ} (tail : Fin m → PowerSeries R) + (ht : ∀ i, PowerSeries.constantCoeff (tail i) = 0) + (v : Fin (m+1) → ℚ) (hv : ∀ i, 0 ≤ v i) + (hweight : ∀ i, (tail i).toMvPowerSeries (0 : Fin (m+1)) ∈ + rationalWeightedIdeal v hv (v i.succ)) (H : ℚ) (f) : + shiftEquiv tail ht f ∈ rationalWeightedIdeal v hv H ↔ + f ∈ rationalWeightedIdeal v hv H := by + have hn : ∀ i, (-tail i).toMvPowerSeries (0 : Fin (m+1)) ∈ + rationalWeightedIdeal v hv (v i.succ) := by + intro i + rw [map_neg] + intro d hd + rw [map_neg, hweight i d hd, neg_zero] + constructor + · intro hf + have h := shiftMap_mem_rationalWeightedIdeal (fun i => -tail i) + (by simp [ht]) v hv hn H _ hf + change (shiftEquiv tail ht).symm (shiftEquiv tail ht f) ∈ _ at h + simpa only [AlgEquiv.symm_apply_apply] using h + · exact shiftMap_mem_rationalWeightedIdeal tail ht v hv hweight H f + +noncomputable def logTail (T : ℕ) : PowerSeries ℂ := + PowerSeries.log ℂ - (PowerSeries.trunc T (PowerSeries.log ℂ) : PowerSeries ℂ) + +@[simp] theorem logTail_constantCoeff (T : ℕ) : PowerSeries.constantCoeff (logTail T) = 0 := by + simp [logTail, Polynomial.constantCoeff_coe, PowerSeries.coeff_trunc, + PowerSeries.coeff_log] + +theorem coeff_logTail_eq_zero (T n : ℕ) (hn : n < T) : + PowerSeries.coeff n (logTail T) = 0 := by + simp [logTail, Polynomial.coeff_coe, PowerSeries.coeff_trunc, hn] + +theorem logTail_mem_rationalWeightedIdeal {m : ℕ} (v : Fin (m+1) → ℚ) + (hv : ∀ i, 0 ≤ v i) (T : ℕ) (H : ℚ) (hT : H ≤ (T : ℚ) * v 0) : + (logTail T).toMvPowerSeries (0 : Fin (m+1)) ∈ rationalWeightedIdeal v hv H := by + intro d hd + rw [← liftSeries_eq_toMvPowerSeries, FormalLogJet.coeff_liftSeries] + split_ifs with ht + · have he : d = Finsupp.single 0 (d 0) := by + calc + d = Finsupp.cons (d 0) d.tail := (Finsupp.cons_tail d).symm + _ = Finsupp.single 0 (d 0) := by rw [ht, Finsupp.cons_zero_eq_single_zero] + have hdeg : (d 0 : ℚ) * v 0 < H := by + calc + (d 0 : ℚ) * v 0 = Finsupp.weight v (Finsupp.single 0 (d 0)) := by + rw [Finsupp.weight_single, nsmul_eq_mul] + _ = Finsupp.weight v d := congrArg _ he.symm + _ < H := hd + apply coeff_logTail_eq_zero + by_contra hn + have hcast : (T : ℚ) ≤ d 0 := by exact_mod_cast (Nat.le_of_not_gt hn) + exact (not_lt_of_ge ((mul_le_mul_of_nonneg_right hcast (hv 0)).trans' hT)) hdeg + · rfl + +noncomputable def truncatedFormalJet {m : ℕ} (c : Fin m → ℂ) (T : Fin m → ℕ) : + PiExponentApprox.FramePolynomial m →ₐ[ℂ] MvPowerSeries (Fin (m+1)) ℂ := + MvPolynomial.aeval (Fin.cases (1 + X 0) (fun i => + C (c i) + X i.succ + FormalLogJet.liftSeries m + (PowerSeries.trunc (T i) (PowerSeries.log ℂ) : PowerSeries ℂ))) + +theorem shiftMap_truncatedFormalJet {m : ℕ} (c : Fin m → ℂ) (T : Fin m → ℕ) + (P : PiExponentApprox.FramePolynomial m) : + shiftMap (fun i => logTail (T i)) (fun i => logTail_constantCoeff (T i)) + (truncatedFormalJet c T P) = FormalLogJet.formalJet c P := by + have he : (shiftMap (fun i => logTail (T i)) (fun i => logTail_constantCoeff (T i))).comp + (truncatedFormalJet c T) = FormalLogJet.formalJet c := by + apply MvPolynomial.algHom_ext + intro i + cases i using Fin.cases with + | zero => + simp only [AlgHom.comp_apply, truncatedFormalJet, MvPolynomial.aeval_X, + Fin.cases_zero, FormalLogJet.formalJet_Y, map_add, map_one, shiftMap_X_zero] + | succ i => + simp only [AlgHom.comp_apply, truncatedFormalJet, MvPolynomial.aeval_X, + Fin.cases_succ, FormalLogJet.formalJet_X, map_add, + shiftMap_X_succ, shiftMap_liftSeries] + rw [← liftSeries_eq_toMvPowerSeries, logTail, map_sub, FormalLogJet.formalLog] + have hc : shiftMap (fun i => logTail (T i)) (fun i => logTail_constantCoeff (T i)) + (C (c i)) = C (c i) := (shiftMap _ _).commutes (c i) + rw [hc] + ring + exact DFunLike.congr_fun he P + +theorem packets_surjective_comp_equiv {σ α J : Type*} (v : σ → ℚ) + (hv : ∀ i, 0 ≤ v i) (H : ℚ) + (e : MvPowerSeries σ R ≃ₐ[R] MvPowerSeries σ R) + (he : ∀ f ∈ rationalWeightedIdeal v hv H, e f ∈ rationalWeightedIdeal v hv H) + (f : α → J → MvPowerSeries σ R) + (hf : Function.Surjective (fun a j => rationalCoefficientPacket v H (f a j))) : + Function.Surjective (fun a j => rationalCoefficientPacket v H (e (f a j))) := by + intro p + choose F hF using fun j => rationalCoefficientPacket_surjective (R := R) v H (p j) + obtain ⟨a,ha⟩ := hf (fun j => rationalCoefficientPacket v H (e.symm (F j))) + refine ⟨a, ?_⟩ + funext j + have hdiff := he _ ((rationalCoefficientPacket_eq_iff v hv H _ _).mp (congrFun ha j)) + rw [map_sub, e.apply_symm_apply] at hdiff + exact ((rationalCoefficientPacket_eq_iff v hv H _ _).mpr hdiff).trans (hF j) + +theorem packets_surjective_comp_equiv_iff {σ α J : Type*} (v : σ → ℚ) + (hv : ∀ i, 0 ≤ v i) (H : ℚ) + (e : MvPowerSeries σ R ≃ₐ[R] MvPowerSeries σ R) + (he : ∀ f ∈ rationalWeightedIdeal v hv H, e f ∈ rationalWeightedIdeal v hv H) + (hi : ∀ f ∈ rationalWeightedIdeal v hv H, e.symm f ∈ rationalWeightedIdeal v hv H) + (f : α → J → MvPowerSeries σ R) : + Function.Surjective (fun a j => rationalCoefficientPacket v H (e (f a j))) ↔ + Function.Surjective (fun a j => rationalCoefficientPacket v H (f a j)) := by + constructor + · intro h + simpa only [e.symm_apply_apply] using + packets_surjective_comp_equiv v hv H e.symm hi (fun a j => e (f a j)) h + · exact packets_surjective_comp_equiv v hv H e he f + +theorem formalLog_packets_surjective_iff_truncated {m : ℕ} {α J : Type*} + (v : Fin (m+1) → ℚ) (hv : ∀ i, 0 ≤ v i) (H : ℚ) + (T : Fin m → ℕ) (hT : ∀ i, v i.succ ≤ (T i : ℚ) * v 0) + (c : J → Fin m → ℂ) (P : α → PiExponentApprox.FramePolynomial m) : + Function.Surjective (fun a j => rationalCoefficientPacket v H (FormalLogJet.formalJet (c j) (P a))) ↔ + Function.Surjective (fun a j => rationalCoefficientPacket v H (truncatedFormalJet (c j) T (P a))) := by + let tail := fun i => logTail (T i) + let ht := fun i => logTail_constantCoeff (T i) + let e := shiftEquiv tail ht + have hw : ∀ i, (tail i).toMvPowerSeries (0 : Fin (m+1)) ∈ + rationalWeightedIdeal v hv (v i.succ) := + fun i => logTail_mem_rationalWeightedIdeal v hv (T i) (v i.succ) (hT i) + have he : ∀ f ∈ rationalWeightedIdeal v hv H, e f ∈ rationalWeightedIdeal v hv H := + fun f hf => (shiftEquiv_mem_iff tail ht v hv hw H f).mpr hf + have hi : ∀ f ∈ rationalWeightedIdeal v hv H, e.symm f ∈ rationalWeightedIdeal v hv H := by + intro f hf + apply (shiftEquiv_mem_iff tail ht v hv hw H (e.symm f)).mp + change e (e.symm f) ∈ rationalWeightedIdeal v hv H + simpa only [AlgEquiv.apply_symm_apply] using hf + have hh := packets_surjective_comp_equiv_iff v hv H e he hi + (fun a j => truncatedFormalJet (c j) T (P a)) + simpa only [e, tail, ht, shiftEquiv_apply, shiftMap_truncatedFormalJet] using hh + +end PiExponent.FormalLogTruncation + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/HilbertSeries.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/HilbertSeries.lean new file mode 100644 index 0000000000000000000000000000000000000000..82065be47569775d5239ae52787589db132fd80a --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/HilbertSeries.lean @@ -0,0 +1,43 @@ +import Mathlib.RingTheory.PowerSeries.Basic +import Mathlib.Tactic.NormNum +import OAI.NumberTheory.PiExponent.LocalAlgebra.RegularHilbertStep + +namespace OAI + +namespace PiExponentJets.W64 + +attribute [local instance] MvPolynomial.gradedAlgebra + +variable {k σ : Type*} [Field k] [Finite σ] + +noncomputable def sectionHilbertSeries (I : Ideal (MvPolynomial σ k)) : PowerSeries ℤ := + PowerSeries.mk (fun n => (Module.finrank k (quotientSection I n) : ℤ)) + +omit [Finite σ] in +@[simp] theorem coeff_sectionHilbertSeries (I : Ideal (MvPolynomial σ k)) (n : ℕ) : + PowerSeries.coeff n (sectionHilbertSeries I) = + (Module.finrank k (quotientSection I n) : ℤ) := + PowerSeries.coeff_mk _ _ + +theorem sectionHilbertSeries_regular_step (I : Ideal (MvPolynomial σ k)) + (hI : I.IsHomogeneous (MvPolynomial.homogeneousSubmodule σ k)) + {d : ℕ} (f : MvPolynomial σ k) (hf : f.IsHomogeneous d) + (hreg : IsRightRegular (Ideal.Quotient.mk I f)) : + sectionHilbertSeries (Ideal.span {f} ⊔ I) = + (1 - PowerSeries.X ^ d) * sectionHilbertSeries I := by + ext n + rw [sub_mul, one_mul, map_sub, PowerSeries.coeff_X_pow_mul'] + simp only [coeff_sectionHilbertSeries] + by_cases hdn : d ≤ n + · rw [ite_eq_left hdn] + have h := regular_hilbert_step I hI f hf hreg (n-d) + rw [Nat.sub_add_cancel hdn] at h + apply eq_sub_of_add_eq + exact_mod_cast h + · rw [ite_eq_right hdn, sub_zero] + exact congrArg (fun m : ℕ => (m : ℤ)) + (hilbert_step_of_degree_lt I hI f hf (Nat.lt_of_not_ge hdn)) + +end PiExponentJets.W64 + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/LiteralAnalyticSummand.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/LiteralAnalyticSummand.lean new file mode 100644 index 0000000000000000000000000000000000000000..35a912d824519c7665f3bc89e1e0a9ed04f18556 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/LiteralAnalyticSummand.lean @@ -0,0 +1,231 @@ +import OAI.NumberTheory.PiExponent.Analysis.DeterminantAnalyticBound +import OAI.NumberTheory.PiExponent.Approximation.DeterminantContradiction +import OAI.NumberTheory.PiExponent.Approximation.MatrixTranslationBounds + +namespace OAI + +open scoped BigOperators + +namespace PiExponent.LiteralAnalytic +open DeterminantContradiction + +noncomputable def fixedWeights {nu : ℝ} (d : FixedData nu) : Fin d.m → ℝ := + MatrixArithmetic.logWeights (finiteDenominators d) + +abbrev Transverse {nu : ℝ} (d : FixedData nu) (H : ℝ) := + ↥(MatrixTranslation.transverseIndices (fixedWeights d) H) + +noncomputable def beta {nu : ℝ} (d : FixedData nu) {H : ℝ} (r : Row d H) : Fin d.m →₀ ℕ := + InterpolationMatrix.exponentVector (fun i => r.2.1 i.succ) + +abbrev RowChoice {nu : ℝ} (d : FixedData nu) (H : ℝ) (r : Row d H) := + RowTranslation.RowChoices (MatrixTranslation.transverseIndices (fixedWeights d) H) + (beta d r) (r.2.1 0) + +abbrev ChoiceFamily {nu : ℝ} (d : FixedData nu) (H : ℝ) := + ∀ r : Row d H, RowChoice d H r + +noncomputable def indexWeight {nu : ℝ} (d : FixedData nu) {H : ℝ} (a : Transverse d H) : ℝ := + MatrixTranslationBounds.weight (fixedWeights d) (fun i => a.1 i) + +noncomputable def rowWeight {nu : ℝ} (d : FixedData nu) {H : ℝ} (r : Row d H) : ℝ := + MatrixTranslationBounds.weight (fixedWeights d) (fun i => beta d r i) + +noncomputable def choiceScalar {nu : ℝ} (d : FixedData nu) {H : ℝ} + (r : Row d H) (t : RowChoice d H r) : ℂ := + RowTranslation.rowScalar + (fun i => (r.1.val : ℂ) * + (MatrixArithmetic.rationalCenters (finiteNumerators d) (finiteDenominators d) i - logarithmicPeriod)) + (fun i => RowTranslation.tail + (MatrixArithmetic.truncationOrders (finiteDenominators d) d.F0 d.v0 i) (PowerSeries.log ℂ)) + (beta d r) t.1.1 t.2.1 t.2.2 + +noncomputable def choiceMatrix {nu : ℝ} (d : FixedData nu) {H : ℝ} + (selection : Row d H → Column d H) (f : ChoiceFamily d H) : Matrix (Row d H) (Row d H) ℂ := + fun r c => PowerSeries.coeff (r.2.1 0 - (f r).2.2) + ((MatrixTranslation.periodMonomial r.1.val logarithmicPeriod + ((selection c).1 0) (fun i => (selection c).1 i.succ)).coeff (f r).1.1) + +theorem fixedWeights_pos {nu : ℝ} (d : FixedData nu) (i : Fin d.m) : + 0 < fixedWeights d i := by + change 0 < MatrixArithmetic.logWeights (finiteDenominators d) i + rw [logWeights_eq] + exact lt_of_lt_of_le zero_lt_one (d.x_one_le _) + +theorem fixedWeights_lower {nu : ℝ} (d : FixedData nu) (i : Fin d.m) : + d.wstar ≤ fixedWeights d i := by + change d.wstar ≤ MatrixArithmetic.logWeights (finiteDenominators d) i + rw [logWeights_eq] + exact d.wstar_lower i + +theorem rowOrder_le {nu : ℝ} (d : FixedData nu) {H : ℝ} (r : Row d H) : + (r.2.1 0 : ℝ) ≤ H / (d.v0 : ℝ) := by + have hr := InterpolationMatrix.row_weight_lt d.v0_pos d.base.theta_pos (fixedWeights_pos d) r + have hs : 0 ≤ (∑ i, fixedWeights d i * (r.2.1 i.succ : ℝ)) / (d.base.theta : ℝ) := + div_nonneg (Finset.sum_nonneg fun i _ => mul_nonneg (fixedWeights_pos d i).le (Nat.cast_nonneg _)) + d.base.theta_pos.le + apply (le_div_iff₀ d.v0_pos).mpr + nlinarith + +theorem indexWeight_nonneg {nu : ℝ} (d : FixedData nu) {H : ℝ} (a : Transverse d H) : + 0 ≤ indexWeight d a := by + unfold indexWeight MatrixTranslationBounds.weight + exact Finset.sum_nonneg fun i _ => mul_nonneg (fixedWeights_pos d i).le (Nat.cast_nonneg _) + +theorem indexWeight_le {nu : ℝ} (d : FixedData nu) {H : ℝ} (a : Transverse d H) : + indexWeight d a ≤ H := + (MatrixTranslation.mem_transverseIndices (fixedWeights d) H (fixedWeights_pos d) a.1).mp a.2 + +theorem norm_choiceScalar_le {nu : ℝ} (d : FixedData nu) (hnu : 0 ≤ nu) + {H : ℝ} (r : Row d H) (t : RowChoice d H r) : + ‖choiceScalar d r t‖ ≤ Real.exp + (-nu * (indexWeight d t.1 - rowWeight d r) + H * d.translationError) := by + have hK : (1 : ℝ) ≤ d.K := by exact_mod_cast d.K_pos + have hC : 0 ≤ Real.log (2 * (d.K : ℝ)) + nu := + add_nonneg (Real.log_nonneg (by linarith)) hnu + have hk : ((t.2.2 : ℕ) : ℝ) ≤ H / (d.v0 : ℝ) := by + apply le_trans _ (rowOrder_le d r) + exact_mod_cast Nat.le_of_lt_succ t.2.2.isLt + have hT : ∀ i, 1 ≤ MatrixArithmetic.truncationOrders (finiteDenominators d) d.F0 d.v0 i := + fun i => MatrixTranslationBounds.truncationOrder_pos d.F0_pos d.v0_pos (fixedWeights_pos d i) + have hTw : ∀ i, d.F0 * fixedWeights d i ≤ + (d.v0 : ℝ) * MatrixArithmetic.truncationOrders (finiteDenominators d) d.F0 d.v0 i := + fun _ => MatrixTranslationBounds.truncationOrder_budget d.v0_pos + have heps := MatrixTranslationBounds.actual_error_exp (finiteNumerators d) (finiteDenominators d) + r.1.val d.K nu d.K_pos r.1.isLt.le hnu + (fun i => le_trans (by decide : 1 ≤ 2) (finiteDenominators_two_le d i)) + (fun i => (d.approximations i.val).2.2) + have hb := MatrixTranslationBounds.norm_rowScalar_exp_weight_difference + (fun i => (r.1.val : ℂ) * + (MatrixArithmetic.rationalCenters (finiteNumerators d) (finiteDenominators d) i - logarithmicPeriod)) + (MatrixArithmetic.truncationOrders (finiteDenominators d) d.F0 d.v0) + (beta d r) t.1.1 t.2.1 t.2.2 (fixedWeights d) + (Real.log (2 * (d.K : ℝ)) + nu) nu H d.wstar d.v0 d.F0 + hC hnu d.wstar_pos d.v0_pos d.F0_pos (fixedWeights_lower d) (indexWeight_le d t.1) + hk hT hTw heps + simpa only [choiceScalar, indexWeight, rowWeight, AdmissibleParameters.translationError, add_assoc] + using hb + +theorem rowWeight_le_indexWeight_of_ne_zero {nu : ℝ} (d : FixedData nu) + {H : ℝ} (r : Row d H) (t : RowChoice d H r) (ht : choiceScalar d r t ≠ 0) : + rowWeight d r ≤ indexWeight d t.1 := by + have h := RowTranslation.rowScalar_ne_zero_le _ _ _ _ _ _ ht + unfold rowWeight indexWeight MatrixTranslationBounds.weight + exact Finset.sum_le_sum fun i _ => mul_le_mul_of_nonneg_left (by exact_mod_cast h i) + (fixedWeights_pos d i).le + +theorem actualRowCount_pos {nu : ℝ} (d : FixedData nu) {H : ℝ} (hH : 0 < H) : + 0 < actualRowCount d H := + MatrixArithmetic.actual_row_card_pos (lt_of_lt_of_le Nat.zero_lt_one d.K_pos) d.v0_pos d.base.theta_pos hH + (fixedWeights_pos d) + +theorem sum_rowWeight_eq {nu : ℝ} (d : FixedData nu) {H : ℝ} (hH : 0 < H) : + (∑ r : Row d H, rowWeight d r) = (actualRowCount d H : ℝ) * H * actualMean d H := by + have hM : (actualRowCount d H : ℝ) ≠ 0 := by exact_mod_cast (actualRowCount_pos d hH).ne' + unfold actualMean MatrixArithmetic.meanRowWeight + change (∑ r : Row d H, rowWeight d r) = (actualRowCount d H : ℝ) * H * + (MatrixArithmetic.rowWeightedSum d.K d.v0 d.base.theta (finiteDenominators d) H / + ((actualRowCount d H : ℝ) * H)) + rw [mul_div_cancel₀ _ (mul_ne_zero hM hH.ne')] + unfold MatrixArithmetic.rowWeightedSum rowWeight MatrixTranslationBounds.weight beta fixedWeights + simp only [InterpolationMatrix.exponentVector_apply, mul_comm] + +theorem low_transverse_capacity {nu : ℝ} (d : FixedData nu) (H : ℝ) : + (((Finset.univ : Finset (Transverse d H)).filter + (fun A => indexWeight d A ≤ (d.base.A : ℝ) * H)).card : ℝ) ≤ lowIndexCount d H := by + classical + let f : {A : Transverse d H // indexWeight d A ≤ (d.base.A : ℝ) * H} → + ↥(MatrixTranslation.transverseIndices (fixedWeights d) ((d.base.A : ℝ) * H)) := + fun A => ⟨A.1.1, (MatrixTranslation.mem_transverseIndices _ _ (fixedWeights_pos d) _).mpr A.2⟩ + have hinj : Function.Injective f := by + intro A B h + apply Subtype.ext + apply Subtype.ext + have hh := congrArg Subtype.val h + simpa only [f] using hh + have hh := Fintype.card_le_of_injective f hinj + rw [Fintype.card_subtype] at hh + have hc : Fintype.card ↥(MatrixTranslation.transverseIndices (fixedWeights d) + ((d.base.A : ℝ) * H)) = lowIndexCount d H := by + simp only [Fintype.card_coe, MatrixTranslation.card_transverseIndices] + rfl + rw [hc] at hh + exact_mod_cast hh + +theorem lowIndexCount_pos {nu : ℝ} (d : FixedData nu) {H : ℝ} (hH : 0 < H) : + 0 < lowIndexCount d H := by + apply Finset.card_pos.mpr + refine ⟨fun _ => 0, ?_⟩ + apply (mem_realWeightedSimplex (fixedWeights_pos d)).mpr + simp only [Nat.cast_zero, mul_zero, Finset.sum_const_zero] + exact mul_nonneg d.base.A_pos.le hH.le + +theorem norm_scalar_product_le {nu : ℝ} (d : FixedData nu) (hnu : 0 ≤ nu) + {H : ℝ} (hH : 0 < H) (f : ChoiceFamily d H) : + ‖∏ r, choiceScalar d r (f r)‖ ≤ Real.exp + (-nu * ((∑ r, indexWeight d (f r).1) - (actualRowCount d H : ℝ) * H * actualMean d H) + + (actualRowCount d H : ℝ) * H * d.translationError) := by + rw [norm_prod] + apply (Finset.prod_le_prod₀ (fun r _ => norm_nonneg _) (fun r _ => norm_choiceScalar_le d hnu r (f r))).trans + rw [← Real.exp_sum] + apply le_of_eq + congr 1 + rw [Finset.sum_add_distrib, ← Finset.mul_sum, Finset.sum_sub_distrib, sum_rowWeight_eq d hH] + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, actualRowCount] + ring_nf + +theorem norm_choiceMatrix_le {nu : ℝ} (d : FixedData nu) {H : ℝ} (hH : 0 < H) + (selection : Row d H → Column d H) (f : ChoiceFamily d H) : + ‖(choiceMatrix d selection f).det‖ ≤ Real.exp + (-(Real.log 2 / 4) * (∑ A : Transverse d H, + (Collision.multiplicity Finset.univ (fun r => (f r).1) A : ℝ) ^ 2) + + (actualRowCount d H : ℝ) * H * + (d.holomorphicError + Collision.collisionRemainder (actualRowCount d H) H)) := by + have horders : ((∑ r : Row d H, (r.2.1 0 - ((f r).2.2 : ℕ)) : ℕ) : ℝ) ≤ + (Fintype.card (Row d H) : ℝ) * H / (d.v0 : ℝ) := by + rw [Nat.cast_sum] + calc + _ ≤ ∑ r : Row d H, H / (d.v0 : ℝ) := by + apply Finset.sum_le_sum + intro r _ + exact le_trans (by exact_mod_cast Nat.sub_le (r.2.1 0) ((f r).2.2 : ℕ)) (rowOrder_le d r) + _ = _ := by simp; ring_nf + have hb := formal_period_collision_bound (fun r => (f r).1) (fun A : Transverse d H => A.1) + (fun r => r.1.val) (fun r => r.2.1 0 - ((f r).2.2 : ℕ)) + (fun c => (selection c).1 0) (fun c i => (selection c).1 i.succ) (fixedWeights d) + (lt_of_lt_of_le Nat.zero_lt_one d.K_pos) hH d.w0_pos d.wstar_pos (fixedWeights_lower d) + (fun r => r.1.isLt) + (fun c => InterpolationMatrix.column_weight_le d.w0_pos (fixedWeights_pos d) (selection c)) horders + convert! hb using 1 + +theorem norm_actual_summand_le {nu : ℝ} (d : FixedData nu) (hnu : 0 ≤ nu) + {H : ℝ} (hH : 0 < H) (selection : Row d H → Column d H) (f : ChoiceFamily d H) : + ‖(∏ r, choiceScalar d r (f r)) * (choiceMatrix d selection f).det‖ ≤ + Real.exp ((actualRowCount d H : ℝ) * H * + (d.analyticError + Collision.collisionRemainder (actualRowCount d H) H + + max (-collisionRate d H) + (-nu * ((d.base.A : ℝ) * (1 - d.base.eta) - actualMean d H)))) := by + classical + by_cases hs : (∏ r, choiceScalar d r (f r)) = 0 + · simp [hs, Real.exp_nonneg] + have hmono : (actualRowCount d H : ℝ) * H * actualMean d H ≤ ∑ r, indexWeight d (f r).1 := by + rw [← sum_rowWeight_eq d hH] + apply Finset.sum_le_sum + intro r _ + apply rowWeight_le_indexWeight_of_ne_zero d r (f r) + exact Finset.prod_ne_zero_iff.mp hs r (Finset.mem_univ r) + have hb := DeterminantAnalyticBound.translated_summand_bound + (fun r => (f r).1) (fun A : Transverse d H => indexWeight d A) + (∏ r, choiceScalar d r (f r)) (choiceMatrix d selection f).det + hH d.base.A_pos.le d.base.eta_pos.le hnu collisionConstant_pos.le + (by exact_mod_cast lowIndexCount_pos d hH) + (indexWeight_nonneg d) hmono (low_transverse_capacity d H) + (norm_scalar_product_le d hnu hH f) (norm_choiceMatrix_le d hH selection f) + convert! hb using 1 + congr 1 + unfold AdmissibleParameters.analyticError collisionRate collisionConstant actualRowCount + ring_nf + +end PiExponent.LiteralAnalytic + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/LogTailAnalytic.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/LogTailAnalytic.lean new file mode 100644 index 0000000000000000000000000000000000000000..cffd1d20c57ff417ab0c9087515a606ca4d5529f --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/LogTailAnalytic.lean @@ -0,0 +1,234 @@ +import Mathlib +import OAI.NumberTheory.PiExponent.Analysis.AnalyticCollision +import OAI.NumberTheory.PiExponent.Approximation.RowTranslation + +namespace OAI + +open scoped BigOperators + +namespace PiExponent.LogTailAnalytic + +noncomputable def logTail (T : ℕ) (z : ℂ) : ℂ := + Complex.logTaylor T z - Complex.log (1 + z) + +theorem eval_trunc_log (T : ℕ) (z : ℂ) : + (PowerSeries.trunc T (PowerSeries.log ℂ)).eval z = Complex.logTaylor T z := by + change (PowerSeries.trunc T (PowerSeries.log ℂ)).eval₂ (RingHom.id ℂ) z = _ + rw [PowerSeries.eval₂_trunc_eq_sum_range] + unfold Complex.logTaylor + apply Finset.sum_congr rfl + intro n hn + simp only [RingHom.id_apply, PowerSeries.coeff_log] + by_cases h : n = 0 + · simp [h] + · simp [h, map_div₀, map_pow] + ring + +theorem analyticAt_logTail (T : ℕ) {z : ℂ} (hz : ‖z‖ < 1) : + AnalyticAt ℂ (logTail T) z := by + unfold logTail Complex.logTaylor + apply AnalyticAt.sub + · apply Finset.analyticAt_fun_sum + intro n hn + fun_prop + · exact (analyticAt_const.add analyticAt_id).clog (Complex.mem_slitPlane_of_norm_lt_one hz) + + theorem norm_logTail_le (T : ℕ) (hT : 1 ≤ T) {z : ℂ} (hz : ‖z‖ < 1) : + ‖logTail T z‖ ≤ ‖z‖ ^ T * (1 - ‖z‖)⁻¹ / T := by + obtain ⟨n, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : T ≠ 0) + unfold logTail + rw [norm_sub_rev] + simpa only [Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one] using + Complex.norm_log_sub_logTaylor_le n hz + +theorem norm_logTail_le_one (T : ℕ) (hT : 1 ≤ T) {z : ℂ} (hz : ‖z‖ ≤ 1 / 2) : + ‖logTail T z‖ ≤ 1 := by + have hz1 : ‖z‖ < 1 := by linarith + have hpow : ‖z‖ ^ T ≤ 1 / 2 := by + obtain ⟨n, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : T ≠ 0) + rw [pow_succ] + have hh : ‖z‖ ^ n ≤ 1 := pow_le_one₀ (norm_nonneg z) hz1.le + nlinarith [norm_nonneg z] + have hinv : (1 - ‖z‖)⁻¹ ≤ 2 := by + rw [inv_le_comm₀ (by linarith : 0 < 1 - ‖z‖) (by norm_num : (0 : ℝ) < 2)] + linarith + have hTreal : (1 : ℝ) ≤ T := by exact_mod_cast hT + calc + ‖logTail T z‖ ≤ ‖z‖ ^ T * (1 - ‖z‖)⁻¹ / T := norm_logTail_le T hT hz1 + _ ≤ (1 / 2 : ℝ) * 2 / T := by gcongr + _ ≤ 1 := by rw [div_le_iff₀ (by positivity : (0 : ℝ) < T)]; nlinarith + +theorem norm_prod_logTail_le_one {ι : Type*} (s : Finset ι) (T d : ι → ℕ) + (hT : ∀ i ∈ s, 1 ≤ T i) {z : ℂ} (hz : ‖z‖ ≤ 1 / 2) : + ‖∏ i ∈ s, logTail (T i) z ^ d i‖ ≤ 1 := by + rw [norm_prod] + apply Finset.prod_le_one₀ + · intro i hi + positivity + · intro i hi + rw [norm_pow] + exact pow_le_one₀ (norm_nonneg _) (norm_logTail_le_one (T i) (hT i hi) hz) + +theorem analyticAt_prod_logTail {ι : Type*} (s : Finset ι) (T d : ι → ℕ) + {z : ℂ} (hz : ‖z‖ < 1) : + AnalyticAt ℂ (fun t => ∏ i ∈ s, logTail (T i) t ^ d i) z := by + apply Finset.analyticAt_fun_prod + intro i hi + exact (analyticAt_logTail (T i) hz).pow (d i) + +theorem norm_rowTest_prod_logTail_le {ι : Type*} (s : Finset ι) (T d : ι → ℕ) + (hT : ∀ i ∈ s, 1 ≤ T i) (k : ℕ) : + ‖AnalyticCollision.rowTest k (fun z => ∏ i ∈ s, logTail (T i) z ^ d i)‖ ≤ + (2 : ℝ) ^ k := by + have h := AnalyticCollision.norm_rowTest_le + (f := fun z => ∏ i ∈ s, logTail (T i) z ^ d i) (D := 1) ?_ k + · simpa only [mul_one] using h + intro z hz + apply norm_prod_logTail_le_one s T d hT + exact (by simpa only [Metric.mem_sphere, dist_zero_right] using hz : ‖z‖ = 1 / 2).le + +theorem logTail_isBigO (T : ℕ) (hT : 1 ≤ T) : + (fun z => logTail T z) =O[nhds (0 : ℂ)] (fun z => z ^ T) := by + obtain ⟨n, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : T ≠ 0) + have h := (Complex.log_sub_logTaylor_isBigO n).neg_left + simpa only [logTail, neg_sub, Nat.succ_eq_add_one] using h + +theorem order_formal_logTail (T : ℕ) : + (T : ℕ∞) ≤ (RowTranslation.tail T (PowerSeries.log ℂ)).order := + RowTranslation.order_tail T (PowerSeries.log ℂ) + +theorem hasSum_formal_log {z : ℂ} (hz : ‖z‖ < 1) : + HasSum (fun n => PowerSeries.coeff n (PowerSeries.log ℂ) * z ^ n) + (Complex.log (1 + z)) := by + convert Complex.hasSum_taylorSeries_log hz using 1 + funext n + by_cases hn : n = 0 + · simp [hn] + · simp [PowerSeries.coeff_log, hn, map_div₀, map_pow] + ring + +theorem hasSum_trunc_log (T : ℕ) (z : ℂ) : + HasSum (fun n => PowerSeries.coeff n + (PowerSeries.trunc T (PowerSeries.log ℂ) : PowerSeries ℂ) * z ^ n) + (Complex.logTaylor T z) := by + have h := hasSum_sum_of_ne_finset_zero (L := SummationFilter.unconditional ℕ) + (s := Finset.range T) + (f := fun n => PowerSeries.coeff n + (PowerSeries.trunc T (PowerSeries.log ℂ) : PowerSeries ℂ) * z ^ n) ?_ + · convert h using 1 + rw [← eval_trunc_log] + change (PowerSeries.trunc T (PowerSeries.log ℂ)).eval₂ (RingHom.id ℂ) z = _ + rw [PowerSeries.eval₂_trunc_eq_sum_range] + apply Finset.sum_congr rfl + intro n hn + simp [PowerSeries.coeff_trunc, Finset.mem_range.mp hn] + · intro n hn + have hn' : ¬ n < T := by simpa only [Finset.mem_range] using hn + simp [PowerSeries.coeff_trunc, hn'] + +theorem hasSum_formal_logTail (T : ℕ) {z : ℂ} (hz : ‖z‖ < 1) : + HasSum (fun n => PowerSeries.coeff n + (RowTranslation.tail T (PowerSeries.log ℂ)) * z ^ n) (logTail T z) := by + convert (hasSum_trunc_log T z).sub (hasSum_formal_log hz) using 1 + · funext n + simp only [RowTranslation.tail, map_sub, sub_mul] + · rfl + +theorem hasFPowerSeriesAt_logTail (T : ℕ) : + HasFPowerSeriesAt (logTail T) + (FormalMultilinearSeries.ofScalars ℂ + (fun n => PowerSeries.coeff n (RowTranslation.tail T (PowerSeries.log ℂ)))) 0 := by + rw [hasFPowerSeriesAt_iff] + filter_upwards [Metric.ball_mem_nhds (0 : ℂ) (by norm_num : (0 : ℝ) < 1)] with z hz + have hn : ‖z‖ < 1 := by simpa only [Metric.mem_ball, dist_zero_right] using hz + simpa only [FormalMultilinearSeries.coeff_ofScalars, zero_add, smul_eq_mul, mul_comm] using + hasSum_formal_logTail T hn + +theorem hasSum_coeff_mul {f g : PowerSeries ℂ} {x y z : ℂ} + (hf : HasSum (fun n => PowerSeries.coeff n f * z ^ n) x) + (hg : HasSum (fun n => PowerSeries.coeff n g * z ^ n) y) : + HasSum (fun n => PowerSeries.coeff n (f * g) * z ^ n) (x * y) := by + have hfn := hf.summable.norm + have hgn := hg.summable.norm + have hs := (summable_norm_sum_mul_antidiagonal_of_summable_norm hfn hgn).of_norm.hasSum + have heq := tsum_mul_tsum_eq_tsum_sum_antidiagonal_of_summable_norm hfn hgn + rw [hf.tsum_eq, hg.tsum_eq] at heq + rw [← heq] at hs + convert hs using 1 + funext n + rw [PowerSeries.coeff_mul, Finset.sum_mul] + apply Finset.sum_congr rfl + intro a ha + have he : a.1 + a.2 = n := Finset.HasAntidiagonal.mem_antidiagonal.mp ha + rw [← he, pow_add] + ring + +theorem hasSum_coeff_one (z : ℂ) : + HasSum (fun n => PowerSeries.coeff n (1 : PowerSeries ℂ) * z ^ n) 1 := by + convert hasSum_ite_eq 0 (1 : ℂ) using 1 + funext n + by_cases hn : n = 0 <;> simp [PowerSeries.coeff_one, hn] + + theorem hasSum_coeff_pow {f : PowerSeries ℂ} {x z : ℂ} + (hf : HasSum (fun n => PowerSeries.coeff n f * z ^ n) x) (d : ℕ) : + HasSum (fun n => PowerSeries.coeff n (f ^ d) * z ^ n) (x ^ d) := by + induction d with + | zero => simpa only [pow_zero] using hasSum_coeff_one z + | succ d hd => simpa only [pow_succ] using hasSum_coeff_mul hd hf + +theorem hasSum_formal_prod_logTail {ι : Type*} (s : Finset ι) (T d : ι → ℕ) + {z : ℂ} (hz : ‖z‖ < 1) : + HasSum (fun n => PowerSeries.coeff n + (∏ i ∈ s, RowTranslation.tail (T i) (PowerSeries.log ℂ) ^ d i) * z ^ n) + (∏ i ∈ s, logTail (T i) z ^ d i) := by + classical + induction s using Finset.induction_on with + | empty => simpa only [Finset.prod_empty] using hasSum_coeff_one z + | @insert i s hi hs => + simpa only [Finset.prod_insert hi] using + hasSum_coeff_mul (hasSum_coeff_pow (hasSum_formal_logTail (T i) hz) (d i)) hs + +theorem hasFPowerSeriesAt_prod_logTail {ι : Type*} (s : Finset ι) (T d : ι → ℕ) : + HasFPowerSeriesAt (fun z => ∏ i ∈ s, logTail (T i) z ^ d i) + (FormalMultilinearSeries.ofScalars ℂ + (fun n => PowerSeries.coeff n + (∏ i ∈ s, RowTranslation.tail (T i) (PowerSeries.log ℂ) ^ d i))) 0 := by + rw [hasFPowerSeriesAt_iff] + filter_upwards [Metric.ball_mem_nhds (0 : ℂ) (by norm_num : (0 : ℝ) < 1)] with z hz + have hn : ‖z‖ < 1 := by simpa only [Metric.mem_ball, dist_zero_right] using hz + simpa only [FormalMultilinearSeries.coeff_ofScalars, zero_add, smul_eq_mul, mul_comm] using + hasSum_formal_prod_logTail s T d hn + +theorem rowTest_prod_logTail_eq_coeff {ι : Type*} (s : Finset ι) (T d : ι → ℕ) (k : ℕ) : + AnalyticCollision.rowTest k (fun z => ∏ i ∈ s, logTail (T i) z ^ d i) = + PowerSeries.coeff k (∏ i ∈ s, RowTranslation.tail (T i) (PowerSeries.log ℂ) ^ d i) := by + have hd : DifferentiableOn ℂ (fun z => ∏ i ∈ s, logTail (T i) z ^ d i) + (Metric.closedBall 0 (1 / 2)) := by + intro z hz + apply (analyticAt_prod_logTail s T d ?_).differentiableAt.differentiableWithinAt + have hz' : ‖z‖ ≤ 1 / 2 := by simpa only [Metric.mem_closedBall, dist_zero_right] using hz + linarith + have hp := hd.hasFPowerSeriesOnBall (R := (1 / 2 : NNReal)) (by norm_num) + have he := hp.hasFPowerSeriesAt.eq_formalMultilinearSeries + (hasFPowerSeriesAt_prod_logTail s T d) + have hh := congrArg (fun p : FormalMultilinearSeries ℂ ℂ ℂ => p k (fun _ => 1)) he + simpa only [AnalyticCollision.rowTest, FormalMultilinearSeries.apply_eq_prod_smul_coeff, + Finset.prod_const_one, one_smul, FormalMultilinearSeries.coeff_ofScalars, + NNReal.coe_div, NNReal.coe_one, NNReal.coe_ofNat] using hh + +theorem norm_coeff_prod_formal_logTail_le {ι : Type*} (s : Finset ι) (T d : ι → ℕ) + (hT : ∀ i ∈ s, 1 ≤ T i) (k : ℕ) : + ‖PowerSeries.coeff k (∏ i ∈ s, RowTranslation.tail (T i) (PowerSeries.log ℂ) ^ d i)‖ ≤ + (2 : ℝ) ^ k := by + rw [← rowTest_prod_logTail_eq_coeff] + exact norm_rowTest_prod_logTail_le s T d hT k + +theorem rowTest_tail_budget {ι : Type*} (s : Finset ι) (T d : ι → ℕ) (k : ℕ) + (hk : AnalyticCollision.rowTest k (fun z => ∏ i ∈ s, logTail (T i) z ^ d i) ≠ 0) : + ∑ i ∈ s, d i * T i ≤ k := by + rw [rowTest_prod_logTail_eq_coeff] at hk + exact RowTranslation.tail_budget_nat s T d (fun _ => PowerSeries.log ℂ) k hk + +end PiExponent.LogTailAnalytic + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/LogarithmicContactIdeal.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/LogarithmicContactIdeal.lean new file mode 100644 index 0000000000000000000000000000000000000000..939b3633636f314320bdf8b8426ba10fa4a533b9 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/LogarithmicContactIdeal.lean @@ -0,0 +1,139 @@ +import OAI.NumberTheory.PiExponent.Jets.BranchContactIdeal +import OAI.NumberTheory.PiExponent.Jets.DVRBranchJet +import OAI.NumberTheory.PiExponent.Jets.FormalBranchContact + +namespace OAI + +noncomputable section + +namespace PiExponent.LogarithmicContactIdeal + +variable {A : Type*} [CommRing A] [IsDomain A] [IsDiscreteValuationRing A] + [Algebra ℂ A] [Algebra.IsIntegral ℂ (IsLocalRing.ResidueField A)] + +def truncatedCoordinates {m : ℕ} (c : Fin m → ℂ) (y : A) (x : Fin m → A) + (T : Fin m → ℕ) : Fin (m+1) → A := + Fin.cases (y-1) (fun i => x i - algebraMap ℂ A (c i) - + Polynomial.aeval (y-1) (PowerSeries.trunc (T i) (PowerSeries.log ℂ))) + +def logarithmicIdeal {m : ℕ} (c : Fin m → ℂ) (y : A) (x : Fin m → A) + (T : Fin m → ℕ) (e : Fin (m+1) → ℕ) : Ideal A := + BranchContactIdeal.powerIdeal (truncatedCoordinates c y x T) e + +theorem expansion_polynomial_aeval (z : A) (p : Polynomial ℂ) : + DVRBranch.expansion ℂ A (Polynomial.aeval z p) = + Polynomial.aeval (DVRBranch.expansion ℂ A z) p := by + have hh : (DVRBranch.expansion ℂ A).comp (Polynomial.aeval z) = + Polynomial.aeval (DVRBranch.expansion ℂ A z) := by + apply Polynomial.algHom_ext + simp + exact AlgHom.congr_fun hh p + +theorem expansion_truncatedCoordinates {m : ℕ} + (c : Fin m → ℂ) (y : A) (x : Fin m → A) (T : Fin m → ℕ) + (hy : CurveLocalOrder.residueAugmentation ℂ A y = 1) : + (fun i => DVRBranch.expansion ℂ A (truncatedCoordinates c y x T i)) = + FormalBranchContact.truncatedBranchCoordinates c (DVRBranch.expansion ℂ A y) + (fun i => DVRBranch.expansion ℂ A (x i)) T := by + have ht : PowerSeries.constantCoeff (DVRBranch.expansion ℂ A y - 1) = 0 := by + simp [hy] + have hs := PowerSeries.HasSubst.of_constantCoeff_zero' ht + funext i + cases i using Fin.cases with + | zero => simp [truncatedCoordinates, FormalBranchContact.truncatedBranchCoordinates] + | succ i => + simp only [truncatedCoordinates, FormalBranchContact.truncatedBranchCoordinates, + Fin.cases_succ, map_sub, map_one, AlgHom.commutes, expansion_polynomial_aeval] + rw [PowerSeries.subst_coe hs] + rfl + +theorem truncatedCoordinates_nonzero {m : ℕ} + (v : Fin (m+1) → ℚ) (hv : ∀ i, 0 < v i) + (c : Fin m → ℂ) (y : A) (x : Fin m → A) + (hy : CurveLocalOrder.residueAugmentation ℂ A y = 1) + (hx : ∀ i, CurveLocalOrder.residueAugmentation ℂ A (x i) = c i) + (hnc : y ≠ 1 ∨ ∃ i, x i ≠ algebraMap ℂ A (c i)) + (T : Fin m → ℕ) (hT : ∀ i, v i.succ < (T i : ℚ) * v 0) : + ∃ i, truncatedCoordinates c y x T i ≠ 0 := by + have hn := FormalBranchContact.truncatedBranchCoordinates_not_all_zero v hv c + (DVRBranch.expansion ℂ A y) (fun i => DVRBranch.expansion ℂ A (x i)) + (by simpa using hy) (fun i => by simpa using hx i) + (DVRBranchJet.coordinates_nonzero c y x hnc) T hT + rw [← expansion_truncatedCoordinates c y x T hy] at hn + obtain ⟨i, hi⟩ := hn + refine ⟨i, ?_⟩ + intro hz + apply hi + change DVRBranch.expansion ℂ A (truncatedCoordinates c y x T i) = 0 + rw [hz, map_zero] + +theorem branchContact_congr {ι : Type*} [Fintype ι] + (v : ι → ℚ) (a b : ι → PowerSeries ℂ) + (ha : ∃ i, a i ≠ 0) (hb : ∃ i, b i ≠ 0) (hab : a = b) : + BranchContact.contact v a ha = BranchContact.contact v b hb := by + subst b + rfl + +theorem truncated_contact_eq {m : ℕ} + (v : Fin (m+1) → ℚ) (hv : ∀ i, 0 < v i) + (c : Fin m → ℂ) (y : A) (x : Fin m → A) + (hy : CurveLocalOrder.residueAugmentation ℂ A y = 1) + (hx : ∀ i, CurveLocalOrder.residueAugmentation ℂ A (x i) = c i) + (hnc : y ≠ 1 ∨ ∃ i, x i ≠ algebraMap ℂ A (c i)) + (T : Fin m → ℕ) (hT : ∀ i, v i.succ < (T i : ℚ) * v 0) : + BranchContactIdeal.contact v (truncatedCoordinates c y x T) + (truncatedCoordinates_nonzero v hv c y x hy hx hnc T hT) = + DVRBranchJet.contact v c y x hnc := by + unfold BranchContactIdeal.contact DVRBranchJet.contact + trans BranchContact.contact v + (FormalBranchContact.truncatedBranchCoordinates c (DVRBranch.expansion ℂ A y) + (fun i => DVRBranch.expansion ℂ A (x i)) T) + (FormalBranchContact.truncatedBranchCoordinates_not_all_zero v hv c + (DVRBranch.expansion ℂ A y) (fun i => DVRBranch.expansion ℂ A (x i)) + (by simpa using hy) (fun i => by simpa using hx i) + (DVRBranchJet.coordinates_nonzero c y x hnc) T hT) + · apply branchContact_congr + exact expansion_truncatedCoordinates c y x T hy + · exact FormalBranchContact.contact_truncatedBranchCoordinates_eq v hv c + (DVRBranch.expansion ℂ A y) (fun i => DVRBranch.expansion ℂ A (x i)) + (by simpa using hy) (fun i => by simpa using hx i) + (DVRBranchJet.coordinates_nonzero c y x hnc) T hT + +theorem logarithmicIdeal_colength_eq_contact {m : ℕ} + (v : Fin (m+1) → ℚ) (hv : ∀ i, 0 < v i) + (c : Fin m → ℂ) (y : A) (x : Fin m → A) + (hy : CurveLocalOrder.residueAugmentation ℂ A y = 1) + (hx : ∀ i, CurveLocalOrder.residueAugmentation ℂ A (x i) = c i) + (hnc : y ≠ 1 ∨ ∃ i, x i ≠ algebraMap ℂ A (c i)) + (T : Fin m → ℕ) (hT : ∀ i, v i.succ < (T i : ℚ) * v 0) + (R : ℚ) (e : Fin (m+1) → ℕ) (he : ∀ i, v i * (e i : ℚ) = R) : + ((Module.length A (A ⧸ logarithmicIdeal c y x T e)).toNat : ℚ) = + R * DVRBranchJet.contact v c y x hnc := by + change ((Module.length A (A ⧸ BranchContactIdeal.powerIdeal + (truncatedCoordinates c y x T) e)).toNat : ℚ) = _ + rw [BranchContactIdeal.colength_eq_contact v hv _ + (truncatedCoordinates_nonzero v hv c y x hy hx hnc T hT) R e he, + truncated_contact_eq v hv c y x hy hx hnc T hT] + +theorem logarithmicIdeal_colength_ne_top {m : ℕ} + (v : Fin (m+1) → ℚ) (hv : ∀ i, 0 < v i) + (c : Fin m → ℂ) (y : A) (x : Fin m → A) + (hy : CurveLocalOrder.residueAugmentation ℂ A y = 1) + (hx : ∀ i, CurveLocalOrder.residueAugmentation ℂ A (x i) = c i) + (hnc : y ≠ 1 ∨ ∃ i, x i ≠ algebraMap ℂ A (c i)) + (T : Fin m → ℕ) (hT : ∀ i, v i.succ < (T i : ℚ) * v 0) + (R : ℚ) (e : Fin (m+1) → ℕ) (he : ∀ i, v i * (e i : ℚ) = R) : + Module.length A (A ⧸ logarithmicIdeal c y x T e) ≠ ⊤ := by + obtain ⟨i, hi, heq, _⟩ := BranchContactIdeal.exists_generator_colength_eq_contact + v hv (truncatedCoordinates c y x T) + (truncatedCoordinates_nonzero v hv c y x hy hx hnc T hT) R e he + change Module.length A (A ⧸ BranchContactIdeal.powerIdeal + (truncatedCoordinates c y x T) e) ≠ ⊤ + rw [heq] + exact CurveLocalOrder.principal_colength_ne_top (pow_ne_zero _ hi) + +end PiExponent.LogarithmicContactIdeal + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/LogarithmicObstruction.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/LogarithmicObstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..4258b1caeb6f5ad944728f82e68d044497a81752 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/LogarithmicObstruction.lean @@ -0,0 +1,188 @@ +import Mathlib.Algebra.Polynomial.Derivation +import Mathlib.Algebra.Polynomial.Div +import Mathlib.RingTheory.LaurentSeries +import Mathlib.RingTheory.Trace.Defs +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +namespace PiExponent + +open scoped LaurentSeries Matrix + +theorem laurent_derivative_residue_eq_zero {K : Type*} [Field K] + (f : K⸨X⸩) : (LaurentSeries.derivative K f).coeff (-1) = 0 := by + simp [LaurentSeries.derivative] + +theorem laurent_derivative_ne_simple_pole {K : Type*} [Field K] + (f : K⸨X⸩) {c : K} (hc : c ≠ 0) : + LaurentSeries.derivative K f ≠ HahnSeries.single (-1) c := by + intro h + have hr := congrArg (fun z : K⸨X⸩ => z.coeff (-1)) h + exact hc (by simpa [laurent_derivative_residue_eq_zero] using hr.symm) + +open Polynomial + +theorem polynomial_logarithmic_equation_impossible {K : Type*} [Field K] [CharZero K] + (P Q : K[X]) (hQ : Q ≠ 0) (hcop : IsCoprime P Q) {c : K} (hc : c ≠ 0) : + X * (derivative P * Q - P * derivative Q) ≠ C c * Q ^ 2 := by + intro heq + obtain ⟨U, hfactor, hU⟩ := Q.exists_eq_pow_rootMultiplicity_mul_and_not_dvd hQ 0 + simp only [map_zero, sub_zero] at hfactor hU + have hU0 : U.coeff 0 ≠ 0 := fun h => hU (X_dvd_iff.mpr h) + cases hn : Q.rootMultiplicity 0 with + | zero => + have hQ0 : Q.coeff 0 ≠ 0 := by + rw [hfactor, hn] + simpa using hU0 + have hconst := congrArg (fun f : K[X] => f.coeff 0) heq + have hz : c * (Q.coeff 0) ^ 2 = 0 := by simpa [pow_two] using hconst.symm + exact (mul_ne_zero hc (pow_ne_zero _ hQ0)) hz + | succ n => + have hQfactor : Q = X ^ (n + 1) * U := by simpa [hn] using hfactor + have hQ0 : Q.coeff 0 = 0 := by simp [hQfactor] + have hP0 : P.coeff 0 ≠ 0 := by + intro hp + obtain ⟨A, B, hab⟩ := hcop + have hconst := congrArg (fun f : K[X] => f.coeff 0) hab + simp [hp, hQ0] at hconst + have hcancel : + X * derivative P * U - P * (C (n + 1 : K) * U + X * derivative U) = + C c * X ^ (n + 1) * U ^ 2 := by + apply mul_left_cancel₀ (pow_ne_zero (n + 1) (X_ne_zero (R := K))) + calc + X ^ (n + 1) * + (X * derivative P * U - P * (C (n + 1 : K) * U + X * derivative U)) = + X * (derivative P * Q - P * derivative Q) := by + rw [hQfactor, derivative_mul, derivative_X_pow_succ] + ring + _ = C c * Q ^ 2 := heq + _ = X ^ (n + 1) * (C c * X ^ (n + 1) * U ^ 2) := by rw [hQfactor]; ring + have hconst := congrArg (fun f : K[X] => f.coeff 0) hcancel + have hz : P.coeff 0 * ((n + 1 : K) * U.coeff 0) = 0 := by + simpa using hconst + exact (mul_ne_zero hP0 (mul_ne_zero (Nat.cast_add_one_ne_zero n) hU0)) hz + +theorem ratFunc_derivation_polynomial {K : Type*} [Field K] + (D : Derivation K (RatFunc K) (RatFunc K)) + (hDX : D RatFunc.X = 1) (p : K[X]) : + D (algebraMap K[X] (RatFunc K) p) = + algebraMap K[X] (RatFunc K) (derivative p) := by + simpa [RatFunc.aeval_X_left_eq_algebraMap, hDX] using D.comp_aeval_eq RatFunc.X p + +theorem ratFunc_derivation_ne_simple_pole {K : Type*} [Field K] [CharZero K] + (D : Derivation K (RatFunc K) (RatFunc K)) + (hDX : D RatFunc.X = 1) (r : RatFunc K) {c : K} (hc : c ≠ 0) : + D r ≠ RatFunc.C c / RatFunc.X := by + intro heq + have hquot := D.leibniz_div (algebraMap K[X] (RatFunc K) r.num) + (algebraMap K[X] (RatFunc K) r.denom) + rw [RatFunc.num_div_denom, ratFunc_derivation_polynomial D hDX, + ratFunc_derivation_polynomial D hDX] at hquot + have hder : D r = + algebraMap K[X] (RatFunc K) (derivative r.num * r.denom - r.num * derivative r.denom) / + (algebraMap K[X] (RatFunc K) r.denom) ^ 2 := by + rw [hquot] + simp only [smul_eq_mul, map_sub, map_mul, div_eq_mul_inv, inv_pow] + ring + have hden : algebraMap K[X] (RatFunc K) r.denom ≠ 0 := + RatFunc.algebraMap_ne_zero r.denom_ne_zero + have hx : (RatFunc.X : RatFunc K) ≠ 0 := by + rw [← RatFunc.algebraMap_X] + exact RatFunc.algebraMap_ne_zero X_ne_zero + have hcross := (div_eq_div_iff (pow_ne_zero 2 hden) hx).mp (hder.symm.trans heq) + apply polynomial_logarithmic_equation_impossible r.num r.denom r.denom_ne_zero + r.isCoprime_num_denom hc + apply RatFunc.algebraMap_injective K + simpa only [map_mul, map_pow, RatFunc.algebraMap_X, RatFunc.algebraMap_C, mul_comm] using hcross + +theorem derivation_intermediate_smul + {k F E : Type*} [Field k] [Field F] [Field E] + [Algebra k F] [Algebra k E] [Algebra F E] [IsScalarTower k F E] + (d : Derivation k F F) (D : Derivation k E E) + (hcompat : ∀ a : F, D (algebraMap F E a) = algebraMap F E (d a)) + (a : F) (z : E) : D (a • z) = d a • z + a • D z := by + rw [Algebra.smul_def, D.leibniz, hcompat] + simp only [smul_eq_mul, Algebra.smul_def] + ring + +theorem derivation_basis_coordinates + {k F E ι : Type*} [Field k] [Field F] [Field E] [Fintype ι] + [Algebra k F] [Algebra k E] [Algebra F E] [IsScalarTower k F E] + (d : Derivation k F F) (D : Derivation k E E) + (hcompat : ∀ a : F, D (algebraMap F E a) = algebraMap F E (d a)) + (b : Module.Basis ι F E) (z : E) (i : ι) : + b.repr (D z) i = d (b.repr z i) + + ∑ j, b.repr z j * b.repr (D (b j)) i := by + classical + conv_lhs => rw [← b.sum_repr z] + simp only [map_sum, derivation_intermediate_smul d D hcompat, map_add, + map_smul, Finset.sum_add_distrib, Finsupp.coe_add, Pi.add_apply, + Finsupp.coe_finsetSum, Finset.sum_apply, Finsupp.coe_smul, Pi.smul_apply, smul_eq_mul] + simp [Finsupp.single_apply, eq_comm] + +theorem derivation_trace_of_basis + {k F E ι : Type*} [Field k] [Field F] [Field E] [Fintype ι] + [Algebra k F] [Algebra k E] [Algebra F E] [IsScalarTower k F E] + (d : Derivation k F F) (D : Derivation k E E) + (hcompat : ∀ a : F, D (algebraMap F E a) = algebraMap F E (d a)) + (b : Module.Basis ι F E) (x : E) : + d (Algebra.trace F E x) = Algebra.trace F E (D x) := by + classical + let M := Algebra.leftMulMatrix b x + let N : Matrix ι ι F := fun i j => b.repr (D (b j)) i + have hentry (i j : ι) : + Algebra.leftMulMatrix b (D x) i j + (M * N) i j = + d (M i j) + (N * M) i j := by + have hMN : (M * N) i j = ∑ t, M i t * N t j := rfl + have hNM : (N * M) i j = ∑ t, N i t * M t j := rfl + have hz := derivation_basis_coordinates d D hcompat b (x * b j) i + have hm := congrFun (Algebra.leftMulMatrix_mulVec_repr b x (D (b j))) i + have hl : b.repr (D (x * b j)) i = + Algebra.leftMulMatrix b (D x) i j + (M * N) i j := by + rw [hMN, D.leibniz] + simp only [smul_eq_mul, map_add, Finsupp.add_apply] + rw [← hm] + simp only [M, N, Algebra.leftMulMatrix_eq_repr_mul, + Matrix.mulVec, dotProduct, mul_comm, add_comm] + rw [hl] at hz + simpa only [hNM, M, N, Algebra.leftMulMatrix_eq_repr_mul, mul_comm] using hz + have hs := Finset.sum_congr rfl (fun i (_ : i ∈ Finset.univ) => hentry i i) + have ht : Matrix.trace (Algebra.leftMulMatrix b (D x)) + Matrix.trace (M * N) = + d (Matrix.trace M) + Matrix.trace (N * M) := by + simpa only [Matrix.trace, Matrix.diag_apply, Finset.sum_add_distrib, map_sum] using hs + rw [Matrix.trace_mul_comm M N] at ht + have ht' := add_right_cancel ht + simpa only [Algebra.trace_eq_matrix_trace b, M] using ht'.symm + +theorem finite_extension_derivation_ne_simple_pole + {K E : Type*} [Field K] [CharZero K] [Field E] + [Algebra K E] [Algebra (RatFunc K) E] [IsScalarTower K (RatFunc K) E] + [FiniteDimensional (RatFunc K) E] + (d : Derivation K (RatFunc K) (RatFunc K)) (D : Derivation K E E) + (hdX : d RatFunc.X = 1) + (hcompat : ∀ a : RatFunc K, + D (algebraMap (RatFunc K) E a) = algebraMap (RatFunc K) E (d a)) + (x : E) {c : K} (hc : c ≠ 0) : + D x ≠ algebraMap (RatFunc K) E (RatFunc.C c / RatFunc.X) := by + intro hx + have ht := derivation_trace_of_basis d D hcompat + (Module.finBasis (RatFunc K) E) x + rw [hx, Algebra.trace_algebraMap] at ht + have hdegree : (Module.finrank (RatFunc K) E : K) ≠ 0 := by + exact Nat.cast_ne_zero.mpr (ne_of_gt (Module.finrank_pos (R := RatFunc K) (M := E))) + apply ratFunc_derivation_ne_simple_pole d hdX (Algebra.trace (RatFunc K) E x) + (mul_ne_zero hdegree hc) + calc + d (Algebra.trace (RatFunc K) E x) = + Module.finrank (RatFunc K) E • (RatFunc.C c / RatFunc.X) := ht + _ = RatFunc.C ((Module.finrank (RatFunc K) E : K) * c) / RatFunc.X := by + simp only [map_mul, map_natCast, nsmul_eq_mul, mul_div_assoc] + +end PiExponent + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/PeriodAnalytic.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/PeriodAnalytic.lean new file mode 100644 index 0000000000000000000000000000000000000000..49db2e8eec54400c2ff900df85e081762040aecf --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/PeriodAnalytic.lean @@ -0,0 +1,172 @@ +import OAI.NumberTheory.PiExponent.Analysis.LogTailAnalytic +import OAI.NumberTheory.PiExponent.Approximation.MatrixTranslation + +namespace OAI + +open scoped BigOperators +open PiExponent.AnalyticCollision PiExponent.LogTailAnalytic + +namespace PiExponent.PeriodAnalytic + +noncomputable def periodSeries (b center : ℂ) (h d : ℕ) : PowerSeries ℂ := + PowerSeries.C b * (1 + PowerSeries.X) ^ h * + (PowerSeries.C center + PowerSeries.log ℂ) ^ d + +noncomputable def periodFunction (b center : ℂ) (h d : ℕ) (t : ℂ) : ℂ := + b * (1 + t) ^ h * (center + Complex.log (1 + t)) ^ d + +theorem hasSum_coeff_C (b z : ℂ) : + HasSum (fun n => PowerSeries.coeff n (PowerSeries.C b) * z ^ n) b := by + convert hasSum_ite_eq 0 b using 1 + funext n + by_cases hn : n = 0 <;> simp [PowerSeries.coeff_C, hn] + +theorem hasSum_coeff_X (z : ℂ) : + HasSum (fun n => PowerSeries.coeff n (PowerSeries.X : PowerSeries ℂ) * z ^ n) z := by + convert hasSum_ite_eq 1 z using 1 + funext n + by_cases hn : n = 1 <;> simp [PowerSeries.coeff_X, hn] + +theorem hasSum_coeff_add {f g : PowerSeries ℂ} {x y z : ℂ} + (hf : HasSum (fun n => PowerSeries.coeff n f * z ^ n) x) + (hg : HasSum (fun n => PowerSeries.coeff n g * z ^ n) y) : + HasSum (fun n => PowerSeries.coeff n (f + g) * z ^ n) (x + y) := by + simpa only [map_add, add_mul] using hf.add hg + +theorem hasSum_periodSeries (b center : ℂ) (h d : ℕ) {z : ℂ} (hz : ‖z‖ < 1) : + HasSum (fun n => PowerSeries.coeff n (periodSeries b center h d) * z ^ n) + (periodFunction b center h d z) := by + exact hasSum_coeff_mul + (hasSum_coeff_mul (hasSum_coeff_C b z) + (hasSum_coeff_pow (hasSum_coeff_add (hasSum_coeff_one z) (hasSum_coeff_X z)) h)) + (hasSum_coeff_pow (hasSum_coeff_add (hasSum_coeff_C center z) (hasSum_formal_log hz)) d) + +theorem analyticAt_periodFunction (b center : ℂ) (h d : ℕ) {z : ℂ} (hz : ‖z‖ < 1) : + AnalyticAt ℂ (periodFunction b center h d) z := by + unfold periodFunction + apply AnalyticAt.mul + · fun_prop + · exact (analyticAt_const.add ((analyticAt_const.add analyticAt_id).clog + (Complex.mem_slitPlane_of_norm_lt_one hz))).pow d + +theorem hasFPowerSeriesAt_periodFunction (b center : ℂ) (h d : ℕ) : + HasFPowerSeriesAt (periodFunction b center h d) + (FormalMultilinearSeries.ofScalars ℂ (fun n => PowerSeries.coeff n + (periodSeries b center h d))) 0 := by + rw [hasFPowerSeriesAt_iff] + filter_upwards [Metric.ball_mem_nhds (0 : ℂ) (by norm_num : (0 : ℝ) < 1)] with z hz + have hn : ‖z‖ < 1 := by simpa only [Metric.mem_ball, dist_zero_right] using hz + simpa only [FormalMultilinearSeries.coeff_ofScalars, zero_add, smul_eq_mul, mul_comm] using + hasSum_periodSeries b center h d hn + +theorem rowTest_periodFunction_eq_coeff (b center : ℂ) (h d ell : ℕ) : + rowTest ell (periodFunction b center h d) = + PowerSeries.coeff ell (periodSeries b center h d) := by + have hd : DifferentiableOn ℂ (periodFunction b center h d) + (Metric.closedBall 0 (1 / 2)) := by + intro z hz + apply (analyticAt_periodFunction b center h d ?_).differentiableAt.differentiableWithinAt + have hz' : ‖z‖ ≤ 1 / 2 := by simpa only [Metric.mem_closedBall, dist_zero_right] using hz + linarith + have hp := hd.hasFPowerSeriesOnBall (R := (1 / 2 : NNReal)) (by norm_num) + have he := hp.hasFPowerSeriesAt.eq_formalMultilinearSeries + (hasFPowerSeriesAt_periodFunction b center h d) + have hh := congrArg (fun p : FormalMultilinearSeries ℂ ℂ ℂ => p ell (fun _ => 1)) he + simpa only [rowTest, FormalMultilinearSeries.apply_eq_prod_smul_coeff, + Finset.prod_const_one, one_smul, FormalMultilinearSeries.coeff_ofScalars, + NNReal.coe_div, NNReal.coe_one, NNReal.coe_ofNat] using hh + +theorem rowTest_congr_sphere {f g : ℂ → ℂ} + (hfg : ∀ z ∈ Metric.sphere (0 : ℂ) (1 / 2), f z = g z) (ell : ℕ) : + rowTest ell f = rowTest ell g := by + simp only [rowTest, cauchyPowerSeries_apply] + congr 1 + apply circleIntegral.integral_congr (by norm_num) + intro z hz + change (1 / (z - 0)) ^ ell • (z - 0)⁻¹ • f z = + (1 / (z - 0)) ^ ell • (z - 0)⁻¹ • g z + rw [hfg z hz] + +theorem periodFunction_eq_exponentialMonomial (b center : ℂ) (h d : ℕ) + (hcenter : Complex.exp center = 1) {z : ℂ} (hz : ‖z‖ < 1) : + periodFunction b center h d z = + exponentialMonomial b (h : ℂ) d (center + Complex.log (1 + z)) := by + have hz0 : 1 + z ≠ 0 := by + intro heq + have heq' : z = -1 := by linear_combination heq + simp [heq'] at hz + unfold periodFunction exponentialMonomial + rw [Complex.exp_nat_mul, Complex.exp_add, hcenter, Complex.exp_log hz0, one_mul] + +theorem exp_period_center (j : ℕ) : + Complex.exp ((j : ℂ) * (2 * (Real.pi : ℂ) * Complex.I)) = 1 := by + rw [Complex.exp_nat_mul, Complex.exp_two_pi_mul_I, one_pow] + +theorem rowTest_exponentialMonomial_eq_coeff (b : ℂ) (j h d ell : ℕ) : + rowTest ell (fun t => exponentialMonomial b (h : ℂ) d + ((j : ℂ) * (2 * (Real.pi : ℂ) * Complex.I) + Complex.log (1 + t))) = + PowerSeries.coeff ell (periodSeries b ((j : ℂ) * (2 * (Real.pi : ℂ) * Complex.I)) h d) := by + rw [← rowTest_periodFunction_eq_coeff] + apply rowTest_congr_sphere + intro t ht + symm + apply periodFunction_eq_exponentialMonomial _ _ _ _ (exp_period_center j) + have hn : ‖t‖ = (1 / 2 : ℝ) := by simpa only [Metric.mem_sphere, dist_zero_right] using ht + rw [hn] + norm_num + +theorem periodMonomial_coeff_eq_rowTest {m : ℕ} (j h ell : ℕ) + (a : Fin m → ℕ) (A : Fin m →₀ ℕ) : + PowerSeries.coeff ell ((MatrixTranslation.periodMonomial j + (2 * (Real.pi : ℂ) * Complex.I) h a).coeff A) = + rowTest ell (fun t => exponentialMonomial + ((∏ i, (a i).choose (A i) : ℕ) : ℂ) (h : ℂ) (∑ i : Fin m, (a i - A i)) + ((j : ℂ) * (2 * (Real.pi : ℂ) * Complex.I) + Complex.log (1 + t))) := by + rw [rowTest_exponentialMonomial_eq_coeff, MatrixTranslation.periodMonomial_coeff] + simp only [periodSeries, MatrixTranslation.periodCoordinate, map_natCast] + +theorem norm_binomial_product_le {m : ℕ} (a : Fin m → ℕ) (A : Fin m →₀ ℕ) : + ‖((∏ i, (a i).choose (A i) : ℕ) : ℂ)‖ ≤ (2 : ℝ) ^ (∑ i, a i) := by + rw [Complex.norm_natCast] + have h : (∏ i, (a i).choose (A i) : ℕ) ≤ 2 ^ (∑ i, a i) := by + calc + _ ≤ ∏ i, 2 ^ a i := Finset.prod_le_prod (fun i _ => Nat.choose_le_two_pow _ _) + _ = _ := Finset.prod_pow_eq_pow_sum _ _ _ + exact_mod_cast h + +noncomputable def columnFunction {m : ℕ} (h : ℕ) (a : Fin m → ℕ) + (A : Fin m →₀ ℕ) : ℂ → ℂ := + exponentialMonomial ((∏ i, (a i).choose (A i) : ℕ) : ℂ) (h : ℂ) + (∑ i : Fin m, (a i - A i)) + +theorem differentiable_columnFunction {m : ℕ} (h : ℕ) (a : Fin m → ℕ) + (A : Fin m →₀ ℕ) : Differentiable ℂ (columnFunction h a A) := + differentiable_exponentialMonomial _ _ _ + +theorem norm_columnFunction_le {m : ℕ} (h : ℕ) (a : Fin m → ℕ) + (A : Fin m →₀ ℕ) (w : Fin m → ℝ) {R H w0 wstar : ℝ} + (hR : 1 ≤ R) (hH : 0 ≤ H) (hw0 : 0 < w0) (hws : 0 < wstar) + (hw : ∀ i, wstar ≤ w i) (hcol : w0 * h + ∑ i, w i * a i ≤ H) + {z : ℂ} (hz : ‖z‖ ≤ R) : + ‖columnFunction h a A z‖ ≤ + Real.exp (H * (R / w0 + Real.log (2 * R) / wstar)) := by + have hwpos (i) : 0 ≤ w i := hws.le.trans (hw i) + have hsum0 : 0 ≤ ∑ i, w i * a i := Finset.sum_nonneg fun i _ => mul_nonneg (hwpos i) (Nat.cast_nonneg _) + have hh : ‖(h : ℂ)‖ ≤ H / w0 := by + rw [Complex.norm_natCast, le_div_iff₀ hw0] + nlinarith + have htot : (((∑ i, a i : ℕ) : ℝ)) ≤ H / wstar := by + rw [le_div_iff₀ hws] + have hs : wstar * ∑ i, (a i : ℝ) ≤ ∑ i, w i * a i := by + rw [Finset.mul_sum] + exact Finset.sum_le_sum fun i _ => mul_le_mul_of_nonneg_right (hw i) (Nat.cast_nonneg _) + have hcast : ((∑ i, a i : ℕ) : ℝ) = ∑ i, (a i : ℝ) := by push_cast; rfl + rw [hcast] + nlinarith + exact norm_exponentialMonomial_le_exp_budget _ _ _ _ hR hH hw0 hws hz + (norm_binomial_product_le a A) hh + (Finset.sum_le_sum fun i _ => Nat.sub_le _ _) htot + +end PiExponent.PeriodAnalytic + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/RegularSequenceSeries.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/RegularSequenceSeries.lean new file mode 100644 index 0000000000000000000000000000000000000000..40ac25c625aa1745b314af001ad3d1a6504a0147 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/RegularSequenceSeries.lean @@ -0,0 +1,75 @@ +import Mathlib.Algebra.Ring.GeomSum +import OAI.NumberTheory.PiExponent.LocalAlgebra.RegularPrefixes +import OAI.NumberTheory.PiExponent.Polynomials.HilbertPolynomialBase + +namespace OAI + +namespace PiExponentJets.W64 + +open scoped BigOperators +attribute [local instance] MvPolynomial.gradedAlgebra + +variable {k σ : Type*} [Field k] [Finite σ] + +noncomputable def degreeAt {m : ℕ} (degrees : Fin m → ℕ) (i : ℕ) : ℕ := + if hi : i < m then degrees ⟨i, hi⟩ else 0 + +theorem regular_prefix_series + (rs : List (MvPolynomial σ k)) (degrees : Fin rs.length → ℕ) + (hhom : ∀ i : Fin rs.length, rs[i].IsHomogeneous (degrees i)) + (hreg : RingTheory.Sequence.IsRegular (MvPolynomial σ k) rs) + (n : ℕ) (hn : n ≤ rs.length) : + sectionHilbertSeries (Ideal.ofList (rs.take n)) = + (∏ i ∈ Finset.range n, (1 - PowerSeries.X ^ degreeAt degrees i)) * + sectionHilbertSeries (⊥ : Ideal (MvPolynomial σ k)) := by + induction n with + | zero => simp + | succ n ih => + have hlt : n < rs.length := hn + have hn' : n ≤ rs.length := Nat.le_of_lt hlt + rw [PiExponentSiegel.W20.prefixIdeal_succ rs ⟨n, hlt⟩] + simp only [Fin.getElem_fin] + have hh : (rs[n]'hlt).IsHomogeneous (degrees ⟨n, hlt⟩) := by + simpa only [Fin.getElem_fin] using hhom ⟨n, hlt⟩ + have hr : IsRightRegular (Ideal.Quotient.mk (Ideal.ofList (rs.take n)) (rs[n]'hlt)) := by + simpa only [Fin.getElem_fin] using + PiExponentSiegel.W20.regular_next_mod_prefix rs hreg ⟨n, hlt⟩ + rw [sectionHilbertSeries_regular_step _ + (PiExponentSiegel.W20.prefixIdeal_homogeneous rs degrees hhom n) + (rs[n]'hlt) hh hr] + rw [ih hn', Finset.prod_range_succ] + simp only [degreeAt, dite_eq_left hlt] + ac_rfl + +theorem degree_factors_mul_invOneSubPow (D : ℕ → ℕ) (m : ℕ) : + (∏ i ∈ Finset.range m, (1 - (PowerSeries.X : PowerSeries ℤ) ^ D i)) * + (PowerSeries.invOneSubPow ℤ m).val = + ∏ i ∈ Finset.range m, ∑ j ∈ Finset.range (D i), + (PowerSeries.X : PowerSeries ℤ) ^ j := by + have hfactor : + (∏ i ∈ Finset.range m, (1 - (PowerSeries.X : PowerSeries ℤ) ^ D i)) = + (∏ i ∈ Finset.range m, ∑ j ∈ Finset.range (D i), + (PowerSeries.X : PowerSeries ℤ) ^ j) * (1 - PowerSeries.X) ^ m := by + simp_rw [← geom_sum_mul_neg] + rw [Finset.prod_mul_distrib] + simp + rw [hfactor, mul_assoc, ← PowerSeries.invOneSubPow_inv_eq_one_sub_pow] + rw [(PowerSeries.invOneSubPow ℤ m).inv_val, mul_one] + +theorem regular_sequence_series_geometric [Fintype σ] + (hσ : 0 < Fintype.card σ) + (rs : List (MvPolynomial σ k)) (degrees : Fin rs.length → ℕ) + (hhom : ∀ i : Fin rs.length, rs[i].IsHomogeneous (degrees i)) + (hreg : RingTheory.Sequence.IsRegular (MvPolynomial σ k) rs) + (hlen : rs.length = Fintype.card σ) : + sectionHilbertSeries (Ideal.ofList rs) = + ∏ i ∈ Finset.range rs.length, ∑ j ∈ Finset.range (degreeAt degrees i), + (PowerSeries.X : PowerSeries ℤ) ^ j := by + have h := regular_prefix_series rs degrees hhom hreg rs.length le_rfl + simp only [List.take_length] at h + rw [h, sectionHilbertSeries_bot hσ, ← hlen] + exact degree_factors_mul_invOneSubPow (degreeAt degrees) rs.length + +end PiExponentJets.W64 + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Analysis/TranslationCountLimit.lean b/lean/OAI/NumberTheory/PiExponent/Analysis/TranslationCountLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..23f6866046887efa3419e4d0a227e6111f53f231 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Analysis/TranslationCountLimit.lean @@ -0,0 +1,47 @@ +import OAI.NumberTheory.PiExponent.Polynomials.SimplexFloor +import OAI.NumberTheory.PiExponent.Polynomials.SimplexLog + +namespace OAI + +open Filter Topology + +namespace PiExponent + +noncomputable def translationTermCount (m : ℕ) (v H : ℝ) : ℕ := + (⌊H⌋₊ + 1) ^ (2 * m) * (⌊H / v⌋₊ + 1) + +theorem tendsto_natFloor_mul_add_one_div {a : ℝ} (ha : 0 < a) : + Tendsto (fun H : ℝ => ((⌊a * H⌋₊ + 1 : ℕ) : ℝ) / H) atTop (𝓝 a) := by + have h := (tendsto_natFloor_affine_div ha 0).add (tendsto_id.const_div_atTop (1 : ℝ)) + simpa only [add_zero, id_eq, Nat.cast_add, Nat.cast_one, add_div] using h + +theorem tendsto_translationTermCount_normalized (m : ℕ) {v : ℝ} (hv : 0 < v) : + Tendsto (fun H : ℝ => (translationTermCount m v H : ℝ) / H ^ (2 * m + 1)) + atTop (𝓝 (1 / v)) := by + have h₁ : Tendsto (fun H : ℝ => ((⌊H⌋₊ + 1 : ℕ) : ℝ) / H) atTop (𝓝 1) := by + simpa only [one_mul] using tendsto_natFloor_mul_add_one_div (show (0 : ℝ) < 1 by norm_num) + have h₂ : Tendsto (fun H : ℝ => ((⌊H / v⌋₊ + 1 : ℕ) : ℝ) / H) + atTop (𝓝 (1 / v)) := by + simpa only [one_div, div_eq_mul_inv, mul_comm, mul_one, one_mul] using + tendsto_natFloor_mul_add_one_div (div_pos zero_lt_one hv) + have h := (h₁.pow (2 * m)).mul h₂ + simp only [one_pow, one_mul] at h + convert h using 1 + ext H + simp only [translationTermCount, Nat.cast_mul, Nat.cast_pow, div_pow, div_mul_div_comm, + pow_succ] + +theorem tendsto_log_translationTermCount_div (m : ℕ) {v : ℝ} (hv : 0 < v) : + Tendsto (fun H : ℝ => Real.log (translationTermCount m v H : ℝ) / H) + atTop (𝓝 0) := + tendsto_log_div_of_normalized_pow (tendsto_translationTermCount_normalized m hv) + (div_pos zero_lt_one hv) + +theorem tendsto_log_translationTermCount_div_nat (m : ℕ) {v : ℝ} (hv : 0 < v) : + Tendsto (fun H : ℕ => Real.log (translationTermCount m v (H : ℝ) : ℝ) / (H : ℝ)) + atTop (𝓝 0) := + (tendsto_log_translationTermCount_div m hv).comp tendsto_natCast_atTop_atTop + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/AddEquivSignedSum.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/AddEquivSignedSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..1aaa58c63f476268ff124c671af293c645bd043f --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/AddEquivSignedSum.lean @@ -0,0 +1,22 @@ +import Mathlib + +namespace OAI + +namespace PiExponent.AddEquivSignedSum +open scoped BigOperators + +theorem map_signed_sum {A B : Type*} [AddCommGroup A] [AddCommGroup B] + (E : A ≃+ B) (q : ℕ) (f : Fin (q+2) → A) : + E (∑ k, (-1 : ℤ)^k.val • f k) = ∑ k, (-1 : ℤ)^k.val • E (f k) := by + simp only [map_sum, map_zsmul] + +theorem map_signed_sum_eq {A B : Type*} [AddCommGroup A] [AddCommGroup B] + (E : A ≃+ B) (q : ℕ) (f : Fin (q+2) → A) (g : Fin (q+2) → B) + (h : ∀ k, E (f k) = g k) : + E (∑ k, (-1 : ℤ)^k.val • f k) = ∑ k, (-1 : ℤ)^k.val • g k := by + rw [map_signed_sum] + exact Finset.sum_congr rfl (fun k _ => congrArg (fun z => (-1 : ℤ)^k.val • z) (h k)) + +end PiExponent.AddEquivSignedSum + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/AdditiveKernelTransport.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/AdditiveKernelTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..9dc6240e028a2695ea81049e616281809f9fd0f5 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/AdditiveKernelTransport.lean @@ -0,0 +1,46 @@ +import Mathlib + +namespace OAI + +namespace PiExponent.AdditiveKernelTransport + +variable {A A' B B' : Type*} + [AddCommGroup A] [AddCommGroup A'] [AddCommGroup B] [AddCommGroup B'] + +theorem equiv_zero (e : A ≃+ B) : e 0 = 0 := map_zero e + +def kernelEquiv (e : A ≃+ B) (e' : A' ≃+ B') + (d : A →+ A') (D : B →+ B') (h : ∀ x, e' (d x) = D (e x)) : + d.ker ≃+ D.ker where + toFun c := ⟨e c.val, by + change D (e c.val) = 0 + rw [← h, c.property, map_zero]⟩ + invFun c := ⟨e.symm c.val, by + change d (e.symm c.val) = 0 + apply e'.injective + rw [h, e.apply_symm_apply, map_zero] + exact c.property⟩ + left_inv c := Subtype.ext (e.symm_apply_apply c.val) + right_inv c := Subtype.ext (e.apply_symm_apply c.val) + map_add' c b := Subtype.ext (map_add e c.val b.val) + +theorem kernelEquiv_val (e : A ≃+ B) (e' : A' ≃+ B') + (d : A →+ A') (D : B →+ B') (h : ∀ x, e' (d x) = D (e x)) + (c : d.ker) : (kernelEquiv e e' d D h c).val = e c.val := rfl + +theorem transport_primitives {A₂ B₂ : Type*} [AddCommGroup A₂] [AddCommGroup B₂] + (e₀ : A ≃+ B) (e₁ : A' ≃+ B') (e₂ : A₂ ≃+ B₂) + (d₀ : A →+ A') (d₁ : A' →+ A₂) (D₀ : B →+ B') (D₁ : B' →+ B₂) + (h₀ : ∀ x, e₁ (d₀ x) = D₀ (e₀ x)) + (h₁ : ∀ x, e₂ (d₁ x) = D₁ (e₁ x)) + (hp : ∀ c, D₁ c = 0 → ∃ b, D₀ b = c) : + ∀ c, d₁ c = 0 → ∃ b, d₀ b = c := by + intro c hc + have hclosed : D₁ (e₁ c) = 0 := by rw [← h₁, hc, map_zero] + obtain ⟨b, hb⟩ := hp (e₁ c) hclosed + refine ⟨e₀.symm b, e₁.injective ?_⟩ + rw [h₀, e₀.apply_symm_apply, hb] + +end PiExponent.AdditiveKernelTransport + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleMatrixFrame.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleMatrixFrame.lean new file mode 100644 index 0000000000000000000000000000000000000000..c7d8370c242e33c767bd571fcfbae1f03a5937f6 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleMatrixFrame.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.PiExponent.Ampleness.WeightedAffineFrame +import OAI.NumberTheory.PiExponent.Jets.AffineJetCoefficientInterface + +namespace OAI + +noncomputable section +namespace PiExponent.AdmissibleMatrixInterpolation +open AdmissibleBlowupGeometry AlgebraicGeometry CategoryTheory PiExponentSeshadri.Geometry +attribute [local irreducible] WeightedCompactification.lineBundle + WeightedCompactification.affineChartMap + AffineJetCoefficientInterface.Frame + +theorem frame_exists_of_actual {X : Scheme} {R : Type} [CommRing R] + (j : Spec (CommRingCat.of R) ⟶ X) [IsOpenImmersion j] (A : LineBundle X) + (h : Nonempty (A.sheaf.restrict j.opensRange.ι ≅ + structureSheaf j.opensRange.toScheme)) : + Nonempty (AffineJetCoefficientInterface.Frame j A) := by + unfold AffineJetCoefficientInterface.Frame + exact h + +theorem monomialFrame_exists {R ι σ : Type} [CommRing R] + (a : σ → ι →₀ ℕ) (z : σ) (hz : a z = 0) + (coordinate : ι → σ) (hcoordinate : ∀ i, a (coordinate i) = Finsupp.single i 1) : + Nonempty (AffineJetCoefficientInterface.Frame + (WeightedCompactification.affineChartMap (R := R) a z hz coordinate hcoordinate) + (WeightedCompactification.lineBundle (R := R) a)) := by + exact frame_exists_of_actual + (X := Proj (WeightedCompactification.imageGrade (R := R) a)) + (R := MvPolynomial ι R) + (WeightedCompactification.affineChartMap (R := R) a z hz coordinate hcoordinate) + (WeightedCompactification.lineBundle (R := R) a) + (WeightedAffineFrame.affineFrame_nonempty (R := R) a z hz coordinate hcoordinate) + +theorem actualFrame_exists {ν Λ D : ℝ} (d : AdmissibleParameters ν Λ D) : + Nonempty (AffineJetCoefficientInterface.Frame (affineChart d) (hyperplane d)) := by + exact monomialFrame_exists (R := ℂ) + (exponents d) (constantIndex d) + ((scale d).exponents_constant d.curveDegreeWeights_pos) + (coordinateIndex d) ((scale d).exponents_coordinate d.curveDegreeWeights_pos) +end PiExponent.AdmissibleMatrixInterpolation + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleMatrixGeometry.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleMatrixGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..a684b7075f38134980a563da3968fcc9f13e50d2 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleMatrixGeometry.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.PiExponent.Approximation.AdmissibleMatrixFrame +import OAI.NumberTheory.PiExponent.Approximation.AdmissibleMatrixInterpolation +import OAI.NumberTheory.PiExponent.Approximation.WeightedGlobalSectionBound +import OAI.NumberTheory.PiExponent.Jets.AdmissibleJetPackets +import OAI.NumberTheory.PiExponent.Jets.AdmissibleJetSurjectivity + +namespace OAI + +noncomputable section +namespace PiExponent.AdmissibleMatrixInterpolation +open AlgebraicGeometry CategoryTheory Filter +open PiExponentSeshadri.Geometry +open DeterminantContradiction AdmissibleBlowupGeometry AdmissibleJetPackets +attribute [local irreducible] WeightedCompactification.lineBundle + WeightedCompactification.affineChartMap + AffineJetCoefficientInterface.Frame AffineJetCoefficientInterface.Sections + AffineJetCoefficientInterface.coefficient +variable {ν : ℝ} (d : FixedData ν) + +theorem eventual_packets_of_eventual_jetRestriction + (hjet : ∀ᶠ n : ℕ in atTop, Function.Surjective + (BlowupJetSurjectivity.jetRestriction (centerIdeal d) (hyperplane d) n)) : + ∀ᶠ n : ℕ in atTop, Function.Surjective (packetMap d n) := by + obtain ⟨N,hN⟩ := WeightedGlobalSectionBound.eventual_admissible_supportBound d + obtain ⟨e⟩ := actualFrame_exists d + filter_upwards [hjet, eventually_ge_atTop N] with n hn hnN + apply packetMap_surjective_of_family d n (sectionPolynomial d n e) + · intro s + exact hN n hnN e s + · exact formalPackets_surjective_of_jetRestriction d n e hn + +theorem globalInterpolation_of_eventual_jetRestriction + (hjet : ∀ ν : ℝ, 2 < ν → ∀ d : FixedData ν, + ∀ᶠ n : ℕ in atTop, Function.Surjective + (BlowupJetSurjectivity.jetRestriction (centerIdeal d) (hyperplane d) n)) : + GlobalInterpolationStatement := by + apply globalInterpolation_of_eventual_packets + intro ν hν d + exact eventual_packets_of_eventual_jetRestriction d (hjet ν hν d) + +theorem globalInterpolation : GlobalInterpolationStatement := by + apply globalInterpolation_of_eventual_jetRestriction + intro ν _ d + exact AdmissibleJetSurjectivity.eventually_jetRestriction_surjective d + +end PiExponent.AdmissibleMatrixInterpolation + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleMatrixInterpolation.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleMatrixInterpolation.lean new file mode 100644 index 0000000000000000000000000000000000000000..4020f7dd25e10186f64d56b7edbd47fb07b45921 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleMatrixInterpolation.lean @@ -0,0 +1,151 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AdmissibleBlowupGeometry +import OAI.NumberTheory.PiExponent.Approximation.DeterminantContradiction +import OAI.NumberTheory.PiExponent.Approximation.FormalMatrixSurjectivity +import OAI.NumberTheory.PiExponent.Approximation.WeightedSliceDegree + +namespace OAI + +noncomputable section +namespace PiExponent.AdmissibleMatrixInterpolation +open Filter +open DeterminantContradiction AdmissibleBlowupGeometry +variable {ν : ℝ} (d : FixedData ν) + +theorem degreeWeights_eq_matrix (i : Fin (d.m+1)) : + (d.curveDegreeWeights i : ℝ) = + InterpolationMatrix.columnWeights d.w0 + (MatrixArithmetic.logWeights (finiteDenominators d)) i := by + refine Fin.cases ?_ (fun j => ?_) i + · rfl + · simp only [AdmissibleParameters.curveDegreeWeights_succ, + d.cast_rationalWeight, InterpolationMatrix.columnWeights, Fin.cases_succ, + logWeights_eq] + +theorem jetWeights_eq_matrix (i : Fin (d.m+1)) : + (d.curveJetWeights i : ℝ) = + InterpolationMatrix.rowWeights d.v0 d.base.theta + (MatrixArithmetic.logWeights (finiteDenominators d)) i := by + refine Fin.cases ?_ (fun j => ?_) i + · rfl + · simp only [AdmissibleParameters.curveJetWeights_succ, Rat.cast_div, + d.cast_rationalWeight, InterpolationMatrix.rowWeights, Fin.cases_succ, + logWeights_eq] + +theorem actual_truncation_weight_bound (i : Fin d.m) : + d.curveJetWeights i.succ ≤ + (MatrixArithmetic.truncationOrders (finiteDenominators d) d.F0 d.v0 i : ℚ) * + d.curveJetWeights 0 := by + have hw : 0 < MatrixArithmetic.logWeights (finiteDenominators d) i := by + rw [logWeights_eq] + exact zero_lt_one.trans_le (d.x_one_le _) + have hF : 1 / (d.base.theta : ℝ) < d.F0 := + (div_lt_div_of_pos_right (by norm_num : (1 : ℝ) < 2) d.base.theta_pos).trans d.F0_large + have hceil := Nat.le_ceil + (d.F0 * MatrixArithmetic.logWeights (finiteDenominators d) i / (d.v0 : ℝ)) + have hbound : MatrixArithmetic.logWeights (finiteDenominators d) i / (d.base.theta : ℝ) ≤ + (MatrixArithmetic.truncationOrders (finiteDenominators d) d.F0 d.v0 i : ℝ) * + (d.v0 : ℝ) := by + calc + _ = (1 / (d.base.theta : ℝ)) * + MatrixArithmetic.logWeights (finiteDenominators d) i := by ring + _ ≤ d.F0 * MatrixArithmetic.logWeights (finiteDenominators d) i := + mul_le_mul_of_nonneg_right hF.le hw.le + _ ≤ _ := (div_le_iff₀ d.v0_pos).mp hceil + have hcast : (d.curveJetWeights i.succ : ℝ) ≤ + (MatrixArithmetic.truncationOrders (finiteDenominators d) d.F0 d.v0 i : ℝ) * + (d.curveJetWeights 0 : ℝ) := by + simpa only [AdmissibleParameters.curveJetWeights_zero, + AdmissibleParameters.curveJetWeights_succ, Rat.cast_div, + d.cast_rationalWeight, logWeights_eq] using hbound + exact_mod_cast hcast + +theorem matrix_degree_of_supportBound (H : ℝ) (P : PiExponentApprox.FramePolynomial d.m) + (hP : WeightedSliceDegree.SupportBound (fun i => (d.curveDegreeWeights i : ℝ)) H P) : + PiExponentApprox.HasWeightedDegreeLE + (InterpolationMatrix.columnWeights d.w0 + (MatrixArithmetic.logWeights (finiteDenominators d))) H P := by + intro a ha + have h := hP a ha + have hw : (fun i => (d.curveDegreeWeights i : ℝ)) = + InterpolationMatrix.columnWeights d.w0 + (MatrixArithmetic.logWeights (finiteDenominators d)) := + funext (degreeWeights_eq_matrix d) + rw [hw] at h + simpa only [PiExponentApprox.monomialWeight, Finsupp.weight_eq_sum, nsmul_eq_mul] using h + +theorem actualMatrix_surjective_of_formalPackets {α : Type*} (H : ℚ) + (P : α → PiExponentApprox.FramePolynomial d.m) + (hdegree : ∀ a, WeightedSliceDegree.SupportBound + (fun i => (d.curveDegreeWeights i : ℝ)) (H : ℝ) (P a)) + (hpacket : Function.Surjective (fun a => fun j : Fin d.K => + JetGeometry.rationalCoefficientPacket d.curveJetWeights H + (FormalLogJet.formalJet (d.curveCenters j) (P a)))) : + Function.Surjective (actualMatrix d (H : ℝ)).mulVecLin := by + apply FormalMatrixBridge.truncatedLogMatrix_surjective_of_formalLog_packets + d.K d.w0 d.v0 d.base.theta + (MatrixArithmetic.logWeights (finiteDenominators d)) H + d.w0_pos (fun i => ?_) d.curveJetWeights d.curveJetWeights_pos + (jetWeights_eq_matrix d) + (MatrixArithmetic.rationalCenters (finiteNumerators d) (finiteDenominators d)) + (MatrixArithmetic.truncationOrders (finiteDenominators d) d.F0 d.v0) + (actual_truncation_weight_bound d) P + (fun a => matrix_degree_of_supportBound d _ _ (hdegree a)) hpacket + rw [logWeights_eq] + exact zero_lt_one.trans_le (d.x_one_le _) + +def WeightedPolynomials (n : ℕ) := + {P : PiExponentApprox.FramePolynomial d.m // + WeightedSliceDegree.SupportBound (fun i => (d.curveDegreeWeights i : ℝ)) + ((n : ℝ) * (scale d).radius) P} + +def packetMap (n : ℕ) (P : WeightedPolynomials d n) := + fun j : Fin d.K => JetGeometry.rationalCoefficientPacket d.curveJetWeights + ((n : ℚ) * (scale d).radius) (FormalLogJet.formalJet (d.curveCenters j) P.val) + +theorem packetMap_surjective_of_family {α : Type*} (n : ℕ) + (P : α → PiExponentApprox.FramePolynomial d.m) + (hdegree : ∀ a, WeightedSliceDegree.SupportBound + (fun i => (d.curveDegreeWeights i : ℝ)) ((n : ℝ) * (scale d).radius) (P a)) + (hpacket : Function.Surjective (fun a => fun j : Fin d.K => + JetGeometry.rationalCoefficientPacket d.curveJetWeights + ((n : ℚ) * (scale d).radius) (FormalLogJet.formalJet (d.curveCenters j) (P a)))) : + Function.Surjective (packetMap d n) := by + intro y + obtain ⟨a,ha⟩ := hpacket y + exact ⟨⟨P a,hdegree a⟩,ha⟩ + +theorem actualMatrix_surjective_of_packetMap (n : ℕ) + (hpacket : Function.Surjective (packetMap d n)) : + Function.Surjective (actualMatrix d ((n : ℝ) * (scale d).radius)).mulVecLin := by + have h := actualMatrix_surjective_of_formalPackets d + ((n : ℚ) * (scale d).radius) (fun P : WeightedPolynomials d n => P.val) + (fun P => by simpa only [Rat.cast_mul, Rat.cast_natCast] using P.property) hpacket + have hc : (((n : ℚ) * (scale d).radius : ℚ) : ℝ) = + (n : ℝ) * (scale d).radius := by push_cast; rfl + exact hc ▸ h + +theorem cofinal_actualMatrix_of_eventual_packets + (hpacket : ∀ᶠ n : ℕ in atTop, Function.Surjective (packetMap d n)) + (L : ℝ) : ∃ H : ℝ, L ≤ H ∧ Function.Surjective (actualMatrix d H).mulVecLin := by + obtain ⟨N,hN⟩ := eventually_atTop.mp hpacket + let n := max N (Nat.ceil (L / ((scale d).radius : ℝ))) + have hR : (0 : ℝ) < (scale d).radius := by exact_mod_cast (scale d).radius_pos + have hL : L ≤ (n : ℝ) * (scale d).radius := by + apply (div_le_iff₀ hR).mp + exact (Nat.le_ceil _).trans (by exact_mod_cast (le_max_right N + (Nat.ceil (L / ((scale d).radius : ℝ))))) + exact ⟨(n : ℝ) * (scale d).radius, hL, + actualMatrix_surjective_of_packetMap d n (hN n (le_max_left _ _))⟩ + +theorem globalInterpolation_of_eventual_packets + (hpacket : ∀ ν : ℝ, 2 < ν → ∀ d : FixedData ν, + ∀ᶠ n : ℕ in atTop, Function.Surjective (packetMap d n)) : + GlobalInterpolationStatement := by + intro ν hν d L + exact cofinal_actualMatrix_of_eventual_packets d (hpacket ν hν d) L + +end PiExponent.AdmissibleMatrixInterpolation + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleParameters.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..aed8970acadb00f9198d8fbb83048bb48f82185d --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleParameters.lean @@ -0,0 +1,334 @@ +import Mathlib +import OAI.NumberTheory.PiExponent.Approximation.Parameters +import OAI.NumberTheory.PiExponent.Approximation.Sigma +import OAI.NumberTheory.PiExponent.Approximation.SuccessiveApproximations +import OAI.NumberTheory.PiExponent.Approximation.WeightErrorMargin +import OAI.NumberTheory.PiExponent.Approximation.WeightSeparation +import OAI.NumberTheory.PiExponent.Approximation.WeightSeparationConstant +import OAI.NumberTheory.PiExponent.LocalAlgebra.Dimension + +namespace OAI + +namespace PiExponent + +noncomputable def interpolationSeparationConstant (m : ℕ) (sigma : ℚ) : ℝ := + 2 * ((m : ℝ) + 2) ^ (m + 2) * + (1 + ((m : ℝ) + 2) / (sigma : ℝ)) ^ (m + 2) + +theorem interpolationSeparationConstant_pos (m : ℕ) (sigma : ℚ) + (hsigma : 0 < (sigma : ℝ)) : 0 < interpolationSeparationConstant m sigma := by + unfold interpolationSeparationConstant + positivity + +noncomputable def weightErrorCoefficient (nu theta : ℝ) (K : ℕ) : ℝ := + theta + Real.log 4 + Real.log (2 * (K : ℝ)) + nu + Real.log (200 * (K : ℝ)) + +theorem weightErrorCoefficient_nonneg (nu theta : ℝ) (K : ℕ) + (hnu : 0 < nu) (htheta : 0 < theta) (hK : 1 ≤ K) : + 0 ≤ weightErrorCoefficient nu theta K := by + have hKr : (1 : ℝ) ≤ K := by exact_mod_cast hK + have h4 : 0 ≤ Real.log 4 := Real.log_nonneg (by norm_num) + have h2K : 0 ≤ Real.log (2 * (K : ℝ)) := Real.log_nonneg (by linarith) + have h200K : 0 ≤ Real.log (200 * (K : ℝ)) := Real.log_nonneg (by linarith) + unfold weightErrorCoefficient + linarith + +theorem exists_initial_scale (nu theta epsilon : ℝ) (_htheta : 0 < theta) + (hepsilon : 0 < epsilon) : + ∃ F0 : ℝ, 0 < F0 ∧ 2 / theta < F0 ∧ nu / F0 < epsilon / 3 := by + obtain ⟨N, hN⟩ := exists_nat_gt (max 1 (max (2 / theta) (3 * nu / epsilon))) + have hF : 1 < (N : ℝ) := lt_of_le_of_lt (le_max_left _ _) hN + have hthetaF : 2 / theta < (N : ℝ) := + lt_of_le_of_lt ((le_max_left _ _).trans (le_max_right _ _)) hN + have hnuF : 3 * nu / epsilon < (N : ℝ) := + lt_of_le_of_lt ((le_max_right _ _).trans (le_max_right _ _)) hN + refine ⟨N, by linarith, hthetaF, ?_⟩ + apply (div_lt_iff₀ (show (0 : ℝ) < N by linarith)).2 + have := (div_lt_iff₀ hepsilon).mp hnuF + nlinarith + +structure AdmissibleParameters (nu Lambda c : ℝ) where + base : Parameters nu + epsilon : ℝ + F0 : ℝ + m : ℕ + K : ℕ + w0 : ℚ + v0 : ℚ + sigma : ℚ + p : ℕ → ℤ + q : ℕ → ℕ + x : ℕ → ℝ + wstar : ℝ + epsilon_pos : 0 < epsilon + epsilon_lt_gap : epsilon < + nu * ((base.A : ℝ) * (1 - base.eta) - base.theta) - (1 - base.theta) + epsilon_le_half : epsilon ≤ 1 / 2 + F0_pos : 0 < F0 + F0_large : 2 / (base.theta : ℝ) < F0 + initial_margin : nu / F0 < epsilon / 3 + m_pos : 1 ≤ m + K_eq : K = dimensionK (base.C : ℝ) m + K_pos : 1 ≤ K + w0_eq : (w0 : ℝ) = dimensionW (base.B : ℝ) m + v0_eq : (v0 : ℝ) = dimensionV (base.theta : ℝ) base.B base.C m + w0_pos : 0 < (w0 : ℝ) + v0_pos : 0 < (v0 : ℝ) + volume_eq : (K : ℝ) * ((w0 : ℝ) / v0) * (base.theta : ℝ) ^ m = 1 / 2 + volume_lt_one : (K : ℝ) * (base.theta : ℝ) ^ m < 1 + dimension_margin : + (Lambda * F0 * (m : ℝ) + 2 * Real.log 2) / (v0 : ℝ) + + 100 * (K : ℝ) / (w0 : ℝ) < epsilon / 3 + collision_margin : 2 < c * + (base.eta ^ 2 * (K : ℝ) * (base.theta : ℝ) ^ m / + (((m : ℝ) + 1) * (v0 : ℝ) * (base.A : ℝ) ^ m)) + sigma_pos : 0 < (sigma : ℝ) + sigma_volume : (1 + 3 * (sigma : ℝ)) ^ (m + 1) * + ((K : ℝ) * ((w0 : ℝ) / v0) * (base.theta : ℝ) ^ m) < 1 + sigma_centers : (1 + 3 * (sigma : ℝ)) ^ m * + ((K : ℝ) * (base.theta : ℝ) ^ m) < 1 + sigma_theta : (1 + (sigma : ℝ)) * (base.theta : ℝ) < 1 + x_zero : x 0 = 1 + x_log : ∀ n, x (n + 1) = (Nat.ceil (Real.log (q n)) : ℝ) + approximations : ∀ n, 2 ≤ q n ∧ p n ≠ 0 ∧ + |Real.pi - (p n : ℝ) / q n| ≤ (q n : ℝ) ^ (-nu) + x_one_le : ∀ i, 1 ≤ x i + weight_growth : PiExponentApprox.SeparatedWeightGrowth m + (PiExponentApprox.weightSeparationFactor m (interpolationSeparationConstant m sigma) + w0 v0 base.theta) x + wstar_pos : 0 < wstar + wstar_lower : ∀ i : Fin m, wstar ≤ x (i.val + 1) + wstar_attained : ∃ i : Fin m, wstar = x (i.val + 1) + weight_margin : Lambda * (∑ i : Fin m, 1 / x (i.val + 1)) + + weightErrorCoefficient nu base.theta K / wstar < epsilon / 3 + +theorem exists_admissible_parameters + (nu Lambda c : ℝ) (hnu : 2 < nu) (hLambda : 0 < Lambda) (hc : 0 < c) + (hbad : ∀ Q : ℕ, ∃ p : ℤ, ∃ q : ℕ, + Q ≤ q ∧ |Real.pi - (p : ℝ) / q| ≤ (q : ℝ) ^ (-nu)) : + Nonempty (AdmissibleParameters nu Lambda c) := by + classical + obtain ⟨P⟩ := exists_parameters nu hnu + let g : ℝ := nu * ((P.A : ℝ) * (1 - P.eta) - P.theta) - (1 - P.theta) + have hg : 0 < g := P.gap_pos + let epsilon : ℝ := min (g / 2) (1 / 2) + have hepsilon : 0 < epsilon := lt_min (by positivity) (by norm_num) + have hepsg : epsilon < g := lt_of_le_of_lt (min_le_left _ _) (by linarith) + have hepshalf : epsilon ≤ 1 / 2 := min_le_right _ _ + have heps3 : 0 < epsilon / 3 := by positivity + obtain ⟨F0, hF0, hFtheta, hFmargin⟩ := + exists_initial_scale nu P.theta epsilon P.theta_pos hepsilon + have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) + obtain ⟨m, hm, hdim, hcollision⟩ := exists_dimension_margin + P.theta P.A P.B P.C P.eta (Lambda * F0) (2 * Real.log 2) + (epsilon / 3) (2 / c) P.theta_pos P.B_pos P.one_lt_C + P.CB_lt_one P.one_lt_C_theta_div_B P.one_lt_B_div_A P.eta_pos + (mul_pos hLambda hF0).le (by positivity) heps3 + let K : ℕ := dimensionK P.C m + let w0 : ℚ := (P.B ^ m)⁻¹ + let v0 : ℚ := 2 * (K : ℚ) * P.theta ^ m * w0 + have hK : 1 ≤ K := dimensionK_one_le P.C P.one_lt_C.le m + have hw0eq : (w0 : ℝ) = dimensionW P.B m := by simp [w0, dimensionW] + have hv0eq : (v0 : ℝ) = dimensionV P.theta P.B P.C m := by + simp [v0, dimensionV, K, hw0eq] + have hw0 : 0 < (w0 : ℝ) := by + rw [hw0eq] + exact dimensionW_pos P.B P.B_pos m + have hv0 : 0 < (v0 : ℝ) := by + rw [hv0eq] + exact dimensionV_pos P.theta P.B P.C P.theta_pos P.B_pos P.one_lt_C.le m + have hvolume : (K : ℝ) * ((w0 : ℝ) / v0) * (P.theta : ℝ) ^ m = 1 / 2 := by + rw [hw0eq, hv0eq] + exact dimension_volume P.theta P.B P.C P.theta_pos P.B_pos P.one_lt_C.le m + have hvolume1 : (K : ℝ) * (P.theta : ℝ) ^ m < 1 := + dimension_volume_lt_one P.theta P.C P.theta_pos P.C_pos.le P.C_theta_lt_one m hm + have hcollision' : 2 < c * + (P.eta ^ 2 * (K : ℝ) * (P.theta : ℝ) ^ m / + (((m : ℝ) + 1) * (v0 : ℝ) * (P.A : ℝ) ^ m)) := by + rw [hv0eq] + change 2 < c * (P.eta ^ 2 * (dimensionK (P.C : ℝ) m : ℝ) * + (P.theta : ℝ) ^ m / (((m : ℝ) + 1) * + dimensionV (P.theta : ℝ) P.B P.C m * (P.A : ℝ) ^ m)) + rw [dimension_collision_identity P.theta P.A P.B P.C P.eta + P.theta_pos P.A_pos P.B_pos P.one_lt_C.le] + have hh := (div_lt_iff₀ hc).mp hcollision + nlinarith + obtain ⟨sigma, hsigma, hsigmaVol, hsigmaK, hsigmaTheta⟩ := + exists_small_rational_sigma m (1 / 2) + ((K : ℝ) * (P.theta : ℝ) ^ m) P.theta (by norm_num) hvolume1 P.theta_lt_one + have hnupos : 0 < nu := by linarith + have hS : 0 ≤ weightErrorCoefficient nu P.theta K := + weightErrorCoefficient_nonneg nu P.theta K hnupos P.theta_pos hK + obtain ⟨X, hX, hXmargin⟩ := exists_uniform_weight_error_margin m Lambda + (weightErrorCoefficient nu P.theta K) (epsilon / 3) hLambda hS heps3 + obtain ⟨p, q, x, hx0, hxlog, happ, hx1, hgrowth⟩ := + exists_normalized_successive_approximations nu X + (PiExponentApprox.weightSeparationFactor m + (interpolationSeparationConstant m sigma) w0 v0 P.theta) hnupos hbad + obtain ⟨wstar, hwstarX, hwstarLower, hwstarAttained⟩ := + exists_minimum_weight m hm (fun i : Fin m => x (i.val + 1)) X + (fun i => (happ i.val).2.2.2.2) + have hwstar : 0 < wstar := lt_of_lt_of_le zero_lt_one (le_trans hX hwstarX.le) + refine ⟨{ + base := P + epsilon := epsilon + F0 := F0 + m := m + K := K + w0 := w0 + v0 := v0 + sigma := sigma + p := p + q := q + x := x + wstar := wstar + epsilon_pos := hepsilon + epsilon_lt_gap := hepsg + epsilon_le_half := hepshalf + F0_pos := hF0 + F0_large := hFtheta + initial_margin := hFmargin + m_pos := hm + K_eq := rfl + K_pos := hK + w0_eq := hw0eq + v0_eq := hv0eq + w0_pos := hw0 + v0_pos := hv0 + volume_eq := hvolume + volume_lt_one := hvolume1 + dimension_margin := ?_ + collision_margin := hcollision' + sigma_pos := hsigma + sigma_volume := ?_ + sigma_centers := hsigmaK + sigma_theta := hsigmaTheta + x_zero := hx0 + x_log := hxlog + approximations := fun n => ⟨(happ n).1, (happ n).2.1, (happ n).2.2.1⟩ + x_one_le := hx1 + weight_growth := fun i hi _ => hgrowth i hi + wstar_pos := hwstar + wstar_lower := hwstarLower + wstar_attained := hwstarAttained + weight_margin := hXmargin wstar (fun i : Fin m => x (i.val + 1)) + hwstarX hwstarLower + }⟩ + · rw [hv0eq, hw0eq] + exact hdim + · rw [hvolume] + exact hsigmaVol + +namespace AdmissibleParameters + +variable {nu Lambda c : ℝ} (d : AdmissibleParameters nu Lambda c) + +noncomputable def rationalWeight : ℕ → ℚ + | 0 => 1 + | n + 1 => (Nat.ceil (Real.log (d.q n)) : ℚ) + +theorem cast_rationalWeight (i : ℕ) : (d.rationalWeight i : ℝ) = d.x i := by + cases i with + | zero => simpa [rationalWeight] using d.x_zero.symm + | succ n => simpa [rationalWeight] using (d.x_log n).symm + +theorem rationalWeight_pos (i : ℕ) : 0 < d.rationalWeight i := by + have h : (0 : ℝ) < (d.rationalWeight i : ℝ) := by + rw [d.cast_rationalWeight] + exact zero_lt_one.trans_le (d.x_one_le i) + exact_mod_cast h + +theorem multiplicity_constant_bound (k : ℕ) (hk : k ≤ d.m) : + 2 * (k.factorial : ℝ) * (((d.m : ℝ) + 2) / (d.sigma : ℝ)) ^ k ≤ + interpolationSeparationConstant d.m d.sigma := by + exact PiExponentApprox.multiplicity_constant_le_enlarged d.m k d.sigma d.sigma_pos hk + +theorem rectangular_multiplicity_constant_bound (k : ℕ) (hk : k ≤ d.m) : + (k : ℝ) ^ k * (((d.m : ℝ) + 2) / (d.sigma : ℝ)) ^ k ≤ + interpolationSeparationConstant d.m d.sigma := by + exact PiExponentApprox.rectangular_multiplicity_constant_le_enlarged + d.m k d.sigma d.sigma_pos hk + +theorem separated_weight_products + (A B : Finset ℕ) (hcard : A.card = B.card) + (hA : A ⊆ Finset.range (d.m + 1)) (hB : B ⊆ Finset.range (d.m + 1)) + (i : ℕ) (hi : 0 < i) (hiA : i ∈ A) (hiB : i ∉ B) + (hbelow : ∀ j ∈ B \ A, j < i) : + interpolationSeparationConstant d.m d.sigma * + (∏ j ∈ B, PiExponentApprox.geometricJetWeight d.v0 d.base.theta d.x j) < + ∏ j ∈ A, PiExponentApprox.geometricDegreeWeight d.w0 d.x j := by + exact PiExponentApprox.geometric_weight_products_separated d.m + (interpolationSeparationConstant d.m d.sigma) d.w0 d.v0 d.base.theta d.x + (interpolationSeparationConstant_pos d.m d.sigma d.sigma_pos) + d.w0_pos d.v0_pos d.base.theta_pos d.x_zero d.x_one_le d.weight_growth + A B hcard hA hB i hi hiA hiB hbelow + +theorem total_error_lt_gap : + nu / d.F0 + + ((Lambda * d.F0 * (d.m : ℝ) + 2 * Real.log 2) / (d.v0 : ℝ) + + 100 * (d.K : ℝ) / (d.w0 : ℝ)) + + (Lambda * (∑ i : Fin d.m, 1 / d.x (i.val + 1)) + + weightErrorCoefficient nu d.base.theta d.K / d.wstar) < + nu * ((d.base.A : ℝ) * (1 - d.base.eta) - d.base.theta) - + (1 - d.base.theta) := by + have h1 := d.initial_margin + have h2 := d.dimension_margin + have h3 := d.weight_margin + have h4 := d.epsilon_lt_gap + linarith + +theorem collision_exceeds_one_add_error : + 1 + (nu / d.F0 + + ((Lambda * d.F0 * (d.m : ℝ) + 2 * Real.log 2) / (d.v0 : ℝ) + + 100 * (d.K : ℝ) / (d.w0 : ℝ)) + + (Lambda * (∑ i : Fin d.m, 1 / d.x (i.val + 1)) + + weightErrorCoefficient nu d.base.theta d.K / d.wstar)) < + c * (d.base.eta ^ 2 * (d.K : ℝ) * (d.base.theta : ℝ) ^ d.m / + (((d.m : ℝ) + 1) * (d.v0 : ℝ) * (d.base.A : ℝ) ^ d.m)) := by + have h1 := d.initial_margin + have h2 := d.dimension_margin + have h3 := d.weight_margin + have h4 := d.epsilon_le_half + have h5 := d.collision_margin + linarith + +noncomputable def arithmeticError : ℝ := + Lambda * d.F0 * (d.m : ℝ) / (d.v0 : ℝ) + + Lambda * (∑ i : Fin d.m, 1 / d.x (i.val + 1)) + (d.base.theta : ℝ) / d.wstar + +noncomputable def translationError : ℝ := + nu / d.F0 + Real.log 2 / (d.v0 : ℝ) + + (Real.log 4 + Real.log (2 * (d.K : ℝ)) + nu) / d.wstar + +noncomputable def holomorphicError : ℝ := + 100 * (d.K : ℝ) / (d.w0 : ℝ) + Real.log 2 / (d.v0 : ℝ) + + Real.log (200 * (d.K : ℝ)) / d.wstar + +noncomputable def analyticError : ℝ := d.translationError + d.holomorphicError + +theorem error_sum_eq : d.arithmeticError + d.analyticError = + nu / d.F0 + + ((Lambda * d.F0 * (d.m : ℝ) + 2 * Real.log 2) / (d.v0 : ℝ) + + 100 * (d.K : ℝ) / (d.w0 : ℝ)) + + (Lambda * (∑ i : Fin d.m, 1 / d.x (i.val + 1)) + + weightErrorCoefficient nu d.base.theta d.K / d.wstar) := by + unfold arithmeticError analyticError translationError holomorphicError weightErrorCoefficient + ring + +theorem error_sum_lt_gap : d.arithmeticError + d.analyticError < + nu * ((d.base.A : ℝ) * (1 - d.base.eta) - d.base.theta) - + (1 - d.base.theta) := by + rw [d.error_sum_eq] + exact d.total_error_lt_gap + +theorem collision_exceeds_error_sum : 1 + d.arithmeticError + d.analyticError < + c * (d.base.eta ^ 2 * (d.K : ℝ) * (d.base.theta : ℝ) ^ d.m / + (((d.m : ℝ) + 1) * (d.v0 : ℝ) * (d.base.A : ℝ) ^ d.m)) := by + rw [add_assoc, d.error_sum_eq] + exact d.collision_exceeds_one_add_error + +end AdmissibleParameters + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/AffineClosedAnnihilatedDescent.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/AffineClosedAnnihilatedDescent.lean new file mode 100644 index 0000000000000000000000000000000000000000..31ca6af17292fd24e913ead15bb2b4cc709964ac --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/AffineClosedAnnihilatedDescent.lean @@ -0,0 +1,110 @@ +import OAI.NumberTheory.PiExponent.Approximation.ClosedAnnihilatedDescent +import OAI.NumberTheory.PiExponent.Approximation.GlobalSectionClearing + +namespace OAI + +namespace PiExponentSeshadri.ClosedAnnihilatedDescent +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace Opposite +variable {R S : CommRingCat.{0}} + +def surjectiveModule (φ : R ⟶ S) (hφ : Function.Surjective φ) (M : ModuleCat R) + (h : RingHom.ker φ.hom ≤ Module.annihilator R M) : ModuleCat S := + (ModuleCat.restrictScalars (φ.hom.quotientKerEquivOfSurjective hφ).symm.toRingHom).obj + (quotientModule (RingHom.ker φ.hom) M h) + +def surjectiveModuleRestrictIso (φ : R ⟶ S) (hφ : Function.Surjective φ) + (M : ModuleCat R) (h : RingHom.ker φ.hom ≤ Module.annihilator R M) : + (ModuleCat.restrictScalars φ.hom).obj (surjectiveModule φ hφ M h) ≅ M := + (ModuleCat.restrictScalarsComp'App φ.hom + (φ.hom.quotientKerEquivOfSurjective hφ).symm.toRingHom + (Ideal.Quotient.mk (RingHom.ker φ.hom)) + (RingHom.quotientKerEquivOfSurjective_symm_comp hφ).symm + (quotientModule (RingHom.ker φ.hom) M h)).symm ≪≫ quotientModuleRestrictIso _ M h + +def specSurjectiveDescent (φ : R ⟶ S) (hφ : Function.Surjective φ) + (M : (Spec R).Modules) + (h : RingHom.ker φ.hom ≤ Module.annihilator R (moduleSpecΓFunctor.obj M)) : + (Spec S).Modules := tilde (surjectiveModule φ hφ (moduleSpecΓFunctor.obj M) h) + +def specSurjectiveDescentPushforwardIso (φ : R ⟶ S) (hφ : Function.Surjective φ) + (M : (Spec R).Modules) [M.IsQuasicoherent] + (h : RingHom.ker φ.hom ≤ Module.annihilator R (moduleSpecΓFunctor.obj M)) : + (Scheme.Modules.pushforward (Spec.map φ)).obj (specSurjectiveDescent φ hφ M h) ≅ M := + specPushforwardTildeIso _ _ ≪≫ + (tilde.functor R).mapIso (surjectiveModuleRestrictIso φ hφ (moduleSpecΓFunctor.obj M) h) ≪≫ + @asIso _ _ _ _ M.fromTildeΓ + (Scheme.Modules.isIso_fromTildeΓ_of_isQuasicoherent M) + +variable {X Y : Scheme.{0}} + +def affineSpecTopSections [IsAffine X] (M : X.Modules) : + moduleSpecΓFunctor.obj (PiExponent.GlobalSectionClearing.affineToSpecModule M) ≃ₗ[Γ(X,⊤)] + Γ(M,⊤) where + toFun := fun x => x + invFun := fun x => x + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' r m := by + change @SMul.smul Γ(X,⊤) Γ(M,⊤) (M.val.obj (op ⊤)).isModule.toSMul + ((X.toSpecΓ.app ⊤) + ((Spec Γ(X,⊤)).presheaf.map (homOfLE (show (⊤ : (Spec Γ(X,⊤)).Opens) ≤ ⊤ from le_top)).op + ((Scheme.ΓSpecIso Γ(X,⊤)).inv r))) m = + @SMul.smul Γ(X,⊤) Γ(M,⊤) (M.val.obj (op ⊤)).isModule.toSMul r m + apply congrArg (fun a : Γ(X,⊤) => + @SMul.smul Γ(X,⊤) Γ(M,⊤) (M.val.obj (op ⊤)).isModule.toSMul a m) + have hi : (homOfLE (show (⊤ : (Spec Γ(X,⊤)).Opens) ≤ ⊤ from le_top)).op = 𝟙 _ := rfl + rw [hi, CategoryTheory.Functor.map_id] + change X.toSpecΓ.appTop ((Scheme.ΓSpecIso Γ(X,⊤)).inv r) = r + rw [Scheme.toSpecΓ_appTop] + exact (Scheme.ΓSpecIso Γ(X,⊤)).inv_hom_id_apply r + +lemma affineSpecTopSections_annihilator [IsAffine X] (M : X.Modules) (I : Ideal Γ(X,⊤)) + (h : I ≤ Module.annihilator Γ(X,⊤) Γ(M,⊤)) : + I ≤ Module.annihilator Γ(X,⊤) + (moduleSpecΓFunctor.obj (PiExponent.GlobalSectionClearing.affineToSpecModule M)) := by + intro r hr + rw [Module.mem_annihilator] at * + intro m + apply (affineSpecTopSections M).injective + rw [map_smul, map_zero] + exact Module.mem_annihilator.mp (h hr) _ + +def affineDescentAlong [IsAffine X] [IsAffine Y] (f : Y ⟶ X) + (hf : Function.Surjective f.appTop) (M : X.Modules) + (h : RingHom.ker f.appTop.hom ≤ Module.annihilator Γ(X,⊤) Γ(M,⊤)) : Y.Modules := + (Scheme.Modules.pushforward Y.isoSpec.inv).obj + (specSurjectiveDescent f.appTop hf + (PiExponent.GlobalSectionClearing.affineToSpecModule M) + (affineSpecTopSections_annihilator M _ h)) + +def affineDescentAlongPushforwardIso [IsAffine X] [IsAffine Y] (f : Y ⟶ X) + (hf : Function.Surjective f.appTop) (M : X.Modules) [M.IsQuasicoherent] + (h : RingHom.ker f.appTop.hom ≤ Module.annihilator Γ(X,⊤) Γ(M,⊤)) : + (Scheme.Modules.pushforward f).obj (affineDescentAlong f hf M h) ≅ M := by + let A := specSurjectiveDescent f.appTop hf + (PiExponent.GlobalSectionClearing.affineToSpecModule M) + (affineSpecTopSections_annihilator M _ h) + exact (Scheme.Modules.pushforwardComp Y.isoSpec.inv f).app A ≪≫ + (Scheme.Modules.pushforwardCongr (Scheme.isoSpec_inv_naturality f).symm).app A ≪≫ + ((Scheme.Modules.pushforwardComp (Spec.map f.appTop) X.isoSpec.inv).app A).symm ≪≫ + (Scheme.Modules.pushforward X.isoSpec.inv).mapIso + (specSurjectiveDescentPushforwardIso f.appTop hf + (PiExponent.GlobalSectionClearing.affineToSpecModule M) + (affineSpecTopSections_annihilator M _ h)) ≪≫ + (Scheme.Modules.pushforwardComp X.isoSpec.hom X.isoSpec.inv).app M ≪≫ + (Scheme.Modules.pushforwardCongr X.isoSpec.hom_inv_id).app M ≪≫ + (Scheme.Modules.pushforwardId X).app M + +theorem exists_affine_closed_descent [IsAffine X] (f : Y ⟶ X) [IsClosedImmersion f] + (M : X.Modules) [M.IsQuasicoherent] + (h : RingHom.ker f.appTop.hom ≤ Module.annihilator Γ(X,⊤) Γ(M,⊤)) : + ∃ N : Y.Modules, Nonempty ((Scheme.Modules.pushforward f).obj N ≅ M) := by + obtain ⟨hY, hf⟩ := IsClosedImmersion.isAffine_surjective_of_isAffine f + exact ⟨affineDescentAlong f hf M h, ⟨affineDescentAlongPushforwardIso f hf M h⟩⟩ + +end +end PiExponentSeshadri.ClosedAnnihilatedDescent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/AffineThickeningCriterion.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/AffineThickeningCriterion.lean new file mode 100644 index 0000000000000000000000000000000000000000..19e93a88331f281902bd599df0f96b5117fb9271 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/AffineThickeningCriterion.lean @@ -0,0 +1,64 @@ +import Mathlib.AlgebraicGeometry.Morphisms.Affine + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite + +variable {X Y : Scheme} + +theorem isUnit_of_basicOpen_eq_top (r : Γ(X,⊤)) (hr : X.basicOpen r = ⊤) : + IsUnit r := by + apply X.toRingedSpace.isUnit_of_isUnit_germ ⊤ r + intro x hx + exact (X.mem_basicOpen_top r x).mp (by rw [hr]; trivial) + +theorem appTop_reflects_isUnit (f : Y ⟶ X) (hf : Function.Surjective f) + (r : Γ(X,⊤)) (hr : IsUnit (f.appTop r)) : IsUnit r := by + apply isUnit_of_basicOpen_eq_top r + apply top_unique + intro x hx + obtain ⟨y, rfl⟩ := hf x + have hy : y ∈ f ⁻¹ᵁ X.basicOpen r := by + rw [Scheme.preimage_basicOpen_top, Y.basicOpen_of_isUnit hr] + trivial + exact hy + +theorem isAffineOpen_basicOpen_of_le (r : Γ(X,⊤)) (U : X.Opens) + (hU : IsAffineOpen U) (hr : X.basicOpen r ≤ U) : + IsAffineOpen (X.basicOpen r) := by + have h := hU.basicOpen (X.presheaf.map (homOfLE (show U ≤ ⊤ from le_top)).op r) + rwa [Scheme.basicOpen_res, inf_eq_right.mpr hr] at h + +theorem isAffine_of_surjective_appTop (f : Y ⟶ X) [IsAffine Y] + (hf : Function.Surjective f) (hΓ : Function.Surjective f.appTop) : IsAffine X := by + let S : Set Γ(X,⊤) := {r | IsAffineOpen (X.basicOpen r)} + have hcover : (⊤ : Y.Opens) ≤ ⨆ a : (f.appTop '' S), Y.basicOpen a.1 := by + intro y hy + obtain ⟨U, hU, hyU, -⟩ := exists_isAffineOpen_mem_and_subset + (show f y ∈ (⊤ : X.Opens) from trivial) + obtain ⟨a, haU, hya⟩ := (isAffineOpen_top Y).exists_basicOpen_le + (⟨y, hyU⟩ : f ⁻¹ᵁ U) (by trivial) + obtain ⟨r, hr⟩ := hΓ a + have hrU : X.basicOpen r ≤ U := by + intro x hx + obtain ⟨z, rfl⟩ := hf x + apply haU + have hz : z ∈ f ⁻¹ᵁ X.basicOpen r := hx + rwa [Scheme.preimage_basicOpen_top, hr] at hz + have hrS : r ∈ S := isAffineOpen_basicOpen_of_le r U hU hrU + exact Opens.mem_iSup.mpr ⟨⟨a, r, hrS, hr⟩, hya⟩ + have hmap : Ideal.map f.appTop.hom (Ideal.span S) = ⊤ := by + rw [Ideal.map_span] + exact (isAffineOpen_top Y).self_le_iSup_basicOpen_iff.mp hcover + obtain ⟨r, hrS, hr⟩ := (Ideal.mem_map_iff_of_surjective f.appTop.hom hΓ).mp + (show (1 : Γ(Y,⊤)) ∈ Ideal.map f.appTop.hom (Ideal.span S) by rw [hmap]; trivial) + have hunit : IsUnit r := appTop_reflects_isUnit f hf r (hr ▸ isUnit_one) + exact isAffine_of_isAffineOpen_basicOpen S + ((Ideal.span S).eq_top_of_isUnit_mem hrS hunit) (fun r hr => hr) + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ApproximationCenters.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ApproximationCenters.lean new file mode 100644 index 0000000000000000000000000000000000000000..7fc07955a1eaee0c6530ac396e75bb81a1498a22 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ApproximationCenters.lean @@ -0,0 +1,79 @@ +import Mathlib + +namespace OAI + +namespace PiExponent + +noncomputable def approximatePeriod (p : ℤ) (q : ℕ) : ℂ := + 2 * Complex.I * (p : ℂ) / (q : ℂ) + +theorem approximatePeriod_ne_zero {p : ℤ} {q : ℕ} (hp : p ≠ 0) (hq : q ≠ 0) : + approximatePeriod p q ≠ 0 := by + unfold approximatePeriod + exact div_ne_zero + (mul_ne_zero (mul_ne_zero (by norm_num) Complex.I_ne_zero) (by exact_mod_cast hp)) + (by exact_mod_cast hq) + +theorem approximation_centers_injective {p : ℤ} {q : ℕ} + (hp : p ≠ 0) (hq : q ≠ 0) : + Function.Injective (fun j : ℕ => (j : ℂ) * approximatePeriod p q) := by + intro j k h + have heq : (j : ℂ) = (k : ℂ) := mul_right_cancel₀ (approximatePeriod_ne_zero hp hq) h + exact_mod_cast heq + +noncomputable def logarithmicPeriod : ℂ := 2 * (Real.pi : ℂ) * Complex.I + +theorem norm_period_error (p : ℤ) (q : ℕ) : + ‖approximatePeriod p q - logarithmicPeriod‖ = + 2 * |Real.pi - (p : ℝ) / q| := by + have heq : approximatePeriod p q - logarithmicPeriod = + (2 * Complex.I) * (((p : ℝ) / q - Real.pi : ℝ) : ℂ) := by + unfold approximatePeriod logarithmicPeriod + push_cast + ring + rw [heq, norm_mul, Complex.norm_real, Real.norm_eq_abs] + norm_num [norm_mul, abs_sub_comm] + +theorem norm_center_error_le (nu : ℝ) {p : ℤ} {q j K : ℕ} + (hj : j ≤ K) + (happrox : |Real.pi - (p : ℝ) / q| ≤ (q : ℝ) ^ (-nu)) : + ‖(j : ℂ) * (approximatePeriod p q - logarithmicPeriod)‖ ≤ + 2 * K * (q : ℝ) ^ (-nu) := by + rw [norm_mul, norm_period_error] + have hjR : (j : ℝ) ≤ (K : ℝ) := by exact_mod_cast hj + have hqpow : 0 ≤ (q : ℝ) ^ (-nu) := Real.rpow_nonneg (by positivity) _ + simp only [Complex.norm_natCast] + nlinarith [abs_nonneg (Real.pi - (p : ℝ) / q)] + +theorem ceil_log_bounds {q : ℕ} (hq : 1 ≤ q) : + 0 ≤ (⌈Real.log q⌉₊ : ℝ) - Real.log q ∧ + (⌈Real.log q⌉₊ : ℝ) - Real.log q < 1 := by + have hlog : 0 ≤ Real.log (q : ℝ) := Real.log_nonneg (by exact_mod_cast hq) + constructor + · exact sub_nonneg.mpr (Nat.le_ceil _) + · have := Nat.ceil_lt_add_one hlog + linarith + +theorem rpow_neg_le_exp_ceil_log (nu : ℝ) {q : ℕ} (hnu : 0 ≤ nu) (hq : 1 ≤ q) : + (q : ℝ) ^ (-nu) ≤ + Real.exp nu * Real.exp (-nu * (⌈Real.log q⌉₊ : ℝ)) := by + have hqpos : (0 : ℝ) < q := by exact_mod_cast (by omega : 0 < q) + rw [Real.rpow_def_of_pos hqpos, ← Real.exp_add] + apply Real.exp_le_exp.mpr + have hw := (ceil_log_bounds hq).2 + nlinarith + +theorem norm_center_error_exp (nu : ℝ) {p : ℤ} {q j K : ℕ} + (hnu : 0 ≤ nu) (hq : 1 ≤ q) (hj : j ≤ K) + (happrox : |Real.pi - (p : ℝ) / q| ≤ (q : ℝ) ^ (-nu)) : + ‖(j : ℂ) * (approximatePeriod p q - logarithmicPeriod)‖ ≤ + (2 * K * Real.exp nu) * Real.exp (-nu * (⌈Real.log q⌉₊ : ℝ)) := by + calc + _ ≤ 2 * K * (q : ℝ) ^ (-nu) := norm_center_error_le nu hj happrox + _ ≤ 2 * K * (Real.exp nu * Real.exp (-nu * (⌈Real.log q⌉₊ : ℝ))) := + mul_le_mul_of_nonneg_left (rpow_neg_le_exp_ceil_log nu hnu hq) (by positivity) + _ = _ := by ring + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ApproximationSelection.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ApproximationSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..2150294f25f0262b0cc6f1cc25348a4157b70177 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ApproximationSelection.lean @@ -0,0 +1,34 @@ +import Mathlib + +namespace OAI + +namespace PiExponent + +theorem exists_large_log_approximation + (nu X : ℝ) (hnu : 0 < nu) + (hbad : ∀ Q : ℕ, ∃ p : ℤ, ∃ q : ℕ, + Q ≤ q ∧ |Real.pi - (p : ℝ) / q| ≤ (q : ℝ) ^ (-nu)) : + ∃ p : ℤ, ∃ q : ℕ, + 2 ≤ q ∧ X < Real.log q ∧ p ≠ 0 ∧ + |Real.pi - (p : ℝ) / q| ≤ (q : ℝ) ^ (-nu) := by + obtain ⟨N, hN⟩ := exists_nat_gt (Real.exp X) + obtain ⟨p, q, hq, happrox⟩ := hbad (max 2 N) + have hq2 : 2 ≤ q := le_trans (le_max_left _ _) hq + have hNq : N ≤ q := le_trans (le_max_right _ _) hq + have hexp : Real.exp X < (q : ℝ) := lt_of_lt_of_le hN (by exact_mod_cast hNq) + have hlog : X < Real.log q := by + simpa using Real.log_lt_log (Real.exp_pos X) hexp + have hp : p ≠ 0 := by + intro hp0 + have hpow : (q : ℝ) ^ (-nu) ≤ 1 := + Real.rpow_le_one_of_one_le_of_nonpos (by exact_mod_cast (by omega : 1 ≤ q)) + (by linarith) + have hpi : Real.pi ≤ (q : ℝ) ^ (-nu) := by + simpa [hp0, abs_of_pos Real.pi_pos] using happrox + have hpi2 := Real.pi_gt_three + linarith + exact ⟨p, q, hq2, hlog, hp, happrox⟩ + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/Arithmetic.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/Arithmetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..a71f65e5e5eac1203ecaf1ca1b9b34dd4cbccd81 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/Arithmetic.lean @@ -0,0 +1,329 @@ +import Mathlib.Algebra.Polynomial.Eval.Subring +import Mathlib.LinearAlgebra.Matrix.Determinant.Basic +import Mathlib.NumberTheory.Chebyshev +import Mathlib.NumberTheory.Zsqrtd.GaussianInt +import Mathlib.RingTheory.PowerSeries.Log +import Mathlib.RingTheory.PowerSeries.Trunc +import Mathlib.Tactic + +namespace OAI + +namespace PiExponent.Arithmetic + +noncomputable def lcmConstant : ℝ := Real.log 4 + 4 + +theorem lcmConstant_pos : 0 < lcmConstant := by + have h : 0 < Real.log (4 : ℝ) := Real.log_pos (by norm_num) + dsimp [lcmConstant] + linarith + +theorem log_lcmUpto_le (n : ℕ) : + Real.log (Nat.lcmUpto n : ℝ) ≤ lcmConstant * n := by + rw [← Chebyshev.psi_eq_log_lcmUpto] + exact Chebyshev.psi_le_const_mul_self (by positivity) + +theorem gaussian_norm_one_le (z : GaussianInt) (hz : z ≠ 0) : + 1 ≤ ‖(z : ℂ)‖ := by + have hi : (1 : ℤ) ≤ z.norm := (GaussianInt.norm_pos.mpr hz) + have hr : (1 : ℝ) ≤ (z.norm : ℝ) := by exact_mod_cast hi + rw [GaussianInt.intCast_real_norm, Complex.normSq_eq_norm_sq] at hr + have hn : 0 ≤ ‖(z : ℂ)‖ := norm_nonneg _ + nlinarith + +theorem gaussian_det_norm_one_le {ι : Type*} [Fintype ι] [DecidableEq ι] + (A : Matrix ι ι GaussianInt) (hA : A.det ≠ 0) : + 1 ≤ ‖(A.map GaussianInt.toComplex).det‖ := by + change 1 ≤ ‖(GaussianInt.toComplex.mapMatrix A).det‖ + rw [← RingHom.map_det] + exact gaussian_norm_one_le A.det hA + +theorem det_row_column_scale {ι : Type*} [Fintype ι] [DecidableEq ι] + (A : Matrix ι ι ℂ) (r c : ι → ℂ) : + Matrix.det (fun i j => r i * (c j * A i j)) = + (∏ i, r i) * (∏ j, c j) * A.det := by + calc + _ = (∏ i, r i) * (Matrix.of fun i j => c j * A i j).det := + Matrix.det_mul_column r (Matrix.of fun i j => c j * A i j) + _ = _ := by rw [Matrix.det_mul_row c A]; ring + +theorem cleared_det_norm_bound {ι : Type*} [Fintype ι] [DecidableEq ι] + (A : Matrix ι ι ℂ) (B : Matrix ι ι GaussianInt) + (r c : ι → ℝ) (hr : ∀ i, 0 < r i) (hc : ∀ i, 0 < c i) + (hA : A.det ≠ 0) + (hB : B.map GaussianInt.toComplex = fun i j => (r i : ℂ) * ((c j : ℂ) * A i j)) : + 1 ≤ (∏ i, r i) * (∏ j, c j) * ‖A.det‖ := by + have hd : (B.map GaussianInt.toComplex).det = + (∏ i, (r i : ℂ)) * (∏ j, (c j : ℂ)) * A.det := by + rw [hB, det_row_column_scale] + have hn : B.det ≠ 0 := by + intro he + have hz : (B.map GaussianInt.toComplex).det = 0 := by + change (GaussianInt.toComplex.mapMatrix B).det = 0 + rw [← RingHom.map_det, he, map_zero] + rw [hd] at hz + have hr' : (∏ i, (r i : ℂ)) ≠ 0 := Finset.prod_ne_zero_iff.mpr (by + intro i hi + exact_mod_cast (hr i).ne') + have hc' : (∏ j, (c j : ℂ)) ≠ 0 := Finset.prod_ne_zero_iff.mpr (by + intro j hj + exact_mod_cast (hc j).ne') + exact mul_ne_zero (mul_ne_zero hr' hc') hA hz + have h := gaussian_det_norm_one_le B hn + rw [hd, norm_mul, norm_mul, norm_prod, norm_prod] at h + simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (hr _), + abs_of_pos (hc _)] using h + +theorem cleared_det_log_bound {ι : Type*} [Fintype ι] [DecidableEq ι] + (A : Matrix ι ι ℂ) (B : Matrix ι ι GaussianInt) + (r c : ι → ℝ) (hr : ∀ i, 0 < r i) (hc : ∀ i, 0 < c i) + (hA : A.det ≠ 0) + (hB : B.map GaussianInt.toComplex = fun i j => (r i : ℂ) * ((c j : ℂ) * A i j)) : + -(∑ i, Real.log (r i)) - ∑ j, Real.log (c j) ≤ Real.log ‖A.det‖ := by + have hrp : 0 < ∏ i, r i := Finset.prod_pos (by intro i hi; exact hr i) + have hcp : 0 < ∏ i, c i := Finset.prod_pos (by intro i hi; exact hc i) + have hn : 0 < ‖A.det‖ := norm_pos_iff.mpr hA + have h := Real.log_nonneg (cleared_det_norm_bound A B r c hr hc hA hB) + rw [Real.log_mul (mul_pos hrp hcp).ne' hn.ne', Real.log_mul hrp.ne' hcp.ne', + Real.log_prod (by intro i hi; exact (hr i).ne'), + Real.log_prod (by intro i hi; exact (hc i).ne')] at h + linarith + +theorem log_lcm_power_product_le {ι : Type*} (s : Finset ι) (T e : ι → ℕ) : + Real.log (∏ i ∈ s, (Nat.lcmUpto (T i) : ℝ) ^ e i) ≤ + lcmConstant * ∑ i ∈ s, (e i : ℝ) * T i := by + rw [Real.log_prod (by intro i hi; exact pow_ne_zero _ (by exact_mod_cast Nat.lcmUpto_ne_zero (T i)))] + simp_rw [Real.log_pow] + rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro i hi + have h := mul_le_mul_of_nonneg_left (log_lcmUpto_le (T i)) (Nat.cast_nonneg (e i) : (0 : ℝ) ≤ e i) + nlinarith only [h] + +theorem log_lcm_floor_product_le {ι : Type*} (s : Finset ι) + (T : ι → ℕ) (w : ι → ℝ) (H : ℝ) (hH : 0 ≤ H) (hw : ∀ i ∈ s, 0 < w i) : + Real.log (∏ i ∈ s, (Nat.lcmUpto (T i) : ℝ) ^ ⌊H / w i⌋₊) ≤ + H * lcmConstant * ∑ i ∈ s, (T i : ℝ) / w i := by + calc + _ ≤ lcmConstant * ∑ i ∈ s, (⌊H / w i⌋₊ : ℝ) * T i := + log_lcm_power_product_le s T _ + _ ≤ lcmConstant * ∑ i ∈ s, (H / w i) * T i := by + apply mul_le_mul_of_nonneg_left _ lcmConstant_pos.le + apply Finset.sum_le_sum + intro i hi + apply mul_le_mul_of_nonneg_right _ (Nat.cast_nonneg (T i)) + exact Nat.floor_le (div_nonneg hH (hw i hi).le) + _ = _ := by + rw [Finset.mul_sum, Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + ring + +theorem sum_ceil_truncation_div_le {ι : Type*} (s : Finset ι) + (w : ι → ℝ) (F v : ℝ) (hF : 0 ≤ F) (hv : 0 < v) (hw : ∀ i ∈ s, 0 < w i) : + (∑ i ∈ s, (⌈F * w i / v⌉₊ : ℝ) / w i) ≤ + F * s.card / v + ∑ i ∈ s, 1 / w i := by + calc + _ ≤ ∑ i ∈ s, (F * w i / v + 1) / w i := by + apply Finset.sum_le_sum + intro i hi + apply div_le_div_of_nonneg_right _ (hw i hi).le + exact (Nat.ceil_lt_add_one (div_nonneg (mul_nonneg hF (hw i hi).le) hv.le)).le + _ = ∑ i ∈ s, (F / v + 1 / w i) := by + apply Finset.sum_congr rfl + intro i hi + field_simp [(hw i hi).ne', hv.ne'] + _ = _ := by rw [Finset.sum_add_distrib, Finset.sum_const]; simp; ring + +theorem truncation_denominator_log_le {ι : Type*} (s : Finset ι) + (w : ι → ℝ) (F v H : ℝ) (hF : 0 ≤ F) (hv : 0 < v) (hH : 0 < H) + (hw : ∀ i ∈ s, 0 < w i) : + Real.log (∏ i ∈ s, + (Nat.lcmUpto (⌈F * w i / v⌉₊) : ℝ) ^ ⌊H / w i⌋₊) / H ≤ + lcmConstant * F * s.card / v + lcmConstant * ∑ i ∈ s, 1 / w i := by + apply (div_le_iff₀ hH).mpr + calc + _ ≤ H * lcmConstant * ∑ i ∈ s, (⌈F * w i / v⌉₊ : ℝ) / w i := + log_lcm_floor_product_le s _ w H hH.le hw + _ ≤ H * lcmConstant * (F * s.card / v + ∑ i ∈ s, 1 / w i) := by + exact mul_le_mul_of_nonneg_left (sum_ceil_truncation_div_le s w F v hF hv hw) + (mul_pos hH lcmConstant_pos).le + _ = _ := by ring + +theorem dvd_lcmUpto_of_pos_le {k T : ℕ} (hk : 0 < k) (hkT : k ≤ T) : + k ∣ Nat.lcmUpto T := by + exact Finset.dvd_lcm (f := id) (Finset.mem_Icc.mpr ⟨hk, hkT⟩) + +theorem lcm_mul_log_coeff_gaussian (T k : ℕ) (hk : k ≤ T) : + (Nat.lcmUpto T : ℂ) * PowerSeries.coeff k (PowerSeries.log ℂ) ∈ + GaussianInt.toComplex.range := by + by_cases hk0 : k = 0 + · simp [hk0] + obtain ⟨m, hm⟩ := dvd_lcmUpto_of_pos_le (Nat.pos_of_ne_zero hk0) hk + refine ⟨((-1 : GaussianInt) ^ (k + 1)) * (m : GaussianInt), ?_⟩ + rw [PowerSeries.coeff_log, ite_eq_right hk0, hm] + have hkC : (k : ℂ) ≠ 0 := by exact_mod_cast hk0 + simp only [map_mul, map_pow, map_neg, map_one, map_natCast, map_div₀, Nat.cast_mul] + field_simp + +theorem cleared_log_trunc_mem (T : ℕ) : + Polynomial.C (Nat.lcmUpto T : ℂ) * PowerSeries.trunc T (PowerSeries.log ℂ) ∈ + (Polynomial.mapRingHom GaussianInt.toComplex).range := by + apply (Polynomial.mem_map_range GaussianInt.toComplex).mpr + intro k + rw [Polynomial.coeff_C_mul, PowerSeries.coeff_trunc] + split_ifs with hk + · exact lcm_mul_log_coeff_gaussian T k hk.le + · simp + +theorem exists_cleared_log_trunc (T : ℕ) : + ∃ P : Polynomial GaussianInt, + P.map GaussianInt.toComplex = + Polynomial.C (Nat.lcmUpto T : ℂ) * PowerSeries.trunc T (PowerSeries.log ℂ) := + cleared_log_trunc_mem T + +theorem gaussian_C_mem (z : GaussianInt) : + Polynomial.C (z : ℂ) ∈ (Polynomial.mapRingHom GaussianInt.toComplex).range := by + exact ⟨Polynomial.C z, by simp⟩ + +theorem cleared_shifted_log_trunc_mem (T q : ℕ) (z : GaussianInt) : + Polynomial.C (Nat.lcmUpto T : ℂ) * + (Polynomial.C (z : ℂ) + Polynomial.C (q : ℂ) * + PowerSeries.trunc T (PowerSeries.log ℂ)) ∈ + (Polynomial.mapRingHom GaussianInt.toComplex).range := by + let S := (Polynomial.mapRingHom GaussianInt.toComplex).range + have hL : Polynomial.C (Nat.lcmUpto T : ℂ) ∈ S := by + simp + have hq : Polynomial.C (q : ℂ) ∈ S := by + simp + have hlog := cleared_log_trunc_mem T + have h := S.add_mem (S.mul_mem hL (gaussian_C_mem z)) (S.mul_mem hq hlog) + convert h using 1 + ring + +theorem cleared_polynomial_power_mem (L e d : ℕ) (f : Polynomial ℂ) (hd : d ≤ e) + (hf : Polynomial.C (L : ℂ) * f ∈ (Polynomial.mapRingHom GaussianInt.toComplex).range) : + Polynomial.C ((L : ℂ) ^ e) * f ^ d ∈ + (Polynomial.mapRingHom GaussianInt.toComplex).range := by + let S := (Polynomial.mapRingHom GaussianInt.toComplex).range + have hL : Polynomial.C (L : ℂ) ∈ S := by + simp + have h := S.mul_mem (S.pow_mem hL (e - d)) (S.pow_mem hf d) + have he : e = (e - d) + d := (Nat.sub_add_cancel hd).symm + rw [he, map_pow, pow_add] + simpa only [mul_pow, mul_assoc] using h + +theorem cleared_polynomial_product_mem {ι : Type*} (s : Finset ι) + (L e d : ι → ℕ) (f : ι → Polynomial ℂ) (hd : ∀ i ∈ s, d i ≤ e i) + (hf : ∀ i ∈ s, Polynomial.C (L i : ℂ) * f i ∈ + (Polynomial.mapRingHom GaussianInt.toComplex).range) : + Polynomial.C (∏ i ∈ s, (L i : ℂ) ^ e i) * (∏ i ∈ s, f i ^ d i) ∈ + (Polynomial.mapRingHom GaussianInt.toComplex).range := by + let S := (Polynomial.mapRingHom GaussianInt.toComplex).range + have h := S.prod_mem (fun i hi => cleared_polynomial_power_mem (L i) (e i) (d i) + (f i) (hd i hi) (hf i hi)) + simpa only [← Finset.prod_mul_distrib, map_prod] using h + +theorem common_denominator_coeff_gaussian {ι : Type*} (s : Finset ι) + (L e d : ι → ℕ) (f : ι → Polynomial ℂ) (P : Polynomial GaussianInt) + (hd : ∀ i ∈ s, d i ≤ e i) + (hf : ∀ i ∈ s, Polynomial.C (L i : ℂ) * f i ∈ + (Polynomial.mapRingHom GaussianInt.toComplex).range) (k : ℕ) : + (∏ i ∈ s, (L i : ℂ) ^ e i) * + (P.map GaussianInt.toComplex * ∏ i ∈ s, f i ^ d i).coeff k ∈ + GaussianInt.toComplex.range := by + let S := (Polynomial.mapRingHom GaussianInt.toComplex).range + have hP : P.map GaussianInt.toComplex ∈ S := ⟨P, rfl⟩ + have h := S.mul_mem hP (cleared_polynomial_product_mem s L e d f hd hf) + have he : P.map GaussianInt.toComplex * + (Polynomial.C (∏ i ∈ s, (L i : ℂ) ^ e i) * ∏ i ∈ s, f i ^ d i) = + Polynomial.C (∏ i ∈ s, (L i : ℂ) ^ e i) * + (P.map GaussianInt.toComplex * ∏ i ∈ s, f i ^ d i) := by ring + rw [he] at h + have hc := (Polynomial.mem_map_range GaussianInt.toComplex).mp h k + simpa only [Polynomial.coeff_C_mul] using hc + +theorem cleared_det_log_bound_of_entries {ι : Type*} [Fintype ι] [DecidableEq ι] + (A : Matrix ι ι ℂ) (r c : ι → ℝ) (hr : ∀ i, 0 < r i) (hc : ∀ i, 0 < c i) + (hA : A.det ≠ 0) + (hentries : ∀ i j, (r i : ℂ) * ((c j : ℂ) * A i j) ∈ GaussianInt.toComplex.range) : + -(∑ i, Real.log (r i)) - ∑ j, Real.log (c j) ≤ Real.log ‖A.det‖ := by + classical + choose B hB using hentries + apply cleared_det_log_bound A B r c hr hc hA + ext i j + exact hB i j + +theorem cleared_det_log_bound_with_denominator {ι : Type*} [Fintype ι] [DecidableEq ι] + (A : Matrix ι ι ℂ) (r c : ι → ℝ) (D : ℝ) + (hD : 0 < D) (hr : ∀ i, 0 < r i) (hc : ∀ i, 0 < c i) (hA : A.det ≠ 0) + (hentries : ∀ i j, (D : ℂ) * (r i : ℂ) * ((c j : ℂ) * A i j) ∈ + GaussianInt.toComplex.range) : + -(Fintype.card ι : ℝ) * Real.log D - (∑ i, Real.log (r i)) - + ∑ j, Real.log (c j) ≤ Real.log ‖A.det‖ := by + have h := cleared_det_log_bound_of_entries A (fun i => D * r i) c + (fun i => mul_pos hD (hr i)) hc hA (by simpa using hentries) + simp_rw [Real.log_mul hD.ne' (hr _).ne'] at h + rw [Finset.sum_add_distrib, Finset.sum_const] at h + simp only [Finset.card_univ, nsmul_eq_mul] at h + linarith + +theorem shifted_truncation_product_coeff_gaussian {ι : Type*} (s : Finset ι) + (T q e d : ι → ℕ) (z : ι → GaussianInt) (P : Polynomial GaussianInt) + (hd : ∀ i ∈ s, d i ≤ e i) (k : ℕ) : + (∏ i ∈ s, (Nat.lcmUpto (T i) : ℂ) ^ e i) * + (P.map GaussianInt.toComplex * ∏ i ∈ s, + (Polynomial.C (z i : ℂ) + Polynomial.C (q i : ℂ) * + PowerSeries.trunc (T i) (PowerSeries.log ℂ)) ^ d i).coeff k ∈ + GaussianInt.toComplex.range := by + exact common_denominator_coeff_gaussian s (fun i => Nat.lcmUpto (T i)) e d _ P hd + (fun i hi => cleared_shifted_log_trunc_mem (T i) (q i) (z i)) k + +theorem column_log_cost_le {ι : Type*} (s : Finset ι) (a q : ι → ℕ) : + (∑ i ∈ s, (a i : ℝ) * Real.log (q i)) ≤ + ∑ i ∈ s, (a i : ℝ) * (⌈Real.log (q i)⌉₊ : ℝ) := by + apply Finset.sum_le_sum + intro i hi + exact mul_le_mul_of_nonneg_left (Nat.le_ceil _) (Nat.cast_nonneg _) + +theorem sum_exponents_le_weight_div {ι : Type*} (s : Finset ι) + (a : ι → ℕ) (w : ι → ℝ) (wmin : ℝ) (hmin : 0 < wmin) + (hw : ∀ i ∈ s, wmin ≤ w i) : + (∑ i ∈ s, (a i : ℝ)) ≤ (∑ i ∈ s, (a i : ℝ) * w i) / wmin := by + apply (le_div_iff₀ hmin).mpr + rw [Finset.sum_mul] + exact Finset.sum_le_sum (fun i hi => mul_le_mul_of_nonneg_left (hw i hi) (Nat.cast_nonneg _)) + +theorem row_log_cost_lower {ι : Type*} (s : Finset ι) + (a q : ι → ℕ) (wmin U : ℝ) (hmin : 0 < wmin) + (hw : ∀ i ∈ s, wmin ≤ (⌈Real.log (q i)⌉₊ : ℝ)) + (hbudget : (∑ i ∈ s, (a i : ℝ) * (⌈Real.log (q i)⌉₊ : ℝ)) ≤ U) : + (∑ i ∈ s, (a i : ℝ) * (⌈Real.log (q i)⌉₊ : ℝ)) - U / wmin ≤ + ∑ i ∈ s, (a i : ℝ) * Real.log (q i) := by + have hsum := sum_exponents_le_weight_div s a (fun i => (⌈Real.log (q i)⌉₊ : ℝ)) + wmin hmin hw + have hsumU : (∑ i ∈ s, (a i : ℝ)) ≤ U / wmin := + hsum.trans (div_le_div_of_nonneg_right hbudget hmin.le) + have hceil : (∑ i ∈ s, (a i : ℝ) * (⌈Real.log (q i)⌉₊ : ℝ)) ≤ + (∑ i ∈ s, (a i : ℝ) * Real.log (q i)) + ∑ i ∈ s, (a i : ℝ) := by + rw [← Finset.sum_add_distrib] + apply Finset.sum_le_sum + intro i hi + have h := mul_le_mul_of_nonneg_left + (Nat.ceil_lt_add_one (Real.log_natCast_nonneg (q i))).le (Nat.cast_nonneg (a i) : (0 : ℝ) ≤ a i) + nlinarith only [h] + linarith + +theorem normalized_arithmetic_bound (M H b E δ logD columnCost rowCost logAbsDet : ℝ) + (hM : 0 < M) (hH : 0 < H) + (hclear : -M * logD - columnCost + rowCost ≤ logAbsDet) + (hden : logD ≤ H * E) + (hcol : columnCost ≤ M * H) + (hrow : M * H * b - M * H * δ ≤ rowCost) : + -(1 - b) - (E + δ) ≤ logAbsDet / (M * H) := by + apply (le_div_iff₀ (mul_pos hM hH)).mpr + have hd := mul_le_mul_of_nonneg_left hden hM.le + nlinarith only [hclear, hd, hcol, hrow] + +end PiExponent.Arithmetic + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/CanonicalAffineRecovery.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/CanonicalAffineRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..aeabd506154dadae02fd628dea1f7724648598b8 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/CanonicalAffineRecovery.lean @@ -0,0 +1,71 @@ +import OAI.NumberTheory.PiExponent.Geometry.CanonicalRecoveryProperties +import OAI.NumberTheory.PiExponent.LocalAlgebra.AffineIdealSections +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealSectionRestriction +import OAI.NumberTheory.PiExponent.LocalAlgebra.PresentedIdealIso + +namespace OAI + +noncomputable section +namespace PiExponent.CanonicalAffineRecovery +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.IdealModule PiExponentSeshadri.IdealPullback +open GeometrySupport + +private theorem bijective_iff_of_square {A B C D : Type*} + (p : A → B) (q : C → D) (a : A → C) (b : B → D) + (ha : Function.Bijective a) (hb : Function.Bijective b) + (h : ∀ x, b (p x) = q (a x)) : Function.Bijective p ↔ Function.Bijective q := by + have he : b ∘ p = q ∘ a := funext h + rw [← hb.of_comp_iff' p, he] + exact Function.Bijective.of_comp_iff q ha + +theorem bijective_iff_comap {R : Type} [CommRing R] {Y : Scheme.{0}} + (I : Ideal R) (f : Y ⟶ Spec (CommRingCat.of R)) [QuasiCompact f] + (L : LineBundle Y) (ι : L.sheaf ⟶ structureSheaf Y) + (hL : PresentsPullbackIdeal (specIdeal I) f L ι) + (r : I → Γ(L.sheaf,⊤)) + (hr : ∀ a : I, ι.app ⊤ (r a) = + f.appTop ((Scheme.ΓSpecIso (CommRingCat.of R)).inv a.val)) : + Function.Bijective r ↔ + Function.Bijective ((IdealPullbackMap.comap f (specIdeal I)).app ⊤) := by + let t := PresentedIdealIso.toIdealModule (specIdeal I) f L ι hL + have ht : Function.Bijective (t.app ⊤) := ConcreteCategory.bijective_of_isIso _ + have hdiag (a : I) : + t.app ⊤ (r a) = + IdealSectionRestriction.pullback f (specIdeal I) ⊤ ⊤ (by simp) + ((AffineIdealSections.equiv I).symm a) := by + apply IdealSectionRestriction.inclusion_injective ((specIdeal I).comap f) ⊤ + have h₁ := congrArg (fun g => g.app ⊤ (r a)) + (PresentedIdealIso.toIdealModule_inclusion (specIdeal I) f L ι hL) + have h₂ := IdealSectionRestriction.pullback_inclusion f (specIdeal I) ⊤ ⊤ + (by simp) ((AffineIdealSections.equiv I).symm a) + have htop : f.appLE ⊤ ⊤ (by simp) = f.appTop := f.appLE_eq_app + rw [htop] at h₂ + have h₃ := AffineIdealSections.equiv_symm_inclusion I a + exact (h₁.trans (hr a)).trans + ((congrArg f.appTop h₃).symm.trans h₂.symm) + exact (bijective_iff_of_square r + (IdealSectionRestriction.pullback f (specIdeal I) ⊤ ⊤ (by simp)) + (AffineIdealSections.equiv I).symm (t.app ⊤) + (AffineIdealSections.equiv I).symm.bijective ht hdiag).trans + (IdealSectionRestriction.pullback_bijective_iff_comap f (specIdeal I) ⊤ ⊤ + (by simp) (by simp)) + +theorem power_bijective_iff_comap {R : Type} [CommRing R] {Y : Scheme.{0}} + (I : Ideal R) (f : Y ⟶ Spec (CommRingCat.of R)) [QuasiCompact f] + (L : LineBundle Y) (ι : L.sheaf ⟶ structureSheaf Y) + (hL : PresentsPullbackIdeal (specIdeal I) f L ι) (n : ℕ) + (r : ↥(I^n : Ideal R) → Γ((L.pow n).sheaf,⊤)) + (hr : ∀ a : ↥(I^n : Ideal R), (idealPowerInclusion L ι n).app ⊤ (r a) = + f.appTop ((Scheme.ΓSpecIso (CommRingCat.of R)).inv a.val)) : + Function.Bijective r ↔ CanonicalRecoveryProperties.ComapBijective f (specIdeal (I^n)) ⊤ := by + have hp : PresentsPullbackIdeal (specIdeal (I^n)) f (L.pow n) (idealPowerInclusion L ι n) := by + rw [specIdeal_pow] + exact PresentedIdealIso.idealPower_presents (specIdeal I) f L ι hL n + exact bijective_iff_comap (I^n) f (L.pow n) (idealPowerInclusion L ι n) hp r hr + +end PiExponent.CanonicalAffineRecovery + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedAnnihilatedDescent.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedAnnihilatedDescent.lean new file mode 100644 index 0000000000000000000000000000000000000000..11ab92af1fa2d7b03b8c72c48623447e86153152 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedAnnihilatedDescent.lean @@ -0,0 +1,91 @@ +import OAI.NumberTheory.PiExponent.LocalAlgebra.FiniteGlobalPresentation + +namespace OAI + +namespace PiExponentSeshadri.ClosedAnnihilatedDescent +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +variable {R S : CommRingCat.{0}} + +def specPushforwardSectionsIso (φ : R ⟶ S) (N : (Spec S).Modules) : + moduleSpecΓFunctor.obj ((Scheme.Modules.pushforward (Spec.map φ)).obj N) ≅ + (ModuleCat.restrictScalars φ.hom).obj (moduleSpecΓFunctor.obj N) := by + let E : TopCat.Sheaf (ModuleCat R) (Spec R) ⥤ ModuleCat R := + TopCat.Sheaf.forget _ _ ⋙ (evaluation _ _).obj (op ⊤) + exact E.mapIso ((pushforwardCompModulesSpecToSheafIso φ).app N) + +def specPushforwardTildeIso (φ : R ⟶ S) (N : ModuleCat S) : + (Scheme.Modules.pushforward (Spec.map φ)).obj (tilde N) ≅ + tilde ((ModuleCat.restrictScalars φ.hom).obj N) := by + let P := (Scheme.Modules.pushforward (Spec.map φ)).obj (tilde N) + let : IsIso P.fromTildeΓ := isIso_fromTildeΓ_pushforward φ (tilde N) + exact (asIso P.fromTildeΓ).symm ≪≫ (tilde.functor R).mapIso + (specPushforwardSectionsIso φ (tilde N) ≪≫ + (ModuleCat.restrictScalars φ.hom).mapIso (tilde.isoTop N).symm) + +def quotientModule (I : Ideal R) (M : ModuleCat R) + (h : I ≤ Module.annihilator R M) : ModuleCat (CommRingCat.of (R ⧸ I)) := by + let ht : Module.IsTorsionBySet R M I := fun {x} {a} => + Module.mem_annihilator.mp (h a.property) x + letI := ht.module + exact ModuleCat.of _ M + +def quotientModuleRestrictIso (I : Ideal R) (M : ModuleCat R) + (h : I ≤ Module.annihilator R M) : + (ModuleCat.restrictScalars (Ideal.Quotient.mk I)).obj (quotientModule I M h) ≅ M := + Iso.refl M + +def affineDescent (I : Ideal R) (M : (Spec R).Modules) + (h : I ≤ Module.annihilator R (moduleSpecΓFunctor.obj M)) : + (Spec (CommRingCat.of (R ⧸ I))).Modules := + tilde (quotientModule I (moduleSpecΓFunctor.obj M) h) + +instance affineDescent_isQuasicoherent (I : Ideal R) (M : (Spec R).Modules) + (h : I ≤ Module.annihilator R (moduleSpecΓFunctor.obj M)) : + (affineDescent I M h).IsQuasicoherent := by + unfold affineDescent + infer_instance + +def affineDescentPushforwardIso (I : Ideal R) (M : (Spec R).Modules) [M.IsQuasicoherent] + (h : I ≤ Module.annihilator R (moduleSpecΓFunctor.obj M)) : + (Scheme.Modules.pushforward (Spec.map (CommRingCat.ofHom (Ideal.Quotient.mk I)))).obj + (affineDescent I M h) ≅ M := + specPushforwardTildeIso _ _ ≪≫ + (tilde.functor R).mapIso (quotientModuleRestrictIso I (moduleSpecΓFunctor.obj M) h) ≪≫ + @asIso _ _ _ _ M.fromTildeΓ + (Scheme.Modules.isIso_fromTildeΓ_of_isQuasicoherent M) + +instance quotientModule_finite (I : Ideal R) (M : ModuleCat R) [Module.Finite R M] + (h : I ≤ Module.annihilator R M) : + Module.Finite (CommRingCat.of (R ⧸ I)) (quotientModule I M h) := by + let ht : Module.IsTorsionBySet R M I := fun {x} {a} => + Module.mem_annihilator.mp (h a.property) x + let := ht.module + let : IsScalarTower R (R ⧸ I) M := ht.isScalarTower + change Module.Finite (R ⧸ I) M + exact Module.Finite.of_restrictScalars_finite R (R ⧸ I) M + +lemma affineDescent_finitePresentation [IsNoetherianRing R] (I : Ideal R) + (M : (Spec R).Modules) [Module.Finite R (moduleSpecΓFunctor.obj M)] + (h : I ≤ Module.annihilator R (moduleSpecΓFunctor.obj M)) : + (affineDescent I M h).IsFinitePresentation := + PiExponent.FiniteGlobalPresentation.tilde_finitePresentation _ + +theorem exists_affine_coherent_descent [IsNoetherianRing R] (I : Ideal R) + (M : (Spec R).Modules) [M.IsFinitePresentation] + (h : I ≤ Module.annihilator R (moduleSpecΓFunctor.obj M)) : + ∃ N : (Spec (CommRingCat.of (R ⧸ I))).Modules, + N.IsFinitePresentation ∧ Nonempty + ((Scheme.Modules.pushforward (Spec.map (CommRingCat.ofHom (Ideal.Quotient.mk I)))).obj N ≅ M) := by + let : M.IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData M).choose.isQuasicoherent + have : Module.Finite R (moduleSpecΓFunctor.obj M) := + PiExponent.CoherentAffineFinite.spec_sections_finite_of_localGenerators M + (PiExponent.CoherentAffineFinite.locallyFinitelyGenerated_of_finitePresentation M) + exact ⟨affineDescent I M h, affineDescent_finitePresentation I M h, + ⟨affineDescentPushforwardIso I M h⟩⟩ + +end +end PiExponentSeshadri.ClosedAnnihilatedDescent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedImmersionModules.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedImmersionModules.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7cf4cd05607b17cdeec7b33a0ca4e333f27e2c9 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedImmersionModules.lean @@ -0,0 +1,113 @@ +import OAI.NumberTheory.PiExponent.Approximation.ClosedPullbackUnit + +namespace OAI + +namespace PiExponentSeshadri.ClosedImmersionModules +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +variable {X Y : Scheme.{0}} (f : Y ⟶ X) + +def additiveFullyFaithful [IsClosedImmersion f] : + ((Functor.whiskeringLeft _ _ AddCommGrpCat).obj (Opens.map f.base).op).FullyFaithful := by + let h := f.isClosedEmbedding.isEmbedding.isInducing + let adj := h.adjunction + have hc (V : Y.Opens) : IsIso (adj.counit.app V) := by + have he : adj.counit.app V = eqToHom (h.map_functorObj V) := Subsingleton.elim _ _ + exact he.symm ▸ (eqToIso (h.map_functorObj V)).isIso_hom + let : IsIso adj.counit := NatIso.isIso_of_isIso_app _ + let := adj.fullyFaithfulROfIsIsoCounit.full + let := adj.fullyFaithfulROfIsIsoCounit.faithful + let W := (MorphismProperty.isomorphisms Y.Opens).inverseImage (Opens.map f.base) + let : (Opens.map f.base).IsLocalization W := adj.isLocalization + let : (Opens.map f.base).op.IsLocalization W.op := + (Functor.IsLocalization.op_iff (Opens.map f.base) W).mpr inferInstance + exact Localization.fullyFaithfulWhiskeringLeft (Opens.map f.base).op W.op AddCommGrpCat + +lemma preimage_surjective [IsClosedImmersion f] : + Function.Surjective (fun U : X.Opens => f ⁻¹ᵁ U) := by + intro V + let h := f.isClosedEmbedding.isEmbedding.isInducing + exact ⟨h.functorObj V, h.map_functorObj V⟩ + +def additivePreimage [IsClosedImmersion f] {M N : Y.Modules} + (a : (Scheme.Modules.pushforward f).obj M ⟶ (Scheme.Modules.pushforward f).obj N) : + M.presheaf ⟶ N.presheaf := + (additiveFullyFaithful f).preimage a.mapPresheaf + +lemma additivePreimage_app [IsClosedImmersion f] {M N : Y.Modules} + (a : (Scheme.Modules.pushforward f).obj M ⟶ (Scheme.Modules.pushforward f).obj N) + (U : X.Opens) : (additivePreimage f a).app (op (f ⁻¹ᵁ U)) = a.app U := by + exact congrArg (fun b : (Opens.map f.base).op ⋙ M.presheaf ⟶ + (Opens.map f.base).op ⋙ N.presheaf => b.app (op U)) + ((additiveFullyFaithful f).map_preimage (X := M.presheaf) (Y := N.presheaf) a.mapPresheaf) + +lemma additivePreimage_smul [IsClosedImmersion f] + {M N : Y.Modules} + (a : (Scheme.Modules.pushforward f).obj M ⟶ (Scheme.Modules.pushforward f).obj N) + (V : Y.Opens) (r : Γ(Y,V)) (m : Γ(M,V)) : + (additivePreimage f a).app (op V) (r • m) = + r • (additivePreimage f a).app (op V) m := by + obtain ⟨U, rfl⟩ := preimage_surjective f V + apply N.isSheaf.section_ext + intro y hy + obtain ⟨W, hW, hyW, hWU⟩ := exists_isAffineOpen_mem_and_subset (X := X) (x := f y) (U := U) hy + let j : W ⟶ U := homOfLE hWU + let k : f ⁻¹ᵁ W ⟶ f ⁻¹ᵁ U := (Opens.map f.base).map j + refine ⟨f ⁻¹ᵁ W, leOfHom k, hyW, ?_⟩ + have hn (z : Γ(M,f ⁻¹ᵁ U)) : + (additivePreimage f a).app (op (f ⁻¹ᵁ W)) (M.presheaf.map k.op z) = + N.presheaf.map k.op ((additivePreimage f a).app (op (f ⁻¹ᵁ U)) z) := + CategoryTheory.congr_fun ((additivePreimage f a).naturality k.op) z + have hs : N.presheaf.map k.op (r • (additivePreimage f a).app (op (f ⁻¹ᵁ U)) m) = + Y.presheaf.map k.op r • N.presheaf.map k.op ((additivePreimage f a).app (op (f ⁻¹ᵁ U)) m) := + N.val.map_smul k.op r ((additivePreimage f a).app (op (f ⁻¹ᵁ U)) m) + change N.presheaf.map k.op ((additivePreimage f a).app (op (f ⁻¹ᵁ U)) (r • m)) = + N.presheaf.map k.op (r • (additivePreimage f a).app (op (f ⁻¹ᵁ U)) m) + rw [← hn, hs, ← hn, additivePreimage_app] + obtain ⟨c, hc⟩ := f.app_surjective W hW (Y.presheaf.map k.op r) + have hm := M.val.map_smul k.op r m + change M.presheaf.map k.op (r • m) = Y.presheaf.map k.op r • M.presheaf.map k.op m at hm + rw [hm, ← hc] + exact a.app_smul (r := c) (x := M.presheaf.map k.op m) + +def modulePreimage [IsClosedImmersion f] {M N : Y.Modules} + (a : (Scheme.Modules.pushforward f).obj M ⟶ (Scheme.Modules.pushforward f).obj N) : + M ⟶ N where + val.app V := ModuleCat.ofHom (X := M.val.obj V) (Y := N.val.obj V) + { toAddHom := ((additivePreimage f a).app V).hom.toAddHom + map_smul' := fun r m => additivePreimage_smul f a V.unop r m } + val.naturality {V W} j := by + ext m + exact CategoryTheory.congr_fun ((additivePreimage f a).naturality j) m + +def pushforwardFullyFaithful [IsClosedImmersion f] : + (Scheme.Modules.pushforward f).FullyFaithful where + preimage a := modulePreimage f a + map_preimage a := by + ext U m + exact CategoryTheory.congr_fun (additivePreimage_app f a U) m + preimage_map a := by + apply Scheme.Modules.hom_ext + intro V + obtain ⟨U, rfl⟩ := preimage_surjective f V + exact additivePreimage_app f ((Scheme.Modules.pushforward f).map a) U + +theorem counit_isIso [IsClosedImmersion f] : + IsIso (Scheme.Modules.pullbackPushforwardAdjunction f).counit := by + let := (pushforwardFullyFaithful f).full + let := (pushforwardFullyFaithful f).faithful + exact (Scheme.Modules.pullbackPushforwardAdjunction f).counit_isIso_of_R_fully_faithful + +theorem unit_isIso_of_pushforward [IsClosedImmersion f] + {M : X.Modules} {N : Y.Modules} + (e : M ≅ (Scheme.Modules.pushforward f).obj N) : + IsIso ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M) := by + let : IsIso (Scheme.Modules.pullbackPushforwardAdjunction f).counit := counit_isIso f + let := (Scheme.Modules.pullbackPushforwardAdjunction f).fullyFaithfulROfIsIsoCounit.full + let := (Scheme.Modules.pullbackPushforwardAdjunction f).fullyFaithfulROfIsIsoCounit.faithful + exact (Scheme.Modules.pullbackPushforwardAdjunction f).isIso_unit_app_of_iso e + +end +end PiExponentSeshadri.ClosedImmersionModules + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedImmersionSerreTransfer.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedImmersionSerreTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..997438f32b910c3b4bc57e9c5ec18a4dc791a782 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedImmersionSerreTransfer.lean @@ -0,0 +1,106 @@ +import OAI.NumberTheory.PiExponent.Approximation.ClosedPushforwardCoherent + +namespace OAI + +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits CategoryTheory.Abelian +open TopologicalSpace Opposite +open PiExponentSeshadri.FlasqueCohomology + +namespace PiExponent.ClosedImmersionSerreTransfer + +universe u +private abbrev schemeUnit (Z : Scheme.{u}) : Z.Modules := + SheafOfModules.unit Z.ringCatSheaf + +variable {X Y : Scheme.{u}} (f : X ⟶ Y) + +def structureMap : schemeUnit Y ⟶ + (Scheme.Modules.pushforward f).obj (schemeUnit X) := + SheafOfModules.unitToPushforwardObjUnit f.toRingCatSheafHom + +lemma globalHom_push (M : X.Modules) (g : schemeUnit X ⟶ M) : + globalHomEquiv Y.ringCatSheaf ((Scheme.Modules.pushforward f).obj M) + (structureMap f ≫ (Scheme.Modules.pushforward f).map g) = + globalHomEquiv X.ringCatSheaf M g := by + change (g.val.app (op ⊤)) ((f.app ⊤) 1) = (g.val.app (op ⊤)) (1 : Γ(X,⊤)) + rw [map_one] + rfl + +lemma globalHom_push_bijective (M : X.Modules) : + Function.Bijective (fun g : schemeUnit X ⟶ M => + structureMap f ≫ (Scheme.Modules.pushforward f).map g) := by + constructor + · intro a b h + apply (globalHomEquiv X.ringCatSheaf M).injective + exact (globalHom_push f M a).symm.trans + ((congrArg (globalHomEquiv Y.ringCatSheaf _) h).trans (globalHom_push f M b)) + · intro b + obtain ⟨a, ha⟩ := (globalHomEquiv X.ringCatSheaf M).surjective + (globalHomEquiv Y.ringCatSheaf ((Scheme.Modules.pushforward f).obj M) b) + refine ⟨a, ?_⟩ + apply (globalHomEquiv Y.ringCatSheaf _).injective + exact (globalHom_push f M a).trans ha + +instance pushforward_flasque (M : X.Modules) + [TopCat.Sheaf.IsFlasque ((SheafOfModules.toSheaf X.ringCatSheaf).obj M)] : + TopCat.Sheaf.IsFlasque + ((SheafOfModules.toSheaf Y.ringCatSheaf).obj ((Scheme.Modules.pushforward f).obj M)) := + TopCat.Sheaf.IsFlasque.pushforward_isFlasque + ((SheafOfModules.toSheaf X.ringCatSheaf).obj M) f.base + +local instance : HasExt.{u+1} X.Modules := HasExt.standard _ +local instance : HasExt.{u+1} Y.Modules := HasExt.standard _ + +variable [PreservesFiniteColimits (Scheme.Modules.pushforward f)] + +def cohomologyMap (M : X.Modules) (n : ℕ) : + Ext.{u+1} (C := X.Modules) (schemeUnit X) M n →+ + Ext.{u+1} (C := Y.Modules) (schemeUnit Y) + ((Scheme.Modules.pushforward f).obj M) n := + PiExponentSeshadri.ExtSectionComparison.mapFrom + (Scheme.Modules.pushforward f) (structureMap f) M n + +theorem cohomologyMap_bijective (M : X.Modules) (n : ℕ) : + Function.Bijective (cohomologyMap f M n) := by + let : EnoughInjectives X.Modules := + PiExponentSeshadri.ModuleGrothendieck.enoughInjectives X.ringCatSheaf + apply PiExponentSeshadri.ExtSectionComparison.mapFrom_bijective + · exact globalHom_push_bijective f + · intro I hI q x + let : Injective (C := SheafOfModules X.ringCatSheaf) I := hI + let : TopCat.Sheaf.IsFlasque ((SheafOfModules.toSheaf X.ringCatSheaf).obj I) := + PiExponentSeshadri.ModuleFlasque.injective_isFlasque X.ringCatSheaf I + exact flasque_ext_zero Y.ringCatSheaf q ((Scheme.Modules.pushforward f).obj I) x + +def cohomologyEquiv (M : X.Modules) (n : ℕ) : + Ext.{u+1} (C := X.Modules) (schemeUnit X) M n ≃+ + Ext.{u+1} (C := Y.Modules) (schemeUnit Y) + ((Scheme.Modules.pushforward f).obj M) n := + AddEquiv.ofBijective (cohomologyMap f M n) (cohomologyMap_bijective f M n) + +theorem ext_zero_iff (M : X.Modules) (n : ℕ) : + (∀ x : Ext.{u+1} (C := X.Modules) (schemeUnit X) M n, x = 0) ↔ + (∀ x : Ext.{u+1} (C := Y.Modules) (schemeUnit Y) + ((Scheme.Modules.pushforward f).obj M) n, x = 0) := by + constructor + · intro h x + obtain ⟨y, rfl⟩ := (cohomologyEquiv f M n).surjective x + rw [h y, map_zero] + · intro h x + apply (cohomologyEquiv f M n).injective + rw [map_zero] + exact h _ + +def closedCohomologyEquiv {X Y : Scheme.{0}} (f : X ⟶ Y) + [IsClosedImmersion f] (M : X.Modules) (n : ℕ) : + Ext.{1} (C := X.Modules) (schemeUnit X) M n ≃+ + Ext.{1} (C := Y.Modules) (schemeUnit Y) + ((Scheme.Modules.pushforward f).obj M) n := + cohomologyEquiv f M n + +end PiExponent.ClosedImmersionSerreTransfer + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPowerSectionLifting.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPowerSectionLifting.lean new file mode 100644 index 0000000000000000000000000000000000000000..cdf831ed481176a3fef42e208d4bc13bd0bbccd8 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPowerSectionLifting.lean @@ -0,0 +1,51 @@ +import OAI.NumberTheory.PiExponent.Approximation.ClosedImmersionSerreTransfer +import OAI.NumberTheory.PiExponent.Approximation.ClosedRestrictionTensor +import OAI.NumberTheory.PiExponent.Approximation.ClosedThickeningSections + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits CategoryTheory.Abelian +open PiExponentSeshadri.Frames +variable {X Y : Scheme.{0}} +local instance : HasExt.{1} X.Modules := HasExt.standard _ + +theorem pullbackPowerSection_surjective_of_ideal_ext_zero (i : Y ⟶ X) + [IsClosedImmersion i] (L : LineBundle X) (n : ℕ) + (hzero : ∀ x : Abelian.Ext.{1} (structureSheaf X) + ((moduleTwistFunctor L n).obj (IdealModule.idealModule i)) 1, x = 0) : + Function.Surjective (pullbackPowerSection L i n) := by + let S := ShortComplex.mk (IdealModule.inclusion i) (IdealModule.structureMap i) + (kernel.condition _) + have hS := moduleTwistFunctor_shortExact L n S (IdealModule.closedSequence_exact i) + have hsurj := globalSections_surjective_of_ext_one_zero (S.map (moduleTwistFunctor L n)) hS hzero + intro σ + let e := PiExponent.ClosedRestrictionTensor.powerProjectionIso i L n + let b : GlobalSections X ((Scheme.Modules.pushforward i).obj ((L.pullback i).pow n).sheaf) := + IdealModule.structureMap i ≫ (Scheme.Modules.pushforward i).map σ + obtain ⟨a,ha⟩ := hsurj (b ≫ e.inv) + let t : GlobalSections X (L.pow n).sheaf := a ≫ (moduleTwistUnitIso L n).hom + refine ⟨t, ?_⟩ + apply (PiExponent.ClosedImmersionSerreTransfer.globalHom_push_bijective i + ((L.pullback i).pow n).sheaf).injective + have ht := PiExponent.ClosedRestrictionTensor.section_restriction_eq i L n t + change t ≫ (moduleTwistUnitIso L n).inv ≫ + (moduleTwistFunctor L n).map (IdealModule.structureMap i) ≫ e.hom = + IdealModule.structureMap i ≫ (Scheme.Modules.pushforward i).map + (pullbackPowerSection L i n t) at ht + change IdealModule.structureMap i ≫ (Scheme.Modules.pushforward i).map + (pullbackPowerSection L i n t) = b + rw [← ht] + dsimp only [t] + erw [Category.assoc a (moduleTwistUnitIso L n).hom, + (moduleTwistUnitIso L n).hom_inv_id_assoc] + change (a ≫ (moduleTwistFunctor L n).map (IdealModule.structureMap i)) ≫ e.hom = b + have ha' : a ≫ (moduleTwistFunctor L n).map (IdealModule.structureMap i) = b ≫ e.inv := ha + exact (congrArg (fun z => z ≫ e.hom) ha').trans (by simp only [Category.assoc, + Iso.inv_hom_id, Category.comp_id]) + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPullbackUnit.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPullbackUnit.lean new file mode 100644 index 0000000000000000000000000000000000000000..dbf8fa2883f80e801b00669aa17c78019a561338 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPullbackUnit.lean @@ -0,0 +1,120 @@ +import OAI.NumberTheory.PiExponent.Approximation.OpenBaseChange + +namespace OAI + +namespace PiExponentSeshadri.ClosedPullbackUnit +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +variable {X Y : Scheme.{0}} (f : Y ⟶ X) + +def opensEquivalence [IsIso f.base] : X.Opens ≌ Y.Opens := + Opens.mapMapIso (asIso f.base) + +lemma preimage_surjective [IsIso f.base] : + Function.Surjective (fun U : X.Opens => f ⁻¹ᵁ U) := by + intro V + refine ⟨(opensEquivalence f).inverse.obj V, ?_⟩ + exact le_antisymm (leOfHom ((opensEquivalence f).counitIso.app V).hom) + (leOfHom ((opensEquivalence f).counitIso.app V).inv) + +def additivePreimage [IsIso f.base] {M N : Y.Modules} + (a : (Scheme.Modules.pushforward f).obj M ⟶ (Scheme.Modules.pushforward f).obj N) : + M.presheaf ⟶ N.presheaf := by + let : (Opens.map f.base).IsEquivalence := (opensEquivalence f).isEquivalence_functor + exact ((Functor.whiskeringLeft _ _ AddCommGrpCat).obj (Opens.map f.base).op).preimage a.mapPresheaf + +lemma additivePreimage_app [IsIso f.base] {M N : Y.Modules} + (a : (Scheme.Modules.pushforward f).obj M ⟶ (Scheme.Modules.pushforward f).obj N) + (U : X.Opens) : (additivePreimage f a).app (op (f ⁻¹ᵁ U)) = a.app U := by + let : (Opens.map f.base).IsEquivalence := (opensEquivalence f).isEquivalence_functor + exact congrArg (fun b : (Opens.map f.base).op ⋙ M.presheaf ⟶ + (Opens.map f.base).op ⋙ N.presheaf => b.app (op U)) + (((Functor.whiskeringLeft _ _ AddCommGrpCat).obj (Opens.map f.base).op).map_preimage (X := M.presheaf) (Y := N.presheaf) a.mapPresheaf) + +lemma additivePreimage_smul [IsClosedImmersion f] [IsIso f.base] + {M N : Y.Modules} + (a : (Scheme.Modules.pushforward f).obj M ⟶ (Scheme.Modules.pushforward f).obj N) + (V : Y.Opens) (r : Γ(Y,V)) (m : Γ(M,V)) : + (additivePreimage f a).app (op V) (r • m) = + r • (additivePreimage f a).app (op V) m := by + obtain ⟨U, rfl⟩ := preimage_surjective f V + apply N.isSheaf.section_ext + intro y hy + obtain ⟨W, hW, hyW, hWU⟩ := exists_isAffineOpen_mem_and_subset (X := X) (x := f y) (U := U) hy + let j : W ⟶ U := homOfLE hWU + let k : f ⁻¹ᵁ W ⟶ f ⁻¹ᵁ U := (Opens.map f.base).map j + refine ⟨f ⁻¹ᵁ W, leOfHom k, hyW, ?_⟩ + have hn (z : Γ(M,f ⁻¹ᵁ U)) : + (additivePreimage f a).app (op (f ⁻¹ᵁ W)) (M.presheaf.map k.op z) = + N.presheaf.map k.op ((additivePreimage f a).app (op (f ⁻¹ᵁ U)) z) := + CategoryTheory.congr_fun ((additivePreimage f a).naturality k.op) z + have hs : N.presheaf.map k.op (r • (additivePreimage f a).app (op (f ⁻¹ᵁ U)) m) = + Y.presheaf.map k.op r • N.presheaf.map k.op ((additivePreimage f a).app (op (f ⁻¹ᵁ U)) m) := + N.val.map_smul k.op r ((additivePreimage f a).app (op (f ⁻¹ᵁ U)) m) + change N.presheaf.map k.op ((additivePreimage f a).app (op (f ⁻¹ᵁ U)) (r • m)) = + N.presheaf.map k.op (r • (additivePreimage f a).app (op (f ⁻¹ᵁ U)) m) + rw [← hn, hs, ← hn, additivePreimage_app] + obtain ⟨c, hc⟩ := f.app_surjective W hW (Y.presheaf.map k.op r) + have hm := M.val.map_smul k.op r m + change M.presheaf.map k.op (r • m) = Y.presheaf.map k.op r • M.presheaf.map k.op m at hm + rw [hm, ← hc] + exact a.app_smul (r := c) (x := M.presheaf.map k.op m) + +def modulePreimage [IsClosedImmersion f] [IsIso f.base] {M N : Y.Modules} + (a : (Scheme.Modules.pushforward f).obj M ⟶ (Scheme.Modules.pushforward f).obj N) : + M ⟶ N where + val.app V := ModuleCat.ofHom (X := M.val.obj V) (Y := N.val.obj V) + { toAddHom := ((additivePreimage f a).app V).hom.toAddHom + map_smul' := fun r m => additivePreimage_smul f a V.unop r m } + val.naturality {V W} j := by + ext m + exact CategoryTheory.congr_fun ((additivePreimage f a).naturality j) m + +def pushforwardFullyFaithful [IsClosedImmersion f] [IsIso f.base] : + (Scheme.Modules.pushforward f).FullyFaithful where + preimage a := modulePreimage f a + map_preimage a := by + ext U m + exact CategoryTheory.congr_fun (additivePreimage_app f a U) m + preimage_map a := by + apply Scheme.Modules.hom_ext + intro V + obtain ⟨U, rfl⟩ := preimage_surjective f V + exact additivePreimage_app f ((Scheme.Modules.pushforward f).map a) U + +theorem counit_isIso [IsClosedImmersion f] (hf : Function.Surjective f) : + IsIso (Scheme.Modules.pullbackPushforwardAdjunction f).counit := by + let : IsIso f.base := (TopCat.isIso_iff_isHomeomorph f.base).mpr + (isHomeomorph_iff_isEmbedding_surjective.mpr ⟨f.isClosedEmbedding.isEmbedding, hf⟩) + let := (pushforwardFullyFaithful f).full + let := (pushforwardFullyFaithful f).faithful + exact (Scheme.Modules.pullbackPushforwardAdjunction f).counit_isIso_of_R_fully_faithful + +theorem unit_isIso_of_pushforward [IsClosedImmersion f] (hf : Function.Surjective f) + {M : X.Modules} {N : Y.Modules} + (e : M ≅ (Scheme.Modules.pushforward f).obj N) : + IsIso ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M) := by + let : IsIso (Scheme.Modules.pullbackPushforwardAdjunction f).counit := counit_isIso f hf + let := (Scheme.Modules.pullbackPushforwardAdjunction f).fullyFaithfulROfIsIsoCounit.full + let := (Scheme.Modules.pullbackPushforwardAdjunction f).fullyFaithfulROfIsIsoCounit.faithful + exact (Scheme.Modules.pullbackPushforwardAdjunction f).isIso_unit_app_of_iso e + +lemma subscheme_surjective_of_support_top (I : X.IdealSheafData) (hI : I.support = ⊤) : + Function.Surjective I.subschemeι := by + rw [← Set.range_eq_univ, I.range_subschemeι, hI] + rfl + +theorem subscheme_counit_isIso (I : X.IdealSheafData) (hI : I.support = ⊤) : + IsIso (Scheme.Modules.pullbackPushforwardAdjunction I.subschemeι).counit := + counit_isIso I.subschemeι (subscheme_surjective_of_support_top I hI) + +theorem subscheme_unit_isIso_of_pushforward (I : X.IdealSheafData) (hI : I.support = ⊤) + {M : X.Modules} {N : I.subscheme.Modules} + (e : M ≅ (Scheme.Modules.pushforward I.subschemeι).obj N) : + IsIso ((Scheme.Modules.pullbackPushforwardAdjunction I.subschemeι).unit.app M) := + unit_isIso_of_pushforward I.subschemeι (subscheme_surjective_of_support_top I hI) e + +end +end PiExponentSeshadri.ClosedPullbackUnit + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPullbackUnitRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPullbackUnitRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..f4b273e9d9f480b6f1ef3df0b3838b1f7135e300 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPullbackUnitRestriction.lean @@ -0,0 +1,68 @@ +import OAI.NumberTheory.PiExponent.Approximation.ClosedPullbackUnit +import OAI.NumberTheory.PiExponent.Approximation.OpenPullbackUnit +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealModule + +namespace OAI + +namespace PiExponentSeshadri.ClosedPullbackUnitRestriction +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace +variable {X Y : Scheme.{0}} (f : Y ⟶ X) + +lemma restrict_unit_isIso_iff (U : X.Opens) (M : X.Modules) : + IsIso ((Scheme.Modules.restrictFunctor U.ι).map + ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M)) ↔ + IsIso ((Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).unit.app + (M.restrict U.ι)) := by + let g := (Scheme.Modules.restrictFunctor U.ι).map + ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M) + let e := OpenBaseChange.iso f U ((Scheme.Modules.pullback f).obj M) + let k := (Scheme.Modules.pushforward (f ∣_ U)).map + ((OpenBaseChange.leftSquare f U).hom.app M) + calc + IsIso g ↔ IsIso (g ≫ e.hom) := (isIso_comp_right_iff g e.hom).symm + _ ↔ IsIso (((Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).unit.app + (M.restrict U.ι)) ≫ k) := by rw [OpenBaseChange.unit_compatibility] + _ ↔ _ := isIso_comp_right_iff _ k + +theorem unit_isIso_of_affine (M : X.Modules) + (h : ∀ U : X.affineOpens, + IsIso ((Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U.1)).unit.app + (M.restrict U.1.ι))) : + IsIso ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M) := by + apply IdealModule.isIso_of_affine_app + intro U + have hr := (restrict_unit_isIso_iff f U.1 M).mpr (h U) + have ht := Scheme.Modules.Hom.isIso_iff_isIso_app.mp hr ⊤ + change IsIso (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M).app + (U.1.ι ''ᵁ ⊤)) at ht + have he : U.1.ι ''ᵁ ⊤ = U.1 := + (Scheme.Hom.image_top_eq_opensRange U.1.ι).trans (Scheme.Opens.opensRange_ι U.1) + rw [he] at ht + exact ht + +lemma morphismRestrict_surjective (hf : Function.Surjective f) (U : X.Opens) : + Function.Surjective (f ∣_ U) := by + intro x + obtain ⟨y, hy⟩ := hf x.1 + refine ⟨⟨y, ?_⟩, ?_⟩ + · change f y ∈ U + simpa only [hy] using x.2 + · apply Subtype.ext + exact (morphismRestrict_base_coe f U _).trans hy + +theorem unit_isIso_of_affine_pushforward [IsClosedImmersion f] + (hf : Function.Surjective f) (M : X.Modules) + (h : ∀ U : X.affineOpens, ∃ N : (f ⁻¹ᵁ U.1).toScheme.Modules, + Nonempty (M.restrict U.1.ι ≅ (Scheme.Modules.pushforward (f ∣_ U.1)).obj N)) : + IsIso ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M) := by + apply unit_isIso_of_affine f M + intro U + obtain ⟨N, ⟨e⟩⟩ := h U + exact ClosedPullbackUnit.unit_isIso_of_pushforward (f ∣_ U.1) + (morphismRestrict_surjective f hf U.1) e + +end +end PiExponentSeshadri.ClosedPullbackUnitRestriction + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPushforwardAffine.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPushforwardAffine.lean new file mode 100644 index 0000000000000000000000000000000000000000..c716690218942144f9ff4aca15e35713b14f5094 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPushforwardAffine.lean @@ -0,0 +1,84 @@ +import OAI.NumberTheory.PiExponent.Approximation.GlobalSectionClearing +import OAI.NumberTheory.PiExponent.LocalAlgebra.FiniteGlobalPresentation + +namespace OAI + +namespace PiExponent.ClosedPushforwardAffine +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite +open CoherentAffineFinite FiniteGlobalPresentation +variable {X Y : Scheme.{0}} + +private def transportPresentation {Z : Scheme.{0}} + {M N : SheafOfModules Z.ringCatSheaf} (e : M ≅ N) (P : M.Presentation) : + N.Presentation := by + let : IsIso e.hom := e.isIso_hom + exact P.ofIsIso e.hom + +theorem affine_pushforward_quasicoherent [IsAffine X] [IsAffine Y] + (f : X ⟶ Y) (M : X.Modules) [M.IsQuasicoherent] : + ((Scheme.Modules.pushforward f).obj M).IsQuasicoherent := by + let MX := (Scheme.Modules.pushforward X.isoSpec.hom).obj M + have : MX.IsQuasicoherent := GlobalSectionClearing.quasicoherent_pushforward_iso X.isoSpec M + let MY := (Scheme.Modules.pushforward (Spec.map f.appTop)).obj MX + have : MY.IsQuasicoherent := + (isQuasicoherent_iff_isIso_fromTildeΓ MY).mpr (isIso_fromTildeΓ_pushforward f.appTop MX) + have hback : ((Scheme.Modules.pushforward Y.isoSpec.inv).obj MY).IsQuasicoherent := + GlobalSectionClearing.quasicoherent_pushforward_iso Y.isoSpec.symm MY + let e₁ := (Scheme.Modules.pushforward Y.isoSpec.inv).mapIso + ((Scheme.Modules.pushforwardComp X.isoSpec.hom (Spec.map f.appTop)).app M) + let e₂ := (Scheme.Modules.pushforwardComp (X.isoSpec.hom ≫ Spec.map f.appTop) Y.isoSpec.inv).app M + have hf : (X.isoSpec.hom ≫ Spec.map f.appTop) ≫ Y.isoSpec.inv = f := by + rw [Scheme.isoSpec_hom_naturality, Category.assoc, Iso.hom_inv_id, Category.comp_id] + let e₃ := (Scheme.Modules.pushforwardCongr hf).app M + exact (SheafOfModules.isQuasicoherent Y.ringCatSheaf).prop_of_iso (e₁ ≪≫ e₂ ≪≫ e₃) hback + +theorem affine_pushforward_sections_finite [IsAffine X] [IsAffine Y] + (f : X ⟶ Y) [IsClosedImmersion f] (M : X.Modules) [M.IsQuasicoherent] + (hM : LocallyFinitelyGenerated M) : + Module.Finite Γ(Y,⊤) Γ((Scheme.Modules.pushforward f).obj M,⊤) := by + have hfin : Module.Finite Γ(X,f ⁻¹ᵁ (⊤ : Y.Opens)) Γ(M,f ⁻¹ᵁ (⊤ : Y.Opens)) := by + simpa only [Scheme.Hom.preimage_top] using! affine_sections_finite_of_localGenerators M hM + let σ : Γ(Y,⊤) →+* Γ(X,f ⁻¹ᵁ (⊤ : Y.Opens)) := (f.app ⊤).hom + have : RingHomSurjective σ := ⟨f.app_surjective ⊤ (isAffineOpen_top Y)⟩ + let ψ : Γ((Scheme.Modules.pushforward f).obj M,⊤) →ₛₗ[σ] Γ(M,f ⁻¹ᵁ (⊤ : Y.Opens)) := { + toFun := fun x => x + map_add' _ _ := rfl + map_smul' _ _ := rfl } + exact (ψ.finite_iff_of_bijective ⟨fun _ _ h => h, fun x => ⟨x, rfl⟩⟩).mpr hfin + +theorem affine_exists_finitePresentation_of_sections [IsAffine X] [IsLocallyNoetherian X] + (M : X.Modules) [M.IsQuasicoherent] [Module.Finite Γ(X,⊤) Γ(M,⊤)] : + ∃ P : M.Presentation, P.IsFinite := by + let a := X.isoSpec.inv + let b := X.isoSpec.hom + have : IsNoetherianRing Γ(X,⊤) := + IsLocallyNoetherian.component_noetherian ⟨⊤, isAffineOpen_top X⟩ + have : Module.Finite Γ(X,⊤) ((modulesSpecToSheaf.obj (M.restrict a)).obj.obj (op ⊤)) := + finite_isoSpec_sections M + obtain ⟨P,hP⟩ := spec_exists_finitePresentation_of_sections (M.restrict a) + let F : SheafOfModules (Spec Γ(X,⊤)).ringCatSheaf ⥤ SheafOfModules X.ringCatSheaf := + Scheme.Modules.restrictFunctor b + let : PreservesColimitsOfSize.{0,0} F := + (Scheme.Modules.restrictAdjunction b).leftAdjoint_preservesColimits + let Q := P.map F (Scheme.Modules.restrictUnitIso b).symm + let e₁ := (Scheme.Modules.restrictFunctorComp b a).app M + have e₂ : M.restrict (𝟙 X) ≅ ((M.restrict a).restrict b) := by + change M.restrict (b ≫ a) ≅ ((M.restrict a).restrict b) at e₁ + simpa only [a, b, Iso.hom_inv_id] using e₁ + let e₃ := e₂.symm ≪≫ Scheme.Modules.restrictFunctorId.app M + exact ⟨transportPresentation (Z := X) e₃ Q, + ⟨⟨hP.isFiniteType_generators.finite⟩, ⟨hP.isFiniteType_relations.finite⟩⟩⟩ + +theorem affine_pushforward_exists_finitePresentation [IsAffine X] [IsAffine Y] + [IsLocallyNoetherian Y] (f : X ⟶ Y) [IsClosedImmersion f] + (M : X.Modules) [M.IsQuasicoherent] (hM : LocallyFinitelyGenerated M) : + ∃ P : ((Scheme.Modules.pushforward f).obj M).Presentation, P.IsFinite := by + have := affine_pushforward_quasicoherent f M + have := affine_pushforward_sections_finite f M hM + exact affine_exists_finitePresentation_of_sections ((Scheme.Modules.pushforward f).obj M) + +end +end PiExponent.ClosedPushforwardAffine + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPushforwardCoherent.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPushforwardCoherent.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c20b5b41eb3bfe4d82cf11a56c679b4b015e622 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPushforwardCoherent.lean @@ -0,0 +1,101 @@ +import OAI.NumberTheory.PiExponent.Approximation.ClosedPushforwardAffine +import OAI.NumberTheory.PiExponent.Approximation.OpenBaseChange +import OAI.NumberTheory.PiExponent.LocalAlgebra.FiniteGlobalPresentation + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.ClosedPushforward + +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite +variable {X Y : Scheme.{0}} + +lemma sections_empty (M : X.Modules) (U : X.Opens) (hU : U = ⊥) : + Subsingleton (M.val.obj (op U)) := by + exact AddCommGrpCat.subsingleton_of_isZero + (TopCat.Sheaf.isTerminalOfEqEmpty ((SheafOfModules.toSheaf.{0} X.ringCatSheaf).obj M) hU).isZero + +lemma map_epi (f : X ⟶ Y) [IsClosedImmersion f] {M N : X.Modules} + (φ : M ⟶ N) [Epi φ] : Epi ((Scheme.Modules.pushforward f).map φ) := by + let FX := SheafOfModules.toSheaf.{0} X.ringCatSheaf + let FY := SheafOfModules.toSheaf.{0} Y.ringCatSheaf + let S := ShortComplex.mk _ _ (kernel.condition φ) + have hS : S.ShortExact := { exact := ShortComplex.exact_kernel φ } + have hepi : Epi (FX.map φ) := (ModuleSheafExact.shortExact_map X.ringCatSheaf hS).epi_g + have hφ : TopCat.Presheaf.IsLocallySurjective (FX.map φ).hom := + (TopCat.Sheaf.isLocallySurjective_iff_epi _).mpr hepi + have hloc : TopCat.Presheaf.IsLocallySurjective + (FY.map ((Scheme.Modules.pushforward f).map φ)).hom := by + apply (TopCat.Presheaf.isLocallySurjective_iff _).mpr + intro U t y hy + by_cases him : y ∈ Set.range f + · obtain ⟨x, rfl⟩ := him + obtain ⟨W,hWU,⟨s,hs⟩,hxW⟩ := + (TopCat.Presheaf.isLocallySurjective_iff _).mp hφ (f ⁻¹ᵁ U) t x hy + obtain ⟨V',hV',hpre⟩ := f.isClosedEmbedding.isEmbedding.isInducing.isOpen_iff.mp W.isOpen + let V : Y.Opens := ⟨V', hV'⟩ ⊓ U + have hV : f ⁻¹ᵁ V = W := by + ext z + change (f z ∈ V' ∧ f z ∈ U) ↔ z ∈ W + have hh : f z ∈ V' ↔ z ∈ W := Set.ext_iff.mp hpre z + exact ⟨fun h => hh.mp h.1, fun h => ⟨hh.mpr h,hWU h⟩⟩ + refine ⟨V,inf_le_right,?_,?_,⟩ + · change ∃ s, (φ.val.app (op (f ⁻¹ᵁ V))) s = + N.val.map ((Opens.map f.base).map (homOfLE inf_le_right)).op t + subst W + exact ⟨s,hs⟩ + · exact ⟨(Set.ext_iff.mp hpre x).mpr hxW,hy⟩ + · let V : Y.Opens := U ⊓ ⟨(Set.range f)ᶜ, f.isClosedEmbedding.isClosed_range.isOpen_compl⟩ + have hV : f ⁻¹ᵁ V = ⊥ := by + ext x + change (f x ∈ U ∧ f x ∉ Set.range f) ↔ False + simp + have := sections_empty N (f ⁻¹ᵁ V) hV + refine ⟨V,inf_le_left,⟨0,?_⟩,⟨hy,him⟩⟩ + exact @Subsingleton.elim (N.val.obj (op (f ⁻¹ᵁ V))) (sections_empty N _ hV) _ _ + let : Epi (FY.map ((Scheme.Modules.pushforward f).map φ)) := + (TopCat.Sheaf.isLocallySurjective_iff_epi _).mp hloc + exact FY.epi_of_epi_map inferInstance + +instance preservesEpis (f : X ⟶ Y) [IsClosedImmersion f] : + (Scheme.Modules.pushforward f).PreservesEpimorphisms where + preserves {_ _} φ _ := map_epi f φ + +instance preservesHomology (f : X ⟶ Y) [IsClosedImmersion f] : + (Scheme.Modules.pushforward f).PreservesHomology := + Functor.preservesHomology_of_preservesEpis_and_kernels _ + +instance preservesFiniteColimits (f : X ⟶ Y) [IsClosedImmersion f] : + PreservesFiniteColimits (Scheme.Modules.pushforward f) := + Functor.preservesFiniteColimits_of_preservesHomology _ + +open PiExponent.CoherentAffineFinite PiExponent.FiniteGlobalPresentation +open PiExponent.ClosedPushforwardAffine + +private theorem presentation_transport {Z : Scheme.{0}} + {M N : SheafOfModules Z.ringCatSheaf} (e : M ≅ N) + (P : M.Presentation) (hP : P.IsFinite) : ∃ Q : N.Presentation, Q.IsFinite := by + let : IsIso e.hom := e.isIso_hom + exact ⟨P.ofIsIso e.hom, + ⟨⟨hP.isFiniteType_generators.finite⟩, ⟨hP.isFiniteType_relations.finite⟩⟩⟩ + +instance pushforward_isFinitePresentation (f : X ⟶ Y) [IsClosedImmersion f] + [IsLocallyNoetherian Y] (M : X.Modules) [M.IsFinitePresentation] : + ((Scheme.Modules.pushforward f).obj M).IsFinitePresentation := by + apply isFinitePresentation_of_affine_presentations + intro U + have : IsAffine U.1.toScheme := U.2 + have : IsAffine (f ⁻¹ᵁ U.1).toScheme := U.2.preimage f + let : M.IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData M).choose.isQuasicoherent + have hM := (locallyFinitelyGenerated_of_finitePresentation M).restrict (f ⁻¹ᵁ U.1).ι + obtain ⟨P,hP⟩ := affine_pushforward_exists_finitePresentation (f ∣_ U.1) + (M.restrict (f ⁻¹ᵁ U.1).ι) hM + exact presentation_transport (Z := U.1.toScheme) (OpenBaseChange.iso f U.1 M).symm P hP + +end PiExponentSeshadri.ClosedPushforward + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPushforwardLinear.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPushforwardLinear.lean new file mode 100644 index 0000000000000000000000000000000000000000..a87cc586ce7d6df0b46989c02fb259873ed2c5f4 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedPushforwardLinear.lean @@ -0,0 +1,128 @@ +import OAI.NumberTheory.PiExponent.Approximation.ClosedImmersionSerreTransfer +import OAI.NumberTheory.PiExponent.Cohomology.EulerExact + +namespace OAI + +namespace PiExponent.ClosedImmersionSerreTransfer + +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits CategoryTheory.Abelian +open TopologicalSpace Opposite PiExponentSeshadri.Geometry + +variable {X Y : Scheme.{0}} (f : X ⟶ Y) +local instance closedPushforwardLinearSourceHasExt : HasExt.{1} X.Modules := schemeHasExt +local instance closedPushforwardLinearTargetHasExt : HasExt.{1} Y.Modules := schemeHasExt + +lemma baseScalars_comp_actual (p : Y ⟶ Spec (CommRingCat.of ℂ)) : + baseScalars (f ≫ p) = f.appTop.hom.comp (baseScalars p) := by + ext c + simp only [baseScalars, Scheme.Hom.comp_appTop, CommRingCat.hom_comp, + RingHom.comp_apply] + +lemma scalar_naturality (p : Y ⟶ Spec (CommRingCat.of ℂ)) (U : Y.Opens) (r : ℂ) : + restrictScalar X (f ⁻¹ᵁ U) (baseScalars (f ≫ p) r) = + f.app U (restrictScalar Y U (baseScalars p r)) := by + rw [baseScalars_comp_actual] + change X.presheaf.map (homOfLE le_top).op (f.appTop (baseScalars p r)) = _ + exact (CategoryTheory.congr_fun (f.naturality (homOfLE le_top).op) (baseScalars p r)).symm + +theorem complexLinearPushforward (p : Y ⟶ Spec (CommRingCat.of ℂ)) : + letI := sheafComplexLinear (f ≫ p) + letI := sheafComplexLinear p + (Scheme.Modules.pushforward f).Linear ℂ := by + let := sheafComplexLinear (f ≫ p) + let := sheafComplexLinear p + constructor + intro M N g r + ext U m + let y : Γ(N, f ⁻¹ᵁ U) := g.val.app (op (f ⁻¹ᵁ U)) m + change restrictScalar X (f ⁻¹ᵁ U) (baseScalars (f ≫ p) r) • y = + f.app U (restrictScalar Y U (baseScalars p r)) • y + rw [scalar_naturality] + +variable [IsClosedImmersion f] + +lemma cohomologyMap_comp {M N : X.Modules} {n m k : ℕ} + (x : cohomology M n) (y : Ext.{1} M N m) (h : n + m = k) : + cohomologyMap f N k (x.comp y h) = + (cohomologyMap f M n x).comp (y.mapExactFunctor (Scheme.Modules.pushforward f)) h := + PiExponentSeshadri.ExtSectionComparison.mapFrom_comp + (Scheme.Modules.pushforward f) (structureMap f) x y h + +def typedCohomologyMap (M : X.Modules) (n : ℕ) : + cohomology M n →+ cohomology ((Scheme.Modules.pushforward f).obj M) n := + cohomologyMap f M n + +lemma typedCohomologyMap_comp {M N : X.Modules} {n m k : ℕ} + (x : cohomology M n) (y : Ext.{1} M N m) (h : n + m = k) : + typedCohomologyMap f N k (x.comp y h) = + (typedCohomologyMap f M n x).comp + (y.mapExactFunctor (Scheme.Modules.pushforward f)) h := + cohomologyMap_comp f x y h + +lemma typedCohomologyMap_bijective (M : X.Modules) (n : ℕ) : + Function.Bijective (typedCohomologyMap f M n) := + cohomologyMap_bijective f M n + +def cohomologyLinearMap (p : Y ⟶ Spec (CommRingCat.of ℂ)) (M : X.Modules) (n : ℕ) : + letI := Module.compHom (cohomology M n) (baseScalars (f ≫ p)) + letI := Module.compHom (cohomology ((Scheme.Modules.pushforward f).obj M) n) (baseScalars p) + cohomology M n →ₗ[ℂ] cohomology ((Scheme.Modules.pushforward f).obj M) n := by + letI := Module.compHom (cohomology M n) (baseScalars (f ≫ p)) + letI := Module.compHom (cohomology ((Scheme.Modules.pushforward f).obj M) n) (baseScalars p) + exact { toFun := typedCohomologyMap f M n + map_add' := (typedCohomologyMap f M n).map_add + map_smul' := by + intro r x + change typedCohomologyMap f M n ((baseScalars (f ≫ p) r) • x) = + (baseScalars p r) • (typedCohomologyMap f M n x) + rw [Ext.smul_eq_comp_mk₀, typedCohomologyMap_comp, Ext.smul_eq_comp_mk₀, + Ext.mapExactFunctor_mk₀] + congr 2 + ext U m + change Γ(M, f ⁻¹ᵁ U) at m + change restrictScalar X (f ⁻¹ᵁ U) (baseScalars (f ≫ p) r) • m = + f.app U (restrictScalar Y U (baseScalars p r)) • m + rw [scalar_naturality] } + +lemma cohomologyLinearMap_eq (p : Y ⟶ Spec (CommRingCat.of ℂ)) (M : X.Modules) (n : ℕ) : + ⇑(cohomologyLinearMap f p M n) = typedCohomologyMap f M n := rfl + +def cohomologyLinearEquiv (p : Y ⟶ Spec (CommRingCat.of ℂ)) (M : X.Modules) (n : ℕ) : + letI := Module.compHom (cohomology M n) (baseScalars (f ≫ p)) + letI := Module.compHom (cohomology ((Scheme.Modules.pushforward f).obj M) n) (baseScalars p) + cohomology M n ≃ₗ[ℂ] cohomology ((Scheme.Modules.pushforward f).obj M) n := by + exact LinearEquiv.ofBijective (cohomologyLinearMap f p M n) + (by rw [cohomologyLinearMap_eq]; exact typedCohomologyMap_bijective f M n) + +theorem finiteDimensional_of_pushforward + (p : Y ⟶ Spec (CommRingCat.of ℂ)) (M : X.Modules) (n : ℕ) + (hfinite : letI := Module.compHom (cohomology ((Scheme.Modules.pushforward f).obj M) n) (baseScalars p) + FiniteDimensional ℂ (cohomology ((Scheme.Modules.pushforward f).obj M) n)) : + letI := Module.compHom (cohomology M n) (baseScalars (f ≫ p)) + FiniteDimensional ℂ (cohomology M n) := by + let := Module.compHom (cohomology M n) (baseScalars (f ≫ p)) + let := Module.compHom (cohomology ((Scheme.Modules.pushforward f).obj M) n) (baseScalars p) + have := hfinite + exact FiniteDimensional.of_injective (cohomologyLinearEquiv f p M n).toLinearMap + (cohomologyLinearEquiv f p M n).injective + +lemma cohomologyDimension_pushforward + (p : Y ⟶ Spec (CommRingCat.of ℂ)) (M : X.Modules) (n : ℕ) : + cohomologyDimension p ((Scheme.Modules.pushforward f).obj M) n = + cohomologyDimension (f ≫ p) M n := by + let := Module.compHom (cohomology M n) (baseScalars (f ≫ p)) + let := Module.compHom (cohomology ((Scheme.Modules.pushforward f).obj M) n) (baseScalars p) + exact (cohomologyLinearEquiv f p M n).finrank_eq.symm + +theorem euler_pushforward (p : Y ⟶ Spec (CommRingCat.of ℂ)) (M : X.Modules) (d : ℕ) : + eulerCharacteristic p d ((Scheme.Modules.pushforward f).obj M) = + eulerCharacteristic (f ≫ p) d M := by + apply Finset.sum_congr rfl + intro n hn + rw [cohomologyDimension_pushforward] + +end +end PiExponent.ClosedImmersionSerreTransfer + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedRestrictionTensor.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedRestrictionTensor.lean new file mode 100644 index 0000000000000000000000000000000000000000..755d33eeb5e15504a8b0414fdcd04e0fd3952e56 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedRestrictionTensor.lean @@ -0,0 +1,203 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ClosedAmpleRestriction +import OAI.NumberTheory.PiExponent.Approximation.ProjectionFormula +import OAI.NumberTheory.PiExponent.Approximation.TwistPowerSection +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealModule + +namespace OAI + +namespace PiExponent.ClosedRestrictionTensor +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames PiExponentSeshadri.TensorPure + +lemma tensor_map_pure_val {Z : Scheme.{0}} {M N P Q : Z.Modules} + (a : M ⟶ P) (b : N ⟶ Q) (U : Z.Opens) + (m : M.val.obj (op U)) (n : N.val.obj (op U)) : + (moduleTensorMap a b).val.app (op U) (pure M N U m n) = + pure P Q U (a.val.app (op U) m) (b.val.app (op U) n) := + map_pure a b U m n + +lemma tensor_comm_pure_val {Z : Scheme.{0}} (M N : Z.Modules) (U : Z.Opens) + (m : M.val.obj (op U)) (n : N.val.obj (op U)) : + (moduleTensorComm M N).hom.val.app (op U) (pure M N U m n) = + pure N M U n m := moduleTensorComm_pure M N U m n + +lemma projection_hom_pure_val {X Y : Scheme.{0}} (f : X ⟶ Y) + (M : X.Modules) (L : Y.Modules) (U : Y.Opens) + (m : M.val.obj (op (f ⁻¹ᵁ U))) (s : L.val.obj (op U)) : + (ProjectionFormula.hom f M L).val.app (op U) + (pure ((Scheme.Modules.pushforward f).obj M) L U m s) = + pure M ((Scheme.Modules.pullback f).obj L) (f ⁻¹ᵁ U) m + (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app L).val.app (op U) s) := + ProjectionFormula.hom_pure f M L U m s + +lemma pushforward_hom_pure_val {X Y : Scheme.{0}} (f : X ⟶ Y) + (M N : X.Modules) (U : Y.Opens) + (m : M.val.obj (op (f ⁻¹ᵁ U))) (n : N.val.obj (op (f ⁻¹ᵁ U))) : + (PiExponentSeshadri.PushforwardTensor.hom f M N).val.app (op U) + (pure ((Scheme.Modules.pushforward f).obj M) ((Scheme.Modules.pushforward f).obj N) U m n) = + pure M N (f ⁻¹ᵁ U) m n := + PiExponentSeshadri.PushforwardTensor.hom_pure f M N U m n + +variable {X Y : Scheme.{0}} (f : X ⟶ Y) (L : LineBundle Y) + +def powerProjectionIso (n : ℕ) : + (moduleTwistFunctor L n).obj ((Scheme.Modules.pushforward f).obj (O X)) ≅ + (Scheme.Modules.pushforward f).obj ((L.pullback f).pow n).sheaf := + (ProjectionFormula.twistIso f (O X) L n).symm ≪≫ + (Scheme.Modules.pushforward f).mapIso (moduleTwistUnitIso (L.pullback f) n) + +def powerUnit (n : ℕ) : (L.pow n).sheaf ⟶ + (Scheme.Modules.pushforward f).obj ((L.pullback f).pow n).sheaf := + (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (L.pow n).sheaf ≫ + (Scheme.Modules.pushforward f).map (PiExponentSeshadri.PullbackTensor.powIso f L n).hom + +lemma powerProjectionIso_succ_pure (n : ℕ) (U : Y.Opens) + (m : ((moduleTwistFunctor L n).obj ((Scheme.Modules.pushforward f).obj (O X))).val.obj (op U)) + (s : L.sheaf.val.obj (op U)) : + (powerProjectionIso f L (n+1)).hom.val.app (op U) + (pure _ L.sheaf U m s) = + pure (L.pullback f).sheaf ((L.pullback f).pow n).sheaf (f ⁻¹ᵁ U) + (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app L.sheaf).val.app (op U) s) + ((powerProjectionIso f L n).hom.val.app (op U) m) := by + change (moduleTwistUnitIso (L.pullback f) (n+1)).hom.val.app (op (f ⁻¹ᵁ U)) + ((ProjectionFormula.hom f ((moduleTwistFunctor (L.pullback f) n).obj (O X)) L.sheaf).val.app (op U) + ((moduleTensorMap (ProjectionFormula.twistIso f (O X) L n).inv (𝟙 L.sheaf)).val.app (op U) + (pure _ L.sheaf U m s))) = _ + rw [tensor_map_pure_val] + change (moduleTensorComm ((L.pullback f).pow n).sheaf (L.pullback f).sheaf).hom.val.app (op (f ⁻¹ᵁ U)) + ((moduleTensorMap (moduleTwistUnitIso (L.pullback f) n).hom (𝟙 (L.pullback f).sheaf)).val.app (op (f ⁻¹ᵁ U)) + ((ProjectionFormula.hom f ((moduleTwistFunctor (L.pullback f) n).obj (O X)) L.sheaf).val.app (op U) + (pure _ L.sheaf U ((ProjectionFormula.twistIso f (O X) L n).inv.val.app (op U) m) s))) = _ + erw [projection_hom_pure_val f ((moduleTwistFunctor (L.pullback f) n).obj (O X)) + L.sheaf U ((ProjectionFormula.twistIso f (O X) L n).inv.val.app (op U) m) s] + have ht := tensor_map_pure_val (Z := X) (moduleTwistUnitIso (L.pullback f) n).hom + (𝟙 (L.pullback f).sheaf) (f ⁻¹ᵁ U) + ((ProjectionFormula.twistIso f (O X) L n).inv.val.app (op U) m) + (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app L.sheaf).val.app (op U) s) + exact (congrArg (fun r => (moduleTensorComm ((L.pullback f).pow n).sheaf + (L.pullback f).sheaf).hom.val.app (op (f ⁻¹ᵁ U)) r) ht).trans + (tensor_comm_pure_val _ _ _ _ _) + +lemma powerUnit_succ_pure (n : ℕ) (U : Y.Opens) + (s : L.sheaf.val.obj (op U)) (m : (L.pow n).sheaf.val.obj (op U)) : + (powerUnit f L (n+1)).val.app (op U) (pure L.sheaf (L.pow n).sheaf U s m) = + pure (L.pullback f).sheaf ((L.pullback f).pow n).sheaf (f ⁻¹ᵁ U) + (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app L.sheaf).val.app (op U) s) + ((powerUnit f L n).val.app (op U) m) := by + have h := PiExponentSeshadri.PullbackTensor.unit_hom f L.sheaf (L.pow n).sheaf + have hp := congrArg (fun q => q.val.app (op U) (pure L.sheaf (L.pow n).sheaf U s m)) h + change (PiExponentSeshadri.PullbackTensor.hom f L.sheaf (L.pow n).sheaf).val.app (op (f ⁻¹ᵁ U)) + (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app + (moduleTensor Y L.sheaf (L.pow n).sheaf)).val.app (op U) (pure L.sheaf (L.pow n).sheaf U s m)) = + (PiExponentSeshadri.PushforwardTensor.hom f _ _).val.app (op U) + ((moduleTensorMap ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app L.sheaf) + ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (L.pow n).sheaf)).val.app (op U) + (pure L.sheaf (L.pow n).sheaf U s m)) at hp + have hm := tensor_map_pure_val (Z := Y) + ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app L.sheaf) + ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (L.pow n).sheaf) U s m + have hv := pushforward_hom_pure_val f ((Scheme.Modules.pullback f).obj L.sheaf) + ((Scheme.Modules.pullback f).obj (L.pow n).sheaf) U + (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app L.sheaf).val.app (op U) s) + (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (L.pow n).sheaf).val.app (op U) m) + have hp' := hp.trans ((congrArg (fun r => (PiExponentSeshadri.PushforwardTensor.hom f + ((Scheme.Modules.pullback f).obj L.sheaf) ((Scheme.Modules.pullback f).obj (L.pow n).sheaf)).val.app + (op U) r) hm).trans hv) + change (moduleTensorMap (𝟙 (L.pullback f).sheaf) (PiExponentSeshadri.PullbackTensor.powIso f L n).hom).app + (f ⁻¹ᵁ U) + ((PiExponentSeshadri.PullbackTensor.hom f L.sheaf (L.pow n).sheaf).val.app (op (f ⁻¹ᵁ U)) + (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app + (moduleTensor Y L.sheaf (L.pow n).sheaf)).val.app (op U) (pure L.sheaf (L.pow n).sheaf U s m))) = _ + exact (congrArg (fun r => (moduleTensorMap (𝟙 (L.pullback f).sheaf) + (PiExponentSeshadri.PullbackTensor.powIso f L n).hom).val.app (op (f ⁻¹ᵁ U)) r) hp').trans + (tensor_map_pure_val (Z := X) (𝟙 (L.pullback f).sheaf) + (PiExponentSeshadri.PullbackTensor.powIso f L n).hom _ _ _) + +theorem twist_structureMap_power (n : ℕ) : + (moduleTwistFunctor L n).map (PiExponentSeshadri.IdealModule.structureMap f) ≫ + (powerProjectionIso f L n).hom = + (moduleTwistUnitIso L n).hom ≫ powerUnit f L n := by + induction n with + | zero => + change PiExponentSeshadri.IdealModule.structureMap f = + (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (O Y) ≫ + (Scheme.Modules.pushforward f).map (pullbackUnitIso f).hom + exact (pullbackUnit_adjunction f).symm + | succ n ih => + apply PiExponentSeshadri.TensorPure.hom_ext + intro U m s + change (powerProjectionIso f L (n+1)).hom.val.app (op U) + ((moduleTensorMap ((moduleTwistFunctor L n).map (PiExponentSeshadri.IdealModule.structureMap f)) + (𝟙 L.sheaf)).val.app (op U) (pure _ L.sheaf U m s)) = + (powerUnit f L (n+1)).val.app (op U) + ((moduleTensorComm (L.pow n).sheaf L.sheaf).hom.val.app (op U) + ((moduleTensorMap (moduleTwistUnitIso L n).hom (𝟙 L.sheaf)).val.app (op U) + (pure _ L.sheaf U m s))) + have h1 := tensor_map_pure_val (Z := Y) + ((moduleTwistFunctor L n).map (PiExponentSeshadri.IdealModule.structureMap f)) (𝟙 L.sheaf) U m s + have h2 := powerProjectionIso_succ_pure f L n U + (((moduleTwistFunctor L n).map (PiExponentSeshadri.IdealModule.structureMap f)).val.app (op U) m) s + have h3 := tensor_map_pure_val (Z := Y) (moduleTwistUnitIso L n).hom (𝟙 L.sheaf) U m s + have h4 := tensor_comm_pure_val (L.pow n).sheaf L.sheaf U + ((moduleTwistUnitIso L n).hom.val.app (op U) m) s + have h5 := powerUnit_succ_pure f L n U s ((moduleTwistUnitIso L n).hom.val.app (op U) m) + have hleft := (congrArg (fun r => (powerProjectionIso f L (n+1)).hom.val.app (op U) r) h1).trans h2 + have hright := (congrArg (fun r => (powerUnit f L (n+1)).val.app (op U) r) + ((congrArg (fun r => (moduleTensorComm (L.pow n).sheaf L.sheaf).hom.val.app (op U) r) h3).trans h4)).trans h5 + exact hleft.trans ((congrArg (fun r => pure (L.pullback f).sheaf ((L.pullback f).pow n).sheaf + (f ⁻¹ᵁ U) (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app L.sheaf).val.app (op U) s) r) + (congrArg (fun q => q.val.app (op U) m) ih)).trans hright.symm) + +theorem power_restriction_eq (n : ℕ) : + (moduleTwistUnitIso L n).inv ≫ + (moduleTwistFunctor L n).map (PiExponentSeshadri.IdealModule.structureMap f) ≫ + (ProjectionFormula.twistIso f (O X) L n).inv ≫ + (Scheme.Modules.pushforward f).map (moduleTwistUnitIso (L.pullback f) n).hom = + (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (L.pow n).sheaf ≫ + (Scheme.Modules.pushforward f).map (PiExponentSeshadri.PullbackTensor.powIso f L n).hom := by + change (moduleTwistUnitIso L n).inv ≫ + ((moduleTwistFunctor L n).map (PiExponentSeshadri.IdealModule.structureMap f) ≫ + (powerProjectionIso f L n).hom) = powerUnit f L n + erw [twist_structureMap_power, Iso.inv_hom_id_assoc] + +theorem push_pullbackSection {M : Y.Modules} (s : O Y ⟶ M) : + PiExponentSeshadri.IdealModule.structureMap f ≫ + (Scheme.Modules.pushforward f).map (pullbackSection f s) = + s ≫ (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M := by + have hu : PiExponentSeshadri.IdealModule.structureMap f = + (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (O Y) ≫ + (Scheme.Modules.pushforward f).map (pullbackUnitIso f).hom := + (pullbackUnit_adjunction f).symm + let F := Scheme.Modules.pushforward f + let P := Scheme.Modules.pullback f + let e := pullbackUnitIso f + have h := (F.map_comp e.hom (e.inv ≫ P.map s)).symm.trans + (congrArg F.map (e.hom_inv_id_assoc (P.map s))) + calc + _ = ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (O Y) ≫ + F.map e.hom) ≫ F.map (e.inv ≫ P.map s) := + congrArg (fun q : O Y ⟶ F.obj (O X) => q ≫ F.map (pullbackSection f s)) hu + _ = (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (O Y) ≫ F.map (P.map s) := + (Category.assoc _ _ _).trans + (congrArg (fun q => (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (O Y) ≫ q) h) + _ = _ := ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.naturality s).symm + +theorem section_restriction_eq (n : ℕ) (s : O Y ⟶ (L.pow n).sheaf) : + s ≫ (moduleTwistUnitIso L n).inv ≫ + (moduleTwistFunctor L n).map (PiExponentSeshadri.IdealModule.structureMap f) ≫ + (ProjectionFormula.twistIso f (O X) L n).inv ≫ + (Scheme.Modules.pushforward f).map (moduleTwistUnitIso (L.pullback f) n).hom = + PiExponentSeshadri.IdealModule.structureMap f ≫ + (Scheme.Modules.pushforward f).map (pullbackPowerSection L f n s) := by + erw [power_restriction_eq] + symm + simp only [pullbackPowerSection] + erw [(Scheme.Modules.pushforward f).map_comp (pullbackSection f s) + (PiExponentSeshadri.PullbackTensor.powIso f L n).hom, ← Category.assoc, + push_pullbackSection f s, Category.assoc] + +end +end PiExponent.ClosedRestrictionTensor + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedSectionLifting.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedSectionLifting.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ad04afbbc5fdeb862e6ec899c6a9f6f7ddf81d0 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedSectionLifting.lean @@ -0,0 +1,36 @@ +import OAI.NumberTheory.PiExponent.Ampleness.NakaiSectionLifting +import OAI.NumberTheory.PiExponent.Approximation.ClosedThickeningSections + +namespace OAI + +noncomputable section +namespace PiExponentSeshadri.Geometry + +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits CategoryTheory.Abelian + + +variable {X Y : Scheme.{0}} +local instance (Z : Scheme.{0}) : HasExt.{1} Z.Modules := HasExt.standard _ + +theorem closed_line_unit_epi (f : Y ⟶ X) [IsClosedImmersion f] (M : LineBundle X) : + Epi ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M.sheaf) := + PiExponentSeshadri.LineClosedUnit.epi f M + +theorem pullbackSection_surjective_of_kernel_cohomology_zero + (f : Y ⟶ X) [IsClosedImmersion f] (M : LineBundle X) + (hzero : ∀ z : cohomology + (kernel ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M.sheaf)) 1, + z = 0) : + Function.Surjective (fun s : GlobalSections X M.sheaf => pullbackSection f s) := by + let u := (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M.sheaf + have : Epi u := closed_line_unit_epi f M + let S := ShortComplex.mk (kernel.ι u) u (kernel.condition u) + have hS : S.ShortExact := { exact := ShortComplex.exact_kernel u } + exact PiExponent.NumericalAmpleness.pullbackSection_surjective_of_unit_surjective f M + (globalSections_surjective_of_ext_one_zero S hS hzero) + +end PiExponentSeshadri.Geometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedSupportedSerre.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedSupportedSerre.lean new file mode 100644 index 0000000000000000000000000000000000000000..40c29c8a453335d83d2009ed67f95f15a838678d --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedSupportedSerre.lean @@ -0,0 +1,52 @@ +import OAI.NumberTheory.PiExponent.Approximation.ClosedImmersionSerreTransfer +import OAI.NumberTheory.PiExponent.Approximation.ProjectionFormula +import OAI.NumberTheory.PiExponent.Cohomology.NoetherianAmpleSerreVanishing + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits CategoryTheory.Abelian +variable {X Y : Scheme.{0}} +local instance (Z : Scheme.{0}) : HasExt.{1} Z.Modules := HasExt.standard _ + +theorem ext_zero_of_moduleIso {M N : X.Modules} (e : M ≅ N) (q : ℕ) + (h : ∀ x : Abelian.Ext.{1} (structureSheaf X) N q, x = 0) + (x : Abelian.Ext.{1} (structureSheaf X) M q) : x = 0 := by + let E := (extFunctorObj (structureSheaf X) q).mapIso e + apply (ConcreteCategory.bijective_of_isIso E.hom).injective + change E.hom x = E.hom 0 + rw [map_zero] + exact h (E.hom x) + +theorem affine_closed_pushforward_ext_zero (i : Y ⟶ X) [IsClosedImmersion i] + [IsAffine Y] [IsNoetherian Y] (M : X.Modules) (N : Y.Modules) + [N.IsQuasicoherent] (e : M ≅ (Scheme.Modules.pushforward i).obj N) + (q : ℕ) (hq : 0 < q) (x : Abelian.Ext.{1} (structureSheaf X) M q) : x = 0 := by + apply ext_zero_of_moduleIso e q _ x + apply (PiExponent.ClosedImmersionSerreTransfer.ext_zero_iff i N q).mp + obtain ⟨k,rfl⟩ := Nat.exists_eq_succ_of_ne_zero (Nat.ne_zero_of_lt hq) + exact AffineSchemeCohomology.affine_ext_zero Y N k + +theorem eventual_twist_ext_zero_of_closed_pushforward + {R : Type} [CommRing R] [IsNoetherianRing R] + (p : X ⟶ Spec (CommRingCat.of R)) [IsProper p] + (i : Y ⟶ X) [IsClosedImmersion i] + (L : LineBundle X) (hL : (L.pullback i).IsAmple) + (M : X.Modules) (N : Y.Modules) [N.IsFinitePresentation] + (e : M ≅ (Scheme.Modules.pushforward i).obj N) : + ∃ B, ∀ n, B ≤ n → ∀ q, 0 < q → + ∀ x : Abelian.Ext.{1} (structureSheaf X) ((moduleTwistFunctor L n).obj M) q, x = 0 := by + obtain ⟨B,hB⟩ := PiExponent.GeometrySupport.NoetherianAmpleSerreVanishing.ample_serre_vanishing + (i ≫ p) (L.pullback i) hL N + refine ⟨B, fun n hn q hq x => ?_⟩ + let E := (moduleTwistFunctor L n).mapIso e ≪≫ + (PiExponent.ProjectionFormula.twistIso i N L n).symm + apply ext_zero_of_moduleIso E q _ x + exact (PiExponent.ClosedImmersionSerreTransfer.ext_zero_iff i + ((moduleTwistFunctor (L.pullback i) n).obj N) q).mp (hB n hn q hq) + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedThickeningSections.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedThickeningSections.lean new file mode 100644 index 0000000000000000000000000000000000000000..c2cd9af6bc77ab10c6d36e6b0ed5f6de38960229 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedThickeningSections.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.PiExponent.Approximation.AffineThickeningCriterion +import OAI.NumberTheory.PiExponent.Approximation.FullSupportNilpotence +import OAI.NumberTheory.PiExponent.Cohomology.FiniteCoverCohomology +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealModule + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits CategoryTheory.Abelian +open TopologicalSpace Opposite +open PiExponentSeshadri.Frames +variable {X Y : Scheme.{0}} +local instance (Z : Scheme.{0}) : HasExt.{1} Z.Modules := HasExt.standard _ + +theorem globalSections_surjective_of_ext_one_zero (S : ShortComplex X.Modules) + (hS : S.ShortExact) + (hzero : ∀ x : Abelian.Ext.{1} (structureSheaf X) S.X₁ 1, x = 0) : + Function.Surjective (fun s : GlobalSections X S.X₂ => s ≫ S.g) := by + intro s + obtain ⟨a,ha⟩ := Ext.covariant_sequence_exact₃ (structureSheaf X) hS (Ext.mk₀ s) + rfl (hzero _) + refine ⟨Ext.homEquiv₀ a, ?_⟩ + apply (Ext.mk₀_bijective (structureSheaf X) S.X₃).injective + rw [← Ext.mk₀_comp_mk₀, Ext.mk₀_homEquiv₀_apply] + exact ha + +theorem closed_appTop_surjective_of_ext_one_zero (i : Y ⟶ X) [IsClosedImmersion i] + (hzero : ∀ x : Abelian.Ext.{1} (structureSheaf X) (IdealModule.idealModule i) 1, x = 0) : + Function.Surjective i.appTop := by + let P := (Scheme.Modules.pushforward i).obj (IdealModule.unit Y) + let S := ShortComplex.mk (IdealModule.inclusion i) (IdealModule.structureMap i) + (kernel.condition _) + have hlift := globalSections_surjective_of_ext_one_zero S + (IdealModule.closedSequence_exact i) hzero + intro y + let t : GlobalSections X P := (moduleSectionEquiv P).symm y + obtain ⟨s, hs⟩ := hlift t + refine ⟨s.app ⊤ (1 : Γ(X,⊤)), ?_⟩ + have he := congrArg (fun t : GlobalSections X P => t.app ⊤ (1 : Γ(X,⊤))) hs + exact he.trans ((moduleSectionEquiv P).apply_symm_apply y) + +theorem subscheme_surjective_of_fullSupport (I : X.IdealSheafData) + (hI : I.support = ⊤) : Function.Surjective I.subschemeι := by + apply Set.range_eq_univ.mp + rw [I.range_subschemeι, hI] + rfl + +theorem isAffine_of_fullSupport_of_ideal_ext_one_zero (I : X.IdealSheafData) + (hI : I.support = ⊤) [IsAffine I.subscheme] + (hzero : ∀ x : Abelian.Ext.{1} (structureSheaf X) (IdealModule.closedModule I) 1, x = 0) : + IsAffine X := + isAffine_of_surjective_appTop I.subschemeι (subscheme_surjective_of_fullSupport I hI) + (closed_appTop_surjective_of_ext_one_zero I.subschemeι hzero) + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedUnitKernel.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedUnitKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..cdb630c8e96e06db398b37ba59a942b8878be1ea --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ClosedUnitKernel.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.PiExponent.Approximation.ClosedSectionLifting +import OAI.NumberTheory.PiExponent.Approximation.ProjectionFormula +import OAI.NumberTheory.PiExponent.Approximation.SerrePowerDescent + +namespace OAI + +noncomputable section +namespace PiExponentSeshadri.Geometry + +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits CategoryTheory.Abelian Opposite +open PiExponentSeshadri.TensorPure + + +variable {X Y : Scheme.{0}} + +def closedLineQuotientIso (f : Y ⟶ X) (M : LineBundle X) : + moduleTensor X ((Scheme.Modules.pushforward f).obj (structureSheaf Y)) M.sheaf ≅ + (Scheme.Modules.pushforward f).obj (M.pullback f).sheaf := + PiExponent.ProjectionFormula.iso f (structureSheaf Y) M ≪≫ + (Scheme.Modules.pushforward f).mapIso (moduleTensorUnit (M.pullback f).sheaf) + +theorem closedLineQuotientIso_map (f : Y ⟶ X) (M : LineBundle X) : + moduleTensorMap (PiExponentSeshadri.IdealModule.structureMap f) (𝟙 M.sheaf) ≫ + (closedLineQuotientIso f M).hom = + (moduleTensorUnit M.sheaf).hom ≫ + (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M.sheaf := by + apply PiExponentSeshadri.TensorPure.hom_ext + intro U a m + let η := ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M.sheaf).val.app (op U) + have ht := map_pure (PiExponentSeshadri.IdealModule.structureMap f) (𝟙 M.sheaf) U a m + have hp := PiExponent.ProjectionFormula.hom_pure f (structureSheaf Y) M.sheaf U + ((PiExponentSeshadri.IdealModule.structureMap f).app U a) m + have hu := unit_pure (M.pullback f).sheaf (f ⁻¹ᵁ U) + ((PiExponentSeshadri.IdealModule.structureMap f).app U a) (η m) + have hv := unit_pure M.sheaf U a m + have hs := η.hom.map_smul a m + exact (congrArg (fun z => (moduleTensorUnit (M.pullback f).sheaf).hom.app (f ⁻¹ᵁ U) + ((PiExponent.ProjectionFormula.hom f (structureSheaf Y) M.sheaf).app U z)) ht).trans + ((congrArg (fun z => (moduleTensorUnit (M.pullback f).sheaf).hom.app (f ⁻¹ᵁ U) z) hp).trans + (hu.trans (hs.symm.trans (congrArg (fun z => η z) hv).symm))) + +def closedLineUnitKernelIso (f : Y ⟶ X) [IsClosedImmersion f] (M : LineBundle X) : + moduleTensor X (PiExponentSeshadri.IdealModule.idealModule f) M.sheaf ≅ + kernel ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M.sheaf) := by + let S := ShortComplex.mk (PiExponentSeshadri.IdealModule.inclusion f) + (PiExponentSeshadri.IdealModule.structureMap f) (kernel.condition _) + let T := S.map (moduleTwistFunctor M 1) + have hT : T.ShortExact := moduleTwistFunctor_shortExact M 1 S + (PiExponentSeshadri.IdealModule.closedSequence_exact f) + let e : T.X₁ ≅ kernel T.g := + hT.fIsKernel.conePointUniqueUpToIso (limit.isLimit _) + exact e ≪≫ kernel.mapIso T.g + ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M.sheaf) + (moduleTensorUnit M.sheaf) (closedLineQuotientIso f M) + (closedLineQuotientIso_map f M) + +theorem pullbackSection_surjective_of_idealTensor_cohomology_zero + (f : Y ⟶ X) [IsClosedImmersion f] (M : LineBundle X) + (hzero : ∀ z : cohomology + (moduleTensor X (PiExponentSeshadri.IdealModule.idealModule f) M.sheaf) 1, z = 0) : + Function.Surjective (fun s : GlobalSections X M.sheaf => pullbackSection f s) := by + apply pullbackSection_surjective_of_kernel_cohomology_zero f M + exact PiExponent.GeometrySupport.SerrePowerDescent.ext_zero_of_iso + (closedLineUnitKernelIso f M) 1 hzero + +end PiExponentSeshadri.Geometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/CocycleTensor.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/CocycleTensor.lean new file mode 100644 index 0000000000000000000000000000000000000000..7022235f656586cc391070b153afe8f9a392092b --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/CocycleTensor.lean @@ -0,0 +1,189 @@ +import OAI.NumberTheory.PiExponent.Approximation.ModuleLinePowerLaws +import OAI.NumberTheory.PiExponent.Geometry.LineBundleGluingTransitions + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.LineBundleGluing +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite MonoidalCategory +open PiExponentSeshadri.Geometry PiExponentSeshadri.TensorPure +variable {X : Scheme} {ι : Type} {U : ι → X.Opens} + +def Cocycle.one : Cocycle U where + transition _ _ _ _ _ := 1 + restriction _ _ _ _ _ := by simp + identity _ _ _ := rfl + cocycle _ _ _ _ _ _ _ := one_mul _ + +def Cocycle.inverse (c : Cocycle U) : Cocycle U where + transition i j W hi hj := (c.transition i j W hi hj)⁻¹ + restriction := by + intro i j V W h hi hj + have h' : restrictUnit h (c.transition i j _ hi hj) = + c.transition i j _ (h.trans hi) (h.trans hj) := Units.ext (c.restriction i j h hi hj) + exact congrArg Units.val ((map_inv (restrictUnit h) _).symm.trans (congrArg Inv.inv h')) + identity i W hi := by rw [c.identity, inv_one] + cocycle i j k W hi hj hk := by rw [← mul_inv, c.cocycle] + +def inverseProduct (c : Cocycle U) (V : X.Opens) + (s : sections c V) (t : sections c.inverse V) : sections (Cocycle.one (U := U)) V := + ⟨fun p => s.val p * t.val p, by + constructor + · intro i W W' hW hi h + change X.presheaf.map (homOfLE h).op (_ * _) = _ + rw [map_mul, s.property.1 i W W' hW hi h, t.property.1 i W W' hW hi h] + · intro i j W hW hi hj + change s.val ⟨i,W,hW,hi⟩ * t.val ⟨i,W,hW,hi⟩ = 1 * _ + rw [s.property.2 i j W hW hi hj, t.property.2 i j W hW hi hj, one_mul] + change (_ * _) * ((↑((c.transition i j W hi hj)⁻¹ : Γ(X,W)ˣ) : Γ(X,W)) * _) = _ + rw [mul_mul_mul_comm, Units.mul_inv, one_mul]⟩ + +def inverseProductMap (c : Cocycle U) : + PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) + (presheaf c) (presheaf c.inverse) ⟶ presheaf (Cocycle.one (U := U)) where + app V := ModuleCat.MonoidalCategory.tensorLift (inverseProduct c V.unop) + (by intros; apply Subtype.ext; funext p; exact add_mul _ _ _) + (by intros; apply Subtype.ext; funext p; exact mul_assoc _ _ _) + (by intros; apply Subtype.ext; funext p; exact mul_add _ _ _) + (by intros; apply Subtype.ext; funext p; exact mul_left_comm _ _ _) + naturality {V W} f := by + apply ModuleCat.MonoidalCategory.tensor_ext + intro s t + rfl + +def trivialCoefficientMap : (structureSheaf X).val ⟶ presheaf (Cocycle.one (U := U)) where + app V := ModuleCat.ofHom (R := Γ(X, V.unop)) + (X := ModuleCat.of Γ(X, V.unop) Γ(X, V.unop)) + (Y := ModuleCat.of Γ(X, V.unop) (sections (Cocycle.one (U := U)) V.unop)) { + toFun a := ⟨fun p => X.presheaf.map (homOfLE p.2.property.1).op a, by + constructor + · intro i W W' hW hi h + change (X.presheaf.map _ ≫ X.presheaf.map _) a = _ + rw [← Functor.map_comp] + rfl + · intros; exact (one_mul _).symm⟩ + map_add' a b := by apply Subtype.ext; funext p; exact map_add _ _ _ + map_smul' a b := by apply Subtype.ext; funext p; exact map_mul _ _ _ } + naturality {V W} f := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro a + apply Subtype.ext + funext p + change (X.presheaf.map _ ≫ X.presheaf.map _) a = _ + rw [← Functor.map_comp] + rfl + +lemma cocycleUnit_restrict_isIso (c : Cocycle U) (i : ι) : + IsIso ((modulePresheafRestrict (U i).ι).map ((adj X).unit.app (presheaf c))) := by + let R : PresheafOfModules X.ringCatSheaf.obj ⥤ + PresheafOfModules (U i).toScheme.ringCatSheaf.obj := modulePresheafRestrict (U i).ι + have hη : IsIso ((adj (U i).toScheme).unit.app (R.obj (presheaf c))) := + sheafification_unit_isIso_of_iso _ (structureSheaf (U i).toScheme) + (chartPresheafFrame c i) + have hh : IsIso (R.map ((adj X).unit.app (presheaf c)) ≫ + ((moduleSheafificationRestrict (U i).ι).hom.app (presheaf c)).val) := by + erw [sheafify_restrict_unit] + exact hη + let V : (U i).toScheme.Modules ⥤ PresheafOfModules (U i).toScheme.ringCatSheaf.obj := + SheafOfModules.forget (U i).toScheme.ringCatSheaf + let hv : IsIso (C := PresheafOfModules (U i).toScheme.ringCatSheaf.obj) + (((moduleSheafificationRestrict (U i).ι).hom.app (presheaf c)).val) := + (V.mapIso ((moduleSheafificationRestrict (U i).ι).app (presheaf c))).isIso_hom + exact (@isIso_comp_right_iff (PresheafOfModules (U i).toScheme.ringCatSheaf.obj) + _ _ _ _ _ _ hv).mp hh + +lemma trivialCoefficientMap_frame (i : ι) : + (modulePresheafRestrict (U i).ι).map (trivialCoefficientMap (U := U)) ≫ + (chartPresheafFrame (Cocycle.one (U := U)) i).hom = + (Scheme.Modules.restrictUnitIso (U i).ι).hom.val := by + ext V a + change X.presheaf.map (homOfLE (show (U i).ι ''ᵁ V.unop ≤ (U i).ι ''ᵁ V.unop from le_rfl)).op a = _ + simp only [homOfLE_refl, op_id, CategoryTheory.Functor.map_id] + change a = ((U i).ι.appIso V.unop).hom a + simp only [Scheme.Opens.ι_appIso, Iso.refl_hom] + rfl + +lemma trivialCoefficientMap_restrict_isIso (i : ι) : + IsIso ((modulePresheafRestrict (U i).ι).map (trivialCoefficientMap (U := U))) := by + let V : (U i).toScheme.Modules ⥤ PresheafOfModules (U i).toScheme.ringCatSheaf.obj := + SheafOfModules.forget (U i).toScheme.ringCatSheaf + have hv : IsIso (C := PresheafOfModules (U i).toScheme.ringCatSheaf.obj) + ((Scheme.Modules.restrictUnitIso (U i).ι).hom.val) := + (V.mapIso (Scheme.Modules.restrictUnitIso (U i).ι)).isIso_hom + have hh : IsIso ((modulePresheafRestrict (U i).ι).map (trivialCoefficientMap (U := U)) ≫ + (chartPresheafFrame (Cocycle.one (U := U)) i).hom) := by + rw [trivialCoefficientMap_frame] + exact hv + let hc : IsIso (C := PresheafOfModules (U i).toScheme.ringCatSheaf.obj) + (chartPresheafFrame (Cocycle.one (U := U)) i).hom := + (chartPresheafFrame (Cocycle.one (U := U)) i).isIso_hom + exact (@isIso_comp_right_iff (PresheafOfModules (U i).toScheme.ringCatSheaf.obj) + _ _ _ _ _ _ hc).mp hh + +lemma inverseProductMap_frame (c : Cocycle U) (i : ι) : + (modulePresheafRestrict (U i).ι).map (inverseProductMap c) ≫ + (chartPresheafFrame (Cocycle.one (U := U)) i).hom = + (modulePresheafTensorRestrict (U i) (presheaf c) (presheaf c.inverse)).hom ≫ + PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := (U i).toScheme.presheaf) + (chartPresheafFrame c i).hom (chartPresheafFrame c.inverse i).hom ≫ + (by + let : MonoidalCategory (PresheafOfModules (U i).toScheme.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := (U i).toScheme.presheaf) + exact (λ_ (structureSheaf (U i).toScheme).val).hom) := by + let : MonoidalCategory (PresheafOfModules (U i).toScheme.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := (U i).toScheme.presheaf) + let l := (modulePresheafRestrict (U i).ι).map (inverseProductMap c) ≫ + (chartPresheafFrame (Cocycle.one (U := U)) i).hom + let r := (modulePresheafTensorRestrict (U i) (presheaf c) (presheaf c.inverse)).hom ≫ + PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := (U i).toScheme.presheaf) + (chartPresheafFrame c i).hom (chartPresheafFrame c.inverse i).hom ≫ + (λ_ (structureSheaf (U i).toScheme).val).hom + change l = r + ext V : 1 + apply ModuleCat.hom_ext + apply LinearMap.ext + intro z + induction z using TensorProduct.inductionOn with + | tmul s t => rfl + | add a b ha hb => + exact ((l.app V).hom.map_add a b).trans + ((congrArg₂ (· + ·) ha hb).trans ((r.app V).hom.map_add a b).symm) + +lemma inverseProductMap_restrict_isIso (c : Cocycle U) (i : ι) : + IsIso ((modulePresheafRestrict (U i).ι).map (inverseProductMap c)) := by + let : MonoidalCategory (PresheafOfModules (U i).toScheme.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := (U i).toScheme.presheaf) + let e := modulePresheafTensorRestrict (U i) (presheaf c) (presheaf c.inverse) ≪≫ + tensorIso (chartPresheafFrame c i) (chartPresheafFrame c.inverse i) ≪≫ + λ_ (structureSheaf (U i).toScheme).val + have hh : IsIso ((modulePresheafRestrict (U i).ι).map (inverseProductMap c) ≫ + (chartPresheafFrame (Cocycle.one (U := U)) i).hom) := by + rw [inverseProductMap_frame] + exact e.isIso_hom + let hc : IsIso (C := PresheafOfModules (U i).toScheme.ringCatSheaf.obj) + (chartPresheafFrame (Cocycle.one (U := U)) i).hom := + (chartPresheafFrame (Cocycle.one (U := U)) i).isIso_hom + exact (@isIso_comp_right_iff (PresheafOfModules (U i).toScheme.ringCatSheaf.obj) + _ _ _ _ _ _ hc).mp hh + +lemma sheafification_isIso_of_chart {P Q : PresheafOfModules X.ringCatSheaf.obj} + (f : P ⟶ Q) (hcover : ⊤ ≤ ⨆ i, U i) + (hf : ∀ i, IsIso ((modulePresheafRestrict (U i).ι).map f)) : + IsIso ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map f) := by + apply PiExponent.NumericalAmpleness.isIso_of_locally_isIso + intro x + obtain ⟨i, hi⟩ := Opens.mem_iSup.mp (hcover (show x ∈ (⊤ : X.Opens) from trivial)) + refine ⟨U i, hi, ?_⟩ + apply (NatIso.isIso_map_iff (moduleSheafificationRestrict (U i).ι) f).mpr + have := hf i + change IsIso ((PresheafOfModules.sheafification (𝟙 (U i).toScheme.ringCatSheaf.obj)).map + ((modulePresheafRestrict (U i).ι).map f)) + infer_instance + +end PiExponentSeshadri.LineBundleGluing + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/CocycleTensorIso.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/CocycleTensorIso.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c2fd49e66b50695b609ff2832aef5e5d6de198c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/CocycleTensorIso.lean @@ -0,0 +1,67 @@ +import OAI.NumberTheory.PiExponent.Approximation.CocycleTensor + +namespace OAI + +namespace PiExponentSeshadri.LineBundleGluing +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite MonoidalCategory +open PiExponentSeshadri.Geometry PiExponentSeshadri.TensorPure +variable {X : Scheme} {ι : Type} {U : ι → X.Opens} + +lemma tensorHom_restrict_isIso (W : X.Opens) + {P P' Q Q' : PresheafOfModules X.ringCatSheaf.obj} (f : P ⟶ P') (g : Q ⟶ Q') + [IsIso ((modulePresheafRestrict W.ι).map f)] + [IsIso ((modulePresheafRestrict W.ι).map g)] : + IsIso ((modulePresheafRestrict W.ι).map + (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) f g)) := by + let R := modulePresheafRestrict W.ι + let : MonoidalCategory (PresheafOfModules W.toScheme.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := W.toScheme.presheaf) + have hh : IsIso (R.map (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) f g) ≫ + (modulePresheafTensorRestrict W P' Q').hom) := by + rw [modulePresheafTensorRestrict_natural] + change IsIso (_ ≫ (R.map f ⊗ₘ R.map g)) + infer_instance + let hc : IsIso (C := PresheafOfModules W.toScheme.ringCatSheaf.obj) + (modulePresheafTensorRestrict W P' Q').hom := + (modulePresheafTensorRestrict W P' Q').isIso_hom + exact (@isIso_comp_right_iff (PresheafOfModules W.toScheme.ringCatSheaf.obj) + _ _ _ _ _ _ hc).mp hh + +def cocycleTensorComparison (c d : Cocycle U) (hcover : ⊤ ≤ ⨆ i, U i) : + (PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).obj + (PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) + (presheaf c) (presheaf d)) ≅ moduleTensor X (sheaf c) (sheaf d) := by + let f := PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) + ((adj X).unit.app (presheaf c)) ((adj X).unit.app (presheaf d)) + have ht : IsIso ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map f) := by + apply sheafification_isIso_of_chart f hcover + intro i + have := cocycleUnit_restrict_isIso c i + have := cocycleUnit_restrict_isIso d i + exact tensorHom_restrict_isIso (U i) _ _ + exact @asIso _ _ _ _ ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map f) ht + +def trivialSheafIso (hcover : ⊤ ≤ ⨆ i, U i) : + sheaf (Cocycle.one (U := U)) ≅ structureSheaf X := by + have ht : IsIso ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map + (trivialCoefficientMap (U := U))) := + sheafification_isIso_of_chart _ hcover trivialCoefficientMap_restrict_isIso + exact (@asIso _ _ _ _ ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map + (trivialCoefficientMap (U := U))) ht).symm ≪≫ + (asIso (adj X).counit).app (structureSheaf X) + +def tensorInverseIso (c : Cocycle U) (hcover : ⊤ ≤ ⨆ i, U i) : + moduleTensor X (sheaf c) (sheaf c.inverse) ≅ structureSheaf X := by + have ht : IsIso ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map + (inverseProductMap c)) := + sheafification_isIso_of_chart _ hcover (inverseProductMap_restrict_isIso c) + exact (cocycleTensorComparison c c.inverse hcover).symm ≪≫ + @asIso _ _ _ _ ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map + (inverseProductMap c)) ht ≪≫ + trivialSheafIso hcover + +end +end PiExponentSeshadri.LineBundleGluing + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/CoherentCokernels.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/CoherentCokernels.lean new file mode 100644 index 0000000000000000000000000000000000000000..4aea7a73f424267b6a59e6ddd800198443ac7744 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/CoherentCokernels.lean @@ -0,0 +1,96 @@ +import OAI.NumberTheory.PiExponent.LocalAlgebra.FiniteGlobalPresentation + +namespace OAI + +namespace PiExponent.CoherentCokernels +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite +open PiExponent.FiniteGlobalPresentation PiExponent.CoherentAffineFinite +universe u + +private def presentationOfIso (X : Scheme.{u}) + {M N : SheafOfModules.{u} X.ringCatSheaf} (e : M ≅ N) + (P : M.Presentation) : N.Presentation := by + let : IsIso e.hom := e.isIso_hom + exact P.ofIsIso e.hom + +def specCokernelIso {R : CommRingCat.{u}} {M N : (Spec R).Modules} + [M.IsQuasicoherent] [N.IsQuasicoherent] (f : M ⟶ N) : + let g := (tilde.functor R).preimage + ((asIso M.fromTildeΓ).hom ≫ f ≫ (asIso N.fromTildeΓ).inv) + (tilde.functor R).obj (cokernel g) ≅ cokernel f := by + intro g + let hm := Scheme.Modules.isIso_fromTildeΓ_of_isQuasicoherent M + let hn := Scheme.Modules.isIso_fromTildeΓ_of_isQuasicoherent N + let em := @asIso _ _ _ _ M.fromTildeΓ hm + let en := @asIso _ _ _ _ N.fromTildeΓ hn + exact PreservesCokernel.iso (tilde.functor R) g ≪≫ + cokernel.mapIso ((tilde.functor R).map g) f em en (by + change (tilde.functor R).map ((tilde.functor R).preimage _) ≫ _ = _ + erw [Functor.map_preimage] + exact (Category.assoc em.hom (f ≫ en.inv) en.hom).trans + (congrArg (fun q => em.hom ≫ q) + ((Category.assoc f en.inv en.hom).trans + ((congrArg (fun q => f ≫ q) en.inv_hom_id).trans (Category.comp_id f))))) + +theorem spec_cokernel_exists_finitePresentation {R : CommRingCat.{u}} [IsNoetherianRing R] + {M N : (Spec R).Modules} [M.IsQuasicoherent] [N.IsQuasicoherent] + [Module.Finite R ((modulesSpecToSheaf.obj N).obj.obj (op ⊤))] (f : M ⟶ N) : + ∃ P : (cokernel f).Presentation, P.IsFinite := by + let g := (tilde.functor R).preimage + ((asIso M.fromTildeΓ).hom ≫ f ≫ (asIso N.fromTildeΓ).inv) + have : Module.Finite R (moduleSpecΓFunctor.obj N) := inferInstanceAs + (Module.Finite R ((modulesSpecToSheaf.obj N).obj.obj (op ⊤))) + have : Module.Finite R (cokernel (C := ModuleCat R) g) := + Module.Finite.of_surjective (cokernel.π g).hom + ((ModuleCat.epi_iff_surjective _).mp inferInstance) + obtain ⟨P,hP⟩ := tilde_exists_finitePresentation (cokernel g) + exact ⟨presentationOfIso (Spec R) (specCokernelIso f) P, + ⟨⟨hP.isFiniteType_generators.finite⟩, ⟨hP.isFiniteType_relations.finite⟩⟩⟩ + +theorem affine_cokernel_exists_finitePresentation {X : Scheme.{u}} + [IsAffine X] [IsLocallyNoetherian X] {M N : X.Modules} + [M.IsQuasicoherent] [N.IsQuasicoherent] (f : M ⟶ N) + (hN : LocallyFinitelyGenerated N) : + ∃ P : (cokernel f).Presentation, P.IsFinite := by + let a := X.isoSpec.inv + let F := Scheme.Modules.restrictFunctor a + have : IsNoetherianRing Γ(X,⊤) := + IsLocallyNoetherian.component_noetherian ⟨⊤, isAffineOpen_top X⟩ + have : Module.Finite Γ(X,⊤) ((modulesSpecToSheaf.obj (N.restrict a)).obj.obj (op ⊤)) := + spec_sections_finite_of_localGenerators (N.restrict a) (hN.restrict a) + obtain ⟨P,hP⟩ := spec_cokernel_exists_finitePresentation (F.map f) + let e := PreservesCokernel.iso F f + let P' := presentationOfIso (Spec Γ(X,⊤)) e.symm P + let b := X.isoSpec.hom + let G : SheafOfModules (Spec Γ(X,⊤)).ringCatSheaf ⥤ SheafOfModules X.ringCatSheaf := + Scheme.Modules.restrictFunctor b + let : PreservesColimitsOfSize.{u,u} G := + (Scheme.Modules.restrictAdjunction b).leftAdjoint_preservesColimits + let Q := P'.map G (Scheme.Modules.restrictUnitIso b).symm + let e₁ := (Scheme.Modules.restrictFunctorComp b a).app (cokernel f) + have e₂ : (cokernel f).restrict (𝟙 X) ≅ ((cokernel f).restrict a).restrict b := by + change (cokernel f).restrict (b ≫ a) ≅ ((cokernel f).restrict a).restrict b at e₁ + simpa only [b, a, Iso.hom_inv_id] using e₁ + let e₃ := e₂.symm ≪≫ Scheme.Modules.restrictFunctorId.app (cokernel f) + exact ⟨presentationOfIso X e₃ Q, + ⟨⟨hP.isFiniteType_generators.finite⟩, ⟨hP.isFiniteType_relations.finite⟩⟩⟩ + +theorem cokernel_isFinitePresentation {X : Scheme.{u}} [IsLocallyNoetherian X] + {M N : X.Modules} [M.IsQuasicoherent] [N.IsFinitePresentation] (f : M ⟶ N) : + (cokernel f).IsFinitePresentation := by + apply isFinitePresentation_of_affine_presentations + intro U + have : IsAffine U.1.toScheme := U.2 + let F := Scheme.Modules.restrictFunctor U.1.ι + let : N.IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData N).choose.isQuasicoherent + obtain ⟨P,hP⟩ := affine_cokernel_exists_finitePresentation (F.map f) + ((locallyFinitelyGenerated_of_finitePresentation N).restrict U.1.ι) + let e := PreservesCokernel.iso F f + exact ⟨presentationOfIso U.1.toScheme e.symm P, + ⟨⟨hP.isFiniteType_generators.finite⟩, ⟨hP.isFiniteType_relations.finite⟩⟩⟩ +end +end PiExponent.CoherentCokernels + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/CoherentTwistPresentation.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/CoherentTwistPresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a2d785d6bee3e285c1538130a6ee21a75c49901 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/CoherentTwistPresentation.lean @@ -0,0 +1,455 @@ +import OAI.NumberTheory.PiExponent.Cohomology.FiniteCoverCohomology +import OAI.NumberTheory.PiExponent.Geometry.LineBundleTensor + +namespace OAI + +noncomputable section + +open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite + +namespace PiExponent.CoherentTwist + +universe u +variable {R : CommRingCat.{u}} (M : (Spec R).Modules) [M.IsQuasicoherent] + +abbrev affineSections (U : (Spec R).Opens) := + (modulesSpecToSheaf.obj M).obj.obj (op U) + +abbrev principalRestriction (r : R) := + ((modulesSpecToSheaf.obj M).obj.map (PrimeSpectrum.basicOpen r).leTop.op).hom + +theorem principalRestriction_localizes (r : R) : + IsLocalizedModule.Away r (principalRestriction M r) := + ((isIso_fromTildeΓ_iff_isLocalizing M).mp inferInstance) r + +theorem principal_section_extends (r : R) + (x : affineSections M (PrimeSpectrum.basicOpen r)) : + ∃ N : ℕ, ∀ n ≥ N, ∃ y : affineSections M ⊤, + principalRestriction M r y = r ^ n • x := by + let := principalRestriction_localizes M r + obtain ⟨N, y, hy⟩ := (inferInstance : IsLocalizedModule.Away r + (principalRestriction M r)).surj _ _ x + refine ⟨N, fun n hn => ⟨r ^ (n - N) • y, ?_⟩⟩ + rw [map_smul, ← hy, ← mul_smul, ← pow_add, Nat.sub_add_cancel hn] + +theorem principal_section_zero (r : R) (x : affineSections M ⊤) + (hx : principalRestriction M r x = 0) : + ∃ N : ℕ, ∀ n ≥ N, r ^ n • x = 0 := by + let := principalRestriction_localizes M r + obtain ⟨⟨_, N, rfl⟩, hN⟩ := + (IsLocalizedModule.eq_zero_iff (.powers r) (principalRestriction M r)).mp hx + change r ^ N • x = 0 at hN + refine ⟨N, fun n hn => ?_⟩ + rw [← Nat.sub_add_cancel hn, pow_add, mul_smul, hN, smul_zero] + +theorem finite_principal_sections_extend {ι : Type*} [Fintype ι] (r : R) + (x : ι → affineSections M (PrimeSpectrum.basicOpen r)) : + ∃ N : ℕ, ∀ n ≥ N, ∃ y : ι → affineSections M ⊤, + ∀ i, principalRestriction M r (y i) = r ^ n • x i := by + classical + choose N hN using fun i => principal_section_extends M r (x i) + refine ⟨Finset.univ.sup N, fun n hn => ?_⟩ + have hn' (i : ι) : N i ≤ n := + (Finset.le_sup (f := N) (Finset.mem_univ i)).trans hn + choose y hy using fun i => hN i n (hn' i) + exact ⟨y, hy⟩ + +theorem finite_principal_sections_zero {ι : Type*} [Fintype ι] (r : R) + (x : ι → affineSections M ⊤) + (hx : ∀ i, principalRestriction M r (x i) = 0) : + ∃ N : ℕ, ∀ n ≥ N, ∀ i, r ^ n • x i = 0 := by + classical + choose N hN using fun i => principal_section_zero M r (x i) (hx i) + refine ⟨Finset.univ.sup N, fun n hn i => ?_⟩ + exact hN i n ((Finset.le_sup (f := N) (Finset.mem_univ i)).trans hn) + +open TopologicalSpace +variable {X : Scheme.{u}} {P Q : X.Modules} + +lemma app_zero_of_restrict (φ : P ⟶ Q) (U W : X.Opens) (hW : W ≤ U) + (h : (Scheme.Modules.restrictFunctor U.ι).map φ = 0) : φ.app W = 0 := by + have hz := congrArg (fun q : P.restrict U.ι ⟶ Q.restrict U.ι => + q.app (U.ι ⁻¹ᵁ W)) h + have he : U.ι ''ᵁ U.ι ⁻¹ᵁ W = W := by + rw [Scheme.Hom.image_preimage_eq_opensRange_inf, Scheme.Opens.opensRange_ι, + inf_eq_right.mpr hW] + change φ.app (U.ι ''ᵁ U.ι ⁻¹ᵁ W) = 0 at hz + suffices hh : ∀ A : X.Opens, A = W → φ.app A = 0 → φ.app W = 0 from hh _ he hz + intro A hA hφ + subst A + exact hφ + +lemma eq_zero_of_local (φ : P ⟶ Q) + (h : ∀ x : X, ∃ U : X.Opens, x ∈ U ∧ + (Scheme.Modules.restrictFunctor U.ι).map φ = 0) : φ = 0 := by + ext W m + change φ.app W m = 0 + let F : (X : TopCat).Sheaf AddCommGrpCat := (SheafOfModules.toSheaf X.ringCatSheaf).obj Q + apply TopCat.Presheaf.section_ext F W (φ.app W m) 0 + intro x hx + obtain ⟨U,hxU,hU⟩ := h x + let V : X.Opens := W ⊓ U + have hv : φ.app V = 0 := app_zero_of_restrict φ U V inf_le_right hU + change Q.presheaf.germ W x hx (φ.app W m) = Q.presheaf.germ W x hx 0 + rw [← TopCat.Presheaf.germ_res_apply Q.presheaf (homOfLE (show V ≤ W from inf_le_left)) + x (show x ∈ V from ⟨hx,hxU⟩)] + have hn := CategoryTheory.congr_fun (φ.mapPresheaf.naturality + (homOfLE (show V ≤ W from inf_le_left)).op) m + change φ.app V (P.presheaf.map (homOfLE inf_le_left).op m) = + Q.presheaf.map (homOfLE inf_le_left).op (φ.app W m) at hn + rw [← hn,hv] + simp + +lemma epi_of_local (φ : P ⟶ Q) + (h : ∀ x : X, ∃ U : X.Opens, x ∈ U ∧ + Epi ((Scheme.Modules.restrictFunctor U.ι).map φ)) : Epi φ := by + apply (Preadditive.epi_iff_cancel_zero _).mpr + intro T g hg + apply eq_zero_of_local + intro x + obtain ⟨U,hx,hU⟩ := h x + let := hU + refine ⟨U,hx,?_⟩ + apply (cancel_epi ((Scheme.Modules.restrictFunctor U.ι).map φ)).mp + rw [← Functor.map_comp,hg,Functor.map_zero,comp_zero] + +lemma mono_of_local (φ : P ⟶ Q) + (h : ∀ x : X, ∃ U : X.Opens, x ∈ U ∧ + Mono ((Scheme.Modules.restrictFunctor U.ι).map φ)) : Mono φ := by + apply (Preadditive.mono_iff_cancel_zero _).mpr + intro T g hg + apply eq_zero_of_local + intro x + obtain ⟨U, hx, hU⟩ := h x + let := hU + refine ⟨U, hx, ?_⟩ + apply (cancel_mono ((Scheme.Modules.restrictFunctor U.ι).map φ)).mp + rw [← Functor.map_comp, hg, Functor.map_zero, zero_comp] + +lemma exact_of_local (S : ShortComplex X.Modules) + (h : ∀ x : X, ∃ U : X.Opens, x ∈ U ∧ + (S.map (Scheme.Modules.restrictFunctor U.ι)).Exact) : S.Exact := by + rw [ShortComplex.exact_iff_isZero_homology] + apply (IsZero.iff_id_eq_zero _).mpr + apply eq_zero_of_local + intro x + obtain ⟨U, hx, hU⟩ := h x + have hz : IsZero ((Scheme.Modules.restrictFunctor U.ι).obj S.homology) := + ((ShortComplex.exact_iff_isZero_homology _).mp hU).of_iso + (S.mapHomologyIso (Scheme.Modules.restrictFunctor U.ι)).symm + refine ⟨U, hx, ?_⟩ + rw [CategoryTheory.Functor.map_id] + exact hz.eq_of_src _ _ + +end PiExponent.CoherentTwist + +namespace PiExponentSeshadri.Geometry +open MonoidalCategory +variable {X : Scheme} + +private lemma tensorRestrict_natural {C D : Type*} [Category C] [Category D] + [mC : MonoidalCategory C] [mD : MonoidalCategory D] (R F : C ⥤ D) [F.OplaxMonoidal] + (e : R ≅ F) {M N P Q : C} (f : M ⟶ N) (g : P ⟶ Q) : + R.map (f ⊗ₘ g) ≫ (e.hom.app (N ⊗ Q) ≫ + Functor.OplaxMonoidal.δ F N Q ≫ (e.inv.app N ⊗ₘ e.inv.app Q)) = + (e.hom.app (M ⊗ P) ≫ Functor.OplaxMonoidal.δ F M P ≫ + (e.inv.app M ⊗ₘ e.inv.app P)) ≫ (R.map f ⊗ₘ R.map g) := by + rw [← Category.assoc, e.hom.naturality, Category.assoc, + ← Category.assoc (F.map (f ⊗ₘ g)), ← Functor.OplaxMonoidal.δ_natural, + Category.assoc, tensorHom_comp_tensorHom, e.inv.naturality, + e.inv.naturality, ← tensorHom_comp_tensorHom] + simp only [Category.assoc] + +private lemma modulePresheafTensorRestrict_natural_aux (U : X.Opens) + {M N P Q : PresheafOfModules X.ringCatSheaf.obj} + (f : M ⟶ N) (g : P ⟶ Q) : + type_of% (tensorRestrict_natural + (C := PresheafOfModules (X.presheaf ⋙ forget₂ CommRingCat RingCat)) + (D := PresheafOfModules + ((U.ι.opensFunctor.op ⋙ X.presheaf) ⋙ forget₂ CommRingCat RingCat)) + (mC := PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf)) + (mD := PresheafOfModulesOfCommRing.monoidalCategory + (R := U.ι.opensFunctor.op ⋙ X.presheaf)) + (modulePresheafRestrict U.ι) + (PresheafOfModules.pushforward₀OfCommRingCat U.ι.opensFunctor X.presheaf) + (modulePresheafRestrictOpensIso U) f g) := + tensorRestrict_natural + (C := PresheafOfModules (X.presheaf ⋙ forget₂ CommRingCat RingCat)) + (D := PresheafOfModules + ((U.ι.opensFunctor.op ⋙ X.presheaf) ⋙ forget₂ CommRingCat RingCat)) + (mC := PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf)) + (mD := PresheafOfModulesOfCommRing.monoidalCategory + (R := U.ι.opensFunctor.op ⋙ X.presheaf)) + (modulePresheafRestrict U.ι) + (PresheafOfModules.pushforward₀OfCommRingCat U.ι.opensFunctor X.presheaf) + (modulePresheafRestrictOpensIso U) f g + +lemma modulePresheafTensorRestrict_natural (U : X.Opens) + {M N P Q : PresheafOfModules X.ringCatSheaf.obj} + (f : M ⟶ N) (g : P ⟶ Q) : + (modulePresheafRestrict U.ι).map + (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) f g) ≫ + (modulePresheafTensorRestrict U N Q).hom = + (modulePresheafTensorRestrict U M P).hom ≫ + PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := U.toScheme.presheaf) + ((modulePresheafRestrict U.ι).map f) ((modulePresheafRestrict U.ι).map g) := by + dsimp only [modulePresheafTensorRestrict, Iso.trans_hom, Iso.symm_hom, + Functor.Monoidal.μIso_inv, tensorIso_hom] + exact modulePresheafTensorRestrict_natural_aux U f g + +lemma moduleTensorRestrict_natural (U : X.Opens) {M N P Q : X.Modules} + (f : M ⟶ N) (g : P ⟶ Q) : + (Scheme.Modules.restrictFunctor U.ι).map (moduleTensorMap f g) ≫ + (moduleTensorRestrict U N Q).hom = + (moduleTensorRestrict U M P).hom ≫ + moduleTensorMap ((Scheme.Modules.restrictFunctor U.ι).map f) + ((Scheme.Modules.restrictFunctor U.ι).map g) := by + let K : PresheafOfModules X.ringCatSheaf.obj ⥤ X.Modules := + PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj) + let R : X.Modules ⥤ U.toScheme.Modules := Scheme.Modules.restrictFunctor U.ι + let Rpre : PresheafOfModules X.ringCatSheaf.obj ⥤ + PresheafOfModules U.toScheme.ringCatSheaf.obj := modulePresheafRestrict U.ι + let S : PresheafOfModules U.toScheme.ringCatSheaf.obj ⥤ U.toScheme.Modules := + PresheafOfModules.sheafification (𝟙 U.toScheme.ringCatSheaf.obj) + let e : K ⋙ R ≅ Rpre ⋙ S := moduleSheafificationRestrict U.ι + let h := PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) f.val g.val + let k := PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := U.toScheme.presheaf) + (Rpre.map f.val) (Rpre.map g.val) + let a := (modulePresheafTensorRestrict U M.val P.val).hom + let b := (modulePresheafTensorRestrict U N.val Q.val).hom + change R.map (K.map h) ≫ (e.hom.app _ ≫ S.map b) = + (e.hom.app _ ≫ S.map a) ≫ S.map k + have ht : Rpre.map h ≫ b = a ≫ k := modulePresheafTensorRestrict_natural U f.val g.val + calc + _ = (R.map (K.map h) ≫ e.hom.app _) ≫ S.map b := + (Category.assoc _ _ _).symm + _ = (e.hom.app _ ≫ S.map (Rpre.map h)) ≫ S.map b := + congrArg (· ≫ S.map b) (e.hom.naturality h) + _ = e.hom.app _ ≫ (S.map (Rpre.map h) ≫ S.map b) := Category.assoc _ _ _ + _ = e.hom.app _ ≫ S.map (Rpre.map h ≫ b) := + congrArg (e.hom.app _ ≫ ·) (S.map_comp _ _).symm + _ = e.hom.app _ ≫ S.map (a ≫ k) := + congrArg (fun t => e.hom.app _ ≫ S.map t) ht + _ = e.hom.app _ ≫ (S.map a ≫ S.map k) := + congrArg (e.hom.app _ ≫ ·) (S.map_comp _ _) + _ = _ := (Category.assoc _ _ _).symm + +def moduleTensorRightFunctor (L : X.Modules) : X.Modules ⥤ X.Modules where + obj M := moduleTensor X M L + map f := moduleTensorMap f (𝟙 L) + map_id M := moduleTensorMap_id M L + map_comp f g := by simpa using moduleTensorMap_comp f g (𝟙 L) (𝟙 L) + +@[simp] theorem moduleTensorIso_hom {M N P Q : X.Modules} + (e : M ≅ N) (f : P ≅ Q) : + (moduleTensorIso e f).hom = moduleTensorMap e.hom f.hom := rfl + +@[reassoc] theorem moduleTensorRightUnit_natural {M N : X.Modules} (f : M ⟶ N) : + moduleTensorMap f (𝟙 (structureSheaf X)) ≫ (moduleTensorRightUnit N).hom = + (moduleTensorRightUnit M).hom ≫ f := by + let : MonoidalCategory (PresheafOfModules X.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf) + let S : PresheafOfModules X.ringCatSheaf.obj ⥤ X.Modules := + PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj) + let adj := PresheafOfModules.sheafificationAdjunction (R := X.ringCatSheaf) + (𝟙 X.ringCatSheaf.obj) + change S.map (f.val ⊗ₘ 𝟙 _) ≫ (S.map (ρ_ N.val).hom ≫ adj.counit.app N) = + (S.map (ρ_ M.val).hom ≫ adj.counit.app M) ≫ f + have hu : (f.val ⊗ₘ 𝟙 _) ≫ (ρ_ N.val).hom = (ρ_ M.val).hom ≫ f.val := by + simpa only [tensorHom_id] using rightUnitor_naturality f.val + have hS : S.map (f.val ⊗ₘ 𝟙 _) ≫ S.map (ρ_ N.val).hom = + S.map (ρ_ M.val).hom ≫ S.map f.val := + (S.map_comp _ _).symm.trans ((congrArg S.map hu).trans (S.map_comp _ _)) + calc + _ = (S.map (f.val ⊗ₘ 𝟙 _) ≫ S.map (ρ_ N.val).hom) ≫ adj.counit.app N := + (Category.assoc _ _ _).symm + _ = (S.map (ρ_ M.val).hom ≫ S.map f.val) ≫ adj.counit.app N := + congrArg (· ≫ adj.counit.app N) hS + _ = S.map (ρ_ M.val).hom ≫ (S.map f.val ≫ adj.counit.app N) := + Category.assoc _ _ _ + _ = S.map (ρ_ M.val).hom ≫ (adj.counit.app M ≫ f) := + congrArg (S.map (ρ_ M.val).hom ≫ ·) (adj.counit.naturality f) + _ = _ := (Category.assoc _ _ _).symm + +def moduleTensorFrame (M : X.Modules) {L : X.Modules} + (e : L ≅ structureSheaf X) : moduleTensor X M L ≅ M := + moduleTensorIso (Iso.refl M) e ≪≫ moduleTensorRightUnit M + +@[reassoc] theorem moduleTensorFrame_natural {M N L : X.Modules} + (f : M ⟶ N) (e : L ≅ structureSheaf X) : + moduleTensorMap f (𝟙 L) ≫ (moduleTensorFrame N e).hom = + (moduleTensorFrame M e).hom ≫ f := by + simp only [moduleTensorFrame, Iso.trans_hom, moduleTensorIso_hom, Iso.refl_hom] + calc + _ = moduleTensorMap f e.hom ≫ (moduleTensorRightUnit N).hom := by + rw [← Category.assoc, ← moduleTensorMap_comp] + simp only [Category.comp_id, Category.id_comp] + _ = moduleTensorMap (𝟙 M) e.hom ≫ + moduleTensorMap f (𝟙 (structureSheaf X)) ≫ (moduleTensorRightUnit N).hom := by + rw [← Category.assoc, ← moduleTensorMap_comp] + simp only [Category.comp_id, Category.id_comp] + _ = _ := by rw [moduleTensorRightUnit_natural, Category.assoc] + +def moduleTensorRestrictFrame (U : X.Opens) (L : X.Modules) + (e : L.restrict U.ι ≅ structureSheaf U.toScheme) : + moduleTensorRightFunctor L ⋙ Scheme.Modules.restrictFunctor U.ι ≅ + Scheme.Modules.restrictFunctor U.ι := + NatIso.ofComponents + (fun M => moduleTensorRestrict U M L ≪≫ moduleTensorFrame (M.restrict U.ι) e) + (by + intro M N f + change (Scheme.Modules.restrictFunctor U.ι).map (moduleTensorMap f (𝟙 L)) ≫ + ((moduleTensorRestrict U N L).hom ≫ (moduleTensorFrame (N.restrict U.ι) e).hom) = + ((moduleTensorRestrict U M L).hom ≫ (moduleTensorFrame (M.restrict U.ι) e).hom) ≫ + (Scheme.Modules.restrictFunctor U.ι).map f + rw [← Category.assoc, moduleTensorRestrict_natural, Category.assoc, + CategoryTheory.Functor.map_id, moduleTensorFrame_natural, Category.assoc]) + +theorem moduleTensorMap_epi {M N : X.Modules} (f : M ⟶ N) [Epi f] + (L : LineBundle X) : Epi (moduleTensorMap f (𝟙 L.sheaf)) := by + apply PiExponent.CoherentTwist.epi_of_local + intro x + obtain ⟨U, hx, ⟨e⟩⟩ := L.locallyRankOne x + refine ⟨U, hx, ?_⟩ + let F : X.Modules ⥤ U.toScheme.Modules := Scheme.Modules.restrictFunctor U.ι + let E : moduleTensorRightFunctor L.sheaf ⋙ F ≅ F := moduleTensorRestrictFrame U L.sheaf e + have h : F.map (moduleTensorMap f (𝟙 L.sheaf)) = + (E.app M).hom ≫ F.map f ≫ (E.app N).inv := by + exact ((E.app N).eq_comp_inv.mpr (E.hom.naturality f)).trans + (Category.assoc _ _ _) + rw [h] + let : Epi (F.map f) := inferInstanceAs + (Epi ((Scheme.Modules.restrictFunctor U.ι).map f)) + let : IsIso (E.app M).hom := (E.app M).isIso_hom + let : IsIso (E.app N).inv := (E.app N).isIso_inv + exact (inferInstance : Epi (C := U.toScheme.Modules) + ((E.app M).hom ≫ F.map f ≫ (E.app N).inv)) + +theorem moduleTensorMap_mono {M N : X.Modules} (f : M ⟶ N) [Mono f] + (L : LineBundle X) : Mono (moduleTensorMap f (𝟙 L.sheaf)) := by + apply PiExponent.CoherentTwist.mono_of_local + intro x + obtain ⟨U, hx, ⟨e⟩⟩ := L.locallyRankOne x + refine ⟨U, hx, ?_⟩ + let F : X.Modules ⥤ U.toScheme.Modules := Scheme.Modules.restrictFunctor U.ι + let E : moduleTensorRightFunctor L.sheaf ⋙ F ≅ F := moduleTensorRestrictFrame U L.sheaf e + have h : F.map (moduleTensorMap f (𝟙 L.sheaf)) = + (E.app M).hom ≫ F.map f ≫ (E.app N).inv := by + exact ((E.app N).eq_comp_inv.mpr (E.hom.naturality f)).trans + (Category.assoc _ _ _) + rw [h] + let : Mono (F.map f) := inferInstanceAs + (Mono ((Scheme.Modules.restrictFunctor U.ι).map f)) + let : IsIso (E.app M).hom := (E.app M).isIso_hom + let : IsIso (E.app N).inv := (E.app N).isIso_inv + exact (inferInstance : Mono (C := U.toScheme.Modules) + ((E.app M).hom ≫ F.map f ≫ (E.app N).inv)) + +instance moduleTensorRightFunctor_preservesZero (L : LineBundle X) : + (moduleTensorRightFunctor L.sheaf).PreservesZeroMorphisms where + map_zero M N := by + apply PiExponent.CoherentTwist.eq_zero_of_local + intro x + obtain ⟨U, hx, ⟨e⟩⟩ := L.locallyRankOne x + refine ⟨U, hx, ?_⟩ + let E := moduleTensorRestrictFrame U L.sheaf e + apply (cancel_mono (E.app N).hom).mp + rw [zero_comp] + change ((moduleTensorRightFunctor L.sheaf ⋙ Scheme.Modules.restrictFunctor U.ι).map + (0 : M ⟶ N)) ≫ E.hom.app N = 0 + rw [E.hom.naturality, CategoryTheory.Functor.map_zero, comp_zero] + +theorem moduleTensorRightFunctor_exact (L : LineBundle X) + (S : ShortComplex X.Modules) (hS : S.Exact) : + (S.map (moduleTensorRightFunctor L.sheaf)).Exact := by + apply PiExponent.CoherentTwist.exact_of_local + intro x + obtain ⟨U, hx, ⟨e⟩⟩ := L.locallyRankOne x + refine ⟨U, hx, ?_⟩ + exact ShortComplex.exact_of_iso + (S.mapNatIso (moduleTensorRestrictFrame U L.sheaf e)).symm + (hS.map (Scheme.Modules.restrictFunctor U.ι)) + +theorem moduleTensorRightFunctor_shortExact (L : LineBundle X) + (S : ShortComplex X.Modules) (hS : S.ShortExact) : + (S.map (moduleTensorRightFunctor L.sheaf)).ShortExact where + exact := moduleTensorRightFunctor_exact L S hS.exact + mono_f := by + have := hS.mono_f + exact moduleTensorMap_mono S.f L + epi_g := by + have := hS.epi_g + exact moduleTensorMap_epi S.g L + +instance moduleTensorRightFunctor_additive (L : LineBundle X) : + (moduleTensorRightFunctor L.sheaf).Additive where + map_add {M N} {f g} := by + apply sub_eq_zero.mp + apply PiExponent.CoherentTwist.eq_zero_of_local + intro x + obtain ⟨U, hx, ⟨e⟩⟩ := L.locallyRankOne x + refine ⟨U, hx, ?_⟩ + let F := Scheme.Modules.restrictFunctor U.ι + let T := moduleTensorRightFunctor L.sheaf + let E := moduleTensorRestrictFrame U L.sheaf e + have h (a : M ⟶ N) : F.map (T.map a) = + (E.app M).hom ≫ F.map a ≫ (E.app N).inv := by + apply (cancel_mono (E.app N).hom).mp + simp only [Category.assoc, Iso.inv_hom_id, Category.comp_id] + exact E.hom.naturality a + change F.map (T.map (f + g) - (T.map f + T.map g)) = 0 + rw [F.map_sub, F.map_add, h (f+g), h f, h g, F.map_add, + Preadditive.add_comp, Preadditive.comp_add, sub_self] + +def moduleTwistFunctor (L : LineBundle X) : ℕ → X.Modules ⥤ X.Modules + | 0 => 𝟭 _ + | n + 1 => moduleTwistFunctor L n ⋙ moduleTensorRightFunctor L.sheaf + +instance moduleTwistFunctor_additive (L : LineBundle X) (n : ℕ) : + (moduleTwistFunctor L n).Additive := by + induction n with + | zero => change (𝟭 X.Modules).Additive; infer_instance + | succ n ih => + change (moduleTwistFunctor L n ⋙ moduleTensorRightFunctor L.sheaf).Additive + infer_instance + +theorem moduleTwistFunctor_add (L : LineBundle X) (m n : ℕ) : + moduleTwistFunctor L (m+n) = moduleTwistFunctor L m ⋙ moduleTwistFunctor L n := by + induction n with + | zero => + change moduleTwistFunctor L m = moduleTwistFunctor L m ⋙ 𝟭 _ + rfl + | succ n ih => + change moduleTwistFunctor L (m+n) ⋙ moduleTensorRightFunctor L.sheaf = + moduleTwistFunctor L m ⋙ (moduleTwistFunctor L n ⋙ moduleTensorRightFunctor L.sheaf) + rw [ih] + rfl + +theorem moduleTwistFunctor_shortExact (L : LineBundle X) (n : ℕ) + (S : ShortComplex X.Modules) (hS : S.ShortExact) : + (S.map (moduleTwistFunctor L n)).ShortExact := by + induction n with + | zero => exact hS + | succ n ih => + change ((S.map (moduleTwistFunctor L n)).map + (moduleTensorRightFunctor L.sheaf)).ShortExact + exact moduleTensorRightFunctor_shortExact L (S.map (moduleTwistFunctor L n)) ih + +def moduleTensorComm (M N : X.Modules) : moduleTensor X M N ≅ moduleTensor X N M := by + let : MonoidalCategory (PresheafOfModules X.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf) + let : SymmetricCategory (PresheafOfModules X.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.symmetricCategory (R := X.presheaf) + exact (PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).mapIso (β_ M.val N.val) + +def moduleTwistUnitIso (L : LineBundle X) : ∀ n : ℕ, + (moduleTwistFunctor L n).obj (structureSheaf X) ≅ modulePow X L.sheaf n + | 0 => Iso.refl _ + | n+1 => moduleTensorIso (moduleTwistUnitIso L n) (Iso.refl L.sheaf) ≪≫ + moduleTensorComm (modulePow X L.sheaf n) L.sheaf + +end PiExponentSeshadri.Geometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/Comparison.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/Comparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..6a27291752006033eb3a1fff501c9a453210f8ae --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/Comparison.lean @@ -0,0 +1,59 @@ +import Mathlib.Tactic.Linarith +import Mathlib.Topology.Instances.Real.Lemmas + +namespace OAI + +namespace PiExponent + +open Filter Topology + +theorem determinant_bounds_inconsistent + (nu theta x b ear ean err collision d : ℝ) + (hnu : 1 < nu) (hb0 : 0 ≤ b) (hb : b ≤ theta) + (hgap : ear + ean + err < nu * (x - theta) - (1 - theta)) + (hcollision : 1 + ear + ean + err < collision) + (hlower : -(1 - b) - ear ≤ d) + (hupper : d ≤ ean + err + max (-collision) (-nu * (x - b))) : False := by + have hfirst : ean + err - collision < -(1 - b) - ear := by linarith + have hmono : + nu * (x - theta) - (1 - theta) ≤ nu * (x - b) - (1 - b) := by + nlinarith + have hsecond : ean + err - nu * (x - b) < -(1 - b) - ear := by linarith + rcases le_total (-collision) (-nu * (x - b)) with h | h + · rw [max_eq_right h] at hupper + linarith + · rw [max_eq_left h] at hupper + linarith + +theorem asymptotic_determinant_bounds_inconsistent + (nu theta x ear ean collisionLimit : ℝ) + (b d err collision : ℕ → ℝ) + (hnu : 1 < nu) + (hgap : ear + ean < nu * (x - theta) - (1 - theta)) + (hcollision : 1 + ear + ean < collisionLimit) + (herr : Tendsto err atTop (𝓝 0)) + (hcol : Tendsto collision atTop (𝓝 collisionLimit)) + (hb0 : ∀ᶠ n in atTop, 0 ≤ b n) + (hb : ∀ᶠ n in atTop, b n ≤ theta) + (hlower : ∀ᶠ n in atTop, -(1 - b n) - ear ≤ d n) + (hupper : ∀ᶠ n in atTop, + d n ≤ ean + err n + max (-collision n) (-nu * (x - b n))) : False := by + have hsum : Tendsto (fun n => ear + ean + err n) atTop (𝓝 (ear + ean + 0)) := + tendsto_const_nhds.add herr + have hsmall : ∀ᶠ n in atTop, + ear + ean + err n < nu * (x - theta) - (1 - theta) := + hsum.eventually (Iio_mem_nhds (by simpa using hgap)) + have hdiff : Tendsto (fun n => collision n - (1 + ear + ean + err n)) + atTop (𝓝 (collisionLimit - (1 + ear + ean + 0))) := + hcol.sub (tendsto_const_nhds.add herr) + have hlarge : ∀ᶠ n in atTop, 0 < collision n - (1 + ear + ean + err n) := + hdiff.eventually (Ioi_mem_nhds (by linarith)) + have hfalse : ∀ᶠ n : ℕ in atTop, False := by + filter_upwards [hsmall, hlarge, hb0, hb, hlower, hupper] with n hs hc h0 ht hl hu + exact determinant_bounds_inconsistent nu theta x (b n) ear ean (err n) + (collision n) (d n) hnu h0 ht hs (by linarith) hl hu + exact hfalse.exists.elim fun _ h => h + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/CompositePullbackFrame.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/CompositePullbackFrame.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c8e85b863ddadf13f597f469469143ea5ef1b2c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/CompositePullbackFrame.lean @@ -0,0 +1,88 @@ +import OAI.NumberTheory.PiExponent.Ampleness.ClosedAmpleRestriction +import OAI.NumberTheory.PiExponent.Polynomials.PullbackFrameCoefficient + +namespace OAI + +noncomputable section +namespace PiExponent.CompositePullbackFrame +open AlgebraicGeometry CategoryTheory +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +variable {X Y Z : Scheme.{0}} + +private theorem mapIso_trans_inv_comp {C D : Type*} [Category C] [Category D] + (F : C ⥤ D) {A B T : C} {U : D} (e : A ≅ B) (u : F.obj B ≅ U) + (s : A ⟶ T) : + (F.mapIso e ≪≫ u).inv ≫ F.map s = u.inv ≫ F.map (e.inv ≫ s) := by + simp only [Iso.trans_inv, Functor.mapIso_inv, Functor.map_comp, Category.assoc] + +private theorem map_comp_iso_inv {C D : Type*} [Category C] [Category D] + (F : C ⥤ D) {A B T : C} {U : D} (u : U ⟶ F.obj A) + (s : A ⟶ B) (e : B ≅ T) : + (u ≫ F.map (s ≫ e.hom)) ≫ (F.mapIso e).inv = u ≫ F.map s := by + simp only [Functor.mapIso_inv, Category.assoc, ← Functor.map_comp, + Iso.hom_inv_id, Category.comp_id] + +theorem exists_frame (f : X ⟶ Y) (φ : Z ⟶ X) [IsOpenImmersion φ] + (V : Y.Opens) (g : Z ⟶ V.toScheme) (h : φ ≫ f = g ≫ V.ι) + {M : Y.Modules} (e : M.restrict V.ι ≅ O V.toScheme) : + ∃ E : ((Scheme.Modules.pullback f).obj M).restrict φ ≅ O Z, + ∀ s : O Y ⟶ M, + coefficient E (restrictSection φ (pullbackSection f s)) = + g.appTop (coefficient e (restrictSection V.ι s)) := by + let F := Scheme.Modules.pullback f ⋙ Scheme.Modules.restrictFunctor φ + let G := Scheme.Modules.restrictFunctor V.ι ⋙ Scheme.Modules.pullback g + let v : F ≅ G := + Functor.isoWhiskerLeft (Scheme.Modules.pullback f) + (Scheme.Modules.restrictFunctorIsoPullback φ) ≪≫ + Scheme.Modules.pullbackComp φ f ≪≫ + Scheme.Modules.pullbackCongr h ≪≫ + (Scheme.Modules.pullbackComp g V.ι).symm ≪≫ + Functor.isoWhiskerRight (Scheme.Modules.restrictFunctorIsoPullback V.ι).symm + (Scheme.Modules.pullback g) + let uF : F.obj (O Y) ≅ O Z := + (Scheme.Modules.restrictFunctor φ).mapIso (pullbackUnitIso f) ≪≫ + Scheme.Modules.restrictUnitIso φ + let uG : G.obj (O Y) ≅ O Z := + (Scheme.Modules.pullback g).mapIso (Scheme.Modules.restrictUnitIso V.ι) ≪≫ + pullbackUnitIso g + obtain ⟨E, hE⟩ := PullbackFrameCoefficient.exists_frame_natIso_all F G v uF uG + (pullbackFrame g e) + refine ⟨E, fun s => ?_⟩ + have hs : coefficient E (restrictSection φ (pullbackSection f s)) = + coefficient (pullbackFrame g e) (pullbackSection g (restrictSection V.ι s)) := by + simp only [restrictSection, pullbackSection] + exact (congrArg (coefficient E) + (mapIso_trans_inv_comp (Scheme.Modules.restrictFunctor φ) + (pullbackUnitIso f) (Scheme.Modules.restrictUnitIso φ) + ((Scheme.Modules.pullback f).map s)).symm).trans + ((hE s).trans (congrArg (coefficient (pullbackFrame g e)) + (mapIso_trans_inv_comp (Scheme.Modules.pullback g) + (Scheme.Modules.restrictUnitIso V.ι) (pullbackUnitIso g) + ((Scheme.Modules.restrictFunctor V.ι).map s)))) + rw [hs, coefficient_pullback] + +theorem exists_power_frame (L : LineBundle Y) (f : X ⟶ Y) + (φ : Z ⟶ X) [IsOpenImmersion φ] (V : Y.Opens) + (g : Z ⟶ V.toScheme) (h : φ ≫ f = g ≫ V.ι) (n : ℕ) + (e : (modulePow Y L.sheaf n).restrict V.ι ≅ O V.toScheme) : + ∃ E : (modulePow X (L.pullback f).sheaf n).restrict φ ≅ O Z, + ∀ s : O Y ⟶ modulePow Y L.sheaf n, + coefficient E (restrictSection φ (pullbackPowerSection L f n s)) = + g.appTop (coefficient e (restrictSection V.ι s)) := by + obtain ⟨E, hE⟩ := exists_frame f φ V g h e + refine ⟨(Scheme.Modules.restrictFunctor φ).mapIso + (PiExponentSeshadri.PullbackTensor.powIso f L n).symm ≪≫ E, fun s => ?_⟩ + erw [coefficient_transport] + have hs : restrictSection φ (pullbackPowerSection L f n s) ≫ + ((Scheme.Modules.restrictFunctor φ).mapIso (PiExponentSeshadri.PullbackTensor.powIso f L n).symm).hom = + restrictSection φ (pullbackSection f s) := by + simp only [restrictSection, pullbackPowerSection, Functor.mapIso_hom, Iso.symm_hom] + exact map_comp_iso_inv (Scheme.Modules.restrictFunctor φ) + (Scheme.Modules.restrictUnitIso φ).inv (pullbackSection f s) + (PiExponentSeshadri.PullbackTensor.powIso f L n) + exact (congrArg (coefficient E) hs).trans (hE s) + +end PiExponent.CompositePullbackFrame +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ConstantPullbackDegree.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ConstantPullbackDegree.lean new file mode 100644 index 0000000000000000000000000000000000000000..2419881b8dc80ee0414d817f5eecd466bef1cbdc --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ConstantPullbackDegree.lean @@ -0,0 +1,70 @@ +import OAI.NumberTheory.PiExponent.Approximation.LinePullback +import OAI.NumberTheory.PiExponent.Approximation.NumericalMarginRestriction +import OAI.NumberTheory.PiExponent.Approximation.SectionPullback + +namespace OAI + +namespace PiExponent.ConstantPullbackDegree +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +variable {X Y : Scheme.{0}} + +def pullbackFrame_of_range_subset (K : LineBundle Y) (g : X ⟶ Y) + (U : Y.Opens) (h : Set.range g ⊆ (U : Set Y)) + (e : K.sheaf.restrict U.ι ≅ structureSheaf U.toScheme) : + (K.pullback g).sheaf ≅ structureSheaf X := by + have hr : Set.range g ⊆ Set.range U.ι := by + rw [Scheme.Opens.range_ι] + exact h + let l := IsOpenImmersion.lift U.ι g hr + have hl : l ≫ U.ι = g := IsOpenImmersion.lift_fac U.ι g hr + exact (Scheme.Modules.pullbackCongr hl.symm).app K.sheaf ≪≫ + ((Scheme.Modules.pullbackComp l U.ι).app K.sheaf).symm ≪≫ + (Scheme.Modules.pullback l).mapIso ((Scheme.Modules.restrictFunctorIsoPullback U.ι).app + K.sheaf).symm ≪≫ (Scheme.Modules.pullback l).mapIso e ≪≫ pullbackUnitIso l + +def constantPullbackIso (K : LineBundle Y) (g : X ⟶ Y) (y : Y) + (hg : Set.range g ⊆ ({y} : Set Y)) : + (K.pullback g).sheaf ≅ structureSheaf X := by + apply Classical.choice + obtain ⟨U, hy, ⟨e⟩⟩ := K.locallyRankOne y + refine ⟨pullbackFrame_of_range_subset K g U ?_ e⟩ + intro z hz + have hz' : z = y := hg hz + exact hz'.symm ▸ hy + +theorem euler_difference_eq_zero (p : X ⟶ Spec (CommRingCat.of ℂ)) + (K : LineBundle Y) (g : X ⟶ Y) (y : Y) + (hg : Set.range g ⊆ ({y} : Set Y)) (d : ℕ) : + eulerCharacteristic p d (K.pullback g).sheaf - + eulerCharacteristic p d (structureSheaf X) = 0 := by + rw [eulerCharacteristic_iso p (constantPullbackIso K g y hg) d] + exact sub_self _ + +theorem euler_difference_eq_zero_of_constant (p : X ⟶ Spec (CommRingCat.of ℂ)) + (K : LineBundle Y) (g : X ⟶ Y) (y : Y) + (hg : ∀ x, g x = y) (d : ℕ) : + eulerCharacteristic p d (K.pullback g).sheaf - + eulerCharacteristic p d (structureSheaf X) = 0 := + euler_difference_eq_zero p K g y (by rintro z ⟨x,rfl⟩; exact hg x) d + +theorem curveDegree_eq_zero_of_contracted + (p : X ⟶ Spec (CommRingCat.of ℂ)) (K : LineBundle Y) + (g : X ⟶ Y) (C : NumericalAmpleness.IntegralCurve X) (y : Y) + (hg : Set.range (C.embedding ≫ g) ⊆ ({y} : Set Y)) : + NumericalAmpleness.curveDegree p (K.pullback g) C = 0 := by + have he := eulerCharacteristic_iso (C.embedding ≫ p) + ((Scheme.Modules.pullbackComp C.embedding g).app K.sheaf) 1 + simp only [CategoryTheory.Functor.comp_obj] at he + unfold NumericalAmpleness.curveDegree + change eulerCharacteristic (C.embedding ≫ p) 1 + ((Scheme.Modules.pullback C.embedding).obj ((Scheme.Modules.pullback g).obj K.sheaf)) - + eulerCharacteristic (C.embedding ≫ p) 1 (structureSheaf C.scheme) = 0 + rw [he] + exact euler_difference_eq_zero (C.embedding ≫ p) K (C.embedding ≫ g) y hg 1 + +end +end PiExponent.ConstantPullbackDegree + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/CoordinateFrameIdentification.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/CoordinateFrameIdentification.lean new file mode 100644 index 0000000000000000000000000000000000000000..274c06dabd54c76d9780ab638b63675df9e805c3 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/CoordinateFrameIdentification.lean @@ -0,0 +1,44 @@ +import OAI.NumberTheory.PiExponent.Geometry.LineBundleFrameCocycle + +namespace OAI + +namespace PiExponentSeshadri.LineBundleFrameCocycle +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +variable {X : Scheme} {ι : Type} {U : ι → X.Opens} + +lemma cocycle_ext {c d : LineBundleGluing.Cocycle U} + (h : c.transition = d.transition) : c = d := by + cases c + cases d + cases h + rfl + +def isoOfCoordinateCoefficients (M N : X.Modules) + (e : ∀ i, M.restrict (U i).ι ≅ O (U i).toScheme) + (f : ∀ i, N.restrict (U i).ι ≅ O (U i).toScheme) + (s : ι → (O X ⟶ M)) (t : ι → (O X ⟶ N)) + (hnorm : ∀ i, coefficient (e i) (restrictSection (U i).ι (s i)) = 1) + (hcoeff : ∀ i j, coefficient (f i) (restrictSection (U i).ι (t j)) = + coefficient (e i) (restrictSection (U i).ι (s j))) + (hcover : ⊤ ≤ ⨆ i, U i) : M ≅ N := by + have hnorm' (i : ι) : coefficient (f i) (restrictSection (U i).ι (t i)) = 1 := + (hcoeff i i).trans (hnorm i) + have hc : ofFrames M U e = ofFrames N U f := by + apply cocycle_ext + funext i j W hi hj + apply Units.ext + change W.topIso.hom + (frameChange (restrictOpenFrame hj (e j)) (restrictOpenFrame hi (e i)) : Γ(W.toScheme,⊤)) = + W.topIso.hom + (frameChange (restrictOpenFrame hj (f j)) (restrictOpenFrame hi (f i)) : Γ(W.toScheme,⊤)) + rw [frameChange_restrictOpenFrame hj hi (e j) (e i) (s j) (hnorm j), + frameChange_restrictOpenFrame hj hi (f j) (f i) (t j) (hnorm' j), hcoeff i j] + exact isoSheaf M U e hcover ≪≫ eqToIso (congrArg LineBundleGluing.sheaf hc) ≪≫ + (isoSheaf N U f hcover).symm + +end +end PiExponentSeshadri.LineBundleFrameCocycle + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/CoordinateSliceComparison.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/CoordinateSliceComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..043a0918d8389637de422aafcd1d5dfdf9aa0335 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/CoordinateSliceComparison.lean @@ -0,0 +1,176 @@ +import OAI.NumberTheory.PiExponent.LocalAlgebra.CoordinateFiniteSlice +import OAI.NumberTheory.PiExponent.LocalAlgebra.CoordinateSliceLength +import OAI.NumberTheory.PiExponent.LocalAlgebra.CoordinateTranscendenceBasis +import OAI.NumberTheory.PiExponent.LocalAlgebra.PointLengthEquiv + +namespace OAI + +noncomputable section +namespace PiExponent.CoordinateSliceComparison + +open PiExponentJets.PolynomialLocalResidueResolution +open CoordinateFiniteSlice + +variable {K ι : Type*} [Field K] [Fintype ι] + +abbrev primeLength {R : Type*} [CommRing R] (Q : Ideal R) [Q.IsPrime] (I : Ideal R) : ℕ∞ := + Module.length (Localization.AtPrime Q) + (Localization.AtPrime Q ⧸ I.map (algebraMap R (Localization.AtPrime Q))) + +omit [Fintype ι] in +theorem splitBasis (Q : Ideal (MvPolynomial ι K)) [Q.IsPrime] (A : Finset ι) + (hB : IsTranscendenceBasis K (fun i : {i // i ∉ A} => residueCoordinates Q i.val)) : + IsTranscendenceBasis K + (splitResidueBeta K (Fin A.card) {i // i ∉ A} (splitPrime Q A)) := + complementary_transcendenceBasis Q A hB + +omit [Fintype ι] in +theorem map_residueSlice_eq_enumeratedSliceMap + (Q : Ideal (MvPolynomial ι K)) [Q.IsPrime] (A : Finset ι) : + (MvPolynomial.map (residueEquiv Q A).symm.toRingHom).comp + ((CoordinateSliceLength.residueSlice K (Fin A.card) {i // i ∉ A} (splitPrime Q A)).comp + (coordinateRenaming (K := K) A).toRingHom) = + (WeightedSliceDegree.enumeratedSliceMap (C := K) A (residueCoordinates Q)).toRingHom := by + apply MvPolynomial.ringHom_ext + · intro c + simp [CoordinateSliceLength.residueSlice, coordinateRenaming, + WeightedSliceDegree.enumeratedSliceMap, WeightedSliceDegree.sliceMap, + MvPolynomial.algebraMap_eq, AlgEquiv.commutes] + · intro i + obtain ⟨j, rfl⟩ := (coordinateEquiv A).surjective i + cases j with + | inl j => + simp [RingHom.comp_apply, CoordinateSliceLength.residueSlice] + | inr j => + change MvPolynomial.map (residueEquiv Q A).symm.toRingHom + (CoordinateSliceLength.residueSlice K (Fin A.card) {i // i ∉ A} (splitPrime Q A) + (coordinateRenaming (K := K) A (MvPolynomial.X j.val))) = + WeightedSliceDegree.enumeratedSliceMap (C := K) A (residueCoordinates Q) (MvPolynomial.X j.val) + rw [coordinateRenaming_X_inr] + rw [show CoordinateSliceLength.residueSlice K (Fin A.card) {i // i ∉ A} (splitPrime Q A) + (MvPolynomial.X (Sum.inr j)) = + MvPolynomial.C (splitResidueBeta K (Fin A.card) {i // i ∉ A} (splitPrime Q A) j) by + simp [CoordinateSliceLength.residueSlice]] + rw [MvPolynomial.map_C, enumeratedSliceMap_X_inr] + exact congrArg MvPolynomial.C (residueEquiv_symm_coordinate_inr Q A j) + +omit [Fintype ι] in +theorem map_splitPoint_eq (Q : Ideal (MvPolynomial ι K)) [Q.IsPrime] (A : Finset ι) : + (fun i => (residueEquiv Q A).symm.toRingEquiv + (CoordinateSliceLength.slicePoint K (Fin A.card) {i // i ∉ A} (splitPrime Q A) i)) = + slicePoint Q A := by + funext i + exact residueEquiv_symm_coordinate_inl Q A i + +omit [Fintype ι] in +theorem map_slice_ideal (Q I : Ideal (MvPolynomial ι K)) [Q.IsPrime] (A : Finset ι) : + ((I.map (coordinateRenaming (K := K) A).toRingHom).map + (CoordinateSliceLength.residueSlice K (Fin A.card) {i // i ∉ A} (splitPrime Q A))).map + (MvPolynomial.map (residueEquiv Q A).symm.toRingHom) = + I.map (WeightedSliceDegree.enumeratedSliceMap (C := K) A (residueCoordinates Q)).toRingHom := by + rw [Ideal.map_map, Ideal.map_map] + congr 1 + exact map_residueSlice_eq_enumeratedSliceMap Q A + +theorem length_eq_enumeratedSlice [CharZero K] + (Q I : Ideal (MvPolynomial ι K)) [Q.IsPrime] (A : Finset ι) + (hB : IsTranscendenceBasis K (fun i : {i // i ∉ A} => residueCoordinates Q i.val)) : + primeLength Q I = primeLength (WeightedBezout.pointIdeal (slicePoint Q A)) + (I.map (WeightedSliceDegree.enumeratedSliceMap (C := K) A (residueCoordinates Q)).toRingHom) := by + have h₁ := PiExponentJets.W22.localized_quotient_length_eq_of_ringEquiv + (coordinateRenaming (K := K) A).toRingEquiv Q (splitPrime Q A) + (PiExponentSiegel.W23.atPrimeImage_comap (coordinateRenaming (K := K) A).toRingEquiv Q) I + have h₂ := CoordinateSliceLength.length_eq_residueSlice K (Fin A.card) {i // i ∉ A} + (splitPrime Q A) (splitBasis Q A hB) (I.map (coordinateRenaming (K := K) A).toRingHom) + have h₃ := PointLengthEquiv.pointLocal_quotient_length (residueEquiv Q A).symm.toRingEquiv + (CoordinateSliceLength.slicePoint K (Fin A.card) {i // i ∉ A} (splitPrime Q A)) + ((I.map (coordinateRenaming (K := K) A).toRingHom).map + (CoordinateSliceLength.residueSlice K (Fin A.card) {i // i ∉ A} (splitPrime Q A))) + rw [map_slice_ideal, map_splitPoint_eq] at h₃ + exact h₁.trans (h₂.trans h₃) + +theorem slicePoint_mem_minimalPrimes + (Q I : Ideal (MvPolynomial ι K)) [Q.IsPrime] (A : Finset ι) + (hB : IsTranscendenceBasis K (fun i : {i // i ∉ A} => residueCoordinates Q i.val)) + (hQ : Q ∈ I.minimalPrimes) : + WeightedBezout.pointIdeal (slicePoint Q A) ∈ + (I.map (WeightedSliceDegree.enumeratedSliceMap (C := K) A (residueCoordinates Q)).toRingHom).minimalPrimes := by + have h₁ := splitPrime_mem_minimalPrimes Q I A hQ + have h₂ := CoordinateSliceLength.slicePoint_mem_minimalPrimes K (Fin A.card) {i // i ∉ A} + (splitPrime Q A) (splitBasis Q A hB) (I.map (coordinateRenaming (K := K) A).toRingHom) h₁ + have h₃ := PointLengthEquiv.point_mem_minimalPrimes_map (residueEquiv Q A).symm.toRingEquiv + (CoordinateSliceLength.slicePoint K (Fin A.card) {i // i ∉ A} (splitPrime Q A)) + ((I.map (coordinateRenaming (K := K) A).toRingHom).map + (CoordinateSliceLength.residueSlice K (Fin A.card) {i // i ∉ A} (splitPrime Q A))) h₂ + rw [map_slice_ideal, map_splitPoint_eq] at h₃ + exact h₃ + +theorem length_eq_enumeratedSlice_of_normalBasis [CharZero K] + (Q I : Ideal (MvPolynomial ι K)) [Q.IsPrime] (A : Finset ι) + (hA : NormalBasisRigidity.IsNormalBasis (K := Q.ResidueField) + (fun i => (polynomialTangent + (IsScalarTower.toAlgHom K (MvPolynomial ι K) Q.ResidueField) Q).mkQ + (Pi.basisFun Q.ResidueField ι i)) A) : + primeLength Q I = primeLength (WeightedBezout.pointIdeal (slicePoint Q A)) + (I.map (WeightedSliceDegree.enumeratedSliceMap (C := K) A (residueCoordinates Q)).toRingHom) := + length_eq_enumeratedSlice Q I A + (idealResidueNormalBasis_complement_isTranscendenceBasis Q A hA) + +theorem slicePoint_mem_minimalPrimes_of_normalBasis [CharZero K] + (Q I : Ideal (MvPolynomial ι K)) [Q.IsPrime] (A : Finset ι) + (hA : NormalBasisRigidity.IsNormalBasis (K := Q.ResidueField) + (fun i => (polynomialTangent + (IsScalarTower.toAlgHom K (MvPolynomial ι K) Q.ResidueField) Q).mkQ + (Pi.basisFun Q.ResidueField ι i)) A) + (hQ : Q ∈ I.minimalPrimes) : + WeightedBezout.pointIdeal (slicePoint Q A) ∈ + (I.map (WeightedSliceDegree.enumeratedSliceMap (C := K) A (residueCoordinates Q)).toRingHom).minimalPrimes := + slicePoint_mem_minimalPrimes Q I A + (idealResidueNormalBasis_complement_isTranscendenceBasis Q A hA) hQ + +omit [Fintype ι] in +theorem map_span_sliceFamily + (Q : Ideal (MvPolynomial ι K)) [Q.IsPrime] (A : Finset ι) + {J : Type*} (f : J → MvPolynomial ι K) : + (Ideal.span (Set.range f)).map + (WeightedSliceDegree.enumeratedSliceMap (C := K) A (residueCoordinates Q)).toRingHom = + Ideal.span (Set.range (fun j => + WeightedSliceDegree.enumeratedSliceMap (C := K) A (residueCoordinates Q) (f j))) := by + rw [Ideal.map_span, ← Set.range_comp] + rfl + +theorem length_eq_sliceFamily_of_normalBasis [CharZero K] + (Q : Ideal (MvPolynomial ι K)) [Q.IsPrime] (A : Finset ι) + (hA : NormalBasisRigidity.IsNormalBasis (K := Q.ResidueField) + (fun i => (polynomialTangent + (IsScalarTower.toAlgHom K (MvPolynomial ι K) Q.ResidueField) Q).mkQ + (Pi.basisFun Q.ResidueField ι i)) A) + {J : Type*} (f : J → MvPolynomial ι K) : + primeLength Q (Ideal.span (Set.range f)) = + primeLength (WeightedBezout.pointIdeal (slicePoint Q A)) + (Ideal.span (Set.range (fun j => + WeightedSliceDegree.enumeratedSliceMap (C := K) A (residueCoordinates Q) (f j)))) := by + have h := length_eq_enumeratedSlice_of_normalBasis Q (Ideal.span (Set.range f)) A hA + rw [map_span_sliceFamily] at h + exact h + +theorem sliceFamily_mem_minimalPrimes_of_normalBasis [CharZero K] + (Q : Ideal (MvPolynomial ι K)) [Q.IsPrime] (A : Finset ι) + (hA : NormalBasisRigidity.IsNormalBasis (K := Q.ResidueField) + (fun i => (polynomialTangent + (IsScalarTower.toAlgHom K (MvPolynomial ι K) Q.ResidueField) Q).mkQ + (Pi.basisFun Q.ResidueField ι i)) A) + {J : Type*} (f : J → MvPolynomial ι K) + (hQ : Q ∈ (Ideal.span (Set.range f)).minimalPrimes) : + WeightedBezout.pointIdeal (slicePoint Q A) ∈ + (Ideal.span (Set.range (fun j => + WeightedSliceDegree.enumeratedSliceMap (C := K) A (residueCoordinates Q) (f j)))).minimalPrimes := by + have h := slicePoint_mem_minimalPrimes_of_normalBasis Q (Ideal.span (Set.range f)) A hA hQ + rw [map_span_sliceFamily] at h + exact h + +end PiExponent.CoordinateSliceComparison + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/DeterminantContradiction.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/DeterminantContradiction.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b46a6c8002c548105a8228def6e23a7f5375d79 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/DeterminantContradiction.lean @@ -0,0 +1,184 @@ +import Mathlib +import OAI.NumberTheory.PiExponent.Approximation.AdmissibleParameters +import OAI.NumberTheory.PiExponent.Approximation.Comparison +import OAI.NumberTheory.PiExponent.Approximation.MatrixArithmetic +import OAI.NumberTheory.PiExponent.Approximation.MatrixCounting +import OAI.NumberTheory.PiExponent.Statement + +namespace OAI + +open Filter +open scoped Topology + +namespace PiExponent.DeterminantContradiction + +noncomputable def collisionConstant : ℝ := Real.log 2 / 4 + +theorem collisionConstant_pos : 0 < collisionConstant := by + unfold collisionConstant + exact div_pos (Real.log_pos (by norm_num)) (by norm_num) + +abbrev FixedData (nu : ℝ) := AdmissibleParameters nu Arithmetic.lcmConstant collisionConstant + +noncomputable def finiteNumerators {nu : ℝ} (d : FixedData nu) : Fin d.m → ℤ := + fun i => d.p i.val + +noncomputable def finiteDenominators {nu : ℝ} (d : FixedData nu) : Fin d.m → ℕ := + fun i => d.q i.val + +theorem finiteDenominators_two_le {nu : ℝ} (d : FixedData nu) (i : Fin d.m) : + 2 ≤ finiteDenominators d i := (d.approximations i.val).1 + +theorem logWeights_eq {nu : ℝ} (d : FixedData nu) (i : Fin d.m) : + MatrixArithmetic.logWeights (finiteDenominators d) i = d.x (i.val + 1) := + (d.x_log i.val).symm + +abbrev Row {nu : ℝ} (d : FixedData nu) (H : ℝ) := + InterpolationMatrix.Row d.K d.v0 d.base.theta + (MatrixArithmetic.logWeights (finiteDenominators d)) H + +abbrev Column {nu : ℝ} (d : FixedData nu) (H : ℝ) := + InterpolationMatrix.Column d.w0 (MatrixArithmetic.logWeights (finiteDenominators d)) H + +noncomputable def actualMatrix {nu : ℝ} (d : FixedData nu) (H : ℝ) : + Matrix (Row d H) (Column d H) ℂ := + InterpolationMatrix.truncatedLogMatrix d.K d.w0 d.v0 d.base.theta + (MatrixArithmetic.logWeights (finiteDenominators d)) H + (MatrixArithmetic.rationalCenters (finiteNumerators d) (finiteDenominators d)) + (MatrixArithmetic.truncationOrders (finiteDenominators d) d.F0 d.v0) + +noncomputable def actualMinor {nu : ℝ} (d : FixedData nu) (H : ℝ) + (selection : Row d H → Column d H) : Matrix (Row d H) (Row d H) ℂ := + MatrixArithmetic.selectedMinor d.K d.w0 d.v0 d.base.theta d.F0 H + (finiteNumerators d) (finiteDenominators d) selection + +noncomputable def actualMean {nu : ℝ} (d : FixedData nu) (H : ℝ) : ℝ := + MatrixArithmetic.meanRowWeight d.K d.v0 d.base.theta (finiteDenominators d) H + +noncomputable def actualRowCount {nu : ℝ} (d : FixedData nu) (H : ℝ) : ℕ := + Fintype.card (Row d H) + +noncomputable def lowIndexCount {nu : ℝ} (d : FixedData nu) (H : ℝ) : ℕ := + (realWeightedSimplex (MatrixArithmetic.logWeights (finiteDenominators d)) + ((d.base.A : ℝ) * H)).card + +noncomputable def collisionRate {nu : ℝ} (d : FixedData nu) (H : ℝ) : ℝ := + collisionConstant * d.base.eta ^ 2 * (actualRowCount d H : ℝ) / + (H * (lowIndexCount d H : ℝ)) + +noncomputable def collisionLimit {nu : ℝ} (d : FixedData nu) : ℝ := + collisionConstant * + (d.base.eta ^ 2 * (d.K : ℝ) * (d.base.theta : ℝ) ^ d.m / + (((d.m : ℝ) + 1) * (d.v0 : ℝ) * (d.base.A : ℝ) ^ d.m)) + +theorem actual_minor_arithmetic_lower_bound {nu : ℝ} (d : FixedData nu) + (H : ℝ) (hH : 0 < H) (selection : Row d H → Column d H) + (hdet : (actualMinor d H selection).det ≠ 0) : + -(1 - actualMean d H) - d.arithmeticError ≤ + Real.log ‖(actualMinor d H selection).det‖ / + ((actualRowCount d H : ℝ) * H) := by + have hh := MatrixArithmetic.selectedMinor_arithmetic_lower_bound + (finiteNumerators d) (finiteDenominators d) (finiteDenominators_two_le d) + (Nat.zero_lt_of_lt d.K_pos) d.w0_pos d.v0_pos d.base.theta_pos d.F0_pos.le hH + d.wstar_pos (fun i => by rw [logWeights_eq]; exact d.wstar_lower i) selection hdet + simpa only [actualMinor, actualMean, actualRowCount, + AdmissibleParameters.arithmeticError, logWeights_eq] using hh + +theorem actualMean_bounds {nu : ℝ} (d : FixedData nu) (H : ℝ) (hH : 0 < H) : + 0 ≤ actualMean d H ∧ actualMean d H ≤ (d.base.theta : ℝ) := by + exact ⟨MatrixArithmetic.meanRowWeight_nonneg _ _ _ _ hH.le, + MatrixArithmetic.meanRowWeight_le_theta (finiteDenominators d) + (finiteDenominators_two_le d) (Nat.zero_lt_of_lt d.K_pos) + d.v0_pos d.base.theta_pos hH⟩ + +def GlobalInterpolationStatement : Prop := + ∀ nu : ℝ, 2 < nu → ∀ d : FixedData nu, + ∀ L : ℝ, ∃ H : ℝ, L ≤ H ∧ Function.Surjective (actualMatrix d H).mulVecLin + +def AnalyticAggregateStatement : Prop := + ∀ nu : ℝ, 2 < nu → ∀ d : FixedData nu, + ∃ error : ℝ → ℝ, Tendsto error atTop (𝓝 0) ∧ + ∀ᶠ H : ℝ in atTop, ∀ selection : Row d H → Column d H, + (actualMinor d H selection).det ≠ 0 → + Real.log ‖(actualMinor d H selection).det‖ / ((actualRowCount d H : ℝ) * H) ≤ + d.analyticError + error H + + max (-collisionRate d H) + (-nu * ((d.base.A : ℝ) * (1 - d.base.eta) - actualMean d H)) + +theorem tendsto_collisionRate {nu : ℝ} (d : FixedData nu) : + Tendsto (collisionRate d) atTop (𝓝 (collisionLimit d)) := by + have hv : 0 < d.v0 := by exact_mod_cast d.v0_pos + have ht : 0 < d.base.theta := by exact_mod_cast d.base.theta_pos + have hA : 0 < d.base.A := by exact_mod_cast d.base.A_pos + have hh := MatrixCounting.tendsto_collisionRatio d.K d.v0 d.base.theta d.base.A + (finiteDenominators d) hv ht hA (finiteDenominators_two_le d) + collisionConstant d.base.eta + have he : collisionConstant * d.base.eta ^ 2 * (d.K : ℝ) * + (d.base.theta : ℝ) ^ d.m / + (((d.m : ℝ) + 1) * (d.v0 : ℝ) * (d.base.A : ℝ) ^ d.m) = + collisionLimit d := by + unfold collisionLimit + ring + rw [he] at hh + exact hh + +theorem no_fixed_data_of_interpolation_and_analytic_aggregate + (hgeometry : GlobalInterpolationStatement) (hanalytic : AnalyticAggregateStatement) + (nu : ℝ) (hnu : 2 < nu) (d : FixedData nu) : False := by + classical + obtain ⟨error, herror, hupper⟩ := hanalytic nu hnu d + have hsum : Tendsto (fun H : ℝ => d.arithmeticError + d.analyticError + error H) + atTop (𝓝 (d.arithmeticError + d.analyticError + 0)) := + tendsto_const_nhds.add herror + have hsmall : ∀ᶠ H : ℝ in atTop, + d.arithmeticError + d.analyticError + error H < + nu * ((d.base.A : ℝ) * (1 - d.base.eta) - d.base.theta) - + (1 - d.base.theta) := + hsum.eventually (Iio_mem_nhds (by simpa using d.error_sum_lt_gap)) + have hdiff : Tendsto (fun H : ℝ => + collisionRate d H - (1 + d.arithmeticError + d.analyticError + error H)) + atTop (𝓝 (collisionLimit d - (1 + d.arithmeticError + d.analyticError + 0))) := + (tendsto_collisionRate d).sub (tendsto_const_nhds.add herror) + have hlarge : ∀ᶠ H : ℝ in atTop, + 0 < collisionRate d H - (1 + d.arithmeticError + d.analyticError + error H) := by + apply hdiff.eventually (Ioi_mem_nhds ?_) + have hh := d.collision_exceeds_error_sum + change 1 + d.arithmeticError + d.analyticError < collisionLimit d at hh + linarith + have hcontradiction : ∀ᶠ H : ℝ in atTop, + Function.Surjective (actualMatrix d H).mulVecLin → False := by + filter_upwards [hsmall, hlarge, hupper, + eventually_gt_atTop (0 : ℝ)] with H hsmall hlarge hupper hH + intro hsurj + obtain ⟨selection, _hselection, hdet⟩ := + InterpolationMatrix.exists_full_row_minor_of_surjective (actualMatrix d H) hsurj + have hdet' : (actualMinor d H selection).det ≠ 0 := hdet + have hlower := actual_minor_arithmetic_lower_bound d H hH selection hdet' + have hb := actualMean_bounds d H hH + exact determinant_bounds_inconsistent nu d.base.theta + ((d.base.A : ℝ) * (1 - d.base.eta)) (actualMean d H) + d.arithmeticError d.analyticError (error H) (collisionRate d H) + (Real.log ‖(actualMinor d H selection).det‖ / ((actualRowCount d H : ℝ) * H)) + (by linarith) hb.1 hb.2 hsmall (by linarith) hlower (hupper selection hdet') + obtain ⟨L, hL⟩ := Filter.eventually_atTop.mp hcontradiction + obtain ⟨H, hLH, hsurj⟩ := hgeometry nu hnu d L + exact hL H hLH hsurj + +theorem piEventualLowerBound_of_interpolation_and_analytic_aggregate + (hgeometry : GlobalInterpolationStatement) (hanalytic : AnalyticAggregateStatement) : + PiEventualLowerBound := by + intro nu hnu + by_contra h + push Not at h + have hbad : ∀ Q : ℕ, ∃ p : ℤ, ∃ q : ℕ, + Q ≤ q ∧ |Real.pi - (p : ℝ) / q| ≤ (q : ℝ) ^ (-nu) := by + intro Q + obtain ⟨p, q, hq, herr⟩ := h (max Q 2) (le_max_right _ _) + exact ⟨p, q, (le_max_left _ _).trans hq, herr.le⟩ + obtain ⟨d⟩ := exists_admissible_parameters nu Arithmetic.lcmConstant collisionConstant + hnu Arithmetic.lcmConstant_pos collisionConstant_pos hbad + exact no_fixed_data_of_interpolation_and_analytic_aggregate hgeometry hanalytic nu hnu d + +end PiExponent.DeterminantContradiction + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/Exponent.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/Exponent.lean new file mode 100644 index 0000000000000000000000000000000000000000..33af40186f6465906ae09a5a43d103635b195886 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/Exponent.lean @@ -0,0 +1,123 @@ +import OAI.NumberTheory.PiExponent.Statement + +namespace OAI + +namespace PiExponent + + theorem eventualLowerBound_iff_integer (x : ℝ) : + EventualLowerBound x ↔ IntegerEventualLowerBound x := by + unfold EventualLowerBound IntegerEventualLowerBound + constructor + · intro h ν hν + obtain ⟨Q, hQ, hb⟩ := h ν hν + refine ⟨Q, by exact_mod_cast hQ, ?_⟩ + intro p q hq + have hq0 : 0 ≤ q := le_trans (by omega) hq + have hnat : Q ≤ q.toNat := by omega + have heq : (q.toNat : ℝ) = (q : ℝ) := by + exact_mod_cast (Int.toNat_of_nonneg hq0) + simpa only [heq] using hb p q.toNat hnat + · intro h ν hν + obtain ⟨Q, hQ, hb⟩ := h ν hν + have hQ0 : 0 ≤ Q := by omega + refine ⟨Q.toNat, by omega, ?_⟩ + intro p q hq + have hqi : Q ≤ (q : ℤ) := by omega + simpa using hb p q hqi + +theorem finite_rat_den_le_abs_sub_lt_one (x : ℝ) (N : ℕ) : + {r : ℚ | r.den ≤ N ∧ |x - (r : ℝ)| < 1}.Finite := by + classical + let f : ℚ → ℤ × ℕ := fun r => (r.num, r.den) + have hinj : Function.Injective f := by + intro a b hab + have hp := Prod.mk.inj hab + rw [← Rat.num_div_den a, ← Rat.num_div_den b, hp.1, hp.2] + let t : Set (ℤ × ℕ) := ⋃ (q : ℕ) (_ : q ∈ Set.Icc 1 N), + Set.Icc ⌈(x - 1) * q⌉ ⌊(x + 1) * q⌋ ×ˢ {q} + have ht : t.Finite := + Set.Finite.biUnion (Set.finite_Icc _ _) fun q _ => + Set.Finite.prod (Set.finite_Icc _ _) (Set.finite_singleton _) + have hsub : f '' {r : ℚ | r.den ≤ N ∧ |x - (r : ℝ)| < 1} ⊆ t := by + rintro _ ⟨r, ⟨hrN, hr⟩, rfl⟩ + have hrden : (0 : ℝ) < r.den := Nat.cast_pos.mpr r.pos + have hrlow : x - 1 < (r : ℝ) := by linarith [(abs_lt.mp hr).2] + have hrhigh : (r : ℝ) < x + 1 := by linarith [(abs_lt.mp hr).1] + have hnlow : (x - 1) * r.den ≤ (r.num : ℝ) := by + rw [Rat.cast_def] at hrlow + exact ((lt_div_iff₀ hrden).mp hrlow).le + have hnhigh : (r.num : ℝ) ≤ (x + 1) * r.den := by + rw [Rat.cast_def] at hrhigh + exact ((div_lt_iff₀ hrden).mp hrhigh).le + simp only [t, Set.mem_iUnion] + refine ⟨r.den, ⟨r.pos, hrN⟩, ?_⟩ + exact ⟨⟨Int.ceil_le.mpr hnlow, Int.le_floor.mpr hnhigh⟩, rfl⟩ + exact (ht.subset hsub).of_finite_image hinj.injOn + +theorem two_mem_approximationExponents {x : ℝ} (hx : Irrational x) : + (2 : ℝ) ∈ ApproximationExponents x := by + refine ⟨by norm_num, ?_⟩ + have hi := Real.infinite_rat_abs_sub_lt_one_div_den_sq_of_irrational hx + have hf := finite_rat_den_le_abs_sub_lt_one x 1 + apply (hi.sdiff hf).mono + intro r hr + have hrden : 1 ≤ (r.den : ℝ) := by exact_mod_cast r.pos + have hrone : |x - (r : ℝ)| < 1 := + hr.1.trans_le (by + simpa only [div_one] using + one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 1) + (by nlinarith : (1 : ℝ) ≤ (r.den : ℝ)^2)) + have hr2 : 2 ≤ r.den := by + by_contra h + exact hr.2 ⟨by omega, hrone⟩ + refine ⟨hr2, abs_pos.mpr (sub_ne_zero.mpr (hx.ne_rat r)), ?_⟩ + simpa only [Set.mem_ofPred_eq, Real.rpow_neg (Nat.cast_nonneg r.den), + Real.rpow_two, one_div] using hr.1 + +theorem finite_goodRationalApproximations_of_eventualLowerBound {x ν : ℝ} + (hx : EventualLowerBound x) (hν : 2 < ν) : + (GoodRationalApproximations x ν).Finite := by + obtain ⟨Q, hQ, hb⟩ := hx ν hν + apply (finite_rat_den_le_abs_sub_lt_one x Q).subset + intro r hr + have hltQ : r.den < Q := by + by_contra h + have h := hb r.num r.den (by omega) + rw [← Rat.cast_def] at h + exact (not_lt_of_ge h) hr.2.2 + refine ⟨hltQ.le, hr.2.2.trans_le ?_⟩ + exact Real.rpow_le_one_of_one_le_of_nonpos + (by exact_mod_cast r.pos) (by linarith) + +theorem irrationalityExponent_eq_two_of_eventualLowerBound {x : ℝ} + (hi : Irrational x) (hx : EventualLowerBound x) : + irrationalityExponent x = 2 := by + have htwo := two_mem_approximationExponents hi + have hbound : ∀ ν ∈ ApproximationExponents x, ν ≤ 2 := by + intro ν hν + by_contra h + exact (finite_goodRationalApproximations_of_eventualLowerBound hx (by linarith)).not_infinite hν.2 + apply le_antisymm + · exact csSup_le ⟨2, htwo⟩ hbound + · exact le_csSup ⟨2, hbound⟩ htwo + +theorem pi_irrationalityExponent_eq_two_of_eventualLowerBound + (h : PiEventualLowerBound) : irrationalityExponent Real.pi = 2 := + irrationalityExponent_eq_two_of_eventualLowerBound irrational_pi h + +theorem eventualLowerBound_of_not_unbounded_approximations {x : ℝ} + (h : ∀ ν : ℝ, 2 < ν → + ¬ ∀ Q : ℕ, ∃ (p : ℤ) (q : ℕ), Q ≤ q ∧ + |x - (p : ℝ) / (q : ℝ)| ≤ (q : ℝ) ^ (-ν)) : + EventualLowerBound x := by + intro ν hν + have hbad := h ν hν + push Not at hbad + obtain ⟨Q, hQ⟩ := hbad + refine ⟨max Q 2, le_max_right _ _, ?_⟩ + intro p q hq + exact (hQ p q ((le_max_left Q 2).trans hq)).le + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FibreNormalRigidity.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FibreNormalRigidity.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e8f354ac4ba698c86cfb8c8a5bc55d8faa2a9dd --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FibreNormalRigidity.lean @@ -0,0 +1,83 @@ +import OAI.NumberTheory.PiExponent.LocalAlgebra.PrimeNormalRigidity + +namespace OAI + +noncomputable section +namespace PiExponent +open Module MvPolynomial NormalBasisRigidity + +variable {C ι : Type*} [Field C] [CharZero C] [IsAlgClosed C] + [Fintype ι] [LinearOrder ι] + +omit [LinearOrder ι] in +theorem coordinate_constant_of_unique_normal_basis + (Q : Ideal (MvPolynomial ι C)) [Q.IsPrime] + (hq : (polynomialTangent (polynomialResidueMap Q) Q).mkQ ≠ 0) + (hunique : ∀ A B : Finset ι, + IsNormalBasis (K := PolynomialResidueField Q) + (fun j => (polynomialTangent (polynomialResidueMap Q) Q).mkQ + (Pi.basisFun (PolynomialResidueField Q) ι j)) A → + IsNormalBasis (K := PolynomialResidueField Q) + (fun j => (polynomialTangent (polynomialResidueMap Q) Q).mkQ + (Pi.basisFun (PolynomialResidueField Q) ι j)) B → A = B) : + ∃ i : ι, ∃ c : C, X i - MvPolynomial.C c ∈ Q := by + let φ := polynomialResidueMap Q + let q := (polynomialTangent φ Q).mkQ + let b := Pi.basisFun (PolynomialResidueField Q) ι + have hex : ∃ i, q (b i) ≠ 0 := by + by_contra! h + apply hq + exact b.ext h + obtain ⟨i, hi⟩ := hex + obtain ⟨A, hiA, hA⟩ := exists_normalBasis_containing (fun j => q (b j)) + (polynomialNormal_span φ Q b) i hi + have hmand : ∀ B, IsNormalBasis (K := PolynomialResidueField Q) (fun j => q (b j)) B → i ∈ B := by + intro B hB + rw [← hunique A B hA hB] + exact hiA + have htangent : ∀ t ∈ polynomialTangent φ Q, t i = 0 := by + intro t ht + have hh := mandatory_coordinate_eq_zero b q (polynomialNormal_span φ Q b) + i hmand t ((Submodule.Quotient.mk_eq_zero _).mpr ht) + simpa only [b, Pi.basisFun_repr] using hh + have hD := differential_eq_zero_of_polynomialTangent φ Q + (polynomialResidueMap_eq_zero Q) i htangent + have : Algebra.EssFiniteType C (PolynomialResidueField Q) := + polynomialResidueField_essFiniteType Q + obtain ⟨c, hc⟩ := constant_of_differential_eq_zero (φ (X i)) hD + exact ⟨i, c, coordinate_sub_constant_mem_prime Q i c hc⟩ + +theorem coordinate_constant_of_normal_discrepancy_excluded + (Q : Ideal (MvPolynomial ι C)) [Q.IsPrime] + (hq : (polynomialTangent (polynomialResidueMap Q) Q).mkQ ≠ 0) + (hexclude : ∀ A B : Finset ι, + IsNormalBasis (K := PolynomialResidueField Q) + (fun j => (polynomialTangent (polynomialResidueMap Q) Q).mkQ + (Pi.basisFun (PolynomialResidueField Q) ι j)) A → + IsNormalBasis (K := PolynomialResidueField Q) + (fun j => (polynomialTangent (polynomialResidueMap Q) Q).mkQ + (Pi.basisFun (PolynomialResidueField Q) ι j)) B → + ∀ i, i ∈ A → i ∉ B → (∀ j, i < j → (j ∈ A ↔ j ∈ B)) → False) : + ∃ i : ι, ∃ c : C, X i - MvPolynomial.C c ∈ Q := by + apply coordinate_constant_of_unique_normal_basis Q hq + exact normalBasis_unique_of_discrepancy_excluded _ hexclude + +omit [CharZero C] [IsAlgClosed C] [Fintype ι] [LinearOrder ι] in + +theorem coordinate_constant_at_most_one_center {J : Type*} + (Q : Ideal (MvPolynomial ι C)) (centers : J → ι → C) + (i : ι) (c : C) (hc : X i - MvPolynomial.C c ∈ Q) + (hinj : Function.Injective (fun j => centers j i)) + (j k : J) + (hj : ∀ p ∈ Q, MvPolynomial.eval (centers j) p = 0) + (hk : ∀ p ∈ Q, MvPolynomial.eval (centers k) p = 0) : j = k := by + have hjc := hj _ hc + have hkc := hk _ hc + simp only [eval_sub, eval_X, eval_C, sub_eq_zero] at hjc hkc + exact hinj (hjc.trans hkc.symm) + +end PiExponent + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FibreWeightSeparation.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FibreWeightSeparation.lean new file mode 100644 index 0000000000000000000000000000000000000000..7215cf71aed0095875b8f9ef5e4b9b74c0852e69 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FibreWeightSeparation.lean @@ -0,0 +1,30 @@ +import OAI.NumberTheory.PiExponent.Jets.NormalBasisProducts + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace PiExponent.FibreWeightSeparation + +theorem positive_indices {m : ℕ} (w cost : Fin (m+1) → ℝ) (C : ℝ) + (hsep : ∀ A B : Finset (Fin (m+1)), A.card = B.card → + ∀ i, i ≠ 0 → i ∈ A → i ∉ B → + (∀ j, i < j → (j ∈ A ↔ j ∈ B)) → + C * (∏ j ∈ B, cost j) < ∏ j ∈ A, w j) : + ∀ A B : Finset (Fin m), A.card = B.card → + ∀ i, i ∈ A → i ∉ B → (∀ j, i < j → (j ∈ A ↔ j ∈ B)) → + C * (∏ j ∈ B, cost j.succ) < ∏ j ∈ A, w j.succ := by + intro A B hcard i hiA hiB hlarge + have h := hsep (A.map (Fin.succEmb m)) (B.map (Fin.succEmb m)) + (by simpa only [Finset.card_map] using hcard) i.succ (Fin.succ_ne_zero i) + (by simpa using hiA) (by simpa using hiB) (by + intro j hij + cases j using Fin.cases with + | zero => exact (not_lt_of_ge (Fin.zero_le _) hij).elim + | succ j => simpa using hlarge j (Fin.succ_lt_succ_iff.mp hij)) + simpa only [Finset.prod_map, Fin.coe_succEmb] using h + +end PiExponent.FibreWeightSeparation +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FormalMatrixBridge.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FormalMatrixBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..43ebdbb799fb91e6605f389b3090546aa4b98fa3 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FormalMatrixBridge.lean @@ -0,0 +1,118 @@ +import OAI.NumberTheory.PiExponent.Analysis.FormalLogTruncation +import OAI.NumberTheory.PiExponent.Jets.AuxiliaryJetMap +import OAI.NumberTheory.PiExponent.Polynomials.NestedPolynomialSwap + +namespace OAI + +noncomputable section + +namespace PiExponent.FormalMatrixBridge + +open MvPowerSeries +open scoped BigOperators + +def flatten (m : ℕ) : + MvPolynomial (Fin m) (Polynomial ℂ) →ₐ[ℂ] MvPowerSeries (Fin (m+1)) ℂ := + (MvPolynomial.coeToMvPowerSeries.algHom ℂ).comp + ((MvPolynomial.finSuccEquiv ℂ m).symm.toAlgHom.comp + (nestedPolynomialSwap ℂ m).toAlgHom) + +@[simp] theorem coeff_flatten {m : ℕ} + (p : MvPolynomial (Fin m) (Polynomial ℂ)) (d : Fin (m+1) →₀ ℕ) : + coeff d (flatten m p) = (p.coeff d.tail).coeff (d 0) := by + change ((MvPolynomial.finSuccEquiv ℂ m).symm (nestedPolynomialSwap ℂ m p)).coeff d = _ + rw [← Finsupp.cons_tail d, ← MvPolynomial.finSuccEquiv_coeff_coeff, + AlgEquiv.apply_symm_apply] + exact coeff_nestedPolynomialSwap p (d 0) d.tail + +@[simp] theorem flatten_C {m : ℕ} (p : Polynomial ℂ) : + flatten m (MvPolynomial.C p) = FormalLogJet.liftSeries m (p : PowerSeries ℂ) := by + classical + ext d + rw [coeff_flatten, FormalLogJet.coeff_liftSeries] + simp only [MvPolynomial.coeff_C, Polynomial.coeff_coe] + split_ifs <;> simp_all + +@[simp] theorem flatten_X {m : ℕ} (i : Fin m) : + flatten m (MvPolynomial.X i) = X i.succ := by + classical + ext d + rw [coeff_flatten, MvPolynomial.coeff_X, coeff_X] + have hd : d = Finsupp.single i.succ 1 ↔ + d.tail = Finsupp.single i 1 ∧ d 0 = 0 := by + conv_lhs => rw [← Finsupp.cons_tail d] + exact Finsupp.cons_eq_single_succ_iff i + simp only [hd] + by_cases ht : Finsupp.single i 1 = d.tail + · rw [ite_eq_left ht] + have ht' : d.tail = Finsupp.single i 1 := ht.symm + simp only [ht', true_and, Polynomial.coeff_one] + · rw [ite_eq_right ht, Polynomial.coeff_zero] + have ht' : ¬ d.tail = Finsupp.single i 1 := Ne.symm ht + simp only [ht', false_and, ite_false] + +theorem flatten_literalJetSubstitution {m : ℕ} + (r : Fin m → ℂ) (T : Fin m → ℕ) (j : ℕ) + (p : PiExponentApprox.FramePolynomial m) : + flatten m (literalJetSubstitution r + (fun i => InterpolationMatrix.truncatedLog (T i)) j p) = + FormalLogTruncation.truncatedFormalJet (fun i => (j : ℂ) * r i) T p := by + have hh : (flatten m).comp + (literalJetSubstitution r (fun i => InterpolationMatrix.truncatedLog (T i)) j) = + FormalLogTruncation.truncatedFormalJet (fun i => (j : ℂ) * r i) T := by + ext i + cases i using Fin.cases with + | zero => + simp [literalJetSubstitution, FormalLogTruncation.truncatedFormalJet] + | succ i => + simp [literalJetSubstitution, FormalLogTruncation.truncatedFormalJet, + InterpolationMatrix.truncatedLog, add_assoc, add_left_comm, add_comm] + exact DFunLike.congr_fun hh p + +theorem coeff_truncatedFormalJet {m : ℕ} + (r : Fin m → ℂ) (T : Fin m → ℕ) (j : ℕ) + (p : PiExponentApprox.FramePolynomial m) (d : Fin (m+1) →₀ ℕ) : + coeff d (FormalLogTruncation.truncatedFormalJet + (fun i => (j : ℂ) * r i) T p) = + ((literalJetSubstitution r (fun i => InterpolationMatrix.truncatedLog (T i)) j p).coeff + d.tail).coeff (d 0) := by + rw [← flatten_literalJetSubstitution, coeff_flatten] + +@[simp] theorem exponentVector_tail {m : ℕ} (a : Fin (m+1) → ℕ) : + (InterpolationMatrix.exponentVector a).tail = + InterpolationMatrix.exponentVector (fun i => a i.succ) := by + ext i + simp [Finsupp.tail_apply] + +theorem entry_eq_coeff_truncatedFormalJet {m : ℕ} + (r : Fin m → ℂ) (T : Fin m → ℕ) (j : ℕ) + (b e : Fin (m+1) → ℕ) : + InterpolationMatrix.entry r (fun i => InterpolationMatrix.truncatedLog (T i)) + j (b 0) (fun i => b i.succ) (e 0) (fun i => e i.succ) = + coeff (InterpolationMatrix.exponentVector b) + (FormalLogTruncation.truncatedFormalJet (fun i => (j : ℂ) * r i) T + (MvPolynomial.monomial (InterpolationMatrix.exponentVector e) 1)) := by + rw [coeff_truncatedFormalJet, literalJetSubstitution_monomial] + simp [InterpolationMatrix.entry] + +theorem truncatedLogMatrix_mulVec_eq_coeff {m : ℕ} + (K : ℕ) (w0 v0 θ : ℝ) (w : Fin m → ℝ) (H : ℝ) + (r : Fin m → ℂ) (T : Fin m → ℕ) + (x : InterpolationMatrix.Column w0 w H → ℂ) + (ρ : InterpolationMatrix.Row K v0 θ w H) : + (InterpolationMatrix.truncatedLogMatrix K w0 v0 θ w H r T).mulVecLin x ρ = + coeff (InterpolationMatrix.exponentVector ρ.2.val) + (FormalLogTruncation.truncatedFormalJet (fun i => (ρ.1.val : ℂ) * r i) T + (polynomialOfCoefficients + (realWeightedSimplex (InterpolationMatrix.columnWeights w0 w) H) x)) := by + rw [coeff_truncatedFormalJet, literalJetSubstitution_polynomialOfCoefficients] + simpa only [exponentVector_tail, InterpolationMatrix.exponentVector_apply, + InterpolationMatrix.linearEvaluation, InterpolationMatrix.truncatedLogMatrix] using + InterpolationMatrix.linearEvaluation_eq_coeff K w0 v0 θ w H r + (fun i => InterpolationMatrix.truncatedLog (T i)) x ρ + +end PiExponent.FormalMatrixBridge + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FormalMatrixSurjectivity.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FormalMatrixSurjectivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..9bb97cb66f1a92fc8dc7422395aa49cdc34eb949 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FormalMatrixSurjectivity.lean @@ -0,0 +1,80 @@ +import OAI.NumberTheory.PiExponent.Approximation.FormalMatrixBridge +import OAI.NumberTheory.PiExponent.Jets.FormalJetIndices + +namespace OAI + +noncomputable section + +namespace PiExponent.FormalMatrixBridge + +open MvPowerSeries + +theorem truncatedLogMatrix_surjective_of_rational_packets {m : ℕ} {α : Type*} + (K : ℕ) (w0 v0 θ : ℝ) (w : Fin m → ℝ) (H : ℚ) + (hw0 : 0 < w0) (hw : ∀ i, 0 < w i) + (V : Fin (m+1) → ℚ) (hV : ∀ i, 0 < V i) + (hrow : ∀ i, (V i : ℝ) = InterpolationMatrix.rowWeights v0 θ w i) + (r : Fin m → ℂ) (T : Fin m → ℕ) + (P : α → PiExponentApprox.FramePolynomial m) + (hdegree : ∀ a, PiExponentApprox.HasWeightedDegreeLE + (InterpolationMatrix.columnWeights w0 w) (H : ℝ) (P a)) + (hpacket : Function.Surjective (fun a => fun j : Fin K => + JetGeometry.rationalCoefficientPacket V H + (FormalLogTruncation.truncatedFormalJet (fun i => (j.val : ℂ) * r i) T (P a)))) : + Function.Surjective + (InterpolationMatrix.truncatedLogMatrix K w0 v0 θ w (H : ℝ) r T).mulVecLin := by + classical + have hrow' : (fun i => (V i : ℝ)) = InterpolationMatrix.rowWeights v0 θ w := funext hrow + have hW : ∀ i, 0 < InterpolationMatrix.columnWeights w0 w i := by + intro i + exact Fin.cases hw0 hw i + intro y + let e := rationalJetIndexEquiv V hV H + let z : Fin K → JetGeometry.RationalCoefficientPacket (R := ℂ) V H := + fun j d => y (j, ⟨(e d).val, by + simpa only [← hrow'] using (e d).property⟩) + obtain ⟨a, ha⟩ := hpacket z + let x : InterpolationMatrix.Column w0 w (H : ℝ) → ℂ := + fun c => (P a).coeff (InterpolationMatrix.exponentVector c.val) + refine ⟨x, ?_⟩ + funext ρ + rw [truncatedLogMatrix_mulVec_eq_coeff] + change coeff (InterpolationMatrix.exponentVector ρ.2.val) + (FormalLogTruncation.truncatedFormalJet (fun i => (ρ.1.val : ℂ) * r i) T + (polynomialOfCoefficients + (realWeightedSimplex (InterpolationMatrix.columnWeights w0 w) (H : ℝ)) + (fun c => (P a).coeff (InterpolationMatrix.exponentVector c.val)))) = y ρ + rw [polynomialOfCoefficients_of_weighted _ hW _ (P a) (hdegree a)] + let b : ↥(strictWeightedSimplex (fun i => (V i : ℝ)) (H : ℝ)) := + ⟨ρ.2.val, by simpa only [hrow'] using ρ.2.property⟩ + have hh := congrFun (congrFun ha ρ.1) (e.symm b) + change coeff (e.symm b).val + (FormalLogTruncation.truncatedFormalJet (fun i => (ρ.1.val : ℂ) * r i) T (P a)) = + z ρ.1 (e.symm b) at hh + simpa only [e, rationalJetIndexEquiv_symm_val, b, z, Equiv.apply_symm_apply] using hh + +theorem truncatedLogMatrix_surjective_of_formalLog_packets {m : ℕ} {α : Type*} + (K : ℕ) (w0 v0 θ : ℝ) (w : Fin m → ℝ) (H : ℚ) + (hw0 : 0 < w0) (hw : ∀ i, 0 < w i) + (V : Fin (m+1) → ℚ) (hV : ∀ i, 0 < V i) + (hrow : ∀ i, (V i : ℝ) = InterpolationMatrix.rowWeights v0 θ w i) + (r : Fin m → ℂ) (T : Fin m → ℕ) + (hT : ∀ i, V i.succ ≤ (T i : ℚ) * V 0) + (P : α → PiExponentApprox.FramePolynomial m) + (hdegree : ∀ a, PiExponentApprox.HasWeightedDegreeLE + (InterpolationMatrix.columnWeights w0 w) (H : ℝ) (P a)) + (hpacket : Function.Surjective (fun a => fun j : Fin K => + JetGeometry.rationalCoefficientPacket V H + (FormalLogJet.formalJet (fun i => (j.val : ℂ) * r i) (P a)))) : + Function.Surjective + (InterpolationMatrix.truncatedLogMatrix K w0 v0 θ w (H : ℝ) r T).mulVecLin := by + apply truncatedLogMatrix_surjective_of_rational_packets + K w0 v0 θ w H hw0 hw V hV hrow r T P hdegree + exact (FormalLogTruncation.formalLog_packets_surjective_iff_truncated + V (fun i => (hV i).le) H T hT (fun j : Fin K => fun i => (j.val : ℂ) * r i) P).mp hpacket + +end PiExponent.FormalMatrixBridge + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FrameEquationFamily.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameEquationFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..a3c261a3d6df2559030391299ef09779bce90100 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameEquationFamily.lean @@ -0,0 +1,114 @@ +import OAI.NumberTheory.PiExponent.Approximation.WeightedSliceDegree +import OAI.NumberTheory.PiExponent.Geometry.CurveContact + +namespace OAI + +namespace PiExponent.FrameEquationFamily + +open scoped BigOperators +open PiExponentApprox + +abbrev BoundedWords {m : ℕ} (cost : Fin (m + 1) → ℝ) (bound : ℝ) := + {word : List (Fin (m + 1)) // frameWordCost cost word ≤ bound} + +noncomputable def equations {m : ℕ} (cost : Fin (m + 1) → ℝ) (bound : ℝ) + (F : FramePolynomial m) : BoundedWords cost bound → FramePolynomial m := + fun word => polynomialFrameWord m word.1 F + +theorem equations_mem {m : ℕ} (cost : Fin (m + 1) → ℝ) (bound : ℝ) + (F : FramePolynomial m) (word : BoundedWords cost bound) : + equations cost bound F word ∈ frameDerivativeIdeal cost bound F := + frameWord_mem_derivativeIdeal cost bound F word.1 word.2 + +theorem span_equations {m : ℕ} (cost : Fin (m + 1) → ℝ) (bound : ℝ) + (F : FramePolynomial m) : + Ideal.span (Set.range (equations cost bound F)) = + frameDerivativeIdeal cost bound F := by + unfold frameDerivativeIdeal + congr 1 + ext g + constructor + · rintro ⟨word, rfl⟩ + exact ⟨word.1, word.2, rfl⟩ + · rintro ⟨word, hword, rfl⟩ + exact ⟨⟨word, hword⟩, rfl⟩ + +theorem monomialWeight_eq_weight {m : ℕ} (W : Fin (m + 1) → ℝ) + (d : Fin (m + 1) →₀ ℕ) : + monomialWeight W d = Finsupp.weight W d := by + simp only [monomialWeight, Finsupp.weight_eq_sum, nsmul_eq_mul] + +theorem hasWeightedDegreeLE_iff_supportBound {m : ℕ} (W : Fin (m + 1) → ℝ) + (N : ℝ) (F : FramePolynomial m) : + HasWeightedDegreeLE W N F ↔ WeightedSliceDegree.SupportBound W N F := by + simp only [HasWeightedDegreeLE, WeightedSliceDegree.SupportBound, monomialWeight_eq_weight] + +theorem equation_hasWeightedDegreeLE {m : ℕ} (cost W : Fin (m + 1) → ℝ) + (bound N : ℝ) (F : FramePolynomial m) + (hF : HasWeightedDegreeLE W N F) (hW : ∀ i, 0 ≤ W i) + (word : BoundedWords cost bound) : + HasWeightedDegreeLE W N (equations cost bound F word) := + hF.polynomialFrameWord hW word.1 + +theorem equation_supportBound {m : ℕ} (cost W : Fin (m + 1) → ℝ) + (bound N : ℝ) (F : FramePolynomial m) + (hF : HasWeightedDegreeLE W N F) (hW : ∀ i, 0 ≤ W i) + (word : BoundedWords cost bound) : + WeightedSliceDegree.SupportBound W N (equations cost bound F word) := + (hasWeightedDegreeLE_iff_supportBound W N _).mp + (equation_hasWeightedDegreeLE cost W bound N F hF hW word) + +variable {E : Type*} [Field E] [Algebra ℂ E] + +noncomputable def sliceEquations {m : ℕ} (cost : Fin (m + 1) → ℝ) (bound : ℝ) + (F : FramePolynomial m) (A : Finset (Fin (m + 1))) (b : Fin (m + 1) → E) : + BoundedWords cost bound → MvPolynomial (Fin A.card) E := + fun word => WeightedSliceDegree.enumeratedSliceMap A b (equations cost bound F word) + +theorem span_sliceEquations {m : ℕ} (cost : Fin (m + 1) → ℝ) (bound : ℝ) + (F : FramePolynomial m) (A : Finset (Fin (m + 1))) (b : Fin (m + 1) → E) : + Ideal.span (Set.range (sliceEquations cost bound F A b)) = + (frameDerivativeIdeal cost bound F).map + (WeightedSliceDegree.enumeratedSliceMap A b).toRingHom := by + rw [← span_equations cost bound F, Ideal.map_span] + congr 1 + ext g + constructor + · rintro ⟨word, rfl⟩ + exact ⟨equations cost bound F word, ⟨word, rfl⟩, rfl⟩ + · rintro ⟨p, ⟨word, rfl⟩, rfl⟩ + exact ⟨word, rfl⟩ + +theorem sliceEquation_supportBound {m : ℕ} (cost W : Fin (m + 1) → ℝ) + (bound N : ℝ) (F : FramePolynomial m) + (hF : HasWeightedDegreeLE W N F) (hW : ∀ i, 0 ≤ W i) + (A : Finset (Fin (m + 1))) (b : Fin (m + 1) → E) + (word : BoundedWords cost bound) : + WeightedSliceDegree.SupportBound (fun j : Fin A.card => W (A.equivFin.symm j)) N + (sliceEquations cost bound F A b word) := + WeightedSliceDegree.supportBound_enumeratedSliceMap A b W hW N + (equations cost bound F word) (equation_supportBound cost W bound N F hF hW word) + +theorem sliceEquation_weighted_sum_le {m : ℕ} (cost W : Fin (m + 1) → ℝ) + (bound N : ℝ) (F : FramePolynomial m) + (hF : HasWeightedDegreeLE W N F) (hW : ∀ i, 0 ≤ W i) + (A : Finset (Fin (m + 1))) (b : Fin (m + 1) → E) + (word : BoundedWords cost bound) : + ∀ d ∈ (sliceEquations cost bound F A b word).support, + (∑ j ∈ d.support, (d j : ℝ) * W (A.equivFin.symm j)) ≤ N := by + have h := sliceEquation_supportBound cost W bound N F hF hW A b word + simpa only [WeightedSliceDegree.SupportBound, Finsupp.weight_apply, Finsupp.sum, + nsmul_eq_mul] using h + +theorem sliceEquation_eval {m : ℕ} (cost : Fin (m + 1) → ℝ) (bound : ℝ) + (F : FramePolynomial m) (A : Finset (Fin (m + 1))) (b : Fin (m + 1) → E) + (word : BoundedWords cost bound) : + MvPolynomial.aeval (fun j : Fin A.card => b (A.equivFin.symm j)) + (sliceEquations cost bound F A b word) = + MvPolynomial.aeval b (equations cost bound F word) := + AlgHom.congr_fun (WeightedSliceDegree.enumeratedSliceMap_eval (C := ℂ) A b) + (equations cost bound F word) + +end PiExponent.FrameEquationFamily + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FrameResidueDirections.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameResidueDirections.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf631f54f540f257a97251bbe8c05e4353e777a6 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameResidueDirections.lean @@ -0,0 +1,29 @@ +import OAI.NumberTheory.PiExponent.Jets.NormalFrameBasis +import OAI.NumberTheory.PiExponent.Polynomials.PolynomialFrame + +namespace OAI + +noncomputable section +namespace PiExponent + +open scoped BigOperators +open PiExponentApprox NormalBasisRigidity + +theorem residue_polynomialFrame_eq_frameBasis_dot {E : Type*} [Field E] + (m : ℕ) (phi : FramePolynomial m →+* E) + (hy : phi (MvPolynomial.X (0 : Fin (m + 1))) ≠ 0) + (j : Fin (m + 1)) (p : FramePolynomial m) : + phi (polynomialFrame m j p) = + ∑ i, frameBasis m (phi (MvPolynomial.X 0)) hy j i * + phi (MvPolynomial.pderiv i p) := by + refine Fin.cases ?_ (fun l => ?_) j + · rw [polynomialFrame_zero, logarithmicDerivation_apply, map_add, map_mul, + map_sum, Fin.sum_univ_succ] + simp only [frameBasis_zero_zero, frameBasis_zero_succ, one_mul] + · rw [polynomialFrame_pos m l.succ (Fin.succ_ne_zero l), frameBasis_succ] + simp [Pi.basisFun_apply, Pi.single_apply] + +end PiExponent +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FrameSections.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameSections.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e66e602cc4e2a6e41036ea78cb1207e43d9c442 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameSections.lean @@ -0,0 +1,173 @@ +import OAI.NumberTheory.PiExponent.Polynomials.FrameCoefficients + +namespace OAI + +noncomputable section + +universe u + +namespace PiExponentSeshadri.Frames + +section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open scoped AlgebraicGeometry +variable {X Y : Scheme.{u}} + +def scalarEnd (r : Γ(X, ⊤)) : O X ⟶ O X where + val.app U := by + let S := X.ringCatSheaf.obj.obj U + letI : CommRing S := inferInstanceAs (CommRing Γ(X, U.unop)) + exact ModuleCat.ofHom (LinearMap.mulLeft S + ((X.presheaf.map (homOfLE le_top).op) r)) + val.naturality {U V} i := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro a + change Γ(X, U.unop) at a + change (X.presheaf.map (homOfLE le_top).op r) * (X.presheaf.map i a) = + X.presheaf.map i (X.presheaf.map (homOfLE le_top).op r * a) + rw [map_mul, ← CommRingCat.comp_apply, ← Functor.map_comp] + rfl + +@[simp] lemma endValue_scalarEnd (r : Γ(X, ⊤)) : endValue (scalarEnd r) = r := by + change X.presheaf.map (𝟙 _) r * 1 = r + simp + +lemma endValue_injective : Function.Injective (endValue (X := X)) := by + intro f g h + ext U a + change Γ(X, U) at a + change f.app U a = g.app U a + rw [end_apply f U a, end_apply g U a] + rw [end_naturality f U, end_naturality g U, h] + +lemma end_isIso_iff (f : O X ⟶ O X) : IsIso f ↔ IsUnit (endValue f) := by + constructor + · intro h + let := h + refine isUnit_iff_exists_inv.mpr ⟨endValue (inv f), ?_⟩ + rw [← endValue_comp] + simp + · rintro ⟨u, hu⟩ + refine ⟨⟨scalarEnd ↑u⁻¹, ?_, ?_⟩⟩ + · apply endValue_injective + rw [endValue_comp, ← hu, endValue_scalarEnd, endValue_id] + exact Units.val_inv u + · apply endValue_injective + rw [endValue_comp, ← hu, endValue_scalarEnd, endValue_id] + exact Units.inv_val u + +lemma coefficient_isUnit_iff {M : X.Modules} (e : M ≅ O X) (s : O X ⟶ M) : + IsUnit (coefficient e s) ↔ IsIso s := by + change IsUnit (endValue (s ≫ e.hom)) ↔ _ + rw [← end_isIso_iff] + exact isIso_comp_right_iff s e.hom + +end + +section +open CategoryTheory AlgebraicGeometry TopologicalSpace Opposite +open scoped AlgebraicGeometry +variable {X : Scheme} + +def moduleSectionsTopEquiv {T : TopCat} (R : Sheaf (Opens.grothendieckTopology T) RingCat) + (M : SheafOfModules R) : M.sections ≃ M.val.obj (op ⊤) where + toFun s := s.val (op ⊤) + invFun t := PresheafOfModules.sectionsMk + (fun U => M.val.map (homOfLE le_top).op t) + (by + intro U V i + rw [← M.val.map_comp_apply] + exact M.val.congr_map_apply (Subsingleton.elim _ _) t) + left_inv s := by + apply PresheafOfModules.sections_ext + intro U + exact s.property (homOfLE le_top).op + right_inv t := by + change M.val.map (𝟙 (op ⊤)) t = t + rw [M.val.map_id] + rfl + +def moduleSectionEquiv (M : X.Modules) : (O X ⟶ M) ≃ Γ(M, ⊤) := + M.unitHomEquiv.trans (moduleSectionsTopEquiv X.ringCatSheaf M) + +@[simp] lemma moduleSectionEquiv_apply (M : X.Modules) (s : O X ⟶ M) : + moduleSectionEquiv M s = s.app ⊤ (1 : Γ(X, ⊤)) := rfl + +def openSectionEquiv (M : X.Modules) (U : X.Opens) : + (O U.toScheme ⟶ M.restrict U.ι) ≃ Γ(M, U) := + (moduleSectionEquiv (M.restrict U.ι)).trans + (let e := M.presheaf.mapIso (eqToIso U.ι_image_top.symm).op + { toFun := e.hom + invFun := e.inv + left_inv := fun t => Iso.hom_inv_id_apply e t + right_inv := fun t => Iso.inv_hom_id_apply e t }) + +lemma section_value_natural {M : X.Modules} (s : O X ⟶ M) {U V : X.Opens} (i : U ⟶ V) : + M.presheaf.map i.op (s.app V (1 : Γ(X, V))) = s.app U (1 : Γ(X, U)) := by + have h := CategoryTheory.congr_fun (s.mapPresheaf.naturality i.op) (1 : Γ(X, V)) + change s.app U (X.presheaf.map i.op (1 : Γ(X, V))) = + M.presheaf.map i.op (s.app V (1 : Γ(X, V))) at h + simpa only [map_one] using h.symm + +@[simp] lemma openSectionEquiv_restrict {M : X.Modules} (s : O X ⟶ M) (U : X.Opens) : + openSectionEquiv M U (restrictSection U.ι s) = s.app U (1 : Γ(X, U)) := by + change M.presheaf.map (eqToHom U.ι_image_top.symm).op + (s.app (U.ι ''ᵁ ⊤) ((U.ι.appIso ⊤).inv (1 : Γ(U.toScheme, ⊤)))) = _ + rw [map_one] + exact section_value_natural s (eqToHom U.ι_image_top.symm) + +end + +open CategoryTheory AlgebraicGeometry TopologicalSpace +open scoped AlgebraicGeometry +variable {X : Scheme} + +lemma moduleSectionEquiv_scalar {M : X.Modules} (f : Γ(X, ⊤)) (s : O X ⟶ M) : + moduleSectionEquiv M (scalarEnd f ≫ s) = f • moduleSectionEquiv M s := by + change s.app ⊤ (endValue (scalarEnd f)) = f • s.app ⊤ (1 : Γ(X, ⊤)) + rw [endValue_scalarEnd] + have h := s.app_smul (r := f) (x := (1 : Γ(X, ⊤))) + change s.app ⊤ (f * 1 : Γ(X, ⊤)) = f • s.app ⊤ (1 : Γ(X, ⊤)) at h + simpa only [mul_one] using h + +lemma openSectionEquiv_scalar (M : X.Modules) (U : X.Opens) + (f : Γ(U.toScheme, ⊤)) (s : O U.toScheme ⟶ M.restrict U.ι) : + openSectionEquiv M U (scalarEnd f ≫ s) = U.topIso.hom f • openSectionEquiv M U s := by + change M.presheaf.map (eqToHom U.ι_image_top.symm).op + (moduleSectionEquiv (M.restrict U.ι) (scalarEnd f ≫ s)) = _ + rw [moduleSectionEquiv_scalar] + change M.presheaf.map (eqToHom U.ι_image_top.symm).op + ((U.ι.appIso ⊤).inv f • (show Γ(M, U.ι ''ᵁ ⊤) from moduleSectionEquiv (M.restrict U.ι) s)) = _ + rw [M.map_smul, U.ι_appIso] + rfl + +lemma openSectionEquiv_restrict_value (M : X.Modules) (U : X.Opens) + (s : O U.toScheme ⟶ M.restrict U.ι) (W : U.toScheme.Opens) : + M.presheaf.map (homOfLE (U.ι_image_le W)).op (openSectionEquiv M U s) = + s.app W (1 : Γ(U.toScheme, W)) := by + have h := section_value_natural s (homOfLE (show W ≤ ⊤ from le_top)) + change M.presheaf.map (U.ι.opensFunctor.map (homOfLE (show W ≤ ⊤ from le_top))).op + (s.app ⊤ (1 : Γ(U.toScheme, ⊤))) = _ at h + change M.presheaf.map (homOfLE (U.ι_image_le W)).op + (M.presheaf.map (eqToHom U.ι_image_top.symm).op (s.app ⊤ (1 : Γ(U.toScheme, ⊤)))) = _ + erw [← ConcreteCategory.comp_apply, ← Functor.map_comp] + exact h + +lemma image_section_extension (M : X.Modules) (U : X.Opens) + (s t : O U.toScheme ⟶ M.restrict U.ι) (W : U.toScheme.Opens) + (f : Γ(W.toScheme, ⊤)) + (h : restrictSection W.ι t = scalarEnd f ≫ restrictSection W.ι s) : + M.presheaf.map (homOfLE (U.ι_image_le W)).op (openSectionEquiv M U t) = + (U.ι.appIso W).inv (W.topIso.hom f) • M.presheaf.map (homOfLE (U.ι_image_le W)).op + (openSectionEquiv M U s) := by + have hh := congrArg (openSectionEquiv (M.restrict U.ι) W) h + rw [openSectionEquiv_restrict, openSectionEquiv_scalar, openSectionEquiv_restrict] at hh + rw [openSectionEquiv_restrict_value, openSectionEquiv_restrict_value] + exact hh + +end PiExponentSeshadri.Frames + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FrameSubopens.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameSubopens.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b1879716598b4d4557938b9a013615eae73ed7c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameSubopens.lean @@ -0,0 +1,43 @@ +import OAI.NumberTheory.PiExponent.Polynomials.FrameCoefficients + +namespace OAI + +namespace PiExponentSeshadri.Frames +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +variable {X : Scheme} {M : X.Modules} + +def restrictOpenFrame {U V : X.Opens} (h : V ≤ U) (e : M.restrict U.ι ≅ O U.toScheme) : + M.restrict V.ι ≅ O V.toScheme := + ((Scheme.Modules.restrictFunctorCongr (X.homOfLE_ι h)).app M).symm ≪≫ + (Scheme.Modules.restrictFunctorComp (X.homOfLE h) U.ι).app M ≪≫ + restrictFrame (X.homOfLE h) e + +lemma restrictOpenFrame_coefficient_global {U V : X.Opens} (h : V ≤ U) + (e : M.restrict U.ι ≅ O U.toScheme) (s : O X ⟶ M) : + coefficient (restrictOpenFrame h e) (restrictSection V.ι s) = + (X.homOfLE h).appTop (coefficient e (restrictSection U.ι s)) := by + unfold restrictOpenFrame + rw [coefficient_transport] + rw [← restrictSection_congr (X.homOfLE_ι h) s, Category.assoc] + have he : (Scheme.Modules.restrictFunctorCongr (X.homOfLE_ι h)).hom.app M ≫ + ((Scheme.Modules.restrictFunctorCongr (X.homOfLE_ι h)).app M).symm.hom = 𝟙 _ := + Iso.hom_inv_id ((Scheme.Modules.restrictFunctorCongr (X.homOfLE_ι h)).app M) + rw [he, Category.comp_id] + exact coefficient_restrict_comp (X.homOfLE h) U.ι e s + +lemma frameChange_restrictOpenFrame {U V W : X.Opens} (hWU : W ≤ U) (hWV : W ≤ V) + (e : M.restrict U.ι ≅ O U.toScheme) (f : M.restrict V.ι ≅ O V.toScheme) + (s : O X ⟶ M) (hs : coefficient e (restrictSection U.ι s) = 1) : + (frameChange (restrictOpenFrame hWU e) (restrictOpenFrame hWV f) : Γ(W.toScheme,⊤)) = + (X.homOfLE hWV).appTop (coefficient f (restrictSection V.ι s)) := by + have h := coefficient_change (restrictOpenFrame hWU e) (restrictOpenFrame hWV f) + (restrictSection W.ι s) + rw [restrictOpenFrame_coefficient_global, restrictOpenFrame_coefficient_global, + hs, map_one, mul_one] at h + exact h.symm + +end +end PiExponentSeshadri.Frames + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FrameSubopensCoherence.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameSubopensCoherence.lean new file mode 100644 index 0000000000000000000000000000000000000000..49c1edc9a20970f36693175cf0381b21cfd75938 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameSubopensCoherence.lean @@ -0,0 +1,79 @@ +import OAI.NumberTheory.PiExponent.Approximation.FrameSubopens + +namespace OAI + +namespace PiExponentSeshadri.Frames +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +variable {X : Scheme} {M : X.Modules} {U V W : X.Opens} + +lemma restrictOpenFrame_app (h : V ≤ U) (e : M.restrict U.ι ≅ O U.toScheme) + (A : V.toScheme.Opens) (x : Γ(M.restrict V.ι,A)) : + (restrictOpenFrame h e).hom.app A x = + X.presheaf.map (homOfLE (show V.ι ''ᵁ A ≤ U.ι ''ᵁ (X.homOfLE h ''ᵁ A) from by + simp [← Scheme.Hom.comp_image])).op + (e.hom.app (X.homOfLE h ''ᵁ A) + (M.presheaf.map (homOfLE + (show U.ι ''ᵁ (X.homOfLE h ''ᵁ A) ≤ V.ι ''ᵁ A from by + simp [← Scheme.Hom.comp_image])).op x)) := by + simp only [restrictOpenFrame, Iso.trans_hom, Iso.symm_hom, + Scheme.Modules.Hom.comp_app, Iso.app_inv, Iso.app_hom, + Scheme.Modules.restrictFunctorCongr_inv_app_app, + Scheme.Modules.restrictFunctorComp_hom_app_app] + change ((X.homOfLE h).appIso A).hom (e.hom.app (X.homOfLE h ''ᵁ A) + ((M.presheaf.map _ ≫ M.presheaf.map _) x)) = _ + simp only [Scheme.Hom.appIso_hom', Scheme.homOfLE_appLE] + erw [← Functor.map_comp] + rfl + +lemma restrictOpenFrame_trans (h : W ≤ V) (k : V ≤ U) + (e : M.restrict U.ι ≅ O U.toScheme) : + restrictOpenFrame h (restrictOpenFrame k e) = restrictOpenFrame (h.trans k) e := by + apply Iso.ext + ext A x + have hh := restrictOpenFrame_app h (restrictOpenFrame k e) A x + let y := M.presheaf.map (homOfLE + (show V.ι ''ᵁ (X.homOfLE h ''ᵁ A) ≤ W.ι ''ᵁ A from by + simp [← Scheme.Hom.comp_image])).op x + have hk := restrictOpenFrame_app k e (X.homOfLE h ''ᵁ A) y + have hhk := congrArg (X.presheaf.map (homOfLE + (show W.ι ''ᵁ A ≤ V.ι ''ᵁ (X.homOfLE h ''ᵁ A) from by + simp [← Scheme.Hom.comp_image])).op) hk + have hc := restrictOpenFrame_app (h.trans k) e A x + refine hh.trans (hhk.trans (Eq.trans ?_ hc.symm)) + change (X.presheaf.map _ ≫ X.presheaf.map _) + (e.hom.app (X.homOfLE k ''ᵁ (X.homOfLE h ''ᵁ A)) + ((M.presheaf.map _ ≫ M.presheaf.map _) x)) = + X.presheaf.map _ (e.hom.app (X.homOfLE (h.trans k) ''ᵁ A) + (M.presheaf.map _ x)) + erw [← Functor.map_comp, ← Functor.map_comp] + let B := X.homOfLE k ''ᵁ (X.homOfLE h ''ᵁ A) + let C := X.homOfLE (h.trans k) ''ᵁ A + have hA : C ≤ B := by + simp only [B, C, ← Scheme.Hom.comp_image, Scheme.homOfLE_homOfLE] + exact le_rfl + have hB : U.ι ''ᵁ B ≤ W.ι ''ᵁ A := by + simp [B, ← Scheme.Hom.comp_image] + have hC : W.ι ''ᵁ A ≤ U.ι ''ᵁ C := by + simp [C, ← Scheme.Hom.comp_image] + have hn := CategoryTheory.congr_fun + (e.hom.mapPresheaf.naturality (homOfLE hA).op) + (M.presheaf.map (homOfLE hB).op x) + change e.hom.app C ((M.restrict U.ι).presheaf.map (homOfLE hA).op + (M.presheaf.map (homOfLE hB).op x)) = + U.toScheme.presheaf.map (homOfLE hA).op + (e.hom.app B (M.presheaf.map (homOfLE hB).op x)) at hn + refine Eq.trans ?_ (Eq.trans (congrArg (X.presheaf.map (homOfLE hC).op) hn).symm ?_) + · change X.presheaf.map _ (e.hom.app B (M.presheaf.map _ x)) = + (X.presheaf.map _ ≫ X.presheaf.map _) (e.hom.app B (M.presheaf.map _ x)) + erw [← Functor.map_comp] + rfl + · apply congrArg (X.presheaf.map (homOfLE hC).op) + apply congrArg (e.hom.app C) + change (M.presheaf.map _ ≫ M.presheaf.map _) x = M.presheaf.map _ x + erw [← Functor.map_comp] + rfl +end +end PiExponentSeshadri.Frames + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FrameTensorPowers.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameTensorPowers.lean new file mode 100644 index 0000000000000000000000000000000000000000..37528294c7de8d77571f5348b7609c3cad2ba5b6 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FrameTensorPowers.lean @@ -0,0 +1,139 @@ +import OAI.NumberTheory.PiExponent.Polynomials.FrameCoefficients + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace MonoidalCategory +open scoped AlgebraicGeometry +open PiExponentSeshadri.Frames +variable {X : Scheme} + +lemma tensor_unit_end {C : Type*} [Category C] [MonoidalCategory C] + (f g : 𝟙_ C ⟶ 𝟙_ C) : + (f ⊗ₘ g) ≫ (λ_ (𝟙_ C)).hom = (λ_ (𝟙_ C)).hom ≫ (f ≫ g) := by + rw [MonoidalCategory.tensorHom_def, Category.assoc, leftUnitor_naturality, ← Category.assoc, + unitors_equal, rightUnitor_naturality, Category.assoc] + +lemma moduleTensorUnit_scalar (f g : structureSheaf X ⟶ structureSheaf X) : + moduleTensorMap f g ≫ (moduleTensorUnit (structureSheaf X)).hom = + (moduleTensorUnit (structureSheaf X)).hom ≫ (f ≫ g) := by + let : MonoidalCategory (PresheafOfModules X.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf) + let F : PresheafOfModules X.ringCatSheaf.obj ⥤ X.Modules := + PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj) + let G : X.Modules ⥤ PresheafOfModules X.ringCatSheaf.obj := + SheafOfModules.forget X.ringCatSheaf ⋙ + PresheafOfModules.restrictScalars (𝟙 X.ringCatSheaf.obj) + let ε : G ⋙ F ⟶ 𝟭 X.Modules := + (PresheafOfModules.sheafificationAdjunction (𝟙 X.ringCatSheaf.obj)).counit + have h : (f.val ⊗ₘ g.val) ≫ (λ_ (structureSheaf X).val).hom = + (λ_ (structureSheaf X).val).hom ≫ (f ≫ g).val := by + let f₀ : 𝟙_ (PresheafOfModules X.ringCatSheaf.obj) ⟶ + 𝟙_ (PresheafOfModules X.ringCatSheaf.obj) := f.val + let g₀ : 𝟙_ (PresheafOfModules X.ringCatSheaf.obj) ⟶ + 𝟙_ (PresheafOfModules X.ringCatSheaf.obj) := g.val + exact tensor_unit_end f₀ g₀ + change F.map (f.val ⊗ₘ g.val) ≫ (F.map (λ_ (structureSheaf X).val).hom ≫ ε.app (structureSheaf X)) = + (F.map (λ_ (structureSheaf X).val).hom ≫ ε.app (structureSheaf X)) ≫ (f ≫ g) + erw [← Category.assoc, ← F.map_comp, h, F.map_comp, Category.assoc, Category.assoc] + congr 1 + exact ε.naturality (f ≫ g) + +def endPower (f : structureSheaf X ⟶ structureSheaf X) : ℕ → (structureSheaf X ⟶ structureSheaf X) + | 0 => 𝟙 _ + | n + 1 => f ≫ endPower f n + +lemma endValue_endPower (f : structureSheaf X ⟶ structureSheaf X) (n : ℕ) : + endValue (endPower f n) = endValue f ^ n := by + induction n with + | zero => + change (1 : Γ(X, ⊤)) = endValue f ^ 0 + exact (pow_zero _).symm + | succ n hn => + calc + endValue (endPower f (n + 1)) = endValue f * endValue (endPower f n) := + endValue_comp f (endPower f n) + _ = endValue f * endValue f ^ n := congrArg (endValue f * ·) hn + _ = _ := (pow_succ' _ _).symm + +lemma moduleTensorUnit_natural {M N : X.Modules} (g : M ⟶ N) : + moduleTensorMap (𝟙 (structureSheaf X)) g ≫ (moduleTensorUnit N).hom = + (moduleTensorUnit M).hom ≫ g := by + let : MonoidalCategory (PresheafOfModules X.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf) + let F : PresheafOfModules X.ringCatSheaf.obj ⥤ X.Modules := + PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj) + let G : X.Modules ⥤ PresheafOfModules X.ringCatSheaf.obj := + SheafOfModules.forget X.ringCatSheaf ⋙ + PresheafOfModules.restrictScalars (𝟙 X.ringCatSheaf.obj) + let ε : G ⋙ F ⟶ 𝟭 X.Modules := + (PresheafOfModules.sheafificationAdjunction (𝟙 X.ringCatSheaf.obj)).counit + change F.map ((𝟙 (structureSheaf X).val) ⊗ₘ g.val) ≫ + (F.map (λ_ N.val).hom ≫ ε.app N) = + (F.map (λ_ M.val).hom ≫ ε.app M) ≫ g + have h : ((𝟙 (structureSheaf X).val) ⊗ₘ g.val) ≫ (λ_ N.val).hom = + (λ_ M.val).hom ≫ g.val := by + rw [id_tensorHom] + exact leftUnitor_naturality g.val + have hF : F.map (𝟙 (structureSheaf X).val ⊗ₘ g.val) ≫ F.map (λ_ N.val).hom = + F.map (λ_ M.val).hom ≫ F.map g.val := + (F.map_comp _ _).symm.trans ((congrArg F.map h).trans (F.map_comp _ _)) + refine (Category.assoc _ _ _).symm.trans ?_ + refine (congrArg (· ≫ ε.app N) hF).trans ?_ + refine (Category.assoc _ _ _).trans ?_ + refine (congrArg (F.map (λ_ M.val).hom ≫ ·) (ε.naturality g)).trans ?_ + exact (Category.assoc _ _ _).symm + +lemma modulePowMap_unitPower (f : structureSheaf X ⟶ structureSheaf X) (n : ℕ) : + modulePowMap f n ≫ (unitPowerIso n).hom = + (unitPowerIso n).hom ≫ endPower f n := by + induction n with + | zero => + change 𝟙 (structureSheaf X) ≫ 𝟙 (structureSheaf X) = 𝟙 (structureSheaf X) ≫ 𝟙 (structureSheaf X) + rfl + | succ n hn => + change moduleTensorMap f (modulePowMap f n) ≫ + ((moduleTensorUnit _).hom ≫ (unitPowerIso n).hom) = + ((moduleTensorUnit _).hom ≫ (unitPowerIso n).hom) ≫ (f ≫ endPower f n) + calc + _ = moduleTensorMap f (modulePowMap f n) ≫ + moduleTensorMap (𝟙 (structureSheaf X)) (unitPowerIso n).hom ≫ + (moduleTensorUnit (structureSheaf X)).hom := by + rw [moduleTensorUnit_natural] + _ = moduleTensorMap f ((unitPowerIso n).hom ≫ endPower f n) ≫ + (moduleTensorUnit (structureSheaf X)).hom := by + rw [← Category.assoc, ← moduleTensorMap_comp, Category.comp_id, hn] + _ = moduleTensorMap (𝟙 (structureSheaf X)) (unitPowerIso n).hom ≫ + moduleTensorMap f (endPower f n) ≫ (moduleTensorUnit (structureSheaf X)).hom := by + rw [← Category.assoc, ← moduleTensorMap_comp, Category.id_comp] + _ = (moduleTensorUnit (modulePow X (structureSheaf X) n)).hom ≫ + (unitPowerIso n).hom ≫ (f ≫ endPower f n) := by + rw [moduleTensorUnit_scalar, ← Category.assoc, moduleTensorUnit_natural, + Category.assoc] + _ = _ := by simp only [Category.assoc] + +def globalPowerFrame {M : X.Modules} (e : M ≅ structureSheaf X) (n : ℕ) : + modulePow X M n ≅ structureSheaf X := + (modulePowFunctor n).mapIso e ≪≫ unitPowerIso n + +lemma powerSection_coefficient {M : X.Modules} (e : M ≅ structureSheaf X) + (s : structureSheaf X ⟶ M) (n : ℕ) : + coefficient (globalPowerFrame e n) (powerSection s n) = coefficient e s ^ n := by + change endValue ((unitPowerIso n).inv ≫ modulePowMap s n ≫ + (modulePowMap e.hom n ≫ (unitPowerIso n).hom)) = _ + erw [← Category.assoc (modulePowMap s n), ← modulePowMap_comp, + modulePowMap_unitPower, Iso.inv_hom_id_assoc, endValue_endPower] + rfl + +lemma frameChange_globalPowerFrame {M : X.Modules} + (e f : M ≅ structureSheaf X) (n : ℕ) : + (frameChange (globalPowerFrame e n) (globalPowerFrame f n) : Γ(X,⊤)) = + (frameChange e f : Γ(X,⊤)) ^ n := by + have h := powerSection_coefficient f e.inv n + exact h + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FramedPullback.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FramedPullback.lean new file mode 100644 index 0000000000000000000000000000000000000000..51a518ba4941fc3a75f2823885793ce2d8e66050 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FramedPullback.lean @@ -0,0 +1,98 @@ +import OAI.NumberTheory.PiExponent.Approximation.SectionPullback + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace +open PiExponentSeshadri.Frames +variable {X Y : Scheme.{0}} + +lemma endValue_conjugation (b : O Y ≅ O Y) (a : O Y ⟶ O Y) : + endValue (b.hom ≫ a ≫ b.inv) = endValue a := by + rw [endValue_comp, endValue_comp] + have hb : endValue b.hom * endValue b.inv = 1 := by + rw [← endValue_comp, b.hom_inv_id, endValue_id] + calc + endValue b.hom * (endValue a * endValue b.inv) = + endValue a * (endValue b.hom * endValue b.inv) := by ring + _ = endValue a := by rw [hb, mul_one] + +lemma exists_frame_natIso (F G : X.Modules ⥤ Y.Modules) (v : F ≅ G) + (uF : F.obj (O X) ≅ O Y) (uG : G.obj (O X) ≅ O Y) + {M : X.Modules} (e : G.obj M ≅ O Y) (s : O X ⟶ M) : + ∃ eF : F.obj M ≅ O Y, + coefficient eF (uF.inv ≫ F.map s) = coefficient e (uG.inv ≫ G.map s) := by + let b : O Y ≅ O Y := uF.symm ≪≫ v.app (O X) ≪≫ uG + refine ⟨v.app M ≪≫ e ≪≫ b.symm, ?_⟩ + have h : (uF.inv ≫ F.map s) ≫ (v.app M).hom = + b.hom ≫ (uG.inv ≫ G.map s) := by + simp only [b, Iso.trans_hom, Iso.symm_hom, Category.assoc] + simp only [Iso.hom_inv_id_assoc] + exact congrArg (fun q => uF.inv ≫ q) (v.hom.naturality s) + change endValue (((uF.inv ≫ F.map s) ≫ (v.app M).hom) ≫ e.hom ≫ b.inv) = _ + rw [h] + change endValue (b.hom ≫ (uG.inv ≫ G.map s ≫ e.hom) ≫ b.inv) = _ + exact endValue_conjugation b _ + +def pullbackRestrictNatIso (f : Y ⟶ X) (U : X.Opens) : + Scheme.Modules.pullback f ⋙ Scheme.Modules.restrictFunctor (f ⁻¹ᵁ U).ι ≅ + Scheme.Modules.restrictFunctor U.ι ⋙ Scheme.Modules.pullback (f ∣_ U) := + Functor.isoWhiskerLeft (Scheme.Modules.pullback f) + (Scheme.Modules.restrictFunctorIsoPullback (f ⁻¹ᵁ U).ι) ≪≫ + Scheme.Modules.pullbackComp (f ⁻¹ᵁ U).ι f ≪≫ + Scheme.Modules.pullbackCongr (morphismRestrict_ι f U).symm ≪≫ + (Scheme.Modules.pullbackComp (f ∣_ U) U.ι).symm ≪≫ + Functor.isoWhiskerRight (Scheme.Modules.restrictFunctorIsoPullback U.ι).symm + (Scheme.Modules.pullback (f ∣_ U)) + +theorem exists_restricted_pullback_frame (f : Y ⟶ X) (U : X.Opens) + {M : X.Modules} (e : M.restrict U.ι ≅ O U.toScheme) (s : O X ⟶ M) : + ∃ eF : ((Scheme.Modules.pullback f).obj M).restrict (f ⁻¹ᵁ U).ι ≅ + O (f ⁻¹ᵁ U).toScheme, + coefficient eF (restrictSection (f ⁻¹ᵁ U).ι (pullbackSection f s)) = + (f ∣_ U).appTop (coefficient e (restrictSection U.ι s)) := by + let F : X.Modules ⥤ (f ⁻¹ᵁ U).toScheme.Modules := + Scheme.Modules.pullback f ⋙ Scheme.Modules.restrictFunctor (f ⁻¹ᵁ U).ι + let G : X.Modules ⥤ (f ⁻¹ᵁ U).toScheme.Modules := + Scheme.Modules.restrictFunctor U.ι ⋙ Scheme.Modules.pullback (f ∣_ U) + let uF : F.obj (O X) ≅ O (f ⁻¹ᵁ U).toScheme := + (Scheme.Modules.restrictFunctor (f ⁻¹ᵁ U).ι).mapIso (pullbackUnitIso f) ≪≫ + Scheme.Modules.restrictUnitIso (f ⁻¹ᵁ U).ι + let uG : G.obj (O X) ≅ O (f ⁻¹ᵁ U).toScheme := + (Scheme.Modules.pullback (f ∣_ U)).mapIso (Scheme.Modules.restrictUnitIso U.ι) ≪≫ + pullbackUnitIso (f ∣_ U) + obtain ⟨eF,he⟩ := exists_frame_natIso F G (pullbackRestrictNatIso f U) uF uG + (pullbackFrame (f ∣_ U) e) s + refine ⟨eF, ?_⟩ + have he' : coefficient eF (restrictSection (f ⁻¹ᵁ U).ι (pullbackSection f s)) = + coefficient (pullbackFrame (f ∣_ U) e) + (pullbackSection (f ∣_ U) (restrictSection U.ι s)) := by + let P : X.Modules ⥤ Y.Modules := Scheme.Modules.pullback f + let R : Y.Modules ⥤ (f ⁻¹ᵁ U).toScheme.Modules := + Scheme.Modules.restrictFunctor (f ⁻¹ᵁ U).ι + let S : X.Modules ⥤ U.toScheme.Modules := Scheme.Modules.restrictFunctor U.ι + let Q : U.toScheme.Modules ⥤ (f ⁻¹ᵁ U).toScheme.Modules := + Scheme.Modules.pullback (f ∣_ U) + let p : P.obj (O X) ≅ O Y := pullbackUnitIso f + let r : R.obj (O Y) ≅ O (f ⁻¹ᵁ U).toScheme := + Scheme.Modules.restrictUnitIso (f ⁻¹ᵁ U).ι + let a : S.obj (O X) ≅ O U.toScheme := Scheme.Modules.restrictUnitIso U.ι + let q : Q.obj (O U.toScheme) ≅ O (f ⁻¹ᵁ U).toScheme := pullbackUnitIso (f ∣_ U) + have hl : restrictSection (f ⁻¹ᵁ U).ι (pullbackSection f s) = uF.inv ≫ F.map s := by + simp only [restrictSection, pullbackSection] + change r.inv ≫ R.map (p.inv ≫ P.map s) = (r.inv ≫ R.map p.inv) ≫ R.map (P.map s) + exact (congrArg (fun k => r.inv ≫ k) (R.map_comp p.inv (P.map s))).trans + (Category.assoc r.inv (R.map p.inv) (R.map (P.map s))).symm + have hr : pullbackSection (f ∣_ U) (restrictSection U.ι s) = uG.inv ≫ G.map s := by + change q.inv ≫ Q.map (a.inv ≫ S.map s) = (q.inv ≫ Q.map a.inv) ≫ Q.map (S.map s) + exact (congrArg (fun k => q.inv ≫ k) (Q.map_comp a.inv (S.map s))).trans + (Category.assoc q.inv (Q.map a.inv) (Q.map (S.map s))).symm + exact (congrArg (coefficient eF) hl).trans + (he.trans (congrArg (coefficient (pullbackFrame (f ∣_ U) e)) hr).symm) + rw [he', coefficient_pullback] + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/FullSupportNilpotence.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/FullSupportNilpotence.lean new file mode 100644 index 0000000000000000000000000000000000000000..23b2b693abf00e0069c8b8ab38151e7b1eb29add --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/FullSupportNilpotence.lean @@ -0,0 +1,68 @@ +import Mathlib.AlgebraicGeometry.IdealSheaf.Basic +import Mathlib.AlgebraicGeometry.Noetherian +import Mathlib.RingTheory.Noetherian.Nilpotent + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +variable {X : Scheme} + +lemma idealSheaf_le_nilradical_of_fullSupport (I : X.IdealSheafData) + (hI : I.support = ⊤) : I ≤ X.nilradical := by + have h : (⊤ : Closeds X) ≤ I.support := by rw [hI] + simpa only [Scheme.IdealSheafData.vanishingIdeal_top] using + Scheme.IdealSheafData.le_support_iff_le_vanishingIdeal.mp h + +lemma affineIdeal_isNilpotent_of_fullSupport [IsLocallyNoetherian X] + (I : X.IdealSheafData) (hI : I.support = ⊤) (U : X.affineOpens) : + IsNilpotent (I.ideal U) := by + let := IsLocallyNoetherian.component_noetherian U + apply (Ideal.FG.isNilpotent_iff_le_nilradical (IsNoetherian.noetherian _)).mpr + exact idealSheaf_le_nilradical_of_fullSupport I hI U + +theorem exists_pos_pow_eq_bot_of_fullSupport [IsNoetherian X] + (I : X.IdealSheafData) (hI : I.support = ⊤) : + ∃ n : ℕ, 0 < n ∧ I ^ n = ⊥ := by + classical + have hlocal : ∀ U : X.affineOpens, ∃ n : ℕ, I.ideal U ^ n = ⊥ := + fun U => affineIdeal_isNilpotent_of_fullSupport I hI U + choose n hn using hlocal + obtain ⟨S, hS⟩ := isCompact_univ.elim_finite_subcover + (fun U : X.affineOpens => (U.1 : Set X)) (fun U => U.1.isOpen) + (by + intro x _ + have hx : x ∈ (⨆ U : X.affineOpens, U.1) := by + rw [iSup_affineOpens_eq_top X] + trivial + obtain ⟨U, hU⟩ := Opens.mem_iSup.mp hx + exact Set.mem_iUnion.mpr ⟨U, hU⟩) + refine ⟨S.sup n + 1, Nat.succ_pos _, ?_⟩ + apply Scheme.IdealSheafData.ext_of_iSup_eq_top (fun U : S => U.val) + · apply top_unique + intro x _ + obtain ⟨U, hU⟩ := Set.mem_iUnion.mp (hS (show x ∈ Set.univ from trivial)) + obtain ⟨hUS, hxU⟩ := Set.mem_iUnion.mp hU + exact Opens.mem_iSup.mpr ⟨⟨U, hUS⟩, hxU⟩ + · intro U + change I.ideal U.val ^ (S.sup n + 1) = ⊥ + apply le_bot_iff.mp + calc + I.ideal U.val ^ (S.sup n + 1) ≤ I.ideal U.val ^ n U.val := + Ideal.pow_le_pow_right ((Finset.le_sup U.property).trans (Nat.le_succ _)) + _ = ⊥ := hn U.val + +theorem exists_pos_pow_eq_bot_of_support_univ [IsNoetherian X] + (I : X.IdealSheafData) (hI : (I.support : Set X) = Set.univ) : + ∃ n : ℕ, 0 < n ∧ I ^ n = ⊥ := + exists_pos_pow_eq_bot_of_fullSupport I (SetLike.coe_injective hI) + +theorem exists_pos_nilradical_pow_eq_bot [IsNoetherian X] : + ∃ n : ℕ, 0 < n ∧ X.nilradical ^ n = ⊥ := + exists_pos_pow_eq_bot_of_fullSupport X.nilradical X.support_nilradical + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/GeneratorsSectionCover.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/GeneratorsSectionCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..d2a704bed024dbe214d471d26aaf6ff83489e7a7 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/GeneratorsSectionCover.lean @@ -0,0 +1,161 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleAllPowersGeneration +import OAI.NumberTheory.PiExponent.Approximation.SectionOpens +import OAI.NumberTheory.PiExponent.Cohomology.FiniteCoverCohomology + +namespace OAI + +namespace PiExponent.GeneratorsSectionCover +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames PiExponentSeshadri.SectionOpens +variable {X : Scheme.{0}} + +private lemma epi_iso_comp {C : Type*} [Category C] {A B D E : C} + (i : A ≅ B) (f : B ⟶ D) (e : D ≅ E) [Epi f] : + Epi (i.hom ≫ f ≫ e.hom) := inferInstance + +private abbrev schemeFree (X : Scheme.{0}) (ι : Type) : X.Modules := + SheafOfModules.free ι + +private abbrev schemeInclusion {X : Scheme.{0}} {ι : Type} (i : ι) : + O X ⟶ schemeFree X ι := SheafOfModules.ιFree i + +def freeProjection {ι : Type} [DecidableEq ι] (i : ι) : + schemeFree X ι ⟶ O X := + Sigma.desc (C := X.Modules) (f := fun _ : ι => O X) (fun j => if j = i then 𝟙 _ else 0) + +@[simp] theorem free_inclusion_projection {ι : Type} [DecidableEq ι] (i j : ι) : + schemeInclusion j ≫ freeProjection (X := X) i = if j = i then 𝟙 _ else 0 := by + exact Sigma.ι_comp_desc (C := X.Modules) (f := fun _ : ι => O X) _ _ + +theorem free_sum_projection_inclusion {ι : Type} [Fintype ι] [DecidableEq ι] : + (∑ i : ι, freeProjection (X := X) i ≫ schemeInclusion i) = + 𝟙 (schemeFree X ι) := by + apply (SheafOfModules.isColimitFreeCofan ι).hom_ext + intro j + change schemeInclusion j.as ≫ _ = schemeInclusion j.as ≫ _ + simp only [Preadditive.comp_sum, ← Category.assoc, free_inclusion_projection] + simp only [ite_comp, Category.id_comp, zero_comp, Fintype.sum_ite_eq, Category.comp_id] + +lemma hom_sum_app {M N : X.Modules} {ι : Type} (S : Finset ι) + (f : ι → (M ⟶ N)) (V : X.Opens) (z : Γ(M,V)) : + (∑ i ∈ S, f i).app V z = ∑ i ∈ S, (f i).app V z := by + classical + induction S using Finset.induction_on with + | empty => rfl + | @insert a S ha ih => + simp only [Finset.sum_insert ha, Scheme.Modules.Hom.add_app] + change (f a).app V z + (∑ i ∈ S, f i).app V z = _ + rw [ih] + +theorem unit_epimorphism_cover {ι : Type} [Finite ι] + (f : schemeFree X ι ⟶ O X) [Epi f] : + (⨆ i : ι, isoOpen (schemeInclusion i ≫ f)) = ⊤ := by + classical + let : Fintype ι := Fintype.ofFinite ι + apply top_unique + intro x _ + let F : X.Modules ⥤ _ := SheafOfModules.toSheaf X.ringCatSheaf + have : F.PreservesEpimorphisms := + inferInstanceAs (SheafOfModules.toSheaf X.ringCatSheaf).PreservesEpimorphisms + have hFf : Epi (F.map f) := F.map_epi f + have hloc : TopCat.Presheaf.IsLocallySurjective (F.map f).hom := + (TopCat.Sheaf.isLocallySurjective_iff_epi _).mpr hFf + obtain ⟨V, hV, ⟨z, hz⟩, hxV⟩ := + (TopCat.Presheaf.isLocallySurjective_iff _).mp hloc ⊤ (1 : Γ(X,⊤)) x trivial + change Scheme.Modules.Hom.app f V z = X.presheaf.map (homOfLE hV).op (1 : Γ(X,⊤)) at hz + rw [map_one] at hz + have he : (∑ i : ι, freeProjection (X := X) i ≫ (schemeInclusion i ≫ f)) = f := by + simp only [← Category.assoc] + rw [← Preadditive.sum_comp, free_sum_projection_inclusion, Category.id_comp] + have hsum : (∑ i : ι, Scheme.Modules.Hom.app (schemeInclusion i ≫ f) V + (Scheme.Modules.Hom.app (freeProjection (X := X) i) V z)) = (1 : Γ(X,V)) := by + exact (hom_sum_app Finset.univ + (fun i => freeProjection (X := X) i ≫ (schemeInclusion i ≫ f)) V z).symm.trans + ((congrArg (fun q : (schemeFree X ι : X.Modules) ⟶ O X => + Scheme.Modules.Hom.app q V z) he).trans hz) + have hsum' : (∑ i : ι, X.presheaf.germ V x hxV + (Scheme.Modules.Hom.app (schemeInclusion i ≫ f) V (Scheme.Modules.Hom.app (freeProjection (X := X) i) V z))) = 1 := by + exact (map_sum (X.presheaf.germ V x hxV).hom _ _).symm.trans + ((congrArg (X.presheaf.germ V x hxV) hsum).trans (X.presheaf.germ V x hxV).hom.map_one) + obtain ⟨i, _, hi⟩ := IsLocalRing.exists_of_isUnit_sum (hsum' ▸ isUnit_one) + have hc : IsUnit (X.presheaf.germ ⊤ x trivial + (endValue (schemeInclusion i ≫ f))) := by + let si : O X ⟶ O X := schemeInclusion i ≫ f + let a : Γ(X,V) := Scheme.Modules.Hom.app (freeProjection (X := X) i) V z + have ht := end_apply si V a + have hi' : IsUnit (X.presheaf.germ V x hxV + (a * (show Γ(X,V) from si.app V (1 : Γ(X,V))))) := ht ▸ hi + have hc' : IsUnit (X.presheaf.germ V x hxV + (show Γ(X,V) from si.app V (1 : Γ(X,V)))) := by + rw [map_mul] at hi' + exact isUnit_of_mul_isUnit_right hi' + have hcoeff := congrArg (fun z : Γ(X,V) => X.presheaf.germ V x hxV z) + (end_naturality si V) + rw [X.presheaf.germ_res_apply] at hcoeff + exact hcoeff ▸ hc' + apply Opens.mem_iSup.mpr + refine ⟨i, ?_⟩ + erw [isoOpen_eq_basicOpen (Iso.refl (O X))] + change x ∈ X.basicOpen (endValue (schemeInclusion i ≫ f)) + exact (X.mem_basicOpen (endValue (schemeInclusion i ≫ f)) x (show x ∈ (⊤ : X.Opens) from trivial)).mpr hc + +def generatorSection (L : LineBundle X) (G : L.sheaf.GeneratingSections) (i : G.I) : + GlobalSections X L.sheaf := schemeInclusion i ≫ G.π + +theorem generators_sectionOpen_cover (L : LineBundle X) + (G : L.sheaf.GeneratingSections) [G.IsFiniteType] : + (⨆ i : G.I, sectionOpen X (generatorSection L G i)) = ⊤ := by + apply top_unique + intro x _ + obtain ⟨U, hx, ⟨e⟩⟩ := L.locallyRankOne x + let F : SheafOfModules X.ringCatSheaf ⥤ SheafOfModules U.toScheme.ringCatSheaf := + Scheme.Modules.restrictFunctor U.ι + have : PreservesColimitsOfSize.{0,0} F := + inferInstanceAs (PreservesColimitsOfSize.{0,0} (Scheme.Modules.restrictFunctor U.ι)) + let η := (Scheme.Modules.restrictUnitIso U.ι).symm + let f : schemeFree U.toScheme G.I ⟶ O U.toScheme := + (SheafOfModules.mapFreeIso F G.I η).hom ≫ F.map G.π ≫ e.hom + have hπ : Epi (F.map G.π) := @Functor.map_epi _ _ _ _ F _ _ _ G.π G.epi + have : Epi f := @epi_iso_comp _ _ _ _ _ _ + (SheafOfModules.mapFreeIso F G.I η) (F.map G.π) e hπ + let : Finite G.I := (inferInstance : G.IsFiniteType).finite + have hf := unit_epimorphism_cover f + obtain ⟨i, hi⟩ := Opens.mem_iSup.mp + (show (⟨x,hx⟩ : U.toScheme) ∈ ⨆ i : G.I, isoOpen (schemeInclusion i ≫ f) by + rw [hf]; trivial) + have he : schemeInclusion i ≫ f = + restrictSection U.ι (generatorSection L G i) ≫ e.hom := by + dsimp only [f, generatorSection, restrictSection] + erw [← Category.assoc, ← Category.assoc, SheafOfModules.ιFree_mapFreeIso_hom] + erw [F.map_comp] + exact Category.assoc _ _ _ + erw [he, isoOpen_postcomp, isoOpen_restrictSection] at hi + exact Opens.mem_iSup.mpr ⟨i, hi⟩ + +theorem exists_fin_section_cover (L : LineBundle X) + (G : L.sheaf.GeneratingSections) [G.IsFiniteType] : + ∃ k : ℕ, ∃ s : Fin k → GlobalSections X L.sheaf, + (⨆ i, sectionOpen X (s i)) = ⊤ := by + let : Finite G.I := (inferInstance : G.IsFiniteType).finite + let : Fintype G.I := Fintype.ofFinite G.I + let e := (Fintype.equivFin G.I).symm + exact ⟨Fintype.card G.I, fun i => generatorSection L G (e i), + (e.iSup_comp (g := fun i => sectionOpen X (generatorSection L G i))).trans + (generators_sectionOpen_cover L G)⟩ + +theorem ample_eventual_fin_section_cover [NoetherianSpace X] + (L : LineBundle X) (hL : L.IsAmple) : + ∃ N : ℕ, ∀ n ≥ N, ∃ k : ℕ, + ∃ s : Fin k → GlobalSections X (modulePow X L.sheaf n), + (⨆ i, sectionOpen X (s i)) = ⊤ := by + obtain ⟨N, hN⟩ := AmpleGlobalGeneration.ample_eventual_power_global_generators L hL + refine ⟨N, fun n hn => ?_⟩ + obtain ⟨G, hG⟩ := hN n hn + let : G.IsFiniteType := hG + exact @exists_fin_section_cover X (L.pow n) G hG + +end +end PiExponent.GeneratorsSectionCover + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/GenericFibreRigidity.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/GenericFibreRigidity.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5177191ad888149191c43d932d3bcfd5416cabc --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/GenericFibreRigidity.lean @@ -0,0 +1,99 @@ +import OAI.NumberTheory.PiExponent.Approximation.FibreNormalRigidity +import OAI.NumberTheory.PiExponent.Approximation.GenericNormalRigidity + +namespace OAI + +noncomputable section + +namespace PiExponent + +open Module MvPolynomial NormalBasisRigidity + +variable {C E ι : Type*} [Field C] [CharZero C] [IsAlgClosed C] + [Field E] [Algebra C E] [Algebra.EssFiniteType C E] + [Fintype ι] [LinearOrder ι] + +abbrev genericCoordinateNormals (φ : MvPolynomial ι C →ₐ[C] E) + (Q : Ideal (MvPolynomial ι C)) : ι → PolynomialNormal φ Q := + fun i => (polynomialTangent φ Q).mkQ (Pi.basisFun E ι i) + +omit [LinearOrder ι] in +theorem coordinate_constant_of_generic_unique_normal_basis + (φ : MvPolynomial ι C →ₐ[C] E) (Q : Ideal (MvPolynomial ι C)) + (hker : ∀ p, φ p = 0 ↔ p ∈ Q) (hQ : Q ≠ ⊥) + (hunique : ∀ A B : Finset ι, + IsNormalBasis (K := E) (genericCoordinateNormals φ Q) A → + IsNormalBasis (K := E) (genericCoordinateNormals φ Q) B → A = B) : + ∃ i : ι, ∃ c : C, X i - MvPolynomial.C c ∈ Q := by + let q := (polynomialTangent φ Q).mkQ + let b := Pi.basisFun E ι + have hq : q ≠ 0 := polynomialNormal_mkQ_ne_zero_of_kernel φ Q hker hQ + have hex : ∃ i, q (b i) ≠ 0 := by + by_contra! h + apply hq + exact b.ext h + obtain ⟨i, hi⟩ := hex + obtain ⟨A, hiA, hA⟩ := exists_normalBasis_containing (fun j => q (b j)) + (polynomialNormal_span φ Q b) i hi + have hmand : ∀ B, IsNormalBasis (K := E) (fun j => q (b j)) B → i ∈ B := by + intro B hB + rw [← hunique A B hA hB] + exact hiA + have htangent : ∀ t ∈ polynomialTangent φ Q, t i = 0 := by + intro t ht + have hh := mandatory_coordinate_eq_zero b q (polynomialNormal_span φ Q b) + i hmand t ((Submodule.Quotient.mk_eq_zero _).mpr ht) + simpa only [b, Pi.basisFun_repr] using hh + have hD := differential_eq_zero_of_polynomialTangent φ Q + (fun p hp => (hker p).mpr hp) i htangent + obtain ⟨c, hc⟩ := constant_of_differential_eq_zero (φ (X i)) hD + refine ⟨i, c, (hker _).mp ?_⟩ + simp only [map_sub, MvPolynomial.algHom_C, hc, sub_self] + +theorem coordinate_constant_of_generic_normal_separation + (φ : MvPolynomial ι C →ₐ[C] E) (Q : Ideal (MvPolynomial ι C)) + (hker : ∀ p, φ p = 0 ↔ p ∈ Q) (hQ : Q ≠ ⊥) + (hexclude : ∀ A B : Finset ι, + IsNormalBasis (K := E) (genericCoordinateNormals φ Q) A → + IsNormalBasis (K := E) (genericCoordinateNormals φ Q) B → + ∀ i, i ∈ A → i ∉ B → (∀ j, i < j → (j ∈ A ↔ j ∈ B)) → False) : + ∃ i : ι, ∃ c : C, X i - MvPolynomial.C c ∈ Q := by + apply coordinate_constant_of_generic_unique_normal_basis φ Q hker hQ + exact normalBasis_unique_of_discrepancy_excluded _ hexclude + +theorem coordinate_constant_of_generic_normal_weight_comparison + (φ : MvPolynomial ι C →ₐ[C] E) (Q : Ideal (MvPolynomial ι C)) + (hker : ∀ p, φ p = 0 ↔ p ∈ Q) (hQ : Q ≠ ⊥) + (w cost : ι → ℝ) (M : ℝ) + (hcomparison : ∀ A B, + IsNormalBasis (K := E) (genericCoordinateNormals φ Q) A → + IsNormalBasis (K := E) (genericCoordinateNormals φ Q) B → + (∏ j ∈ A, w j) ≤ M * ∏ j ∈ B, cost j) + (hseparated : ∀ A B : Finset ι, A.card = B.card → + ∀ i, i ∈ A → i ∉ B → (∀ j, i < j → (j ∈ A ↔ j ∈ B)) → + M * (∏ j ∈ B, cost j) < ∏ j ∈ A, w j) : + ∃ i : ι, ∃ c : C, X i - MvPolynomial.C c ∈ Q := by + apply coordinate_constant_of_generic_normal_separation φ Q hker hQ + intro A B hA hB i hiA hiB hlarge + exact (not_lt_of_ge (hcomparison A B hA hB)) + (hseparated A B (hA.card_eq.trans hB.card_eq.symm) i hiA hiB hlarge) + +theorem generic_normal_separation_at_most_one_center {J : Type*} + (φ : MvPolynomial ι C →ₐ[C] E) (Q : Ideal (MvPolynomial ι C)) + (hker : ∀ p, φ p = 0 ↔ p ∈ Q) (hQ : Q ≠ ⊥) + (hexclude : ∀ A B : Finset ι, + IsNormalBasis (K := E) (genericCoordinateNormals φ Q) A → + IsNormalBasis (K := E) (genericCoordinateNormals φ Q) B → + ∀ i, i ∈ A → i ∉ B → (∀ j, i < j → (j ∈ A ↔ j ∈ B)) → False) + (centers : J → ι → C) (hinj : ∀ i, Function.Injective (fun j => centers j i)) + (j k : J) + (hj : ∀ p ∈ Q, MvPolynomial.eval (centers j) p = 0) + (hk : ∀ p ∈ Q, MvPolynomial.eval (centers k) p = 0) : j = k := by + obtain ⟨i, c, hc⟩ := coordinate_constant_of_generic_normal_separation φ Q hker hQ hexclude + exact coordinate_constant_at_most_one_center Q centers i c hc (hinj i) j k hj hk + +end PiExponent + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/GenericNormalRigidity.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/GenericNormalRigidity.lean new file mode 100644 index 0000000000000000000000000000000000000000..39d35d3b2effa25c6cba7dbd3c045c75f07d8f9b --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/GenericNormalRigidity.lean @@ -0,0 +1,65 @@ +import OAI.NumberTheory.PiExponent.LocalAlgebra.PrimeNormalRigidity + +namespace OAI + +noncomputable section +namespace PiExponent +open Module MvPolynomial NormalBasisRigidity + +variable {C E ι : Type*} [Field C] [CharZero C] [Field E] [Algebra C E] [Fintype ι] + +theorem polynomialNormal_mkQ_ne_zero_of_kernel + (φ : MvPolynomial ι C →ₐ[C] E) (Q : Ideal (MvPolynomial ι C)) + (hker : ∀ p, φ p = 0 ↔ p ∈ Q) (hQ : Q ≠ ⊥) : + (polynomialTangent φ Q).mkQ ≠ 0 := by + classical + intro hzero + have htop : polynomialTangent φ Q = ⊤ := by + rw [← Submodule.ker_mkQ (polynomialTangent φ Q), hzero, LinearMap.ker_zero] + apply hQ + apply ideal_eq_bot_of_pderiv_stable Q + · intro h + have hh := (hker 1).mpr (by rw [h]; trivial) + exact (one_ne_zero : (1 : E) ≠ 0) (by simpa only [map_one] using hh) + · intro p hp i + apply (hker _).mp + have ht : (Pi.single i 1 : ι → E) ∈ polynomialTangent φ Q := by rw [htop]; trivial + change polynomialJacobian φ Q (Pi.single i 1) = 0 at ht + have hh := congrFun ht ⟨p, hp⟩ + simpa [polynomialJacobian, Pi.single_apply] using hh + +theorem constant_zeroth_coordinate_of_generic_normal_separation + [IsAlgClosed C] [Algebra.EssFiniteType C E] {m : ℕ} + (φ : MvPolynomial (Fin (m + 1)) C →ₐ[C] E) + (Q : Ideal (MvPolynomial (Fin (m + 1)) C)) + (hker : ∀ p, φ p = 0 ↔ p ∈ Q) (hQ : Q ≠ ⊥) + (hy : φ (X (0 : Fin (m + 1))) ≠ 0) + (hexclude : ∀ A B : Finset (Fin (m + 1)), + IsNormalBasis (K := E) + (fun j => (polynomialTangent φ Q).mkQ (Pi.basisFun E _ j)) A → + IsNormalBasis (K := E) + (fun j => (polynomialTangent φ Q).mkQ (frameBasis m (φ (X 0)) hy j)) B → + ∀ i, i ≠ 0 → i ∈ A → i ∉ B → + (∀ j, i < j → (j ∈ A ↔ j ∈ B)) → False) : + ∃ c : C, X (0 : Fin (m + 1)) - MvPolynomial.C c ∈ Q := by + let q := (polynomialTangent φ Q).mkQ + have hvan : ∀ p ∈ Q, φ p = 0 := fun p hp => (hker p).mpr hp + have hd := normal_basis_differential_dichotomy m (φ (X 0)) hy q + (Submodule.mkQ_surjective _) (polynomialNormal_mkQ_ne_zero_of_kernel φ Q hker hQ) hexclude + have hconst : ∃ c : C, algebraMap C E c = φ (X (0 : Fin (m + 1))) := by + rcases hd with hzero | ⟨i, hlog⟩ + · exact constant_of_differential_eq_zero (φ (X 0)) + (differential_eq_zero_of_polynomialTangent φ Q hvan 0 + (fun t ht => hzero t ((Submodule.Quotient.mk_eq_zero _).mpr ht))) + · exact constant_of_logarithmic_differential (φ (X i.succ)) (φ (X 0)) + (logarithmic_differential_of_polynomialTangent φ Q hvan i.succ 0 + (fun t ht => hlog t ((Submodule.Quotient.mk_eq_zero _).mpr ht))) + obtain ⟨c, hc⟩ := hconst + refine ⟨c, (hker _).mp ?_⟩ + simp only [map_sub, MvPolynomial.algHom_C, hc, sub_self] + +end PiExponent + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/GlobalClosedAnnihilatedDescent.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/GlobalClosedAnnihilatedDescent.lean new file mode 100644 index 0000000000000000000000000000000000000000..110afae95e44cbe7225f7003100c772ce02103b7 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/GlobalClosedAnnihilatedDescent.lean @@ -0,0 +1,50 @@ +import OAI.NumberTheory.PiExponent.Approximation.AffineClosedAnnihilatedDescent +import OAI.NumberTheory.PiExponent.Approximation.ClosedImmersionModules +import OAI.NumberTheory.PiExponent.Approximation.ClosedPullbackUnitRestriction +import OAI.NumberTheory.PiExponent.Approximation.ModulePullbackCoherent + +namespace OAI + +namespace PiExponentSeshadri.ClosedAnnihilatedDescent +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace Opposite +variable {X Y : Scheme.{0}} (f : Y ⟶ X) + +def LocallyAnnihilated (M : X.Modules) : Prop := + ∀ U : X.affineOpens, + RingHom.ker (f ∣_ U.1).appTop.hom ≤ + Module.annihilator Γ(U.1.toScheme,⊤) Γ(M.restrict U.1.ι,⊤) + +theorem unit_isIso_of_locallyAnnihilated [IsClosedImmersion f] + (M : X.Modules) [M.IsQuasicoherent] (h : LocallyAnnihilated f M) : + IsIso ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M) := by + apply ClosedPullbackUnitRestriction.unit_isIso_of_affine f M + intro U + let : IsAffine U.1.toScheme := U.2 + obtain ⟨N, ⟨e⟩⟩ := exists_affine_closed_descent (f ∣_ U.1) (M.restrict U.1.ι) (h U) + exact ClosedImmersionModules.unit_isIso_of_pushforward (f ∣_ U.1) e.symm + +def closedDescentPushforwardIso [IsClosedImmersion f] + (M : X.Modules) [M.IsQuasicoherent] (h : LocallyAnnihilated f M) : + (Scheme.Modules.pushforward f).obj ((Scheme.Modules.pullback f).obj M) ≅ M := by + let := unit_isIso_of_locallyAnnihilated f M h + exact (asIso ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M)).symm + +theorem exists_closed_descent [IsClosedImmersion f] + (M : X.Modules) [M.IsQuasicoherent] (h : LocallyAnnihilated f M) : + ∃ N : Y.Modules, Nonempty ((Scheme.Modules.pushforward f).obj N ≅ M) := + ⟨(Scheme.Modules.pullback f).obj M, ⟨closedDescentPushforwardIso f M h⟩⟩ + +theorem exists_closed_coherent_descent [IsClosedImmersion f] + (M : X.Modules) [M.IsFinitePresentation] (h : LocallyAnnihilated f M) : + ∃ N : Y.Modules, N.IsFinitePresentation ∧ + Nonempty ((Scheme.Modules.pushforward f).obj N ≅ M) := by + let : M.IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData M).choose.isQuasicoherent + exact ⟨(Scheme.Modules.pullback f).obj M, Geometry.pullback_isFinitePresentation f M, + ⟨closedDescentPushforwardIso f M h⟩⟩ + +end +end PiExponentSeshadri.ClosedAnnihilatedDescent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/GlobalSectionClearing.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/GlobalSectionClearing.lean new file mode 100644 index 0000000000000000000000000000000000000000..469bc21e1db640aba19810e1d9c6fa59dec51d96 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/GlobalSectionClearing.lean @@ -0,0 +1,486 @@ +import Mathlib + +namespace OAI + +namespace PiExponent.GlobalSectionClearing +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +universe u +variable {X Y : Scheme.{u}} + +def restrictScalar (X : Scheme.{u}) (U : X.Opens) : Γ(X, ⊤) →+* Γ(X, U) := + (X.presheaf.map (homOfLE le_top).op).hom + +lemma restrictScalar_naturality (X : Scheme.{u}) {U V : X.Opens} (i : U ⟶ V) (r : Γ(X, ⊤)) : + X.presheaf.map i.op (restrictScalar X V r) = restrictScalar X U r := by + change (X.presheaf.map (homOfLE le_top).op ≫ X.presheaf.map i.op) r = _ + rw [← X.presheaf.map_comp] + rfl + +def OpenSections (M : X.Modules) (U : X.Opens) := Γ(M,U) +instance (M : X.Modules) (U : X.Opens) : AddCommGroup (OpenSections M U) := + inferInstanceAs (AddCommGroup Γ(M,U)) +instance (M : X.Modules) (U : X.Opens) : Module Γ(X,⊤) (OpenSections M U) := + Module.compHom Γ(M,U) (restrictScalar X U) + +def openRestriction (M : X.Modules) {U V : X.Opens} (h : U ≤ V) : + OpenSections M V →ₗ[Γ(X,⊤)] OpenSections M U where + toFun := M.val.map (homOfLE h).op + map_add' := map_add _ + map_smul' := by + intro r m + let : Module Γ(X,V) (OpenSections M V) := (M.val.obj (op V)).isModule + let : Module Γ(X,U) (OpenSections M U) := (M.val.obj (op U)).isModule + change M.presheaf.map (homOfLE h).op (restrictScalar X V r • (m : Γ(M,V))) = + restrictScalar X U r • M.presheaf.map (homOfLE h).op m + erw [M.map_smul, restrictScalar_naturality] + +theorem quasicoherent_pushforward_iso (e : X ≅ Y) (M : X.Modules) [M.IsQuasicoherent] : + ((Scheme.Modules.pushforward e.hom).obj M).IsQuasicoherent := by + let N := (Scheme.Modules.pushforward e.hom).obj M + let q : (Scheme.Modules.pushforward e.inv).obj N ≅ M := + (Scheme.Modules.pushforwardComp e.hom e.inv).app M ≪≫ + (Scheme.Modules.pushforwardCongr e.hom_inv_id).app M ≪≫ + (Scheme.Modules.pushforwardId X).app M + let j : N ≅ M.restrict e.inv := + ((Scheme.Modules.restrictFunctorAdjCounitIso e.inv).app N).symm ≪≫ + (Scheme.Modules.restrictFunctor e.inv).mapIso q + exact (SheafOfModules.isQuasicoherent Y.ringCatSheaf).prop_of_iso j.symm inferInstance + +abbrev affineToSpecModule [IsAffine X] (M : X.Modules) := + (Scheme.Modules.pushforward X.toSpecΓ).obj M + +instance affineToSpecModule_quasicoherent [IsAffine X] (M : X.Modules) + [M.IsQuasicoherent] : (affineToSpecModule M).IsQuasicoherent := + quasicoherent_pushforward_iso X.isoSpec M + +theorem affine_sections_localize [IsAffine X] (M : X.Modules) [M.IsQuasicoherent] + (r : Γ(X,⊤)) : + IsLocalizedModule.Away r + (((modulesSpecToSheaf.obj (affineToSpecModule M)).obj.map + (PrimeSpectrum.basicOpen r).leTop.op).hom) := + ((isIso_fromTildeΓ_iff_isLocalizing (affineToSpecModule M)).mp inferInstance) r + +def affineSpecSections [IsAffine X] (M : X.Modules) + (U : (Spec Γ(X,⊤)).Opens) : + ((modulesSpecToSheaf.obj (affineToSpecModule M)).obj.obj (op U)) ≃ₗ[Γ(X,⊤)] + OpenSections M (X.toSpecΓ ⁻¹ᵁ U) where + toFun := fun x => x + invFun := fun x => x + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' r m := by + let : Module Γ(X,X.toSpecΓ ⁻¹ᵁ U) Γ(M,X.toSpecΓ ⁻¹ᵁ U) := + (M.val.obj (op (X.toSpecΓ ⁻¹ᵁ U))).isModule + change @SMul.smul Γ(X,X.toSpecΓ ⁻¹ᵁ U) Γ(M,X.toSpecΓ ⁻¹ᵁ U) _ + ((X.toSpecΓ.app U).hom + ((Spec Γ(X,⊤)).presheaf.map U.leTop.op ((Scheme.ΓSpecIso Γ(X,⊤)).inv r))) m = + @SMul.smul Γ(X,X.toSpecΓ ⁻¹ᵁ U) Γ(M,X.toSpecΓ ⁻¹ᵁ U) _ + (restrictScalar X (X.toSpecΓ ⁻¹ᵁ U) r) m + congr 1 + have h := congrArg (fun f : Γ(Spec Γ(X,⊤),⊤) ⟶ Γ(X,X.toSpecΓ ⁻¹ᵁ U) => + f ((Scheme.ΓSpecIso Γ(X,⊤)).inv r)) (X.toSpecΓ.naturality U.leTop.op) + simp only [CommRingCat.comp_apply, Scheme.toSpecΓ_appTop] at h + change _ = restrictScalar X (X.toSpecΓ ⁻¹ᵁ U) + ((Scheme.ΓSpecIso Γ(X,⊤)).hom ((Scheme.ΓSpecIso Γ(X,⊤)).inv r)) at h + rw [(Scheme.ΓSpecIso Γ(X,⊤)).inv_hom_id_apply r] at h + exact h + +def openSectionsCongr (M : X.Modules) {U V : X.Opens} (h : U = V) : + OpenSections M U ≃ₗ[Γ(X,⊤)] OpenSections M V := by + subst V + exact LinearEquiv.refl _ _ + +lemma openSectionsCongr_restriction (M : X.Modules) {U V : X.Opens} (h : U = V) + (m : OpenSections M ⊤) : + openSectionsCongr M h (openRestriction M (show U ≤ ⊤ from le_top) m) = openRestriction M (show V ≤ ⊤ from le_top) m := by + subst V + rfl + +theorem affine_openRestriction_localize [IsAffine X] (M : X.Modules) [M.IsQuasicoherent] + (r : Γ(X,⊤)) : + IsLocalizedModule.Away r (openRestriction M (X.basicOpen_le r)) := by + let F := modulesSpecToSheaf.obj (affineToSpecModule M) + let f := (F.obj.map (PrimeSpectrum.basicOpen r).leTop.op).hom + let e0 : (F.obj.obj (op ⊤)) ≃ₗ[Γ(X,⊤)] OpenSections M ⊤ := affineSpecSections M ⊤ + let e1 := (affineSpecSections M (PrimeSpectrum.basicOpen r)).trans + (openSectionsCongr M (Scheme.toSpecΓ_preimage_basicOpen X r)) + have hf : IsLocalizedModule.Away r f := affine_sections_localize M r + have hq : IsLocalizedModule.Away r (e1.toLinearMap ∘ₗ f ∘ₗ e0.symm.toLinearMap) := by + let := hf + let := IsLocalizedModule.of_linearEquiv (.powers r) f e1 + exact IsLocalizedModule.of_linearEquiv_right (.powers r) (e1.toLinearMap ∘ₗ f) e0.symm + have he : e1.toLinearMap ∘ₗ f ∘ₗ e0.symm.toLinearMap = + openRestriction M (X.basicOpen_le r) := by + ext m + exact openSectionsCongr_restriction M (Scheme.toSpecΓ_preimage_basicOpen X r) m + rwa [he] at hq + +theorem affine_basicOpen_denominators [IsAffine X] (M : X.Modules) [M.IsQuasicoherent] + (r : Γ(X,⊤)) (x : OpenSections M (X.basicOpen r)) : + ∃ n : ℕ, ∃ y : OpenSections M ⊤, + openRestriction M (X.basicOpen_le r) y = r^n • x := by + let f := openRestriction M (X.basicOpen_le r) + let : IsLocalizedModule.Away r f := affine_openRestriction_localize M r + obtain ⟨n,y,hy⟩ := (inferInstance : IsLocalizedModule.Away r f).surj _ _ x + exact ⟨n,y,hy.symm⟩ + +def openTopSections (M : X.Modules) : + letI : Module Γ(X,⊤) Γ(M,⊤) := (M.val.obj (op ⊤)).isModule + OpenSections M ⊤ ≃ₗ[Γ(X,⊤)] Γ(M,⊤) := by + letI : Module Γ(X,⊤) Γ(M,⊤) := (M.val.obj (op ⊤)).isModule + refine { toFun := fun x => x + invFun := fun x => x + left_inv := fun _ => rfl + right_inv := fun _ => rfl + map_add' := fun _ _ => rfl + map_smul' := ?_ } + intro r m + change @SMul.smul Γ(X,⊤) Γ(M,⊤) _ (restrictScalar X ⊤ r) m = + @SMul.smul Γ(X,⊤) Γ(M,⊤) _ r m + congr 1 + change (X.presheaf.map (𝟙 (op ⊤))) r = r + rw [X.presheaf.map_id] + rfl + +lemma restrictScalar_appIso (f : Y ⟶ X) [IsOpenImmersion f] (U : Y.Opens) + (r : Γ(X,⊤)) : + (f.appIso U).inv (restrictScalar Y U (f.appTop r)) = + restrictScalar X (f ''ᵁ U) r := by + have h := congrArg (fun g : Γ(X,⊤) ⟶ Γ(X,f ''ᵁ U) => g r) + (Scheme.Hom.appLE_appIso_inv f (U := ⊤) (V := U) (by simp)) + change (f.appIso U).inv ((f.appLE ⊤ U (by simp)) r) = _ at h + have he : f.appLE ⊤ U (by simp) = f.appTop ≫ Y.presheaf.map U.leTop.op := by + erw [Scheme.Hom.appTop, Scheme.Hom.app_eq_appLE, Scheme.Hom.appLE_map] + rw [he] at h + exact h + +def restrictedOpenSections (M : X.Modules) (f : Y ⟶ X) [IsOpenImmersion f] + (U : Y.Opens) : + letI := Module.compHom (OpenSections (M.restrict f) U) f.appTop.hom + OpenSections (M.restrict f) U ≃ₗ[Γ(X,⊤)] OpenSections M (f ''ᵁ U) := by + letI := Module.compHom (OpenSections (M.restrict f) U) f.appTop.hom + letI : Module Γ(X,f ''ᵁ U) Γ(M,f ''ᵁ U) := (M.val.obj (op (f ''ᵁ U))).isModule + refine { toFun := fun x => x + invFun := fun x => x + left_inv := fun _ => rfl + right_inv := fun _ => rfl + map_add' := fun _ _ => rfl + map_smul' := ?_ } + intro r m + change @SMul.smul Γ(X,f ''ᵁ U) Γ(M,f ''ᵁ U) _ + ((f.appIso U).inv (restrictScalar Y U (f.appTop r))) m = + @SMul.smul Γ(X,f ''ᵁ U) Γ(M,f ''ᵁ U) _ (restrictScalar X (f ''ᵁ U) r) m + rw [restrictScalar_appIso] + +lemma restrictedOpenSections_naturality (M : X.Modules) (f : Y ⟶ X) [IsOpenImmersion f] + {U V : Y.Opens} (h : U ≤ V) (m : OpenSections (M.restrict f) V) : + restrictedOpenSections M f U (openRestriction (M.restrict f) h m) = + openRestriction M (f.image_mono h) (restrictedOpenSections M f V m) := rfl + +theorem affine_basicOpen_zero [IsAffine X] (M : X.Modules) [M.IsQuasicoherent] + (r : Γ(X,⊤)) (x : OpenSections M ⊤) + (hx : openRestriction M (X.basicOpen_le r) x = 0) : + ∃ N : ℕ, ∀ n ≥ N, r ^ n • x = 0 := by + let := affine_openRestriction_localize M r + obtain ⟨⟨_, N, rfl⟩, hN⟩ := + (IsLocalizedModule.eq_zero_iff (.powers r) + (openRestriction M (X.basicOpen_le r))).mp hx + change r ^ N • x = 0 at hN + refine ⟨N, fun n hn => ?_⟩ + rw [← Nat.sub_add_cancel hn, pow_add, mul_smul, hN, smul_zero] + +lemma openRestriction_comp_apply (M : X.Modules) {U V W : X.Opens} + (hUV : U ≤ V) (hVW : V ≤ W) (x : OpenSections M W) : + openRestriction M hUV (openRestriction M hVW x) = + openRestriction M (hUV.trans hVW) x := by + change M.presheaf.map _ (M.presheaf.map _ x) = M.presheaf.map _ x + erw [← M.presheaf.map_comp_apply, ← op_comp, homOfLE_comp] + +lemma openRestriction_zero_congr (M : X.Modules) {U V W : X.Opens} + (e : U = V) (hU : U ≤ W) (hV : V ≤ W) (x : OpenSections M W) + (h : openRestriction M hU x = 0) : openRestriction M hV x = 0 := by + subst V + exact h + +lemma affine_immersion_zero_on [IsAffine Y] (M : X.Modules) [M.IsQuasicoherent] + (f : Y ⟶ X) [IsOpenImmersion f] (r : Γ(X,⊤)) + (U : X.Opens) (hU : f ''ᵁ (⊤ : Y.Opens) ≤ U) (x : OpenSections M U) + (hx : openRestriction M (show U ⊓ X.basicOpen r ≤ U from inf_le_left) x = 0) : + ∃ N : ℕ, ∀ n ≥ N, + openRestriction M hU (r ^ n • x) = 0 := by + let x' := (restrictedOpenSections M f ⊤).symm + (openRestriction M hU x) + have hWD : f ''ᵁ (Y.basicOpen (f.appTop r)) ≤ U ⊓ X.basicOpen r := by + apply le_inf + · exact (f.image_mono le_top).trans hU + · rw [← Scheme.preimage_basicOpen_top] + exact f.image_preimage_le _ + have hx' : openRestriction (M.restrict f) (Y.basicOpen_le (f.appTop r)) x' = 0 := by + apply (restrictedOpenSections M f _).injective + rw [map_zero, restrictedOpenSections_naturality] + simp only [x', LinearEquiv.apply_symm_apply] + rw [openRestriction_comp_apply] + rw [← openRestriction_comp_apply M hWD (show U ⊓ X.basicOpen r ≤ U from inf_le_left) x, hx, map_zero] + obtain ⟨N, hN⟩ := affine_basicOpen_zero (M.restrict f) (f.appTop r) x' hx' + refine ⟨N, fun n hn => ?_⟩ + have hi := congrArg (restrictedOpenSections M f ⊤) (hN n hn) + let : Module Γ(X,⊤) (OpenSections (M.restrict f) ⊤) := + Module.compHom (OpenSections (M.restrict f) ⊤) f.appTop.hom + have hscalar : (f.appTop r) ^ n • x' = (r ^ n) • x' := by + change (f.appTop r) ^ n • x' = f.appTop (r ^ n) • x' + rw [map_pow] + rw [hscalar, map_smul, map_zero] at hi + simpa only [x', LinearEquiv.apply_symm_apply, map_smul] using hi + +theorem compact_open_section_zero (M : X.Modules) [M.IsQuasicoherent] + (r : Γ(X,⊤)) (U : X.Opens) (hU : IsCompact (U : Set X)) + (x : OpenSections M U) + (hx : openRestriction M (show U ⊓ X.basicOpen r ≤ U from inf_le_left) x = 0) : + ∃ N : ℕ, ∀ n ≥ N, r ^ n • x = 0 := by + classical + obtain ⟨s, hs, e⟩ := isCompact_and_isOpen_iff_finite_and_eq_biUnion_affineOpens.mp + ⟨hU, U.2⟩ + replace e : U = iSup fun i : s => (i : X.Opens) := by + ext1 + simpa using e + have h₁ (i : s) : i.1.1 ≤ U := by + rw [e] + exact le_iSup (fun i : s => (i : X.Opens)) i + have H (i : s) : ∃ N : ℕ, ∀ n ≥ N, + openRestriction M (h₁ i) (r ^ n • x) = 0 := by + let : IsAffine i.1.1.toScheme := i.1.2 + have hh := affine_immersion_zero_on M i.1.1.ι r U + (by simpa only [Scheme.Opens.ι_image_top] using h₁ i) x hx + obtain ⟨N, hN⟩ := hh + exact ⟨N, fun n hn => openRestriction_zero_congr M i.1.1.ι_image_top _ _ _ (hN n hn)⟩ + choose n hn using H + have := hs.to_subtype + let := Fintype.ofFinite s + refine ⟨Finset.univ.sup n, fun k hk => ?_⟩ + apply TopCat.Sheaf.eq_of_locally_eq' ⟨_, M.isSheaf⟩ (fun i : s => (i : X.Opens)) U + (fun i => homOfLE (h₁ i)) (by rw [e]) + intro i + have hi := hn i k ((Finset.le_sup (f := n) (Finset.mem_univ i)).trans hk) + change M.presheaf.map _ (r ^ k • x) = M.presheaf.map _ 0 + rw [map_zero] + exact hi + +theorem global_section_zero [CompactSpace X] (M : X.Modules) [M.IsQuasicoherent] + (r : Γ(X,⊤)) (x : OpenSections M ⊤) + (hx : openRestriction M (X.basicOpen_le r) x = 0) : + ∃ N : ℕ, ∀ n ≥ N, r ^ n • x = 0 := by + apply compact_open_section_zero M r ⊤ isCompact_univ x + exact openRestriction_zero_congr M (top_inf_eq (a := X.basicOpen r)).symm _ _ _ hx + +lemma openSectionsCongr_naturality (M : X.Modules) {U V U' V' : X.Opens} + (eU : U = U') (eV : V = V') (h : U ≤ V) (h' : U' ≤ V') + (x : OpenSections M V) : + openSectionsCongr M eU (openRestriction M h x) = + openRestriction M h' (openSectionsCongr M eV x) := by + subst U' V' + rfl + +lemma principal_open_image (r : Γ(X,⊤)) (U : X.Opens) : + U.ι ''ᵁ U.toScheme.basicOpen (U.ι.appTop r) = U ⊓ X.basicOpen r := by + rw [← Scheme.preimage_basicOpen_top, Scheme.Hom.image_preimage_eq_opensRange_inf, + Scheme.Opens.opensRange_ι] + +def affineOpenPrincipalEquiv (M : X.Modules) (r : Γ(X,⊤)) (U : X.Opens) : + letI := Module.compHom (OpenSections (M.restrict U.ι) + (U.toScheme.basicOpen (U.ι.appTop r))) U.ι.appTop.hom + OpenSections (M.restrict U.ι) (U.toScheme.basicOpen (U.ι.appTop r)) ≃ₗ[Γ(X,⊤)] + OpenSections M (U ⊓ X.basicOpen r) := + (restrictedOpenSections M U.ι _).trans (openSectionsCongr M (principal_open_image r U)) + +def affineOpenTopEquiv (M : X.Modules) (U : X.Opens) : + letI := Module.compHom (OpenSections (M.restrict U.ι) ⊤) U.ι.appTop.hom + OpenSections (M.restrict U.ι) ⊤ ≃ₗ[Γ(X,⊤)] OpenSections M U := + (restrictedOpenSections M U.ι ⊤).trans (openSectionsCongr M U.ι_image_top) + +lemma affineOpenPrincipalEquiv_restrict (M : X.Modules) (r : Γ(X,⊤)) (U : X.Opens) + (y : OpenSections (M.restrict U.ι) ⊤) : + affineOpenPrincipalEquiv M r U + (openRestriction (M.restrict U.ι) (U.toScheme.basicOpen_le (U.ι.appTop r)) y) = + openRestriction M (show U ⊓ X.basicOpen r ≤ U from inf_le_left) + (affineOpenTopEquiv M U y) := by + dsimp only [affineOpenPrincipalEquiv, affineOpenTopEquiv, LinearEquiv.trans_apply] + rw [restrictedOpenSections_naturality] + exact openSectionsCongr_naturality M (principal_open_image r U) U.ι_image_top _ _ _ + +theorem affine_open_section_extends (M : X.Modules) [M.IsQuasicoherent] + (r : Γ(X,⊤)) (U : X.Opens) (hU : IsAffineOpen U) + (x : OpenSections M (U ⊓ X.basicOpen r)) : + ∃ n : ℕ, ∃ y : OpenSections M U, + openRestriction M (show U ⊓ X.basicOpen r ≤ U from inf_le_left) y = r ^ n • x := by + let : IsAffine U.toScheme := hU + let : Module Γ(X,⊤) (OpenSections (M.restrict U.ι) + (U.toScheme.basicOpen (U.ι.appTop r))) := + Module.compHom _ U.ι.appTop.hom + let x' := (affineOpenPrincipalEquiv M r U).symm x + obtain ⟨n, y, hy⟩ := affine_basicOpen_denominators (M.restrict U.ι) (U.ι.appTop r) x' + refine ⟨n, affineOpenTopEquiv M U y, ?_⟩ + have hscalar : (U.ι.appTop r) ^ n • x' = (r ^ n) • x' := by + change (U.ι.appTop r) ^ n • x' = U.ι.appTop (r ^ n) • x' + rw [map_pow] + have hh := congrArg (affineOpenPrincipalEquiv M r U) hy + rw [hscalar, map_smul, affineOpenPrincipalEquiv_restrict] at hh + simpa only [x', LinearEquiv.apply_symm_apply] using hh + +def overlapDifference (M : X.Modules) {U V : X.Opens} + (y : OpenSections M U) (z : OpenSections M V) : OpenSections M (U ⊓ V) := + openRestriction M inf_le_left y - openRestriction M inf_le_right z + +lemma overlapDifference_restrict_zero (M : X.Modules) (r : Γ(X,⊤)) + (x : OpenSections M (X.basicOpen r)) (N : ℕ) {U V : X.Opens} + (y : OpenSections M U) (z : OpenSections M V) + (hy : openRestriction M (show U ⊓ X.basicOpen r ≤ U from inf_le_left) y = + r ^ N • openRestriction M inf_le_right x) + (hz : openRestriction M (show V ⊓ X.basicOpen r ≤ V from inf_le_left) z = + r ^ N • openRestriction M inf_le_right x) : + openRestriction M (show (U ⊓ V) ⊓ X.basicOpen r ≤ U ⊓ V from inf_le_left) + (overlapDifference M y z) = 0 := by + have hU : (U ⊓ V) ⊓ X.basicOpen r ≤ U ⊓ X.basicOpen r := inf_le_inf inf_le_left le_rfl + have hV : (U ⊓ V) ⊓ X.basicOpen r ≤ V ⊓ X.basicOpen r := inf_le_inf inf_le_right le_rfl + calc + _ = openRestriction M hU (openRestriction M inf_le_left y) - + openRestriction M hV (openRestriction M inf_le_left z) := by + simp only [overlapDifference, map_sub, openRestriction_comp_apply] + _ = 0 := by + rw [hy, hz, map_smul, map_smul, openRestriction_comp_apply, openRestriction_comp_apply, + sub_self] + +lemma overlapDifference_smul_zero_iff (M : X.Modules) (r : Γ(X,⊤)) + {U V : X.Opens} (y : OpenSections M U) (z : OpenSections M V) (K : ℕ) : + r ^ K • overlapDifference M y z = 0 ↔ + openRestriction M (show U ⊓ V ≤ U from inf_le_left) (r ^ K • y) = + openRestriction M (show U ⊓ V ≤ V from inf_le_right) (r ^ K • z) := by + simp only [overlapDifference, smul_sub, map_smul, sub_eq_zero] + +theorem clear_finite_overlap_discrepancies (M : X.Modules) [M.IsQuasicoherent] + (r : Γ(X,⊤)) {ι : Type*} [Fintype ι] (U : ι → X.Opens) + (hcompact : ∀ i j, IsCompact ((U i ⊓ U j : X.Opens) : Set X)) + (x : OpenSections M (X.basicOpen r)) (N : ℕ) (y : ∀ i, OpenSections M (U i)) + (hy : ∀ i, openRestriction M (show U i ⊓ X.basicOpen r ≤ U i from inf_le_left) (y i) = + r ^ N • openRestriction M inf_le_right x) : + ∃ K : ℕ, ∀ i j, + openRestriction M (show U i ⊓ U j ≤ U i from inf_le_left) (r ^ K • y i) = + openRestriction M (show U i ⊓ U j ≤ U j from inf_le_right) (r ^ K • y j) := by + classical + have h (ij : ι × ι) := compact_open_section_zero M r (U ij.1 ⊓ U ij.2) + (hcompact ij.1 ij.2) (overlapDifference M (y ij.1) (y ij.2)) + (overlapDifference_restrict_zero M r x N _ _ (hy ij.1) (hy ij.2)) + choose k hk using h + let K := Finset.univ.sup k + refine ⟨K, fun i j => ?_⟩ + apply (overlapDifference_smul_zero_iff M r (y i) (y j) K).mp + exact hk (i,j) K (Finset.le_sup (f := k) (Finset.mem_univ (i,j))) + +lemma restriction_of_glued_power (M : X.Modules) (r : Γ(X,⊤)) + {ι : Type*} (U : ι → X.Opens) (hcover : (⨆ i, U i) = ⊤) + (x : OpenSections M (X.basicOpen r)) (N K : ℕ) (y : ∀ i, OpenSections M (U i)) + (hy : ∀ i, openRestriction M (show U i ⊓ X.basicOpen r ≤ U i from inf_le_left) (y i) = + r ^ N • openRestriction M inf_le_right x) + (z : OpenSections M ⊤) + (hz : ∀ i, openRestriction M (show U i ≤ ⊤ from le_top) z = r ^ K • y i) : + openRestriction M (X.basicOpen_le r) z = r ^ (N + K) • x := by + apply TopCat.Sheaf.eq_of_locally_eq' ⟨_, M.isSheaf⟩ (fun i => U i ⊓ X.basicOpen r) + (X.basicOpen r) (fun i => homOfLE inf_le_right) + (by rw [← iSup_inf_eq, hcover, top_inf_eq]) + intro i + change openRestriction M inf_le_right (openRestriction M (X.basicOpen_le r) z) = + openRestriction M inf_le_right (r ^ (N + K) • x) + rw [openRestriction_comp_apply, + ← openRestriction_comp_apply M (show U i ⊓ X.basicOpen r ≤ U i from inf_le_left) le_top z, + hz i, map_smul, hy i, map_smul, ← mul_smul, ← pow_add, Nat.add_comm K N] + +theorem finite_cover_power_gluing (M : X.Modules) [M.IsQuasicoherent] + (r : Γ(X,⊤)) {ι : Type*} [Fintype ι] (U : ι → X.Opens) + (hcover : (⨆ i, U i) = ⊤) + (hcompact : ∀ i j, IsCompact ((U i ⊓ U j : X.Opens) : Set X)) + (x : OpenSections M (X.basicOpen r)) (N : ℕ) (y : ∀ i, OpenSections M (U i)) + (hy : ∀ i, openRestriction M (show U i ⊓ X.basicOpen r ≤ U i from inf_le_left) (y i) = + r ^ N • openRestriction M inf_le_right x) : + ∃ K : ℕ, ∃ z : OpenSections M ⊤, + openRestriction M (X.basicOpen_le r) z = r ^ (N + K) • x := by + obtain ⟨K, hK⟩ := clear_finite_overlap_discrepancies M r U hcompact x N y hy + have hh := TopCat.Sheaf.existsUnique_gluing' ⟨_, M.isSheaf⟩ U ⊤ + (fun i => homOfLE (show U i ≤ ⊤ from le_top)) (by rw [hcover]) (fun i => r ^ K • y i) ?_ + · obtain ⟨z, hz, _⟩ := hh + exact ⟨K, z, restriction_of_glued_power M r U hcover x N K y hy z hz⟩ + · intro i j + exact hK i j + +theorem finite_affine_local_extensions (M : X.Modules) [M.IsQuasicoherent] + (r : Γ(X,⊤)) {ι : Type*} [Fintype ι] (U : ι → X.Opens) + (hU : ∀ i, IsAffineOpen (U i)) (x : OpenSections M (X.basicOpen r)) : + ∃ N : ℕ, ∃ y : ∀ i, OpenSections M (U i), + ∀ i, openRestriction M (show U i ⊓ X.basicOpen r ≤ U i from inf_le_left) (y i) = + r ^ N • openRestriction M inf_le_right x := by + classical + choose n y hy using fun i => affine_open_section_extends M r (U i) (hU i) + (openRestriction M (show U i ⊓ X.basicOpen r ≤ X.basicOpen r from inf_le_right) x) + let N := Finset.univ.sup n + refine ⟨N, fun i => r ^ (N - n i) • y i, fun i => ?_⟩ + rw [map_smul, hy i, ← mul_smul, ← pow_add, + Nat.sub_add_cancel (Finset.le_sup (f := n) (Finset.mem_univ i))] + +theorem global_section_extends [NoetherianSpace X] (M : X.Modules) [M.IsQuasicoherent] + (r : Γ(X,⊤)) (x : OpenSections M (X.basicOpen r)) : + ∃ N : ℕ, ∀ n ≥ N, ∃ y : OpenSections M ⊤, + openRestriction M (X.basicOpen_le r) y = r ^ n • x := by + classical + obtain ⟨s, hs, e⟩ := + (isCompact_and_isOpen_iff_finite_and_eq_biUnion_affineOpens (X := X) + (U := ((⊤ : X.Opens) : Set X))).mp + ⟨NoetherianSpace.isCompact _, (⊤ : X.Opens).2⟩ + have hcover : (⨆ i : s, (i : X.Opens)) = ⊤ := by + ext1 + simpa using e.symm + have := hs.to_subtype + let := Fintype.ofFinite s + obtain ⟨N, y, hy⟩ := finite_affine_local_extensions M r (fun i : s => (i : X.Opens)) + (fun i => i.1.2) x + obtain ⟨K, z, hz⟩ := finite_cover_power_gluing M r (fun i : s => (i : X.Opens)) hcover + (fun i j => NoetherianSpace.isCompact _) x N y hy + refine ⟨N + K, fun n hn => ⟨r ^ (n - (N + K)) • z, ?_⟩⟩ + rw [map_smul, hz, ← mul_smul, ← pow_add, Nat.sub_add_cancel hn] + +theorem global_section_extends_native [NoetherianSpace X] + (M : X.Modules) [M.IsQuasicoherent] (r : Γ(X,⊤)) (x : Γ(M, X.basicOpen r)) : + letI : Module Γ(X, X.basicOpen r) Γ(M, X.basicOpen r) := + (M.val.obj (op (X.basicOpen r))).isModule + ∃ N : ℕ, ∀ n ≥ N, ∃ y : Γ(M,⊤), + M.presheaf.map (homOfLE (X.basicOpen_le r)).op y = + (restrictScalar X (X.basicOpen r) r) ^ n • x := by + let : Module Γ(X, X.basicOpen r) Γ(M, X.basicOpen r) := + (M.val.obj (op (X.basicOpen r))).isModule + obtain ⟨N, hN⟩ := global_section_extends M r x + refine ⟨N, fun n hn => ?_⟩ + obtain ⟨y, hy⟩ := hN n hn + refine ⟨y, ?_⟩ + change M.presheaf.map (homOfLE (X.basicOpen_le r)).op y = + (restrictScalar X (X.basicOpen r) (r ^ n)) • x at hy + simpa only [map_pow] using hy + +theorem global_section_zero_native [CompactSpace X] + (M : X.Modules) [M.IsQuasicoherent] (r : Γ(X,⊤)) (x : Γ(M,⊤)) + (hx : M.presheaf.map (homOfLE (X.basicOpen_le r)).op x = 0) : + letI : Module Γ(X,⊤) Γ(M,⊤) := (M.val.obj (op ⊤)).isModule + ∃ N : ℕ, ∀ n ≥ N, r ^ n • x = 0 := by + let : Module Γ(X,⊤) Γ(M,⊤) := (M.val.obj (op ⊤)).isModule + obtain ⟨N, hN⟩ := global_section_zero M r x hx + refine ⟨N, fun n hn => ?_⟩ + have hh := hN n hn + change restrictScalar X ⊤ (r ^ n) • x = 0 at hh + have hr : restrictScalar X ⊤ (r ^ n) = r ^ n := by + change X.presheaf.map (𝟙 (op ⊤)) (r ^ n) = r ^ n + rw [X.presheaf.map_id] + rfl + exact (congrArg (fun c : Γ(X, ⊤) => c • x) hr).symm.trans hh + +end +end PiExponent.GlobalSectionClearing + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/GlueGlobalGenerators.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/GlueGlobalGenerators.lean new file mode 100644 index 0000000000000000000000000000000000000000..f5ee52fbbae78c8bcbde60de8b2f8e6dd57d71a4 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/GlueGlobalGenerators.lean @@ -0,0 +1,72 @@ +import OAI.NumberTheory.PiExponent.Ampleness.CoherentAffineFinite +import OAI.NumberTheory.PiExponent.Approximation.CoherentTwistPresentation +import OAI.NumberTheory.PiExponent.Approximation.FrameSections + +namespace OAI + +namespace PiExponent.GlueGlobalGenerators +noncomputable section +universe u +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames + +variable {X : Scheme.{u}} (M : X.Modules) {ι : Type u} + (U : ι → X.Opens) (hcover : (⨆ i, U i) = ⊤) + (σ : ∀ i, (M.restrict (U i).ι).GeneratingSections) + (t : ∀ i, (σ i).I → GlobalSections X M) + (ht : ∀ i j, restrictSection (U i).ι (t i j) = + (M.restrict (U i).ι).unitHomEquiv.symm ((σ i).s j)) + +include hcover ht + +theorem globalEvaluation_epi : Epi + (M.freeHomEquiv.symm (fun ij : Σ i, (σ i).I => M.unitHomEquiv (t ij.1 ij.2))) := by + let q := M.freeHomEquiv.symm (fun ij : Σ i, (σ i).I => M.unitHomEquiv (t ij.1 ij.2)) + have hq (i : ι) (j : (σ i).I) : SheafOfModules.ιFree ⟨i,j⟩ ≫ q = t i j := by + erw [← SheafOfModules.unitHomEquiv_symm_freeHomEquiv_apply] + simp only [q, Equiv.apply_symm_apply] + exact M.unitHomEquiv.symm_apply_apply (t i j) + change Epi (C := X.Modules) q + apply (Preadditive.epi_iff_cancel_zero (C := X.Modules) q).mpr + intro N g hg + have hz (i : ι) (j : (σ i).I) : t i j ≫ g = 0 := by + erw [← hq i j, Category.assoc, hg, comp_zero] + apply CoherentTwist.eq_zero_of_local + intro x + have hx : x ∈ ⨆ i, U i := by rw [hcover]; trivial + obtain ⟨i, hxi⟩ := Opens.mem_iSup.mp hx + refine ⟨U i,hxi,?_⟩ + apply (@cancel_epi _ _ _ _ _ (σ i).π (σ i).epi _ _).mp + erw [comp_zero] + apply (SheafOfModules.isColimitFreeCofan (σ i).I).hom_ext + intro j + change SheafOfModules.ιFree j.as ≫ ((σ i).π ≫ + (Scheme.Modules.restrictFunctor (U i).ι).map g) = SheafOfModules.ιFree j.as ≫ 0 + erw [comp_zero, ← Category.assoc, + ← SheafOfModules.unitHomEquiv_symm_freeHomEquiv_apply] + simp only [SheafOfModules.GeneratingSections.π, Equiv.apply_symm_apply] + erw [← ht i j.as] + let R : X.Modules ⥤ (U i).toScheme.Modules := Scheme.Modules.restrictFunctor (U i).ι + let e : R.obj (O X) ≅ O (U i).toScheme := Scheme.Modules.restrictUnitIso (U i).ι + change (e.inv ≫ R.map (t i j.as)) ≫ R.map g = 0 + erw [Category.assoc, ← Functor.map_comp, hz, Functor.map_zero, comp_zero] + +def globalGenerators : M.GeneratingSections where + I := Σ i, (σ i).I + s ij := M.unitHomEquiv (t ij.1 ij.2) + epi := globalEvaluation_epi M U hcover σ t ht + +instance [Finite ι] [hσ : ∀ i, (σ i).IsFiniteType] : + (globalGenerators M U hcover σ t ht).IsFiniteType where + finite := by + let (i : ι) : Finite (σ i).I := (hσ i).finite + exact inferInstanceAs (Finite (Σ i, (σ i).I)) + +theorem exists_finite_global_generators [Finite ι] [∀ i, (σ i).IsFiniteType] : + ∃ q : M.GeneratingSections, q.IsFiniteType := + ⟨globalGenerators M U hcover σ t ht, inferInstance⟩ + +end +end PiExponent.GlueGlobalGenerators + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/IntegralLineSections.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/IntegralLineSections.lean new file mode 100644 index 0000000000000000000000000000000000000000..9cb3855fd03febe4c31ca795cf9e5202b6f2eb48 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/IntegralLineSections.lean @@ -0,0 +1,254 @@ +import OAI.NumberTheory.PiExponent.Approximation.SectionOpens + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri + +namespace Geometry +open CategoryTheory AlgebraicGeometry TopologicalSpace +open scoped AlgebraicGeometry +variable {X : Scheme} + +lemma trivialModule_restriction_injective [IsIntegral X] (M : X.Modules) + (e : M ≅ structureSheaf X) {U V : X.Opens} (i : U ⟶ V) [Nonempty U] : + Function.Injective (M.presheaf.map i.op) := by + intro s t h + apply (ConcreteCategory.bijective_of_isIso + (((Scheme.Modules.toPresheaf X).mapIso e).app (Opposite.op V)).hom).injective + have hn := e.hom.mapPresheaf.naturality i.op + have heq := congrArg (fun a => e.hom.app U a) h + have hh (a : Γ(M, V)) : + e.hom.app U (M.presheaf.map i.op a) = + X.presheaf.map i.op (e.hom.app V a) := by + exact CategoryTheory.congr_fun hn a + rw [hh, hh] at heq + exact map_injective_of_isIntegral X i heq + +theorem LineBundle.restriction_injective [IsIntegral X] (L : LineBundle X) + {U V : X.Opens} (i : U ⟶ V) [Nonempty U] : + Function.Injective (L.sheaf.presheaf.map i.op) := by + intro s t h + apply L.sheaf.isSheaf.section_ext + intro x hx + obtain ⟨T, hxT, ⟨e⟩⟩ := L.locallyRankOne x + let f := T.ι + let U' : T.toScheme.Opens := f ⁻¹ᵁ U + let V' : T.toScheme.Opens := f ⁻¹ᵁ V + have hU' : Nonempty U' := by + obtain ⟨y, hyT, hyU⟩ := nonempty_preirreducible_inter T.isOpen U.isOpen + ⟨x, hxT⟩ (by obtain ⟨u⟩ := ‹Nonempty U›; exact ⟨u.val, u.property⟩) + exact ⟨⟨⟨y, hyT⟩, hyU⟩⟩ + have : Nonempty U' := hU' + have : Nonempty T := ⟨⟨x, hxT⟩⟩ + let j : U' ⟶ V' := homOfLE (fun _ h => leOfHom i h) + let W := f ''ᵁ V' + have hWV : W ≤ V := f.image_preimage_le V + refine ⟨W, hWV, ?_, ?_⟩ + · exact ⟨⟨x, hxT⟩, hx, rfl⟩ + · apply trivialModule_restriction_injective (L.sheaf.restrict f) e j + change L.sheaf.presheaf.map ((f.opensFunctor.map j).op) + (L.sheaf.presheaf.map (homOfLE hWV).op s) = + L.sheaf.presheaf.map ((f.opensFunctor.map j).op) + (L.sheaf.presheaf.map (homOfLE hWV).op t) + have hh := congrArg + (fun a => L.sheaf.presheaf.map (homOfLE (f.image_preimage_le U)).op a) h + simp only [← ConcreteCategory.comp_apply, ← Functor.map_comp] at hh ⊢ + have eq : i.op ≫ (homOfLE (f.image_preimage_le U)).op = + (homOfLE hWV).op ≫ (f.opensFunctor.map j).op := Subsingleton.elim _ _ + rw [eq] at hh + simpa only [Functor.map_comp, ConcreteCategory.comp_apply] using hh + +theorem LineBundle.section_restriction_injective [IsIntegral X] (L : LineBundle X) + (U : X.Opens) [Nonempty U] : + Function.Injective (fun s : GlobalSections X L.sheaf => s.app U (1 : Γ(X, U))) := by + intro s t h + have natural (s : GlobalSections X L.sheaf) (V : X.Opens) : + s.app V (1 : Γ(X, V)) = L.sheaf.presheaf.map + (homOfLE (show V ≤ ⊤ from le_top)).op (s.app ⊤ (1 : Γ(X, ⊤))) := by + have hs := CategoryTheory.congr_fun (s.mapPresheaf.naturality + (homOfLE (show V ≤ ⊤ from le_top)).op) (1 : Γ(X, ⊤)) + change s.app V (X.presheaf.map (homOfLE (show V ≤ ⊤ from le_top)).op 1) = + L.sheaf.presheaf.map (homOfLE (show V ≤ ⊤ from le_top)).op + (s.app ⊤ (1 : Γ(X, ⊤))) at hs + simpa only [map_one, ConcreteCategory.comp_apply] using hs + have ht : s.app ⊤ (1 : Γ(X, ⊤)) = t.app ⊤ (1 : Γ(X, ⊤)) := by + apply L.restriction_injective (homOfLE (show U ≤ ⊤ from le_top)) + rw [← natural s U, ← natural t U] + exact h + ext V a + change Γ(X, V) at a + have hv : s.app V (1 : Γ(X, V)) = t.app V (1 : Γ(X, V)) := by + rw [natural s, natural t, ht] + have scalar (s : GlobalSections X L.sheaf) : + s.app V a = a • s.app V (1 : Γ(X, V)) := by + have hs := s.app_smul (r := a) (x := (1 : Γ(X, V))) + change s.app V (a * 1 : Γ(X, V)) = _ at hs + simpa only [mul_one] using hs + rw [scalar s, scalar t, hv] + +variable [IsIntegral X] + +theorem LineBundle.noZeroSMulDivisors (L : LineBundle X) + (U : X.Opens) [Nonempty U] : NoZeroSMulDivisors Γ(X, U) Γ(L.sheaf, U) where + eq_zero_or_eq_zero_of_smul_eq_zero {a m} h := by + obtain ⟨x, hx⟩ := ‹Nonempty U› + obtain ⟨T, hxT, ⟨e⟩⟩ := L.locallyRankOne x + let V : T.toScheme.Opens := T.ι ⁻¹ᵁ U + have : Nonempty V := ⟨⟨⟨x, hxT⟩, hx⟩⟩ + have : Nonempty T := ⟨⟨x, hxT⟩⟩ + let W : X.Opens := T.ι ''ᵁ V + have : Nonempty W := ⟨⟨x, ⟨x, hxT⟩, hx, rfl⟩⟩ + let i : W ⟶ U := homOfLE (T.ι.image_preimage_le U) + let ar : Γ(X, W) := X.presheaf.map i.op a + let mr : Γ(L.sheaf, W) := L.sheaf.presheaf.map i.op m + have hr : ar • mr = 0 := by + have hh := congrArg (fun z => L.sheaf.presheaf.map i.op z) h + simpa only [L.sheaf.map_smul, map_zero] using hh + let ar' : Γ(T.toScheme, V) := (T.ι.appIso V).hom ar + let mr' : Γ(L.sheaf.restrict T.ι, V) := (L.sheaf.restrictAppIso T.ι V).inv mr + let cr : Γ(T.toScheme, V) := e.hom.app V mr' + have hr' : ar' • mr' = 0 := by + rw [← Scheme.Modules.smul_restrictAppIso_inv_apply] + simp only [hr, map_zero] + have hmul : ar' * cr = 0 := by + have hh := e.hom.app_smul (r := ar') (x := mr') + change e.hom.app V (ar' • mr') = ar' * cr at hh + rw [hr', map_zero] at hh + exact hh.symm + rcases mul_eq_zero.mp hmul with ha | hm + · left + apply map_injective_of_isIntegral X i + have hinj := (ConcreteCategory.bijective_of_isIso (T.ι.appIso V).hom).injective + apply hinj + simpa only [map_zero] using ha + · right + apply L.restriction_injective i + have hinj := (ConcreteCategory.bijective_of_isIso + (((Scheme.Modules.toPresheaf T.toScheme).mapIso e).app (Opposite.op V)).hom).injective + apply (ConcreteCategory.bijective_of_isIso (L.sheaf.restrictAppIso T.ι V).inv).injective + apply hinj + change cr = e.hom.app V ((L.sheaf.restrictAppIso T.ι V).inv + (L.sheaf.presheaf.map i.op 0)) + refine hm.trans ?_ + simp only [map_zero] + rfl + +theorem LineBundle.mono_section (L : LineBundle X) + (s : GlobalSections X L.sheaf) (hs : s ≠ 0) : Mono s := by + have hmono : Mono s.val := by + apply PresheafOfModules.mono_of_injective + intro U + by_cases hU : Nonempty U.unop + · let := hU + let := L.noZeroSMulDivisors U.unop + intro a b hab + change Γ(X, U.unop) at a b + have hc : s.app U.unop (1 : Γ(X, U.unop)) ≠ 0 := by + intro h + apply hs + apply L.section_restriction_injective U.unop + exact h + have hscalar (a : Γ(X, U.unop)) : s.app U.unop a = + a • s.app U.unop (1 : Γ(X, U.unop)) := by + have hh := s.app_smul (r := a) (x := (1 : Γ(X, U.unop))) + change s.app U.unop (a * 1 : Γ(X, U.unop)) = _ at hh + simpa only [mul_one] using hh + have heq : s.app U.unop a = s.app U.unop b := hab + rw [hscalar a, hscalar b] at heq + exact (smul_left_injective Γ(X, U.unop) hc) heq + · have he : U.unop = ⊥ := by + apply Opens.ext + ext x + exact ⟨fun hx => (hU ⟨⟨x, hx⟩⟩).elim, fun h => h.elim⟩ + have : Subsingleton Γ(X, U.unop) := by rw [he]; infer_instance + intro a b _ + change Γ(X, U.unop) at a b + exact Subsingleton.elim a b + exact (SheafOfModules.forget X.ringCatSheaf).mono_of_mono_map hmono + +end Geometry + +namespace Frames +open CategoryTheory AlgebraicGeometry +variable {X Y : Scheme} +lemma coefficient_injective {M : X.Modules} (e : M ≅ O X) : + Function.Injective (coefficient e) := by + intro s t h + apply (cancel_mono e.hom).1 + exact endValue_injective h +lemma coefficient_zero {M : X.Modules} (e : M ≅ O X) : + coefficient e (0 : O X ⟶ M) = 0 := by + rw [coefficient, CategoryTheory.Limits.zero_comp] + rfl +lemma restrictSection_zero (φ : Y ⟶ X) [IsOpenImmersion φ] {M : X.Modules} : + restrictSection φ (0 : O X ⟶ M) = 0 := by + ext U a + rfl +end Frames + +namespace Geometry +open CategoryTheory AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Frames +variable {X Y : Scheme} +lemma LineBundle.restrict_sections_injective [IsIntegral X] (L : LineBundle X) + (f : Y ⟶ X) [IsOpenImmersion f] [Nonempty Y] : + Function.Injective (fun s : GlobalSections X L.sheaf => + (Scheme.Modules.restrictFunctor f).map s) := by + intro s t h + let U : X.Opens := f ''ᵁ ⊤ + have : Nonempty U := by + obtain ⟨y⟩ := ‹Nonempty Y› + exact ⟨⟨f y, y, Set.mem_univ y, rfl⟩⟩ + apply L.section_restriction_injective U + have he := congrArg (fun s : (structureSheaf X).restrict f ⟶ L.sheaf.restrict f => + s.app ⊤ (1 : Γ(X, U))) h + exact he + +lemma LineBundle.restricted_coefficient_injective [IsIntegral X] (L : LineBundle X) + (f : Y ⟶ X) [IsOpenImmersion f] [Nonempty Y] + (e : L.sheaf.restrict f ≅ O Y) : + Function.Injective (fun s : GlobalSections X L.sheaf => coefficient e (restrictSection f s)) := by + intro s t h + apply L.restrict_sections_injective f + let u : (structureSheaf X).restrict f ≅ structureSheaf Y := + Scheme.Modules.restrictUnitIso f + apply (cancel_epi u.inv).mp + exact coefficient_injective e h + +lemma LineBundle.isoOpen_ne_bot [IsIntegral X] (L : LineBundle X) + (s : O X ⟶ L.sheaf) (hs : s ≠ 0) : PiExponentSeshadri.SectionOpens.isoOpen s ≠ ⊥ := by + obtain ⟨x⟩ : Nonempty X := inferInstance + obtain ⟨V,hx,⟨e⟩⟩ := L.locallyRankOne x + let : Nonempty V := ⟨⟨x,hx⟩⟩ + have hc : coefficient e (restrictSection V.ι s) ≠ 0 := by + intro h + apply hs + apply L.restricted_coefficient_injective V.ι e + have hz : coefficient e (restrictSection V.ι (0 : O X ⟶ L.sheaf)) = 0 := + (congrArg (coefficient e) (restrictSection_zero V.ι)).trans (coefficient_zero e) + exact h.trans hz.symm + intro hz + have he := preimage_isoOpen s V.ι e + rw [hz] at he + have hb : V.toScheme.basicOpen (coefficient e (restrictSection V.ι s)) = ⊥ := by + simpa only [Scheme.Hom.preimage_bot] using he.symm + exact hc (eq_zero_of_basicOpen_eq_bot _ hb) + +theorem LineBundle.sectionOpen_nonempty [IsIntegral X] (L : LineBundle X) + (s : GlobalSections X L.sheaf) (hs : s ≠ 0) : + Nonempty (sectionOpen X s) := by + have h := L.isoOpen_ne_bot s hs + by_contra hn + apply h + apply TopologicalSpace.Opens.ext + ext x + exact ⟨fun hx => hn ⟨⟨x,hx⟩⟩, fun hx => hx.elim⟩ +end Geometry + +end PiExponentSeshadri + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/InterpolationConsequence.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/InterpolationConsequence.lean new file mode 100644 index 0000000000000000000000000000000000000000..a578da1de6124007398ab19c0dbbe2abe3501821 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/InterpolationConsequence.lean @@ -0,0 +1,30 @@ +import OAI.NumberTheory.PiExponent.Analysis.AnalyticAggregate +import OAI.NumberTheory.PiExponent.Analysis.FlintConsequence +import OAI.NumberTheory.PiExponent.Approximation.Exponent + +namespace OAI + +namespace PiExponent + +theorem piEventualLowerBound_of_globalInterpolation + (hgeometry : DeterminantContradiction.GlobalInterpolationStatement) : + PiEventualLowerBound := + DeterminantContradiction.piEventualLowerBound_of_interpolation_and_analytic_aggregate + hgeometry LiteralAnalytic.analyticAggregate + +theorem pi_irrationalityExponent_of_globalInterpolation + (hgeometry : DeterminantContradiction.GlobalInterpolationStatement) : + irrationalityExponent Real.pi = 2 := + pi_irrationalityExponent_eq_two_of_eventualLowerBound + (piEventualLowerBound_of_globalInterpolation hgeometry) + +theorem flintHills_of_globalInterpolation + (hgeometry : DeterminantContradiction.GlobalInterpolationStatement) : + Summable (fun n : ℕ => + 1 / (((n + 1 : ℕ) : ℝ) ^ 3 * Real.sin (n + 1 : ℕ) ^ 2)) := + flintHills_positive_summable_of_eventual_lower_bound + (piEventualLowerBound_of_globalInterpolation hgeometry) + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/InterpolationMatrix.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/InterpolationMatrix.lean new file mode 100644 index 0000000000000000000000000000000000000000..84caa6a3ae56844b6535833bb8d4c7efa350ba86 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/InterpolationMatrix.lean @@ -0,0 +1,192 @@ +import OAI.NumberTheory.PiExponent.Polynomials.SimplexCounting + +namespace OAI + +open scoped BigOperators + +namespace PiExponent.InterpolationMatrix + +noncomputable def exponentVector {m : ℕ} (a : Fin m → ℕ) : Fin m →₀ ℕ := + Finsupp.equivFunOnFinite.symm a + +@[simp] theorem exponentVector_apply {m : ℕ} (a : Fin m → ℕ) (i : Fin m) : + exponentVector a i = a i := by + simp [exponentVector] + +noncomputable def truncatedLog (T : ℕ) : Polynomial ℂ := + PowerSeries.trunc T (PowerSeries.log ℂ) + +@[simp] theorem truncatedLog_coeff (T k : ℕ) : + (truncatedLog T).coeff k = + if k < T then + if k = 0 then 0 else algebraMap ℚ ℂ ((-1 : ℚ) ^ (k + 1) / k) + else 0 := by + simp [truncatedLog, PowerSeries.coeff_trunc] + +noncomputable def monomialImage {m : ℕ} (r : Fin m → ℂ) + (G : Fin m → Polynomial ℂ) (j h : ℕ) (a : Fin m → ℕ) : + MvPolynomial (Fin m) (Polynomial ℂ) := + MvPolynomial.C ((1 + Polynomial.X) ^ h) * + ∏ i, (MvPolynomial.C (Polynomial.C ((j : ℂ) * r i) + G i) + + MvPolynomial.X i) ^ a i + +noncomputable def entry {m : ℕ} (r : Fin m → ℂ) + (G : Fin m → Polynomial ℂ) (j s : ℕ) (b : Fin m → ℕ) + (h : ℕ) (a : Fin m → ℕ) : ℂ := + ((monomialImage r G j h a).coeff (exponentVector b)).coeff s + +noncomputable def sectionImage {m : ℕ} {C : Type*} [Fintype C] + (r : Fin m → ℂ) (G : Fin m → Polynomial ℂ) + (h : C → ℕ) (a : C → Fin m → ℕ) (x : C → ℂ) (j : ℕ) : + MvPolynomial (Fin m) (Polynomial ℂ) := + ∑ c, MvPolynomial.C (Polynomial.C (x c)) * monomialImage r G j (h c) (a c) + +theorem sectionImage_coeff {m : ℕ} {C : Type*} [Fintype C] + (r : Fin m → ℂ) (G : Fin m → Polynomial ℂ) + (h : C → ℕ) (a : C → Fin m → ℕ) (x : C → ℂ) + (j s : ℕ) (b : Fin m → ℕ) : + ((sectionImage r G h a x j).coeff (exponentVector b)).coeff s = + ∑ c, entry r G j s b (h c) (a c) * x c := by + classical + simp only [sectionImage, MvPolynomial.coeff_sum, MvPolynomial.coeff_C_mul, + Polynomial.finsetSum_coeff, Polynomial.coeff_C_mul, entry] + apply Finset.sum_congr rfl + intro c hc + exact mul_comm _ _ + +def columnWeights {m : ℕ} (w0 : ℝ) (w : Fin m → ℝ) : Fin (m + 1) → ℝ := + Fin.cases w0 w + +noncomputable def rowWeights {m : ℕ} (v0 θ : ℝ) (w : Fin m → ℝ) : Fin (m + 1) → ℝ := + Fin.cases v0 (fun i => w i / θ) + +abbrev Column {m : ℕ} (w0 : ℝ) (w : Fin m → ℝ) (H : ℝ) := + ↥(PiExponent.realWeightedSimplex (columnWeights w0 w) H) + +abbrev Row {m : ℕ} (K : ℕ) (v0 θ : ℝ) (w : Fin m → ℝ) (H : ℝ) := + Fin K × ↥(PiExponent.strictWeightedSimplex (rowWeights v0 θ w) H) + +theorem column_mem_iff {m : ℕ} {w0 H : ℝ} {w : Fin m → ℝ} + (hw0 : 0 < w0) (hw : ∀ i, 0 < w i) (a : Fin (m + 1) → ℕ) : + a ∈ PiExponent.realWeightedSimplex (columnWeights w0 w) H ↔ + w0 * (a 0 : ℝ) + ∑ i, w i * (a i.succ : ℝ) ≤ H := by + have hp : ∀ i, 0 < columnWeights w0 w i := by + intro i + refine Fin.cases hw0 (fun j => hw j) i + rw [PiExponent.mem_realWeightedSimplex hp, Fin.sum_univ_succ] + rfl + +theorem row_mem_iff {m : ℕ} {v0 θ H : ℝ} {w : Fin m → ℝ} + (hv0 : 0 < v0) (hθ : 0 < θ) (hw : ∀ i, 0 < w i) (b : Fin (m + 1) → ℕ) : + b ∈ PiExponent.strictWeightedSimplex (rowWeights v0 θ w) H ↔ + v0 * (b 0 : ℝ) + (∑ i, w i * (b i.succ : ℝ)) / θ < H := by + have hp : ∀ i, 0 < rowWeights v0 θ w i := by + intro i + refine Fin.cases hv0 (fun j => div_pos (hw j) hθ) i + rw [PiExponent.mem_strictWeightedSimplex hp, Fin.sum_univ_succ] + simp only [rowWeights, Fin.cases_zero, Fin.cases_succ, div_mul_eq_mul_div, + Finset.sum_div] + +theorem column_weight_le {m : ℕ} {w0 H : ℝ} {w : Fin m → ℝ} + (hw0 : 0 < w0) (hw : ∀ i, 0 < w i) (c : Column w0 w H) : + w0 * (c.1 0 : ℝ) + ∑ i, w i * (c.1 i.succ : ℝ) ≤ H := + (column_mem_iff hw0 hw c.1).mp c.2 + +theorem row_weight_lt {m K : ℕ} {v0 θ H : ℝ} {w : Fin m → ℝ} + (hv0 : 0 < v0) (hθ : 0 < θ) (hw : ∀ i, 0 < w i) (ρ : Row K v0 θ w H) : + v0 * (ρ.2.1 0 : ℝ) + (∑ i, w i * (ρ.2.1 i.succ : ℝ)) / θ < H := + (row_mem_iff hv0 hθ hw ρ.2.1).mp ρ.2.2 + +noncomputable def matrix {m : ℕ} (K : ℕ) (w0 v0 θ : ℝ) + (w : Fin m → ℝ) (H : ℝ) (r : Fin m → ℂ) (G : Fin m → Polynomial ℂ) : + Matrix (Row K v0 θ w H) (Column w0 w H) ℂ := + fun ρ c => entry r G ρ.1.val (ρ.2.1 0) (fun i => ρ.2.1 i.succ) + (c.1 0) (fun i => c.1 i.succ) + +noncomputable def linearEvaluation {m : ℕ} (K : ℕ) (w0 v0 θ : ℝ) + (w : Fin m → ℝ) (H : ℝ) (r : Fin m → ℂ) (G : Fin m → Polynomial ℂ) : + (Column w0 w H → ℂ) →ₗ[ℂ] (Row K v0 θ w H → ℂ) := + (matrix K w0 v0 θ w H r G).mulVecLin + +theorem linearEvaluation_apply {m : ℕ} (K : ℕ) (w0 v0 θ : ℝ) + (w : Fin m → ℝ) (H : ℝ) (r : Fin m → ℂ) (G : Fin m → Polynomial ℂ) + (x : Column w0 w H → ℂ) (ρ : Row K v0 θ w H) : + linearEvaluation K w0 v0 θ w H r G x ρ = + ∑ c, entry r G ρ.1.val (ρ.2.1 0) (fun i => ρ.2.1 i.succ) + (c.1 0) (fun i => c.1 i.succ) * x c := rfl + +theorem linearEvaluation_eq_coeff {m : ℕ} (K : ℕ) (w0 v0 θ : ℝ) + (w : Fin m → ℝ) (H : ℝ) (r : Fin m → ℂ) (G : Fin m → Polynomial ℂ) + (x : Column w0 w H → ℂ) (ρ : Row K v0 θ w H) : + linearEvaluation K w0 v0 θ w H r G x ρ = + ((sectionImage r G (fun c : Column w0 w H => c.1 0) + (fun c i => c.1 i.succ) x ρ.1.val).coeff + (exponentVector (fun i => ρ.2.1 i.succ))).coeff (ρ.2.1 0) := by + rw [linearEvaluation_apply, sectionImage_coeff] + +@[simp] theorem row_card {m : ℕ} (K : ℕ) (v0 θ : ℝ) + (w : Fin m → ℝ) (H : ℝ) : + Fintype.card (Row K v0 θ w H) = + K * (PiExponent.strictWeightedSimplex (rowWeights v0 θ w) H).card := by + classical + simp [Row] + +theorem exists_full_row_minor_of_surjective + {R C K : Type*} [Fintype R] [Fintype C] [DecidableEq R] [Field K] + (A : Matrix R C K) (hA : Function.Surjective A.mulVecLin) : + ∃ selection : R → C, Function.Injective selection ∧ + (A.submatrix id selection).det ≠ 0 := by + classical + obtain ⟨B, hB⟩ := Matrix.mulVec_surjective_iff_exists_right_inverse.mp hA + have hexp : (A * B).det = + ∑ p : R → C, (A.submatrix id p).det * ∏ i, B (p i) i := by + calc + (A * B).det = ∑ p : R → C, ∑ σ : Equiv.Perm R, + ((Equiv.Perm.sign σ : ℤ) : K) * ∏ i, A (σ i) (p i) * B (p i) i := by + simp only [Matrix.det_apply', Matrix.mul_apply, Finset.prod_univ_sum, + Finset.mul_sum, Fintype.piFinset_univ] + rw [Finset.sum_comm] + _ = ∑ p : R → C, (A.submatrix id p).det * ∏ i, B (p i) i := by + apply Finset.sum_congr rfl + intro p hp + simp only [Matrix.det_apply', Matrix.submatrix_apply, id_eq, + Finset.prod_mul_distrib, ← mul_assoc, ← Finset.sum_mul] + have hsum : (∑ p : R → C, (A.submatrix id p).det * ∏ i, B (p i) i) ≠ 0 := by + rw [← hexp, hB, Matrix.det_one] + exact one_ne_zero + obtain ⟨p, _, hp⟩ := Finset.exists_ne_zero_of_sum_ne_zero hsum + have hdet : (A.submatrix id p).det ≠ 0 := by + intro h + apply hp + rw [h, zero_mul] + refine ⟨p, ?_, hdet⟩ + intro i j hij + by_contra hne + exact hdet (Matrix.det_zero_of_column_eq hne (fun k => congrArg (A k) hij)) + +theorem interpolation_full_row_minor {m : ℕ} (K : ℕ) (w0 v0 θ : ℝ) + (w : Fin m → ℝ) (H : ℝ) (r : Fin m → ℂ) (G : Fin m → Polynomial ℂ) + (hsurj : Function.Surjective (linearEvaluation K w0 v0 θ w H r G)) : + ∃ selection : Row K v0 θ w H → Column w0 w H, + Function.Injective selection ∧ + ((matrix K w0 v0 θ w H r G).submatrix id selection).det ≠ 0 := by + classical + exact exists_full_row_minor_of_surjective (matrix K w0 v0 θ w H r G) hsurj + +noncomputable def truncatedLogMatrix {m : ℕ} (K : ℕ) (w0 v0 θ : ℝ) + (w : Fin m → ℝ) (H : ℝ) (r : Fin m → ℂ) (T : Fin m → ℕ) : + Matrix (Row K v0 θ w H) (Column w0 w H) ℂ := + matrix K w0 v0 θ w H r (fun i => truncatedLog (T i)) + +theorem truncatedLog_full_row_minor {m : ℕ} (K : ℕ) (w0 v0 θ : ℝ) + (w : Fin m → ℝ) (H : ℝ) (r : Fin m → ℂ) (T : Fin m → ℕ) + (hsurj : Function.Surjective + (linearEvaluation K w0 v0 θ w H r (fun i => truncatedLog (T i)))) : + ∃ selection : Row K v0 θ w H → Column w0 w H, + Function.Injective selection ∧ + ((truncatedLogMatrix K w0 v0 θ w H r T).submatrix id selection).det ≠ 0 := by + exact interpolation_full_row_minor K w0 v0 θ w H r _ hsurj + +end PiExponent.InterpolationMatrix + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/InverseDualRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/InverseDualRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..6de454c25a1cd7f427993bd17eb2e92a57afd84d --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/InverseDualRestriction.lean @@ -0,0 +1,61 @@ +import OAI.NumberTheory.PiExponent.Approximation.InverseFrames +import OAI.NumberTheory.PiExponent.Geometry.LineBundleInverse + +namespace OAI + +namespace PiExponent.InverseFrames +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames PiExponentSeshadri.TensorPure +variable {X : Scheme.{0}} {M N : X.Modules} + +lemma dualMap_restrict (E : moduleTensor X M N ≅ O X) (s : O X ⟶ M) (U : X.Opens) : + (Scheme.Modules.restrictFunctor U.ι).map (dualMap E s) ≫ + (Scheme.Modules.restrictUnitIso U.ι).hom = + dualMap (restrictPairing E U) (restrictSection U.ι s) := by + ext A n + change Γ(N, U.ι ''ᵁ A) at n + change (U.ι.appIso A).hom ((dualMap E s).app (U.ι ''ᵁ A) n) = + (dualMap (restrictPairing E U) (restrictSection U.ι s)).app A n + erw [dualMap_apply E s (U.ι ''ᵁ A) n, + dualMap_apply (restrictPairing E U) (restrictSection U.ι s) A n] + change (U.ι.appIso A).hom (E.hom.app (U.ι ''ᵁ A) + (PiExponentSeshadri.TensorPure.pure M N (U.ι ''ᵁ A) + (s.app (U.ι ''ᵁ A) (1 : Γ(X,U.ι ''ᵁ A))) n)) = + (U.ι.appIso A).hom (E.hom.app (U.ι ''ᵁ A) + ((moduleTensorRestrict U M N).inv.app A + (PiExponentSeshadri.TensorPure.pure (M.restrict U.ι) (N.restrict U.ι) A + ((restrictSection U.ι s).app A (1 : Γ(U.toScheme,A))) n))) + erw [restrict_pure_inv U M N A + ((restrictSection U.ι s).app A (1 : Γ(U.toScheme,A))) n] + change (U.ι.appIso A).hom (E.hom.app (U.ι ''ᵁ A) + (PiExponentSeshadri.TensorPure.pure M N (U.ι ''ᵁ A) + (s.app (U.ι ''ᵁ A) (1 : Γ(X,U.ι ''ᵁ A))) n)) = + (U.ι.appIso A).hom (E.hom.app (U.ι ''ᵁ A) + (PiExponentSeshadri.TensorPure.pure M N (U.ι ''ᵁ A) + (s.app (U.ι ''ᵁ A) ((U.ι.appIso A).inv (1 : Γ(U.toScheme,A)))) n)) + rw [show (U.ι.appIso A).inv (1 : Γ(U.toScheme,A)) = (1 : Γ(X,U.ι ''ᵁ A)) from + (U.ι.appIso A).inv.hom.map_one] + +lemma dualMap_restrict_coefficient (E : moduleTensor X M N ≅ O X) + (s : O X ⟶ M) (U : X.Opens) (e : M.restrict U.ι ≅ O U.toScheme) : + endValue ((inverseOpenFrame E U e).inv ≫ + (Scheme.Modules.restrictFunctor U.ι).map (dualMap E s) ≫ + (Scheme.Modules.restrictUnitIso U.ι).hom) = + coefficient e (restrictSection U.ι s) := by + erw [dualMap_restrict] + exact dualMap_coefficient (restrictPairing E U) e (restrictSection U.ι s) + +lemma dualSection_restrict_coefficient (L : LineBundle X) + (s : structureSheaf X ⟶ L.sheaf) (U : X.Opens) + (e : L.sheaf.restrict U.ι ≅ structureSheaf U.toScheme) : + endValue ((inverseOpenFrame (lineTensorInverseIso L) U e).inv ≫ + (Scheme.Modules.restrictFunctor U.ι).map (L.dualSection s) ≫ + (Scheme.Modules.restrictUnitIso U.ι).hom) = + coefficient e (restrictSection U.ι s) := + dualMap_restrict_coefficient (lineTensorInverseIso L) s U e + +end +end PiExponent.InverseFrames + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/InverseFrameRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/InverseFrameRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..0dd1b82b7f7e59259b56fe996e50898051b6cc02 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/InverseFrameRestriction.lean @@ -0,0 +1,99 @@ +import OAI.NumberTheory.PiExponent.Approximation.FrameSubopensCoherence +import OAI.NumberTheory.PiExponent.Approximation.InverseFrames + +namespace OAI + +namespace PiExponent.InverseFrames +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames PiExponentSeshadri.TensorPure +variable {X : Scheme.{0}} {M N : X.Modules} + +lemma restrictPairing_pure (E : moduleTensor X M N ≅ O X) (U : X.Opens) + (A : U.toScheme.Opens) (m : Γ(M.restrict U.ι,A)) (n : Γ(N.restrict U.ι,A)) : + (restrictPairing E U).hom.app A (PiExponentSeshadri.TensorPure.pure (M.restrict U.ι) (N.restrict U.ι) A m n) = + E.hom.app (U.ι ''ᵁ A) (PiExponentSeshadri.TensorPure.pure M N (U.ι ''ᵁ A) m n) := by + change (Scheme.Modules.restrictUnitIso U.ι).hom.app A + (((Scheme.Modules.restrictFunctor U.ι).map E.hom).app A + ((moduleTensorRestrict U M N).inv.app A + (PiExponentSeshadri.TensorPure.pure (M.restrict U.ι) (N.restrict U.ι) A m n))) = _ + refine (congrArg (fun z => (Scheme.Modules.restrictUnitIso U.ι).hom.app A + (((Scheme.Modules.restrictFunctor U.ι).map E.hom).app A z)) + (restrict_pure_inv U M N A m n)).trans ?_ + change (U.ι.appIso A).hom (E.hom.app (U.ι ''ᵁ A) (PiExponentSeshadri.TensorPure.pure M N (U.ι ''ᵁ A) m n)) = _ + rw [Scheme.Opens.ι_appIso] + rfl + +lemma inverseOpenFrame_pairing (E : moduleTensor X M N ≅ O X) (U : X.Opens) + (e : M.restrict U.ι ≅ O U.toScheme) + (A : U.toScheme.Opens) (m : Γ(M.restrict U.ι,A)) (n : Γ(N.restrict U.ι,A)) : + E.hom.app (U.ι ''ᵁ A) (PiExponentSeshadri.TensorPure.pure M N (U.ι ''ᵁ A) m n) = + regularValue e.hom A m * regularValue (inverseOpenFrame E U e).hom A n := by + rw [← restrictPairing_pure] + exact pairing_apply (restrictPairing E U) e A m n + +lemma pairing_restrict (E : moduleTensor X M N ≅ O X) {U V : X.Opens} + (h : V ≤ U) (m : Γ(M,U)) (n : Γ(N,U)) : + X.presheaf.map (homOfLE h).op (E.hom.app U (PiExponentSeshadri.TensorPure.pure M N U m n)) = + E.hom.app V (PiExponentSeshadri.TensorPure.pure M N V (M.presheaf.map (homOfLE h).op m) + (N.presheaf.map (homOfLE h).op n)) := by + have hn := CategoryTheory.congr_fun (E.hom.mapPresheaf.naturality (homOfLE h).op) + (PiExponentSeshadri.TensorPure.pure M N U m n) + change E.hom.app V ((moduleTensor X M N).presheaf.map (homOfLE h).op + (PiExponentSeshadri.TensorPure.pure M N U m n)) = + X.presheaf.map (homOfLE h).op (E.hom.app U (PiExponentSeshadri.TensorPure.pure M N U m n)) at hn + exact hn.symm.trans (congrArg (fun z => E.hom.app V z) + (pure_restrict M N (homOfLE h) m n)) + +private lemma restrictionMap_cycle {C : Type*} [Category C] + (F : X.Opensᵒᵖ ⥤ C) {U V : X.Opens} (h : V ≤ U) (k : U ≤ V) : + F.map (homOfLE h).op ≫ F.map (homOfLE k).op = 𝟙 (F.obj (op U)) := by + rw [← Functor.map_comp] + rw [show (homOfLE h).op ≫ (homOfLE k).op = 𝟙 (op U) from Subsingleton.elim _ _] + exact F.map_id _ + +lemma inverseOpenFrame_restrict_pairing (E : moduleTensor X M N ≅ O X) + {U V : X.Opens} (h : V ≤ U) (e : M.restrict U.ι ≅ O U.toScheme) + (A : V.toScheme.Opens) (m : Γ(M.restrict V.ι,A)) (n : Γ(N.restrict V.ι,A)) : + E.hom.app (V.ι ''ᵁ A) (PiExponentSeshadri.TensorPure.pure M N (V.ι ''ᵁ A) m n) = + regularValue (restrictOpenFrame h e).hom A m * + regularValue (restrictOpenFrame h (inverseOpenFrame E U e)).hom A n := by + let B := X.homOfLE h ''ᵁ A + have h₁ : V.ι ''ᵁ A ≤ U.ι ''ᵁ B := by simp [B, ← Scheme.Hom.comp_image] + have h₂ : U.ι ''ᵁ B ≤ V.ι ''ᵁ A := by simp [B, ← Scheme.Hom.comp_image] + let m' := M.presheaf.map (homOfLE h₂).op m + let n' := N.presheaf.map (homOfLE h₂).op n + have hp := inverseOpenFrame_pairing E U e B m' n' + have hs := congrArg (fun x : Γ(U.toScheme,B) => X.presheaf.map (homOfLE h₁).op x) hp + have hs := hs.trans ((X.presheaf.map (homOfLE h₁).op).hom.map_mul _ _) + have hr := pairing_restrict E h₁ m' n' + have hm : M.presheaf.map (homOfLE h₁).op m' = m := by + change (M.presheaf.map _ ≫ M.presheaf.map _) m = m + exact CategoryTheory.congr_fun (restrictionMap_cycle M.presheaf h₂ h₁) m + have hn : N.presheaf.map (homOfLE h₁).op n' = n := by + change (N.presheaf.map _ ≫ N.presheaf.map _) n = n + exact CategoryTheory.congr_fun (restrictionMap_cycle N.presheaf h₂ h₁) n + rw [hm, hn] at hr + dsimp only [regularValue] + rw [restrictOpenFrame_app, restrictOpenFrame_app] + exact hr.symm.trans hs + +lemma inverseOpenFrame_restrict (E : moduleTensor X M N ≅ O X) + {U V : X.Opens} (h : V ≤ U) (e : M.restrict U.ι ≅ O U.toScheme) : + restrictOpenFrame h (inverseOpenFrame E U e) = + inverseOpenFrame E V (restrictOpenFrame h e) := by + apply Iso.ext + ext A n + let eV := restrictOpenFrame h e + have h1 := inverseOpenFrame_restrict_pairing E h e A (eV.inv.app A (1 : Γ(V.toScheme,A))) n + have h2 := inverseOpenFrame_pairing E V eV A (eV.inv.app A (1 : Γ(V.toScheme,A))) n + have he : regularValue eV.hom A (eV.inv.app A (1 : Γ(V.toScheme,A))) = (1 : Γ(V.toScheme,A)) := + congrArg (fun g => g.app A (1 : Γ(V.toScheme,A))) eV.inv_hom_id + change _ = regularValue eV.hom A (eV.inv.app A (1 : Γ(V.toScheme,A))) * _ at h1 + rw [he, one_mul] at h1 h2 + exact h1.symm.trans h2 + +end +end PiExponent.InverseFrames + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/InverseFrames.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/InverseFrames.lean new file mode 100644 index 0000000000000000000000000000000000000000..91d6719946e0ccb8fe190a431c96b2071fde7da1 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/InverseFrames.lean @@ -0,0 +1,150 @@ +import OAI.NumberTheory.PiExponent.Approximation.FrameSubopens +import OAI.NumberTheory.PiExponent.Approximation.TensorPure + +namespace OAI + +namespace PiExponent.InverseFrames +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames PiExponentSeshadri.TensorPure +variable {X : Scheme.{0}} {M N : X.Modules} + +def regularValue {P : X.Modules} (f : P ⟶ O X) (U : X.Opens) + (x : P.val.obj (op U)) : Γ(X,U) := f.app U x + +def pairingFrame (E : moduleTensor X M N ≅ O X) (e : M ≅ O X) : N ≅ O X := + (moduleTensorUnit N).symm ≪≫ moduleTensorIso e.symm (Iso.refl N) ≪≫ E + +lemma unit_inv_pure (N : X.Modules) (U : X.Opens) (x : N.val.obj (op U)) : + (moduleTensorUnit N).inv.app U x = PiExponentSeshadri.TensorPure.pure (O X) N U (1 : Γ(X,U)) x := by + have h : (moduleTensorUnit N).hom.app U (PiExponentSeshadri.TensorPure.pure (O X) N U (1 : Γ(X,U)) x) = x := by + change (moduleTensorUnit N).hom.app U + (PiExponentSeshadri.TensorPure.pure (structureSheaf X) N U (1 : Γ(X,U)) x) = x + exact (unit_pure N U (1 : Γ(X,U)) x).trans (one_smul Γ(X,U) (show Γ(N,U) from x)) + calc + (moduleTensorUnit N).inv.app U x = + (moduleTensorUnit N).inv.app U + ((moduleTensorUnit N).hom.app U (PiExponentSeshadri.TensorPure.pure (O X) N U (1 : Γ(X,U)) x)) := + congrArg (fun z => (moduleTensorUnit N).inv.app U z) h.symm + _ = _ := congrArg (fun f => f.app U (PiExponentSeshadri.TensorPure.pure (O X) N U (1 : Γ(X,U)) x)) + (moduleTensorUnit N).hom_inv_id + +lemma pairingFrame_apply (E : moduleTensor X M N ≅ O X) (e : M ≅ O X) + (U : X.Opens) (x : N.val.obj (op U)) : + (pairingFrame E e).hom.app U x = + E.hom.app U (PiExponentSeshadri.TensorPure.pure M N U (e.inv.app U (1 : Γ(X,U))) x) := by + change E.hom.app U ((moduleTensorMap e.inv (𝟙 N)).app U + ((moduleTensorUnit N).inv.app U x)) = _ + rw [unit_inv_pure] + exact congrArg (fun z => E.hom.app U z) + (PiExponentSeshadri.TensorPure.map_pure e.inv (𝟙 N) U (1 : Γ(X,U)) x) + +lemma frame_generator_change (e f : M ≅ O X) : + f.inv.app ⊤ (1 : Γ(X,⊤)) = (frameChange f e : Γ(X,⊤)) • e.inv.app ⊤ (1 : Γ(X,⊤)) := by + have h := e.inv.app_smul (r := (frameChange f e : Γ(X,⊤))) + (x := (1 : Γ(X,⊤))) + change e.inv.app ⊤ ((frameChange f e : Γ(X,⊤)) * (1 : Γ(X,⊤)) : Γ(X,⊤)) = _ at h + rw [mul_one] at h + rw [← h] + change f.inv.app ⊤ (1 : Γ(X,⊤)) = e.inv.app ⊤ (e.hom.app ⊤ (f.inv.app ⊤ (1 : Γ(X,⊤)))) + exact (congrArg (fun t => t.app ⊤ (f.inv.app ⊤ (1 : Γ(X,⊤)))) e.hom_inv_id).symm + +lemma pairingFrame_change_apply (E : moduleTensor X M N ≅ O X) + (e f : M ≅ O X) (x : N.val.obj (op (⊤ : X.Opens))) : + regularValue (pairingFrame E f).hom ⊤ x = + (frameChange f e : Γ(X,⊤)) * regularValue (pairingFrame E e).hom ⊤ x := by + dsimp only [regularValue] + have hf := pairingFrame_apply E f ⊤ x + have he := pairingFrame_apply E e ⊤ x + have hg := congrArg (fun m => E.hom.app ⊤ (PiExponentSeshadri.TensorPure.pure M N ⊤ m x)) + (frame_generator_change e f) + have hs := congrArg (fun z => E.hom.app ⊤ z) + (pure_smul_left M N ⊤ (frameChange f e : Γ(X,⊤)) (e.inv.app ⊤ (1 : Γ(X,⊤))) x) + have hm := E.hom.app_smul (r := (frameChange f e : Γ(X,⊤))) + (x := PiExponentSeshadri.TensorPure.pure M N ⊤ (e.inv.app ⊤ (1 : Γ(X,⊤))) x) + exact hf.trans (hg.trans (hs.trans (hm.trans + (congrArg (fun a : Γ(X,⊤) => (frameChange f e : Γ(X,⊤)) * a) he.symm)))) + +lemma pairingFrame_frameChange (E : moduleTensor X M N ≅ O X) + (e f : M ≅ O X) : + frameChange (pairingFrame E e) (pairingFrame E f) = frameChange f e := by + apply Units.ext + change (pairingFrame E f).hom.app ⊤ ((pairingFrame E e).inv.app ⊤ (1 : Γ(X,⊤))) = _ + change regularValue (pairingFrame E f).hom ⊤ ((pairingFrame E e).inv.app ⊤ (1 : Γ(X,⊤))) = _ + erw [pairingFrame_change_apply] + have h := congrArg (fun t => t.app ⊤ (1 : Γ(X,⊤))) (pairingFrame E e).inv_hom_id + change (pairingFrame E e).hom.app ⊤ ((pairingFrame E e).inv.app ⊤ (1 : Γ(X,⊤))) = (1 : Γ(X,⊤)) at h + have hv : regularValue (pairingFrame E e).hom ⊤ + ((pairingFrame E e).inv.app ⊤ (1 : Γ(X,⊤))) = 1 := h + rw [hv, mul_one] + +lemma pairing_apply (E : moduleTensor X M N ≅ O X) (e : M ≅ O X) + (U : X.Opens) (m : M.val.obj (op U)) (n : N.val.obj (op U)) : + regularValue E.hom U (PiExponentSeshadri.TensorPure.pure M N U m n) = + regularValue e.hom U m * regularValue (pairingFrame E e).hom U n := by + have hm : m = (regularValue e.hom U m) • e.inv.app U (1 : Γ(X,U)) := by + have h := e.inv.app_smul (r := (regularValue e.hom U m)) + (x := (1 : Γ(X,U))) + change e.inv.app U (regularValue e.hom U m * (1 : Γ(X,U)) : Γ(X,U)) = _ at h + rw [mul_one] at h + rw [← h] + exact (congrArg (fun t => t.app U m) e.hom_inv_id).symm + calc + regularValue E.hom U (PiExponentSeshadri.TensorPure.pure M N U m n) = + regularValue E.hom U (PiExponentSeshadri.TensorPure.pure M N U ((regularValue e.hom U m) • e.inv.app U (1 : Γ(X,U))) n) := + congrArg (fun z => regularValue E.hom U (PiExponentSeshadri.TensorPure.pure M N U z n)) hm + _ = (regularValue e.hom U m) * regularValue E.hom U (PiExponentSeshadri.TensorPure.pure M N U (e.inv.app U (1 : Γ(X,U))) n) := by + erw [pure_smul_left] + exact E.hom.app_smul _ _ + _ = _ := by + dsimp only [regularValue] + rw [pairingFrame_apply] + +lemma pairing_inverse_generator (E : moduleTensor X M N ≅ O X) (e : M ≅ O X) + (U : X.Opens) (m : M.val.obj (op U)) : + E.hom.app U (PiExponentSeshadri.TensorPure.pure M N U m ((pairingFrame E e).inv.app U (1 : Γ(X,U)))) = e.hom.app U m := by + change regularValue E.hom U _ = regularValue e.hom U m + erw [pairing_apply] + have h := congrArg (fun t => t.app U (1 : Γ(X,U))) (pairingFrame E e).inv_hom_id + change (pairingFrame E e).hom.app U ((pairingFrame E e).inv.app U (1 : Γ(X,U))) = (1 : Γ(X,U)) at h + have hv : regularValue (pairingFrame E e).hom U + ((pairingFrame E e).inv.app U (1 : Γ(X,U))) = 1 := h + rw [hv, mul_one] + +def dualMap (E : moduleTensor X M N ≅ O X) (s : O X ⟶ M) : N ⟶ O X := + (moduleTensorUnit N).inv ≫ moduleTensorMap s (𝟙 N) ≫ E.hom + +lemma dualMap_apply (E : moduleTensor X M N ≅ O X) (s : O X ⟶ M) + (U : X.Opens) (n : N.val.obj (op U)) : + (dualMap E s).app U n = E.hom.app U (PiExponentSeshadri.TensorPure.pure M N U (s.app U (1 : Γ(X,U))) n) := by + change E.hom.app U ((moduleTensorMap s (𝟙 N)).app U + ((moduleTensorUnit N).inv.app U n)) = _ + rw [unit_inv_pure] + exact congrArg (fun z => E.hom.app U z) + (PiExponentSeshadri.TensorPure.map_pure s (𝟙 N) U (1 : Γ(X,U)) n) + +lemma dualMap_coefficient (E : moduleTensor X M N ≅ O X) (e : M ≅ O X) + (s : O X ⟶ M) : + endValue ((pairingFrame E e).inv ≫ dualMap E s) = coefficient e s := by + change (dualMap E s).app ⊤ ((pairingFrame E e).inv.app ⊤ (1 : Γ(X,⊤))) = e.hom.app ⊤ (s.app ⊤ (1 : Γ(X,⊤))) + exact (dualMap_apply E s ⊤ ((pairingFrame E e).inv.app ⊤ (1 : Γ(X,⊤)))).trans + (pairing_inverse_generator E e ⊤ (s.app ⊤ (1 : Γ(X,⊤)))) + +def restrictPairing (E : moduleTensor X M N ≅ O X) (U : X.Opens) : + moduleTensor U.toScheme (M.restrict U.ι) (N.restrict U.ι) ≅ O U.toScheme := + (moduleTensorRestrict U M N).symm ≪≫ + (Scheme.Modules.restrictFunctor U.ι).mapIso E ≪≫ Scheme.Modules.restrictUnitIso U.ι + +def inverseOpenFrame (E : moduleTensor X M N ≅ O X) (U : X.Opens) + (e : M.restrict U.ι ≅ O U.toScheme) : N.restrict U.ι ≅ O U.toScheme := + pairingFrame (restrictPairing E U) e + +lemma inverseOpenFrame_frameChange (E : moduleTensor X M N ≅ O X) (U : X.Opens) + (e f : M.restrict U.ι ≅ O U.toScheme) : + frameChange (inverseOpenFrame E U e) (inverseOpenFrame E U f) = frameChange f e := + pairingFrame_frameChange (restrictPairing E U) e f + +end +end PiExponent.InverseFrames + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/LineClosedUnit.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/LineClosedUnit.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d72494d36532814600dab63dcf55048038fa28f --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/LineClosedUnit.lean @@ -0,0 +1,69 @@ +import OAI.NumberTheory.PiExponent.Approximation.CoherentTwistPresentation +import OAI.NumberTheory.PiExponent.Approximation.OpenPullbackUnit +import OAI.NumberTheory.PiExponent.LocalAlgebra.IdealModule + +namespace OAI + + +namespace PiExponentSeshadri.LineClosedUnit +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite +open PiExponentSeshadri.Geometry PiExponentSeshadri.Frames +variable {X Y : Scheme.{0}} (f : X ⟶ Y) + +def map (L : LineBundle Y) : L.sheaf ⟶ + (Scheme.Modules.pushforward f).obj ((Scheme.Modules.pullback f).obj L.sheaf) := + (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app L.sheaf + +def frame (L : LineBundle Y) (U : Y.Opens) (e : L.sheaf.restrict U.ι ≅ O U.toScheme) : + ((Scheme.Modules.pushforward f).obj ((Scheme.Modules.pullback f).obj L.sheaf)).restrict U.ι ≅ + (Scheme.Modules.pushforward (f ∣_ U)).obj (O (f ⁻¹ᵁ U).toScheme) := + OpenBaseChange.iso f U _ ≪≫ + (Scheme.Modules.pushforward (f ∣_ U)).mapIso + ((OpenBaseChange.leftSquare f U).app L.sheaf).symm ≪≫ + (Scheme.Modules.pushforward (f ∣_ U)).mapIso (pullbackFrame (f ∣_ U) e) + +lemma framed_map (L : LineBundle Y) (U : Y.Opens) + (e : L.sheaf.restrict U.ι ≅ O U.toScheme) : + e.inv ≫ (Scheme.Modules.restrictFunctor U.ι).map (map f L) ≫ + (frame f L U e).hom = IdealModule.structureMap (f ∣_ U) := by + dsimp only [map, IdealModule.structureMap] + have hu := OpenBaseChange.unit_compatibility f U L.sheaf + have hn := (Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).unit_naturality e.hom + have hb := pullbackUnit_adjunction (f ∣_ U) + rw [Adjunction.homEquiv_unit] at hb + dsimp only [frame, Iso.trans_hom, Functor.mapIso_hom, Iso.symm_hom] + simp only [← Category.assoc] + rw [Category.assoc e.inv, hu] + simp only [Category.assoc] + have hec : (OpenBaseChange.leftSquare f U).hom.app L.sheaf ≫ + ((OpenBaseChange.leftSquare f U).app L.sheaf).inv = 𝟙 _ := + ((OpenBaseChange.leftSquare f U).app L.sheaf).hom_inv_id + rw [← Functor.map_comp_assoc, hec] + erw [CategoryTheory.Functor.map_id, Category.id_comp] + change e.inv ≫ (Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).unit.app _ ≫ + (Scheme.Modules.pushforward (f ∣_ U)).map + ((Scheme.Modules.pullback (f ∣_ U)).map e.hom ≫ (pullbackUnitIso (f ∣_ U)).hom) = _ + rw [Functor.map_comp] + have hn' := congrArg (fun t => e.inv ≫ t ≫ + (Scheme.Modules.pushforward (f ∣_ U)).map (pullbackUnitIso (f ∣_ U)).hom) hn + simp only [Category.assoc, hb] at hn' + exact hn'.trans (e.inv_hom_id_assoc _) + +theorem epi [IsClosedImmersion f] (L : LineBundle Y) : Epi (map f L) := by + apply PiExponent.CoherentTwist.epi_of_local + intro y + obtain ⟨U,hy,⟨e⟩⟩ := L.locallyRankOne y + refine ⟨U,hy,?_⟩ + have hg : Epi (IdealModule.structureMap (f ∣_ U)) := IdealModule.structureMap_epi _ + have he := framed_map f L U e + have : Epi (e.inv ≫ (Scheme.Modules.restrictFunctor U.ι).map (map f L) ≫ + (frame f L U e).hom) := he.symm ▸ hg + have h1 : Epi ((Scheme.Modules.restrictFunctor U.ι).map (map f L) ≫ + (frame f L U e).hom) := epi_of_epi e.inv _ + exact (epi_comp_iff_of_isIso _ _).mp h1 + +end +end PiExponentSeshadri.LineClosedUnit + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/LinePowerLaws.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/LinePowerLaws.lean new file mode 100644 index 0000000000000000000000000000000000000000..67ea28b5b1ee01c54e8f15b3215d6fb26a39c099 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/LinePowerLaws.lean @@ -0,0 +1,197 @@ +import OAI.NumberTheory.PiExponent.Approximation.CoherentTwistPresentation + +namespace OAI + +noncomputable section + +universe u v + +namespace PiExponent.NumericalAmpleness +open CategoryTheory AlgebraicGeometry +lemma isIso_of_locally_isIso {X : Scheme} {M N : X.Modules} (f : M ⟶ N) + (h : ∀ x : X, ∃ U : X.Opens, x ∈ U ∧ IsIso ((Scheme.Modules.restrictFunctor U.ι).map f)) : + IsIso f := by + have : Mono f := PiExponent.CoherentTwist.mono_of_local f (fun x => by + obtain ⟨U,hx,hi⟩ := h x + have := hi + exact ⟨U,hx,inferInstance⟩) + have : Epi f := PiExponent.CoherentTwist.epi_of_local f (fun x => by + obtain ⟨U,hx,hi⟩ := h x + have := hi + exact ⟨U,hx,inferInstance⟩) + exact isIso_of_mono_of_epi f +end PiExponent.NumericalAmpleness + +namespace PiExponentSeshadri.TensorLocalization +open CategoryTheory MonoidalCategory +universe v' u' +variable {C : Type u} [Category.{v} C] [MonoidalCategory C] + {D : Type u'} [Category.{v'} D] (F : C ⥤ D) + +lemma map_tensor_right_unit {P Q L : C} (f : P ⟶ Q) (e : L ≅ 𝟙_ C) + [IsIso (F.map f)] : IsIso (F.map (f ⊗ₘ 𝟙 L)) := by + let ε (A : C) : A ⊗ L ≅ A := tensorIso (Iso.refl A) e ≪≫ ρ_ A + have h : (f ⊗ₘ 𝟙 L) ≫ (ε Q).hom = (ε P).hom ≫ f := by + simp only [ε, Iso.trans_hom, tensorIso_hom, Iso.refl_hom] + rw [← Category.assoc, tensorHom_comp_tensorHom, Category.comp_id, Category.id_comp] + have ht : f ⊗ₘ e.hom = (𝟙 P ⊗ₘ e.hom) ≫ (f ⊗ₘ 𝟙 (𝟙_ C)) := by + rw [tensorHom_comp_tensorHom] + simp only [Category.id_comp, Category.comp_id] + rw [ht, Category.assoc, tensorHom_id, rightUnitor_naturality, Category.assoc] + have hh : IsIso (F.map ((f ⊗ₘ 𝟙 L) ≫ (ε Q).hom)) := by + rw [h, F.map_comp] + infer_instance + rw [F.map_comp] at hh + exact (isIso_comp_right_iff _ _).mp hh + +end PiExponentSeshadri.TensorLocalization + +namespace PiExponentSeshadri.Geometry + +section +open CategoryTheory AlgebraicGeometry TopologicalSpace MonoidalCategory +open scoped AlgebraicGeometry +variable {X : Scheme} + +lemma sheafification_tensor_right_isIso + {P Q : PresheafOfModules X.ringCatSheaf.obj} (f : P ⟶ Q) (L : LineBundle X) + [IsIso ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map f)] : + IsIso ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map + (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) f (𝟙 L.sheaf.val))) := by + let F : PresheafOfModules X.ringCatSheaf.obj ⥤ X.Modules := + PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj) + apply PiExponent.NumericalAmpleness.isIso_of_locally_isIso + intro x + obtain ⟨U, hx, ⟨e⟩⟩ := L.locallyRankOne x + refine ⟨U, hx, ?_⟩ + let R : PresheafOfModules X.ringCatSheaf.obj ⥤ + PresheafOfModules U.toScheme.ringCatSheaf.obj := modulePresheafRestrict U.ι + let S : PresheafOfModules U.toScheme.ringCatSheaf.obj ⥤ U.toScheme.Modules := + PresheafOfModules.sheafification (𝟙 U.toScheme.ringCatSheaf.obj) + let : MonoidalCategory (PresheafOfModules U.toScheme.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := U.toScheme.presheaf) + have hf : IsIso (S.map (R.map f)) := by + apply (NatIso.isIso_map_iff (moduleSheafificationRestrict U.ι) f).mp + change IsIso ((Scheme.Modules.restrictFunctor U.ι).map (F.map f)) + let : IsIso (F.map f) := inferInstanceAs + (IsIso ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map f)) + exact (Scheme.Modules.restrictFunctor U.ι).map_isIso (F.map f) + let ep : R.obj L.sheaf.val ≅ 𝟙_ (PresheafOfModules U.toScheme.ringCatSheaf.obj) := + (SheafOfModules.forget _).mapIso e + have ht : IsIso (S.map ((R.map f) ⊗ₘ 𝟙 (R.obj L.sheaf.val))) := + TensorLocalization.map_tensor_right_unit S (R.map f) ep + apply (NatIso.isIso_map_iff (moduleSheafificationRestrict U.ι) _).mpr + let g := PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) f (𝟙 L.sheaf.val) + change IsIso (S.map (R.map g)) + have heq := modulePresheafTensorRestrict_natural U f (𝟙 L.sheaf.val) + let : IsIso (S.map (modulePresheafTensorRestrict U P L.sheaf.val).hom) := + (S.mapIso (modulePresheafTensorRestrict U P L.sheaf.val)).isIso_hom + let : IsIso (S.map (modulePresheafTensorRestrict U Q L.sheaf.val).hom) := + (S.mapIso (modulePresheafTensorRestrict U Q L.sheaf.val)).isIso_hom + have hcomp : IsIso (S.map (R.map g ≫ + (modulePresheafTensorRestrict U Q L.sheaf.val).hom)) := by + erw [heq, S.map_comp] + have ht' : IsIso (S.map + (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := U.toScheme.presheaf) + (R.map f) (R.map (𝟙 L.sheaf.val)))) := by + rw [R.map_id] + exact ht + exact (inferInstance : IsIso (C := U.toScheme.Modules) + (S.map (modulePresheafTensorRestrict U P L.sheaf.val).hom ≫ S.map + (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := U.toScheme.presheaf) + (R.map f) (R.map (𝟙 L.sheaf.val))))) + erw [S.map_comp] at hcomp + exact (isIso_comp_right_iff (C := U.toScheme.Modules) _ _).mp hcomp + +end + +open CategoryTheory AlgebraicGeometry TopologicalSpace MonoidalCategory BraidedCategory +open scoped AlgebraicGeometry +variable {X : Scheme} + +lemma sheafification_tensor_left_isIso + {P Q : PresheafOfModules X.ringCatSheaf.obj} (f : P ⟶ Q) (L : LineBundle X) + [IsIso ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map f)] : + IsIso ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map + (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) (𝟙 L.sheaf.val) f)) := by + let : MonoidalCategory (PresheafOfModules X.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf) + let : SymmetricCategory (PresheafOfModules X.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.symmetricCategory (R := X.presheaf) + let F : PresheafOfModules X.ringCatSheaf.obj ⥤ X.Modules := + PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj) + have : IsIso (F.map (f ⊗ₘ 𝟙 L.sheaf.val)) := sheafification_tensor_right_isIso f L + let : IsIso (F.map (β_ L.sheaf.val P).hom) := + (F.mapIso (β_ L.sheaf.val P)).isIso_hom + have h : IsIso (F.map ((𝟙 L.sheaf.val ⊗ₘ f) ≫ (β_ L.sheaf.val Q).hom)) := by + rw [braiding_naturality, F.map_comp] + exact (inferInstance : IsIso (C := X.Modules) + (F.map (β_ L.sheaf.val P).hom ≫ F.map (f ⊗ₘ 𝟙 L.sheaf.val))) + rw [F.map_comp] at h + exact (isIso_comp_right_iff _ _).mp h + +def sheafificationTensorRight (P : PresheafOfModules X.ringCatSheaf.obj) + (L : LineBundle X) : + (PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).obj + (PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) P L.sheaf.val) ≅ + moduleTensor X ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).obj P) + L.sheaf := by + let F := PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj) + let η := (PresheafOfModules.sheafificationAdjunction (𝟙 X.ringCatSheaf.obj)).unit.app P + have : IsIso (F.map η) := + isIso_of_comp_hom_eq_id _ + ((PresheafOfModules.sheafificationAdjunction (𝟙 X.ringCatSheaf.obj)).left_triangle_components P) + let ht : IsIso (F.map (PresheafOfModulesOfCommRing.Monoidal.tensorHom + (R := X.presheaf) η (𝟙 L.sheaf.val))) := sheafification_tensor_right_isIso η L + exact @asIso _ _ _ _ (F.map (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) + η (𝟙 L.sheaf.val))) ht + +def sheafificationTensorLeft (P : PresheafOfModules X.ringCatSheaf.obj) + (L : LineBundle X) : + (PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).obj + (PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) L.sheaf.val P) ≅ + moduleTensor X L.sheaf + ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).obj P) := by + let F := PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj) + let η := (PresheafOfModules.sheafificationAdjunction (𝟙 X.ringCatSheaf.obj)).unit.app P + have : IsIso (F.map η) := + isIso_of_comp_hom_eq_id _ + ((PresheafOfModules.sheafificationAdjunction (𝟙 X.ringCatSheaf.obj)).left_triangle_components P) + let ht : IsIso (F.map (PresheafOfModulesOfCommRing.Monoidal.tensorHom + (R := X.presheaf) (𝟙 L.sheaf.val) η)) := sheafification_tensor_left_isIso η L + exact @asIso _ _ _ _ (F.map (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) + (𝟙 L.sheaf.val) η)) ht + +def lineTensorAssoc (L M N : LineBundle X) : + moduleTensor X (moduleTensor X L.sheaf M.sheaf) N.sheaf ≅ + moduleTensor X L.sheaf (moduleTensor X M.sheaf N.sheaf) := by + let : MonoidalCategory (PresheafOfModules X.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf) + exact (sheafificationTensorRight (L.sheaf.val ⊗ M.sheaf.val) N).symm ≪≫ + (PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).mapIso + (α_ L.sheaf.val M.sheaf.val N.sheaf.val) ≪≫ + sheafificationTensorLeft (M.sheaf.val ⊗ N.sheaf.val) L + +def linePowerAdd (L : LineBundle X) : ∀ m n : ℕ, + modulePow X L.sheaf (m + n) ≅ + moduleTensor X (modulePow X L.sheaf m) (modulePow X L.sheaf n) + | 0, n => by + simpa only [Nat.zero_add, modulePow, structureSheaf] using (moduleTensorUnit (modulePow X L.sheaf n)).symm + | m + 1, n => by + rw [Nat.succ_add] + exact moduleTensorIso (Iso.refl _) (linePowerAdd L m n) ≪≫ + (lineTensorAssoc L (L.pow m) (L.pow n)).symm + +def linePowerMul (L : LineBundle X) (m : ℕ) : ∀ n : ℕ, + modulePow X (modulePow X L.sheaf m) n ≅ modulePow X L.sheaf (m * n) + | 0 => Iso.refl _ + | n + 1 => by + rw [Nat.mul_succ, Nat.add_comm (m * n) m] + exact moduleTensorIso (Iso.refl _) (linePowerMul L m n) ≪≫ + (linePowerAdd L m (m * n)).symm + +end PiExponentSeshadri.Geometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/LinePullback.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/LinePullback.lean new file mode 100644 index 0000000000000000000000000000000000000000..8da5881300dd811cb80a3ad9e47d2f175764819d --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/LinePullback.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.PiExponent.Geometry.LineBundleTensor + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace +variable {X Y : Scheme.{0}} + +instance opensMap_final (f : Y ⟶ X) : (Opens.map f.base).Final := by + let : PreservesLimit (Functor.empty.{0} X.Opens) (Opens.map f.base) := by + apply preservesLimit_of_preserves_limit_cone (isTerminalTop (α := X.Opens)) + exact (isLimitMapConeEmptyConeEquiv (Opens.map f.base) (⊤ : X.Opens)).symm isTerminalTop + infer_instance + +def pullbackRestrictIso (f : Y ⟶ X) (L : X.Modules) (U : X.Opens) : + ((Scheme.Modules.pullback f).obj L).restrict (f ⁻¹ᵁ U).ι ≅ + (Scheme.Modules.pullback (f ∣_ U)).obj (L.restrict U.ι) := + (Scheme.Modules.restrictFunctorIsoPullback (f ⁻¹ᵁ U).ι).app _ ≪≫ + (Scheme.Modules.pullbackComp (f ⁻¹ᵁ U).ι f).app L ≪≫ + (Scheme.Modules.pullbackCongr (morphismRestrict_ι f U).symm).app L ≪≫ + ((Scheme.Modules.pullbackComp (f ∣_ U) U.ι).app L).symm ≪≫ + (Scheme.Modules.pullback (f ∣_ U)).mapIso + ((Scheme.Modules.restrictFunctorIsoPullback U.ι).app L).symm + +def LineBundle.pullback (L : LineBundle X) (f : Y ⟶ X) : LineBundle Y where + sheaf := (Scheme.Modules.pullback f).obj L.sheaf + locallyRankOne y := by + obtain ⟨U,hy,⟨e⟩⟩ := L.locallyRankOne (f y) + refine ⟨f ⁻¹ᵁ U,hy,⟨pullbackRestrictIso f L.sheaf U ≪≫ + (Scheme.Modules.pullback (f ∣_ U)).mapIso e ≪≫ ?_⟩⟩ + letI : (Opens.map (f ∣_ U).base).Final := opensMap_final (f ∣_ U) + letI : (SheafOfModules.pushforward (f ∣_ U).toRingCatSheafHom).IsRightAdjoint := + inferInstanceAs (Scheme.Modules.pushforward (f ∣_ U)).IsRightAdjoint + let hu : IsIso (SheafOfModules.pullbackObjUnitToUnit (f ∣_ U).toRingCatSheafHom) := + SheafOfModules.instIsIsoPullbackObjUnitToUnitOfFinal (f ∣_ U).toRingCatSheafHom + let a : (SheafOfModules.pullback (f ∣_ U).toRingCatSheafHom).obj + (SheafOfModules.unit U.toScheme.ringCatSheaf) ≅ + SheafOfModules.unit (f ⁻¹ᵁ U).toScheme.ringCatSheaf := + @asIso _ _ _ _ (SheafOfModules.pullbackObjUnitToUnit (f ∣_ U).toRingCatSheafHom) hu + exact { hom := a.hom, inv := a.inv, hom_inv_id := a.hom_inv_id, inv_hom_id := a.inv_hom_id } + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/LinePullbackPowers.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/LinePullbackPowers.lean new file mode 100644 index 0000000000000000000000000000000000000000..aae60d56c6610c1670561a02ee4e79565140d186 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/LinePullbackPowers.lean @@ -0,0 +1,219 @@ +import OAI.NumberTheory.PiExponent.Approximation.SectionOpens +import OAI.NumberTheory.PiExponent.Approximation.TensorOpenBaseChange + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.PullbackTensor +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite MonoidalCategory +open PiExponentSeshadri.Geometry PiExponentSeshadri.TensorPure PiExponentSeshadri.Frames +variable {X Y : Scheme.{0}} (f : X ⟶ Y) (U : Y.Opens) + +def hom (M N : Y.Modules) : (Scheme.Modules.pullback f).obj (moduleTensor Y M N) ⟶ + moduleTensor X ((Scheme.Modules.pullback f).obj M) ((Scheme.Modules.pullback f).obj N) := + ((Scheme.Modules.pullbackPushforwardAdjunction f).homEquiv _ _).symm + (moduleTensorMap ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M) + ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app N) ≫ + PushforwardTensor.hom f _ _) + +lemma unit_hom (M N : Y.Modules) : + (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (moduleTensor Y M N) ≫ + (Scheme.Modules.pushforward f).map (hom f M N) = + moduleTensorMap ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M) + ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app N) ≫ + PushforwardTensor.hom f _ _ := + ((Scheme.Modules.pullbackPushforwardAdjunction f).homEquiv _ _).apply_symm_apply _ + +@[reassoc] lemma naturality {M N P Q : Y.Modules} (a : M ⟶ P) (b : N ⟶ Q) : + (Scheme.Modules.pullback f).map (moduleTensorMap a b) ≫ hom f P Q = + hom f M N ≫ moduleTensorMap ((Scheme.Modules.pullback f).map a) + ((Scheme.Modules.pullback f).map b) := by + apply ((Scheme.Modules.pullbackPushforwardAdjunction f).homEquiv _ _).injective + rw [Adjunction.homEquiv_naturality_left,Adjunction.homEquiv_naturality_right] + simp only [hom,Equiv.apply_symm_apply] + rw [← Category.assoc,← moduleTensorMap_comp] + rw [Category.assoc,← PushforwardTensor.naturality,← Category.assoc,← moduleTensorMap_comp] + rw [← (Scheme.Modules.pullbackPushforwardAdjunction f).unit_naturality, + ← (Scheme.Modules.pullbackPushforwardAdjunction f).unit_naturality] + +lemma unit_pure_structure (Z : Scheme.{0}) (U : Z.Opens) + (a b : (O Z).val.obj (op U)) : + (moduleTensorUnit (O Z)).hom.app U (pure (O Z) (O Z) U a b) = + (show Γ(Z,U) from a) * (show Γ(Z,U) from b) := + TensorPure.unit_pure (O Z) U a b + +lemma unit_compatibility : + hom f (O Y) (O Y) ≫ + (moduleTensorIso (pullbackUnitIso f) (pullbackUnitIso f)).hom ≫ + (moduleTensorUnit (O X)).hom = + (Scheme.Modules.pullback f).map (moduleTensorUnit (O Y)).hom ≫ + (pullbackUnitIso f).hom := by + apply ((Scheme.Modules.pullbackPushforwardAdjunction f).homEquiv _ _).injective + let adj := Scheme.Modules.pullbackPushforwardAdjunction f + have hl := adj.homEquiv_naturality_left (moduleTensorUnit (O Y)).hom + (pullbackUnitIso f).hom + have hr := adj.homEquiv_naturality_right (hom f (O Y) (O Y)) + ((moduleTensorIso (pullbackUnitIso f) (pullbackUnitIso f)).hom ≫ + (moduleTensorUnit (O X)).hom) + have hu := congrArg (fun q => (moduleTensorUnit (O Y)).hom ≫ q) + (pullbackUnit_adjunction f) + refine hr.trans (Eq.trans ?_ (hu.symm.trans hl.symm)) + simp only [adj, hom, Equiv.apply_symm_apply] + apply TensorPure.hom_ext + intro U a b + change (moduleTensorUnit (O X)).hom.app (f ⁻¹ᵁ U) + ((moduleTensorMap (pullbackUnitIso f).hom (pullbackUnitIso f).hom).app (f ⁻¹ᵁ U) + ((PushforwardTensor.hom f _ _).app U ((moduleTensorMap _ _).app U + (pure (O Y) (O Y) U a b)))) = + (f.app U) ((moduleTensorUnit (O Y)).hom.app U (pure (O Y) (O Y) U a b)) + let η := (Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (O Y) + let m := η.app U a + let n := η.app U b + have h₁ := congrArg (fun z => (moduleTensorUnit (O X)).hom.app (f ⁻¹ᵁ U) + ((moduleTensorMap (pullbackUnitIso f).hom (pullbackUnitIso f).hom).app (f ⁻¹ᵁ U) + ((PushforwardTensor.hom f _ _).app U z))) + (TensorPure.map_pure η η U a b) + have h₂ := congrArg (fun z => (moduleTensorUnit (O X)).hom.app (f ⁻¹ᵁ U) + ((moduleTensorMap (pullbackUnitIso f).hom (pullbackUnitIso f).hom).app (f ⁻¹ᵁ U) z)) + (PushforwardTensor.hom_pure f ((Scheme.Modules.pullback f).obj (O Y)) + ((Scheme.Modules.pullback f).obj (O Y)) U m n) + have h₃ := congrArg (fun z => (moduleTensorUnit (O X)).hom.app (f ⁻¹ᵁ U) z) + (TensorPure.map_pure (pullbackUnitIso f).hom (pullbackUnitIso f).hom (f ⁻¹ᵁ U) m n) + refine h₁.trans (h₂.trans (h₃.trans ((unit_pure_structure X (f ⁻¹ᵁ U) _ _).trans ?_))) + have hy := congrArg (fun z => (f.app U) z) (unit_pure_structure Y U a b) + refine Eq.trans ?_ hy.symm + have hu := congrArg (fun q => q.app U) (pullbackUnit_adjunction f) + have ha := congrArg (fun q => q a) hu + have hb := congrArg (fun q => q b) hu + change (pullbackUnitIso f).hom.app (f ⁻¹ᵁ U) + (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (O Y)).app U a) = + (f.app U) a at ha + change (pullbackUnitIso f).hom.app (f ⁻¹ᵁ U) + (((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app (O Y)).app U b) = + (f.app U) b at hb + exact (congrArg₂ (fun a b : Γ(X,f ⁻¹ᵁ U) => a * b) ha hb).trans + (map_mul (f.app U).hom (show Γ(Y,U) from a) (show Γ(Y,U) from b)).symm + +instance unit_isIso : IsIso (hom f (O Y) (O Y)) := by + let e := (Scheme.Modules.pullback f).mapIso (moduleTensorUnit (O Y)) ≪≫ + pullbackUnitIso f + let d := moduleTensorIso (pullbackUnitIso f) (pullbackUnitIso f) ≪≫ + moduleTensorUnit (O X) + have hi : IsIso (hom f (O Y) (O Y) ≫ d.hom) := by + change IsIso (hom f (O Y) (O Y) ≫ + (moduleTensorIso (pullbackUnitIso f) (pullbackUnitIso f)).hom ≫ + (moduleTensorUnit (O X)).hom) + rw [unit_compatibility] + exact e.isIso_hom + let hd : IsIso (C := X.Modules) d.hom := d.isIso_hom + exact (@isIso_comp_right_iff X.Modules _ _ _ _ _ _ hd).mp hi + +lemma open_transpose (M : Y.Modules) : + (Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).homEquiv _ _ + ((OpenBaseChange.leftSquare f U).hom.app M) = + (Scheme.Modules.restrictFunctor U.ι).map + ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M) ≫ + (OpenBaseChange.iso f U ((Scheme.Modules.pullback f).obj M)).hom := + (OpenBaseChange.unit_compatibility f U M).symm + +lemma restrict_compatibility (M N : Y.Modules) : + (OpenBaseChange.leftSquare f U).hom.app (moduleTensor Y M N) ≫ + (Scheme.Modules.restrictFunctor (f ⁻¹ᵁ U).ι).map (hom f M N) ≫ + (moduleTensorRestrict (f ⁻¹ᵁ U) ((Scheme.Modules.pullback f).obj M) + ((Scheme.Modules.pullback f).obj N)).hom = + (Scheme.Modules.pullback (f ∣_ U)).map (moduleTensorRestrict U M N).hom ≫ + hom (f ∣_ U) (M.restrict U.ι) (N.restrict U.ι) ≫ + moduleTensorMap ((OpenBaseChange.leftSquare f U).hom.app M) + ((OpenBaseChange.leftSquare f U).hom.app N) := by + apply ((Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).homEquiv _ _).injective + conv_rhs => rw [Adjunction.homEquiv_naturality_left, + Adjunction.homEquiv_naturality_right] + conv_lhs => rw [Adjunction.homEquiv_naturality_right] + rw [open_transpose] + have ht : (Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).homEquiv _ _ + (hom (f ∣_ U) (M.restrict U.ι) (N.restrict U.ι)) = + moduleTensorMap ((Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).unit.app (M.restrict U.ι)) + ((Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).unit.app (N.restrict U.ι)) ≫ + PushforwardTensor.hom (f ∣_ U) _ _ := Equiv.apply_symm_apply _ _ + rw [ht] + simp only [Functor.map_comp, Category.assoc] + rw [← OpenBaseChange.naturality_assoc] + rw [← Functor.map_comp_assoc, unit_hom, Functor.map_comp] + simp only [Category.assoc] + rw [OpenBaseChange.tensor_square] + rw [← Category.assoc] + refine (congrArg (fun q => q ≫ + moduleTensorMap (OpenBaseChange.iso f U ((Scheme.Modules.pullback f).obj M)).hom + (OpenBaseChange.iso f U ((Scheme.Modules.pullback f).obj N)).hom ≫ + PushforwardTensor.hom (f ∣_ U) + (((Scheme.Modules.pullback f).obj M).restrict (f ⁻¹ᵁ U).ι) + (((Scheme.Modules.pullback f).obj N).restrict (f ⁻¹ᵁ U).ι)) + (TensorPure.restrict_map U + ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M) + ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app N))).trans ?_ + simp only [Category.assoc] + rw [← moduleTensorMap_comp_assoc] + rw [OpenBaseChange.unit_compatibility,OpenBaseChange.unit_compatibility] + rw [moduleTensorMap_comp] + simp only [Category.assoc] + exact congrArg (fun q => (moduleTensorRestrict U M N).hom ≫ + moduleTensorMap ((Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).unit.app (M.restrict U.ι)) + ((Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).unit.app (N.restrict U.ι)) ≫ q) + (PushforwardTensor.naturality (f ∣_ U) + ((OpenBaseChange.leftSquare f U).hom.app M) ((OpenBaseChange.leftSquare f U).hom.app N)) + +lemma framed_isIso (M N : Y.Modules) (e : M ≅ O Y) (d : N ≅ O Y) : + IsIso (hom f M N) := by + have h := naturality f e.hom d.hom + have : IsIso ((Scheme.Modules.pullback f).map (moduleTensorMap e.hom d.hom) ≫ + hom f (O Y) (O Y)) := by + change IsIso ((Scheme.Modules.pullback f).map (moduleTensorIso e d).hom ≫ _) + infer_instance + have : IsIso (moduleTensorMap ((Scheme.Modules.pullback f).map e.hom) + ((Scheme.Modules.pullback f).map d.hom)) := by + change IsIso (moduleTensorIso ((Scheme.Modules.pullback f).mapIso e) + ((Scheme.Modules.pullback f).mapIso d)).hom + infer_instance + have hi : IsIso (hom f M N ≫ moduleTensorMap ((Scheme.Modules.pullback f).map e.hom) + ((Scheme.Modules.pullback f).map d.hom)) := h ▸ inferInstance + exact (isIso_comp_right_iff _ _).mp hi + +instance power_step_isIso (L : LineBundle Y) (n : ℕ) : + IsIso (hom f L.sheaf (L.pow n).sheaf) := by + apply PiExponentSeshadri.SectionOpens.isIso_of_locally_isIso + intro x + obtain ⟨U,hx,⟨e⟩⟩ := L.locallyRankOne (f x) + let d := modulePowFrame U e n + refine ⟨f ⁻¹ᵁ U,hx,?_⟩ + let : IsIso (hom (f ∣_ U) (L.sheaf.restrict U.ι) ((L.pow n).sheaf.restrict U.ι)) := + framed_isIso (f ∣_ U) _ _ e d + have : IsIso (moduleTensorMap ((OpenBaseChange.leftSquare f U).hom.app L.sheaf) + ((OpenBaseChange.leftSquare f U).hom.app (L.pow n).sheaf)) := by + change IsIso (moduleTensorIso ((OpenBaseChange.leftSquare f U).app L.sheaf) + ((OpenBaseChange.leftSquare f U).app (L.pow n).sheaf)).hom + infer_instance + have h := restrict_compatibility f U L.sheaf (L.pow n).sheaf + have : IsIso ((OpenBaseChange.leftSquare f U).hom.app (moduleTensor Y L.sheaf (L.pow n).sheaf) ≫ + (Scheme.Modules.restrictFunctor (f ⁻¹ᵁ U).ι).map (hom f L.sheaf (L.pow n).sheaf) ≫ + (moduleTensorRestrict (f ⁻¹ᵁ U) ((Scheme.Modules.pullback f).obj L.sheaf) + ((Scheme.Modules.pullback f).obj (L.pow n).sheaf)).hom) := by rw [h]; infer_instance + have hi : IsIso ((Scheme.Modules.restrictFunctor (f ⁻¹ᵁ U).ι).map + (hom f L.sheaf (L.pow n).sheaf) ≫ + (moduleTensorRestrict (f ⁻¹ᵁ U) ((Scheme.Modules.pullback f).obj L.sheaf) + ((Scheme.Modules.pullback f).obj (L.pow n).sheaf)).hom) := + (isIso_comp_left_iff ((OpenBaseChange.leftSquare f U).hom.app + (moduleTensor Y L.sheaf (L.pow n).sheaf)) _).mp inferInstance + exact (isIso_comp_right_iff _ _).mp hi + +def powIso (L : LineBundle Y) : ∀ n : ℕ, + (Scheme.Modules.pullback f).obj (L.pow n).sheaf ≅ ((L.pullback f).pow n).sheaf + | 0 => pullbackUnitIso f + | n+1 => @asIso _ _ _ _ (hom f L.sheaf (L.pow n).sheaf) (power_step_isIso f L n) ≪≫ + moduleTensorIso (Iso.refl _) (powIso L n) + +end PiExponentSeshadri.PullbackTensor + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixArithmetic.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixArithmetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..81aa27b105a9572974e8b7c2cb631c850dffe1d8 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixArithmetic.lean @@ -0,0 +1,448 @@ +import OAI.NumberTheory.PiExponent.Approximation.Arithmetic +import OAI.NumberTheory.PiExponent.Approximation.InterpolationMatrix +import OAI.NumberTheory.PiExponent.Approximation.RowTranslation + +namespace OAI + +namespace PiExponent + +open scoped BigOperators + +namespace InterpolationMatrix + +theorem entry_eq_binomial_product {m : ℕ} (r : Fin m → ℂ) + (G : Fin m → Polynomial ℂ) (j s : ℕ) (β : Fin m → ℕ) + (h : ℕ) (α : Fin m → ℕ) : + entry r G j s β h α = + (∏ i, ((α i).choose (β i) : ℂ)) * + (((1 + Polynomial.X) ^ h * ∏ i, + (Polynomial.C ((j : ℂ) * r i) + G i) ^ (α i - β i)).coeff s) := by + classical + have hexp := RowTranslation.shiftCoefficient_eq + (fun i => Polynomial.C ((j : ℂ) * r i) + G i) + (exponentVector β) (exponentVector α) + rw [RowTranslation.shiftCoefficient, RowTranslation.shift_monomial_one] at hexp + simp only [exponentVector_apply] at hexp + have hp : (monomialImage r G j h α).coeff (exponentVector β) = + (1 + Polynomial.X) ^ h * ∏ i, + ((α i).choose (β i) : Polynomial ℂ) * + (Polynomial.C ((j : ℂ) * r i) + G i) ^ (α i - β i) := by + rw [monomialImage, MvPolynomial.coeff_C_mul] + simpa only [add_comm] using congrArg (fun x => (1 + Polynomial.X) ^ h * x) hexp + rw [entry, hp, Finset.prod_mul_distrib] + have hc : (∏ i, ((α i).choose (β i) : Polynomial ℂ)) = + Polynomial.C (∏ i, ((α i).choose (β i) : ℂ)) := by simp + rw [hc] + rw [show (1 + Polynomial.X) ^ h * + (Polynomial.C (∏ i, ((α i).choose (β i) : ℂ)) * + ∏ i, (Polynomial.C ((j : ℂ) * r i) + G i) ^ (α i - β i)) = + Polynomial.C (∏ i, ((α i).choose (β i) : ℂ)) * + ((1 + Polynomial.X) ^ h * + ∏ i, (Polynomial.C ((j : ℂ) * r i) + G i) ^ (α i - β i)) by ring] + rw [Polynomial.coeff_C_mul] + +theorem entry_eq_zero_of_not_le {m : ℕ} (r : Fin m → ℂ) + (G : Fin m → Polynomial ℂ) (j s : ℕ) (β : Fin m → ℕ) + (h : ℕ) (α : Fin m → ℕ) (hβα : ¬ ∀ i, β i ≤ α i) : + entry r G j s β h α = 0 := by + classical + push Not at hβα + obtain ⟨i, hi⟩ := hβα + rw [entry_eq_binomial_product] + have hprod : (∏ k, ((α k).choose (β k) : ℂ)) = 0 := by + apply Finset.prod_eq_zero (Finset.mem_univ i) + simp [Nat.choose_eq_zero_of_lt hi] + rw [hprod, zero_mul] + +theorem scalar_product_mul_coeff {m : ℕ} (q : Fin m → ℂ) + (d : Fin m → ℕ) (P : Polynomial ℂ) (F : Fin m → Polynomial ℂ) (s : ℕ) : + (∏ i, q i ^ d i) * (P * ∏ i, F i ^ d i).coeff s = + (P * ∏ i, (Polynomial.C (q i) * F i) ^ d i).coeff s := by + have he : P * ∏ i, (Polynomial.C (q i) * F i) ^ d i = + Polynomial.C (∏ i, q i ^ d i) * (P * ∏ i, F i ^ d i) := by + simp only [mul_pow, Finset.prod_mul_distrib, ← map_pow, ← map_prod] + ring + rw [he, Polynomial.coeff_C_mul] + +theorem gaussian_center_cast (j : ℕ) (p : ℤ) : + (((⟨0, 2 * (j : ℤ) * p⟩ : GaussianInt) : ℂ)) = + (j : ℂ) * (2 * Complex.I * (p : ℂ)) := by + simp only [GaussianInt.toComplex_def', Int.cast_zero, Int.cast_mul, + Int.cast_ofNat, Int.cast_natCast, zero_add] + ring + +theorem entry_truncatedLog_cleared_gaussian {m : ℕ} + (T q e : Fin m → ℕ) (p : Fin m → ℤ) (hq : ∀ i, q i ≠ 0) + (j s h : ℕ) (β α : Fin m → ℕ) (hα : ∀ i, α i ≤ e i) : + (∏ i, (Nat.lcmUpto (T i) : ℂ) ^ e i) * + (∏ i, (q i : ℂ) ^ α i) / (∏ i, (q i : ℂ) ^ β i) * + entry (fun i => 2 * Complex.I * (p i : ℂ) / (q i : ℂ)) + (fun i => truncatedLog (T i)) j s β h α ∈ GaussianInt.toComplex.range := by + classical + by_cases hβα : ∀ i, β i ≤ α i + swap + · rw [entry_eq_zero_of_not_le _ _ _ _ _ _ _ hβα, mul_zero] + exact GaussianInt.toComplex.range.zero_mem + have hqC : ∀ i, (q i : ℂ) ≠ 0 := by + intro i + exact_mod_cast hq i + have hratio : (∏ i, (q i : ℂ) ^ α i) / (∏ i, (q i : ℂ) ^ β i) = + ∏ i, (q i : ℂ) ^ (α i - β i) := by + rw [← Finset.prod_div_distrib] + apply Finset.prod_congr rfl + intro i hi + simpa only [div_eq_mul_inv] using (pow_sub₀ (q i : ℂ) (hqC i) (hβα i)).symm + let z : Fin m → GaussianInt := fun i => ⟨0, 2 * (j : ℤ) * p i⟩ + have hz (i : Fin m) : Polynomial.C (q i : ℂ) * + (Polynomial.C ((j : ℂ) * (2 * Complex.I * (p i : ℂ) / (q i : ℂ))) + + truncatedLog (T i)) = + Polynomial.C (z i : ℂ) + Polynomial.C (q i : ℂ) * + PowerSeries.trunc (T i) (PowerSeries.log ℂ) := by + rw [mul_add, ← map_mul] + congr 1 + apply congrArg Polynomial.C + rw [show (z i : ℂ) = (j : ℂ) * (2 * Complex.I * (p i : ℂ)) from + gaussian_center_cast j (p i)] + field_simp [hqC i] + have hclear := Arithmetic.shifted_truncation_product_coeff_gaussian Finset.univ + T q e (fun i => α i - β i) z ((1 + Polynomial.X) ^ h) + (fun i hi => (Nat.sub_le (α i) (β i)).trans (hα i)) s + have hP : (((1 + Polynomial.X) ^ h : Polynomial GaussianInt).map GaussianInt.toComplex) = + (1 + Polynomial.X) ^ h := by simp + simp only [hP] at hclear + have hchoose : (∏ i, ((α i).choose (β i) : ℂ)) ∈ GaussianInt.toComplex.range := by + apply GaussianInt.toComplex.range.prod_mem + intro i hi + exact ⟨((α i).choose (β i) : GaussianInt), by simp⟩ + have hscalar := scalar_product_mul_coeff (fun i => (q i : ℂ)) (fun i => α i - β i) + ((1 + Polynomial.X) ^ h) + (fun i => Polynomial.C ((j : ℂ) * (2 * Complex.I * (p i : ℂ) / (q i : ℂ))) + + truncatedLog (T i)) s + simp_rw [hz] at hscalar + rw [mul_div_assoc, hratio, entry_eq_binomial_product] + have he := GaussianInt.toComplex.range.mul_mem hchoose hclear + rw [← hscalar] at he + convert he using 1 + ring + +end InterpolationMatrix + +namespace MatrixArithmetic + +noncomputable def logWeights {m : ℕ} (q : Fin m → ℕ) (i : Fin m) : ℝ := + (⌈Real.log (q i)⌉₊ : ℝ) + +noncomputable def columnScale {m : ℕ} (q : Fin m → ℕ) (a : Fin m → ℕ) : ℝ := + ∏ i, (q i : ℝ) ^ a i + +noncomputable def rowScale {m : ℕ} (q : Fin m → ℕ) (b : Fin m → ℕ) : ℝ := + (columnScale q b)⁻¹ + +noncomputable def denominator {m : ℕ} (q : Fin m → ℕ) (T : Fin m → ℕ) (H : ℝ) : ℝ := + ∏ i, (Nat.lcmUpto (T i) : ℝ) ^ ⌊H / logWeights q i⌋₊ + +noncomputable def rationalCenters {m : ℕ} (p : Fin m → ℤ) (q : Fin m → ℕ) : Fin m → ℂ := + fun i => 2 * Complex.I * (p i : ℂ) / (q i : ℂ) + +noncomputable def truncationOrders {m : ℕ} (q : Fin m → ℕ) (F v0 : ℝ) : Fin m → ℕ := + fun i => ⌈F * logWeights q i / v0⌉₊ + +theorem columnScale_pos {m : ℕ} {q : Fin m → ℕ} (hq : ∀ i, 0 < q i) + (a : Fin m → ℕ) : 0 < columnScale q a := by + exact Finset.prod_pos (fun i _ => pow_pos (by exact_mod_cast hq i) _) + +theorem rowScale_pos {m : ℕ} {q : Fin m → ℕ} (hq : ∀ i, 0 < q i) + (b : Fin m → ℕ) : 0 < rowScale q b := + inv_pos.mpr (columnScale_pos hq b) + +theorem denominator_pos {m : ℕ} (q : Fin m → ℕ) (T : Fin m → ℕ) (H : ℝ) : + 0 < denominator q T H := by + apply Finset.prod_pos + intro i hi + apply pow_pos + exact_mod_cast Nat.pos_of_ne_zero (Nat.lcmUpto_ne_zero (T i)) + +theorem log_columnScale {m : ℕ} {q : Fin m → ℕ} (hq : ∀ i, 0 < q i) + (a : Fin m → ℕ) : + Real.log (columnScale q a) = ∑ i, (a i : ℝ) * Real.log (q i) := by + rw [columnScale, Real.log_prod (by + intro i hi + exact pow_ne_zero _ (by exact_mod_cast (hq i).ne'))] + simp only [Real.log_pow] + +theorem log_rowScale {m : ℕ} {q : Fin m → ℕ} (hq : ∀ i, 0 < q i) + (b : Fin m → ℕ) : + Real.log (rowScale q b) = -(∑ i, (b i : ℝ) * Real.log (q i)) := by + rw [rowScale, Real.log_inv, log_columnScale hq] + +theorem log_denominator_le {m : ℕ} {q : Fin m → ℕ} (F v0 H : ℝ) + (hF : 0 ≤ F) (hv0 : 0 < v0) (hH : 0 < H) + (hw : ∀ i, 0 < logWeights q i) : + Real.log (denominator q (truncationOrders q F v0) H) ≤ + H * (Arithmetic.lcmConstant * F * m / v0 + + Arithmetic.lcmConstant * ∑ i, 1 / logWeights q i) := by + have h := Arithmetic.truncation_denominator_log_le Finset.univ + (logWeights q) F v0 H hF hv0 hH (fun i _ => hw i) + rw [div_le_iff₀ hH] at h + simpa [denominator, truncationOrders, mul_comm H] using h + +noncomputable def rowWeightedSum {m : ℕ} (K : ℕ) (v0 θ : ℝ) + (q : Fin m → ℕ) (H : ℝ) : ℝ := + ∑ ρ : InterpolationMatrix.Row K v0 θ (logWeights q) H, + ∑ i, (ρ.2.1 i.succ : ℝ) * logWeights q i + +noncomputable def meanRowWeight {m : ℕ} (K : ℕ) (v0 θ : ℝ) + (q : Fin m → ℕ) (H : ℝ) : ℝ := + rowWeightedSum K v0 θ q H / + ((Fintype.card (InterpolationMatrix.Row K v0 θ (logWeights q) H) : ℝ) * H) + +noncomputable def rowCost {m : ℕ} (K : ℕ) (v0 θ : ℝ) + (q : Fin m → ℕ) (H : ℝ) : ℝ := + ∑ ρ : InterpolationMatrix.Row K v0 θ (logWeights q) H, + ∑ i, (ρ.2.1 i.succ : ℝ) * Real.log (q i) + +noncomputable def columnCost {m : ℕ} {K : ℕ} {w0 v0 θ : ℝ} + (q : Fin m → ℕ) {H : ℝ} + (selection : InterpolationMatrix.Row K v0 θ (logWeights q) H → + InterpolationMatrix.Column w0 (logWeights q) H) : ℝ := + ∑ ρ : InterpolationMatrix.Row K v0 θ (logWeights q) H, + ∑ i, ((selection ρ).1 i.succ : ℝ) * Real.log (q i) + +noncomputable def selectedMinor {m : ℕ} (K : ℕ) (w0 v0 θ F H : ℝ) + (p : Fin m → ℤ) (q : Fin m → ℕ) + (selection : InterpolationMatrix.Row K v0 θ (logWeights q) H → + InterpolationMatrix.Column w0 (logWeights q) H) : + Matrix (InterpolationMatrix.Row K v0 θ (logWeights q) H) + (InterpolationMatrix.Row K v0 θ (logWeights q) H) ℂ := + (InterpolationMatrix.truncatedLogMatrix K w0 v0 θ (logWeights q) H + (rationalCenters p q) (truncationOrders q F v0)).submatrix id selection + +theorem actual_row_card_pos {m K : ℕ} {v0 θ H : ℝ} {q : Fin m → ℕ} + (hK : 0 < K) (hv0 : 0 < v0) (hθ : 0 < θ) (hH : 0 < H) + (hw : ∀ i, 0 < logWeights q i) : + 0 < Fintype.card (InterpolationMatrix.Row K v0 θ (logWeights q) H) := by + apply Fintype.card_pos_iff.mpr + refine ⟨⟨⟨0, hK⟩, ⟨fun _ => 0, ?_⟩⟩⟩ + apply (InterpolationMatrix.row_mem_iff hv0 hθ hw _).mpr + simpa using hH + +theorem ceil_log_weight_pos {q : ℕ} (hq : 2 ≤ q) : + 0 < (⌈Real.log (q : ℝ)⌉₊ : ℝ) := by + have hqR : (1 : ℝ) < q := by exact_mod_cast (by omega : 1 < q) + exact lt_of_lt_of_le (Real.log_pos hqR) (Nat.le_ceil _) + +theorem column_coordinate_le_floor {m : ℕ} {w0 H : ℝ} {w : Fin m → ℝ} + (hw0 : 0 < w0) (hw : ∀ i, 0 < w i) + (c : PiExponent.InterpolationMatrix.Column w0 w H) (i : Fin m) : + c.1 i.succ ≤ ⌊H / w i⌋₊ := by + apply Nat.le_floor + apply (le_div_iff₀ (hw i)).mpr + have hs : w i * (c.1 i.succ : ℝ) ≤ + ∑ j, w j * (c.1 j.succ : ℝ) := + Finset.single_le_sum (fun j hj => mul_nonneg (hw j).le (Nat.cast_nonneg (c.1 j.succ))) + (Finset.mem_univ i) + have h0 : 0 ≤ w0 * (c.1 0 : ℝ) := mul_nonneg hw0.le (Nat.cast_nonneg _) + have hb := PiExponent.InterpolationMatrix.column_weight_le hw0 hw c + nlinarith only [hs, h0, hb] + +theorem column_log_cost_le_H {m : ℕ} {w0 H : ℝ} (q : Fin m → ℕ) + (hq : ∀ i, 2 ≤ q i) (hw0 : 0 < w0) + (c : PiExponent.InterpolationMatrix.Column w0 + (fun i => (⌈Real.log (q i : ℝ)⌉₊ : ℝ)) H) : + (∑ i, (c.1 i.succ : ℝ) * Real.log (q i : ℝ)) ≤ H := by + have hb := PiExponent.InterpolationMatrix.column_weight_le hw0 + (fun i => ceil_log_weight_pos (hq i)) c + have hc := PiExponent.Arithmetic.column_log_cost_le Finset.univ + (fun i => c.1 i.succ) q + have h0 : 0 ≤ w0 * (c.1 0 : ℝ) := mul_nonneg hw0.le (Nat.cast_nonneg _) + calc + _ ≤ ∑ i, (c.1 i.succ : ℝ) * (⌈Real.log (q i : ℝ)⌉₊ : ℝ) := hc + _ = ∑ i, (⌈Real.log (q i : ℝ)⌉₊ : ℝ) * (c.1 i.succ : ℝ) := by + apply Finset.sum_congr rfl + intro i hi + exact mul_comm _ _ + _ ≤ H := by linarith + +theorem selected_column_log_cost_le {m K : ℕ} {w0 v0 θ H : ℝ} + (q : Fin m → ℕ) (hq : ∀ i, 2 ≤ q i) (hw0 : 0 < w0) + (selection : PiExponent.InterpolationMatrix.Row K v0 θ + (fun i => (⌈Real.log (q i : ℝ)⌉₊ : ℝ)) H → + PiExponent.InterpolationMatrix.Column w0 + (fun i => (⌈Real.log (q i : ℝ)⌉₊ : ℝ)) H) : + (∑ ρ, ∑ i, ((selection ρ).1 i.succ : ℝ) * Real.log (q i : ℝ)) ≤ + (Fintype.card (PiExponent.InterpolationMatrix.Row K v0 θ + (fun i => (⌈Real.log (q i : ℝ)⌉₊ : ℝ)) H) : ℝ) * H := by + calc + _ ≤ ∑ ρ, H := Finset.sum_le_sum (fun ρ hρ => column_log_cost_le_H q hq hw0 (selection ρ)) + _ = _ := by simp + +theorem row_weighted_cost_le {m K : ℕ} {v0 θ H : ℝ} {w : Fin m → ℝ} + (hv0 : 0 < v0) (hθ : 0 < θ) (hw : ∀ i, 0 < w i) + (ρ : PiExponent.InterpolationMatrix.Row K v0 θ w H) : + (∑ i, (ρ.2.1 i.succ : ℝ) * w i) ≤ H * θ := by + have hb := PiExponent.InterpolationMatrix.row_weight_lt hv0 hθ hw ρ + have h0 : 0 ≤ v0 * (ρ.2.1 0 : ℝ) := mul_nonneg hv0.le (Nat.cast_nonneg _) + have hh : (∑ i, w i * (ρ.2.1 i.succ : ℝ)) / θ ≤ H := by linarith + have hm := (div_le_iff₀ hθ).mp hh + simpa only [mul_comm] using hm + +theorem all_row_log_cost_lower {m K : ℕ} {v0 θ H wmin : ℝ} + (q : Fin m → ℕ) (hq : ∀ i, 2 ≤ q i) + (hv0 : 0 < v0) (hθ : 0 < θ) (hmin : 0 < wmin) + (hwmin : ∀ i, wmin ≤ (⌈Real.log (q i : ℝ)⌉₊ : ℝ)) : + (∑ ρ : PiExponent.InterpolationMatrix.Row K v0 θ + (fun i => (⌈Real.log (q i : ℝ)⌉₊ : ℝ)) H, + ∑ i, (ρ.2.1 i.succ : ℝ) * (⌈Real.log (q i : ℝ)⌉₊ : ℝ)) - + (Fintype.card (PiExponent.InterpolationMatrix.Row K v0 θ + (fun i => (⌈Real.log (q i : ℝ)⌉₊ : ℝ)) H) : ℝ) * H * θ / wmin ≤ + ∑ ρ : PiExponent.InterpolationMatrix.Row K v0 θ + (fun i => (⌈Real.log (q i : ℝ)⌉₊ : ℝ)) H, + ∑ i, (ρ.2.1 i.succ : ℝ) * Real.log (q i : ℝ) := by + have hrow (ρ : PiExponent.InterpolationMatrix.Row K v0 θ + (fun i => (⌈Real.log (q i : ℝ)⌉₊ : ℝ)) H) := + PiExponent.Arithmetic.row_log_cost_lower Finset.univ (fun i => ρ.2.1 i.succ) + q wmin (H * θ) hmin (fun i hi => hwmin i) + (row_weighted_cost_le hv0 hθ (fun i => ceil_log_weight_pos (hq i)) ρ) + have hs := Finset.sum_le_sum (s := Finset.univ) (fun ρ hρ => hrow ρ) + simpa only [Finset.sum_sub_distrib, Finset.sum_const, Finset.card_univ, + nsmul_eq_mul, mul_div_assoc, mul_assoc] using hs + +theorem selectedMinor_entries_gaussian {m K : ℕ} {w0 v0 θ F H : ℝ} + (p : Fin m → ℤ) (q : Fin m → ℕ) (hq : ∀ i, 2 ≤ q i) (hw0 : 0 < w0) + (selection : InterpolationMatrix.Row K v0 θ (logWeights q) H → + InterpolationMatrix.Column w0 (logWeights q) H) + (ρ σ : InterpolationMatrix.Row K v0 θ (logWeights q) H) : + (denominator q (truncationOrders q F v0) H : ℂ) * + (rowScale q (fun i => ρ.2.1 i.succ) : ℂ) * + ((columnScale q (fun i => (selection σ).1 i.succ) : ℂ) * + selectedMinor K w0 v0 θ F H p q selection ρ σ) ∈ + GaussianInt.toComplex.range := by + have hw : ∀ i, 0 < logWeights q i := fun i => ceil_log_weight_pos (hq i) + have he := InterpolationMatrix.entry_truncatedLog_cleared_gaussian + (truncationOrders q F v0) q (fun i => ⌊H / logWeights q i⌋₊) p + (fun i => by have := hq i; omega) ρ.1.val (ρ.2.1 0) ((selection σ).1 0) + (fun i => ρ.2.1 i.succ) (fun i => (selection σ).1 i.succ) + (column_coordinate_le_floor hw0 hw (selection σ)) + simp only [denominator, rowScale, columnScale, selectedMinor, + InterpolationMatrix.truncatedLogMatrix, InterpolationMatrix.matrix, + Matrix.submatrix_apply, id_eq, + Complex.ofReal_prod, Complex.ofReal_pow, Complex.ofReal_natCast, + Complex.ofReal_inv] + have hcenters : rationalCenters p q = + (fun i => 2 * Complex.I * (p i : ℂ) / (q i : ℂ)) := rfl + rw [← hcenters] at he + convert he using 1 + ring + +theorem selectedMinor_clearing_bound {m K : ℕ} {w0 v0 θ F H : ℝ} + (p : Fin m → ℤ) (q : Fin m → ℕ) (hq : ∀ i, 2 ≤ q i) (hw0 : 0 < w0) + (selection : InterpolationMatrix.Row K v0 θ (logWeights q) H → + InterpolationMatrix.Column w0 (logWeights q) H) + (hdet : (selectedMinor K w0 v0 θ F H p q selection).det ≠ 0) : + -(Fintype.card (InterpolationMatrix.Row K v0 θ (logWeights q) H) : ℝ) * + Real.log (denominator q (truncationOrders q F v0) H) - + columnCost q selection + rowCost K v0 θ q H ≤ + Real.log ‖(selectedMinor K w0 v0 θ F H p q selection).det‖ := by + have hqpos : ∀ i, 0 < q i := fun i => lt_of_lt_of_le (by decide) (hq i) + have hc := Arithmetic.cleared_det_log_bound_with_denominator + (selectedMinor K w0 v0 θ F H p q selection) + (fun ρ => rowScale q (fun i => ρ.2.1 i.succ)) + (fun σ => columnScale q (fun i => (selection σ).1 i.succ)) + (denominator q (truncationOrders q F v0) H) + (denominator_pos _ _ _) (fun ρ => rowScale_pos hqpos _) + (fun σ => columnScale_pos hqpos _) hdet + (selectedMinor_entries_gaussian p q hq hw0 selection) + simp only [log_rowScale hqpos, log_columnScale hqpos, + Finset.sum_neg_distrib, sub_neg_eq_add] at hc + dsimp [columnCost, rowCost] + linarith + +theorem selectedMinor_arithmetic_lower_bound {m K : ℕ} {w0 v0 θ F H wmin : ℝ} + (p : Fin m → ℤ) (q : Fin m → ℕ) (hq : ∀ i, 2 ≤ q i) + (hK : 0 < K) (hw0 : 0 < w0) (hv0 : 0 < v0) (hθ : 0 < θ) + (hF : 0 ≤ F) (hH : 0 < H) (hmin : 0 < wmin) + (hwmin : ∀ i, wmin ≤ logWeights q i) + (selection : InterpolationMatrix.Row K v0 θ (logWeights q) H → + InterpolationMatrix.Column w0 (logWeights q) H) + (hdet : (selectedMinor K w0 v0 θ F H p q selection).det ≠ 0) : + -(1 - meanRowWeight K v0 θ q H) - + (Arithmetic.lcmConstant * F * m / v0 + + Arithmetic.lcmConstant * ∑ i, 1 / logWeights q i + θ / wmin) ≤ + Real.log ‖(selectedMinor K w0 v0 θ F H p q selection).det‖ / + ((Fintype.card (InterpolationMatrix.Row K v0 θ (logWeights q) H) : ℝ) * H) := by + have hw : ∀ i, 0 < logWeights q i := fun i => ceil_log_weight_pos (hq i) + have hM : 0 < (Fintype.card (InterpolationMatrix.Row K v0 θ (logWeights q) H) : ℝ) := by + exact_mod_cast actual_row_card_pos hK hv0 hθ hH hw + apply Arithmetic.normalized_arithmetic_bound _ _ _ _ _ _ _ _ _ hM hH + · exact selectedMinor_clearing_bound p q hq hw0 selection hdet + · exact log_denominator_le F v0 H hF hv0 hH hw + · exact selected_column_log_cost_le q hq hw0 selection + · have hrow (ρ : InterpolationMatrix.Row K v0 θ (logWeights q) H) := + Arithmetic.row_log_cost_lower Finset.univ (fun i => ρ.2.1 i.succ) q + wmin (H * θ) hmin (fun i _ => hwmin i) + (row_weighted_cost_le hv0 hθ hw ρ) + have hr := Finset.sum_le_sum (s := Finset.univ) (fun ρ _ => hrow ρ) + simp only [Finset.sum_sub_distrib, Finset.sum_const, Finset.card_univ, + nsmul_eq_mul] at hr + have hb : + (Fintype.card (InterpolationMatrix.Row K v0 θ (logWeights q) H) : ℝ) * H * + meanRowWeight K v0 θ q H = rowWeightedSum K v0 θ q H := by + unfold meanRowWeight + field_simp [(mul_pos hM hH).ne'] + rw [hb] + simpa only [rowWeightedSum, rowCost, logWeights, mul_div_assoc, mul_assoc] using hr + +theorem meanRowWeight_nonneg {m : ℕ} (K : ℕ) (v0 θ : ℝ) (q : Fin m → ℕ) + {H : ℝ} (hH : 0 ≤ H) : 0 ≤ meanRowWeight K v0 θ q H := by + apply div_nonneg + · apply Finset.sum_nonneg + intro ρ hρ + exact Finset.sum_nonneg (fun i hi => mul_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _)) + · exact mul_nonneg (Nat.cast_nonneg _) hH + +theorem meanRowWeight_le_theta {m K : ℕ} {v0 θ H : ℝ} (q : Fin m → ℕ) + (hq : ∀ i, 2 ≤ q i) (hK : 0 < K) (hv0 : 0 < v0) (hθ : 0 < θ) + (hH : 0 < H) : meanRowWeight K v0 θ q H ≤ θ := by + have hw : ∀ i, 0 < logWeights q i := fun i => ceil_log_weight_pos (hq i) + have hM : 0 < (Fintype.card (InterpolationMatrix.Row K v0 θ (logWeights q) H) : ℝ) := by + exact_mod_cast actual_row_card_pos hK hv0 hθ hH hw + apply (div_le_iff₀ (mul_pos hM hH)).mpr + calc + rowWeightedSum K v0 θ q H ≤ + ∑ _ρ : InterpolationMatrix.Row K v0 θ (logWeights q) H, H * θ := + Finset.sum_le_sum (fun ρ hρ => row_weighted_cost_le hv0 hθ hw ρ) + _ = θ * ((Fintype.card (InterpolationMatrix.Row K v0 θ (logWeights q) H) : ℝ) * H) := by + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + ring + +noncomputable def minimumLogWeight {m : ℕ} [NeZero m] (q : Fin m → ℕ) : ℝ := + Finset.univ.inf' Finset.univ_nonempty (logWeights q) + +theorem minimumLogWeight_pos {m : ℕ} [NeZero m] (q : Fin m → ℕ) + (hq : ∀ i, 2 ≤ q i) : 0 < minimumLogWeight q := by + exact (Finset.lt_inf'_iff _).mpr (fun i hi => ceil_log_weight_pos (hq i)) + +theorem minimumLogWeight_le {m : ℕ} [NeZero m] (q : Fin m → ℕ) (i : Fin m) : + minimumLogWeight q ≤ logWeights q i := + Finset.inf'_le _ (Finset.mem_univ i) + +theorem selectedMinor_arithmetic_lower_bound_minimum {m K : ℕ} [NeZero m] + {w0 v0 θ F H : ℝ} (p : Fin m → ℤ) (q : Fin m → ℕ) (hq : ∀ i, 2 ≤ q i) + (hK : 0 < K) (hw0 : 0 < w0) (hv0 : 0 < v0) (hθ : 0 < θ) + (hF : 0 ≤ F) (hH : 0 < H) + (selection : InterpolationMatrix.Row K v0 θ (logWeights q) H → + InterpolationMatrix.Column w0 (logWeights q) H) + (hdet : (selectedMinor K w0 v0 θ F H p q selection).det ≠ 0) : + -(1 - meanRowWeight K v0 θ q H) - + (Arithmetic.lcmConstant * F * m / v0 + + Arithmetic.lcmConstant * ∑ i, 1 / logWeights q i + θ / minimumLogWeight q) ≤ + Real.log ‖(selectedMinor K w0 v0 θ F H p q selection).det‖ / + ((Fintype.card (InterpolationMatrix.Row K v0 θ (logWeights q) H) : ℝ) * H) := + selectedMinor_arithmetic_lower_bound p q hq hK hw0 hv0 hθ hF hH + (minimumLogWeight_pos q hq) (minimumLogWeight_le q) selection hdet + +end MatrixArithmetic + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixCounting.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixCounting.lean new file mode 100644 index 0000000000000000000000000000000000000000..5af3b4f515bd0fd6a5487bd56ae009ab9ab3562a --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixCounting.lean @@ -0,0 +1,137 @@ +import OAI.NumberTheory.PiExponent.Approximation.MatrixArithmetic +import OAI.NumberTheory.PiExponent.Polynomials.SimplexRational + +namespace OAI + +open scoped BigOperators +open Filter Topology + +namespace PiExponent.MatrixCounting + +noncomputable def rowCount {m : ℕ} (K : ℕ) (v0 θ : ℚ) + (q : Fin m → ℕ) (H : ℝ) : ℝ := + Fintype.card (InterpolationMatrix.Row K (v0 : ℝ) (θ : ℝ) (MatrixArithmetic.logWeights q) H) + +noncomputable def lowIndexCount {m : ℕ} (A : ℚ) (q : Fin m → ℕ) (H : ℝ) : ℝ := + (realWeightedSimplex (MatrixArithmetic.logWeights q) ((A : ℝ) * H)).card + +noncomputable def rationalLogWeights {m : ℕ} (q : Fin m → ℕ) (i : Fin m) : ℚ := + (⌈Real.log (q i)⌉₊ : ℚ) + +@[simp] theorem rationalLogWeights_cast {m : ℕ} (q : Fin m → ℕ) (i : Fin m) : + (rationalLogWeights q i : ℝ) = MatrixArithmetic.logWeights q i := by + simp [rationalLogWeights, MatrixArithmetic.logWeights] + +theorem rationalLogWeights_pos {m : ℕ} (q : Fin m → ℕ) (hq : ∀ i, 2 ≤ q i) + (i : Fin m) : 0 < rationalLogWeights q i := by + have h := MatrixArithmetic.ceil_log_weight_pos (hq i) + unfold rationalLogWeights + exact_mod_cast h + +theorem tendsto_rowCount_normalized {m : ℕ} (K : ℕ) (v0 θ : ℚ) + (q : Fin m → ℕ) (hv0 : 0 < v0) (hθ : 0 < θ) (hq : ∀ i, 2 ≤ q i) : + Tendsto (fun H : ℝ => rowCount K v0 θ q H / H ^ (m + 1)) atTop + (𝓝 ((K : ℝ) * (θ : ℝ) ^ m / + (((m + 1).factorial : ℝ) * (v0 : ℝ) * ∏ i, MatrixArithmetic.logWeights q i))) := by + let V : Fin (m + 1) → ℚ := Fin.cases v0 (fun i => rationalLogWeights q i / θ) + have hV : ∀ i, 0 < V i := by + intro i + exact Fin.cases hv0 (fun j => div_pos (rationalLogWeights_pos q hq j) hθ) i + have hcast : (fun i => (V i : ℝ)) = + InterpolationMatrix.rowWeights (v0 : ℝ) (θ : ℝ) (MatrixArithmetic.logWeights q) := by + funext i + refine Fin.cases ?_ (fun j => ?_) i + · simp [V, InterpolationMatrix.rowWeights] + · simp [V, InterpolationMatrix.rowWeights] + have hp : ∏ i, (V i : ℝ) = + (v0 : ℝ) * (∏ i, MatrixArithmetic.logWeights q i) / (θ : ℝ) ^ m := by + rw [Fin.prod_univ_succ] + simp [V, Finset.prod_div_distrib, mul_div_assoc] + have ht := (tendsto_card_strictWeightedSimplex_rational V hV).const_mul (K : ℝ) + have hθ0 : (θ : ℝ) ≠ 0 := by exact_mod_cast hθ.ne' + have he : (K : ℝ) * (1 / (((m + 1).factorial : ℝ) * ∏ i, (V i : ℝ))) = + (K : ℝ) * (θ : ℝ) ^ m / + (((m + 1).factorial : ℝ) * (v0 : ℝ) * ∏ i, MatrixArithmetic.logWeights q i) := by + rw [hp] + field_simp + rw [he] at ht + apply ht.congr' + exact Eventually.of_forall (fun H => by + simp only [rowCount, InterpolationMatrix.row_card, Nat.cast_mul] + rw [← hcast] + ring) + +theorem tendsto_lowIndexCount_normalized {m : ℕ} (A : ℚ) + (q : Fin m → ℕ) (hA : 0 < A) (hq : ∀ i, 2 ≤ q i) : + Tendsto (fun H : ℝ => lowIndexCount A q H / H ^ m) atTop + (𝓝 ((A : ℝ) ^ m / ((m.factorial : ℝ) * ∏ i, MatrixArithmetic.logWeights q i))) := by + have hAR : (0 : ℝ) < A := by exact_mod_cast hA + have ht : Tendsto (fun H : ℝ => (A : ℝ) * H) atTop atTop := + Tendsto.const_mul_atTop hAR tendsto_id + have h := ((tendsto_card_realWeightedSimplex_rational (rationalLogWeights q) + (rationalLogWeights_pos q hq)).comp ht).mul_const ((A : ℝ) ^ m) + simp only [rationalLogWeights_cast] at h + have he : 1 / ((m.factorial : ℝ) * ∏ i, MatrixArithmetic.logWeights q i) * (A : ℝ) ^ m = + (A : ℝ) ^ m / ((m.factorial : ℝ) * ∏ i, MatrixArithmetic.logWeights q i) := by ring + rw [he] at h + have hweights : (fun i => (rationalLogWeights q i : ℝ)) = MatrixArithmetic.logWeights q := by + funext i + exact rationalLogWeights_cast q i + apply h.congr' + exact Eventually.of_forall (fun H => by + simp only [Function.comp_apply, lowIndexCount, mul_pow] + field_simp) + +theorem tendsto_row_lowIndex_ratio {m : ℕ} (K : ℕ) (v0 θ A : ℚ) + (q : Fin m → ℕ) (hv0 : 0 < v0) (hθ : 0 < θ) (hA : 0 < A) + (hq : ∀ i, 2 ≤ q i) : + Tendsto (fun H : ℝ => rowCount K v0 θ q H / (H * lowIndexCount A q H)) atTop + (𝓝 ((K : ℝ) * (θ : ℝ) ^ m / (((m : ℝ) + 1) * (v0 : ℝ) * (A : ℝ) ^ m))) := by + have hAR : (0 : ℝ) < A := by exact_mod_cast hA + have hvR : (0 : ℝ) < v0 := by exact_mod_cast hv0 + have hθR : (0 : ℝ) < θ := by exact_mod_cast hθ + have hP : 0 < ∏ i, MatrixArithmetic.logWeights q i := + Finset.prod_pos (fun i _ => MatrixArithmetic.ceil_log_weight_pos (hq i)) + have hfac : (0 : ℝ) < m.factorial := by exact_mod_cast Nat.factorial_pos m + have hd : (A : ℝ) ^ m / ((m.factorial : ℝ) * ∏ i, MatrixArithmetic.logWeights q i) ≠ 0 := + (div_pos (pow_pos hAR m) (mul_pos hfac hP)).ne' + have h := (tendsto_rowCount_normalized K v0 θ q hv0 hθ hq).div + (tendsto_lowIndexCount_normalized A q hA hq) hd + have he : + ((K : ℝ) * (θ : ℝ) ^ m / + (((m + 1).factorial : ℝ) * (v0 : ℝ) * ∏ i, MatrixArithmetic.logWeights q i)) / + ((A : ℝ) ^ m / ((m.factorial : ℝ) * ∏ i, MatrixArithmetic.logWeights q i)) = + (K : ℝ) * (θ : ℝ) ^ m / (((m : ℝ) + 1) * (v0 : ℝ) * (A : ℝ) ^ m) := by + simp only [Nat.factorial_succ, Nat.cast_mul, Nat.cast_add, Nat.cast_one] + field_simp + rw [he] at h + apply h.congr' + filter_upwards [eventually_gt_atTop (0 : ℝ)] with H hH + change (rowCount K v0 θ q H / H ^ (m + 1)) / (lowIndexCount A q H / H ^ m) = + rowCount K v0 θ q H / (H * lowIndexCount A q H) + by_cases hn : lowIndexCount A q H = 0 + · simp [hn] + · simp only [pow_succ] + field_simp [hH.ne', hn] + +theorem tendsto_collisionRatio {m : ℕ} (K : ℕ) (v0 θ A : ℚ) + (q : Fin m → ℕ) (hv0 : 0 < v0) (hθ : 0 < θ) (hA : 0 < A) + (hq : ∀ i, 2 ≤ q i) (c η : ℝ) : + Tendsto (fun H : ℝ => c * η ^ 2 * rowCount K v0 θ q H / + (H * lowIndexCount A q H)) atTop + (𝓝 (c * η ^ 2 * (K : ℝ) * (θ : ℝ) ^ m / + (((m : ℝ) + 1) * (v0 : ℝ) * (A : ℝ) ^ m))) := by + have ht := (tendsto_row_lowIndex_ratio K v0 θ A q hv0 hθ hA hq).const_mul (c * η ^ 2) + have he : (c * η ^ 2) * + ((K : ℝ) * (θ : ℝ) ^ m / (((m : ℝ) + 1) * (v0 : ℝ) * (A : ℝ) ^ m)) = + c * η ^ 2 * (K : ℝ) * (θ : ℝ) ^ m / + (((m : ℝ) + 1) * (v0 : ℝ) * (A : ℝ) ^ m) := by ring + rw [he] at ht + apply ht.congr' + exact Eventually.of_forall (fun H => by + change (c * η ^ 2) * (rowCount K v0 θ q H / (H * lowIndexCount A q H)) = _ + ring) + +end PiExponent.MatrixCounting + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixTranslation.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixTranslation.lean new file mode 100644 index 0000000000000000000000000000000000000000..4884bb898cd1ced9ff362143cf2a6b56e510e631 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixTranslation.lean @@ -0,0 +1,241 @@ +import OAI.NumberTheory.PiExponent.Approximation.InterpolationMatrix +import OAI.NumberTheory.PiExponent.Approximation.RowTranslation + +namespace OAI + +namespace PiExponent.MatrixTranslation + +open scoped BigOperators +open MvPolynomial +open RowTranslation + +noncomputable def periodCoordinate (j : ℕ) (ω : ℂ) : PowerSeries ℂ := + PowerSeries.C ((j : ℂ) * ω) + PowerSeries.log ℂ + +noncomputable def periodMonomial {m : ℕ} (j : ℕ) (ω : ℂ) (h : ℕ) + (a : Fin m → ℕ) : MvPolynomial (Fin m) (PowerSeries ℂ) := + C ((1 + PowerSeries.X) ^ h) * + ∏ i, (C (periodCoordinate j ω) + X i) ^ a i + +theorem periodMonomial_as_shift {m : ℕ} (j : ℕ) (ω : ℂ) (h : ℕ) + (a : Fin m → ℕ) : + periodMonomial j ω h a = C ((1 + PowerSeries.X) ^ h) * + shift (fun _ => periodCoordinate j ω) (monomial (InterpolationMatrix.exponentVector a) 1) := by + rw [periodMonomial, shift_monomial_one] + simp [add_comm] + +theorem periodMonomial_coeff {m : ℕ} (j : ℕ) (ω : ℂ) (h : ℕ) + (a : Fin m → ℕ) (A : Fin m →₀ ℕ) : + (periodMonomial j ω h a).coeff A = + ((∏ i, (a i).choose (A i) : ℕ) : PowerSeries ℂ) * + (1 + PowerSeries.X) ^ h * periodCoordinate j ω ^ (∑ i : Fin m, (a i - A i)) := by + rw [periodMonomial_as_shift, coeff_C_mul] + change _ * shiftCoefficient _ _ _ = _ + rw [shiftCoefficient_eq, Finset.prod_mul_distrib, Finset.prod_pow_eq_pow_sum] + simp only [InterpolationMatrix.exponentVector_apply, Nat.cast_prod] + ring + +theorem periodMonomial_support_le {m : ℕ} (j : ℕ) (ω : ℂ) (h : ℕ) + (a : Fin m → ℕ) {A : Fin m →₀ ℕ} + (hA : A ∈ (periodMonomial j ω h a).support) : ∀ i, A i ≤ a i := by + intro i + by_contra hn + have hi : a i < A i := by omega + have hzero : (∏ k, (a k).choose (A k) : ℕ) = 0 := by + apply Finset.prod_eq_zero (Finset.mem_univ i) + exact Nat.choose_eq_zero_of_lt hi + have hz : (periodMonomial j ω h a).coeff A = 0 := by + rw [periodMonomial_coeff, hzero] + simp + exact (MvPolynomial.mem_support_iff.mp hA) hz + +theorem periodMonomial_support_weight {m : ℕ} (j : ℕ) (ω : ℂ) (h : ℕ) + (a : Fin m → ℕ) (w : Fin m → ℝ) (H : ℝ) (hw : ∀ i, 0 ≤ w i) + (ha : ∑ i, w i * a i ≤ H) {A : Fin m →₀ ℕ} + (hA : A ∈ (periodMonomial j ω h a).support) : + ∑ i, w i * A i ≤ H := by + apply le_trans _ ha + apply Finset.sum_le_sum + intro i hi + apply mul_le_mul_of_nonneg_left _ (hw i) + exact_mod_cast periodMonomial_support_le j ω h a hA i + +noncomputable def transverseIndices {m : ℕ} (w : Fin m → ℝ) (H : ℝ) : + Finset (Fin m →₀ ℕ) := + (PiExponent.realWeightedSimplex w H).map Finsupp.equivFunOnFinite.symm.toEmbedding + +@[simp] theorem mem_transverseIndices {m : ℕ} (w : Fin m → ℝ) (H : ℝ) + (hw : ∀ i, 0 < w i) (A : Fin m →₀ ℕ) : + A ∈ transverseIndices w H ↔ ∑ i, w i * A i ≤ H := by + classical + simp only [transverseIndices, Finset.mem_map_equiv, PiExponent.mem_realWeightedSimplex hw] + rfl + +@[simp] theorem card_transverseIndices {m : ℕ} (w : Fin m → ℝ) (H : ℝ) : + (transverseIndices w H).card = (PiExponent.realWeightedSimplex w H).card := by + simp [transverseIndices] + +theorem periodMonomial_support_subset {m : ℕ} (j : ℕ) (ω : ℂ) (h : ℕ) + (a : Fin m → ℕ) (w : Fin m → ℝ) (H : ℝ) (hw : ∀ i, 0 < w i) + (ha : ∑ i, w i * a i ≤ H) : + (periodMonomial j ω h a).support ⊆ transverseIndices w H := by + intro A hA + apply (mem_transverseIndices w H hw A).2 + exact periodMonomial_support_weight j ω h a w H (fun i => (hw i).le) ha hA + +theorem transverseIndices_coordinate_le {m : ℕ} (w : Fin m → ℝ) (H : ℝ) + (hw : ∀ i, 1 ≤ w i) {A : Fin m →₀ ℕ} (hA : A ∈ transverseIndices w H) (i : Fin m) : + A i ≤ ⌊H⌋₊ := by + have hwpos : ∀ i, 0 < w i := fun i => lt_of_lt_of_le zero_lt_one (hw i) + have ha := (mem_transverseIndices w H hwpos A).mp hA + apply Nat.le_floor + calc + (A i : ℝ) ≤ w i * A i := by nlinarith [show (0 : ℝ) ≤ (A i : ℝ) by positivity, hw i] + _ ≤ ∑ k, w k * A k := Finset.single_le_sum + (fun k hk => mul_nonneg (hwpos k).le (Nat.cast_nonneg _)) (Finset.mem_univ i) + _ ≤ H := ha + +theorem transverseIndices_card_le {m : ℕ} (w : Fin m → ℝ) (H : ℝ) + (hw : ∀ i, 1 ≤ w i) : + (transverseIndices w H).card ≤ (⌊H⌋₊ + 1) ^ m := by + classical + let box : Finset (Fin m → ℕ) := Fintype.piFinset (fun _ => Finset.range (⌊H⌋₊ + 1)) + have hcard : (transverseIndices w H).card ≤ box.card := by + apply Finset.card_le_card_of_injOn (fun A : Fin m →₀ ℕ => fun i => A i) + · intro A hA + apply Fintype.mem_piFinset.mpr + intro i + exact Finset.mem_range.mpr (Nat.lt_succ_of_le (transverseIndices_coordinate_le w H hw hA i)) + · intro A hA B hB he + exact Finsupp.ext (fun i => congrFun he i) + simpa [box, Fintype.card_piFinset] using hcard + +theorem row_term_count {m : ℕ} (w : Fin m → ℝ) (H v : ℝ) + (hw : ∀ i, 1 ≤ w i) (β : Fin m →₀ ℕ) (s : ℕ) (hs : (s : ℝ) ≤ H / v) : + Fintype.card (RowChoices (transverseIndices w H) β s) ≤ + (⌊H⌋₊ + 1) ^ (2 * m) * (⌊H / v⌋₊ + 1) := by + have h := card_rowChoices_box_le (transverseIndices w H) β s ⌊H⌋₊ + (fun A hA i => transverseIndices_coordinate_le w H hw hA i) + (by simpa using transverseIndices_card_le w H hw) + simp only [Fintype.card_fin] at h + exact h.trans (Nat.mul_le_mul_left _ (Nat.add_le_add_right (Nat.le_floor hs) 1)) + +noncomputable def formalMonomialImage {m : ℕ} (r : Fin m → ℂ) + (T : Fin m → ℕ) (j h : ℕ) (a : Fin m → ℕ) : + MvPolynomial (Fin m) (PowerSeries ℂ) := + MvPolynomial.map Polynomial.coeToPowerSeries.ringHom + (InterpolationMatrix.monomialImage r (fun i => InterpolationMatrix.truncatedLog (T i)) j h a) + +theorem coordinate_translation (j : ℕ) (ω r : ℂ) (T : ℕ) : + periodCoordinate j ω + (PowerSeries.C ((j : ℂ) * (r - ω)) + + tail T (PowerSeries.log ℂ)) = + PowerSeries.C ((j : ℂ) * r) + (InterpolationMatrix.truncatedLog T : PowerSeries ℂ) := by + unfold periodCoordinate tail InterpolationMatrix.truncatedLog + calc + _ = PowerSeries.C ((j : ℂ) * ω) + PowerSeries.C ((j : ℂ) * (r - ω)) + + (PowerSeries.trunc T (PowerSeries.log ℂ) : PowerSeries ℂ) := by ring + _ = _ := by rw [← map_add]; congr 1; congr 1; ring + +theorem periodMonomial_shift {m : ℕ} (r : Fin m → ℂ) (T : Fin m → ℕ) + (j : ℕ) (ω : ℂ) (h : ℕ) (a : Fin m → ℕ) : + shift (fun i => PowerSeries.C ((j : ℂ) * (r i - ω)) + tail (T i) (PowerSeries.log ℂ)) + (periodMonomial j ω h a) = formalMonomialImage r T j h a := by + simp only [periodMonomial, formalMonomialImage, InterpolationMatrix.monomialImage, + map_mul, map_prod, map_pow, map_add, shift_C, shift_X, MvPolynomial.map_C, + MvPolynomial.map_X, Polynomial.coeToPowerSeries.ringHom_apply, + Polynomial.coe_C, Polynomial.coe_one, Polynomial.coe_X] + congr 1 + apply Finset.prod_congr rfl + intro i hi + congr 1 + calc + _ = C (periodCoordinate j ω + (PowerSeries.C ((j : ℂ) * (r i - ω)) + + tail (T i) (PowerSeries.log ℂ))) + X i := by simp only [map_add, map_mul]; ring + _ = _ := by rw [coordinate_translation]; simp [map_add] + +theorem formalMonomialImage_coeff {m : ℕ} (r : Fin m → ℂ) (T : Fin m → ℕ) + (j s : ℕ) (b : Fin m → ℕ) (h : ℕ) (a : Fin m → ℕ) : + PowerSeries.coeff s ((formalMonomialImage r T j h a).coeff + (InterpolationMatrix.exponentVector b)) = + InterpolationMatrix.entry r (fun i => InterpolationMatrix.truncatedLog (T i)) j s b h a := by + simp [formalMonomialImage, MvPolynomial.coeff_map, InterpolationMatrix.entry] + +theorem matrix_entry_translation {m : ℕ} (r : Fin m → ℂ) (T : Fin m → ℕ) + (j s : ℕ) (ω : ℂ) (b : Fin m → ℕ) (h : ℕ) (a : Fin m → ℕ) + (S : Finset (Fin m →₀ ℕ)) (hp : (periodMonomial j ω h a).support ⊆ S) : + InterpolationMatrix.entry r (fun i => InterpolationMatrix.truncatedLog (T i)) j s b h a = + ∑ A ∈ S, ∑ d : (∀ i, Fin (A i - (InterpolationMatrix.exponentVector b) i + 1)), + ∑ kl ∈ Finset.HasAntidiagonal.antidiagonal s, + rowScalar (fun i => (j : ℂ) * (r i - ω)) + (fun i => tail (T i) (PowerSeries.log ℂ)) + (InterpolationMatrix.exponentVector b) A d kl.1 * + PowerSeries.coeff kl.2 ((periodMonomial j ω h a).coeff A) := by + rw [← formalMonomialImage_coeff r T j s b h a, ← periodMonomial_shift r T j ω h a] + exact exact_row_identity _ _ _ _ S hp s + +theorem matrix_entry_translation_choices {m : ℕ} (r : Fin m → ℂ) (T : Fin m → ℕ) + (j s : ℕ) (ω : ℂ) (b : Fin m → ℕ) (h : ℕ) (a : Fin m → ℕ) + (S : Finset (Fin m →₀ ℕ)) (hp : (periodMonomial j ω h a).support ⊆ S) : + InterpolationMatrix.entry r (fun i => InterpolationMatrix.truncatedLog (T i)) j s b h a = + ∑ t : RowChoices S (InterpolationMatrix.exponentVector b) s, + rowScalar (fun i => (j : ℂ) * (r i - ω)) + (fun i => tail (T i) (PowerSeries.log ℂ)) + (InterpolationMatrix.exponentVector b) t.1.1 t.2.1 t.2.2 * + PowerSeries.coeff (s - t.2.2) ((periodMonomial j ω h a).coeff t.1.1) := by + classical + rw [matrix_entry_translation r T j s ω b h a S hp, Fintype.sum_sigma] + simp only [Fintype.sum_prod_type] + rw [← Finset.sum_coe_sort] + apply Finset.sum_congr rfl + intro A hA + apply Finset.sum_congr rfl + intro d hd + rw [Finset.Nat.sum_antidiagonal_eq_sum_range_succ_mk, ← Fin.sum_univ_eq_sum_range] + +theorem det_dependent_row_sum {ι : Type*} [Fintype ι] [DecidableEq ι] + {δ : ι → Type*} [∀ i, Fintype (δ i)] + (B : ∀ i, δ i → ℂ) (C : ∀ i, δ i → ι → ℂ) : + Matrix.det (fun i j => ∑ t, B i t * C i t j) = + ∑ f : (∀ i, δ i), (∏ i, B i (f i)) * Matrix.det (fun i j => C i (f i) j) := by + classical + have hm := (Matrix.detRowAlternating : (ι → ℂ) [⋀^ι]→ₗ[ℂ] ℂ).toMultilinearMap.map_sum + (fun i t => B i t • C i t) + calc + _ = Matrix.det (fun i => ∑ t, B i t • C i t) := by + congr 1 + funext i j + simp + _ = ∑ f : (∀ i, δ i), Matrix.det (fun i => B i (f i) • C i (f i)) := hm + _ = _ := by + apply Finset.sum_congr rfl + intro f hf + exact Matrix.det_mul_column (fun i => B i (f i)) (fun i j => C i (f i) j) + +theorem det_matrix_translation {ι : Type*} [Fintype ι] [DecidableEq ι] + {m : ℕ} (r : Fin m → ℂ) (T : Fin m → ℕ) + (j s : ι → ℕ) (ω : ℂ) (b : ι → Fin m → ℕ) + (h : ι → ℕ) (a : ι → Fin m → ℕ) (S : Finset (Fin m →₀ ℕ)) + (hp : ∀ i c, (periodMonomial (j i) ω (h c) (a c)).support ⊆ S) : + Matrix.det (fun i c => InterpolationMatrix.entry r + (fun k => InterpolationMatrix.truncatedLog (T k)) (j i) (s i) (b i) (h c) (a c)) = + ∑ f : (∀ i, RowChoices S (InterpolationMatrix.exponentVector (b i)) (s i)), + (∏ i, rowScalar (fun k => (j i : ℂ) * (r k - ω)) + (fun k => tail (T k) (PowerSeries.log ℂ)) + (InterpolationMatrix.exponentVector (b i)) (f i).1.1 (f i).2.1 (f i).2.2) * + Matrix.det (fun i c => PowerSeries.coeff (s i - (f i).2.2) + ((periodMonomial (j i) ω (h c) (a c)).coeff (f i).1.1)) := by + have he : (fun i c => InterpolationMatrix.entry r + (fun k => InterpolationMatrix.truncatedLog (T k)) (j i) (s i) (b i) (h c) (a c)) = + (fun i c => ∑ t : RowChoices S (InterpolationMatrix.exponentVector (b i)) (s i), + rowScalar (fun k => (j i : ℂ) * (r k - ω)) + (fun k => tail (T k) (PowerSeries.log ℂ)) + (InterpolationMatrix.exponentVector (b i)) t.1.1 t.2.1 t.2.2 * + PowerSeries.coeff (s i - t.2.2) ((periodMonomial (j i) ω (h c) (a c)).coeff t.1.1)) := by + funext i c + exact matrix_entry_translation_choices r T (j i) (s i) ω (b i) (h c) (a c) S (hp i c) + rw [he] + exact det_dependent_row_sum _ _ + +end PiExponent.MatrixTranslation + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixTranslationBounds.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixTranslationBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..655c157be7be89d6e82aafe256da0e9b4c3ce711 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/MatrixTranslationBounds.lean @@ -0,0 +1,173 @@ +import OAI.NumberTheory.PiExponent.Analysis.LogTailAnalytic +import OAI.NumberTheory.PiExponent.Approximation.ApproximationCenters +import OAI.NumberTheory.PiExponent.Approximation.MatrixTranslation + +namespace OAI + +namespace PiExponent.MatrixTranslationBounds + +open scoped BigOperators +open RowTranslation + +noncomputable def weight {σ : Type*} [Fintype σ] (w : σ → ℝ) (a : σ → ℕ) : ℝ := + ∑ i, w i * a i + +theorem error_power_product_le {σ : Type*} [Fintype σ] + (ε : σ → ℂ) (e : σ → ℕ) (w : σ → ℝ) (C ν : ℝ) + (hε : ∀ i, ‖ε i‖ ≤ Real.exp (C - ν * w i)) : + (∏ i, ‖ε i‖ ^ e i) ≤ Real.exp (∑ i, (e i : ℝ) * (C - ν * w i)) := by + rw [Real.exp_sum] + apply Finset.prod_le_prod₀ (fun i hi => by positivity) + intro i hi + rw [Real.exp_nat_mul] + exact pow_le_pow_left₀ (norm_nonneg _) (hε i) _ + +theorem norm_rowScalar_exp_basic {σ : Type*} [Fintype σ] [DecidableEq σ] + (ε : σ → ℂ) (T : σ → ℕ) (β a : σ →₀ ℕ) + (d : ∀ i, Fin (a i - β i + 1)) (k : ℕ) (w : σ → ℝ) (C ν : ℝ) + (hT : ∀ i, 1 ≤ T i) (hε : ∀ i, ‖ε i‖ ≤ Real.exp (C - ν * w i)) : + ‖rowScalar ε (fun i => tail (T i) (PowerSeries.log ℂ)) β a d k‖ ≤ + Real.exp ((∑ i, a i : ℕ) * Real.log 4 + + (∑ i, ((a i - β i - d i : ℕ) : ℝ) * (C - ν * w i)) + + (k : ℝ) * Real.log 2) := by + have hτ := LogTailAnalytic.norm_coeff_prod_formal_logTail_le Finset.univ T + (fun i => (d i : ℕ)) (fun i hi => hT i) k + apply (norm_rowScalar_le ε _ β a d k ((2 : ℝ) ^ k) hτ).trans + calc + _ ≤ (4 : ℝ) ^ (∑ i, a i) * + Real.exp (∑ i, ((a i - β i - d i : ℕ) : ℝ) * (C - ν * w i)) * (2 : ℝ) ^ k := + mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left (error_power_product_le ε _ w C ν hε) (by positivity)) + (by positivity) + _ = _ := by + rw [Real.exp_add, Real.exp_add, Real.exp_nat_mul, Real.exp_nat_mul, + Real.exp_log (by norm_num : (0 : ℝ) < 4), Real.exp_log (by norm_num : (0 : ℝ) < 2)] + +theorem sum_exponents_le {σ : Type*} [Fintype σ] (w : σ → ℝ) (a : σ → ℕ) + (H ws : ℝ) (hws : 0 < ws) (hw : ∀ i, ws ≤ w i) (ha : weight w a ≤ H) : + ((∑ i, a i : ℕ) : ℝ) ≤ H / ws := by + apply (le_div_iff₀ hws).2 + calc + ((∑ i, a i : ℕ) : ℝ) * ws = ∑ i, ws * (a i : ℝ) := by + simp only [Nat.cast_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro i hi + ring_nf + _ ≤ weight w a := Finset.sum_le_sum (fun i hi => + mul_le_mul_of_nonneg_right (hw i) (Nat.cast_nonneg _)) + _ ≤ H := ha + +theorem residual_exponent_identity {σ : Type*} [Fintype σ] + (a β : σ →₀ ℕ) (d : ∀ i, Fin (a i - β i + 1)) (w : σ → ℝ) (C ν : ℝ) : + (∑ i, ((a i - β i - d i : ℕ) : ℝ) * (C - ν * w i)) = + C * ((∑ i, (a i - β i - d i) : ℕ) : ℝ) - + ν * weight w (fun i => a i - β i) + ν * weight w (fun i => (d i : ℕ)) := by + simp only [weight, Nat.cast_sum, Finset.mul_sum, ← Finset.sum_sub_distrib, + ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i hi + rw [Nat.cast_sub (Nat.le_of_lt_succ (d i).isLt)] + ring_nf + +theorem norm_rowScalar_exp_weighted {σ : Type*} [Fintype σ] [DecidableEq σ] + (ε : σ → ℂ) (T : σ → ℕ) (β a : σ →₀ ℕ) + (d : ∀ i, Fin (a i - β i + 1)) (k : ℕ) (w : σ → ℝ) + (C ν H ws v F : ℝ) (hC : 0 ≤ C) (hν : 0 ≤ ν) + (hws : 0 < ws) (hv : 0 < v) (hF : 0 < F) + (hw : ∀ i, ws ≤ w i) (ha : weight w (fun i => a i) ≤ H) + (hk : (k : ℝ) ≤ H / v) (hT : ∀ i, 1 ≤ T i) + (hTw : ∀ i, F * w i ≤ v * T i) + (hε : ∀ i, ‖ε i‖ ≤ Real.exp (C - ν * w i)) : + ‖rowScalar ε (fun i => tail (T i) (PowerSeries.log ℂ)) β a d k‖ ≤ + Real.exp (-ν * weight w (fun i => a i - β i) + + H * (ν / F + Real.log 2 / v + (Real.log 4 + C) / ws)) := by + by_cases hz : PowerSeries.coeff k (∏ i, tail (T i) (PowerSeries.log ℂ) ^ (d i : ℕ)) = 0 + · simp [rowScalar, hz, Real.exp_nonneg] + have hbudget : weight w (fun i => (d i : ℕ)) ≤ H / F := by + have hb := tail_weight_budget Finset.univ T (fun i => (d i : ℕ)) + (fun _ => PowerSeries.log ℂ) k w v F hv.le hF (fun i hi => hTw i) hz + have hkv : v * (k : ℝ) ≤ H := by nlinarith [(le_div_iff₀ hv).mp hk] + have hb' : weight w (fun i => (d i : ℕ)) ≤ v * k / F := by + simpa [weight, mul_comm] using hb + exact hb'.trans (div_le_div_of_nonneg_right hkv hF.le) + have hsize := sum_exponents_le w (fun i => a i) H ws hws hw ha + have hcount : ((∑ i, (a i - β i - d i) : ℕ) : ℝ) ≤ ((∑ i, a i : ℕ) : ℝ) := by + exact_mod_cast Finset.sum_le_sum (fun i hi => (Nat.sub_le _ _).trans (Nat.sub_le _ _)) + have hlog2 : 0 ≤ Real.log 2 := Real.log_nonneg (by norm_num) + have hlog4 : 0 ≤ Real.log 4 := Real.log_nonneg (by norm_num) + apply (norm_rowScalar_exp_basic ε T β a d k w C ν hT hε).trans + apply Real.exp_le_exp.mpr + rw [residual_exponent_identity] + calc + _ ≤ (Real.log 4 + C) * ((∑ i, a i : ℕ) : ℝ) - + ν * weight w (fun i => a i - β i) + ν * (H / F) + (H / v) * Real.log 2 := by + nlinarith [mul_le_mul_of_nonneg_left hcount hC, + mul_le_mul_of_nonneg_left hbudget hν, + mul_le_mul_of_nonneg_right hk hlog2] + _ ≤ (Real.log 4 + C) * (H / ws) - + ν * weight w (fun i => a i - β i) + ν * (H / F) + (H / v) * Real.log 2 := by + nlinarith [mul_le_mul_of_nonneg_left hsize (add_nonneg hlog4 hC)] + _ = _ := by ring_nf + +theorem weight_sub_le_weight_tsub {σ : Type*} [Fintype σ] + (w : σ → ℝ) (a β : σ → ℕ) (hw : ∀ i, 0 ≤ w i) : + weight w a - weight w β ≤ weight w (fun i => a i - β i) := by + simp only [weight, ← Finset.sum_sub_distrib] + apply Finset.sum_le_sum + intro i hi + rw [← mul_sub] + apply mul_le_mul_of_nonneg_left _ (hw i) + by_cases h : β i ≤ a i + · rw [Nat.cast_sub h] + · have hle : a i ≤ β i := by omega + rw [Nat.sub_eq_zero_of_le hle, Nat.cast_zero] + exact sub_nonpos.mpr (by exact_mod_cast hle) + +theorem norm_rowScalar_exp_weight_difference {σ : Type*} [Fintype σ] [DecidableEq σ] + (ε : σ → ℂ) (T : σ → ℕ) (β a : σ →₀ ℕ) + (d : ∀ i, Fin (a i - β i + 1)) (k : ℕ) (w : σ → ℝ) + (C ν H ws v F : ℝ) (hC : 0 ≤ C) (hν : 0 ≤ ν) + (hws : 0 < ws) (hv : 0 < v) (hF : 0 < F) + (hw : ∀ i, ws ≤ w i) (ha : weight w (fun i => a i) ≤ H) + (hk : (k : ℝ) ≤ H / v) (hT : ∀ i, 1 ≤ T i) + (hTw : ∀ i, F * w i ≤ v * T i) + (hε : ∀ i, ‖ε i‖ ≤ Real.exp (C - ν * w i)) : + ‖rowScalar ε (fun i => tail (T i) (PowerSeries.log ℂ)) β a d k‖ ≤ + Real.exp (-ν * (weight w (fun i => a i) - weight w (fun i => β i)) + + H * (ν / F + Real.log 2 / v + (Real.log 4 + C) / ws)) := by + apply (norm_rowScalar_exp_weighted ε T β a d k w C ν H ws v F + hC hν hws hv hF hw ha hk hT hTw hε).trans + apply Real.exp_le_exp.mpr + have h := weight_sub_le_weight_tsub w (fun i => a i) (fun i => β i) + (fun i => hws.le.trans (hw i)) + nlinarith [mul_le_mul_of_nonneg_left h hν] + +theorem actual_error_exp {σ : Type*} (p : σ → ℤ) (q : σ → ℕ) + (j K : ℕ) (ν : ℝ) (hK : 1 ≤ K) (hj : j ≤ K) (hν : 0 ≤ ν) + (hq : ∀ i, 1 ≤ q i) + (happrox : ∀ i, |Real.pi - (p i : ℝ) / q i| ≤ (q i : ℝ) ^ (-ν)) : + ∀ i, ‖(j : ℂ) * (approximatePeriod (p i) (q i) - logarithmicPeriod)‖ ≤ + Real.exp ((Real.log (2 * (K : ℝ)) + ν) - ν * (⌈Real.log (q i)⌉₊ : ℝ)) := by + intro i + have h := norm_center_error_exp ν hν (hq i) hj (happrox i) + have hKpos : (0 : ℝ) < 2 * K := by exact_mod_cast (by omega : 0 < 2 * K) + convert h using 1 + rw [sub_eq_add_neg, Real.exp_add, Real.exp_add, Real.exp_log hKpos] + congr 1 + ring_nf + +noncomputable def truncationOrder (F v w : ℝ) : ℕ := ⌈F * w / v⌉₊ + +theorem truncationOrder_pos {F v w : ℝ} (hF : 0 < F) (hv : 0 < v) (hw : 0 < w) : + 1 ≤ truncationOrder F v w := by + exact Nat.ceil_pos.mpr (div_pos (mul_pos hF hw) hv) + +theorem truncationOrder_budget {F v w : ℝ} (hv : 0 < v) : + F * w ≤ v * truncationOrder F v w := by + have h := Nat.le_ceil (F * w / v) + have h' := (div_le_iff₀ hv).mp h + simpa [truncationOrder, mul_comm] using h' + +end PiExponent.MatrixTranslationBounds + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/MixedFrameExtension.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/MixedFrameExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..75b108663ae338694629bf6876b55331eba50cd1 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/MixedFrameExtension.lean @@ -0,0 +1,59 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleProjectiveSections +import OAI.NumberTheory.PiExponent.Approximation.MixedSectionExtension +import OAI.NumberTheory.PiExponent.Approximation.TensorMixedSection + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite +open PiExponentSeshadri.Frames PiExponentSeshadri.TensorPure +variable {X : Scheme.{0}} + +theorem LineBundle.divisible_mixed_extension [IsIntegral X] [CompactSpace X] (L M : LineBundle X) + (s : O X ⟶ L.sheaf) (hD : (sectionOpen X s : Set X).Nonempty) + (w : Γ(M.sheaf,sectionOpen X s)) : + ∃ N : ℕ, ∀ n ≥ N, ∃ t : O X ⟶ ((L.pow (n+1)).tensor M).sheaf, + sectionOpen X t ≤ sectionOpen X s ∧ + t.app (sectionOpen X s) (1 : Γ(X,sectionOpen X s)) = + pure (L.pow (n+1)).sheaf M.sheaf (sectionOpen X s) + ((powerSection s (n+1)).app (sectionOpen X s) (1 : Γ(X,sectionOpen X s))) w := by + obtain ⟨N,hN⟩ := L.mixed_extension M s hD w + refine ⟨N,fun n hn => ?_⟩ + obtain ⟨t,ht⟩ := hN n hn + let q := tensorSection s t ≫ (lineTensorAssoc L (L.pow n) M).inv + refine ⟨q,?_,?_⟩ + · change SectionOpens.isoOpen (tensorSection s t ≫ (lineTensorAssoc L (L.pow n) M).symm.hom) ≤ _ + erw [SectionOpens.isoOpen_postcomp,section_open L ((L.pow n).tensor M)] + exact inf_le_left + · let D := sectionOpen X s + change (lineTensorAssoc L (L.pow n) M).inv.app D ((tensorSection s t).app D (1 : Γ(X,D))) = _ + have h := (section_apply s t D).trans + (congrArg (pure L.sheaf ((L.pow n).tensor M).sheaf D (s.app D (1 : Γ(X,D)))) ht) + exact (congrArg ((lineTensorAssoc L (L.pow n) M).inv.app D) h).trans + ((assoc_inv_pure L (L.pow n) M D _ _ w).trans + (congrArg (fun z => pure (L.pow (n+1)).sheaf M.sheaf D z w) (power_succ_apply s n D).symm)) + +theorem LineBundle.mixed_frame_extension [IsIntegral X] [CompactSpace X] (L M : LineBundle X) + (s : O X ⟶ L.sheaf) (hD : (sectionOpen X s : Set X).Nonempty) + (e : M.sheaf.restrict (sectionOpen X s).ι ≅ O (sectionOpen X s).toScheme) : + ∃ N : ℕ, ∀ n ≥ N, ∃ t : O X ⟶ ((L.pow (n+1)).tensor M).sheaf, + sectionOpen X t = sectionOpen X s ∧ + t.app (sectionOpen X s) (1 : Γ(X,sectionOpen X s)) = + pure (L.pow (n+1)).sheaf M.sheaf (sectionOpen X s) + ((powerSection s (n+1)).app (sectionOpen X s) (1 : Γ(X,sectionOpen X s))) + (openSectionEquiv M.sheaf (sectionOpen X s) e.inv) := by + obtain ⟨N,hN⟩ := L.divisible_mixed_extension M s hD + (openSectionEquiv M.sheaf (sectionOpen X s) e.inv) + refine ⟨N,fun n hn => ?_⟩ + obtain ⟨t,ht,hv⟩ := hN n hn + refine ⟨t,le_antisymm ht ?_,hv⟩ + have hi : IsIso (restrictSection (sectionOpen X s).ι (powerSection s (n+1))) := by + have hs := L.sectionOpen_power s (by omega : 0 < n+1) + exact isIso_restricted_section _ _ hs + exact mixed_value_open (sectionOpen X s) (powerSection s (n+1)) e.inv t hv + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/MixedSectionExtension.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/MixedSectionExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..b22770ba23c4beeba636e36d9186025528e8a14b --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/MixedSectionExtension.lean @@ -0,0 +1,152 @@ +import OAI.NumberTheory.PiExponent.Approximation.PowerSectionExtension +import OAI.NumberTheory.PiExponent.Approximation.TensorSectionOpen + +namespace OAI + +noncomputable section + +namespace PiExponentSeshadri.Geometry +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite +open PiExponentSeshadri.Frames PiExponentSeshadri.TensorPure +variable {X : Scheme.{0}} + +theorem local_affine_mixed_extension (L M : LineBundle X) (U : X.Opens) [IsAffine U.toScheme] + (e : L.sheaf.restrict U.ι ≅ O U.toScheme) (d : M.sheaf.restrict U.ι ≅ O U.toScheme) + (s : O X ⟶ L.sheaf) + (w : Γ(M.sheaf, U.ι ''ᵁ (U.toScheme.basicOpen (coefficient e (restrictSection U.ι s))))) : + ∃ N : ℕ, ∀ n ≥ N, ∃ t : O U.toScheme ⟶ (((L.pow n).tensor M).sheaf.restrict U.ι), + let V := U.toScheme.basicOpen (coefficient e (restrictSection U.ι s)) + (((L.pow n).tensor M).sheaf).presheaf.map (homOfLE (U.ι_image_le V)).op + (openSectionEquiv _ U t) = + pure (L.pow n).sheaf M.sheaf (U.ι ''ᵁ V) ((powerSection s n).app (U.ι ''ᵁ V) (1 : Γ(X,U.ι ''ᵁ V))) w := by + let V := U.toScheme.basicOpen (coefficient e (restrictSection U.ι s)) + let b : Γ(U.toScheme,V) := d.hom.app V w + let f : Γ(V.toScheme,⊤) := V.topIso.inv b + obtain ⟨N,hN⟩ := local_affine_power_extension U e s f + refine ⟨N,fun n hn => ?_⟩ + obtain ⟨t,ht⟩ := hN n hn + let q : O U.toScheme ⟶ (((L.pow n).tensor M).sheaf.restrict U.ι) := + TensorPure.tensorSection t d.inv ≫ (moduleTensorRestrict U (L.pow n).sheaf M.sheaf).inv + refine ⟨q,?_⟩ + change (((L.pow n).tensor M).sheaf).presheaf.map (homOfLE (U.ι_image_le V)).op + (openSectionEquiv _ U q) = _ + erw [openSectionEquiv_restrict_value ((L.pow n).tensor M).sheaf U q V] + have he := congrArg (openSectionEquiv ((L.pow n).sheaf.restrict U.ι) V) ht + erw [openSectionEquiv_restrict t V, + openSectionEquiv_scalar ((L.pow n).sheaf.restrict U.ι) V f + (restrictSection V.ι (restrictSection U.ι (powerSection s n))), + openSectionEquiv_restrict (restrictSection U.ι (powerSection s n)) V] at he + have hf : V.topIso.hom f = b := Iso.inv_hom_id_apply _ _ + rw [hf] at he + have hp : (restrictSection U.ι (powerSection s n)).app V (1 : Γ(U.toScheme,V)) = + (powerSection s n).app (U.ι ''ᵁ V) (1 : Γ(X,U.ι ''ᵁ V)) := by + change (powerSection s n).app (U.ι ''ᵁ V) ((U.ι.appIso V).inv (1 : Γ(U.toScheme,V))) = _ + rw [map_one] + have he := he.trans (congrArg (fun z : Γ((L.pow n).sheaf.restrict U.ι, V) => (b : Γ(U.toScheme,V)) • z) hp) + apply (ConcreteCategory.bijective_of_isIso + (((Scheme.Modules.toPresheaf U.toScheme).mapIso + (moduleTensorRestrict U (L.pow n).sheaf M.sheaf)).app (op V)).hom).injective + change (moduleTensorRestrict U (L.pow n).sheaf M.sheaf).hom.app V + ((moduleTensorRestrict U (L.pow n).sheaf M.sheaf).inv.app V + ((TensorPure.tensorSection t d.inv).app V (1 : Γ(U.toScheme,V)))) = _ + have hc : (moduleTensorRestrict U (L.pow n).sheaf M.sheaf).hom.app V + ((moduleTensorRestrict U (L.pow n).sheaf M.sheaf).inv.app V + ((TensorPure.tensorSection t d.inv).app V (1 : Γ(U.toScheme,V)))) = (TensorPure.tensorSection t d.inv).app V (1 : Γ(U.toScheme,V)) := by + change ((moduleTensorRestrict U (L.pow n).sheaf M.sheaf).inv ≫ + (moduleTensorRestrict U (L.pow n).sheaf M.sheaf).hom).app V _ = _ + rw [Iso.inv_hom_id] + rfl + erw [hc,TensorPure.section_apply t d.inv V] + refine (congrArg (fun z => pure ((L.pow n).sheaf.restrict U.ι) (M.sheaf.restrict U.ι) V + z (d.inv.app V (1 : Γ(U.toScheme,V)))) he).trans ?_ + erw [pure_smul_left,← pure_smul_right] + have hd : b • d.inv.app V (1 : Γ(U.toScheme,V)) = w := by + erw [← d.inv.app_smul b (1 : Γ(U.toScheme,V)),smul_eq_mul,mul_one] + change d.inv.app V (d.hom.app V w) = w + change (d.hom ≫ d.inv).app V w = w + rw [Iso.hom_inv_id] + rfl + erw [hd] + exact (restrict_pure U (L.pow n).sheaf M.sheaf V _ w).symm + +theorem LineBundle.finite_cover_mixed_extension [IsIntegral X] (L M : LineBundle X) + {ι : Type*} [Fintype ι] [Nonempty ι] (U : ι → X.Opens) + (hcover : (⊤ : X.Opens) ≤ iSup U) + (haff : ∀ i, IsAffine (U i).toScheme) (hU : ∀ i, (U i : Set X).Nonempty) + (e : ∀ i, L.sheaf.restrict (U i).ι ≅ O (U i).toScheme) + (d : ∀ i, M.sheaf.restrict (U i).ι ≅ O (U i).toScheme) + (s : O X ⟶ L.sheaf) (hD : (sectionOpen X s : Set X).Nonempty) + (w : Γ(M.sheaf, sectionOpen X s)) : + ∃ N : ℕ, ∀ n ≥ N, ∃ t : O X ⟶ ((L.pow n).tensor M).sheaf, + t.app (sectionOpen X s) (1 : Γ(X,sectionOpen X s)) = + pure (L.pow n).sheaf M.sheaf (sectionOpen X s) + ((powerSection s n).app (sectionOpen X s) (1 : Γ(X,sectionOpen X s))) w := by + classical + let D := sectionOpen X s + let V (i : ι) := (U i).toScheme.basicOpen (coefficient (e i) (restrictSection (U i).ι s)) + let W (i : ι) := (U i).ι ''ᵁ V i + have hV (i : ι) : V i = (U i).ι ⁻¹ᵁ D := (preimage_isoOpen s (U i).ι (e i)).symm + have hW_eq (i : ι) : W i = U i ⊓ D := by + simp only [W,hV,Scheme.Hom.image_preimage_eq_opensRange_inf,Scheme.Opens.opensRange_ι] + have hWU (i : ι) : W i ≤ U i := (U i).ι_image_le (V i) + have hWD (i : ι) : W i ≤ D := (hW_eq i).le.trans inf_le_right + have hW (i : ι) : (W i : Set X).Nonempty := by + rw [hW_eq] + exact nonempty_preirreducible_inter (U i).isOpen D.isOpen (hU i) hD + let wi (i : ι) : Γ(M.sheaf,W i) := M.sheaf.presheaf.map (homOfLE (hWD i)).op w + have hh (i : ι) := @local_affine_mixed_extension X L M (U i) (haff i) (e i) (d i) s (wi i) + choose N hN using hh + refine ⟨Finset.univ.sup N, fun n hn => ?_⟩ + have hn' (i : ι) : N i ≤ n := (Finset.le_sup (f := N) (Finset.mem_univ i)).trans hn + choose t ht using fun i => hN i n (hn' i) + let P := ((L.pow n).tensor M) + let target : Γ(P.sheaf,D) := pure (L.pow n).sheaf M.sheaf D + ((powerSection s n).app D (1 : Γ(X,D))) w + have heq (i : ι) : P.sheaf.presheaf.map (homOfLE (hWU i)).op + (openSectionEquiv P.sheaf (U i) (t i)) = + P.sheaf.presheaf.map (homOfLE (hWD i)).op target := by + refine (ht i).trans ?_ + have hr := pure_restrict (L.pow n).sheaf M.sheaf (homOfLE (hWD i)) + ((powerSection s n).app D (1 : Γ(X,D))) w + have hp := section_value_natural (powerSection s n) (homOfLE (hWD i)) + exact (congrArg (fun z => pure (L.pow n).sheaf M.sheaf (W i) z (wi i)) hp).symm.trans hr.symm + obtain ⟨g,hg,-⟩ := P.glue_dense_subopens D U W hcover hWU hWD hW + (fun i => openSectionEquiv P.sheaf (U i) (t i)) target heq + refine ⟨(moduleSectionEquiv P.sheaf).symm g,?_⟩ + have H := section_value_natural ((moduleSectionEquiv P.sheaf).symm g) + (homOfLE (show D ≤ ⊤ from le_top)) + have Htop : ((moduleSectionEquiv P.sheaf).symm g).app ⊤ (1 : Γ(X,⊤)) = g := + (moduleSectionEquiv P.sheaf).apply_symm_apply g + rw [Htop] at H + exact H.symm.trans hg.2 + +theorem LineBundle.mixed_extension [IsIntegral X] [CompactSpace X] (L M : LineBundle X) + (s : O X ⟶ L.sheaf) (hD : (sectionOpen X s : Set X).Nonempty) + (w : Γ(M.sheaf,sectionOpen X s)) : + ∃ N : ℕ, ∀ n ≥ N, ∃ t : O X ⟶ ((L.pow n).tensor M).sheaf, + t.app (sectionOpen X s) (1 : Γ(X,sectionOpen X s)) = + pure (L.pow n).sheaf M.sheaf (sectionOpen X s) + ((powerSection s n).app (sectionOpen X s) (1 : Γ(X,sectionOpen X s))) w := by + classical + choose U hUx he hd using common_affine_frames L M + obtain ⟨I,hI⟩ := isCompact_univ.elim_finite_subcover + (fun x => (U x).1 : X → Set X) (fun x => (U x).1.isOpen) + (by intro x _; exact Set.mem_iUnion.mpr ⟨x,hUx x⟩) + have hic (x : X) : ∃ i ∈ I, x ∈ (U i).1 := by + obtain ⟨i,hi⟩ := Set.mem_iUnion.mp (hI (show x ∈ Set.univ from trivial)) + obtain ⟨hi,hx⟩ := Set.mem_iUnion.mp hi + exact ⟨i,hi,hx⟩ + have : Nonempty I := by + obtain ⟨x,-⟩ := hD + obtain ⟨i,hi,-⟩ := hic x + exact ⟨⟨i,hi⟩⟩ + exact L.finite_cover_mixed_extension M (fun i : I => (U i.val).1) + (by intro x _; obtain ⟨i,hi,hx⟩ := hic x; exact Opens.mem_iSup.mpr ⟨⟨i,hi⟩,hx⟩) + (fun i => (U i.val).2) (fun i => ⟨i.val,hUx i.val⟩) + (fun i => Classical.choice (he i.val)) (fun i => Classical.choice (hd i.val)) s hD w + +end PiExponentSeshadri.Geometry + +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/MixedSectionOpenExtension.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/MixedSectionOpenExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a9d58bf679534e4cd6b791443294087336c9744 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/MixedSectionOpenExtension.lean @@ -0,0 +1,46 @@ +import OAI.NumberTheory.PiExponent.Approximation.MixedFrameExtension +import OAI.NumberTheory.PiExponent.Cohomology.PencilCohomologySections + +namespace OAI + + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Frames PiExponentSeshadri.TensorPure PiExponentSeshadri.SectionOpens +variable {X : Scheme.{0}} + +theorem LineBundle.mixed_section_open_extension [IsIntegral X] [CompactSpace X] + (L M : LineBundle X) (s : O X ⟶ L.sheaf) + (hne : (sectionOpen X s : Set X).Nonempty) + (w : O (sectionOpen X s).toScheme ⟶ M.sheaf.restrict (sectionOpen X s).ι) : + ∃ N : ℕ, ∀ n ≥ N, ∃ t : O X ⟶ ((L.pow (n+1)).tensor M).sheaf, + sectionOpen X t = (sectionOpen X s).ι ''ᵁ isoOpen w := by + let U := sectionOpen X s + obtain ⟨N,hN⟩ := L.divisible_mixed_extension M s hne (openSectionEquiv M.sheaf U w) + refine ⟨N,fun n hn => ?_⟩ + obtain ⟨t,ht,hv⟩ := hN n hn + have hi : IsIso (restrictSection U.ι (powerSection s (n+1))) := + isIso_restricted_section _ _ (L.sectionOpen_power s (by omega)) + have hpre : U.ι ⁻¹ᵁ isoOpen t = isoOpen w := by + rw [← isoOpen_restrictSection] + have hval := mixed_value_restrict U (powerSection s (n+1)) w t hv + have hpost := isoOpen_postcomp (tensorSection (restrictSection U.ι (powerSection s (n+1))) w) + (moduleTensorRestrict U (L.pow (n+1)).sheaf M.sheaf).symm + have hopen := section_open ((L.pow (n+1)).restrict U.ι) (M.restrict U.ι) + (restrictSection U.ι (powerSection s (n+1))) w + refine (congrArg isoOpen hval).trans (hpost.trans (hopen.trans ?_)) + have he : isoOpen (restrictSection U.ι (powerSection s (n+1))) = ⊤ := by + apply top_unique + intro x _ + apply (mem_isoOpen_iff _ x).mpr + exact ⟨⊤, trivial, by infer_instance⟩ + exact (congrArg (fun V : U.toScheme.Opens => V ⊓ isoOpen w) he).trans (top_inf_eq _) + refine ⟨t,?_⟩ + change isoOpen t = _ + rw [← hpre,Scheme.Hom.image_preimage_eq_opensRange_inf,Scheme.Opens.opensRange_ι] + exact (inf_eq_right.mpr ht).symm +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ModuleLinePowerLaws.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ModuleLinePowerLaws.lean new file mode 100644 index 0000000000000000000000000000000000000000..685f7280503c4b14e54d972f01474ffea01f1de2 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ModuleLinePowerLaws.lean @@ -0,0 +1,135 @@ +import OAI.NumberTheory.PiExponent.Approximation.LinePowerLaws +import OAI.NumberTheory.PiExponent.Approximation.TensorPure +import OAI.NumberTheory.PiExponent.Geometry.SheafificationUnitIso + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace MonoidalCategory +open PiExponentSeshadri.TensorPure +variable {X : Scheme} + +def lineTensorPresheafRestrictFrame (L : LineBundle X) (N : X.Modules) + (U : X.Opens) (e : L.sheaf.restrict U.ι ≅ structureSheaf U.toScheme) : + (modulePresheafRestrict U.ι).obj + (PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) L.sheaf.val N.val) ≅ + (N.restrict U.ι).val := by + let : MonoidalCategory (PresheafOfModules U.toScheme.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := U.toScheme.presheaf) + let ep : (modulePresheafRestrict U.ι).obj L.sheaf.val ≅ + 𝟙_ (PresheafOfModules U.toScheme.ringCatSheaf.obj) := + (SheafOfModules.forget _).mapIso e + exact modulePresheafTensorRestrict U L.sheaf.val N.val ≪≫ + tensorIso ep (Iso.refl _) ≪≫ λ_ _ + +lemma lineTensorPresheaf_unit_restrict_isIso (L : LineBundle X) (N : X.Modules) + (U : X.Opens) (e : L.sheaf.restrict U.ι ≅ structureSheaf U.toScheme) : + IsIso ((modulePresheafRestrict U.ι).map + ((adj X).unit.app + (PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) L.sheaf.val N.val))) := by + let P := PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) L.sheaf.val N.val + let R : PresheafOfModules X.ringCatSheaf.obj ⥤ + PresheafOfModules U.toScheme.ringCatSheaf.obj := modulePresheafRestrict U.ι + have hη : IsIso ((adj U.toScheme).unit.app (R.obj P)) := + sheafification_unit_isIso_of_iso (R.obj P) (N.restrict U.ι) + (lineTensorPresheafRestrictFrame L N U e) + have hh : IsIso (R.map ((adj X).unit.app P) ≫ + ((moduleSheafificationRestrict U.ι).hom.app P).val) := by + erw [sheafify_restrict_unit] + exact hη + let V : U.toScheme.Modules ⥤ PresheafOfModules U.toScheme.ringCatSheaf.obj := + SheafOfModules.forget U.toScheme.ringCatSheaf + let hv : IsIso (C := PresheafOfModules U.toScheme.ringCatSheaf.obj) + (((moduleSheafificationRestrict U.ι).hom.app P).val) := + (V.mapIso ((moduleSheafificationRestrict U.ι).app P)).isIso_hom + exact (@isIso_comp_right_iff (PresheafOfModules U.toScheme.ringCatSheaf.obj) + _ _ _ _ _ _ hv).mp hh + +lemma sheafification_tensor_left_line_unit_isIso (M : X.Modules) (L : LineBundle X) + (N : X.Modules) : + IsIso ((PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).map + (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) (𝟙 M.val) + ((adj X).unit.app + (PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) L.sheaf.val N.val)))) := by + let P := PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) L.sheaf.val N.val + let F : PresheafOfModules X.ringCatSheaf.obj ⥤ X.Modules := + PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj) + let η := (adj X).unit.app P + let Q := (F ⋙ SheafOfModules.forget X.ringCatSheaf ⋙ + PresheafOfModules.restrictScalars (𝟙 X.ringCatSheaf.obj)).obj P + let g := PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) (𝟙 M.val) η + apply PiExponent.NumericalAmpleness.isIso_of_locally_isIso + intro x + obtain ⟨U,hx,⟨e⟩⟩ := L.locallyRankOne x + refine ⟨U,hx,?_⟩ + let R : PresheafOfModules X.ringCatSheaf.obj ⥤ + PresheafOfModules U.toScheme.ringCatSheaf.obj := modulePresheafRestrict U.ι + let S : PresheafOfModules U.toScheme.ringCatSheaf.obj ⥤ U.toScheme.Modules := + PresheafOfModules.sheafification (𝟙 U.toScheme.ringCatSheaf.obj) + let : MonoidalCategory (PresheafOfModules U.toScheme.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := U.toScheme.presheaf) + have : IsIso (R.map η) := lineTensorPresheaf_unit_restrict_isIso L N U e + apply (NatIso.isIso_map_iff (moduleSheafificationRestrict U.ι) g).mpr + change IsIso (S.map (R.map g)) + have heq := modulePresheafTensorRestrict_natural U (𝟙 M.val) η + let : IsIso (S.map (modulePresheafTensorRestrict U M.val P).hom) := + (S.mapIso (modulePresheafTensorRestrict U M.val P)).isIso_hom + let : IsIso (S.map (modulePresheafTensorRestrict U M.val Q).hom) := + (S.mapIso (modulePresheafTensorRestrict U M.val Q)).isIso_hom + have hcomp : IsIso (S.map (R.map g ≫ + (modulePresheafTensorRestrict U M.val Q).hom)) := by + erw [heq, S.map_comp] + have ht : IsIso (S.map + (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := U.toScheme.presheaf) + (R.map (𝟙 M.val)) (R.map η))) := by + rw [R.map_id] + change IsIso (S.map ((𝟙 (R.obj M.val)) ⊗ₘ (R.map η))) + infer_instance + exact (inferInstance : IsIso (C := U.toScheme.Modules) + (S.map (modulePresheafTensorRestrict U M.val P).hom ≫ S.map + (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := U.toScheme.presheaf) + (R.map (𝟙 M.val)) (R.map η)))) + erw [S.map_comp] at hcomp + exact (isIso_comp_right_iff (C := U.toScheme.Modules) _ _).mp hcomp + +def sheafificationTensorLeftLinePair (M : X.Modules) (L N : LineBundle X) : + (PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).obj + (PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) M.val + (PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) L.sheaf.val N.sheaf.val)) ≅ + moduleTensor X M (moduleTensor X L.sheaf N.sheaf) := by + let P := PresheafOfModulesOfCommRing.Monoidal.tensorObj (R := X.presheaf) L.sheaf.val N.sheaf.val + let F := PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj) + let η := (adj X).unit.app P + let ht : IsIso (F.map (PresheafOfModulesOfCommRing.Monoidal.tensorHom + (R := X.presheaf) (𝟙 M.val) η)) := sheafification_tensor_left_line_unit_isIso M L N.sheaf + exact @asIso _ _ _ _ (F.map (PresheafOfModulesOfCommRing.Monoidal.tensorHom (R := X.presheaf) + (𝟙 M.val) η)) ht + +def moduleLineTensorAssoc (M : X.Modules) (L N : LineBundle X) : + moduleTensor X (moduleTensor X M L.sheaf) N.sheaf ≅ + moduleTensor X M (moduleTensor X L.sheaf N.sheaf) := by + let : MonoidalCategory (PresheafOfModules X.ringCatSheaf.obj) := + PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf) + exact (sheafificationTensorRight (M.val ⊗ L.sheaf.val) N).symm ≪≫ + (PresheafOfModules.sheafification (𝟙 X.ringCatSheaf.obj)).mapIso + (α_ M.val L.sheaf.val N.sheaf.val) ≪≫ + sheafificationTensorLeftLinePair M L N + +def moduleTwistPowerIso (L : LineBundle X) (M : X.Modules) : ∀ n : ℕ, + (moduleTwistFunctor L n).obj M ≅ moduleTensor X M (modulePow X L.sheaf n) + | 0 => (moduleTensorRightUnit M).symm + | n+1 => moduleTensorIso (moduleTwistPowerIso L M n) (Iso.refl L.sheaf) ≪≫ + moduleLineTensorAssoc M (L.pow n) L ≪≫ + moduleTensorIso (Iso.refl M) (moduleTensorComm (modulePow X L.sheaf n) L.sheaf) + +def moduleTwistPowerMulIso (L : LineBundle X) (M : X.Modules) (d n : ℕ) : + (moduleTwistFunctor (L.pow d) n).obj M ≅ (moduleTwistFunctor L (d*n)).obj M := + moduleTwistPowerIso (L.pow d) M n ≪≫ + moduleTensorIso (Iso.refl M) (linePowerMul L d n) ≪≫ + (moduleTwistPowerIso L M (d*n)).symm + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/ModulePullbackCoherent.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/ModulePullbackCoherent.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a7a8e0e33bb6ab175d621cc4051d9a80bbef0f4 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/ModulePullbackCoherent.lean @@ -0,0 +1,36 @@ +import OAI.NumberTheory.PiExponent.Approximation.FramedPullback +import OAI.NumberTheory.PiExponent.LocalAlgebra.FiniteGlobalPresentation + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits TopologicalSpace +open PiExponent.FiniteGlobalPresentation + +private def presentationOfIso (X : Scheme.{0}) + {M N : SheafOfModules X.ringCatSheaf} (e : M ≅ N) + (P : M.Presentation) : N.Presentation := by + let : IsIso e.hom := e.isIso_hom + exact P.ofIsIso e.hom + +theorem pullback_isFinitePresentation {X Y : Scheme.{0}} (f : Y ⟶ X) + (M : X.Modules) [M.IsFinitePresentation] : + ((Scheme.Modules.pullback f).obj M).IsFinitePresentation := by + apply isFinitePresentation_of_localPresentations + intro y + obtain ⟨U, hy, P, hP⟩ := exists_local_finitePresentation M (f y) + let F : SheafOfModules U.toScheme.ringCatSheaf ⥤ + SheafOfModules (f ⁻¹ᵁ U).toScheme.ringCatSheaf := + Scheme.Modules.pullback (f ∣_ U) + let : PreservesColimitsOfSize.{0,0} F := + (Scheme.Modules.pullbackPushforwardAdjunction (f ∣_ U)).leftAdjoint_preservesColimits + let Q := P.map F (pullbackUnitIso (f ∣_ U)).symm + let e := (pullbackRestrictNatIso f U).app M + exact ⟨f ⁻¹ᵁ U, hy, presentationOfIso (f ⁻¹ᵁ U).toScheme e.symm Q, + ⟨⟨hP.isFiniteType_generators.finite⟩, ⟨hP.isFiniteType_relations.finite⟩⟩⟩ + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/NegativeTwistPresentations.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/NegativeTwistPresentations.lean new file mode 100644 index 0000000000000000000000000000000000000000..cbe6ff777759c732aa90b00fb925827913d91bee --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/NegativeTwistPresentations.lean @@ -0,0 +1,99 @@ +import OAI.NumberTheory.PiExponent.Approximation.ModuleLinePowerLaws +import OAI.NumberTheory.PiExponent.Approximation.TwistPresentations +import OAI.NumberTheory.PiExponent.Cohomology.CohomologyIso +import OAI.NumberTheory.PiExponent.LocalAlgebra.CoherentExtFiniteness + +namespace OAI + +namespace PiExponent.NegativeTwistPresentations +noncomputable section +open AlgebraicGeometry CategoryTheory CategoryTheory.Limits CategoryTheory.Abelian +open PiExponentSeshadri.Geometry +open PiExponent.GeometrySupport.TwistPresentations +variable {X : Scheme.{0}} + +def cancelIso (M : X.Modules) (L N : LineBundle X) + (e : moduleTensor X L.sheaf N.sheaf ≅ structureSheaf X) : + moduleTensor X (moduleTensor X M L.sheaf) N.sheaf ≅ M := + moduleLineTensorAssoc M L N ≪≫ moduleTensorIso (Iso.refl M) e ≪≫ moduleTensorRightUnit M + +variable (L N : LineBundle X) {M : X.Modules} {n : ℕ} + (s : ((moduleTwistFunctor L n).obj M).GeneratingSections) + (e : moduleTensor X (L.pow n).sheaf N.sheaf ≅ structureSheaf X) + +def presentationMap : moduleTensor X (SheafOfModules.free s.I) N.sheaf ⟶ M := + moduleTensorMap (s.π ≫ (moduleTwistPowerIso L M n).hom) (𝟙 N.sheaf) ≫ + (cancelIso M (L.pow n) N e).hom + +instance presentationMap_epi : Epi (presentationMap L N s e) := by + let g : (SheafOfModules.free s.I : X.Modules) ⟶ moduleTensor X M (L.pow n).sheaf := + s.π ≫ (moduleTwistPowerIso L M n).hom + let : Epi (C := X.Modules) s.π := s.epi + let hg : Epi (C := X.Modules) g := epi_comp (C := X.Modules) s.π (moduleTwistPowerIso L M n).hom + let : Epi (C := X.Modules) (moduleTensorMap g (𝟙 N.sheaf)) := + @moduleTensorMap_epi X _ _ g hg N + exact epi_comp (C := X.Modules) (moduleTensorMap g (𝟙 N.sheaf)) + (cancelIso M (L.pow n) N e).hom + +def middleIsoBiproduct [Fintype s.I] [HasFiniteBiproducts X.Modules] : + moduleTensor X (SheafOfModules.free s.I) N.sheaf ≅ ⨁ (fun _ : s.I => N.sheaf) := + twistFreeIsoBiproduct N 1 s.I ≪≫ + biproduct.mapIso (fun _ : s.I => moduleTensorRightUnit N.sheaf) + +theorem middle_isFinitePresentation [hs : s.IsFiniteType] : + (moduleTensor X (SheafOfModules.free s.I) N.sheaf).IsFinitePresentation := by + let : Finite s.I := hs.finite + have := PiExponent.FiniteGlobalPresentation.free_isFinitePresentation X s.I + exact PiExponent.FiniteGlobalPresentation.moduleTwist_isFinitePresentation N 1 + (SheafOfModules.free s.I) + +theorem kernel_isFinitePresentation [IsLocallyNoetherian X] [M.IsFinitePresentation] + [s.IsFiniteType] : (kernel (presentationMap L N s e)).IsFinitePresentation := by + have := middle_isFinitePresentation L N s + let : M.IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData M).choose.isQuasicoherent + exact PiExponent.FiniteGlobalPresentation.kernel_isFinitePresentation (presentationMap L N s e) + +theorem presentation_shortExact : + (ShortComplex.mk (kernel.ι (presentationMap L N s e)) (presentationMap L N s e) + (kernel.condition (presentationMap L N s e))).ShortExact := + { exact := ShortComplex.exact_kernel (presentationMap L N s e) } + +theorem middle_cohomology_finite (p : X ⟶ Spec (CommRingCat.of ℂ)) [hs : s.IsFiniteType] + (q : ℕ) + (hN : letI := Module.compHom (cohomology N.sheaf q) (baseScalars p) + FiniteDimensional ℂ (cohomology N.sheaf q)) : + letI := Module.compHom + (cohomology (moduleTensor X (SheafOfModules.free s.I) N.sheaf) q) (baseScalars p) + FiniteDimensional ℂ (cohomology (moduleTensor X (SheafOfModules.free s.I) N.sheaf) q) := by + let : Finite s.I := hs.finite + let : Fintype s.I := Fintype.ofFinite s.I + let : HasFiniteBiproducts X.Modules := Abelian.hasFiniteBiproducts + let B := ⨁ (fun _ : s.I => N.sheaf) + let := Module.compHom (cohomology B q) (baseScalars p) + let := Module.compHom + (cohomology (moduleTensor X (SheafOfModules.free s.I) N.sheaf) q) (baseScalars p) + have : FiniteDimensional ℂ (cohomology B q) := + CoherentExtFiniteness.cohomology_finite_of_biproduct p + (biproduct.isBilimit (fun _ : s.I => N.sheaf)) q (fun _ => hN) + exact Module.Finite.of_surjective (cohomologyIso p (middleIsoBiproduct L N s) q).symm.toLinearMap + (cohomologyIso p (middleIsoBiproduct L N s) q).symm.surjective + +def coherentFinitePresentation [IsLocallyNoetherian X] [M.IsFinitePresentation] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [s.IsFiniteType] + (hN : ∀ q, letI := Module.compHom (cohomology N.sheaf q) (baseScalars p) + FiniteDimensional ℂ (cohomology N.sheaf q)) : + CoherentExtFiniteness.CoherentFinitePresentation p M where + kernel := kernel (presentationMap L N s e) + kernel_coherent := kernel_isFinitePresentation L N s e + middle := moduleTensor X (SheafOfModules.free s.I) N.sheaf + left := kernel.ι (presentationMap L N s e) + right := presentationMap L N s e + comp_zero := kernel.condition (presentationMap L N s e) + shortExact := presentation_shortExact L N s e + middle_finite := fun q => middle_cohomology_finite L N s p q (hN q) + +end +end PiExponent.NegativeTwistPresentations + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/NoetherianPowerExtension.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/NoetherianPowerExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f41b493320615f4ab072bc4ed42a987cee84a68 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/NoetherianPowerExtension.lean @@ -0,0 +1,74 @@ +import OAI.NumberTheory.PiExponent.Approximation.FrameSections +import OAI.NumberTheory.PiExponent.Approximation.TwistGlobalExtension +import OAI.NumberTheory.PiExponent.Approximation.TwistPowerSection +import OAI.NumberTheory.PiExponent.Geometry.LineBundleCoherent + +namespace OAI + +namespace PiExponentSeshadri.Geometry +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace Opposite +open PiExponentSeshadri.Frames +variable {X : Scheme} + +theorem LineBundle.noetherian_power_extension [NoetherianSpace X] (L : LineBundle X) + (s : GlobalSections X L.sheaf) (f : Γ(X,sectionOpen X s)) : + ∃ N : ℕ, ∀ n ≥ N, ∃ t : GlobalSections X (modulePow X L.sheaf n), + t.app (sectionOpen X s) (1 : Γ(X,sectionOpen X s)) = + f • (powerSection s n).app (sectionOpen X s) (1 : Γ(X,sectionOpen X s)) := by + have : (structureSheaf X).IsFinitePresentation := + PiExponent.GeometrySupport.LineBundleCoherent.structureSheaf_isFinitePresentation + have : (structureSheaf X).IsQuasicoherent := + (SheafOfModules.IsFinitePresentation.exists_quasicoherentData + (structureSheaf X)).choose.isQuasicoherent + obtain ⟨N, hN⟩ := PiExponent.TwistGlobalExtension.global_twist_extension_native L s + (structureSheaf X) f + refine ⟨N, fun n hn => ?_⟩ + obtain ⟨z, hz⟩ := hN n hn + let P := (moduleTwistFunctor L n).obj (structureSheaf X) + let Q := modulePow X L.sheaf n + let D := sectionOpen X s + let e := moduleTwistUnitIso L n + let t : GlobalSections X Q := (moduleSectionEquiv Q).symm (e.hom.app ⊤ z) + refine ⟨t, ?_⟩ + have htop : t.app ⊤ (1 : Γ(X,⊤)) = e.hom.app ⊤ z := + (moduleSectionEquiv Q).apply_symm_apply _ + have ht : Q.presheaf.map (homOfLE (show D ≤ ⊤ from le_top)).op + (e.hom.app ⊤ z) = t.app D (1 : Γ(X,D)) := + (congrArg (fun x : Γ(Q,⊤) => + Q.presheaf.map (homOfLE (show D ≤ ⊤ from le_top)).op x) htop).symm.trans + (section_value_natural t (homOfLE (show D ≤ ⊤ from le_top))) + have he := CategoryTheory.congr_fun + (e.hom.mapPresheaf.naturality (homOfLE (show D ≤ ⊤ from le_top)).op) z + change e.hom.app D (P.presheaf.map (homOfLE (show D ≤ ⊤ from le_top)).op z) = + Q.presheaf.map (homOfLE (show D ≤ ⊤ from le_top)).op (e.hom.app ⊤ z) at he + have hp := moduleTwistSection_unitIso_app L s n D f + calc + t.app D (1 : Γ(X,D)) = + Q.presheaf.map (homOfLE (show D ≤ ⊤ from le_top)).op (e.hom.app ⊤ z) := ht.symm + _ = e.hom.app D (P.presheaf.map (homOfLE (show D ≤ ⊤ from le_top)).op z) := he.symm + _ = e.hom.app D (((moduleTwistSection L s n).app (structureSheaf X)).app D f) := + congrArg (fun x => e.hom.app D x) hz + _ = (powerSection s n).app D f := hp + _ = f • (powerSection s n).app D (1 : Γ(X,D)) := by + have hm := (powerSection s n).app_smul (r := f) (x := (1 : Γ(X,D))) + change (powerSection s n).app D (show Γ(X,D) from f * 1) = _ at hm + exact (congrArg ((powerSection s n).app D) (mul_one f)).symm.trans hm + +theorem LineBundle.noetherian_power_extension_ratio [NoetherianSpace X] (L : LineBundle X) + (s : GlobalSections X L.sheaf) (f : Γ((sectionOpen X s).toScheme,⊤)) : + ∃ N : ℕ, ∀ n ≥ N, ∃ t : GlobalSections X (modulePow X L.sheaf n), + restrictSection (sectionOpen X s).ι t = scalarEnd f ≫ + restrictSection (sectionOpen X s).ι (powerSection s n) := by + obtain ⟨N, hN⟩ := L.noetherian_power_extension s ((sectionOpen X s).topIso.hom f) + refine ⟨N, fun n hn => ?_⟩ + obtain ⟨t, ht⟩ := hN n hn + refine ⟨t, ?_⟩ + apply (openSectionEquiv (modulePow X L.sheaf n) (sectionOpen X s)).injective + erw [openSectionEquiv_restrict, openSectionEquiv_scalar, openSectionEquiv_restrict] + exact ht + +end +end PiExponentSeshadri.Geometry + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/NumericalMarginRestriction.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/NumericalMarginRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3e3193468caf7b1408352a1f032c533bd3f3d35 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/NumericalMarginRestriction.lean @@ -0,0 +1,81 @@ +import OAI.NumberTheory.PiExponent.Ampleness.NumericalAmpleness +import OAI.NumberTheory.PiExponent.Approximation.LinePullback +import OAI.NumberTheory.PiExponent.Cohomology.CohomologyIso + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open CategoryTheory AlgebraicGeometry TopologicalSpace +open PiExponentSeshadri.Geometry + +def curveDegree {X : Scheme.{0}} (p : X ⟶ Spec (CommRingCat.of ℂ)) + (L : LineBundle X) (C : IntegralCurve X) : ℤ := + eulerCharacteristic (C.embedding ≫ p) 1 + ((Scheme.Modules.pullback C.embedding).obj L.sheaf) - + eulerCharacteristic (C.embedding ≫ p) 1 (structureSheaf C.scheme) + +def IntegralCurve.mapClosed {X Y : Scheme.{0}} (C : IntegralCurve Y) + (i : Y ⟶ X) [IsClosedImmersion i] : IntegralCurve X where + scheme := C.scheme + embedding := C.embedding ≫ i + closedImmersion := inferInstance + integral := C.integral + dimension := C.dimension + +theorem curveDegree_mapClosed {X Y : Scheme.{0}} (p : X ⟶ Spec (CommRingCat.of ℂ)) + (L : LineBundle X) (i : Y ⟶ X) [IsClosedImmersion i] (C : IntegralCurve Y) : + curveDegree p L (C.mapClosed i) = curveDegree (i ≫ p) (L.pullback i) C := by + unfold curveDegree IntegralCurve.mapClosed LineBundle.pullback + simp only [Category.assoc] + congr 1 + exact eulerCharacteristic_iso (C.embedding ≫ i ≫ p) + ((Scheme.Modules.pullbackComp C.embedding i).app L.sheaf).symm 1 + +theorem uniform_curve_margin_restrict {X Y : Scheme.{0}} + (p : X ⟶ Spec (CommRingCat.of ℂ)) (L H : LineBundle X) (ε : ℝ) + (hmargin : ∀ C : IntegralCurve X, + ε * (curveDegree p H C : ℝ) ≤ (curveDegree p L C : ℝ)) + (i : Y ⟶ X) [IsClosedImmersion i] : + ∀ C : IntegralCurve Y, + ε * (curveDegree (i ≫ p) (H.pullback i) C : ℝ) ≤ + (curveDegree (i ≫ p) (L.pullback i) C : ℝ) := by + intro C + simpa only [curveDegree_mapClosed] using hmargin (C.mapClosed i) + +theorem proper_closed_dimension_succ_le {X Y : Type*} + [TopologicalSpace X] [TopologicalSpace Y] [IrreducibleSpace X] [Nonempty Y] + (f : Y → X) (hf : Topology.IsClosedEmbedding f) + (hproper : Set.range f ≠ Set.univ) : + topologicalKrullDim Y + 1 ≤ topologicalKrullDim X := by + let T : IrreducibleCloseds X := ⟨Set.univ, IrreducibleSpace.isIrreducible_univ X, isClosed_univ⟩ + let g := IrreducibleCloseds.map f hf.continuous + have hg : StrictMono g := IrreducibleCloseds.map_strictMono_of_isInducing hf.isEmbedding.isInducing + have hlt (Z : IrreducibleCloseds Y) : g Z < T := by + apply lt_of_le_of_ne + · intro x hx; trivial + · intro he + apply hproper + apply Set.eq_univ_of_forall + intro x + have hx : x ∈ (g Z : Set X) := by rw [he]; trivial + exact closure_minimal (Set.image_subset_range f _) hf.isClosed_range hx + let k : WithTop (IrreducibleCloseds Y) → IrreducibleCloseds X := WithTop.recTopCoe T g + have hk : StrictMono k := WithTop.strictMono_iff.mpr ⟨hg, hlt⟩ + have : Nonempty (IrreducibleCloseds Y) := by + obtain ⟨y⟩ := ‹Nonempty Y› + exact ⟨⟨closure {y}, isIrreducible_singleton.closure, isClosed_closure⟩⟩ + have hh := Order.krullDim_le_of_strictMono k hk + simpa only [Order.krullDim_WithTop, topologicalKrullDim] using hh + +theorem proper_closed_subscheme_dimension_succ_le {X Y : Scheme.{0}} + [IsIntegral X] [Nonempty Y] (i : Y ⟶ X) [IsClosedImmersion i] + (hproper : ¬ Function.Surjective i) : + topologicalKrullDim Y + 1 ≤ topologicalKrullDim X := + proper_closed_dimension_succ_le i i.isClosedEmbedding + (fun h => hproper (Set.range_eq_univ.mp h)) + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/NumericalSlopeInduction.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/NumericalSlopeInduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..c359b644cc8d519f6f29713d63d7b5017a975136 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/NumericalSlopeInduction.lean @@ -0,0 +1,86 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleSlopeAlgebra +import OAI.NumberTheory.PiExponent.Ampleness.NakaiInductionStep + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} + +def LowerClosedNumericalCriterion (p : X ⟶ Spec (CommRingCat.of ℂ)) + (H : LineBundle X) (d : ℕ) : Prop := + ∀ (I : X.IdealSheafData), topologicalKrullDim I.subscheme ≤ d → + ∀ (M : LineBundle I.subscheme) (δ : ℝ), 0 < δ → + (∀ C : IntegralCurve I.subscheme, + δ * (curveDegree (I.subschemeι ≫ p) (H.pullback I.subschemeι) C : ℝ) ≤ + (curveDegree (I.subschemeι ≫ p) M C : ℝ)) → M.IsAmple + +theorem slope_lower_closed_ampleness + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (H L : LineBundle X) (hH : H.IsAmple) (d : ℕ) + (hlower : LowerClosedNumericalCriterion p H d) + (ε : ℝ) (hε : 0 < ε) + (hmargin : ∀ C : IntegralCurve X, + ε * (curveDegree p H C : ℝ) ≤ (curveDegree p L C : ℝ)) + (a b : ℕ) (hb : 0 < b) : + ∀ I : X.IdealSheafData, topologicalKrullDim I.subscheme ≤ d → + ((slopeBundle L H a b).pullback I.subschemeι).IsAmple := by + intro I hI + have hδ : (0:ℝ) < (b:ℝ)*ε+a := + add_pos_of_pos_of_nonneg (mul_pos (by exact_mod_cast hb) hε) (Nat.cast_nonneg a) + apply hlower I hI ((slopeBundle L H a b).pullback I.subschemeι) ((b:ℝ)*ε+a) hδ + exact uniform_curve_margin_restrict p (slopeBundle L H a b) H ((b:ℝ)*ε+a) + (uniform_margin_tensor_powers p H L hH ε hmargin a b) I.subschemeι + +theorem ample_slope_of_topEuler_pos_of_lower_criterion [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (r : ℕ) (i : X ⟶ ProjectiveO1.projectiveSpace ℂ (Fin (r+1))) [IsClosedImmersion i] + (hi : i ≫ polynomialProjectiveProjection ℂ (Fin (r+1)) = p) + (H L : LineBundle X) (hH : H.IsAmple) (d : ℕ) + (hdim : topologicalKrullDim X ≤ d+1) + (hlower : LowerClosedNumericalCriterion p H d) + (ε : ℝ) (hε : 0 < ε) + (hmargin : ∀ C : IntegralCurve X, + ε * (curveDegree p H C : ℝ) ≤ (curveDegree p L C : ℝ)) + (a b : ℕ) (hb : 0 < b) + (htop : 0 < (fwdDiff (1:ℕ))^[d+1] + (fun n => eulerCharacteristic p (d+1) ((slopeBundle L H a b).pow n).sheaf) 0) : + (slopeBundle L H a b).IsAmple := by + have hδ : (0:ℝ) < (b:ℝ)*ε+a := + add_pos_of_pos_of_nonneg (mul_pos (by exact_mod_cast hb) hε) (Nat.cast_nonneg a) + exact isAmple_of_lower_ampleness_of_topEuler_pos_of_margin p r i hi H + (slopeBundle L H a b) hH d hdim + (slope_lower_closed_ampleness p H L hH d hlower ε hε hmargin a b hb) + htop ((b:ℝ)*ε+a) hδ (uniform_margin_tensor_powers p H L hH ε hmargin a b) + +theorem ample_slope_of_polynomial_pos_of_lower_criterion [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (r : ℕ) (i : X ⟶ ProjectiveO1.projectiveSpace ℂ (Fin (r+1))) [IsClosedImmersion i] + (hi : i ≫ polynomialProjectiveProjection ℂ (Fin (r+1)) = p) + (H L : LineBundle X) (hH : H.IsAmple) (d : ℕ) + (hdim : topologicalKrullDim X ≤ d+1) + (hlower : LowerClosedNumericalCriterion p H d) + (ε : ℝ) (hε : 0 < ε) + (hmargin : ∀ C : IntegralCurve X, + ε * (curveDegree p H C : ℝ) ≤ (curveDegree p L C : ℝ)) + (P : Polynomial ℝ) + (hP : ∀ a b : ℕ, 0 < b → + (((fwdDiff (1:ℕ))^[d+1] + (fun n => eulerCharacteristic p (d+1) ((slopeBundle L H a b).pow n).sheaf) 0 : ℤ):ℝ) = + (b:ℝ)^(d+1) * P.eval ((a:ℝ)/b)) + (a b : ℕ) (hb : 0 < b) (hpos : 0 < P.eval ((a:ℝ)/b)) : + (slopeBundle L H a b).IsAmple := by + apply ample_slope_of_topEuler_pos_of_lower_criterion p r i hi H L hH d hdim hlower ε hε hmargin a b hb + have hreal : (0:ℝ) < + (((fwdDiff (1:ℕ))^[d+1] + (fun n => eulerCharacteristic p (d+1) ((slopeBundle L H a b).pow n).sheaf) 0 : ℤ):ℝ) := by + rw [hP a b hb] + exact mul_pos (pow_pos (by exact_mod_cast hb) _) hpos + exact_mod_cast hreal + +end +end PiExponent.NumericalAmpleness + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/NumericalThresholdStep.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/NumericalThresholdStep.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd09be6f4298f6ffb2f76a9031fa5afb67f0eb54 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/NumericalThresholdStep.lean @@ -0,0 +1,76 @@ +import OAI.NumberTheory.PiExponent.Ampleness.AmpleSlopeTopology +import OAI.NumberTheory.PiExponent.Ampleness.AmpleThresholdPolynomial +import OAI.NumberTheory.PiExponent.Approximation.NumericalSlopeInduction + +namespace OAI + +namespace PiExponent.NumericalAmpleness +noncomputable section +open AlgebraicGeometry CategoryTheory TopologicalSpace +open PiExponentSeshadri.Geometry +variable {X : Scheme.{0}} + +theorem isAmple_of_lower_criterion_of_euler_slope_polynomial [IsIntegral X] + (p : X ⟶ Spec (CommRingCat.of ℂ)) [IsProper p] + (r : ℕ) (i : X ⟶ ProjectiveO1.projectiveSpace ℂ (Fin (r+1))) [IsClosedImmersion i] + (hi : i ≫ polynomialProjectiveProjection ℂ (Fin (r+1)) = p) + (H L : LineBundle X) (hH : H.IsAmple) (d : ℕ) + (hdim : topologicalKrullDim X ≤ d+1) + (hlower : LowerClosedNumericalCriterion p H d) + (ε : ℝ) (hε : 0 < ε) + (hmargin : ∀ C : IntegralCurve X, + ε * (curveDegree p H C : ℝ) ≤ (curveDegree p L C : ℝ)) + (P : Polynomial ℝ) + (hP : ∀ a b : ℕ, 0 < b → + (((fwdDiff (1:ℕ))^[d+1] + (fun n => eulerCharacteristic p (d+1) ((slopeBundle L H a b).pow n).sheaf) 0 : ℤ):ℝ) = + (b:ℝ)^(d+1) * P.eval ((a:ℝ)/b)) + (hPample : ∀ a b : ℕ, 0 < b → (slopeBundle L H a b).IsAmple → + 0 < P.eval ((a:ℝ)/b)) + (hPderivative : ∀ a b : ℕ, 0 < b → (slopeBundle L H a b).IsAmple → + ((a:ℝ)/b+ε) * P.derivative.eval ((a:ℝ)/b) ≤ + ((d+1:ℕ):ℝ) * P.eval ((a:ℝ)/b)) : L.IsAmple := by + let : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace p + let t := ampleThreshold L H + have ht : 0 ≤ t := ampleThreshold_nonneg L H hH + have hrat (q : ℚ) (hq : t < (q:ℝ)) : ∃ a b : ℕ, 0 < b ∧ + (q:ℝ) = (a:ℝ)/b ∧ (slopeBundle L H a b).IsAmple := by + have hqnonneg : (0:ℚ) ≤ q := by exact_mod_cast (ht.trans hq.le) + obtain ⟨a,b,hb,hab⟩ := nonnegative_rat_nat_ratio q hqnonneg + exact ⟨a,b,hb,hab,ample_of_threshold_lt L H hH a b hb (hab ▸ hq)⟩ + have hpositive : ∀ q : ℚ, t < (q:ℝ) → 0 < P.eval (q:ℝ) := by + intro q hq + obtain ⟨a,b,hb,hab,hamp⟩ := hrat q hq + rw [hab] + exact hPample a b hb hamp + have hderivative : ∀ q : ℚ, t < (q:ℝ) → + ((q:ℝ)+ε) * P.derivative.eval (q:ℝ) ≤ ((d+1:ℕ):ℝ)*P.eval (q:ℝ) := by + intro q hq + obtain ⟨a,b,hb,hab,hamp⟩ := hrat q hq + rw [hab] + exact hPderivative a b hb hamp + have hPt : 0 < P.eval t := + polynomial_pos_at_boundary_of_rational_margin P (d+1) t ε ht hε hpositive hderivative + by_cases htzero : t = 0 + · have hpzero : 0 < P.eval ((0:ℝ)/1) := by simpa only [htzero,zero_div] using hPt + exact (slope_zero_isAmple_iff L H 1 (by decide)).mp + (ample_slope_of_polynomial_pos_of_lower_criterion p r i hi H L hH d hdim hlower ε hε + hmargin P hP 0 1 (by decide) (by simpa using hpzero)) + · have htpos : 0 < t := lt_of_le_of_ne ht (Ne.symm htzero) + obtain ⟨q,hq0,hqt,hPq⟩ := exists_positive_rational_below_of_polynomial_pos P t htpos hPt + have hqnonneg : (0:ℚ) ≤ q := by exact_mod_cast hq0.le + obtain ⟨a,b,hb,hab⟩ := nonnegative_rat_nat_ratio q hqnonneg + have ha : 0 < a := by + have hnum : (0:ℝ) < a := + (div_pos_iff_of_pos_right (by exact_mod_cast hb : (0:ℝ) centers j i)) + (j l : J) (hj : ∀ p ∈ P, MvPolynomial.eval (centers j) p = 0) + (hl : ∀ p ∈ P, MvPolynomial.eval (centers l) p = 0) : j = l := by + obtain ⟨i, c, hc⟩ := coordinate_constant_of_persistent_comparison + w cost M delta hcost hdelta f hf d P hP hheight hvanish hcomparison hseparated + have hjc := hj _ hc + have hlc := hl _ hc + simp only [MvPolynomial.eval_sub, MvPolynomial.eval_X, MvPolynomial.eval_C, sub_eq_zero] at hjc hlc + exact hinj i (hjc.trans hlc.symm) + +end PiExponent.OrdinaryComponentRigidity +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/OrdinarySliceComparison.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/OrdinarySliceComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..69d3e1e6fe69964f612c01c01106d3f9605a5bf1 --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/OrdinarySliceComparison.lean @@ -0,0 +1,57 @@ +import OAI.NumberTheory.PiExponent.Jets.NormalBasisProducts +import OAI.NumberTheory.PiExponent.LocalAlgebra.OrdinaryMultiplicity +import OAI.NumberTheory.PiExponent.LocalAlgebra.PrimeWeightedBezout + +namespace OAI + +noncomputable section +namespace PiExponent.OrdinarySliceComparison + +open scoped BigOperators +open NormalBasisRigidity NormalBasisProducts TransverseWeightedMultiplicity +open OrdinaryDerivatives DerivativeIdeals + +theorem comparison_of_normal_basis {n : ℕ} + (Q : Ideal (OrdinaryDerivatives.Polynomial n)) [Q.IsPrime] + (A : Finset (Fin n)) (hk : 0 < A.card) + (hA : IsNormalBasis (K := Q.ResidueField) + (fun i => (polynomialTangent (primeResidueMap Q) Q).mkQ + (Pi.basisFun Q.ResidueField _ i)) A) + (B : Fin A.card → Fin n) + (hB : LinearIndependent Q.ResidueField + (fun j => (polynomialTangent (primeResidueMap Q) Q).mkQ + (Pi.basisFun Q.ResidueField _ (B j)))) + {J : Type*} (f : J → OrdinaryDerivatives.Polynomial n) + (hQ : Q ∈ (Ideal.span (Set.range f)).minimalPrimes) + (rho : Fin n → ℚ) (hrho : ∀ i, 0 < rho i) + (cost : Fin n → ℝ) (hcost : ∀ i, 0 < cost i) + (epsilon N : ℝ) (hepsilon : 0 < epsilon) (hN : 0 < N) + (hdegree : ∀ j, ∀ d ∈ (f j).support, + (∑ i ∈ d.support, (d i : ℝ) * (rho i : ℝ)) ≤ N) + (hn : ∀ i, 2 ≤ rectangularCutoff (fun j => cost (B j)) (epsilon * N) i) + (hvanish : ∀ p ∈ Ideal.span (Set.range f), ∀ l : List (Fin n), + wordCost cost l ≤ epsilon * N → OrdinaryDerivatives.word n l p ∈ Q) : + (∏ i ∈ A, (rho i : ℝ)) ≤ + (A.card : ℝ) ^ A.card * (∏ i, cost (B i)) / epsilon ^ A.card := by + obtain ⟨L, hL, hupper⟩ := PrimeWeightedBezout.weighted_prime_length_bound + Q A hA f hQ rho hrho N hN.le hdegree + have hlower := OrdinaryMultiplicity.prime_rectangular_length_lower n A.card Q B hB + (Ideal.span (Set.range f)) cost + (rectangularCutoff (fun j => cost (B j)) (epsilon * N)) (epsilon * N) hn + (fun i => (hcost i).le) + (rectangularCutoff_budget hk (fun j => cost (B j)) (fun j => hcost _) + (epsilon * N) (mul_pos hepsilon hN)) hvanish + change (∏ i, rectangularCutoff (fun j => cost (B j)) (epsilon * N) i : ℕ) ≤ + CoordinateSliceComparison.primeLength Q (Ideal.span (Set.range f)) at hlower + rw [hL] at hlower + have hrhoR (i : Fin n) : (0 : ℝ) < rho i := by exact_mod_cast hrho i + have h := weight_comparison_of_rectangular_count hk + (fun i => (rho (A.equivFin.symm i) : ℝ)) (fun j => cost (B j)) epsilon N L + (fun i => hrhoR _) (fun j => hcost _) hepsilon hN (by exact_mod_cast hlower) + (by simpa only [prod_equivFin A (fun i => (rho i : ℝ))] using hupper) + simpa only [prod_equivFin A (fun i => (rho i : ℝ))] using h + +end PiExponent.OrdinarySliceComparison +end + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/Parameters.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/Parameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..9d024fd8b4ca090140172436a783d5db2cf701ec --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/Parameters.lean @@ -0,0 +1,150 @@ +import Mathlib + +namespace OAI + +namespace PiExponent + +theorem exists_rational_parameters (ν : ℝ) (hν : 2 < ν) : + ∃ θ A B C : ℚ, + 0 < (θ : ℝ) ∧ (θ : ℝ) < A ∧ (A : ℝ) < B ∧ (B : ℝ) < 1 ∧ + ν * ((A : ℝ) - θ) > 1 - θ ∧ + 1 < (C : ℝ) ∧ (B : ℝ) < 1 / C ∧ + (B : ℝ) < C * θ ∧ (C : ℝ) * θ < 1 := by + have hνpos : 0 < ν := by linarith + have hdiv : 1 / ν < (1 / 2 : ℝ) := + (div_lt_iff₀ hνpos).2 (by linarith) + obtain ⟨b, hbl, hbu⟩ := exists_rat_btwn (show (1 / 2 : ℝ) < 1 - 1 / ν by linarith) + have hbpos : 0 < (b : ℝ) := by linarith + have hb1 : (b : ℝ) < 1 := by + have := one_div_pos.mpr hνpos + linarith + have hνb : ν * (b : ℝ) < ν - 1 := calc + _ < ν * (1 - 1 / ν) := mul_lt_mul_of_pos_left hbu hνpos + _ = ν - 1 := by field_simp + have hcoeff : 0 < ν * (1 - (b : ℝ)) - 1 := by nlinarith + have hδtop : 0 < min (1 : ℝ) ((2 * (b : ℝ) - 1) / ((b : ℝ) * b)) := + lt_min (by norm_num) (div_pos (by linarith) (mul_pos hbpos hbpos)) + obtain ⟨δ, hδpos, hδtop⟩ := exists_rat_btwn hδtop + have hδ1 : (δ : ℝ) < 1 := lt_of_lt_of_le hδtop (min_le_left _ _) + have hδsmall : (δ : ℝ) < (2 * (b : ℝ) - 1) / ((b : ℝ) * b) := + lt_of_lt_of_le hδtop (min_le_right _ _) + have hδprod : (δ : ℝ) * ((b : ℝ) * b) < 2 * (b : ℝ) - 1 := + (lt_div_iff₀ (mul_pos hbpos hbpos)).mp hδsmall + let θ : ℚ := 1 - δ + let A : ℚ := 1 - b * δ + have hθcast : (θ : ℝ) = 1 - (δ : ℝ) := by simp [θ] + have hAcast : (A : ℝ) = 1 - (b : ℝ) * δ := by simp [A] + have hθpos : 0 < (θ : ℝ) := by rw [hθcast]; linarith + have hθA : (θ : ℝ) < A := by + rw [hθcast, hAcast] + nlinarith [mul_pos (sub_pos.mpr hb1) hδpos] + have hApos : 0 < (A : ℝ) := lt_trans hθpos hθA + have hA1 : (A : ℝ) < 1 := by + rw [hAcast] + nlinarith [mul_pos hbpos hδpos] + have hAsq : (A : ℝ) ^ 2 < θ := by + rw [hAcast, hθcast] + nlinarith [mul_pos hδpos (sub_pos.mpr hδprod)] + have hgap : 1 - (θ : ℝ) < ν * ((A : ℝ) - θ) := by + rw [hAcast, hθcast] + nlinarith [mul_pos hcoeff hδpos] + have hCinterval : (A : ℝ) / θ < 1 / A := by + apply (div_lt_div_iff₀ hθpos hApos).2 + nlinarith + obtain ⟨C, hClo, hChi⟩ := exists_rat_btwn hCinterval + have hC1 : 1 < (C : ℝ) := by + have : (1 : ℝ) < (A : ℝ) / θ := (lt_div_iff₀ hθpos).2 (by simpa using hθA) + exact lt_trans this hClo + have hCpos : 0 < (C : ℝ) := by linarith + have hACθ : (A : ℝ) < (C : ℝ) * θ := (div_lt_iff₀ hθpos).mp hClo + have hCA : (C : ℝ) * A < 1 := (lt_div_iff₀ hApos).mp hChi + have hAinvC : (A : ℝ) < 1 / C := (lt_div_iff₀ hCpos).2 (by nlinarith) + have hCθ1 : (C : ℝ) * θ < 1 := by nlinarith [mul_lt_mul_of_pos_left hθA hCpos] + have hBinterval : (A : ℝ) < min (1 / (C : ℝ)) ((C : ℝ) * θ) := + lt_min hAinvC hACθ + obtain ⟨B, hBlo, hBhi⟩ := exists_rat_btwn hBinterval + have hBinv : (B : ℝ) < 1 / C := lt_of_lt_of_le hBhi (min_le_left _ _) + have hBCθ : (B : ℝ) < (C : ℝ) * θ := lt_of_lt_of_le hBhi (min_le_right _ _) + exact ⟨θ, A, B, C, hθpos, hθA, hBlo, lt_trans hBCθ hCθ1, + hgap, hC1, hBinv, hBCθ, hCθ1⟩ + +theorem exists_eta_preserving_exponent_gap + (nu theta A : ℝ) (hnu : 2 < nu) (hA : 0 < A) + (hgap : 1 - theta < nu * (A - theta)) : + ∃ eta : ℝ, 0 < eta ∧ eta < 1 ∧ + 0 < nu * (A * (1 - eta) - theta) - (1 - theta) := by + let gap : ℝ := nu * (A - theta) - (1 - theta) + have hgap_pos : 0 < gap := by dsimp [gap]; linarith + have hnu_pos : 0 < nu := by linarith + have hden_pos : 0 < 2 * nu * A := by positivity + let eta : ℝ := min (1 / 2) (gap / (2 * nu * A)) + have heta_pos : 0 < eta := by + dsimp [eta] + exact lt_min (by norm_num) (div_pos hgap_pos hden_pos) + have heta_half : eta ≤ 1 / 2 := min_le_left _ _ + have heta_lt_one : eta < 1 := by linarith + have heta_gap : eta ≤ gap / (2 * nu * A) := min_le_right _ _ + have hscaled : eta * (2 * nu * A) ≤ gap := + (le_div_iff₀ hden_pos).mp heta_gap + refine ⟨eta, heta_pos, heta_lt_one, ?_⟩ + dsimp [gap] at hgap_pos hscaled + nlinarith + +structure Parameters (ν : ℝ) where + theta : ℚ + A : ℚ + B : ℚ + C : ℚ + eta : ℝ + theta_pos : 0 < (theta : ℝ) + theta_lt_A : (theta : ℝ) < A + A_lt_B : (A : ℝ) < B + B_lt_one : (B : ℝ) < 1 + approximation_gap : 1 - (theta : ℝ) < ν * ((A : ℝ) - theta) + one_lt_C : 1 < (C : ℝ) + B_lt_inv_C : (B : ℝ) < 1 / C + B_lt_C_theta : (B : ℝ) < (C : ℝ) * theta + C_theta_lt_one : (C : ℝ) * theta < 1 + eta_pos : 0 < eta + eta_lt_one : eta < 1 + gap_pos : 0 < ν * ((A : ℝ) * (1 - eta) - theta) - (1 - theta) + +theorem exists_parameters (ν : ℝ) (hν : 2 < ν) : Nonempty (Parameters ν) := by + obtain ⟨theta, A, B, C, htheta, hthetaA, hAB, hB, hgap, hC, hBinv, hBC, hCtheta⟩ := + exists_rational_parameters ν hν + obtain ⟨eta, heta, heta1, hgapeta⟩ := exists_eta_preserving_exponent_gap + ν theta A hν (lt_trans htheta hthetaA) hgap + exact ⟨⟨theta, A, B, C, eta, htheta, hthetaA, hAB, hB, hgap, hC, + hBinv, hBC, hCtheta, heta, heta1, hgapeta⟩⟩ + +namespace Parameters + +variable {ν : ℝ} (p : Parameters ν) + +theorem A_pos : 0 < (p.A : ℝ) := lt_trans p.theta_pos p.theta_lt_A + +theorem B_pos : 0 < (p.B : ℝ) := lt_trans p.A_pos p.A_lt_B + +theorem C_pos : 0 < (p.C : ℝ) := lt_trans zero_lt_one p.one_lt_C + +theorem A_lt_one : (p.A : ℝ) < 1 := lt_trans p.A_lt_B p.B_lt_one + +theorem theta_lt_one : (p.theta : ℝ) < 1 := lt_trans p.theta_lt_A p.A_lt_one + +theorem CB_lt_one : (p.C : ℝ) * p.B < 1 := by + have h := (lt_div_iff₀ p.C_pos).mp p.B_lt_inv_C + simpa only [mul_comm] using h + +theorem one_lt_C_theta_div_B : 1 < (p.C : ℝ) * p.theta / p.B := by + apply (lt_div_iff₀ p.B_pos).2 + simpa using p.B_lt_C_theta + +theorem one_lt_B_div_A : 1 < (p.B : ℝ) / p.A := by + apply (lt_div_iff₀ p.A_pos).2 + simpa using p.A_lt_B + +end Parameters + +end PiExponent + +end OAI diff --git a/lean/OAI/NumberTheory/PiExponent/Approximation/PersistentComponents.lean b/lean/OAI/NumberTheory/PiExponent/Approximation/PersistentComponents.lean new file mode 100644 index 0000000000000000000000000000000000000000..534f37872aa5195e16952df7623050e90ef7610c --- /dev/null +++ b/lean/OAI/NumberTheory/PiExponent/Approximation/PersistentComponents.lean @@ -0,0 +1,154 @@ +import Mathlib + +namespace OAI + +namespace PiExponent.PersistentComponents + +variable {R : Type*} [CommRing R] + +theorem prime_height_step {P Q : Ideal R} (hP : P.IsPrime) (hQ : Q.IsPrime) + (hPQ : P < Q) : P.height + 1 ≤ Q.height := by + let := hP + let := hQ + exact Ideal.height_add_one_le_of_lt_of_isPrime hPQ + +theorem exists_adjacent_eq_of_height_bound (P : ℕ → Ideal R) (m : ℕ) + (hPrime : ∀ i ≤ m + 1, (P i).IsPrime) + (hstep : ∀ i ≤ m, P i ≤ P (i + 1)) + (hheight : (P (m + 1)).height ≤ m) : + ∃ i ≤ m, P i = P (i + 1) := by + by_contra h + have hneq : ∀ i ≤ m, P i ≠ P (i + 1) := by simpa only [not_exists, not_and] using h + have hgrowth : ∀ i ≤ m + 1, (i : ℕ∞) ≤ (P i).height := by + intro i hi + induction i with + | zero => exact bot_le + | succ i ih => + have him : i ≤ m := by omega + have hip : i ≤ m + 1 := by omega + have hs := prime_height_step (hPrime i hip) (hPrime (i + 1) hi) + (lt_of_le_of_ne (hstep i him) (hneq i him)) + have hadd : (i : ℕ∞) + 1 ≤ (P i).height + 1 := by + gcongr + exact ih hip + simpa only [Nat.cast_add, Nat.cast_one] using hadd.trans hs + have hf := (hgrowth (m + 1) le_rfl).trans hheight + exact (by exact_mod_cast (Nat.not_succ_le_self m) : ¬ ((m + 1 : ℕ) : ℕ∞) ≤ (m : ℕ∞)) hf + +theorem exists_nested_minimalPrimes (I : ℕ → Ideal R) (hI : Monotone I) + (n : ℕ) (P : Ideal R) (hP : P.IsPrime) (hIP : I n ≤ P) : + ∃ Q : ℕ → Ideal R, + (∀ i ≤ n, Q i ∈ (I i).minimalPrimes) ∧ + (∀ i < n, Q i ≤ Q (i + 1)) ∧ Q n ≤ P := by + induction n generalizing P with + | zero => + let := hP + obtain ⟨Q, hQ, hQP⟩ := Ideal.exists_minimalPrimes_le hIP + refine ⟨fun _ => Q, ?_, ?_, hQP⟩ + · intro i hi + have hi0 : i = 0 := by omega + simpa only [hi0] using hQ + · intro i hi + omega + | succ n ih => + let := hP + obtain ⟨Qlast, hQlast, hQlastP⟩ := Ideal.exists_minimalPrimes_le hIP + obtain ⟨Q, hQ, hstep, hQlastle⟩ := + ih Qlast hQlast.isPrime ((hI (Nat.le_succ n)).trans hQlast.le) + refine ⟨fun i => if i = n + 1 then Qlast else Q i, ?_, ?_, ?_⟩ + · intro i hi + by_cases hei : i = n + 1 + · simpa [hei] using hQlast + · simpa [hei] using hQ i (by omega) + · intro i hi + have hin : i ≠ n + 1 := by omega + by_cases hei : i = n + · simpa [hei] using hQlastle + · have hip : i + 1 ≠ n + 1 := by omega + simpa [hin, hip, hei] using hstep i (by omega) + · simpa [Nat.succ_eq_add_one] using hQlastP + +theorem exists_persistent_minimalPrime (I : ℕ → Ideal R) (hI : Monotone I) + (m : ℕ) (P : Ideal R) (hP : P.IsPrime) + (hIP : I (m + 2) ≤ P) (hheight : P.height ≤ m) : + ∃ r < m + 2, ∃ Q : Ideal R, + Q ∈ (I r).minimalPrimes ∧ I (r + 1) ≤ Q ∧ Q ≤ P := by + obtain ⟨Q, hQ, hstep, hQP⟩ := exists_nested_minimalPrimes I hI (m + 2) P hP hIP + have hmono : ∀ i j, i ≤ j → j ≤ m + 2 → Q i ≤ Q j := by + intro i j hij hj + induction j with + | zero => + have hi : i = 0 := by omega + simp only [hi, le_refl] + | succ j ih => + by_cases heq : i = j + 1 + · simp [heq] + · exact (ih (by omega) (by omega)).trans (hstep j (by omega)) + have hbound : (Q (m + 1)).height ≤ m := + (Ideal.height_mono ((hmono (m + 1) (m + 2) (by omega) le_rfl).trans hQP)).trans hheight + obtain ⟨r, hr, heq⟩ := exists_adjacent_eq_of_height_bound Q m + (fun i hi => (hQ i (by omega)).isPrime) (fun i hi => hstep i (by omega)) hbound + refine ⟨r, by omega, Q r, hQ r (by omega), ?_, ?_⟩ + · rw [heq] + exact (hQ (r + 1) (by omega)).le + · exact (hmono r (m + 2) (by omega) le_rfl).trans hQP + +theorem minimalPrime_persists {I J Q : Ideal R} (hIJ : I ≤ J) + (hQ : Q ∈ I.minimalPrimes) (hJQ : J ≤ Q) : Q ∈ J.minimalPrimes := by + refine ⟨⟨hQ.isPrime, hJQ⟩, ?_⟩ + intro P hP hPQ + exact hQ.2 ⟨hP.1, hIJ.trans hP.2⟩ hPQ + +theorem exists_persistent_minimalPrime_pair (I : ℕ → Ideal R) (hI : Monotone I) + (m : ℕ) (P : Ideal R) (hP : P.IsPrime) + (hIP : I (m + 2) ≤ P) (hheight : P.height ≤ m) : + ∃ r < m + 2, ∃ Q : Ideal R, + Q ∈ (I r).minimalPrimes ∧ Q ∈ (I (r + 1)).minimalPrimes ∧ Q ≤ P := by + obtain ⟨r, hr, Q, hQ, hnext, hQP⟩ := + exists_persistent_minimalPrime I hI m P hP hIP hheight + exact ⟨r, hr, Q, hQ, minimalPrime_persists (hI (Nat.le_succ r)) hQ hnext, hQP⟩ + +theorem minimalPrime_gives_irreducibleComponent (I Q : Ideal R) (hQ : Q ∈ I.minimalPrimes) : + ∃ Z : Set (PrimeSpectrum.zeroLocus (I : Set R)), + Z ∈ irreducibleComponents (PrimeSpectrum.zeroLocus (I : Set R)) := by + exact ⟨((Ideal.minimalPrimes.equivIrreducibleComponents I) ⟨Q, hQ⟩).val, + ((Ideal.minimalPrimes.equivIrreducibleComponents I) ⟨Q, hQ⟩).property⟩ + +theorem exists_persistent_operation_component (I : ℕ → Ideal R) (hI : Monotone I) + (m : ℕ) (P : Ideal R) (hP : P.IsPrime) + (hIP : I (m + 2) ≤ P) (hheight : P.height ≤ m) + {D : Type*} (op : D → R → R) (Allowed : ℕ → D → Prop) + (hshift : ∀ r d, Allowed r d → ∀ f ∈ I r, op d f ∈ I (r + 1)) : + ∃ r < m + 2, ∃ Q : Ideal R, + Q ∈ (I r).minimalPrimes ∧ Q ∈ (I (r + 1)).minimalPrimes ∧ Q ≤ P ∧ + ∀ d, Allowed r d → ∀ f ∈ I r, op d f ∈ Q := by + obtain ⟨r, hr, Q, hQr, hQnext, hQP⟩ := + exists_persistent_minimalPrime_pair I hI m P hP hIP hheight + exact ⟨r, hr, Q, hQr, hQnext, hQP, fun d hd f hf => hQnext.le (hshift r d hd f hf)⟩ + +theorem minimalPrime_height_pos_of_nonzero_mem [IsDomain R] {I Q : Ideal R} + (hQ : Q ∈ I.minimalPrimes) {F : R} (hF : F ≠ 0) (hFI : F ∈ I) : + 1 ≤ Q.height := by + have hQbot : Q ≠ ⊥ := by + intro h + have hFQ := hQ.le hFI + simp only [h, Ideal.mem_bot] at hFQ + exact hF hFQ + exact Order.one_le_iff_ne_zero.mpr (mt Ideal.height_eq_zero_iff_eq_bot.mp hQbot) + +theorem exists_persistent_component_positive_height [IsDomain R] + (I : ℕ → Ideal R) (hI : Monotone I) (m : ℕ) (P : Ideal R) (hP : P.IsPrime) + (hIP : I (m + 2) ≤ P) (hheight : P.height ≤ m) + {F : R} (hF : F ≠ 0) (hFI : F ∈ I 0) : + ∃ r < m + 2, ∃ Q : Ideal R, + Q ∈ (I r).minimalPrimes ∧ Q ∈ (I (r + 1)).minimalPrimes ∧ Q ≤ P ∧ + 1 ≤ Q.height ∧ Q.height ≤ m := by + obtain ⟨r, hr, Q, hQr, hQnext, hQP⟩ := + exists_persistent_minimalPrime_pair I hI m P hP hIP hheight + exact ⟨r, hr, Q, hQr, hQnext, hQP, + minimalPrime_height_pos_of_nonzero_mem hQr hF ((hI (Nat.zero_le r)) hFI), + (Ideal.height_mono hQP).trans hheight⟩ + +end PiExponent.PersistentComponents + +end OAI