Theorem: MeasureTheory.withDensityᵥ_eq_withDensity_pos_part_sub_withDensity_neg_part
File: Mathlib/MeasureTheory/Measure/WithDensityVectorMeasure.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : α → E
f : α → ℝ
hfi : Integrable f μ
⊢ μ.withDensityᵥ f =
    (μ.withDensity fun x => ENNReal.ofReal (f x)).toSignedMeasure -
      (μ.withDensity fun x => ENNReal.ofReal (-f x)).toSignedMeasure
state_after: α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : α → E
f : α → ℝ
hfi : Integrable f μ
this : IsFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal (f x))
⊢ μ.withDensityᵥ f =
    (μ.withDensity fun x => ENNReal.ofReal (f x)).toSignedMeasure -
      (μ.withDensity fun x => ENNReal.ofReal (-f x)).toSignedMeasure
tactic: haveI := isFiniteMeasure_withDensity_ofReal hfi.2
state_before: α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : α → E
f : α → ℝ
hfi : Integrable f μ
this : IsFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal (f x))
⊢ μ.withDensityᵥ f =
    (μ.withDensity fun x => ENNReal.ofReal (f x)).toSignedMeasure -
      (μ.withDensity fun x => ENNReal.ofReal (-f x)).toSignedMeasure
state_after: α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : α → E
f : α → ℝ
hfi : Integrable f μ
this✝ : IsFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal (f x))
this : IsFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal ((-f) x))
⊢ μ.withDensityᵥ f =
    (μ.withDensity fun x => ENNReal.ofReal (f x)).toSignedMeasure -
      (μ.withDensity fun x => ENNReal.ofReal (-f x)).toSignedMeasure
tactic: haveI := isFiniteMeasure_withDensity_ofReal hfi.neg.2
state_before: α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : α → E
f : α → ℝ
hfi : Integrable f μ
this✝ : IsFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal (f x))
this : IsFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal ((-f) x))
⊢ μ.withDensityᵥ f =
    (μ.withDensity fun x => ENNReal.ofReal (f x)).toSignedMeasure -
      (μ.withDensity fun x => ENNReal.ofReal (-f x)).toSignedMeasure
state_after: case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : α → E
f : α → ℝ
hfi : Integrable f μ
this✝ : IsFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal (f x))
this : IsFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal ((-f) x))
i : Set α
hi : MeasurableSet i
⊢ ↑(μ.withDensityᵥ f) i =
    ↑((μ.withDensity fun x => ENNReal.ofReal (f x)).toSignedMeasure -
          (μ.withDensity fun x => ENNReal.ofReal (-f x)).toSignedMeasure)
      i
tactic: ext i hi
state_before: case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : α → E
f : α → ℝ
hfi : Integrable f μ
this✝ : IsFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal (f x))
this : IsFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal ((-f) x))
i : Set α
hi : MeasurableSet i
⊢ ↑(μ.withDensityᵥ f) i =
    ↑((μ.withDensity fun x => ENNReal.ofReal (f x)).toSignedMeasure -
          (μ.withDensity fun x => ENNReal.ofReal (-f x)).toSignedMeasure)
      i
state_after: no goals
tactic: rw [withDensityᵥ_apply hfi hi,
    integral_eq_lintegral_pos_part_sub_lintegral_neg_part hfi.integrableOn,
    VectorMeasure.sub_apply, toSignedMeasure_apply_measurable hi,
    toSignedMeasure_apply_measurable hi, withDensity_apply _ hi, withDensity_apply _ hi]