Download lean/OAI/NumberTheory/CubicGram/CubicOperator.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 20.7 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/NumberTheory/CubicGram/CubicOperator.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/NumberTheory/CubicGram/CubicOperator.lean
-
curl -L -o CubicOperator.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/NumberTheory/CubicGram/CubicOperator.lean
20.7 kB
| import Mathlib | |
| import OAI.NumberTheory.CubicGram.CommonFactors | |
| namespace OAI | |
| /-! Finite cubic sieve operators, bilinear norms and coprime completion. -/ | |
| section | |
| noncomputable section | |
| open scoped BigOperators ContDiff | |
| open Set Filter MeasureTheory Topology | |
| attribute [local instance] Classical.propDecidable | |
| namespace CubicFirstMoment | |
| def primarySmoothedSieveMass (S : Finset Eisenstein) (u : Eisenstein → ℂ) | |
| (W : ℝ → ℂ) (M : ℝ) : ℂ := | |
| ∑' x : Eisenstein, if primary x then | |
| W (norm x / M) * (‖∑ n ∈ S, u n * cubicSymbol n x‖^2 : ℝ) else 0 | |
| lemma primarySmoothedSieveMass_gram (S : Finset Eisenstein) | |
| (hS : ∀ n ∈ S, primary n) (u : Eisenstein → ℂ) | |
| (W : ℝ → ℂ) (hW : HasCompactSupport W) (hW' : ContDiff ℝ ∞ W) | |
| {M : ℝ} (hM : 0 < M) : | |
| primarySmoothedSieveMass S u W M = | |
| ∑ a ∈ S, ∑ b ∈ S, u a * star (u b) * primaryCharacterGram a b W M := by | |
| let F (a b x : Eisenstein) : ℂ := u a * star (u b) * | |
| (if primary x then W (norm x / M) * cubicSymbol a x * star (cubicSymbol b x) else 0) | |
| have hF (a : Eisenstein) (ha : a ∈ S) (b : Eisenstein) (hb : b ∈ S) : | |
| Summable (F a b) := by | |
| apply Summable.mul_left | |
| simpa only [and_true] using | |
| summable_gram_restricted (hS a ha) (hS b hb) W hW hW' hM (fun _ => True) | |
| have hpoint (x : Eisenstein) : | |
| (if primary x then W (norm x / M) * | |
| (‖∑ n ∈ S, u n * cubicSymbol n x‖^2 : ℝ) else 0) = | |
| ∑ a ∈ S, ∑ b ∈ S, F a b x := by | |
| by_cases hx : primary x | |
| · simp only [ite_eq_left hx, ← Complex.normSq_eq_norm_sq, ← Complex.mul_conj, | |
| map_sum, map_mul, F] | |
| simp_rw [Finset.sum_mul, Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro a ha | |
| apply Finset.sum_congr rfl | |
| intro b hb | |
| simp only [starRingEnd_apply] | |
| ring | |
| · simp [hx, F] | |
| unfold primarySmoothedSieveMass | |
| simp_rw [hpoint] | |
| rw [Summable.tsum_finsetSum (fun a ha => summable_sum (fun b hb => hF a ha b hb))] | |
| apply Finset.sum_congr rfl | |
| intro a ha | |
| rw [Summable.tsum_finsetSum (hF a ha)] | |
| apply Finset.sum_congr rfl | |
| intro b hb | |
| exact tsum_mul_left | |
| end CubicFirstMoment | |
| open UniqueFactorizationMonoid | |
| namespace CubicFirstMoment | |
| lemma primaryPrime_mem_factors {n p : Eisenstein} (hn : primary n) | |
| (hp : primaryPrime p) (hd : p ∣ n) : p ∈ primaryPrimeFactors n := by | |
| obtain ⟨q,hq,hpq⟩ := exists_mem_normalizedFactors_of_dvd | |
| (primary_ne_zero hn) hp.2.irreducible hd | |
| apply Finset.mem_image.mpr | |
| refine ⟨q, Multiset.mem_toFinset.mpr hq, ?_⟩ | |
| apply primary_associated_eq | |
| (primaryNormalize_primary (unit_residue_of_dvd_primary hn (dvd_of_mem_normalizedFactors hq))) hp.1 | |
| exact (primaryNormalize_associated q).symm.trans hpq.symm | |
| lemma primaryPrime_mem_factors_iff {n p : Eisenstein} (hn : primary n) : | |
| p ∈ primaryPrimeFactors n ↔ primaryPrime p ∧ p ∣ n := | |
| ⟨primaryPrimeFactor_spec hn, fun h => primaryPrime_mem_factors hn h.1 h.2⟩ | |
| lemma primeSet_subset_factors_of_prod_dvd {n : Eisenstein} (hn : primary n) | |
| {s : Finset Eisenstein} (hs : ∀ p ∈ s, primaryPrime p) | |
| (hd : (∏ p ∈ s, p) ∣ n) : s ⊆ primaryPrimeFactors n := by | |
| intro p hp | |
| exact primaryPrime_mem_factors hn (hs p hp) | |
| ((Finset.dvd_prod_of_mem (fun p : Eisenstein => p) hp).trans hd) | |
| lemma primary_moebius_universal_indicator {U : Finset Eisenstein} | |
| (hU : ∀ p ∈ U, primaryPrime p) {a b : Eisenstein} | |
| (ha : primary a) (hsa : Squarefree a) (haU : primaryPrimeFactors a ⊆ U) : | |
| (if IsCoprime a b then (1 : ℂ) else 0) = | |
| ∑ s ∈ U.powerset, (idealMoebius (∏ p ∈ s, p) : ℂ) * | |
| (if (∏ p ∈ s, p) ∣ a ∧ (∏ p ∈ s, p) ∣ b then (1 : ℂ) else 0) := by | |
| rw [primary_moebius_coprimality ha hsa] | |
| calc | |
| _ = ∑ s ∈ (primaryPrimeFactors a).powerset, | |
| (idealMoebius (∏ p ∈ s, p) : ℂ) * | |
| (if (∏ p ∈ s, p) ∣ a ∧ (∏ p ∈ s, p) ∣ b then (1 : ℂ) else 0) := by | |
| apply Finset.sum_congr rfl | |
| intro s hs | |
| have hd : (∏ p ∈ s, p) ∣ a := | |
| (primary_subsets_prod_dvd ha (Finset.mem_powerset.mp hs) a).mpr | |
| (fun p hp => (primaryPrimeFactor_spec ha (Finset.mem_powerset.mp hs hp)).2) | |
| simp only [hd, true_and] | |
| _ = _ := by | |
| apply Finset.sum_subset (Finset.powerset_mono.mpr haU) | |
| intro s hs hn | |
| have hnd : ¬(∏ p ∈ s, p) ∣ a := by | |
| intro hd | |
| apply hn | |
| exact Finset.mem_powerset.mpr (primeSet_subset_factors_of_prod_dvd ha | |
| (fun p hp => hU p (Finset.mem_powerset.mp hs hp)) hd) | |
| simp [hnd] | |
| theorem coprime_bilinear_moebius (S T U : Finset Eisenstein) | |
| (hS : ∀ a ∈ S, primary a ∧ Squarefree a) | |
| (hU : ∀ p ∈ U, primaryPrime p) | |
| (hSU : ∀ a ∈ S, primaryPrimeFactors a ⊆ U) (v w : Eisenstein → ℂ) : | |
| (∑ a ∈ S, ∑ b ∈ T, if IsCoprime a b then v a * star (w b) else 0) = | |
| ∑ s ∈ U.powerset, (idealMoebius (∏ p ∈ s, p) : ℂ) * | |
| (∑ a ∈ S, if (∏ p ∈ s, p) ∣ a then v a else 0) * | |
| star (∑ b ∈ T, if (∏ p ∈ s, p) ∣ b then w b else 0) := by | |
| have hpoint (a : Eisenstein) (ha : a ∈ S) (b : Eisenstein) : | |
| (if IsCoprime a b then v a * star (w b) else 0) = | |
| ∑ s ∈ U.powerset, (idealMoebius (∏ p ∈ s, p) : ℂ) * | |
| ((if (∏ p ∈ s, p) ∣ a then v a else 0) * | |
| star (if (∏ p ∈ s, p) ∣ b then w b else 0)) := by | |
| have hi := congrArg (fun z : ℂ => z * (v a * star (w b))) | |
| (primary_moebius_universal_indicator hU (hS a ha).1 (hS a ha).2 (hSU a ha) | |
| (b := b)) | |
| rw [Finset.sum_mul] at hi | |
| convert hi using 1 | |
| · split_ifs <;> simp | |
| · apply Finset.sum_congr rfl | |
| intro s hs | |
| split_ifs <;> simp_all | |
| simp_rw [Finset.sum_congr rfl (fun a ha => Finset.sum_congr rfl | |
| (fun b _ => hpoint a ha b))] | |
| simp_rw [Finset.sum_comm (s := T) (t := U.powerset)] | |
| rw [Finset.sum_comm (s := S) (t := U.powerset)] | |
| apply Finset.sum_congr rfl | |
| intro s hs | |
| simp only [star_sum] | |
| simp only [Finset.sum_mul, Finset.mul_sum] | |
| rw [Finset.sum_comm (s := T) (t := S)] | |
| apply Finset.sum_congr rfl | |
| intro a ha | |
| apply Finset.sum_congr rfl | |
| intro b hb | |
| ring | |
| end CubicFirstMoment | |
| namespace CubicFirstMoment | |
| def finiteCubicOperator (S H : Finset Eisenstein) : | |
| EuclideanSpace ℂ S →L[ℂ] EuclideanSpace ℂ H := | |
| (Matrix.toEuclideanLin (fun (h : H) (a : S) => cubicSymbol a.val h.val)).toContinuousLinearMap | |
| def finiteCubicBound (S H : Finset Eisenstein) : ℝ := ‖finiteCubicOperator S H‖^2 | |
| lemma finiteCubicBound_nonneg (S H : Finset Eisenstein) : 0 ≤ finiteCubicBound S H := | |
| sq_nonneg _ | |
| lemma finiteCubicOperator_apply (S H : Finset Eisenstein) (u : Eisenstein → ℂ) | |
| (h : H) : | |
| finiteCubicOperator S H (WithLp.toLp 2 (fun a : S => u a.val)) h = | |
| ∑ a ∈ S, u a * cubicSymbol a h.val := by | |
| change (∑ a : S, cubicSymbol a.val h.val * u a.val) = _ | |
| rw [← Finset.sum_subtype S (fun _ => Iff.rfl) (fun a => cubicSymbol a h.val * u a)] | |
| apply Finset.sum_congr rfl | |
| intro a ha | |
| ring | |
| lemma finiteCubicBound_controls_mass (S H : Finset Eisenstein) (u : Eisenstein → ℂ) : | |
| (∑ h ∈ H, ‖∑ a ∈ S, u a * cubicSymbol a h‖^2) ≤ | |
| finiteCubicBound S H * ∑ a ∈ S, ‖u a‖^2 := by | |
| let v : EuclideanSpace ℂ S := WithLp.toLp 2 (fun a : S => u a.val) | |
| have hb := (finiteCubicOperator S H).le_opNorm v | |
| have hs := pow_le_pow_left₀ (_root_.norm_nonneg _) hb 2 | |
| rw [mul_pow, EuclideanSpace.norm_sq_eq, EuclideanSpace.norm_sq_eq] at hs | |
| change (∑ h : H, ‖finiteCubicOperator S H v h‖^2) ≤ | |
| finiteCubicBound S H * ∑ a : S, ‖u a.val‖^2 at hs | |
| dsimp only [v] at hs | |
| simp_rw [finiteCubicOperator_apply] at hs | |
| simpa only [← Finset.sum_subtype H (fun _ => Iff.rfl) | |
| (fun h => ‖∑ a ∈ S, u a * cubicSymbol a h‖^2), | |
| ← Finset.sum_subtype S (fun _ => Iff.rfl) (fun a => ‖u a‖^2)] using hs | |
| end CubicFirstMoment | |
| namespace CubicFirstMoment | |
| private def euclideanConj {ι : Type*} [Fintype ι] (v : EuclideanSpace ℂ ι) : | |
| EuclideanSpace ℂ ι := WithLp.toLp 2 (fun i => star (v i)) | |
| private lemma euclideanConj_norm {ι : Type*} [Fintype ι] (v : EuclideanSpace ℂ ι) : | |
| ‖euclideanConj v‖ = ‖v‖ := by | |
| apply (sq_eq_sq₀ (_root_.norm_nonneg _) (_root_.norm_nonneg _)).mp | |
| simp [EuclideanSpace.norm_sq_eq, euclideanConj] | |
| private def matrixHilbertOperator {ι κ : Type*} [Fintype ι] [Fintype κ] | |
| (A : Matrix ι κ ℂ) : EuclideanSpace ℂ κ →L[ℂ] EuclideanSpace ℂ ι := | |
| A.toEuclideanLin.toContinuousLinearMap | |
| private lemma matrixHilbertOperator_conj {ι κ : Type*} [Fintype ι] [Fintype κ] | |
| (A : Matrix ι κ ℂ) (v : EuclideanSpace ℂ κ) : | |
| matrixHilbertOperator (A.map star) v = | |
| euclideanConj (matrixHilbertOperator A (euclideanConj v)) := by | |
| apply PiLp.ext | |
| intro i | |
| change (∑ j, star (A i j) * v j) = star (∑ j, A i j * star (v j)) | |
| simp [star_sum, star_mul, mul_comm] | |
| private lemma matrixHilbertOperator_conj_norm_le {ι κ : Type*} [Fintype ι] [Fintype κ] | |
| (A : Matrix ι κ ℂ) : | |
| ‖matrixHilbertOperator (A.map star)‖ ≤ ‖matrixHilbertOperator A‖ := by | |
| apply (ContinuousLinearMap.opNorm_le_iff (f := matrixHilbertOperator (A.map star)) | |
| (_root_.norm_nonneg (matrixHilbertOperator A))).mpr | |
| intro v | |
| rw [matrixHilbertOperator_conj, euclideanConj_norm] | |
| simpa only [euclideanConj_norm] using | |
| (matrixHilbertOperator A).le_opNorm (euclideanConj v) | |
| private lemma matrixHilbertOperator_conj_norm {ι κ : Type*} [Fintype ι] [Fintype κ] | |
| (A : Matrix ι κ ℂ) : | |
| ‖matrixHilbertOperator (A.map star)‖ = ‖matrixHilbertOperator A‖ := by | |
| apply le_antisymm (matrixHilbertOperator_conj_norm_le A) | |
| have he : (A.map star).map star = A := by ext i j; simp | |
| have h := matrixHilbertOperator_conj_norm_le (A.map star) | |
| rwa [he] at h | |
| private lemma matrixHilbertOperator_transpose_norm {ι κ : Type*} | |
| [Fintype ι] [Fintype κ] (A : Matrix ι κ ℂ) : | |
| ‖matrixHilbertOperator A.transpose‖ = ‖matrixHilbertOperator A‖ := by | |
| have hc : A.transpose = (A.conjTranspose).map star := by | |
| ext i j | |
| simp | |
| rw [hc, matrixHilbertOperator_conj_norm] | |
| change ‖LinearMap.toContinuousLinearMap A.conjTranspose.toEuclideanLin‖ = _ | |
| rw [Matrix.toEuclideanLin_conjTranspose_eq_adjoint, LinearMap.adjoint_toContinuousLinearMap] | |
| exact ContinuousLinearMap.adjoint.norm_map _ | |
| theorem finiteCubicBound_symm (S H : Finset Eisenstein) | |
| (hS : ∀ a ∈ S, primary a) (hH : ∀ h ∈ H, primary h) : | |
| finiteCubicBound S H = finiteCubicBound H S := by | |
| let A : Matrix H S ℂ := fun h a => cubicSymbol a.val h.val | |
| have hmat : (fun (a : S) (h : H) => cubicSymbol h.val a.val) = A.transpose := by | |
| funext a h | |
| exact cubic_reciprocity (hH h.val h.property) (hS a.val a.property) | |
| unfold finiteCubicBound finiteCubicOperator | |
| rw [hmat] | |
| exact congrArg (fun x : ℝ => x^2) (matrixHilbertOperator_transpose_norm A).symm | |
| end CubicFirstMoment | |
| namespace CubicFirstMoment | |
| theorem finiteCubicBound_bilinear (S H : Finset Eisenstein) | |
| (v w phase : Eisenstein → ℂ) (hphase : ∀ h ∈ H, ‖phase h‖ ≤ 1) : | |
| ‖∑ h ∈ H, phase h * (∑ a ∈ S, v a * cubicSymbol a h) * | |
| star (∑ a ∈ S, w a * cubicSymbol a h)‖ ≤ | |
| finiteCubicBound S H * | |
| ((∑ a ∈ S, ‖v a‖^2) + (∑ a ∈ S, ‖w a‖^2)) / 2 := by | |
| let V (h : Eisenstein) := ∑ a ∈ S, v a * cubicSymbol a h | |
| let W (h : Eisenstein) := ∑ a ∈ S, w a * cubicSymbol a h | |
| calc | |
| _ ≤ ∑ h ∈ H, ‖phase h * V h * star (W h)‖ := norm_sum_le _ _ | |
| _ ≤ ∑ h ∈ H, (‖V h‖^2+‖W h‖^2)/2 := by | |
| apply Finset.sum_le_sum | |
| intro h hh | |
| rw [norm_mul, norm_mul, norm_star] | |
| calc | |
| _ ≤ 1 * ‖V h‖ * ‖W h‖ := | |
| mul_le_mul_of_nonneg_right | |
| (mul_le_mul_of_nonneg_right (hphase h hh) (_root_.norm_nonneg _)) | |
| (_root_.norm_nonneg _) | |
| _ ≤ _ := by nlinarith [sq_nonneg (‖V h‖-‖W h‖)] | |
| _ = ((∑ h ∈ H, ‖V h‖^2) + (∑ h ∈ H, ‖W h‖^2))/2 := by | |
| rw [← Finset.sum_div, Finset.sum_add_distrib] | |
| _ ≤ _ := by | |
| have hv := finiteCubicBound_controls_mass S H v | |
| have hw := finiteCubicBound_controls_mass S H w | |
| change (∑ h ∈ H, ‖V h‖^2) ≤ _ at hv | |
| change (∑ h ∈ H, ‖W h‖^2) ≤ _ at hw | |
| nlinarith | |
| theorem finiteCubicBound_conjugate_bilinear (S H : Finset Eisenstein) | |
| (v w phase : Eisenstein → ℂ) (hphase : ∀ h ∈ H, ‖phase h‖ ≤ 1) : | |
| ‖∑ h ∈ H, phase h * (∑ a ∈ S, v a * star (cubicSymbol a h)) * | |
| star (∑ a ∈ S, w a * star (cubicSymbol a h))‖ ≤ | |
| finiteCubicBound S H * | |
| ((∑ a ∈ S, ‖v a‖^2) + (∑ a ∈ S, ‖w a‖^2)) / 2 := by | |
| have h := finiteCubicBound_bilinear S H (fun a => star (w a)) | |
| (fun a => star (v a)) phase hphase | |
| simp only [norm_star] at h | |
| have he : (∑ h ∈ H, phase h * (∑ a ∈ S, v a * star (cubicSymbol a h)) * | |
| star (∑ a ∈ S, w a * star (cubicSymbol a h))) = | |
| ∑ h ∈ H, phase h * (∑ a ∈ S, star (w a) * cubicSymbol a h) * | |
| star (∑ a ∈ S, star (v a) * cubicSymbol a h) := by | |
| apply Finset.sum_congr rfl | |
| intro h hh | |
| simp [star_sum, star_mul, mul_comm, mul_left_comm, mul_assoc] | |
| rw [he] | |
| simpa only [add_comm] using h | |
| end CubicFirstMoment | |
| namespace CubicFirstMoment | |
| lemma coefficientVector_norm_sq (S : Finset Eisenstein) (u : Eisenstein → ℂ) : | |
| ‖(WithLp.toLp 2 (fun a : S => u a.val) : EuclideanSpace ℂ S)‖^2 = | |
| ∑ a ∈ S, ‖u a‖^2 := by | |
| rw [EuclideanSpace.norm_sq_eq] | |
| exact (Finset.sum_subtype S (fun _ => Iff.rfl) (fun a => ‖u a‖^2)).symm | |
| lemma finiteCubicOperator_norm_sq (S H : Finset Eisenstein) (u : Eisenstein → ℂ) : | |
| ‖finiteCubicOperator S H (WithLp.toLp 2 (fun a : S => u a.val))‖^2 = | |
| ∑ h ∈ H, ‖∑ a ∈ S, u a * cubicSymbol a h‖^2 := by | |
| rw [EuclideanSpace.norm_sq_eq] | |
| change (∑ h : H, ‖finiteCubicOperator S H (WithLp.toLp 2 (fun a : S => u a.val)) h‖^2) = _ | |
| simp_rw [finiteCubicOperator_apply] | |
| exact (Finset.sum_subtype H (fun _ => Iff.rfl) | |
| (fun h => ‖∑ a ∈ S, u a * cubicSymbol a h‖^2)).symm | |
| lemma finiteCubicBound_le_iff (S H : Finset Eisenstein) {C : ℝ} (hC : 0 ≤ C) : | |
| finiteCubicBound S H ≤ C ↔ ∀ u : Eisenstein → ℂ, | |
| (∑ h ∈ H, ‖∑ a ∈ S, u a * cubicSymbol a h‖^2) ≤ | |
| C * ∑ a ∈ S, ‖u a‖^2 := by | |
| constructor | |
| · intro h u | |
| exact (finiteCubicBound_controls_mass S H u).trans | |
| (mul_le_mul_of_nonneg_right h (Finset.sum_nonneg (fun _ _ => sq_nonneg _))) | |
| · intro h | |
| have hn : ‖finiteCubicOperator S H‖ ≤ Real.sqrt C := by | |
| apply (ContinuousLinearMap.opNorm_le_iff (f := finiteCubicOperator S H) | |
| (Real.sqrt_nonneg C)).mpr | |
| intro v | |
| let u (a : Eisenstein) : ℂ := if ha : a ∈ S then v ⟨a, ha⟩ else 0 | |
| have hv : WithLp.toLp 2 (fun a : S => u a.val) = v := by | |
| apply PiLp.ext | |
| intro a | |
| simp [u] | |
| have hh : ‖finiteCubicOperator S H v‖^2 ≤ C*‖v‖^2 := by | |
| rw [← hv, finiteCubicOperator_norm_sq, coefficientVector_norm_sq] | |
| exact h u | |
| apply (sq_le_sq₀ (_root_.norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (_root_.norm_nonneg _))).mp | |
| simpa only [mul_pow, Real.sq_sqrt hC] using hh | |
| exact (pow_le_pow_left₀ (_root_.norm_nonneg _) hn 2).trans_eq (Real.sq_sqrt hC) | |
| end CubicFirstMoment | |
| namespace CubicFirstMoment | |
| lemma finiteCubicBound_mono {S T H J : Finset Eisenstein} (hST : S ⊆ T) (hHJ : H ⊆ J) : | |
| finiteCubicBound S H ≤ finiteCubicBound T J := by | |
| apply (finiteCubicBound_le_iff S H (finiteCubicBound_nonneg T J)).mpr | |
| intro u | |
| let v (a : Eisenstein) := if a ∈ S then u a else 0 | |
| have hi (h : Eisenstein) : (∑ a ∈ T, v a * cubicSymbol a h) = | |
| ∑ a ∈ S, u a * cubicSymbol a h := by | |
| calc | |
| _ = ∑ a ∈ S, v a * cubicSymbol a h := | |
| (Finset.sum_subset hST (fun a _ ha => by simp [v, ha])).symm | |
| _ = _ := Finset.sum_congr rfl (fun a ha => by simp [v, ha]) | |
| have hv : (∑ a ∈ T, ‖v a‖^2) = ∑ a ∈ S, ‖u a‖^2 := by | |
| calc | |
| _ = ∑ a ∈ S, ‖v a‖^2 := | |
| (Finset.sum_subset hST (fun a _ ha => by simp [v, ha])).symm | |
| _ = _ := Finset.sum_congr rfl (fun a ha => by simp [v, ha]) | |
| have hb := finiteCubicBound_controls_mass T J v | |
| simp_rw [hi, hv] at hb | |
| exact (Finset.sum_le_sum_of_subset_of_nonneg hHJ (fun _ _ _ => sq_nonneg _)).trans hb | |
| lemma finiteCubicBound_mul_support_le (Q H : Finset Eisenstein) | |
| {m : Eisenstein} (hm : primary m) (hQ : ∀ b ∈ Q, primary b) : | |
| finiteCubicBound (Q.image (fun b => m*b)) H ≤ finiteCubicBound Q H := by | |
| apply (finiteCubicBound_le_iff _ _ (finiteCubicBound_nonneg Q H)).mpr | |
| intro u | |
| have hinj : ∀ a ∈ Q, ∀ b ∈ Q, m*a=m*b → a=b := by | |
| intro a ha b hb he | |
| exact mul_left_cancel₀ (primary_ne_zero hm) he | |
| have he (h : Eisenstein) : | |
| (∑ a ∈ Q.image (fun b => m*b), u a * cubicSymbol a h) = | |
| cubicSymbol m h * ∑ b ∈ Q, u (m*b) * cubicSymbol b h := by | |
| rw [Finset.sum_image hinj, Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro b hb | |
| rw [cubicSymbol_mul_lower (primary_ne_zero hm) (primary_ne_zero (hQ b hb))] | |
| ring | |
| have hn (h : Eisenstein) : | |
| ‖∑ a ∈ Q.image (fun b => m*b), u a * cubicSymbol a h‖^2 ≤ | |
| ‖∑ b ∈ Q, u (m*b) * cubicSymbol b h‖^2 := by | |
| rw [he, norm_mul] | |
| apply pow_le_pow_left₀ (by positivity) | |
| simpa only [one_mul] using mul_le_mul_of_nonneg_right | |
| (norm_cubicSymbol_le_one hm h) (_root_.norm_nonneg _) | |
| calc | |
| _ ≤ ∑ h ∈ H, ‖∑ b ∈ Q, u (m*b) * cubicSymbol b h‖^2 := | |
| Finset.sum_le_sum (fun h _ => hn h) | |
| _ ≤ finiteCubicBound Q H * ∑ b ∈ Q, ‖u (m*b)‖^2 := | |
| finiteCubicBound_controls_mass Q H (fun b => u (m*b)) | |
| _ = _ := by rw [Finset.sum_image hinj] | |
| end CubicFirstMoment | |
| namespace CubicFirstMoment | |
| lemma norm_idealMoebius_le_one (m : Eisenstein) : ‖(idealMoebius m : ℂ)‖ ≤ 1 := by | |
| have hs : (idealMoebius m : ℝ)^2 ≤ 1 := by | |
| rw [idealMoebius_sq] | |
| split_ifs <;> norm_num | |
| have hn : ‖(idealMoebius m : ℂ)‖ = |(idealMoebius m : ℝ)| := | |
| Complex.norm_intCast _ | |
| rw [hn] | |
| nlinarith [sq_abs (idealMoebius m : ℝ), abs_nonneg (idealMoebius m : ℝ)] | |
| theorem finiteCubicBound_coprime_bilinear (S H U : Finset Eisenstein) | |
| (hS : ∀ a ∈ S, primary a ∧ Squarefree a) | |
| (hU : ∀ p ∈ U, primaryPrime p) | |
| (hSU : ∀ a ∈ S, primaryPrimeFactors a ⊆ U) | |
| (v w phase : Eisenstein → ℂ) (hphase : ∀ h ∈ H, ‖phase h‖ ≤ 1) : | |
| ‖∑ h ∈ H, phase h * ∑ a ∈ S, ∑ b ∈ S, | |
| if IsCoprime a b then | |
| (v a * star (cubicSymbol a h)) * star (w b * star (cubicSymbol b h)) else 0‖ ≤ | |
| ∑ s ∈ U.powerset, | |
| finiteCubicBound (S.filter (fun a => (∏ p ∈ s, p) ∣ a)) H * | |
| ((∑ a ∈ S.filter (fun a => (∏ p ∈ s, p) ∣ a), ‖v a‖^2) + | |
| (∑ a ∈ S.filter (fun a => (∏ p ∈ s, p) ∣ a), ‖w a‖^2)) / 2 := by | |
| let V (s : Finset Eisenstein) (h : Eisenstein) : ℂ := | |
| ∑ a ∈ S.filter (fun a => (∏ p ∈ s, p) ∣ a), v a * star (cubicSymbol a h) | |
| let W (s : Finset Eisenstein) (h : Eisenstein) : ℂ := | |
| ∑ a ∈ S.filter (fun a => (∏ p ∈ s, p) ∣ a), w a * star (cubicSymbol a h) | |
| have he (h : Eisenstein) := coprime_bilinear_moebius S S U hS hU hSU | |
| (fun a => v a * star (cubicSymbol a h)) (fun a => w a * star (cubicSymbol a h)) | |
| have he' (h : Eisenstein) : | |
| (∑ a ∈ S, ∑ b ∈ S, if IsCoprime a b then | |
| (v a * star (cubicSymbol a h)) * star (w b * star (cubicSymbol b h)) else 0) = | |
| ∑ s ∈ U.powerset, (idealMoebius (∏ p ∈ s, p) : ℂ) * V s h * star (W s h) := by | |
| simpa only [V, W, Finset.sum_filter] using he h | |
| simp_rw [he', Finset.mul_sum] | |
| rw [Finset.sum_comm] | |
| have hfactor (s : Finset Eisenstein) : | |
| (∑ h ∈ H, phase h * ((idealMoebius (∏ p ∈ s, p) : ℂ) * V s h * star (W s h))) = | |
| (idealMoebius (∏ p ∈ s, p) : ℂ) * ∑ h ∈ H, phase h * V s h * star (W s h) := by | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro h hh | |
| ring | |
| simp_rw [hfactor] | |
| apply (norm_sum_le _ _).trans | |
| apply Finset.sum_le_sum | |
| intro s hs | |
| rw [norm_mul] | |
| calc | |
| _ ≤ 1 * ‖∑ h ∈ H, phase h * V s h * star (W s h)‖ := | |
| mul_le_mul_of_nonneg_right (norm_idealMoebius_le_one _) (_root_.norm_nonneg _) | |
| _ ≤ _ := by | |
| rw [one_mul] | |
| exact finiteCubicBound_conjugate_bilinear _ H v w phase hphase | |
| end CubicFirstMoment | |
| end | |
| end | |
| end OAI | |