Download data/lean/OAI/Probability/LatticeSurface/Coercivity/SparsePaths.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.64 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LatticeSurface/Coercivity/SparsePaths.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/LatticeSurface/Coercivity/SparsePaths.lean
-
curl -L -o SparsePaths.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LatticeSurface/Coercivity/SparsePaths.lean
2.64 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators | |
| namespace SparsePaths | |
| attribute [local instance] Classical.propDecidable | |
| lemma walk_sum_abs {W : Type*} (G : SimpleGraph W) (h : W β β) | |
| {x y : W} (p : G.Walk x y) : | |
| |h x-h y| β€ (p.darts.map (fun e => |h e.fst-h e.snd|)).sum := by | |
| induction p with | |
| | nil => simp | |
| | @cons x y z hxy p ih => | |
| simpa only [SimpleGraph.Walk.darts_cons,List.map_cons,List.sum_cons] using | |
| (abs_sub_le (h x) (h y) (h z)).trans (add_le_add le_rfl ih) | |
| def dartsMap {W E : Type*} {G : SimpleGraph W} (v : W β E) (e : G.Dart) : E Γ E := | |
| (v e.fst, v e.snd) | |
| lemma dartsMap_injective {W E : Type*} {G : SimpleGraph W} (v : W β E) | |
| (hv : Function.Injective v) : Function.Injective (dartsMap (G := G) v) := by | |
| intro e f hef | |
| apply SimpleGraph.Dart.ext | |
| exact Prod.ext (hv (congrArg Prod.fst hef)) (hv (congrArg Prod.snd hef)) | |
| def edges {W E : Type*} [DecidableEq E] {G : SimpleGraph W} (v : W β E) | |
| {x y : W} (p : G.Walk x y) : Finset (E Γ E) := | |
| (p.darts.map (dartsMap v)).toFinset | |
| lemma card_edges {W E : Type*} [DecidableEq E] {G : SimpleGraph W} | |
| (v : W β E) (hv : Function.Injective v) {x y : W} | |
| (p : G.Walk x y) (hp : p.IsPath) : (edges v p).card = p.length := by | |
| rw [edges,List.toFinset_card_of_nodup] | |
| Β· simp | |
| Β· exact (p.darts_nodup_of_support_nodup hp.support_nodup).map (dartsMap_injective v hv) | |
| lemma sum_edges {W E : Type*} [DecidableEq E] {G : SimpleGraph W} | |
| (v : W β E) (hv : Function.Injective v) {x y : W} | |
| (p : G.Walk x y) (hp : p.IsPath) (h : E β β) : | |
| |h (v x)-h (v y)| β€ β e β edges v p, |h e.1-h e.2| := by | |
| have hn := (p.darts_nodup_of_support_nodup hp.support_nodup).map (dartsMap_injective v hv) | |
| rw [edges,List.sum_toFinset _ hn] | |
| simpa only [List.map_map,Function.comp_def,dartsMap] using walk_sum_abs G (h β v) p | |
| lemma cap_count {E : Type*} [DecidableEq E] (F : Finset E) (a : E β β) | |
| (Ξ΅ : β) (hΞ΅ : 0 < Ξ΅) (ha : β e β F, a e β€ 1) | |
| (hbad : (1-Ξ΅/2)*(F.card : β) < β e β F, a e) : | |
| (F.card : β)/2 β€ ((F.filter (fun e => 1-Ξ΅ β€ a e)).card : β) := by | |
| have hup : β e β F, a e β€ (1-Ξ΅)*(F.card : β) + | |
| Ξ΅*((F.filter (fun e => 1-Ξ΅ β€ a e)).card : β) := by | |
| calc | |
| _ β€ β e β F, ((1-Ξ΅) + if 1-Ξ΅ β€ a e then Ξ΅ else 0) := by | |
| apply Finset.sum_le_sum | |
| intro e he | |
| split_ifs with hh | |
| Β· linarith [ha e he] | |
| Β· linarith | |
| _ = _ := by | |
| simp [Finset.sum_add_distrib,Finset.sum_ite,Finset.sum_const,mul_comm] | |
| ring | |
| nlinarith | |
| end SparsePaths | |
| end | |
| end OAI | |