l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem withDensityᵥ_smul {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E]
    [SMulCommClass ℝ 𝕜 E] (f : α → E) (r : 𝕜) : μ.withDensityᵥ (r • f) = r • μ.withDensityᵥ f := by
  by_cases hf : Integrable f μ
  · ext1 i hi
    rw [withDensityᵥ_apply (hf.smul r) hi, VectorMeasure.smul_apply, withDensityᵥ_apply hf hi, ←
      integral_smul r f]
    

Proof state:
case pos.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
𝕜 : Type u_4
inst✝² : NontriviallyNormedField 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : SMulCommClass ℝ 𝕜 E
f : α → E
r : 𝕜
hf : Integrable f
i : Set α
hi : MeasurableSet i
⊢ ∫ (x : α) in i, (r • f) x ∂μ = ∫ (a : α) in i, r • f a ∂μ

Next tactic:
rfl
@[simp]
theorem withDensityᵥ_smul {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E]
    [SMulCommClass ℝ 𝕜 E] (f : α → E) (r : 𝕜) : μ.withDensityᵥ (r • f) = r • μ.withDensityᵥ f := by
  by_cases hf : Integrable f μ
  · ext1 i hi
    rw [withDensityᵥ_apply (hf.smul r) hi, VectorMeasure.smul_apply, withDensityᵥ_apply hf hi, ←
      integral_smul r f]
    rfl
  · 

Proof state:
case neg
α : 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
𝕜 : Type u_4
inst✝² : NontriviallyNormedField 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : SMulCommClass ℝ 𝕜 E
f : α → E
r : 𝕜
hf : ¬Integrable f
⊢ withDensityᵥ μ (r • f) = r • withDensityᵥ μ f

Next tactic:
by_cases hr : r = 0
@[simp]
theorem withDensityᵥ_smul {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E]
    [SMulCommClass ℝ 𝕜 E] (f : α → E) (r : 𝕜) : μ.withDensityᵥ (r • f) = r • μ.withDensityᵥ f := by
  by_cases hf : Integrable f μ
  · ext1 i hi
    rw [withDensityᵥ_apply (hf.smul r) hi, VectorMeasure.smul_apply, withDensityᵥ_apply hf hi, ←
      integral_smul r f]
    rfl
  · by_cases hr : r = 0
    · 

Proof state:
case pos
α : 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
𝕜 : Type u_4
inst✝² : NontriviallyNormedField 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : SMulCommClass ℝ 𝕜 E
f : α → E
r : 𝕜
hf : ¬Integrable f
hr : r = 0
⊢ withDensityᵥ μ (r • f) = r • withDensityᵥ μ f

Next tactic:
rw [hr, zero_smul, zero_smul, withDensityᵥ_zero]
@[simp]
theorem withDensityᵥ_smul {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E]
    [SMulCommClass ℝ 𝕜 E] (f : α → E) (r : 𝕜) : μ.withDensityᵥ (r • f) = r • μ.withDensityᵥ f := by
  by_cases hf : Integrable f μ
  · ext1 i hi
    rw [withDensityᵥ_apply (hf.smul r) hi, VectorMeasure.smul_apply, withDensityᵥ_apply hf hi, ←
      integral_smul r f]
    rfl
  · by_cases hr : r = 0
    · rw [hr, zero_smul, zero_smul, withDensityᵥ_zero]
    · 

Proof state:
case neg
α : 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
𝕜 : Type u_4
inst✝² : NontriviallyNormedField 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : SMulCommClass ℝ 𝕜 E
f : α → E
r : 𝕜
hf : ¬Integrable f
hr : ¬r = 0
⊢ withDensityᵥ μ (r • f) = r • withDensityᵥ μ f

