-- Mathlib/MeasureTheory/Decomposition/RadonNikodym.lean
theorem withDensityᵥ_rnDeriv_eq (s : SignedMeasure α) (μ : Measure α) [SigmaFinite μ]
    (h : s ≪ᵥ μ.toENNRealVectorMeasure) : μ.withDensityᵥ (s.rnDeriv μ) = s

Proof state:
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s ≪ᵥ μ.toENNRealVectorMeasure
⊢ μ.withDensityᵥ (s.rnDeriv μ) = s

Tactic:
rw [absolutelyContinuous_ennreal_iff, (_ : μ.toENNRealVectorMeasure.ennrealToMeasure = μ),
  totalVariation_absolutelyContinuous_iff] at h

Result:
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
⊢ μ.withDensityᵥ (s.rnDeriv μ) = s

α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.totalVariation ≪ μ.toENNRealVectorMeasure.ennrealToMeasure
⊢ μ.toENNRealVectorMeasure.ennrealToMeasure = μ

Proof state:
case h.hg.refine_2
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ ∫⁻ (x : α), s.toJordanDecomposition.negPart.rnDeriv μ x ∂μ ≠ ⊤

Tactic:
exact (lintegral_rnDeriv_lt_top _ _).ne

Result:
no goals

Proof state:
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ Measurable fun x => (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal

Tactic:
fun_prop

Result:
no goals

Proof state:
case h.hg.refine_1
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ AEStronglyMeasurable (fun x => (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal) (μ.restrict Set.univ)

Tactic:
apply Measurable.aestronglyMeasurable (by fun_prop)

Result:
no goals

Proof state:
case h
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ (s.toJordanDecomposition.posPart i).toReal - (s.toJordanDecomposition.negPart i).toReal = ↑s i

Tactic:
conv_rhs => rw [← s.toSignedMeasure_toJordanDecomposition]

Result:
case h
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ (s.toJordanDecomposition.posPart i).toReal - (s.toJordanDecomposition.negPart i).toReal =
    ↑s.toJordanDecomposition.toSignedMeasure i

Proof state:
case h
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ (s.toJordanDecomposition.posPart i).toReal - (s.toJordanDecomposition.negPart i).toReal =
    ↑s.toJordanDecomposition.posPart.toSignedMeasure i - ↑s.toJordanDecomposition.negPart.toSignedMeasure i

Tactic:
rw [toSignedMeasure_apply_measurable hi, toSignedMeasure_apply_measurable hi]

Result:
no goals

Proof state:
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
⊢ μ.withDensityᵥ (s.rnDeriv μ) = s

Tactic:
ext1 i hi

Result:
case h
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ ↑(μ.withDensityᵥ (s.rnDeriv μ)) i = ↑s i

Proof state:
case h.hg
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ IntegrableOn (fun x => (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal) Set.univ μ

Tactic:
refine ⟨?_, hasFiniteIntegral_toReal_of_lintegral_ne_top ?_⟩

Result:
case h.hg.refine_1
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ AEStronglyMeasurable (fun x => (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal) (μ.restrict Set.univ)

case h.hg.refine_2
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ ∫⁻ (x : α) in Set.univ, s.toJordanDecomposition.negPart.rnDeriv μ x ∂μ ≠ ⊤

Proof state:
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.totalVariation ≪ μ.toENNRealVectorMeasure.ennrealToMeasure
⊢ μ.toENNRealVectorMeasure.ennrealToMeasure = μ

Tactic:
exact equivMeasure.right_inv μ

Result:
no goals

Proof state:
case h.hg
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ IntegrableOn (fun x => (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal) Set.univ (μ.restrict i)

Tactic:
refine IntegrableOn.restrict ?_ MeasurableSet.univ

Result:
case h.hg
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ IntegrableOn (fun x => (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal) Set.univ μ

Proof state:
case h
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ (s.toJordanDecomposition.posPart i).toReal - (s.toJordanDecomposition.negPart i).toReal =
    ↑s.toJordanDecomposition.toSignedMeasure i

Tactic:
erw [VectorMeasure.sub_apply]

Result:
case h
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ (s.toJordanDecomposition.posPart i).toReal - (s.toJordanDecomposition.negPart i).toReal =
    ↑s.toJordanDecomposition.posPart.toSignedMeasure i - ↑s.toJordanDecomposition.negPart.toSignedMeasure i

Proof state:
case h.hg
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ Integrable (fun x => (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal) (μ.restrict i)

Tactic:
rw [← integrableOn_univ]

Result:
case h.hg
α : Type u_1
m : MeasurableSpace α
s : SignedMeasure α
μ : Measure α
inst✝ : SigmaFinite μ
h : s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ
i : Set α
hi : MeasurableSet i
⊢ IntegrableOn (fun x => (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal) Set.univ (μ.restrict i)