l3lab/ntp-mathlib huggingface dataset:
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
x : α
⊢ i x / f x ≤ g x

Next tactic:
exact div_le_of_le_mul' (hi x)
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
⊢ ∫⁻ (a : α), i a ∂μ ≤ ⨆ g_1, ⨆ (_ : Measurable g_1), ⨆ (_ : g_1 ≤ fun a => g a), ∫⁻ (a : α), g_1 a ∂withDensity μ f

Next tactic:
refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
⊢ ∫⁻ (a : α), i a ∂μ ≤
    ⨆ (_ : (fun x => (f x)⁻¹ * i x) ≤ fun a => g a), ∫⁻ (a : α), (fun x => (f x)⁻¹ * i x) a ∂withDensity μ f

Next tactic:
refine' le_iSup_of_le A _
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  refine' le_iSup_of_le A _
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
⊢ ∫⁻ (a : α), i a ∂μ ≤ ∫⁻ (a : α), (fun x => (f x)⁻¹ * i x) a ∂withDensity μ f

Next tactic:
rw [lintegral_withDensity_eq_lintegral_mul _ f_meas (f_meas.inv.mul i_meas)]
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  refine' le_iSup_of_le A _
  rw [lintegral_withDensity_eq_lintegral_mul _ f_meas (f_meas.inv.mul i_meas)]
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
⊢ ∫⁻ (a : α), i a ∂μ ≤ ∫⁻ (a : α), (f * fun a => (f a)⁻¹ * i a) a ∂μ

Next tactic:
apply lintegral_mono_ae
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  refine' le_iSup_of_le A _
  rw [lintegral_withDensity_eq_lintegral_mul _ f_meas (f_meas.inv.mul i_meas)]
  apply lintegral_mono_ae
  

Proof state:
case h
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
⊢ ∀ᵐ (a : α) ∂μ, i a ≤ (f * fun a => (f a)⁻¹ * i a) a

Next tactic:
filter_upwards [hf]
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  refine' le_iSup_of_le A _
  rw [lintegral_withDensity_eq_lintegral_mul _ f_meas (f_meas.inv.mul i_meas)]
  apply lintegral_mono_ae
  filter_upwards [hf]
  

Proof state:
case h
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
⊢ ∀ (a : α), f a < ⊤ → i a ≤ (f * fun a => (f a)⁻¹ * i a) a

Next tactic:
intro x h'x
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  refine' le_iSup_of_le A _
  rw [lintegral_withDensity_eq_lintegral_mul _ f_meas (f_meas.inv.mul i_meas)]
  apply lintegral_mono_ae
  filter_upwards [hf]
  intro x h'x
  

Proof state:
case h
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
x : α
h'x : f x < ⊤
⊢ i x ≤ (f * fun a => (f a)⁻¹ * i a) x

Next tactic:
rcases eq_or_ne (f x) 0 with (hx | hx)
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  refine' le_iSup_of_le A _
  rw [lintegral_withDensity_eq_lintegral_mul _ f_meas (f_meas.inv.mul i_meas)]
  apply lintegral_mono_ae
  filter_upwards [hf]
  intro x h'x
  rcases eq_or_ne (f x) 0 with (hx | hx)
  · 

Proof state:
case h.inl
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
x : α
h'x : f x < ⊤
hx : f x = 0
⊢ i x ≤ (f * fun a => (f a)⁻¹ * i a) x

Next tactic:
have := hi x
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  refine' le_iSup_of_le A _
  rw [lintegral_withDensity_eq_lintegral_mul _ f_meas (f_meas.inv.mul i_meas)]
  apply lintegral_mono_ae
  filter_upwards [hf]
  intro x h'x
  rcases eq_or_ne (f x) 0 with (hx | hx)
  · have := hi x
    

Proof state:
case h.inl
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
x : α
h'x : f x < ⊤
hx : f x = 0
this : i x ≤ (fun a => (f * g) a) x
⊢ i x ≤ (f * fun a => (f a)⁻¹ * i a) x

