# Best way to write a system of conditions

Quite simply, I am wondering if there is a cleaner (and more easily altered) way to write a system of conditions for an evaluation. For instance, suppose I have something like (I don't think a real MWE is needed here)

FindInstance[a1 && a2 &&...&& an]


where each a is a conditional expression.

Is there a way to write this as something like the following?

Conditions1 = a1 && a2 && a3;
Conditions2 = a4 && a5 &&...&& an;
FindInstance[Conditions1 && Conditions2]


Any more practical alternatives are greatly appreciated.

## 2 Answers

Short answer: Yes.

Because And has the attribute Flat, And[a, b, And[c, And[d, e]], And[f, g]] is the same as And[a,b,c,d,e,f,g]:

And[a, b, And[c, And[d, e]], And[f, g]]

 a && b && c && d && e && f && g

And[a, b, c, d, e, f, g]

 a && b && c && d && e && f && g


Using the example conditions for cvgmt's answer:

conditions1 = And[x + y > 0, x y > 0]

x + y > 0 && x y > 0

conditions2 = And[x > 1, y < 5]

 x > 1 && y < 5

And[conditions1, conditions2]


x + y > 0 && x y > 0 && x > 1 && y < 5

FindInstance[conditions1 && conditions2, {x, y}]

{{x -> 2, y -> 5/2}}


Note: Re the argument expr in FindInstance[expr, ...]

So, you can also do

FindInstance[{conditions1, conditions2}, {x, y}]

{{x -> 2, y -> 5/2}}

conditions1 = {x + y > 0, x*y > 0};
conditions2 = {x > 1, y < 5};
FindInstance[Join[conditions1, conditions2], {x, y}]