l3lab/ntp-mathlib huggingface dataset:
private theorem haveLebesgueDecomposition_mk' (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff] at htμ
  change _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) at htμ
  rw [VectorMeasure.equivMeasure.right_inv, totalVariation_mutuallySingular_iff] at htμ
  refine'
    { posPart := by
        

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν : Measure α
s t : SignedMeasure α
μ : Measure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
⊢ Measure.HaveLebesgueDecomposition (toJordanDecomposition s).posPart μ

Next tactic:
use ⟨t.toJordanDecomposition.posPart, fun x => ENNReal.ofReal (f x)⟩
private theorem haveLebesgueDecomposition_mk' (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff] at htμ
  change _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) at htμ
  rw [VectorMeasure.equivMeasure.right_inv, totalVariation_mutuallySingular_iff] at htμ
  refine'
    { posPart := by
        use ⟨t.toJordanDecomposition.posPart, fun x => ENNReal.ofReal (f x)⟩
        

Proof state:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν : Measure α
s t : SignedMeasure α
μ : Measure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
⊢ Measurable ((toJordanDecomposition t).posPart, fun x => ENNReal.ofReal (f x)).2 ∧
    ((toJordanDecomposition t).posPart, fun x => ENNReal.ofReal (f x)).1 ⟂ₘ μ ∧
      (toJordanDecomposition s).posPart =
        ((toJordanDecomposition t).posPart, fun x => ENNReal.ofReal (f x)).1 +
          withDensity μ ((toJordanDecomposition t).posPart, fun x => ENNReal.ofReal (f x)).2

Next tactic:
refine' ⟨hf.ennreal_ofReal, htμ.1, _⟩
private theorem haveLebesgueDecomposition_mk' (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff] at htμ
  change _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) at htμ
  rw [VectorMeasure.equivMeasure.right_inv, totalVariation_mutuallySingular_iff] at htμ
  refine'
    { posPart := by
        use ⟨t.toJordanDecomposition.posPart, fun x => ENNReal.ofReal (f x)⟩
        refine' ⟨hf.ennreal_ofReal, htμ.1, _⟩
        

Proof state:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν : Measure α
s t : SignedMeasure α
μ : Measure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
⊢ (toJordanDecomposition s).posPart =
    ((toJordanDecomposition t).posPart, fun x => ENNReal.ofReal (f x)).1 +
      withDensity μ ((toJordanDecomposition t).posPart, fun x => ENNReal.ofReal (f x)).2

Next tactic:
rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
private theorem haveLebesgueDecomposition_mk' (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff] at htμ
  change _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) at htμ
  rw [VectorMeasure.equivMeasure.right_inv, totalVariation_mutuallySingular_iff] at htμ
  refine'
    { posPart := by
        use ⟨t.toJordanDecomposition.posPart, fun x => ENNReal.ofReal (f x)⟩
        refine' ⟨hf.ennreal_ofReal, htμ.1, _⟩
        rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
      negPart := by
        

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν : Measure α
s t : SignedMeasure α
μ : Measure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
⊢ Measure.HaveLebesgueDecomposition (toJordanDecomposition s).negPart μ

Next tactic:
use ⟨t.toJordanDecomposition.negPart, fun x => ENNReal.ofReal (-f x)⟩
private theorem haveLebesgueDecomposition_mk' (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff] at htμ
  change _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) at htμ
  rw [VectorMeasure.equivMeasure.right_inv, totalVariation_mutuallySingular_iff] at htμ
  refine'
    { posPart := by
        use ⟨t.toJordanDecomposition.posPart, fun x => ENNReal.ofReal (f x)⟩
        refine' ⟨hf.ennreal_ofReal, htμ.1, _⟩
        rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
      negPart := by
        use ⟨t.toJordanDecomposition.negPart, fun x => ENNReal.ofReal (-f x)⟩
        

Proof state:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν : Measure α
s t : SignedMeasure α
μ : Measure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
⊢ Measurable ((toJordanDecomposition t).negPart, fun x => ENNReal.ofReal (-f x)).2 ∧
    ((toJordanDecomposition t).negPart, fun x => ENNReal.ofReal (-f x)).1 ⟂ₘ μ ∧
      (toJordanDecomposition s).negPart =
        ((toJordanDecomposition t).negPart, fun x => ENNReal.ofReal (-f x)).1 +
          withDensity μ ((toJordanDecomposition t).negPart, fun x => ENNReal.ofReal (-f x)).2

Next tactic:
refine' ⟨hf.neg.ennreal_ofReal, htμ.2, _⟩
private theorem haveLebesgueDecomposition_mk' (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff] at htμ
  change _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) at htμ
  rw [VectorMeasure.equivMeasure.right_inv, totalVariation_mutuallySingular_iff] at htμ
  refine'
    { posPart := by
        use ⟨t.toJordanDecomposition.posPart, fun x => ENNReal.ofReal (f x)⟩
        refine' ⟨hf.ennreal_ofReal, htμ.1, _⟩
        rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
      negPart := by
        use ⟨t.toJordanDecomposition.negPart, fun x => ENNReal.ofReal (-f x)⟩
        refine' ⟨hf.neg.ennreal_ofReal, htμ.2, _⟩
        

Proof state:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν : Measure α
s t : SignedMeasure α
μ : Measure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
⊢ (toJordanDecomposition s).negPart =
    ((toJordanDecomposition t).negPart, fun x => ENNReal.ofReal (-f x)).1 +
      withDensity μ ((toJordanDecomposition t).negPart, fun x => ENNReal.ofReal (-f x)).2

Next tactic:
rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν : Measure α
s t : SignedMeasure α
μ : Measure α
f : α → ℝ
hf : Measurable f
htμ : t ⟂ᵥ toENNRealVectorMeasure μ
hadd : s = t + withDensityᵥ μ f
⊢ HaveLebesgueDecomposition s μ

Next tactic:
by_cases hfi : Integrable f μ
theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ := by
  by_cases hfi : Integrable f μ
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν : Measure α
s t : SignedMeasure α
μ : Measure α
f : α → ℝ
hf : Measurable f
htμ : t ⟂ᵥ toENNRealVectorMeasure μ
hadd : s = t + withDensityᵥ μ f
hfi : Integrable f
⊢ HaveLebesgueDecomposition s μ

Next tactic:
exact haveLebesgueDecomposition_mk' μ hf hfi htμ hadd
theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ := by
  by_cases hfi : Integrable f μ
  · exact haveLebesgueDecomposition_mk' μ hf hfi htμ hadd
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν : Measure α
s t : SignedMeasure α
μ : Measure α
f : α → ℝ
hf : Measurable f
htμ : t ⟂ᵥ toENNRealVectorMeasure μ
hadd : s = t + withDensityᵥ μ f
hfi : ¬Integrable f
⊢ HaveLebesgueDecomposition s μ

Next tactic:
rw [withDensityᵥ, dif_neg hfi, add_zero] at hadd
theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ := by
  by_cases hfi : Integrable f μ
  · exact haveLebesgueDecomposition_mk' μ hf hfi htμ hadd
  · rw [withDensityᵥ, dif_neg hfi, add_zero] at hadd
    

Proof state:
case neg
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν : Measure α
s t : SignedMeasure α
μ : Measure α
f : α → ℝ
hf : Measurable f
htμ : t ⟂ᵥ toENNRealVectorMeasure μ
hadd : s = t
hfi : ¬Integrable f
⊢ HaveLebesgueDecomposition s μ

Next tactic:
refine' haveLebesgueDecomposition_mk' μ measurable_zero (integrable_zero _ _ μ) htμ _
theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ := by
  by_cases hfi : Integrable f μ
  · exact haveLebesgueDecomposition_mk' μ hf hfi htμ hadd
  · rw [withDensityᵥ, dif_neg hfi, add_zero] at hadd
    refine' haveLebesgueDecomposition_mk' μ measurable_zero (integrable_zero _ _ μ) htμ _
    

Proof state:
case neg
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν : Measure α
s t : SignedMeasure α
μ : Measure α
f : α → ℝ
hf : Measurable f
htμ : t ⟂ᵥ toENNRealVectorMeasure μ
hadd : s = t
hfi : ¬Integrable f
⊢ s = t + withDensityᵥ μ 0

Next tactic:
rwa [withDensityᵥ_zero, add_zero]
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : t ⟂ᵥ toENNRealVectorMeasure μ
hadd : s = t + withDensityᵥ μ f
⊢ t = singularPart s μ

Next tactic:
have htμ' := htμ
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  have htμ' := htμ
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : t ⟂ᵥ toENNRealVectorMeasure μ
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
⊢ t = singularPart s μ

Next tactic:
rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
    VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
    VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
⊢ t = singularPart s μ

Next tactic:
rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
    JordanDecomposition.toSignedMeasure]
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
    VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
  rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
    JordanDecomposition.toSignedMeasure]
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
⊢ toSignedMeasure (toJordanDecomposition t).posPart - toSignedMeasure (toJordanDecomposition t).negPart =
    toSignedMeasure (Measure.singularPart (toJordanDecomposition s).posPart μ) -
      toSignedMeasure (Measure.singularPart (toJordanDecomposition s).negPart μ)