Next tactic:
simp only [hx, zero_mul, Pi.mul_apply, nonpos_iff_eq_zero] at this
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  refine' le_iSup_of_le A _
  rw [lintegral_withDensity_eq_lintegral_mul _ f_meas (f_meas.inv.mul i_meas)]
  apply lintegral_mono_ae
  filter_upwards [hf]
  intro x h'x
  rcases eq_or_ne (f x) 0 with (hx | hx)
  · have := hi x
    simp only [hx, zero_mul, Pi.mul_apply, nonpos_iff_eq_zero] at this
    

Proof state:
case h.inl
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
x : α
h'x : f x < ⊤
hx : f x = 0
this : i x = 0
⊢ i x ≤ (f * fun a => (f a)⁻¹ * i a) x

Next tactic:
simp [this]
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  refine' le_iSup_of_le A _
  rw [lintegral_withDensity_eq_lintegral_mul _ f_meas (f_meas.inv.mul i_meas)]
  apply lintegral_mono_ae
  filter_upwards [hf]
  intro x h'x
  rcases eq_or_ne (f x) 0 with (hx | hx)
  · have := hi x
    simp only [hx, zero_mul, Pi.mul_apply, nonpos_iff_eq_zero] at this
    simp [this]
  · 

Proof state:
case h.inr
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
x : α
h'x : f x < ⊤
hx : f x ≠ 0
⊢ i x ≤ (f * fun a => (f a)⁻¹ * i a) x

Next tactic:
apply le_of_eq _
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  refine' le_iSup_of_le A _
  rw [lintegral_withDensity_eq_lintegral_mul _ f_meas (f_meas.inv.mul i_meas)]
  apply lintegral_mono_ae
  filter_upwards [hf]
  intro x h'x
  rcases eq_or_ne (f x) 0 with (hx | hx)
  · have := hi x
    simp only [hx, zero_mul, Pi.mul_apply, nonpos_iff_eq_zero] at this
    simp [this]
  · apply le_of_eq _
    

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
x : α
h'x : f x < ⊤
hx : f x ≠ 0
⊢ i x = (f * fun a => (f a)⁻¹ * i a) x

Next tactic:
dsimp
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  refine' le_antisymm (lintegral_withDensity_le_lintegral_mul μ f_meas g) _
  rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
  refine' iSup₂_le fun i i_meas => iSup_le fun hi => _
  have A : (fun x => (f x)⁻¹ * i x) ≤ g := by
    intro x
    dsimp
    rw [mul_comm, ← div_eq_mul_inv]
    exact div_le_of_le_mul' (hi x)
  refine' le_iSup_of_le (fun x => (f x)⁻¹ * i x) (le_iSup_of_le (f_meas.inv.mul i_meas) _)
  refine' le_iSup_of_le A _
  rw [lintegral_withDensity_eq_lintegral_mul _ f_meas (f_meas.inv.mul i_meas)]
  apply lintegral_mono_ae
  filter_upwards [hf]
  intro x h'x
  rcases eq_or_ne (f x) 0 with (hx | hx)
  · have := hi x
    simp only [hx, zero_mul, Pi.mul_apply, nonpos_iff_eq_zero] at this
    simp [this]
  · apply le_of_eq _
    dsimp
    

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
hf : ∀ᵐ (x : α) ∂μ, f x < ⊤
g i : α → ℝ≥0∞
i_meas : Measurable i
hi : i ≤ fun a => (f * g) a
A : (fun x => (f x)⁻¹ * i x) ≤ g
x : α
h'x : f x < ⊤
hx : f x ≠ 0
⊢ i x = f x * ((f x)⁻¹ * i x)

