l3lab/ntp-mathlib huggingface dataset:
theorem extend_mono {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁) (hs : s₁ ⊆ s₂) :
    extend m s₁ ≤ extend m s₂ := by
  refine' le_iInf _; intro h₂
  have :=
    extend_union MeasurableSet.empty m0 MeasurableSet.iUnion mU disjoint_sdiff_self_right h₁
      (h₂.diff h₁)
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
s₁ s₂ : Set α
h₁ : MeasurableSet s₁
hs : s₁ ⊆ s₂
h₂ : (fun s => MeasurableSet s) s₂
this : extend m (s₁ ∪ s₂ \ s₁) = extend m s₁ + extend m (s₂ \ s₁)
⊢ extend m s₁ ≤ m s₂ h₂

Next tactic:
rw [union_diff_cancel hs] at this
theorem extend_mono {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁) (hs : s₁ ⊆ s₂) :
    extend m s₁ ≤ extend m s₂ := by
  refine' le_iInf _; intro h₂
  have :=
    extend_union MeasurableSet.empty m0 MeasurableSet.iUnion mU disjoint_sdiff_self_right h₁
      (h₂.diff h₁)
  rw [union_diff_cancel hs] at this
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
s₁ s₂ : Set α
h₁ : MeasurableSet s₁
hs : s₁ ⊆ s₂
h₂ : (fun s => MeasurableSet s) s₂
this : extend m s₂ = extend m s₁ + extend m (s₂ \ s₁)
⊢ extend m s₁ ≤ m s₂ h₂

Next tactic:
rw [← extend_eq m]
theorem extend_mono {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁) (hs : s₁ ⊆ s₂) :
    extend m s₁ ≤ extend m s₂ := by
  refine' le_iInf _; intro h₂
  have :=
    extend_union MeasurableSet.empty m0 MeasurableSet.iUnion mU disjoint_sdiff_self_right h₁
      (h₂.diff h₁)
  rw [union_diff_cancel hs] at this
  rw [← extend_eq m]
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
s₁ s₂ : Set α
h₁ : MeasurableSet s₁
hs : s₁ ⊆ s₂
h₂ : (fun s => MeasurableSet s) s₂
this : extend m s₂ = extend m s₁ + extend m (s₂ \ s₁)
⊢ extend m s₁ ≤ extend m s₂

Next tactic:
exact le_iff_exists_add.2 ⟨_, this⟩
theorem extend_iUnion_le_tsum_nat : ∀ s : ℕ → Set α,
    extend m (⋃ i, s i) ≤ ∑' i, extend m (s i) := by
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
⊢ ∀ (s : ℕ → Set α), extend m (⋃ i, s i) ≤ ∑' (i : ℕ), extend m (s i)

Next tactic:
refine' extend_iUnion_le_tsum_nat' MeasurableSet.iUnion _
theorem extend_iUnion_le_tsum_nat : ∀ s : ℕ → Set α,
    extend m (⋃ i, s i) ≤ ∑' i, extend m (s i) := by
  refine' extend_iUnion_le_tsum_nat' MeasurableSet.iUnion _; 

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
⊢ ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) ≤ ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))

Next tactic:
intro f h
theorem extend_iUnion_le_tsum_nat : ∀ s : ℕ → Set α,
    extend m (⋃ i, s i) ≤ ∑' i, extend m (s i) := by
  refine' extend_iUnion_le_tsum_nat' MeasurableSet.iUnion _; intro f h
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
f : ℕ → Set α
h : ∀ (i : ℕ), MeasurableSet (f i)
⊢ m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) ≤ ∑' (i : ℕ), m (f i) (_ : ?m.295677 (f i))

Next tactic:
simp (config := { singlePass := true }) [iUnion_disjointed.symm]
theorem extend_iUnion_le_tsum_nat : ∀ s : ℕ → Set α,
    extend m (⋃ i, s i) ≤ ∑' i, extend m (s i) := by
  refine' extend_iUnion_le_tsum_nat' MeasurableSet.iUnion _; intro f h
  simp (config := { singlePass := true }) [iUnion_disjointed.symm]
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
f : ℕ → Set α
h : ∀ (i : ℕ), MeasurableSet (f i)
⊢ m (⋃ n, disjointed (fun n => f n) n) (_ : MeasurableSet (⋃ n, disjointed (fun n => f n) n)) ≤
    ∑' (i : ℕ), m (f i) (_ : ?m.295677 (f i))

