l3lab/ntp-mathlib huggingface dataset:
theorem measurableSet_Ioi {c : ℝ} : MeasurableSet[f.outer.caratheodory] (Ioi c) := by
  refine OuterMeasure.ofFunction_caratheodory fun t => ?_
  refine' le_iInf fun a => le_iInf fun b => le_iInf fun h => _
  refine'
    le_trans
      (add_le_add (f.length_mono <| inter_subset_inter_left _ h)
        (f.length_mono <| diff_subset_diff_left h)) _
  

Proof state:
f : StieltjesFunction
c : ℝ
t : Set ℝ
a b : ℝ
h : t ⊆ Ioc a b
⊢ length f (Ioc a b ∩ Ioi c) + length f (Ioc a b \ Ioi c) ≤ ofReal (↑f b - ↑f a)

Next tactic:
rcases le_total a c with hac | hac
theorem measurableSet_Ioi {c : ℝ} : MeasurableSet[f.outer.caratheodory] (Ioi c) := by
  refine OuterMeasure.ofFunction_caratheodory fun t => ?_
  refine' le_iInf fun a => le_iInf fun b => le_iInf fun h => _
  refine'
    le_trans
      (add_le_add (f.length_mono <| inter_subset_inter_left _ h)
        (f.length_mono <| diff_subset_diff_left h)) _
  rcases le_total a c with hac | hac <;> 

Proof state:
case inl
f : StieltjesFunction
c : ℝ
t : Set ℝ
a b : ℝ
h : t ⊆ Ioc a b
hac : a ≤ c
⊢ length f (Ioc a b ∩ Ioi c) + length f (Ioc a b \ Ioi c) ≤ ofReal (↑f b - ↑f a)

Next tactic:
rcases le_total b c with hbc | hbc
theorem measurableSet_Ioi {c : ℝ} : MeasurableSet[f.outer.caratheodory] (Ioi c) := by
  refine OuterMeasure.ofFunction_caratheodory fun t => ?_
  refine' le_iInf fun a => le_iInf fun b => le_iInf fun h => _
  refine'
    le_trans
      (add_le_add (f.length_mono <| inter_subset_inter_left _ h)
        (f.length_mono <| diff_subset_diff_left h)) _
  rcases le_total a c with hac | hac <;> 

Proof state:
case inr
f : StieltjesFunction
c : ℝ
t : Set ℝ
a b : ℝ
h : t ⊆ Ioc a b
hac : c ≤ a
⊢ length f (Ioc a b ∩ Ioi c) + length f (Ioc a b \ Ioi c) ≤ ofReal (↑f b - ↑f a)

Next tactic:
rcases le_total b c with hbc | hbc
theorem measurableSet_Ioi {c : ℝ} : MeasurableSet[f.outer.caratheodory] (Ioi c) := by
  refine OuterMeasure.ofFunction_caratheodory fun t => ?_
  refine' le_iInf fun a => le_iInf fun b => le_iInf fun h => _
  refine'
    le_trans
      (add_le_add (f.length_mono <| inter_subset_inter_left _ h)
        (f.length_mono <| diff_subset_diff_left h)) _
  rcases le_total a c with hac | hac <;> rcases le_total b c with hbc | hbc
  · 

Proof state:
case inl.inl
f : StieltjesFunction
c : ℝ
t : Set ℝ
a b : ℝ
h : t ⊆ Ioc a b
hac : a ≤ c
hbc : b ≤ c
⊢ length f (Ioc a b ∩ Ioi c) + length f (Ioc a b \ Ioi c) ≤ ofReal (↑f b - ↑f a)

Next tactic:
simp only [Ioc_inter_Ioi, f.length_Ioc, hac, _root_.sup_eq_max, hbc, le_refl, Ioc_eq_empty,
      max_eq_right, min_eq_left, Ioc_diff_Ioi, f.length_empty, zero_add, not_lt]
theorem measurableSet_Ioi {c : ℝ} : MeasurableSet[f.outer.caratheodory] (Ioi c) := by
  refine OuterMeasure.ofFunction_caratheodory fun t => ?_
  refine' le_iInf fun a => le_iInf fun b => le_iInf fun h => _
  refine'
    le_trans
      (add_le_add (f.length_mono <| inter_subset_inter_left _ h)
        (f.length_mono <| diff_subset_diff_left h)) _
  rcases le_total a c with hac | hac <;> rcases le_total b c with hbc | hbc
  · simp only [Ioc_inter_Ioi, f.length_Ioc, hac, _root_.sup_eq_max, hbc, le_refl, Ioc_eq_empty,
      max_eq_right, min_eq_left, Ioc_diff_Ioi, f.length_empty, zero_add, not_lt]
  · 

