Download data/lean/OAI/Geometry/CAT0Fillings/Gradient/ClosedLinear.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 10.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/CAT0Fillings/Gradient/ClosedLinear.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/CAT0Fillings/Gradient/ClosedLinear.lean
-
curl -L -o ClosedLinear.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/CAT0Fillings/Gradient/ClosedLinear.lean
10.6 kB
| import Mathlib | |
| import OAI.Geometry.CAT0Fillings.Gradient.CyclePairing | |
| namespace OAI | |
| section | |
| open Set Filter MeasureTheory Matrix | |
| open scoped Topology ENNReal NNReal BigOperators | |
| namespace CAT0Fillings.ChartGeometry | |
| variable {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] | |
| [CompactSpace X] [Nonempty X] {n : β} {T : Functional X n} | |
| {hT : IsMetricCurrent T} (q : ChartGeometry hT) | |
| lemma exists_inverse_coordinates (i : β) : | |
| β (F : Fin n β X β β) (K : ββ₯0), (β a, LipschitzWith K (F a)) β§ | |
| βα΅ z βvolume.restrict (q.chart i).domain, | |
| β a, q.covector i (F a) z = (1 : Matrix (Fin n) (Fin n) β) a := by | |
| obtain β¨Kβ,Kβ,hKβ,hKββ© := (q.chart i).bilipschitz | |
| have hrow : β a y (hy : y β (q.chart i).domain) z (hz : z β (q.chart i).domain), | |
| |EuclideanSpace.proj a y-EuclideanSpace.proj a z| β€ | |
| (Kβ : β)*dist ((q.chart i).param β¨y,hyβ©) ((q.chart i).param β¨z,hzβ©) := by | |
| intro a y hy z hz | |
| have h := PiLp.norm_apply_le (p := (2 : ββ₯0β)) (y-z) a | |
| have he : |EuclideanSpace.proj a y-EuclideanSpace.proj a z| β€ dist y z := by | |
| change |y.ofLp a-z.ofLp a| β€ βy-zβ | |
| simpa only [Real.norm_eq_abs,PiLp.sub_apply] using h | |
| exact he.trans (hKβ.le_mul_dist β¨y,hyβ© β¨z,hzβ©) | |
| obtain β¨F,hF,hFeq,_β© := (q.chart i).exists_inverse_coordinate_tests | |
| (q.chart i).borel subset_rfl (fun a => EuclideanSpace.proj a) Kβ hrow | |
| refine β¨F,Kβ,hF,?_β© | |
| rw [eventually_all] | |
| intro a | |
| have h := (q.chart i).ae_fderivWithin_scalar_eq_linear (q.chart i).borel subset_rfl | |
| (hF a) (EuclideanSpace.proj a) (hFeq a) | |
| filter_upwards [h] with z hz | |
| ext b | |
| unfold covector | |
| rw [hz] | |
| change (EuclideanSpace.single b (1 : β)).ofLp a = (1 : Matrix (Fin n) (Fin n) β) a b | |
| simp [Matrix.one_apply] | |
| lemma ae_coordinate_density_pos (i : β) : | |
| βα΅ z βq.coordinateMeasure i, 0 < q.density i z := by | |
| apply (ae_withDensity_iff' (q.density_integrable i).aestronglyMeasurable.aemeasurable.ennreal_ofReal).mpr | |
| exact Eventually.of_forall fun z hz => lt_of_not_ge (fun h => hz (ENNReal.ofReal_eq_zero.mpr h)) | |
| lemma ae_multiplicity_ne_zero (i : β) : | |
| βα΅ z βq.coordinateMeasure i, ((q.chart i).multiplicity z : β) β 0 := by | |
| filter_upwards [q.ae_coordinate_density_pos i] with z hz | |
| intro he | |
| simp only [density,he,abs_zero,zero_mul] at hz | |
| exact lt_irrefl 0 hz | |
| end CAT0Fillings.ChartGeometry | |
| end | |
| section | |
| open Set Filter MeasureTheory Matrix | |
| open scoped Topology ENNReal NNReal BigOperators | |
| namespace CAT0Fillings.ChartGeometry | |
| variable {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] | |
| [CompactSpace X] [Nonempty X] {k : β} {T : Functional X (k+1)} | |
| {hT : IsMetricCurrent T} (q : ChartGeometry hT) | |
| lemma eq_zero_of_pairing_null (L : Lp (Euc (k+1)) 2 q.atlasMeasure) | |
| (hnull : β (Ο : Fin k β X β β) (K : Fin k β ββ₯0), | |
| (β j, LipschitzWith (K j) (Ο j)) β β b, BoundedLip b β q.pairing Ο b L = 0) : | |
| L = 0 := by | |
| apply Lp.ext | |
| apply EventuallyEq.trans _ (Lp.coeFn_zero (Euc (k+1)) 2 q.atlasMeasure).symm | |
| apply Measure.ae_sum_iff.mpr | |
| intro i | |
| apply (measurableEmbedding_prodMk_left i).ae_map_iff.mpr | |
| obtain β¨F,K,hF,hrowsβ© := q.exists_inverse_coordinates i | |
| have hzero : βα΅ z βq.coordinateMeasure i, β a : Fin (k+1), | |
| q.testWeight (fun j => F (Equiv.swap 0 a j.succ)) L (i,z) = 0 := by | |
| rw [eventually_all] | |
| intro a | |
| have hh := q.testWeight_eq_zero_of_pairings (fun j => F (Equiv.swap 0 a j.succ)) | |
| (fun _ => K) (fun j => hF _) L (hnull _ _ (fun j => hF _)) | |
| exact (measurableEmbedding_prodMk_left i).ae_map_iff.mp (Measure.ae_sum_iff.mp hh i) | |
| have hrows' := (withDensity_absolutelyContinuous _ (fun z => ENNReal.ofReal (q.density i z))).ae_le hrows | |
| have hdiff := (withDensity_absolutelyContinuous _ (fun z => ENNReal.ofReal (q.density i z))).ae_le (q.differential i) | |
| filter_upwards [hzero,hrows',hdiff,q.ae_multiplicity_ne_zero i] with z hz hr hd hΞΈ | |
| have hG : (q.gram i z).PosDef := polarizationMatrix_posDef _ _ hd.2.2 hd.2.1 | |
| have hJ : Real.sqrt (q.gram i z).det β 0 := (Real.sqrt_pos.mpr hG.det_pos).ne' | |
| have hraw : rawCovector (q.gram i z) (L (i,z)) = 0 := by | |
| funext a | |
| apply component_zero_of_omitted_det _ a | |
| have hh := hz a | |
| change ((_ : β)/abs _) * normalizedDet _ _ _ = 0 at hh | |
| have hh' := (mul_eq_zero.mp hh).resolve_left (div_ne_zero hΞΈ (abs_ne_zero.mpr hΞΈ)) | |
| unfold normalizedDet at hh' | |
| have he : (fun j : Fin k => q.covector i (F (Equiv.swap 0 a j.succ)) z) = | |
| fun j => (1 : Matrix (Fin (k+1)) (Fin (k+1)) β) (Equiv.swap 0 a j.succ) := by | |
| funext j | |
| exact hr _ | |
| rw [he] at hh' | |
| exact (div_eq_zero_iff.mp hh').resolve_right hJ | |
| have he := normalize_rawCovector (q.gram i z) hG (L (i,z)) | |
| rw [hraw,Matrix.mulVec_zero] at he | |
| apply (WithLp.equiv 2 (Fin (k+1) β β)).injective | |
| exact he.symm | |
| theorem gradient_closable (hz : IsCycle T) | |
| (u : β β X β β) (Ku : β β ββ₯0) (hu : β j, LipschitzWith (Ku j) (u j)) | |
| (hu0 : Tendsto (fun j => lpNorm (u j) 2 (MassMeasure.currentMassMeasure hT)) atTop (π 0)) | |
| (L : Lp (Euc (k+1)) 2 q.atlasMeasure) | |
| (hL : Tendsto (fun j => q.gradient (hu j)) atTop (π L)) : L = 0 := by | |
| apply q.eq_zero_of_pairing_null L | |
| intro Ο K hΟ b hb | |
| exact q.pairing_eq_zero_of_gradient_limit hz u Ku hu hu0 L hL Ο K hΟ hb | |
| end CAT0Fillings.ChartGeometry | |
| end | |
| section | |
| open Set Filter MeasureTheory Matrix | |
| open scoped Topology NNReal ENNReal | |
| namespace CAT0Fillings.ChartGeometry | |
| variable {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] | |
| [CompactSpace X] [Nonempty X] {n : β} {T : Functional X n} | |
| {hT : IsMetricCurrent T} (q : ChartGeometry hT) | |
| lemma gradient_add {u v : X β β} {K J : ββ₯0} | |
| (hu : LipschitzWith K u) (hv : LipschitzWith J v) : | |
| q.gradient (hu.add hv) = q.gradient hu + q.gradient hv := by | |
| apply Lp.ext | |
| apply EventuallyEq.trans _ (Lp.coeFn_add _ _).symm | |
| have hea := (q.memLp_gradientFunction (hu.add hv)).coeFn_toLp | |
| have heb := (q.memLp_gradientFunction hu).coeFn_toLp | |
| have hec := (q.memLp_gradientFunction hv).coeFn_toLp | |
| have he : q.gradientFunction (fun x => u x+v x) =α΅[q.atlasMeasure] | |
| fun w => q.gradientFunction u w+q.gradientFunction v w := by | |
| apply Measure.ae_sum_iff.mpr | |
| intro i | |
| apply (measurableEmbedding_prodMk_left i).ae_map_iff.mpr | |
| apply (withDensity_absolutelyContinuous _ _).ae_le | |
| filter_upwards [ae_uniqueDiffWithinAt volume (q.chart i).domain, | |
| (q.chart i).ae_differentiableWithinAt_scalar hu, | |
| (q.chart i).ae_differentiableWithinAt_scalar hv] with z hz hdu hdv | |
| have hs : (q.chart i).scalar (fun x => u x+v x) = | |
| (q.chart i).scalar u+(q.chart i).scalar v := by | |
| funext z | |
| by_cases hz : z β (q.chart i).domain <;> simp [IntegerChart.scalar,hz] | |
| change q.normalizedCovector i (fun x => u x+v x) z = | |
| q.normalizedCovector i u z+q.normalizedCovector i v z | |
| unfold normalizedCovector covector | |
| rw [hs,fderivWithin_add hz hdu hdv] | |
| have he : differentialRow (fderivWithin β ((q.chart i).scalar u) (q.chart i).domain z + | |
| fderivWithin β ((q.chart i).scalar v) (q.chart i).domain z) = | |
| differentialRow (fderivWithin β ((q.chart i).scalar u) (q.chart i).domain z)+ | |
| differentialRow (fderivWithin β ((q.chart i).scalar v) (q.chart i).domain z) := rfl | |
| rw [he,Matrix.mulVec_add,WithLp.toLp_add] | |
| filter_upwards [hea,heb,hec,he] with w ha hb hc he | |
| change (q.gradient (hu.add hv)) w = (q.gradient hu) w+(q.gradient hv) w | |
| exact ha.trans (he.trans (congrArgβ (Β·+Β·) hb.symm hc.symm)) | |
| lemma gradient_smul {u : X β β} {K : ββ₯0} (hu : LipschitzWith K u) (c : β) : | |
| q.gradient ((lipschitzWith_smul c).comp hu) = c β’ q.gradient hu := by | |
| apply Lp.ext | |
| apply EventuallyEq.trans _ (Lp.coeFn_smul c _).symm | |
| have hea := (q.memLp_gradientFunction ((lipschitzWith_smul c).comp hu)).coeFn_toLp | |
| have heb := (q.memLp_gradientFunction hu).coeFn_toLp | |
| have he : q.gradientFunction (fun x => c β’ u x) =α΅[q.atlasMeasure] | |
| fun w => c β’ q.gradientFunction u w := by | |
| apply Measure.ae_sum_iff.mpr | |
| intro i | |
| apply (measurableEmbedding_prodMk_left i).ae_map_iff.mpr | |
| apply (withDensity_absolutelyContinuous _ _).ae_le | |
| filter_upwards [ae_uniqueDiffWithinAt volume (q.chart i).domain, | |
| (q.chart i).ae_differentiableWithinAt_scalar hu] with z hz hdu | |
| have hs : (q.chart i).scalar (fun x => c β’ u x) = c β’ (q.chart i).scalar u := by | |
| funext z | |
| by_cases hz : z β (q.chart i).domain <;> simp [IntegerChart.scalar,hz] | |
| change q.normalizedCovector i (fun x => c β’ u x) z = c β’ q.normalizedCovector i u z | |
| unfold normalizedCovector covector | |
| rw [hs,fderivWithin_const_smul hz hdu] | |
| have he : differentialRow (c β’ fderivWithin β ((q.chart i).scalar u) (q.chart i).domain z) = | |
| c β’ differentialRow (fderivWithin β ((q.chart i).scalar u) (q.chart i).domain z) := rfl | |
| rw [he,Matrix.mulVec_smul,WithLp.toLp_smul] | |
| filter_upwards [hea,heb,he] with w ha hb he | |
| change (q.gradient ((lipschitzWith_smul c).comp hu)) w = c β’ (q.gradient hu) w | |
| exact ha.trans (he.trans (congrArg (c β’ Β·) hb.symm)) | |
| noncomputable def value {u : X β β} {K : ββ₯0} (hu : LipschitzWith K u) : | |
| Lp β 2 (MassMeasure.currentMassMeasure hT) := | |
| ((Foundations.boundedLip_of_lipschitz hu).memLp 2).toLp u | |
| lemma value_add {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] | |
| [CompactSpace X] [Nonempty X] {n : β} {T : Functional X n} | |
| {hT : IsMetricCurrent T} {u v : X β β} {K J : ββ₯0} | |
| (hu : LipschitzWith K u) (hv : LipschitzWith J v) : | |
| value (hT := hT) (hu.add hv) = value hu + value hv := | |
| MemLp.toLp_add _ _ | |
| lemma value_smul {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] | |
| [CompactSpace X] [Nonempty X] {n : β} {T : Functional X n} | |
| {hT : IsMetricCurrent T} {u : X β β} {K : ββ₯0} (hu : LipschitzWith K u) (c : β) : | |
| value (hT := hT) ((lipschitzWith_smul c).comp hu) = c β’ value hu := | |
| MemLp.toLp_const_smul c ((Foundations.boundedLip_of_lipschitz hu).memLp 2) | |
| lemma norm_value {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] | |
| [CompactSpace X] [Nonempty X] {n : β} {T : Functional X n} | |
| {hT : IsMetricCurrent T} {u : X β β} {K : ββ₯0} (hu : LipschitzWith K u) : | |
| βvalue (hT := hT) huβ = lpNorm u 2 (MassMeasure.currentMassMeasure hT) := by | |
| rw [value,Lp.norm_toLp,toReal_eLpNorm] | |
| end CAT0Fillings.ChartGeometry | |
| end | |
| end OAI | |