Technology and Art
This post lists solutions to many of the exercises in the Distance Metrics section 1.1 of Erwin Kreyszig’s Introductory Functional Analysis with Applications. This is definitely a work in progress, and proofs may be refined or added over time.
Proof:
For the distance metric d(x,y)=(x−y)2, we need to prove or disprove the Triangle Inequality:
d(x,z)≤d(x,y)+d(y,z)We start with the term (x−z)2, as follows:
(x−z)2=((x−y)+(y−z))2⇒(x−z)2=(x−y)2+(y−z)2+2(x−y)(y−z)⇒d(x,z)=d(x,y)+d(y,z)+2(x−y)(y−z)⏟positive or negativeWhen the term 2(x−y)(y−z) is positive:
d(x,z)>d(x,y)+d(y,z)When the term 2(x−y)(y−z) is negative or zero:
d(x,z)≤d(x,y)+d(y,z)Thus, the Triangle Inequality can only be satisfied for specific values of x, y, and z; hence d(x,y)=(x−y)2 is not a valid distance metric.
◼Proof:
For the distance metric d(x,y)=√|x−y|, we need to prove the Triangle Inequality:
d(x,z)≤d(x,y)+d(y,z)We start with the basic Triangle Inequality for R:
|x−z|≤|x−y|+|y−z|Adding and subtracting 2√|x−y||y−z| on the RHS we get:
|x−z|≤|x−y|+|y−z|+2√|x−y||y−x|−2√|x−y||y−z|⇒|x−z|≤(√|x−y|+√|y−z|)2−2√|x−y||y−z|⏟positiveSetting C=2√|x−y||y−z|>0, we get:
|x−z|≤(√|x−y|+√|y−z|)2−C⇒(√|x−z|)2≤(√|x−y|+√|y−z|)2−C⇒(√|x−z|)2+C≤(√|x−y|+√|y−z|)2⇒(√|x−z|)2≤(√|x−y|+√|y−z|)2⇒√|x−z|≤√|x−y|+√|y−z|⇒d(x,z)≤d(x,y)+d(y,z)Hence, this proves the Triangle Inequality, and consequently, d(x,y)=√|x−y| is a valid distance metric.
◼(i) Proof:
Let ˉd(x,y)=kd(x,y) be a candidate metric on X. For it to be a valid distance metric, it must satisfy the four axioms of a metric, i.e.:
ˉd(x,z)≤ˉd(x,y)+ˉd(y,z): For this, if we multiply the original, valid Triangle Inequality by k on both sides, we have the following:
kd(x,z)≤k[d(x,y)+d(y,z)]⇒kd(x,z)≤kd(x,y)+kd(y,z)⇒ˉd(x,z)≤ˉd(x,y)+ˉd(y,z)proving that the Triangle Inequality holds for ˉd for any k∈R.
Putting all of these together, we get the condition that k>0,k∈R.
(ii) Proof:
Let ˉd(x,y)=d(x,y)+k be a candidate metric on X. For it to be a valid distance metric, it must satisfy the four axioms of a metric, i.e.:
ˉd(x,z)≤ˉd(x,y)+ˉd(y,z): For this, we can need to find the condition for which the following holds:
d(x,z)+k≤[d(x,y)+k]+[d(y,z)+k]⇒d(x,z)+k≤d(x,y)+d(y,z)+2k⇒d(x,z)≤d(x,y)+d(y,z)+kSince d(x,z)≤d(x,y)+d(y,z) already, we must have k≥0 for the above inequality to always hold; this shows that the Triangle Inequality holds for ˉd for k≥0∈R.
Putting all of these together, we get the condition that k=0,k∈R.
Answer: l∞ is the set of all bounded sequences of complex numbers. The metric under consideration is d(x,y)=sup|ζi−etai|.
We need to prove that d(x,y)≤d(x,z)+d(z,y). We know that: |ηi−ζi|≤|ηi−θi|+|θi−ζi|. Taking sup on both sides we get:
sup|ηi−ζi|≤sup[|ηi−θi|+|θi−ζi|]For two sequences (ai) and (bi), we have: ai≤sup(ai)bi≤sup(bi)
Adding the two inequalities, we get:
ai+bi≤sup(ai)+sup(bi)⇒sup(ai+bi)≤sup(ai)+sup(bi)The above is because any ai+bi is less than or equal to some constant, so the supremum is also less than or equal to that constant.
Setting ai=|ηi−θi| and bi=|θi−ζi|, we get:
sup[|ηi−θi|+|θi−ζi|]≤sup|ηi−θi|+sup|θi−ζi|Putting (1) and (2) together we get:
sup|ηi−ζi|≤sup[|ηi−θi|+|θi−ζi|]≤sup|ηi−θi|+sup|θi−ζi|⇒sup|ηi−ζi|≤sup|ηi−θi|+sup|θi−ζi|This proves the Triangle Inequality for the given distance metric.
◼Proof:
The distance metric given is: d(x,y)=b∫a|x(t)−y(t)| We know that:
|x(t)−y(t)|≤|x(t)−z(t)|+|z(t)−y(t)|Integrating both sides with respect to t from a to b, we get:
b∫a|x(t)−y(t)|≤b∫a|x(t)−z(t)|+b∫a|z(t)−y(t)|⇒d(x,y)≤d(x,z)+d(z,y) ◼For reference, the axioms (M1) to (M4) are as follows:
The discrete metric is: d(x,x)=0d(x,y)=1, for x≠y
This satisfies (M1), since d(x,y)∈{0,1}.
(M2) also follows from d(x,x)=0.
(M3) also follows from d(x,y)=d(y,x)=1 if x≠y and d(x,x)=0.
Let’s prove the Triangle Inequality. We have:
d(x,z)≥0d(z,y)≥0Adding the above inequalities, we get:
d(x,z)+d(z,y)≥0Case 1
If x=y, then d(x,y)=0, and we have:
d(x,z)+d(z,y)≥d(x,y) for x=yCase 2
If x≠y, then d(x,y)=1. Then, we have 3 sub-cases:
(2.1) z=x,z≠y. Then d(x,z)+d(z,y)=0+1=1≥d(x,y)
(2.2) z=y,z≠x. Then d(x,z)+d(z,y)=1+0=1≥d(x,y)
(2.3) z≠y,z≠x. Then d(x,z)+d(z,y)=1+1=2≥d(x,y)
In all the above cases, we have d(x,y)≤d(x,z)+d(z,y), thus proving (M4) (the Triangle Inequality).
◼Proof:
The set of all ordered triples of zeros and ones, forms a sequence of numbers X=[0,7],xi∈X,xi∈Z in their binary form. Thus, it is evident that the number of triples is 23=8.
Let a,b,c∈0,1, then each number in this set, can be represented as xi=a+2b+4c. Then the suggested distance metric is:
d(x,y)=|ax−ay|+|bx−by|+|cx−cy|Let x1, x2, x3 be defined as follows:
x=ax+2bx+4cxy=ay+2by+4cyz=az+2bz+4cz d(x,z)=|ax−az|+|bx−bz|+|cx−cz|=|ax−ay+ay−az|+|bx−by+by−bz|+|cx−cy+cy−cz|Now we have the following inequalities:
|ax−ay+ay−az|≤|ax−ay|+|ay−az||bx−by+by−bz|≤|bx−by|+|by−bz||cx−cy+cy−cz|≤|cx−cy|+|cy−cz|Summing up these inequalities, and noting that the LHS resolves to d(x,z), we get:
d(x,z)≤|ax−ay|+|ay−az|+|bx−by|+|by−bz|+|cx−cy|+|cy−cz|⇒d(x,z)≤(|ax−ay|+|bx−by|+|cx−cy|)+(|ay−az|+|by−bz|+|cy−cz|)⇒d(x,z)≤d(x,y)+d(y,z)Thus, this proves the Triangle Inequality for the Hamming Distance as a metric.
◼We write the two following triangle inequalities. One involves x, y, z. The other one involves w, y, z.
d(x,y)≤d(x,z)+d(z,y) d(z,y)≤d(z,w)+d(w,y)Adding d(x,z) to (3), we get:
d(x,z)+d(z,y)≤d(x,z)+d(z,w)+d(w,y)Thus, we have:
d(x,y)≤d(x,z)+d(z,y)≤d(x,z)+d(z,w)+d(w,y)⇒d(x,y)≤d(x,z)+d(z,w)+d(w,y)⇒d(x,y)≤d(x,z)+d(z,w)+d(y,w)(by the Symmetry property of a Distance Metric) d(x,y)−d(z,w)≤d(x,z)+d(w,y)We write the two following triangle inequalities. One involves x, z, w. The other one involves x, y, w.
d(z,w)≤d(z,x)+d(x,w) d(x,w)≤d(x,y)+d(y,w)Adding d(z,x) to (5), we get:
d(z,x)+d(x,w)≤d(z,x)+d(x,y)+d(y,w)Thus, we have:
d(z,w)≤d(z,x)+d(x,w)≤d(z,x)+d(x,y)+d(y,w)⇒d(z,w)≤d(z,x)+d(x,y)+d(y,w)⇒d(z,w)≤d(x,z)+d(x,y)+d(y,w)(by the Symmetry property of a Distance Metric) d(z,w)−d(x,y)≤d(z,x)+d(y,w)Summarising (4) and (6), we get:
d(x,y)−d(z,w)≤d(x,z)+d(y,w)d(z,w)−d(x,y)≤d(x,z)+d(y,w)⇒|d(x,y)−d(z,w)|≤d(x,z)+d(y,w) ◼Proof:
We have to show that:
|d(x,z)−d(y,z)|≤d(x,y)We write the following Triangle Inequality:
d(x,z)≤d(x,y)+d(y,z)⇒d(x,z)−d(y,z)≤d(x,y)The other Triangle Inequality we write is:
d(y,z)≤d(y,x)+d(x,z)⇒d(y,z)−d(x,z)≤d(y,x)⇒d(y,z)−d(x,z)≤d(x,y)(by the Symmetry property of a Distance Metric)Summarising the results of (7) and (8), we get:
d(x,z)−d(y,z)≤d(x,y)d(y,z)−d(x,z)≤d(x,y)⇒|d(x,z)−d(y,z)|≤d(x,y) ◼For reference, the axioms (M1) to (M4) are as follows:
Proof for (M3):
The allowed assumptions are:
Set z=y in (A2), so that we get:
\require{cancel} \begin{equation} d(x,y) \leq d(y,x) + \cancel{d(y,y)} \text{ (by (A1))} \\ \Rightarrow d(x,y) \leq d(y,x) \label{eq:1-1-14-abs-1} \end{equation}From (A2), we get d(y,x) as:
\begin{equation} d(y,x) \leq d(z,y) + d(z,x) \label{eq:1-1-14-y-x} \end{equation}Set z=x in \eqref{eq:1-1-14-y-x} again, so that we get:
\begin{equation} d(y,x) \leq d(x,y) + \cancel{d(x,x)} \text{ (by (A1))} \\ \Rightarrow d(y,x) \leq d(x,y) \\ \Rightarrow d(x,y) \geq d(y,x) \label{eq:1-1-14-abs-2} \end{equation}Summarising the results of \eqref{eq:1-1-14-abs-1} and \eqref{eq:1-1-14-abs-2}, we get:
d(x,y) \leq d(y,x) \\ d(x,y) \geq d(y,x)This implies that:
\begin{equation} d(x,y)=d(y,x) \label{eq:1-1-14-symmetry} \end{equation} \blacksquareProof for (M4):
(M4) should immediately follow from \eqref{eq:1-1-14-symmetry}, since:
d(x,y) \leq d(z,x) + d(z,y) \Rightarrow d(x,y) \leq d(x,z) + d(z,y) \blacksquareProof:
We have to prove that: d(x,y) \geq 0 follows from (M2) and (M4).
From the Triangle Inequality (M4), we have:
d(x,y) \leq d(x,z) + d(z,y)Set x=y, then we get:
d(y,y) \leq d(y,z) + d(z,y) \\ \Rightarrow \underbrace{\cancel{d(y,y)}}_\text{by (M2)} \leq d(y,z) + \underbrace{d(y,z)}_\text{by (M3)} \\ \Rightarrow 2d(y,z) \geq 0 \\ \Rightarrow d(y,z) \geq 0This proves (M1).
\blacksquare