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 \or S = \varnothing \or 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 \and T \ne \varnothing$$ and from the main result, $$S = T$$

or:
 * $$S = \varnothing \or 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 \or S = \varnothing \or T = \varnothing$$.

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

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

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

by definition of equality.