Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 970b17b

Browse files
committed
refactor(topology/metric_space): move lemmas about paracompact_space and the shrinking lemma to separate files (#8404)
Only a few files in `mathlib` actually depend on results about `paracompact_space`. With this refactor, only a few files depend on `topology/paracompact_space` and `topology/shrinking_lemma`. The main side effects are that `paracompact_of_emetric` and `normal_of_emetric` instances are not available without importing `topology.metric_space.emetric_paracompact` and the shrinking lemma for balls in a proper metric space is not available without `import topology.metric_space.shrinking_lemma`.
1 parent 0dd81c1 commit 970b17b

File tree

6 files changed

+290
-240
lines changed

6 files changed

+290
-240
lines changed

src/analysis/fourier.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import measure_theory.continuous_map_dense
77
import measure_theory.l2_space
88
import measure_theory.haar_measure
99
import analysis.complex.circle
10+
import topology.metric_space.emetric_paracompact
1011
import topology.continuous_function.stone_weierstrass
1112

1213
/-!

src/geometry/manifold/partition_of_unity.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Yury G. Kudryashov
55
-/
6+
import topology.paracompact
7+
import topology.shrinking_lemma
68
import geometry.manifold.bump_function
79

810
/-!

src/topology/metric_space/basic.lean

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Authors: Jeremy Avigad, Robert Y. Lewis, Johannes Hölzl, Mario Carneiro, Sébas
55
-/
66

77
import topology.metric_space.emetric_space
8-
import topology.shrinking_lemma
98
import topology.algebra.ordered.basic
109
import data.fintype.intervals
1110

@@ -1982,105 +1981,6 @@ instance metric_space_pi : metric_space (Πb, π b) :=
19821981

19831982
end pi
19841983

1985-
section proper_space
1986-
1987-
variables {ι : Type*} {c : ι → γ}
1988-
variables [proper_space γ] {x : γ} {r : ℝ} {s : set γ}
1989-
1990-
/-- Shrinking lemma for coverings by open balls in a proper metric space. A point-finite open cover
1991-
of a closed subset of a proper metric space by open balls can be shrunk to a new cover by open balls
1992-
so that each of the new balls has strictly smaller radius than the old one. This version assumes
1993-
that `λ x, ball (c i) (r i)` is a locally finite covering and provides a covering indexed by the
1994-
same type. -/
1995-
lemma exists_subset_Union_ball_radius_lt {r : ι → ℝ} (hs : is_closed s)
1996-
(uf : ∀ x ∈ s, finite {i | x ∈ ball (c i) (r i)}) (us : s ⊆ ⋃ i, ball (c i) (r i)) :
1997-
∃ r' : ι → ℝ, s ⊆ (⋃ i, ball (c i) (r' i)) ∧ ∀ i, r' i < r i :=
1998-
begin
1999-
rcases exists_subset_Union_closed_subset hs (λ i, @is_open_ball _ _ (c i) (r i)) uf us
2000-
with ⟨v, hsv, hvc, hcv⟩,
2001-
have := λ i, exists_lt_subset_ball (hvc i) (hcv i),
2002-
choose r' hlt hsub,
2003-
exact ⟨r', subset.trans hsv $ Union_subset_Union $ hsub, hlt⟩
2004-
end
2005-
2006-
/-- Shrinking lemma for coverings by open balls in a proper metric space. A point-finite open cover
2007-
of a proper metric space by open balls can be shrunk to a new cover by open balls so that each of
2008-
the new balls has strictly smaller radius than the old one. -/
2009-
lemma exists_Union_ball_eq_radius_lt {r : ι → ℝ} (uf : ∀ x, finite {i | x ∈ ball (c i) (r i)})
2010-
(uU : (⋃ i, ball (c i) (r i)) = univ) :
2011-
∃ r' : ι → ℝ, (⋃ i, ball (c i) (r' i)) = univ ∧ ∀ i, r' i < r i :=
2012-
let ⟨r', hU, hv⟩ := exists_subset_Union_ball_radius_lt is_closed_univ (λ x _, uf x) uU.ge
2013-
in ⟨r', univ_subset_iff.1 hU, hv⟩
2014-
2015-
/-- Shrinking lemma for coverings by open balls in a proper metric space. A point-finite open cover
2016-
of a closed subset of a proper metric space by nonempty open balls can be shrunk to a new cover by
2017-
nonempty open balls so that each of the new balls has strictly smaller radius than the old one. -/
2018-
lemma exists_subset_Union_ball_radius_pos_lt {r : ι → ℝ} (hr : ∀ i, 0 < r i) (hs : is_closed s)
2019-
(uf : ∀ x ∈ s, finite {i | x ∈ ball (c i) (r i)}) (us : s ⊆ ⋃ i, ball (c i) (r i)) :
2020-
∃ r' : ι → ℝ, s ⊆ (⋃ i, ball (c i) (r' i)) ∧ ∀ i, r' i ∈ Ioo 0 (r i) :=
2021-
begin
2022-
rcases exists_subset_Union_closed_subset hs (λ i, @is_open_ball _ _ (c i) (r i)) uf us
2023-
with ⟨v, hsv, hvc, hcv⟩,
2024-
have := λ i, exists_pos_lt_subset_ball (hr i) (hvc i) (hcv i),
2025-
choose r' hlt hsub,
2026-
exact ⟨r', subset.trans hsv $ Union_subset_Union hsub, hlt⟩
2027-
end
2028-
2029-
/-- Shrinking lemma for coverings by open balls in a proper metric space. A point-finite open cover
2030-
of a proper metric space by nonempty open balls can be shrunk to a new cover by nonempty open balls
2031-
so that each of the new balls has strictly smaller radius than the old one. -/
2032-
lemma exists_Union_ball_eq_radius_pos_lt {r : ι → ℝ} (hr : ∀ i, 0 < r i)
2033-
(uf : ∀ x, finite {i | x ∈ ball (c i) (r i)}) (uU : (⋃ i, ball (c i) (r i)) = univ) :
2034-
∃ r' : ι → ℝ, (⋃ i, ball (c i) (r' i)) = univ ∧ ∀ i, r' i ∈ Ioo 0 (r i) :=
2035-
let ⟨r', hU, hv⟩ := exists_subset_Union_ball_radius_pos_lt hr is_closed_univ (λ x _, uf x) uU.ge
2036-
in ⟨r', univ_subset_iff.1 hU, hv⟩
2037-
2038-
/-- Let `R : γ → ℝ` be a (possibly discontinuous) function on a proper metric space.
2039-
Let `s` be a closed set in `α` such that `R` is positive on `s`. Then there exists a collection of
2040-
pairs of balls `metric.ball (c i) (r i)`, `metric.ball (c i) (r' i)` such that
2041-
2042-
* all centers belong to `s`;
2043-
* for all `i` we have `0 < r i < r' i < R (c i)`;
2044-
* the family of balls `metric.ball (c i) (r' i)` is locally finite;
2045-
* the balls `metric.ball (c i) (r i)` cover `s`.
2046-
2047-
This is a simple corollary of `refinement_of_locally_compact_sigma_compact_of_nhds_basis_set`
2048-
and `exists_subset_Union_ball_radius_pos_lt`. -/
2049-
lemma exists_locally_finite_subset_Union_ball_radius_lt (hs : is_closed s)
2050-
{R : γ → ℝ} (hR : ∀ x ∈ s, 0 < R x) :
2051-
∃ (ι : Type w) (c : ι → γ) (r r' : ι → ℝ),
2052-
(∀ i, c i ∈ s ∧ 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧
2053-
locally_finite (λ i, ball (c i) (r' i)) ∧ s ⊆ ⋃ i, ball (c i) (r i) :=
2054-
begin
2055-
have : ∀ x ∈ s, (𝓝 x).has_basis (λ r : ℝ, 0 < r ∧ r < R x) (λ r, ball x r),
2056-
from λ x hx, nhds_basis_uniformity (uniformity_basis_dist_lt (hR x hx)),
2057-
rcases refinement_of_locally_compact_sigma_compact_of_nhds_basis_set hs this
2058-
with ⟨ι, c, r', hr', hsub', hfin⟩,
2059-
rcases exists_subset_Union_ball_radius_pos_lt (λ i, (hr' i).2.1) hs
2060-
(λ x hx, hfin.point_finite x) hsub' with ⟨r, hsub, hlt⟩,
2061-
exact ⟨ι, c, r, r', λ i, ⟨(hr' i).1, (hlt i).1, (hlt i).2, (hr' i).2.2⟩, hfin, hsub⟩
2062-
end
2063-
2064-
/-- Let `R : γ → ℝ` be a (possibly discontinuous) positive function on a proper metric space. Then
2065-
there exists a collection of pairs of balls `metric.ball (c i) (r i)`, `metric.ball (c i) (r' i)`
2066-
such that
2067-
2068-
* for all `i` we have `0 < r i < r' i < R (c i)`;
2069-
* the family of balls `metric.ball (c i) (r' i)` is locally finite;
2070-
* the balls `metric.ball (c i) (r i)` cover the whole space.
2071-
2072-
This is a simple corollary of `refinement_of_locally_compact_sigma_compact_of_nhds_basis`
2073-
and `exists_Union_ball_eq_radius_pos_lt` or `exists_locally_finite_subset_Union_ball_radius_lt`. -/
2074-
lemma exists_locally_finite_Union_eq_ball_radius_lt {R : γ → ℝ} (hR : ∀ x, 0 < R x) :
2075-
∃ (ι : Type w) (c : ι → γ) (r r' : ι → ℝ), (∀ i, 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧
2076-
locally_finite (λ i, ball (c i) (r' i)) ∧ (⋃ i, ball (c i) (r i)) = univ :=
2077-
let ⟨ι, c, r, r', hlt, hfin, hsub⟩ := exists_locally_finite_subset_Union_ball_radius_lt
2078-
is_closed_univ (λ x _, hR x)
2079-
in ⟨ι, c, r, r', λ i, (hlt i).2, hfin, univ_subset_iff.1 hsub⟩
2080-
2081-
end proper_space
2082-
2083-
20841984
namespace metric
20851985
section second_countable
20861986
open topological_space
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
/-
2+
Copyright (c) 202 Yury G. Kudryashov. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yury G. Kudryashov
5+
-/
6+
import topology.metric_space.emetric_space
7+
import topology.paracompact
8+
import set_theory.ordinal
9+
10+
/-!
11+
# (Extended) metric spaces are paracompact
12+
13+
In this file we provide two instances:
14+
15+
* `emetric.paracompact_space`: a `pseudo_emetric_space` is paracompact; formalization is based
16+
on [MR0236876];
17+
* `emetric.normal_of_metric`: an `emetric_space` is a normal topological space.
18+
19+
## Tags
20+
21+
metric space, paracompact space, normal space
22+
-/
23+
24+
variable {α : Type*}
25+
26+
open_locale ennreal topological_space
27+
open set
28+
29+
namespace emetric
30+
31+
/-- A `pseudo_emetric_space` is always a paracompact space. Formalization is based
32+
on [MR0236876]. -/
33+
@[priority 100] -- See note [lower instance priority]
34+
instance [pseudo_emetric_space α] : paracompact_space α :=
35+
begin
36+
classical,
37+
/- We start with trivial observations about `1 / 2 ^ k`. Here and below we use `1 / 2 ^ k` in
38+
the comments and `2⁻¹ ^ k` in the code. -/
39+
have pow_pos : ∀ k : ℕ, (0 : ℝ≥0∞) < 2⁻¹ ^ k,
40+
from λ k, ennreal.pow_pos (ennreal.inv_pos.2 ennreal.two_ne_top) _,
41+
have hpow_le : ∀ {m n : ℕ}, m ≤ n → (2⁻¹ : ℝ≥0∞) ^ n ≤ 2⁻¹ ^ m,
42+
from λ m n h, ennreal.pow_le_pow_of_le_one (ennreal.inv_le_one.2 ennreal.one_lt_two.le) h,
43+
have h2pow : ∀ n : ℕ, 2 * (2⁻¹ : ℝ≥0∞) ^ (n + 1) = 2⁻¹ ^ n,
44+
by { intro n, simp [pow_succ, ← mul_assoc, ennreal.mul_inv_cancel] },
45+
-- Consider an open covering `S : set (set α)`
46+
refine ⟨λ ι s ho hcov, _⟩,
47+
simp only [Union_eq_univ_iff] at hcov,
48+
-- choose a well founded order on `S`
49+
letI : linear_order ι := linear_order_of_STO' well_ordering_rel,
50+
have wf : well_founded ((<) : ι → ι → Prop) := @is_well_order.wf ι well_ordering_rel _,
51+
-- Let `ind x` be the minimal index `s : S` such that `x ∈ s`.
52+
set ind : α → ι := λ x, wf.min {i : ι | x ∈ s i} (hcov x),
53+
have mem_ind : ∀ x, x ∈ s (ind x), from λ x, wf.min_mem _ (hcov x),
54+
have nmem_of_lt_ind : ∀ {x i}, i < (ind x) → x ∉ s i,
55+
from λ x i hlt hxi, wf.not_lt_min _ (hcov x) hxi hlt,
56+
/- The refinement `D : ℕ → ι → set α` is defined recursively. For each `n` and `i`, `D n i`
57+
is the union of balls `ball x (1 / 2 ^ n)` over all points `x` such that
58+
59+
* `ind x = i`;
60+
* `x` does not belong to any `D m j`, `m < n`;
61+
* `ball x (3 / 2 ^ n) ⊆ s i`;
62+
63+
We define this sequence using `nat.strong_rec_on'`, then restate it as `Dn` and `memD`.
64+
-/
65+
set D : ℕ → ι → set α :=
66+
λ n, nat.strong_rec_on' n (λ n D' i,
67+
⋃ (x : α) (hxs : ind x = i) (hb : ball x (3 * 2⁻¹ ^ n) ⊆ s i)
68+
(hlt : ∀ (m < n) (j : ι), x ∉ D' m ‹_› j), ball x (2⁻¹ ^ n)),
69+
have Dn : ∀ n i, D n i = ⋃ (x : α) (hxs : ind x = i) (hb : ball x (3 * 2⁻¹ ^ n) ⊆ s i)
70+
(hlt : ∀ (m < n) (j : ι), x ∉ D m j), ball x (2⁻¹ ^ n),
71+
from λ n s, by { simp only [D], rw nat.strong_rec_on_beta' },
72+
have memD : ∀ {n i y}, y ∈ D n i ↔ ∃ x (hi : ind x = i) (hb : ball x (3 * 2⁻¹ ^ n) ⊆ s i)
73+
(hlt : ∀ (m < n) (j : ι), x ∉ D m j), edist y x < 2⁻¹ ^ n,
74+
{ intros n i y, rw [Dn n i], simp only [mem_Union, mem_ball] },
75+
-- The sets `D n i` cover the whole space. Indeed, for each `x` we can choose `n` such that
76+
-- `ball x (3 / 2 ^ n) ⊆ s (ind x)`, then either `x ∈ D n i`, or `x ∈ D m i` for some `m < n`.
77+
have Dcov : ∀ x, ∃ n i, x ∈ D n i,
78+
{ intro x,
79+
obtain ⟨n, hn⟩ : ∃ n : ℕ, ball x (3 * 2⁻¹ ^ n) ⊆ s (ind x),
80+
{ -- This proof takes 5 lines because we can't import `specific_limits` here
81+
rcases is_open_iff.1 (ho $ ind x) x (mem_ind x) with ⟨ε, ε0, hε⟩,
82+
have : 0 < ε / 3 := ennreal.div_pos_iff.2 ⟨ε0.lt.ne', ennreal.coe_ne_top⟩,
83+
rcases ennreal.exists_inv_two_pow_lt this.ne' with ⟨n, hn⟩,
84+
refine ⟨n, subset.trans (ball_subset_ball _) hε⟩,
85+
simpa only [div_eq_mul_inv, mul_comm] using (ennreal.mul_lt_of_lt_div hn).le },
86+
by_contra h, push_neg at h,
87+
apply h n (ind x),
88+
exact memD.2 ⟨x, rfl, hn, λ _ _ _, h _ _, mem_ball_self (pow_pos _)⟩ },
89+
-- Each `D n i` is a union of open balls, hence it is an open set
90+
have Dopen : ∀ n i, is_open (D n i),
91+
{ intros n i,
92+
rw Dn,
93+
iterate 4 { refine is_open_Union (λ _, _) },
94+
exact is_open_ball },
95+
-- the covering `D n i` is a refinement of the original covering: `D n i ⊆ s i`
96+
have HDS : ∀ n i, D n i ⊆ s i,
97+
{ intros n s x,
98+
rw memD,
99+
rintro ⟨y, rfl, hsub, -, hyx⟩,
100+
refine hsub (lt_of_lt_of_le hyx _),
101+
calc 2⁻¹ ^ n = 1 * 2⁻¹ ^ n : (one_mul _).symm
102+
... ≤ 3 * 2⁻¹ ^ n : ennreal.mul_le_mul _ le_rfl,
103+
-- TODO: use `norm_num`
104+
have : ((1 : ℕ) : ℝ≥0∞) ≤ (3 : ℕ), from ennreal.coe_nat_le_coe_nat.2 (by norm_num1),
105+
exact_mod_cast this },
106+
-- Let us show the rest of the properties. Since the definition expects a family indexed
107+
-- by a single parameter, we use `ℕ × ι` as the domain.
108+
refine ⟨ℕ × ι, λ ni, D ni.1 ni.2, λ _, Dopen _ _, _, _, λ ni, ⟨ni.2, HDS _ _⟩⟩,
109+
-- The sets `D n i` cover the whole space as we proved earlier
110+
{ refine Union_eq_univ_iff.2 (λ x, _),
111+
rcases Dcov x with ⟨n, i, h⟩,
112+
exact ⟨⟨n, i⟩, h⟩ },
113+
{ /- Let us prove that the covering `D n i` is locally finite. Take a point `x` and choose
114+
`n`, `i` so that `x ∈ D n i`. Since `D n i` is an open set, we can choose `k` so that
115+
`B = ball x (1 / 2 ^ (n + k + 1)) ⊆ D n i`. -/
116+
intro x,
117+
rcases Dcov x with ⟨n, i, hn⟩,
118+
have : D n i ∈ 𝓝 x, from is_open.mem_nhds (Dopen _ _) hn,
119+
rcases (nhds_basis_uniformity uniformity_basis_edist_inv_two_pow).mem_iff.1 this
120+
with ⟨k, -, hsub : ball x (2⁻¹ ^ k) ⊆ D n i⟩,
121+
set B := ball x (2⁻¹ ^ (n + k + 1)),
122+
refine ⟨B, ball_mem_nhds _ (pow_pos _), _⟩,
123+
-- The sets `D m i`, `m > n + k`, are disjoint with `B`
124+
have Hgt : ∀ (m ≥ n + k + 1) (i : ι), disjoint (D m i) B,
125+
{ rintros m hm i y ⟨hym, hyx⟩,
126+
rcases memD.1 hym with ⟨z, rfl, hzi, H, hz⟩,
127+
have : z ∉ ball x (2⁻¹ ^ k), from λ hz, H n (by linarith) i (hsub hz), apply this,
128+
calc edist z x ≤ edist y z + edist y x : edist_triangle_left _ _ _
129+
... < (2⁻¹ ^ m) + (2⁻¹ ^ (n + k + 1)) : ennreal.add_lt_add hz hyx
130+
... ≤ (2⁻¹ ^ (k + 1)) + (2⁻¹ ^ (k + 1)) :
131+
add_le_add (hpow_le $ by linarith) (hpow_le $ by linarith)
132+
... = (2⁻¹ ^ k) : by rw [← two_mul, h2pow] },
133+
-- For each `m ≤ n + k` there is at most one `j` such that `D m j ∩ B` is nonempty.
134+
have Hle : ∀ m ≤ n + k, set.subsingleton {j | (D m j ∩ B).nonempty},
135+
{ rintros m hm j₁ ⟨y, hyD, hyB⟩ j₂ ⟨z, hzD, hzB⟩,
136+
by_contra h,
137+
wlog h : j₁ < j₂ := ne.lt_or_lt h using [j₁ j₂ y z, j₂ j₁ z y],
138+
rcases memD.1 hyD with ⟨y', rfl, hsuby, -, hdisty⟩,
139+
rcases memD.1 hzD with ⟨z', rfl, -, -, hdistz⟩,
140+
suffices : edist z' y' < 3 * 2⁻¹ ^ m, from nmem_of_lt_ind h (hsuby this),
141+
calc edist z' y' ≤ edist z' x + edist x y' : edist_triangle _ _ _
142+
... ≤ (edist z z' + edist z x) + (edist y x + edist y y') :
143+
add_le_add (edist_triangle_left _ _ _) (edist_triangle_left _ _ _)
144+
... < (2⁻¹ ^ m + 2⁻¹ ^ (n + k + 1)) + (2⁻¹ ^ (n + k + 1) + 2⁻¹ ^ m) :
145+
by apply_rules [ennreal.add_lt_add]
146+
... = 2 * (2⁻¹ ^ m + 2⁻¹ ^ (n + k + 1)) : by simp only [two_mul, add_comm]
147+
... ≤ 2 * (2⁻¹ ^ m + 2⁻¹ ^ (m + 1)) :
148+
ennreal.mul_le_mul le_rfl $ add_le_add le_rfl $ hpow_le (add_le_add hm le_rfl)
149+
... = 3 * 2⁻¹ ^ m : by rw [mul_add, h2pow, bit1, add_mul, one_mul] },
150+
-- Finally, we glue `Hgt` and `Hle`
151+
have : (⋃ (m ≤ n + k) (i ∈ {i : ι | (D m i ∩ B).nonempty}), {(m, i)}).finite,
152+
from (finite_le_nat _).bUnion (λ i hi, (Hle i hi).finite.bUnion (λ _ _, finite_singleton _)),
153+
refine this.subset (λ I hI, _), simp only [mem_Union],
154+
refine ⟨I.1, _, I.2, hI, prod.mk.eta.symm⟩,
155+
exact not_lt.1 (λ hlt, Hgt I.1 hlt I.2 hI.some_spec) }
156+
end
157+
158+
@[priority 100] -- see Note [lower instance priority]
159+
instance normal_of_emetric [emetric_space α] : normal_space α := normal_of_paracompact_t2
160+
161+
end emetric

0 commit comments

Comments
 (0)