l3lab/ntp-mathlib huggingface dataset:
lemma integral_le_liminf_integral_of_forall_isOpen_measure_le_liminf_measure
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ℕ → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    {f : Ω →ᵇ ℝ} (f_nn : 0 ≤ f)
    (h_opens : ∀ G, IsOpen G → μ G ≤ atTop.liminf (fun i ↦ μs i G)) :
    ∫ x, (f x) ∂μ ≤ atTop.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)) := by
  have same := lintegral_le_liminf_lintegral_of_forall_isOpen_measure_le_liminf_measure
                  f.continuous f_nn h_opens
  rw [@integral_eq_lintegral_of_nonneg_ae Ω _ μ f (eventually_of_forall f_nn)
        f.continuous.measurable.aestronglyMeasurable]
  convert (ENNReal.toReal_le_toReal ?_ ?_).mpr same
  · simp only [fun i ↦ @integral_eq_lintegral_of_nonneg_ae Ω _ (μs i) f (eventually_of_forall f_nn)
                        f.continuous.measurable.aestronglyMeasurable]
    let g := BoundedContinuousFunction.comp _ Real.lipschitzWith_toNNReal f
    have bound : ∀ i, ∫⁻ x, ENNReal.ofReal (f x) ∂(μs i) ≤ nndist 0 g := fun i ↦ by
      simpa only [coe_nnreal_ennreal_nndist, measure_univ, mul_one, ge_iff_le] using
            BoundedContinuousFunction.lintegral_le_edist_mul (μ := μs i) g
    apply ENNReal.liminf_toReal_eq ENNReal.coe_ne_top (eventually_of_forall bound)
  · exact (f.lintegral_of_real_lt_top μ).ne
  · apply ne_of_lt
    have obs := fun (i : ℕ) ↦ @BoundedContinuousFunction.lintegral_nnnorm_le Ω _ _ (μs i) ℝ _ f
    simp only [measure_univ, mul_one] at obs
    apply lt_of_le_of_lt _ (show (‖f‖₊ : ℝ≥0∞) < ∞ from ENNReal.coe_lt_top)
    apply liminf_le_of_le
    · refine ⟨0, eventually_of_forall (by simp only [ge_iff_le, zero_le, forall_const])⟩
    · intro x hx
      obtain ⟨i, hi⟩ := hx.exists
      apply le_trans hi
      convert obs i with x
      have aux := ENNReal.ofReal_eq_coe_nnreal (f_nn x)
      simp only [ContinuousMap.toFun_eq_coe, BoundedContinuousFunction.coe_to_continuous_fun] at aux
      rw [aux]
      congr
      

Proof state:
case h.e'_3.h.e'_4.h.e_a.e_val
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ℕ → Measure Ω
inst✝ : ∀ (i : ℕ), IsProbabilityMeasure (μs i)
f : Ω →ᵇ ℝ
f_nn : 0 ≤ f
h_opens : ∀ (G : Set Ω), IsOpen G → ↑↑μ G ≤ liminf (fun i => ↑↑(μs i) G) atTop
same : ∫⁻ (x : Ω), ENNReal.ofReal (f x) ∂μ ≤ liminf (fun i => ∫⁻ (x : Ω), ENNReal.ofReal (f x) ∂μs i) atTop
obs : ∀ (i : ℕ), ∫⁻ (x : Ω), ↑‖f x‖₊ ∂μs i ≤ ↑‖f‖₊
x✝ : ℝ≥0∞
hx : ∀ᶠ (n : ℕ) in atTop, x✝ ≤ ∫⁻ (x : Ω), ENNReal.ofReal (f x) ∂μs n
i : ℕ
hi : x✝ ≤ ∫⁻ (x : Ω), ENNReal.ofReal (f x) ∂μs i
x : Ω
aux : ENNReal.ofReal (f x) = ↑{ val := f x, property := (_ : (fun r => 0 ≤ r) (f x)) }
⊢ f x = ‖f x‖

Next tactic:
exact (Real.norm_of_nonneg (f_nn x)).symm
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  

Proof state:
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
⊢ Tendsto (fun i => ∫ (x : Ω), f x ∂μs i) L (𝓝 (∫ (x : Ω), f x ∂μ))

Next tactic:
rcases eq_or_neBot L with rfl|hL
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · 

Proof state:
case inl
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
f : Ω →ᵇ ℝ
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) ⊥
⊢ Tendsto (fun i => ∫ (x : Ω), f x ∂μs i) ⊥ (𝓝 (∫ (x : Ω), f x ∂μ))

Next tactic:
simp only [tendsto_bot]
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  

Proof state:
case inr
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
⊢ Tendsto (fun i => ∫ (x : Ω), f x ∂μs i) L (𝓝 (∫ (x : Ω), f x ∂μ))

Next tactic:
have obs := BoundedContinuousFunction.isBounded_range_integral μs f
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
  

Proof state:
case inr
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
obs : Bornology.IsBounded (range fun i => ∫ (x : Ω), f x ∂μs i)
⊢ Tendsto (fun i => ∫ (x : Ω), f x ∂μs i) L (𝓝 (∫ (x : Ω), f x ∂μ))

