math / data /lean /OAI /Probability /Ballisticity /Estimates /BufferFirstFailure.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
4.99 kB
import Mathlib
import OAI.Probability.Ballisticity.Estimates.RawPairLocality
namespace OAI
section
section
open MeasureTheory ProbabilityTheory Filter
open scoped ENNReal NNReal BigOperators Topology Classical
namespace DirectionalTransience
def BelowHeight {d : β„•} (β„“ : Vector d) (a : ℝ) : Set (Lattice d) :=
{y | dot (realPosition y) β„“ < a}
def PairAtHeight {d : β„•} (β„“ : Vector d) (a : ℝ) : Set (Lattice d Γ— Lattice d) :=
{x | dot (realPosition x.1) β„“ = a ∧ dot (realPosition x.2) β„“ = a}
noncomputable def rowHeightFiltration {d : β„•} (β„“ : Vector d) (a : ℝ) :
Filtration β„• (inferInstance : MeasurableSpace (Environment d)) where
seq n := rowSigma (BelowHeight β„“ (a+n))
mono' := by
intro n m hnm
apply rowSigma_mono
intro y hy
have hnmR : (n:ℝ) ≀ m := by exact_mod_cast hnm
dsimp [BelowHeight] at hy ⊒
linarith
le' n := rowSigma_le _
noncomputable def bufferTraversalMass {d : β„•} (β„“ : Vector d) (f : Direction d) (a z : ℝ)
(Ο€ : Environment d β†’ SupportedPairMeasures (PairAtHeight β„“ a)) (h : β„•) (Ο‰ : Environment d) : ℝβ‰₯0∞ :=
if h=0 then 1 else pairKernelMass β„“ f h z (Ο€ Ο‰).val Ο‰
lemma bufferTraversalMass_adapted {d : β„•} (β„“ : Vector d) (f : Direction d) (a z : ℝ)
(Ο€ : Environment d β†’ SupportedPairMeasures (PairAtHeight β„“ a))
(hΟ€ : @Measurable _ _ (rowSigma (BelowHeight β„“ a)) _ Ο€) :
Adapted (rowHeightFiltration β„“ a) (bufferTraversalMass β„“ f a z Ο€) := by
intro h
by_cases hh : h=0
Β· simp only [hh]
exact measurable_const
Β· have hhpos : 0 < h := Nat.pos_of_ne_zero hh
have hle : rowSigma (BelowHeight β„“ a) ≀ rowSigma (BelowHeight β„“ (a+h)) := by
apply rowSigma_mono
intro y hy
dsimp [BelowHeight] at hy ⊒
have : (0:ℝ) ≀ h := Nat.cast_nonneg h
linarith
have hC (x : Lattice d Γ— Lattice d) (hx : x ∈ PairAtHeight β„“ a) :
Strip β„“ x.1 h βŠ† BelowHeight β„“ (a+h) ∧ Strip β„“ x.2 h βŠ† BelowHeight β„“ (a+h) := by
constructor
Β· intro y hy
change dot (realPosition y) β„“ < a+h
simpa only [hx.1] using hy.2
Β· intro y hy
change dot (realPosition y) β„“ < a+h
simpa only [hx.2] using hy.2
have hp : @Measurable _ _ (rowSigma (BelowHeight β„“ (a+h))) _ Ο€ := hΟ€.mono hle le_rfl
have hm := (pairKernelMass_joint_rows β„“ f hhpos z (PairAtHeight β„“ a)
(BelowHeight β„“ (a+h)) hC).comp (hp.prodMk measurable_id)
change @Measurable _ _ (rowSigma (BelowHeight β„“ (a+h))) _ _
unfold bufferTraversalMass
simp only [ite_eq_right hh]
exact hm
noncomputable def bufferFirstFailure {d : β„•} (β„“ : Vector d) (f : Direction d) (a z g : ℝ)
(Ο€ : Environment d β†’ SupportedPairMeasures (PairAtHeight β„“ a)) (H : β„•) : Environment d β†’ β„• :=
hittingBtwn (bufferTraversalMass β„“ f a z Ο€) (Set.Iio (ENNReal.ofReal g)) 1 H
lemma bufferFirstFailure_stopping {d : β„•} (β„“ : Vector d) (f : Direction d) (a z g : ℝ)
(Ο€ : Environment d β†’ SupportedPairMeasures (PairAtHeight β„“ a))
(hΟ€ : @Measurable _ _ (rowSigma (BelowHeight β„“ a)) _ Ο€) (H : β„•) :
IsStoppingTime (rowHeightFiltration β„“ a) (fun Ο‰ => (bufferFirstFailure β„“ f a z g Ο€ H Ο‰ : WithTop β„•)) :=
(bufferTraversalMass_adapted β„“ f a z Ο€ hΟ€).isStoppingTime_hittingBtwn measurableSet_Iio
lemma bufferFirstFailure_bounds {d : β„•} (β„“ : Vector d) (f : Direction d) (a z g : ℝ)
(Ο€ : Environment d β†’ SupportedPairMeasures (PairAtHeight β„“ a)) {H : β„•} (hH : 0 < H)
(Ο‰ : Environment d) : 1 ≀ bufferFirstFailure β„“ f a z g Ο€ H Ο‰ ∧
bufferFirstFailure β„“ f a z g Ο€ H Ο‰ ≀ H :=
hittingBtwn_mem_Icc hH Ο‰
lemma before_bufferFirstFailure_pass {d : β„•} (β„“ : Vector d) (f : Direction d) (a z g : ℝ)
(Ο€ : Environment d β†’ SupportedPairMeasures (PairAtHeight β„“ a)) (H : β„•)
(Ο‰ : Environment d) {j : β„•} (hj : 0 < j) (hjlt : j < bufferFirstFailure β„“ f a z g Ο€ H Ο‰) :
ENNReal.ofReal g ≀ pairKernelMass β„“ f j z (Ο€ Ο‰).val Ο‰ := by
have hn := notMem_of_lt_hittingBtwn hjlt hj
simpa only [bufferTraversalMass,ite_eq_right (Nat.ne_of_gt hj),Set.mem_Iio,not_lt] using hn
lemma bufferFirstFailure_fails_of_lt {d : β„•} (β„“ : Vector d) (f : Direction d) (a z g : ℝ)
(Ο€ : Environment d β†’ SupportedPairMeasures (PairAtHeight β„“ a)) {H : β„•} (hH : 0 < H)
(Ο‰ : Environment d) (hlt : bufferFirstFailure β„“ f a z g Ο€ H Ο‰ < H) :
pairKernelMass β„“ f (bufferFirstFailure β„“ f a z g Ο€ H Ο‰) z (Ο€ Ο‰).val Ο‰ < ENNReal.ofReal g := by
have hn := hittingBtwn_mem_set_of_hittingBtwn_lt hlt
change bufferTraversalMass β„“ f a z Ο€ (bufferFirstFailure β„“ f a z g Ο€ H Ο‰) Ο‰ < ENNReal.ofReal g at hn
have hp := (bufferFirstFailure_bounds β„“ f a z g Ο€ hH Ο‰).1
simpa only [bufferTraversalMass,ite_eq_right (by omega : bufferFirstFailure β„“ f a z g Ο€ H Ο‰ β‰  0),Set.mem_Iio] using hn
end DirectionalTransience
end
end
end OAI