|
| 1 | +/- |
| 2 | +Copyright (c) 2026 Terence Tao. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Terence Tao |
| 5 | +-/ |
| 6 | +module |
| 7 | + |
| 8 | +public import Mathlib.Topology.MetricSpace.Pseudo.Defs |
| 9 | +public import Mathlib.Topology.UniformSpace.HeineCantor |
| 10 | + |
| 11 | +/-! |
| 12 | +# The Heine–Cantor theorem in metric ε-δ form |
| 13 | +
|
| 14 | +A function continuous on a compact set of a pseudometric space is uniformly continuous there. |
| 15 | +This file records the metric ε-δ consequences of the uniform-space level |
| 16 | +`IsCompact.uniformContinuousOn_of_continuous` and its siblings. |
| 17 | +-/ |
| 18 | + |
| 19 | +public section |
| 20 | + |
| 21 | +open Metric CompactSpace |
| 22 | + |
| 23 | +variable {α β : Type*} [PseudoMetricSpace α] [PseudoMetricSpace β] {s : Set α} {f : α → β} |
| 24 | + |
| 25 | +/-- **Heine–Cantor** in metric ε-δ form: a function `f` continuous on a compact set `s` is |
| 26 | +uniformly continuous there, so for every `ε > 0` there is a `δ > 0` such that points of `s` |
| 27 | +within `δ` are mapped within `ε`. -/ |
| 28 | +theorem ContinuousOn.exists_forall_dist_lt_of_isCompact (hs : IsCompact s) (hf : ContinuousOn f s) |
| 29 | + {ε : ℝ} (hε : 0 < ε) : |
| 30 | + ∃ δ > 0, ∀ x ∈ s, ∀ y ∈ s, dist x y < δ → dist (f x) (f y) < ε := |
| 31 | + uniformContinuousOn_iff.mp (hs.uniformContinuousOn_of_continuous hf) ε hε |
| 32 | + |
| 33 | +/-- Version of `ContinuousOn.exists_forall_dist_lt_of_isCompact` with non-strict inequalities. -/ |
| 34 | +theorem ContinuousOn.exists_forall_dist_le_of_isCompact (hs : IsCompact s) (hf : ContinuousOn f s) |
| 35 | + {ε : ℝ} (hε : 0 < ε) : |
| 36 | + ∃ δ > 0, ∀ x ∈ s, ∀ y ∈ s, dist x y ≤ δ → dist (f x) (f y) ≤ ε := |
| 37 | + uniformContinuousOn_iff_le.mp (hs.uniformContinuousOn_of_continuous hf) ε hε |
| 38 | + |
| 39 | +/-- **Heine–Cantor** on a compact space, in metric ε-δ form: a continuous function on a compact |
| 40 | +pseudometric space is uniformly continuous, so for every `ε > 0` there is a `δ > 0` such that any |
| 41 | +two points within `δ` are mapped within `ε`. -/ |
| 42 | +theorem Continuous.exists_forall_dist_lt_of_compactSpace [CompactSpace α] (hf : Continuous f) |
| 43 | + {ε : ℝ} (hε : 0 < ε) : |
| 44 | + ∃ δ > 0, ∀ x y : α, dist x y < δ → dist (f x) (f y) < ε := |
| 45 | + uniformContinuous_iff.mp (uniformContinuous_of_continuous hf) ε hε |
| 46 | + |
| 47 | +/-- Version of `Continuous.exists_forall_dist_lt_of_compactSpace` with non-strict inequalities. -/ |
| 48 | +theorem Continuous.exists_forall_dist_le_of_compactSpace [CompactSpace α] (hf : Continuous f) |
| 49 | + {ε : ℝ} (hε : 0 < ε) : |
| 50 | + ∃ δ > 0, ∀ x y : α, dist x y ≤ δ → dist (f x) (f y) ≤ ε := |
| 51 | + uniformContinuous_iff_le.mp (uniformContinuous_of_continuous hf) ε hε |
| 52 | + |
| 53 | +/-- Metric ε-δ form of `IsCompact.uniformContinuousAt_of_continuousAt`: if `f` is continuous at |
| 54 | +each point of a compact set `s`, then for every `ε > 0` there is a `δ > 0` such that `f x` and |
| 55 | +`f y` are within `ε` whenever `x ∈ s` and `y` is within `δ` of `x`. Unlike |
| 56 | +`ContinuousOn.exists_forall_dist_lt_of_isCompact`, the point `y` need not lie in `s`. -/ |
| 57 | +theorem IsCompact.exists_forall_dist_lt_of_continuousAt (hs : IsCompact s) |
| 58 | + (hf : ∀ a ∈ s, ContinuousAt f a) {ε : ℝ} (hε : 0 < ε) : |
| 59 | + ∃ δ > 0, ∀ x ∈ s, ∀ y, dist x y < δ → dist (f x) (f y) < ε := by |
| 60 | + obtain ⟨δ, hδ, H⟩ := uniformity_basis_dist.mem_iff.1 |
| 61 | + (hs.uniformContinuousAt_of_continuousAt f hf (uniformity_basis_dist.mem_of_mem hε)) |
| 62 | + exact ⟨δ, hδ, fun x hx y hxy ↦ H (a := (x, y)) hxy hx⟩ |
| 63 | + |
| 64 | +/-- Version of `IsCompact.exists_forall_dist_lt_of_continuousAt` with non-strict inequalities. -/ |
| 65 | +theorem IsCompact.exists_forall_dist_le_of_continuousAt (hs : IsCompact s) |
| 66 | + (hf : ∀ a ∈ s, ContinuousAt f a) {ε : ℝ} (hε : 0 < ε) : |
| 67 | + ∃ δ > 0, ∀ x ∈ s, ∀ y, dist x y ≤ δ → dist (f x) (f y) ≤ ε := by |
| 68 | + obtain ⟨δ, hδ, H⟩ := uniformity_basis_dist_le.mem_iff.1 |
| 69 | + (hs.uniformContinuousAt_of_continuousAt f hf (uniformity_basis_dist_le.mem_of_mem hε)) |
| 70 | + exact ⟨δ, hδ, fun x hx y hxy ↦ H (a := (x, y)) hxy hx⟩ |
0 commit comments