-- Mathlib/MeasureTheory/Measure/WithDensity.lean
theorem withDensity_ofReal_mutuallySingular {f : α → ℝ} (hf : Measurable f) :
    (μ.withDensity fun x => ENNReal.ofReal <| f x) ⟂ₘ
      μ.withDensity fun x => ENNReal.ofReal <| -f x

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
hS : MeasurableSet S
⊢ (μ.withDensity fun x => ENNReal.ofReal (f x)) ⟂ₘ μ.withDensity fun x => ENNReal.ofReal (-f x)

Tactic:
refine ⟨S, hS, ?_, ?_⟩

Result:
case refine_1
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
hS : MeasurableSet S
⊢ (μ.withDensity fun x => ENNReal.ofReal (f x)) S = 0

case refine_2
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
hS : MeasurableSet S
⊢ (μ.withDensity fun x => ENNReal.ofReal (-f x)) Sᶜ = 0

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
⊢ (μ.withDensity fun x => ENNReal.ofReal (f x)) ⟂ₘ μ.withDensity fun x => ENNReal.ofReal (-f x)

Tactic:
set S : Set α := { x | f x < 0 }

Result:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
⊢ (μ.withDensity fun x => ENNReal.ofReal (f x)) ⟂ₘ μ.withDensity fun x => ENNReal.ofReal (-f x)

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
⊢ (μ.withDensity fun x => ENNReal.ofReal (f x)) ⟂ₘ μ.withDensity fun x => ENNReal.ofReal (-f x)

Tactic:
have hS : MeasurableSet S := measurableSet_lt hf measurable_const

Result:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
hS : MeasurableSet S
⊢ (μ.withDensity fun x => ENNReal.ofReal (f x)) ⟂ₘ μ.withDensity fun x => ENNReal.ofReal (-f x)

Proof state:
case refine_2
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
hS : MeasurableSet S
⊢ ∀ᵐ (x : α) ∂μ.restrict Sᶜ, ENNReal.ofReal (-f x) = 0 x

Tactic:
exact
  (ae_restrict_mem hS.compl).mono fun x hx =>
    ENNReal.ofReal_eq_zero.2 (not_lt.1 <| mt neg_pos.1 hx)

Result:
no goals

Proof state:
case refine_1
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
hS : MeasurableSet S
⊢ (μ.withDensity fun x => ENNReal.ofReal (f x)) S = 0

Tactic:
rw [withDensity_apply _ hS, lintegral_eq_zero_iff hf.ennreal_ofReal, EventuallyEq]

Result:
case refine_1
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
hS : MeasurableSet S
⊢ ∀ᵐ (x : α) ∂μ.restrict S, ENNReal.ofReal (f x) = 0 x

Proof state:
case refine_1
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
hS : MeasurableSet S
⊢ ∀ᵐ (x : α) ∂μ.restrict S, ENNReal.ofReal (f x) = 0 x

Tactic:
exact (ae_restrict_mem hS).mono fun x hx => ENNReal.ofReal_eq_zero.2 (le_of_lt hx)

Result:
no goals

Proof state:
case refine_2
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
hS : MeasurableSet S
⊢ (μ.withDensity fun x => ENNReal.ofReal (-f x)) Sᶜ = 0

Tactic:
rw [withDensity_apply _ hS.compl, lintegral_eq_zero_iff hf.neg.ennreal_ofReal, EventuallyEq]

Result:
case refine_2
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Measurable f
S : Set α := {x | f x < 0}
hS : MeasurableSet S
⊢ ∀ᵐ (x : α) ∂μ.restrict Sᶜ, ENNReal.ofReal (-f x) = 0 x