mathlib documentation

topology.metric_space.lipschitz

Lipschitz continuous functions #

A map f : α → β between two (extended) metric spaces is called Lipschitz continuous with constant K ≥ 0 if for all x, y we have edist (f x) (f y) ≤ K * edist x y. For a metric space, the latter inequality is equivalent to dist (f x) (f y) ≤ K * dist x y. There is also a version asserting this inequality only for x and y in some set s.

In this file we provide various ways to prove that various combinations of Lipschitz continuous functions are Lipschitz continuous. We also prove that Lipschitz continuous functions are uniformly continuous.

Main definitions and lemmas #

Implementation notes #

The parameter K has type ℝ≥0. This way we avoid conjuction in the definition and have coercions both to and ℝ≥0∞. Constructors whose names end with ' take K : ℝ as an argument, and return lipschitz_with (real.to_nnreal K) f.

def lipschitz_with {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] (K : ℝ≥0) (f : α → β) :
Prop

A function f is Lipschitz continuous with constant K ≥ 0 if for all x, y we have dist (f x) (f y) ≤ K * dist x y

Equations
theorem lipschitz_with_iff_dist_le_mul {α : Type u} {β : Type v} [pseudo_metric_space α] [pseudo_metric_space β] {K : ℝ≥0} {f : α → β} :
lipschitz_with K f ∀ (x y : α), dist (f x) (f y) (K) * dist x y
theorem lipschitz_with.of_dist_le_mul {α : Type u} {β : Type v} [pseudo_metric_space α] [pseudo_metric_space β] {K : ℝ≥0} {f : α → β} :
(∀ (x y : α), dist (f x) (f y) (K) * dist x y)lipschitz_with K f

Alias of lipschitz_with_iff_dist_le_mul.

theorem lipschitz_with.dist_le_mul {α : Type u} {β : Type v} [pseudo_metric_space α] [pseudo_metric_space β] {K : ℝ≥0} {f : α → β} :
lipschitz_with K f∀ (x y : α), dist (f x) (f y) (K) * dist x y

Alias of lipschitz_with_iff_dist_le_mul.

def lipschitz_on_with {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] (K : ℝ≥0) (f : α → β) (s : set α) :
Prop

A function f is Lipschitz continuous with constant K ≥ 0 on s if for all x, y in s we have dist (f x) (f y) ≤ K * dist x y

