I'm trying to find a way to force a group of variables to take the same sign. Either positive or negative. Clearly, the fact that an OR statement is required implies that the problem becomes non-convex, also confirmed at this question and this question.
I then thought about the following expression:
$$ \text{if } |a + b| = |a| + |b| \text{ then } sign(a) = sign(b) $$
Since it is possible to linearize absolute value constraints under certain conditions, I then thought about adding auxiliary variables that are larger than the absolute values in the above expression, and "putting pressure" on these variables by penalizing them (as separate terms) in the objective function. If my reasoning is correct, this should lead to a solution that enforces the sign equality constraint if the auxiliary variables are penalized enough.
For example:
\begin{align} \arg \min_{a,b,y_a,y_b,z} \quad (c_a &a + c_b b) + M (y_a + y_b) + N z \\ \text{subject to} \quad y_{a} &\geq +a \\ y_{a} &\geq -a \\ y_{b} &\geq +b \\ y_{b} &\geq -b \\ z &\geq +(a + b) \\ z &\geq -(a + b) \\ z &= y_a + y_b \end{align}
If $M$ and $N$ are big enough, would this lead to the correct solution?
Where does my reasoning go wrong?
Nota bene: this problem is a vastly simplified example of my actual optimization problem. Since I want to enforce equal signs on many different groups of variables, I cannot split the program into two separate problems and choose the solution with the lowest objective value.
By using the equality constraint to eliminate $z$, we obtain from the last two inequalities that \begin{align} y_a + y_b &\ge a+b \\ y_a + y_b &\ge -(a+b) \end{align} But these constraints are redundant because they are just aggregations of the first four constraints. For sufficiently large $M$, every optimal solution will satisfy $y_a=|a|$ and $y_b=|b|$, but nothing forces $\operatorname{sign}{(a)}=\operatorname{sign}{(b)}$. In fact, the problem decomposes into two independent problems with no connection between $a$ and $b$.