Download data/lean/OAI/Probability/LatticeSurface/Geometry/CapWeld.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.94 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LatticeSurface/Geometry/CapWeld.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/LatticeSurface/Geometry/CapWeld.lean
-
curl -L -o CapWeld.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LatticeSurface/Geometry/CapWeld.lean
5.94 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 | |
| namespace OAI | |
| noncomputable section | |
| open MeasureTheory Set | |
| open scoped ENNReal | |
| namespace ExtremalEdges | |
| attribute [local instance] Classical.propDecidable | |
| variable {V : Type*} | |
| def weldHeight (pins : Set V) (w v : V) (h : Free pins β β) (x : V) : β := | |
| if x = w then restore pins (fun _ => 0) h v else restore pins (fun _ => 0) h x | |
| def weldBody (G : SimpleGraph V) (pins : Set V) (w v : V) : Set (Free pins β β) := | |
| {h | β x y, G.Adj x y β |weldHeight pins w v h x - weldHeight pins w v h y| β€ 1} | |
| lemma continuous_weldHeight [Fintype V] (pins : Set V) (w v x : V) : | |
| Continuous (fun h : Free pins β β => weldHeight pins w v h x) := by | |
| by_cases hx : x = w <;> simp only [weldHeight, hx, ite_true, ite_false] | |
| Β· exact continuous_restore pins _ v | |
| Β· exact continuous_restore pins _ x | |
| lemma closed_weldBody [Fintype V] (G : SimpleGraph V) (pins : Set V) (w v : V) : | |
| IsClosed (weldBody G pins w v) := by | |
| simp only [weldBody, Set.ofPred_forall] | |
| exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_iInter fun _ => | |
| isClosed_le ((continuous_weldHeight pins w v x).sub (continuous_weldHeight pins w v y)).abs | |
| continuous_const | |
| lemma restore_boundary_congr (pins : Set V) {b c : V β β} | |
| (hbc : β x β pins, b x = c x) (h : Free pins β β) (x : V) : | |
| restore pins b h x = restore pins c h x := by | |
| by_cases hx : x β pins <;> simp [restore, hx, hbc x] | |
| lemma body_boundary_congr (G : SimpleGraph V) (pins : Set V) {b c : V β β} | |
| (hbc : β x β pins, b x = c x) : | |
| conditionalBody G pins b = conditionalBody G pins c := by | |
| ext h | |
| simp only [conditionalBody, Set.mem_ofPred_eq, restore_boundary_congr pins hbc] | |
| lemma weld_pinned (G : SimpleGraph V) (pins : Set V) (w v : V) | |
| (hw : w β pins) (hv : v β pins) : | |
| weldBody G pins w v = conditionalBody G pins (fun _ => 0) := by | |
| have hh : β h x, weldHeight pins w v h x = restore pins (fun _ => 0) h x := by | |
| intro h x | |
| by_cases hx : x = w | |
| Β· subst x; simp [weldHeight, restore, hw, hv] | |
| Β· simp [weldHeight, hx] | |
| ext h | |
| simp only [weldBody, conditionalBody, Set.mem_ofPred_eq, hh] | |
| def weldBoundary (w v : V) (a : β) (x : V) : β := if x = w β¨ x = v then a else 0 | |
| lemma weld_coordinate (pins : Set V) (w v : V) (hw : w β pins) (hv : v β pins) | |
| (h : Free (insert v pins) β β) (a : β) (x : V) : | |
| weldHeight pins w v ((splitCoordinate pins v hv).symm (h,a)) x = | |
| restore (insert v pins) (weldBoundary w v a) h x := by | |
| have hvw : v β w := fun he => hv (he βΈ hw) | |
| rw [weldHeight, coordinate_restore, coordinate_restore] | |
| by_cases hxw : x = w | |
| Β· subst x | |
| simp [restore, hw, weldBoundary] | |
| Β· by_cases hxv : x = v | |
| Β· subst x | |
| simp [hxw, restore, weldBoundary] | |
| Β· by_cases hxp : x β pins | |
| Β· simp [hxw, hxv, restore, hxp, weldBoundary] | |
| Β· simp [hxw, hxv, restore, hxp] | |
| lemma weld_volume_coordinate [Fintype V] (G : SimpleGraph V) (pins : Set V) | |
| (w v : V) (hw : w β pins) (hv : v β pins) : | |
| volume (weldBody G pins w v) = β«β» a : β, | |
| volume (conditionalBody G (insert v pins) (weldBoundary w v a)) := by | |
| rw [volume_coordinate_slices pins v hv _ (closed_weldBody G pins w v).measurableSet] | |
| apply lintegral_congr | |
| intro a | |
| congr 1 | |
| ext h | |
| simp only [weldBody, conditionalBody, Set.mem_ofPred_eq, weld_coordinate pins w v hw hv] | |
| lemma weld_boundary_extreme (pins : Set V) (w v : V) (a : β) : | |
| (β y β pins, weldBoundary w v a y β€ weldBoundary w v a w) β¨ | |
| (β y β pins, weldBoundary w v a w β€ weldBoundary w v a y) := by | |
| rcases le_total 0 a with ha | ha | |
| Β· left; intro y hy; simp only [weldBoundary, true_or, ite_true]; split_ifs <;> linarith | |
| Β· right; intro y hy; simp only [weldBoundary, true_or, ite_true]; split_ifs <;> linarith | |
| lemma weld_released_body (G : SimpleGraph V) (pins : Set V) (w v : V) (a : β) : | |
| conditionalBody G ((insert v pins) \ {w}) (weldBoundary w v a) = | |
| conditionalBody G ((insert v pins) \ {w}) (Function.update (fun _ => 0) v a) := by | |
| apply body_boundary_congr | |
| intro x hx | |
| have hn : x β w := hx.2 | |
| by_cases hv : x = v | |
| Β· subst x; simp [weldBoundary] | |
| Β· simp [weldBoundary, hn, hv] | |
| lemma volume_body_pin_congr [Fintype V] (G : SimpleGraph V) {p q : Set V} | |
| (hpq : p = q) (b : V β β) : | |
| volume (conditionalBody G p b) = volume (conditionalBody G q b) := by | |
| subst q | |
| rfl | |
| theorem volume_weld_le [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] | |
| (pins : Set V) (w v : V) (hw : w β pins) (hvw : v β w) : | |
| volume (weldBody G pins w v) β€ | |
| 2 ^ G.degree w * volume (conditionalBody G (pins \ {w}) (fun _ => 0)) := by | |
| classical | |
| by_cases hv : v β pins | |
| Β· rw [weld_pinned G pins w v hw hv] | |
| exact volume_release_max_pin G pins w hw (fun _ => 0) (by simp) | |
| Β· have hvs : v β pins \ {w} := fun h => hv h.1 | |
| rw [weld_volume_coordinate G pins w v hw hv, | |
| volume_body_coordinate G (pins \ {w}) (fun _ => 0) v hvs, | |
| β lintegral_const_mul' _ _ (by finiteness)] | |
| apply lintegral_mono | |
| intro a | |
| have hh := volume_release_extreme_pin G (insert v pins) w (Or.inr hw) | |
| (weldBoundary w v a) (weld_boundary_extreme (insert v pins) w v a) | |
| rw [weld_released_body] at hh | |
| have he : (insert v pins) \ {w} = insert v (pins \ {w}) := by | |
| ext x | |
| simp only [mem_sdiff, mem_insert_iff, mem_singleton_iff] | |
| constructor | |
| Β· rintro β¨h,hnβ©; exact h.elim Or.inl (fun hp => Or.inr β¨hp,hnβ©) | |
| Β· rintro (h | h) | |
| Β· subst x; exact β¨Or.inl rfl,hvwβ© | |
| Β· exact β¨Or.inr h.1,h.2β© | |
| rw [volume_body_pin_congr G he _] at hh | |
| exact hh | |
| end ExtremalEdges | |
| end | |
| end OAI | |