Download data/lean/OAI/Probability/Ballisticity/Estimates/CellBadEvent.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 10.5 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/Ballisticity/Estimates/CellBadEvent.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/Ballisticity/Estimates/CellBadEvent.lean
-
curl -L -o CellBadEvent.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/Ballisticity/Estimates/CellBadEvent.lean
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 | |