# Discrete metric is a metric

## Homework Statement

Let ##x,y\in X## such that ##X## is a metric space. Let ##d(x,y)=0## if and only if ##x=y## and ##d(x,y)=1## if and only if ##x\neq y##

N/A

## The Attempt at a Solution

I have already seen various approaches in proving this. Although, I just want to know if this approach of mine is also valid.

Proof:
We want to show that ##\forall x,y,z\in X##, ##d(x,y)\leq d(x,z)+d(z,y)##.
If ##d(x,z)=1##, then ##1\leq d(x,z)+d(z,y)\leq 2##. But since ##0\leq d(x,y)\leq 1##, then ##d(x,y)\leq 1\leq d(x,z)+d(z,y)\leq 2##. However, if ##d(x,z)=0=d(z,y)##, then ##d(x,y)=0=d(x,z)+d(z,y)##. Hence, the result follows.

member 587159

## Homework Statement

Let ##x,y\in X## such that ##X## is a metric space. Let ##d(x,y)=0## if and only if ##x=y## and ##d(x,y)=1## if and only if ##x\neq y##

N/A

## The Attempt at a Solution

I have already seen various approaches in proving this. Although, I just want to know if this approach of mine is also valid.

Proof:
We want to show that ##\forall x,y,z\in X##, ##d(x,y)\leq d(x,z)+d(z,y)##.
If ##d(x,z)=1##, then ##1\leq d(x,z)+d(z,y)\leq 2##. But since ##0\leq d(x,y)\leq 1##, then ##d(x,y)\leq 1\leq d(x,z)+d(z,y)\leq 2##. However, if ##d(x,z)=0=d(z,y)##, then ##d(x,y)=0=d(x,z)+d(z,y)##. Hence, the result follows.
Not really a lot to say. If you consider all cases, you are done. Seems like you did that, so you are fine.

• Terrell
Not really a lot to say. If you consider all cases, you are done. Seems like you did that, so you are fine.
Thanks! I had it on an exam earlier, just couldn't get my head off it if I got it right or not. lol.