The following is Exercise 5.40 from John Lee's ISM.
Suppose $S \subset M$ is a level set of a smooth map $\Phi : M \to N$ with constant rank. Show that $T_pS = {\rm Ker} d\Phi_p$ for each $p \in S$.
I am having a hard time proving this result. From Theorem 5.12 (Constant-Rank Level Set Theorem) of the txt, I know that $S$ is a properly embedded submanifold. I think the proof should be similar to Proposition 5.38. Using the fact that the inclusion map $\iota: S \hookrightarrow M$ is a smooth immersion, I can show that since $\Phi \circ \iota$ is constant on $S$, so $d\Phi_p \circ d \iota_p$ is the zero map from $T_pS$ to $T_{\Phi(P)}N$, and therefore ${\rm Im} d \iota_p \subset {\rm Ker} d\Phi_p$. Up to here, is identical to the proof of Proposition 5.38. However, I cannot use that $d\Phi_p$ is surjective as in the proof, so I cannot conclude that ${\rm Im} d \iota_p = {\rm Ker} d \Phi_p$. I am lost here. I would greatly appreciate any help.

Suppose $\Phi$ has constant rank $k$, which means that $\dim \text{im}\ d\Phi=k.$
By the constant rank theorem there are charts $(U,\varphi)$ at $p\in M$ and $(V,\psi)$ at $\Phi(p)=c$ such that
$(\psi\circ\Phi\circ \varphi)^{-1}(r^1,\cdots,r^n)=(r^1,\cdots,r^k,0,0,\cdots, 0)$.
And since $\varphi(\Phi^{-1}(c))=(\psi\circ\Phi\circ \varphi^{-1})^{-1}(0),$ it follows that $S$ vanishes on the coordinates $x^i=r^i\circ \varphi:1\le i\le k$.
So, in these coordinates, $i(x^1,\cdots,x^n)=(0,\cdots 0, x^{k+1},\cdots,x^n)$ so $\dim \text{im}\ di=n-k.$
Now, $n=\dim \ker \Phi+\dim \text{im}\ \Phi\Rightarrow \dim \ker \Phi=n-k=\dim \text{im}\ di.$