I am trying to formulate an optimization problem with the following constraint: $y = 1$ if $x \le c$ and $y = 0$ if $x > c$ which is basically an indicator function $y = 1[x \le c]$ and $c$ would be the decision variable here (hence $y$).
I noticed that big-M is the typical way of dealing with indicator constraints but it only works for the opposite direction: e.g., if $y = 1$ then $x \le c$.
I wonder if there's a way of formulating this as an optimization constraint. Thank you!
Update: The optimization problem would be something like \begin{align*} & \max \;\; f(y) \\ & \text{s.t.} \;\; y = 1[x \le c]\\ & y = \{0,1\}, c \in \mathbb{R} \end{align*} where $x$ is a fixed parameter. The objective function is a function of $y$, so we would like to optimize the choice of $c$ (which can be thought of as a threshold) such that $f(y)$ is maximized/minimized.