9.1 Categories and precategories

9.1 Categories and precategories

In classical mathematics, there are many

equivalent

definitions of a

category

.
In our case, since we have dependent types, it is natural to choose the arrows to be a type family

indexed by

the objects.
This matches the way hom-types are always used in

category theory

: we never even consider comparing two arrows unless we know their domains and

codomains

agree.
Furthermore, it seems clear that for a theory of 1-categories, the hom-types should all be sets.
This leads us to the following definition.

Definition 9.1.1

.

A

precategory

A

consists of the following.

1.

A type

A

0

of

objects

.
We write

a

:

A

for

a

:

A

0

.

2.

For each

a

,

b

:

A

, a set

hom

A

⁡

(

a

,

b

)

of

arrows

or

morphisms

.

3.

For each

a

:

A

, a morphism

1

a

:

hom

A

⁡

(

a

,

a

)

.

4.

For each

a

,

b

,

c

:

A

, a function

hom

A

⁡

(

b

,

c

)

→

hom

A

⁡

(

a

,

b

)

→

hom

A

⁡

(

a

,

c

)

denoted infix by

g

↦

f

↦

g

∘

f

, or sometimes simply by

g

⁢

f

.

5.

For each

a

,

b

:

A

and

f

:

hom

A

⁡

(

a

,

b

)

, we have

f

=

1

b

∘

f

and

f

=

f

∘

1

a

.

6.

For each

a

,

b

,

c

,

d

:

A

and

f

:

hom

A

⁡

(

a

,

b

)

,

g

:

hom

A

⁡

(

b

,

c

)

,

h

:

hom

A

⁡

(

c

,

d

)

,

we have

h

∘

(

g

∘

f

)

=

(

h

∘

g

)

∘

f

.

The problem with the notion of precategory is that for objects

a

,

b

:

A

, we have two possibly-different notions of “sameness”.
On the one hand, we have the type

(

a

=

A

0

b

)

.
But on the other hand, there is the standard

categorical

notion of

isomorphism

.

Definition 9.1.2

.

A morphism

f

:

hom

A

⁡

(

a

,

b

)

is an

isomorphism

if there is a morphism

g

:

hom

A

⁡

(

b

,

a

)

such that

g

∘

f

=

1

a

and

f

∘

g

=

1

b

.
We write

a

≅

b

for the type of such isomorphisms.

Lemma 9.1.3

.

For any

f

:

hom

A

⁡

(

a

,

b

)

, the type “

f

is an isomorphism” is a mere proposition.
Therefore, for any

a

,

b

:

A

the type

a

≅

b

is a set.

Proof.

Suppose given

g

:

hom

A

⁡

(

b

,

a

)

and

η

:

(

1

a

=

g

∘

f

)

and

ϵ

:

(

f

∘

g

=

1

b

)

, and similarly

g

′

,

η

′

, and

ϵ

′

.
We must show

(

g

,

η

,

ϵ

)

=

(

g

′

,

η

′

,

ϵ

′

)

.
But since all hom-sets are sets, their identity types are mere propositions, so it suffices to show

g

=

g

′

.
For this we have

g

′

=

1

a

∘

g

′

=

(

g

∘

f

)

∘

g

′

=

g

∘

(

f

∘

g

′

)

=

g

∘

1

b

=

g

using

η

and

ϵ

′

.
∎

If

f

:

a

≅

b

, then we write

f

-

1

for its

inverse

, which by

\autoref

ct:isoprop is uniquely determined.

The only relationship between these two notions of sameness that we have in a precategory is the following.

Lemma 9.1.4

(

idtoiso

).

If

A

is a precategory and

a

,

b

:

A

, then

(

a

=

b

)

→

(

a

≅

b

)

.

Proof.

By

induction

on identity, we may assume

a

and

b

are the same.
But then we have

1

a

:

hom

A

⁡

(

a

,

a

)

, which is clearly an isomorphism.
∎

Evidently, this situation is analogous to the issue that motivated us to introduce the univalence axiom.
In fact, we have the following:

Example 9.1.5

.

There is a precategory

S

⁢

e

⁢

t

, whose type of objects is

\set

, and with

hom

S

⁢

e

⁢

t

(

A

,

B

)

:

≡

(

A

→

B

)

.
The identity morphisms are

identity functions

and the composition is function composition.
For this precategory,

\autoref

ct:idtoiso is equal to (the

restriction

to sets of) the map

idtoeqv

from

\autoref

sec:compute-universe.

Of course, to be more precise we should call this category

S

⁢

e

⁢

t

U

, since its objects are only the

small sets

relative to a

universe

U

.

Thus, it is natural to make the following definition.

Definition 9.1.6

.

A

category

is a precategory such that for all

a

,

b

:

A

, the function

idtoiso

a

,

b

from

\autoref

ct:idtoiso is an

equivalence

