l3lab/ntp-mathlib huggingface dataset:
theorem f_iUnion {s : ℕ → Set α} (h : ∀ i, IsCaratheodory m (s i)) (hd : Pairwise (Disjoint on s)) :
    m (⋃ i, s i) = ∑' i, m (s i) := by
  refine' le_antisymm (m.iUnion_nat s) _
  

Proof state:
α : Type u
m : OuterMeasure α
s✝ s₁ s₂ : Set α
s : ℕ → Set α
h : ∀ (i : ℕ), IsCaratheodory m (s i)
hd : Pairwise (Disjoint on s)
⊢ ∑' (i : ℕ), ↑m (s i) ≤ ↑m (⋃ i, s i)

Next tactic:
rw [ENNReal.tsum_eq_iSup_nat]
theorem f_iUnion {s : ℕ → Set α} (h : ∀ i, IsCaratheodory m (s i)) (hd : Pairwise (Disjoint on s)) :
    m (⋃ i, s i) = ∑' i, m (s i) := by
  refine' le_antisymm (m.iUnion_nat s) _
  rw [ENNReal.tsum_eq_iSup_nat]
  

Proof state:
α : Type u
m : OuterMeasure α
s✝ s₁ s₂ : Set α
s : ℕ → Set α
h : ∀ (i : ℕ), IsCaratheodory m (s i)
hd : Pairwise (Disjoint on s)
⊢ ⨆ i, ∑ a in Finset.range i, ↑m (s a) ≤ ↑m (⋃ i, s i)

Next tactic:
refine' iSup_le fun n => _
theorem f_iUnion {s : ℕ → Set α} (h : ∀ i, IsCaratheodory m (s i)) (hd : Pairwise (Disjoint on s)) :
    m (⋃ i, s i) = ∑' i, m (s i) := by
  refine' le_antisymm (m.iUnion_nat s) _
  rw [ENNReal.tsum_eq_iSup_nat]
  refine' iSup_le fun n => _
  

Proof state:
α : Type u
m : OuterMeasure α
s✝ s₁ s₂ : Set α
s : ℕ → Set α
h : ∀ (i : ℕ), IsCaratheodory m (s i)
hd : Pairwise (Disjoint on s)
n : ℕ
⊢ ∑ a in Finset.range n, ↑m (s a) ≤ ↑m (⋃ i, s i)

Next tactic:
have := @isCaratheodory_sum _ m _ h hd univ n
theorem f_iUnion {s : ℕ → Set α} (h : ∀ i, IsCaratheodory m (s i)) (hd : Pairwise (Disjoint on s)) :
    m (⋃ i, s i) = ∑' i, m (s i) := by
  refine' le_antisymm (m.iUnion_nat s) _
  rw [ENNReal.tsum_eq_iSup_nat]
  refine' iSup_le fun n => _
  have := @isCaratheodory_sum _ m _ h hd univ n
  

Proof state:
α : Type u
m : OuterMeasure α
s✝ s₁ s₂ : Set α
s : ℕ → Set α
h : ∀ (i : ℕ), IsCaratheodory m (s i)
hd : Pairwise (Disjoint on s)
n : ℕ
this : ∑ i in Finset.range n, ↑m (univ ∩ s i) = ↑m (univ ∩ ⋃ i, ⋃ (_ : i < n), s i)
⊢ ∑ a in Finset.range n, ↑m (s a) ≤ ↑m (⋃ i, s i)

Next tactic:
simp only [inter_comm, inter_univ, univ_inter] at this
theorem f_iUnion {s : ℕ → Set α} (h : ∀ i, IsCaratheodory m (s i)) (hd : Pairwise (Disjoint on s)) :
    m (⋃ i, s i) = ∑' i, m (s i) := by
  refine' le_antisymm (m.iUnion_nat s) _
  rw [ENNReal.tsum_eq_iSup_nat]
  refine' iSup_le fun n => _
  have := @isCaratheodory_sum _ m _ h hd univ n
  simp only [inter_comm, inter_univ, univ_inter] at this; 

Proof state:
α : Type u
m : OuterMeasure α
s✝ s₁ s₂ : Set α
s : ℕ → Set α
h : ∀ (i : ℕ), IsCaratheodory m (s i)
hd : Pairwise (Disjoint on s)
n : ℕ
this : ∑ x in Finset.range n, ↑m (s x) = ↑m (⋃ i, ⋃ (_ : i < n), s i)
⊢ ∑ a in Finset.range n, ↑m (s a) ≤ ↑m (⋃ i, s i)

