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

Commit 201413b

Browse files
Patrick Massotjohoelzl
authored andcommitted
chore(topology): Splits topology.basic and topology.continuity (#785)
Also, the most basic aspects of continuity are now in topology.basic
1 parent 1084868 commit 201413b

File tree

16 files changed

+2357
-2276
lines changed

16 files changed

+2357
-2276
lines changed

src/category_theory/instances/topological_spaces.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import category_theory.limits.types
1010
import category_theory.natural_isomorphism
1111
import category_theory.eq_to_hom
1212
import topology.basic
13-
import topology.continuity
13+
import topology.opens
1414
import order.galois_connection
1515

1616
open category_theory

src/data/analysis/topology.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Mario Carneiro
55
66
Computational realization of topological spaces (experimental).
77
-/
8-
import topology.basic data.analysis.filter
8+
import topology.bases data.analysis.filter
99
open set
1010
open filter (hiding realizer)
1111

src/topology/algebra/topological_structures.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ TODO: generalize `topological_monoid` and `topological_add_monoid` to semigroups
1111
import order.liminf_limsup
1212
import algebra.big_operators algebra.group algebra.pi_instances
1313
import data.set.intervals data.equiv.algebra
14-
import topology.basic topology.continuity topology.uniform_space.basic
14+
import topology.constructions topology.uniform_space.basic
1515

1616
open classical set lattice filter topological_space
1717
local attribute [instance] classical.prop_decidable

src/topology/bases.lean

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
/-
2+
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Johannes Hölzl, Mario Carneiro
5+
6+
Bases of topologies. Countability axioms.
7+
-/
8+
9+
import topology.order
10+
11+
open set filter lattice classical
12+
13+
namespace topological_space
14+
/- countability axioms
15+
16+
For our applications we are interested that there exists a countable basis, but we do not need the
17+
concrete basis itself. This allows us to declare these type classes as `Prop` to use them as mixins.
18+
-/
19+
universe u
20+
variables {α : Type u} [t : topological_space α]
21+
include t
22+
23+
/-- A topological basis is one that satisfies the necessary conditions so that
24+
it suffices to take unions of the basis sets to get a topology (without taking
25+
finite intersections as well). -/
26+
def is_topological_basis (s : set (set α)) : Prop :=
27+
(∀t₁∈s, ∀t₂∈s, ∀ x ∈ t₁ ∩ t₂, ∃ t₃∈s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂) ∧
28+
(⋃₀ s) = univ ∧
29+
t = generate_from s
30+
31+
lemma is_topological_basis_of_subbasis {s : set (set α)} (hs : t = generate_from s) :
32+
is_topological_basis ((λf, ⋂₀ f) '' {f:set (set α) | finite f ∧ f ⊆ s ∧ ⋂₀ f ≠ ∅}) :=
33+
let b' := (λf, ⋂₀ f) '' {f:set (set α) | finite f ∧ f ⊆ s ∧ ⋂₀ f ≠ ∅} in
34+
⟨assume s₁ ⟨t₁, ⟨hft₁, ht₁b, ht₁⟩, eq₁⟩ s₂ ⟨t₂, ⟨hft₂, ht₂b, ht₂⟩, eq₂⟩,
35+
have ie : ⋂₀(t₁ ∪ t₂) = ⋂₀ t₁ ∩ ⋂₀ t₂, from Inf_union,
36+
eq₁ ▸ eq₂ ▸ assume x h,
37+
⟨_, ⟨t₁ ∪ t₂, ⟨finite_union hft₁ hft₂, union_subset ht₁b ht₂b,
38+
by simpa only [ie] using ne_empty_of_mem h⟩, ie⟩, h, subset.refl _⟩,
39+
eq_univ_iff_forall.2 $ assume a, ⟨univ, ⟨∅, ⟨finite_empty, empty_subset _,
40+
by rw sInter_empty; exact nonempty_iff_univ_ne_empty.1 ⟨a⟩⟩, sInter_empty⟩, mem_univ _⟩,
41+
have generate_from s = generate_from b',
42+
from le_antisymm
43+
(generate_from_le $ assume s hs,
44+
by_cases
45+
(assume : s = ∅, by rw [this]; apply @is_open_empty _ _)
46+
(assume : s ≠ ∅, generate_open.basic _ ⟨{s}, ⟨finite_singleton s, singleton_subset_iff.2 hs,
47+
by rwa [sInter_singleton]⟩, sInter_singleton s⟩))
48+
(generate_from_le $ assume u ⟨t, ⟨hft, htb, ne⟩, eq⟩,
49+
eq ▸ @is_open_sInter _ (generate_from s) _ hft (assume s hs, generate_open.basic _ $ htb hs)),
50+
this ▸ hs⟩
51+
52+
lemma is_topological_basis_of_open_of_nhds {s : set (set α)}
53+
(h_open : ∀ u ∈ s, _root_.is_open u)
54+
(h_nhds : ∀(a:α) (u : set α), a ∈ u → _root_.is_open u → ∃v ∈ s, a ∈ v ∧ v ⊆ u) :
55+
is_topological_basis s :=
56+
⟨assume t₁ ht₁ t₂ ht₂ x ⟨xt₁, xt₂⟩,
57+
h_nhds x (t₁ ∩ t₂) ⟨xt₁, xt₂⟩
58+
(is_open_inter _ _ _ (h_open _ ht₁) (h_open _ ht₂)),
59+
eq_univ_iff_forall.2 $ assume a,
60+
let ⟨u, h₁, h₂, _⟩ := h_nhds a univ trivial (is_open_univ _) in
61+
⟨u, h₁, h₂⟩,
62+
le_antisymm
63+
(assume u hu,
64+
(@is_open_iff_nhds α (generate_from _) _).mpr $ assume a hau,
65+
let ⟨v, hvs, hav, hvu⟩ := h_nhds a u hau hu in
66+
by rw nhds_generate_from; exact infi_le_of_le v (infi_le_of_le ⟨hav, hvs⟩ $ le_principal_iff.2 hvu))
67+
(generate_from_le h_open)⟩
68+
69+
lemma mem_nhds_of_is_topological_basis {a : α} {s : set α} {b : set (set α)}
70+
(hb : is_topological_basis b) : s ∈ (nhds a).sets ↔ ∃t∈b, a ∈ t ∧ t ⊆ s :=
71+
begin
72+
rw [hb.2.2, nhds_generate_from, infi_sets_eq'],
73+
{ simp only [mem_bUnion_iff, exists_prop, mem_set_of_eq, and_assoc, and.left_comm]; refl },
74+
{ exact assume s ⟨hs₁, hs₂⟩ t ⟨ht₁, ht₂⟩,
75+
have a ∈ s ∩ t, from ⟨hs₁, ht₁⟩,
76+
let ⟨u, hu₁, hu₂, hu₃⟩ := hb.1 _ hs₂ _ ht₂ _ this in
77+
⟨u, ⟨hu₂, hu₁⟩, le_principal_iff.2 (subset.trans hu₃ (inter_subset_left _ _)),
78+
le_principal_iff.2 (subset.trans hu₃ (inter_subset_right _ _))⟩ },
79+
{ rcases eq_univ_iff_forall.1 hb.2.1 a with ⟨i, h1, h2⟩,
80+
exact ⟨i, h2, h1⟩ }
81+
end
82+
83+
lemma is_open_of_is_topological_basis {s : set α} {b : set (set α)}
84+
(hb : is_topological_basis b) (hs : s ∈ b) : _root_.is_open s :=
85+
is_open_iff_mem_nhds.2 $ λ a as,
86+
(mem_nhds_of_is_topological_basis hb).2 ⟨s, hs, as, subset.refl _⟩
87+
88+
lemma mem_basis_subset_of_mem_open {b : set (set α)}
89+
(hb : is_topological_basis b) {a:α} {u : set α} (au : a ∈ u)
90+
(ou : _root_.is_open u) : ∃v ∈ b, a ∈ v ∧ v ⊆ u :=
91+
(mem_nhds_of_is_topological_basis hb).1 $ mem_nhds_sets ou au
92+
93+
lemma sUnion_basis_of_is_open {B : set (set α)}
94+
(hB : is_topological_basis B) {u : set α} (ou : _root_.is_open u) :
95+
∃ S ⊆ B, u = ⋃₀ S :=
96+
⟨{s ∈ B | s ⊆ u}, λ s h, h.1, set.ext $ λ a,
97+
⟨λ ha, let ⟨b, hb, ab, bu⟩ := mem_basis_subset_of_mem_open hB ha ou in
98+
⟨b, ⟨hb, bu⟩, ab⟩,
99+
λ ⟨b, ⟨hb, bu⟩, ab⟩, bu ab⟩⟩
100+
101+
lemma Union_basis_of_is_open {B : set (set α)}
102+
(hB : is_topological_basis B) {u : set α} (ou : _root_.is_open u) :
103+
∃ (β : Type u) (f : β → set α), u = (⋃ i, f i) ∧ ∀ i, f i ∈ B :=
104+
let ⟨S, sb, su⟩ := sUnion_basis_of_is_open hB ou in
105+
⟨S, subtype.val, su.trans set.sUnion_eq_Union, λ ⟨b, h⟩, sb h⟩
106+
107+
variables (α)
108+
109+
/-- A separable space is one with a countable dense subset. -/
110+
class separable_space : Prop :=
111+
(exists_countable_closure_eq_univ : ∃s:set α, countable s ∧ closure s = univ)
112+
113+
/-- A first-countable space is one in which every point has a
114+
countable neighborhood basis. -/
115+
class first_countable_topology : Prop :=
116+
(nhds_generated_countable : ∀a:α, ∃s:set (set α), countable s ∧ nhds a = (⨅t∈s, principal t))
117+
118+
/-- A second-countable space is one with a countable basis. -/
119+
class second_countable_topology : Prop :=
120+
(is_open_generated_countable : ∃b:set (set α), countable b ∧ t = topological_space.generate_from b)
121+
122+
instance second_countable_topology.to_first_countable_topology
123+
[second_countable_topology α] : first_countable_topology α :=
124+
let ⟨b, hb, eq⟩ := second_countable_topology.is_open_generated_countable α in
125+
⟨assume a, ⟨{s | a ∈ s ∧ s ∈ b},
126+
countable_subset (assume x ⟨_, hx⟩, hx) hb, by rw [eq, nhds_generate_from]⟩⟩
127+
128+
lemma second_countable_topology_induced (β)
129+
[t : topological_space β] [second_countable_topology β] (f : α → β) :
130+
@second_countable_topology α (t.induced f) :=
131+
begin
132+
rcases second_countable_topology.is_open_generated_countable β with ⟨b, hb, eq⟩,
133+
refine { is_open_generated_countable := ⟨preimage f '' b, countable_image _ hb, _⟩ },
134+
rw [eq, induced_generate_from_eq]
135+
end
136+
137+
instance subtype.second_countable_topology
138+
(s : set α) [topological_space α] [second_countable_topology α] : second_countable_topology s :=
139+
second_countable_topology_induced s α coe
140+
141+
lemma is_open_generated_countable_inter [second_countable_topology α] :
142+
∃b:set (set α), countable b ∧ ∅ ∉ b ∧ is_topological_basis b :=
143+
let ⟨b, hb₁, hb₂⟩ := second_countable_topology.is_open_generated_countable α in
144+
let b' := (λs, ⋂₀ s) '' {s:set (set α) | finite s ∧ s ⊆ b ∧ ⋂₀ s ≠ ∅} in
145+
⟨b',
146+
countable_image _ $ countable_subset
147+
(by simp only [(and_assoc _ _).symm]; exact inter_subset_left _ _)
148+
(countable_set_of_finite_subset hb₁),
149+
assume ⟨s, ⟨_, _, hn⟩, hp⟩, hn hp,
150+
is_topological_basis_of_subbasis hb₂⟩
151+
152+
instance second_countable_topology.to_separable_space
153+
[second_countable_topology α] : separable_space α :=
154+
let ⟨b, hb₁, hb₂, hb₃, hb₄, eq⟩ := is_open_generated_countable_inter α in
155+
have nhds_eq : ∀a, nhds a = (⨅ s : {s : set α // a ∈ s ∧ s ∈ b}, principal s.val),
156+
by intro a; rw [eq, nhds_generate_from, infi_subtype]; refl,
157+
have ∀s∈b, ∃a, a ∈ s, from assume s hs, exists_mem_of_ne_empty $ assume eq, hb₂ $ eq ▸ hs,
158+
have ∃f:∀s∈b, α, ∀s h, f s h ∈ s, by simp only [skolem] at this; exact this,
159+
let ⟨f, hf⟩ := this in
160+
⟨⟨(⋃s∈b, ⋃h:s∈b, {f s h}),
161+
countable_bUnion hb₁ (λ _ _, countable_Union_Prop $ λ _, countable_singleton _),
162+
set.ext $ assume a,
163+
have a ∈ (⋃₀ b), by rw [hb₄]; exact trivial,
164+
let ⟨t, ht₁, ht₂⟩ := this in
165+
have w : {s : set α // a ∈ s ∧ s ∈ b}, from ⟨t, ht₂, ht₁⟩,
166+
suffices (⨅ (x : {s // a ∈ s ∧ s ∈ b}), principal (x.val ∩ ⋃s (h₁ h₂ : s ∈ b), {f s h₂})) ≠ ⊥,
167+
by simpa only [closure_eq_nhds, nhds_eq, infi_inf w, inf_principal, mem_set_of_eq, mem_univ, iff_true],
168+
infi_neq_bot_of_directed ⟨a⟩
169+
(assume ⟨s₁, has₁, hs₁⟩ ⟨s₂, has₂, hs₂⟩,
170+
have a ∈ s₁ ∩ s₂, from ⟨has₁, has₂⟩,
171+
let ⟨s₃, hs₃, has₃, hs⟩ := hb₃ _ hs₁ _ hs₂ _ this in
172+
⟨⟨s₃, has₃, hs₃⟩, begin
173+
simp only [le_principal_iff, mem_principal_sets, (≥)],
174+
simp only [subset_inter_iff] at hs, split;
175+
apply inter_subset_inter_left; simp only [hs]
176+
end⟩)
177+
(assume ⟨s, has, hs⟩,
178+
have s ∩ (⋃ (s : set α) (H h : s ∈ b), {f s h}) ≠ ∅,
179+
from ne_empty_of_mem ⟨hf _ hs, mem_bUnion hs $ mem_Union.mpr ⟨hs, mem_singleton _⟩⟩,
180+
mt principal_eq_bot_iff.1 this) ⟩⟩
181+
182+
variables {α}
183+
184+
lemma is_open_Union_countable [second_countable_topology α]
185+
{ι} (s : ι → set α) (H : ∀ i, _root_.is_open (s i)) :
186+
∃ T : set ι, countable T ∧ (⋃ i ∈ T, s i) = ⋃ i, s i :=
187+
let ⟨B, cB, _, bB⟩ := is_open_generated_countable_inter α in
188+
begin
189+
let B' := {b ∈ B | ∃ i, b ⊆ s i},
190+
choose f hf using λ b:B', b.2.2,
191+
haveI : encodable B' := (countable_subset (sep_subset _ _) cB).to_encodable,
192+
refine ⟨_, countable_range f,
193+
subset.antisymm (bUnion_subset_Union _ _) (sUnion_subset _)⟩,
194+
rintro _ ⟨i, rfl⟩ x xs,
195+
rcases mem_basis_subset_of_mem_open bB xs (H _) with ⟨b, hb, xb, bs⟩,
196+
exact ⟨_, ⟨_, rfl⟩, _, ⟨⟨⟨_, hb, _, bs⟩, rfl⟩, rfl⟩, hf _ (by exact xb)⟩
197+
end
198+
199+
lemma is_open_sUnion_countable [second_countable_topology α]
200+
(S : set (set α)) (H : ∀ s ∈ S, _root_.is_open s) :
201+
∃ T : set (set α), countable T ∧ T ⊆ S ∧ ⋃₀ T = ⋃₀ S :=
202+
let ⟨T, cT, hT⟩ := is_open_Union_countable (λ s:S, s.1) (λ s, H s.1 s.2) in
203+
⟨subtype.val '' T, countable_image _ cT,
204+
image_subset_iff.2 $ λ ⟨x, xs⟩ xt, xs,
205+
by rwa [sUnion_image, sUnion_eq_Union]⟩
206+
207+
end topological_space

0 commit comments

Comments
 (0)