Metamath Proof Explorer


Theorem mstri

Description: Triangle inequality for the distance function of a metric space. Definition 14-1.1(d) of Gleason p. 223. (Contributed by Mario Carneiro, 2-Oct-2015)

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

Proof

Step Hyp Ref Expression
1 mscl.x 𝑋 = ( Base ‘ 𝑀 )
2 mscl.d 𝐷 = ( dist ‘ 𝑀 )
3 1 2 msmet2 ( 𝑀 ∈ MetSp → ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) ∈ ( Met ‘ 𝑋 ) )
4 mettri ( ( ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) ∈ ( 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 9 7 ovresd ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐶 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐵 ) = ( 𝐶 𝐷 𝐵 ) )
12 10 11 oveq12d ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( ( 𝐴 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐶 ) + ( 𝐶 ( 𝐷 ↾ ( 𝑋 × 𝑋 ) ) 𝐵 ) ) = ( ( 𝐴 𝐷 𝐶 ) + ( 𝐶 𝐷 𝐵 ) ) )
13 5 8 12 3brtr3d ( ( 𝑀 ∈ MetSp ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐴 𝐷 𝐵 ) ≤ ( ( 𝐴 𝐷 𝐶 ) + ( 𝐶 𝐷 𝐵 ) ) )