l3lab/ntp-mathlib huggingface dataset:
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint μ on As)
⊢ Set.Countable {i | 0 < ↑↑μ (As i)}

Next tactic:
rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
⊢ Set.Countable {i | 0 < ↑↑(sum (sFiniteSeq μ)) (As i)}

Next tactic:
have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
    rw [sum_apply₀] at hi
    · simp_rw [con] at hi
      simp at hi
    · exact As_mble i
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
⊢ {i | 0 < ↑↑(sum (sFiniteSeq μ)) (As i)} ⊆ ⋃ n, {i | 0 < ↑↑(sFiniteSeq μ n) (As i)}

Next tactic:
intro i hi
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
i : ι
hi : i ∈ {i | 0 < ↑↑(sum (sFiniteSeq μ)) (As i)}
⊢ i ∈ ⋃ n, {i | 0 < ↑↑(sFiniteSeq μ n) (As i)}

Next tactic:
by_contra con
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
i : ι
hi : i ∈ {i | 0 < ↑↑(sum (sFiniteSeq μ)) (As i)}
con : i ∉ ⋃ n, {i | 0 < ↑↑(sFiniteSeq μ n) (As i)}
⊢ False

Next tactic:
simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
    

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
i : ι
hi : 0 < ↑↑(sum (sFiniteSeq μ)) (As i)
con : ∀ (x : ℕ), ↑↑(sFiniteSeq μ x) (As i) = 0
⊢ False

Next tactic:
rw [sum_apply₀] at hi
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
    rw [sum_apply₀] at hi
    · 

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
i : ι
hi : 0 < ∑' (i_1 : ℕ), ↑↑(sFiniteSeq μ i_1) (As i)
con : ∀ (x : ℕ), ↑↑(sFiniteSeq μ x) (As i) = 0
⊢ False

Next tactic:
simp_rw [con] at hi
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
    rw [sum_apply₀] at hi
    · simp_rw [con] at hi
      

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
i : ι
con : ∀ (x : ℕ), ↑↑(sFiniteSeq μ x) (As i) = 0
hi : 0 < ∑' (i : ℕ), 0
⊢ False

Next tactic:
simp at hi
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
    rw [sum_apply₀] at hi
    · simp_rw [con] at hi
      simp at hi
    · 

Proof state:
case hs
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
i : ι
hi : 0 < ↑↑(sum (sFiniteSeq μ)) (As i)
con : ∀ (x : ℕ), ↑↑(sFiniteSeq μ x) (As i) = 0
⊢ NullMeasurableSet (As i)

Next tactic:
exact As_mble i
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
    rw [sum_apply₀] at hi
    · simp_rw [con] at hi
      simp at hi
    · exact As_mble i
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
obs : {i | 0 < ↑↑(sum (sFiniteSeq μ)) (As i)} ⊆ ⋃ n, {i | 0 < ↑↑(sFiniteSeq μ n) (As i)}
⊢ Set.Countable {i | 0 < ↑↑(sum (sFiniteSeq μ)) (As i)}

Next tactic:
apply Countable.mono obs
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
    rw [sum_apply₀] at hi
    · simp_rw [con] at hi
      simp at hi
    · exact As_mble i
  apply Countable.mono obs
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
obs : {i | 0 < ↑↑(sum (sFiniteSeq μ)) (As i)} ⊆ ⋃ n, {i | 0 < ↑↑(sFiniteSeq μ n) (As i)}
⊢ Set.Countable (⋃ n, {i | 0 < ↑↑(sFiniteSeq μ n) (As i)})

Next tactic:
refine countable_iUnion fun n ↦ ?_
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
    rw [sum_apply₀] at hi
    · simp_rw [con] at hi
      simp at hi
    · exact As_mble i
  apply Countable.mono obs
  refine countable_iUnion fun n ↦ ?_
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
obs : {i | 0 < ↑↑(sum (sFiniteSeq μ)) (As i)} ⊆ ⋃ n, {i | 0 < ↑↑(sFiniteSeq μ n) (As i)}
n : ℕ
⊢ Set.Countable {i | 0 < ↑↑(sFiniteSeq μ n) (As i)}

Next tactic:
apply countable_meas_pos_of_disjoint_of_meas_iUnion_ne_top₀
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
    rw [sum_apply₀] at hi
    · simp_rw [con] at hi
      simp at hi
    · exact As_mble i
  apply Countable.mono obs
  refine countable_iUnion fun n ↦ ?_
  apply countable_meas_pos_of_disjoint_of_meas_iUnion_ne_top₀
  · 

