2.15 Universal properties

2.15 Universal properties

By combining the path computation rules described in the preceding

sections

, we can show that various type forming

operations

satisfy

the expected

universal properties

, interpreted in a homotopical way as equivalences.
For

instance

, given types

X

,

A

,

B

, we have a

function

(

X

→

A

×

B

)

→

(

X

→

A

)

×

(

X

→

B

)

(2.15.1)

defined by

f

↦

(

𝗉𝗋

1

∘

f

,

𝗉𝗋

2

∘

f

)

.

Theorem 2.15.2

.

(

2.15.1

) is an equivalence.

Proof.

We define the

quasi-inverse

by sending

(

g

,

h

)

to

λ

⁢

x

.

(

g

⁢

(

x

)

,

h

⁢

(

x

)

)

.
(Technically, we have used the

induction

principle for the

cartesian product

(

X

→

A

)

×

(

X

→

B

)

, to reduce to the case of a pair.
From now on we will often apply this principle without explicit mention.)

Now given

f

:

X

→

A

×

B

, the round-trip composite yields the function

λ

⁢

x

.

(

𝗉𝗋

1

⁢

(

f

⁢

(

x

)

)

,

𝗉𝗋

2

⁢

(

f

⁢

(

x

)

)

)

.

(2.15.3)

By

Theorem

2.6.2 (

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

), for any

x

:

X

we have

(

𝗉𝗋

1

⁢

(

f

⁢

(

x

)

)

,

𝗉𝗋

2

⁢

(

f

⁢

(

x

)

)

)

=

f

⁢

(

x

)

.
Thus, by function extensionality, the function (

2.15.3

) is equal to

f

.

On the other hand, given

(

g

,

h

)

, the round-trip composite yields the pair

(

λ

⁢

x

.

g

⁢

(

x

)

,

λ

⁢

x

.

h

⁢

(

x

)

)

.
By the uniqueness principle for functions, this is (judgmentally) equal to

(

g

,

h

)

.
∎

In fact, we also have a dependently typed version of this universal property.
Suppose given a type

X

and type families

A

,

B

:

X

→

𝒰

.
Then we have a function

(

∏

x

:

X

(

A

⁢

(

x

)

×

B

⁢

(

x

)

)

)

→

(

∏

x

:

X

A

⁢

(

x

)

)

×

(

∏

x

:

X

B

⁢

(

x

)

)

(2.15.4)

defined as before by

f

↦

(

𝗉𝗋

1

∘

f

,

𝗉𝗋

2

∘

f

)

.

Theorem 2.15.5

.

(

2.15.4

) is an equivalence.

Proof.

Left to the reader.
∎

Just as

Σ

-types are a

generalization

of cartesian products, they satisfy a generalized version of this universal property.
Jumping right to the dependently typed version, suppose we have a type

X

and type families

A

:

X

→

𝒰

and

P

:

∏

(

x

:

X

)

A

⁢

(

x

)

→

𝒰

.
Then we have a function

(

∏

x

:

X

∑

(

a

:

A

(

x

)

)

P

⁢

(

x

,

a

)

)

→

(

∑

(

g

:

∏

(

x

:

X

)

A

(

x

)

)

∏

(

x

:

X

)

P

⁢

(

x

,

g

⁢

(

x

)

)

)

.

(2.15.6)

Note that if we have

P

(

x

,

a

)

:

≡

B

(

x

)

for some

B

:

X

→

𝒰

, then (

2.15.6

) reduces to (

2.15.4

).

Theorem 2.15.7

.

(

2.15.6

) is an equivalence.

Proof.

As before, we define a quasi-inverse to send

(

g

,

h

)

to the function

λ

⁢

x

.

(

g

⁢

(

x

)

,

h

⁢

(

x

)

)

.
Now given

f

:

∏

(

x

:

X

)

∑

(

a

:

A

(

x

)

)

P

⁢

(

x

,

a

)

, the round-trip composite yields the function

λ

⁢

x

.

(

𝗉𝗋

1

⁢

(

f

⁢

(

x

)

)

,

𝗉𝗋

2

⁢

(

f

⁢

(

x

)

)

)

.

(2.15.8)

Now for any

x

:

X

, by Corollary 2.7.3 (

http://planetmath.org/27sigmatypes#Thmprecor1

) (the uniqueness principle for

Σ

-types) we have

(

𝗉𝗋

1

⁢

(

f

⁢

(

x

)

)

,

𝗉𝗋

2

⁢

(

f

⁢

(

x

)

)

)

=

f

⁢

(

x

)

.

Thus, by function extensionality, (

2.15.8

) is equal to

f

