Theorem: MeasureTheory.countable_generateSetAlgebra
File: Mathlib/MeasureTheory/SetAlgebra.lean

tactic: let ℬ := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
⊢ (generateSetAlgebra 𝒜).Countable
state_after: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
⊢ (generateSetAlgebra 𝒜).Countable

tactic: have count_ℬ : ℬ.Countable := by
  apply h.union
  have : compl '' 𝒜 = {s | sᶜ ∈ 𝒜} := by
    ext s; simp
    exact ⟨fun ⟨x, x_mem, hx⟩ ↦ by simp [← hx, x_mem], fun hs ↦ ⟨sᶜ, hs, by simp⟩⟩
  exact this ▸ h.image compl
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
⊢ (generateSetAlgebra 𝒜).Countable
state_after: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
⊢ (generateSetAlgebra 𝒜).Countable

tactic: let f : Set (Set (Set α)) → Set α := fun A ↦ ⋃ a ∈ A, ⋂ t ∈ a, t
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
⊢ (generateSetAlgebra 𝒜).Countable
state_after: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
⊢ (generateSetAlgebra 𝒜).Countable

tactic: let 𝒞 := {a | a.Finite ∧ a ⊆ ℬ}
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
⊢ (generateSetAlgebra 𝒜).Countable
state_after: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
⊢ (generateSetAlgebra 𝒜).Countable

tactic: have count_𝒞 : 𝒞.Countable := countable_setOf_finite_subset (countable_coe_iff.1 count_ℬ)
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
⊢ (generateSetAlgebra 𝒜).Countable
state_after: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
⊢ (generateSetAlgebra 𝒜).Countable

tactic: let 𝒟 := {A | A.Finite ∧ A ⊆ 𝒞}
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
⊢ (generateSetAlgebra 𝒜).Countable
state_after: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
𝒟 : Set (Set (Set (Set α))) := {A | A.Finite ∧ A ⊆ 𝒞}
⊢ (generateSetAlgebra 𝒜).Countable

tactic: have count_𝒟 : 𝒟.Countable := countable_setOf_finite_subset (countable_coe_iff.1 count_𝒞)
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
𝒟 : Set (Set (Set (Set α))) := {A | A.Finite ∧ A ⊆ 𝒞}
⊢ (generateSetAlgebra 𝒜).Countable
state_after: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
𝒟 : Set (Set (Set (Set α))) := {A | A.Finite ∧ A ⊆ 𝒞}
count_𝒟 : 𝒟.Countable
⊢ (generateSetAlgebra 𝒜).Countable

tactic: have : generateSetAlgebra 𝒜 ⊆ f '' 𝒟 := by
  intro s s_mem
  rcases mem_generateSetAlgebra_elim s_mem with ⟨A, A_fin, mem_A, hA, rfl⟩
  exact ⟨A, ⟨A_fin, fun a ha ↦ ⟨mem_A a ha, hA a ha⟩⟩, rfl⟩
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
𝒟 : Set (Set (Set (Set α))) := {A | A.Finite ∧ A ⊆ 𝒞}
count_𝒟 : 𝒟.Countable
⊢ (generateSetAlgebra 𝒜).Countable
state_after: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
𝒟 : Set (Set (Set (Set α))) := {A | A.Finite ∧ A ⊆ 𝒞}
count_𝒟 : 𝒟.Countable
this : generateSetAlgebra 𝒜 ⊆ f '' 𝒟
⊢ (generateSetAlgebra 𝒜).Countable

tactic: exact (count_𝒟.image f).mono this
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
𝒟 : Set (Set (Set (Set α))) := {A | A.Finite ∧ A ⊆ 𝒞}
count_𝒟 : 𝒟.Countable
this : generateSetAlgebra 𝒜 ⊆ f '' 𝒟
⊢ (generateSetAlgebra 𝒜).Countable
state_after: no goals

tactic: apply h.union
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
⊢ ℬ.Countable
state_after: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
⊢ {s | sᶜ ∈ 𝒜}.Countable

tactic: have : compl '' 𝒜 = {s | sᶜ ∈ 𝒜} := by
  ext s; simp
  exact ⟨fun ⟨x, x_mem, hx⟩ ↦ by simp [← hx, x_mem], fun hs ↦ ⟨sᶜ, hs, by simp⟩⟩
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
⊢ {s | sᶜ ∈ 𝒜}.Countable
state_after: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
this : compl '' 𝒜 = {s | sᶜ ∈ 𝒜}
⊢ {s | sᶜ ∈ 𝒜}.Countable

tactic: exact this ▸ h.image compl
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
this : compl '' 𝒜 = {s | sᶜ ∈ 𝒜}
⊢ {s | sᶜ ∈ 𝒜}.Countable
state_after: no goals

