Set notation clarification. It may sound like a silly question, but I really want to make sure that I'm getting this right.
I am somewhat ambiguous about what $$\{(x_1,\ldots, x_n)\in \mathbb{N}^n\mid x_i = x_j\} , 1\leq i<j\leq n$$
stands for.
In the case of $n=3$, for example, do we mean the set $\{(1,1,1), (2,2,2), (3,3,3), \ldots\}$ or the set $\{(1,1,1), (1,1,2), (1,1,3), (1,2,1), (1,2,2),\ldots\}$? In other words, do we need $all$ coordinates to be equal or at least two?
 A: $$\{(x_1,\ldots, x_n)\in \mathbb{N}^n\mid x_i = x_j\}$$ means the set of $n$-tuples of natural numbers in which the $i$th and $j$th components are equal. Thus
$$
\{(x_1,x_2,x_3,x_4,x_5) \in \mathbb N^5 \mid x_3=x_5\} \tag 1
$$
is the case where $i=3$ and $j=5.$ It is not a finite set such as those listed in your question, since it says $\text{“}\in\mathbb N^n\text{''},$ and $\mathbb N$ is not finite. In the case $n=5$ you would get $10 = \binom 5 2$ different sets, one of which is that displayed on line $(1)$ above.
However, if it said
$$
\Big\{(x_1,x_2,x_3,x_4,x_5) \in \mathbb N^5 \mid x_i =x_j,\,\,\, 1 \le i < j \le 5\Big\}
$$
instead of
$$
\Big\{(x_1,x_2,x_3,x_4,x_5) \in \mathbb N^5 \mid x_i =x_j \Big\},\,\,\, 1 \le i < j \le 5
$$
then it would mean all components are equal.
A: The general form of the question looks like
$$ S(i,j) = \{x \in A : \phi(i,j)\}$$
where for every $i$ and $j$, we get a set $S(i,j)$. Because we write $\phi(i,j)$ by mentioning $i$ and $j$ specifically, that means that $i$ and $j$ are not quantified (i.e. not associated to a 'there exists' or a 'for all') in the formula $\phi$.
In your example, we have $\phi(i,j) = (x_i = x_j)$. If we had instead wrote $\phi(j) = (\exists i, x_i = x_j)$—and it wouldn't make sense to call this $\phi(i,j)$ because then we would have something like $\phi(1,j) = (\exists 1, x_1 = x_j)$ which is just silly—then we have
$$ S(j) = \{x \in A : \phi(j)\} = \{(x_1,\dots,x_n) \in \mathbb{N}^n : \exists i, x_i = x_j\}. $$
This gives us one set for every $j$. The difference is that the variable $i$ is bound to the quantifier $\exists$ inside the set constructor.
Thus, getting finally to Michael Hardy's point:
$$ S(i,j) = \{(x_1,\dots,x_n) \in \mathbb{N}^n : x_i = x_j\} $$
gives us $n^2$ sets; one set per choice of $i$ and $j$ (not worrying about which sets are identical). On the other hand,
$$ S = \{(x_1,\dots,x_n) \in \mathbb{N}^n : x_i = x_j, 1 \le i < j \le n\} $$
is a single set because there are no unbound variables in the formula "$x_i = x_j, 1 \le i < j \le n$."
In summary:
$$ S(i_1,\dots,i_k) = \{x \in A : \phi(i_1,\dots,i_k)\} $$
defines a collection of sets where we get one set for each choice of unbound variables $(i_1,\dots,i_k)$ in the formula $\phi$.
