# Linear Programming if-then-else [duplicate]

I have a binary variable $y\ \epsilon\ \{0,1\}$ and a real $x$ which has the following boundaries $-100\leq\ x \leq\ 100$. How can I reformulate the following statement: $$y = \begin{cases} 0 & \text{if  x< 0  }\\ 1 & \text{if x \geq0}\\ \end{cases}$$

Your help would be much appreciated.

• What is the form of any "statement" in an LP? Note also that IP ≠ LP; you can't simulate discrete variables fully with (polynomially sized) LPs (since solving IPs is NP-hard in general). – Raphael Apr 3 '18 at 18:01
• – D.W. Apr 3 '18 at 21:42