Next tactic:
rw [withDensityᵥ, withDensityᵥ, dif_neg hf, dif_neg, smul_zero]
@[simp]
theorem withDensityᵥ_smul {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E]
    [SMulCommClass ℝ 𝕜 E] (f : α → E) (r : 𝕜) : μ.withDensityᵥ (r • f) = r • μ.withDensityᵥ f := by
  by_cases hf : Integrable f μ
  · ext1 i hi
    rw [withDensityᵥ_apply (hf.smul r) hi, VectorMeasure.smul_apply, withDensityᵥ_apply hf hi, ←
      integral_smul r f]
    rfl
  · by_cases hr : r = 0
    · rw [hr, zero_smul, zero_smul, withDensityᵥ_zero]
    · rw [withDensityᵥ, withDensityᵥ, dif_neg hf, dif_neg, smul_zero]
      

Proof state:
case neg.hnc
α : 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
𝕜 : Type u_4
inst✝² : NontriviallyNormedField 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : SMulCommClass ℝ 𝕜 E
f : α → E
r : 𝕜
hf : ¬Integrable f
hr : ¬r = 0
⊢ ¬Integrable (r • f)

Next tactic:
rwa [integrable_smul_iff hr f]
theorem withDensityᵥ_smul_eq_withDensityᵥ_withDensity {f : α → ℝ≥0} {g : α → E}
    (hf : AEMeasurable f μ) (hfg : Integrable (f • g) μ) :
    μ.withDensityᵥ (f • g) = (μ.withDensity (fun x ↦ f x)).withDensityᵥ g := by
  

Proof state:
α : 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 : α → ℝ≥0
g : α → E
hf : AEMeasurable f
hfg : Integrable (f • g)
⊢ withDensityᵥ μ (f • g) = withDensityᵥ (withDensity μ fun x => ↑(f x)) g

Next tactic:
ext s hs
theorem withDensityᵥ_smul_eq_withDensityᵥ_withDensity {f : α → ℝ≥0} {g : α → E}
    (hf : AEMeasurable f μ) (hfg : Integrable (f • g) μ) :
    μ.withDensityᵥ (f • g) = (μ.withDensity (fun x ↦ f x)).withDensityᵥ g := by
  ext s hs
  

Proof state:
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 : α → ℝ≥0
g : α → E
hf : AEMeasurable f
hfg : Integrable (f • g)
s : Set α
hs : MeasurableSet s
⊢ ↑(withDensityᵥ μ (f • g)) s = ↑(withDensityᵥ (withDensity μ fun x => ↑(f x)) g) s

Next tactic:
rw [withDensityᵥ_apply hfg hs,
    withDensityᵥ_apply ((integrable_withDensity_iff_integrable_smul₀ hf).mpr hfg) hs,
    set_integral_withDensity_eq_set_integral_smul₀ hf.restrict _ hs]
theorem withDensityᵥ_smul_eq_withDensityᵥ_withDensity {f : α → ℝ≥0} {g : α → E}
    (hf : AEMeasurable f μ) (hfg : Integrable (f • g) μ) :
    μ.withDensityᵥ (f • g) = (μ.withDensity (fun x ↦ f x)).withDensityᵥ g := by
  ext s hs
  rw [withDensityᵥ_apply hfg hs,
    withDensityᵥ_apply ((integrable_withDensity_iff_integrable_smul₀ hf).mpr hfg) hs,
    set_integral_withDensity_eq_set_integral_smul₀ hf.restrict _ hs]
  

Proof state:
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 : α → ℝ≥0
g : α → E
hf : AEMeasurable f
hfg : Integrable (f • g)
s : Set α
hs : MeasurableSet s
⊢ ∫ (x : α) in s, (f • g) x ∂μ = ∫ (a : α) in s, f a • g a ∂μ

Next tactic:
rfl
theorem withDensityᵥ_smul_eq_withDensityᵥ_withDensity' {f : α → ℝ≥0∞} {g : α → E}
    (hf : AEMeasurable f μ) (hflt : ∀ᵐ x ∂μ, f x < ∞)
    (hfg : Integrable (fun x ↦ (f x).toReal • g x) μ) :
    μ.withDensityᵥ (fun x ↦ (f x).toReal • g x) = (μ.withDensity f).withDensityᵥ g := by
  

