l3lab/ntp-mathlib huggingface dataset:
theorem ae_le_of_forall_set_lintegral_le_of_sigmaFinite₀ [SigmaFinite μ]
    {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ)
    (h : ∀ s, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in s, g x ∂μ) :
    f ≤ᵐ[μ] g := by
  have h' : ∀ s, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, hf.mk f x ∂μ ≤ ∫⁻ x in s, hg.mk g x ∂μ := by
    refine fun s hs hμs ↦ (set_lintegral_congr_fun hs ?_).trans_le
      ((h s hs hμs).trans_eq (set_lintegral_congr_fun hs ?_))
    · filter_upwards [hf.ae_eq_mk] with a ha using fun _ ↦ ha.symm
    · filter_upwards [hg.ae_eq_mk] with a ha using fun _ ↦ ha
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
p : ℝ≥0∞
inst✝ : SigmaFinite μ
f g : α → ℝ≥0∞
hf : AEMeasurable f
hg : AEMeasurable g
h : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → ∫⁻ (x : α) in s, f x ∂μ ≤ ∫⁻ (x : α) in s, g x ∂μ
h' :
  ∀ (s : Set α),
    MeasurableSet s →
      ↑↑μ s < ⊤ → ∫⁻ (x : α) in s, AEMeasurable.mk f hf x ∂μ ≤ ∫⁻ (x : α) in s, AEMeasurable.mk g hg x ∂μ
⊢ f ≤ᵐ[μ] g

Next tactic:
filter_upwards [hf.ae_eq_mk, hg.ae_eq_mk,
    ae_le_of_forall_set_lintegral_le_of_sigmaFinite hf.measurable_mk hg.measurable_mk h']
    with a haf hag ha
theorem ae_le_of_forall_set_lintegral_le_of_sigmaFinite₀ [SigmaFinite μ]
    {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ)
    (h : ∀ s, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in s, g x ∂μ) :
    f ≤ᵐ[μ] g := by
  have h' : ∀ s, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, hf.mk f x ∂μ ≤ ∫⁻ x in s, hg.mk g x ∂μ := by
    refine fun s hs hμs ↦ (set_lintegral_congr_fun hs ?_).trans_le
      ((h s hs hμs).trans_eq (set_lintegral_congr_fun hs ?_))
    · filter_upwards [hf.ae_eq_mk] with a ha using fun _ ↦ ha.symm
    · filter_upwards [hg.ae_eq_mk] with a ha using fun _ ↦ ha
  filter_upwards [hf.ae_eq_mk, hg.ae_eq_mk,
    ae_le_of_forall_set_lintegral_le_of_sigmaFinite hf.measurable_mk hg.measurable_mk h']
    with a haf hag ha
  

Proof state:
case h
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
p : ℝ≥0∞
inst✝ : SigmaFinite μ
f g : α → ℝ≥0∞
hf : AEMeasurable f
hg : AEMeasurable g
h : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → ∫⁻ (x : α) in s, f x ∂μ ≤ ∫⁻ (x : α) in s, g x ∂μ
h' :
  ∀ (s : Set α),
    MeasurableSet s →
      ↑↑μ s < ⊤ → ∫⁻ (x : α) in s, AEMeasurable.mk f hf x ∂μ ≤ ∫⁻ (x : α) in s, AEMeasurable.mk g hg x ∂μ
a : α
haf : f a = AEMeasurable.mk f hf a
hag : g a = AEMeasurable.mk g hg a
ha : AEMeasurable.mk f hf a ≤ AEMeasurable.mk g hg a
⊢ f a ≤ g a

Next tactic:
rwa [haf, hag]
theorem ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite₀ [SigmaFinite μ]
    {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ)
    (h : ∀ s, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, f x ∂μ = ∫⁻ x in s, g x ∂μ) : f =ᵐ[μ] g := by
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
p : ℝ≥0∞
inst✝ : SigmaFinite μ
f g : α → ℝ≥0∞
hf : AEMeasurable f
hg : AEMeasurable g
h : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → ∫⁻ (x : α) in s, f x ∂μ = ∫⁻ (x : α) in s, g x ∂μ
⊢ f =ᵐ[μ] g

Next tactic:
have A : f ≤ᵐ[μ] g :=
    ae_le_of_forall_set_lintegral_le_of_sigmaFinite₀ hf hg fun s hs h's => le_of_eq (h s hs h's)
theorem ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite₀ [SigmaFinite μ]
    {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ)
    (h : ∀ s, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, f x ∂μ = ∫⁻ x in s, g x ∂μ) : f =ᵐ[μ] g := by
  have A : f ≤ᵐ[μ] g :=
    ae_le_of_forall_set_lintegral_le_of_sigmaFinite₀ hf hg fun s hs h's => le_of_eq (h s hs h's)
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
p : ℝ≥0∞
inst✝ : SigmaFinite μ
f g : α → ℝ≥0∞
hf : AEMeasurable f
hg : AEMeasurable g
h : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → ∫⁻ (x : α) in s, f x ∂μ = ∫⁻ (x : α) in s, g x ∂μ
A : f ≤ᵐ[μ] g
⊢ f =ᵐ[μ] g

