5.5 Homotopy-inductive types

5.5 Homotopy-inductive types

In §5.3 (

http://planetmath.org/53wtypes

) we showed how to encode

natural numbers

as

𝖶

-types, with

𝐍

𝐰

:

≡

𝖶

(

b

:

𝟐

)

𝗋𝖾𝖼

𝟐

(

𝒰

,

𝟎

,

𝟏

)

,

0

𝐰

:

≡

𝗌𝗎𝗉

(

0

𝟐

,

(

λ

x

.

𝗋𝖾𝖼

𝟎

(

𝐍

𝐰

,

x

)

)

)

,

𝐬

𝐰

:

≡

λ

n

.

𝗌𝗎𝗉

(

1

𝟐

,

(

λ

x

.

n

)

)

.

We also showed how one can define a

𝖽𝗈𝗎𝖻𝗅𝖾

function

on

𝐍

𝐰

using the

recursion

principle.
When it comes to the

induction

principle, however, this encoding is no longer satisfactory: given

E

:

𝐍

𝐰

→

𝒰

and recurrences

e

z

:

E

⁢

(

0

𝐰

)

and

e

s

:

∏

(

n

:

𝐍

𝐰

)

∏

(

y

:

E

(

n

)

)

E

⁢

(

𝐬

𝐰

⁢

(

n

)

)

, we can only

construct

a dependent function

r

⁢

(

E

,

e

z

,

e

s

)

:

∏

(

n

:

𝐍

𝐰

)

E

⁢

(

n

)

satisfying the given recurrences

propositionally

, i.e. up to a path.
This means that the computation rules for natural numbers, which give judgmental equalities, cannot be derived from the rules for

𝖶

-types in any obvious way.

This problem goes away if instead of the conventional inductive types we consider

homotopy-inductive types

, where all computation rules are stated up to a path, i.e. the symbol

≡

is replaced by

=

. For

instance

, the computation rule for the

homotopy

version of

𝖶

-types

𝖶

𝗁

becomes:

•

For any

a

:

A

and

f

:

B

⁢

(

a

)

→

𝖶

(

x

:

A

)

h

⁢

B

⁢

(

x

)

we have

𝗋𝖾𝖼

𝖶

(

x

:

A

)

h

⁢

B

⁢

(

x

)

(

E

,

𝗌𝗎𝗉

(

a

,

f

)

)

=

e

(

a

,

f

,

(

λ

b

.

𝗋𝖾𝖼

𝖶

(

x

:

A

)

h

⁢

B

⁢

(

x

)

(

E

,

f

(

b

)

)

)

)

Homotopy-inductive types have an obvious disadvantage when it comes to computational properties — the

behavior

of any function constructed using the induction principle can now only be characterized propositionally.
But numerous other considerations drive us to consider homotopy-inductive types as well.
For instance, while we showed in §5.4 (

http://planetmath.org/54inductivetypesareinitialalgebras

) that inductive types are homotopy-initial

algebras

, not every homotopy-initial algebra is an inductive type (i.e.

satisfies

the corresponding induction principle) — but every homotopy-initial algebra

is

a homotopy-inductive type.
Similarly, we might want to apply the uniqueness

argument

from §5.2 (

http://planetmath.org/52uniquenessofinductivetypes

) when one (or both) of the types involved is only a homotopy-inductive type — for instance, to show that the

𝖶

-type encoding of

ℕ

is

equivalent

to the usual

ℕ

.

Additionally, the notion of a homotopy-inductive type is now internal to the

type theory

.
For example, this means we can form a type of all

natural numbers objects

and make assertions about it.
In the case of

𝖶

-types, we can characterize a homotopy

𝖶

-type

𝖶

(

x

:

A

)

⁢

B

⁢

(

x

)

as any type endowed with a

supremum

function and an induction principle satisfying the appropriate (propositional) computation rule:

𝖶

d

(

A

,

B

)

:

≡

∑

W

:

𝒰

∑

(

𝗌𝗎𝗉

:

∏

(

a

)

(

B

(

a

)

→

W

)

→

W

)

∏

(

E

:

W

→

𝒰

)

∏

(

e

:

∏

(

a

,

f

)

(

∏

(

b

:

B

(

a

)

)

E

(

f

(

b

)

)

)

→

E

(

𝗌𝗎𝗉

(

a

,

f

)

)

)

∑

(

𝗂𝗇𝖽

:

∏

(

w

:

W

)

E

(

w

)

)

∏

(

a

,

f

)

𝗂𝗇𝖽

(

𝗌𝗎𝗉

(

a

,

f

)

)

=

e

(

a

,

λ

b

.

𝗂𝗇𝖽

(

f

(

b

)

)

)

.

In

http://planetmath.org/node/87579

Chapter 6 we will see some other reasons why propositional computation rules are worth considering.

In this

section

, we will state some basic facts about homotopy-inductive types.
We omit most of the proofs, which are somewhat technical.

Theorem 5.5.1

