Why is a vector field on the sphere equivalent to $f : \mathbb S^n \rightarrow \mathbb R^{n+1}$ such that $f(x) \perp x$ I am new to differential geometry and the definition I have of $X$ vector field on $\mathbb S^n$ is that $X : \mathbb S^n \rightarrow T\mathbb S^n$ is smooth and $\pi \circ X = id_M$. In everything I read, such a vector field is automatically thought as $f : \mathbb S^n \rightarrow \mathbb R^{n+1}$ such that $f(x) \perp x$ and I would like to understand why.
I know that for each $p \in \mathbb S^n$, $T_p \mathbb S^n$ is a vector space of dimension $n$ so it is isomorphic to $\mathbb R^n$. Given X a vector field on $\mathbb S^n$, to get such a function $f$, as $X_p \in T_p\mathbb S^n$ my intuition is to use that this tangent space is a vector space of dimension $n$ so I can see $X_p$ as an element of $\mathbb R^n$. The problem is that it is not the right dimension and such an identification is abstract so I couldn't even use it to argue it preserves the smoothness of $X$.
Conversly, if I get such a function $f$ I can define
$$
X = \sum_{i=1}^{n+1} f_i \frac{\partial}{\partial x^i} : \mathbb S^n \rightarrow T \mathbb R^{n+1}
$$
that is a smooth and such that $\pi \circ X = id_{\mathbb S^n}$. Then I think I should show it is tangent to $\mathbb S^n$ to get a vector field on $\mathbb S^n$ but I don't even see where it leads because the best I have is $X_p = i'(p) \cdot v$ for some $v \in T_p \mathbb S^n$ and I cannot express $X_p$ with $v$ because $i'(p)$ is not bijective.
This is very frustrating as geometrically I can see that the tangent space of $\mathbb S^n$ at $p$ is $\{p\}^\perp + p$.
 A: Smooth manifolds $M$ have an abstract definition of tangent spaces. It doesn't matter if you use the definition using derivations on $C^{\infty}(M)$, or if you use the definition as an equivalence class of smooth curves, or any one of the other possible definitions. Set theoretically, when we define $T_pM$, and by extension $TM$, the elements are rather complicated and ugly objects. Now, in general, if we start with any smooth manifold $M$ a point $p\in M$ and take a chart $(U,\alpha)$ around the point $p$, this allows us to induce a linear isomorphism $\Phi_{\alpha,p}:T_pM\to\Bbb{R}^{\dim M}$. Actually, we can elevate from the pointwise level to get a mapping $TU\to \alpha[U]\times\Bbb{R}^n$ (i.e a local trivialization of the tangent bundle). The precise definition of this mapping depends very much on which definition of the tangent space you start with of course. If for example you use the definition with equivalence classes of curves, then the definition is
\begin{align}
\Phi_{\alpha,p}([\gamma]):= (\alpha\circ \gamma)'(0)
\end{align}
However, when we look at a $k$-dimensional embedded submanifold $M$ of $\Bbb{R}^n$, then there is a standard way of identifying $T_pM$ (which again has an abstract definition in differential geometry) with an honest $k$-dimensional subspace $\mathcal{T}_pM\subset\Bbb{R}^n$. We can do this because $T_pM\subset T_p\Bbb{R}^n$ (this is almost true even set theoretically if you use the definition as an equivalence class of curves, but if you use some other definition, such as derivations, we should really say $T\iota_p\equiv \iota_{*,p}$ is an injective linear mapping of $T_pM$ into $T_p\Bbb{R}^n$, so we can identify $T_pM$ with its image $T\iota_p(T_pM)\subset T_p\Bbb{R}^n$). Now, think back to how the smooth manifold structure on $\Bbb{R}^n$ is defined: it is defined to be the maximal atlas containing the identity chart $(\Bbb{R}^n,\text{id}_{\Bbb{R}^n})$ i.e "cartesian coordinates". So, using the identity chart on $\Bbb{R}^n$, we have a standard linear isomorphism $T_p\Bbb{R}^n\to\Bbb{R}^n$:
\begin{align}
\Phi_{\text{id}_{\Bbb{R}^n},p}([\gamma]):= (\text{id}_{\Bbb{R}^n}\circ \gamma)'(0)=\gamma'(0).
\end{align}
So, the image of $T_pM$ under the identity chart's isomorphism is what I denoted above as $\mathcal{T}_pM$, and this is an honest subspace of $\Bbb{R}^n$.
Once again, we can elevate the discussion from the pointwise level to the global level. We have the set inclusion $TM\subset T\Bbb{R}^n$, and using the identity chart, we have a diffeomorphism $T\Bbb{R}^n\to \Bbb{R}^n\times\Bbb{R}^n$. Therefore, the image of $TM$ under this diffeomorphism is a certain subset of $M\times\Bbb{R}^n$
So, now getting to vector fields on submanifolds of $\Bbb{R}^n$. Let $M$ be an embedded $k$-dimensional smooth submanifold of $\Bbb{R}^n$. A smooth vector field on $M$ is by definition a smooth mapping $X:M\to TM$ such that $\pi\circ X=\text{id}_M$. Now, based on what I described above, we can think of $X$ as mapping into the larger target space $T\Bbb{R}^n$, which then is diffeomorphic to $\Bbb{R}^n\times\Bbb{R}^n$ in the standard way, by virtue of the identity chart. This gives us, by composition, a mapping $\widetilde{X}:M\to M\times\Bbb{R}^n$. Finally, you can project onto the second factor to get a mapping $f:M\to\Bbb{R}^n$. This mapping $f$ has the property that for each $p\in M$, $f(p)\in \mathcal{T}_pM$ (recall that this curly $\mathcal{T}$ means the image of $T_pM$ under the identity chart's induced isomorphism). Note that $f$ being smooth is clear because it's a composition of $X$ with a diffeomorphism, followed by projection to second factor.
Conversely, if you start with a smooth map $f:M\to\Bbb{R}^n$ such that for each $p\in M$ we have $f(p)\in \mathcal{T}_pM$, then we can consider the graph mapping $\Gamma_f:M\to M\times \Bbb{R}^n$, defined as $\Gamma_f(p):= (p,f(p))$. Finally, we can compose by the inverse diffeomorphism to get us a mapping $X_f:M\to T\Bbb{R}^n$ such that the image actually lies in the subset $TM$, and it projects back to $\text{id}_M$. Smoothness of $f$  implies that of $\Gamma_f$, and hence composing with inverse diffeomorphisms still keeps it smooth; finally restricting the target space of $X_f$ from $T\Bbb{R}^n$ to $TM$ still keeps it smooth. Hence, starting from $f$ we constructed a smooth vector field $X_f$ on $M$.
In the case of the sphere, we have $S^n\subset\Bbb{R}^{n+1}$. You talk about identifying $T_pS^n$ with $\Bbb{R}^n$. Well, you certainly could if you choose a chart on $S^n$, however, usually when dealing with submanifolds of $\Bbb{R}^{n+1}$, we don't like to do that. Rather we work with the identity chart, so that $T_pS^n$ is identified with $\mathcal{T}_pS^n=\{\xi\in\Bbb{R}^{n+1}\,:\, \langle\xi,p \rangle=0\}\subset\Bbb{R}^{n+1}$. So, I hope this makes the dimension issue clearer.
You may find the following answers of mine a helpful read afterwards: How to show that $T_{(1,0)}S^1\cong\text{span}({e_2})$?, where I again talk about the relationship between the abstract and concrete interpretations of tangent space, and understanding vector fields on $S^3$.
