import Mathlib import OAI.Probability.Ballisticity.Coupling.SeedRadius import OAI.Probability.Ballisticity.Coupling.StageSeedProfile namespace OAI section open MeasureTheory ProbabilityTheory open scoped ENNReal BigOperators Classical namespace DirectionalTransience lemma fresh_random_budget_mass_lt {d k : ℕ} (ν : Measure (Row d)) [IsProbabilityMeasure ν] (e f : Direction d) (a G r s : ℝ) (H : ℕ) (π : Environment d → BudgetProfile (k:=k) e f a G) (hπ : @Measurable _ _ (rowSigma (BelowHeight (realPosition (step e)) a)) _ π) (A : Set (Environment d)) (hA : MeasurableSet[rowSigma (BelowHeight (realPosition (step e)) a)] A) (c : ℝ≥0∞) (hbound : ∀ η ∈ A, environmentLaw ν {ω | relativeBudgetMass e f H r (π η).val ω by change a≤dot (realPosition y) (realPosition (step e)) simpa only [hx j] using hy.1) have hB : @MeasurableSet (Environment d×Environment d) (MeasurableSpace.prod (rowSigma S) (rowSigma T)) B := measurableSet_lt (hQ.comp ((hπ.comp measurable_fst).prodMk measurable_snd)) measurable_const have hV : @Measurable (Environment d) (Environment d) inferInstance (rowSigma T) id := measurable_id.mono le_rfl (rowSigma_le T) have hb (η : Environment d) (hη : η∈A) : (@Measure.map (Environment d) (Environment d) inferInstance (rowSigma T) id (environmentLaw ν)) {ω | (η,ω)∈B}≤c := by rw [show {ω | (η,ω)∈B}=Prod.mk η ⁻¹' B from rfl, Measure.map_apply hV (hB.preimage measurable_prodMk_left)] exact hbound η hη apply @fresh_rows_random_test_bound d (Environment d) (Environment d) (rowSigma S) (rowSigma T) ν _ S T _ id id measurable_id measurable_id A hA B hB c hb exact Set.disjoint_left.mpr fun x hx hy => (not_lt.mpr (show a≤dot (realPosition x) (realPosition (step e)) from hy)) (show dot (realPosition x) (realPosition (step e)) (not_lt.mpr (show a≤dot (realPosition x) (realPosition (step e)) from hy)) (show dot (realPosition x) (realPosition (step e)) b p.1 p.2)) (π : Environment d → D) (hπ : @Measurable _ _ (rowSigma (BelowHeight (realPosition (step e)) a)) _ π) (A : Set (Environment d)) (hA : MeasurableSet[rowSigma (BelowHeight (realPosition (step e)) a)] A) (g c : ℝ≥0∞) (hbound : ∀ η∈A, environmentLaw ν {ω | b (π η) ω seedSeparatedRaw e f H G p.1.val p.2 Set.univ) := by apply (Measure.measurable_coe MeasurableSet.univ).comp apply seedSeparatedRaw_joint_rows intro x hx j y hy change a≤dot (realPosition y) (realPosition (step e)) simpa only [hx j] using hy.1 lemma fresh_random_seed_failure {d k : ℕ} (ν : Measure (Row d)) [IsProbabilityMeasure ν] (e f : Direction d) (a G : ℝ) (H : ℕ) (g : ℝ≥0∞) (π : Environment d → LayerTupleProfile (k:=k) e a) (hπ : @Measurable _ _ (rowSigma (BelowHeight (realPosition (step e)) a)) _ π) (A : Set (Environment d)) (hA : MeasurableSet[rowSigma (BelowHeight (realPosition (step e)) a)] A) (c : ℝ≥0∞) (hbound : ∀ η∈A, environmentLaw ν {ω | seedSeparatedRaw e f H G (π η).val ω Set.univ seedSeparatedRaw e f H G p.val ω Set.univ) (seedSeparatedMass_joint_upper (k:=k) e f a G H) π hπ A hA g c hbound lemma seedSeparatedRaw_measurable {d k : ℕ} (e f : Direction d) (H : ℕ) (G a : ℝ) (π : LayerTupleProfile (k:=k) e a) : Measurable (fun ω => seedSeparatedRaw e f H G π.val ω) := by have hh := seedSeparatedRaw_joint_rows (k:=k) e f H G a Set.univ (fun _ _ _ => Set.subset_univ _) exact (hh.comp (measurable_const.prodMk measurable_id)).mono (rowSigma_le _) le_rfl theorem adapted_separated_seeds {d : ℕ} (ν : Measure (Row d)) [IsProbabilityMeasure ν] (hue : UniformElliptic ν) (e f : Direction d) (hef : e.1≠f.1) (htrans : DirectionallyTransient ν (realPosition (step e))) (k : ℕ) (hk : 2≤k) (p : ℝ) (hp : 0 ?_⟩ apply fresh_random_seed_failure ν e f a _ H _ π hπ A hA (ENNReal.ofReal p) intro η _ have hs := hh H hH ⟨(π η).val,(π η).property.1⟩ let G := c₀*fluctuationRadius (independentConditionedPairLaw ν (realPosition (step e))) (commonIncrementProcess (realPosition (step e)) f 0) ((H:ℝ)/C) have hm : MeasurableSet {ω | seedSeparatedRaw e f H G (π η).val ω Set.univ