Next tactic:
have B : g ≤ᵐ[μ] f :=
    ae_le_of_forall_set_lintegral_le_of_sigmaFinite₀ hg hf fun s hs h's => ge_of_eq (h s hs h's)
theorem ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite₀ [SigmaFinite μ]
    {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ)
    (h : ∀ s, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, f x ∂μ = ∫⁻ x in s, g x ∂μ) : f =ᵐ[μ] g := by
  have A : f ≤ᵐ[μ] g :=
    ae_le_of_forall_set_lintegral_le_of_sigmaFinite₀ hf hg fun s hs h's => le_of_eq (h s hs h's)
  have B : g ≤ᵐ[μ] f :=
    ae_le_of_forall_set_lintegral_le_of_sigmaFinite₀ hg hf fun s hs h's => ge_of_eq (h s hs h's)
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
p : ℝ≥0∞
inst✝ : SigmaFinite μ
f g : α → ℝ≥0∞
hf : AEMeasurable f
hg : AEMeasurable g
h : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → ∫⁻ (x : α) in s, f x ∂μ = ∫⁻ (x : α) in s, g x ∂μ
A : f ≤ᵐ[μ] g
B : g ≤ᵐ[μ] f
⊢ f =ᵐ[μ] g

Next tactic:
filter_upwards [A, B] with x using le_antisymm
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
⊢ 0 ≤ᵐ[μ] f

Next tactic:
simp_rw [EventuallyLE, Pi.zero_apply]
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
⊢ ∀ᵐ (x : α) ∂μ, 0 ≤ f x

Next tactic:
rw [ae_const_le_iff_forall_lt_measure_zero]
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
⊢ ∀ b < 0, ↑↑μ {x | f x ≤ b} = 0

Next tactic:
intro b hb_neg
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
⊢ ↑↑μ {x | f x ≤ b} = 0

Next tactic:
let s := {x | f x ≤ b}
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  let s := {x | f x ≤ b}
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
s : Set α := {x | f x ≤ b}
⊢ ↑↑μ {x | f x ≤ b} = 0

Next tactic:
have hs : MeasurableSet s := hfm.measurableSet_le stronglyMeasurable_const
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  let s := {x | f x ≤ b}
  have hs : MeasurableSet s := hfm.measurableSet_le stronglyMeasurable_const
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
s : Set α := {x | f x ≤ b}
hs : MeasurableSet s
⊢ ↑↑μ {x | f x ≤ b} = 0

Next tactic:
have mus : μ s < ∞ := by
    let c : ℝ≥0 := ⟨|b|, abs_nonneg _⟩
    have c_pos : (c : ℝ≥0∞) ≠ 0 := by simpa [← NNReal.coe_eq_zero] using hb_neg.ne
    calc
      μ s ≤ μ {x | (c : ℝ≥0∞) ≤ ‖f x‖₊} := by
        apply measure_mono
        intro x hx
        simp only [Set.mem_setOf_eq] at hx
        simpa only [nnnorm, abs_of_neg hb_neg, abs_of_neg (hx.trans_lt hb_neg), Real.norm_eq_abs,
          Subtype.mk_le_mk, neg_le_neg_iff, Set.mem_setOf_eq, ENNReal.coe_le_coe, NNReal] using hx
      _ ≤ (∫⁻ x, ‖f x‖₊ ∂μ) / c :=
        (meas_ge_le_lintegral_div hfm.aemeasurable.ennnorm c_pos ENNReal.coe_ne_top)
      _ < ∞ := ENNReal.div_lt_top (ne_of_lt hf.2) c_pos
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  let s := {x | f x ≤ b}
  have hs : MeasurableSet s := hfm.measurableSet_le stronglyMeasurable_const
  have mus : μ s < ∞ := by
    

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
s : Set α := {x | f x ≤ b}
hs : MeasurableSet s
⊢ ↑↑μ s < ⊤