.
On the other hand, given

(

g

,

h

)

, the round-trip composite yields

(

λ

⁢

x

.

g

⁢

(

x

)

,

λ

⁢

x

.

h

⁢

(

x

)

)

, which is judgmentally equal to

(

g

,

h

)

as before.
∎

This is noteworthy because the propositions-as-types

interpretation

of (

2.15.6

) is “the

axiom of choice

”.
If we read

Σ

as “there exists” and

Π

(sometimes) as “for all”, we can pronounce:

•

∏

(

x

:

X

)

∑

(

a

:

A

(

x

)

)

P

⁢

(

x

,

a

)

as “for all

x

:

X

there exists an

a

:

A

⁢

(

x

)

such that

P

⁢

(

x

,

a

)

”, and

•

∑

(

g

:

∏

(

x

:

X

)

A

(

x

)

)

∏

(

x

:

X

)

P

⁢

(

x

,

g

⁢

(

x

)

)

as “there exists a

choice function

g

:

∏

(

x

:

X

)

A

⁢

(

x

)

such that for all

x

:

X

we have

P

⁢

(

x

,

g

⁢

(

x

)

)

”.

Thus, Theorem 2.15.7 (

http://planetmath.org/215universalproperties#Thmprethm3

) says that not only is the axiom of choice “true”, its

antecedent

is actually

equivalent

to its

conclusion

.
(On the other hand, the classical mathematician may find that (

2.15.6

) does not carry the usual meaning of the axiom of choice, since we have already specified the values of

g

, and there are no choices left to be made.
We will return to this point in §3.8 (

http://planetmath.org/38theaxiomofchoice

).)

The above universal property for pair types is for “

mapping

in”, which is familiar from the category-theoretic notion of

products

.
However, pair types also have a universal property for “mapping out”, which may look less familiar.
In the case of cartesian products, the non-dependent version simply expresses
the cartesian

closure

adjunction

:

(

(

A

×

B

)

→

C

)

≃

(

A

→

(

B

→

C

)

)

.

The dependent version of this is formulated for a type family

C

:

A

×

B

→

𝒰

:

(

∏

w

:

A

×

B

C

⁢

(

w

)

)

≃

(

∏

(

x

:

A

)

∏

(

y

:

B

)

C

⁢

(

x

,

y

)

)

.

Here the right-to-left function is simply the induction principle for

A

×

B

, while the left-to-right is evaluation at a pair.
We leave it to the reader to prove that these are quasi-inverses.
There is also a version for

Σ

-types:

(

∏

w

:

∑

(

x

:

A

)

B

⁢

(

x

)

C

⁢

(

w

)

)

≃

(

∏

(

x

:

A

)

∏

(

y

:

B

(

x

)

)

C

⁢

(

x

,

y

)

)

.

(2.15.9)

Again, the right-to-left function is the induction principle.

Some other induction principles are also part of universal properties of this sort.
For instance, path induction is the right-to-left direction of an equivalence as follows:

(

∏

(

x

:

A

)

∏

(

p

:

a

=

x

)

B

⁢

(

x

,

p

)

)

≃

B

⁢

(

a

,

𝗋𝖾𝖿𝗅

a

)

(2.15.10)

for any

a

:

A

and type family

B

:

∏

(

x

:

A

)

(

a

=

x

)

→

𝒰

.
However, inductive types with

recursion

, such as the

natural numbers

, have more complicated universal properties; see

http://planetmath.org/node/87578

Chapter 5.

Since Theorem 2.15.2 (

http://planetmath.org/215universalproperties#Thmprethm1

) expresses the usual universal property of a cartesian product (in an appropriate homotopy-theoretic sense), the categorically inclined reader may well wonder about other limits and

colimits

of types.
In

http://planetmath.org/node/87640

Exercise 2.9 we ask the reader to show that the

coproduct

type

A

+

B

also has the expected universal property, and the nullary cases of

𝟏

(the

terminal object

) and

𝟎

(the

initial object

) are easy.

For

pullbacks

, the expected explicit construction works: given

f

:

A

→

C

and

g

:

B

→

C

, we define

A

×

C

B

:

≡

∑

(

a

:

A

)

∑

(

b

:

B

)

(

f

(

a

)

=

g

(

b

)

)

.

(2.15.11)

In

http://planetmath.org/node/87642

Exercise 2.11 we ask the reader to verify this.
Some more general homotopy limits can be constructed in a similar way, but for colimits we will need a new ingredient; see

http://planetmath.org/node/87579

Chapter 6.

Title

2.15 Universal properties

\metatable

Generated on Thu Feb 8 19:33:30 2018 by

LaTeXML