tactic: ext s
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
⊢ compl '' 𝒜 = {s | sᶜ ∈ 𝒜}
state_after: case h
α : Type u_1
𝒜 : Set (Set α)
s✝ t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
s : Set α
⊢ s ∈ compl '' 𝒜 ↔ s ∈ {s | sᶜ ∈ 𝒜}

tactic: simp
state_before: case h
α : Type u_1
𝒜 : Set (Set α)
s✝ t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
s : Set α
⊢ s ∈ compl '' 𝒜 ↔ s ∈ {s | sᶜ ∈ 𝒜}
state_after: case h
α : Type u_1
𝒜 : Set (Set α)
s✝ t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
s : Set α
⊢ (∃ x ∈ 𝒜, xᶜ = s) ↔ sᶜ ∈ 𝒜

tactic: exact ⟨fun ⟨x, x_mem, hx⟩ ↦ by simp [← hx, x_mem], fun hs ↦ ⟨sᶜ, hs, by simp⟩⟩
state_before: case h
α : Type u_1
𝒜 : Set (Set α)
s✝ t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
s : Set α
⊢ (∃ x ∈ 𝒜, xᶜ = s) ↔ sᶜ ∈ 𝒜
state_after: no goals

tactic: simp [← hx, x_mem]
state_before: α : Type u_1
𝒜 : Set (Set α)
s✝ t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
s : Set α
x✝ : ∃ x ∈ 𝒜, xᶜ = s
x : Set α
x_mem : x ∈ 𝒜
hx : xᶜ = s
⊢ sᶜ ∈ 𝒜
state_after: no goals

tactic: simp
state_before: α : Type u_1
𝒜 : Set (Set α)
s✝ t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
s : Set α
hs : sᶜ ∈ 𝒜
⊢ sᶜᶜ = s
state_after: no goals

tactic: intro s s_mem
state_before: α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
𝒟 : Set (Set (Set (Set α))) := {A | A.Finite ∧ A ⊆ 𝒞}
count_𝒟 : 𝒟.Countable
⊢ generateSetAlgebra 𝒜 ⊆ f '' 𝒟
state_after: α : Type u_1
𝒜 : Set (Set α)
s✝ t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
𝒟 : Set (Set (Set (Set α))) := {A | A.Finite ∧ A ⊆ 𝒞}
count_𝒟 : 𝒟.Countable
s : Set α
s_mem : s ∈ generateSetAlgebra 𝒜
⊢ s ∈ f '' 𝒟

tactic: rcases mem_generateSetAlgebra_elim s_mem with ⟨A, A_fin, mem_A, hA, rfl⟩
state_before: α : Type u_1
𝒜 : Set (Set α)
s✝ t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
𝒟 : Set (Set (Set (Set α))) := {A | A.Finite ∧ A ⊆ 𝒞}
count_𝒟 : 𝒟.Countable
s : Set α
s_mem : s ∈ generateSetAlgebra 𝒜
⊢ s ∈ f '' 𝒟
state_after: case intro.intro.intro.intro
α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
𝒟 : Set (Set (Set (Set α))) := {A | A.Finite ∧ A ⊆ 𝒞}
count_𝒟 : 𝒟.Countable
A : Set (Set (Set α))
A_fin : A.Finite
mem_A : ∀ a ∈ A, a.Finite
hA : ∀ a ∈ A, ∀ t ∈ a, t ∈ 𝒜 ∨ tᶜ ∈ 𝒜
s_mem : ⋃ a ∈ A, ⋂ t ∈ a, t ∈ generateSetAlgebra 𝒜
⊢ ⋃ a ∈ A, ⋂ t ∈ a, t ∈ f '' 𝒟

tactic: exact ⟨A, ⟨A_fin, fun a ha ↦ ⟨mem_A a ha, hA a ha⟩⟩, rfl⟩
state_before: case intro.intro.intro.intro
α : Type u_1
𝒜 : Set (Set α)
s t : Set α
h : 𝒜.Countable
ℬ : Set (Set α) := {s | s ∈ 𝒜} ∪ {s | sᶜ ∈ 𝒜}
count_ℬ : ℬ.Countable
f : Set (Set (Set α)) → Set α := fun A => ⋃ a ∈ A, ⋂ t ∈ a, t
𝒞 : Set (Set (Set α)) := {a | a.Finite ∧ a ⊆ ℬ}
count_𝒞 : 𝒞.Countable
𝒟 : Set (Set (Set (Set α))) := {A | A.Finite ∧ A ⊆ 𝒞}
count_𝒟 : 𝒟.Countable
A : Set (Set (Set α))
A_fin : A.Finite
mem_A : ∀ a ∈ A, a.Finite
hA : ∀ a ∈ A, ∀ t ∈ a, t ∈ 𝒜 ∨ tᶜ ∈ 𝒜
s_mem : ⋃ a ∈ A, ⋂ t ∈ a, t ∈ generateSetAlgebra 𝒜
⊢ ⋃ a ∈ A, ⋂ t ∈ a, t ∈ f '' 𝒟
state_after: no goals