.

For any

A

:

U

and

B

:

A

→

U

, the type

W

d

⁢

(

A

,

B

)

is a mere proposition.

It turns out that there is an equivalent

characterization

of

𝖶

-types using a recursion principle, plus certain

uniqueness

and

coherence

laws. First we give the recursion principle:

•

When constructing a function from the

𝖶

-type

𝖶

(

x

:

A

)

h

⁢

B

⁢

(

x

)

into the type

C

, it suffices to give its value for

𝗌𝗎𝗉

⁢

(

a

,

f

)

, assuming we are given the values of all

f

⁢

(

b

)

with

b

:

B

⁢

(

a

)

.
In other words, it suffices to construct a function

c

:

∏

a

:

A

(

B

(

a

)

→

C

)

→

C

.

The associated computation rule for

𝗋𝖾𝖼

𝖶

(

x

:

A

)

h

⁢

B

⁢

(

x

)

⁢

(

C

,

c

)

:

(

𝖶

(

x

:

A

)

⁢

B

⁢

(

x

)

)

→

C

is as follows:

•

For any

a

:

A

and

f

:

B

⁢

(

a

)

→

𝖶

(

x

:

A

)

h

⁢

B

⁢

(

x

)

we have
a witness

β

⁢

(

C

,

c

,

a

,

f

)

for

equality

𝗋𝖾𝖼

𝖶

(

x

:

A

)

h

⁢

B

⁢

(

x

)

(

C

,

c

,

𝗌𝗎𝗉

(

a

,

f

)

)

=

c

(

a

,

λ

b

.

𝗋𝖾𝖼

𝖶

(

x

:

A

)

h

⁢

B

⁢

(

x

)

(

C

,

c

,

f

(

b

)

)

)

.

Furthermore, we assert the following uniqueness principle, saying that any two functions defined by the same recurrence are equal:

•

Let

C

:

𝒰

and

c

:

∏

(

a

:

A

)

(

B

(

a

)

→

C

)

→

C

be given. Let

g

,

h

:

(

𝖶

(

x

:

A

)

h

⁢

B

⁢

(

x

)

)

→

C

be two functions which satisfy the recurrence

c

up to propositional equality, i.e., such that we have

β

g

:

∏

a

,

f

g

(

𝗌𝗎𝗉

(

a

,

f

)

)

=

c

(

a

,

λ

b

.

g

(

f

(

b

)

)

)

,

β

h

:

∏

a

,

f

h

(

𝗌𝗎𝗉

(

a

,

f

)

)

=

c

(

a

,

λ

b

.

h

(

f

(

b

)

)

)

.

Then

g

and

h

are equal, i.e. there is

α

⁢

(

C

,

c

,

f

,

g

,

β

g

,

β

h

)

of type

g

=

h

.

Recall that when we have an induction principle rather than only a recursion principle, this propositional uniqueness principle is

derivable

(

Theorem

5.3.1 (

http://planetmath.org/53wtypes#Thmprethm1

)).
But with only recursion, the uniqueness principle is no longer derivable — and in fact, the statement is not even true (exercise). Hence, we

postulate

it as an axiom.
We also postulate the following coherence law, which tells us how the proof of uniqueness behaves on canonical

elements

:

•

For any

a

:

A

and

f

:

B

⁢

(

a

)

→

C

, the following

diagram

commutes propositionally:

\includegraphics

HoTT_fig_5.5.1.png

where

α

abbreviates the path

α

⁢

(

C

,

c

,

f

,

g

,

β

g

,

β

h

)

:

g

=

h

.

Putting all of this data together yields another characterization of

𝖶

(

x

:

A

)

⁢

B

⁢

(

x

)

, as a type with a supremum function, satisfying simple elimination, computation, uniqueness, and coherence rules:

𝖶

s

(

A

,

B

)

:

≡

∑

W

:

𝒰

∑

𝗌𝗎𝗉

:

∏

(

a

)

(

B

(

a

)

→

W

)

→

W

∏

C

:

𝒰

∏

c

:

∏

(

a

)

(

B

(

a

)

→

C

)

→

C

∑

𝗋𝖾𝖼

:

W

→

C

∑

β

:

∏

(

a

,

f

)

𝗋𝖾𝖼

(

𝗌𝗎𝗉

(

a

,

f

)

)

=

c

(

a

,

λ

b

.

𝗋𝖾𝖼

(

f

(

b

)

)

)

∏

g

:

W

→

C

∏

h

:

W

→

C

∏

β

g

:

∏

(

a

,

f

)

g

(

𝗌𝗎𝗉

(

a

,

f

)

)

=

c

(

a

,

λ

b

.

g

(

f

(

b

)

)

)

∏

β

h

:

∏

(

a

,

f

)

h

(

𝗌𝗎𝗉

(

a

,

f

)

)

=

c

(

a

,

λ

b

.

h

(

f

(

b

)

)

)

∑

α

:

∏

