Our professor stated and proved the following theorem (my translation):
Let $m < n$ and $D$ be an open set in $\mathbb{R}^n$. Let $G: D \to \mathbb{R}^m$, $G = (g_1, g_2, \ldots, g_m)$ be a $C^1$ map on $D$ of maximal rank ($\text{rank}(G) = m$). Let $M = G^{-1}(\{0\}) \neq \emptyset$. Let $f \in C^1(D)$. Suppose $f$ has a local extrema at $p \in M$ as a function $f: M \to \mathbb{R}$. Then, there exist constants $\lambda_1, \ldots, \lambda_m \in \mathbb{R}$, such that $(Df)(p) = \sum_1^m {\lambda_j(Dg_j)(p)}$.
The book we're using states and proves the following theorem (also my translation):
Let function $f \in C^1$, $f(x) = f(x_1, \ldots, x_n)$, at point $a$, local extrema under additional conditions: $$ g_1(x_1, \ldots, x_n) = 0$$ $$ g_2(x_1, \ldots, x_n) = 0 $$ $$ \cdots $$ $$ g_m(x_1, \ldots, x_n) = 0 $$ where $g_i$ for $i \in \{ 1, 2, \ldots, m \}$ are $C^1$ functions around $a$ (and of course $g_1(a_1, \ldots, a_n) = g_2(a_1, \ldots, a_n) = \ldots = g_m(a_1, \ldots, a_n) = 0)$. Let the gradients $$(\text{grad}(g_1))(a), (\text{grad}(g_2))(a), \ldots, (\text{grad}(g_m))(a)$$ be linearly independent. Then there exist real numbers $\lambda_1, \lambda_2, \ldots, \lambda_m$, such that $a$ is a stationaty point of function $$F = f - \lambda_1 g_1 - \lambda_2 g_2 - \ldots - \lambda_m g_m$$
Both theorems look very similar or at least related to me. This makes me wonder if they are completely equivalent and how could one show that they are. How are the hypothesis in both theorems equivalent?