Download data/lean/OAI/Probability/CriticalPercolation/Clusters/ClusterObject.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.95 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Clusters/ClusterObject.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/Clusters/ClusterObject.lean
-
curl -L -o ClusterObject.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Clusters/ClusterObject.lean
7.95 kB
| import Mathlib | |
| import OAI.Probability.CriticalPercolation.GraphGeometry.VertexBall | |
| import OAI.Probability.CriticalPercolation.ProductMeasure.Distribution | |
| namespace OAI | |
| section | |
| section | |
| open Set MeasureTheory ProbabilityTheory | |
| open Set | |
| open scoped BigOperators | |
| namespace CriticalPercolation.BondGraph | |
| open ClusterDeletion FiniteProduct | |
| open scoped Classical | |
| variable {V E : Type*} (G : BondGraph V E) | |
| abbrev ClusterObject (V E : Type*) := Set V Γ Set E | |
| def clusterObject (Ο : Set E) (S : Set V) : ClusterObject V E := | |
| (roots (G.openGraph Ο) S, Ο β© G.incidentEdges (roots (G.openGraph Ο) S)) | |
| def eraseVertices (Ο : Set E) (U : Set V) : Set E := Ο \ G.incidentEdges U | |
| lemma incidentEdges_mono {S T : Set V} (h : S β T) : G.incidentEdges S β G.incidentEdges T := by | |
| rintro e β¨v, hv, heβ© | |
| exact β¨v, h hv, heβ© | |
| lemma clusterObject_mono {Ο Ο' : Set E} (h : Ο β Ο') (S : Set V) : | |
| G.clusterObject Ο S β€ G.clusterObject Ο' S := by | |
| have hr := roots_mono (SimpleGraph.fromEdgeSet_mono (Set.image_mono (f := G.ends) h)) S | |
| exact β¨hr, fun _ he => β¨h he.1, G.incidentEdges_mono hr he.2β©β© | |
| lemma eraseVertices_mono {Ο Ο' : Set E} (h : Ο β Ο') (U : Set V) : | |
| G.eraseVertices Ο U β G.eraseVertices Ο' U := | |
| fun _ he => β¨h he.1, he.2β© | |
| lemma eraseVertices_antitone {U U' : Set V} (h : U β U') (Ο : Set E) : | |
| G.eraseVertices Ο U' β G.eraseVertices Ο U := | |
| fun _ he => β¨he.1, fun hh => he.2 (G.incidentEdges_mono h hh)β© | |
| lemma openGraph_eraseVertices (Ο : Set E) (U : Set V) : | |
| G.openGraph (G.eraseVertices Ο U) = delete (G.openGraph Ο) U := by | |
| ext v w | |
| simp only [openGraph, SimpleGraph.fromEdgeSet_adj, Set.mem_image, | |
| eraseVertices, Set.mem_sdiff, delete] | |
| constructor | |
| Β· rintro β¨β¨e, β¨he, hUβ©, heqβ©, hneβ© | |
| refine β¨β¨β¨e, he, heqβ©, hneβ©, ?_, ?_β© | |
| Β· intro hv | |
| exact hU β¨v, hv, by simp [heq]β© | |
| Β· intro hw | |
| exact hU β¨w, hw, by simp [heq]β© | |
| Β· rintro β¨β¨β¨e, he, heqβ©, hneβ©, hv, hwβ© | |
| refine β¨β¨e, β¨he, ?_β©, heqβ©, hneβ© | |
| rintro β¨t, ht, hteβ© | |
| rw [heq] at hte | |
| rcases (by simpa using hte : t = v β¨ t = w) with rfl | rfl | |
| Β· exact hv ht | |
| Β· exact hw ht | |
| lemma eraseVertices_dependsOn (U : Set V) : | |
| DependsOn (fun Ο : Set E => G.eraseVertices Ο U) (G.incidentEdges U)αΆ := by | |
| intro Ο Ο' hΟ | |
| ext e | |
| change (Ο e β§ e β G.incidentEdges U) β (Ο' e β§ e β G.incidentEdges U) | |
| by_cases he : e β G.incidentEdges U | |
| Β· simp [he] | |
| Β· rw [(hΟ e he).to_iff] | |
| lemma clusterObject_eq_of_incident {S : Set V} {C : ClusterObject V E} {Ο Ο' : Set E} | |
| (hC : G.clusterObject Ο S = C) | |
| (hΟ : β e β G.incidentEdges C.1, e β Ο β e β Ο') : | |
| G.clusterObject Ο' S = C := by | |
| have hr : roots (G.openGraph Ο) S = C.1 := congrArg Prod.fst hC | |
| have hr' := G.roots_eq_of_incident hr hΟ | |
| apply Prod.ext hr' | |
| change Ο' β© G.incidentEdges (roots (G.openGraph Ο') S) = C.2 | |
| have he : Ο β© G.incidentEdges (roots (G.openGraph Ο) S) = C.2 := congrArg Prod.snd hC | |
| rw [hr] at he | |
| rw [hr', β he] | |
| ext e | |
| constructor | |
| Β· intro hh | |
| exact β¨(hΟ e hh.2).mpr hh.1, hh.2β© | |
| Β· intro hh | |
| exact β¨(hΟ e hh.2).mp hh.1, hh.2β© | |
| lemma dependsOn_exact_clusterObject (S : Set V) (C : ClusterObject V E) : | |
| DependsOn (fun Ο : Set E => G.clusterObject Ο S = C) (G.incidentEdges C.1) := by | |
| intro Ο Ο' hΟ | |
| apply propext | |
| constructor | |
| Β· exact fun h => G.clusterObject_eq_of_incident h (fun e he => (hΟ e he).to_iff) | |
| Β· exact fun h => G.clusterObject_eq_of_incident h (fun e he => (hΟ e he).symm.to_iff) | |
| lemma roots_disjoint_symm (Ο : Set E) (A B : Set V) : | |
| Disjoint (roots (G.openGraph Ο) A) B β Disjoint (roots (G.openGraph Ο) B) A := by | |
| simp only [Set.disjoint_left] | |
| constructor | |
| Β· rintro h a β¨b, hb, hbaβ© ha | |
| exact h β¨a, ha, hba.symmβ© hb | |
| Β· rintro h b β¨a, ha, habβ© hb | |
| exact h β¨b, hb, hab.symmβ© ha | |
| lemma roots_disjoint_roots (Ο : Set E) {A B : Set V} | |
| (h : Disjoint (roots (G.openGraph Ο) A) B) : | |
| Disjoint (roots (G.openGraph Ο) A) (roots (G.openGraph Ο) B) := by | |
| rw [Set.disjoint_left] at h β’ | |
| rintro v β¨a, ha, havβ© β¨b, hb, hbvβ© | |
| exact h β¨a, ha, hav.trans hbv.symmβ© hb | |
| lemma roots_erase_roots (Ο : Set E) {A B : Set V} | |
| (h : Disjoint (roots (G.openGraph Ο) A) B) : | |
| roots (G.openGraph (G.eraseVertices Ο (roots (G.openGraph Ο) A))) B = | |
| roots (G.openGraph Ο) B := by | |
| rw [G.openGraph_eraseVertices] | |
| ext v | |
| constructor | |
| Β· exact fun hv => roots_mono (delete_le _ _) _ hv | |
| Β· rintro β¨b, hb, hbvβ© | |
| refine β¨b, hb, ?_β© | |
| change v β component (delete (G.openGraph Ο) (roots (G.openGraph Ο) A)) b | |
| rw [delete_roots_component _ _ _ (fun hh => Set.disjoint_left.mp h hh hb)] | |
| exact hbv | |
| lemma openBond_roots {Ο : Set E} {S : Set V} {e : E} (he : e β Ο) | |
| {v w : V} (hv : v β G.ends e) (hw : w β G.ends e) | |
| (hr : v β roots (G.openGraph Ο) S) : w β roots (G.openGraph Ο) S := by | |
| by_cases hvw : v = w | |
| Β· simpa [β hvw] using hr | |
| Β· have heq : G.ends e = s(v,w) := Sym2.eq_of_ne_mem hvw hv hw (by simp) (by simp) | |
| exact roots_closed hr ((SimpleGraph.fromEdgeSet_adj _).mpr | |
| β¨β¨e, he, heqβ©, hvwβ©) | |
| lemma clusterObject_erase_other (Ο : Set E) {A B : Set V} | |
| (h : Disjoint (G.clusterObject Ο A).1 B) : | |
| G.clusterObject (G.eraseVertices Ο (G.clusterObject Ο A).1) B = G.clusterObject Ο B := by | |
| have hr := G.roots_erase_roots Ο h | |
| apply Prod.ext hr | |
| change G.eraseVertices Ο (roots (G.openGraph Ο) A) β© | |
| G.incidentEdges (roots (G.openGraph (G.eraseVertices Ο (roots (G.openGraph Ο) A))) B) = | |
| Ο β© G.incidentEdges (roots (G.openGraph Ο) B) | |
| rw [hr] | |
| ext e | |
| constructor | |
| Β· exact fun hh => β¨hh.1.1, hh.2β© | |
| Β· rintro β¨he, hiβ© | |
| refine β¨β¨he, ?_β©, hiβ© | |
| rintro β¨a, ha, haeβ© | |
| obtain β¨b, hb, hbeβ© := hi | |
| exact Set.disjoint_left.mp (G.roots_disjoint_roots Ο h) ha | |
| (G.openBond_roots he hbe hae hb) | |
| lemma clusterObject_exposure [Fintype V] [Fintype E] | |
| (w : E β Prop β β) (hw : β e, β b, w e b = 1) | |
| (S : Set V) (F : ClusterObject V E β Set E β β) : | |
| expect w (fun Ο => F (G.clusterObject Ο S) | |
| (G.eraseVertices Ο (G.clusterObject Ο S).1)) = | |
| expect w (fun Ο => expect w (fun Ο' => F (G.clusterObject Ο S) | |
| (G.eraseVertices Ο' (G.clusterObject Ο S).1))) := by | |
| classical | |
| exact expect_exposure w hw (fun Ο => G.clusterObject Ο S) | |
| (fun C => G.incidentEdges C.1) (G.dependsOn_exact_clusterObject S) | |
| (fun C Ο => F C (G.eraseVertices Ο C.1)) | |
| (fun C _ _ hΟ => congrArg (F C) (G.eraseVertices_dependsOn C.1 hΟ)) | |
| lemma clusterObject_avoidance_exposure [Fintype V] [Fintype E] | |
| (w : E β Prop β β) (hw : β e, β b, w e b = 1) | |
| (A B : Set V) (F : ClusterObject V E β ClusterObject V E β β) : | |
| expect w (fun Ο => if Disjoint (G.clusterObject Ο A).1 B then | |
| F (G.clusterObject Ο A) (G.clusterObject Ο B) else 0) = | |
| expect w (fun Ο => if Disjoint (G.clusterObject Ο A).1 B then | |
| expect w (fun Ο' => F (G.clusterObject Ο A) | |
| (G.clusterObject (G.eraseVertices Ο' (G.clusterObject Ο A).1) B)) else 0) := by | |
| classical | |
| have he := G.clusterObject_exposure w hw A | |
| (fun C Ο => if Disjoint C.1 B then F C (G.clusterObject Ο B) else 0) | |
| have hl : (fun Ο : E β Prop => if Disjoint (G.clusterObject Ο A).1 B then | |
| F (G.clusterObject Ο A) | |
| (G.clusterObject (G.eraseVertices Ο (G.clusterObject Ο A).1) B) else 0) = | |
| (fun Ο => if Disjoint (G.clusterObject Ο A).1 B then | |
| F (G.clusterObject Ο A) (G.clusterObject Ο B) else 0) := by | |
| funext Ο | |
| split_ifs with h | |
| Β· rw [G.clusterObject_erase_other Ο h] | |
| Β· rfl | |
| rw [hl] at he | |
| refine he.trans ?_ | |
| congr 1 | |
| funext Ο | |
| split_ifs <;> simp [expect_zero] | |
| end CriticalPercolation.BondGraph | |
| end | |
| end | |
| end OAI | |