I need to simplify a set of solutions of a system, say for example:
A := (a[1] == 3 && a[2] <= 1 && b[1] <= 5) || (a[1] == 3 && a[2] == 1 && b[1] == -7)
I care only about a[1] and a[2] but I can not use Eliminate since I have inequalities. So one solution is:
Simplify[Reduce[Exists[{b[1]}, A]]]
a[1] == 3 && a[2] <= 1
It works! But since I have a large system (many b's) I need to automate this. Since:
Array[b, 1]
{b[1]}
I tried:
Simplify[Reduce[Exists[Array[b,1],A]]]
a[1] == 3 && a[2] <= 1 && b[1] <= 5
The second method yields the wrong outcome! What am I doing wrong here?
HoldPattern. For example,HoldPattern[a@# == _] -> True & /@ Range@5will generate replacement rules fora[1]througha[5]– rm -rf Mar 29 '13 at 01:38