I am trying to understand how to use the Karush-Kuhn-Tucker conditions, similar as asked but not answered in this thread.
Assume the target function is given by $f(x)$, where $x$ a vector. Let $g(x) \ge 0 $ be an inequality constraint under which we wish to maximize $f$.
The Lagrange function is given by $L(x,\lambda)=f(x)+\lambda g(x)$. From a textbook I know that I have to maximize this function "with respect to the conditions":
$$ g(x) \ge 0 \\ \lambda \ge 0 \\ \lambda g(x) = 0$$
Now I do not fully understand what this means. Does this mean I have to maximize $L$ as if $g(x)=0$ and then I 'check' whether the three conditions are met?
An example. Let $f(x)= 1 - x_1^2 - x_2^2$ and $g(x)= 1-x_1-x_2$. We find
$$ \nabla_x L = 2 \begin{bmatrix} -1 & 0 \\ 0 & -1 \\ \end{bmatrix} x + \lambda \begin{bmatrix} -1 \\ -1 \\ \end{bmatrix} =0 $$
$$ \nabla_{\lambda} L = \begin{bmatrix} -1 \\ -1 \\ \end{bmatrix} x + 1 = 0 $$
From here we can simplify to find $\lambda=-1$ and
$$x=\begin{bmatrix} 1/2 \\ 1/2 \\ \end{bmatrix} $$
We can verify $g(x) = 0$ as well as $\lambda g(x) = 0$ as required. However, $\lambda<-1$. So it seems the optimizations 'failed', but I am not sure what this means. It seems to suggest we found a minimum? Please help me with how to work with these constraints.