Next tactic:
rw [mU (MeasurableSet.disjointed h) (disjoint_disjointed _)]
theorem extend_iUnion_le_tsum_nat : ∀ s : ℕ → Set α,
    extend m (⋃ i, s i) ≤ ∑' i, extend m (s i) := by
  refine' extend_iUnion_le_tsum_nat' MeasurableSet.iUnion _; intro f h
  simp (config := { singlePass := true }) [iUnion_disjointed.symm]
  rw [mU (MeasurableSet.disjointed h) (disjoint_disjointed _)]
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
f : ℕ → Set α
h : ∀ (i : ℕ), MeasurableSet (f i)
⊢ ∑' (i : ℕ), m (disjointed (fun i => f i) i) (_ : MeasurableSet (disjointed (fun i => f i) i)) ≤
    ∑' (i : ℕ), m (f i) (_ : ?m.295677 (f i))

Next tactic:
refine' ENNReal.tsum_le_tsum fun i => _
theorem extend_iUnion_le_tsum_nat : ∀ s : ℕ → Set α,
    extend m (⋃ i, s i) ≤ ∑' i, extend m (s i) := by
  refine' extend_iUnion_le_tsum_nat' MeasurableSet.iUnion _; intro f h
  simp (config := { singlePass := true }) [iUnion_disjointed.symm]
  rw [mU (MeasurableSet.disjointed h) (disjoint_disjointed _)]
  refine' ENNReal.tsum_le_tsum fun i => _
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
f : ℕ → Set α
h : ∀ (i : ℕ), MeasurableSet (f i)
i : ℕ
⊢ m (disjointed (fun i => f i) i) (_ : MeasurableSet (disjointed (fun i => f i) i)) ≤ m (f i) (_ : ?m.295677 (f i))

Next tactic:
rw [← extend_eq m, ← extend_eq m]
theorem extend_iUnion_le_tsum_nat : ∀ s : ℕ → Set α,
    extend m (⋃ i, s i) ≤ ∑' i, extend m (s i) := by
  refine' extend_iUnion_le_tsum_nat' MeasurableSet.iUnion _; intro f h
  simp (config := { singlePass := true }) [iUnion_disjointed.symm]
  rw [mU (MeasurableSet.disjointed h) (disjoint_disjointed _)]
  refine' ENNReal.tsum_le_tsum fun i => _
  rw [← extend_eq m, ← extend_eq m]
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : (s : Set α) → MeasurableSet s → ℝ≥0∞
m0 : m ∅ (_ : MeasurableSet ∅) = 0
mU :
  ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) →
      m (⋃ i, f i) (_ : MeasurableSet (⋃ b, f b)) = ∑' (i : ℕ), m (f i) (_ : MeasurableSet (f i))
f : ℕ → Set α
h : ∀ (i : ℕ), MeasurableSet (f i)
i : ℕ
⊢ extend m (disjointed (fun i => f i) i) ≤ extend m (f i)

Next tactic:
exact extend_mono m0 mU (MeasurableSet.disjointed h _) (disjointed_le f _)
theorem le_trim : m ≤ m.trim := by
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : OuterMeasure α
⊢ m ≤ trim m

Next tactic:
apply le_ofFunction.mpr
theorem le_trim : m ≤ m.trim := by
  apply le_ofFunction.mpr
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : OuterMeasure α
⊢ ∀ (s : Set α), ↑m s ≤ extend (fun s x => ↑m s) s
α : Type u_1 inst✝ : MeasurableSpace α m : OuterMeasure α ⊢ extend (fun s x => ↑m s) ∅ = 0

Next tactic:
intro s
theorem le_trim : m ≤ m.trim := by
  apply le_ofFunction.mpr
  intro s
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : OuterMeasure α
s : Set α
⊢ ↑m s ≤ extend (fun s x => ↑m s) s
α : Type u_1 inst✝ : MeasurableSpace α m : OuterMeasure α ⊢ extend (fun s x => ↑m s) ∅ = 0

