import Mathlib import OAI.Analysis.HardSphere.Bridges.BridgeAverage namespace OAI section section noncomputable section open MeasureTheory ProbabilityTheory Set open scoped ENNReal NNReal Topology BigOperators namespace HardSphere.Bridge open Wiener GaussianPacking PathCutoff def LegMeshRegular (n : ℕ) (t r R C : ℝ) (y u : Point) (β : Noise) : Prop := (∀j : Fin n,legMeshRatio t r y u j β≤R) ∧ (∑j : Fin n,legCost t r y u j β)≤C*(n:ℝ) lemma legMeshRegular_measurable (n : ℕ) (t r R C : ℝ) (y u : Point) : MeasurableSet {β | LegMeshRegular n t r R C y u β} := by have he : {β | LegMeshRegular n t r R C y u β} = ((⋂j : Fin n,{β | legMeshRatio t r y u j β≤R}) ∩ {β | (∑j : Fin n,legCost t r y u j β)≤C*(n:ℝ)}) := by ext β; simp [LegMeshRegular] rw [he] apply MeasurableSet.inter · apply MeasurableSet.iInter intro j apply measurableSet_le _ measurable_const unfold legMeshRatio have hζ : Continuous (fun β : Noise ↦ fun i : Fin 3 ↦ (pathCoordinates (leg t y u β) i).comp ⟨meshTime j,meshTime_continuous j⟩) := by apply continuous_pi; intro i apply ContinuousMap.continuous_of_continuous_uncurry change Continuous (fun p : Noise×Time ↦ leg t y u p.1 (meshTime j p.2) i) have hl := leg_continuous t y u have hj := meshTime_continuous j fun_prop exact (((liftedDiameter_continuous 0 1).comp hζ).div_const r).measurable · exact measurableSet_le (Finset.measurable_fun_sum _ (fun j _ ↦ (legCost_continuous j t r y u).measurable)) measurable_const lemma strong_mesh_of_free (L : Length) (n : ℕ) {t r R B C Creg : ℝ} (hr : 0