@@ -1157,6 +1157,94 @@ lemma filter.eventually.exists_Ioo_subset [no_max_order α] [no_min_order α] {a
1157
1157
∃ l u, a ∈ Ioo l u ∧ Ioo l u ⊆ {x | p x} :=
1158
1158
mem_nhds_iff_exists_Ioo_subset.1 hp
1159
1159
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
+
1160
1248
section pi
1161
1249
1162
1250
/-!
0 commit comments