Next tactic:
apply le_iInf
theorem le_trim : m ≤ m.trim := by
  apply le_ofFunction.mpr
  intro s
  apply le_iInf
  

Proof state:
case h
α : Type u_1
inst✝ : MeasurableSpace α
m : OuterMeasure α
s : Set α
⊢ ∀ (i : (fun s => MeasurableSet s) s), ↑m s ≤ (fun s x => ↑m s) s i
α : Type u_1 inst✝ : MeasurableSpace α m : OuterMeasure α ⊢ extend (fun s x => ↑m s) ∅ = 0

Next tactic:
simp only [le_refl, implies_true]
theorem le_trim : m ≤ m.trim := by
  apply le_ofFunction.mpr
  intro s
  apply le_iInf
  simp only [le_refl, implies_true]
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : OuterMeasure α
⊢ extend (fun s x => ↑m s) ∅ = 0

Next tactic:
apply extend_empty
theorem le_trim : m ≤ m.trim := by
  apply le_ofFunction.mpr
  intro s
  apply le_iInf
  simp only [le_refl, implies_true]
  apply extend_empty <;> 

Proof state:
case m0
α : Type u_1
inst✝ : MeasurableSpace α
m : OuterMeasure α
⊢ ↑m ∅ = 0

Next tactic:
simp
theorem le_trim : m ≤ m.trim := by
  apply le_ofFunction.mpr
  intro s
  apply le_iInf
  simp only [le_refl, implies_true]
  apply extend_empty <;> 

Proof state:
case P0
α : Type u_1
inst✝ : MeasurableSpace α
m : OuterMeasure α
⊢ MeasurableSet ∅

Next tactic:
simp
theorem trim_congr {m₁ m₂ : OuterMeasure α} (H : ∀ {s : Set α}, MeasurableSet s → m₁ s = m₂ s) :
    m₁.trim = m₂.trim := by
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
H : ∀ {s : Set α}, MeasurableSet s → ↑m₁ s = ↑m₂ s
⊢ trim m₁ = trim m₂

Next tactic:
unfold trim
theorem trim_congr {m₁ m₂ : OuterMeasure α} (H : ∀ {s : Set α}, MeasurableSet s → m₁ s = m₂ s) :
    m₁.trim = m₂.trim := by
  unfold trim
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
H : ∀ {s : Set α}, MeasurableSet s → ↑m₁ s = ↑m₂ s
⊢ inducedOuterMeasure (fun s x => ↑m₁ s) (_ : MeasurableSet ∅) (_ : ↑m₁ ∅ = 0) =
    inducedOuterMeasure (fun s x => ↑m₂ s) (_ : MeasurableSet ∅) (_ : ↑m₂ ∅ = 0)

Next tactic:
congr
theorem trim_congr {m₁ m₂ : OuterMeasure α} (H : ∀ {s : Set α}, MeasurableSet s → m₁ s = m₂ s) :
    m₁.trim = m₂.trim := by
  unfold trim
  congr
  

Proof state:
case e_m
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
H : ∀ {s : Set α}, MeasurableSet s → ↑m₁ s = ↑m₂ s
⊢ (fun s x => ↑m₁ s) = fun s x => ↑m₂ s

Next tactic:
funext s hs
theorem trim_congr {m₁ m₂ : OuterMeasure α} (H : ∀ {s : Set α}, MeasurableSet s → m₁ s = m₂ s) :
    m₁.trim = m₂.trim := by
  unfold trim
  congr
  funext s hs
  

Proof state:
case e_m.h.h
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
H : ∀ {s : Set α}, MeasurableSet s → ↑m₁ s = ↑m₂ s
s : Set α
hs : MeasurableSet s
⊢ ↑m₁ s = ↑m₂ s

Next tactic:
exact H hs
theorem le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁ ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s := by
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
⊢ m₁ ≤ trim m₂ ↔ ∀ (s : Set α), MeasurableSet s → ↑m₁ s ≤ ↑m₂ s