Proof state:
case As_mble
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
obs : {i | 0 < ↑↑(sum (sFiniteSeq μ)) (As i)} ⊆ ⋃ n, {i | 0 < ↑↑(sFiniteSeq μ n) (As i)}
n : ℕ
⊢ ∀ (i : ι), NullMeasurableSet (As i)

Next tactic:
exact fun i ↦ (As_mble i).mono (le_sum _ _)
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
    rw [sum_apply₀] at hi
    · simp_rw [con] at hi
      simp at hi
    · exact As_mble i
  apply Countable.mono obs
  refine countable_iUnion fun n ↦ ?_
  apply countable_meas_pos_of_disjoint_of_meas_iUnion_ne_top₀
  · exact fun i ↦ (As_mble i).mono (le_sum _ _)
  · 

Proof state:
case As_disj
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
obs : {i | 0 < ↑↑(sum (sFiniteSeq μ)) (As i)} ⊆ ⋃ n, {i | 0 < ↑↑(sFiniteSeq μ n) (As i)}
n : ℕ
⊢ Pairwise (AEDisjoint (sFiniteSeq μ n) on fun i => As i)

Next tactic:
exact fun i j hij ↦ AEDisjoint.of_le (As_disj hij) (le_sum _ _)
/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} { _ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) } := by
  rw [← sum_sFiniteSeq μ] at As_disj As_mble ⊢
  have obs : { i : ι | 0 < sum (sFiniteSeq μ) (As i) }
      ⊆ ⋃ n, { i : ι | 0 < sFiniteSeq μ n (As i) } := by
    intro i hi
    by_contra con
    simp only [mem_iUnion, mem_setOf_eq, not_exists, not_lt, nonpos_iff_eq_zero] at *
    rw [sum_apply₀] at hi
    · simp_rw [con] at hi
      simp at hi
    · exact As_mble i
  apply Countable.mono obs
  refine countable_iUnion fun n ↦ ?_
  apply countable_meas_pos_of_disjoint_of_meas_iUnion_ne_top₀
  · exact fun i ↦ (As_mble i).mono (le_sum _ _)
  · exact fun i j hij ↦ AEDisjoint.of_le (As_disj hij) (le_sum _ _)
  · 

Proof state:
case Union_As_finite
α : Type u_1
β : Type u_2
δ : Type u_3
ι✝ : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
ι : Type u_5
x✝ : MeasurableSpace α
μ : Measure α
inst✝ : SFinite μ
As : ι → Set α
As_mble : ∀ (i : ι), NullMeasurableSet (As i)
As_disj : Pairwise (AEDisjoint (sum (sFiniteSeq μ)) on As)
obs : {i | 0 < ↑↑(sum (sFiniteSeq μ)) (As i)} ⊆ ⋃ n, {i | 0 < ↑↑(sFiniteSeq μ n) (As i)}
n : ℕ
⊢ ↑↑(sFiniteSeq μ n) (⋃ i, As i) ≠ ⊤

Next tactic:
exact measure_ne_top _ (⋃ i, As i)
theorem countable_meas_level_set_pos₀ {α β : Type*} {_ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] [MeasurableSpace β] [MeasurableSingletonClass β] {g : α → β}
    (g_mble : NullMeasurable g μ) : Set.Countable { t : β | 0 < μ { a : α | g a = t } } := by
  

Proof state:
α✝ : Type u_1
β✝ : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α✝
inst✝³ : MeasurableSpace β✝
μ✝ ν ν₁ ν₂ : Measure α✝
s t : Set α✝
α : Type u_5
β : Type u_6
x✝ : MeasurableSpace α
μ : Measure α
inst✝² : SFinite μ
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSingletonClass β
g : α → β
g_mble : NullMeasurable g
⊢ Set.Countable {t | 0 < ↑↑μ {a | g a = t}}

Next tactic:
have level_sets_disjoint : Pairwise (Disjoint on fun t : β => { a : α | g a = t }) :=
    fun s t hst => Disjoint.preimage g (disjoint_singleton.mpr hst)
theorem countable_meas_level_set_pos₀ {α β : Type*} {_ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] [MeasurableSpace β] [MeasurableSingletonClass β] {g : α → β}
    (g_mble : NullMeasurable g μ) : Set.Countable { t : β | 0 < μ { a : α | g a = t } } := by
  have level_sets_disjoint : Pairwise (Disjoint on fun t : β => { a : α | g a = t }) :=
    fun s t hst => Disjoint.preimage g (disjoint_singleton.mpr hst)
  

Proof state:
α✝ : Type u_1
β✝ : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α✝
inst✝³ : MeasurableSpace β✝
μ✝ ν ν₁ ν₂ : Measure α✝
s t : Set α✝
α : Type u_5
β : Type u_6
x✝ : MeasurableSpace α
μ : Measure α
inst✝² : SFinite μ
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSingletonClass β
g : α → β
g_mble : NullMeasurable g
level_sets_disjoint : Pairwise (Disjoint on fun t => {a | g a = t})
⊢ Set.Countable {t | 0 < ↑↑μ {a | g a = t}}

