Metamath Proof Explorer


Theorem mstri3

Description: Triangle inequality for the distance function of a metric space. (Contributed by Mario Carneiro, 2-Oct-2015)

Ref Expression
Hypotheses mscl.x 𝑋 = ( Base ‘ 𝑀 )
mscl.d 𝐷 = ( dist ‘ 𝑀 )
Assertion mstri3 ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐴 𝐷 𝐵 ) ≤ ( ( 𝐴 𝐷 𝐶 ) + ( 𝐵 𝐷 𝐶 ) ) )

Proof

Step Hyp Ref Expression
1 mscl.x 𝑋 = ( Base ‘ 𝑀 )
2 mscl.d 𝐷 = ( dist ‘ 𝑀 )
3 1 2 msmet2 ( 𝑀 ∈ MetSp → ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) ∈ ( Met ‘ 𝑋 ) )
4 mettri3 ( ( ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) ∈ ( Met ‘ 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐴 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐵 ) ≤ ( ( 𝐴 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐶 ) + ( 𝐵 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐶 ) ) )
5 3 4 sylan ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐴 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐵 ) ≤ ( ( 𝐴 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐶 ) + ( 𝐵 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐶 ) ) )
6 simpr1 ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → 𝐴𝑋 )
7 simpr2 ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → 𝐵𝑋 )
8 6 7 ovresd ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐴 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐵 ) = ( 𝐴 𝐷 𝐵 ) )
9 simpr3 ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → 𝐶𝑋 )
10 6 9 ovresd ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐴 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐶 ) = ( 𝐴 𝐷 𝐶 ) )
11 7 9 ovresd ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐵 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐶 ) = ( 𝐵 𝐷 𝐶 ) )
12 10 11 oveq12d ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( ( 𝐴 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐶 ) + ( 𝐵 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐶 ) ) = ( ( 𝐴 𝐷 𝐶 ) + ( 𝐵 𝐷 𝐶 ) ) )
13 5 8 12 3brtr3d ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐴 𝐷 𝐵 ) ≤ ( ( 𝐴 𝐷 𝐶 ) + ( 𝐵 𝐷 𝐶 ) ) )