Next tactic:
let me := extend (fun s (_p : MeasurableSet s) => measureOf m₂ s)
theorem le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁ ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s := by
  let me := extend (fun s (_p : MeasurableSet s) => measureOf m₂ s)
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
me : Set α → ℝ≥0∞ := extend fun s _p => ↑m₂ s
⊢ m₁ ≤ trim m₂ ↔ ∀ (s : Set α), MeasurableSet s → ↑m₁ s ≤ ↑m₂ s

Next tactic:
have me_empty : me ∅ = 0 := by apply extend_empty; simp; simp
theorem le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁ ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s := by
  let me := extend (fun s (_p : MeasurableSet s) => measureOf m₂ s)
  have me_empty : me ∅ = 0 := by 

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
me : Set α → ℝ≥0∞ := extend fun s _p => ↑m₂ s
⊢ me ∅ = 0

Next tactic:
apply extend_empty
theorem le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁ ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s := by
  let me := extend (fun s (_p : MeasurableSet s) => measureOf m₂ s)
  have me_empty : me ∅ = 0 := by apply extend_empty; 

Proof state:
case m0
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
me : Set α → ℝ≥0∞ := extend fun s _p => ↑m₂ s
⊢ ↑m₂ ∅ = 0
case P0
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
me : Set α → ℝ≥0∞ := extend fun s _p => ↑m₂ s
⊢ MeasurableSet ∅

Next tactic:
simp
theorem le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁ ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s := by
  let me := extend (fun s (_p : MeasurableSet s) => measureOf m₂ s)
  have me_empty : me ∅ = 0 := by apply extend_empty; simp; 

Proof state:
case P0
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
me : Set α → ℝ≥0∞ := extend fun s _p => ↑m₂ s
⊢ MeasurableSet ∅

Next tactic:
simp
theorem le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁ ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s := by
  let me := extend (fun s (_p : MeasurableSet s) => measureOf m₂ s)
  have me_empty : me ∅ = 0 := by apply extend_empty; simp; simp
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
me : Set α → ℝ≥0∞ := extend fun s _p => ↑m₂ s
me_empty : me ∅ = 0
⊢ m₁ ≤ trim m₂ ↔ ∀ (s : Set α), MeasurableSet s → ↑m₁ s ≤ ↑m₂ s

Next tactic:
have : m₁ ≤ OuterMeasure.ofFunction me me_empty ↔
          (∀ (s : Set α), measureOf m₁ s ≤ me s) := le_ofFunction
theorem le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁ ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s := by
  let me := extend (fun s (_p : MeasurableSet s) => measureOf m₂ s)
  have me_empty : me ∅ = 0 := by apply extend_empty; simp; simp
  have : m₁ ≤ OuterMeasure.ofFunction me me_empty ↔
          (∀ (s : Set α), measureOf m₁ s ≤ me s) := le_ofFunction
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
me : Set α → ℝ≥0∞ := extend fun s _p => ↑m₂ s
me_empty : me ∅ = 0
this : m₁ ≤ OuterMeasure.ofFunction me me_empty ↔ ∀ (s : Set α), ↑m₁ s ≤ me s
⊢ m₁ ≤ trim m₂ ↔ ∀ (s : Set α), MeasurableSet s → ↑m₁ s ≤ ↑m₂ s

Next tactic:
apply this.trans
theorem le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁ ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s := by
  let me := extend (fun s (_p : MeasurableSet s) => measureOf m₂ s)
  have me_empty : me ∅ = 0 := by apply extend_empty; simp; simp
  have : m₁ ≤ OuterMeasure.ofFunction me me_empty ↔
          (∀ (s : Set α), measureOf m₁ s ≤ me s) := le_ofFunction
  apply this.trans
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
me : Set α → ℝ≥0∞ := extend fun s _p => ↑m₂ s
me_empty : me ∅ = 0
this : m₁ ≤ OuterMeasure.ofFunction me me_empty ↔ ∀ (s : Set α), ↑m₁ s ≤ me s
⊢ (∀ (s : Set α), ↑m₁ s ≤ me s) ↔ ∀ (s : Set α), MeasurableSet s → ↑m₁ s ≤ ↑m₂ s

