l3lab/ntp-mathlib huggingface dataset:
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν : μ ≪ ν) (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  let t := hνν'.nullSet
  have ht : MeasurableSet t := hνν'.measurableSet_nullSet
  refine ae_of_ae_restrict_of_ae_restrict_compl t (by simp) ?_
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν : μ ≪ ν
hνν' : ν ⟂ₘ ν'
t : Set α := MutuallySingular.nullSet hνν'
ht : MeasurableSet t
⊢ ∀ᵐ (x : α) ∂restrict ν tᶜ, rnDeriv μ (ν + ν') x = rnDeriv μ ν x

Next tactic:
change μ.rnDeriv (ν + ν') =ᵐ[ν.restrict tᶜ] μ.rnDeriv ν
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν : μ ≪ ν) (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  let t := hνν'.nullSet
  have ht : MeasurableSet t := hνν'.measurableSet_nullSet
  refine ae_of_ae_restrict_of_ae_restrict_compl t (by simp) ?_
  change μ.rnDeriv (ν + ν') =ᵐ[ν.restrict tᶜ] μ.rnDeriv ν
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν : μ ≪ ν
hνν' : ν ⟂ₘ ν'
t : Set α := MutuallySingular.nullSet hνν'
ht : MeasurableSet t
⊢ rnDeriv μ (ν + ν') =ᶠ[ae (restrict ν tᶜ)] rnDeriv μ ν

Next tactic:
rw [← withDensity_eq_iff_of_sigmaFinite (μ := ν.restrict tᶜ)
    (Measure.measurable_rnDeriv _ _).aemeasurable (Measure.measurable_rnDeriv _ _).aemeasurable]
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν : μ ≪ ν) (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  let t := hνν'.nullSet
  have ht : MeasurableSet t := hνν'.measurableSet_nullSet
  refine ae_of_ae_restrict_of_ae_restrict_compl t (by simp) ?_
  change μ.rnDeriv (ν + ν') =ᵐ[ν.restrict tᶜ] μ.rnDeriv ν
  rw [← withDensity_eq_iff_of_sigmaFinite (μ := ν.restrict tᶜ)
    (Measure.measurable_rnDeriv _ _).aemeasurable (Measure.measurable_rnDeriv _ _).aemeasurable]
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν : μ ≪ ν
hνν' : ν ⟂ₘ ν'
t : Set α := MutuallySingular.nullSet hνν'
ht : MeasurableSet t
⊢ withDensity (restrict ν tᶜ) (rnDeriv μ (ν + ν')) = withDensity (restrict ν tᶜ) (rnDeriv μ ν)

Next tactic:
have : (ν.restrict tᶜ).withDensity (μ.rnDeriv (ν + ν'))
      = ((ν + ν').restrict tᶜ).withDensity (μ.rnDeriv (ν + ν')) := by simp
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν : μ ≪ ν) (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  let t := hνν'.nullSet
  have ht : MeasurableSet t := hνν'.measurableSet_nullSet
  refine ae_of_ae_restrict_of_ae_restrict_compl t (by simp) ?_
  change μ.rnDeriv (ν + ν') =ᵐ[ν.restrict tᶜ] μ.rnDeriv ν
  rw [← withDensity_eq_iff_of_sigmaFinite (μ := ν.restrict tᶜ)
    (Measure.measurable_rnDeriv _ _).aemeasurable (Measure.measurable_rnDeriv _ _).aemeasurable]
  have : (ν.restrict tᶜ).withDensity (μ.rnDeriv (ν + ν'))
      = ((ν + ν').restrict tᶜ).withDensity (μ.rnDeriv (ν + ν')) := by 

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν : μ ≪ ν
hνν' : ν ⟂ₘ ν'
t : Set α := MutuallySingular.nullSet hνν'
ht : MeasurableSet t
⊢ withDensity (restrict ν tᶜ) (rnDeriv μ (ν + ν')) = withDensity (restrict (ν + ν') tᶜ) (rnDeriv μ (ν + ν'))

Next tactic:
simp
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν : μ ≪ ν) (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  let t := hνν'.nullSet
  have ht : MeasurableSet t := hνν'.measurableSet_nullSet
  refine ae_of_ae_restrict_of_ae_restrict_compl t (by simp) ?_
  change μ.rnDeriv (ν + ν') =ᵐ[ν.restrict tᶜ] μ.rnDeriv ν
  rw [← withDensity_eq_iff_of_sigmaFinite (μ := ν.restrict tᶜ)
    (Measure.measurable_rnDeriv _ _).aemeasurable (Measure.measurable_rnDeriv _ _).aemeasurable]
  have : (ν.restrict tᶜ).withDensity (μ.rnDeriv (ν + ν'))
      = ((ν + ν').restrict tᶜ).withDensity (μ.rnDeriv (ν + ν')) := by simp
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν : μ ≪ ν
hνν' : ν ⟂ₘ ν'
t : Set α := MutuallySingular.nullSet hνν'
ht : MeasurableSet t
this : withDensity (restrict ν tᶜ) (rnDeriv μ (ν + ν')) = withDensity (restrict (ν + ν') tᶜ) (rnDeriv μ (ν + ν'))
⊢ withDensity (restrict ν tᶜ) (rnDeriv μ (ν + ν')) = withDensity (restrict ν tᶜ) (rnDeriv μ ν)

Next tactic:
rw [this, ← restrict_withDensity ht.compl, ← restrict_withDensity ht.compl,
      Measure.withDensity_rnDeriv_eq _ _ (hμν.add_right ν'), Measure.withDensity_rnDeriv_eq _ _ hμν]
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
⊢ rnDeriv μ (ν + ν') =ᶠ[ae ν] rnDeriv μ ν

Next tactic:
have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
⊢ rnDeriv μ (ν + ν') =ᶠ[ae ν] rnDeriv μ ν

Next tactic:
rw [haveLebesgueDecomposition_add μ ν]
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  rw [haveLebesgueDecomposition_add μ ν]
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
⊢ rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae ν]
    rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν

Next tactic:
have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  rw [haveLebesgueDecomposition_add μ ν]
  have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
h₁ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae (ν + ν')]
    rnDeriv (singularPart μ ν) (ν + ν') + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν')
⊢ rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae ν]
    rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν

Next tactic:
have h₂ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) ν
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  rw [haveLebesgueDecomposition_add μ ν]
  have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
  have h₂ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) ν
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
h₁ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae (ν + ν')]
    rnDeriv (singularPart μ ν) (ν + ν') + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν')
h₂ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν
⊢ rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae ν]
    rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν

Next tactic:
refine (Filter.EventuallyEq.trans (h_ac.ae_le h₁) ?_).trans h₂.symm
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  rw [haveLebesgueDecomposition_add μ ν]
  have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
  have h₂ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) ν
  refine (Filter.EventuallyEq.trans (h_ac.ae_le h₁) ?_).trans h₂.symm
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
h₁ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae (ν + ν')]
    rnDeriv (singularPart μ ν) (ν + ν') + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν')
h₂ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν
⊢ (fun x => (rnDeriv (singularPart μ ν) (ν + ν') + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν')) x) =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν

Next tactic:
simp only [Pi.add_apply]
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  rw [haveLebesgueDecomposition_add μ ν]
  have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
  have h₂ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) ν
  refine (Filter.EventuallyEq.trans (h_ac.ae_le h₁) ?_).trans h₂.symm
  simp only [Pi.add_apply]
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
h₁ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae (ν + ν')]
    rnDeriv (singularPart μ ν) (ν + ν') + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν')
h₂ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν
⊢ (fun x => rnDeriv (singularPart μ ν) (ν + ν') x + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') x) =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν

Next tactic:
have h₃ := rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular
    (withDensity_absolutelyContinuous ν (μ.rnDeriv ν)) hνν'
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  rw [haveLebesgueDecomposition_add μ ν]
  have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
  have h₂ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) ν
  refine (Filter.EventuallyEq.trans (h_ac.ae_le h₁) ?_).trans h₂.symm
  simp only [Pi.add_apply]
  have h₃ := rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular
    (withDensity_absolutelyContinuous ν (μ.rnDeriv ν)) hνν'
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
h₁ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae (ν + ν')]
    rnDeriv (singularPart μ ν) (ν + ν') + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν')
h₂ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν
h₃ : rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae ν] rnDeriv (withDensity ν (rnDeriv μ ν)) ν
⊢ (fun x => rnDeriv (singularPart μ ν) (ν + ν') x + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') x) =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν

Next tactic:
have h₄ : (μ.singularPart ν).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine h_ac.ae_eq ?_
    simp only [rnDeriv_eq_zero, MutuallySingular.add_right_iff]
    exact ⟨mutuallySingular_singularPart μ ν, hμν'.singularPart ν⟩
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  rw [haveLebesgueDecomposition_add μ ν]
  have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
  have h₂ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) ν
  refine (Filter.EventuallyEq.trans (h_ac.ae_le h₁) ?_).trans h₂.symm
  simp only [Pi.add_apply]
  have h₃ := rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular
    (withDensity_absolutelyContinuous ν (μ.rnDeriv ν)) hνν'
  have h₄ : (μ.singularPart ν).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
h₁ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae (ν + ν')]
    rnDeriv (singularPart μ ν) (ν + ν') + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν')
h₂ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν
h₃ : rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae ν] rnDeriv (withDensity ν (rnDeriv μ ν)) ν
⊢ rnDeriv (singularPart μ ν) (ν + ν') =ᶠ[ae ν] 0

Next tactic:
refine h_ac.ae_eq ?_
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  rw [haveLebesgueDecomposition_add μ ν]
  have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
  have h₂ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) ν
  refine (Filter.EventuallyEq.trans (h_ac.ae_le h₁) ?_).trans h₂.symm
  simp only [Pi.add_apply]
  have h₃ := rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular
    (withDensity_absolutelyContinuous ν (μ.rnDeriv ν)) hνν'
  have h₄ : (μ.singularPart ν).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine h_ac.ae_eq ?_
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
h₁ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae (ν + ν')]
    rnDeriv (singularPart μ ν) (ν + ν') + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν')
h₂ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν
h₃ : rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae ν] rnDeriv (withDensity ν (rnDeriv μ ν)) ν
⊢ rnDeriv (singularPart μ ν) (ν + ν') =ᶠ[ae (ν + ν')] 0

Next tactic:
simp only [rnDeriv_eq_zero, MutuallySingular.add_right_iff]
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  rw [haveLebesgueDecomposition_add μ ν]
  have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
  have h₂ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) ν
  refine (Filter.EventuallyEq.trans (h_ac.ae_le h₁) ?_).trans h₂.symm
  simp only [Pi.add_apply]
  have h₃ := rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular
    (withDensity_absolutelyContinuous ν (μ.rnDeriv ν)) hνν'
  have h₄ : (μ.singularPart ν).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine h_ac.ae_eq ?_
    simp only [rnDeriv_eq_zero, MutuallySingular.add_right_iff]
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
h₁ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae (ν + ν')]
    rnDeriv (singularPart μ ν) (ν + ν') + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν')
h₂ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν
h₃ : rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae ν] rnDeriv (withDensity ν (rnDeriv μ ν)) ν
⊢ singularPart μ ν ⟂ₘ ν ∧ singularPart μ ν ⟂ₘ ν'

Next tactic:
exact ⟨mutuallySingular_singularPart μ ν, hμν'.singularPart ν⟩
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  rw [haveLebesgueDecomposition_add μ ν]
  have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
  have h₂ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) ν
  refine (Filter.EventuallyEq.trans (h_ac.ae_le h₁) ?_).trans h₂.symm
  simp only [Pi.add_apply]
  have h₃ := rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular
    (withDensity_absolutelyContinuous ν (μ.rnDeriv ν)) hνν'
  have h₄ : (μ.singularPart ν).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine h_ac.ae_eq ?_
    simp only [rnDeriv_eq_zero, MutuallySingular.add_right_iff]
    exact ⟨mutuallySingular_singularPart μ ν, hμν'.singularPart ν⟩
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
h₁ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae (ν + ν')]
    rnDeriv (singularPart μ ν) (ν + ν') + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν')
h₂ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν
h₃ : rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae ν] rnDeriv (withDensity ν (rnDeriv μ ν)) ν
h₄ : rnDeriv (singularPart μ ν) (ν + ν') =ᶠ[ae ν] 0
⊢ (fun x => rnDeriv (singularPart μ ν) (ν + ν') x + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') x) =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν

Next tactic:
have h₅ : (μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := rnDeriv_singularPart μ ν
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
  rw [haveLebesgueDecomposition_add μ ν]
  have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
  have h₂ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) ν
  refine (Filter.EventuallyEq.trans (h_ac.ae_le h₁) ?_).trans h₂.symm
  simp only [Pi.add_apply]
  have h₃ := rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular
    (withDensity_absolutelyContinuous ν (μ.rnDeriv ν)) hνν'
  have h₄ : (μ.singularPart ν).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine h_ac.ae_eq ?_
    simp only [rnDeriv_eq_zero, MutuallySingular.add_right_iff]
    exact ⟨mutuallySingular_singularPart μ ν, hμν'.singularPart ν⟩
  have h₅ : (μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := rnDeriv_singularPart μ ν
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
hμν' : μ ⟂ₘ ν'
hνν' : ν ⟂ₘ ν'
h_ac : ν ≪ ν + ν'
h₁ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae (ν + ν')]
    rnDeriv (singularPart μ ν) (ν + ν') + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν')
h₂ :
  rnDeriv (singularPart μ ν + withDensity ν (rnDeriv μ ν)) ν =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν
h₃ : rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') =ᶠ[ae ν] rnDeriv (withDensity ν (rnDeriv μ ν)) ν
h₄ : rnDeriv (singularPart μ ν) (ν + ν') =ᶠ[ae ν] 0
h₅ : rnDeriv (singularPart μ ν) ν =ᶠ[ae ν] 0
⊢ (fun x => rnDeriv (singularPart μ ν) (ν + ν') x + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') x) =ᶠ[ae ν]
    rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν

Next tactic:
filter_upwards [h₃, h₄, h₅] with x hx₃ hx₄ hx₅