import Mathlib import OAI.Probability.Ballisticity.Coupling.SeedUniform namespace OAI section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal BigOperators Topology Classical namespace DirectionalTransience noncomputable def fluctuationRadius {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (S : Ω → ℝ) (s : ℝ) : ℝ := if h : ∃ r : ℝ, 0 hR.trans_le hr) obtain ⟨r,hr,he⟩ := intermediate_value_Ici hcont (fluctuationScale_tendsto μ S hS hI hne) hs.le have hex : ∃ r : ℝ, 0 (H:ℝ)/C) atTop atTop := tendsto_natCast_atTop_atTop.atTop_div_const hC obtain ⟨H₀,hH₀⟩ := eventually_atTop.mp (hlim.eventually (eventually_gt_atTop (fluctuationScale μ S R))) refine ⟨C,c₀,g₀,hC,hc,hg,H₀,fun H hH π => ?_⟩ obtain ⟨hr,hspec⟩ := fluctuationRadius_spec μ S hS hI hne hR (hH₀ H hH) apply hseed _ hr.le H _ π change (H:ℝ)=C*fluctuationScale μ S (fluctuationRadius μ S ((H:ℝ)/C)) rw [hspec] field_simp end DirectionalTransience end end OAI