[guided]We first isolate the equation that defines the momentum level. Define $F:O\to\mathbb{R}$ by
\begin{align*}
F(x,r,v,w)=p_n(x,r,v,w)-\ell.
\end{align*}
Because $L$ is $C^2$ and $p_n=\partial_wL$, the momentum component $p_n:O\to\mathbb{R}$ is $C^1$. Hence $F$ is also $C^1$, as required for the implicit function theorem. The point $(x_0,r_0,v_0,w_0)$ lies on the level set $p_n=\ell$, so
\begin{align*}
F(x_0,r_0,v_0,w_0)=0.
\end{align*}
The derivative of $F$ in the unknown variable $w=\dot q_n$ is
\begin{align*}
\partial_wF(x_0,r_0,v_0,w_0)=\partial_w p_n(x_0,r_0,v_0,w_0)=\partial_w^2L(x_0,r_0,v_0,w_0).
\end{align*}
This number is nonzero by hypothesis. Therefore the [Implicit Function Theorem](/theorems/52) applies to the equation $F=0$ with $w$ as the solved variable. It gives neighbourhoods $A\subset\mathbb{R}^{n-1}\times\mathbb{R}^{n-1}$, $J\subset\mathbb{R}$, and $B\subset\mathbb{R}$, shrunk so that $A\times J\times B\subset O$, together with a unique $C^1$ function $\phi_\ell:A\times J\to B$, such that
\begin{align*}
p_n(x,r,v,w)=\ell \quad \iff \quad w=\phi_\ell(x,v,r)
\end{align*}
for all $(x,r,v,w)\in A\times J\times B$.
The next point is to prove that this branch actually has no dependence on $r$. Because $q_n$ is a cyclic coordinate, $\partial_rL=0$ throughout the coordinate neighbourhood. Since $L\in C^2$, the mixed second partial derivatives in the $r$ and $w$ variables commute. Differentiating the identity $\partial_rL=0$ with respect to $w$ therefore gives
\begin{align*}
\partial_rp_n=\partial_r\partial_wL=\partial_w\partial_rL=0.
\end{align*}
Since $J$ is an interval, the identity $\partial_rp_n=0$ implies that the function $r\mapsto p_n(x,r,v,w)$ is constant on $J$ for every fixed $(x,v,w)\in A\times B$. Thus, for fixed $(x,v)\in A$, if a value $w\in B$ solves $p_n(x,r_1,v,w)=\ell$ at one $r_1\in J$, then the same $w$ solves $p_n(x,r_2,v,w)=\ell$ for every $r_2\in J$. The implicit-function theorem also gives local uniqueness of the solution in $B$, so $\phi_\ell(x,v,r_1)=\phi_\ell(x,v,r_2)$ for all $r_1,r_2\in J$. Therefore the branch is independent of $r$. Define $\psi_\ell:A\to B$ by $\psi_\ell(x,v)=\phi_\ell(x,v,r_0)$. Then
\begin{align*}
p_n(x,r,v,w)=\ell \quad \iff \quad w=\psi_\ell(x,v)
\end{align*}
for all $(x,r,v,w)\in A\times J\times B$.[/guided]