-- Mathlib/MeasureTheory/Measure/LevyProkhorovMetric.lean
lemma levyProkhorovEDist_triangle [OpensMeasurableSpace Ω] (μ ν κ : Measure Ω) :
    levyProkhorovEDist μ κ ≤ levyProkhorovEDist μ ν + levyProkhorovEDist ν κ

Proof state:
case neg.h
Ω : Type u_1
inst✝² : MeasurableSpace Ω
inst✝¹ : PseudoEMetricSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ ν κ : Measure Ω
LPμν_finite : ¬levyProkhorovEDist μ ν = ⊤
LPνκ_finite : ¬levyProkhorovEDist ν κ = ⊤
ε : ℝ≥0∞
B : Set Ω
ε_pos : 0 < ε
ε_lt_top : ε < ⊤
B_mble : MeasurableSet B
half_ε_pos : 0 < ε / 2
half_ε_lt_top : ε / 2 < ⊤
r : ℝ≥0∞ := levyProkhorovEDist μ ν + ε / 2
s : ℝ≥0∞ := levyProkhorovEDist ν κ + ε / 2
lt_r : levyProkhorovEDist μ ν < r
⊢ μ B ≤
      κ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
          (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
        ε ∧
    κ B ≤
      μ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
          (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
        ε

Tactic:
have lt_s : levyProkhorovEDist ν κ < s := lt_add_right LPνκ_finite half_ε_pos.ne'

Result:
case neg.h
Ω : Type u_1
inst✝² : MeasurableSpace Ω
inst✝¹ : PseudoEMetricSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ ν κ : Measure Ω
LPμν_finite : ¬levyProkhorovEDist μ ν = ⊤
LPνκ_finite : ¬levyProkhorovEDist ν κ = ⊤
ε : ℝ≥0∞
B : Set Ω
ε_pos : 0 < ε
ε_lt_top : ε < ⊤
B_mble : MeasurableSet B
half_ε_pos : 0 < ε / 2
half_ε_lt_top : ε / 2 < ⊤
r : ℝ≥0∞ := levyProkhorovEDist μ ν + ε / 2
s : ℝ≥0∞ := levyProkhorovEDist ν κ + ε / 2
lt_r : levyProkhorovEDist μ ν < r
lt_s : levyProkhorovEDist ν κ < s
⊢ μ B ≤
      κ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
          (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
        ε ∧
    κ B ≤
      μ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
          (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
        ε

Proof state:
case neg.h.refine_1
Ω : Type u_1
inst✝² : MeasurableSpace Ω
inst✝¹ : PseudoEMetricSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ ν κ : Measure Ω
LPμν_finite : ¬levyProkhorovEDist μ ν = ⊤
LPνκ_finite : ¬levyProkhorovEDist ν κ = ⊤
ε : ℝ≥0∞
B : Set Ω
ε_pos : 0 < ε
ε_lt_top : ε < ⊤
B_mble : MeasurableSet B
half_ε_pos : 0 < ε / 2
half_ε_lt_top : ε / 2 < ⊤
r : ℝ≥0∞ := levyProkhorovEDist μ ν + ε / 2
s : ℝ≥0∞ := levyProkhorovEDist ν κ + ε / 2
lt_r : levyProkhorovEDist μ ν < r
lt_s : levyProkhorovEDist ν κ < s
hs_add_r : s + r = levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε
hs_add_r' : s.toReal + r.toReal = (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal
⊢ μ B ≤ κ (thickening (s.toReal + r.toReal) B) + (s + r)

Tactic:
calc μ B ≤ ν (thickening r.toReal B) + r :=
  left_measure_le_of_levyProkhorovEDist_lt lt_r B_mble
_ ≤ κ (thickening s.toReal (thickening r.toReal B)) + s + r :=
  add_le_add_right
    (left_measure_le_of_levyProkhorovEDist_lt lt_s isOpen_thickening.measurableSet) _
_ = κ (thickening s.toReal (thickening r.toReal B)) + (s + r) := add_assoc _ _ _
_ ≤ κ (thickening (s.toReal + r.toReal) B) + (s + r) :=
  add_le_add_right (measure_mono (thickening_thickening_subset _ _ _)) _

Result:
no goals

Proof state:
case ha
Ω : Type u_1
inst✝² : MeasurableSpace Ω
inst✝¹ : PseudoEMetricSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ ν κ : Measure Ω
LPμν_finite : ¬levyProkhorovEDist μ ν = ⊤
LPνκ_finite : ¬levyProkhorovEDist ν κ = ⊤
ε : ℝ≥0∞
B : Set Ω
ε_pos : 0 < ε
ε_lt_top : ε < ⊤
B_mble : MeasurableSet B
half_ε_pos : 0 < ε / 2
half_ε_lt_top : ε / 2 < ⊤
r : ℝ≥0∞ := levyProkhorovEDist μ ν + ε / 2
s : ℝ≥0∞ := levyProkhorovEDist ν κ + ε / 2
lt_r : levyProkhorovEDist μ ν < r
lt_s : levyProkhorovEDist ν κ < s
hs_add_r : s + r = levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε
⊢ s ≠ ⊤

Tactic:
exact ENNReal.add_ne_top.mpr ⟨LPνκ_finite, half_ε_lt_top.ne⟩

Result:
no goals

Proof state:
case neg.h
Ω : Type u_1
inst✝² : MeasurableSpace Ω
inst✝¹ : PseudoEMetricSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ ν κ : Measure Ω
LPμν_finite : ¬levyProkhorovEDist μ ν = ⊤
LPνκ_finite : ¬levyProkhorovEDist ν κ = ⊤
ε : ℝ≥0∞
B : Set Ω
ε_pos : 0 < ε
ε_lt_top : ε < ⊤
B_mble : MeasurableSet B
half_ε_pos : 0 < ε / 2
half_ε_lt_top : ε / 2 < ⊤
r : ℝ≥0∞ := levyProkhorovEDist μ ν + ε / 2
s : ℝ≥0∞ := levyProkhorovEDist ν κ + ε / 2
lt_r : levyProkhorovEDist μ ν < r
lt_s : levyProkhorovEDist ν κ < s
hs_add_r : s + r = levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε
hs_add_r' : s.toReal + r.toReal = (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal
⊢ μ B ≤
      κ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
          (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
        ε ∧
    κ B ≤
      μ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
          (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
        ε

Tactic:
rw [← hs_add_r', add_assoc, ← hs_add_r, add_assoc _ _ ε, ← hs_add_r]

Result:
case neg.h
Ω : Type u_1
inst✝² : MeasurableSpace Ω
inst✝¹ : PseudoEMetricSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ ν κ : Measure Ω
LPμν_finite : ¬levyProkhorovEDist μ ν = ⊤
LPνκ_finite : ¬levyProkhorovEDist ν κ = ⊤
ε : ℝ≥0∞
B : Set Ω
ε_pos : 0 < ε
ε_lt_top : ε < ⊤
B_mble : MeasurableSet B
half_ε_pos : 0 < ε / 2
half_ε_lt_top : ε / 2 < ⊤
r : ℝ≥0∞ := levyProkhorovEDist μ ν + ε / 2
s : ℝ≥0∞ := levyProkhorovEDist ν κ + ε / 2
lt_r : levyProkhorovEDist μ ν < r
lt_s : levyProkhorovEDist ν κ < s
hs_add_r : s + r = levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε
hs_add_r' : s.toReal + r.toReal = (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal
⊢ μ B ≤ κ (thickening (s.toReal + r.toReal) B) + (s + r) ∧ κ B ≤ μ (thickening (s.toReal + r.toReal) B) + (s + r)

Proof state:
Ω : Type u_1
inst✝² : MeasurableSpace Ω
inst✝¹ : PseudoEMetricSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ ν κ : Measure Ω
⊢ levyProkhorovEDist μ κ ≤ levyProkhorovEDist μ ν + levyProkhorovEDist ν κ

Tactic:
by_cases LPμν_finite : levyProkhorovEDist μ ν = ∞

Result:
case pos
Ω : Type u_1
inst✝² : MeasurableSpace Ω
inst✝¹ : PseudoEMetricSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ ν κ : Measure Ω
LPμν_finite : levyProkhorovEDist μ ν = ⊤
⊢ levyProkhorovEDist μ κ ≤ levyProkhorovEDist μ ν + levyProkhorovEDist ν κ

case neg
Ω : Type u_1
inst✝² : MeasurableSpace Ω
inst✝¹ : PseudoEMetricSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ ν κ : Measure Ω
LPμν_finite : ¬levyProkhorovEDist μ ν = ⊤
⊢ levyProkhorovEDist μ κ ≤ levyProkhorovEDist μ ν + levyProkhorovEDist ν κ