# How can I expand a inequality with Abs

I want

Abs[x] + Abs[y] <= 1


to be convert to

x + y <= 1 && x + y >= -1 && x - y <= 1 && x - y >= -1


How could I get it with Mathematica?

-
Reduce[Abs[x] + Abs[y] <= 1, {x, y}, Reals] already does a pretty good job--and incidentally shows that all solutions lie in the interval $[-1,1]$. – whuber Jan 30 '13 at 19:22

expandAbs[eq_] := And @@ Flatten@Module[{case},
eq //.
x_?((case = Cases[#, Abs[_], Infinity, 1]) =!= {} &) :> (case =
First[case]; {x /. case -> First[case],
x /. case -> -First[case]})]
expandAbs[Abs[x] + Abs[y] <= 1]

-
This isn't always algebraically correct, but this is: expandAbs[eq_] := Module[{case}, eq //. x_?((case = Cases[#, Abs[_], Infinity, 1]) =!= {} &) :> (case = First[case]; Or[(x /. case -> First[case]) && First@case >= 0, (x /. case -> -First[case]) && First@case < 0])] – VF1 Aug 30 '13 at 5:06

In case you want to visualize the answer:

RegionPlot[Evaluate@Reduce[Abs[x] + Abs[y] <= 1, {x, y}, Reals], {x,-2,2}, {y,-2,2}]


-
Abs[x] + Abs[y] //. (k_: 1) Abs[x_] + y_ :> {k x + y, -k x + y} /.
t_ :> And @@ Thread[Flatten[t] <= 1]


x + y <= 1 && x - y <= 1 && -x + y <= 1 && -x - y <= 1

Abs[x] + 2 Abs[y] + 3 Abs[z] //. (k_: 1) Abs[x_] + y_ :> {k x + y, -k x + y} /.
t_ :> And @@ Thread[Flatten[t] <= 1]


x + 2 y + 3 z <= 1 && x + 2 y - 3 z <= 1 && x - 2 y + 3 z <= 1 && x - 2 y - 3 z <= 1 && -x + 2 y + 3 z <= 1 && -x + 2 y - 3 z <= 1 && -x - 2 y + 3 z <= 1 && -x - 2 y - 3 z <= 1

-