l3lab/ntp-mathlib huggingface dataset:
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 μ ν
  · haveI := hl
    

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

Next tactic:
obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
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 μ ν
  · haveI := hl
    obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
    

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

Next tactic:
suffices : (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞
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 μ ν
  · haveI := hl
    obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
    suffices : (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞
    

Proof state:
case pos.intro.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
s : Set α
hs : ↑↑μ s ≠ ⊤
hl this✝ : HaveLebesgueDecomposition μ ν
hadd : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
this : ∫⁻ (x : α) in toMeasurable μ s, rnDeriv μ ν x ∂ν < ⊤
⊢ ∫⁻ (x : α) in s, rnDeriv μ ν x ∂ν < ⊤
case this
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
s : Set α
hs : ↑↑μ s ≠ ⊤
hl this : HaveLebesgueDecomposition μ ν
hadd : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
⊢ ∫⁻ (x : α) in toMeasurable μ s, rnDeriv μ ν x ∂ν < ⊤

Next tactic:
exact lt_of_le_of_lt (lintegral_mono_set (subset_toMeasurable _ _)) this
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 μ ν
  · haveI := hl
    obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
    suffices : (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞
    exact lt_of_le_of_lt (lintegral_mono_set (subset_toMeasurable _ _)) this
    

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

Next tactic:
rw [← withDensity_apply _ (measurableSet_toMeasurable _ _)]
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 μ ν
  · haveI := hl
    obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
    suffices : (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞
    exact lt_of_le_of_lt (lintegral_mono_set (subset_toMeasurable _ _)) this
    rw [← withDensity_apply _ (measurableSet_toMeasurable _ _)]
    

Proof state:
case this
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
s : Set α
hs : ↑↑μ s ≠ ⊤
hl this : HaveLebesgueDecomposition μ ν
hadd : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
⊢ ↑↑(withDensity ν fun x => rnDeriv μ ν x) (toMeasurable μ s) < ⊤

Next tactic:
refine'
      lt_of_le_of_lt
        (le_add_left le_rfl :
          _ ≤ μ.singularPart ν (toMeasurable μ s) + ν.withDensity (μ.rnDeriv ν) (toMeasurable μ s))
        _
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 μ ν
  · haveI := hl
    obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
    suffices : (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞
    exact lt_of_le_of_lt (lintegral_mono_set (subset_toMeasurable _ _)) this
    rw [← withDensity_apply _ (measurableSet_toMeasurable _ _)]
    refine'
      lt_of_le_of_lt
        (le_add_left le_rfl :
          _ ≤ μ.singularPart ν (toMeasurable μ s) + ν.withDensity (μ.rnDeriv ν) (toMeasurable μ s))
        _
    

Proof state:
case this
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
s : Set α
hs : ↑↑μ s ≠ ⊤
hl this : HaveLebesgueDecomposition μ ν
hadd : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
⊢ ↑↑(singularPart μ ν) (toMeasurable μ s) + ↑↑(withDensity ν (rnDeriv μ ν)) (toMeasurable μ s) < ⊤

Next tactic:
rw [← Measure.add_apply, ← hadd, measure_toMeasurable]
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 μ ν
  · haveI := hl
    obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
    suffices : (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞
    exact lt_of_le_of_lt (lintegral_mono_set (subset_toMeasurable _ _)) this
    rw [← withDensity_apply _ (measurableSet_toMeasurable _ _)]
    refine'
      lt_of_le_of_lt
        (le_add_left le_rfl :
          _ ≤ μ.singularPart ν (toMeasurable μ s) + ν.withDensity (μ.rnDeriv ν) (toMeasurable μ s))
        _
    rw [← Measure.add_apply, ← hadd, measure_toMeasurable]
    

Proof state:
case this
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
s : Set α
hs : ↑↑μ s ≠ ⊤
hl this : HaveLebesgueDecomposition μ ν
hadd : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
⊢ ↑↑μ s < ⊤

Next tactic:
exact hs.lt_top
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 μ ν
  · haveI := hl
    obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
    suffices : (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞
    exact lt_of_le_of_lt (lintegral_mono_set (subset_toMeasurable _ _)) this
    rw [← withDensity_apply _ (measurableSet_toMeasurable _ _)]
    refine'
      lt_of_le_of_lt
        (le_add_left le_rfl :
          _ ≤ μ.singularPart ν (toMeasurable μ s) + ν.withDensity (μ.rnDeriv ν) (toMeasurable μ s))
        _
    rw [← Measure.add_apply, ← hadd, measure_toMeasurable]
    exact hs.lt_top
  · 

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

Next tactic:
erw [Measure.rnDeriv, dif_neg hl, lintegral_zero]
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 μ ν
  · haveI := hl
    obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
    suffices : (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞
    exact lt_of_le_of_lt (lintegral_mono_set (subset_toMeasurable _ _)) this
    rw [← withDensity_apply _ (measurableSet_toMeasurable _ _)]
    refine'
      lt_of_le_of_lt
        (le_add_left le_rfl :
          _ ≤ μ.singularPart ν (toMeasurable μ s) + ν.withDensity (μ.rnDeriv ν) (toMeasurable μ s))
        _
    rw [← Measure.add_apply, ← hadd, measure_toMeasurable]
    exact hs.lt_top
  · erw [Measure.rnDeriv, dif_neg hl, lintegral_zero]
    

Proof state:
case neg
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
s : Set α
hs : ↑↑μ s ≠ ⊤
hl : ¬HaveLebesgueDecomposition μ ν
⊢ 0 < ⊤

Next tactic:
exact WithTop.zero_lt_top
theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [IsFiniteMeasure μ] :
    (∫⁻ x, μ.rnDeriv ν x ∂ν) < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : IsFiniteMeasure μ
⊢ ∫⁻ (x : α), rnDeriv μ ν x ∂ν < ⊤

Next tactic:
rw [← set_lintegral_univ]
theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [IsFiniteMeasure μ] :
    (∫⁻ x, μ.rnDeriv ν x ∂ν) < ∞ := by
  rw [← set_lintegral_univ]
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : IsFiniteMeasure μ
⊢ ∫⁻ (x : α) in univ, rnDeriv μ ν x ∂ν < ⊤

Next tactic:
exact lintegral_rnDeriv_lt_top_of_measure_ne_top _ (measure_lt_top _ _).ne
/-- The Radon-Nikodym derivative of a sigma-finite measure `μ` with respect to another
measure `ν` is `ν`-almost everywhere finite. -/
theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : SigmaFinite μ
⊢ ∀ᵐ (x : α) ∂ν, rnDeriv μ ν x < ⊤

Next tactic:
suffices ∀ n, ∀ᵐ x ∂ν, x ∈ spanningSets μ n → μ.rnDeriv ν x < ∞ by
    filter_upwards [ae_all_iff.2 this] with _ hx using hx _ (mem_spanningSetsIndex _ _)
/-- The Radon-Nikodym derivative of a sigma-finite measure `μ` with respect to another
measure `ν` is `ν`-almost everywhere finite. -/
theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞ := by
  suffices ∀ n, ∀ᵐ x ∂ν, x ∈ spanningSets μ n → μ.rnDeriv ν x < ∞ by
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : SigmaFinite μ
this : ∀ (n : ℕ), ∀ᵐ (x : α) ∂ν, x ∈ spanningSets μ n → rnDeriv μ ν x < ⊤
⊢ ∀ᵐ (x : α) ∂ν, rnDeriv μ ν x < ⊤

Next tactic:
filter_upwards [ae_all_iff.2 this] with _ hx using hx _ (mem_spanningSetsIndex _ _)
/-- The Radon-Nikodym derivative of a sigma-finite measure `μ` with respect to another
measure `ν` is `ν`-almost everywhere finite. -/
theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞ := by
  suffices ∀ n, ∀ᵐ x ∂ν, x ∈ spanningSets μ n → μ.rnDeriv ν x < ∞ by
    filter_upwards [ae_all_iff.2 this] with _ hx using hx _ (mem_spanningSetsIndex _ _)
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : SigmaFinite μ
⊢ ∀ (n : ℕ), ∀ᵐ (x : α) ∂ν, x ∈ spanningSets μ n → rnDeriv μ ν x < ⊤

Next tactic:
intro n
/-- The Radon-Nikodym derivative of a sigma-finite measure `μ` with respect to another
measure `ν` is `ν`-almost everywhere finite. -/
theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞ := by
  suffices ∀ n, ∀ᵐ x ∂ν, x ∈ spanningSets μ n → μ.rnDeriv ν x < ∞ by
    filter_upwards [ae_all_iff.2 this] with _ hx using hx _ (mem_spanningSetsIndex _ _)
  intro n
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : SigmaFinite μ
n : ℕ
⊢ ∀ᵐ (x : α) ∂ν, x ∈ spanningSets μ n → rnDeriv μ ν x < ⊤

Next tactic:
rw [← ae_restrict_iff' (measurable_spanningSets _ _)]
/-- The Radon-Nikodym derivative of a sigma-finite measure `μ` with respect to another
measure `ν` is `ν`-almost everywhere finite. -/
theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞ := by
  suffices ∀ n, ∀ᵐ x ∂ν, x ∈ spanningSets μ n → μ.rnDeriv ν x < ∞ by
    filter_upwards [ae_all_iff.2 this] with _ hx using hx _ (mem_spanningSetsIndex _ _)
  intro n
  rw [← ae_restrict_iff' (measurable_spanningSets _ _)]
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : SigmaFinite μ
n : ℕ
⊢ ∀ᵐ (x : α) ∂restrict ν (spanningSets μ n), rnDeriv μ ν x < ⊤

Next tactic:
apply ae_lt_top (measurable_rnDeriv _ _)
/-- The Radon-Nikodym derivative of a sigma-finite measure `μ` with respect to another
measure `ν` is `ν`-almost everywhere finite. -/
theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞ := by
  suffices ∀ n, ∀ᵐ x ∂ν, x ∈ spanningSets μ n → μ.rnDeriv ν x < ∞ by
    filter_upwards [ae_all_iff.2 this] with _ hx using hx _ (mem_spanningSetsIndex _ _)
  intro n
  rw [← ae_restrict_iff' (measurable_spanningSets _ _)]
  apply ae_lt_top (measurable_rnDeriv _ _)
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : SigmaFinite μ
n : ℕ
⊢ ∫⁻ (x : α) in spanningSets μ n, rnDeriv μ ν x ∂ν ≠ ⊤

Next tactic:
refine' (lintegral_rnDeriv_lt_top_of_measure_ne_top _ _).ne
/-- The Radon-Nikodym derivative of a sigma-finite measure `μ` with respect to another
measure `ν` is `ν`-almost everywhere finite. -/
theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞ := by
  suffices ∀ n, ∀ᵐ x ∂ν, x ∈ spanningSets μ n → μ.rnDeriv ν x < ∞ by
    filter_upwards [ae_all_iff.2 this] with _ hx using hx _ (mem_spanningSetsIndex _ _)
  intro n
  rw [← ae_restrict_iff' (measurable_spanningSets _ _)]
  apply ae_lt_top (measurable_rnDeriv _ _)
  refine' (lintegral_rnDeriv_lt_top_of_measure_ne_top _ _).ne
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : SigmaFinite μ
n : ℕ
⊢ ↑↑μ (spanningSets μ n) ≠ ⊤

Next tactic:
exact (measure_spanningSets_lt_top _ _).ne
lemma rnDeriv_ne_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x ≠ ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝ : SigmaFinite μ
⊢ ∀ᵐ (x : α) ∂ν, rnDeriv μ ν x ≠ ⊤

Next tactic:
filter_upwards [Measure.rnDeriv_lt_top μ ν] with x hx using hx.ne
/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.

This theorem provides the uniqueness of the `singularPart` in the Lebesgue decomposition theorem,
while `MeasureTheory.Measure.eq_rnDeriv` provides the uniqueness of the
`rnDeriv`. -/
theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
    (hadd : μ = s + ν.withDensity f) : s = μ.singularPart ν := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν s : Measure α
f : α → ℝ≥0∞
hf : Measurable f
hs : s ⟂ₘ ν
hadd : μ = s + withDensity ν f
⊢ s = singularPart μ ν

Next tactic:
haveI : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.

This theorem provides the uniqueness of the `singularPart` in the Lebesgue decomposition theorem,
while `MeasureTheory.Measure.eq_rnDeriv` provides the uniqueness of the
`rnDeriv`. -/
theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
    (hadd : μ = s + ν.withDensity f) : s = μ.singularPart ν := by
  haveI : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν s : Measure α
f : α → ℝ≥0∞
hf : Measurable f
hs : s ⟂ₘ ν
hadd : μ = s + withDensity ν f
this : HaveLebesgueDecomposition μ ν
⊢ s = singularPart μ ν

Next tactic:
obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.

This theorem provides the uniqueness of the `singularPart` in the Lebesgue decomposition theorem,
while `MeasureTheory.Measure.eq_rnDeriv` provides the uniqueness of the
`rnDeriv`. -/
theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
    (hadd : μ = s + ν.withDensity f) : s = μ.singularPart ν := by
  haveI : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
  obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν s : Measure α
f : α → ℝ≥0∞
hf : Measurable f
hs : s ⟂ₘ ν
hadd : μ = s + withDensity ν f
this : HaveLebesgueDecomposition μ ν
hmeas : Measurable (rnDeriv μ ν)
hsing : singularPart μ ν ⟂ₘ ν
hadd' : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
⊢ s = singularPart μ ν

Next tactic:
obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.

This theorem provides the uniqueness of the `singularPart` in the Lebesgue decomposition theorem,
while `MeasureTheory.Measure.eq_rnDeriv` provides the uniqueness of the
`rnDeriv`. -/
theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
    (hadd : μ = s + ν.withDensity f) : s = μ.singularPart ν := by
  haveI : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
  obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
  obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν s : Measure α
f : α → ℝ≥0∞
hf : Measurable f
hadd : μ = s + withDensity ν f
this : HaveLebesgueDecomposition μ ν
hmeas : Measurable (rnDeriv μ ν)
hadd' : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑s S = 0
hS₃ : ↑↑ν Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : ↑↑(singularPart μ ν) T = 0
hT₃ : ↑↑ν Tᶜ = 0
⊢ s = singularPart μ ν

Next tactic:
rw [hadd'] at hadd
/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.

This theorem provides the uniqueness of the `singularPart` in the Lebesgue decomposition theorem,
while `MeasureTheory.Measure.eq_rnDeriv` provides the uniqueness of the
`rnDeriv`. -/
theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
    (hadd : μ = s + ν.withDensity f) : s = μ.singularPart ν := by
  haveI : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
  obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
  obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
  rw [hadd'] at hadd
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν s : Measure α
f : α → ℝ≥0∞
hf : Measurable f
hadd : singularPart μ ν + withDensity ν (rnDeriv μ ν) = s + withDensity ν f
this : HaveLebesgueDecomposition μ ν
hmeas : Measurable (rnDeriv μ ν)
hadd' : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑s S = 0
hS₃ : ↑↑ν Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : ↑↑(singularPart μ ν) T = 0
hT₃ : ↑↑ν Tᶜ = 0
⊢ s = singularPart μ ν

Next tactic:
have hνinter : ν (S ∩ T)ᶜ = 0 := by
    rw [compl_inter]
    refine' nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) _)
    rw [hT₃, hS₃, add_zero]
/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.

This theorem provides the uniqueness of the `singularPart` in the Lebesgue decomposition theorem,
while `MeasureTheory.Measure.eq_rnDeriv` provides the uniqueness of the
`rnDeriv`. -/
theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
    (hadd : μ = s + ν.withDensity f) : s = μ.singularPart ν := by
  haveI : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
  obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
  obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
  rw [hadd'] at hadd
  have hνinter : ν (S ∩ T)ᶜ = 0 := by
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν s : Measure α
f : α → ℝ≥0∞
hf : Measurable f
hadd : singularPart μ ν + withDensity ν (rnDeriv μ ν) = s + withDensity ν f
this : HaveLebesgueDecomposition μ ν
hmeas : Measurable (rnDeriv μ ν)
hadd' : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑s S = 0
hS₃ : ↑↑ν Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : ↑↑(singularPart μ ν) T = 0
hT₃ : ↑↑ν Tᶜ = 0
⊢ ↑↑ν (S ∩ T)ᶜ = 0

Next tactic:
rw [compl_inter]
/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.

This theorem provides the uniqueness of the `singularPart` in the Lebesgue decomposition theorem,
while `MeasureTheory.Measure.eq_rnDeriv` provides the uniqueness of the
`rnDeriv`. -/
theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
    (hadd : μ = s + ν.withDensity f) : s = μ.singularPart ν := by
  haveI : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
  obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
  obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
  rw [hadd'] at hadd
  have hνinter : ν (S ∩ T)ᶜ = 0 := by
    rw [compl_inter]
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν s : Measure α
f : α → ℝ≥0∞
hf : Measurable f
hadd : singularPart μ ν + withDensity ν (rnDeriv μ ν) = s + withDensity ν f
this : HaveLebesgueDecomposition μ ν
hmeas : Measurable (rnDeriv μ ν)
hadd' : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑s S = 0
hS₃ : ↑↑ν Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : ↑↑(singularPart μ ν) T = 0
hT₃ : ↑↑ν Tᶜ = 0
⊢ ↑↑ν (Sᶜ ∪ Tᶜ) = 0

Next tactic:
refine' nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) _)
/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.

This theorem provides the uniqueness of the `singularPart` in the Lebesgue decomposition theorem,
while `MeasureTheory.Measure.eq_rnDeriv` provides the uniqueness of the
`rnDeriv`. -/
theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
    (hadd : μ = s + ν.withDensity f) : s = μ.singularPart ν := by
  haveI : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
  obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
  obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
  rw [hadd'] at hadd
  have hνinter : ν (S ∩ T)ᶜ = 0 := by
    rw [compl_inter]
    refine' nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) _)
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν s : Measure α
f : α → ℝ≥0∞
hf : Measurable f
hadd : singularPart μ ν + withDensity ν (rnDeriv μ ν) = s + withDensity ν f
this : HaveLebesgueDecomposition μ ν
hmeas : Measurable (rnDeriv μ ν)
hadd' : μ = singularPart μ ν + withDensity ν (rnDeriv μ ν)
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑s S = 0
hS₃ : ↑↑ν Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : ↑↑(singularPart μ ν) T = 0
hT₃ : ↑↑ν Tᶜ = 0
⊢ ↑↑ν Sᶜ + ↑↑ν Tᶜ ≤ 0

Next tactic:
rw [hT₃, hS₃, add_zero]