Next tactic:
apply forall_congr'
theorem le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁ ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s := by
  let me := extend (fun s (_p : MeasurableSet s) => measureOf m₂ s)
  have me_empty : me ∅ = 0 := by apply extend_empty; simp; simp
  have : m₁ ≤ OuterMeasure.ofFunction me me_empty ↔
          (∀ (s : Set α), measureOf m₁ s ≤ me s) := le_ofFunction
  apply this.trans
  apply forall_congr'
  

Proof state:
case h
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
me : Set α → ℝ≥0∞ := extend fun s _p => ↑m₂ s
me_empty : me ∅ = 0
this : m₁ ≤ OuterMeasure.ofFunction me me_empty ↔ ∀ (s : Set α), ↑m₁ s ≤ me s
⊢ ∀ (a : Set α), ↑m₁ a ≤ me a ↔ MeasurableSet a → ↑m₁ a ≤ ↑m₂ a

Next tactic:
intro s
theorem le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁ ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s := by
  let me := extend (fun s (_p : MeasurableSet s) => measureOf m₂ s)
  have me_empty : me ∅ = 0 := by apply extend_empty; simp; simp
  have : m₁ ≤ OuterMeasure.ofFunction me me_empty ↔
          (∀ (s : Set α), measureOf m₁ s ≤ me s) := le_ofFunction
  apply this.trans
  apply forall_congr'
  intro s
  

Proof state:
case h
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
me : Set α → ℝ≥0∞ := extend fun s _p => ↑m₂ s
me_empty : me ∅ = 0
this : m₁ ≤ OuterMeasure.ofFunction me me_empty ↔ ∀ (s : Set α), ↑m₁ s ≤ me s
s : Set α
⊢ ↑m₁ s ≤ me s ↔ MeasurableSet s → ↑m₁ s ≤ ↑m₂ s

Next tactic:
apply le_iInf_iff
theorem trim_le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁.trim ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s :=
  le_trim_iff.trans <| forall₂_congr fun s hs => by 

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
s : Set α
hs : MeasurableSet s
⊢ ↑(trim m₁) s ≤ ↑m₂ s ↔ ↑m₁ s ≤ ↑m₂ s

Next tactic:
rw [trim_eq _ hs]
theorem trim_eq_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁.trim = m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s = m₂ s := by
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
⊢ trim m₁ = trim m₂ ↔ ∀ (s : Set α), MeasurableSet s → ↑m₁ s = ↑m₂ s

Next tactic:
simp only [le_antisymm_iff, trim_le_trim_iff, forall_and]
theorem trim_eq_iInf (s : Set α) : m.trim s = ⨅ (t) (_ : s ⊆ t) (_ : MeasurableSet t), m t := by
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : OuterMeasure α
s : Set α
⊢ ↑(trim m) s = ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑m t

Next tactic:
simp (config := { singlePass := true }) only [iInf_comm]
theorem trim_eq_iInf (s : Set α) : m.trim s = ⨅ (t) (_ : s ⊆ t) (_ : MeasurableSet t), m t := by
  simp (config := { singlePass := true }) only [iInf_comm]
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : OuterMeasure α
s : Set α
⊢ ↑(trim m) s = ⨅ t, ⨅ (_ : MeasurableSet t), ⨅ (_ : s ⊆ t), ↑m t

Next tactic:
exact
    inducedOuterMeasure_eq_iInf MeasurableSet.iUnion (fun f _ => m.iUnion_nat f)
      (fun _ _ _ _ h => m.mono h) s
theorem trim_eq_iInf' (s : Set α) : m.trim s = ⨅ t : { t // s ⊆ t ∧ MeasurableSet t }, m t := by
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m : OuterMeasure α
s : Set α
⊢ ↑(trim m) s = ⨅ t, ↑m ↑t

Next tactic:
simp [iInf_subtype, iInf_and, trim_eq_iInf]
theorem trim_sum_ge {ι} (m : ι → OuterMeasure α) : (sum fun i => (m i).trim) ≤ (sum m).trim :=
  fun s => by
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m✝ : OuterMeasure α
ι : Type u_2
m : ι → OuterMeasure α
s : Set α
⊢ ↑(sum fun i => trim (m i)) s ≤ ↑(trim (sum m)) s

