Theorem: MeasureTheory.OuterMeasure.exists_measurable_superset_eq_trim
File: Mathlib/MeasureTheory/Measure/OuterMeasure.lean

tactic: simp only [trim_eq_iInf]
state_before: α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ↑(trim m) s

tactic: set ms := ⨅ (t : Set α) (st : s ⊆ t) (ht : MeasurableSet t), m t
state_before: α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t

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

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

tactic: simp only [iInf_eq_top] at hs
state_before: case pos
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ms = ⊤
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ⊤

tactic: exact ⟨univ, subset_univ s, MeasurableSet.univ, hs _ (subset_univ s) MeasurableSet.univ⟩
state_before: case pos
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ∀ (i : Set α), s ⊆ i → MeasurableSet i → ↑m i = ⊤
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ⊤

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
state_before: case neg
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ms

tactic: have : ∀ n : ℕ, ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t < ms + (n : ℝ≥0∞)⁻¹ := by
  intro n
  refine' this _ (ENNReal.lt_add_right hs _)
  simp
state_before: case neg
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ms

tactic: choose t hsub hm hm' using this
state_before: case neg
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this✝ : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
this : ∀ (n : ℕ), ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < ms + (↑n)⁻¹
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ms

tactic: refine' ⟨⋂ n, t n, subset_iInter hsub, MeasurableSet.iInter hm, _⟩
state_before: case neg
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
t : ℕ → Set α
hsub : ∀ (n : ℕ), s ⊆ t n
hm : ∀ (n : ℕ), MeasurableSet (t n)
hm' : ∀ (n : ℕ), ↑m (t n) < ms + (↑n)⁻¹
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t = ms

tactic: have : Tendsto (fun n : ℕ => ms + (n : ℝ≥0∞)⁻¹) atTop (𝓝 (ms + 0)) :=
  tendsto_const_nhds.add ENNReal.tendsto_inv_nat_nhds_zero
state_before: case neg
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
t : ℕ → Set α
hsub : ∀ (n : ℕ), s ⊆ t n
hm : ∀ (n : ℕ), MeasurableSet (t n)
hm' : ∀ (n : ℕ), ↑m (t n) < ms + (↑n)⁻¹
⊢ ↑m (⋂ (n : ℕ), t n) = ms

tactic: rw [add_zero] at this
state_before: case neg
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this✝ : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
t : ℕ → Set α
hsub : ∀ (n : ℕ), s ⊆ t n
hm : ∀ (n : ℕ), MeasurableSet (t n)
hm' : ∀ (n : ℕ), ↑m (t n) < ms + (↑n)⁻¹
this : Tendsto (fun n => ms + (↑n)⁻¹) atTop (𝓝 (ms + 0))
⊢ ↑m (⋂ (n : ℕ), t n) = ms

tactic: refine' le_antisymm (ge_of_tendsto' this fun n => _) _
state_before: case neg
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this✝ : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
t : ℕ → Set α
hsub : ∀ (n : ℕ), s ⊆ t n
hm : ∀ (n : ℕ), MeasurableSet (t n)
hm' : ∀ (n : ℕ), ↑m (t n) < ms + (↑n)⁻¹
this : Tendsto (fun n => ms + (↑n)⁻¹) atTop (𝓝 ms)
⊢ ↑m (⋂ (n : ℕ), t n) = ms

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

tactic: have : ∃t, MeasurableSet t ∧ s ⊆ t ∧ measureOf m t < r := by simpa [iInf_lt_iff] using hs
state_before: α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs✝ : ¬ms = ⊤
r : ℝ≥0∞
hs : r > ms
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r

tactic: rcases this with ⟨t, hmt, hin, hlt⟩
state_before: α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs✝ : ¬ms = ⊤
r : ℝ≥0∞
hs : r > ms
this : ∃ t, MeasurableSet t ∧ s ⊆ t ∧ ↑m t < r
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r

