2.6 Cartesian product types

2.6 Cartesian product types

Given types

A

and

B

, consider the

cartesian product

type

A

×

B

.
For any

elements

x

,

y

:

A

×

B

and a path

p

:

x

=

A

×

B

y

, by functoriality we can extract paths

𝗉𝗋

1

(

p

)

:

𝗉𝗋

1

(

x

)

=

A

𝗉𝗋

1

(

y

)

and

𝗉𝗋

2

(

p

)

:

𝗉𝗋

2

(

x

)

=

B

𝗉𝗋

2

(

y

)

.
Thus, we have a

function

(

x

=

A

×

B

y

)

→

(

𝗉𝗋

1

(

x

)

=

A

𝗉𝗋

1

(

y

)

)

×

(

𝗉𝗋

2

(

x

)

=

B

𝗉𝗋

2

(

y

)

)

.

(2.6.1)

Theorem 2.6.2

.

For any

x

and

y

, the function (

2.6.1

) is an equivalence.

Read logically, this says that two pairs are equal if they are equal
componentwise. Read category-theoretically, this says that the

morphisms

in a

product

groupoid

are pairs of morphisms. Read
homotopy-theoretically, this says that the paths in a

product
space

are pairs of paths.

Proof.

We need a function in the other direction:

(

𝗉𝗋

1

(

x

)

=

A

𝗉𝗋

1

(

y

)

)

×

(

𝗉𝗋

2

(

x

)

=

B

𝗉𝗋

2

(

y

)

)

→

(

x

=

A

×

B

y

)

.

(2.6.3)

By the

induction

rule for cartesian products, we may assume that

x

and

y

are both pairs, i.e.

x

≡

(

a

,

b

)

and

y

≡

(

a

′

,

b

′

)

for some

a

,

a

′

:

A

and

b

,

b

′

:

B

.
In this case, what we want is a function

(

a

=

A

a

′

)

×

(

b

=

B

b

′

)

→

(

(

a

,

b

)

=

A

×

B

(

a

′

,

b

′

)

)

.

Now by induction for the cartesian product in its domain, we may assume given

p

:

a

=

a

′

and

q

:

b

=

b

′

.
And by two path inductions, we may assume that

a

≡

a

′

and

b

≡

b

′

and both

p

and

q

are

reflexivity

.
But in this case, we have

(

a

,

b

)

≡

(

a

′

,

b

′

)

and so we can take the output to also be reflexivity.

It remains to prove that (

2.6.3

) is

quasi-inverse

to (

2.6.1

).
This is a simple

sequence

of inductions, but they have to be done in the right order.

In one direction, let us start with

r

:

x

=

A

×

B

y

.
We first do a path induction on

r

in order to assume that

x

≡

y

and

r

is reflexivity.
In this case, since

𝖺𝗉

𝗉𝗋

1

and

𝖺𝗉

𝗉𝗋

2

are defined by path induction, (

2.6.1

) takes

r

≡

𝗋𝖾𝖿𝗅

x

to the pair

(

𝗋𝖾𝖿𝗅

𝗉𝗋

1

⁢

x

,

𝗋𝖾𝖿𝗅

𝗉𝗋

2

⁢

x

)

.
Now by induction on

x

, we may assume

x

≡

(

a

,

b

)

, so that this is

(

𝗋𝖾𝖿𝗅

a

,

𝗋𝖾𝖿𝗅

b

)

.
Thus, (

2.6.3

) takes it by definition to

𝗋𝖾𝖿𝗅

(

a

,

b

)

, which (under our current

assumptions

) is

r

.

In the other direction, if we start with

s

:

(

𝗉𝗋

1

(

x

)

=

A

𝗉𝗋

1

(

y

)

)

×

(

𝗉𝗋

2

(

x

)

=

B

𝗉𝗋

2

(

y

)

)

, then we first do induction on

x

and

y

to assume that they are pairs

(

a

,

b

)

and

(

a

′

,

b

′

)

, and then induction on

s

:

(

a

=

A

a

′

)

×

(

b

=

B

b

′

)

to reduce it to a pair

(

p

,

q

)

where

p

