-- Lean 4 proof step from Mathlib.MeasureTheory.Measure.Prokhorov (goal)
Goal:
E : Type u_1
inst : MeasurableSpace E
inst_1 : TopologicalSpace E
inst_2 : T2Space E
inst_3 : BorelSpace E
u : ℕ → ℝ≥0
K : ℕ → Set E
C : ℝ≥0
hu : Tendsto u atTop (𝓝 0)
hK : ∀ (n : ℕ), IsCompact (K n)
h : NormalSpace E ∨ Monotone K
I :
  ∀ (μ : FiniteMeasure E) (n : ℕ),
    ∑ i ∈ Finset.range (n + 1), μ.restrict (disjointed K i) = μ.restrict ((partialSups K : (a : ℕ) → Set E) n)
A : ∀ (n : ℕ), IsCompact.{u_1} (X := E) ((partialSups K : (a : ℕ) → Set E) n)
f : Ultrafilter (FiniteMeasure E)
hf : {μ : FiniteMeasure E | μ.mass ≤ C ∧ ∀ (n : ℕ), (μ : (a : Set E) → ℝ≥0) (K n)ᶜ ≤ u n} ∈ f
ν : (n : ℕ) → FiniteMeasure E
ν_reg : ∀ (n : ℕ), (↑(ν n) : Measure E).InnerRegular
νK : ∀ (n : ℕ), Eq (α := ℝ≥0) ((ν n : (a : Set E) → ℝ≥0) ((partialSups K : (a : ℕ) → Set E) n)ᶜ : ℝ≥0) (0 : ℝ≥0)
hν :
  ∀ (n : ℕ), Tendsto (fun (ρ : FiniteMeasure E) ↦ ρ.restrict (disjointed K n)) (↑f : Filter (FiniteMeasure E)) (𝓝 (ν n))
B : ((Measure.sum fun (n : ℕ) ↦ (↑(ν n) : Measure E) : Measure E) : (a : Set E) → ℝ≥0∞) univ ≤ (↑C : ℝ≥0∞)
μ : FiniteMeasure E :=
  Subtype.mk (p := fun (μ : Measure E) ↦ IsFiniteMeasure μ) (Measure.sum fun (n : ℕ) ↦ (↑(ν n) : Measure E)) ⋯
g : E →ᵇ ℝ
ε : ℝ
εpos : ε > 0
I1 :
  ∀ᶠ (n : ℕ) in atTop,
    dist (α := ℝ)
        (@integral _ _ _ _ inst (∑ i ∈ Finset.range (n + 1), (↑(ν i) : Measure E)) fun (x : E) ↦ (g : (a : E) → ℝ) x)
        (∫ (x : E), (g : (a : E) → ℝ) x ∂(↑μ : Measure E)) <
      ε / 3
I2 : ∀ᶠ (n : ℕ) in atTop, ‖g‖ * (↑(u n) : ℝ) < ε / 3
n : ℕ
hn :
  dist (α := ℝ)
      (@integral _ _ _ _ inst (∑ i ∈ Finset.range (n + 1), (↑(ν i) : Measure E)) fun (x : E) ↦ (g : (a : E) → ℝ) x)
      (∫ (x : E), (g : (a : E) → ℝ) x ∂(↑μ : Measure E)) <
    ε / 3
h'n : ‖g‖ * (↑(u n) : ℝ) < ε / 3
this_1 :
  Tendsto (β := ℝ)
    (fun (ρ : FiniteMeasure E) ↦
      @integral _ _ _ _ inst (↑(∑ i ∈ Finset.range (n + 1), ρ.restrict (disjointed K i)) : Measure E) fun (x : E) ↦
        (g : (a : E) → ℝ) x)
    (↑f : Filter (FiniteMeasure E))
    (𝓝 (@integral _ _ _ _ inst (↑(∑ i ∈ Finset.range (n + 1), ν i) : Measure E) fun (x : E) ↦ (g : (a : E) → ℝ) x))
ρ : FiniteMeasure E
hρ :
  dist (α := ℝ)
      (@integral _ _ _ _ inst (↑(∑ i ∈ Finset.range (n + 1), ρ.restrict (disjointed K i)) : Measure E) fun (x : E) ↦
        (g : (a : E) → ℝ) x)
      (@integral _ _ _ _ inst (↑(∑ i ∈ Finset.range (n + 1), ν i) : Measure E) fun (x : E) ↦ (g : (a : E) → ℝ) x) <
    ε / 3
h'ρ : ρ.mass ≤ C ∧ ∀ (n : ℕ), (ρ : (a : Set E) → ℝ≥0) (K n)ᶜ ≤ u n
this : ρ = ρ.restrict ((partialSups K : (a : ℕ) → Set E) n)ᶜ + ∑ i ∈ Finset.range (n + 1), ρ.restrict (disjointed K i)
calc :
  LE.le (α := ℝ)
    (∫ (x : E),
      norm (E := ℝ) ((g : (a : E) → ℝ) x : ℝ) ∂(↑(ρ.restrict ((partialSups K : (a : ℕ) → Set E) n)ᶜ) : Measure E))
    (∫ (x : E), ‖g‖ ∂(↑(ρ.restrict ((partialSups K : (a : ℕ) → Set E) n)ᶜ) : Measure E))
calc₁ :
  ∫ (x : E), ‖g‖ ∂(↑(ρ.restrict ((partialSups K : (a : ℕ) → Set E) n)ᶜ) : Measure E) =
    ‖g‖ * (↑((ρ : (a : Set E) → ℝ≥0) ((partialSups K : (a : ℕ) → Set E) n)ᶜ) : ℝ)
⊢ norm (E := ℝ) (∫ (x : E), (g : (a : E) → ℝ) x ∂(↑(ρ.restrict ((partialSups K : (a : ℕ) → Set E) n)ᶜ) : Measure E)) <
    ε / 3
have calc₂ : ‖g‖ * (↑((ρ : (a : Set E) → ℝ≥0) ((partialSups K : (a : ℕ) → Set E) n)ᶜ) : ℝ) ≤
  ‖g‖ * (↑((ρ : (a : Set E) → ℝ≥0) (K n)ᶜ) : ℝ)
Tactic: calc ‖∫ x, g x ∂(ρ.restrict ((partialSups K) n)ᶜ)‖
        _ ≤ ∫ x, ‖g x‖ ∂(ρ.restrict ((partialSups K) n)ᶜ) := norm_integral_le_integral_norm _
        _ ≤ ∫ x, ‖g‖ ∂(ρ.restrict ((partialSups K) n)ᶜ : Measure E) := by
          apply integral_mono_of_nonneg
          · filter_upwards with x using by positivity
          · simp
          · filter_upwards with x using norm_coe_le_norm g x
        _ = ‖g‖ * ρ ((partialSups K) n)ᶜ := by simp [mul_comm]
        _ ≤ ‖g‖ * ρ (K n)ᶜ := by gcongr; apply le_partialSups
        _ ≤ ‖g‖ * u n := by gcongr; exact h'ρ.2 n
        _ < ε / 3 := h'n