-- Mathlib/MeasureTheory/Measure/WithDensity.lean
/-- If `f` is almost everywhere positive, then `μ ≪ μ.withDensity f`. See also
`withDensity_absolutelyContinuous` for the reverse direction, which always holds. -/
lemma withDensity_absolutelyContinuous' {μ : Measure α} {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (hf_ne_zero : ∀ᵐ x ∂μ, f x ≠ 0) :
    μ ≪ μ.withDensity f

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f μ
hf_ne_zero : ∀ᵐ (x : α) ∂μ, f x ≠ 0
s : Set α
hs : MeasurableSet s
hμs : (μ.withDensity f) s = 0
⊢ μ s = 0

Tactic:
rw [withDensity_apply _ hs, lintegral_eq_zero_iff' hf.restrict,
  ae_eq_restrict_iff_indicator_ae_eq hs, Set.indicator_zero', Filter.EventuallyEq, ae_iff] at hμs

Result:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f μ
hf_ne_zero : ∀ᵐ (x : α) ∂μ, f x ≠ 0
s : Set α
hs : MeasurableSet s
hμs : μ {a | ¬s.indicator f a = 0 a} = 0
⊢ μ s = 0

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f μ
s : Set α
hs : MeasurableSet s
hμs : μ {a | ¬s.indicator f a = 0 a} = 0
hf_ne_zero : μ {a | f a = 0} = 0
⊢ μ s = 0

Tactic:
simp only [Pi.zero_apply, Set.indicator_apply_eq_zero, not_forall, exists_prop] at hμs

Result:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f μ
s : Set α
hs : MeasurableSet s
hf_ne_zero : μ {a | f a = 0} = 0
hμs : μ {a | a ∈ s ∧ ¬f a = 0} = 0
⊢ μ s = 0

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f μ
hf_ne_zero : ∀ᵐ (x : α) ∂μ, f x ≠ 0
s : Set α
hs : MeasurableSet s
hμs : μ {a | ¬s.indicator f a = 0 a} = 0
⊢ μ s = 0

Tactic:
simp only [ae_iff, ne_eq, not_not] at hf_ne_zero

Result:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f μ
s : Set α
hs : MeasurableSet s
hμs : μ {a | ¬s.indicator f a = 0 a} = 0
hf_ne_zero : μ {a | f a = 0} = 0
⊢ μ s = 0

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f μ
s : Set α
hs : MeasurableSet s
hf_ne_zero : μ {a | f a = 0} = 0
hμs : μ {a | a ∈ s ∧ ¬f a = 0} = 0
hle : s ⊆ {a | a ∈ s ∧ ¬f a = 0} ∪ {a | f a = 0}
⊢ μ s = 0

Tactic:
exact measure_mono_null hle <| nonpos_iff_eq_zero.1 <| le_trans (measure_union_le _ _)
  <| hμs.symm ▸ zero_add _ |>.symm ▸ hf_ne_zero.le

Result:
no goals

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f μ
hf_ne_zero : ∀ᵐ (x : α) ∂μ, f x ≠ 0
⊢ μ ≪ μ.withDensity f

Tactic:
refine Measure.AbsolutelyContinuous.mk (fun s hs hμs ↦ ?_)

Result:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f μ
hf_ne_zero : ∀ᵐ (x : α) ∂μ, f x ≠ 0
s : Set α
hs : MeasurableSet s
hμs : (μ.withDensity f) s = 0
⊢ μ s = 0

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f μ
s : Set α
hs : MeasurableSet s
hf_ne_zero : μ {a | f a = 0} = 0
hμs : μ {a | a ∈ s ∧ ¬f a = 0} = 0
⊢ μ s = 0

Tactic:
have hle : s ⊆ {a | a ∈ s ∧ ¬f a = 0} ∪ {a | f a = 0} :=
  fun x hx ↦ or_iff_not_imp_right.mpr <| fun hnx ↦ ⟨hx, hnx⟩

Result:
α : Type u_1
m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f μ
s : Set α
hs : MeasurableSet s
hf_ne_zero : μ {a | f a = 0} = 0
hμs : μ {a | a ∈ s ∧ ¬f a = 0} = 0
hle : s ⊆ {a | a ∈ s ∧ ¬f a = 0} ∪ {a | f a = 0}
⊢ μ s = 0