:

a

=

a

′

and

q

:

b

=

b

′

.
Now by induction on

p

and

q

, we may assume they are reflexivities

𝗋𝖾𝖿𝗅

a

and

𝗋𝖾𝖿𝗅

b

, in which case (

2.6.3

) yields

𝗋𝖾𝖿𝗅

(

a

,

b

)

and then (

2.6.1

) returns us to

(

𝗋𝖾𝖿𝗅

a

,

𝗋𝖾𝖿𝗅

b

)

≡

(

p

,

q

)

≡

s

.
∎

In particular, we have shown that (

2.6.1

) has an

inverse

(

2.6.3

), which we may denote by

𝗉𝖺𝗂𝗋

=

:

(

𝗉𝗋

1

(

x

)

=

𝗉𝗋

1

(

y

)

)

×

(

𝗉𝗋

2

(

x

)

=

𝗉𝗋

2

(

y

)

)

→

(

x

=

y

)

.

Note that a special case of this yields the propositional uniqueness principle for products:

z

=

(

𝗉𝗋

1

⁢

(

z

)

,

𝗉𝗋

2

⁢

(

z

)

)

.

It can be helpful to view

𝗉𝖺𝗂𝗋

=

as a

constructor

or

introduction

rule

for

x

=

y

, analogous to the “

pairing

” constructor of

A

×

B

itself, which introduces the pair

(

a

,

b

)

given

a

:

A

and

b

:

B

.
From this perspective, the two

components

of (

2.6.1

):

𝖺𝗉

𝗉𝗋

1

:

(

x

=

y

)

→

(

𝗉𝗋

1

(

x

)

=

𝗉𝗋

1

(

y

)

)

𝖺𝗉

𝗉𝗋

2

:

(

x

=

y

)

→

(

𝗉𝗋

2

(

x

)

=

𝗉𝗋

2

(

y

)

)

are

elimination

rules.
Similarly, the two

homotopies

which witness (

2.6.3

) as quasi-inverse to (

2.6.1

) consist, respectively, of

propositional computation rules

:

𝖺𝗉

𝗉𝗋

1

⁢

(

𝗉𝖺𝗂𝗋

=

⁢

(

p

,

q

)

)

=

p

for

⁢

p

:

𝗉𝗋

1

⁢

x

=

𝗉𝗋

1

⁢

y

𝖺𝗉

𝗉𝗋

2

⁢

(

𝗉𝖺𝗂𝗋

=

⁢

(

p

,

q

)

)

=

q

for

⁢

q

:

𝗉𝗋

2

⁢

x

=

𝗉𝗋

2

⁢

y

and a

propositional uniqueness principle

:

r

=

𝗉𝖺𝗂𝗋

=

⁢

(

𝖺𝗉

𝗉𝗋

1

⁢

(

r

)

,

𝖺𝗉

𝗉𝗋

2

⁢

(

r

)

)

for

⁢

r

:

x

=

A

×

B

y

.

We can also characterize the reflexivity, inverses, and composition of paths in

A

×

B

componentwise:

𝗋𝖾𝖿𝗅

(

z

:

A

×

B

)

=

𝗉𝖺𝗂𝗋

=

⁢

(

𝗋𝖾𝖿𝗅

𝗉𝗋

1

⁢

z

,

𝗋𝖾𝖿𝗅

𝗉𝗋

2

⁢

z

)

p

-

1

=

𝗉𝖺𝗂𝗋

=

⁢

(

𝖺𝗉

𝗉𝗋

1

⁢

(

p

)

-

1

,

𝖺𝗉

𝗉𝗋

2

⁢

(

p

)

-

1

)

p

⁢

\centerdot

⁢

q

=

𝗉𝖺𝗂𝗋

=

⁢

(

𝖺𝗉

𝗉𝗋

1

⁢

(

p

)

⁢

\centerdot

⁢

𝖺𝗉

𝗉𝗋

1

⁢

(

q

)

,

𝖺𝗉

𝗉𝗋

2

⁢

(

p

)

⁢

\centerdot

⁢

𝖺𝗉

𝗉𝗋

2

⁢

(

q

)

)

