l3lab/ntp-mathlib huggingface dataset:
theorem withDensity_rnDeriv_le (μ ν : Measure α) : ν.withDensity (μ.rnDeriv ν) ≤ μ := by
  by_cases hl : HaveLebesgueDecomposition μ ν
  · cases' (haveLebesgueDecomposition_spec μ ν).2 with _ h
    conv_rhs => rw [h]
    exact Measure.le_add_left le_rfl
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
hl : ¬HaveLebesgueDecomposition μ ν
⊢ withDensity ν (rnDeriv μ ν) ≤ μ

Next tactic:
rw [rnDeriv, dif_neg hl, withDensity_zero]
theorem withDensity_rnDeriv_le (μ ν : Measure α) : ν.withDensity (μ.rnDeriv ν) ≤ μ := by
  by_cases hl : HaveLebesgueDecomposition μ ν
  · cases' (haveLebesgueDecomposition_spec μ ν).2 with _ h
    conv_rhs => rw [h]
    exact Measure.le_add_left le_rfl
  · rw [rnDeriv, dif_neg hl, withDensity_zero]
    

Proof state:
case neg
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
hl : ¬HaveLebesgueDecomposition μ ν
⊢ 0 ≤ μ

Next tactic:
exact Measure.zero_le μ
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ ν
⊢ μ ≪ withDensity μ (rnDeriv ν μ)

Next tactic:
rw [haveLebesgueDecomposition_add ν μ] at hμν
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
⊢ μ ≪ withDensity μ (rnDeriv ν μ)

Next tactic:
refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
⊢ ↑↑μ s = 0

Next tactic:
obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
⊢ ↑↑μ s = 0

Next tactic:
have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by 

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
⊢ s = s ∩ t ∪ s ∩ tᶜ

Next tactic:
ext x
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; 

Proof state:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
x : α
⊢ x ∈ s ↔ x ∈ s ∩ t ∪ s ∩ tᶜ

Next tactic:
simp
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
  

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ
⊢ ↑↑μ s = 0

Next tactic:
rw [hs_eq_union]
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
  rw [hs_eq_union]
  

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ
⊢ ↑↑μ (s ∩ t ∪ s ∩ tᶜ) = 0

Next tactic:
refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
  rw [hs_eq_union]
  refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
  

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ
⊢ ↑↑μ (s ∩ t) + ↑↑μ (s ∩ tᶜ) ≤ 0

Next tactic:
simp only [nonpos_iff_eq_zero, add_eq_zero]
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
  rw [hs_eq_union]
  refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
  simp only [nonpos_iff_eq_zero, add_eq_zero]
  

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ
⊢ ↑↑μ (s ∩ t) = 0 ∧ ↑↑μ (s ∩ tᶜ) = 0

Next tactic:
constructor
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
  rw [hs_eq_union]
  refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
  simp only [nonpos_iff_eq_zero, add_eq_zero]
  constructor
  · 

Proof state:
case intro.intro.intro.left
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ
⊢ ↑↑μ (s ∩ t) = 0

Next tactic:
refine hμν ?_
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
  rw [hs_eq_union]
  refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
  simp only [nonpos_iff_eq_zero, add_eq_zero]
  constructor
  · refine hμν ?_
    

Proof state:
case intro.intro.intro.left
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ
⊢ ↑↑(singularPart ν μ + withDensity μ (rnDeriv ν μ)) (s ∩ t) = 0

Next tactic:
simp only [add_toOuterMeasure, OuterMeasure.coe_add, Pi.add_apply, add_eq_zero]
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
  rw [hs_eq_union]
  refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
  simp only [nonpos_iff_eq_zero, add_eq_zero]
  constructor
  · refine hμν ?_
    simp only [add_toOuterMeasure, OuterMeasure.coe_add, Pi.add_apply, add_eq_zero]
    

Proof state:
case intro.intro.intro.left
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ
⊢ ↑↑(singularPart ν μ) (s ∩ t) = 0 ∧ ↑↑(withDensity μ (rnDeriv ν μ)) (s ∩ t) = 0

Next tactic:
constructor
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
  rw [hs_eq_union]
  refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
  simp only [nonpos_iff_eq_zero, add_eq_zero]
  constructor
  · refine hμν ?_
    simp only [add_toOuterMeasure, OuterMeasure.coe_add, Pi.add_apply, add_eq_zero]
    constructor
    · 

Proof state:
case intro.intro.intro.left.left
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ
⊢ ↑↑(singularPart ν μ) (s ∩ t) = 0

Next tactic:
exact measure_mono_null (Set.inter_subset_right _ _) ht1
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
  rw [hs_eq_union]
  refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
  simp only [nonpos_iff_eq_zero, add_eq_zero]
  constructor
  · refine hμν ?_
    simp only [add_toOuterMeasure, OuterMeasure.coe_add, Pi.add_apply, add_eq_zero]
    constructor
    · exact measure_mono_null (Set.inter_subset_right _ _) ht1
    · 

Proof state:
case intro.intro.intro.left.right
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ
⊢ ↑↑(withDensity μ (rnDeriv ν μ)) (s ∩ t) = 0

