8.1.4 The encode-decode proof

8.1.4 The encode-decode proof

We begin with the

function

(

LABEL:eq:pi1s1-encode

) that maps paths to codes:

Definition 8.1.1

.

Define

encode

:

∏

(

x

:

S

1

)

(

base

=

x

)

→

code

(

x

)

by

𝖾𝗇𝖼𝗈𝖽𝖾

p

:

≡

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

(

p

,

0

)

(we leave the

argument

x

implicit).

Encode is defined by

lifting

a path into the

universal cover

, which
determines an

equivalence

, and then applying the resulting equivalence
to

0

.
The interesting thing about this function is that it computes a concrete
number from a loop on the circle, when this loop is represented using
the abstract groupoidal framework of

homotopy type theory

. To gain an
intuition for how it does this, observe that by the above lemmas,

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

𝗅𝗈𝗈𝗉

,

x

)

is the

successor

map and

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

𝗅𝗈𝗈𝗉

-

1

,

x

)

is the

predecessor

map.
Further,

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

is functorial (

\autoref

cha:basics), so

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

𝗅𝗈𝗈𝗉

⁢

\centerdot

⁢

𝗅𝗈𝗈𝗉

,

–

)

is

(

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

𝗅𝗈𝗈𝗉

,

-

)

)

∘

(

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

𝗅𝗈𝗈𝗉

,

-

)

)

and so on.
Thus, when

p

is a composition like

𝗅𝗈𝗈𝗉

⁢

\centerdot

⁢

𝗅𝗈𝗈𝗉

-

1

⁢

\centerdot

⁢

𝗅𝗈𝗈𝗉

⁢

\centerdot

⁢

⋯

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

p

,

–

)

will compute a composition of functions like

𝗌𝗎𝖼𝖼

∘

𝗉𝗋𝖾𝖽

∘

𝗌𝗎𝖼𝖼

∘

⋯

Applying this composition of functions to 0 will compute the

winding number

of the path—how many times it goes around the
circle, with orientation marked by whether it is

positive

or negative,
after

inverses

have been canceled. Thus, the computational behavior of

𝖾𝗇𝖼𝗈𝖽𝖾

follows from the

reduction

rules for higher-inductive types and
univalence, and the action of

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

on compositions and inverses.

Note that the

instance

𝖾𝗇𝖼𝗈𝖽𝖾

′

:

≡

𝖾𝗇𝖼𝗈𝖽𝖾

𝖻𝖺𝗌𝖾

has type

(

𝖻𝖺𝗌𝖾

=

𝖻𝖺𝗌𝖾

)

→

ℤ

.
This will be one half of our desired equivalence; indeed, it is exactly the function

g

defined in

\autoref

sec:pi1s1-initial-thoughts.

Similarly, the function (

LABEL:eq:pi1s1-decode

) is a

generalization

of the function

𝗅𝗈𝗈𝗉

–

from

\autoref

sec:pi1s1-initial-thoughts.

Definition 8.1.2

.

Define

decode

:

∏

(

x

:

S

1

)

code

(

x

)

→

(

base

=

x

)

by
circle

induction

on

x

. It suffices to give a function

code

(

base

)

→

(

base

=

base

)

, for which we use

loop

–

, and
to show that

loop

–

respects the loop.

Proof.

To show that

𝗅𝗈𝗈𝗉

–

respects the loop, it suffices to give a path
from

𝗅𝗈𝗈𝗉

–

to itself that lies over

𝗅𝗈𝗈𝗉

.
By the

definition

of dependent paths, this means a path from

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

(

x

′

↦

𝖼𝗈𝖽𝖾

(

x

′

)

→

(

𝖻𝖺𝗌𝖾

=

x

′

)

)

⁢

(

𝗅𝗈𝗈𝗉

,

𝗅𝗈𝗈𝗉

–

)

to

𝗅𝗈𝗈𝗉

–

. We define such a
path as follows:

\MoveEqLeft

⁢

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

(

x

′

↦

𝖼𝗈𝖽𝖾

(

x

′

)

→

(

𝖻𝖺𝗌𝖾

=

x

′

)

)

⁢

(

𝗅𝗈𝗈𝗉

,

𝗅𝗈𝗈𝗉

–

)

=

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

x

′

↦

(

𝖻𝖺𝗌𝖾

=

x

′

)

⁢

(

𝗅𝗈𝗈𝗉

)

∘

𝗅𝗈𝗈𝗉

–

∘

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

𝗅𝗈𝗈𝗉

-

1

)

=

(

-

\centerdot

⁢

𝗅𝗈𝗈𝗉

)

∘

(

𝗅𝗈𝗈𝗉

–

)

∘

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

𝗅𝗈𝗈𝗉

-

1

)

=

(

-

\centerdot

⁢

𝗅𝗈𝗈𝗉

)

∘

(

𝗅𝗈𝗈𝗉

–

)

∘

𝗉𝗋𝖾𝖽

=

(

n

↦

𝗅𝗈𝗈𝗉

n

-

1

\centerdot

𝗅𝗈𝗈𝗉

)

.

On the first line, we apply the

characterization

of

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

when the outer

connective

of the

fibration

is

→

, which
reduces the

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

to pre- and post-composition with

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

at the domain and codomain types. On the second line,
we apply the characterization of

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

when the type family
is

x

↦

𝖻𝖺𝗌𝖾

=

x

, which is post-composition of paths. On the third line,
we use the action of

𝖼𝗈𝖽𝖾

on

𝗅𝗈𝗈𝗉

-

1

from

\autoref