.

The same is true for the rest of the higher groupoid

structure

considered in §2.1 (

http://planetmath.org/21typesarehighergroupoids

).
All of these

equations

can be derived by using path induction on the given paths and then returning reflexivity.

We now consider transport in a pointwise product of type families.
Given type families

A

,

B

:

Z

→

𝒰

, we abusively write

A

×

B

:

Z

→

𝒰

for the type family defined by

(

A

×

B

)

(

z

)

:

≡

A

(

z

)

×

B

(

z

)

.
Now given

p

:

z

=

Z

w

and

x

:

A

⁢

(

z

)

×

B

⁢

(

z

)

, we can transport

x

along

p

to obtain an element of

A

⁢

(

w

)

×

B

⁢

(

w

)

.

Theorem 2.6.4

.

In the above situation, we have

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

A

×

B

⁢

(

p

,

x

)

=

A

⁢

(

y

)

×

B

⁢

(

y

)

(

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

A

⁢

(

p

,

𝗉𝗋

1

⁢

x

)

,

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

B

⁢

(

p

,

𝗉𝗋

2

⁢

x

)

)

.

Proof.

By path induction, we may assume

p

is reflexivity, in which case we have

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

A

×

B

⁢

(

p

,

x

)

≡

x

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

A

⁢

(

p

,

𝗉𝗋

1

⁢

x

)

≡

𝗉𝗋

1

⁢

x

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

B

⁢

(

p

,

𝗉𝗋

2

⁢

x

)

≡

𝗉𝗋

2

⁢

x

.

Thus, it remains to show

x

=

(

𝗉𝗋

1

⁢

x

,

𝗉𝗋

2

⁢

x

)

.
But this is the propositional uniqueness principle for product types, which, as we remarked above, follows from

Theorem

2.6.2 (

http://planetmath.org/26cartesianproducttypes#Thmprethm1

).
∎

Finally, we consider the functoriality of

𝖺𝗉

under cartesian products.
Suppose given types

A

,

B

,

A

′

,

B

′

and functions

g

:

A

→

A

′

and

h

:

B

→

B

′

; then we can define a function

f

:

A

×

B

→

A

′

×

B

′

by

f

(

x

)

:

≡

(

g

(

𝗉𝗋

1

x

)

,

h

(

𝗉𝗋

2

x

)

)

.

Theorem 2.6.5

.

In the above situation, given

x

,

y

:

A

×

B

and

p

:

pr

1

⁢

x

=

pr

1

⁢

y

and

q

:

pr

2

⁢

x

=

pr

2

⁢

y

, we have

f

(

𝗉𝖺𝗂𝗋

=

(

p

,

q

)

)

=

(

f

(

x

)

=

f

(

y

)

)

𝗉𝖺𝗂𝗋

=

(

g

(

p

)

,

h

(

q

)

)

.

Proof.

Note first that the above equation is well-typed.
On the one hand, since

𝗉𝖺𝗂𝗋

=

⁢

(

p

,

q

)

:

x

=

y

we have

f

(

𝗉𝖺𝗂𝗋

=

(

p

,

q

)

)

:

f

(

x

)

=

f

(

y

)

.
On the other hand, since

𝗉𝗋

1

⁢

(

f

⁢

(

x

)

)

≡

g

⁢

(

𝗉𝗋

1

⁢

x

)

and

𝗉𝗋

2

⁢

(

f

⁢

(

x

)

)

≡

h

⁢

(

𝗉𝗋

2

⁢

x

)

, we also have

𝗉𝖺𝗂𝗋

=

(

g

(

p

)

,

h

(

q

)

)

:

f

(

x

)

=

f

(

y

)

.

Now, by induction, we may assume

x

≡

(

a

,

b

)

and

y

≡

(

a

′

,

b

′

)

, in which case we have

p

:

a

=

a

′

and

q

:

b

=

b

′

.
Thus, by path induction, we may assume

p

and

q

are reflexivity, in which case the desired equation holds judgmentally.
∎

Title

2.6 Cartesian product types

\metatable

Generated on Thu Feb 8 19:34:13 2018 by

LaTeXML