Cartesian Product is Anticommutative

Theorem
Let $S, T \ne \varnothing$.

Then:
 * $S \times T = T \times S \implies S = T$.

Corollary

 * $S \times T = T \times S \iff S = T \lor S = \varnothing \lor T = \varnothing$

Proof
Suppose $S \times T = T \times S$.

Then:

Thus it can be seen from the definition of set equality that $S \times T = T \times S \implies S = T$.

Note that if $S = \varnothing$ or $T = \varnothing$ then, from Cartesian Product Null, $S \times T = T \times S = \varnothing$ whatever $S$ and $T$ are, and the result does not hold.

Proof of Corollary
Suppose $S \times T = T \times S$.

Then either:


 * $S \ne \varnothing \land T \ne \varnothing$ and from the main result, $S = T$

or:
 * $S = \varnothing \lor T = \varnothing$ and from Cartesian Product Null, $S \times T = T \times S = \varnothing$.

In either case, we see that:
 * $S \times T = T \times S \implies S = T \lor S = \varnothing \lor T = \varnothing$.

Now suppose $S = T \lor S = \varnothing \lor T = \varnothing$.

From Cartesian Product Null, we have that:
 * $S = \varnothing \lor T = \varnothing \implies S \times T = \varnothing = T \times S$.

Similarly:
 * $S = T \land \neg \left({S = \varnothing \lor T = \varnothing}\right) \implies S \times T = T \times S$

by definition of equality.