import Mathlib import OAI.Analysis.HardSphere.Geometry.SmoothSiteWeight import OAI.Analysis.HardSphere.Geometry.ScalarNormSqIntegral import OAI.Analysis.HardSphere.Geometry.BoxWeight import OAI.Analysis.HardSphere.Conditioning.BathPhase namespace OAI section section noncomputable section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology BigOperators ComplexConjugate namespace HardSphere lemma cons_measurableEmbedding {n : ℕ} (L : Length) : MeasurableEmbedding (fun p : Configuration n L × Torus L ↦ Fin.cons (α:=fun _ ↦ Torus L) p.2 p.1) := by have h := ((MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n+1) ↦ Torus L) 0).symm.measurableEmbedding).comp (MeasurableEquiv.prodComm : Configuration n L × Torus L ≃ᵐ Torus L × Configuration n L).measurableEmbedding convert h using 1 funext pair change Fin.cons pair.2 pair.1 = Fin.insertNth (α:=fun _ : Fin (n+1) ↦ Torus L) 0 pair.2 pair.1 exact (Fin.insertNth_zero' _ _).symm lemma ground_bath_integral {n : ℕ} {L : Length} {u : Jet (n+1) L} (hu : ‖u.1‖=1) (F : Configuration n L → ℝ) (hF : Measurable F) {B : ℝ} (hB : ∀Y,|F Y|≤B) : (∫Y,F Y*(∫x,‖u.1 (Fin.cons x Y)‖^2)) = ∫Y,F Y ∂(groundPositionLaw (n+1) L u).map (fun X ↦ fun i : Fin n ↦ X i.succ) := by let μ := groundPositionLaw (n+1) L u let := groundPositionLaw_probability u hu have hm : Measurable (fun X : Configuration (n+1) L ↦ fun i : Fin n ↦ X i.succ) := by fun_prop rw [integral_map hm.aemeasurable hF.aestronglyMeasurable,groundPositionLaw_integral] let f : Configuration n L × Torus L → ℝ := fun p ↦ F p.1*‖u.1 (Fin.cons p.2 p.1)‖^2 have hf : Integrable f (volume.prod volume) := by have hu' := (Lp.memLp u.1).comp_measurePreserving (cons_preserving (n:=n) L) apply ((hu'.integrable_norm_pow (by norm_num : (2:ℕ)≠0)).const_mul B).mono' · exact (hF.comp measurable_fst).aestronglyMeasurable.mul (hu'.aestronglyMeasurable.norm.pow 2) · exact Eventually.of_forall fun p ↦ by change ‖F p.1*‖u.1 (Fin.cons p.2 p.1)‖^2‖ ≤ B*‖u.1 (Fin.cons p.2 p.1)‖^2 simp only [Real.norm_eq_abs,abs_mul,abs_sq] exact mul_le_mul_of_nonneg_right (hB _) (sq_nonneg _) calc _ = ∫p,f p ∂volume.prod volume := by rw [integral_prod _ hf]; simp only [f,integral_const_mul] _ = _ := by have he := (cons_preserving (n:=n) L).integral_comp (cons_measurableEmbedding (n:=n) L) (fun X ↦ F (fun i : Fin n ↦ X i.succ)*‖u.1 X‖^2) simpa only [Fin.cons_succ] using he lemma ground_physical_phase_transfer {n : ℕ} {L : Length} {r h : ℝ} {u : Jet (n+1) L} (hu : IsGroundVector (n+1) L r u) (hh : 0