Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: add instances for MeasurableSpace.CountablyGenerated #5216

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 26 additions & 2 deletions Mathlib/MeasureTheory/MeasurableSpace.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1639,17 +1639,41 @@ variable (α)
/-- We say a measurable space is countably generated
if can be generated by a countable set of sets.-/
class CountablyGenerated [m : MeasurableSpace α] : Prop where
IsCountablyGenerated : ∃ b : Set (Set α), b.Countable ∧ m = generateFrom b
isCountablyGenerated : ∃ b : Set (Set α), b.Countable ∧ m = generateFrom b
#align measurable_space.countably_generated MeasurableSpace.CountablyGenerated

variable {α}

theorem CountablyGenerated.comap [m : MeasurableSpace β] [h : CountablyGenerated β] (f : α → β) :
@CountablyGenerated α (.comap f m) := by
rcases h with ⟨⟨b, hbc, rfl⟩⟩
rw [comap_generateFrom]
letI := generateFrom (preimage f '' b)
exact ⟨_, hbc.image _, rfl⟩

theorem CountablyGenerated.sup {m₁ m₂ : MeasurableSpace β} (h₁ : @CountablyGenerated β m₁)
(h₂ : @CountablyGenerated β m₂) : @CountablyGenerated β (m₁ ⊔ m₂) := by
rcases h₁ with ⟨⟨b₁, hb₁c, rfl⟩⟩
rcases h₂ with ⟨⟨b₂, hb₂c, rfl⟩⟩
exact @mk _ (_ ⊔ _) ⟨_, hb₁c.union hb₂c, generateFrom_sup_generateFrom⟩

instance [MeasurableSpace α] [CountablyGenerated α] {p : α → Prop} :
CountablyGenerated { x // p x } := .comap _

instance [MeasurableSpace α] [CountablyGenerated α] [MeasurableSpace β] [CountablyGenerated β] :
CountablyGenerated (α × β) :=
.sup (.comap Prod.fst) (.comap Prod.snd)

variable (α)

open Classical

/-- If a measurable space is countably generated, it admits a measurable injection
into the Cantor space `ℕ → Bool` (equipped with the product sigma algebra). -/
theorem measurable_injection_nat_bool_of_countablyGenerated [MeasurableSpace α]
[h : CountablyGenerated α] [MeasurableSingletonClass α] :
∃ f : α → ℕ → Bool, Measurable f ∧ Function.Injective f := by
obtain ⟨b, bct, hb⟩ := h.IsCountablyGenerated
obtain ⟨b, bct, hb⟩ := h.isCountablyGenerated
obtain ⟨e, he⟩ := Set.Countable.exists_eq_range (bct.insert ∅) (insert_nonempty _ _)
rw [← generateFrom_insert_empty, he] at hb
refine' ⟨fun x n => x ∈ e n, _, _⟩
Expand Down
7 changes: 2 additions & 5 deletions Mathlib/MeasureTheory/Measure/OuterMeasure.lean
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,8 @@ theorem null_of_locally_null [TopologicalSpace α] [SecondCountableTopology α]
theorem exists_mem_forall_mem_nhds_within_pos [TopologicalSpace α] [SecondCountableTopology α]
(m : OuterMeasure α) {s : Set α} (hs : m s ≠ 0) : ∃ x ∈ s, ∀ t ∈ 𝓝[s] x, 0 < m t := by
contrapose! hs
simp only [nonpos_iff_eq_zero, ← exists_prop] at hs
apply m.null_of_locally_null s
intro x hx
specialize hs x hx
exact Iff.mp bex_def hs
simp only [nonpos_iff_eq_zero] at hs
exact m.null_of_locally_null s hs
#align measure_theory.outer_measure.exists_mem_forall_mem_nhds_within_pos MeasureTheory.OuterMeasure.exists_mem_forall_mem_nhds_within_pos

/-- If `s : ι → Set α` is a sequence of sets, `S = ⋃ n, s n`, and `m (S \ s n)` tends to zero along
Expand Down