15 Fundamental Lemma
Consider the unconstrained minimization of a differentiable function
f:A\subseteq \mathbb{R}^n\to \mathbb{R}.
If \bm{x}^\star is an interior local minimizer, the first-order necessary condition is
\nabla f(\bm{x}^\star)=\bm{0}.
The analogous statement in the calculus of variations is that, at a local minimizer x, the first variation must vanish in every admissible direction:
\delta\mathcal{J}(x;\eta)=0.
An admissible perturbation \eta is a function such that x+\alpha\eta remains in the admissible set for all sufficiently small |\alpha|. The fundamental lemma converts an integral identity valid for every admissible test function into a pointwise identity.
15.1 Statement
Lemma 15.1 (Lemma) Let
f:[a,b]\to\mathbb{R},\qquad f\in C([a,b]).
If
\int_a^b f(x)g(x)\,\mathrm{d}x=0 \tag{15.1}
for every test function g\in C_c^\infty((a,b)), then
f(x)=0\qquad \forall x\in[a,b].
Here C_c^\infty((a,b)) denotes the set of infinitely differentiable functions whose support is a compact subset of (a,b).
15.2 Sign Persistence
The proof relies on a simple consequence of continuity.
Lemma 15.2 (Lemma) Let f:[a,b]\to\mathbb{R} be continuous and suppose that f(c)>0 for some c\in(a,b). Then there exists \delta>0, with
[c-\delta,c+\delta]\subset(a,b),
such that
f(x)\geq \frac{f(c)}{2}>0 \qquad \forall x\in[c-\delta,c+\delta].
Proof. Choose
\varepsilon=\frac{f(c)}{2}>0.
Since f is continuous at c, there exists \delta>0 such that
|x-c|<\delta \quad\Longrightarrow\quad |f(x)-f(c)|<\frac{f(c)}{2}.
Therefore
f(x)>f(c)-\frac{f(c)}{2}=\frac{f(c)}{2}.
Reducing \delta if necessary ensures that [c-\delta,c+\delta]\subset(a,b). \square
15.3 Proof Strategy: A Triangular Test Function
Before giving the fully rigorous proof, it is useful to see the central idea with a test function for which every computation is explicit.
Assume, seeking a contradiction, that f is not identically zero. If necessary replace f by -f, so that for some c\in(a,b),
f(c)>0.
By Lemma 15.2, choose \delta>0 such that
f(x)\geq \frac{f(c)}{2}>0 \qquad \forall x\in[c-\delta,c+\delta].
Now consider the triangular function
g_\triangle(x)= \begin{cases} \frac{x-(c-\delta)}{\delta}, & c-\delta\leq x\leq c,\\[6pt] \frac{c+\delta-x}{\delta}, & c\leq x\leq c+\delta,\\[6pt] 0, & \text{otherwise}. \end{cases} \tag{15.2}
It satisfies
g_\triangle(x)\geq0, \qquad \operatorname{supp}(g_\triangle)=[c-\delta,c+\delta], \qquad g_\triangle(c)=1.
Moreover, its integral is simply the area of a triangle of base 2\delta and height 1:
\int_a^b g_\triangle(x)\,\mathrm{d}x = \frac{1}{2}(2\delta)(1) = \delta.
Therefore
\begin{aligned} \int_a^b f(x)g_\triangle(x)\,\mathrm{d}x &= \int_{c-\delta}^{c+\delta}f(x)g_\triangle(x)\,\mathrm{d}x\\ &\geq \frac{f(c)}{2} \int_{c-\delta}^{c+\delta}g_\triangle(x)\,\mathrm{d}x\\ &= \frac{f(c)\delta}{2}>0. \end{aligned} \tag{15.3}
The triangular test function g_\triangle makes the sign argument and the integral estimate completely explicit.
Why This Is Not Yet a Proof
The computation above contains the essential logic of the fundamental lemma, but it does not yet prove Lemma 15.1 as stated.
Indeed,
g_\triangle\in C_c^0((a,b)),
but g_\triangle is not differentiable at
x=c-\delta,\qquad x=c,\qquad x=c+\delta,
and hence
g_\triangle\notin C_c^\infty((a,b)).
The hypothesis in Equation 15.1 is only known for smooth compactly supported test functions. Consequently, inserting g_\triangle directly into Equation 15.1 would be a logical gap.
The important point is that nothing is wrong with the sign argument. Only the regularity of the chosen test function must be repaired.
15.4 Smooth Bump Function
A standard smooth building block is
h(s)= \begin{cases} \exp(-1/s), & s>0,\\ 0, & s\leq0. \end{cases} \tag{15.4}
This function belongs to C^\infty(\mathbb{R}), and all of its derivatives vanish at s=0.
A compactly supported bump centered at c is obtained more directly as
g_\infty(x)= \begin{cases} \displaystyle \exp\!\left(-\frac{1}{\delta^2-(x-c)^2}\right), & |x-c|<\delta,\\[10pt] 0, & |x-c|\geq\delta. \end{cases} \tag{15.5}
It has exactly the properties required for the proof:
g_\infty\in C_c^\infty((a,b)),
g_\infty(x)\geq0,
and
\operatorname{supp}(g_\infty)=[c-\delta,c+\delta].
Furthermore,
g_\infty(x)>0 \qquad \text{for }|x-c|<\delta,
so that
\int_{c-\delta}^{c+\delta}g_\infty(x)\,\mathrm{d}x>0.
A smooth test function with the same localization and sign properties used in the triangular argument.
15.5 Rigorous Proof
Proof. Assume that f is not identically zero. Then there exists c\in(a,b) such that f(c)\neq0. Replacing f by -f if necessary, suppose that
f(c)>0.
By Lemma 15.2, there exists \delta>0 such that
[c-\delta,c+\delta]\subset(a,b)
and
f(x)\geq\frac{f(c)}{2}>0 \qquad \forall x\in[c-\delta,c+\delta].
Choose the smooth bump g_\infty defined in Equation 15.5. Since
g_\infty\in C_c^\infty((a,b)),
it is an admissible test function in Equation 15.1. Hence the hypothesis of the fundamental lemma would give
\int_a^b f(x)g_\infty(x)\,\mathrm{d}x=0.
On the other hand, because g_\infty\geq0 and is supported in [c-\delta,c+\delta],
\begin{aligned} \int_a^b f(x)g_\infty(x)\,\mathrm{d}x &= \int_{c-\delta}^{c+\delta}f(x)g_\infty(x)\,\mathrm{d}x\\ &\geq \frac{f(c)}{2} \int_{c-\delta}^{c+\delta}g_\infty(x)\,\mathrm{d}x\\ &>0, \end{aligned}
which is a contradiction. Therefore
f(x)=0 \qquad \forall x\in(a,b).
Since f is continuous on [a,b], the same conclusion extends to the endpoints:
f(a)=f(b)=0.
Thus
f\equiv0\quad\text{on }[a,b].
\square
15.6 Interpretation
The triangular and smooth proofs use exactly the same mechanism:
- if f(c)\neq0, continuity forces f to retain the same sign in a neighborhood of c;
- choose a nonnegative test function supported entirely in that neighborhood;
- the product fg then has one strict sign on a set of positive measure;
- consequently \int fg cannot vanish.
The triangular function makes Steps 2–4 transparent because its area is elementary. The smooth bump then reproduces the same argument inside the actual test space C_c^\infty((a,b)) and turns the intuitive argument into a rigorous proof.