-- Mathlib/MeasureTheory/Measure/AddContent.lean
theorem addContent_iUnion_eq_tsum_of_disjoint_of_addContent_iUnion_le {m : AddContent C}
    (hC : IsSetSemiring C)
    -- TODO: `m_subadd` is in fact equivalent to `m.IsSigmaSubadditive`.
    (m_subadd : ∀ (f : ℕ → Set α) (_ : ∀ i, f i ∈ C) (_ : ⋃ i, f i ∈ C)
      (_hf_disj : Pairwise (Disjoint on f)), m (⋃ i, f i) ≤ ∑' i, m (f i))
    (f : ℕ → Set α) (hf : ∀ i, f i ∈ C) (hf_Union : (⋃ i, f i) ∈ C)
    (hf_disj : Pairwise (Disjoint on f)) :
    m (⋃ i, f i) = ∑' i, m (f i)

Proof state:
case refine_2
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
s : Set α
hs : s ∈ f '' ↑I
t : Set α
ht : t ∈ f '' ↑I
hst : s ≠ t
⊢ (Disjoint on id) s t

Tactic:
rw [Set.mem_image] at hs ht

Result:
case refine_2
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
s : Set α
hs : ∃ x ∈ ↑I, f x = s
t : Set α
ht : ∃ x ∈ ↑I, f x = t
hst : s ≠ t
⊢ (Disjoint on id) s t

Proof state:
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
⊢ ∑' (i : ℕ), m (f i) ≤ m (⋃ i, f i)

Tactic:
refine tsum_le_of_sum_le ENNReal.summable fun I ↦ ?_

Result:
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
⊢ ∑ i ∈ I, m (f i) ≤ m (⋃ i, f i)

Proof state:
case refine_2
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
s : Set α
hs : ∃ x ∈ ↑I, f x = s
t : Set α
ht : ∃ x ∈ ↑I, f x = t
hst : s ≠ t
⊢ (Disjoint on id) s t

Tactic:
obtain ⟨i, _, rfl⟩ := hs

Result:
case refine_2.intro.intro
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
t : Set α
ht : ∃ x ∈ ↑I, f x = t
i : ℕ
left✝ : i ∈ ↑I
hst : f i ≠ t
⊢ (Disjoint on id) (f i) t

Proof state:
case refine_2.intro.intro.intro.intro
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
i : ℕ
left✝¹ : i ∈ ↑I
j : ℕ
left✝ : j ∈ ↑I
hst : f i ≠ f j
hij : i ≠ j
⊢ (Disjoint on id) (f i) (f j)

Tactic:
exact hf_disj hij

Result:
no goals

Proof state:
case refine_1.intro.intro
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
j : ℕ
left✝ : j ∈ ↑I
⊢ f j ∈ C

Tactic:
exact hf j

Result:
no goals

Proof state:
case refine_2.intro.intro
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
t : Set α
ht : ∃ x ∈ ↑I, f x = t
i : ℕ
left✝ : i ∈ ↑I
hst : f i ≠ t
⊢ (Disjoint on id) (f i) t

Tactic:
obtain ⟨j, _, rfl⟩ := ht

Result:
case refine_2.intro.intro.intro.intro
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
i : ℕ
left✝¹ : i ∈ ↑I
j : ℕ
left✝ : j ∈ ↑I
hst : f i ≠ f j
⊢ (Disjoint on id) (f i) (f j)

Proof state:
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
i : ℕ
left✝¹ : i ∈ ↑I
j : ℕ
left✝ : j ∈ ↑I
hst : f i ≠ f j
⊢ i ≠ j

Tactic:
intro h_eq

Result:
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
i : ℕ
left✝¹ : i ∈ ↑I
j : ℕ
left✝ : j ∈ ↑I
hst : f i ≠ f j
h_eq : i = j
⊢ False

Proof state:
case refine_1
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
⊢ ↑I ⊆ f ⁻¹' C

Tactic:
refine (subset_preimage_image f I).trans (preimage_mono ?_)

Result:
case refine_1
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
⊢ f '' ↑I ⊆ C

Proof state:
case refine_2
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
⊢ (f '' ↑I).PairwiseDisjoint id

Tactic:
intro s hs t ht hst

Result:
case refine_2
α : Type u_1
C : Set (Set α)
m : AddContent C
hC : IsSetSemiring C
m_subadd :
  ∀ (f : ℕ → Set α), (∀ (i : ℕ), f i ∈ C) → ⋃ i, f i ∈ C → Pairwise (Disjoint on f) → m (⋃ i, f i) ≤ ∑' (i : ℕ), m (f i)
f : ℕ → Set α
hf : ∀ (i : ℕ), f i ∈ C
hf_Union : ⋃ i, f i ∈ C
hf_disj : Pairwise (Disjoint on f)
I : Finset ℕ
s : Set α
hs : s ∈ f '' ↑I
t : Set α
ht : t ∈ f '' ↑I
hst : s ≠ t
⊢ (Disjoint on id) s t