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

Commit f40cd3c

Browse files
committed
feat(topology/algebra/order/basic): in a second-countable linear order, only countably many points are isolated to the right (#14564)
This makes it possible to remove a useless `densely_ordered` assumption in a lemma in `borel_space`.
1 parent a20032a commit f40cd3c

File tree

7 files changed

+108
-9
lines changed

7 files changed

+108
-9
lines changed

src/data/set/basic.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ theorem eq_empty_of_is_empty [is_empty α] (s : set α) : s = ∅ :=
389389
eq_empty_of_subset_empty $ λ x hx, is_empty_elim x
390390

391391
/-- There is exactly one set of a type that is empty. -/
392-
-- TODO[gh-6025]: make this an instance once safe to do so
393-
def unique_empty [is_empty α] : unique (set α) :=
392+
instance unique_empty [is_empty α] : unique (set α) :=
394393
{ default := ∅, uniq := eq_empty_of_is_empty }
395394

396395
lemma not_nonempty_iff_eq_empty {s : set α} : ¬s.nonempty ↔ s = ∅ :=

src/data/set/countable.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ countable_insert.2 h
187187
lemma finite.countable {s : set α} : s.finite → countable s
188188
| ⟨h⟩ := trunc.nonempty (by exactI fintype.trunc_encodable s)
189189

190+
@[nontriviality] lemma countable.of_subsingleton [subsingleton α] (s : set α) :
191+
countable s :=
192+
(finite.of_subsingleton s).countable
193+
190194
lemma subsingleton.countable {s : set α} (hs : s.subsingleton) : countable s :=
191195
hs.finite.countable
192196

src/data/set/finite.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ section set_finite_constructors
337337
theorem finite.of_fintype [fintype α] (s : set α) : s.finite :=
338338
by { classical, apply finite_of_fintype }
339339

340+
@[nontriviality] lemma finite.of_subsingleton [subsingleton α] (s : set α) : s.finite :=
341+
finite.of_fintype s
342+
340343
theorem finite_univ [fintype α] : (@univ α).finite := finite_of_fintype _
341344

342345
theorem finite.union {s t : set α} (hs : s.finite) (ht : t.finite) : (s ∪ t).finite :=

src/measure_theory/constructions/borel_space.lean

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ lemma ae_measurable_restrict_of_antitone_on [linear_order β] [order_closed_topo
11361136
ae_measurable f (μ.restrict s) :=
11371137
@ae_measurable_restrict_of_monotone_on αᵒᵈ β _ _ ‹_› _ _ _ _ _ ‹_› _ _ _ _ hs _ hf
11381138

1139-
lemma measurable_set_of_mem_nhds_within_Ioi_aux [densely_ordered α]
1139+
lemma measurable_set_of_mem_nhds_within_Ioi_aux
11401140
{s : set α} (h : ∀ x ∈ s, s ∈ 𝓝[>] x) (h' : ∀ x ∈ s, ∃ y, x < y) :
11411141
measurable_set s :=
11421142
begin
@@ -1159,12 +1159,11 @@ begin
11591159
have : x ∈ interior s :=
11601160
mem_interior.2 ⟨Ioo x' (y x'), h'y _ hx'.1, is_open_Ioo, ⟨h', hz.1.trans h'z.2⟩⟩,
11611161
exact false.elim (hx.2 this) } },
1162-
apply B.countable_of_is_open (λ x hx, is_open_Ioo) (λ x hx, _),
1163-
simpa using hy x hx.1
1162+
exact B.countable_of_Ioo (λ x hx, hy x hx.1),
11641163
end
11651164

11661165
/-- If a set is a right-neighborhood of all of its points, then it is measurable. -/
1167-
lemma measurable_set_of_mem_nhds_within_Ioi [densely_ordered α] {s : set α}
1166+
lemma measurable_set_of_mem_nhds_within_Ioi {s : set α}
11681167
(h : ∀ x ∈ s, s ∈ 𝓝[>] x) : measurable_set s :=
11691168
begin
11701169
by_cases H : ∃ x ∈ s, is_top x,

