Download data/lean/OAI/Probability/LatticeSurface/Geometry/CapContract.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.13 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LatticeSurface/Geometry/CapContract.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/LatticeSurface/Geometry/CapContract.lean
-
curl -L -o CapContract.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LatticeSurface/Geometry/CapContract.lean
6.13 kB
| import Mathlib | |
| import OAI.Probability.LatticeSurface.Convexity.BoundedBase | |
| import OAI.Probability.LatticeSurface.Geometry.CapReflection | |
| import OAI.Probability.LatticeSurface.Geometry.CapSplit | |
| import OAI.Probability.LatticeSurface.Geometry.CapUnpin | |
| import OAI.Probability.LatticeSurface.Geometry.CapWeld | |
| namespace OAI | |
| noncomputable section | |
| open MeasureTheory Set | |
| open scoped ENNReal | |
| namespace ExtremalEdges | |
| attribute [local instance] Classical.propDecidable | |
| variable {V : Type*} | |
| def squash (w v x : V) : V := if x = w then v else x | |
| def contract (G : SimpleGraph V) (w v : V) : SimpleGraph V := G.map (squash w v) | |
| lemma graph_constraint_map (G : SimpleGraph V) (f : V β V) (h : V β β) : | |
| (β x y, (G.map f).Adj x y β |h x-h y| β€ 1) β | |
| (β x y, G.Adj x y β |h (f x)-h (f y)| β€ 1) := by | |
| constructor | |
| Β· intro hh x y hxy | |
| by_cases he : f x = f y | |
| Β· simp [he] | |
| Β· exact hh _ _ (SimpleGraph.map_adj_apply' hxy he) | |
| Β· rintro hh x y β¨hne,a,b,hab,rfl,rflβ© | |
| exact hh a b hab | |
| lemma contracted_body (G : SimpleGraph V) (pins : Set V) (w v : V) : | |
| conditionalBody (contract G w v) pins (fun _ => 0) = weldBody G pins w v := by | |
| ext h | |
| rw [conditionalBody, mem_ofPred_eq, contract, graph_constraint_map] | |
| have hf : β x, restore pins (fun _ => 0) h (squash w v x) = weldHeight pins w v h x := by | |
| intro x | |
| by_cases hx : x = w <;> simp [squash, weldHeight, hx] | |
| simp only [hf, weldBody, mem_ofPred_eq] | |
| lemma degree_map_singleton [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] | |
| (f : V β V) (a : V) (hf : β x, f x = a β x = a) : | |
| (G.map f).degree a β€ G.degree a := by | |
| classical | |
| rw [β SimpleGraph.card_neighborFinset_eq_degree, β SimpleGraph.card_neighborFinset_eq_degree] | |
| refine (Finset.card_le_card (t := (G.neighborFinset a).image f) ?_).trans (Finset.card_image_le) | |
| intro y hy | |
| have hh : (G.map f).Adj a y := by simpa using hy | |
| rcases hh with β¨hne,x,z,hxz,hxa,hzyβ© | |
| have hxa' := hf x hxa | |
| subst x | |
| exact Finset.mem_image.mpr β¨z, by simpa using hxz, hzyβ© | |
| def collapse (W : Finset V) (r : V β V) (x : V) : V := if x β W then r x else x | |
| lemma collapse_empty (r : V β V) : collapse β r = id := by | |
| funext x; simp [collapse] | |
| lemma collapse_insert {W : Finset V} {w : V} {r : V β V} | |
| (hw : w β W) (hr : β x β insert w W, r x β insert w W) : | |
| collapse (insert w W) r = squash w (r w) β collapse W r := by | |
| classical | |
| funext x | |
| have hrr : β y β insert w W, r y β w := fun y hy hh => hr y hy (by simp [hh]) | |
| by_cases hxw : x = w | |
| Β· subst x; simp [collapse, squash, hw] | |
| Β· by_cases hx : x β W | |
| Β· have hn := hrr x (Finset.mem_insert_of_mem hx) | |
| simp [collapse, squash, hx, hxw, hn] | |
| Β· simp [collapse, squash, hx, hxw] | |
| lemma collapse_unique [DecidableEq V] {W : Finset V} {w : V} {r : V β V} | |
| (_hw : w β W) (hr : β x β W, r x β w) : | |
| β x, collapse W r x = w β x = w := by | |
| intro x hh | |
| by_cases hx : x β W | |
| Β· exact False.elim (hr x hx (by simpa [collapse, hx] using hh)) | |
| Β· simpa [collapse, hx] using hh | |
| lemma volume_graph_body_congr [Fintype V] {G H : SimpleGraph V} (h : G = H) | |
| (pins : Set V) (b : V β β) : | |
| volume (conditionalBody G pins b) = volume (conditionalBody H pins b) := by rw [h] | |
| theorem volume_collapsed_body_le [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] | |
| (pins : Set V) (W : Finset V) (r : V β V) (D : β) | |
| (hwp : β w β W, w β pins) (hr : β w β W, r w β W) | |
| (hd : β w β W, G.degree w β€ D) : | |
| volume (conditionalBody (G.map (collapse W r)) (pins βͺ (W : Set V)) (fun _ => 0)) β€ | |
| (2 ^ D) ^ W.card * volume (conditionalBody G pins (fun _ => 0)) := by | |
| classical | |
| induction W using Finset.induction_on with | |
| | empty => | |
| have hg : G.map (collapse β r) = G := by simp [collapse_empty] | |
| rw [hg, volume_body_pin_congr G (show pins βͺ (β : Finset V) = pins by simp) _] | |
| simp | |
| | @insert w W hw ih => | |
| have hwp' : β x β W, x β pins := fun x hx => hwp x (Finset.mem_insert_of_mem hx) | |
| have hr' : β x β W, r x β W := fun x hx ht => hr x (Finset.mem_insert_of_mem hx) | |
| (Finset.mem_insert_of_mem ht) | |
| have hd' : β x β W, G.degree x β€ D := fun x hx => hd x (Finset.mem_insert_of_mem hx) | |
| have ihh := ih hwp' hr' hd' | |
| let H := G.map (collapse W r) | |
| let P : Set V := pins βͺ (insert w W : Finset V) | |
| have hwP : w β P := Or.inr (by simp) | |
| have hvw : r w β w := fun he => hr w (by simp) (by simp [he]) | |
| have heG : G.map (collapse (insert w W) r) = contract H w (r w) := by | |
| rw [collapse_insert hw hr] | |
| exact (SimpleGraph.map_map _ _ _).symm | |
| have hPr : P \ {w} = pins βͺ (W : Set V) := by | |
| ext x | |
| have hnp := hwp w (by simp) | |
| simp only [P, mem_sdiff, mem_union, Finset.mem_coe, Finset.mem_insert, mem_singleton_iff] | |
| constructor | |
| Β· rintro β¨hp | hx,hnβ© | |
| Β· exact Or.inl hp | |
| Β· exact Or.inr (hx.resolve_left hn) | |
| Β· intro hh | |
| refine β¨?_, ?_β© | |
| Β· exact hh.elim Or.inl (fun hx => Or.inr (Or.inr hx)) | |
| Β· intro he | |
| subst x | |
| exact hh.elim hnp hw | |
| have hdeg : H.degree w β€ D := | |
| (degree_map_singleton G (collapse W r) w (collapse_unique hw | |
| (fun x hx hh => hr x (Finset.mem_insert_of_mem hx) (by simp [hh])))).trans | |
| (hd w (by simp)) | |
| have hv := volume_weld_le H P w (r w) hwP hvw | |
| rw [β contracted_body] at hv | |
| rw [volume_body_pin_congr H hPr _] at hv | |
| calc | |
| volume (conditionalBody (G.map (collapse (insert w W) r)) | |
| (pins βͺ (insert w W : Finset V)) (fun _ => 0)) = | |
| volume (conditionalBody (contract H w (r w)) P (fun _ => 0)) := | |
| volume_graph_body_congr heG _ _ | |
| _ β€ 2 ^ H.degree w * volume (conditionalBody H (pins βͺ (W : Set V)) (fun _ => 0)) := hv | |
| _ β€ 2 ^ D * ((2 ^ D) ^ W.card * volume (conditionalBody G pins (fun _ => 0))) := by | |
| apply mul_le_mul' ?_ ihh | |
| exact pow_le_pow_right' (by norm_num) hdeg | |
| _ = _ := by rw [Finset.card_insert_of_notMem hw, pow_succ]; ring | |
| end ExtremalEdges | |
| end | |
| end OAI | |