Distributivity of products over sums; semiring vibes [01HJ]

The notation of \times and + for products and sum is not a coincidence. In fact, the collection of all sets under product and sum forms something like a commutative semiring, except that the equational laws of a semiring have to be replaced with isomorphism (which we will learn about later). Since we have already seen the concept of cardinality, we can at least make the following observations:

\begin {aligned} \mathord {\#}{\mathopen {}\left (A\times {\mathopen {}\left (B\times C\right )\mathclose {}}\right )\mathclose {}} &= \mathord {\#}{{\mathopen {}\left ({\mathopen {}\left (A\times B\right )\mathclose {}}\times C\right )\mathclose {}}} \\ \mathord {\#}{\mathopen {}\left (A+{\mathopen {}\left (B+C\right )\mathclose {}}\right )\mathclose {}} &= \mathord {\#}{{\mathopen {}\left ({\mathopen {}\left (A+B\right )\mathclose {}}+C\right )\mathclose {}}} \\ \mathord {\#}{\mathopen {}\left ({\mathopen {}\left \{*\right \}\mathclose {}}\times A\right )\mathclose {}} &= \mathord {\#}{A} \\ \mathord {\#}{\mathopen {}\left (\varnothing +A\right )\mathclose {}} &= \mathord {\#}{A} \\ \mathord {\#}{A\times B} &= \mathord {\#}{B\times A} \\ \mathord {\#}{\mathopen {}\left (A+B\right )\mathclose {}} &= \mathord {\#}{\mathopen {}\left (B+A\right )\mathclose {}} \\ \mathord {\#}{\mathopen {}\left (A\times {\mathopen {}\left (B+C\right )\mathclose {}}\right )\mathclose {}} &= \mathord {\#}{\mathopen {}\left ({\mathopen {}\left (A\times B\right )\mathclose {}}+{\mathopen {}\left (A\times C\right )\mathclose {}}\right )\mathclose {}} \end {aligned}

So the set with a single element is the neutral set for the binary product operation, and the empty set is the neutral set for the binary sum operation. One way to understand what is happening here is to say that the collection of cardinalities forms something like a commutative semiring (but we must state this carefully, because there cannot exist a set of all cardinalities).

Once we learn about isomorphism, we will be able to see that the semiring structure of cardinalities shown above is the shadow of a richer structure on sets. If you become a mathematician, you may in the future refer to this semiring-like structure of sets under product and sum as a two dimensional semiring or 2-semiring for short. But you don’t need to know or use that terminology to work with these basic operations.