Equations
@[simp]
theorem lipschitz_on_with_empty {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] (K : ℝ≥0) (f : α → β) :
theorem lipschitz_on_with.mono {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {s t : set α} {f : α → β} (hf : lipschitz_on_with K f t) (h : s t) :
theorem lipschitz_on_with_iff_dist_le_mul {α : Type u} {β : Type v} [pseudo_metric_space α] [pseudo_metric_space β] {K : ℝ≥0} {s : set α} {f : α → β} :
lipschitz_on_with K f s ∀ (x : α), x s∀ (y : α), y sdist (f x) (f y) (K) * dist x y
theorem lipschitz_on_with.dist_le_mul {α : Type u} {β : Type v} [pseudo_metric_space α] [pseudo_metric_space β] {K : ℝ≥0} {s : set α} {f : α → β} :
lipschitz_on_with K f s∀ (x : α), x s∀ (y : α), y sdist (f x) (f y) (K) * dist x y

Alias of lipschitz_on_with_iff_dist_le_mul.

theorem lipschitz_on_with.of_dist_le_mul {α : Type u} {β : Type v} [pseudo_metric_space α] [pseudo_metric_space β] {K : ℝ≥0} {s : set α} {f : α → β} :
(∀ (x : α), x s∀ (y : α), y sdist (f x) (f y) (K) * dist x y)lipschitz_on_with K f s

Alias of lipschitz_on_with_iff_dist_le_mul.

@[simp]
theorem lipschitz_on_univ {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} :
theorem lipschitz_on_with_iff_restrict {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} {s : set α} :
theorem lipschitz_with.lipschitz_on_with {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} (h : lipschitz_with K f) (s : set α) :
theorem lipschitz_with.edist_le_mul {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} (h : lipschitz_with K f) (x y : α) :
edist (f x) (f y) (K) * edist x y
theorem lipschitz_with.edist_lt_top {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} (hf : lipschitz_with K f) {x y : α} (h : edist x y ) :
edist (f x) (f y) <
theorem lipschitz_with.mul_edist_le {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} (h : lipschitz_with K f) (x y : α) :
(K)⁻¹ * edist (f x) (f y) edist x y
theorem lipschitz_with.of_edist_le {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {f : α → β} (h : ∀ (x y : α), edist (f x) (f y) edist x y) :
theorem lipschitz_with.weaken {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} (hf : lipschitz_with K f) {K' : ℝ≥0} (h : K K') :
theorem lipschitz_with.ediam_image_le {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} (hf : lipschitz_with K f) (s : set α) :
theorem lipschitz_with.edist_lt_of_edist_lt_div {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} (hf : lipschitz_with K f) {x y : α} {d : ℝ≥0∞} (h : edist x y < d / K) :
edist (f x) (f y) < d
theorem lipschitz_with.uniform_continuous {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} (hf : lipschitz_with K f) :

A Lipschitz function is uniformly continuous

theorem lipschitz_with.continuous {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} (hf : lipschitz_with K f) :

A Lipschitz function is continuous

theorem lipschitz_with.const {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] (b : β) :
lipschitz_with 0 (λ (a : α), b)
theorem lipschitz_with.subtype_coe {α : Type u} [pseudo_emetric_space α] (s : set α) :
theorem lipschitz_with.subtype_mk {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} (hf : lipschitz_with K f) {p : β → Prop} (hp : ∀ (x : α), p (f x)) :
lipschitz_with K (λ (x : α), f x, _⟩)
theorem lipschitz_with.eval {ι : Type x} {α : ι → Type u} [Π (i : ι), pseudo_emetric_space (α i)] [fintype ι] (i : ι) :
theorem lipschitz_with.restrict {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {f : α → β} (hf : lipschitz_with K f) (s : set α) :
theorem lipschitz_with.comp {α : Type u} {β : Type v} {γ : Type w} [pseudo_emetric_space α] [pseudo_emetric_space β] [pseudo_emetric_space γ] {Kf Kg : ℝ≥0} {f : β → γ} {g : α → β} (hf : lipschitz_with Kf f) (hg : lipschitz_with Kg g) :
lipschitz_with (Kf * Kg) (f g)
theorem lipschitz_with.prod {α : Type u} {β : Type v} {γ : Type w} [pseudo_emetric_space α] [pseudo_emetric_space β] [pseudo_emetric_space γ] {f : α → β} {Kf : ℝ≥0} (hf : lipschitz_with Kf f) {g : α → γ} {Kg : ℝ≥0} (hg : lipschitz_with Kg g) :
lipschitz_with (max Kf Kg) (λ (x : α), (f x, g x))
theorem lipschitz_with.uncurry {α : Type u} {β : Type v} {γ : Type w} [pseudo_emetric_space α] [pseudo_emetric_space β] [pseudo_emetric_space γ] {f : α → β → γ} {Kα Kβ : ℝ≥0} (hα : ∀ (b : β), lipschitz_with (λ (a : α), f a b)) (hβ : ∀ (a : α), lipschitz_with (f a)) :
theorem lipschitz_with.iterate {α : Type u} [pseudo_emetric_space α] {K : ℝ≥0} {f : α → α} (hf : lipschitz_with K f) (n : ) :
theorem lipschitz_with.edist_iterate_succ_le_geometric {α : Type u} [pseudo_emetric_space α] {K : ℝ≥0} {f : α → α} (hf : lipschitz_with K f) (x : α) (n : ) :
edist (f^[n] x) (f^[n + 1] x) (edist x (f x)) * K ^ n
theorem lipschitz_with.mul {α : Type u} [pseudo_emetric_space α] {f g : category_theory.End α} {Kf Kg : ℝ≥0} (hf : lipschitz_with Kf f) (hg : lipschitz_with Kg g) :
lipschitz_with (Kf * Kg) (f * g)
theorem lipschitz_with.list_prod {α : Type u} {ι : Type x} [pseudo_emetric_space α] (f : ι → category_theory.End α) (K : ι → ℝ≥0) (h : ∀ (i : ι), lipschitz_with (K i) (f i)) (l : list ι) :

The product of a list of Lipschitz continuous endomorphisms is a Lipschitz continuous endomorphism.

theorem lipschitz_with.pow {α : Type u} [pseudo_emetric_space α] {f : category_theory.End α} {K : ℝ≥0} (h : lipschitz_with K f) (n : ) :
lipschitz_with (K ^ n) (f ^ n)
theorem lipschitz_with.of_dist_le' {α : Type u} {β : Type v} [pseudo_metric_space α] [pseudo_metric_space β] {f : α → β} {K : } (h : ∀ (x y : α), dist (f x) (f y) K * dist x y) :
theorem lipschitz_with.mk_one {α : Type u} {β : Type v} [pseudo_metric_space α] [pseudo_metric_space β] {f : α → β} (h : ∀ (x y : α), dist (f x) (f y) dist x y) :
theorem lipschitz_with.of_le_add_mul' {α : Type u} [pseudo_metric_space α] {f : α → } (K : ) (h : ∀ (x y : α), f x f y + K * dist x y) :

For functions to , it suffices to prove f x ≤ f y + K * dist x y; this version doesn't assume 0≤K.

theorem lipschitz_with.of_le_add_mul {α : Type u} [pseudo_metric_space α] {f : α → } (K : ℝ≥0) (h : ∀ (x y : α), f x f y + (K) * dist x y) :

For functions to , it suffices to prove f x ≤ f y + K * dist x y; this version assumes 0≤K.

theorem lipschitz_with.of_le_add {α : Type u} [pseudo_metric_space α] {f : α → } (h : ∀ (x y : α), f x f y + dist x y) :
theorem lipschitz_with.le_add_mul {α : Type u} [pseudo_metric_space α] {f : α → } {K : ℝ≥0} (h : lipschitz_with K f) (x y : α) :
f x f y + (K) * dist x y
theorem lipschitz_with.iff_le_add_mul {α : Type u} [pseudo_metric_space α] {f : α → } {K : ℝ≥0} :
lipschitz_with K f ∀ (x y : α), f x f y + (K) * dist x y
theorem lipschitz_with.nndist_le {α : Type u} {β : Type v} [pseudo_metric_space α] [pseudo_metric_space β] {K : ℝ≥0} {f : α → β} (hf : lipschitz_with K f) (x y : α) :
nndist (f x) (f y) K * nndist x y
theorem lipschitz_with.diam_image_le {α : Type u} {β : Type v} [pseudo_metric_space α] [pseudo_metric_space β] {K : ℝ≥0} {f : α → β} (hf : lipschitz_with K f) (s : set α) (hs : metric.bounded s) :
theorem lipschitz_with.dist_left {α : Type u} [pseudo_metric_space α] (y : α) :
lipschitz_with 1 (λ (x : α), dist x y)
theorem lipschitz_with.dist_right {α : Type u} [pseudo_metric_space α] (x : α) :
theorem lipschitz_with.dist_iterate_succ_le_geometric {α : Type u} [pseudo_metric_space α] {K : ℝ≥0} {f : α → α} (hf : lipschitz_with K f) (x : α) (n : ) :
dist (f^[n] x) (f^[n + 1] x) (dist x (f x)) * K ^ n
theorem lipschitz_with_max  :
lipschitz_with 1 (λ (p : × ), max p.fst p.snd)
theorem lipschitz_with_min  :
lipschitz_with 1 (λ (p : × ), min p.fst p.snd)
theorem lipschitz_with.max {α : Type u} [pseudo_emetric_space α] {f g : α → } {Kf Kg : ℝ≥0} (hf : lipschitz_with Kf f) (hg : lipschitz_with Kg g) :
lipschitz_with (max Kf Kg) (λ (x : α), max (f x) (g x))
theorem lipschitz_with.min {α : Type u} [pseudo_emetric_space α] {f g : α → } {Kf Kg : ℝ≥0} (hf : lipschitz_with Kf f) (hg : lipschitz_with Kg g) :
lipschitz_with (max Kf Kg) (λ (x : α), min (f x) (g x))
theorem lipschitz_with.max_const {α : Type u} [pseudo_emetric_space α] {f : α → } {Kf : ℝ≥0} (hf : lipschitz_with Kf f) (a : ) :
lipschitz_with Kf (λ (x : α), max (f x) a)
theorem lipschitz_with.const_max {α : Type u} [pseudo_emetric_space α] {f : α → } {Kf : ℝ≥0} (hf : lipschitz_with Kf f) (a : ) :
lipschitz_with Kf (λ (x : α), max a (f x))
theorem lipschitz_with.min_const {α : Type u} [pseudo_emetric_space α] {f : α → } {Kf : ℝ≥0} (hf : lipschitz_with Kf f) (a : ) :
lipschitz_with Kf (λ (x : α), min (f x) a)
theorem lipschitz_with.const_min {α : Type u} [pseudo_emetric_space α] {f : α → } {Kf : ℝ≥0} (hf : lipschitz_with Kf f) (a : ) :
lipschitz_with Kf (λ (x : α), min a (f x))
theorem lipschitz_with.proj_Icc {a b : } (h : a b) :
theorem lipschitz_on_with.uniform_continuous_on {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {s : set α} {f : α → β} (hf : lipschitz_on_with K f s) :
theorem lipschitz_on_with.continuous_on {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {s : set α} {f : α → β} (hf : lipschitz_on_with K f s) :
theorem lipschitz_on_with.edist_lt_of_edist_lt_div {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {K : ℝ≥0} {s : set α} {f : α → β} (hf : lipschitz_on_with K f s) {x y : α} (hx : x s) (hy : y s) {d : ℝ≥0∞} (hd : edist x y < d / K) :
edist (f x) (f y) < d
theorem continuous_on_prod_of_continuous_on_lipschitz_on {α : Type u} {β : Type v} {γ : Type w} [pseudo_emetric_space α] [topological_space β] [pseudo_emetric_space γ] (f : α × β → γ) {s : set α} {t : set β} (K : ℝ≥0) (ha : ∀ (a : α), a scontinuous_on (λ (y : β), f (a, y)) t) (hb : ∀ (b : β), b tlipschitz_on_with K (λ (x : α), f (x, b)) s) :

Consider a function f : α × β → γ. Suppose that it is continuous on each “vertical fiber” {a} × t, a ∈ s, and is Lipschitz continuous on each “horizontal fiber” s × {b}, b ∈ t with the same Lipschitz constant K. Then it is continuous on s × t.

The actual statement uses (Lipschitz) continuity of λ y, f (a, y) and λ x, f (x, b) instead of continuity of f on subsets of the product space.

theorem continuous_prod_of_continuous_lipschitz {α : Type u} {β : Type v} {γ : Type w} [pseudo_emetric_space α] [topological_space β] [pseudo_emetric_space γ] (f : α × β → γ) (K : ℝ≥0) (ha : ∀ (a : α), continuous (λ (y : β), f (a, y))) (hb : ∀ (b : β), lipschitz_with K (λ (x : α), f (x, b))) :

Consider a function f : α × β → γ. Suppose that it is continuous on each “vertical section” {a} × univ, a : α, and is Lipschitz continuous on each “horizontal section” univ × {b}, b : β with the same Lipschitz constant K. Then it is continuous.

The actual statement uses (Lipschitz) continuity of λ y, f (a, y) and λ x, f (x, b) instead of continuity of f on subsets of the product space.

theorem continuous_at_of_locally_lipschitz {α : Type u} {β : Type v} [metric_space α] [metric_space β] {f : α → β} {x : α} {r : } (hr : 0 < r) (K : ) (h : ∀ (y : α), dist y x < rdist (f y) (f x) K * dist y x) :

If a function is locally Lipschitz around a point, then it is continuous at this point.