import Mathlib import OAI.GroupTheory.SimpleAmenable.RandomFields.SignalGoodRows namespace OAI section section open scoped symmDiff namespace SimpleAmenable open scoped commutatorElement open scoped commutatorElement section PolygonApproxIdentity open Classical theorem polygon_signal_approx_identity {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) N let e := fun z => (∑w∈J,flagAveragingMatrix χ ((D:ℝ)^4/5) N r η κ z w*h w)-h z let δ := 38880/((D:ℝ)*Real.sqrt (r*η)) (∀z,z∉J → e z=0) ∧ ∑z∈J,(e z)^2 ≤ flagVolumeConstant m D L*(Cv*η*(1+δ)+Ca*δ)^2+ flagExceptionalConstant a m D L*(κ+r/N)*(flagRowSumConstant D*Ca)^2 := by obtain ⟨R,Q₁,Cv,Ca,hR,hQ₁,hCv,hCa,hamp,hgood⟩ := flagSignal_good_row_constants (v:=v) hD g ψ χ hψ hsψ q K hcompact hχ₁ obtain ⟨Q₂,hQ₂,hsupp⟩ := flagSignal_box_support (v:=v) hD g ψ q hL (by linarith) hcompact refine ⟨R,max Q₁ Q₂,Cv,Ca,hR,(hQ₁.trans (le_max_left _ _)),hCv,hCa, fun N r η κ hN hQN hr hrN hη hη₁ hκ hscale hline hRf => ?_⟩ have hN' : 0 q+ψ x) N let e := fun z => (∑w∈J,flagAveragingMatrix χ ((D:ℝ)^4/5) N r η κ z w*h w)-h z let δ := 38880/((D:ℝ)*Real.sqrt (r*η)) change (∀z,z∉J → e z=0) ∧ _ have hprod (z w : FlagSite a m D v) (hw : w∉J) : flagAveragingMatrix χ ((D:ℝ)^4/5) N r η κ z w*h w=0 := by rw [flagAveragingMatrix_box_support hD χ hL hN' hχc _ _ _ _ z w (Or.inr hw),zero_mul] refine ⟨?_,?_⟩ · intro z hz have hh := hsupp N hN' ((le_max_right _ _).trans hQN) z hz dsimp [e,h] rw [hh,sub_zero] apply Finset.sum_eq_zero intro w hw rw [flagAveragingMatrix_box_support hD χ hL hN' hχc _ _ _ _ z w (Or.inl hz),zero_mul] · apply flag_good_bad_energy hD hL hκ (div_pos hr' hN') ((div_le_one hN').mpr hrN) hN (by rwa [div_mul_cancel₀ _ hN'.ne']) (show 0 ≤ Cv*η*(1+δ)+Ca*δ by dsimp [δ]; positivity) (show 0 ≤ flagRowSumConstant D*Ca by dsimp [flagRowSumConstant]; positivity) J (fun z hz => by simpa only [mul_comm N L] using (mem_flagBoxFinset _ _ _).mp hz) e · intro z hz hzg have hh := hgood N r η κ hN' ((le_max_left _ _).trans hQN) hr' hη hη₁ hκ hscale hline hRf z J hzg (hprod z) convert hh using 1 dsimp [e,h,δ] ring · intro z hz have hh := flagAveragingMatrix_crude_error hD χ hχ h hρ hN' hr' hη hκ (show 1 ≤ r*η by linarith) (div_nonneg hCa hN'.le) (hamp N hN') z J convert hh using 1 dsimp [e,flagRowSumConstant] ring end PolygonApproxIdentity section FiniteResolvent open Classical Matrix noncomputable def finiteL2Norm {ι : Type*} [Fintype ι] (x : ι → ℝ) : ℝ := ‖WithLp.toLp 2 x‖ theorem finiteL2Norm_nonneg {ι : Type*} [Fintype ι] (x : ι → ℝ) : 0 ≤ finiteL2Norm x := norm_nonneg _ theorem finiteL2Norm_sq {ι : Type*} [Fintype ι] (x : ι → ℝ) : finiteL2Norm x^2=∑i,x i^2 := by simp [finiteL2Norm,PiLp.norm_sq_eq_of_L2,Real.norm_eq_abs,sq_abs] theorem finiteL2Norm_add {ι : Type*} [Fintype ι] (x y : ι → ℝ) : finiteL2Norm (x+y) ≤ finiteL2Norm x+finiteL2Norm y := by simpa only [finiteL2Norm,WithLp.toLp_add] using norm_add_le (WithLp.toLp 2 x) (WithLp.toLp 2 y) theorem finiteL2Norm_sub {ι : Type*} [Fintype ι] (x y : ι → ℝ) : finiteL2Norm (x-y) ≤ finiteL2Norm x+finiteL2Norm y := by simpa only [finiteL2Norm,WithLp.toLp_sub] using norm_sub_le (WithLp.toLp 2 x) (WithLp.toLp 2 y) theorem finiteL2Norm_smul {ι : Type*} [Fintype ι] (c : ℝ) (x : ι → ℝ) : finiteL2Norm (c • x)=|c| * finiteL2Norm x := by simp only [finiteL2Norm,WithLp.toLp_smul,norm_smul,Real.norm_eq_abs] theorem finiteL2Norm_one_add_le {ι : Type*} [Fintype ι] [DecidableEq ι] (B : Matrix ι ι ℝ) (hB : B.PosSemidef) (x : ι → ℝ) : finiteL2Norm x ≤ finiteL2Norm ((1+B)*ᵥx) := by let y := (1+B)*ᵥx let S := ∑i,x i^2 let T := ∑i,y i^2 let P := ∑i,x i*y i have hS : 0 ≤ S := Finset.sum_nonneg (fun i _ => sq_nonneg _) have hT : 0 ≤ T := Finset.sum_nonneg (fun i _ => sq_nonneg _) have hp : 0 ≤ ∑i,x i*(B*ᵥx) i := by simpa only [dotProduct,star_trivial] using hB.dotProduct_mulVec_nonneg x have he : P=S+(∑i,x i*(B*ᵥx) i) := by simp only [P,S,y,Matrix.add_mulVec,Matrix.one_mulVec,Pi.add_apply,mul_add,Finset.sum_add_distrib,pow_two] have hSP : S ≤ P := by linarith have hP : 0 ≤ P := hS.trans hSP have hcs : P^2 ≤ S*T := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ x y have hST : S ≤ T := by by_cases h : S=0 · simpa only [h] using hT · have hS' : 0