math / data /lean /OAI /Probability /Ballisticity /Estimates /CellBadEvent.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
10.5 kB
import Mathlib
import OAI.Probability.Ballisticity.Estimates.CellCertificates
namespace OAI
section
open MeasureTheory ProbabilityTheory
open scoped ENNReal BigOperators Classical
namespace DirectionalTransience
lemma cell_bad_event_subset {d k : β„•} (Ξ½ : Measure (Row d))
(e f : Direction d) (hef : e.1 β‰  f.1) (a C c gβ‚€ g₁ A G : ℝ) (hc : 0 < c)
(hA : 0 ≀ A) (Ο€ : Environment d β†’ LayerTupleProfile (k:=k) e a)
(v w m s : β„•) (hv : 2*cellWidth w m 0 ≀ v) (hs : 0 < s)
(hG : βˆ€ i < m, G ≀ c*cellRadius Ξ½ e f C w m i/2) (q : ℝβ‰₯0∞) :
{Ο‰ | βˆƒ t : β„•, v ≀ t ∧ t ≀ v+w ∧
rawTupleMixture (realPosition (step e)) t (Ο€ Ο‰).val Ο‰ {y | TupleSeparated f G y} <
q*(ENNReal.ofReal gβ‚€*ENNReal.ofReal g₁*ENNReal.ofReal (Real.exp (-A*k*m)))} βŠ†
{Ο‰ | βˆƒ h : β„•, rawTupleMixture (realPosition (step e)) h (Ο€ Ο‰).val Ο‰ Set.univ < q} βˆͺ
(⋃ i, scheduledCellSuccess Ξ½ e f hef a C c gβ‚€ g₁ A hc Ο€ v w m s i)ᢜ := by
intro ω hω
by_cases hmass : Ο‰ ∈ {Ο‰ | βˆƒ h : β„•, rawTupleMixture (realPosition (step e)) h (Ο€ Ο‰).val Ο‰ Set.univ < q}
Β· exact Or.inl hmass
Β· refine Or.inr ?_
intro hcert
obtain ⟨i,hi⟩ := Set.mem_iUnion.mp hcert
have him : i < m := by
by_contra hh
simp only [scheduledCellSuccess,ite_eq_right hh,Set.mem_empty_iff_false] at hi
obtain ⟨t,hvt,ht,hbad⟩ := hΟ‰
have hq : q ≀ rawTupleMixture (realPosition (step e)) (cellOpportunity v w m i) (Ο€ Ο‰).val Ο‰ Set.univ := by
by_contra hh
exact hmass ⟨_,not_le.mp hh⟩
have hp := successful_cell_certificate Ξ½ e f hef a C c gβ‚€ g₁ A hc hA Ο€ v w m s i hv hs Ο‰ hi t hvt ht
have hmono : rawTupleMixture (realPosition (step e)) t (Ο€ Ο‰).val Ο‰
{y | TupleSeparated f (c*cellRadius Ξ½ e f C w m i/2) y} ≀
rawTupleMixture (realPosition (step e)) t (Ο€ Ο‰).val Ο‰ {y | TupleSeparated f G y} := by
apply measure_mono
intro y hy j l hjl
exact (hG i him).trans (hy j l hjl)
exact (not_lt_of_ge ((mul_le_mul_left hq _).trans (hp.trans hmono))) hbad
lemma cells_bad_probability {d k n : β„•} (Ξ½ : Measure (Row d))
(e f : Direction d) (hef : e.1 β‰  f.1) (a C c gβ‚€ g₁ A : ℝ) (hc : 0 < c)
(hA : 0 ≀ A) (Ο€ : Environment d β†’ LayerTupleProfile (k:=k) e a)
(v w : Fin n β†’ β„•) (m s : β„•) (hs : 0 < s) (G : Fin n β†’ ℝ)
(hv : βˆ€ j, 2*cellWidth (w j) m 0 ≀ v j)
(hG : βˆ€ j i, i < m β†’ G j ≀ c*cellRadius Ξ½ e f C (w j) m i/2)
(q Ξ΄ Ξ΅ : ℝβ‰₯0∞)
(hmass : environmentLaw Ξ½ {Ο‰ | βˆƒ h : β„•, rawTupleMixture (realPosition (step e)) h (Ο€ Ο‰).val Ο‰ Set.univ < q} ≀ Ξ΄)
(hcell : βˆ€ j, environmentLaw Ξ½ (⋃ i, scheduledCellSuccess Ξ½ e f hef a C c gβ‚€ g₁ A hc Ο€ (v j) (w j) m s i)ᢜ ≀ Ξ΅) :
environmentLaw Ξ½ {Ο‰ | βˆƒ j : Fin n, βˆƒ t : β„•, v j ≀ t ∧ t ≀ v j+w j ∧
rawTupleMixture (realPosition (step e)) t (Ο€ Ο‰).val Ο‰ {y | TupleSeparated f (G j) y} <
q*(ENNReal.ofReal gβ‚€*ENNReal.ofReal g₁*ENNReal.ofReal (Real.exp (-A*k*m)))} ≀ Ξ΄+n*Ξ΅ := by
let E := {Ο‰ | βˆƒ h : β„•, rawTupleMixture (realPosition (step e)) h (Ο€ Ο‰).val Ο‰ Set.univ < q}
let F := fun j : Fin n => (⋃ i, scheduledCellSuccess Ξ½ e f hef a C c gβ‚€ g₁ A hc Ο€ (v j) (w j) m s i)ᢜ
have hsub : {Ο‰ | βˆƒ j : Fin n, βˆƒ t : β„•, v j ≀ t ∧ t ≀ v j+w j ∧
rawTupleMixture (realPosition (step e)) t (Ο€ Ο‰).val Ο‰ {y | TupleSeparated f (G j) y} <
q*(ENNReal.ofReal gβ‚€*ENNReal.ofReal g₁*ENNReal.ofReal (Real.exp (-A*k*m)))} βŠ† E βˆͺ ⋃ j, F j := by
rintro Ο‰ ⟨j,hj⟩
rcases cell_bad_event_subset Ξ½ e f hef a C c gβ‚€ g₁ A (G j) hc hA Ο€ (v j) (w j) m s (hv j) hs (hG j) q hj with he|hf
Β· exact Or.inl he
· exact Or.inr (Set.mem_iUnion.mpr ⟨j,hf⟩)
apply (measure_mono hsub).trans
apply (measure_union_le _ _).trans
apply add_le_add hmass
apply (measure_iUnion_fintype_le _ _).trans
calc
βˆ‘ j : Fin n, environmentLaw Ξ½ (F j) ≀ βˆ‘ _j : Fin n, Ξ΅ := Finset.sum_le_sum (fun j _ => hcell j)
_ = n*Ξ΅ := by simp [nsmul_eq_mul]
end DirectionalTransience
end
section
open MeasureTheory ProbabilityTheory
open scoped ENNReal BigOperators Classical
namespace DirectionalTransience
def stageBadEvent {d k : β„•} (e f : Direction d) (H : β„•) (Gminus Gplus : ℝ)
(Ο€ : Measure (Fin k β†’ Lattice d)) (p : ℝβ‰₯0∞) : Set (Environment d) :=
{Ο‰ | (βˆƒ h : β„•, 1 ≀ h ∧ h ≀ H ∧
rawTupleMixture (realPosition (step e)) h Ο€ Ο‰ {y | TupleSeparated f Gminus y} < p) ∨
rawTupleMixture (realPosition (step e)) H Ο€ Ο‰ {y | TupleSeparated f Gplus y} < p}
theorem finite_stage_assembly {d k n : β„•} (Ξ½ : Measure (Row d))
(e f : Direction d) (hef : e.1 β‰  f.1) (a C c gβ‚€ g₁ A G Gminus Gplus r : ℝ)
(hc : 0 < c) (hA : 0 ≀ A) (Ο€ : BudgetProfile (k:=k) e f a G)
(He H : β„•) (v w : Fin n β†’ β„•) (m s : β„•) (hs : 0 < s) (Gs : Fin n β†’ ℝ)
(hv : βˆ€ j, 2*cellWidth (w j) m 0 ≀ v j)
(hGs : βˆ€ j i, i < m β†’ Gs j ≀ c*cellRadius Ξ½ e f C (w j) m i/2)
(hcover : βˆ€ h : β„•, He < h β†’ h ≀ H β†’ βˆƒ j, v j ≀ h ∧ h ≀ v j+w j ∧ Gminus ≀ Gs j)
(hgrowth : βˆƒ j, v j ≀ H ∧ H ≀ v j+w j ∧ Gplus ≀ Gs j)
(hshortgap : Gminus ≀ G-r) (p q Ξ΄β‚€ δ₁ Ξ΅ : ℝβ‰₯0∞)
(hp : p ≀ q*(ENNReal.ofReal gβ‚€*ENNReal.ofReal g₁*ENNReal.ofReal (Real.exp (-A*k*m))))
(hshort : environmentLaw Ξ½ {Ο‰ | relativeBudgetMassENN e f He r Ο€.val Ο‰ < p} ≀ Ξ΄β‚€)
(hmass : environmentLaw Ξ½ {Ο‰ | βˆƒ h : β„•, rawTupleMixture (realPosition (step e)) h Ο€.val Ο‰ Set.univ < q} ≀ δ₁)
(hcell : βˆ€ j, environmentLaw Ξ½ (⋃ i, scheduledCellSuccess Ξ½ e f hef a C c gβ‚€ g₁ A hc
(fun _ => Ο€.toLayerProfile) (v j) (w j) m s i)ᢜ ≀ Ξ΅) :
environmentLaw Ξ½ (stageBadEvent e f H Gminus Gplus Ο€.val p) ≀ Ξ΄β‚€+δ₁+n*Ξ΅ := by
let E := {Ο‰ | relativeBudgetMassENN e f He r Ο€.val Ο‰ < p}
let F := {Ο‰ | βˆƒ j : Fin n, βˆƒ t : β„•, v j ≀ t ∧ t ≀ v j+w j ∧
rawTupleMixture (realPosition (step e)) t Ο€.val Ο‰ {y | TupleSeparated f (Gs j) y} <
q*(ENNReal.ofReal gβ‚€*ENNReal.ofReal g₁*ENNReal.ofReal (Real.exp (-A*k*m)))}
have hF : environmentLaw Ξ½ F ≀ δ₁+n*Ξ΅ :=
cells_bad_probability Ξ½ e f hef a C c gβ‚€ g₁ A hc hA (fun _ => Ο€.toLayerProfile)
v w m s hs Gs hv hGs q δ₁ Ξ΅ hmass hcell
have hsub : stageBadEvent e f H Gminus Gplus Ο€.val p βŠ† E βˆͺ F := by
intro ω hω
rcases hΟ‰ with ⟨h,hh,hH,hbad⟩|hbad
Β· by_cases he : h ≀ He
Β· apply Or.inl
apply lt_of_le_of_lt _ hbad
have hb := budget_profile_prefix_certificate e f a G r Ο€ Ο‰ h He he
apply hb.trans
exact measure_mono (fun y hy j l hjl => hshortgap.trans (hy j l hjl))
· obtain ⟨j,hv,hw,hg⟩ := hcover h (not_le.mp he) hH
refine Or.inr ⟨j,h,hv,hw,lt_of_le_of_lt ?_ (hbad.trans_le hp)⟩
exact measure_mono (fun y hy i l hil => hg.trans (hy i l hil))
· obtain ⟨j,hv,hw,hg⟩ := hgrowth
refine Or.inr ⟨j,H,hv,hw,lt_of_le_of_lt ?_ (hbad.trans_le hp)⟩
exact measure_mono (fun y hy i l hil => hg.trans (hy i l hil))
exact (measure_mono hsub).trans ((measure_union_le E F).trans
(by simpa only [add_assoc] using add_le_add hshort hF))
end DirectionalTransience
end
section
open MeasureTheory ProbabilityTheory
open scoped ENNReal BigOperators Classical
namespace DirectionalTransience
lemma noDropProduct_le_raw {d k : β„•} (β„“ : Vector d) (Ο‰ : Environment d)
(hΟ‰ : βˆ€ x H, NoDrop β„“ x ≀ᡐ[quenchedKernel (Ο‰,x)] Cross β„“ x H)
(x : Fin k β†’ Lattice d) (H : β„•) :
ENNReal.ofReal (noDropProduct β„“ x Ο‰) ≀ rawTupleEndpointLaw β„“ H Ο‰ x Set.univ := by
rw [noDropProduct,ENNReal.ofReal_prod_of_nonneg (fun j _ => ENNReal.toReal_nonneg),
rawTupleEndpointLaw,Measure.pi_univ]
apply Finset.prod_le_prod
intro j _
rw [ENNReal.ofReal_toReal (show noDropQuenched β„“ (x j) Ο‰ β‰  ⊀ from measure_ne_top _ _)]
have hh : noDropQuenched β„“ (x j) Ο‰ ≀ crossingQuenched β„“ (x j) H Ο‰ :=
measure_mono_ae (hω (x j) H)
rw [crossingQuenched_eq_hitKernel] at hh
exact hh
lemma fullStream_noDrop_lower {d k : β„•} (Ξ½ : Measure (Row d)) [IsProbabilityMeasure Ξ½]
(β„“ : Vector d) (htrans : DirectionallyTransient Ξ½ β„“) :
βˆ€α΅ Ο‰ βˆ‚environmentLaw Ξ½, βˆ€ (Ο€ : Measure (Fin k β†’ Lattice d)) [IsProbabilityMeasure Ο€],
βˆ€ H : β„•, ENNReal.ofReal (∫ x, noDropProduct β„“ x Ο‰ βˆ‚Ο€) ≀
rawTupleMixture β„“ H Ο€ Ο‰ Set.univ := by
filter_upwards [quenched_noDrop_subset_cross_ae ν ℓ htrans] with ω hω π hπ H
have hI : Integrable (fun x => noDropProduct β„“ x Ο‰) Ο€ :=
integrable_of_nonneg_bound Ο€ (measurable_of_countable _) (fun x => noDropProduct_bounds β„“ x Ο‰)
rw [ofReal_integral_eq_lintegral_ofReal hI (Filter.Eventually.of_forall
(fun x => (noDropProduct_bounds β„“ x Ο‰).1)),rawTupleMixture_apply]
exact lintegral_mono fun x => noDropProduct_le_raw ℓ ω hω x H
theorem fullStream_small_mass_probability {d : β„•} (Ξ½ : Measure (Row d))
[IsProbabilityMeasure Ξ½] (hue : UniformElliptic Ξ½) (β„“ : Vector d)
(hβ„“ : dot β„“ β„“ = 1) (htrans : DirectionallyTransient Ξ½ β„“) (e : Fin d) :
βˆƒ lam C : ℝ, 0 < lam ∧ lam ≀ 1 ∧ 0 < C ∧
βˆ€ Bstar : ℝ, 0 < Bstar β†’ βˆ€ k : β„•, 1 ≀ k β†’ βˆƒ G : β„•,
βˆ€ (Ο€ : Measure (Fin k β†’ Lattice d)) [IsProbabilityMeasure Ο€],
(βˆ€α΅ x βˆ‚Ο€, Pairwise fun i j => (G:β„€) ≀ |x i e-x j e|) β†’
βˆ€ s : ℝ, Real.exp (-Bstar) ≀ s β†’
environmentLaw Ξ½ {Ο‰ | βˆƒ H : β„•, rawTupleMixture β„“ H Ο€ Ο‰ Set.univ < ENNReal.ofReal s} ≀
ENNReal.ofReal (Real.exp (C*k)*s^lam) := by
obtain ⟨lam,C,hlam,hlam1,hC,hb⟩ := separated_initial_inverse_moment Ξ½ hue β„“ hβ„“ htrans e
refine ⟨lam,C,hlam,hlam1,hC,fun Bstar hB k hk => ?_⟩
obtain ⟨G,hG⟩ := hb Bstar hB k hk
refine ⟨G,fun Ο€ hΟ€ hsep s hs => ?_⟩
apply le_trans _ (hG Ο€ hsep s hs)
apply measure_mono_ae
filter_upwards [fullStream_noDrop_lower ν ℓ htrans] with ω hω
rintro ⟨H,hH⟩
have hq := (hω π H).trans_lt hH
have hs0 : 0 < s := (Real.exp_pos _).trans_le hs
have hqs : (∫ x, noDropProduct β„“ x Ο‰ βˆ‚Ο€) < s := (ENNReal.ofReal_lt_ofReal_iff hs0).mp hq
change (∫ x, noDropProduct β„“ x Ο‰ βˆ‚Ο€) < 2*s
linarith
end DirectionalTransience
end
end OAI