-- Mathlib/MeasureTheory/Decomposition/RadonNikodym.lean
lemma rnDeriv_withDensity_left {μ ν : Measure α} [SigmaFinite μ] [SigmaFinite ν]
    (hfν : AEMeasurable f ν) (hf_ne_top : ∀ᵐ x ∂μ, f x ≠ ∞) :
    (μ.withDensity f).rnDeriv ν =ᵐ[ν] fun x ↦ f x * μ.rnDeriv ν x

Proof state:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
⊢ (μ.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ.rnDeriv ν x

Tactic:
have hμ'ν : μ' ≪ ν := withDensity_absolutelyContinuous _ _

Result:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
hμ'ν : μ' ≪ ν
⊢ (μ.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ.rnDeriv ν x

Proof state:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
hμ'ν : μ' ≪ ν
h : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ'.rnDeriv ν x
h1 : μ'.rnDeriv ν =ᶠ[ae ν] μ.rnDeriv ν
⊢ (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] (μ.withDensity f).rnDeriv ν

Tactic:
exact rnDeriv_withDensity_withDensity_rnDeriv_left μ ν hf_ne_top

Result:
no goals

Proof state:
case h
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
hμ'ν : μ' ≪ ν
h : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ'.rnDeriv ν x
h1 : μ'.rnDeriv ν =ᶠ[ae ν] μ.rnDeriv ν
h2 : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] (μ.withDensity f).rnDeriv ν
x : α
hx : (μ'.withDensity f).rnDeriv ν x = f x * μ'.rnDeriv ν x
hx1 : μ'.rnDeriv ν x = μ.rnDeriv ν x
hx2 : (μ'.withDensity f).rnDeriv ν x = (μ.withDensity f).rnDeriv ν x
⊢ (μ.withDensity f).rnDeriv ν x = f x * μ.rnDeriv ν x

Tactic:
rw [← hx2, hx, hx1]

Result:
no goals

Proof state:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
hμ'ν : μ' ≪ ν
h : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ'.rnDeriv ν x
h1 : μ'.rnDeriv ν =ᶠ[ae ν] μ.rnDeriv ν
h2 : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] (μ.withDensity f).rnDeriv ν
⊢ (μ.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ.rnDeriv ν x

Tactic:
filter_upwards [h, h1, h2] with x hx hx1 hx2

Result:
case h
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
hμ'ν : μ' ≪ ν
h : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ'.rnDeriv ν x
h1 : μ'.rnDeriv ν =ᶠ[ae ν] μ.rnDeriv ν
h2 : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] (μ.withDensity f).rnDeriv ν
x : α
hx : (μ'.withDensity f).rnDeriv ν x = f x * μ'.rnDeriv ν x
hx1 : μ'.rnDeriv ν x = μ.rnDeriv ν x
hx2 : (μ'.withDensity f).rnDeriv ν x = (μ.withDensity f).rnDeriv ν x
⊢ (μ.withDensity f).rnDeriv ν x = f x * μ.rnDeriv ν x

Proof state:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
hμ'ν : μ' ≪ ν
h : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ'.rnDeriv ν x
h1 : μ'.rnDeriv ν =ᶠ[ae ν] μ.rnDeriv ν
⊢ (μ.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ.rnDeriv ν x

Tactic:
have h2 : (μ'.withDensity f).rnDeriv ν =ᵐ[ν] (μ.withDensity f).rnDeriv ν := by
  exact rnDeriv_withDensity_withDensity_rnDeriv_left μ ν hf_ne_top

Result:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
hμ'ν : μ' ≪ ν
h : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ'.rnDeriv ν x
h1 : μ'.rnDeriv ν =ᶠ[ae ν] μ.rnDeriv ν
h2 : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] (μ.withDensity f).rnDeriv ν
⊢ (μ.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ.rnDeriv ν x

Proof state:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
hμ'ν : μ' ≪ ν
h : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ'.rnDeriv ν x
⊢ (μ.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ.rnDeriv ν x

Tactic:
have h1 : μ'.rnDeriv ν =ᵐ[ν] μ.rnDeriv ν :=
  Measure.rnDeriv_withDensity _ (Measure.measurable_rnDeriv _ _)

Result:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
hμ'ν : μ' ≪ ν
h : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ'.rnDeriv ν x
h1 : μ'.rnDeriv ν =ᶠ[ae ν] μ.rnDeriv ν
⊢ (μ.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ.rnDeriv ν x

Proof state:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
hμ'ν : μ' ≪ ν
⊢ (μ.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ.rnDeriv ν x

Tactic:
have h := rnDeriv_withDensity_left_of_absolutelyContinuous hμ'ν hfν

Result:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
hμ'ν : μ' ≪ ν
h : (μ'.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ'.rnDeriv ν x
⊢ (μ.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ.rnDeriv ν x

Proof state:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
⊢ (μ.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ.rnDeriv ν x

Tactic:
let μ' := ν.withDensity (μ.rnDeriv ν)

Result:
α : Type u_1
m : MeasurableSpace α
f : α → ℝ≥0∞
μ ν : Measure α
inst✝¹ : SigmaFinite μ
inst✝ : SigmaFinite ν
hfν : AEMeasurable f ν
hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤
μ' : Measure α := ν.withDensity (μ.rnDeriv ν)
⊢ (μ.withDensity f).rnDeriv ν =ᶠ[ae ν] fun x => f x * μ.rnDeriv ν x