Next tactic:
have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_le_map_of_bounded_range _ obs
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_le_map_of_bounded_range _ obs
  

Proof state:
case inr
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
obs : Bornology.IsBounded (range fun i => ∫ (x : Ω), f x ∂μs i)
bdd_above : IsBoundedUnder (fun x x_1 => x ≤ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
⊢ Tendsto (fun i => ∫ (x : Ω), f x ∂μs i) L (𝓝 (∫ (x : Ω), f x ∂μ))

Next tactic:
have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_ge_map_of_bounded_range _ obs
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_le_map_of_bounded_range _ obs
  have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_ge_map_of_bounded_range _ obs
  

Proof state:
case inr
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
obs : Bornology.IsBounded (range fun i => ∫ (x : Ω), f x ∂μs i)
bdd_above : IsBoundedUnder (fun x x_1 => x ≤ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
bdd_below : IsBoundedUnder (fun x x_1 => x ≥ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
⊢ Tendsto (fun i => ∫ (x : Ω), f x ∂μs i) L (𝓝 (∫ (x : Ω), f x ∂μ))

Next tactic:
apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, (f x) ∂ (μs i)) (∫ x, (f x) ∂μ)
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_le_map_of_bounded_range _ obs
  have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_ge_map_of_bounded_range _ obs
  apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, (f x) ∂ (μs i)) (∫ x, (f x) ∂μ)
  · 

Proof state:
case inr.hinf
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
obs : Bornology.IsBounded (range fun i => ∫ (x : Ω), f x ∂μs i)
bdd_above : IsBoundedUnder (fun x x_1 => x ≤ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
bdd_below : IsBoundedUnder (fun x x_1 => x ≥ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
⊢ ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L

Next tactic:
have key := h _ (f.add_norm_nonneg)
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_le_map_of_bounded_range _ obs
  have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_ge_map_of_bounded_range _ obs
  apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, (f x) ∂ (μs i)) (∫ x, (f x) ∂μ)
  · have key := h _ (f.add_norm_nonneg)
    

Proof state:
case inr.hinf
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
obs : Bornology.IsBounded (range fun i => ∫ (x : Ω), f x ∂μs i)
bdd_above : IsBoundedUnder (fun x x_1 => x ≤ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
bdd_below : IsBoundedUnder (fun x x_1 => x ≥ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
key : ∫ (x : Ω), (f + const Ω ‖f‖) x ∂μ ≤ liminf (fun i => ∫ (x : Ω), (f + const Ω ‖f‖) x ∂μs i) L
⊢ ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L

Next tactic:
simp_rw [f.integral_add_const ‖f‖] at key
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_le_map_of_bounded_range _ obs
  have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_ge_map_of_bounded_range _ obs
  apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, (f x) ∂ (μs i)) (∫ x, (f x) ∂μ)
  · have key := h _ (f.add_norm_nonneg)
    simp_rw [f.integral_add_const ‖f‖] at key
    

Proof state:
case inr.hinf
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
obs : Bornology.IsBounded (range fun i => ∫ (x : Ω), f x ∂μs i)
bdd_above : IsBoundedUnder (fun x x_1 => x ≤ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
bdd_below : IsBoundedUnder (fun x x_1 => x ≥ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
key :
  ∫ (x : Ω), f x ∂μ + ENNReal.toReal (↑↑μ univ) • ‖f‖ ≤
    liminf (fun i => ∫ (x : Ω), f x ∂μs i + ENNReal.toReal (↑↑(μs i) univ) • ‖f‖) L
⊢ ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L

Next tactic:
simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_le_map_of_bounded_range _ obs
  have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_ge_map_of_bounded_range _ obs
  apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, (f x) ∂ (μs i)) (∫ x, (f x) ∂μ)
  · have key := h _ (f.add_norm_nonneg)
    simp_rw [f.integral_add_const ‖f‖] at key
    simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
    

Proof state:
case inr.hinf
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
obs : Bornology.IsBounded (range fun i => ∫ (x : Ω), f x ∂μs i)
bdd_above : IsBoundedUnder (fun x x_1 => x ≤ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
bdd_below : IsBoundedUnder (fun x x_1 => x ≥ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
key : ∫ (x : Ω), f x ∂μ + ‖f‖ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i + ‖f‖) L
⊢ ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L

Next tactic:
have := liminf_add_const L (fun i ↦ ∫ x, (f x) ∂ (μs i)) ‖f‖ bdd_above bdd_below
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_le_map_of_bounded_range _ obs
  have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_ge_map_of_bounded_range _ obs
  apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, (f x) ∂ (μs i)) (∫ x, (f x) ∂μ)
  · have key := h _ (f.add_norm_nonneg)
    simp_rw [f.integral_add_const ‖f‖] at key
    simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
    have := liminf_add_const L (fun i ↦ ∫ x, (f x) ∂ (μs i)) ‖f‖ bdd_above bdd_below
    

Proof state:
case inr.hinf
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
obs : Bornology.IsBounded (range fun i => ∫ (x : Ω), f x ∂μs i)
bdd_above : IsBoundedUnder (fun x x_1 => x ≤ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
bdd_below : IsBoundedUnder (fun x x_1 => x ≥ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
key : ∫ (x : Ω), f x ∂μ + ‖f‖ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i + ‖f‖) L
this : liminf (fun i => (fun i => ∫ (x : Ω), f x ∂μs i) i + ‖f‖) L = liminf (fun i => ∫ (x : Ω), f x ∂μs i) L + ‖f‖
⊢ ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L

Next tactic:
rwa [this, add_le_add_iff_right] at key
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_le_map_of_bounded_range _ obs
  have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_ge_map_of_bounded_range _ obs
  apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, (f x) ∂ (μs i)) (∫ x, (f x) ∂μ)
  · have key := h _ (f.add_norm_nonneg)
    simp_rw [f.integral_add_const ‖f‖] at key
    simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
    have := liminf_add_const L (fun i ↦ ∫ x, (f x) ∂ (μs i)) ‖f‖ bdd_above bdd_below
    rwa [this, add_le_add_iff_right] at key
  · 

Proof state:
case inr.hsup
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
obs : Bornology.IsBounded (range fun i => ∫ (x : Ω), f x ∂μs i)
bdd_above : IsBoundedUnder (fun x x_1 => x ≤ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
bdd_below : IsBoundedUnder (fun x x_1 => x ≥ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
⊢ limsup (fun i => ∫ (x : Ω), f x ∂μs i) L ≤ ∫ (x : Ω), f x ∂μ

Next tactic:
have key := h _ (f.norm_sub_nonneg)
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_le_map_of_bounded_range _ obs
  have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_ge_map_of_bounded_range _ obs
  apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, (f x) ∂ (μs i)) (∫ x, (f x) ∂μ)
  · have key := h _ (f.add_norm_nonneg)
    simp_rw [f.integral_add_const ‖f‖] at key
    simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
    have := liminf_add_const L (fun i ↦ ∫ x, (f x) ∂ (μs i)) ‖f‖ bdd_above bdd_below
    rwa [this, add_le_add_iff_right] at key
  · have key := h _ (f.norm_sub_nonneg)
    

Proof state:
case inr.hsup
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
obs : Bornology.IsBounded (range fun i => ∫ (x : Ω), f x ∂μs i)
bdd_above : IsBoundedUnder (fun x x_1 => x ≤ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
bdd_below : IsBoundedUnder (fun x x_1 => x ≥ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
key : ∫ (x : Ω), (const Ω ‖f‖ - f) x ∂μ ≤ liminf (fun i => ∫ (x : Ω), (const Ω ‖f‖ - f) x ∂μs i) L
⊢ limsup (fun i => ∫ (x : Ω), f x ∂μs i) L ≤ ∫ (x : Ω), f x ∂μ

Next tactic:
simp_rw [f.integral_const_sub ‖f‖] at key
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
    (f : Ω →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
  rcases eq_or_neBot L with rfl|hL
  · simp only [tendsto_bot]
  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_le_map_of_bounded_range _ obs
  have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
    isBounded_ge_map_of_bounded_range _ obs
  apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, (f x) ∂ (μs i)) (∫ x, (f x) ∂μ)
  · have key := h _ (f.add_norm_nonneg)
    simp_rw [f.integral_add_const ‖f‖] at key
    simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
    have := liminf_add_const L (fun i ↦ ∫ x, (f x) ∂ (μs i)) ‖f‖ bdd_above bdd_below
    rwa [this, add_le_add_iff_right] at key
  · have key := h _ (f.norm_sub_nonneg)
    simp_rw [f.integral_const_sub ‖f‖] at key
    

Proof state:
case inr.hsup
Ω : Type u_1
inst✝⁴ : MeasurableSpace Ω
inst✝³ : TopologicalSpace Ω
inst✝² : OpensMeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
μs : ι → Measure Ω
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
h : ∀ (f : Ω →ᵇ ℝ), 0 ≤ f → ∫ (x : Ω), f x ∂μ ≤ liminf (fun i => ∫ (x : Ω), f x ∂μs i) L
f : Ω →ᵇ ℝ
hL : NeBot L
obs : Bornology.IsBounded (range fun i => ∫ (x : Ω), f x ∂μs i)
bdd_above : IsBoundedUnder (fun x x_1 => x ≤ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
bdd_below : IsBoundedUnder (fun x x_1 => x ≥ x_1) L fun i => ∫ (x : Ω), f x ∂μs i
key :
  ENNReal.toReal (↑↑μ univ) • ‖f‖ - ∫ (x : Ω), f x ∂μ ≤
    liminf (fun i => ENNReal.toReal (↑↑(μs i) univ) • ‖f‖ - ∫ (x : Ω), f x ∂μs i) L
⊢ limsup (fun i => ∫ (x : Ω), f x ∂μs i) L ≤ ∫ (x : Ω), f x ∂μ

Next tactic:
simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key