Download data/lean/OAI/Probability/LatticeSurface/Geometry/BlockVolume.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.45 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LatticeSurface/Geometry/BlockVolume.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/LatticeSurface/Geometry/BlockVolume.lean
-
curl -L -o BlockVolume.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LatticeSurface/Geometry/BlockVolume.lean
6.45 kB
| import Mathlib | |
| import OAI.Probability.LatticeSurface.Geometry.TriangularCover | |
| import OAI.Probability.LatticeSurface.Geometry.TriangularGeometry | |
| namespace OAI | |
| open MeasureTheory | |
| open scoped ENNReal | |
| noncomputable section | |
| namespace TriangularLipschitz | |
| @[simp] lemma mem_interior {L : β} {x : Vertex} : | |
| x β interior L β (1 β€ x.1 β§ x.1 β€ (L : β€) - 1) β§ | |
| (1 β€ x.2 β§ x.2 β€ (L : β€) - 1) := by | |
| simp [interior] | |
| lemma interior_subset_box (L : β) : interior L β box L := by | |
| intro x hx | |
| simp only [mem_interior, mem_box] at hx β’ | |
| omega | |
| @[simp] lemma origin_not_interior (L : β) : (0,0) β interior L := by | |
| simp [mem_interior] | |
| @[simp] lemma filledHeight_free (L : β) (s : Vertex β β) (a : Filling L) | |
| (x : {x : Vertex // x β interior L}) : filledHeight L s a x = a x := | |
| dite_eq_left x.property | |
| @[simp] lemma filledHeight_fixed (L : β) (s : Vertex β β) (a : Filling L) | |
| {x : Vertex} (hx : x β interior L) : filledHeight L s a x = s x := | |
| dite_eq_right hx | |
| lemma continuous_filledHeight (L : β) (s : Vertex β β) (x : Vertex) : | |
| Continuous (fun a : Filling L => filledHeight L s a x) := by | |
| unfold filledHeight | |
| split_ifs with hx | |
| Β· exact continuous_apply (β¨x,hxβ© : {x : Vertex // x β interior L}) | |
| Β· exact continuous_const | |
| lemma isClosed_fillingPolytope (L : β) (s : Vertex β β) : | |
| IsClosed (fillingPolytope L s) := by | |
| simp only [fillingPolytope, Set.ofPred_forall] | |
| exact isClosed_iInter fun x => isClosed_iInter fun _ => | |
| isClosed_iInter fun y => isClosed_iInter fun _ => isClosed_iInter fun _ => | |
| isClosed_le ((continuous_filledHeight L s x).sub | |
| (continuous_filledHeight L s y)).abs continuous_const | |
| lemma measurableSet_fillingPolytope (L : β) (s : Vertex β β) : | |
| MeasurableSet (fillingPolytope L s) := (isClosed_fillingPolytope L s).measurableSet | |
| def filledHeightAffine (L : β) (s : Vertex β β) (x : Vertex) : | |
| Filling L βα΅[β] β := | |
| if hx : x β interior L then (LinearMap.proj β¨x,hxβ©).toAffineMap | |
| else AffineMap.const β _ (s x) | |
| @[simp] lemma filledHeightAffine_apply (L : β) (s : Vertex β β) (x : Vertex) | |
| (a : Filling L) : filledHeightAffine L s x a = filledHeight L s a x := by | |
| unfold filledHeightAffine filledHeight | |
| split_ifs <;> rfl | |
| lemma convex_fillingPolytope (L : β) (s : Vertex β β) : | |
| Convex β (fillingPolytope L s) := by | |
| intro a ha b hb Ξ± Ξ² hΞ± hΞ² hsum x hx y hy hxy | |
| let Ο := filledHeightAffine L s x - filledHeightAffine L s y | |
| have hΟ : β c, Ο c = filledHeight L s c x - filledHeight L s c y := by | |
| intro c | |
| simp only [Ο, AffineMap.coe_sub, Pi.sub_apply, filledHeightAffine_apply] | |
| have h := ((convex_Icc (-1 : β) 1).affine_preimage Ο) | |
| (show Ο a β Set.Icc (-1) 1 by rw [hΟ]; exact abs_le.mp (ha x hx y hy hxy)) | |
| (show Ο b β Set.Icc (-1) 1 by rw [hΟ]; exact abs_le.mp (hb x hx y hy hxy)) | |
| hΞ± hΞ² hsum | |
| rw [Set.mem_preimage, hΟ] at h | |
| exact abs_le.mpr h | |
| lemma latticeDist_origin_le {L : β} {x : Vertex} (hx : x β box L) : | |
| latticeDist x (0,0) β€ 2 * (L : β) := by | |
| obtain β¨β¨hx0,hxLβ©,β¨hy0,hyLβ©β© := mem_box.mp hx | |
| have hx0' : (0 : β) β€ x.1 := by exact_mod_cast hx0 | |
| have hy0' : (0 : β) β€ x.2 := by exact_mod_cast hy0 | |
| have hxL' : (x.1 : β) β€ L := by exact_mod_cast hxL | |
| have hyL' : (x.2 : β) β€ L := by exact_mod_cast hyL | |
| simp only [latticeDist, Int.cast_zero, sub_zero, abs_of_nonneg hx0', | |
| abs_of_nonneg hy0', abs_of_nonneg (add_nonneg hx0' hy0'), max_le_iff] | |
| constructor | |
| Β· constructor <;> linarith | |
| Β· linarith | |
| lemma fillingPolytope_subset_closedBall (L : β) (s : Vertex β β) : | |
| fillingPolytope L s β Metric.closedBall (fun _ => s (0,0) : Filling L) (2*L) := by | |
| intro a ha | |
| rw [Metric.mem_closedBall, dist_pi_le_iff (by positivity : (0 : β) β€ 2*L)] | |
| intro x | |
| have h := near_global_bound ha (interior_subset_box L x.property) | |
| (show (0,0) β box L by simp) | |
| rw [filledHeight_free, filledHeight_fixed _ _ _ (origin_not_interior L), one_mul] at h | |
| exact h.trans (latticeDist_origin_le (interior_subset_box L x.property)) | |
| lemma fillingVolume_lt_top (L : β) (s : Vertex β β) : fillingVolume L s < β€ := | |
| (measure_mono (fillingPolytope_subset_closedBall L s)).trans_lt measure_closedBall_lt_top | |
| lemma isCompact_fillingPolytope (L : β) (s : Vertex β β) : | |
| IsCompact (fillingPolytope L s) := | |
| (isCompact_closedBall _ _).of_isClosed_subset (isClosed_fillingPolytope L s) | |
| (fillingPolytope_subset_closedBall L s) | |
| lemma filledHeight_center (L : β) (h : Vertex β β) (x : Vertex) : | |
| filledHeight L h (fun x => h x) x = h x := by | |
| unfold filledHeight | |
| split_ifs <;> rfl | |
| lemma filledHeight_perturbation (L : β) (h : Vertex β β) (a : Filling L) (x : Vertex) : | |
| |filledHeight L h a x - h x| β€ βa - (fun x => h x : Filling L)β := by | |
| by_cases hx : x β interior L | |
| Β· rw [filledHeight, dite_eq_left hx] | |
| exact norm_le_pi_norm (a - (fun x => h x : Filling L)) β¨x,hxβ© | |
| Β· rw [filledHeight_fixed _ _ _ hx, sub_self, abs_zero] | |
| exact norm_nonneg _ | |
| lemma ball_subset_fillingPolytope {L : β} {h : Vertex β β} {Ξ΄ : β} | |
| (hne : β x β box L, β y β box L, Adj x y β |h x-h y| β€ 1-Ξ΄) : | |
| Metric.ball (fun x => h x : Filling L) (Ξ΄/4) β fillingPolytope L h := by | |
| intro a ha x hx y hy hxy | |
| have hnorm : βa - (fun x => h x : Filling L)β < Ξ΄/4 := by | |
| simpa only [Metric.mem_ball, dist_eq_norm] using ha | |
| have hxerr := filledHeight_perturbation L h a x | |
| have hyerr := filledHeight_perturbation L h a y | |
| have hed := hne x hx y hy hxy | |
| have htri : |filledHeight L h a x-filledHeight L h a y| β€ | |
| |filledHeight L h a x-h x| + |h x-h y| + |filledHeight L h a y-h y| := by | |
| calc | |
| _ β€ |filledHeight L h a x-h x| + |h x-filledHeight L h a y| := abs_sub_le _ _ _ | |
| _ β€ _ := by | |
| have ht := abs_sub_le (h x) (h y) (filledHeight L h a y) | |
| rw [abs_sub_comm (h y)] at ht | |
| linarith | |
| have hn := norm_nonneg (a - (fun x => h x : Filling L)) | |
| linarith | |
| lemma fillingVolume_pos_of_strict {L : β} {h : Vertex β β} {Ξ΄ : β} (hΞ΄ : 0 < Ξ΄) | |
| (hne : β x β box L, β y β box L, Adj x y β |h x-h y| β€ 1-Ξ΄) : | |
| 0 < fillingVolume L h := | |
| (Metric.measure_ball_pos volume _ (by positivity : 0 < Ξ΄/4)).trans_le | |
| (measure_mono (ball_subset_fillingPolytope hne)) | |
| end TriangularLipschitz | |
| end | |
| end OAI | |