Proof state:
α : 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 : α → ℝ≥0∞
g : α → E
hf : AEMeasurable f
hflt : ∀ᵐ (x : α) ∂μ, f x < ⊤
hfg : Integrable fun x => ENNReal.toReal (f x) • g x
⊢ (withDensityᵥ μ fun x => ENNReal.toReal (f x) • g x) = withDensityᵥ (withDensity μ f) g

Next tactic:
rw [← withDensity_congr_ae (coe_toNNReal_ae_eq hflt),
    ← withDensityᵥ_smul_eq_withDensityᵥ_withDensity hf.ennreal_toNNReal hfg]
theorem withDensityᵥ_smul_eq_withDensityᵥ_withDensity' {f : α → ℝ≥0∞} {g : α → E}
    (hf : AEMeasurable f μ) (hflt : ∀ᵐ x ∂μ, f x < ∞)
    (hfg : Integrable (fun x ↦ (f x).toReal • g x) μ) :
    μ.withDensityᵥ (fun x ↦ (f x).toReal • g x) = (μ.withDensity f).withDensityᵥ g := by
  rw [← withDensity_congr_ae (coe_toNNReal_ae_eq hflt),
    ← withDensityᵥ_smul_eq_withDensityᵥ_withDensity hf.ennreal_toNNReal hfg]
  

Proof state:
α : 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 : α → ℝ≥0∞
g : α → E
hf : AEMeasurable f
hflt : ∀ᵐ (x : α) ∂μ, f x < ⊤
hfg : Integrable fun x => ENNReal.toReal (f x) • g x
⊢ (withDensityᵥ μ fun x => ENNReal.toReal (f x) • g x) =
    withDensityᵥ μ ((fun x => ENNReal.toNNReal (f x)) • fun x => g x)

Next tactic:
rfl
theorem Measure.withDensityᵥ_absolutelyContinuous (μ : Measure α) (f : α → ℝ) :
    μ.withDensityᵥ f ≪ᵥ μ.toENNRealVectorMeasure := by
  

Proof state:
α : 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
μ : Measure α
f : α → ℝ
⊢ withDensityᵥ μ f ≪ᵥ toENNRealVectorMeasure μ

Next tactic:
by_cases hf : Integrable f μ
theorem Measure.withDensityᵥ_absolutelyContinuous (μ : Measure α) (f : α → ℝ) :
    μ.withDensityᵥ f ≪ᵥ μ.toENNRealVectorMeasure := by
  by_cases hf : Integrable f μ
  · 

Proof state:
case pos
α : 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
μ : Measure α
f : α → ℝ
hf : Integrable f
⊢ withDensityᵥ μ f ≪ᵥ toENNRealVectorMeasure μ

Next tactic:
refine' VectorMeasure.AbsolutelyContinuous.mk fun i hi₁ hi₂ => _
theorem Measure.withDensityᵥ_absolutelyContinuous (μ : Measure α) (f : α → ℝ) :
    μ.withDensityᵥ f ≪ᵥ μ.toENNRealVectorMeasure := by
  by_cases hf : Integrable f μ
  · refine' VectorMeasure.AbsolutelyContinuous.mk fun i hi₁ hi₂ => _
    

Proof state:
case pos
α : 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
μ : Measure α
f : α → ℝ
hf : Integrable f
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑(toENNRealVectorMeasure μ) i = 0
⊢ ↑(withDensityᵥ μ f) i = 0

Next tactic:
rw [toENNRealVectorMeasure_apply_measurable hi₁] at hi₂
theorem Measure.withDensityᵥ_absolutelyContinuous (μ : Measure α) (f : α → ℝ) :
    μ.withDensityᵥ f ≪ᵥ μ.toENNRealVectorMeasure := by
  by_cases hf : Integrable f μ
  · refine' VectorMeasure.AbsolutelyContinuous.mk fun i hi₁ hi₂ => _
    rw [toENNRealVectorMeasure_apply_measurable hi₁] at hi₂
    