Next tactic:
let c : ℝ≥0 := ⟨|b|, abs_nonneg _⟩
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  let s := {x | f x ≤ b}
  have hs : MeasurableSet s := hfm.measurableSet_le stronglyMeasurable_const
  have mus : μ s < ∞ := by
    let c : ℝ≥0 := ⟨|b|, abs_nonneg _⟩
    

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
s : Set α := {x | f x ≤ b}
hs : MeasurableSet s
c : ℝ≥0 := { val := |b|, property := (_ : 0 ≤ |b|) }
⊢ ↑↑μ s < ⊤

Next tactic:
have c_pos : (c : ℝ≥0∞) ≠ 0 := by simpa [← NNReal.coe_eq_zero] using hb_neg.ne
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  let s := {x | f x ≤ b}
  have hs : MeasurableSet s := hfm.measurableSet_le stronglyMeasurable_const
  have mus : μ s < ∞ := by
    let c : ℝ≥0 := ⟨|b|, abs_nonneg _⟩
    have c_pos : (c : ℝ≥0∞) ≠ 0 := by 

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
s : Set α := {x | f x ≤ b}
hs : MeasurableSet s
c : ℝ≥0 := { val := |b|, property := (_ : 0 ≤ |b|) }
⊢ ↑c ≠ 0

Next tactic:
simpa [← NNReal.coe_eq_zero] using hb_neg.ne
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  let s := {x | f x ≤ b}
  have hs : MeasurableSet s := hfm.measurableSet_le stronglyMeasurable_const
  have mus : μ s < ∞ := by
    let c : ℝ≥0 := ⟨|b|, abs_nonneg _⟩
    have c_pos : (c : ℝ≥0∞) ≠ 0 := by simpa [← NNReal.coe_eq_zero] using hb_neg.ne
    

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
s : Set α := {x | f x ≤ b}
hs : MeasurableSet s
c : ℝ≥0 := { val := |b|, property := (_ : 0 ≤ |b|) }
c_pos : ↑c ≠ 0
⊢ ↑↑μ s < ⊤

Next tactic:
calc
      μ s ≤ μ {x | (c : ℝ≥0∞) ≤ ‖f x‖₊} := by
        apply measure_mono
        intro x hx
        simp only [Set.mem_setOf_eq] at hx
        simpa only [nnnorm, abs_of_neg hb_neg, abs_of_neg (hx.trans_lt hb_neg), Real.norm_eq_abs,
          Subtype.mk_le_mk, neg_le_neg_iff, Set.mem_setOf_eq, ENNReal.coe_le_coe, NNReal] using hx
      _ ≤ (∫⁻ x, ‖f x‖₊ ∂μ) / c :=
        (meas_ge_le_lintegral_div hfm.aemeasurable.ennnorm c_pos ENNReal.coe_ne_top)
      _ < ∞ := ENNReal.div_lt_top (ne_of_lt hf.2) c_pos
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  let s := {x | f x ≤ b}
  have hs : MeasurableSet s := hfm.measurableSet_le stronglyMeasurable_const
  have mus : μ s < ∞ := by
    let c : ℝ≥0 := ⟨|b|, abs_nonneg _⟩
    have c_pos : (c : ℝ≥0∞) ≠ 0 := by simpa [← NNReal.coe_eq_zero] using hb_neg.ne
    calc
      μ s ≤ μ {x | (c : ℝ≥0∞) ≤ ‖f x‖₊} := by
        

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
s : Set α := {x | f x ≤ b}
hs : MeasurableSet s
c : ℝ≥0 := { val := |b|, property := (_ : 0 ≤ |b|) }
c_pos : ↑c ≠ 0
⊢ ↑↑μ s ≤ ↑↑μ {x | ↑c ≤ ↑‖f x‖₊}

Next tactic:
apply measure_mono
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  let s := {x | f x ≤ b}
  have hs : MeasurableSet s := hfm.measurableSet_le stronglyMeasurable_const
  have mus : μ s < ∞ := by
    let c : ℝ≥0 := ⟨|b|, abs_nonneg _⟩
    have c_pos : (c : ℝ≥0∞) ≠ 0 := by simpa [← NNReal.coe_eq_zero] using hb_neg.ne
    calc
      μ s ≤ μ {x | (c : ℝ≥0∞) ≤ ‖f x‖₊} := by
        apply measure_mono
        

Proof state:
case h
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
s : Set α := {x | f x ≤ b}
hs : MeasurableSet s
c : ℝ≥0 := { val := |b|, property := (_ : 0 ≤ |b|) }
c_pos : ↑c ≠ 0
⊢ s ⊆ {x | ↑c ≤ ↑‖f x‖₊}