Next tactic:
congr
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
    VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
  rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
    JordanDecomposition.toSignedMeasure]
  congr
  · 

Proof state:
case e_a.e_μ
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
⊢ (toJordanDecomposition t).posPart = Measure.singularPart (toJordanDecomposition s).posPart μ

Next tactic:
have hfpos : Measurable fun x => ENNReal.ofReal (f x) := by measurability
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
    VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
  rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
    JordanDecomposition.toSignedMeasure]
  congr
  · have hfpos : Measurable fun x => ENNReal.ofReal (f x) := by 

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
⊢ Measurable fun x => ENNReal.ofReal (f x)

Next tactic:
measurability
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
    VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
  rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
    JordanDecomposition.toSignedMeasure]
  congr
  · have hfpos : Measurable fun x => ENNReal.ofReal (f x) := by measurability
    

Proof state:
case e_a.e_μ
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
hfpos : Measurable fun x => ENNReal.ofReal (f x)
⊢ (toJordanDecomposition t).posPart = Measure.singularPart (toJordanDecomposition s).posPart μ

Next tactic:
refine' eq_singularPart hfpos htμ.1 _
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
    VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
  rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
    JordanDecomposition.toSignedMeasure]
  congr
  · have hfpos : Measurable fun x => ENNReal.ofReal (f x) := by measurability
    refine' eq_singularPart hfpos htμ.1 _
    

