Does a singular Jacobian matrix imply functional dependence? I often find the following "fact" mentioned in engineering mathematics texts and videos:

If $f_1,...,f_n$ are $C^1$ functions from $\mathbb{R}^n$ to $\mathbb{R}$ such that the Jacobian matrix of the map $(f_1,...,f_n)$ vanishes everywhere, then the $f_i$'s must be functionally related.

They seem to use the following definition of functionally related: There is some $C^1$ function $\phi:\mathbb{R}^n \rightarrow\mathbb{R}$ such that $\nabla\phi$ is nonzero everywhere, and
$\phi(f_1,...,f_n)=0$ everywhere.
It is easy to see (using chain rule and some elementary linear algebra) why this definition of functionally related would lead to the Jacobian being singular everywhere. But what intrigues me is the converse claim. I am unable to come up with a rigorous proof or a counterexample.  All the multivariable calculus books I have seen so far are silent on this point.
Any helpful pointer would be greatly appreciated.
 A: Let $f_1$, $\ldots$, $f_{k+1}$ such that the jacobian of $(f_1, \ldots, f_k)$ has maximal rank $k$, but the jacobian of $(f_1, \ldots,f_{k+1})$ has constant rank $k$. Then $f_{k+1}$ is a function of $f_1$, $\ldots$, $f_k$.
Indeed, any locus $(f_1,\ldots, f_k)=$ const is a manifold of codimension $k$. Because of the condition on the jacobian of $(f_1, \ldots,f_{k+1})$ the function $f_{k+1}$ is constant on such a locus. It follows that $f_{k+1}= F(f_1, \ldots, f_k)$, for $F$ function of $k$ variables. This function will be smooth, since the map $(f_1, \ldots, f_k)$ is a submersion.
$\bf{Added:}$ Let's explain why if $f_1$, $\ldots$, $f_k$ have jacobian of maximal rank $k$, and $\operatorname{grad}f$ is linearly dependent on $\operatorname{grad}f_1$, $\ldots$, $\operatorname{grad}f_k$, then $f$ is locally constant on any submanifold of the form $f_i = c_i$, $i=1, k$. Indeed, consider a smooth path $t \mapsto \phi(t)$ on such a submanifold. Then at every $t$ we have
$$\langle \operatorname{grad}f_i\ _ {\phi(t)}, \phi'(t)\rangle = 0$$ and by the linear dependence of the gradients we get
$$\langle \operatorname{grad}f _ {\phi(t)}, \phi'(t)\rangle = 0$$
and so the function $f(\phi(t))$ is constant in $t$.
