How momentum is dual to the velocity vector at a point on a differentiable manifold? The tangent space $T_pM$ which is a real vector space on a point $p$ of a differentiable manifold $M$, has a cotangent bundle $T_p^*M$ at $p \in M$, such that for any $v \in T_pM$ and for any $w \in T_p^*M$, we get
$$
w(v) = r , \quad(r \in \mathbb R)
$$,
Or in other notation $ \left< w,v \right> = r$,
I am trying to realize this construction in classical mechanics,
The Lagarangian $L$ is a real valued function on the tangent bundle $TM $ (Assuming no explicit time depencence)
\begin{align}
L : & TM \to \mathbb R\\
&(q,\dot q) \mapsto L(q,\dot q)
\end{align}
One also defines Hamiltonian $H$, a real valued function on the cotangent bundle $T^*M$, as
\begin{align}
H : & T^*M \to \mathbb R\\
&(q,p) \mapsto H(q,p)
\end{align}
$\dot q \in T_qM$ and $p \in T_q^*M$, I am unable to see how $\left< p,\dot q \right> = r$?
Update:
In a differentiable manifold, only real functions I can have is of the form $\left<p,\dot q\right>$, Then the Lagrangian needed to be made out of only these objects, For a free particle that kind of Lagrangian has the form
$$ 
L =  \mathbf p  \cdot \dot{\mathbf  q}
$$
Which is not a function on $TM$.
The differential manifold has no other inner product defined, so I can't make $L = \mathbf{\dot q}\cdot \mathbf{\dot q}$. This will be valid only for Riemannian Manifolds.
Let's consider a free particle on a $n$ dimensional Riemannian Manifold $(M,g)$, The Lagrangian is given by (Summation convention is being used)
\begin{align}
L(\mathbf{ q},\mathbf{\dot q}) =g_{ij}(q) {\dot q}^i\cdot {\dot q^j}, \quad i = 1,\ldots,n
\end{align},
The momentum
$$
p_i = \frac{\partial L}{\partial \dot q^i} = g_{ij}(q){\dot q^j}
$$
Here $p_i$ are the local (in some chart $(U,\phi)$ of $(M,g)$) components of the one-form $p$ given by
$$
p(q) = p_i(q) dq^i(q) = g_{ij}(q){\dot q^j(q)} dq^i(q)
$$
And the velocity vector field is locally given as
$$
v(q) = \dot q^i(q) \left(\frac{\partial }{\partial q^i}\right)_q
$$,
Now,  $dq^i(q)$ span $T_q^*M$ and $\left(\frac{\partial }{\partial q^i}\right)_q$ span $T_qM$, The basis obey
$$
\left< dq^i(q), \left(\frac{\partial }{\partial q^j}\right)_q \right> = \delta_j^i
$$
So we get,
$$
\left<p , v \right>_q = \left<p(q) , v(q) \right> = g_{ij}(q){\dot q^j(q)} \dot q^i(q) = \mathbf{\dot q}(q) \cdot \mathbf{\dot q}(q)  \in \mathbb R
$$,
$p$ is a linear map and also a functional so now I can imagine this as the element of cotangent bundle that maps the vectors into the real numbers
Is this the right way of thinking?
I found something related in the question
https://mathoverflow.net/questions/203138
 A: I am not sure if this answers OP's question, but momentum can mean one of two things. It is either a "generic momentum" $(q,p)\in T^\ast M$, which is just a covector on $M$ defined at some point, or what I am calling the canonical momentum, which is actually a map $\xi:TM\rightarrow T^\ast M$.
Given a Lagrangian $L:TM\rightarrow\mathbb R,\ (q,\dot q)\mapsto L(q,\dot q)$, if the point $q\in M$ is fixed, the "restricted Lagrangian" $L_q:T_qM\rightarrow\mathbb R,\ L_q(\dot q)=L(q,\dot q)$ is a function on the single tangent space $T_qM$. We may take the differential of this function at $\dot q\in T_q M$ to get $$ \mathrm dL_{q,\dot q}:T_\dot qT_qM\cong T_qM\rightarrow\mathbb R, $$ and this is a linear map, thus for fixed $(q,\dot q)\in TM$, $\mathrm dL_{q,\dot q}\in T^\ast M$, i.e. it is a covector. Then the fibre derivative of the Lagrangian is defined as $$\mathbb FL:TM\rightarrow T^\ast M,\ (q,\dot q)\mapsto \mathrm dL_{q,\dot q}. $$ Since for a vector $\dot q$ at $q$, the value $\mathbb FL(q,\dot q)$ is a covector at $q$, this is a (strict) morphism of fibre bundles, but it is not in general a morphism of vector bundles (this map is not fibrewise linear in general).
Then the canonical momentum $p$ (or $(q,p)$, depending on one's notation) corresponding to the velocity $(q,\dot q)$ is $$ p_i=\xi_i(q,\dot q), $$ where the $\xi_i$ are the components of the fibre derivative $\mathbb FL$ in some chart.
A: As you said the Lagrangian is defined on the tangent bundle, whose elements, loosely speaking, are pairs of a coordinate and a derivative, e.g.
$$(q, \dot{q}) = \left((q_i)_i, \; \dot{q}_j\frac{\partial}{\partial{q_j}}\right) $$
The Hamiltonian on the other hand is defined on the cotangent bundle, whose elements are pairs of a coordinate and a 1-form, e.g.
$$(q, p) = \left((q_i)_i, \; p_j \text{d}q_j\right)$$
The operation $\langle p,q \rangle$ is then just the 1-form acting on a derivative, which per definition is $$p_i\text{d}q_i\left(\dot{q}_j\frac{\partial}{\partial{q_j}}\right) = p_i q_j \frac{\partial q_i}{\partial{q_j}} = p_i q_i \in \rm I\!R$$