Next tactic:
simp only [this, ge_iff_le]
theorem f_iUnion {s : ℕ → Set α} (h : ∀ i, IsCaratheodory m (s i)) (hd : Pairwise (Disjoint on s)) :
    m (⋃ i, s i) = ∑' i, m (s i) := by
  refine' le_antisymm (m.iUnion_nat s) _
  rw [ENNReal.tsum_eq_iSup_nat]
  refine' iSup_le fun n => _
  have := @isCaratheodory_sum _ m _ h hd univ n
  simp only [inter_comm, inter_univ, univ_inter] at this; simp only [this, ge_iff_le]
  

Proof state:
α : Type u
m : OuterMeasure α
s✝ s₁ s₂ : Set α
s : ℕ → Set α
h : ∀ (i : ℕ), IsCaratheodory m (s i)
hd : Pairwise (Disjoint on s)
n : ℕ
this : ∑ x in Finset.range n, ↑m (s x) = ↑m (⋃ i, ⋃ (_ : i < n), s i)
⊢ ↑m (⋃ i, ⋃ (_ : i < n), s i) ≤ ↑m (⋃ i, s i)

Next tactic:
exact m.mono (iUnion₂_subset fun i _ => subset_iUnion _ i)
/-- The Carathéodory-measurable sets for an outer measure `m` form a Dynkin system.  -/
def caratheodoryDynkin : MeasurableSpace.DynkinSystem α where
  Has := IsCaratheodory m
  has_empty := isCaratheodory_empty m
  has_compl s := isCaratheodory_compl m s
  has_iUnion_nat f hf hn := by 

Proof state:
α : Type u
m : OuterMeasure α
s s₁ s₂ : Set α
f✝ : ℕ → Set α
f : Pairwise (Disjoint on f✝)
hf : ∀ (i : ℕ), IsCaratheodory m (f✝ i)
hn : Set α
⊢ ↑m hn = ↑m (hn ∩ ⋃ i, f✝ i) + ↑m (hn \ ⋃ i, f✝ i)

Next tactic:
apply isCaratheodory_iUnion_nat m hf f
/-- Given an outer measure `μ`, the Carathéodory-measurable space is
  defined such that `s` is measurable if `∀t, μ t = μ (t ∩ s) + μ (t \ s)`. -/
protected def caratheodory : MeasurableSpace α := by
  

Proof state:
α : Type u
m : OuterMeasure α
s s₁ s₂ : Set α
⊢ MeasurableSpace α

Next tactic:
apply MeasurableSpace.DynkinSystem.toMeasurableSpace (caratheodoryDynkin m)
/-- Given an outer measure `μ`, the Carathéodory-measurable space is
  defined such that `s` is measurable if `∀t, μ t = μ (t ∩ s) + μ (t \ s)`. -/
protected def caratheodory : MeasurableSpace α := by
  apply MeasurableSpace.DynkinSystem.toMeasurableSpace (caratheodoryDynkin m)
  

Proof state:
α : Type u
m : OuterMeasure α
s s₁ s₂ : Set α
⊢ ∀ (s₁ s₂ : Set α),
    MeasurableSpace.DynkinSystem.Has (caratheodoryDynkin m) s₁ →
      MeasurableSpace.DynkinSystem.Has (caratheodoryDynkin m) s₂ →
        MeasurableSpace.DynkinSystem.Has (caratheodoryDynkin m) (s₁ ∩ s₂)

Next tactic:
intro s₁ s₂
/-- Given an outer measure `μ`, the Carathéodory-measurable space is
  defined such that `s` is measurable if `∀t, μ t = μ (t ∩ s) + μ (t \ s)`. -/
protected def caratheodory : MeasurableSpace α := by
  apply MeasurableSpace.DynkinSystem.toMeasurableSpace (caratheodoryDynkin m)
  intro s₁ s₂
  

Proof state:
α : Type u
m : OuterMeasure α
s s₁✝ s₂✝ s₁ s₂ : Set α
⊢ MeasurableSpace.DynkinSystem.Has (caratheodoryDynkin m) s₁ →
    MeasurableSpace.DynkinSystem.Has (caratheodoryDynkin m) s₂ →
      MeasurableSpace.DynkinSystem.Has (caratheodoryDynkin m) (s₁ ∩ s₂)

