Primary constraints for constrained Hamiltonian systems
I) Let us suppress position dependence $q^i$ and explicit time dependence $t$ in the following, and also assume that the Lagrangian $L=L(v)$ is a smooth function of the velocities $v^i$, where $i=1, \ldots, n$. The Hessian matrix is defined as
$$ H_{ij}~:=~\frac{\partial^2 L}{\partial v^i \partial v^j}.\tag{1}$$
Let us consider an open neighborhood$^1$ $V$ around a fixed point $v_{(0)}$. Now a very important assumption is the so-called regularity condition, cf. Refs. 1 and 2. This means that the rank of the Hessian $H_{ij}$ should not depend on the point $v$. In other words, the Hessian $H_{ij}$ should have constant rank $r$. (Ref. 3 implicitly assumes this crucial point without stressing its importance.)
We now permute/rename the velocities $(v^1,\ldots, v^n)$ such that the $r\times r$ minor $A_{ab}$ is invertible in the top left corner of the Hessian
$$ H~=~ \begin{bmatrix} A & B \\ C & D \end{bmatrix} ~=~ \underbrace{\begin{bmatrix} 1 & 0 \\ CA^{-1} & 1 \end{bmatrix}}_{\text{invertible}} \begin{bmatrix} A & 0 \\ 0 & D-CA^{-1}B \end{bmatrix} \underbrace{\begin{bmatrix} 1 & A^{-1}B \\ 0 & 1 \end{bmatrix}}_{\text{invertible}}. \tag{2} $$
The renaming is assumed to be done in the same way in the whole neighborhood $V$. This is possibly by going to a smaller open neighborhood (which we also call $V$) if necessary. (Later when we apply inverse function theorem below we might have to implicitly restrict $V$ further.) It follows from the constant rank condition that
$$ D~=~CA^{-1}B. \tag{3}$$
II) We next perform the singular Legendre transformation $v\leadsto p$. Define functions
$$ g_i(v)~:=~\frac{\partial L(v)}{\partial v^i}, \qquad i=1, \ldots, n. \tag{4} $$
The momenta are defined in the Lagrangian theory as
$$ p_i~:=~g_i(v), \qquad i=1, \ldots, n. \tag{5}$$
The velocities
$$ v^i~\longrightarrow~ (u^a,w^{\alpha}) \tag{6} $$
split into two sets of velocity coordinates
$$ u^a, \quad a=1, \ldots, r, \qquad\text{and}\qquad w^{\alpha}, \quad \alpha=1, \ldots, n-r, \tag{7}$$
which we shall call primary expressible (unexpressible) velocities, respectively. Similarly, the momenta
$$ p_i~\longrightarrow~ (\pi_a,\rho_{\alpha}) \tag{8}$$
split into two sets of momentum coordinates
$$ \pi_a, \quad a=1, \ldots, r, \qquad\text{and}\qquad \rho_{\alpha}, \quad \alpha=1, \ldots, n-r. \tag{9}$$
The primary expressible velocities
$$ u^a~=f^a(\pi,w), \qquad a=1, \ldots, r. \tag{10}$$
are extracted from the $r$ first momentum relations (5) via the inverse function theorem with the $w$-variables as passive spectator parameters.
III) Next define composite functions
$$ h_i(\pi,w) ~:=~ g_i(f(\pi,w),w), \qquad i=1, \ldots, n. \tag{11}$$
It follows immediately that
$$ h_a(\pi,w) ~=~ \pi_a, \qquad a=1, \ldots, r. \tag{12}$$
because the functions $g$ and $f$ are each other's inverse for fixed $w$. Differentiation of (12) wrt. $w^{\alpha}$ leads to
$$ \begin{align} 0~=~&\frac{\partial h_a(\pi,w)}{\partial w^{\alpha}} \cr ~\stackrel{(11)}{=}~&\left.\frac{\partial g_a(u,w)}{\partial w^{\alpha}}\right|_{u=f(\pi,w)} +\left. \frac{\partial g_a(u,w)}{\partial u^b} \right|_{u=f(\pi,w)} \frac{\partial f^b(\pi,w)}{\partial w^{\alpha}} \cr ~\stackrel{(1)+(2)+(4)}{=}&\left.B_{a\alpha}\right|_{u=f(\pi,w)} +\left. A_{ab} \right|_{u=f(\pi,w)} \frac{\partial f^b(\pi,w)}{\partial w^{\alpha}} . \end{align}\tag{13} $$
Theorem 1. The $h_i$-functions (11) do not depend on the $w$-variables.
Proof of theorem 1:
$$ \begin{align} \frac{\partial h_{\alpha}(\pi,w)}{\partial w^{\beta}} ~\stackrel{(11)}{=}~&\left.\frac{\partial g_{\alpha}(u,w)}{\partial w^{\beta}}\right|_{u=f(\pi,w)} +\left. \frac{\partial g_{\alpha}(u,w)}{\partial u^a} \right|_{u=f(\pi,w)} \frac{\partial f^a(\pi,w)}{\partial w^{\beta}} \cr ~\stackrel{(1)+(2)+(4)}{=}&\left.D_{\alpha\beta}\right|_{u=f(\pi,w)}+\left. C_{\alpha a} \right|_{u=f(\pi,w)} \frac{\partial f^a(\pi,w)}{\partial w^{\beta}} \cr ~\stackrel{(13)}{=}~&\left. \left(D_{\alpha\beta}-C_{\alpha a}(A^{-1})^{ab}B_{b\beta} \right)\right|_{u=f(\pi,w)}\cr ~\stackrel{(3)}{=}~&0.\end{align}\tag{14} $$
End of proof. The $n-r$ last momentum relations (5) now become $n-r$ functionally independent primary constraints
$$ \phi_{\alpha}(\pi,\rho)~:=~\rho_{\alpha}- h_{\alpha}(\pi)~\approx~0,\tag{15} $$
where the $\approx$ symbol means equality modulo constraints. The primary constraints (15) are clearly functionally independent as each of them depend on different $\rho$ momenta.
IV) The Lagrangian energy function is defined as
$$h(v)~\stackrel{(4)}{:=}~g_i(v) v^i -L(v).\tag{16}$$
Define the Hamiltonian as a composite function
$$\begin{align} H(\pi,w)~:=~&h(f(\pi,w),w)~\cr \stackrel{(10)+(11)+(16)}{=}&h_a(\pi) f^a(\pi,w) +h_{\alpha}(\pi) w^{\alpha} - L(f(\pi,w),w).\end{align}\tag{17}$$
Theorem 2. The Hamiltonian (17) does not depend on the $w$-variables.
Proof of theorem 2:
$$\begin{align} \frac{\partial H}{\partial w^{\alpha}} ~\stackrel{(17)}{=}~&\left(h_a(\pi) -\left. \frac{\partial L(u,w)}{\partial u^a} \right|_{u=f(\pi,w)} \right) \frac{\partial f^a(\pi,w)}{\partial w^{\alpha}} + h_{\alpha}(\pi) -\left. \frac{\partial L(u,w)}{\partial w^{\alpha}} \right|_{u=f(\pi,w)} \cr ~\stackrel{(4)+(11)}{=}~0.\end{align} \tag{18}$$
End of proof.
V) Example with $n=2$ and $r=1$. Let the Lagrangian be
$$ L ~=~\frac{1}{2}\frac{u^2}{1-w}~=~\frac{u^2}{2}\sum_{n=0}^{\infty}w^n, \qquad |w|~<~1. \tag{19}$$
The Hessian
$$ H_{ij}~=~\begin{bmatrix} \frac{1}{1-w} & \frac{u}{(1-w)^2} \\ \frac{u}{(1-w)^2} & \frac{u^2}{(1-w)^3}\end{bmatrix} \tag{20}$$
has two eigenvalues $\frac{1}{1-w}+ \frac{u^2}{(1-w)^3}>0$ and $0$, i.e. it has constant rank $r=1$ when $|w|< 1$.
The first momentum relation
$$ \pi~=~\frac{\partial L}{\partial u}~=~ \frac{u}{1-w} \tag{21}$$
can be inverted to yield
$$ u~=~ (1-w)\pi. \tag{22}$$
The second momentum relation
$$ \rho~=~\frac{\partial L}{\partial w}~=~ \frac{u^2}{2(1-w)^2} ~=~\frac{1}{2}\pi^2\tag{23}$$
leads to a primary constraint
$$ \phi~:=~ \rho -\frac{1}{2}\pi^2~\approx~0. \tag{24}$$
The Hamiltonian (17) becomes
$$ H~=~ \pi u + \rho w -L~=~\frac{1}{2}\pi^2. \tag{25}$$
It is easy to check that there is no secondary constraint. End of example.
References:
M. Henneaux and C. Teitelboim, Quantization of Gauge Systems, (1994), p. 5-7.
D.M. Gitman and I.V. Tyutin, Quantization of fields with constraints, (1990), p. 13-16.
H. Rothe and K. Rothe, Classical and quantum dynamics of constrained Hamiltonian systems, (2010), p. 24-27.
--
$^1$ We will only make a local argument, i.e. ignore global issues.