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