An exercise on computing the critical points on a manifold My friend asked an exercise on critical points on a manifold. The exercise is the following:
Define
$$M:=\{(x,y,w,z)\in \mathbb{R}^4|x^2+y^2+w^2+z^2=1, xy+wz=0\}$$
and by inverse function theorem (and some routine computation), this is exactly a two dimensional differentiable manifold in $\mathbb{R}^4$. Then the exercise is, let
$$f:M\rightarrow \mathbb{R}, f((x,y,w,z)):=x,$$
and find the critical points of $f$.
Of course the definition of a critical point is: $p\in M$, in some local coordinate $(u,v)$, we have
$$\frac{\partial f}{\partial u}(p)=\frac{\partial f}{\partial v}(p)=0.$$
What my friend asked me is: write
$$
F(x, y, z, w)=\left(\begin{array}{c}
x^{2}+y^{2}+z^{2}+w^{2}-1 \\
x y+z w
\end{array}\right),J F_{p}=\left(\begin{array}{cccc}
2 x & 2 y & 2 z & 2 w \\
y & x & w & z
\end{array}\right),
$$
then how to explain that $(x,y,z,w)$ is a critical point if and only if
$$
\operatorname{rank}\left(\begin{array}{cccc}
2 x & 2 y & 2 z & 2 w \\
y & x & w & z \\
1 & 0 & 0 & 0
\end{array}\right)=2?
$$
This exercise (for maths major students) must be used for checking whether you have fully digested the acurate meanings of basic notions. But unfortunately, I forgot most things in this undergraduate course, so I have no idea how to pass from the very definition to this equivalent form (though it's really intuitive, so intuitive that I even didn't think this needs to be proved!). Any explanation would be welcome and thanks in advance!
 A: There are three manifolds here (technically, one is a variety not a manifold, but where it intersects the other is well away from any singular points, so we can ignore the difference).

*

*$S^3 = \{(x,y,z,w) \mid x^2 + y^2 + z^2 + w^2 = 1\}$ is the 3-sphere embedded in $\Bbb R^4$. It is the zero-set of $g_S(x,y,z,w) = x^2 + y^2 + z^2 + w^2 - 1$.

*$V = \{(x,y,z,w) \mid xy+zw = 0\}$ is the zero-set of $g_V(x,y,z,w) = xy+zw$.

*$M = S^3 \cap V$. In general the intersection of two manifolds does not always have to be a manifold, but in this case it is.

Your matrix consists of the gradients of the three functions:
$$\begin{pmatrix}\nabla g_S\\\nabla g_V\\\nabla f\end{pmatrix}$$
The gradient of a function always points in the direction where it is increasing fastest. Directions perpendicular to the gradient are where the function is unchanging, at least to first order approximation. If this were not so, then adding a component of movement in an increasing direction perpendicular to the gradient would result in a faster rise.
Since $S^3$ and $V$ are zero-sets, $g_S$ and $g_V$ are constant in the directions tangent to the two manifolds. The gradients are therefore perpendicular to the tangent hyperplanes to the manifolds. As these are $3$-dimensional manifolds in a $4$-dimensional space, the gradient of each is the only direction perpendicular to its tangent hyperplane. As $M$ is a subset of both $S^3$ and $V$, it must also be perpendicular to both $\nabla g_S$ and $\nabla g_V$ at each point.
Now notice from the gradients that $\nabla g_S$ and $\nabla g_V$ can only be parallel if $x = y$ and $z = w$. But that means $g_V(x,y,z,w) = x^2 + z^2$, so the only point of $V$ for which this is true is $(0,0,0,0)$, which is not a point of $S^3$ and therefore not of $M$ either. I.e. at every point of $M$, $\nabla g_S$ and $\nabla g_V$ are independent and therefore span a two-dimensional space normal to $M$. As a $2$-dimensional manifold, the tangent space at each point is also two-dimensional and perpendicular to the normal space.
Because $\text{rank}\begin{pmatrix}\nabla g_S\\\nabla g_V\end{pmatrix} = 2$, saying that $$\text{rank}\begin{pmatrix}\nabla g_S\\\nabla g_V\\\nabla f\end{pmatrix} = 2$$
means that $\nabla f$ is a linear combination of $\nabla g_S$ and $\nabla g_V$, and thus lies in the normal space, with no components in the tangent space.
But for any coordinate system $u, v$ on $M$, the partial derivatives $\frac{\partial f}{\partial u}, \frac{\partial f}{\partial v}$ are the components of $\nabla f$ in the directions of $u$ and $v$, which are tangent to $M$. Where the matrix is rank $2$, $\nabla f$ has no components tangent to $M$, so both $\frac{\partial f}{\partial u} = 0, \frac{\partial f}{\partial v} = 0$.
Conversely if both partial derivatives are $0$, then, as they span the tangent space, $\nabla f$ can have no component in it. Therefore it is a vector in the normal space, and thus is in the span of $\nabla g_S$ and $\nabla g_V$. So the matrix has rank 2.
