Metamath Proof Explorer


Theorem mettri

Description: Triangle inequality for the distance function of a metric space. Definition 14-1.1(d) of Gleason p. 223. (Contributed by NM, 27-Aug-2006)

Ref Expression
Assertion mettri ( ( 𝐷 ∈ ( Met ‘ 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐴 𝐷 𝐵 ) ≤ ( ( 𝐴 𝐷 𝐶 ) + ( 𝐶 𝐷 𝐵 ) ) )

Proof

Step Hyp Ref Expression
1 mettri2 ( ( 𝐷 ∈ ( Met ‘ 𝑋 ) ∧ ( 𝐶𝑋𝐴𝑋𝐵𝑋 ) ) → ( 𝐴 𝐷 𝐵 ) ≤ ( ( 𝐶 𝐷 𝐴 ) + ( 𝐶 𝐷 𝐵 ) ) )
2 1 expcom ( ( 𝐶𝑋𝐴𝑋𝐵𝑋 ) → ( 𝐷 ∈ ( Met ‘ 𝑋 ) → ( 𝐴 𝐷 𝐵 ) ≤ ( ( 𝐶 𝐷 𝐴 ) + ( 𝐶 𝐷 𝐵 ) ) ) )
3 2 3coml ( ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) → ( 𝐷 ∈ ( Met ‘ 𝑋 ) → ( 𝐴 𝐷 𝐵 ) ≤ ( ( 𝐶 𝐷 𝐴 ) + ( 𝐶 𝐷 𝐵 ) ) ) )
4 3 impcom ( ( 𝐷 ∈ ( Met ‘ 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐴 𝐷 𝐵 ) ≤ ( ( 𝐶 𝐷 𝐴 ) + ( 𝐶 𝐷 𝐵 ) ) )
5 metsym ( ( 𝐷 ∈ ( Met ‘ 𝑋 ) ∧ 𝐴𝑋𝐶𝑋 ) → ( 𝐴 𝐷 𝐶 ) = ( 𝐶 𝐷 𝐴 ) )
6 5 3adant3r2 ( ( 𝐷 ∈ ( Met ‘ 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐴 𝐷 𝐶 ) = ( 𝐶 𝐷 𝐴 ) )
7 6 oveq1d ( ( 𝐷 ∈ ( Met ‘ 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( ( 𝐴 𝐷 𝐶 ) + ( 𝐶 𝐷 𝐵 ) ) = ( ( 𝐶 𝐷 𝐴 ) + ( 𝐶 𝐷 𝐵 ) ) )
8 4 7 breqtrrd ( ( 𝐷 ∈ ( Met ‘ 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐶𝑋 ) ) → ( 𝐴 𝐷 𝐵 ) ≤ ( ( 𝐴 𝐷 𝐶 ) + ( 𝐶 𝐷 𝐵 ) ) )