import Mathlib import OAI.Analysis.HardSphere.Allocation.PhysicalAmbientRN import OAI.Analysis.HardSphere.Allocation.PhysicalFamilyLikelihood namespace OAI section noncomputable section open MeasureTheory ProbabilityTheory Set open scoped ENNReal NNReal namespace HardSphere.Groups open Wiener Bridge Sampling Comparison GaussianPacking PathCutoff CellOrbital HardSphere.Lattice attribute [local instance] Classical.propDecidable variable {K : ℕ} [NeZero K] {x y : DiscreteTorus K} variable {J : Type*} [Fintype J] [DecidableEq J] omit [NeZero K] in lemma simpleEncounter_comm (R : ℕ) (p q : SimplePath x y) : simpleEncounter R p q=simpleEncounter R q p := by unfold simpleEncounter apply Finset.card_bij (fun z _ ↦ z.swap) · intro z hz obtain ⟨hp,hq,hn⟩ := (mem_encounterSet _ _ _ _ _).mp hz exact (mem_encounterSet _ _ _ _ _).mpr ⟨hq,hp,torusNear_symm hn⟩ · intro z _ w _ he exact Prod.swap_injective he · intro z hz obtain ⟨hp,hq,hn⟩ := (mem_encounterSet _ _ _ _ _).mp hz exact ⟨z.swap,(mem_encounterSet _ _ _ _ _).mpr ⟨hq,hp,torusNear_symm hn⟩,rfl⟩ theorem physicalCoded_moment {N M G : ℕ} {L : Length} (hL : L.val=(K:ℝ)) (g : Fin G) (m : ℕ) (t r R C S : ℝ) (ht : 0 simp only [ite_true] have H := physical_first_likelihood_moment hL g m t r R C S ht u particle f v steps f' v' steps' d A B hc hc' (fun i ↦ (hh i).1) (fun i ↦ (hh' i).1) (fun i ↦ (hh i).2) (fun i ↦ (hh' i).2) hn hn' (he1'.trans he1.symm) hm hp q a ha0 hq hsmall have Hrn := physical_first_RN_cross hL g m t r R C S ht hr u particle f v steps f' v' steps' d A B hc hc' (fun i ↦ (hh i).1) (fun i ↦ (hh' i).1) (fun i ↦ (hh i).2) (fun i ↦ (hh' i).2) hp (he1'.trans he1.symm) rw [he1] at Hrn H rw [Hrn] apply H.trans rw [div_eq_mul_inv,ENNReal.inv_pow,hover] apply mul_le_mul' le_rfl apply pow_le_pow_right₀ ha1 have h1 := simpleRoute_near_first p p' (simpleRouteLength_eq hxy p) (simpleRouteLength_eq hxy p') (fun j ↦ datumHome hL d (particle j)) f f' (fun i ↦ (hh i).1) (fun i ↦ (hh' i).1) 30 have h2 := simpleRoute_near_first p' p (simpleRouteLength_eq hxy p') (simpleRouteLength_eq hxy p) (fun j ↦ datumHome hL d (particle j)) f' f (fun i ↦ (hh' i).1) (fun i ↦ (hh i).1) 30 rw [simpleEncounter_comm 30 p' p] at h2 omega | false => simp only [Bool.false_eq_true,ite_false] have H := physical_second_likelihood_moment hL g m t r R C S ht u particle f v steps f' v' steps' d A B hc hc' (fun i ↦ (hh i).1) (fun i ↦ (hh' i).1) (fun i ↦ (hh i).2) (fun i ↦ (hh' i).2) hn hn' (he0'.trans he0.symm) hm hp q a ha0 hq hsmall have Hrn := physical_second_RN_cross hL g m t r R C S ht hr u particle f v steps f' v' steps' d A B hc hc' (fun i ↦ (hh i).1) (fun i ↦ (hh' i).1) (fun i ↦ (hh i).2) (fun i ↦ (hh' i).2) hp (he0'.trans he0.symm) rw [he0] at Hrn H rw [Hrn] apply H.trans rw [div_eq_mul_inv,ENNReal.inv_pow,hover] apply mul_le_mul' le_rfl apply pow_le_pow_right₀ ha1 have h1 := simpleRoute_near_second p p' (simpleRouteLength_eq hxy p) (simpleRouteLength_eq hxy p') (fun j ↦ datumHome hL d (particle j)) f f' (fun i ↦ (hh i).1) (fun i ↦ (hh' i).1) 30 have h2 := simpleRoute_near_second p' p (simpleRouteLength_eq hxy p') (simpleRouteLength_eq hxy p) (fun j ↦ datumHome hL d (particle j)) f' f (fun i ↦ (hh' i).1) (fun i ↦ (hh i).1) 30 rw [simpleEncounter_comm 30 p' p] at h2 omega end HardSphere.Groups end end section noncomputable section open MeasureTheory ProbabilityTheory Set open scoped ENNReal NNReal namespace HardSphere.Groups open Wiener Bridge Sampling Comparison GaussianPacking PathCutoff CellOrbital HardSphere.Lattice attribute [local instance] Classical.propDecidable variable {K : ℕ} [NeZero K] {x y : DiscreteTorus K} variable {J : Type*} [Fintype J] [DecidableEq J] theorem physicalCoded_density {N M G : ℕ} {L : Length} (hL : L.val=(K:ℝ)) (g : Fin G) (m : ℕ) (t r R C S : ℝ) (ht : 0 simp only [ite_true] rw [hd.1,←simpleRouteVertices_last p _ (simpleRouteLength_eq hxy p), ←physicalPrimary_on_map hL g m t r R C S hr u particle _ d] exact (withDensity_absolutelyContinuous _ _).map hf | false => simp only [Bool.false_eq_true,ite_false] rw [hd.2,←simpleRouteVertices_zero p _,←physicalPrimary_on_map hL g m t r R C S hr u particle _ d] exact (withDensity_absolutelyContinuous _ _).map hf end HardSphere.Groups end end end OAI