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

Commit b08c7ac

Browse files
committed
chore(topology/locally_finite): move from topology.basic (#15640)
Create a new file about `locally_finite`, move the definition and some lemmas from `topology.basic`.
1 parent 2a9d569 commit b08c7ac

File tree

3 files changed

+165
-150
lines changed

3 files changed

+165
-150
lines changed

src/topology/basic.lean

Lines changed: 0 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,151 +1175,6 @@ le_nhds_Lim h
11751175

11761176
end lim
11771177

1178-
/-!
1179-
### Locally finite families
1180-
-/
1181-
1182-
/- locally finite family [General Topology (Bourbaki, 1995)] -/
1183-
section locally_finite
1184-
1185-
/-- A family of sets in `set α` is locally finite if at every point `x:α`,
1186-
there is a neighborhood of `x` which meets only finitely many sets in the family -/
1187-
def locally_finite (f : β → set α) :=
1188-
∀x:α, ∃t ∈ 𝓝 x, {i | (f i ∩ t).nonempty}.finite
1189-
1190-
lemma locally_finite.point_finite {f : β → set α} (hf : locally_finite f) (x : α) :
1191-
{b | x ∈ f b}.finite :=
1192-
let ⟨t, hxt, ht⟩ := hf x in ht.subset $ λ b hb, ⟨x, hb, mem_of_mem_nhds hxt⟩
1193-
1194-
lemma locally_finite_of_finite [finite β] (f : β → set α) : locally_finite f :=
1195-
assume x, ⟨univ, univ_mem, to_finite _⟩
1196-
1197-
lemma locally_finite.subset
1198-
{f₁ f₂ : β → set α} (hf₂ : locally_finite f₂) (hf : ∀b, f₁ b ⊆ f₂ b) : locally_finite f₁ :=
1199-
assume a,
1200-
let ⟨t, ht₁, ht₂⟩ := hf₂ a in
1201-
⟨t, ht₁, ht₂.subset $ assume i hi, hi.mono $ inter_subset_inter (hf i) $ subset.refl _⟩
1202-
1203-
lemma locally_finite.comp_inj_on {ι} {f : β → set α} {g : ι → β} (hf : locally_finite f)
1204-
(hg : inj_on g {i | (f (g i)).nonempty}) : locally_finite (f ∘ g) :=
1205-
λ x, let ⟨t, htx, htf⟩ := hf x in ⟨t, htx, htf.preimage $ hg.mono $ λ i hi,
1206-
hi.out.mono $ inter_subset_left _ _⟩
1207-
1208-
lemma locally_finite.comp_injective {ι} {f : β → set α} {g : ι → β} (hf : locally_finite f)
1209-
(hg : function.injective g) : locally_finite (f ∘ g) :=
1210-
hf.comp_inj_on (hg.inj_on _)
1211-
1212-
lemma locally_finite.eventually_finite {f : β → set α} (hf : locally_finite f) (x : α) :
1213-
∀ᶠ s in (𝓝 x).small_sets, {i | (f i ∩ s).nonempty}.finite :=
1214-
eventually_small_sets.2 $ let ⟨s, hsx, hs⟩ := hf x in
1215-
⟨s, hsx, λ t hts, hs.subset $ λ i hi, hi.out.mono $ inter_subset_inter_right _ hts⟩
1216-
1217-
lemma locally_finite.exists_mem_basis {f : β → set α} (hf : locally_finite f) {p : ι → Prop}
1218-
{s : ι → set α} {x : α} (hb : (𝓝 x).has_basis p s) :
1219-
∃ i (hi : p i), {j | (f j ∩ s i).nonempty}.finite :=
1220-
let ⟨i, hpi, hi⟩ := hb.small_sets.eventually_iff.mp (hf.eventually_finite x)
1221-
in ⟨i, hpi, hi subset.rfl⟩
1222-
1223-
lemma locally_finite.sum_elim {γ} {f : β → set α} {g : γ → set α} (hf : locally_finite f)
1224-
(hg : locally_finite g) : locally_finite (sum.elim f g) :=
1225-
begin
1226-
intro x,
1227-
obtain ⟨s, hsx, hsf, hsg⟩ :
1228-
∃ s, s ∈ 𝓝 x ∧ {i | (f i ∩ s).nonempty}.finite ∧ {j | (g j ∩ s).nonempty}.finite,
1229-
from ((𝓝 x).frequently_small_sets_mem.and_eventually
1230-
((hf.eventually_finite x).and (hg.eventually_finite x))).exists,
1231-
refine ⟨s, hsx, _⟩,
1232-
convert (hsf.image sum.inl).union (hsg.image sum.inr) using 1,
1233-
ext (i|j); simp
1234-
end
1235-
1236-
lemma locally_finite.closure {f : β → set α} (hf : locally_finite f) :
1237-
locally_finite (λ i, closure (f i)) :=
1238-
begin
1239-
intro x,
1240-
rcases hf x with ⟨s, hsx, hsf⟩,
1241-
refine ⟨interior s, interior_mem_nhds.2 hsx, hsf.subset $ λ i hi, _⟩,
1242-
exact (hi.mono (closure_inter_open' is_open_interior)).of_closure.mono
1243-
(inter_subset_inter_right _ interior_subset)
1244-
end
1245-
1246-
lemma locally_finite.is_closed_Union {f : β → set α}
1247-
(h₁ : locally_finite f) (h₂ : ∀i, is_closed (f i)) : is_closed (⋃i, f i) :=
1248-
begin
1249-
simp only [← is_open_compl_iff, compl_Union, is_open_iff_mem_nhds, mem_Inter],
1250-
intros a ha,
1251-
replace ha : ∀ i, (f i)ᶜ ∈ 𝓝 a := λ i, (h₂ i).is_open_compl.mem_nhds (ha i),
1252-
rcases h₁ a with ⟨t, h_nhds, h_fin⟩,
1253-
have : t ∩ (⋂ i ∈ {i | (f i ∩ t).nonempty}, (f i)ᶜ) ∈ 𝓝 a,
1254-
from inter_mem h_nhds ((bInter_mem h_fin).2 (λ i _, ha i)),
1255-
filter_upwards [this],
1256-
simp only [mem_inter_eq, mem_Inter],
1257-
rintros b ⟨hbt, hn⟩ i hfb,
1258-
exact hn i ⟨b, hfb, hbt⟩ hfb,
1259-
end
1260-
1261-
lemma locally_finite.closure_Union {f : β → set α} (h : locally_finite f) :
1262-
closure (⋃ i, f i) = ⋃ i, closure (f i) :=
1263-
subset.antisymm
1264-
(closure_minimal (Union_mono $ λ _, subset_closure) $
1265-
h.closure.is_closed_Union $ λ _, is_closed_closure)
1266-
(Union_subset $ λ i, closure_mono $ subset_Union _ _)
1267-
1268-
/-- If `f : β → set α` is a locally finite family of closed sets, then for any `x : α`, the
1269-
intersection of the complements to `f i`, `x ∉ f i`, is a neighbourhood of `x`. -/
1270-
lemma locally_finite.Inter_compl_mem_nhds {f : β → set α} (hf : locally_finite f)
1271-
(hc : ∀ i, is_closed (f i)) (x : α) : (⋂ i (hi : x ∉ f i), (f i)ᶜ) ∈ 𝓝 x :=
1272-
begin
1273-
refine is_open.mem_nhds _ (mem_Inter₂.2 $ λ i, id),
1274-
suffices : is_closed (⋃ i : {i // x ∉ f i}, f i),
1275-
by rwa [← is_open_compl_iff, compl_Union, Inter_subtype] at this,
1276-
exact (hf.comp_injective subtype.coe_injective).is_closed_Union (λ i, hc _)
1277-
end
1278-
1279-
/-- Let `f : ℕ → Π a, β a` be a sequence of (dependent) functions on a topological space. Suppose
1280-
that the family of sets `s n = {x | f (n + 1) x ≠ f n x}` is locally finite. Then there exists a
1281-
function `F : Π a, β a` such that for any `x`, we have `f n x = F x` on the product of an infinite
1282-
interval `[N, +∞)` and a neighbourhood of `x`.
1283-
1284-
We formulate the conclusion in terms of the product of filter `filter.at_top` and `𝓝 x`. -/
1285-
lemma locally_finite.exists_forall_eventually_eq_prod {β : α → Sort*} {f : ℕ → Π a : α, β a}
1286-
(hf : locally_finite (λ n, {x | f (n + 1) x ≠ f n x})) :
1287-
∃ F : Π a : α, β a, ∀ x, ∀ᶠ p : ℕ × α in at_top ×ᶠ 𝓝 x, f p.1 p.2 = F p.2 :=
1288-
begin
1289-
choose U hUx hU using hf,
1290-
choose N hN using λ x, (hU x).bdd_above,
1291-
replace hN : ∀ x (n > N x) (y ∈ U x), f (n + 1) y = f n y,
1292-
from λ x n hn y hy, by_contra (λ hne, hn.lt.not_le $ hN x ⟨y, hne, hy⟩),
1293-
replace hN : ∀ x (n ≥ N x + 1) (y ∈ U x), f n y = f (N x + 1) y,
1294-
from λ x n hn y hy, nat.le_induction rfl (λ k hle, (hN x _ hle _ hy).trans) n hn,
1295-
refine ⟨λ x, f (N x + 1) x, λ x, _⟩,
1296-
filter_upwards [filter.prod_mem_prod (eventually_gt_at_top (N x)) (hUx x)],
1297-
rintro ⟨n, y⟩ ⟨hn : N x < n, hy : y ∈ U x⟩,
1298-
calc f n y = f (N x + 1) y : hN _ _ hn _ hy
1299-
... = f (max (N x + 1) (N y + 1)) y : (hN _ _ (le_max_left _ _) _ hy).symm
1300-
... = f (N y + 1) y : hN _ _ (le_max_right _ _) _ (mem_of_mem_nhds $ hUx y)
1301-
end
1302-
1303-
/-- Let `f : ℕ → Π a, β a` be a sequence of (dependent) functions on a topological space. Suppose
1304-
that the family of sets `s n = {x | f (n + 1) x ≠ f n x}` is locally finite. Then there exists a
1305-
function `F : Π a, β a` such that for any `x`, for sufficiently large values of `n`, we have
1306-
`f n y = F y` in a neighbourhood of `x`. -/
1307-
lemma locally_finite.exists_forall_eventually_at_top_eventually_eq' {β : α → Sort*}
1308-
{f : ℕ → Π a : α, β a} (hf : locally_finite (λ n, {x | f (n + 1) x ≠ f n x})) :
1309-
∃ F : Π a : α, β a, ∀ x, ∀ᶠ n : ℕ in at_top, ∀ᶠ y : α in 𝓝 x, f n y = F y :=
1310-
hf.exists_forall_eventually_eq_prod.imp $ λ F hF x, (hF x).curry
1311-
1312-
/-- Let `f : ℕ → α → β` be a sequence of functions on a topological space. Suppose
1313-
that the family of sets `s n = {x | f (n + 1) x ≠ f n x}` is locally finite. Then there exists a
1314-
function `F : α → β` such that for any `x`, for sufficiently large values of `n`, we have
1315-
`f n =ᶠ[𝓝 x] F`. -/
1316-
lemma locally_finite.exists_forall_eventually_at_top_eventually_eq
1317-
{f : ℕ → α → β} (hf : locally_finite (λ n, {x | f (n + 1) x ≠ f n x})) :
1318-
∃ F : α → β, ∀ x, ∀ᶠ n : ℕ in at_top, f n =ᶠ[𝓝 x] F :=
1319-
hf.exists_forall_eventually_at_top_eventually_eq'
1320-
1321-
end locally_finite
1322-
13231178
end topological_space
13241179

13251180
/-!
@@ -1446,11 +1301,6 @@ nat.rec_on n continuous_at_id $ λ n ihn,
14461301
show continuous_at (f^[n] ∘ f) x,
14471302
from continuous_at.comp (hx.symm ▸ ihn) hf
14481303

1449-
lemma locally_finite.preimage_continuous {ι} {f : ι → set α} {g : β → α} (hf : locally_finite f)
1450-
(hg : continuous g) : locally_finite (λ i, g ⁻¹' (f i)) :=
1451-
λ x, let ⟨s, hsx, hs⟩ := hf (g x)
1452-
in ⟨g ⁻¹' s, hg.continuous_at hsx, hs.subset $ λ i ⟨y, hy⟩, ⟨g y, hy⟩⟩
1453-
14541304
lemma continuous_iff_is_closed {f : α → β} :
14551305
continuous f ↔ (∀s, is_closed s → is_closed (f ⁻¹' s)) :=
14561306
⟨assume hf s hs, by simpa using (continuous_def.1 hf sᶜ hs.is_open_compl).is_closed_compl,

src/topology/constructions.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Johannes Hölzl, Mario Carneiro, Patrick Massot
55
-/
66
import topology.maps
7+
import topology.locally_finite
78
import order.filter.pi
89
import data.fin.tuple
910

src/topology/locally_finite.lean

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
/-
2+
Copyright (c) 2022 Yury Kudryashov. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yury Kudryashov
5+
-/
6+
import topology.basic
7+
8+
/-!
9+
### Locally finite families of sets
10+
11+
We say that a family of sets in a topological space is *locally finite* if at every point `x : X`,
12+
there is a neighborhood of `x` which meets only finitely many sets in the family.
13+
14+
In this file we give the definition and prove basic properties of locally finite families of sets.
15+
-/
16+
17+
/- locally finite family [General Topology (Bourbaki, 1995)] -/
18+
19+
open set function filter
20+
open_locale topological_space filter
21+
22+
variables {ι ι' α X Y : Type*} [topological_space X] [topological_space Y]
23+
{f g : ι → set X}
24+
25+
/-- A family of sets in `set X` is locally finite if at every point `x : X`,
26+
there is a neighborhood of `x` which meets only finitely many sets in the family. -/
27+
def locally_finite (f : ι → set X) :=
28+
∀ x : X, ∃t ∈ 𝓝 x, {i | (f i ∩ t).nonempty}.finite
29+
30+
lemma locally_finite_of_finite [finite ι] (f : ι → set X) : locally_finite f :=
31+
assume x, ⟨univ, univ_mem, to_finite _⟩
32+
33+
namespace locally_finite
34+
35+
lemma point_finite (hf : locally_finite f) (x : X) : {b | x ∈ f b}.finite :=
36+
let ⟨t, hxt, ht⟩ := hf x in ht.subset $ λ b hb, ⟨x, hb, mem_of_mem_nhds hxt⟩
37+
38+
protected lemma subset (hf : locally_finite f) (hg : ∀ i, g i ⊆ f i) : locally_finite g :=
39+
assume a,
40+
let ⟨t, ht₁, ht₂⟩ := hf a in
41+
⟨t, ht₁, ht₂.subset $ assume i hi, hi.mono $ inter_subset_inter (hg i) subset.rfl⟩
42+
43+
lemma comp_inj_on {g : ι' → ι} (hf : locally_finite f)
44+
(hg : inj_on g {i | (f (g i)).nonempty}) : locally_finite (f ∘ g) :=
45+
λ x, let ⟨t, htx, htf⟩ := hf x in ⟨t, htx, htf.preimage $ hg.mono $ λ i hi,
46+
hi.out.mono $ inter_subset_left _ _⟩
47+
48+
lemma comp_injective {g : ι' → ι} (hf : locally_finite f)
49+
(hg : function.injective g) : locally_finite (f ∘ g) :=
50+
hf.comp_inj_on (hg.inj_on _)
51+
52+
lemma eventually_finite (hf : locally_finite f) (x : X) :
53+
∀ᶠ s in (𝓝 x).small_sets, {i | (f i ∩ s).nonempty}.finite :=
54+
eventually_small_sets.2 $ let ⟨s, hsx, hs⟩ := hf x in
55+
⟨s, hsx, λ t hts, hs.subset $ λ i hi, hi.out.mono $ inter_subset_inter_right _ hts⟩
56+
57+
lemma exists_mem_basis {ι' : Sort*} (hf : locally_finite f) {p : ι' → Prop}
58+
{s : ι' → set X} {x : X} (hb : (𝓝 x).has_basis p s) :
59+
∃ i (hi : p i), {j | (f j ∩ s i).nonempty}.finite :=
60+
let ⟨i, hpi, hi⟩ := hb.small_sets.eventually_iff.mp (hf.eventually_finite x)
61+
in ⟨i, hpi, hi subset.rfl⟩
62+
63+
lemma sum_elim {g : ι' → set X} (hf : locally_finite f) (hg : locally_finite g) :
64+
locally_finite (sum.elim f g) :=
65+
begin
66+
intro x,
67+
obtain ⟨s, hsx, hsf, hsg⟩ :
68+
∃ s, s ∈ 𝓝 x ∧ {i | (f i ∩ s).nonempty}.finite ∧ {j | (g j ∩ s).nonempty}.finite,
69+
from ((𝓝 x).frequently_small_sets_mem.and_eventually
70+
((hf.eventually_finite x).and (hg.eventually_finite x))).exists,
71+
refine ⟨s, hsx, _⟩,
72+
convert (hsf.image sum.inl).union (hsg.image sum.inr) using 1,
73+
ext (i|j); simp
74+
end
75+
76+
protected lemma closure (hf : locally_finite f) : locally_finite (λ i, closure (f i)) :=
77+
begin
78+
intro x,
79+
rcases hf x with ⟨s, hsx, hsf⟩,
80+
refine ⟨interior s, interior_mem_nhds.2 hsx, hsf.subset $ λ i hi, _⟩,
81+
exact (hi.mono (closure_inter_open' is_open_interior)).of_closure.mono
82+
(inter_subset_inter_right _ interior_subset)
83+
end
84+
85+
lemma is_closed_Union (hf : locally_finite f) (hc : ∀i, is_closed (f i)) :
86+
is_closed (⋃i, f i) :=
87+
begin
88+
simp only [← is_open_compl_iff, compl_Union, is_open_iff_mem_nhds, mem_Inter],
89+
intros a ha,
90+
replace ha : ∀ i, (f i)ᶜ ∈ 𝓝 a := λ i, (hc i).is_open_compl.mem_nhds (ha i),
91+
rcases hf a with ⟨t, h_nhds, h_fin⟩,
92+
have : t ∩ (⋂ i ∈ {i | (f i ∩ t).nonempty}, (f i)ᶜ) ∈ 𝓝 a,
93+
from inter_mem h_nhds ((bInter_mem h_fin).2 (λ i _, ha i)),
94+
filter_upwards [this],
95+
simp only [mem_inter_eq, mem_Inter],
96+
rintros b ⟨hbt, hn⟩ i hfb,
97+
exact hn i ⟨b, hfb, hbt⟩ hfb,
98+
end
99+
100+
lemma closure_Union (h : locally_finite f) : closure (⋃ i, f i) = ⋃ i, closure (f i) :=
101+
subset.antisymm
102+
(closure_minimal (Union_mono $ λ _, subset_closure) $
103+
h.closure.is_closed_Union $ λ _, is_closed_closure)
104+
(Union_subset $ λ i, closure_mono $ subset_Union _ _)
105+
106+
/-- If `f : β → set α` is a locally finite family of closed sets, then for any `x : α`, the
107+
intersection of the complements to `f i`, `x ∉ f i`, is a neighbourhood of `x`. -/
108+
lemma Inter_compl_mem_nhds (hf : locally_finite f) (hc : ∀ i, is_closed (f i)) (x : X) :
109+
(⋂ i (hi : x ∉ f i), (f i)ᶜ) ∈ 𝓝 x :=
110+
begin
111+
refine is_open.mem_nhds _ (mem_Inter₂.2 $ λ i, id),
112+
suffices : is_closed (⋃ i : {i // x ∉ f i}, f i),
113+
by rwa [← is_open_compl_iff, compl_Union, Inter_subtype] at this,
114+
exact (hf.comp_injective subtype.coe_injective).is_closed_Union (λ i, hc _)
115+
end
116+
117+
/-- Let `f : ℕ → Π a, β a` be a sequence of (dependent) functions on a topological space. Suppose
118+
that the family of sets `s n = {x | f (n + 1) x ≠ f n x}` is locally finite. Then there exists a
119+
function `F : Π a, β a` such that for any `x`, we have `f n x = F x` on the product of an infinite
120+
interval `[N, +∞)` and a neighbourhood of `x`.
121+
122+
We formulate the conclusion in terms of the product of filter `filter.at_top` and `𝓝 x`. -/
123+
lemma exists_forall_eventually_eq_prod {π : X → Sort*} {f : ℕ → Π x : X, π x}
124+
(hf : locally_finite (λ n, {x | f (n + 1) x ≠ f n x})) :
125+
∃ F : Π x : X, π x, ∀ x, ∀ᶠ p : ℕ × X in at_top ×ᶠ 𝓝 x, f p.1 p.2 = F p.2 :=
126+
begin
127+
choose U hUx hU using hf,
128+
choose N hN using λ x, (hU x).bdd_above,
129+
replace hN : ∀ x (n > N x) (y ∈ U x), f (n + 1) y = f n y,
130+
from λ x n hn y hy, by_contra (λ hne, hn.lt.not_le $ hN x ⟨y, hne, hy⟩),
131+
replace hN : ∀ x (n ≥ N x + 1) (y ∈ U x), f n y = f (N x + 1) y,
132+
from λ x n hn y hy, nat.le_induction rfl (λ k hle, (hN x _ hle _ hy).trans) n hn,
133+
refine ⟨λ x, f (N x + 1) x, λ x, _⟩,
134+
filter_upwards [filter.prod_mem_prod (eventually_gt_at_top (N x)) (hUx x)],
135+
rintro ⟨n, y⟩ ⟨hn : N x < n, hy : y ∈ U x⟩,
136+
calc f n y = f (N x + 1) y : hN _ _ hn _ hy
137+
... = f (max (N x + 1) (N y + 1)) y : (hN _ _ (le_max_left _ _) _ hy).symm
138+
... = f (N y + 1) y : hN _ _ (le_max_right _ _) _ (mem_of_mem_nhds $ hUx y)
139+
end
140+
141+
/-- Let `f : ℕ → Π a, β a` be a sequence of (dependent) functions on a topological space. Suppose
142+
that the family of sets `s n = {x | f (n + 1) x ≠ f n x}` is locally finite. Then there exists a
143+
function `F : Π a, β a` such that for any `x`, for sufficiently large values of `n`, we have
144+
`f n y = F y` in a neighbourhood of `x`. -/
145+
lemma exists_forall_eventually_at_top_eventually_eq' {π : X → Sort*}
146+
{f : ℕ → Π x : X, π x} (hf : locally_finite (λ n, {x | f (n + 1) x ≠ f n x})) :
147+
∃ F : Π x : X, π x, ∀ x, ∀ᶠ n : ℕ in at_top, ∀ᶠ y : X in 𝓝 x, f n y = F y :=
148+
hf.exists_forall_eventually_eq_prod.imp $ λ F hF x, (hF x).curry
149+
150+
/-- Let `f : ℕ → α → β` be a sequence of functions on a topological space. Suppose
151+
that the family of sets `s n = {x | f (n + 1) x ≠ f n x}` is locally finite. Then there exists a
152+
function `F : α → β` such that for any `x`, for sufficiently large values of `n`, we have
153+
`f n =ᶠ[𝓝 x] F`. -/
154+
lemma exists_forall_eventually_at_top_eventually_eq {f : ℕ → X → α}
155+
(hf : locally_finite (λ n, {x | f (n + 1) x ≠ f n x})) :
156+
∃ F : X → α, ∀ x, ∀ᶠ n : ℕ in at_top, f n =ᶠ[𝓝 x] F :=
157+
hf.exists_forall_eventually_at_top_eventually_eq'
158+
159+
lemma preimage_continuous {g : Y → X} (hf : locally_finite f) (hg : continuous g) :
160+
locally_finite (λ i, g ⁻¹' (f i)) :=
161+
λ x, let ⟨s, hsx, hs⟩ := hf (g x)
162+
in ⟨g ⁻¹' s, hg.continuous_at hsx, hs.subset $ λ i ⟨y, hy⟩, ⟨g y, hy⟩⟩
163+
164+
end locally_finite

0 commit comments

Comments
 (0)