Proof state:
case inl.inr
f : StieltjesFunction
c : ℝ
t : Set ℝ
a b : ℝ
h : t ⊆ Ioc a b
hac : a ≤ c
hbc : c ≤ b
⊢ length f (Ioc a b ∩ Ioi c) + length f (Ioc a b \ Ioi c) ≤ ofReal (↑f b - ↑f a)

Next tactic:
simp only [hac, hbc, Ioc_inter_Ioi, Ioc_diff_Ioi, f.length_Ioc, min_eq_right,
      _root_.sup_eq_max, ← ENNReal.ofReal_add, f.mono hac, f.mono hbc, sub_nonneg,
      sub_add_sub_cancel, le_refl,
      max_eq_right]
theorem measurableSet_Ioi {c : ℝ} : MeasurableSet[f.outer.caratheodory] (Ioi c) := by
  refine OuterMeasure.ofFunction_caratheodory fun t => ?_
  refine' le_iInf fun a => le_iInf fun b => le_iInf fun h => _
  refine'
    le_trans
      (add_le_add (f.length_mono <| inter_subset_inter_left _ h)
        (f.length_mono <| diff_subset_diff_left h)) _
  rcases le_total a c with hac | hac <;> rcases le_total b c with hbc | hbc
  · simp only [Ioc_inter_Ioi, f.length_Ioc, hac, _root_.sup_eq_max, hbc, le_refl, Ioc_eq_empty,
      max_eq_right, min_eq_left, Ioc_diff_Ioi, f.length_empty, zero_add, not_lt]
  · simp only [hac, hbc, Ioc_inter_Ioi, Ioc_diff_Ioi, f.length_Ioc, min_eq_right,
      _root_.sup_eq_max, ← ENNReal.ofReal_add, f.mono hac, f.mono hbc, sub_nonneg,
      sub_add_sub_cancel, le_refl,
      max_eq_right]
  · 

Proof state:
case inr.inl
f : StieltjesFunction
c : ℝ
t : Set ℝ
a b : ℝ
h : t ⊆ Ioc a b
hac : c ≤ a
hbc : b ≤ c
⊢ length f (Ioc a b ∩ Ioi c) + length f (Ioc a b \ Ioi c) ≤ ofReal (↑f b - ↑f a)

Next tactic:
simp only [hbc, le_refl, Ioc_eq_empty, Ioc_inter_Ioi, min_eq_left, Ioc_diff_Ioi, f.length_empty,
      zero_add, or_true_iff, le_sup_iff, f.length_Ioc, not_lt]
theorem measurableSet_Ioi {c : ℝ} : MeasurableSet[f.outer.caratheodory] (Ioi c) := by
  refine OuterMeasure.ofFunction_caratheodory fun t => ?_
  refine' le_iInf fun a => le_iInf fun b => le_iInf fun h => _
  refine'
    le_trans
      (add_le_add (f.length_mono <| inter_subset_inter_left _ h)
        (f.length_mono <| diff_subset_diff_left h)) _
  rcases le_total a c with hac | hac <;> rcases le_total b c with hbc | hbc
  · simp only [Ioc_inter_Ioi, f.length_Ioc, hac, _root_.sup_eq_max, hbc, le_refl, Ioc_eq_empty,
      max_eq_right, min_eq_left, Ioc_diff_Ioi, f.length_empty, zero_add, not_lt]
  · simp only [hac, hbc, Ioc_inter_Ioi, Ioc_diff_Ioi, f.length_Ioc, min_eq_right,
      _root_.sup_eq_max, ← ENNReal.ofReal_add, f.mono hac, f.mono hbc, sub_nonneg,
      sub_add_sub_cancel, le_refl,
      max_eq_right]
  · simp only [hbc, le_refl, Ioc_eq_empty, Ioc_inter_Ioi, min_eq_left, Ioc_diff_Ioi, f.length_empty,
      zero_add, or_true_iff, le_sup_iff, f.length_Ioc, not_lt]
  · 

Proof state:
case inr.inr
f : StieltjesFunction
c : ℝ
t : Set ℝ
a b : ℝ
h : t ⊆ Ioc a b
hac : c ≤ a
hbc : c ≤ b
⊢ length f (Ioc a b ∩ Ioi c) + length f (Ioc a b \ Ioi c) ≤ ofReal (↑f b - ↑f a)