Proof state:
case pos
α : 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
μ : Measure α
f : α → ℝ
hf : Integrable f
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑↑μ i = 0
⊢ ↑(withDensityᵥ μ f) i = 0

Next tactic:
rw [withDensityᵥ_apply hf hi₁, Measure.restrict_zero_set hi₂, integral_zero_measure]
theorem Measure.withDensityᵥ_absolutelyContinuous (μ : Measure α) (f : α → ℝ) :
    μ.withDensityᵥ f ≪ᵥ μ.toENNRealVectorMeasure := by
  by_cases hf : Integrable f μ
  · refine' VectorMeasure.AbsolutelyContinuous.mk fun i hi₁ hi₂ => _
    rw [toENNRealVectorMeasure_apply_measurable hi₁] at hi₂
    rw [withDensityᵥ_apply hf hi₁, Measure.restrict_zero_set hi₂, integral_zero_measure]
  · 

Proof state:
case neg
α : 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
μ : Measure α
f : α → ℝ
hf : ¬Integrable f
⊢ withDensityᵥ μ f ≪ᵥ toENNRealVectorMeasure μ

Next tactic:
rw [withDensityᵥ, dif_neg hf]
theorem Measure.withDensityᵥ_absolutelyContinuous (μ : Measure α) (f : α → ℝ) :
    μ.withDensityᵥ f ≪ᵥ μ.toENNRealVectorMeasure := by
  by_cases hf : Integrable f μ
  · refine' VectorMeasure.AbsolutelyContinuous.mk fun i hi₁ hi₂ => _
    rw [toENNRealVectorMeasure_apply_measurable hi₁] at hi₂
    rw [withDensityᵥ_apply hf hi₁, Measure.restrict_zero_set hi₂, integral_zero_measure]
  · rw [withDensityᵥ, dif_neg hf]
    

Proof state:
case neg
α : 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
μ : Measure α
f : α → ℝ
hf : ¬Integrable f
⊢ 0 ≪ᵥ toENNRealVectorMeasure μ

Next tactic:
exact VectorMeasure.AbsolutelyContinuous.zero _
/-- Having the same density implies the underlying functions are equal almost everywhere. -/
theorem Integrable.ae_eq_of_withDensityᵥ_eq {f g : α → E} (hf : Integrable f μ)
    (hg : Integrable g μ) (hfg : μ.withDensityᵥ f = μ.withDensityᵥ g) : f =ᵐ[μ] g := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g✝ f g : α → E
hf : Integrable f
hg : Integrable g
hfg : withDensityᵥ μ f = withDensityᵥ μ g
⊢ f =ᶠ[ae μ] g

Next tactic:
refine' hf.ae_eq_of_forall_set_integral_eq f g hg fun i hi _ => _
/-- Having the same density implies the underlying functions are equal almost everywhere. -/
theorem Integrable.ae_eq_of_withDensityᵥ_eq {f g : α → E} (hf : Integrable f μ)
    (hg : Integrable g μ) (hfg : μ.withDensityᵥ f = μ.withDensityᵥ g) : f =ᵐ[μ] g := by
  refine' hf.ae_eq_of_forall_set_integral_eq f g hg fun i hi _ => _
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g✝ f g : α → E
hf : Integrable f
hg : Integrable g
hfg : withDensityᵥ μ f = withDensityᵥ μ g
i : Set α
hi : MeasurableSet i
x✝ : ↑↑μ i < ⊤
⊢ ∫ (x : α) in i, f x ∂μ = ∫ (x : α) in i, g x ∂μ

Next tactic:
rw [← withDensityᵥ_apply hf hi, hfg, withDensityᵥ_apply hg hi]
theorem WithDensityᵥEq.congr_ae {f g : α → E} (h : f =ᵐ[μ] g) :
    μ.withDensityᵥ f = μ.withDensityᵥ g := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g✝ f g : α → E
h : f =ᶠ[ae μ] g
⊢ withDensityᵥ μ f = withDensityᵥ μ g