Next tactic:
apply isCaratheodory_inter
theorem ofFunction_caratheodory {m : Set α → ℝ≥0∞} {s : Set α} {h₀ : m ∅ = 0}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) :
    MeasurableSet[(OuterMeasure.ofFunction m h₀).caratheodory] s := by
  

Proof state:
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
h₀ : m ∅ = 0
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
⊢ MeasurableSet s

Next tactic:
apply (isCaratheodory_iff_le _).mpr
theorem ofFunction_caratheodory {m : Set α → ℝ≥0∞} {s : Set α} {h₀ : m ∅ = 0}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) :
    MeasurableSet[(OuterMeasure.ofFunction m h₀).caratheodory] s := by
  apply (isCaratheodory_iff_le _).mpr
  

Proof state:
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
h₀ : m ∅ = 0
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
⊢ ∀ (t : Set α),
    ↑(OuterMeasure.ofFunction m h₀) (t ∩ s) + ↑(OuterMeasure.ofFunction m h₀) (t \ s) ≤
      ↑(OuterMeasure.ofFunction m h₀) t

Next tactic:
refine' fun t => le_iInf fun f => le_iInf fun hf => _
theorem ofFunction_caratheodory {m : Set α → ℝ≥0∞} {s : Set α} {h₀ : m ∅ = 0}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) :
    MeasurableSet[(OuterMeasure.ofFunction m h₀).caratheodory] s := by
  apply (isCaratheodory_iff_le _).mpr
  refine' fun t => le_iInf fun f => le_iInf fun hf => _
  

Proof state:
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
h₀ : m ∅ = 0
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
f : ℕ → Set α
hf : t ⊆ ⋃ i, f i
⊢ ↑(OuterMeasure.ofFunction m h₀) (t ∩ s) + ↑(OuterMeasure.ofFunction m h₀) (t \ s) ≤ ∑' (i : ℕ), m (f i)

Next tactic:
refine'
    le_trans
      (add_le_add ((iInf_le_of_le fun i => f i ∩ s) <| iInf_le _ _)
        ((iInf_le_of_le fun i => f i \ s) <| iInf_le _ _))
      _
theorem ofFunction_caratheodory {m : Set α → ℝ≥0∞} {s : Set α} {h₀ : m ∅ = 0}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) :
    MeasurableSet[(OuterMeasure.ofFunction m h₀).caratheodory] s := by
  apply (isCaratheodory_iff_le _).mpr
  refine' fun t => le_iInf fun f => le_iInf fun hf => _
  refine'
    le_trans
      (add_le_add ((iInf_le_of_le fun i => f i ∩ s) <| iInf_le _ _)
        ((iInf_le_of_le fun i => f i \ s) <| iInf_le _ _))
      _
  · 

Proof state:
case refine'_1
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
h₀ : m ∅ = 0
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
f : ℕ → Set α
hf : t ⊆ ⋃ i, f i
⊢ t ∩ s ⊆ ⋃ i, (fun i => f i ∩ s) i

Next tactic:
rw [← iUnion_inter]
theorem ofFunction_caratheodory {m : Set α → ℝ≥0∞} {s : Set α} {h₀ : m ∅ = 0}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) :
    MeasurableSet[(OuterMeasure.ofFunction m h₀).caratheodory] s := by
  apply (isCaratheodory_iff_le _).mpr
  refine' fun t => le_iInf fun f => le_iInf fun hf => _
  refine'
    le_trans
      (add_le_add ((iInf_le_of_le fun i => f i ∩ s) <| iInf_le _ _)
        ((iInf_le_of_le fun i => f i \ s) <| iInf_le _ _))
      _
  · rw [← iUnion_inter]
    

Proof state:
case refine'_1
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
h₀ : m ∅ = 0
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
f : ℕ → Set α
hf : t ⊆ ⋃ i, f i
⊢ t ∩ s ⊆ (⋃ i, f i) ∩ s

Next tactic:
exact inter_subset_inter_left _ hf
theorem ofFunction_caratheodory {m : Set α → ℝ≥0∞} {s : Set α} {h₀ : m ∅ = 0}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) :
    MeasurableSet[(OuterMeasure.ofFunction m h₀).caratheodory] s := by
  apply (isCaratheodory_iff_le _).mpr
  refine' fun t => le_iInf fun f => le_iInf fun hf => _
  refine'
    le_trans
      (add_le_add ((iInf_le_of_le fun i => f i ∩ s) <| iInf_le _ _)
        ((iInf_le_of_le fun i => f i \ s) <| iInf_le _ _))
      _
  · rw [← iUnion_inter]
    exact inter_subset_inter_left _ hf
  · 