Next tactic:
intro x hx
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  let s := {x | f x ≤ b}
  have hs : MeasurableSet s := hfm.measurableSet_le stronglyMeasurable_const
  have mus : μ s < ∞ := by
    let c : ℝ≥0 := ⟨|b|, abs_nonneg _⟩
    have c_pos : (c : ℝ≥0∞) ≠ 0 := by simpa [← NNReal.coe_eq_zero] using hb_neg.ne
    calc
      μ s ≤ μ {x | (c : ℝ≥0∞) ≤ ‖f x‖₊} := by
        apply measure_mono
        intro x hx
        

Proof state:
case h
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
s : Set α := {x | f x ≤ b}
hs : MeasurableSet s
c : ℝ≥0 := { val := |b|, property := (_ : 0 ≤ |b|) }
c_pos : ↑c ≠ 0
x : α
hx : x ∈ s
⊢ x ∈ {x | ↑c ≤ ↑‖f x‖₊}

Next tactic:
simp only [Set.mem_setOf_eq] at hx
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  let s := {x | f x ≤ b}
  have hs : MeasurableSet s := hfm.measurableSet_le stronglyMeasurable_const
  have mus : μ s < ∞ := by
    let c : ℝ≥0 := ⟨|b|, abs_nonneg _⟩
    have c_pos : (c : ℝ≥0∞) ≠ 0 := by simpa [← NNReal.coe_eq_zero] using hb_neg.ne
    calc
      μ s ≤ μ {x | (c : ℝ≥0∞) ≤ ‖f x‖₊} := by
        apply measure_mono
        intro x hx
        simp only [Set.mem_setOf_eq] at hx
        

Proof state:
case h
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
s : Set α := {x | f x ≤ b}
hs : MeasurableSet s
c : ℝ≥0 := { val := |b|, property := (_ : 0 ≤ |b|) }
c_pos : ↑c ≠ 0
x : α
hx : f x ≤ b
⊢ x ∈ {x | ↑c ≤ ↑‖f x‖₊}

Next tactic:
simpa only [nnnorm, abs_of_neg hb_neg, abs_of_neg (hx.trans_lt hb_neg), Real.norm_eq_abs,
          Subtype.mk_le_mk, neg_le_neg_iff, Set.mem_setOf_eq, ENNReal.coe_le_coe, NNReal] using hx
/-- Don't use this lemma. Use `ae_nonneg_of_forall_set_integral_nonneg`. -/
theorem ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable (hfm : StronglyMeasurable f)
    (hf : Integrable f μ) (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) :
    0 ≤ᵐ[μ] f := by
  simp_rw [EventuallyLE, Pi.zero_apply]
  rw [ae_const_le_iff_forall_lt_measure_zero]
  intro b hb_neg
  let s := {x | f x ≤ b}
  have hs : MeasurableSet s := hfm.measurableSet_le stronglyMeasurable_const
  have mus : μ s < ∞ := by
    let c : ℝ≥0 := ⟨|b|, abs_nonneg _⟩
    have c_pos : (c : ℝ≥0∞) ≠ 0 := by simpa [← NNReal.coe_eq_zero] using hb_neg.ne
    calc
      μ s ≤ μ {x | (c : ℝ≥0∞) ≤ ‖f x‖₊} := by
        apply measure_mono
        intro x hx
        simp only [Set.mem_setOf_eq] at hx
        simpa only [nnnorm, abs_of_neg hb_neg, abs_of_neg (hx.trans_lt hb_neg), Real.norm_eq_abs,
          Subtype.mk_le_mk, neg_le_neg_iff, Set.mem_setOf_eq, ENNReal.coe_le_coe, NNReal] using hx
      _ ≤ (∫⁻ x, ‖f x‖₊ ∂μ) / c :=
        (meas_ge_le_lintegral_div hfm.aemeasurable.ennnorm c_pos ENNReal.coe_ne_top)
      _ < ∞ := ENNReal.div_lt_top (ne_of_lt hf.2) c_pos
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
p : ℝ≥0∞
f : α → ℝ
hfm : StronglyMeasurable f
hf : Integrable f
hf_zero : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ
b : ℝ
hb_neg : b < 0
s : Set α := {x | f x ≤ b}
hs : MeasurableSet s
mus : ↑↑μ s < ⊤
⊢ ↑↑μ {x | f x ≤ b} = 0

Next tactic:
have h_int_gt : (∫ x in s, f x ∂μ) ≤ b * (μ s).toReal := by
    have h_const_le : (∫ x in s, f x ∂μ) ≤ ∫ _ in s, b ∂μ := by
      refine'
        set_integral_mono_ae_restrict hf.integrableOn (integrableOn_const.mpr (Or.inr mus)) _
      rw [EventuallyLE, ae_restrict_iff hs]
      exact eventually_of_forall fun x hxs => hxs
    rwa [set_integral_const, smul_eq_mul, mul_comm] at h_const_le