Download data/lean/OAI/Probability/GammaPassage/CrossingLocalized.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.61 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/GammaPassage/CrossingLocalized.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/GammaPassage/CrossingLocalized.lean
-
curl -L -o CrossingLocalized.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/GammaPassage/CrossingLocalized.lean
6.61 kB
| import OAI.Probability.GammaPassage.GridIndependence | |
| import OAI.Probability.GammaPassage.OriginEscape | |
| namespace OAI | |
| namespace GammaFPP.CrossingBridge | |
| open PlanarFPP Set Finset MeasureTheory ProbabilityTheory | |
| abbrev PathIn := IntervalTravelBridge.PathIn | |
| abbrev DependsOnEdges := Grid.DependsOnEdges | |
| @[simp] theorem pathIn_iff_interval (p : Vertex) (ds : List Step) (S : Set Vertex) : | |
| PathIn p ds S β IntervalTravelBridge.PathIn p ds S := Iff.rfl | |
| @[simp] theorem depends_iff_grid (A : Set (Edge β β)) (S : Finset Edge) : | |
| DependsOnEdges A S β Grid.DependsOnEdges A S := Iff.rfl | |
| def edgeEnd (e : Edge) : Vertex := e.1 + if e.2 then (0,1) else (1,0) | |
| def internalEdges (V : Finset Vertex) : Finset Edge := | |
| (V ΓΛ’ Finset.univ).filter (fun e => edgeEnd e β V) | |
| theorem mem_internalEdges (e : Edge) (V : Finset Vertex) : | |
| e β internalEdges V β e.1 β V β§ edgeEnd e β V := by | |
| simp [internalEdges] | |
| theorem internalEdges_card_le (V : Finset Vertex) : (internalEdges V).card β€ 2*V.card := by | |
| have h := Finset.card_filter_le (s := V ΓΛ’ (Finset.univ : Finset Bool)) (fun e => edgeEnd e β V) | |
| simpa [internalEdges,Nat.mul_comm] using h | |
| theorem step_mem_internalEdges (V : Finset Vertex) (p : Vertex) (d : Step) | |
| (hp : p β V) (hq : p+d.delta β V) : d.edge p β internalEdges V := by | |
| rw [mem_internalEdges] | |
| cases d <;> simp_all [Step.edge,Step.delta,edgeEnd,add_assoc] | |
| all_goals change p+0 β V; simpa using hp | |
| theorem internalEdges_disjoint {V W : Finset Vertex} (h : Disjoint V W) : | |
| Disjoint (internalEdges V) (internalEdges W) := by | |
| apply Finset.disjoint_left.mpr | |
| intro e he hf | |
| exact Finset.disjoint_left.mp h (mem_internalEdges e V |>.mp he).1 | |
| (mem_internalEdges e W |>.mp hf).1 | |
| def pathEdges (p : Vertex) : List Step β Finset Edge | |
| | [] => β | |
| | d::ds => insert (d.edge p) (pathEdges (p+d.delta) ds) | |
| theorem pathIn_cons_iff (p : Vertex) (d : Step) (ds : List Step) (S : Set Vertex) : | |
| PathIn p (d::ds) S β p β S β§ PathIn (p+d.delta) ds S := by | |
| constructor | |
| Β· intro h | |
| refine β¨by simpa using h 0 (by simp),?_β© | |
| intro i hi | |
| have hh := h (i+1) (by simpa using hi) | |
| simpa only [List.take_succ_cons,displacement_cons,add_assoc] using hh | |
| Β· rintro β¨hp,htβ© i hi | |
| cases i with | |
| | zero => simpa using hp | |
| | succ i => | |
| have hh := ht i (by simpa using hi) | |
| simpa only [List.take_succ_cons,displacement_cons,add_assoc] using hh | |
| theorem pathIn_endpoint (p : Vertex) (ds : List Step) (S : Set Vertex) | |
| (h : PathIn p ds S) : p+displacement ds β S := by | |
| simpa using h ds.length le_rfl | |
| theorem pathEdges_subset_internalEdges (V : Finset Vertex) (p : Vertex) (ds : List Step) | |
| (h : PathIn p ds (V : Set Vertex)) : pathEdges p ds β internalEdges V := by | |
| induction ds generalizing p with | |
| | nil => simp [pathEdges] | |
| | cons d ds ih => | |
| obtain β¨hp,htβ© := (pathIn_cons_iff p d ds _).mp h | |
| have hq : p+d.delta β V := by simpa using ht 0 (by omega) | |
| intro e he | |
| rcases Finset.mem_insert.mp he with he | he | |
| Β· rw [he] | |
| exact step_mem_internalEdges V p d hp hq | |
| Β· exact ih (p+d.delta) ht he | |
| theorem pathCost_eq_of_agree (w w' : Edge β β) (p : Vertex) (ds : List Step) | |
| (h : β e β pathEdges p ds, w e=w' e) : pathCost w p ds=pathCost w' p ds := by | |
| induction ds generalizing p with | |
| | nil => rfl | |
| | cons d ds ih => | |
| simp only [pathCost] | |
| rw [h (d.edge p) (by simp [pathEdges])] | |
| rw [ih (p+d.delta) (fun e he => h e (by simp [pathEdges,he]))] | |
| def strictLocalizedEvent (V : Finset Vertex) (family : Vertex β List Step β Prop) | |
| (bound : Vertex β List Step β β) : Set (Edge β β) := | |
| {w | β p ds, family p ds β§ PathIn p ds (V : Set Vertex) β§ pathCost w p ds < bound p ds} | |
| def boundedLocalizedEvent (V : Finset Vertex) (family : Vertex β List Step β Prop) | |
| (bound : Vertex β List Step β β) : Set (Edge β β) := | |
| {w | β p ds, family p ds β§ PathIn p ds (V : Set Vertex) β§ pathCost w p ds β€ bound p ds} | |
| theorem measurableSet_strictLocalizedEvent (V : Finset Vertex) | |
| (family : Vertex β List Step β Prop) (bound : Vertex β List Step β β) : | |
| MeasurableSet (strictLocalizedEvent V family bound) := by | |
| simpa only [strictLocalizedEvent,and_assoc] using | |
| measurableSet_strict_path_event (Ο := fun e (w : Edge β β) => w e) measurable_pi_apply | |
| (fun p ds => family p ds β§ PathIn p ds (V : Set Vertex)) bound | |
| theorem measurableSet_boundedLocalizedEvent (V : Finset Vertex) | |
| (family : Vertex β List Step β Prop) (bound : Vertex β List Step β β) : | |
| MeasurableSet (boundedLocalizedEvent V family bound) := by | |
| simpa only [boundedLocalizedEvent,and_assoc] using | |
| measurableSet_bounded_path_event (Ο := fun e (w : Edge β β) => w e) measurable_pi_apply | |
| (fun p ds => family p ds β§ PathIn p ds (V : Set Vertex)) bound | |
| theorem strictLocalizedEvent_depends (V : Finset Vertex) | |
| (family : Vertex β List Step β Prop) (bound : Vertex β List Step β β) : | |
| DependsOnEdges (strictLocalizedEvent V family bound) (internalEdges V) := by | |
| intro w w' hh | |
| have hc (p ds) (hin : PathIn p ds (V : Set Vertex)) : pathCost w p ds=pathCost w' p ds := | |
| pathCost_eq_of_agree w w' p ds (fun e he => hh e (pathEdges_subset_internalEdges V p ds hin he)) | |
| constructor | |
| Β· rintro β¨p,ds,hf,hin,hcostβ© | |
| exact β¨p,ds,hf,hin,by rwa [β hc p ds hin]β© | |
| Β· rintro β¨p,ds,hf,hin,hcostβ© | |
| exact β¨p,ds,hf,hin,by rwa [hc p ds hin]β© | |
| theorem boundedLocalizedEvent_depends (V : Finset Vertex) | |
| (family : Vertex β List Step β Prop) (bound : Vertex β List Step β β) : | |
| DependsOnEdges (boundedLocalizedEvent V family bound) (internalEdges V) := by | |
| intro w w' hh | |
| have hc (p ds) (hin : PathIn p ds (V : Set Vertex)) : pathCost w p ds=pathCost w' p ds := | |
| pathCost_eq_of_agree w w' p ds (fun e he => hh e (pathEdges_subset_internalEdges V p ds hin he)) | |
| constructor | |
| Β· rintro β¨p,ds,hf,hin,hcostβ© | |
| exact β¨p,ds,hf,hin,by rwa [β hc p ds hin]β© | |
| Β· rintro β¨p,ds,hf,hin,hcostβ© | |
| exact β¨p,ds,hf,hin,by rwa [hc p ds hin]β© | |
| theorem strip_vertices_disjoint (V W : Finset Vertex) (b y z R : β) | |
| (hV : β v β V, |transverse b v-y| β€ R) | |
| (hW : β v β W, |transverse b v-z| β€ R) | |
| (hsep : 2*R < |y-z|) : Disjoint V W := by | |
| apply Finset.disjoint_left.mpr | |
| intro v hv hw | |
| have ht := abs_add_le (y-transverse b v) (transverse b v-z) | |
| rw [sub_add_sub_cancel,abs_sub_comm y (transverse b v)] at ht | |
| have h1 := hV v hv | |
| have h2 := hW v hw | |
| linarith | |
| end GammaFPP.CrossingBridge | |
| end OAI | |