Proof state:
case refine'_2
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
h₀ : m ∅ = 0
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
f : ℕ → Set α
hf : t ⊆ ⋃ i, f i
⊢ t \ s ⊆ ⋃ i, (fun i => f i \ s) i

Next tactic:
rw [← iUnion_diff]
theorem ofFunction_caratheodory {m : Set α → ℝ≥0∞} {s : Set α} {h₀ : m ∅ = 0}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) :
    MeasurableSet[(OuterMeasure.ofFunction m h₀).caratheodory] s := by
  apply (isCaratheodory_iff_le _).mpr
  refine' fun t => le_iInf fun f => le_iInf fun hf => _
  refine'
    le_trans
      (add_le_add ((iInf_le_of_le fun i => f i ∩ s) <| iInf_le _ _)
        ((iInf_le_of_le fun i => f i \ s) <| iInf_le _ _))
      _
  · rw [← iUnion_inter]
    exact inter_subset_inter_left _ hf
  · rw [← iUnion_diff]
    

Proof state:
case refine'_2
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
h₀ : m ∅ = 0
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
f : ℕ → Set α
hf : t ⊆ ⋃ i, f i
⊢ t \ s ⊆ (⋃ i, f i) \ s

Next tactic:
exact diff_subset_diff_left hf
theorem ofFunction_caratheodory {m : Set α → ℝ≥0∞} {s : Set α} {h₀ : m ∅ = 0}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) :
    MeasurableSet[(OuterMeasure.ofFunction m h₀).caratheodory] s := by
  apply (isCaratheodory_iff_le _).mpr
  refine' fun t => le_iInf fun f => le_iInf fun hf => _
  refine'
    le_trans
      (add_le_add ((iInf_le_of_le fun i => f i ∩ s) <| iInf_le _ _)
        ((iInf_le_of_le fun i => f i \ s) <| iInf_le _ _))
      _
  · rw [← iUnion_inter]
    exact inter_subset_inter_left _ hf
  · rw [← iUnion_diff]
    exact diff_subset_diff_left hf
  · 

Proof state:
case refine'_3
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
h₀ : m ∅ = 0
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
f : ℕ → Set α
hf : t ⊆ ⋃ i, f i
⊢ ∑' (i : ℕ), m ((fun i => f i ∩ s) i) + ∑' (i : ℕ), m ((fun i => f i \ s) i) ≤ ∑' (i : ℕ), m (f i)

Next tactic:
rw [← ENNReal.tsum_add]
theorem ofFunction_caratheodory {m : Set α → ℝ≥0∞} {s : Set α} {h₀ : m ∅ = 0}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) :
    MeasurableSet[(OuterMeasure.ofFunction m h₀).caratheodory] s := by
  apply (isCaratheodory_iff_le _).mpr
  refine' fun t => le_iInf fun f => le_iInf fun hf => _
  refine'
    le_trans
      (add_le_add ((iInf_le_of_le fun i => f i ∩ s) <| iInf_le _ _)
        ((iInf_le_of_le fun i => f i \ s) <| iInf_le _ _))
      _
  · rw [← iUnion_inter]
    exact inter_subset_inter_left _ hf
  · rw [← iUnion_diff]
    exact diff_subset_diff_left hf
  · rw [← ENNReal.tsum_add]
    

Proof state:
case refine'_3
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
h₀ : m ∅ = 0
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
f : ℕ → Set α
hf : t ⊆ ⋃ i, f i
⊢ ∑' (a : ℕ), (m ((fun i => f i ∩ s) a) + m ((fun i => f i \ s) a)) ≤ ∑' (i : ℕ), m (f i)

Next tactic:
exact ENNReal.tsum_le_tsum fun i => hs _
theorem boundedBy_caratheodory {m : Set α → ℝ≥0∞} {s : Set α}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) : MeasurableSet[(boundedBy m).caratheodory] s := by
  

Proof state:
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
⊢ MeasurableSet s

Next tactic:
apply ofFunction_caratheodory
theorem boundedBy_caratheodory {m : Set α → ℝ≥0∞} {s : Set α}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) : MeasurableSet[(boundedBy m).caratheodory] s := by
  apply ofFunction_caratheodory; 

