# Solving a ForAll optimization problem in Mathematica

I am trying to solve the following optimization problem in Mathematica:

Minimize[{y0 + y2 m2, ForAll[x, y0+y2 x^2 >= Boole[x>0]]}, {y0,y2}]


Unfortunately, it just throws it back at me when I type it in.

I feel like this should be within what Mathematica can solve, being mostly about second-degree polynomials and simple range checks.

Is there some way I might convince Mathematica of this? Perhaps some assumptions I can add?

Ideally, I would like to generalize the above to fourth-degree polynomials as well. I wonder if there are some documented limits on which optimization problems are within the scope of Mathematica?

## 1 Answer

The Resolve command should be added in your code:

Minimize[{y0 + y2 *m2,Resolve[ForAll[x,y0 + y2 x^2 >= Boole[x> 0]], Reals]},{y0,y2}]


$$\left\{ \begin{array}{cc} \{ & \begin{array}{cc} 1 & \text{m2}=0\lor \text{m2}>0 \\ -\infty & \text{True} \\ \end{array} \\ \end{array} ,\left\{\text{y0}\to \begin{array}{cc} \{ & \begin{array}{cc} 1 & \text{m2}=0\lor \text{m2}>0 \\ \text{Indeterminate} & \text{True} \\ \end{array} \\ \end{array} ,\text{y2}\to \begin{array}{cc} \{ & \begin{array}{cc} 1 & \text{m2}=0 \\ 0 & \text{m2}>0 \\ \text{Indeterminate} & \text{True} \\ \end{array} \\ \end{array} \right\}\right\}$$

• Thank you very much! – Thomas Ahle May 7 at 11:58