In the last post we encountered the notion of spaces, which are a way of thinking about situations numerically and geometrically. We saw a few examples of spaces:
Rn is the set of all n-tuples of real numbers, which we think of as n-dimensional space
[a,b] is the interval of numbers between a and b (inclusive on both sides).
in particular, I:=[0,1] consists of all x with 0≤x≤1
S1 is the unit circle in R2
In this post, we'll discuss a way to combine two (or more) spaces X and Y into a new space X×Y, called the product of X and Y. There are two reasons to do this:
it gives us more interesting examples of spaces;
conversely, we understand complicated spaces by expressing them in terms of simpler "building block" spaces. Most questions about X×Y can be answered by answering the same question for the spaces X and Y, and combining the answers somehow.
The space X×Y is analogous to the tuple type [X, Y].
Let's explain why this operation is called multiplication. If X is a finite set, we write ∣X∣ for the number of elements of X, also called the cardinality or size of X. For example, ∣{a,b,c}∣=3.
When X and Y are finite sets, the size of X×Y is the product of the sizes of X and Y:
∣X×Y∣=∣X∣∣Y∣.
For instance, say we have three possible colors and four shapes. The number of possible colored shapes is 3×4=12:
These three options aren't "literally" equal. As an analogy, in TypeScript, [X, Y, Z], [[X, Y], Z], and [X, [Y, Z]] are all different types. But there is an obvious way to go between them:
(x,y,z)⟷((x,y),z)⟷(x,(y,z)).
In math, we generally leave these conversions implicit, so we will write
(X×Y)×Z=X×Y×Z=X×(Y×Z).
I'll say a bit more about this expanded view of equality a few posts from now.
In my area of math (homotopy theory), there's often a lot of work that needs to be done to keep track of all these implicit conversions. One of the difficulties is that when converting between (X×X)×X and X×(X×X), you don't want to accidentally use the "wrong" conversion
((x,y),z)⟷(z,(y,x))
(which wouldn't typecheck for (X×Y)×Z versus X×(Y×Z))