If , our formula should be interpreted as . If , we define in accordance with the positivity requirement. We may quickly prove that with this distance function code-space qualifies as a metric space. First of all, it's all arranged that positivity is satisfied, since is always positive and distance 0 occurs precisely when the two trajectories are the same. Symmetry is true because equality of terms as well as inequality are symmetric relations, that is, if then .
Transitivity is the trickiest condition to verify.
This means for , and for . Then and . Thus, and agree for at least the first terms. Then Since the maximum of two nonnegative numbers is certainly less than or equal to their sum, this inequality is even better than the triangle inequality. It is commonly called the ultrametric inequality .