Next tactic:
by_cases hf : Integrable f μ
theorem WithDensityᵥEq.congr_ae {f g : α → E} (h : f =ᵐ[μ] g) :
    μ.withDensityᵥ f = μ.withDensityᵥ g := by
  by_cases hf : Integrable f μ
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g✝ f g : α → E
h : f =ᶠ[ae μ] g
hf : Integrable f
⊢ withDensityᵥ μ f = withDensityᵥ μ g

Next tactic:
ext i hi
theorem WithDensityᵥEq.congr_ae {f g : α → E} (h : f =ᵐ[μ] g) :
    μ.withDensityᵥ f = μ.withDensityᵥ g := by
  by_cases hf : Integrable f μ
  · ext i hi
    

Proof state:
case pos.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✝ f g : α → E
h : f =ᶠ[ae μ] g
hf : Integrable f
i : Set α
hi : MeasurableSet i
⊢ ↑(withDensityᵥ μ f) i = ↑(withDensityᵥ μ g) i

Next tactic:
rw [withDensityᵥ_apply hf hi, withDensityᵥ_apply (hf.congr h) hi]
theorem WithDensityᵥEq.congr_ae {f g : α → E} (h : f =ᵐ[μ] g) :
    μ.withDensityᵥ f = μ.withDensityᵥ g := by
  by_cases hf : Integrable f μ
  · ext i hi
    rw [withDensityᵥ_apply hf hi, withDensityᵥ_apply (hf.congr h) hi]
    

Proof state:
case pos.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✝ f g : α → E
h : f =ᶠ[ae μ] g
hf : Integrable f
i : Set α
hi : MeasurableSet i
⊢ ∫ (x : α) in i, f x ∂μ = ∫ (x : α) in i, g x ∂μ

Next tactic:
exact integral_congr_ae (ae_restrict_of_ae h)
theorem WithDensityᵥEq.congr_ae {f g : α → E} (h : f =ᵐ[μ] g) :
    μ.withDensityᵥ f = μ.withDensityᵥ g := by
  by_cases hf : Integrable f μ
  · ext i hi
    rw [withDensityᵥ_apply hf hi, withDensityᵥ_apply (hf.congr h) hi]
    exact integral_congr_ae (ae_restrict_of_ae h)
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g✝ f g : α → E
h : f =ᶠ[ae μ] g
hf : ¬Integrable f
⊢ withDensityᵥ μ f = withDensityᵥ μ g

Next tactic:
have hg : ¬Integrable g μ := by intro hg; exact hf (hg.congr h.symm)
theorem WithDensityᵥEq.congr_ae {f g : α → E} (h : f =ᵐ[μ] g) :
    μ.withDensityᵥ f = μ.withDensityᵥ g := by
  by_cases hf : Integrable f μ
  · ext i hi
    rw [withDensityᵥ_apply hf hi, withDensityᵥ_apply (hf.congr h) hi]
    exact integral_congr_ae (ae_restrict_of_ae h)
  · have hg : ¬Integrable g μ := by 

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g✝ f g : α → E
h : f =ᶠ[ae μ] g
hf : ¬Integrable f
⊢ ¬Integrable g

Next tactic:
intro hg
theorem WithDensityᵥEq.congr_ae {f g : α → E} (h : f =ᵐ[μ] g) :
    μ.withDensityᵥ f = μ.withDensityᵥ g := by
  by_cases hf : Integrable f μ
  · ext i hi
    rw [withDensityᵥ_apply hf hi, withDensityᵥ_apply (hf.congr h) hi]
    exact integral_congr_ae (ae_restrict_of_ae h)
  · have hg : ¬Integrable g μ := by intro hg; 

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g✝ f g : α → E
h : f =ᶠ[ae μ] g
hf : ¬Integrable f
hg : Integrable g
⊢ False

