Skip to content

Commit 598bbec

Browse files
teorthclaude
andcommitted
feat(Topology/MetricSpace): metric ε-δ forms of the Heine–Cantor theorem
Add `Mathlib/Topology/MetricSpace/HeineCantor.lean` collecting the metric ε-δ consequences of the uniform-space Heine–Cantor lemmas, each in strict (`_lt`) and non-strict (`_le`) form: - `ContinuousOn.exists_forall_dist_{lt,le}_of_isCompact` - `Continuous.exists_forall_dist_{lt,le}_of_compactSpace` - `IsCompact.exists_forall_dist_{lt,le}_of_continuousAt` These live in a new leaf file rather than in `Pseudo/Lemmas.lean` so that the `Topology.UniformSpace.HeineCantor` import (which transitively pulls in `UniformOnFun`) does not leak into low-level metric files that `assert_not_exists UniformOnFun`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 69b866d commit 598bbec

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8005,6 +8005,7 @@ public import Mathlib.Topology.MetricSpace.GromovHausdorffRealized
80058005
public import Mathlib.Topology.MetricSpace.HausdorffAlexandroff
80068006
public import Mathlib.Topology.MetricSpace.HausdorffDimension
80078007
public import Mathlib.Topology.MetricSpace.HausdorffDistance
8008+
public import Mathlib.Topology.MetricSpace.HeineCantor
80088009
public import Mathlib.Topology.MetricSpace.Holder
80098010
public import Mathlib.Topology.MetricSpace.HolderNorm
80108011
public import Mathlib.Topology.MetricSpace.Infsep
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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

Comments
 (0)