src/measure_theory/integral/set_to_l1.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,9 +673,7 @@ lemma set_to_simple_func_const (T : set α → F →L[ℝ] F') (hT_empty : T ∅
673673
simple_func.set_to_simple_func T (simple_func.const α x) = T univ x :=
674674
begin
675675
casesI hα : is_empty_or_nonempty α,
676-
{ have h_univ_empty : (univ : set α) = ∅,
677-
{ haveI : unique (set α) := unique_empty,
678-
exact subsingleton.elim (univ : set α) (∅ : set α), },
676+
{ have h_univ_empty : (univ : set α) = ∅, from subsingleton.elim _ _,
679677
rw [h_univ_empty, hT_empty],
680678
simp only [set_to_simple_func, continuous_linear_map.zero_apply, sum_empty,
681679
range_eq_empty_of_is_empty], },

src/topology/algebra/order/basic.lean

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,94 @@ lemma filter.eventually.exists_Ioo_subset [no_max_order α] [no_min_order α] {a
11571157
∃ l u, a ∈ Ioo l u ∧ Ioo l u ⊆ {x | p x} :=
11581158
mem_nhds_iff_exists_Ioo_subset.1 hp
11591159

1160+
/-- The set of points which are isolated on the right is countable when the space is
1161+
second-countable. -/
1162+
lemma countable_of_isolated_right [second_countable_topology α] :
1163+
set.countable {x : α | ∃ y, x < y ∧ Ioo x y = ∅} :=
1164+
begin
1165+
nontriviality α,
1166+
let s := {x : α | ∃ y, x < y ∧ Ioo x y = ∅},
1167+
have : ∀ x ∈ s, ∃ y, x < y ∧ Ioo x y = ∅ := λ x, id,
1168+
choose! y hy h'y using this,
1169+
have Hy : ∀ x z, x ∈ s → z < y x → z ≤ x,
1170+
{ assume x z xs hz,
1171+
have A : Ioo x (y x) = ∅ := h'y _ xs,
1172+
contrapose! A,
1173+
exact ne_empty_iff_nonempty.2 ⟨z, A, hz⟩ },
1174+
suffices H : ∀ (a : set α), is_open a → set.countable {x | x ∈ s ∧ x ∈ a ∧ y x ∉ a},
1175+
{ have : s ⊆ ⋃ (a ∈ countable_basis α), {x | x ∈ s ∧ x ∈ a ∧ y x ∉ a},
1176+
{ assume x hx,
1177+
rcases (is_basis_countable_basis α).exists_mem_of_ne (hy x hx).ne with ⟨a, ab, xa, ya⟩,
1178+
simp only [mem_set_of_eq, mem_Union],
1179+
exact ⟨a, ab, hx, xa, ya⟩ },
1180+
apply countable.mono this,
1181+
refine countable.bUnion (countable_countable_basis α) (λ a ha, H _ _),
1182+
exact is_open_of_mem_countable_basis ha },
1183+
assume a ha,
1184+
suffices H : set.countable {x | x ∈ s ∧ x ∈ a ∧ y x ∉ a ∧ ¬(is_bot x)},
1185+
{ have : {x | x ∈ s ∧ x ∈ a ∧ y x ∉ a} ⊆
1186+
{x | x ∈ s ∧ x ∈ a ∧ y x ∉ a ∧ ¬(is_bot x)} ∪ {x | is_bot x},
1187+
{ assume x hx,
1188+
by_cases h'x : is_bot x,
1189+
{ simp only [h'x, mem_set_of_eq, mem_union_eq, not_true, and_false, false_or] },
1190+
{ simpa only [h'x, hx.2.1, hx.2.2, mem_set_of_eq, mem_union_eq,
1191+
not_false_iff, and_true, or_false] using hx.left } },
1192+
exact countable.mono this (H.union (subsingleton_is_bot α).countable) },
1193+
let t := {x | x ∈ s ∧ x ∈ a ∧ y x ∉ a ∧ ¬(is_bot x)},
1194+
have : ∀ x ∈ t, ∃ z < x, Ioc z x ⊆ a,
1195+
{ assume x hx,
1196+
apply exists_Ioc_subset_of_mem_nhds (ha.mem_nhds hx.2.1),
1197+
simpa only [is_bot, not_forall, not_le] using hx.right.right.right },
1198+
choose! z hz h'z using this,
1199+
have : pairwise_disjoint t (λ x, Ioc (z x) x),
1200+
{ assume x xt x' x't hxx',
1201+
rcases lt_or_gt_of_ne hxx' with h'|h',
1202+
{ refine disjoint_left.2 (λ u ux ux', xt.2.2.1 _),
1203+
refine h'z x' x't ⟨ux'.1.trans_le (ux.2.trans (hy x xt.1).le), _⟩,
1204+
by_contra' H,
1205+
exact false.elim (lt_irrefl _ ((Hy _ _ xt.1 H).trans_lt h')) },
1206+
{ refine disjoint_left.2 (λ u ux ux', x't.2.2.1 _),
1207+
refine h'z x xt ⟨ux.1.trans_le (ux'.2.trans (hy x' x't.1).le), _⟩,
1208+
by_contra' H,
1209+
exact false.elim (lt_irrefl _ ((Hy _ _ x't.1 H).trans_lt h')) } },
1210+
refine this.countable_of_is_open (λ x hx, _) (λ x hx, ⟨x, hz x hx, le_rfl⟩),
1211+
suffices H : Ioc (z x) x = Ioo (z x) (y x),
1212+
{ rw H, exact is_open_Ioo },
1213+
exact subset.antisymm (Ioc_subset_Ioo_right (hy x hx.1)) (λ u hu, ⟨hu.1, Hy _ _ hx.1 hu.2⟩),
1214+
end
1215+
1216+
/-- The set of points which are isolated on the left is countable when the space is
1217+
second-countable. -/
1218+
lemma countable_of_isolated_left [second_countable_topology α] :
1219+
set.countable {x : α | ∃ y, y < x ∧ Ioo y x = ∅} :=
1220+
begin
1221+
convert @countable_of_isolated_right αᵒᵈ _ _ _ _,
1222+
have : ∀ (x y : α), Ioo x y = {z | z < y ∧ x < z},
1223+
{ simp_rw [and_comm, Ioo], simp only [eq_self_iff_true, forall_2_true_iff] },
1224+
simp_rw [this],
1225+
refl
1226+
end
1227+
1228+
/-- Consider a disjoint family of intervals `(x, y)` with `x < y` in a second-countable space.
1229+
Then the family is countable.
1230+
This is not a straightforward consequence of second-countability as some of these intervals might be
1231+
empty (but in fact this can happen only for countably many of them). -/
1232+
lemma set.pairwise_disjoint.countable_of_Ioo [second_countable_topology α]
1233+
{y : α → α} {s : set α} (h : pairwise_disjoint s (λ x, Ioo x (y x))) (h' : ∀ x ∈ s, x < y x) :
1234+
countable s :=
1235+
begin
1236+
let t := {x | x ∈ s ∧ (Ioo x (y x)).nonempty},
1237+
have t_count : countable t,
1238+
{ have : t ⊆ s := λ x hx, hx.1,
1239+
exact (h.subset this).countable_of_is_open (λ x hx, is_open_Ioo) (λ x hx, hx.2) },
1240+
have : s ⊆ t ∪ {x : α | ∃ x', x < x' ∧ Ioo x x' = ∅},
1241+
{ assume x hx,
1242+
by_cases h'x : (Ioo x (y x)).nonempty,
1243+
{ exact or.inl ⟨hx, h'x⟩ },
1244+
{ exact or.inr ⟨y x, h' x hx, not_nonempty_iff_eq_empty.1 h'x⟩ } },
1245+
exact countable.mono this (t_count.union countable_of_isolated_right),
1246+
end
1247+
11601248
section pi
11611249

11621250
/-!

src/topology/separation.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,14 @@ begin
318318
exact is_closed_bUnion hs (λ i hi, is_closed_singleton)
319319
end
320320

321+
lemma topological_space.is_topological_basis.exists_mem_of_ne
322+
[t1_space α] {b : set (set α)} (hb : is_topological_basis b) {x y : α} (h : x ≠ y) :
323+
∃ a ∈ b, x ∈ a ∧ y ∉ a :=
324+
begin
325+
rcases hb.is_open_iff.1 is_open_ne x h with ⟨a, ab, xa, ha⟩,
326+
exact ⟨a, ab, xa, λ h, ha h rfl⟩,
327+
end
328+
321329
lemma filter.coclosed_compact_le_cofinite [t1_space α] :
322330
filter.coclosed_compact α ≤ filter.cofinite :=
323331
λ s hs, compl_compl s ▸ hs.is_compact.compl_mem_coclosed_compact_of_is_closed hs.is_closed

0 commit comments

Comments
 (0)