-- Mathlib/MeasureTheory/Measure/Hausdorff.lean
theorem finset_iUnion_of_pairwise_separated (hm : IsMetric μ) {I : Finset ι} {s : ι → Set X}
    (hI : ∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)) :
    μ (⋃ i ∈ I, s i) = ∑ i ∈ I, μ (s i)

Proof state:
case insert
ι : Type u_1
X : Type u_2
inst✝ : EMetricSpace X
μ : OuterMeasure X
hm : μ.IsMetric
s : ι → Set X
i : ι
I : Finset ι
hiI : i ∉ I
ihI : (∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)) → μ (⋃ i ∈ I, s i) = ∑ i ∈ I, μ (s i)
hI : ∀ (i_1 : ι), i_1 = i ∨ i_1 ∈ I → ∀ (j : ι), j = i ∨ j ∈ I → i_1 ≠ j → Metric.AreSeparated (s i_1) (s j)
⊢ μ (⋃ i_1 ∈ insert i I, s i_1) = ∑ i ∈ insert i I, μ (s i)

Tactic:
rw [Finset.set_biUnion_insert, hm, ihI, Finset.sum_insert hiI]

Result:
case insert
ι : Type u_1
X : Type u_2
inst✝ : EMetricSpace X
μ : OuterMeasure X
hm : μ.IsMetric
s : ι → Set X
i : ι
I : Finset ι
hiI : i ∉ I
ihI : (∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)) → μ (⋃ i ∈ I, s i) = ∑ i ∈ I, μ (s i)
hI : ∀ (i_1 : ι), i_1 = i ∨ i_1 ∈ I → ∀ (j : ι), j = i ∨ j ∈ I → i_1 ≠ j → Metric.AreSeparated (s i_1) (s j)
⊢ ∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)

case insert.a
ι : Type u_1
X : Type u_2
inst✝ : EMetricSpace X
μ : OuterMeasure X
hm : μ.IsMetric
s : ι → Set X
i : ι
I : Finset ι
hiI : i ∉ I
ihI : (∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)) → μ (⋃ i ∈ I, s i) = ∑ i ∈ I, μ (s i)
hI : ∀ (i_1 : ι), i_1 = i ∨ i_1 ∈ I → ∀ (j : ι), j = i ∨ j ∈ I → i_1 ≠ j → Metric.AreSeparated (s i_1) (s j)
⊢ Metric.AreSeparated (s i) (⋃ x ∈ I, s x)

Proof state:
ι : Type u_1
X : Type u_2
inst✝ : EMetricSpace X
μ : OuterMeasure X
hm : μ.IsMetric
I : Finset ι
s : ι → Set X
hI : ∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)
⊢ μ (⋃ i ∈ I, s i) = ∑ i ∈ I, μ (s i)

Tactic:
induction' I using Finset.induction_on with i I hiI ihI hI

Result:
case empty
ι : Type u_1
X : Type u_2
inst✝ : EMetricSpace X
μ : OuterMeasure X
hm : μ.IsMetric
s : ι → Set X
hI : ∀ i ∈ ∅, ∀ j ∈ ∅, i ≠ j → Metric.AreSeparated (s i) (s j)
⊢ μ (⋃ i ∈ ∅, s i) = ∑ i ∈ ∅, μ (s i)

case insert
ι : Type u_1
X : Type u_2
inst✝ : EMetricSpace X
μ : OuterMeasure X
hm : μ.IsMetric
s : ι → Set X
i : ι
I : Finset ι
hiI : i ∉ I
ihI : (∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)) → μ (⋃ i ∈ I, s i) = ∑ i ∈ I, μ (s i)
hI : ∀ i_1 ∈ insert i I, ∀ j ∈ insert i I, i_1 ≠ j → Metric.AreSeparated (s i_1) (s j)
⊢ μ (⋃ i_1 ∈ insert i I, s i_1) = ∑ i ∈ insert i I, μ (s i)

Proof state:
case insert
ι : Type u_1
X : Type u_2
inst✝ : EMetricSpace X
μ : OuterMeasure X
hm : μ.IsMetric
s : ι → Set X
i : ι
I : Finset ι
hiI : i ∉ I
ihI : (∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)) → μ (⋃ i ∈ I, s i) = ∑ i ∈ I, μ (s i)
hI : ∀ i_1 ∈ insert i I, ∀ j ∈ insert i I, i_1 ≠ j → Metric.AreSeparated (s i_1) (s j)
⊢ μ (⋃ i_1 ∈ insert i I, s i_1) = ∑ i ∈ insert i I, μ (s i)

Tactic:
simp only [Finset.mem_insert] at hI

Result:
case insert
ι : Type u_1
X : Type u_2
inst✝ : EMetricSpace X
μ : OuterMeasure X
hm : μ.IsMetric
s : ι → Set X
i : ι
I : Finset ι
hiI : i ∉ I
ihI : (∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)) → μ (⋃ i ∈ I, s i) = ∑ i ∈ I, μ (s i)
hI : ∀ (i_1 : ι), i_1 = i ∨ i_1 ∈ I → ∀ (j : ι), j = i ∨ j ∈ I → i_1 ≠ j → Metric.AreSeparated (s i_1) (s j)
⊢ μ (⋃ i_1 ∈ insert i I, s i_1) = ∑ i ∈ insert i I, μ (s i)

Proof state:
case empty
ι : Type u_1
X : Type u_2
inst✝ : EMetricSpace X
μ : OuterMeasure X
hm : μ.IsMetric
s : ι → Set X
hI : ∀ i ∈ ∅, ∀ j ∈ ∅, i ≠ j → Metric.AreSeparated (s i) (s j)
⊢ μ (⋃ i ∈ ∅, s i) = ∑ i ∈ ∅, μ (s i)

Tactic:
simp

Result:
no goals

Proof state:
case insert
ι : Type u_1
X : Type u_2
inst✝ : EMetricSpace X
μ : OuterMeasure X
hm : μ.IsMetric
s : ι → Set X
i : ι
I : Finset ι
hiI : i ∉ I
ihI : (∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)) → μ (⋃ i ∈ I, s i) = ∑ i ∈ I, μ (s i)
hI : ∀ (i_1 : ι), i_1 = i ∨ i_1 ∈ I → ∀ (j : ι), j = i ∨ j ∈ I → i_1 ≠ j → Metric.AreSeparated (s i_1) (s j)
⊢ ∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)

case insert.a
ι : Type u_1
X : Type u_2
inst✝ : EMetricSpace X
μ : OuterMeasure X
hm : μ.IsMetric
s : ι → Set X
i : ι
I : Finset ι
hiI : i ∉ I
ihI : (∀ i ∈ I, ∀ j ∈ I, i ≠ j → Metric.AreSeparated (s i) (s j)) → μ (⋃ i ∈ I, s i) = ∑ i ∈ I, μ (s i)
hI : ∀ (i_1 : ι), i_1 = i ∨ i_1 ∈ I → ∀ (j : ι), j = i ∨ j ∈ I → i_1 ≠ j → Metric.AreSeparated (s i_1) (s j)
⊢ Metric.AreSeparated (s i) (⋃ x ∈ I, s x)

Tactic:
exacts [fun i hi j hj hij => hI i (Or.inr hi) j (Or.inr hj) hij,
  Metric.AreSeparated.finset_iUnion_right fun j hj =>
    hI i (Or.inl rfl) j (Or.inr hj) (ne_of_mem_of_not_mem hj hiI).symm]

Result:
no goals