.

In particular, in a category, if

a

≅

b

, then

a

=

b

.

Example 9.1.7

.

The univalence axiom implies immediately that

S

⁢

e

⁢

t

is a category.
One can also show, using univalence, that any precategory of set-level

structures

such as groups, rings,

topological spaces

, etc. is a category; see

\autoref

sec:sip.

We also note the following.

Lemma 9.1.8

.

In a category, the type of objects is a 1-type.

Proof.

It suffices to show that for any

a

,

b

:

A

, the type

a

=

b

is a set.
But

a

=

b

is equivalent to

a

≅

b

, which is a set.
∎

We write

𝗂𝗌𝗈𝗍𝗈𝗂𝖽

for the inverse

(

a

≅

b

)

→

(

a

=

b

)

of the map

𝗂𝖽𝗍𝗈𝗂𝗌𝗈

from

\autoref

ct:idtoiso.
The following relationship between the two is important.

Lemma 9.1.9

.

For

p

:

a

=

a

′

and

q

:

b

=

b

′

and

f

:

hom

A

⁡

(

a

,

b

)

, we have

(

p

,

q

)

*

(

f

)

=

𝗂𝖽𝗍𝗈𝗂𝗌𝗈

(

q

)

∘

f

∘

𝗂𝖽𝗍𝗈𝗂𝗌𝗈

(

p

)

-

1

.

(9.1.9)

Proof.

By induction, we may assume

p

and

q

are

𝗋𝖾𝖿𝗅

a

and

𝗋𝖾𝖿𝗅

b

respectively.
Then the left-hand side of (

9.1.9

) is simply

f

.
But by definition,

𝗂𝖽𝗍𝗈𝗂𝗌𝗈

⁢

(

𝗋𝖾𝖿𝗅

a

)

is

1

a

, and

𝗂𝖽𝗍𝗈𝗂𝗌𝗈

⁢

(

𝗋𝖾𝖿𝗅

b

)

is

1

b

, so the right-hand side of (

9.1.9

) is

1

b

∘

f

∘

1

a

, which is equal to

f

.
∎

Similarly, we can show

𝗂𝖽𝗍𝗈𝗂𝗌𝗈

⁢

(

p

-

1

)

=

(

𝗂𝖽𝗍𝗈𝗂𝗌𝗈

⁢

(

p

)

)

-

1

(9.1.11)

𝗂𝖽𝗍𝗈𝗂𝗌𝗈

⁢

(

p

⁢

\centerdot

⁢

q

)

=

𝗂𝖽𝗍𝗈𝗂𝗌𝗈

⁢

(

q

)

∘

𝗂𝖽𝗍𝗈𝗂𝗌𝗈

⁢

(

p

)

(9.1.11)

𝗂𝗌𝗈𝗍𝗈𝗂𝖽

⁢

(

f

∘

e

)

=

𝗂𝗌𝗈𝗍𝗈𝗂𝖽

⁢

(

e

)

⁢

\centerdot

⁢

𝗂𝗌𝗈𝗍𝗈𝗂𝖽

⁢

(

f

)

(9.1.11)

and so on.

Example 9.1.11

.

A precategory in which each set

hom

A

⁡

(

a

,

b

)

is a mere proposition is equivalently a type

A

0

equipped with a mere

relation

“

≤

” that is

reflexive

(

a

≤

a

) and

transitive

(if

a

≤

b

and

b

≤

c

, then

a

≤

c

).
We call this a

preorder

.

In a preorder, a witness

f

:

a

≤

b

is an isomorphism just when there exists some witness

g

:

b

≤

a

.
Thus,

a

≅

b

is the mere proposition that

a

≤

b

and

b

≤

a

.
Therefore, a preorder

A

is a category just when (1) each type

a

=

b

is a mere proposition, and (2) for any

a

,

b

:

A

0

there exists a function

(

a

≅

b

)

→

(

a

=

b

)

.
In other words,

A

0

must be a set, and

≤

must be antisymmetric (if

a

≤

b

and

b

≤

a

, then

a

=

b

).
We call this a

(partial) order

or a

poset

.

Example 9.1.12

.

If

A

is a category, then

A

0

is a set if and only if for any

a

,

b

:

A

0

, the type

a

≅

b

is a mere proposition.
This is equivalent to saying that every isomorphism in

A

is an identity; thus it is rather

stronger

than the classical notion of “

skeletal

” category.
Categories of this sort are sometimes called

gaunt

[

bsp12infncats

]

.
There is not really any notion of “skeletality” for our categories, unless one considers

\autoref

ct:category itself to be such.

Example 9.1.13

.

For any 1-type

X

, there is a category with

X

as its type of objects and with

hom

(

x

,

y

)

:

≡

(

x

=

y

)

.
If

X

is a set, we call this the

discrete

category on

X

.
In general, we call it a

