Skip to content

Commit

Permalink
refactor(topology/subset_properties): reformulate `is_clopen_b{Union,…
Browse files Browse the repository at this point in the history
…Inter}` in terms of `set.finite` (#15272)

This way it mirrors `is_open_bInter`/`is_closed_bUnion`. Also add `is_clopen.prod`.
  • Loading branch information
urkud committed Jul 13, 2022
1 parent 2a32596 commit ea13c1c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/topology/category/Profinite/cofiltered_limit.lean
Expand Up @@ -90,7 +90,7 @@ begin
if hs : s ∈ G then F.map (f s hs) ⁻¹' (V s) else set.univ,
-- Conclude, using the `j0` and the clopen set of `F.obj j0` obtained above.
refine ⟨j0, ⋃ (s : S) (hs : s ∈ G), W s, _, _⟩,
{ apply is_clopen_bUnion,
{ apply is_clopen_bUnion_finset,
intros s hs,
dsimp only [W],
rw dif_pos hs,
Expand Down
4 changes: 2 additions & 2 deletions src/topology/separation.lean
Expand Up @@ -1556,7 +1556,7 @@ begin
rw [←not_disjoint_iff_nonempty_inter, imp_not_comm, not_forall] at H1,
cases H1 (disjoint_compl_left_iff_subset.2 $ hab.trans $ union_subset_union hau hbv) with Zi H2,
refine ⟨(⋂ (U ∈ Zi), subtype.val U), _, _, _⟩,
{ exact is_clopen_bInter (λ Z hZ, Z.2.1) },
{ exact is_clopen_bInter_finset (λ Z hZ, Z.2.1) },
{ exact mem_Inter₂.2 (λ Z hZ, Z.2.2) },
{ rwa [←disjoint_compl_left_iff_subset, disjoint_iff_inter_eq_empty, ←not_nonempty_iff_eq_empty] }
end
Expand Down Expand Up @@ -1722,7 +1722,7 @@ begin
swap, { exact λ Z, Z.2.1.2 },
-- This clopen and its complement will separate the connected components of `a` and `b`
set U : set α := (⋂ (i : {Z // is_clopen Z ∧ b ∈ Z}) (H : i ∈ fin_a), i),
have hU : is_clopen U := is_clopen_bInter (λ i j, i.2.1),
have hU : is_clopen U := is_clopen_bInter_finset (λ i j, i.2.1),
exact ⟨U, coe '' U, hU, ha, subset_Inter₂ (λ Z _, Z.2.1.connected_component_subset Z.2.2),
(connected_components_preimage_image U).symm ▸ hU.bUnion_connected_component_eq⟩ },
rw connected_components.quotient_map_coe.is_clopen_preimage at hU,
Expand Down
31 changes: 20 additions & 11 deletions src/topology/subset_properties.lean
Expand Up @@ -1347,28 +1347,37 @@ theorem is_clopen.compl {s : set α} (hs : is_clopen s) : is_clopen sᶜ :=
theorem is_clopen.diff {s t : set α} (hs : is_clopen s) (ht : is_clopen t) : is_clopen (s \ t) :=
hs.inter ht.compl

lemma is_clopen.prod {s : set α} {t : set β} (hs : is_clopen s) (ht : is_clopen t) :
is_clopen (s ×ˢ t) :=
⟨hs.1.prod ht.1, hs.2.prod ht.2

lemma is_clopen_Union {β : Type*} [fintype β] {s : β → set α}
(h : ∀ i, is_clopen (s i)) : is_clopen (⋃ i, s i) :=
⟨is_open_Union (forall_and_distrib.1 h).1, is_closed_Union (forall_and_distrib.1 h).2

lemma is_clopen_bUnion {β : Type*} {s : finset β} {f : β → set α} (h : ∀ i ∈ s, is_clopen $ f i) :
lemma is_clopen_bUnion {β : Type*} {s : set β} {f : β → set α} (hs : s.finite)
(h : ∀ i ∈ s, is_clopen $ f i) :
is_clopen (⋃ i ∈ s, f i) :=
begin
refine ⟨is_open_bUnion (λ i hi, (h i hi).1), _⟩,
show is_closed (⋃ (i : β) (H : i ∈ (s : set β)), f i),
rw bUnion_eq_Union,
exact is_closed_Union (λ ⟨i, hi⟩,(h i hi).2)
end
⟨is_open_bUnion (λ i hi, (h i hi).1), is_closed_bUnion hs (λ i hi, (h i hi).2)⟩

lemma is_clopen_bUnion_finset {β : Type*} {s : finset β} {f : β → set α}
(h : ∀ i ∈ s, is_clopen $ f i) :
is_clopen (⋃ i ∈ s, f i) :=
is_clopen_bUnion s.finite_to_set h

lemma is_clopen_Inter {β : Type*} [fintype β] {s : β → set α}
(h : ∀ i, is_clopen (s i)) : is_clopen (⋂ i, s i) :=
⟨(is_open_Inter (forall_and_distrib.1 h).1), (is_closed_Inter (forall_and_distrib.1 h).2)⟩

lemma is_clopen_bInter {β : Type*} {s : finset β} {f : β → set α} (h : ∀ i ∈ s, is_clopen (f i)) :
lemma is_clopen_bInter {β : Type*} {s : set β} (hs : s.finite) {f : β → set α}
(h : ∀ i ∈ s, is_clopen (f i)) :
is_clopen (⋂ i ∈ s, f i) :=
⟨is_open_bInter hs (λ i hi, (h i hi).1), is_closed_bInter (λ i hi, (h i hi).2)⟩

lemma is_clopen_bInter_finset {β : Type*} {s : finset β} {f : β → set α}
(h : ∀ i ∈ s, is_clopen (f i)) :
is_clopen (⋂ i ∈ s, f i) :=
⟨ is_open_bInter ⟨finset_coe.fintype s⟩ (λ i hi, (h i hi).1),
by {show is_closed (⋂ (i : β) (H : i ∈ (↑s : set β)), f i), rw bInter_eq_Inter,
apply is_closed_Inter, rintro ⟨i, hi⟩, exact (h i hi).2}⟩
is_clopen_bInter s.finite_to_set h

lemma continuous_on.preimage_clopen_of_clopen
{f : α → β} {s : set α} {t : set β} (hf : continuous_on f s) (hs : is_clopen s)
Expand Down

0 comments on commit ea13c1c

Please sign in to comment.