l3lab/ntp-mathlib huggingface dataset:
/-- 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 μ ν
  filter_upwards [h₃, h₄, h₅] with x hx₃ hx₄ hx₅
  

Proof state:
case h
α : 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
x : α
hx₃ : rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') x = rnDeriv (withDensity ν (rnDeriv μ ν)) ν x
hx₄ : rnDeriv (singularPart μ ν) (ν + ν') x = OfNat.ofNat 0 x
hx₅ : rnDeriv (singularPart μ ν) ν x = OfNat.ofNat 0 x
⊢ rnDeriv (singularPart μ ν) (ν + ν') x + rnDeriv (withDensity ν (rnDeriv μ ν)) (ν + ν') x =
    (rnDeriv (singularPart μ ν) ν + rnDeriv (withDensity ν (rnDeriv μ ν)) ν) x

Next tactic:
rw [hx₃, hx₄, Pi.add_apply, hx₅]
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
  

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

Next tactic:
have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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_ac : ν ≪ ν + ν'
⊢ rnDeriv μ (ν + ν') =ᶠ[ae ν] rnDeriv μ ν

Next tactic:
rw [haveLebesgueDecomposition_add μ ν']
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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_ac : ν ≪ ν + ν'
⊢ rnDeriv (singularPart μ ν' + withDensity ν' (rnDeriv μ ν')) (ν + ν') =ᶠ[ae ν]
    rnDeriv (singularPart μ ν' + withDensity ν' (rnDeriv μ ν')) ν

Next tactic:
have h₁ := rnDeriv_add' (μ.singularPart ν') (ν'.withDensity (μ.rnDeriv ν')) (ν + ν')
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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_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 ν')) ν
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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_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
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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_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:
have h₃ := rnDeriv_add_right_of_mutuallySingular' (?_ : μ.singularPart ν' ⟂ₘ ν') hνν'
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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
  have h₃ := rnDeriv_add_right_of_mutuallySingular' (?_ : μ.singularPart ν' ⟂ₘ ν') hνν'
  

Proof state:
case refine_2
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 (singularPart μ ν') (ν + ν') =ᶠ[ae ν] rnDeriv (singularPart μ ν') ν
⊢ (fun x => (rnDeriv (singularPart μ ν') (ν + ν') + rnDeriv (withDensity ν' (rnDeriv μ ν')) (ν + ν')) x) =ᶠ[ae ν]
    rnDeriv (singularPart μ ν') ν + rnDeriv (withDensity ν' (rnDeriv μ ν')) ν
case refine_1
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 μ ν')) ν
⊢ singularPart μ ν' ⟂ₘ ν'

Next tactic:
have h₄ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine rnDeriv_eq_zero_of_mutuallySingular ?_ h_ac
    exact hνν'.symm.withDensity
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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
  have h₃ := rnDeriv_add_right_of_mutuallySingular' (?_ : μ.singularPart ν' ⟂ₘ ν') hνν'
  have h₄ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 (singularPart μ ν') (ν + ν') =ᶠ[ae ν] rnDeriv (singularPart μ ν') ν
⊢ rnDeriv (withDensity ν' (rnDeriv μ ν')) (ν + ν') =ᶠ[ae ν] 0

Next tactic:
refine rnDeriv_eq_zero_of_mutuallySingular ?_ h_ac
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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
  have h₃ := rnDeriv_add_right_of_mutuallySingular' (?_ : μ.singularPart ν' ⟂ₘ ν') hνν'
  have h₄ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine rnDeriv_eq_zero_of_mutuallySingular ?_ h_ac
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 (singularPart μ ν') (ν + ν') =ᶠ[ae ν] rnDeriv (singularPart μ ν') ν
⊢ withDensity ν' (rnDeriv μ ν') ⟂ₘ ν

Next tactic:
exact hνν'.symm.withDensity
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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
  have h₃ := rnDeriv_add_right_of_mutuallySingular' (?_ : μ.singularPart ν' ⟂ₘ ν') hνν'
  have h₄ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine rnDeriv_eq_zero_of_mutuallySingular ?_ h_ac
    exact hνν'.symm.withDensity
  

Proof state:
case refine_2
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 (singularPart μ ν') (ν + ν') =ᶠ[ae ν] rnDeriv (singularPart μ ν') ν
h₄ : rnDeriv (withDensity ν' (rnDeriv μ ν')) (ν + ν') =ᶠ[ae ν] 0
⊢ (fun x => (rnDeriv (singularPart μ ν') (ν + ν') + rnDeriv (withDensity ν' (rnDeriv μ ν')) (ν + ν')) x) =ᶠ[ae ν]
    rnDeriv (singularPart μ ν') ν + rnDeriv (withDensity ν' (rnDeriv μ ν')) ν
case refine_1
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 μ ν')) ν
⊢ singularPart μ ν' ⟂ₘ ν'

Next tactic:
have h₅ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv ν =ᵐ[ν] 0 := by
    rw [rnDeriv_eq_zero]
    exact hνν'.symm.withDensity
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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
  have h₃ := rnDeriv_add_right_of_mutuallySingular' (?_ : μ.singularPart ν' ⟂ₘ ν') hνν'
  have h₄ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine rnDeriv_eq_zero_of_mutuallySingular ?_ h_ac
    exact hνν'.symm.withDensity
  have h₅ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv ν =ᵐ[ν] 0 := by
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 (singularPart μ ν') (ν + ν') =ᶠ[ae ν] rnDeriv (singularPart μ ν') ν
h₄ : rnDeriv (withDensity ν' (rnDeriv μ ν')) (ν + ν') =ᶠ[ae ν] 0
⊢ rnDeriv (withDensity ν' (rnDeriv μ ν')) ν =ᶠ[ae ν] 0

Next tactic:
rw [rnDeriv_eq_zero]
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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
  have h₃ := rnDeriv_add_right_of_mutuallySingular' (?_ : μ.singularPart ν' ⟂ₘ ν') hνν'
  have h₄ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine rnDeriv_eq_zero_of_mutuallySingular ?_ h_ac
    exact hνν'.symm.withDensity
  have h₅ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv ν =ᵐ[ν] 0 := by
    rw [rnDeriv_eq_zero]
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 (singularPart μ ν') (ν + ν') =ᶠ[ae ν] rnDeriv (singularPart μ ν') ν
h₄ : rnDeriv (withDensity ν' (rnDeriv μ ν')) (ν + ν') =ᶠ[ae ν] 0
⊢ withDensity ν' (rnDeriv μ ν') ⟂ₘ ν

Next tactic:
exact hνν'.symm.withDensity
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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
  have h₃ := rnDeriv_add_right_of_mutuallySingular' (?_ : μ.singularPart ν' ⟂ₘ ν') hνν'
  have h₄ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine rnDeriv_eq_zero_of_mutuallySingular ?_ h_ac
    exact hνν'.symm.withDensity
  have h₅ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv ν =ᵐ[ν] 0 := by
    rw [rnDeriv_eq_zero]
    exact hνν'.symm.withDensity
  

Proof state:
case refine_2
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 (singularPart μ ν') (ν + ν') =ᶠ[ae ν] rnDeriv (singularPart μ ν') ν
h₄ : rnDeriv (withDensity ν' (rnDeriv μ ν')) (ν + ν') =ᶠ[ae ν] 0
h₅ : rnDeriv (withDensity ν' (rnDeriv μ ν')) ν =ᶠ[ae ν] 0
⊢ (fun x => (rnDeriv (singularPart μ ν') (ν + ν') + rnDeriv (withDensity ν' (rnDeriv μ ν')) (ν + ν')) x) =ᶠ[ae ν]
    rnDeriv (singularPart μ ν') ν + rnDeriv (withDensity ν' (rnDeriv μ ν')) ν
case refine_1
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 μ ν')) ν
⊢ singularPart μ ν' ⟂ₘ ν'

Next tactic:
filter_upwards [h₃, h₄, h₅] with x hx₃ hx₄ hx₅
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (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
  have h₃ := rnDeriv_add_right_of_mutuallySingular' (?_ : μ.singularPart ν' ⟂ₘ ν') hνν'
  have h₄ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
    refine rnDeriv_eq_zero_of_mutuallySingular ?_ h_ac
    exact hνν'.symm.withDensity
  have h₅ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv ν =ᵐ[ν] 0 := by
    rw [rnDeriv_eq_zero]
    exact hνν'.symm.withDensity
  filter_upwards [h₃, h₄, h₅] with x hx₃ hx₄ hx₅
  

Proof state:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 (singularPart μ ν') (ν + ν') =ᶠ[ae ν] rnDeriv (singularPart μ ν') ν
h₄ : rnDeriv (withDensity ν' (rnDeriv μ ν')) (ν + ν') =ᶠ[ae ν] 0
h₅ : rnDeriv (withDensity ν' (rnDeriv μ ν')) ν =ᶠ[ae ν] 0
x : α
hx₃ : rnDeriv (singularPart μ ν') (ν + ν') x = rnDeriv (singularPart μ ν') ν x
hx₄ : rnDeriv (withDensity ν' (rnDeriv μ ν')) (ν + ν') x = OfNat.ofNat 0 x
hx₅ : rnDeriv (withDensity ν' (rnDeriv μ ν')) ν x = OfNat.ofNat 0 x
⊢ (rnDeriv (singularPart μ ν') (ν + ν') + rnDeriv (withDensity ν' (rnDeriv μ ν')) (ν + ν')) x =
    (rnDeriv (singularPart μ ν') ν + rnDeriv (withDensity ν' (rnDeriv μ ν')) ν) x
case refine_1
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν ν' : Measure α
inst✝² : SigmaFinite μ
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite ν'
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 μ ν')) ν
⊢ singularPart μ ν' ⟂ₘ ν'

Next tactic:
rw [Pi.add_apply, Pi.add_apply, hx₃, hx₄, hx₅]