Download data/lean/OAI/Geometry/CAT0Fillings/Differentiation/ErrorModulus.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/Geometry/CAT0Fillings/Differentiation/ErrorModulus.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/CAT0Fillings/Differentiation/ErrorModulus.lean
-
curl -L -o ErrorModulus.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/CAT0Fillings/Differentiation/ErrorModulus.lean
6.45 kB
| import Mathlib | |
| import OAI.Geometry.CAT0Fillings.Differentiation.Centered | |
| namespace OAI | |
| section | |
| open Set Filter MeasureTheory | |
| open scoped Topology ENNReal NNReal | |
| open MeasureTheory Filter Set Metric | |
| open scoped Topology Pointwise NNReal | |
| open Set Filter MeasureTheory TopologicalSpace | |
| open Filter Set | |
| open scoped Topology NNReal | |
| namespace CAT0Fillings.MetricDifferentiation | |
| open Metric | |
| variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| {X : Type*} [MetricSpace X] [SeparableSpace X] [Nonempty X] | |
| {f : E β X} {K : ββ₯0} | |
| omit [FiniteDimensional β E] in | |
| lemma measurable_metricSeminorm_apply (hf : LipschitzWith K f) (v : E) : | |
| Measurable (fun x => metricSeminorm f x v) := by | |
| simp only [metricSeminorm_apply hf] | |
| exact Measurable.iSup (fun q => (measurable_fderiv_apply_const β (scalarCoordinate f q) v).abs) | |
| noncomputable def metricErrorTerm (f : E β X) (r : β) (q : β) (x : E) : β := | |
| if 0 < βdenseSeq E qβ β§ βdenseSeq E qβ β€ r then | |
| |dist (f (x + denseSeq E q)) (f x) - metricSeminorm f x (denseSeq E q)| / βdenseSeq E qβ | |
| else 0 | |
| noncomputable def metricErrorModulus (f : E β X) (r : β) (x : E) : β := | |
| β¨ q : β, metricErrorTerm f r q x | |
| omit [MeasurableSpace E] [BorelSpace E] in | |
| lemma metricErrorTerm_nonneg (r : β) (q : β) (x : E) : | |
| 0 β€ metricErrorTerm f r q x := by | |
| dsimp [metricErrorTerm] | |
| split_ifs | |
| Β· positivity | |
| Β· rfl | |
| omit [MeasurableSpace E] [BorelSpace E] in | |
| lemma metricErrorTerm_le (hf : LipschitzWith K f) (r : β) (q : β) (x : E) : | |
| metricErrorTerm f r q x β€ 2*(K : β) := by | |
| dsimp [metricErrorTerm] | |
| split_ifs with h | |
| Β· apply (div_le_iffβ h.1).mpr | |
| have hd : dist (f (x+denseSeq E q)) (f x) β€ (K : β)*βdenseSeq E qβ := by | |
| simpa only [dist_eq_norm, add_sub_cancel_left] using hf.dist_le_mul (x+denseSeq E q) x | |
| have hp := metricSeminorm_le hf x (denseSeq E q) | |
| have hp0 := apply_nonneg (metricSeminorm f x) (denseSeq E q) | |
| have hd0 := dist_nonneg (x := f (x+denseSeq E q)) (y := f x) | |
| rw [abs_le] | |
| constructor <;> nlinarith | |
| Β· positivity | |
| omit [MeasurableSpace E] [BorelSpace E] in | |
| lemma bddAbove_metricErrorTerm (hf : LipschitzWith K f) (r : β) (x : E) : | |
| BddAbove (range (fun q => metricErrorTerm f r q x)) := | |
| β¨2*(K : β), by rintro _ β¨q,rflβ©; exact metricErrorTerm_le hf r q xβ© | |
| omit [MeasurableSpace E] [BorelSpace E] in | |
| lemma metricErrorModulus_nonneg (hf : LipschitzWith K f) (r : β) (x : E) : | |
| 0 β€ metricErrorModulus f r x := | |
| (metricErrorTerm_nonneg r 0 x).trans (le_ciSup (bddAbove_metricErrorTerm hf r x) 0) | |
| omit [MeasurableSpace E] [BorelSpace E] in | |
| lemma metricErrorModulus_le (hf : LipschitzWith K f) (r : β) (x : E) : | |
| metricErrorModulus f r x β€ 2*(K : β) := | |
| ciSup_le (fun q => metricErrorTerm_le hf r q x) | |
| lemma measurable_metricErrorModulus (hf : LipschitzWith K f) (r : β) : | |
| Measurable (metricErrorModulus f r) := by | |
| change Measurable (fun x => β¨ q : β, metricErrorTerm f r q x) | |
| apply Measurable.iSup | |
| intro q | |
| change Measurable (fun x => metricErrorTerm f r q x) | |
| unfold metricErrorTerm | |
| split_ifs | |
| Β· exact (((hf.continuous.comp (continuous_id.add continuous_const)).dist hf.continuous).measurable.sub | |
| (measurable_metricSeminorm_apply hf _)).abs.div_const _ | |
| Β· exact measurable_const | |
| omit [MeasurableSpace E] [BorelSpace E] in | |
| lemma metricErrorModulus_le_of_bound (_hf : LipschitzWith K f) {r Ξ΅ : β} {x : E} | |
| (hΞ΅ : 0 β€ Ξ΅) | |
| (H : β v : E, βvβ β€ r β |dist (f (x+v)) (f x)-metricSeminorm f x v| β€ Ξ΅*βvβ) : | |
| metricErrorModulus f r x β€ Ξ΅ := by | |
| apply ciSup_le | |
| intro q | |
| dsimp [metricErrorTerm] | |
| split_ifs with h | |
| Β· exact (div_le_iffβ h.1).mpr (H _ h.2) | |
| Β· exact hΞ΅ | |
| omit [MeasurableSpace E] [BorelSpace E] in | |
| lemma metricErrorModulus_tendsto_zero (hf : LipschitzWith K f) {x : E} | |
| (hx : HasCenteredMetricDifferential f (metricSeminorm f x) x) | |
| {r : β β β} (hr : Tendsto r atTop (π 0)) : | |
| Tendsto (fun n => metricErrorModulus f (r n) x) atTop (π 0) := by | |
| apply tendsto_order.2 | |
| constructor | |
| Β· intro a ha | |
| exact Eventually.of_forall (fun n => ha.trans_le (metricErrorModulus_nonneg hf _ _)) | |
| Β· intro Ξ΅ hΞ΅ | |
| have hxΞ΅ := hx.bound (half_pos hΞ΅) | |
| obtain β¨Ξ΄,hΞ΄,hΞ΄xβ© := Metric.mem_nhds_iff.mp hxΞ΅ | |
| have hΞ΄r := (tendsto_order.1 hr).2 Ξ΄ hΞ΄ | |
| filter_upwards [hΞ΄r] with n hn | |
| apply lt_of_le_of_lt (metricErrorModulus_le_of_bound hf (half_pos hΞ΅).le ?_) | |
| (half_lt_self hΞ΅) | |
| intro v hv | |
| have hvΞ΄ : x+v β ball x Ξ΄ := by | |
| simpa only [mem_ball, dist_eq_norm, add_sub_cancel_left] using hv.trans_lt hn | |
| simpa only [mem_ofPred_eq, add_sub_cancel_left, Real.norm_eq_abs] using hΞ΄x hvΞ΄ | |
| end CAT0Fillings.MetricDifferentiation | |
| namespace CAT0Fillings.MetricDifferentiation | |
| open Metric | |
| variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| {X : Type*} [MetricSpace X] [SeparableSpace X] [Nonempty X] | |
| {f : E β X} {K : ββ₯0} | |
| omit [MeasurableSpace E] [BorelSpace E] in | |
| lemma metricErrorModulus_bound (hf : LipschitzWith K f) {r : β} (x v : E) | |
| (hv : βvβ < r) : | |
| |dist (f (x+v)) (f x)-metricSeminorm f x v| β€ metricErrorModulus f r x * βvβ := by | |
| let A : Set E := {w | |dist (f (x+w)) (f x)-metricSeminorm f x w| β€ | |
| metricErrorModulus f r x * βwβ} | |
| have hA : IsClosed A := isClosed_le | |
| (((hf.continuous.comp (continuous_const.add continuous_id)).dist continuous_const).sub | |
| (metricSeminorm_lipschitz hf x).continuous).abs | |
| (continuous_const.mul continuous_norm) | |
| have hsub : ball (0 : E) r β© range (denseSeq E) β A := by | |
| rintro w β¨hq,β¨q,rflβ©β© | |
| by_cases hw : denseSeq E q = 0 | |
| Β· simp [A,hw] | |
| have hqw : 0 < βdenseSeq E qβ := norm_pos_iff.mpr hw | |
| have hqr : βdenseSeq E qβ β€ r := (by simpa only [mem_ball, dist_zero_right] using hq : | |
| βdenseSeq E qβ < r).le | |
| have hle := le_ciSup (bddAbove_metricErrorTerm hf r x) q | |
| rw [metricErrorTerm, ite_eq_left β¨hqw,hqrβ©] at hle | |
| exact (div_le_iffβ hqw).mp hle | |
| have hvcl := (denseRange_denseSeq E).open_subset_closure_inter isOpen_ball | |
| (by simpa only [mem_ball, dist_zero_right] using hv : v β ball (0 : E) r) | |
| exact hA.closure_subset_iff.mpr hsub hvcl | |
| end CAT0Fillings.MetricDifferentiation | |
| end | |
| end OAI | |