Next tactic:
simp [trim_eq_iInf]
theorem trim_sum_ge {ι} (m : ι → OuterMeasure α) : (sum fun i => (m i).trim) ≤ (sum m).trim :=
  fun s => by
  simp [trim_eq_iInf];
    

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m✝ : OuterMeasure α
ι : Type u_2
m : ι → OuterMeasure α
s : Set α
⊢ ∀ (i : Set α),
    s ⊆ i →
      MeasurableSet i → ∑' (i : ι), ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑(m i) t ≤ ∑' (i_3 : ι), ↑(m i_3) i

Next tactic:
exact fun t st ht =>
      ENNReal.tsum_le_tsum fun i => iInf_le_of_le t <| iInf_le_of_le st <| iInf_le _ ht
theorem exists_measurable_superset_eq_trim (m : OuterMeasure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t = m.trim s := by
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ↑(trim m) s

Next tactic:
simp only [trim_eq_iInf]
theorem exists_measurable_superset_eq_trim (m : OuterMeasure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t = m.trim s := by
  simp only [trim_eq_iInf]; 

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑m t

Next tactic:
set ms := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), m t
theorem exists_measurable_superset_eq_trim (m : OuterMeasure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t = m.trim s := by
  simp only [trim_eq_iInf]; set ms := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), m t
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑m t
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ms

Next tactic:
by_cases hs : ms = ∞
theorem exists_measurable_superset_eq_trim (m : OuterMeasure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t = m.trim s := by
  simp only [trim_eq_iInf]; set ms := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), m t
  by_cases hs : ms = ∞
  · 

Proof state:
case pos
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑m t
hs : ms = ⊤
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ms

Next tactic:
simp only [hs]
theorem exists_measurable_superset_eq_trim (m : OuterMeasure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t = m.trim s := by
  simp only [trim_eq_iInf]; set ms := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), m t
  by_cases hs : ms = ∞
  · simp only [hs]
    

Proof state:
case pos
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑m t
hs : ms = ⊤
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ⊤

Next tactic:
simp only [iInf_eq_top] at hs
theorem exists_measurable_superset_eq_trim (m : OuterMeasure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t = m.trim s := by
  simp only [trim_eq_iInf]; set ms := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), m t
  by_cases hs : ms = ∞
  · simp only [hs]
    simp only [iInf_eq_top] at hs
    

Proof state:
case pos
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑m t
hs : ∀ (i : Set α), s ⊆ i → MeasurableSet i → ↑m i = ⊤
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ⊤

Next tactic:
exact ⟨univ, subset_univ s, MeasurableSet.univ, hs _ (subset_univ s) MeasurableSet.univ⟩
theorem exists_measurable_superset_eq_trim (m : OuterMeasure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t = m.trim s := by
  simp only [trim_eq_iInf]; set ms := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), m t
  by_cases hs : ms = ∞
  · simp only [hs]
    simp only [iInf_eq_top] at hs
    exact ⟨univ, subset_univ s, MeasurableSet.univ, hs _ (subset_univ s) MeasurableSet.univ⟩
  · 

Proof state:
case neg
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ms

Next tactic:
have : ∀ r > ms, ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t < r := by
      intro r hs
      have : ∃t, MeasurableSet t ∧ s ⊆ t ∧ measureOf m t < r := by simpa [iInf_lt_iff] using hs
      rcases this with ⟨t, hmt, hin, hlt⟩
      exists t
theorem exists_measurable_superset_eq_trim (m : OuterMeasure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t = m.trim s := by
  simp only [trim_eq_iInf]; set ms := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), m t
  by_cases hs : ms = ∞
  · simp only [hs]
    simp only [iInf_eq_top] at hs
    exact ⟨univ, subset_univ s, MeasurableSet.univ, hs _ (subset_univ s) MeasurableSet.univ⟩
  · have : ∀ r > ms, ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t < r := by
      

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ t, ⨅ (_ : s ⊆ t), ⨅ (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
⊢ ∀ r > ms, ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r

Next tactic:
intro r hs