import Mathlib import OAI.Analysis.HardSphere.Allocation.PhysicalCellUniform import OAI.Analysis.HardSphere.Allocation.PhysicalReferenceRaw namespace OAI section noncomputable section open MeasureTheory ProbabilityTheory Set open scoped ENNReal BigOperators namespace HardSphere.Comparison variable {Ω A G Y J : Type*} [MeasurableSpace Ω] [MeasurableSpace Y] [Fintype A] [DecidableEq A] [Fintype G] [DecidableEq G] [Fintype J] omit [DecidableEq A] [Fintype G] [DecidableEq G] in lemma allocatedTagLaw_sum (μ : J→Measure Ω) (I : G→Ω→Finset A) (hI : ∀g i,MeasurableSet {ω | i∈I g ω}) (κ : A→Kernel Ω Y) (g : G) : allocatedTagLaw (∑j,μ j) I κ g=∑j,allocatedTagLaw (μ j) I κ g := by classical apply Measure.ext intro s hs simp only [allocatedTagLaw,Measure.finsetSum_apply] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ simp only [Measure.bind_apply hs (κ i).aemeasurable,←lintegral_indicator (hI g i)] exact lintegral_finsetSum_measure _ _ _ end HardSphere.Comparison end end section noncomputable section open MeasureTheory ProbabilityTheory Set open scoped ENNReal BigOperators namespace HardSphere.Groups open Wiener Bridge Sampling Comparison GaussianPacking PathCutoff CellOrbital attribute [local instance] Classical.propDecidable attribute [local instance] Comparison.permBathSpace Comparison.permBathSingleton def physicalRead {N K M G : ℕ} (L : Length) (extra tag : Fin 3→Fin K) (b : Bool) (i : Fin (N+1)) : Kernel (ConfigurationPath (N+1) L×GridAllocation (N+1) K (G*M)) (Torus L×Torus L×Configuration N L) := ((physicalCellPost L extra tag b) ∘ₖ orderedKernel (uniformBathOrder N) i).comap (fun p ↦ p.1 midpointTime) ((continuous_eval_const midpointTime).measurable.comp measurable_fst) lemma physical_branch_allocated_reference {N K M G : ℕ} [NeZero K] {L : Length} (hL : L.val=(K:ℝ)) (hK : 1≤K) (h50 : 50