Next tactic:
simp only [hac, hbc, Ioc_inter_Ioi, Ioc_diff_Ioi, f.length_Ioc, min_eq_right, _root_.sup_eq_max,
      le_refl, Ioc_eq_empty, add_zero, max_eq_left, f.length_empty, not_lt]
theorem outer_trim : f.outer.trim = f.outer := by
  

Proof state:
f : StieltjesFunction
⊢ OuterMeasure.trim (StieltjesFunction.outer f) = StieltjesFunction.outer f

Next tactic:
refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  

Proof state:
f : StieltjesFunction
s : Set ℝ
⊢ ↑(OuterMeasure.trim (StieltjesFunction.outer f)) s ≤ ↑(StieltjesFunction.outer f) s

Next tactic:
rw [OuterMeasure.trim_eq_iInf]
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  

Proof state:
f : StieltjesFunction
s : Set ℝ
⊢ ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑(StieltjesFunction.outer f) t ≤ ↑(StieltjesFunction.outer f) s

Next tactic:
refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  

Proof state:
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
⊢ ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑(StieltjesFunction.outer f) t ≤ ∑' (i : ℕ), length f (t i) + ↑ε

Next tactic:
rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  

Proof state:
case intro.intro
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
⊢ ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑(StieltjesFunction.outer f) t ≤ ∑' (i : ℕ), length f (t i) + ↑ε

Next tactic:
refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  

Proof state:
case intro.intro
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
⊢ ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑(StieltjesFunction.outer f) t ≤
    ∑' (i : ℕ), length f (t i) + ∑' (i : ℕ), ↑(ε' i)

Next tactic:
rw [← ENNReal.tsum_add]
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  

Proof state:
case intro.intro
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
⊢ ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑(StieltjesFunction.outer f) t ≤ ∑' (a : ℕ), (length f (t a) + ↑(ε' a))

Next tactic:
choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
      conv at hl =>
        lhs
        rw [length]
      simp only [iInf_lt_iff] at hl
      rcases hl with ⟨a, b, h₁, h₂⟩
      rw [← f.outer_Ioc] at h₂
      exact ⟨_, h₁, measurableSet_Ioc, le_of_lt <| by simpa using h₂⟩
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      