Proof state:
case hs
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
⊢ ∀ (t : Set α),
    (⨆ (_ : Set.Nonempty (t ∩ s)), m (t ∩ s)) + ⨆ (_ : Set.Nonempty (t \ s)), m (t \ s) ≤ ⨆ (_ : Set.Nonempty t), m t

Next tactic:
intro t
theorem boundedBy_caratheodory {m : Set α → ℝ≥0∞} {s : Set α}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) : MeasurableSet[(boundedBy m).caratheodory] s := by
  apply ofFunction_caratheodory; intro t
  

Proof state:
case hs
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
⊢ (⨆ (_ : Set.Nonempty (t ∩ s)), m (t ∩ s)) + ⨆ (_ : Set.Nonempty (t \ s)), m (t \ s) ≤ ⨆ (_ : Set.Nonempty t), m t

Next tactic:
rcases t.eq_empty_or_nonempty with h | h
theorem boundedBy_caratheodory {m : Set α → ℝ≥0∞} {s : Set α}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) : MeasurableSet[(boundedBy m).caratheodory] s := by
  apply ofFunction_caratheodory; intro t
  rcases t.eq_empty_or_nonempty with h | h
  · 

Proof state:
case hs.inl
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
h : t = ∅
⊢ (⨆ (_ : Set.Nonempty (t ∩ s)), m (t ∩ s)) + ⨆ (_ : Set.Nonempty (t \ s)), m (t \ s) ≤ ⨆ (_ : Set.Nonempty t), m t

Next tactic:
simp [h, Set.not_nonempty_empty]
theorem boundedBy_caratheodory {m : Set α → ℝ≥0∞} {s : Set α}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) : MeasurableSet[(boundedBy m).caratheodory] s := by
  apply ofFunction_caratheodory; intro t
  rcases t.eq_empty_or_nonempty with h | h
  · simp [h, Set.not_nonempty_empty]
  · 

Proof state:
case hs.inr
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
h : Set.Nonempty t
⊢ (⨆ (_ : Set.Nonempty (t ∩ s)), m (t ∩ s)) + ⨆ (_ : Set.Nonempty (t \ s)), m (t \ s) ≤ ⨆ (_ : Set.Nonempty t), m t

Next tactic:
convert le_trans _ (hs t)
theorem boundedBy_caratheodory {m : Set α → ℝ≥0∞} {s : Set α}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) : MeasurableSet[(boundedBy m).caratheodory] s := by
  apply ofFunction_caratheodory; intro t
  rcases t.eq_empty_or_nonempty with h | h
  · simp [h, Set.not_nonempty_empty]
  · convert le_trans _ (hs t)
    · 

Proof state:
case h.e'_4
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
h : Set.Nonempty t
⊢ ⨆ (_ : Set.Nonempty t), m t = m t

Next tactic:
simp [h]
theorem boundedBy_caratheodory {m : Set α → ℝ≥0∞} {s : Set α}
    (hs : ∀ t, m (t ∩ s) + m (t \ s) ≤ m t) : MeasurableSet[(boundedBy m).caratheodory] s := by
  apply ofFunction_caratheodory; intro t
  rcases t.eq_empty_or_nonempty with h | h
  · simp [h, Set.not_nonempty_empty]
  · convert le_trans _ (hs t)
    · simp [h]
    

Proof state:
case hs.inr.convert_2
α : Type u_1
m : Set α → ℝ≥0∞
s : Set α
hs : ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t
t : Set α
h : Set.Nonempty t
⊢ (⨆ (_ : Set.Nonempty (t ∩ s)), m (t ∩ s)) + ⨆ (_ : Set.Nonempty (t \ s)), m (t \ s) ≤ m (t ∩ s) + m (t \ s)

