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

Commit 8da80f4

Browse files
committed
feat(data/set/countable): add iff versions of some lemmas (#15671)
1 parent f22fe49 commit 8da80f4

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

src/data/set/countable.lean

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -158,30 +158,27 @@ lemma countable_Union {t : ι → set α} [countable ι] (ht : ∀ i, (t i).coun
158158
(⋃a, t a).countable :=
159159
by { haveI := λ a, (ht a).to_subtype, rw Union_eq_range_psigma, apply countable_range }
160160

161-
lemma countable.bUnion
162-
{s : set α} {t : Π x ∈ s, set β} (hs : s.countable) (ht : ∀a∈s, (t a ‹_›).countable) :
163-
(⋃a∈s, t a ‹_›).countable :=
164-
begin
165-
rw bUnion_eq_Union,
166-
haveI := hs.to_subtype,
167-
exact countable_Union (by simpa using ht)
168-
end
161+
@[simp] lemma countable_Union_iff [countable ι] {t : ι → set α} :
162+
(⋃ i, t i).countable ↔ ∀ i, (t i).countable :=
163+
⟨λ h i, h.mono $ subset_Union _ _, countable_Union⟩
169164

170-
lemma countable.sUnion {s : set (set α)} (hs : s.countable) (h : ∀a∈s, (a : _).countable) :
171-
(⋃₀ s).countable :=
172-
by rw sUnion_eq_bUnion; exact hs.bUnion h
165+
lemma countable.bUnion_iff {s : set α} {t : Π a ∈ s, set β} (hs : s.countable) :
166+
(⋃ a ∈ s, t a ‹_›).countable ↔ ∀ a ∈ s, (t a ‹_›).countable :=
167+
by { haveI := hs.to_subtype, rw [bUnion_eq_Union, countable_Union_iff, set_coe.forall'] }
173168

174-
lemma countable_Union_Prop {p : Prop} {t : p → set β} (ht : ∀h:p, (t h).countable) :
175-
(⋃h:p, t h).countable :=
176-
by by_cases p; simp [h, ht]
169+
lemma countable.sUnion_iff {s : set (set α)} (hs : s.countable) :
170+
(⋃₀ s).countable ↔ ∀ a ∈ s, (a : _).countable :=
171+
by rw [sUnion_eq_bUnion, hs.bUnion_iff]
177172

178-
lemma countable.union
179-
{s₁ s₂ : set α} (h₁ : s₁.countable) (h₂ : s₂.countable) : (s₁ ∪ s₂).countable :=
180-
by rw union_eq_Union; exact
181-
countable_Union (bool.forall_bool.2 ⟨h₂, h₁⟩)
173+
alias countable.bUnion_iff ↔ _ countable.bUnion
174+
alias countable.sUnion_iff ↔ _ countable.sUnion
182175

183176
@[simp] lemma countable_union {s t : set α} : (s ∪ t).countable ↔ s.countable ∧ t.countable :=
184-
⟨λ h, ⟨h.mono (subset_union_left s t), h.mono (subset_union_right _ _)⟩, λ h, h.1.union h.2
177+
by simp [union_eq_Union, and.comm]
178+
179+
lemma countable.union {s t : set α} (hs : s.countable) (ht : t.countable) :
180+
(s ∪ t).countable :=
181+
countable_union.2 ⟨hs, ht⟩
185182

186183
@[simp] lemma countable_insert {s : set α} {a : α} : (insert a s).countable ↔ s.countable :=
187184
by simp only [insert_eq, countable_union, countable_singleton, true_and]

src/measure_theory/constructions/borel_space.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ begin
634634
rcases exists_countable_dense_bot_top α with ⟨s, hsc, hsd, hsb, hst⟩,
635635
have : (⋃ (l ∈ s) (u ∈ s) (h : l < u), {Ico l u} : set (set α)).countable,
636636
from hsc.bUnion (λ l hl, hsc.bUnion
637-
(λ u hu, countable_Union_Prop $ λ _, countable_singleton _)),
637+
(λ u hu, countable_Union $ λ _, countable_singleton _)),
638638
simp only [← set_of_eq_eq_singleton, ← set_of_exists] at this,
639639
refine measure.ext_of_generate_from_of_cover_subset
640640
(borel_space.measurable_eq.trans (borel_eq_generate_from_Ico α))

0 commit comments

Comments
 (0)