groupoid

(see

\autoref

ct:groupoids).

Example 9.1.14

.

For

any

type

X

, there is a precategory with

X

as its type of objects and with

hom

(

x

,

y

)

:

≡

∥

x

=

y

∥

0

.
The composition operation

∥

y

=

z

∥

0

→

∥

x

=

y

∥

0

→

∥

x

=

z

∥

0

is defined by induction on truncation from

concatenation

(

y

=

z

)

→

(

x

=

y

)

→

(

x

=

z

)

.
We call this the

fundamental pregroupoid

of

X

.
(In fact, we have met it already in

\autoref

sec:van-kampen; see also

\autoref

ex:rezk-vankampen.)

Example 9.1.15

.

There is a precategory whose type of objects is

U

and with

hom

(

X

,

Y

)

:

≡

∥

X

→

Y

∥

0

, and composition defined by induction on truncation from ordinary composition

(

Y

→

Z

)

→

(

X

→

Y

)

→

(

X

→

Z

)

.
We call this the

homotopy

precategory of types

.

Example 9.1.16

.

Let

R

⁢

e

⁢

l

be the following precategory:

•

Its objects are sets.

•

hom

ℛ

⁢

e

⁢

l

⁡

(

X

,

Y

)

=

X

→

Y

→

𝖯𝗋𝗈𝗉

.

•

For a set

X

, we have

1

X

(

x

,

x

′

)

:

≡

(

x

=

x

′

)

.

•

For

R

:

hom

ℛ

⁢

e

⁢

l

⁡

(

X

,

Y

)

and

S

:

hom

ℛ

⁢

e

⁢

l

⁡

(

Y

,

Z

)

, their composite is defined by

(

S

∘

R

)

(

x

,

z

)

:

≡

∥

∑

y

:

Y

R

(

x

,

y

)

×

S

(

y

,

z

)

∥

.

Suppose

R

:

hom

R

⁢

e

⁢

l

⁡

(

X

,

Y

)

is an isomorphism, with inverse

S

.
We observe the following.

1.

If

R

⁢

(

x

,

y

)

and

S

⁢

(

y

′

,

x

)

, then

(

R

∘

S

)

⁢

(

y

′

,

y

)

, and hence

y

′

=

y

.
Similarly, if

R

⁢

(

x

,

y

)

and

S

⁢

(

y

,

x

′

)

, then

x

=

x

′

.

2.

For any

x

, we have

x

=

x

, hence

(

S

∘

R

)

⁢

(

x

,

x

)

.
Thus, there merely exists a

y

:

Y

such that

R

⁢

(

x

,

y

)

and

S

⁢

(

y

,

x

)

.

3.

Suppose

R

⁢

(

x

,

y

)

.
By

2

, there merely exists a

y

′

with

R

⁢

(

x

,

y

′

)

and

S

⁢

(

y

′

,

x

)

.
But then by

1

, merely

y

′

=

y

, and hence

y

′

=

y

since

Y

is a set.
Therefore, by transporting

S

⁢

(

y

′

,

x

)

along this equality, we have

S

⁢

(

y

,

x

)

.
In

conclusion

,

R

⁢

(

x

,

y

)

→

S

⁢

(

y

,

x

)

.
Similarly,

S

⁢

(

y

,

x

)

→

R

⁢

(

x

,

y

)

.

4.

If

R

⁢

(

x

,

y

)

and

R

⁢

(

x

,

y

′

)

, then by

3

,

S

⁢

(

y

′

,

x

)

, so that by

1

,

y

=

y

′

.
Thus, for any

x

there is at most one

y

such that

R

⁢

(

x

,

y

)

.
And by

2

, there merely exists such a

y

, hence there exists such a

y

.

In conclusion, if

R

:

hom

R

⁢

e

⁢

l

⁡

(

X

,

Y

)

is an isomorphism, then for each

x

:

X

there is exactly one

y

:

Y

such that

R

⁢

(

x

,

y

)

, and dually.
Thus, there is a function

f

:

X

→

Y

sending each

x

to this

y

, which is an equivalence; hence

X

=

Y

.
With a little more work, we conclude that

R

⁢

e

⁢

l

is a category.

We might now restrict ourselves to considering categories rather than precategories.
Instead, we will develop many

concepts

for precategories as well as categories, in order to emphasize how much better-behaved categories are, as compared both to precategories and to ordinary categories in classical mathematics.

We will also see in

\crefrange

sec:strict-categoriessec:dagger-categories that in slightly more exotic contexts, there are uses for certain kinds of precategories other than categories, each of which “fixes” the equality of objects in different ways.
This emphasizes the “pre”-ness of precategories: they are the raw material out of which

multiple

important categorical structures can be defined.

Title

9.1 Categories and precategories

\metatable

Generated on Thu Feb 8 19:42:19 2018 by

LaTeXML