Query about functions Suppose that we have a function $f:(\mathbb{R^2},d_2) \to (\mathbb{R^2},d_2) $ where $d_2$ is the Euclidean metric. A function in this case looks like what exactly. Since we are in $\mathbb{R^2}$ the function could look like $f(x,y)=(x-1,y+2)$ right? If this is the case then what would be meant by $d_2(f(x),f(y))$. Maybe someone could clarify why I'm confused, or if I am just wrong in general about how I am thinking about this.
 A: You are confused because you’re using $x,y$ to denote two different things:

*

*Coordinates $(x,y)$ of a vector $X \in \mathbb R^2$.

*Vectors of $\mathbb R^2$ when you write $d(f(x),f(y))$.

This is not an issue usually, except when you’re working on both concepts at the same time. What you’re doing.
Denote $X_1=(x_1,y_1), X_2=(x_2,y_2)$ two vectors will avoid the ambiguity you have.
$d_2(f(X_1),f(X_2))$ means the Euclidean distance between the images of $X_1,X_2$ under $f$.
The map  $f$ is independent from the distance $d_2$ itself. What is not independent from the metric, $d_2$ in your example are some properties of the map $f$. Continuity for example. For such properties, the metric is crucial as a map may be continuous for a metric but not related to another one.
A: The presence of the distances in the definition of $f$ clarifies which topologies we are to use when talking about stuff like continuity for example. What is meant by $d_2(f(x, y), f(z, w))$ is exactly the only thing that can be meant (note that $f$ has two inputs, whilst in your original question it had only one- which is not necessarily a mistake if you also mention $x, y \in \mathbb{R}^2,$ for example). In your particular example, we would have $$d_2(f(x,y), f(z, w)) = \Vert (x - 1, y + 2) - (z - 1, w + 2) \Vert = \Vert (x - z, y - w) \Vert = \sqrt{(x - z)^2 + (y - w)^2} = d_2((x, y), (z, w))$$ for instance.
What you should take away from all of this is that sometimes we are not working with the standard topology on $\mathbb{R}^n$ which we all know and love and the topologies actually dictate what continuity means for functions between those two spaces. :)
A: The Euclidean norm in $\mathbb{R}^{2}$ is defined as follows.
Let $x = (x_{1},x_{2})\in\mathbb{R}^{2}$ and $y = (y_{1},y_{2})\in\mathbb{R}^{2}$. Then we have that
\begin{align*}
d_{2}(x,y) = \sqrt{(x_{1} - y_{1})^{2} + (x_{2} - y_{2})^{2}}
\end{align*}
If we have two functions $f(x,y) = (f_{1}(x,y),f_{2}(x,y))$ and $g(x,y) = (g_{1}(x,y),g_{2}(x,y))$, then
\begin{align*}
d_{2}(f(x,y),g(x,y)) = \sqrt{(f_{1}(x,y) - g_{1}(x,y))^{2} + (f_{2}(x,y) - g_{2}(x,y))^{2}}
\end{align*}
More generally, we can define the Euclidean metric in $\mathbb{R}^{n}$ as follows.
Let $x = (x_{1},x_{2},\ldots,x_{n})$ and $y = (y_{1},y_{2},\ldots,y_{n})$. Then we have that
\begin{align*}
d_{2}(x,y) = \sqrt{(x_{1}-y_{1})^{2} + (x_{2}-y_{2})^{2} + \ldots + (x_{n}-y_{n})^{2}}
\end{align*}
More generally, we can talk about metric spaces.
Given a set $X$, we say the function $d_{X}:X\times X\to\mathbb{R}_{\geq 0}$ is a metric iff given $x\in X$, $y\in X$ and $z\in  X$, we have
(a) $d_{X}(x,y) \geq 0$ and $d_{X}(x,y) = 0$ iff $x = y$.
(b) $d_{X}(x,y) = d_{X}(y,x)$ for every $x$ and $y$.
(c) $d_{X}(x,z) \leq d_{X}(x,y) + d_{X}(y,z)$ for every $x$, $y$ and $z$.
In the case of $\mathbb{R}^{n}$, there are two examples whose presentation is standard.
More precisely, given $x\in\mathbb{R}^{n}$ and $y\in\mathbb{R}^{n}$, one has that
\begin{align*}
d_{1}(x,y) = |x_{1} - y_{1}| + |x_{2} - y_{2}| + \ldots + |x_{n} - y_{n}|
\end{align*}
which is known as the taxi-cab metric.
Another example is given below:
\begin{align*}
d_{\infty}(x,y) = \max\{|x_{1} - y_{1}|, |x_{2}  - y_{2}|,\ldots, |x_{n} - y_{n}|\}
\end{align*}
Besides such examples, there are plenty of metric spaces.
If you still want to go further, you can study Topology, which generalizes the ideas previously presented.
Hopefully this helps!
