import Mathlib import OAI.Analysis.HardSphere.Geometry.FreePathExpectation import OAI.Analysis.HardSphere.PathBounds.FreeVisitTravel namespace OAI section section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators namespace HardSphere.FreeVisits open HardSphere.Wiener HardSphere.BathSlice HardSphere.Lattice HardSphere.CellOrbital attribute [local irreducible] freeTrajectory pathVisitedSites torusDistance def singleVisitDefect {K : ℕ} (L : Length) (A : Finset (DiscreteTorus K)) (η : ℝ) (D : Set (ConfigurationPath 1 L)) (ω : ConfigurationPath 1 L) : ℝ≥0∞ := by classical exact ENNReal.ofReal (Real.exp (η*(if ω∈D then ((pathVisitedSites L (siteCenter L) A 0 ω).card:ℝ) else 0))-1) lemma singleVisitDefect_measurable {K : ℕ} (L : Length) (A : Finset (DiscreteTorus K)) (η : ℝ) {D : Set (ConfigurationPath 1 L)} (hD : MeasurableSet D) : Measurable (singleVisitDefect L A η D) := by classical exact ((measurable_const.mul ((pathVisitedSites_measurable L (siteCenter L) A 0).ite hD measurable_const)).exp.sub measurable_const).ennreal_ofReal lemma singleVisitDefect_reverse {K : ℕ} (L : Length) (A : Finset (DiscreteTorus K)) (η : ℝ) {D : Set (ConfigurationPath 1 L)} (hD : ∀ω,reverseConfigurationPath 1 L ω∈D ↔ ω∈D) (ω : ConfigurationPath 1 L) : singleVisitDefect L A η D (reverseConfigurationPath 1 L ω)=singleVisitDefect L A η D ω := by classical simp only [singleVisitDefect,hD,pathVisitedSites_reverse] lemma free_single_defect_bound {η₀ : ℝ} (hη₀ : 0≤η₀) : ∃ C : ℝ, 0