Next tactic:
exact Measure.countable_meas_pos_of_disjoint_iUnion₀
    (fun b => g_mble (‹MeasurableSingletonClass β›.measurableSet_singleton b))
    ((fun _ _ h ↦ Disjoint.aedisjoint (level_sets_disjoint h)))
/-- If a measure `μ` is the sum of a countable family `mₙ`, and a set `t` has finite measure for
each `mₙ`, then its measurable superset `toMeasurable μ t` (which has the same measure as `t`)
satisfies, for any measurable set `s`, the equality `μ (toMeasurable μ t ∩ s) = μ (t ∩ s)`. -/
theorem measure_toMeasurable_inter_of_sum {s : Set α} (hs : MeasurableSet s) {t : Set α}
    {m : ℕ → Measure α} (hv : ∀ n, m n t ≠ ∞) (hμ : μ = sum m) :
    μ (toMeasurable μ t ∩ s) = μ (t ∩ s) := by
  -- we show that there is a measurable superset of `t` satisfying the conclusion for any
  -- measurable set `s`. It is built for each measure `mₙ` using `toMeasurable`
  -- (which is well behaved for finite measure sets thanks to `measure_toMeasurable_inter`), and
  -- then taking the intersection over `n`.
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s✝ t✝ s : Set α
hs : MeasurableSet s
t : Set α
m : ℕ → Measure α
hv : ∀ (n : ℕ), ↑↑(m n) t ≠ ⊤
hμ : μ = sum m
⊢ ↑↑μ (toMeasurable μ t ∩ s) = ↑↑μ (t ∩ s)

Next tactic:
have A : ∃ t', t' ⊇ t ∧ MeasurableSet t' ∧ ∀ u, MeasurableSet u → μ (t' ∩ u) = μ (t ∩ u) := by
    let w n := toMeasurable (m n) t
    have T : t ⊆ ⋂ n, w n := subset_iInter (fun i ↦ subset_toMeasurable (m i) t)
    have M : MeasurableSet (⋂ n, w n) :=
      MeasurableSet.iInter (fun i ↦ measurableSet_toMeasurable (m i) t)
    refine ⟨⋂ n, w n, T, M, fun u hu ↦ ?_⟩
    refine le_antisymm ?_ (measure_mono (inter_subset_inter_left _ T))
    rw [hμ, sum_apply _ (M.inter hu)]
    apply le_trans _ (le_sum_apply _ _)
    apply ENNReal.tsum_le_tsum (fun i ↦ ?_)
    calc
    m i ((⋂ n, w n) ∩ u) ≤ m i (w i ∩ u) :=
      measure_mono (inter_subset_inter_left _ (iInter_subset _ _))
    _ = m i (t ∩ u) := measure_toMeasurable_inter hu (hv i)
/-- If a measure `μ` is the sum of a countable family `mₙ`, and a set `t` has finite measure for
each `mₙ`, then its measurable superset `toMeasurable μ t` (which has the same measure as `t`)
satisfies, for any measurable set `s`, the equality `μ (toMeasurable μ t ∩ s) = μ (t ∩ s)`. -/
theorem measure_toMeasurable_inter_of_sum {s : Set α} (hs : MeasurableSet s) {t : Set α}
    {m : ℕ → Measure α} (hv : ∀ n, m n t ≠ ∞) (hμ : μ = sum m) :
    μ (toMeasurable μ t ∩ s) = μ (t ∩ s) := by
  -- we show that there is a measurable superset of `t` satisfying the conclusion for any
  -- measurable set `s`. It is built for each measure `mₙ` using `toMeasurable`
  -- (which is well behaved for finite measure sets thanks to `measure_toMeasurable_inter`), and
  -- then taking the intersection over `n`.
  have A : ∃ t', t' ⊇ t ∧ MeasurableSet t' ∧ ∀ u, MeasurableSet u → μ (t' ∩ u) = μ (t ∩ u) := by
    

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s✝ t✝ s : Set α
hs : MeasurableSet s
t : Set α
m : ℕ → Measure α
hv : ∀ (n : ℕ), ↑↑(m n) t ≠ ⊤
hμ : μ = sum m
⊢ ∃ t' ⊇ t, MeasurableSet t' ∧ ∀ (u : Set α), MeasurableSet u → ↑↑μ (t' ∩ u) = ↑↑μ (t ∩ u)

Next tactic:
let w n := toMeasurable (m n) t