Proof state:
case e_a.e_μ
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
hfpos : Measurable fun x => ENNReal.ofReal (f x)
⊢ (toJordanDecomposition s).posPart = (toJordanDecomposition t).posPart + withDensity μ fun x => ENNReal.ofReal (f x)

Next tactic:
rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
    VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
  rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
    JordanDecomposition.toSignedMeasure]
  congr
  · have hfpos : Measurable fun x => ENNReal.ofReal (f x) := by measurability
    refine' eq_singularPart hfpos htμ.1 _
    rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
  · 

Proof state:
case e_a.e_μ
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
⊢ (toJordanDecomposition t).negPart = Measure.singularPart (toJordanDecomposition s).negPart μ

Next tactic:
have hfneg : Measurable fun x => ENNReal.ofReal (-f x) := by measurability
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
    VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
  rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
    JordanDecomposition.toSignedMeasure]
  congr
  · have hfpos : Measurable fun x => ENNReal.ofReal (f x) := by measurability
    refine' eq_singularPart hfpos htμ.1 _
    rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
  · have hfneg : Measurable fun x => ENNReal.ofReal (-f x) := by 

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
⊢ Measurable fun x => ENNReal.ofReal (-f x)

Next tactic:
measurability
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
    VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
  rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
    JordanDecomposition.toSignedMeasure]
  congr
  · have hfpos : Measurable fun x => ENNReal.ofReal (f x) := by measurability
    refine' eq_singularPart hfpos htμ.1 _
    rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
  · have hfneg : Measurable fun x => ENNReal.ofReal (-f x) := by measurability
    

Proof state:
case e_a.e_μ
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
hfneg : Measurable fun x => ENNReal.ofReal (-f x)
⊢ (toJordanDecomposition t).negPart = Measure.singularPart (toJordanDecomposition s).negPart μ

Next tactic:
refine' eq_singularPart hfneg htμ.2 _
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    t = s.singularPart μ := by
  have htμ' := htμ
  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
    VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
  rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
    JordanDecomposition.toSignedMeasure]
  congr
  · have hfpos : Measurable fun x => ENNReal.ofReal (f x) := by measurability
    refine' eq_singularPart hfpos htμ.1 _
    rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
  · have hfneg : Measurable fun x => ENNReal.ofReal (-f x) := by measurability
    refine' eq_singularPart hfneg htμ.2 _
    

Proof state:
case e_a.e_μ
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
hf : Measurable f
hfi : Integrable f
htμ : (toJordanDecomposition t).posPart ⟂ₘ μ ∧ (toJordanDecomposition t).negPart ⟂ₘ μ
hadd : s = t + withDensityᵥ μ f
htμ' : t ⟂ᵥ toENNRealVectorMeasure μ
hfneg : Measurable fun x => ENNReal.ofReal (-f x)
⊢ (toJordanDecomposition s).negPart = (toJordanDecomposition t).negPart + withDensity μ fun x => ENNReal.ofReal (-f x)

Next tactic:
rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
/-- Given a measure `μ`, signed measures `s` and `t`, and a function `f` such that `t` is
mutually singular with respect to `μ` and `s = t + μ.withDensityᵥ f`, we have
`t = singularPart s μ`, i.e. `t` is the singular part of the Lebesgue decomposition between
`s` and `μ`. -/
theorem eq_singularPart (t : SignedMeasure α) (f : α → ℝ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure)
    (hadd : s = t + μ.withDensityᵥ f) : t = s.singularPart μ := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
s t✝ t : SignedMeasure α
f : α → ℝ
htμ : t ⟂ᵥ toENNRealVectorMeasure μ
hadd : s = t + withDensityᵥ μ f
⊢ t = singularPart s μ

Next tactic:
by_cases hfi : Integrable f μ