Theorem. Equivalence of Rectangles and Surjective Cartesian Decompositions [00GM]

The species of rectangles is equal to the species of non-degenerate cartesian decompositions.

Proof. We use function extensionality extensionality, and show that

for any finite set . We start by constructing a map

by setting

The quotient maps and are automatically surjective. (TODO)

Let . Notice that the fiber of over is equivalent to which is contractible by . Using the universal property of the set quotient we can conclude that all fibers of are contractible, hence is an equivalence. With and surjectivity proofs we have that is a cartesian decomposition.

To construct the inverse map

define equivalence relations on by

To construct , notice that fiber of over is equivalent to , which is contractible since is an equivalence.

Now we show that and are mutual inverses, starting with

Recall that has components

and has inverse , so applying gives equivalence relations

Since , we can compute the following logical equivalences.

By propositional extensionality we get the equality and analogously

The term from is a proof that the type is contractible. After transporting along and , this is a proof of the same proposition as , so the two are equal. Hence

Now we show that

Recall that , with

We will write and . Applying gives

together with . We now construct equivalences and such that . We show that is surjective. Given , we can use that surjectivity of gives some with , so . Then

so is surjective. Applying the above Lemma to we get an equivalence and implies By the same argument we get an equivalence with implies

Given , we have thus and , so

Since is the inverse of , we have that , so

Since the surjectivity proofs are just propostions they agree with with , after transporting along . Thus

⁠