Next tactic:
exact hf (hg.congr h.symm)
theorem WithDensityᵥEq.congr_ae {f g : α → E} (h : f =ᵐ[μ] g) :
    μ.withDensityᵥ f = μ.withDensityᵥ g := by
  by_cases hf : Integrable f μ
  · ext i hi
    rw [withDensityᵥ_apply hf hi, withDensityᵥ_apply (hf.congr h) hi]
    exact integral_congr_ae (ae_restrict_of_ae h)
  · have hg : ¬Integrable g μ := by intro hg; exact hf (hg.congr h.symm)
    

Proof state:
case neg
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g✝ f g : α → E
h : f =ᶠ[ae μ] g
hf : ¬Integrable f
hg : ¬Integrable g
⊢ withDensityᵥ μ f = withDensityᵥ μ g

Next tactic:
rw [withDensityᵥ, withDensityᵥ, dif_neg hf, dif_neg hg]
theorem withDensityᵥ_toReal {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) (hf : (∫⁻ x, f x ∂μ) ≠ ∞) :
    (μ.withDensityᵥ fun x => (f x).toReal) =
      @toSignedMeasure α _ (μ.withDensity f) (isFiniteMeasure_withDensity hf) := by
  

Proof state:
α : 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 : α → ℝ≥0∞
hfm : AEMeasurable f
hf : ∫⁻ (x : α), f x ∂μ ≠ ⊤
⊢ (withDensityᵥ μ fun x => ENNReal.toReal (f x)) = toSignedMeasure (withDensity μ f)

Next tactic:
have hfi := integrable_toReal_of_lintegral_ne_top hfm hf
theorem withDensityᵥ_toReal {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) (hf : (∫⁻ x, f x ∂μ) ≠ ∞) :
    (μ.withDensityᵥ fun x => (f x).toReal) =
      @toSignedMeasure α _ (μ.withDensity f) (isFiniteMeasure_withDensity hf) := by
  have hfi := integrable_toReal_of_lintegral_ne_top hfm hf
  

Proof state:
α : 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 : α → ℝ≥0∞
hfm : AEMeasurable f
hf : ∫⁻ (x : α), f x ∂μ ≠ ⊤
hfi : Integrable fun x => ENNReal.toReal (f x)
⊢ (withDensityᵥ μ fun x => ENNReal.toReal (f x)) = toSignedMeasure (withDensity μ f)

Next tactic:
haveI := isFiniteMeasure_withDensity hf
theorem withDensityᵥ_toReal {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) (hf : (∫⁻ x, f x ∂μ) ≠ ∞) :
    (μ.withDensityᵥ fun x => (f x).toReal) =
      @toSignedMeasure α _ (μ.withDensity f) (isFiniteMeasure_withDensity hf) := by
  have hfi := integrable_toReal_of_lintegral_ne_top hfm hf
  haveI := isFiniteMeasure_withDensity hf
  

Proof state:
α : 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 : α → ℝ≥0∞
hfm : AEMeasurable f
hf : ∫⁻ (x : α), f x ∂μ ≠ ⊤
hfi : Integrable fun x => ENNReal.toReal (f x)
this : IsFiniteMeasure (withDensity μ fun a => f a)
⊢ (withDensityᵥ μ fun x => ENNReal.toReal (f x)) = toSignedMeasure (withDensity μ f)

Next tactic:
ext i hi
theorem withDensityᵥ_toReal {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) (hf : (∫⁻ x, f x ∂μ) ≠ ∞) :
    (μ.withDensityᵥ fun x => (f x).toReal) =
      @toSignedMeasure α _ (μ.withDensity f) (isFiniteMeasure_withDensity hf) := by
  have hfi := integrable_toReal_of_lintegral_ne_top hfm hf
  haveI := isFiniteMeasure_withDensity hf
  ext i hi
  

Proof state:
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 : α → ℝ≥0∞
hfm : AEMeasurable f
hf : ∫⁻ (x : α), f x ∂μ ≠ ⊤
hfi : Integrable fun x => ENNReal.toReal (f x)
this : IsFiniteMeasure (withDensity μ fun a => f a)
i : Set α
hi : MeasurableSet i
⊢ ↑(withDensityᵥ μ fun x => ENNReal.toReal (f x)) i = ↑(toSignedMeasure (withDensity μ f)) i