tactic: exists t
state_before: case intro.intro.intro
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs✝ : ¬ms = ⊤
r : ℝ≥0∞
hs : r > ms
t : Set α
hmt : MeasurableSet t
hin : s ⊆ t
hlt : ↑m t < r
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r

tactic: simpa [iInf_lt_iff] using hs
state_before: α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs✝ : ¬ms = ⊤
r : ℝ≥0∞
hs : r > ms
⊢ ∃ t, MeasurableSet t ∧ s ⊆ t ∧ ↑m t < r

tactic: intro n
state_before: α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
⊢ ∀ (n : ℕ), ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < ms + (↑n)⁻¹

tactic: refine' this _ (ENNReal.lt_add_right hs _)
state_before: α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
n : ℕ
⊢ ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < ms + (↑n)⁻¹

tactic: simp
state_before: α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
n : ℕ
⊢ (↑n)⁻¹ ≠ 0

tactic: exact le_trans (m.mono' <| iInter_subset t n) (hm' n).le
state_before: case neg.refine'_1
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this✝ : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
t : ℕ → Set α
hsub : ∀ (n : ℕ), s ⊆ t n
hm : ∀ (n : ℕ), MeasurableSet (t n)
hm' : ∀ (n : ℕ), ↑m (t n) < ms + (↑n)⁻¹
this : Tendsto (fun n => ms + (↑n)⁻¹) atTop (𝓝 ms)
n : ℕ
⊢ ↑m (⋂ (n : ℕ), t n) ≤ ms + (↑n)⁻¹

tactic: refine' iInf_le_of_le (⋂ n, t n) _
state_before: case neg.refine'_2
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this✝ : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
t : ℕ → Set α
hsub : ∀ (n : ℕ), s ⊆ t n
hm : ∀ (n : ℕ), MeasurableSet (t n)
hm' : ∀ (n : ℕ), ↑m (t n) < ms + (↑n)⁻¹
this : Tendsto (fun n => ms + (↑n)⁻¹) atTop (𝓝 ms)
⊢ ms ≤ ↑m (⋂ (n : ℕ), t n)

tactic: refine' iInf_le_of_le (subset_iInter hsub) _
state_before: case neg.refine'_2
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this✝ : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
t : ℕ → Set α
hsub : ∀ (n : ℕ), s ⊆ t n
hm : ∀ (n : ℕ), MeasurableSet (t n)
hm' : ∀ (n : ℕ), ↑m (t n) < ms + (↑n)⁻¹
this : Tendsto (fun n => ms + (↑n)⁻¹) atTop (𝓝 ms)
⊢ (⨅ (_ : s ⊆ ⋂ (n : ℕ), t n) (_ : MeasurableSet (⋂ (n : ℕ), t n)), ↑m (⋂ (n : ℕ), t n)) ≤ ↑m (⋂ (n : ℕ), t n)

tactic: refine' iInf_le _ (MeasurableSet.iInter hm)
state_before: case neg.refine'_2
α : Type u_1
inst✝ : MeasurableSpace α
m✝ m : OuterMeasure α
s : Set α
ms : ℝ≥0∞ := ⨅ (t : Set α) (_ : s ⊆ t) (_ : MeasurableSet t), ↑m t
hs : ¬ms = ⊤
this✝ : ∀ (r : ℝ≥0∞), r > ms → ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ↑m t < r
t : ℕ → Set α
hsub : ∀ (n : ℕ), s ⊆ t n
hm : ∀ (n : ℕ), MeasurableSet (t n)
hm' : ∀ (n : ℕ), ↑m (t n) < ms + (↑n)⁻¹
this : Tendsto (fun n => ms + (↑n)⁻¹) atTop (𝓝 ms)
⊢ (⨅ (_ : MeasurableSet (⋂ (n : ℕ), t n)), ↑m (⋂ (n : ℕ), t n)) ≤ ↑m (⋂ (n : ℕ), t n)