lem:transport-s1-code. And on the fourth line, we simply
reduce the function composition. Thus, it suffices to show that for all

n

,

𝗅𝗈𝗈𝗉

n

-

1

⁢

\centerdot

⁢

𝗅𝗈𝗈𝗉

=

𝗅𝗈𝗈𝗉

n

, which is an easy
induction, using the

groupoid

laws.
∎

We can now show that

𝖾𝗇𝖼𝗈𝖽𝖾

and

𝖽𝖾𝖼𝗈𝖽𝖾

are

quasi-inverses

.
What used to be the difficult direction is now easy!

Lemma 8.1.3

.

For all
for all

x

:

S

1

and

p

:

base

=

x

,

decode

x

⁢

(

encode

x

⁢

(

p

)

)

=

p

.

Proof.

By path induction, it suffices to show that

𝖽𝖾𝖼𝗈𝖽𝖾

𝖻𝖺𝗌𝖾

⁢

(

𝖾𝗇𝖼𝗈𝖽𝖾

𝖻𝖺𝗌𝖾

⁢

(

𝗋𝖾𝖿𝗅

𝖻𝖺𝗌𝖾

)

)

=

𝗋𝖾𝖿𝗅

𝖻𝖺𝗌𝖾

.

But

𝖾𝗇𝖼𝗈𝖽𝖾

𝖻𝖺𝗌𝖾

⁢

(

𝗋𝖾𝖿𝗅

𝖻𝖺𝗌𝖾

)

≡

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

𝗋𝖾𝖿𝗅

𝖻𝖺𝗌𝖾

,

0

)

≡

0

,

and

𝖽𝖾𝖼𝗈𝖽𝖾

𝖻𝖺𝗌𝖾

⁢

(

0

)

≡

𝗅𝗈𝗈𝗉

0

≡

𝗋𝖾𝖿𝗅

𝖻𝖺𝗌𝖾

.
∎

The other direction is not much harder.

Lemma 8.1.4

.

For all

x

:

S

1

and

c

:

code

⁢

(

x

)

, we have

encode

x

⁢

(

decode

x

⁢

(

c

)

)

=

c

.

Proof.

The proof is by circle induction. It suffices to show the case for

𝖻𝖺𝗌𝖾

, because the case for

𝗅𝗈𝗈𝗉

is a path between paths in

ℤ

, which is immediate because

ℤ

is a set.

Thus, it suffices to show, for all

n

:

ℤ

, that

𝖾𝗇𝖼𝗈𝖽𝖾

′

⁢

(

𝗅𝗈𝗈𝗉

n

)

=

n

The proof is by induction, using

\cref

thm:looptothe.

•

In the case for

0

, the result is true by definition.

•

In the case for

n

+

1

,

𝖾𝗇𝖼𝗈𝖽𝖾

′

⁢

(

𝗅𝗈𝗈𝗉

n

+

1

)

=

𝖾𝗇𝖼𝗈𝖽𝖾

′

⁢

(

𝗅𝗈𝗈𝗉

n

⁢

\centerdot

⁢

𝗅𝗈𝗈𝗉

)

(by definition of $\mathsf{loop}^{\mathord{\hskip1.0pt\text{--}\hskip1.0pt}}$)

=

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

(

𝗅𝗈𝗈𝗉

n

⁢

\centerdot

⁢

𝗅𝗈𝗈𝗉

)

,

0

)

(by definition of $\mathsf{encode}$)

=

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

𝗅𝗈𝗈𝗉

,

(

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

𝗅𝗈𝗈𝗉

n

,

0

)

)

)

(by functoriality)

=

(

𝗍𝗋𝖺𝗇𝗌𝗉𝗈𝗋𝗍

𝖼𝗈𝖽𝖾

⁢

(

𝗅𝗈𝗈𝗉

n

,

0

)

)

+

1

(by \autoreflem:transport-s1-code)

=

n

+

1

.

(by the

inductive hypothesis

)

•

The case for negatives is analogous. ∎

Finally, we conclude the

theorem

.

Theorem 8.1.5

.

There is a family of equivalences

∏

(

x

:

S

1

)

(

(

base

=

x

)

≃

code

(

x

)

)

.

Proof.

The maps

𝖾𝗇𝖼𝗈𝖽𝖾

and

𝖽𝖾𝖼𝗈𝖽𝖾

are quasi-inverses by

\autoref

lem:s1-decode-encode,

\autoref

lem:s1-decode-encode.
∎

Instantiating at

𝖻𝖺𝗌𝖾

gives

Corollary 8.1.6

.

Ω

⁢

(

𝕊

1

,

𝖻𝖺𝗌𝖾

)

≃

ℤ

.

A simple induction shows that this equivalence takes

addition

to
composition, so that

Ω

⁢

(

𝕊

1

)

=

ℤ

as groups.

Corollary 8.1.7

.

π

1

⁢

(

𝕊

1

)

=

ℤ

, while

π

n

⁢

(

S

1

)

=

0

for

n

>

1

.

Proof.

For

n

=

1

, we sketched the proof from

\autoref

cor:omega-s1 above.
For

n

>

1

, we have

∥

Ω

n

(

𝕊

1

)

∥

0

=

∥

Ω

n

-

1

(

Ω

𝕊

1

)

∥

0

=

∥

Ω

n

-

1

(

ℤ

)

∥

0

.
And since

ℤ

is a set,

Ω

n

-

1

⁢

(

ℤ

)

is

contractible

, so this is

trivial

.
∎

Title

8.1.4 The encode-decode proof

\metatable

Generated on Thu Feb 8 19:40:29 2018 by

LaTeXML