Next tactic:
exact measure_mono_null (Set.inter_subset_left _ _) hνs
lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
    (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
  rw [haveLebesgueDecomposition_add ν μ] at hμν
  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
  rw [hs_eq_union]
  refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
  simp only [nonpos_iff_eq_zero, add_eq_zero]
  constructor
  · refine hμν ?_
    simp only [add_toOuterMeasure, OuterMeasure.coe_add, Pi.add_apply, add_eq_zero]
    constructor
    · exact measure_mono_null (Set.inter_subset_right _ _) ht1
    · exact measure_mono_null (Set.inter_subset_left _ _) hνs
  · 

Proof state:
case intro.intro.intro.right
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition ν μ
hμν : μ ≪ singularPart ν μ + withDensity μ (rnDeriv ν μ)
s : Set α
x✝ : MeasurableSet s
hνs : ↑↑(withDensity μ (rnDeriv ν μ)) s = 0
t : Set α
left✝ : MeasurableSet t
ht1 : ↑↑(singularPart ν μ) t = 0
ht2 : ↑↑μ tᶜ = 0
hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ
⊢ ↑↑μ (s ∩ tᶜ) = 0

Next tactic:
exact measure_mono_null (Set.inter_subset_right _ _) ht2
@[simp]
lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
    ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition μ ν
⊢ withDensity ν (rnDeriv μ ν) = 0 ↔ μ ⟂ₘ ν

Next tactic:
have h_dec := haveLebesgueDecomposition_add μ ν
@[simp]
lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
    ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
  have h_dec := haveLebesgueDecomposition_add μ ν
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition μ ν
h_dec : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
⊢ withDensity ν (rnDeriv μ ν) = 0 ↔ μ ⟂ₘ ν

Next tactic:
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
@[simp]
lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
    ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
  have h_dec := haveLebesgueDecomposition_add μ ν
  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
  · 

Proof state:
case refine_1
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition μ ν
h_dec : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
h : withDensity ν (rnDeriv μ ν) = 0
⊢ μ ⟂ₘ ν

Next tactic:
rw [h, add_zero] at h_dec
@[simp]
lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
    ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
  have h_dec := haveLebesgueDecomposition_add μ ν
  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
  · rw [h, add_zero] at h_dec
    

Proof state:
case refine_1
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition μ ν
h_dec : μ = singularPart μ ν
h : withDensity ν (rnDeriv μ ν) = 0
⊢ μ ⟂ₘ ν

Next tactic:
rw [h_dec]
@[simp]
lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
    ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
  have h_dec := haveLebesgueDecomposition_add μ ν
  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
  · rw [h, add_zero] at h_dec
    rw [h_dec]
    

Proof state:
case refine_1
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition μ ν
h_dec : μ = singularPart μ ν
h : withDensity ν (rnDeriv μ ν) = 0
⊢ singularPart μ ν ⟂ₘ ν

Next tactic:
exact mutuallySingular_singularPart μ ν
@[simp]
lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
    ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
  have h_dec := haveLebesgueDecomposition_add μ ν
  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
  · rw [h, add_zero] at h_dec
    rw [h_dec]
    exact mutuallySingular_singularPart μ ν
  · 

Proof state:
case refine_2
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition μ ν
h_dec : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
h : μ ⟂ₘ ν
⊢ withDensity ν (rnDeriv μ ν) = 0

Next tactic:
rw [← MutuallySingular.self_iff]
@[simp]
lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
    ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
  have h_dec := haveLebesgueDecomposition_add μ ν
  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
  · rw [h, add_zero] at h_dec
    rw [h_dec]
    exact mutuallySingular_singularPart μ ν
  · rw [← MutuallySingular.self_iff]
    

Proof state:
case refine_2
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition μ ν
h_dec : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
h : μ ⟂ₘ ν
⊢ withDensity ν (rnDeriv μ ν) ⟂ₘ withDensity ν (rnDeriv μ ν)

Next tactic:
rw [h_dec, MutuallySingular.add_left_iff] at h
@[simp]
lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
    ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
  have h_dec := haveLebesgueDecomposition_add μ ν
  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
  · rw [h, add_zero] at h_dec
    rw [h_dec]
    exact mutuallySingular_singularPart μ ν
  · rw [← MutuallySingular.self_iff]
    rw [h_dec, MutuallySingular.add_left_iff] at h
    

Proof state:
case refine_2
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition μ ν
h_dec : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
h : singularPart μ ν ⟂ₘ ν ∧ withDensity ν (rnDeriv μ ν) ⟂ₘ ν
⊢ withDensity ν (rnDeriv μ ν) ⟂ₘ withDensity ν (rnDeriv μ ν)

Next tactic:
refine MutuallySingular.mono_ac h.2 AbsolutelyContinuous.rfl ?_
@[simp]
lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
    ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
  have h_dec := haveLebesgueDecomposition_add μ ν
  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
  · rw [h, add_zero] at h_dec
    rw [h_dec]
    exact mutuallySingular_singularPart μ ν
  · rw [← MutuallySingular.self_iff]
    rw [h_dec, MutuallySingular.add_left_iff] at h
    refine MutuallySingular.mono_ac h.2 AbsolutelyContinuous.rfl ?_
    

Proof state:
case refine_2
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition μ ν
h_dec : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
h : singularPart μ ν ⟂ₘ ν ∧ withDensity ν (rnDeriv μ ν) ⟂ₘ ν
⊢ withDensity ν (rnDeriv μ ν) ≪ ν

Next tactic:
exact withDensity_absolutelyContinuous _ _
@[simp]
lemma rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
    μ.rnDeriv ν =ᵐ[ν] 0 ↔ μ ⟂ₘ ν := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : HaveLebesgueDecomposition μ ν
⊢ rnDeriv μ ν =ᶠ[ae ν] 0 ↔ μ ⟂ₘ ν

Next tactic:
rw [← withDensity_rnDeriv_eq_zero,
    withDensity_eq_zero_iff (measurable_rnDeriv _ _).aemeasurable]
lemma rnDeriv_zero (ν : Measure α) : (0 : Measure α).rnDeriv ν =ᵐ[ν] 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν✝ ν : Measure α
⊢ rnDeriv 0 ν =ᶠ[ae ν] 0

Next tactic:
rw [rnDeriv_eq_zero]
lemma rnDeriv_zero (ν : Measure α) : (0 : Measure α).rnDeriv ν =ᵐ[ν] 0 := by
  rw [rnDeriv_eq_zero]
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν✝ ν : Measure α
⊢ 0 ⟂ₘ ν

Next tactic:
exact MutuallySingular.zero_left
lemma MutuallySingular.rnDeriv_ae_eq_zero {μ ν : Measure α} (hμν : μ ⟂ₘ ν) :
    μ.rnDeriv ν =ᵐ[ν] 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
hμν : μ ⟂ₘ ν
⊢ rnDeriv μ ν =ᶠ[ae ν] 0

Next tactic:
by_cases h : μ.HaveLebesgueDecomposition ν
lemma MutuallySingular.rnDeriv_ae_eq_zero {μ ν : Measure α} (hμν : μ ⟂ₘ ν) :
    μ.rnDeriv ν =ᵐ[ν] 0 := by
  by_cases h : μ.HaveLebesgueDecomposition ν
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
hμν : μ ⟂ₘ ν
h : HaveLebesgueDecomposition μ ν
⊢ rnDeriv μ ν =ᶠ[ae ν] 0

Next tactic:
rw [rnDeriv_eq_zero]
lemma MutuallySingular.rnDeriv_ae_eq_zero {μ ν : Measure α} (hμν : μ ⟂ₘ ν) :
    μ.rnDeriv ν =ᵐ[ν] 0 := by
  by_cases h : μ.HaveLebesgueDecomposition ν
  · rw [rnDeriv_eq_zero]
    

Proof state:
case pos
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
hμν : μ ⟂ₘ ν
h : HaveLebesgueDecomposition μ ν
⊢ μ ⟂ₘ ν

Next tactic:
exact hμν
lemma MutuallySingular.rnDeriv_ae_eq_zero {μ ν : Measure α} (hμν : μ ⟂ₘ ν) :
    μ.rnDeriv ν =ᵐ[ν] 0 := by
  by_cases h : μ.HaveLebesgueDecomposition ν
  · rw [rnDeriv_eq_zero]
    exact hμν
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
hμν : μ ⟂ₘ ν
h : ¬HaveLebesgueDecomposition μ ν
⊢ rnDeriv μ ν =ᶠ[ae ν] 0

Next tactic:
rw [rnDeriv_of_not_haveLebesgueDecomposition h]
lemma rnDeriv_singularPart (μ ν : Measure α) :
    (μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
⊢ rnDeriv (singularPart μ ν) ν =ᶠ[ae ν] 0

Next tactic:
rw [rnDeriv_eq_zero]
lemma rnDeriv_singularPart (μ ν : Measure α) :
    (μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := by
  rw [rnDeriv_eq_zero]
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
⊢ singularPart μ ν ⟂ₘ ν

Next tactic:
exact mutuallySingular_singularPart μ ν
theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measure α) {s : Set α}
    (hs : μ s ≠ ∞) : ∫⁻ x in s, μ.rnDeriv ν x ∂ν < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
s : Set α
hs : ↑↑μ s ≠ ⊤
⊢ ∫⁻ (x : α) in s, rnDeriv μ ν x ∂ν < ⊤

Next tactic:
by_cases hl : HaveLebesgueDecomposition μ ν
theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measure α) {s : Set α}
    (hs : μ s ≠ ∞) : ∫⁻ x in s, μ.rnDeriv ν x ∂ν < ∞ := by
  by_cases hl : HaveLebesgueDecomposition μ ν
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
s : Set α
hs : ↑↑μ s ≠ ⊤
hl : HaveLebesgueDecomposition μ ν
⊢ ∫⁻ (x : α) in s, rnDeriv μ ν x ∂ν < ⊤

Next tactic:
haveI := hl