import Mathlib import OAI.GroupTheory.SimpleAmenable.RandomFields.CovarianceLimit import OAI.GroupTheory.SimpleAmenable.RandomFields.CompactSignalEnergy import OAI.GroupTheory.SimpleAmenable.RandomFields.FiniteLawDistance namespace OAI section section open scoped symmDiff namespace SimpleAmenable open scoped commutatorElement open scoped commutatorElement section SourceFieldHS open Classical Filter Matrix open scoped Topology theorem sourceFlagMatrix_HS_tendsto {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 matrixHSNorm (Matrix.of (fun (z w : T n) => sourceFlagMatrix χ ρ η κ n (flagSiteAction hD g⁻¹ z.val) (flagSiteAction hD g⁻¹ w.val)- sourceFlagMatrix χ ρ η κ n z.val w.val))) atTop (nhds 0) := by have hh := (sourceFlagMatrix_covariance hD g⁻¹ χ hχ hK hcompact hL hρ hη hκ hLip (fun n => (T n).product (T n))).sqrt rw [Real.sqrt_zero] at hh convert hh using 1 funext n unfold matrixHSNorm congr 1 change (∑z : T n,∑w : T n,(sourceFlagMatrix χ ρ η κ n (flagSiteAction hD g⁻¹ z.val) (flagSiteAction hD g⁻¹ w.val)-sourceFlagMatrix χ ρ η κ n z.val w.val)^2)=_ let f : FlagSite a m D v × FlagSite a m D v → ℝ := fun p => (sourceFlagMatrix χ ρ η κ n p.1 p.2-sourceFlagMatrix χ ρ η κ n (flagSiteAction hD g⁻¹ p.1) (flagSiteAction hD g⁻¹ p.2))^2 symm calc _ = ∑z∈T n,∑w∈T n,f (z,w) := by convert! Finset.sum_product (T n) (T n) f using 1 _ = ∑z : T n,∑w : T n,f (z.val,w.val) := by rw [← Finset.sum_coe_sort (T n)] apply Finset.sum_congr rfl intro z _ exact (Finset.sum_coe_sort (T n) _).symm _ = _ := by apply Finset.sum_congr rfl intro z _ apply Finset.sum_congr rfl intro w _ exact sub_sq_comm _ _ end SourceFieldHS section SmallTransportParameters open Classical theorem smallTransportParameters {M C₁ C₂ ε : ℝ} (hM : 0 x (e.symm z) theorem fieldReindex_measurable {ι : Type*} (e : ι ≃ ι) : Measurable (fieldReindex e) := Measurable.of_eval (fun z => measurable_pi_apply (e.symm z)) theorem independentSmoothNoiseLaw_reindex {ι : Type*} (e : ι ≃ ι) : (independentSmoothNoiseLaw ι).map (fieldReindex e)=independentSmoothNoiseLaw ι := by convert! Measure.infinitePi_map_piCongrLeft (fun _ : ι => smoothNoiseLaw) e using 1 congr 1 funext x z simpa only [Equiv.apply_symm_apply,fieldReindex] using (MeasurableEquiv.piCongrLeft_apply_apply (β:=fun _ : ι => ℝ) e x (e.symm z)).symm theorem finiteCoefficientField_enlarge {ι : Type*} (J T : Finset ι) (hJT : J⊆T) (a : ι → ℝ) (B : Matrix ι ι ℝ) (hcol : ∀z w,w∉J → B z w=0) : finiteCoefficientField T a B=finiteCoefficientField J a B := by ext x z unfold finiteCoefficientField congr 1 exact (Finset.sum_subset hJT (fun w _ hw => by rw [hcol z w hw,zero_mul])).symm theorem finiteCoefficientField_covariance {ι : Type*} (J : Finset ι) (a : ι → ℝ) (B : Matrix ι ι ℝ) (e : ι ≃ ι) : ((independentSmoothNoiseLaw ι).map (finiteCoefficientField J a B)).map (fieldReindex e)= (independentSmoothNoiseLaw ι).map (finiteCoefficientField (J.image e) (fun z => a (e.symm z)) (fun z w => B (e.symm z) (e.symm w))) := by rw [Measure.map_map (fieldReindex_measurable e) (finiteCoefficientField_measurable J a B)] have he : fieldReindex e ∘ finiteCoefficientField J a B= finiteCoefficientField (J.image e) (fun z => a (e.symm z)) (fun z w => B (e.symm z) (e.symm w)) ∘ fieldReindex e := by ext x z simp only [Function.comp_apply,fieldReindex,finiteCoefficientField] rw [Finset.sum_image] · simp only [Equiv.symm_apply_apply] · intro i _ j _ hh exact e.injective hh rw [he] have hh := Measure.map_map (finiteCoefficientField_measurable (J.image e) (fun z => a (e.symm z)) (fun z w => B (e.symm z) (e.symm w))) (fieldReindex_measurable e) (μ:=independentSmoothNoiseLaw ι) rw [independentSmoothNoiseLaw_reindex] at hh exact hh.symm end FiniteFieldCovariance section SourceFieldLaw open Classical Matrix MeasureTheory Filter open scoped Topology theorem sourceFlagMatrix_posSemidef {a m D : ℕ} {v : ℝ×ℝ} (χ : (ℝ×ℝ) → ℝ) {ρ η κ : ℝ} (hρ : 0<ρ) (hκ : 0<κ) (n : ℕ) : (Matrix.of (sourceFlagMatrix (a:=a) (m:=m) (D:=D) (v:=v) χ ρ η κ n)).PosSemidef := by have hh := (Matrix.posSemidef_sum (sourceDyadicIndices n) (fun i _ => flagAveragingMatrix_posSemidef (a:=a) (m:=m) (D:=D) (v:=v) (η:=η) χ hρ (sourceDyadicN_pos n) (show 0<(2:ℝ)^i by positivity) hκ)).smul (sourceDyadicWeight_nonneg n) convert! hh using 1 ext z w simp only [Matrix.of_apply,sourceFlagMatrix,Matrix.smul_apply,smul_eq_mul,Matrix.sum_apply] theorem sourceFlagMatrix_box_support {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 flagMeanSignal θ (sourceDyadicN n) (flagSiteAction hD g⁻¹ z)) (Matrix.of (fun z w => sourceFlagMatrix χ ρ η κ n (flagSiteAction hD g⁻¹ z) (flagSiteAction hD g⁻¹ w)))) := by unfold sourceSmoothFieldLaw rw [finiteCoefficientField_covariance] congr 1 symm apply finiteCoefficientField_enlarge · exact Finset.subset_union_right · intro z w hw apply sourceFlagMatrix_box_support hD χ hL hχc ρ η κ n _ _ right intro hm apply hw exact Finset.mem_image.mpr ⟨(flagSitePermutation hD g).symm w,hm, (flagSitePermutation hD g).apply_symm_apply w⟩ end SourceFieldLaw end SimpleAmenable end end end OAI