# Generate family of linear inequalities from vector variable for use in FindInstance

Suppose that I have a vector variable xvec = Array[x, 10]. How do I generate the family of linear inequalities

$$F = \{ {x\in\mathbb{R}^{10}:x_1\geq x_2,\ldots,x_9\geq x_{10}} \}$$

xvec[] >= xvec[] ,..., xvec[] >= xvec[]


Specifically, I would like to do something like:

xvec = Array[x, 10]
FindInstance[xvec[]>=xvec[],...,xvec[]>=xvec[],{xvec}]


which is trivial now but is trying to get at a MWE.

• FindInstance[GreaterEqual @@ xvec, xvec] gives: {x -> 0, x -> 0, x -> 0, x -> 0, x -> 0, x -> 0, x -> 0, x -> 0, x -> 0, x -> 0}} May 29 at 15:52

Use Table.

xvec = Array[x, 10];

ineqs = Table[x[i] >= x[i + 1], {i, 1, Length[xvec] - 1}]
(* {x >= x, x >= x, x >= x, x >= x, x >= x,
x >= x, x >= x, x >= x, x >= x} *)

FindInstance[ineqs, xvec]
(* {{x -> 0, x -> 0, x -> 0, x -> 0, x -> 0, x -> 0,
x -> 0, x -> 0, x -> 0, x -> 0}} *)

• Thanks, this is great! If I have another variable, say a scalar y that I would like to include in the FindInstance, how would I add this in? For example, suppose I have another inequality ineqy = y>0 and I would like to do FindInstance[ineqs && y > 0, {xvec, y}] but I get an error saying FindInstance::ivar: {x,x,x,x,x,x,x,x,x,x} is not a valid variable. May 29 at 15:55
• Not sure if this question is related enough to my original one. If not, then I can create a new question (albeit in like 15 minutes when my post-time-limit deactivates)! May 29 at 16:01
• @rrrrr, you seem to be a novice in Mathematica. I know it can be difficult in the beginning, but it will not be very productive or helpful if you keep asking many small question on StackExchange (yes, there is a good reason for the time-limit). Also, changing a question or adding new subquestions after you got the answer is really discouraged here. I strongly suggest you read through Mathematica tutorials for beginners. There are many of them: May 29 at 16:02
• I am! Ok I will remove my edits and look through the tutorial :) May 29 at 16:04
• (1) Fast Introduction for Math Students, (2) The Wolfram Language: Fast Introduction for Programmers, (3) Stephen Wolfram: An Elementary Introduction to the Wolfram Language, and of course tens of thousands of existing questions on this StackExchange. May 29 at 16:04

In version 12, Mathematica introduced a family of vector comparisons including \[VectorLessEqual]. We can use Differences and then the above operator to get the same effect:

xvec = Array[x, 10]

FindInstance[Differences[xvec] \[VectorLessEqual] 0, xvec]

(* Out: {{x -> 0, x -> 0, x -> 0, x -> 0, x -> 0, x -> 0,
x -> 0, x -> 0, x -> 0, x -> 0}} *)


It's much nicer to see in Mathematica than code: 