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

Proof state:
Ω : 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
⊢ μ (thickening (r.toReal + s.toReal) B) + (s + r) = μ (thickening (s.toReal + r.toReal) B) + (s + r)

Tactic:
rw [add_comm r.toReal]

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 (s.toReal + r.toReal) B) + (s + r) ∧ κ B ≤ μ (thickening (s.toReal + r.toReal) B) + (s + r)

Tactic:
refine ⟨?_, ?_⟩

Result:
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)

case neg.h.refine_2
Ω : 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)

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

Tactic:
simp [LPνκ_finite]

Result:
no goals

Proof state:
Ω : 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
⊢ s + r = levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε

Tactic:
simp_rw [s, r, add_assoc, add_comm (ε / 2), add_assoc, ENNReal.add_halves, ← add_assoc,
  add_comm (levyProkhorovEDist μ ν)]

Result:
no goals

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

Tactic:
apply levyProkhorovEDist_le_of_forall_add_pos_le

Result:
case neg.h
Ω : Type u_1
inst✝² : MeasurableSpace Ω
inst✝¹ : PseudoEMetricSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ ν κ : Measure Ω
LPμν_finite : ¬levyProkhorovEDist μ ν = ⊤
LPνκ_finite : ¬levyProkhorovEDist ν κ = ⊤
⊢ ∀ (ε : ℝ≥0∞) (B : Set Ω),
    0 < ε →
      ε < ⊤ →
        MeasurableSet B →
          μ B ≤
              κ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
                  (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
                ε ∧
            κ B ≤
              μ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
                  (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
                ε

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

Tactic:
simp [LPμν_finite]

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 < ⊤
⊢ μ B ≤
      κ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
          (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
        ε ∧
    κ B ≤
      μ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
          (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
        ε

Tactic:
let r := levyProkhorovEDist μ ν + ε / 2

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
⊢ μ B ≤
      κ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
          (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
        ε ∧
    κ B ≤
      μ (thickening (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ + ε).toReal B) +
          (levyProkhorovEDist μ ν + levyProkhorovEDist ν κ) +
        ε