@@ -8,11 +8,11 @@ Authors: Rohan Mitta, Kevin Buzzard, Alistair Tucker, Johannes Hölzl, Yury Kudr
88! Please do not edit these lines, except to modify the commit id
99! if you have ported upstream changes.
1010-/
11- import Mathbin .Logic.Function.Iterate
12- import Mathbin .Data.Set.Intervals.ProjIcc
13- import Mathbin .Topology.Algebra.Order.Field
14- import Mathbin .Topology.MetricSpace.Basic
15- import Mathbin .Topology.Bornology.Hom
11+ import Mathlib .Logic.Function.Iterate
12+ import Mathlib .Data.Set.Intervals.ProjIcc
13+ import Mathlib .Topology.Algebra.Order.Field
14+ import Mathlib .Topology.MetricSpace.Basic
15+ import Mathlib .Topology.Bornology.Hom
1616
1717/-!
1818# Lipschitz continuous functions
@@ -58,8 +58,7 @@ def LipschitzWith [PseudoEMetricSpace α] [PseudoEMetricSpace β] (K : ℝ≥0)
5858#align lipschitz_with LipschitzWith
5959
6060theorem lipschitzWith_iff_dist_le_mul [PseudoMetricSpace α] [PseudoMetricSpace β] {K : ℝ≥0 }
61- {f : α → β} : LipschitzWith K f ↔ ∀ x y, dist (f x) (f y) ≤ K * dist x y :=
62- by
61+ {f : α → β} : LipschitzWith K f ↔ ∀ x y, dist (f x) (f y) ≤ K * dist x y := by
6362 simp only [LipschitzWith, edist_nndist, dist_nndist]
6463 norm_cast
6564#align lipschitz_with_iff_dist_le_mul lipschitzWith_iff_dist_le_mul
@@ -87,8 +86,7 @@ theorem LipschitzOnWith.mono [PseudoEMetricSpace α] [PseudoEMetricSpace β] {K
8786
8887theorem lipschitzOnWith_iff_dist_le_mul [PseudoMetricSpace α] [PseudoMetricSpace β] {K : ℝ≥0 }
8988 {s : Set α} {f : α → β} :
90- LipschitzOnWith K f s ↔ ∀ x ∈ s, ∀ y ∈ s, dist (f x) (f y) ≤ K * dist x y :=
91- by
89+ LipschitzOnWith K f s ↔ ∀ x ∈ s, ∀ y ∈ s, dist (f x) (f y) ≤ K * dist x y := by
9290 simp only [LipschitzOnWith, edist_nndist, dist_nndist]
9391 norm_cast
9492#align lipschitz_on_with_iff_dist_le_mul lipschitzOnWith_iff_dist_le_mul
@@ -161,8 +159,7 @@ theorem edist_lt_top (hf : LipschitzWith K f) {x y : α} (h : edist x y ≠ ⊤)
161159#align lipschitz_with.edist_lt_top LipschitzWith.edist_lt_top
162160
163161theorem mul_edist_le (h : LipschitzWith K f) (x y : α) :
164- (K⁻¹ : ℝ≥0 ∞) * edist (f x) (f y) ≤ edist x y :=
165- by
162+ (K⁻¹ : ℝ≥0 ∞) * edist (f x) (f y) ≤ edist x y := by
166163 rw [mul_comm, ← div_eq_mul_inv]
167164 exact ENNReal.div_le_of_le_mul' (h x y)
168165#align lipschitz_with.mul_edist_le LipschitzWith.mul_edist_le
@@ -176,8 +173,7 @@ protected theorem weaken (hf : LipschitzWith K f) {K' : ℝ≥0} (h : K ≤ K')
176173#align lipschitz_with.weaken LipschitzWith.weaken
177174
178175theorem ediam_image_le (hf : LipschitzWith K f) (s : Set α) :
179- EMetric.diam (f '' s) ≤ K * EMetric.diam s :=
180- by
176+ EMetric.diam (f '' s) ≤ K * EMetric.diam s := by
181177 apply EMetric.diam_le
182178 rintro _ ⟨x, hx, rfl⟩ _ ⟨y, hy, rfl⟩
183179 exact hf.edist_le_mul_of_le (EMetric.edist_le_diam_of_mem hx hy)
@@ -192,8 +188,7 @@ theorem edist_lt_of_edist_lt_div (hf : LipschitzWith K f) {x y : α} {d : ℝ≥
192188#align lipschitz_with.edist_lt_of_edist_lt_div LipschitzWith.edist_lt_of_edist_lt_div
193189
194190/-- A Lipschitz function is uniformly continuous -/
195- protected theorem uniformContinuous (hf : LipschitzWith K f) : UniformContinuous f :=
196- by
191+ protected theorem uniformContinuous (hf : LipschitzWith K f) : UniformContinuous f := by
197192 refine' EMetric.uniformContinuous_iff.2 fun ε εpos => _
198193 use ε / K, ENNReal.div_pos_iff.2 ⟨ne_of_gt εpos, ENNReal.coe_ne_top⟩
199194 exact fun x y => hf.edist_lt_of_edist_lt_div
@@ -257,8 +252,7 @@ protected theorem prod_snd : LipschitzWith 1 (@Prod.snd α β) :=
257252#align lipschitz_with.prod_snd LipschitzWith.prod_snd
258253
259254protected theorem prod {f : α → β} {Kf : ℝ≥0 } (hf : LipschitzWith Kf f) {g : α → γ} {Kg : ℝ≥0 }
260- (hg : LipschitzWith Kg g) : LipschitzWith (max Kf Kg) fun x => (f x, g x) :=
261- by
255+ (hg : LipschitzWith Kg g) : LipschitzWith (max Kf Kg) fun x => (f x, g x) := by
262256 intro x y
263257 rw [ennreal.coe_mono.map_max, Prod.edist_eq, ENNReal.max_mul]
264258 exact max_le_max (hf x y) (hg x y)
@@ -273,8 +267,7 @@ protected theorem prod_mk_right (b : β) : LipschitzWith 1 fun a : α => (a, b)
273267#align lipschitz_with.prod_mk_right LipschitzWith.prod_mk_right
274268
275269protected theorem uncurry {f : α → β → γ} {Kα Kβ : ℝ≥0 } (hα : ∀ b, LipschitzWith Kα fun a => f a b)
276- (hβ : ∀ a, LipschitzWith Kβ (f a)) : LipschitzWith (Kα + Kβ) (Function.uncurry f) :=
277- by
270+ (hβ : ∀ a, LipschitzWith Kβ (f a)) : LipschitzWith (Kα + Kβ) (Function.uncurry f) := by
278271 rintro ⟨a₁, b₁⟩ ⟨a₂, b₂⟩
279272 simp only [Function.uncurry, ENNReal.coe_add, add_mul]
280273 apply le_trans (edist_triangle _ (f a₂ b₁) _)
@@ -289,8 +282,7 @@ protected theorem iterate {f : α → α} (hf : LipschitzWith K f) : ∀ n, Lips
289282#align lipschitz_with.iterate LipschitzWith.iterate
290283
291284theorem edist_iterate_succ_le_geometric {f : α → α} (hf : LipschitzWith K f) (x n) :
292- edist ((f^[n]) x) ((f^[n + 1 ]) x) ≤ edist x (f x) * K ^ n :=
293- by
285+ edist ((f^[n]) x) ((f^[n + 1 ]) x) ≤ edist x (f x) * K ^ n := by
294286 rw [iterate_succ, mul_comm]
295287 simpa only [ENNReal.coe_pow] using (hf.iterate n) x (f x)
296288#align lipschitz_with.edist_iterate_succ_le_geometric LipschitzWith.edist_iterate_succ_le_geometric
@@ -434,8 +426,7 @@ protected theorem dist : LipschitzWith 2 (Function.uncurry <| @dist α _) :=
434426#align lipschitz_with.dist LipschitzWith.dist
435427
436428theorem dist_iterate_succ_le_geometric {f : α → α} (hf : LipschitzWith K f) (x n) :
437- dist ((f^[n]) x) ((f^[n + 1 ]) x) ≤ dist x (f x) * K ^ n :=
438- by
429+ dist ((f^[n]) x) ((f^[n + 1 ]) x) ≤ dist x (f x) * K ^ n := by
439430 rw [iterate_succ, mul_comm]
440431 simpa only [NNReal.coe_pow] using (hf.iterate n).dist_le_mul x (f x)
441432#align lipschitz_with.dist_iterate_succ_le_geometric LipschitzWith.dist_iterate_succ_le_geometric
@@ -511,8 +502,7 @@ theorem bounded_prod_of_nonempty (hs : s.Nonempty) (ht : t.Nonempty) :
511502#align metric.bounded_prod_of_nonempty Metric.bounded_prod_of_nonempty
512503
513504/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
514- theorem bounded_prod : Bounded (s ×ˢ t) ↔ s = ∅ ∨ t = ∅ ∨ Bounded s ∧ Bounded t :=
515- by
505+ theorem bounded_prod : Bounded (s ×ˢ t) ↔ s = ∅ ∨ t = ∅ ∨ Bounded s ∧ Bounded t := by
516506 rcases s.eq_empty_or_nonempty with (rfl | hs); · simp
517507 rcases t.eq_empty_or_nonempty with (rfl | ht); · simp
518508 simp only [bounded_prod_of_nonempty hs ht, hs.ne_empty, ht.ne_empty, false_or_iff]
@@ -612,8 +602,7 @@ of continuity of `f` on subsets of the product space. -/
612602theorem continuousOn_prod_of_continuousOn_lipschitz_on [PseudoEMetricSpace α] [TopologicalSpace β]
613603 [PseudoEMetricSpace γ] (f : α × β → γ) {s : Set α} {t : Set β} (K : ℝ≥0 )
614604 (ha : ∀ a ∈ s, ContinuousOn (fun y => f (a, y)) t)
615- (hb : ∀ b ∈ t, LipschitzOnWith K (fun x => f (x, b)) s) : ContinuousOn f (s ×ˢ t) :=
616- by
605+ (hb : ∀ b ∈ t, LipschitzOnWith K (fun x => f (x, b)) s) : ContinuousOn f (s ×ˢ t) := by
617606 rintro ⟨x, y⟩ ⟨hx : x ∈ s, hy : y ∈ t⟩
618607 refine' EMetric.tendsto_nhds.2 fun ε (ε0 : 0 < ε) => _
619608 replace ε0 : 0 < ε / 2 := ENNReal.half_pos (ne_of_gt ε0 )
@@ -642,8 +631,7 @@ The actual statement uses (Lipschitz) continuity of `λ y, f (a, y)` and `λ x,
642631of continuity of `f` on subsets of the product space. -/
643632theorem continuous_prod_of_continuous_lipschitz [PseudoEMetricSpace α] [TopologicalSpace β]
644633 [PseudoEMetricSpace γ] (f : α × β → γ) (K : ℝ≥0 ) (ha : ∀ a, Continuous fun y => f (a, y))
645- (hb : ∀ b, LipschitzWith K fun x => f (x, b)) : Continuous f :=
646- by
634+ (hb : ∀ b, LipschitzWith K fun x => f (x, b)) : Continuous f := by
647635 simp only [continuous_iff_continuousOn_univ, ← univ_prod_univ, ← lipschitz_on_univ] at *
648636 exact continuousOn_prod_of_continuousOn_lipschitz_on f K (fun a _ => ha a) fun b _ => hb b
649637#align continuous_prod_of_continuous_lipschitz continuous_prod_of_continuous_lipschitz
@@ -653,8 +641,7 @@ open Metric
653641/-- If a function is locally Lipschitz around a point, then it is continuous at this point. -/
654642theorem continuousAt_of_locally_lipschitz [PseudoMetricSpace α] [PseudoMetricSpace β] {f : α → β}
655643 {x : α} {r : ℝ} (hr : 0 < r) (K : ℝ) (h : ∀ y, dist y x < r → dist (f y) (f x) ≤ K * dist y x) :
656- ContinuousAt f x :=
657- by
644+ ContinuousAt f x := by
658645 -- We use `h` to squeeze `dist (f y) (f x)` between `0` and `K * dist y x`
659646 refine'
660647 tendsto_iff_dist_tendsto_zero.2
@@ -668,8 +655,7 @@ theorem continuousAt_of_locally_lipschitz [PseudoMetricSpace α] [PseudoMetricSp
668655/-- A function `f : α → ℝ` which is `K`-Lipschitz on a subset `s` admits a `K`-Lipschitz extension
669656to the whole space. -/
670657theorem LipschitzOnWith.extend_real [PseudoMetricSpace α] {f : α → ℝ} {s : Set α} {K : ℝ≥0 }
671- (hf : LipschitzOnWith K f s) : ∃ g : α → ℝ, LipschitzWith K g ∧ EqOn f g s :=
672- by
658+ (hf : LipschitzOnWith K f s) : ∃ g : α → ℝ, LipschitzWith K g ∧ EqOn f g s := by
673659 /- An extension is given by `g y = Inf {f x + K * dist y x | x ∈ s}`. Taking `x = y`, one has
674660 `g y ≤ f y` for `y ∈ s`, and the other inequality holds because `f` is `K`-Lipschitz, so that it
675661 can not counterbalance the growth of `K * dist y x`. One readily checks from the formula that the
@@ -713,8 +699,7 @@ extension to the whole space.
713699TODO: state the same result (with the same proof) for the space `ℓ^∞ (ι, ℝ)` over a possibly
714700infinite type `ι`. -/
715701theorem LipschitzOnWith.extend_pi [PseudoMetricSpace α] [Fintype ι] {f : α → ι → ℝ} {s : Set α}
716- {K : ℝ≥0 } (hf : LipschitzOnWith K f s) : ∃ g : α → ι → ℝ, LipschitzWith K g ∧ EqOn f g s :=
717- by
702+ {K : ℝ≥0 } (hf : LipschitzOnWith K f s) : ∃ g : α → ι → ℝ, LipschitzWith K g ∧ EqOn f g s := by
718703 have : ∀ i, ∃ g : α → ℝ, LipschitzWith K g ∧ eq_on (fun x => f x i) g s :=
719704 by
720705 intro i
0 commit comments