Next tactic:
rw [withDensityᵥ_apply hfi hi, toSignedMeasure_apply_measurable hi, withDensity_apply _ hi,
    integral_toReal hfm.restrict]
theorem withDensityᵥ_toReal {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) (hf : (∫⁻ x, f x ∂μ) ≠ ∞) :
    (μ.withDensityᵥ fun x => (f x).toReal) =
      @toSignedMeasure α _ (μ.withDensity f) (isFiniteMeasure_withDensity hf) := by
  have hfi := integrable_toReal_of_lintegral_ne_top hfm hf
  haveI := isFiniteMeasure_withDensity hf
  ext i hi
  rw [withDensityᵥ_apply hfi hi, toSignedMeasure_apply_measurable hi, withDensity_apply _ hi,
    integral_toReal hfm.restrict]
  

Proof state:
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 : α → ℝ≥0∞
hfm : AEMeasurable f
hf : ∫⁻ (x : α), f x ∂μ ≠ ⊤
hfi : Integrable fun x => ENNReal.toReal (f x)
this : IsFiniteMeasure (withDensity μ fun a => f a)
i : Set α
hi : MeasurableSet i
⊢ ∀ᵐ (x : α) ∂restrict μ i, f x < ⊤

Next tactic:
refine' ae_lt_top' hfm.restrict (ne_top_of_le_ne_top hf _)
theorem withDensityᵥ_toReal {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) (hf : (∫⁻ x, f x ∂μ) ≠ ∞) :
    (μ.withDensityᵥ fun x => (f x).toReal) =
      @toSignedMeasure α _ (μ.withDensity f) (isFiniteMeasure_withDensity hf) := by
  have hfi := integrable_toReal_of_lintegral_ne_top hfm hf
  haveI := isFiniteMeasure_withDensity hf
  ext i hi
  rw [withDensityᵥ_apply hfi hi, toSignedMeasure_apply_measurable hi, withDensity_apply _ hi,
    integral_toReal hfm.restrict]
  refine' ae_lt_top' hfm.restrict (ne_top_of_le_ne_top hf _)
  

Proof state:
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 : α → ℝ≥0∞
hfm : AEMeasurable f
hf : ∫⁻ (x : α), f x ∂μ ≠ ⊤
hfi : Integrable fun x => ENNReal.toReal (f x)
this : IsFiniteMeasure (withDensity μ fun a => f a)
i : Set α
hi : MeasurableSet i
⊢ ∫⁻ (x : α) in i, f x ∂μ ≤ ∫⁻ (x : α), f x ∂μ

Next tactic:
conv_rhs => rw [← set_lintegral_univ]
theorem withDensityᵥ_toReal {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) (hf : (∫⁻ x, f x ∂μ) ≠ ∞) :
    (μ.withDensityᵥ fun x => (f x).toReal) =
      @toSignedMeasure α _ (μ.withDensity f) (isFiniteMeasure_withDensity hf) := by
  have hfi := integrable_toReal_of_lintegral_ne_top hfm hf
  haveI := isFiniteMeasure_withDensity hf
  ext i hi
  rw [withDensityᵥ_apply hfi hi, toSignedMeasure_apply_measurable hi, withDensity_apply _ hi,
    integral_toReal hfm.restrict]
  refine' ae_lt_top' hfm.restrict (ne_top_of_le_ne_top hf _)
  conv_rhs => 

Proof state:
α : 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 : α → ℝ≥0∞
hfm : AEMeasurable f
hf : ∫⁻ (x : α), f x ∂μ ≠ ⊤
hfi : Integrable fun x => ENNReal.toReal (f x)
this : IsFiniteMeasure (withDensity μ fun a => f a)
i : Set α
hi : MeasurableSet i
| ∫⁻ (x : α), f x ∂μ

Next tactic:
rw [← set_lintegral_univ]