Proof state:
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
⊢ ∀ (i : ℕ), ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ ↑(StieltjesFunction.outer f) s ≤ length f (t i) + ofReal ↑(ε' i)

Next tactic:
intro i
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      

Proof state:
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
i : ℕ
⊢ ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ ↑(StieltjesFunction.outer f) s ≤ length f (t i) + ofReal ↑(ε' i)

Next tactic:
have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
      

Proof state:
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
i : ℕ
hl : length f (t i) < length f (t i) + ↑(ε' i)
⊢ ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ ↑(StieltjesFunction.outer f) s ≤ length f (t i) + ofReal ↑(ε' i)

Next tactic:
conv at hl =>
        lhs
        rw [length]
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
      conv at hl =>
        

Proof state:
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
i : ℕ
hl : length f (t i) < length f (t i) + ↑(ε' i)
| length f (t i) < length f (t i) + ↑(ε' i)

Next tactic:
lhs
        rw [length]
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
      conv at hl =>
        

Proof state:
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
i : ℕ
hl : length f (t i) < length f (t i) + ↑(ε' i)
| length f (t i) < length f (t i) + ↑(ε' i)

Next tactic:
lhs
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
      conv at hl =>
        lhs
        

Proof state:
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
i : ℕ
hl : length f (t i) < length f (t i) + ↑(ε' i)
| length f (t i)

Next tactic:
rw [length]
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
      conv at hl =>
        lhs
        rw [length]
      

Proof state:
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
i : ℕ
hl : ⨅ a, ⨅ b, ⨅ (_ : t i ⊆ Ioc a b), ofReal (↑f b - ↑f a) < length f (t i) + ↑(ε' i)
⊢ ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ ↑(StieltjesFunction.outer f) s ≤ length f (t i) + ofReal ↑(ε' i)

Next tactic:
simp only [iInf_lt_iff] at hl
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
      conv at hl =>
        lhs
        rw [length]
      simp only [iInf_lt_iff] at hl
      

Proof state:
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
i : ℕ
hl : ∃ i_1 i_2, ∃ (_ : t i ⊆ Ioc i_1 i_2), ofReal (↑f i_2 - ↑f i_1) < length f (t i) + ↑(ε' i)
⊢ ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ ↑(StieltjesFunction.outer f) s ≤ length f (t i) + ofReal ↑(ε' i)

Next tactic:
rcases hl with ⟨a, b, h₁, h₂⟩
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
      conv at hl =>
        lhs
        rw [length]
      simp only [iInf_lt_iff] at hl
      rcases hl with ⟨a, b, h₁, h₂⟩
      

Proof state:
case intro.intro.intro
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
i : ℕ
a b : ℝ
h₁ : t i ⊆ Ioc a b
h₂ : ofReal (↑f b - ↑f a) < length f (t i) + ↑(ε' i)
⊢ ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ ↑(StieltjesFunction.outer f) s ≤ length f (t i) + ofReal ↑(ε' i)

Next tactic:
rw [← f.outer_Ioc] at h₂
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
      conv at hl =>
        lhs
        rw [length]
      simp only [iInf_lt_iff] at hl
      rcases hl with ⟨a, b, h₁, h₂⟩
      rw [← f.outer_Ioc] at h₂
      

Proof state:
case intro.intro.intro
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
i : ℕ
a b : ℝ
h₁ : t i ⊆ Ioc a b
h₂ : ↑(StieltjesFunction.outer f) (Ioc a b) < length f (t i) + ↑(ε' i)
⊢ ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ ↑(StieltjesFunction.outer f) s ≤ length f (t i) + ofReal ↑(ε' i)

Next tactic:
exact ⟨_, h₁, measurableSet_Ioc, le_of_lt <| by simpa using h₂⟩
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
      conv at hl =>
        lhs
        rw [length]
      simp only [iInf_lt_iff] at hl
      rcases hl with ⟨a, b, h₁, h₂⟩
      rw [← f.outer_Ioc] at h₂
      exact ⟨_, h₁, measurableSet_Ioc, le_of_lt <| by 

Proof state:
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
i : ℕ
a b : ℝ
h₁ : t i ⊆ Ioc a b
h₂ : ↑(StieltjesFunction.outer f) (Ioc a b) < length f (t i) + ↑(ε' i)
⊢ ↑(StieltjesFunction.outer f) (Ioc a b) < length f (t i) + ofReal ↑(ε' i)

Next tactic:
simpa using h₂
theorem outer_trim : f.outer.trim = f.outer := by
  refine' le_antisymm (fun s => _) (OuterMeasure.le_trim _)
  rw [OuterMeasure.trim_eq_iInf]
  refine' le_iInf fun t => le_iInf fun ht => ENNReal.le_of_forall_pos_le_add fun ε ε0 h => _
  rcases ENNReal.exists_pos_sum_of_countable (ENNReal.coe_pos.2 ε0).ne' ℕ with ⟨ε', ε'0, hε⟩
  refine' le_trans _ (add_le_add_left (le_of_lt hε) _)
  rw [← ENNReal.tsum_add]
  choose g hg using
    show ∀ i, ∃ s, t i ⊆ s ∧ MeasurableSet s ∧ f.outer s ≤ f.length (t i) + ofReal (ε' i) by
      intro i
      have hl :=
        ENNReal.lt_add_right ((ENNReal.le_tsum i).trans_lt h).ne (ENNReal.coe_pos.2 (ε'0 i)).ne'
      conv at hl =>
        lhs
        rw [length]
      simp only [iInf_lt_iff] at hl
      rcases hl with ⟨a, b, h₁, h₂⟩
      rw [← f.outer_Ioc] at h₂
      exact ⟨_, h₁, measurableSet_Ioc, le_of_lt <| by simpa using h₂⟩
  

Proof state:
case intro.intro
f : StieltjesFunction
s : Set ℝ
t : ℕ → Set ℝ
ht : s ⊆ ⋃ i, t i
ε : ℝ≥0
ε0 : 0 < ε
h : ∑' (i : ℕ), length f (t i) < ⊤
ε' : ℕ → ℝ≥0
ε'0 : ∀ (i : ℕ), 0 < ε' i
hε : ∑' (i : ℕ), ↑(ε' i) < ↑ε
g : ℕ → Set ℝ
hg : ∀ (i : ℕ), t i ⊆ g i ∧ MeasurableSet (g i) ∧ ↑(StieltjesFunction.outer f) (g i) ≤ length f (t i) + ofReal ↑(ε' i)
⊢ ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑(StieltjesFunction.outer f) t ≤ ∑' (a : ℕ), (length f (t a) + ↑(ε' a))

Next tactic:
simp only [ofReal_coe_nnreal] at hg