Two ways of explaining the notation $\mathbb{R}^2$ I found two ways to explain the notation $\mathbb{R}^2$.
First is by Cartesian product: $\mathbb{R} \times \mathbb{R}$.
Secondly, regarding $2$ as any set with two elements. suppose it's $\{0,1\}$.
Then the map from $\{0,1\}$ to $\mathbb{R}$ forms a linear space. which can be also denoted as $\mathbb{R}^{\{0,1\}} = \mathbb{R}^2$.
In mathematics, if two things looks similar or the same, there will always be some deep reason behind it. So what's the deep reason of the above statements?
 A: The "deep" reason is that $\mathbf{R}^n$ can be defined up to a natural isomorphism by the universal property of products. I start with the most general and abstract definition of a product of sets and then I show how that relates to your question:

Consider a set $I$, a set of sets $X$, a function $\phi\colon I\to X$ and $X_i:=\phi(i)$.
A product of $\phi$ consists of a set $P$ and, for each $i\in I$, a function
$\pi_i\colon P\to X_i$ such that the following holds: Let $A$ be some set and $f_i\colon
 A\to X_i$ a function for each $i\in I$, then there is exactly
one function $f\colon A\to P$ with $f_i=\pi_i\circ f$ for all
$i\in I$.

In the beginning, I claimed that products are defined up to a natural isomorphism - here is the precise statement:

Let $P$ and $P'$ be products of $\phi$ then there exists exactly one function $f\colon P'\to P$ such that $\pi'{}_i=\pi_i\circ f$ for all $i\in I$ by the universal property of products. For the same reason, there exists exactly one function $g\colon P\to P'$ such that $\pi_i=\pi'{}_i\circ g$ for all $i\in I$. You can show that $f$ and $g$ are inverse to each other, that is $f\circ g=\mathrm{id}_P$ and $g\circ f=\mathrm{id}_{P'}$.

In your case, $I=\{1,\ldots,n\}$, $\phi(i)=\mathbf{R}$ for all $i\in I$ and as you already noticed, there are many different ways to construct a product:

*

*One way is to define $\mathbf{R}^n$ inductively: $\mathbf{R}^1:=\mathbf{R}$ and $$\mathbf{R}^{n+1}:=\mathbf{R}^n\times\mathbf{R}:=\Big\{\{\{x\},\{x,y\}\}:x\in\mathbf{R}^n\text{ and } y\in\mathbf{R}\Big\}.$$

*Another way is to define $\mathbf{R}^n$ as the set of all functions from $I=\{1,\ldots,n\}$ to $\mathbf{R}$: $$\mathbf{R}^n:=\mathbf{R}^I$$
In both cases, the projections $\pi_1,\ldots,\pi_n\colon\mathbf{R}^n\to\mathbf{R}$ are the obvious ones and
\begin{align}
f\colon\mathbf{R}^I&\to\mathbf{R}\times\mathbf{R}\\
\phi&\mapsto\{\{\phi(1)\},\{\phi(1),\phi(2)\}\}
\end{align}
is the natural isomorphism for $n=2$. Suppose $x_1,\ldots,x_n\in\mathbf{R}$, then the element $x\in\mathbf{R}^n$ with $\pi_i(x)=x_i$ for all $i\in I$ is usually denoted by $(x_1,\ldots,x_n)$.

Addendum
Definition of addition and scalar multiplication:
For all $x,y\in\mathbf{R}^n$ and $\lambda\in\mathbf{R}$, $x+y$ and $\lambda\cdot x$ are the unique elements of $\mathbf{R}^n$ satisfying
$$\pi_i(x+y)=\pi_i(x)+\pi_i(y)$$
and
$$\pi_i(\lambda\cdot x)=\lambda\cdot\pi_i(x)$$
for all $i\in\{1,\ldots,n\}$.
So far, we have defined a vector space structure.
Definition of the inner product:
The standard inner product is defined as follows:
\begin{align}
\mathbf{R}^n\times\mathbf{R}^n&\to\mathbf{R}\\
(x,y)&\mapsto\sum_{i=1}^n\pi_i(x)\cdot\pi_i(y)
\end{align}
The inner product defines a norm and the norm defines a metric.
A: I don't understand what you exactly mean by "a deep reason", but here's a very elementary answer that can help understand the connection.
First think of the first definition of $\mathbb R^2$ as $\mathbb R\times \mathbb R$. From the definition of Cartesian product, $\mathbb R\times \mathbb R=\{(a,b):a,b\in \mathbb R\}$ is the collection of all possible tuples of real numbers.
Now, consider a function $f:\{0,1\}\to \mathbb R$ and note the tuple $\left(f(0),f(1)\right)$. From the definition of $f$, it is clear that $\left(f(0),f(1)\right)$ is a tuple of real numbers. Now, consider the set of all such functions, and name it $S_f$. Keep in mind the range of these functions.
Note that $S_f$ is absolutely same as $\mathbb R\times \mathbb R$ (defined using Cartesian product) by considering a bijection $F:\mathbb R\times \mathbb R \to S_f$ defined by $F((a,b))=f_{ab}$ where $f_{ab}:\{0,1\}\to \mathbb R$ is the function that takes $0$ to $a$ and $1$ to $b$, i.e., $f_{ab}(0)=a$ and $f_{ab}(1)=b$.
Hope that helps.