Next tactic:
exact add_le_add iSup_const_le iSup_const_le
theorem top_caratheodory : (⊤ : OuterMeasure α).caratheodory = ⊤ :=
  top_unique fun s _ =>
    (isCaratheodory_iff_le _).2 fun t =>
      t.eq_empty_or_nonempty.elim (fun ht => by 

Proof state:
α : Type u_1
s : Set α
x✝ : MeasurableSet s
t : Set α
ht : t = ∅
⊢ ↑⊤ (t ∩ s) + ↑⊤ (t \ s) ≤ ↑⊤ t

Next tactic:
simp [ht]
theorem top_caratheodory : (⊤ : OuterMeasure α).caratheodory = ⊤ :=
  top_unique fun s _ =>
    (isCaratheodory_iff_le _).2 fun t =>
      t.eq_empty_or_nonempty.elim (fun ht => by simp [ht]) fun ht => by
        

Proof state:
α : Type u_1
s : Set α
x✝ : MeasurableSet s
t : Set α
ht : Set.Nonempty t
⊢ ↑⊤ (t ∩ s) + ↑⊤ (t \ s) ≤ ↑⊤ t

Next tactic:
simp only [ht, top_apply, le_top]
theorem le_add_caratheodory (m₁ m₂ : OuterMeasure α) :
    m₁.caratheodory ⊓ m₂.caratheodory ≤ (m₁ + m₂ : OuterMeasure α).caratheodory :=
  fun s ⟨hs₁, hs₂⟩ t => by 

Proof state:
α : Type u_1
m₁ m₂ : OuterMeasure α
s : Set α
x✝ : MeasurableSet s
t : Set α
hs₁ : s ∈ (fun m => {t | MeasurableSet t}) (OuterMeasure.caratheodory m₁)
hs₂ : s ∈ (fun m => {t | MeasurableSet t}) (OuterMeasure.caratheodory m₂)
⊢ ↑(m₁ + m₂) t = ↑(m₁ + m₂) (t ∩ s) + ↑(m₁ + m₂) (t \ s)

Next tactic:
simp [hs₁ t, hs₂ t, add_left_comm, add_assoc]
theorem le_sum_caratheodory {ι} (m : ι → OuterMeasure α) :
    ⨅ i, (m i).caratheodory ≤ (sum m).caratheodory := fun s h t => by
  

Proof state:
α : Type u_1
ι : Type u_2
m : ι → OuterMeasure α
s : Set α
h : MeasurableSet s
t : Set α
⊢ ↑(sum m) t = ↑(sum m) (t ∩ s) + ↑(sum m) (t \ s)

Next tactic:
simp [fun i => MeasurableSpace.measurableSet_iInf.1 h i t, ENNReal.tsum_add]
theorem le_smul_caratheodory (a : ℝ≥0∞) (m : OuterMeasure α) :
    m.caratheodory ≤ (a • m).caratheodory := fun s h t => by
      

Proof state:
α : Type u_1
a : ℝ≥0∞
m : OuterMeasure α
s : Set α
h : MeasurableSet s
t : Set α
⊢ ↑(a • m) t = ↑(a • m) (t ∩ s) + ↑(a • m) (t \ s)

Next tactic:
simp only [smul_apply, smul_eq_mul]
theorem le_smul_caratheodory (a : ℝ≥0∞) (m : OuterMeasure α) :
    m.caratheodory ≤ (a • m).caratheodory := fun s h t => by
      simp only [smul_apply, smul_eq_mul]
      

Proof state:
α : Type u_1
a : ℝ≥0∞
m : OuterMeasure α
s : Set α
h : MeasurableSet s
t : Set α
⊢ a * ↑m t = a * ↑m (t ∩ s) + a * ↑m (t \ s)

Next tactic:
rw [(isCaratheodory_iff m).mp h t]
theorem le_smul_caratheodory (a : ℝ≥0∞) (m : OuterMeasure α) :
    m.caratheodory ≤ (a • m).caratheodory := fun s h t => by
      simp only [smul_apply, smul_eq_mul]
      rw [(isCaratheodory_iff m).mp h t]
      

Proof state:
α : Type u_1
a : ℝ≥0∞
m : OuterMeasure α
s : Set α
h : MeasurableSet s
t : Set α
⊢ a * (↑m (t ∩ s) + ↑m (t \ s)) = a * ↑m (t ∩ s) + a * ↑m (t \ s)

Next tactic:
simp [mul_add]
@[simp]
theorem dirac_caratheodory (a : α) : (dirac a).caratheodory = ⊤ :=
  top_unique fun s _ t => by
    

Proof state:
α : Type u_1
a : α
s : Set α
x✝ : MeasurableSet s
t : Set α
⊢ ↑(dirac a) t = ↑(dirac a) (t ∩ s) + ↑(dirac a) (t \ s)

Next tactic:
by_cases ht : a ∈ t
@[simp]
theorem dirac_caratheodory (a : α) : (dirac a).caratheodory = ⊤ :=
  top_unique fun s _ t => by
    by_cases ht : a ∈ t; 

Proof state:
case pos
α : Type u_1
a : α
s : Set α
x✝ : MeasurableSet s
t : Set α
ht : a ∈ t
⊢ ↑(dirac a) t = ↑(dirac a) (t ∩ s) + ↑(dirac a) (t \ s)
case neg
α : Type u_1
a : α
s : Set α
x✝ : MeasurableSet s
t : Set α
ht : a ∉ t
⊢ ↑(dirac a) t = ↑(dirac a) (t ∩ s) + ↑(dirac a) (t \ s)

Next tactic:
swap
@[simp]
theorem dirac_caratheodory (a : α) : (dirac a).caratheodory = ⊤ :=
  top_unique fun s _ t => by
    by_cases ht : a ∈ t; swap; · 

Proof state:
case neg
α : Type u_1
a : α
s : Set α
x✝ : MeasurableSet s
t : Set α
ht : a ∉ t
⊢ ↑(dirac a) t = ↑(dirac a) (t ∩ s) + ↑(dirac a) (t \ s)

Next tactic:
simp [ht]
@[simp]
theorem dirac_caratheodory (a : α) : (dirac a).caratheodory = ⊤ :=
  top_unique fun s _ t => by
    by_cases ht : a ∈ t; swap; · simp [ht]
    

Proof state:
case pos
α : Type u_1
a : α
s : Set α
x✝ : MeasurableSet s
t : Set α
ht : a ∈ t
⊢ ↑(dirac a) t = ↑(dirac a) (t ∩ s) + ↑(dirac a) (t \ s)

Next tactic:
by_cases hs : a ∈ s
@[simp]
theorem dirac_caratheodory (a : α) : (dirac a).caratheodory = ⊤ :=
  top_unique fun s _ t => by
    by_cases ht : a ∈ t; swap; · simp [ht]
    by_cases hs : a ∈ s <;> 

Proof state:
case pos
α : Type u_1
a : α
s : Set α
x✝ : MeasurableSet s
t : Set α
ht : a ∈ t
hs : a ∈ s
⊢ ↑(dirac a) t = ↑(dirac a) (t ∩ s) + ↑(dirac a) (t \ s)

Next tactic:
simp [*]
@[simp]
theorem dirac_caratheodory (a : α) : (dirac a).caratheodory = ⊤ :=
  top_unique fun s _ t => by
    by_cases ht : a ∈ t; swap; · simp [ht]
    by_cases hs : a ∈ s <;> 

Proof state:
case neg
α : Type u_1
a : α
s : Set α
x✝ : MeasurableSet s
t : Set α
ht : a ∈ t
hs : a ∉ s
⊢ ↑(dirac a) t = ↑(dirac a) (t ∩ s) + ↑(dirac a) (t \ s)

Next tactic:
simp [*]
theorem sInf_eq_boundedBy_sInfGen (m : Set (OuterMeasure α)) :
    sInf m = OuterMeasure.boundedBy (sInfGen m) := by
  

Proof state:
α : Type u_1
m : Set (OuterMeasure α)
⊢ sInf m = boundedBy (sInfGen m)

Next tactic:
refine' le_antisymm _ _
theorem sInf_eq_boundedBy_sInfGen (m : Set (OuterMeasure α)) :
    sInf m = OuterMeasure.boundedBy (sInfGen m) := by
  refine' le_antisymm _ _
  · 

Proof state:
case refine'_1
α : Type u_1
m : Set (OuterMeasure α)
⊢ sInf m ≤ boundedBy (sInfGen m)

Next tactic:
refine' le_boundedBy.2 fun s => le_iInf₂ fun μ hμ => _
theorem sInf_eq_boundedBy_sInfGen (m : Set (OuterMeasure α)) :
    sInf m = OuterMeasure.boundedBy (sInfGen m) := by
  refine' le_antisymm _ _
  · refine' le_boundedBy.2 fun s => le_iInf₂ fun μ hμ => _
    

Proof state:
case refine'_1
α : Type u_1
m : Set (OuterMeasure α)
s : Set α
μ : OuterMeasure α
hμ : μ ∈ m
⊢ ↑(sInf m) s ≤ ↑μ s

Next tactic:
apply sInf_le hμ
theorem sInf_eq_boundedBy_sInfGen (m : Set (OuterMeasure α)) :
    sInf m = OuterMeasure.boundedBy (sInfGen m) := by
  refine' le_antisymm _ _
  · refine' le_boundedBy.2 fun s => le_iInf₂ fun μ hμ => _
    apply sInf_le hμ
  · 

Proof state:
case refine'_2
α : Type u_1
m : Set (OuterMeasure α)
⊢ boundedBy (sInfGen m) ≤ sInf m

Next tactic:
refine' le_sInf _
theorem sInf_eq_boundedBy_sInfGen (m : Set (OuterMeasure α)) :
    sInf m = OuterMeasure.boundedBy (sInfGen m) := by
  refine' le_antisymm _ _
  · refine' le_boundedBy.2 fun s => le_iInf₂ fun μ hμ => _
    apply sInf_le hμ
  · refine' le_sInf _
    

Proof state:
case refine'_2
α : Type u_1
m : Set (OuterMeasure α)
⊢ ∀ b ∈ m, boundedBy (sInfGen m) ≤ b

Next tactic:
intro μ hμ t
theorem sInf_eq_boundedBy_sInfGen (m : Set (OuterMeasure α)) :
    sInf m = OuterMeasure.boundedBy (sInfGen m) := by
  refine' le_antisymm _ _
  · refine' le_boundedBy.2 fun s => le_iInf₂ fun μ hμ => _
    apply sInf_le hμ
  · refine' le_sInf _
    intro μ hμ t
    

Proof state:
case refine'_2
α : Type u_1
m : Set (OuterMeasure α)
μ : OuterMeasure α
hμ : μ ∈ m
t : Set α
⊢ ↑(boundedBy (sInfGen m)) t ≤ ↑μ t

Next tactic:
refine' le_trans (boundedBy_le t) (iInf₂_le μ hμ)
theorem iSup_sInfGen_nonempty {m : Set (OuterMeasure α)} (h : m.Nonempty) (t : Set α) :
    ⨆ _ : t.Nonempty, sInfGen m t = ⨅ (μ : OuterMeasure α) (_ : μ ∈ m), μ t := by
  

Proof state:
α : Type u_1
m : Set (OuterMeasure α)
h : Set.Nonempty m
t : Set α
⊢ ⨆ (_ : Set.Nonempty t), sInfGen m t = ⨅ μ ∈ m, ↑μ t

Next tactic:
rcases t.eq_empty_or_nonempty with (rfl | ht)
theorem iSup_sInfGen_nonempty {m : Set (OuterMeasure α)} (h : m.Nonempty) (t : Set α) :
    ⨆ _ : t.Nonempty, sInfGen m t = ⨅ (μ : OuterMeasure α) (_ : μ ∈ m), μ t := by
  rcases t.eq_empty_or_nonempty with (rfl | ht)
  · 

Proof state:
case inl
α : Type u_1
m : Set (OuterMeasure α)
h : Set.Nonempty m
⊢ ⨆ (_ : Set.Nonempty ∅), sInfGen m ∅ = ⨅ μ ∈ m, ↑μ ∅

Next tactic:
rcases h with ⟨μ, hμ⟩
theorem iSup_sInfGen_nonempty {m : Set (OuterMeasure α)} (h : m.Nonempty) (t : Set α) :
    ⨆ _ : t.Nonempty, sInfGen m t = ⨅ (μ : OuterMeasure α) (_ : μ ∈ m), μ t := by
  rcases t.eq_empty_or_nonempty with (rfl | ht)
  · rcases h with ⟨μ, hμ⟩
    

Proof state:
case inl.intro
α : Type u_1
m : Set (OuterMeasure α)
μ : OuterMeasure α
hμ : μ ∈ m
⊢ ⨆ (_ : Set.Nonempty ∅), sInfGen m ∅ = ⨅ μ ∈ m, ↑μ ∅

Next tactic:
rw [eq_false Set.not_nonempty_empty, iSup_false, eq_comm]
theorem iSup_sInfGen_nonempty {m : Set (OuterMeasure α)} (h : m.Nonempty) (t : Set α) :
    ⨆ _ : t.Nonempty, sInfGen m t = ⨅ (μ : OuterMeasure α) (_ : μ ∈ m), μ t := by
  rcases t.eq_empty_or_nonempty with (rfl | ht)
  · rcases h with ⟨μ, hμ⟩
    rw [eq_false Set.not_nonempty_empty, iSup_false, eq_comm]
    

Proof state:
case inl.intro
α : Type u_1
m : Set (OuterMeasure α)
μ : OuterMeasure α
hμ : μ ∈ m
⊢ ⨅ μ ∈ m, ↑μ ∅ = ⊥

Next tactic:
simp_rw [empty']