-- Mathlib/MeasureTheory/Integral/BoundedContinuousFunction.lean
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
    {μ : Measure X} [IsProbabilityMeasure μ] {μs : ι → Measure X} [∀ i, IsProbabilityMeasure (μs i)]
    (h : ∀ f : X →ᵇ ℝ, 0 ≤ f → ∫ x, f x ∂μ ≤ L.liminf (fun i ↦ ∫ x, f x ∂ (μs i)))
    (f : X →ᵇ ℝ) :
    Tendsto (fun i ↦ ∫ x, f x ∂ (μs i)) L (𝓝 (∫ x, f x ∂μ))

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

Tactic:
rwa [this, sub_le_sub_iff_left] at key

Result:
no goals

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

Tactic:
have := liminf_add_const L (fun i ↦ ∫ x, f x ∂ (μs i)) ‖f‖ bdd_above.isCobounded_ge bdd_below

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

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

Tactic:
simp_rw [f.integral_add_const ‖f‖] at key

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

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

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

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