Next tactic:
rw [← mul_assoc, ENNReal.mul_inv_cancel hx h'x.ne, one_mul]
theorem set_lintegral_withDensity_eq_set_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (g : α → ℝ≥0∞) {s : Set α} (hs : MeasurableSet s)
    (hf : ∀ᵐ x ∂μ.restrict s, f x < ∞) :
    ∫⁻ a in s, g a ∂μ.withDensity f = ∫⁻ a in s, (f * g) a ∂μ := by
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
f_meas : Measurable f
g : α → ℝ≥0∞
s : Set α
hs : MeasurableSet s
hf : ∀ᵐ (x : α) ∂Measure.restrict μ s, f x < ⊤
⊢ ∫⁻ (a : α) in s, g a ∂withDensity μ f = ∫⁻ (a : α) in s, (f * g) a ∂μ

Next tactic:
rw [restrict_withDensity hs, lintegral_withDensity_eq_lintegral_mul_non_measurable _ f_meas hf]
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable₀ (μ : Measure α) {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (h'f : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f
h'f : ∀ᵐ (x : α) ∂μ, f x < ⊤
g : α → ℝ≥0∞
⊢ ∫⁻ (a : α), g a ∂withDensity μ f = ∫⁻ (a : α), (f * g) a ∂μ

Next tactic:
let f' := hf.mk f
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable₀ (μ : Measure α) {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (h'f : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  let f' := hf.mk f
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f
h'f : ∀ᵐ (x : α) ∂μ, f x < ⊤
g : α → ℝ≥0∞
f' : α → ℝ≥0∞ := AEMeasurable.mk f hf
⊢ ∫⁻ (a : α), g a ∂withDensity μ f = ∫⁻ (a : α), (f * g) a ∂μ

Next tactic:
calc
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, g a ∂μ.withDensity f' := by
      rw [withDensity_congr_ae hf.ae_eq_mk]
    _ = ∫⁻ a, (f' * g) a ∂μ := by
      apply lintegral_withDensity_eq_lintegral_mul_non_measurable _ hf.measurable_mk
      filter_upwards [h'f, hf.ae_eq_mk]
      intro x hx h'x
      rwa [← h'x]
    _ = ∫⁻ a, (f * g) a ∂μ := by
      apply lintegral_congr_ae
      filter_upwards [hf.ae_eq_mk]
      intro x hx
      simp only [hx, Pi.mul_apply]
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable₀ (μ : Measure α) {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (h'f : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  let f' := hf.mk f
  calc
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, g a ∂μ.withDensity f' := by
      

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f
h'f : ∀ᵐ (x : α) ∂μ, f x < ⊤
g : α → ℝ≥0∞
f' : α → ℝ≥0∞ := AEMeasurable.mk f hf
⊢ ∫⁻ (a : α), g a ∂withDensity μ f = ∫⁻ (a : α), g a ∂withDensity μ f'

Next tactic:
rw [withDensity_congr_ae hf.ae_eq_mk]
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable₀ (μ : Measure α) {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (h'f : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  let f' := hf.mk f
  calc
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, g a ∂μ.withDensity f' := by
      rw [withDensity_congr_ae hf.ae_eq_mk]
    _ = ∫⁻ a, (f' * g) a ∂μ := by
      

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f
h'f : ∀ᵐ (x : α) ∂μ, f x < ⊤
g : α → ℝ≥0∞
f' : α → ℝ≥0∞ := AEMeasurable.mk f hf
⊢ ∫⁻ (a : α), g a ∂withDensity μ f' = ∫⁻ (a : α), (f' * g) a ∂μ

Next tactic:
apply lintegral_withDensity_eq_lintegral_mul_non_measurable _ hf.measurable_mk
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable₀ (μ : Measure α) {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (h'f : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  let f' := hf.mk f
  calc
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, g a ∂μ.withDensity f' := by
      rw [withDensity_congr_ae hf.ae_eq_mk]
    _ = ∫⁻ a, (f' * g) a ∂μ := by
      apply lintegral_withDensity_eq_lintegral_mul_non_measurable _ hf.measurable_mk
      

Proof state:
case hf
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f
h'f : ∀ᵐ (x : α) ∂μ, f x < ⊤
g : α → ℝ≥0∞
f' : α → ℝ≥0∞ := AEMeasurable.mk f hf
⊢ ∀ᵐ (x : α) ∂μ, AEMeasurable.mk f hf x < ⊤

Next tactic:
filter_upwards [h'f, hf.ae_eq_mk]
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable₀ (μ : Measure α) {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (h'f : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  let f' := hf.mk f
  calc
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, g a ∂μ.withDensity f' := by
      rw [withDensity_congr_ae hf.ae_eq_mk]
    _ = ∫⁻ a, (f' * g) a ∂μ := by
      apply lintegral_withDensity_eq_lintegral_mul_non_measurable _ hf.measurable_mk
      filter_upwards [h'f, hf.ae_eq_mk]
      

Proof state:
case h
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f
h'f : ∀ᵐ (x : α) ∂μ, f x < ⊤
g : α → ℝ≥0∞
f' : α → ℝ≥0∞ := AEMeasurable.mk f hf
⊢ ∀ (a : α), f a < ⊤ → f a = AEMeasurable.mk f hf a → AEMeasurable.mk f hf a < ⊤

Next tactic:
intro x hx h'x
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable₀ (μ : Measure α) {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (h'f : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  let f' := hf.mk f
  calc
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, g a ∂μ.withDensity f' := by
      rw [withDensity_congr_ae hf.ae_eq_mk]
    _ = ∫⁻ a, (f' * g) a ∂μ := by
      apply lintegral_withDensity_eq_lintegral_mul_non_measurable _ hf.measurable_mk
      filter_upwards [h'f, hf.ae_eq_mk]
      intro x hx h'x
      

Proof state:
case h
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f
h'f : ∀ᵐ (x : α) ∂μ, f x < ⊤
g : α → ℝ≥0∞
f' : α → ℝ≥0∞ := AEMeasurable.mk f hf
x : α
hx : f x < ⊤
h'x : f x = AEMeasurable.mk f hf x
⊢ AEMeasurable.mk f hf x < ⊤

Next tactic:
rwa [← h'x]
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable₀ (μ : Measure α) {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (h'f : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  let f' := hf.mk f
  calc
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, g a ∂μ.withDensity f' := by
      rw [withDensity_congr_ae hf.ae_eq_mk]
    _ = ∫⁻ a, (f' * g) a ∂μ := by
      apply lintegral_withDensity_eq_lintegral_mul_non_measurable _ hf.measurable_mk
      filter_upwards [h'f, hf.ae_eq_mk]
      intro x hx h'x
      rwa [← h'x]
    _ = ∫⁻ a, (f * g) a ∂μ := by
      

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f
h'f : ∀ᵐ (x : α) ∂μ, f x < ⊤
g : α → ℝ≥0∞
f' : α → ℝ≥0∞ := AEMeasurable.mk f hf
⊢ ∫⁻ (a : α), (f' * g) a ∂μ = ∫⁻ (a : α), (f * g) a ∂μ

Next tactic:
apply lintegral_congr_ae
theorem lintegral_withDensity_eq_lintegral_mul_non_measurable₀ (μ : Measure α) {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (h'f : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ := by
  let f' := hf.mk f
  calc
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, g a ∂μ.withDensity f' := by
      rw [withDensity_congr_ae hf.ae_eq_mk]
    _ = ∫⁻ a, (f' * g) a ∂μ := by
      apply lintegral_withDensity_eq_lintegral_mul_non_measurable _ hf.measurable_mk
      filter_upwards [h'f, hf.ae_eq_mk]
      intro x hx h'x
      rwa [← h'x]
    _ = ∫⁻ a, (f * g) a ∂μ := by
      apply lintegral_congr_ae
      

Proof state:
case h
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ : Measure α
f : α → ℝ≥0∞
hf : AEMeasurable f
h'f : ∀ᵐ (x : α) ∂μ, f x < ⊤
g : α → ℝ≥0∞
f' : α → ℝ≥0∞ := AEMeasurable.mk f hf
⊢ (fun a => (f' * g) a) =ᶠ[ae μ] fun a => (f * g) a

Next tactic:
filter_upwards [hf.ae_eq_mk]