Theorem: ENNReal.aemeasurable_of_exist_almost_disjoint_supersets
File: Mathlib/MeasureTheory/Function/AEMeasurableOrder.lean

tactic: obtain ⟨s, s_count, s_dense, _, s_top⟩ :
  ∃ s : Set ℝ≥0∞, s.Countable ∧ Dense s ∧ 0 ∉ s ∧ ∞ ∉ s :=
  ENNReal.exists_countable_dense_no_zero_top
state_before: α : Type u_1
m : MeasurableSpace α
μ : MeasureTheory.Measure α
f : α → ℝ≥0∞
h :
  ∀ (p q : ℝ≥0),
    p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < ↑p} ⊆ u ∧ {x | ↑q < f x} ⊆ v ∧ ↑↑μ (u ∩ v) = 0
⊢ AEMeasurable f

tactic: have I : ∀ x ∈ s, x ≠ ∞ := fun x xs hx => s_top (hx ▸ xs)
state_before: case intro.intro.intro.intro
α : Type u_1
m : MeasurableSpace α
μ : MeasureTheory.Measure α
f : α → ℝ≥0∞
h :
  ∀ (p q : ℝ≥0),
    p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < ↑p} ⊆ u ∧ {x | ↑q < f x} ⊆ v ∧ ↑↑μ (u ∩ v) = 0
s : Set ℝ≥0∞
s_count : Set.Countable s
s_dense : Dense s
left✝ : ¬0 ∈ s
s_top : ¬⊤ ∈ s
⊢ AEMeasurable f

tactic: apply MeasureTheory.aemeasurable_of_exist_almost_disjoint_supersets μ s s_count s_dense _
state_before: case intro.intro.intro.intro
α : Type u_1
m : MeasurableSpace α
μ : MeasureTheory.Measure α
f : α → ℝ≥0∞
h :
  ∀ (p q : ℝ≥0),
    p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < ↑p} ⊆ u ∧ {x | ↑q < f x} ⊆ v ∧ ↑↑μ (u ∩ v) = 0
s : Set ℝ≥0∞
s_count : Set.Countable s
s_dense : Dense s
left✝ : ¬0 ∈ s
s_top : ¬⊤ ∈ s
I : ∀ (x : ℝ≥0∞), x ∈ s → x ≠ ⊤
⊢ AEMeasurable f

tactic: rintro p hp q hq hpq
state_before: case intro.intro.intro.intro
α : Type u_1
m : MeasurableSpace α
μ : MeasureTheory.Measure α
f : α → ℝ≥0∞
h :
  ∀ (p q : ℝ≥0),
    p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < ↑p} ⊆ u ∧ {x | ↑q < f x} ⊆ v ∧ ↑↑μ (u ∩ v) = 0
s : Set ℝ≥0∞
s_count : Set.Countable s
s_dense : Dense s
left✝ : ¬0 ∈ s
s_top : ¬⊤ ∈ s
I : ∀ (x : ℝ≥0∞), x ∈ s → x ≠ ⊤
⊢ ∀ (p : ℝ≥0∞),
    p ∈ s →
      ∀ (q : ℝ≥0∞),
        q ∈ s →
          p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < p} ⊆ u ∧ {x | q < f x} ⊆ v ∧ ↑↑μ (u ∩ v) = 0

tactic: lift p to ℝ≥0 using I p hp
state_before: case intro.intro.intro.intro
α : Type u_1
m : MeasurableSpace α
μ : MeasureTheory.Measure α
f : α → ℝ≥0∞
h :
  ∀ (p q : ℝ≥0),
    p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < ↑p} ⊆ u ∧ {x | ↑q < f x} ⊆ v ∧ ↑↑μ (u ∩ v) = 0
s : Set ℝ≥0∞
s_count : Set.Countable s
s_dense : Dense s
left✝ : ¬0 ∈ s
s_top : ¬⊤ ∈ s
I : ∀ (x : ℝ≥0∞), x ∈ s → x ≠ ⊤
p : ℝ≥0∞
hp : p ∈ s
q : ℝ≥0∞
hq : q ∈ s
hpq : p < q
⊢ ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < p} ⊆ u ∧ {x | q < f x} ⊆ v ∧ ↑↑μ (u ∩ v) = 0

tactic: lift q to ℝ≥0 using I q hq
state_before: case intro.intro.intro.intro.intro
α : Type u_1
m : MeasurableSpace α
μ : MeasureTheory.Measure α
f : α → ℝ≥0∞
h :
  ∀ (p q : ℝ≥0),
    p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < ↑p} ⊆ u ∧ {x | ↑q < f x} ⊆ v ∧ ↑↑μ (u ∩ v) = 0
s : Set ℝ≥0∞
s_count : Set.Countable s
s_dense : Dense s
left✝ : ¬0 ∈ s
s_top : ¬⊤ ∈ s
I : ∀ (x : ℝ≥0∞), x ∈ s → x ≠ ⊤
q : ℝ≥0∞
hq : q ∈ s
p : ℝ≥0
hp : ↑p ∈ s
hpq : ↑p < q
⊢ ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < ↑p} ⊆ u ∧ {x | q < f x} ⊆ v ∧ ↑↑μ (u ∩ v) = 0

tactic: exact h p q (ENNReal.coe_lt_coe.1 hpq)
state_before: case intro.intro.intro.intro.intro.intro
α : Type u_1
m : MeasurableSpace α
μ : MeasureTheory.Measure α
f : α → ℝ≥0∞
h :
  ∀ (p q : ℝ≥0),
    p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < ↑p} ⊆ u ∧ {x | ↑q < f x} ⊆ v ∧ ↑↑μ (u ∩ v) = 0
s : Set ℝ≥0∞
s_count : Set.Countable s
s_dense : Dense s
left✝ : ¬0 ∈ s
s_top : ¬⊤ ∈ s
I : ∀ (x : ℝ≥0∞), x ∈ s → x ≠ ⊤
p : ℝ≥0
hp : ↑p ∈ s
q : ℝ≥0
hq : ↑q ∈ s
hpq : ↑p < ↑q
⊢ ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < ↑p} ⊆ u ∧ {x | ↑q < f x} ⊆ v ∧ ↑↑μ (u ∩ v) = 0