(

w

:

W

)

g

⁢

(

w

)

=

h

⁢

(

w

)

α

(

𝗌𝗎𝗉

(

x

,

f

)

)

\centerdot

β

h

=

β

g

\centerdot

c

(

a

,

-

)

(

𝖿𝗎𝗇𝖾𝗑𝗍

λ

b

.

α

(

f

(

b

)

)

)

Theorem 5.5.2

.

For any

A

:

U

and

B

:

A

→

U

, the type

W

s

⁢

(

A

,

B

)

is a mere proposition.

Finally, we have a third, very concise characterization of

𝖶

(

x

:

A

)

⁢

B

⁢

(

x

)

as an h-initial

𝖶

-algebra:

𝖶

h

(

A

,

B

)

:

≡

∑

I

:

𝖶𝖠𝗅𝗀

⁢

(

A

,

B

)

𝗂𝗌𝖧𝗂𝗇𝗂𝗍

𝖶

(

A

,

B

,

I

)

.

Theorem 5.5.3

.

For any

A

:

U

and

B

:

A

→

U

, the type

W

h

⁢

(

A

,

B

)

is a mere proposition.

It turns out all three characterizations of

𝖶

-types are in fact equivalent:

Lemma 5.5.4

.

For any

A

:

U

and

B

:

A

→

U

, we have

𝖶

d

⁢

(

A

,

B

)

≃

𝖶

s

⁢

(

A

,

B

)

≃

𝖶

h

⁢

(

A

,

B

)

Indeed, we have the following theorem, which is an improvement over Theorem 5.4.7 (

http://planetmath.org/54inductivetypesareinitialalgebras#Thmprethm3

):

Theorem 5.5.5

.

The types satisfying the formation,

introduction

, elimination, and propositional computation rules for

W

-types are precisely the homotopy-initial

W

-algebras.

Sketch of proof.

Inspecting the proof of Theorem 5.4.7 (

http://planetmath.org/54inductivetypesareinitialalgebras#Thmprethm3

), we see that only the

propositional

computation rule was required to establish the h-initiality of

𝖶

(

x

:

A

)

⁢

B

⁢

(

x

)

.
For the converse implication, let us assume that the polynomial functor associated
to

A

:

𝒰

and

B

:

A

→

𝒰

, has an h-initial algebra

(

W

,

s

W

)

; we show that

W

satisfies the propositional rules of

𝖶

-types.
The

𝖶

-introduction rule is simple; namely, for

a

:

A

and

t

:

B

⁢

(

a

)

→

W

, we define

𝗌𝗎𝗉

⁢

(

a

,

t

)

:

W

to be the
result of applying the

structure map

s

W

:

P

⁢

W

→

W

to

(

a

,

t

)

:

P

⁢

W

.
For the

𝖶

-elimination rule, let us assume its premisses and in particular that

C

′

:

W

→

𝒰

.
Using the other premisses, one shows that the type

C

:

≡

∑

(

w

:

W

)

C

′

(

w

)

can be equipped with a structure map

s

C

:

P

⁢

C

→

C

. By the h-initiality of

W

,
we obtain an algebra homomorphism

(

f

,

s

f

)

:

(

W

,

s

W

)

→

(

C

,

s

C

)

. Furthermore,
the first

projection

𝗉𝗋

1

:

C

→

W

can be equipped with the

structure

of a

homomorphism

, so that we obtain a diagram of the form

\includegraphics

HoTT_fig_5.5.2.png

But the

identity function

1

W

:

W

→

W

has a canonical structure of an
algebra homomorphism and so, by the contractibility of the

type of homomorphisms

from

(

W

,

s

W

)

to itself, there must be an

identity

proof between the composite
of

(

f

,

s

f

)

with

(

𝗉𝗋

1

,

s

𝗉𝗋

1

)

and

(

1

W

,

s

1

W

)

. This implies, in particular,
that there is an identity proof

p

:

𝗉𝗋

1

∘

f

=

1

W

.

Since

(

𝗉𝗋

2

∘

f

)

⁢

w

:

C

⁢

(

(

𝗉𝗋

1

∘

f

)

⁢

w

)

, we can define

𝗋𝖾𝖼

(

w

,

c

)

:

≡

p

*

(

(

𝗉𝗋

2

∘

f

)

w

)

:

C

(

w

)

where the transport

p

*

is with respect to the family

λ

u

.

C

∘

u

:

(

W

→

W

)

→

W

→

𝒰

.

The verification of the propositional

𝖶

-computation rule is a calculation,
involving the naturality properties of

operations

of the form

p

*

.
∎

Finally, as desired, we can encode homotopy-natural-numbers as homotopy-

𝖶

-types:

Theorem 5.5.6

.

The rules for natural numbers with propositional computation rules can be derived from the rules for

W

-types with propositional computation rules.

Title

5.5 Homotopy-inductive types

\metatable

Generated on Thu Feb 8 19:36:49 2018 by

LaTeXML