# Convention of writing constraint sets

As I will write constraint sets very often, I would like to make sure that I respect the convention.

First, I would like to represent a set of constraints and their relation are conjunction. For instance, $[1 \leq i \leq 2, 1 \leq j \leq 2]$ means the set of all possible pairs of $(i,j)$: $\{(1,1); (1,2); (2,1); (2,2)\}$.

Do you think $[1 \leq i \leq 2, 1 \leq j \leq 2]$ or $\{1 \leq i \leq 2; 1 \leq j \leq 2\}$ is better?

Let's denote the above constraint set (a). Second, I want to say another constraint set "forall i, j satisfying (a), $x \leq i$ and $x \leq j$", which is actually $(-\infty, 1]$ for $x$.

Do you think $\forall i, j \in (a), [x \leq i, x \leq j]$ is the best way to formalize that?

-
In general your sets are written like that: $\{(i,j) : 1 \leq i \leq 2, 1 \leq j \leq 2 \}$, that is you describe the general element of your set then you give the constraints. More info: en.wikipedia.org/wiki/Set_builder_notation – Najib Idrissi Feb 29 '12 at 14:33
If you are talking about pairs $(i,j)$, then also use that notation in the description of the set: $A = \{(i,j) : 1 \leq i,j \leq 2\} = \{(1,1); (1,2); (2,1); (2,2)\}$. Then for the set of $x$-values you could write something like $X = \{x : \forall (i,j) \in A: x \leq i,j\} = (-\infty, 1]$. – TMM Feb 29 '12 at 14:34
Note that you can also save time and space by writing $\{(1,1); (1,2); (2,1); (2,2)\} = \{1,2\}^2$ which is also accepted notation. – TMM Feb 29 '12 at 14:37

Do you think $[1\le i\le 2,1 \le j\le 2]$ or $\{1\le i\le 2; 1\le j\le 2\}$ is better?

Both are bad. The first notation clashes with the popular Iverson bracket notation, which stands not for the set itself, but for its characteristic function. The second notation actually describes the set of two elements, in which one element is the inequality $1\le i\le 2$ and the other is the inequality $1\le j\le 2$. (Sets can contain not only numbers, but also formulas, words, and puppies -- possibly all together).

Standard ways to describe this set include $\{(i,j) : 1\le i\le 2, 1\le j\le 2\}$ and $\{(i,j) \; |\; 1\le i\le 2, 1\le j\le 2\}$.

Do you think $\forall i,j\in (a),[x\le i,x\le j]$ is the best way to formalize that?

Writing "$i,j\in (a)$" says that $i$ and $j$ are elements of (a). What you mean is $(i,j)\in (a)$. But the role of $x$ (the fact that its possible values are to be collected into a set) remains somewhat unclear. I suggest either $$\{x : x\le i \text{ and }x\le j \text{ for all }(i,j)\in (a)\}$$ (plain English shouldn't be forgotten) or $$\bigcap_{(i,j)\in (a)}\{x : x\le i \text{ and }x\le j\}$$ Of course, there's a room for simplification with $x\le \min(i,j)$, but that's a different story.