Why is the gradient normal to tangent vectors? Suppose $f: \mathbb{R}^n \to \mathbb{R}$ is differentiable at $x$. Let $d_xf$ denote the derivative of $f$ at $x$. Let $L$ be the level set through $x$, $L = \{y \in \mathbb{R}^n: f(y) = f(x)\}$. Suppose $v$ is a tangent vector at $x$ that is tangent to the level set $L$. Then the claim is that $d_xf(v) = 0$. Why is this true? Is there a rigorous justification of this?
I have seen various answers, like Why is the gradient normal? and Why gradient vector is perpendicular to the plane, but I couldn't really find a rigorous justification of that particular fact, that $d_xf(v) = 0$. I can see the intuition but I'd like a proof if possible.
Also, what does it mean precisely when we say "Suppose $v$ is a tangent vector at $x$ that is tangent to the level set $L$"? Can all these facts and notions be defined and proved in the usual multivariable context of Euclidean space $\mathbb{R}^n$ (like in a normal or advanced Calc III course) or do we need an excursion into differential geometry or something? I'd just like to know because some of the multivariable calculus texts/resources I've seen, as well as some answers on this site, mostly seem to gloss over the details and just roughly justify it by appealing to geometric intuition, which I think is useful but I would also like a proof.
 A: If you're granting the fact (given by the implicit function theorem) that the level set actually has a tangent plane at $x$, then any tangent vector is the velocity vector of some curve $\gamma(t)$ contained in the level set. We may assume that $\gamma(0)=x$ and $\gamma'(0)=v$. Then $f(\gamma(t)) = \text{constant}$ (by definition of level set), and so, by the chain rule,
$$0=d_xf(\gamma'(0)) = d_xf(v),$$
as you desired.
A: Given the definition of level set, it is a $(n-1)$-dimensional surface in $\mathbb{R}^n$: the set of all points $y$ of $\mathbb{R}^n$ that satisfy a single condition, i.e. $f(y)=f(x),$ with $x$ fixed.
So, the level sets can be represented in parametric form in the neighborhood of each point as $y=y(q),$ where $q\in U\subseteq\mathbb{R}^{n-1}$ are parameters. Given that for each $q\in U$ the corresponding point $y(q)$ belongs to the level set, we have the identity
$$
f(y(q))=f(x),\qquad\forall q\in U.
$$
Differentiating this relation we have
$$
\sum_{i=1}^n\frac{\partial f}{\partial x_i}(y(q))\frac{\partial y_i}{\partial q_k}(q)=0,\qquad \forall k=1,\ldots,n-1,
$$
but $\frac{\partial f}{\partial x_i}(y(q))$ are the components of the gradient vector in $y(q)$, while, for fixed $k,$ $\frac{\partial y_i}{\partial q_k}(q)$ are the components of the $k$-th coordinate tangent vector, with respect to the given parametrization, let's call it $t_k(q)$, so the preceding relation can be interpreted as an inner product
$$
\nabla f(y(q))\cdot t_k(q) = 0,\qquad\forall k=1,\ldots,n-1.
$$
Finally, every tangent vector $v$ in $q$ is a linear combination of the $t_k(q)$, i.e. $v=\sum_{k=1}^{n-1}v_kt_k(q),$ then
\begin{align}
\nabla f(y(q))\cdot v 
    &= \nabla f(y(q))\cdot\sum_{k=1}^{n-1}v_kt_k(q) = \\
    &= \sum_{k=1}^{n-1}v_k[\nabla f(y(q))\cdot t_k(q)] = 0.
\end{align}
