introduction to homotopy type theorybuchholtz/... · introduction to homotopy type theory egbert...

278
I NTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019

Upload: others

Post on 03-Aug-2020

17 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

INTRODUCTION TO HOMOTOPY TYPE THEORY

EGBERT RIJKE

2019

Page 2: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the
Page 3: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

Total number of exercises: 232

The author gratefully acknowledges the support of the Air Force Office of Scientific Researchthrough MURI grant FA9550-15-1-0053.

This work is licensed under a Creative Commons “Attribution-NonCommercial-ShareAlike 4.0 International” license.

Page 4: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the
Page 5: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

Contents

Contents i

I Martin-Löf’s dependent type theory 11 Dependent type theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.1 Judgments and contexts in type theory . . . . . . . . . . . . . . . . . . . . 11.2 Inference rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Derivations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2 Dependent function types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.1 Dependent function types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2 Ordinary function types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.3 The identity function, composition, and their laws . . . . . . . . . . . . . . 10Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 The natural numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.1 The formal specification of the type of natural numbers . . . . . . . . . . . 133.2 Addition on the natural numbers . . . . . . . . . . . . . . . . . . . . . . . . 16Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4 More inductive types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.1 The idea of general inductive types . . . . . . . . . . . . . . . . . . . . . . 174.2 The unit type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.3 The empty type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.4 The booleans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.5 Coproducts and the type of integers . . . . . . . . . . . . . . . . . . . . . . 204.6 Dependent pair types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.7 Cartesian products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

5 Identity types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245.1 The inductive definition of identity types . . . . . . . . . . . . . . . . . . . 255.2 The groupoidal structure of types . . . . . . . . . . . . . . . . . . . . . . . 265.3 The action on paths of functions . . . . . . . . . . . . . . . . . . . . . . . . 285.4 Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

6 Type theoretic universes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316.1 Specification of type theoretic universes . . . . . . . . . . . . . . . . . . . . 326.2 Assuming enough universes . . . . . . . . . . . . . . . . . . . . . . . . . . 336.3 Pointed types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356.4 Families and relations on the natural numbers . . . . . . . . . . . . . . . . 36Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

i

Page 6: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

ii CONTENTS

II Basic concepts of type theory 397 Equivalences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

7.1 Homotopies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397.2 Bi-invertible maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417.3 The identity type of a Σ-type . . . . . . . . . . . . . . . . . . . . . . . . . . 42Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

8 Contractible types and contractible maps . . . . . . . . . . . . . . . . . . . . . . . 468.1 Contractible types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478.2 Contractible maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498.3 Equivalences are contractible maps . . . . . . . . . . . . . . . . . . . . . . 50Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

9 The fundamental theorem of identity types . . . . . . . . . . . . . . . . . . . . . . 549.1 Families of equivalences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549.2 The fundamental theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579.3 Embeddings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589.4 Disjointness of coproducts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

10 The hierarchy of homotopical complexity . . . . . . . . . . . . . . . . . . . . . . . 6210.1 Propositions and subtypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6210.2 Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6410.3 General truncation levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

11 Elementary number theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6811.1 Decidability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6811.2 The well-ordering principle for decidable families over N . . . . . . . . . 7011.3 The pigeonhole principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7111.4 Defining the greatest common divisor . . . . . . . . . . . . . . . . . . . . . 7311.5 The trial division primality test . . . . . . . . . . . . . . . . . . . . . . . . . 7411.6 Prime decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7411.7 The infinitude of primes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

III Univalent mathematics 7712 Function extensionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

12.1 Equivalent forms of function extensionality . . . . . . . . . . . . . . . . . . 7712.2 The type theoretic principle of choice . . . . . . . . . . . . . . . . . . . . . 7912.3 Universal properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8112.4 Composing with equivalences . . . . . . . . . . . . . . . . . . . . . . . . . 82Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

13 The univalence axiom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8713.1 Equivalent forms of the univalence axiom . . . . . . . . . . . . . . . . . . . 8713.2 Univalence implies function extensionality . . . . . . . . . . . . . . . . . . 8713.3 Propositional extensionality and posets . . . . . . . . . . . . . . . . . . . . 88Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

14 Groups in univalent mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . 9114.1 Semi-groups and groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9114.2 Homomorphisms of semi-groups and groups . . . . . . . . . . . . . . . . 9314.3 Isomorphic semi-groups are equal . . . . . . . . . . . . . . . . . . . . . . . 9414.4 Isomorphic groups are equal . . . . . . . . . . . . . . . . . . . . . . . . . . 96

Page 7: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

CONTENTS iii

14.5 Categories in univalent mathematics . . . . . . . . . . . . . . . . . . . . . . 96Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

15 The circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9915.1 The induction principle of the circle . . . . . . . . . . . . . . . . . . . . . . 9915.2 The (dependent) universal property of the circle . . . . . . . . . . . . . . . 10015.3 Multiplication on the circle . . . . . . . . . . . . . . . . . . . . . . . . . . . 103Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

16 The fundamental cover of the circle . . . . . . . . . . . . . . . . . . . . . . . . . . 10716.1 Families over the circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10716.2 The fundamental cover of the circle . . . . . . . . . . . . . . . . . . . . . . 10816.3 Contractibility of general total spaces . . . . . . . . . . . . . . . . . . . . . 10916.4 The dependent universal property of the integers . . . . . . . . . . . . . . 11116.5 The identity type of the circle . . . . . . . . . . . . . . . . . . . . . . . . . . 112Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

IV Homotopy pullbacks and pushouts 11717 Homotopy pullbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

17.1 The universal property of pullbacks . . . . . . . . . . . . . . . . . . . . . . 11817.2 Canonical pullbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12217.3 Cartesian products and fiberwise products as pullbacks . . . . . . . . . . 12417.4 Fibers of maps as pullbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . 12517.5 Families of equivalences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12617.6 Descent theorems for coproducts and Σ-types . . . . . . . . . . . . . . . . 130Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

18 Homotopy pushouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13518.1 The universal property of pushouts . . . . . . . . . . . . . . . . . . . . . . 13618.2 Suspensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13918.3 The duality of pullbacks and pushouts . . . . . . . . . . . . . . . . . . . . 14118.4 Fiber sequences and cofiber sequences . . . . . . . . . . . . . . . . . . . . . 14218.5 Further examples of pushouts . . . . . . . . . . . . . . . . . . . . . . . . . . 143Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

19 Cubical diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14719.1 Commuting cubes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14819.2 Families of pullbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15119.3 The 3-by-3-properties for pullbacks and pushouts . . . . . . . . . . . . . . 153Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

20 Universality and descent for pushouts . . . . . . . . . . . . . . . . . . . . . . . . . 15420.1 Five equivalent characterizations of homotopy pushouts . . . . . . . . . . 15620.2 Type families over pushouts . . . . . . . . . . . . . . . . . . . . . . . . . . . 16020.3 The flattening lemma for pushouts . . . . . . . . . . . . . . . . . . . . . . . 16220.4 The universality theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16420.5 The descent property for pushouts . . . . . . . . . . . . . . . . . . . . . . . 16520.6 Applications of the descent theorem . . . . . . . . . . . . . . . . . . . . . . 171Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

21 The identity types of pushouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17321.1 Characterizing families of maps over pushouts . . . . . . . . . . . . . . . . 17321.2 Characterizing the identity types of pushouts . . . . . . . . . . . . . . . . 176Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177

Page 8: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

iv CONTENTS

V Homotopy quotients 17922 Sequential colimits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

22.1 The universal property of sequential colimits . . . . . . . . . . . . . . . . . 17922.2 The construction of sequential colimits . . . . . . . . . . . . . . . . . . . . 18022.3 Descent for sequential colimits . . . . . . . . . . . . . . . . . . . . . . . . . 18122.4 The flattening lemma for sequential colimits . . . . . . . . . . . . . . . . . 182Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

23 The homotopy image of a map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18323.1 The universal property of the image of a map . . . . . . . . . . . . . . . . 18323.2 The universal property of propositional truncation . . . . . . . . . . . . . 18723.3 Constructing the propositional truncation . . . . . . . . . . . . . . . . . . . 18823.4 The image of a map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19123.5 Surjective maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19223.6 Logic in type theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195

24 Set quotients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19724.1 Equivalence relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19724.2 The universal property of set quotients . . . . . . . . . . . . . . . . . . . . 19924.3 The rational numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20324.4 Set truncation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20324.5 Type theoretic replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . 203Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209

25 Truncations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20925.1 The universal property of the truncations . . . . . . . . . . . . . . . . . . . 20925.2 The truncations as recursive higher inductive types . . . . . . . . . . . . . 21125.3 Theorems not to forget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216

26 The real projective spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21626.1 The type of 2-element sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21626.2 Classifying real line bundles . . . . . . . . . . . . . . . . . . . . . . . . . . 21726.3 The finite dimensional real projective spaces . . . . . . . . . . . . . . . . . 217

27 The classifying type of a group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21727.1 The classifying type of a group . . . . . . . . . . . . . . . . . . . . . . . . . 217

VI Synthetic homotopy theory 21928 Homotopy groups of types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

28.1 The suspension-loop space adjunction . . . . . . . . . . . . . . . . . . . . . 21928.2 Homotopy groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22128.3 The Eckmann-Hilton argument . . . . . . . . . . . . . . . . . . . . . . . . . 221Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

29 Connected types and maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22529.1 Connected types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22629.2 k-Equivalences and k-connected maps . . . . . . . . . . . . . . . . . . . . . 22829.3 Orthogonality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23429.4 The connectedness of suspensions . . . . . . . . . . . . . . . . . . . . . . . 23529.5 The join connectivity theorem . . . . . . . . . . . . . . . . . . . . . . . . . . 236Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

30 A second perspective on groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23830.1 The category of pointed connected 1-types . . . . . . . . . . . . . . . . . . 238

Page 9: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

CONTENTS v

30.2 Equivalences of categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24030.3 The equivalence of groups and pointed connected 1-types . . . . . . . . . 240

31 The Hopf fibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24031.1 Fiber sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24131.2 The Hopf construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24231.3 The long exact sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24431.4 The universal complex line bundle . . . . . . . . . . . . . . . . . . . . . . . 24631.5 The finite dimensional complex projective spaces . . . . . . . . . . . . . . 247Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

32 The Blakers-Massey theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24732.1 The Blakers-Massey theorem . . . . . . . . . . . . . . . . . . . . . . . . . . 24832.2 The Freudenthal suspension theorem . . . . . . . . . . . . . . . . . . . . . 24832.3 Higher groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24832.4 The stabilization theorem for higher groups . . . . . . . . . . . . . . . . . 25132.5 Eilenberg-Mac Lane spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 254Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254

Bibliography 255

Index 257

Page 10: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the
Page 11: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

Chapter I

Martin-Löf’s dependent type theory

1 Dependent type theory

Dependent type theory is a system of inference rules that can be combined to make derivations.In these derivations, the goal is often to construct a term of a certain type. Such a term can be afunction if the type of the constructed term is a function type; a proof of a property if the typeof the constructed term is a proposition; an identification if the type of the constructed term isan identity type, and so on. In some respect, a type is just a collection of mathematical objectsand constructing terms of a type is the everyday mathematical task or challenge. The systemof inference rules that we call type theory offers a principled way of engaging in mathematicalactivity.

1.1 Judgments and contexts in type theory

An inference rule is an expression of the form

H1 H2 . . . Hn

Ccontaining above the horizontal line a finite listH1,H2, . . . ,Hn of judgments for the hypotheses,and below the horizontal line a single judgment C for the conclusion. A very simple examplethat we will encounter in §2 when we introduce function types, is the inference rule

Γ ` a : A Γ ` f : A→ BΓ ` f (a) : B

This rule asserts that in any context Γ we may use a term a : A and a function f : A → B toobtain a term f (a) : B. Each of the expressions

Γ ` a : AΓ ` f : A→ BΓ ` f (a) : B

are examples of judgments. There are four kinds of judgments in type theory:

(i) A is a (well-formed) type in context Γ. The symbolic expression for this judgment is

Γ ` A type

1

Page 12: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

2 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

(ii) A and B are judgmentally equal types in context Γ. The symbolic expression for this judg-ment is

Γ ` A ≡ B type

(iii) a is a (well-formed) term of type A in context Γ. The symbolic expression for this judgment is

Γ ` a : A

(iv) a and b are judgmentally equal terms of type A in context Γ. The symbolic expression for thisjudgment is

Γ ` a ≡ b : A

Thus we see that any judgment is of the form Γ ` J , consisting of a context Γ and an expressionJ asserting that A is a type, that A and B are equal types, that a is a term of type A, or that aand b are equal terms of type A. The role of a context is to declare what hypothetical terms areassumed, along with their types. More formally, a context is an expression of the form

x1 : A1, x2 : A2(x1), . . . , xn : An(x1, . . . , xn−1) (1.1)

satisfying the condition that for each 1 ≤ k ≤ n we can derive, using the inference rules of typetheory, that

x1 : A1, x2 : A2(x1), . . . , xk−1 : Ak−1(x1, . . . , xk−2) ` Ak(x1, . . . , xk−1) type. (1.2)

In other words, to check that an expression of the form Eq. (1.1) is a context, one starts on theleft and works their way to the right verifying that each hypothetical term xk is assigned awell-formed type. Hypothetical terms are commonly called variables, and we say that a contextas in Eq. (1.1) declares the variables x1, . . . , xn. We may use variable names other than x1, . . . , xn,as long as no variable is declared more than once.

The condition in Eq. (1.2) that each of the hypothetical terms is assigned a well-formed type,is checked recursively. Note that the context of length 0 satisfies the requirement in Eq. (1.2)vacuously. This context is called the empty context. An expression of the form x1 : A1 is acontext if and only if A1 is a well-formed type in the empty context. Such types are called closedtypes. We will soon encounter the type N of natural numbers, which is an example of a closedtype. There is also the notion of closed term, which is simply a term in the empty context. Thenext case is that an expression of the form x1 : A1, x2 : A2(x1) is a context if and only if A1 is awell-formed type in the empty context, and A2(x1) is a well-formed type, given a hypotheticalterm x1 : A1. This process repeats itself for longer contexts.

It is a feature of dependent type theory that all judgments are context-dependent, and indeedthat even the types of the variables may depend on any previously declared variables. Forexample, when we introduce the identity type in §5, we make full use of the machinery of typedependency, as is clear from how they are introduced:

Γ ` A typeΓ, x : A, y : A ` x = y type

This rule asserts that given a type A in context Γ, we may form a type x = y in contextΓ, x : A, y : A. Note that in order to know that the expression Γ, x : A, y : A is indeed awell-formed context, we need to know that A is a well-formed type in context Γ, x : A. This is aninstance of weakening, which we will describe shortly.

Page 13: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

1. DEPENDENT TYPE THEORY 3

In the situation where we have

Γ, x : A ` B(x) type,

we say that B is a family of types over A in context Γ. Alternatively, we say that B(x) is a typeindexed by x : A, in context Γ. Similarly, in the situation where we have

Γ, x : A ` b(x) : B(x),

we say that b is a section of the family B over A in context Γ. Alternatively, we say that b(x) isa term of type B(x), indexed by x : A in context Γ. Note that in the above situations A, B, andb also depend on the variables declared in the context Γ, even though we have not explicitlymentioned them. It is common practice to not mention every variable in the context Γ in suchsituations.

1.2 Inference rules

In this section we present the basic inference rules of dependent type theory. Those rules arevalid to be used in any type theoretic derivation. There are only four sets of inference rules:

(i) Rules for judgmental equality

(ii) Rules for substitution

(iii) Rules for weakening

(iv) The “variable rule”

Judgmental equality

In this set of inference rules we ensure that judgmental equality (both on types and on terms) areequivalence relations, and we make sure that in any context Γ, we can change the type of anyvariable to a judgmentally equal type.

The rules postulating that judgmental equality on types and on terms is an equivalencerelation are as follows:

Γ ` A typeΓ ` A ≡ A type

Γ ` A ≡ A′ typeΓ ` A′ ≡ A type

Γ ` A ≡ A′ type Γ ` A′ ≡ A′′ typeΓ ` A ≡ A′′ type

Γ ` a : AΓ ` a ≡ a : A

Γ ` a ≡ a′ : AΓ ` a′ ≡ a : A

Γ ` a ≡ a′ : A Γ ` a′ ≡ a′′ : AΓ ` a ≡ a′′ : A

Apart from the rules postulating that judgmental equality is an equivalence relation, thereare also variable conversion rules. Informally, these are rules stating that if A and A′ arejudgmentally equal types in context Γ, then any valid judgment in context Γ, x : A is also avalid judgment in context Γ, x : A′. In other words: we can convert the type of a variable to ajudgmentally equal type.

The first variable conversion rule states that

Γ ` A ≡ A′ type Γ, x : A, ∆ ` B(x) typeΓ, x : A′, ∆ ` B(x) type

Page 14: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

4 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

In this conversion rule, the context of the form Γ, x : A, ∆ is just any extension of the contextΓ, x : A.

Similarly, there are variable conversion rules for judgmental equality of types, for terms, andfor judgmental equality of terms. To avoid having to state essentially the same rule four times,we state all four variable conversion rules at once using a generic judgment J , which can be anyof the four kinds of judgments.

Γ ` A ≡ A′ type Γ, x : A, ∆ ` JΓ, x : A′, ∆ ` J

An analogous term conversion rule, stated in Exercise 1.1, converting the type of a term to ajudgmentally equal type, is derivable using the rules for substitution and weakening, and thevariable rule.

Substitution

If we are given a term a : A in context Γ, then for any type B in context Γ, x : A, ∆ we can formthe type B[a/x] in context Γ, ∆[a/x], where B[a/x] is an abbreviation for

B(x1, . . . , xn−1, a(x1, . . . , xn−1), xn+1, . . . , xn+m−1).

This syntactic operation of substituting a for x is understood to be defined recursively over thelength of ∆. Similarly we obtain for any term b : B in context Γ, x : A, ∆ a term b[a/x] : B[a/x].The substitution rule asserts that substitution preserves well-formedness and judgmental equal-ity of types and terms:

Γ ` a : A Γ, x : A, ∆ ` JSaΓ, ∆[a/x] ` J [a/x]

Furthermore, we postulate that substitution by judgmentally equal terms results in judgmentallyequal types

Γ ` a ≡ a′ : A Γ, x : A, ∆ ` B typeΓ, ∆[a/x] ` B[a/x] ≡ B[a′/x] type

and it also results in judgmentally equal terms

Γ ` a ≡ a′ : A Γ, x : A, ∆ ` b : BΓ, ∆[a/x] ` b[a/x] ≡ b[a′/x] : B[a/x]

When B is a family of types over A and a : A, we also say that B[a/x] is the fiber of B at a. Wewill usually write B(a) for B[a/x].

Weakening

If we are given a type A in context Γ, then any judgment made in a longer context Γ, ∆ canalso be made in the context Γ, x : A, ∆, for a fresh variable x. The weakening rule asserts thatweakening by a type A in context preserves well-formedness and judgmental equality of typesand terms.

Γ ` A type Γ, ∆ ` JWAΓ, x : A, ∆ ` J

Page 15: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

1. DEPENDENT TYPE THEORY 5

This process of expanding the context by a fresh variable of type A is called weakening (by A).In the simplest situation where weakening applies, we have two types A and B in context Γ.

Then we can weaken B by A as follows

Γ ` A type Γ ` B typeWAΓ, x : A ` B type

in order to form the type B in context Γ, x : A. The type B in context Γ, x : A is called the constantfamily B, or the trivial family B.

The variable rule

If we are given a type A in context Γ, then we can weaken A by itself to obtain that A is a type incontext Γ, x : A. The variable rule now asserts that any hypothetical term x : A in context Γ is awell-formed term of type A in context Γ, x : A.

Γ ` A typeδAΓ, x : A ` x : A

One of the reasons for including the variable rule is that it provides an identity function on thetype A in context Γ.

1.3 Derivations

A derivation in type theory is a tree in which each node is a valid rule of inference. We givetwo examples of derivations: a derivation showing that any variable can be changed to a freshone, and a derivation showing that any two variables that do not depend on one another can beswapped in order.

Thus, we will see some examples of new inference rules that can be derived using the rulesof type theory. Such inference rules are called admissible. Since derivations tend to get long andunwieldy, we declare that admissible inference rules are also valid to be used in derivations.

Changing variables

Variables can always be changed to fresh variables. We show that this is the case by showingthat the inference rule

Γ, x : A, ∆ ` Jx′/x

Γ, x′ : A, ∆[x′/x] ` J [x′/x]

is admissible, where x′ is a variable that does not occur in the context Γ, x : A, ∆.Indeed, we have the following derivation using substitution, weakening, and the variable

rule:

Γ ` A typeδAΓ, x′ : A ` x′ : A

Γ ` A type Γ, x : A, ∆ ` JWAΓ, x′ : A, x : A, ∆ ` J Sx′Γ, x′ : A, ∆[x′/x] ` J [x′/x]

In this derivation it is the application of the weakening rule where we have to check that x′ doesnot occur in the context Γ, x : A, ∆.

Page 16: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

6 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

Interchanging variables

The interchange rule states that if we have two types A and B in context Γ, and we makea judgment in context Γ, x : A, y : B, ∆, then we can make that same judgment in contextΓ, y : B, x : A, ∆ where the order of x : A and y : B is swapped. More formally, the interchangerule is the following inference rule

Γ ` B type Γ, x : A, y : B, ∆ ` JΓ, y : B, x : A, ∆ ` J

Just as the rule for changing variables, we claim that the interchange rule is an admissible rule.The idea of the derivation for the interchange rule is as follows: If we have a judgment

Γ, x : A, y : B, ∆ ` J ,

then we can change the variable y to a fresh variable y′ and weaken the judgment to obtain thejudgment

Γ, y : B, x : A, y′ : B, ∆[y′/y] ` J [y′/y].

Now we can substitute y for y′ to obtain the desired judgment Γ, y : B, x : A, ∆ ` J . The formalderivation is as follows:

Γ ` B typeδBΓ, y : B ` y : B

WWB(A)Γ, y : B, x : A ` y : B

Γ, x : A, y : B, ∆ ` Jy′/y

Γ, x : A, y′ : B, ∆[y′/y] ` J [y′/y]WBΓ, y : B, x : A, y′ : B, ∆[y′/y] ` J [y′/y] SWA(y)Γ, y : B, x : A, ∆ ` J

Exercises

1.1 Give a derivation for the following term conversion rule:

Γ ` A ≡ A′ type Γ ` a : AΓ ` a : A′

1.2 Consider a type A in context Γ. In this exercise we establish a correspondence betweentypes in context Γ, x : A, and uniform choices of types Ba, where a ranges over terms of Ain a uniform way. A similar connection is made for terms.

(a) We define a uniform family over A to consist of a type

∆, Γ ` Ba type

for every context ∆, and every term ∆, Γ ` a : A, subject to the condition that one canderive

∆ ` d : D ∆, y : D, Γ ` a : A∆, Γ ` Ba[d/y] ≡ Ba[d/y] type

Define a bijection between the set of types in context Γ, x : A modulo judgmentalequality, and the set of uniform families over A modulo judgmental equality.

Page 17: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

2. DEPENDENT FUNCTION TYPES 7

(b) Consider a type Γ, x : A ` B. We define a uniform term of B over A to consist of atype

∆, Γ ` ba : B[a/x] type

for every context ∆, and every term ∆, Γ ` a : A, subject to the condition that one canderive

∆ ` d : D ∆, y : D, Γ ` a : A∆, Γ ` ba[d/y] ≡ ba[d/y] : B[a/x][d/y]

Define a bijection between the set of terms of B in context Γ, x : A modulo judgmentalequality, and the set of uniform terms of B over A modulo judgmental equality.

2 Dependent function types

A fundamental concept in dependent type theory is that of a dependent function. A dependentfunction is a function of which the type of the output may depend on the input. They are ageneralization of ordinary functions, because an ordinary function f : A → B is a function ofwhich the output f (x) has type B regardless of the value of x.

2.1 Dependent function types

Consider a section b of a family B over A in context Γ, i.e.,

Γ, x : A ` b(x) : B(x).

From one point of view, such a section b is an operation, or a program, that takes as input x : Aand produces a term b(x) : B(x). From a more mathematical point of view we see b as a choiceof an element of each B(x). In other words, we may see b as a function that takes x : A tob(x) : B(x). Note that the type B(x) of the output is dependent on x : A. In this section wepostulate rules for the type of all such dependent functions: whenever B is a family over A incontext Γ, there is a type

∏ (x:A)B(x)

in context Γ, consisting of all the dependent functions of which the output at x : A has type B(x).There are four principal rules for Π-types:

(i) The formation rule, which tells us how we may form dependent function types.

(ii) The introduction rule, which tells us how to introduce new terms of dependent functiontypes.

(iii) The elimination rule, which tells us how to use arbitrary terms of dependent functiontypes.

(iv) The computation rules, which tell us how the introduction and elimination rules interact.These computation rules guarantee that every term of a dependent function type behavesas expected: as a dependent function.

In the cases of the formation rule, the introduction rule, and the elimination rule, we also needrules that assert that all the constructions respect judgmental equality. Those rules are calledcongruence rules.

Page 18: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

8 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

The Π-formation rule

Dependent function types are formed by the following Π-formation rule:

Γ, x : A ` B(x) typeΠ.

Γ ` ∏ (x:A)B(x) type

The congruence rule for Π-formation asserts that formation of dependent function typesrespects judgmental equality of types:

Γ ` A ≡ A′ type Γ, x : A ` B(x) ≡ B′(x) typeΠ-eq.

Γ ` ∏ (x:A)B(x) ≡ ∏ (x:A′)B′(x) type

There is one last rule that we need about the formation of Π-types, asserting that it does notmatter what name we use for the variable x that appears in the expression

∏ (x:A)B(x).

More precisely, when x′ is a fresh variable, i.e., which does not occur in the context Γ, x : A, wepostulate that

Γ, x : A ` B(x) typeΠ-x′/x.

Γ ` ∏ (x:A)B(x) ≡ ∏ (x′ :A)B(x′) type

This rule is also known as α-conversion for Π-types.

The Π-introduction rule

The introduction rule for dependent function types is also called the λ-abstraction rule. Recallthat dependent functions are formed from terms b(x) of type B(x) in context Γ, x : A. Thereforethe λ-abstraction rule is as follows:

Γ, x : A ` b(x) : B(x)λ

Γ ` λx. b(x) : ∏ (x:A)B(x)

Just like ordinary mathematicians, we will sometimes write x 7→ f (x) for a function f . Themap n 7→ n2 is an example.

The λ-abstraction is also required to respect judgmental equality. Therefore we postulate thecongruence rule for λ-abstraction, which asserts that

Γ, x : A ` b(x) ≡ b′(x) : B(x)λ-eq.

Γ ` λx. b(x) ≡ λx. b′(x) : ∏ (x:A)B(x)

Page 19: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

2. DEPENDENT FUNCTION TYPES 9

The Π-elimination rule

The elimination rule for dependent function types provides us with a way to use dependentfunctions. The way to use a dependent function is to apply it to an argument of the domaintype. The Π-elimination rule is therefore also called the evaluation rule. It asserts that given adependent function f : ∏ (x:A)B(x) in context Γ we obtain a term f (x) of type B(x) in contextΓ, x : A. More formally:

Γ ` f : ∏ (x:A)B(x)ev

Γ, x : A ` f (x) : B(x)

Again we require that evaluation respects judgmental equality:

Γ ` f ≡ f ′ : ∏ (x:A)B(x)

Γ, x : A ` f (x) ≡ f ′(x) : B(x)

The Π-computation rules

The computation rules for dependent function types postulate that λ-abstraction rule and theevaluation rule are mutual inverses. Thus we have two computation rules.

First we postulate the β-rule

Γ, x : A ` b(x) : B(x)β.

Γ, x : A ` (λy.b(y))(x) ≡ b(x) : B(x)

Second, we postulate the η-rule

Γ ` f : ∏ (x:A)B(x)η.

Γ ` λx. f (x) ≡ f : ∏ (x:A)B(x)

This completes the specification of dependent function types.

2.2 Ordinary function types

In the case where both A and B are types in context Γ, we may first weaken B by A, and thenapply the formation rule for the dependent function type:

Γ ` A type Γ ` B typeΓ, x : A ` B typeΓ ` ∏ (x:A)B type

The result is the type of functions that take an argument of type A, and return a term of type B.In other words, terms of the type ∏ (x:A)B are ordinary functions from A to B. We write A→ Bfor the type of functions from A to B. Sometimes we will also write BA for the type A→ B.

We give a brief summary of the rules specifying ordinary function types, omitting thecongruence rules. All of these rules can be derived easily from the corresponding rules forΠ-types.

Γ ` A type Γ ` B type →Γ ` A→ B type

Page 20: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

10 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

Γ ` B type Γ, x : A ` b(x) : Bλ

Γ ` λx. b(x) : A→ BΓ ` f : A→ B

evΓ, x : A ` f (x) : B

Γ ` B type Γ, x : A ` b(x) : Bβ

Γ, x : A ` (λy. b(y))(x) ≡ b(x) : BΓ ` f : A→ B

ηΓ ` λx. f (x) ≡ f : A→ B

2.3 The identity function, composition, and their laws

Definition 2.3.1. For any type A in context Γ, we define the identity function idA : A → Ausing the variable rule:

Γ ` A typeΓ, x : A ` x : A

Γ ` idA :≡ λx. x : A→ A

Note that we have used the symbol :≡ in the conclusion to define the identity function. Ajudgment of the form Γ ` a :≡ b : A should be read as "b is a well-defined term of type A incontext Γ, and we will refer to it as a".

Definition 2.3.2. For any three types A, B, and C in context Γ, there is a composition operation

comp : (B→ C)→ ((A→ B)→ (A→ C)),

i.e., we can derive

Γ ` A type Γ ` B type Γ ` C typeΓ ` comp : (B→ C)→ ((A→ B)→ (A→ C))

We will write g f for comp(g, f ).

Construction. The idea of the definition is to define comp(g, f ) to be the function λx. g( f (x)).The derivation we use to construct comp is as follows:

Γ ` A type Γ ` B type

Γ, f : BA, x : A ` f (x) : B

Γ, g : CB, f : BA, x : A ` f (x) : B

Γ ` B type Γ ` C type

Γ, g : CB, y : B ` g(y) : C

Γ, g : CB, f : BA, y : B ` g(y) : C

Γ, g : CB, f : BA, x : A, y : B ` g(y) : C

Γ, g : CB, f : BA, x : A ` g( f (x)) : C

Γ, g : CB, f : BA ` λx. g( f (x)) : CA

Γ, g : B→ C ` λ f . λx. g( f (x)) : BA → CA

Γ ` comp :≡ λg. λ f . λx. g( f (x)) : CB → (BA → CA)

The rules of function types can be used to derive the laws of a category for functions, i.e., wecan derive that function composition is associative and that the identity function satisfies theunit laws. In the remainder of this section we will give these derivations.

Lemma 2.3.3. Composition of functions is associative, i.e., we can derive

Page 21: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

2. EXERCISES 11

Γ ` f : A→ B Γ ` g : B→ C Γ ` h : C → DΓ ` (h g) f ≡ h (g f ) : A→ D

Proof. The main idea of the proof is that both ((h g) f )(x) and (h (g f ))(x) evaluate toh(g( f (x)), and therefore (h g) f and h (g f ) must be judgmentally equal. This idea is madeformal in the following derivation:

Γ ` f : A→ BΓ, x : A ` f (x) : B

Γ ` g : B→ CΓ, y : B ` g(y) : C

Γ, x : A, y : B ` g(y) : CΓ, x : A ` g( f (x)) : C

Γ ` h : C → DΓ, z : C ` h(z) : D

Γ, x : A, z : C ` h(z) : DΓ, x : A ` h(g( f (x))) : D

Γ, x : A ` h(g( f (x))) ≡ h(g( f (x))) : DΓ, x : A ` (h g)( f (x)) ≡ h((g f )(x)) : D

Γ, x : A ` ((h g) f )(x) ≡ (h (g f ))(x) : DΓ ` (h g) f ≡ h (g f ) : A→ D.

Lemma 2.3.4. Composition of functions satisfies the left and right unit laws, i.e., we can derive

Γ ` f : A→ BΓ ` idB f ≡ f : A→ B

and

Γ ` f : A→ BΓ ` f idA ≡ f : A→ B

Proof. The derivation for the left unit law is

Γ ` f : A→ BΓ, x : A ` f (x) : B

Γ ` B typeΓ, y : B ` idB(y) ≡ y : B

Γ, x : A, y : B ` idB(y) ≡ y : BΓ, x : A ` idB( f (x)) ≡ f (x) : B

Γ, x : A ` (idB f )(x) ≡ f (x) : BΓ ` idB f ≡ f : A→ B

The right unit law is left as Exercise 2.1.

Exercises

2.1 Give a derivation for the right unit law of Lemma 2.3.4.2.2 Show that the rule

Γ, x : A ` b(x) : B(x)λ-x′/x

Γ ` λx. b(x) ≡ λx′. b(x′) : ∏ (x:A)B(x)

is admissible for any variable x′ that does not occur in the context Γ, x : A.2.3 (a) Construct the constant function

Page 22: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

12 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

Γ ` A typeΓ, y : B ` consty : A→ B

(b) Show that

Γ ` f : A→ BΓ, z : C ` constz f ≡ constz : A→ C

(c) Show that

Γ ` A type Γ ` g : B→ CΓ, y : B ` g consty ≡ constg(y) : A→ C

2.4 In this exercise we generalize the composition operation of non-dependent function types:

(a) Define a composition operation for dependent function types

Γ ` f : ∏ (x:A)B(x) Γ ` g : ∏ (x:A) ∏ (y:B(x))C(x, y)

Γ ` g ′ f : ∏ (x:A)C(x, f (x))

and show that this operation agrees with ordinary composition when it is specializedto non-dependent function types.

(b) Show that composition of dependent functions agrees with ordinary composition offunctions:

Γ ` f : A→ B Γ ` g : B→ CΓ ` (λx. g) ′ f ≡ g f : A→ C

(c) Show that composition of dependent functions is associative.(d) Show that composition of dependent functions satisfies the right unit law:

Γ ` f : ∏ (x:A)B(x)

Γ ` (λx. f ) ′ idA ≡ f : ∏ (x:A)B(x)

(e) Show that composition of dependent functions satisfies the left unit law:

Γ ` f : ∏ (x:A)B(x)

Γ ` (λx. idB(x)) ′ f ≡ f : ∏ (x:A)B(x)

2.5 (a) Given two types A and B in context Γ, and a type C in context Γ, x : A, y : B, definethe swap function

Γ ` σ :(

∏ (x:A)∏ (y:B)C(x, y))→(

∏ (y:B)∏ (x:A)C(x, y))

that swaps the order of the arguments.(b) Show that

Γ ` σ σ ≡ id :(

∏ (x:A)∏ (y:B)C(x, y))→(

∏ (x:A)∏ (y:B)C(x, y))

.

Page 23: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

3. THE NATURAL NUMBERS 13

3 The natural numbers

The set of natural numbers is the most important object in mathematics. We quote Bishop, fromhis Constructivist Manifesto, the first chapter in Foundations of Constructive Analysis [2], wherehe gives a colorful illustration of its importance to mathematics.

“The primary concern of mathematics is number, and this means the positive integers.We feel about number the way Kant felt about space. The positive integers and theirarithmetic are presupposed by the very nature of our intelligence and, we are temptedto believe, by the very nature of intelligence in general. The development of the theoryof the positive integers from the primitive concept of the unit, the concept of adjoininga unit, and the process of mathematical induction carries complete conviction. In thewords of Kronecker, the positive integers were created by God. Kronecker wouldhave expressed it even better if he had said that the positive integers were created byGod for the benefit of man (and other finite beings). Mathematics belongs to man,not to God. We are not interested in properties of the positive integers that have nodescriptive meaning for finite man. When a man proves a positive integer to exist,he should show how to find it. If God has mathematics of his own that needs to bedone, let him do it himself.”

A bit later in the same chapter, he continues:

“Building on the positive integers, weaving a web of ever more sets and ever morefunctions, we get the basic structures of mathematics: the rational number system, thereal number system, the euclidean spaces, the complex number system, the algebraicnumber fields, Hilbert space, the classical groups, and so forth. Within the frameworkof these structures, most mathematics is done. Everything attaches itself to number,and every mathematical statement ultimately expresses the fact that if we performcertain computations within the set of positive integers, we shall get certain results.”

3.1 The formal specification of the type of natural numbers

The type N of natural numbers is the archetypal example of an inductive type. The rules wepostulate for the type of natural numbers come in four sets, just as the rules for Π-types:

(i) The formation rule, which asserts that the type N can be formed.

(ii) The introduction rules, which provide the zero element and the successor function.

(iii) The elimination rule. This rule is the type theoretic analogue of the induction principle forN.

(iv) The computation rules, which assert that any application of the elimination rule behavesas expected on the constructors 0N and succN of N.

The formation rule of N

The type N is formed by the N-formation rule

N-form`N type.

In other words, N is postulated to be a closed type.

Page 24: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

14 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

The introduction rules of N

Unlike the set of positive integers in Bishop’s remarks, Peano’s first axiom postulates that 0 isa natural number. The introduction rules for N equip it with the zero term and the successorfunction.

` 0N : N ` succN : N→N

Remark 3.1.1. We annotate the terms 0N and succN of type N with their type in the subscript,as a reminder that 0N and succN are declared to be terms of type N, and not of any other type.In the next chapter we will introduce the type Z of the integers, on which we can also define azero term 0Z, and a successor function succZ. These should be distinguished from the terms 0N

and succN. In general, we will make sure that every term is given a unique name. In libraries ofmathematics formalized in a computer proof assistant it is also the case that every type must begiven a unique name.

The elimination rule of N

To prove properties about the natural numbers, we postulate an induction principle for N. For atypical example, it is easy to show by induction that

1 + · · ·+ n =n(n + 1)

2.

Similarly, we can define operations by recursion on the natural numbers: the Fibonacci sequenceis defined by F(0) = 0, F(1) = 1, and

F(n + 2) = F(n) + F(n + 1).

Needless to say, we want an induction principle to hold for the natural numbers in type theoryand we also want it to be possible to construct operations on the natural numbers by recursion.

In dependent type theory we may think of a type family P over N as a predicate over N.Especially after we introduce a few more type-forming operations, such as Σ-types and identitytypes, it will become clear that the language of dependent type theory expressive enough to finddefinitions of all of the standard concepts and operations of elementary number theory in typetheory. Many of those definitions, the ordering relations ≤ and < for example, will make use oftype dependency. Then, to prove that P(n) ‘holds’ for all n we just have to construct a dependentfunction

∏ (n:N)P(n).

The induction principle for the natural numbers in type theory exactly states what one has todo in order to construct such a dependent function, via the following inference rule:

Γ, n : N ` P(n) type

Γ ` p0 : P(0N)

Γ ` pS : ∏ (n:N)P(n)→ P(succN(n))N-ind

Γ ` indN(p0, pS) : ∏ (n:N)P(n)

Just like for the usual induction principle of the natural numbers, there are two things to beconstructed given a type family P over N: in the base case we need to construct a term p0 : P(0N),and for the inductive step we need to construct a function of type P(n)→ P(succN(n)) for alln : N. And this comes at one immediate advantage: induction and recursion in type theory areone and the same thing!

Page 25: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

3. THE NATURAL NUMBERS 15

Remark 3.1.2. We might alternatively present the induction principle of N as the followinginference rule

Γ, n : N ` P(n) type

Γ ` indN : P(0N)→((

∏ (n:N)P(n)→ P(succN(n)))→ ∏ (n:N)P(n)

)In other words, for any type family P over N there is a function indN that takes two arguments,one for the base case and one for the inductive step, and returns a section of P. Now it isjustified to wonder: is this slightly different presentation of induction equivalent to the previouspresentation?

To see that indeed we get such a function from the induction principle (rule N-ind above),we note that the induction principle is stated to hold in an arbitrary context Γ. So let us wieldthe power of type dependency: by weakening and the variable rule we have the followingwell-formed terms:

Γ, p0 : P(0N), pS : ∏ (n:N)P(n)→ P(succN(n)) ` p0 : P(0N)

Γ, p0 : P(0N), pS : ∏ (n:N)P(n)→ P(succN(n)) ` pS : ∏ (n:N)P(n)→ P(succN(n)).

Therefore, the induction principle of N provides us with a term

Γ, p0 : P(0N), pS : ∏ (n:N)P(n)→ P(succN(n)) ` indN(p0, pS) : ∏ (n:N)P(n).

By λ-abstraction we now obtain a function

indN : P(0N)→((

∏ (n:N)P(n)→ P(succN(n)))→ ∏ (n:N)P(n)

)in context Γ. Therefore we see that it does not really matter whether we present the inductionprinciple of N in a more verbose way as an inference rule with the base case and the inductivestep as hypotheses, or as a function taking variables for the base case and the inductive step asarguments.

The computation rules of N

The computation rules for N postulate that the dependent function indN(P, p0, pS) behaves asexpected when it is applied to 0N or a successor. There is one computation rule for each step inthe induction principle, covering the base case and the inductive step.

The computation rule for the base case is

Γ, n : N ` P(n) type

Γ ` p0 : P(0N)

Γ ` pS : ∏ (n:N)P(n)→ P(succN(n))

Γ ` indN(p0, pS, 0N) ≡ p0 : P(0N)

Similarly, with the same hypotheses as for the computation rule for the base case, the computationrule for the inductive step is

· · ·Γ, n : N ` indN(p0, pS, succN(n)) ≡ pS(n, indN(p0, pS, n)) : P(succN(n))

This completes the formal specification of N.

Page 26: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

16 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

3.2 Addition on the natural numbers

Using the induction principle of N we can perform many familiar constructions. For instance,we can define the addition operation by induction on N.

Definition 3.2.1. We define a function

addN : N→ (N→N)

satisfying addN(0N, n) ≡ n and addN(succN(m), n) ≡ succN(addN(m, n)). Usually we willwrite n + m for addN(n, m).

Informal construction. Informally, the definition of addition is as follows. By induction it sufficesto construct a function add-0N : N→N, and a function

add-succN(n, f ) : N→N,

for every n : N and every f : N→N.The function add-0N : N→N is of course taken to be idN, since the result of adding 0 to n

should be n.Given n : N and a function f : N→N we define add-succN(n, f ) :≡ succN f . The idea is

that if f represents adding m, then add-succN(n, f ) should be adding one more than f did.

Formal derivation. The derivation for the construction of add-succN looks as follows:

succN : NN

`N type `N type `N type

` comp : NN → (NN →NN)

g : N→N ` comp(g) : NN →NN

` comp(succN) : NN →NN

n : N ` comp(succN) : NN →NN

` add-succN :≡ λn. comp(succN) : N→ (NN →NN)

We combine this derivation with the induction principle of N to complete the construction ofaddition:

...n : N `NN type

...` add-0N :≡ idN : NN

...` add-succN : N→ (NN →NN)

` addN ≡ indN(add-0N, add-succN) : N→NN

The asserted judgmental equalities then hold by the computation rules for N.

Remark 3.2.2. When we define a function f : ∏ (n:N)P(n), we will often do so just by indicatingits definition on 0N and its definition on succN(n), by writing

f (0N) :≡ p0

f (succN(n)) :≡ pS(n, f (n)).

For example, the definition of addition on the natural numbers could be given as

addN(0N, n) :≡ naddN(succN(m), n) :≡ succN(addN(m, n)).

Page 27: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

3. EXERCISES 17

This way of defining a function is called pattern matching. A more formal inductive argument canbe obtained from a definition by pattern matching if it is possible to obtain from the expressionpS(n, f (n)) a general dependent function

pS : ∏ (n:N)P(n)→ P(succN(n)).

In practice this is usually the case. Computer proof assistants such as Agda have sophisticatedalgorithms to allow for definitions by pattern matching.

Remark 3.2.3. By the computation rules for N it follows that

0N + n ≡ n, and succN(m) + n ≡ succN(m + n).

However, the rules that we provided so far are not sufficient to also conclude that n + 0N ≡ nand n + succN(m) ≡ succN(n + m). Nevertheless, once we have introduced the identity type in§5 we will nevertheless be able to identify n + 0N with n, and n + succN(m) with succN(n + m).See Exercise 5.5.

Exercises

3.1 Define the binary min and max functions

minN, maxN : N→ (N→N).

3.2 Define the multiplication operation

mulN : N→ (N→N).

3.3 Define the exponentiation function n, m 7→ mn of type N→ (N→N).3.4 Define the factorial operation n 7→ n!.3.5 Define the binomial coefficient (n

k) for any n, k : N, making sure that (nk) ≡ 0 when n < k.

3.6 Define the Fibonacci sequence 0, 1, 1, 2, 3, 5, 8, 13, . . . as a function F : N→N.

4 More inductive types

Analogous to the type of natural numbers, many types can be specified as inductive types. Inthis lecture we introduce some further examples of inductive types: the unit type, the emptytype, the booleans, coproducts, dependent pair types, and cartesian products. We also introducethe type of integers.

4.1 The idea of general inductive types

Just like the type of natural numbers, other inductive types are also specified by their constructors,an induction principle, and their computation rules:

(i) The constructors tell what structure the inductive type comes equipped with. There mayany finite number of constructors, even no constructors at all, in the specification of aninductive type.

(ii) The induction principle specifies the data that should be provided in order to construct asection of an arbitrary type family over the inductive type.

Page 28: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

18 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

(iii) The computation rules assert that the inductively defined section agrees on the constructorswith the data that was used to define the section. Thus, there is a computation rule forevery constructor.

The induction principle and computation rules can be generated automatically once the con-structors are specified, but it goes beyond the scope of our course to describe general inductivetypes.

4.2 The unit type

A straightforward example of an inductive type is the unit type, which has just one constructor.Its induction principle is analogous to just the base case of induction on the natural numbers.

Definition 4.2.1. We define the unit type to be a closed type 1 equipped with a closed term

? : 1,

satisfying the induction principle that for any type family of types P(x) indexed by x : 1, there isa term

ind1 : P(?)→ ∏ (x:1)P(x)

for which the computation ruleind1(p, ?) ≡ p

holds. Sometimes we write λ ? . p for ind1(p).

The induction principle can also be used to define ordinary functions out of the unit type.Indeed, given a type A we can first weaken it to obtain the constant family over 1, with value A.Then the induction principle of the unit type provides a function

ind1 : A→ (1→ A).

In other words, by the induction principle for the unit type we obtain for every x : A a functionptx :≡ ind1(x) : 1→ A.

4.3 The empty type

The empty type is a degenerate example of an inductive type. It does not come equipped withany constructors, and therefore there are also no computation rules. The induction principlemerely asserts that any type family has a section. In other words: if we assume the empty typehas a term, then we can prove anything.

Definition 4.3.1. We define the empty type to be a type ∅ satisfying the induction principle thatfor any family of types P(x) indexed by x :, there is a term

ind∅ : ∏ (x:∅)P(x).

The induction principle for the empty type can also be used to construct a function

∅→ A

for any type A. Indeed, to obtain this function one first weakens A to obtain the constant familyover ∅ with value A, and then the induction principle gives the desired function.

Thus we see that from the empty type anything follows. Therefore, we we see that anythingfollows from A, if we have a function from A to the empty type. This motivates the followingdefinition.

Page 29: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

4. MORE INDUCTIVE TYPES 19

Definition 4.3.2. For any type A we define negation of A by

¬A :≡ A→ ∅.

Since ¬A is the type of functions from A to ∅, a proof of ¬A is given by assuming thatA holds, and then deriving a contradiction. This proof technique is called proof of negation.Proofs of negation are not to be confused with proofs by contradiction. In type theory there is noway of obtaining a term of type A from a term of type (A→ ∅)→ ∅.

4.4 The booleans

Definition 4.4.1. We define the booleans to be a type 2 that comes equipped with

02 : 212 : 2

satisfying the induction principle that for any family of types P(x) indexed by x : 2, there is aterm

ind2 : P(02)→(

P(12)→ ∏ (x:2)P(x))

for which the computation rules

ind2(p0, p1, 02) ≡ p0

ind2(p0, p1, 12) ≡ p1

hold.

Just as in the cases for the unit type and the empty type, the induction principle for thebooleans can also be used to construct an ordinary function 2 → A, provided that we canconstruct two terms of type A. Indeed, by the induction principle for the booleans there is afunction

ind2 : A→ (A→ A2)

for any type A.

Example 4.4.2. Using the induction principle of 2 we can define all the operations of Booleanalgebra. For example, the boolean negation operation neg2 : 2→ 2 is defined by

neg2(12) :≡ 02 neg2(02) :≡ 12.

The boolean conjunction operation – ∧ – : 2→ (2→ 2) is defined by

12 ∧ 12 :≡ 12 02 ∧ 12 :≡ 02

12 ∧ 02 :≡ 02 02 ∧ 02 :≡ 02.

The boolean disjunction operation – ∨ – : 2→ (2→ 2) is defined by

12 ∨ 12 :≡ 12 02 ∨ 12 :≡ 12

12 ∨ 02 :≡ 12 02 ∨ 02 :≡ 02.

We leave the definitions of some of the other boolean operations as Exercise 4.3. Note that themethod of defining the boolean operations by the induction principle of 2 is not that differentfrom defining them by truth tables.

Boolean logic is important, but it won’t be very prominent in this course. The reason is simple:in type theory it is more natural to use the ‘logic’ of types that is provided by the inference rules.

Page 30: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

20 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

4.5 Coproducts and the type of integers

Definition 4.5.1. Let A and B be types. We define the coproduct A + B to be a type that comesequipped with

inl : A→ A + Binr : B→ A + B

satisfying the induction principle that for any family of types P(x) indexed by x : A + B, there isa term

ind+ :(

∏ (x:A)P(inl(x)))→(

∏ (y:B)P(inr(y)))→ ∏ (z:A+B)P(z)

for which the computation rules

ind+( f , g, inl(x)) ≡ f (x)inr+( f , g, inr(y)) ≡ g(y)

hold. Sometimes we write [ f , g] for ind+( f , g).

The coproduct of two types is sometimes also called the disjoint sum. By the inductionprinciple of coproducts it follows that we have a function

(A→ X)→((B→ X)→ (A + B→ X)

)for any type X. Note that this special case of the induction principle of coproducts is very muchlike the elimination rule of disjunction in first order logic: if P, P′, and Q are propositions, thenwe have

(P→ Q)→((P′ → Q)→ (P ∨ P′ → Q)

).

Indeed, we can think of propositions as types and of terms as their constructive proofs. Under thisinterpretation of type theory the coproduct is indeed the disjunction.

An important example of a type that can be defined using coproducts is the type Z of integers.

Definition 4.5.2. We define the integers to be the type Z :≡N + (1 + N). The type of integerscomes equipped with inclusion functions of the positive and negative integers

in-pos :≡ inr inr

in-neg :≡ inl,

which are both of type N→ Z, and the constants

−1Z :≡ in-neg(0)0Z :≡ inr(inl(?))

1Z :≡ in-pos(0).

In the following lemma we derive an induction principle for Z, which can be used in manyfamiliar constructions on Z, such as in the definitions of addition and multiplication.

Lemma 4.5.3. Consider a type family P over Z. If we are given

p−1 : P(−1Z)

p−S : ∏ (n:N)P(in-neg(n))→ P(in-neg(succN(n)))

Page 31: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

4. MORE INDUCTIVE TYPES 21

p0 : P(0Z)

P1 : P(1Z)

PS : ∏ (n:N)P(in-pos(n))→ P(in-pos(succN(n))),

then we can construct a dependent function f : ∏ (k:Z)P(k) for which the following judgmental equalitieshold:

f (−1Z) ≡ p−1

f (in-neg(succN(n))) ≡ p−S(n, f (in-neg(n)))f (0Z) ≡ p0

f (1Z) ≡ p1

f (in-pos(succN(n))) ≡ pS(n, f (in-pos(n))).

Proof. Since Z is the coproduct of N and 1 + N, it suffices to define

pinl : ∏ (n:N)P(inl(n))

pinr : ∏ (t:1+N)P(inr(t)).

Note that in-neg ≡ inl and −1Z ≡ in-neg(0N). In order to define pinl we use induction on thenatural numbers, so it suffices to define

p−1 : P(−1)p−S : ∏ (n:N)P(in-neg(n))→ P(in-neg(succN(n))).

Similarly, we proceed by coproduct induction, followed by induction on 1 in the left case andinduction on N on the right case, in order to define pinr.

As an application we define the successor function on the integers.

Definition 4.5.4. We define the successor function on the integers succZ : Z → Z using theinduction principle of Lemma 4.5.3, taking

succZ(−1Z) :≡ 0N

succZ(in-neg(succN(n))) :≡ in-neg(n)succZ(0Z) :≡ 1N

succZ(1Z) :≡ in-pos(1N)

succZ(in-pos(succN(n))) :≡ in-pos(succN(succN(n))).

4.6 Dependent pair types

Given a type family B over A, we may consider pairs (a, b) of terms, where a : A and b : B(a).Note that the type of b depends on the first term in the pair, so we call such a pair a dependentpair.

The dependent pair type is an inductive type that is generated by the dependent pairs.

Definition 4.6.1. Consider a type family B over A. The dependent pair type (or Σ-type) isdefined to be the inductive type ∑(x:A) B(x) equipped with a pairing function

(–, –) : ∏ (x:A)

(B(x)→ ∑(y:A)B(y)

).

Page 32: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

22 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

The induction principle for ∑(x:A) B(x) asserts that for any family of types P(p) indexed byp : ∑(x:A) B(x), there is a function

indΣ :(

∏ (x:A)∏ (y:B(x))P(x, y))→(

∏ (p:∑(x:A) B(x))P(p))

.

satisfying the computation rule

indΣ( f , (x, y)) ≡ f (x, y).

Sometimes we write λ(x, y). f (x, y) for indΣ(λx. λy. f (x, y)).

Definition 4.6.2. Given a type A and a type family B over A, the first projection map

pr1 :(

∑(x:A)B(x))→ A

is defined by induction aspr1 :≡ λ(x, y). x.

The second projection map is a dependent function

pr2 : ∏ (p:∑(x:A) B(x))B(pr1(p))

defined by induction aspr2 :≡ λ(x, y). y.

By the computation rule we have

pr1(x, y) ≡ xpr2(x, y) ≡ y.

4.7 Cartesian products

A special case of the Σ-type occurs when the B is a constant family over A, i.e., when B is just atype. In this case, the inductive type ∑(x:A) B(x) is generated by ordinary pairs (x, y) where x : Aand y : B. In other words, if B does not depend on A, then the type ∑(x:A) B is the (cartesian)product A× B. The cartesian product is a very common special case of the dependent pair type,just as the type A → B of ordinary functions from A → B is a common special case of thedependent product. Therefore we provide its specification along with the induction principle forcartesian products.

Definition 4.7.1. Consider two types A and B. The (cartesian) product of A and B is defined asthe inductive type A× B with constructor

(–, –) : A→ (B→ A× B).

The induction principle for A× B asserts that for any type family P over A× B, one has

ind× :(

∏ (x:A)∏ (y:B)P(a, b))→(

∏ (p:A×B)P(p))

satisfying the computation rule that

ind×( f , (x, y)) ≡ f (x, y).

The projection maps are defined similarly to the projection maps of Σ-types. When one thinksof types as propositions, then A× B is interpreted as the conjunction of A and B.

Page 33: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

4. EXERCISES 23

Exercises

4.1 Write the rules for 1, ∅, 2, A + B, ∑(x:A) B(x), and A× B. As usual, present the rules infour sets:

(i) A formation rule.

(ii) Introduction rules.

(iii) An elimination rule.

(iv) Computation rules.

4.2 Let A be a type.

(a) Show that (A + ¬A)→ (¬¬A→ A).(b) Show that ¬¬¬A→ ¬A.

4.3 Define the following operations of Boolean algebra:

exclusive disjunction p⊕ qimplication p⇒ qif and only if p⇔ qPeirce’s arrow (neither . . . nor) p ↓ qSheffer stroke (not both) p | q.

Here p and q range over 2.4.4 Define the predecessor function predZ : Z→ Z.4.5 Define the group operations

addZ : Z→ (Z→ Z)

negZ : Z→ Z,

and define the multiplication

mulZ : Z→ (Z→ Z).

4.6 Construct a function F : Z → Z that extends the Fibonacci sequence to the negativeintegers

. . . , 5,−3, 2,−1, 1, 0, 1, 1, 2, 3, 5, 8, 13, . . .

in the expected way.4.7 Show that 1 + 1 satisfies the same induction principle as 2, i.e., define

t0 : 1 + 1t1 : 1 + 1,

and show that for any type family P over 1 + 1 there is a function

ind1+1 : P(t0)→(

P(t1)→ ∏ (t:1+1)P(t))

satisfying

ind1+1(p0, p1, t0) ≡ p0

ind1+1(p0, p1, t1) ≡ p1.

In other words, type theory cannot distinguish between the types 2 and 1 + 1.

Page 34: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

24 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

4.8 For any type A we can define the type list(A) of lists elements of A as the inductive typewith constructors

nil : list(A)

cons : A→ (list(A)→ list(A)).

(a) Write down the induction principle and the computation rules for list(A).(b) Let A and B be types, suppose that b : B, and consider a binary operation µ : A →

(B→ B). Define a function

fold-list(µ) : list(A)→ B

that iterates the operation µ, starting with fold-list(µ, nil) :≡ b.(c) Define a function length-list : list(A)→N.(d) Define a function

sum-list : list(N)→N

that adds all the elements in a list of natural numbers.(e) Define a function

concat-list : list(A)→ (list(A)→ list(A))

that concatenates any two lists of elements in A.(f) Define a function

flatten-list : list(list(A))→ list(A)

that concatenates all the lists in a lists of lists in A.(g) Define a function reverse-list : list(A)→ list(A) that reverses the order of the elements

in any list.

5 Identity types

From the perspective of types as proof-relevant propositions, how should we think of equality intype theory? Given a type A, and two terms x, y : A, the equality x = y should again be a type.Indeed, we want to use type theory to prove equalities. Dependent type theory provides us with aconvenient setting for this: the equality type x = y is dependent on x, y : A.

Then, if x = y is to be a type, how should we think of the terms of x = y. A term p : x = ywitnesses that x and y are equal terms of type A. In other words p : x = y is an identification ofx and y. In a proof-relevant world, there might be many terms of type x = y. I.e., there mightbe many identifications of x and y. And, since x = y is itself a type, we can form the type p = qfor any two identifications p, q : x = y. That is, since x = y is a type, we may also use the typetheory to prove things about identifications (for instance, that two given such identifications canthemselves be identified), and we may use the type theory to perform constructions with them.As we will see shortly, we can give every type a groupoidal structure.

Clearly, the equality type should not just be any type dependent on x, y : A. Then how do weform the equality type, and what ways are there to use identifications in constructions in typetheory? The answer to both these questions is that we will form the identity type as an inductivetype, generated by just a reflexivity term providing an identification of x to itself. The inductionprinciple then provides us with a way of performing constructions with identifications, suchas concatenating them, inverting them, and so on. Thus, the identity type is equipped with areflexivity term, and further possesses the structure that are generated by its induction principleand by the type theory. This inductive construction of the identity type is elegant, beautifullysimple, but far from trivial!

Page 35: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

5. IDENTITY TYPES 25

Table I.1: The homotopy interpretation

Type theory Homotopy theory

Types SpacesDependent types FibrationsTerms PointsDependent pair type Total spaceIdentity type Path fibration

The situation where two terms can be identified in possibly more than one way is analogousto the situation in homotopy theory, where two points of a space can be connected by possiblymore than one path. Indeed, for any two points x, y in a space, there is a space of paths from x toy. Moreover, between any two paths from x to y there is a space of homotopies between them,and so on. This leads to the homotopy interpretation of type theory, outlined in Table I.1. Theconnection between homotopy theory and type theory been made precise by the constructionof homotopical models of type theory, and it has led to the fruitful research area of synthetichomotopy theory, the subfield of homotopy type theory that is the topic of this course.

5.1 The inductive definition of identity types

Definition 5.1.1. Consider a type A and let a : A. Then we define the identity type of A at a asan inductive family of types a =A x indexed by x : A, of which the constructor is

refla : a =A a.

The induction principle of the identity type postulates that for any family of types P(x, p) indexedby x : A and p : a =A x, there is a function

path-inda : P(a, refla)→ ∏ (x:A)∏ (p:a=Ax)P(x, p)

that satisfies path-inda(p, a, refla) ≡ p.A term of type a =A x is also called an identification of a with x, and sometimes it is called a

path from a to x. The induction principle for identity types is sometimes called identificationelimination or path induction. We also write IdA for the identity type on A, and often we writea = x for the type of identifications of a with x, omitting reference to the ambient type A.

Remark 5.1.2. We see that the identity type is not just an inductive type, like the inductive typesN, ∅, and 1 for example, but it is and inductive family of types. Even though we have a typea =A x for any x : A, the constructor only provides a term refla : a =A a, identifying a with itself.The induction principle then asserts that in order to prove something about all identificationsof a with some x : A, it suffices to prove this assertion about refla only. We will see in thenext sections that this induction principle is strong enough to derive many familiar facts aboutequality, namely that it is a symmetric and transitive relation, and that all functions preserveequality.

Remark 5.1.3. Since the identity types require getting used to, we provide the formal rules foridentity types. The identity type is formed by the formation rule:

Γ ` a : AΓ, x : A ` a =A x type

Page 36: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

26 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

The constructor of the identity type is then given by the introduction rule:

Γ ` a : AΓ ` refla : a =A a

The induction principle is now given by the elimination rule:

Γ ` a : A Γ, x : A, p : a =A x ` P(x, p) typeΓ ` path-inda : P(a, refla)→ ∏ (x:A) ∏ (p:a=Ax)P(x, p)

And finally the computation rule is:

Γ ` a : A Γ, x : A, p : a =A x ` P(x, p) typeΓ ` path-inda(p, a, refla) ≡ p : P(a, refla)

Remark 5.1.4. One might wonder whether it is also possible to form the identity type at a variableof type A, rather than at a term. This is certainly possible: since we can form the identity type inany context, we can form the identity type at a variable x : A as follows:

Γ, x : A ` x : AΓ, x : A, y : A ` x =A y type

In this way we obtain the ‘binary’ identity type. Its constructor is then also indexed by x : A. Wehave the following introduction rule

Γ, x : A ` x : AΓ, x : A ` reflx : x =A x

and similarly we have elimination and computation rules.

5.2 The groupoidal structure of types

We show that identifications can be concatenated and inverted, which corresponds to the transitivityand symmetry of the identity type.

Definition 5.2.1. Let A be a type. We define the concatenation operation

concat : ∏ (x,y,z:A)(x = y)→ (y = z)→ (x = z).

We will write p q for concat(p, q).

Construction. We construct the concatenation operation by path induction. It suffices to construct

concat(reflx) : ∏ (z:A)(x = z)→ (x = z).

Here we take concat(reflx)z ≡ id(x=z). Explicitly, the term we have constructed is

λx. path-indx(λz. id(x=z)) : ∏ (x,y:A)(x = y)→ ∏ (z:A)(y = z)→ (x = z).

To obtain a term of the asserted type we need to swap the order of the arguments p : x = y andz : A, using Exercise 2.5.

Page 37: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

5. IDENTITY TYPES 27

Definition 5.2.2. Let A be a type. We define the inverse operation

inv : ∏ (x,y:A)(x = y)→ (y = x).

Most of the time we will write p−1 for inv(p).

Construction. We construct the inverse operation by path induction. It suffices to construct

inv(reflx) : x = x,

for any x : A. Here we take inv(reflx) :≡ reflx.

The next question is whether the concatenation and inverting operations on paths behave asexpected. More concretely, is path concatenation associative, does it satisfy the unit laws, and isthe inverse of a path indeed a two-sided inverse?

For example, in the case of associativity we are asking to compare the paths

(p q) r and p (q r)

for any p : x = y, q : y = z, and r : z = w in a type A. The computation rules of path inductionare not strong enough to conclude that (p q) r and p (q r) are judgmentally equal. However,both (p q) r and p (q r) are terms of the same type: they are identifications of type x = w.Since the identity type is a type like any other, we can ask whether there is an identification

(p q) r = p (q r).

This is a very useful idea: while it is often impossible to show that two terms of the same typeare judgmentally equal, it may be the case that those two terms can be identified. Indeed, weidentify two terms by constructing a term of the identity type, and we can use all the type theoryat our disposal in order to construct such a term. In this way we can show, for example, thataddition on the natural numbers or on the integers is associative and satisfies the unit laws. Andindeed, here we will show that path concatenation is associative and satisfies the unit laws.

Definition 5.2.3. Let A be a type and consider three consecutive paths

x y z wp q r

in A. We define the associator

assoc(p, q, r) : (p q) r = p (q r).

Construction. By path induction it suffices to show that

∏ (z:A)∏ (q:x=z)∏ (w:A)∏ (r:z=w)(reflx q) r = reflx (q r).

Let q : x = z and r : z = w. Note that by the computation rule of the path induction principle wehave a judgmental equality reflx q ≡ q. Therefore we conclude that

(reflx q) r ≡ q r.

Similarly we have a judgmental equality reflx (q r) ≡ q r. Thus we see that the left-hand sideand the right-hand side in

(reflx q) r = reflx (q r)

are judgmentally equal, so we can simply define assoc(reflx, q, r) :≡ reflq r.

Page 38: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

28 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

Definition 5.2.4. Let A be a type. We define the left and right unit law operations, which assignsto each p : x = y the terms

left-unit(p) : reflx p = pright-unit(p) : p refly = p,

respectively.

Construction. By identification elimination it suffices to construct

left-unit(reflx) : reflx reflx = reflx

right-unit(reflx) : reflx reflx = reflx.

In both cases we take reflreflx .

Definition 5.2.5. Let A be a type. We define left and right inverse law operations

left-inv(p) : p−1 p = refly

right-inv(p) : p p−1 = reflx.

Construction. By identification elimination it suffices to construct

left-inv(reflx) : refl−1x reflx = reflx

right-inv(reflx) : reflx refl−1x = reflx.

Using the computation rules we see that

refl−1x reflx ≡ reflx reflx ≡ reflx,

so we define left-inv(reflx) :≡ reflreflx . Similarly it follows from the computation rules that

reflx refl−1x ≡ refl−1

x ≡ reflx

so we again define right-inv(reflx) :≡ reflreflx .

Remark 5.2.6. We have seen that the associator, the unit laws, and the inverse laws, are all provenby constructing an identification of identifications. And indeed, there is nothing that would stopus from considering identifications of those identifications of identifications. We can go up as faras we like in the tower of identity types, which is obtained by iteratively taking identity types.

The iterated identity types give types in homotopy type theory a very intricate structure. Oneimportant way of studying this structure is via the homotopy groups of types, a subject that wewill gradually be working towards.

5.3 The action on paths of functions

Using the induction principle of the identity type we can show that every function preservesidentifications. In other words, every function sends identified terms to identified terms. Notethat this is a form of continuity for functions in type theory: if there is a path that identifies twopoints x and y of a type A, then there also is a path that identifies the values f (x) and f (y) in thecodomain of f .

Page 39: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

5. IDENTITY TYPES 29

Definition 5.3.1. Let f : A→ B be a map. We define the action on paths of f as an operation

ap f : ∏ (x,y:A)(x = y)→ ( f (x) = f (y)).

Moreover, there are operations

ap-idA : ∏ (x,y:A)∏ (p:x=y)p = apidA(p)

ap-comp( f , g) : ∏ (x,y:A)∏ (p:x=y)apg(ap f (p)) = apg f (p).

Construction. First we define ap f by identity elimination, taking

ap f (reflx) :≡ refl f (x).

Next, we construct ap-idA by identity elimination, taking

ap-idA(reflx) :≡ reflreflx .

Finally, we construct ap-comp( f , g) by identity elimination, taking

ap-comp( f , g, reflx) :≡ reflg( f (x)).

Definition 5.3.2. Let f : A→ B be a map. Then there are identifications

ap-refl( f , x) : ap f (reflx) = refl f (x)

ap-inv( f , p) : ap f (p−1) = ap f (p)−1

ap-concat( f , p, q) : ap f (p q) = ap f (p) ap f (q)

for every p : x = y and q : x = y.

Construction. To construct ap-refl( f , x) we simply observe that ap f (reflx) ≡ refl f (x), so we take

ap-refl( f , x) :≡ reflrefl f (x).

We construct ap-inv( f , p) by identification elimination on p, taking

ap-inv( f , reflx) :≡ reflap f (reflx).

Finally we construct ap-concat( f , p, q) by identification elimination on p, taking

ap-concat( f , reflx, q) :≡ reflap f (q).

5.4 Transport

Dependent types also come with an action on paths: the transport functions. Given an identi-fication p : x = y in the base type A, we can transport any term b : B(x) to the fiber B(y). Thetransport functions have many applications, which we will encounter throughout this course.

Definition 5.4.1. Let A be a type, and let B be a type family over A. We will construct a transportoperation

trB : ∏ (x,y:A)(x = y)→ (B(x)→ B(y)).

Page 40: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

30 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

Construction. We construct trB(p) by induction on p : x =A y, taking

trB(reflx) :≡ idB(x).

Thus we see that type theory cannot distinguish between identified terms x and y, becausefor any type family B over A one gets a term of B(y) as soon as B(x) has a term.

As an application of the transport function we construct the dependent action on paths ofa dependent function f : ∏ (x:A)B(x). Note that for such a dependent function f , and anidentification p : x =A y, it does not make sense to directly compare f (x) and f (y), since thetype of f (x) is B(x) whereas the type of f (y) is B(y), which might not be exactly the same type.However, we can first transport f (x) along p, so that we obtain the term trB(p, f (x)) which is oftype B(y). Now we can ask whether it is the case that trB(p, f (x)) = f (y). The dependent actionon paths of f establishes this identification.

Definition 5.4.2. Given a dependent function f : ∏ (a:A)B(a) and a path p : x = y in A, weconstruct a path

apd f (p) : trB(p, f (x)) = f (y).

Construction. The path apd f (p) is constructed by path induction on p. Thus, it suffices toconstruct a path

apd f (reflx) : trB(reflx, f (x)) = f (x).

Since transporting along reflx is the identity function on B(x), we simply take apd f (reflx) :≡refl f (x).

Exercises

5.1 (a) State Goldbach’s Conjecture in type theory.(b) State the Twin Prime Conjecture in type theory.

5.2 Show that the operation inverting paths distributes over the concatenation operation, i.e.,construct an identification

distributive-inv-concat(p, q) : (p q)−1 = q−1 p−1.

for any p : x = y and q : y = z.5.3 For any p : x = y, q : y = z, and r : x = z, construct maps

inv-con(p, q, r) : (p q = r)→ (q = p−1 r)

con-inv(p, q, r) : (p q = r)→ (p = r q−1).

5.4 Let B be a type family over A, and consider a path p : x = x′ in A. Construct for anyy : B(x) a path

liftB(p, y) : (x, y) = (x′, trB(p, y)).

In other words, a path in the base type A lifts to a path in the total space ∑(x:A) B(x) for everyterm over the domain, analogous to the path lifting property for fibrations in homotopytheory.

5.5 Show that the operations of addition and multiplication on the natural numbers satisfy thelaws of a commutative semi-ring:

m + (n + k) = (m + n) + k m · (n · k) = (m · n) · k

Page 41: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

6. TYPE THEORETIC UNIVERSES 31

m + 0 = m m · 1 = m0 + m = m 1 ·m = mm + n = n + m m · 0 = 0

0 ·m = 0m · n = n ·m

m · (n + k) = m · n + m · k.

5.6 Consider four consecutive identifications

a b c d ep q r s

in a type A. In this exercise we will show that the Mac Lane pentagon for identificationscommutes.

(a) Construct the five identifications α1, . . . , α5 in the pentagon

((p q) r) s (p q) (r s)

(p (q r)) s p (q (r s)),

p ((q r) s)

α4

α1 α5

α2 α3

where α1, α2, and α3 run counter-clockwise, and α4 and α5 run clockwise.(b) Show that

(α1 α2) α3 = α4 α5.

6 Type theoretic universes

To complete our specification of dependent type theory, we introduce type theoretic universes.Universes are types that consist of types. In other words, a universe is a type U that comesequipped with a type family T over U , and for any X : U we think of X as an encoding of thetype T (X). We call this type family the universal type family.

There are several reasons to equip type theory with universes. One reason is that it enablesus to define new type families over inductive types, using their induction principle. For example,since the universe is itself a type, we can use the induction principle of 2 to obtain a mapP : 2→ U from any two terms X0, X1 : U . Then we obtain a type family over 2 by substituting Pinto the universal type family:

x : 2 ` T (P(x)) type

satisfying T (P(02)) ≡ T (X0) and T (P(12)) ≡ T (X1).We use this way of defining type families to define many familiar relations over N, such as ≤

and <. We also introduce a relation called observational equality EqN on N, which we can thinkof as equality of N. This relation is reflexive, symmetric, and transitive, and moreover it is theleast reflexive relation. Furthermore, one of the most important aspects of observational equalityEqN on N is that EqN(m, n) is a type for every m, n : N, unlike judgmental equality. Thereforewe can use type theory to reason about observational equality on N. Indeed, in the exercises

Page 42: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

32 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

we show that some very elementary mathematics can already be done at this early stage in ourdevelopment of type theory.

A second reason to introduce universes is that it allows us to define many types of typesequipped with structure. One of the most important examples is the type of groups, which is thetype of types equipped with the group operations satisfying the group laws, and for which theunderlying type is a set. We won’t discuss the condition for a type to be a set until §10, so thedefinition of groups in type theory will be given much later. Therefore we illustrate this use ofthe universe by giving simpler examples: pointed types, graphs, and reflexive graphs.

One of the aspects that make universes useful is that they are postulated to be closed under allthe type constructors. For example, if we are given X : U and P : T (X)→ U , then the universeis equipped with a term

Σ(X, P) : Usatisfying the judgmental equality T (Σ(X, P) ≡ ∑(x:T (X)) T (P(x)). We will similarly assumethat any universe is closed under Π-types and the other ways of forming types. However, thereis an important restriction: it would be inconsistent to assume that the universe is contained initself. One way of thinking about this is that universes are types of small types, and it cannot bethe case that the universe is small with respect to itself. We address this problem by assumingthat there are many universes: enough universes so that any type family can be obtained bysubstituting into the universal type family of some universe.

6.1 Specification of type theoretic universes

In the following definition we already state that universes are closed under identity types.Identity types will be introduced in §5.

Definition 6.1.1. A universe in type theory is a closed type U equipped with a type family Tover U called the universal family, equipped with the following structure:

(i) U is closed under Π, in the sense that it comes equipped with a function

Π : ∏ (X:U )(T (X)→ U )→ U

for which the judgmental equality

T(Π(X, P)

)≡ ∏ (x:T (X))T (P(x)).

holds, for every X : U and P : T (X)→ U .

(ii) U is closed under Σ in the sense that it comes equipped with a function

Σ : ∏ (X:U )(T (X)→ U )→ U

for which the judgmental equality

T(Σ(X, P)

)≡ ∑(x:T (X))T (P(x))

holds, for every X : U and P : T (X)→ U .

(iii) U is closed under identity types, in the sense that it comes equipped with a function

I : ∏ (X:U )T (X)→ (T (X)→ U )

for which the judgmental equality

T(I(X, x, y)

)≡ (x = y)

holds, for every X : U and x, y : T (X).

Page 43: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

6. TYPE THEORETIC UNIVERSES 33

(iv) U is closed under coproducts, in the sense that it comes equipped with a function

+ : U → (U → U )

that satisfies T(X+Y

)≡ T (X) + T (Y).

(v) U contains terms ∅, 1, N : U that satisfy the judgmental equalities

T(∅)≡ ∅

T(1)≡ 1

T (N) ≡N.

Given a universe U , we say that a type A in context Γ is small with respect to U if it occurs in theuniverse, i.e., if it comes equipped with a term A : U in context Γ, for which the judgment

Γ ` T(

A)≡ A type

holds. If A is small with respect to U , we usually write simply A for A and also A for T (A). Inother words, by A : U we mean that A is a small type.

Remark 6.1.2. Since ordinary function types are defined as a special case of dependent functiontypes, we don’t have to assume that universes are closed under ordinary function types. Similarly,it follows from the assumption that universes are closed under dependent pair types thatuniverses are closed under cartesian product types.

6.2 Assuming enough universes

Most of the time we will get by with assuming one universe U , and indeed we recommend on afirst reading of this text to simply assume that there is one universe U . However, sometimes wemight need a second universe V that contains U as well as all the types in U . In such situationswe cannot get by with a single universe, because the assumption that U is a term of itself wouldlead to inconsistencies like the Russel’s paradox.

Russel’s paradox is the famous argument that there cannot be a set of all sets. If there weresuch a set S, then we could consider Russel’s subset

R := x ∈ S | x /∈ x.

Russell then observed that R ∈ R if and only if R /∈ R, so we reach a contradiction. A variant ofthis argument reaches a similar contradiction when we assume that U is a universe that containsa term U : U such that T

(U)≡ U . In order to avoid such paradoxes, Russell and Whitehead

formulated the ramified theory of types in their book Principia Mathematica. The ramified theory oftypes is a precursor of Martin Löf’s type theory that we are studying in this course.

Even though the universe is not a term of itself, it is still convenient if every type, includingany universe, is small with respect to some universe. Therefore we will assume that there aresufficiently many universes: we will assume that for every finite list of types

Γ1 ` A1 type

...

Γn ` An type,

Page 44: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

34 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

there is a universe U that contains each Ai in the sense that U comes equipped with a term

Γi ` Ai : U

for which the judgmentΓi ` T

(Ai)≡ Ai type

holds. With this assumption it will rarely be necessary to work with more than one universe atthe same time.

Remark 6.2.1. Using the assumption that for any finite list of types in context there is a universethat contains those types, we obtain many specific universes:

(i) There is a base universe U0 that we obtain using the empty list of types in context. This is auniverse, but it isn’t specified to contain any further types.

(ii) Given a finite list

Γ1 ` A1 type

...

Γn ` An type,

of types in context, and a universe U that contains them, there is a universe U+ that containsall the types in U as well as U . More precisely, it is specified by the finite list

` U type

X : U ` T (X) type.

Note that since the universe U+ contains all the types in U , it also contains the typesA1, . . . , An. To see this, we derive that there is a code for Ai in U+.

Γi ` Ai : UX : U ` T (X) : U+

Γi, X : U ` T (X) : U+

Γi ` T (Ai) : U+

We leave it as an exercise to derive the judgmental equality

T +(T (Ai)) ≡ Ai.

(iii) Given two finite lists

Γ1 ` A1 type ∆1 ` B1 type

......

Γn ` An type ∆m ` Bm type

Page 45: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

6. TYPE THEORETIC UNIVERSES 35

of types in context, and two universes U and V that contain A1, . . . , An and B1, . . . , Bmrespectively, there is a universe U tV that contains the types of both U and V . The universeU t V is specified by the finite list

X : U ` TU (X) type

Y : V ` TV (Y) type.

With an argument similar to the previous construction of a universe, we see that theuniverse U t V contains the types A1, . . . , An as well as the types B1, . . . , Bm.

Note that we could also directly obtain a universeW that contains the types A1, . . . , Anand B1, . . . , Bm. However, this universe might not contain all the types in U or all the typesin V .

Since we don’t postulate any relations between the universes, there are indeed very few of them.For example, the base universe U0 might contain many more types than it is postulated to contain.Nevertheless, there are some relations between the universes. For instance, there is a functionU → U+, since we can simply derive

X : U ` T (X) : U+

` λX. T (X) : U → U+

Similarly, there are functions U → U t V and V → U t V for any two universes U and V .

6.3 Pointed types

Definition 6.3.1. A pointed type is a pair (A, a) consisting of a type A and a term a : A. Thetype of all pointed types in a universe U is defined to be

U∗ :≡ ∑(X:U )X.

Definition 6.3.2. Consider two pointed types (A, a) and (B, b). A pointed map from (A, a) to(B, b) is a pair ( f , p) consisting of a function f : A → B and an identification p : f (a) = b. Wewrite

A→∗ B :≡ ∑( f :A→B) f (a) = b

for the type of all pointed maps from (A, a) to (B, b), leaving the base point implicit.

Since we have a type U∗ of all pointed types in a universe U , we can start defining operationson U∗. An important example of such an operation is to take the loop space of a pointed type.

Definition 6.3.3. We define the loop space operation Ω : U∗ → U∗Ω(A, a) :≡

((a = a), refla

).

We can even go further and define the iterated loop space of a pointed type. Note that thisdefinition could not be given in type theory if we didn’t have universes.

Definition 6.3.4. Given a pointed type (A, a) and a natural number n, we define the n-th loopspace Ωn(A, a) by induction on n : N, taking

Ω0(A, a) :≡ (A, a)

Ωn+1(A, a) :≡ Ω(Ωn(A, a)).

Page 46: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

36 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

6.4 Families and relations on the natural numbers

As we have already seen in the case of the iterated loop space, we can use the universe to definea type family over N by induction on N. For example, we can define the finite types in this way.

Definition 6.4.1. We define the type family Fin : N → U of finite types by induction on N,taking

Fin(0N) :≡ ∅

Fin(succN(n)) :≡ Fin(n) + 1

Similarly, we can define many relations on the natural numbers using a universe. We givehere the example of observational equality on N. This inductively defined equivalence relation isvery important, as it can be used to show that equality on the natural numbers is decidable, i.e.,there is a program that decides for any two natural numbers m and n whether they are equal ornot.

Definition 6.4.2. We define the observational equality on N as binary relation EqN : N →(N→ U ) satisfying

EqN(0N, 0N) ≡ 1 EqN(succN(n), 0N) ≡ ∅

EqN(0N, succN(n)) ≡ ∅ EqN(succN(n), succN(m)) ≡ EqN(n, m).

Construction. We define EqN by double induction on N. By the first application of induction itsuffices to provide

E0 : N→ U

ES : N→ (N→ U )→ (N→ U )

We define E0 by induction, taking E00 :≡ 1 and E0S(n, X, m) :≡ ∅. The resulting family E0satisfies

E0(0N) ≡ 1

E0(succN(n)) ≡ ∅.

We define ES by induction, taking ES0 :≡ ∅ and ES0(n, X, m) :≡ X(m). The resulting family ESsatisfies

ES(n, X, 0N) ≡ ∅

ES(n, X, succN(m)) ≡ X(m)

Therefore we have by the computation rule for the first induction that the judgmental equality

EqN(0N, m) ≡ E0(m)

EqN(succN(n), m) ≡ ES(n, EqN(n), m)

holds, from which the judgmental equalities in the statement of the definition follow.

Page 47: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

6. EXERCISES 37

Lemma 6.4.3. Suppose R : N→ (N→ U ) is a reflexive relation on N, i.e., R comes equipped with

ρ : ∏ (n:N)R(n, n).

Then there is a family of maps∏ (m,n:N)EqN(m, n)→ R(m, n).

Proof. We will prove by induction on m, n : N that there is a term of type

fm,n : ∏ (e:EqN(m,n))∏ (R:N→(N→U ))

(∏ (x:N)R(x, x)

)→ R(m, n)

The dependent function fm,n is defined by

f0N,0N:≡ λ ? . λr. λρ. ρ(0N)

f0N,succN(n) :≡ ind∅

fsuccN(m),0N:≡ ind∅

fsuccN(m),succN(n) :≡ λe. λR. λρ. fm,n(e, R′, ρ′),

where R′ and ρ′ are given by

R′(m, n) :≡ R(succN(m), succN(n))

ρ′(n) :≡ ρ(succN(n)).

We can also define observational equality for many other kinds of types, such as 2 or Z. Ineach of these cases, what sets the observational equality apart from other relations is that it is theleast reflexive relation.

Exercises

6.1 Show that observational equality on N is an equivalence relation, i.e., construct terms ofthe following types:

∏ (n:N)EqN(n, n)

∏ (n,m:N)EqN(n, m)→ EqN(m, n)

∏ (n,m,l:N)EqN(n, m)→ (EqN(m, l)→ EqN(n, l)).

6.2 Let R be a reflexive binary relation on N, i.e., R is of type N → (N → U ) and comesequipped with a term ρ : ∏ (n:N)R(n, n). Show that

∏ (n,m:N)EqN(n, m)→ R(n, m).

6.3 Show that every function f : N→N preserves observational equality in the sense that

∏ (n,m:N)EqN(n, m)→ EqN( f (n), f (m)).

Hint: to get the inductive step going the induction hypothesis has to be strong enough. Constructby double induction a term of type

∏ (n,m:N)∏ ( f :N→N)EqN(n, m)→ EqN( f (n), f (m)),

and pull out the universal quantification over f : N→N by Exercise 2.5.

Page 48: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

38 CHAPTER I. MARTIN-LÖF’S DEPENDENT TYPE THEORY

6.4 (a) Define the order relations ≤ and < on N.(b) Show that ≤ is reflexive and that < is anti-reflexive, i.e., that ¬(n < n).(c) Show that both ≤ and < are transitive, and that n < S(n).(d) Show that k ≤ min(m, n) holds if and only if both k ≤ m and k ≤ n hold, and show

that max(m, n) ≤ k holds if and only if both m ≤ k and n ≤ k hold.6.5 (a) Define observational equality Eq2 on the booleans.

(b) Show that Eq2 is reflexive.(c) Show that for any reflexive relation R : 2→ (2→ U ) one has

∏ (x,y:2)Eq2(x, y)→ R(x, y).

6.6 (a) Define the order relations ≤ and < on and Z.(b) Show that ≤ is reflexive, transitive, and anti-symmetric.(c) Show that < is anti-reflexive and transitive.

6.7 (a) Show that N satisfies strong induction, i.e., construct for any type family P over N afunction of type

P(0N)→(

∏ (k:N)

(∏ (m:N)(m ≤ k)→ P(m)

)→ P(succN(k))

)→ ∏ (n:N)P(n).

(b) Show that N satisfies ordinal induction, i.e., construct for any type family P over N

a function of type(∏ (k:N)

(∏ (m:N)(m < k)→ P(m)

)→ P(k)

)→ ∏ (n:N)P(n).

Page 49: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

Chapter II

Basic concepts of type theory

7 Equivalences

7.1 Homotopies

In homotopy type theory, a homotopy is just a pointwise equality between two functions f andg. We view the type of homotopies as the observational equality for Π-types.

Definition 7.1.1. Let f , g : ∏ (x:A)P(x) be two dependent functions. The type of homotopiesfrom f to g is defined as

f ∼ g :≡ ∏ (x:A) f (x) = g(x).

Note that the type of homotopies f ∼ g is a special case of a dependent function type.Therefore the definition of homotopies is set up in such a way that we may also considerhomotopies between homotopies, and even further homotopies between those higher homotopies.More concretely, if H, K : f ∼ g are two homotopies, then the type of homotopies H ∼ K betweenthem is just the type

∏ (x:A)H(x) = K(x).

In the following definition we define the groupoidal structure of homotopies. Note that weimplement the groupoid laws as homotopies rather than as identifications.

Definition 7.1.2. For any type family B over A there are operations

htpy-refl : ∏ ( f :∏ (x:A)B(x)) f ∼ f

htpy-inv : ∏ ( f ,g:∏ (x:A)B(x))( f ∼ g)→ (g ∼ f )

htpy-concat : ∏ ( f ,g,h:∏ (x:A)B(x))( f ∼ g)→ ((g ∼ h)→ ( f ∼ h)).

We will write H−1 for htpy-inv(H), and H K for htpy-concat(H, K).Furthermore, we define

htpy-assoc(H, K, L) : (H K) L ∼ H (K L)

htpy-left-unit(H) : htpy-refl f H ∼ H

htpy-right-unit(H) : H htpy-reflg ∼ H

htpy-left-inv(H) : H−1 H ∼ htpy-reflg

39

Page 50: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

40 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

htpy-right-inv(H) : H H−1 ∼ htpy-refl f

for any H : f ∼ g, K : g ∼ h and L : h ∼ i, where f , g, h, i : ∏ (x:A)B(x).

Construction. We define

htpy-refl( f ) :≡ λx. refl f (x)

htpy-inv(H) :≡ λx. H(x)−1

htpy-concat(H, K) :≡ λx. H(x) K(x),

where H : f ∼ g and K : g ∼ h are homotopies. Furthermore, we define

htpy-assoc(H, K, L) :≡ λx. assoc(H(x), K(x), L(x))

htpy-left-unit(H) :≡ λx. left-unit(H(x))

htpy-right-unit(H) :≡ λx. right-unit(H(x))

htpy-left-inv(H) :≡ λx. left-inv(H(x))

htpy-right-inv(h) :≡ λx. right-inv(H(x)).

Apart from the groupoid operations and their laws, we will occasionally need whiskeringoperations.

Definition 7.1.3. We define the following whiskering operations on homotopies:

(i) Suppose H : f ∼ g for two functions f , g : A→ B, and let h : B→ C. We define

h · H :≡ λx. aph(H(x)) : h f ∼ h g.

(ii) Suppose f : A→ B and H : g ∼ h for two functions g, h : B→ C. We define

H · f :≡ λx. H( f (x)) : h f ∼ g f .

We also use homotopies to express the commutativity of diagrams. For example, we say thata triangle

A B

X

h

f g

commutes if it comes equipped with a homotopy H : f ∼ g h, and we say that a square

A A′

B B′

g

f f ′

h

if it comes equipped with a homotopy h f g f ′.

Page 51: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

7. EQUIVALENCES 41

7.2 Bi-invertible maps

Definition 7.2.1. Let f : A → B be a function. We say that f has a section if there is a term oftype

sec( f ) :≡ ∑(g:B→A) f g ∼ idB.

Dually, we say that f has a retraction if there is a term of type

retr( f ) :≡ ∑(h:B→A)h f ∼ idA.

If a map f : A→ B has a retraction, we also say that A is a retract of B. We say that a functionf : A → B is an equivalence if it has both a section and a retraction, i.e., if it comes equippedwith a term of type

is-equiv( f ) :≡ sec( f )× retr( f ).

We will write A ' B for the type ∑( f :A→B) is-equiv( f ).

Remark 7.2.2. An equivalence, as we defined it here, can be thought of as a bi-invertible map, sinceit comes equipped with a separate left and right inverse. Explicitly, if f is an equivalence, thenthere are

g : B→ A h : B→ A

G : f g ∼ idB H : h f ∼ idA.

Clearly, if f has an inverse in the sense that it comes equipped with a function g : B→ A suchthat f g ∼ idB and g f ∼ idA, then f is an equivalence. We write

has-inverse( f ) :≡ ∑(g:B→A)( f g ∼ idB)× (g f ∼ idA).

Lemma 7.2.3. Any equivalence e : A ' B can be given the structure of an invertible map. We definee−1 to be the section g : B→ A of e.

Proof. First we construct for any equivalence f with right inverse g and left inverse h a homotopyK : g ∼ h. For any y : B, we have

g(y) h f g(y) h(y).H(g(y))−1 aph(G(y))

Therefore we define a homotopy K : g ∼ h by K :≡ (H · g)−1 h · G. Using the homotopy K weare able to show that g is also a left inverse of f . For x : A we have the identification

g f (x) h f (x) x.K( f (x)) H(x)

Corollary 7.2.4. The inverse of an equivalence is again an equivalence.

Proof. Let f : A→ B be an equivalence. By Lemma 7.2.3 it follows that the section of f is also aretraction. Therefore it follows that the section is itself an invertible map, with inverse f . Henceit is an equivalence.

Remark 7.2.5. For any type A, the identity function idA is an equivalence, since it is its ownsection and its own retractionExample 7.2.6. For any type C(x, y) indexed by x : A and y : B, the swap function

σ :(

∏ (x:A)∏ (y:B)C(x, y))→(

∏ (y:B)∏ (x:A)C(x, y))

that swaps the order of the arguments x and y is an equivalence by Exercise 2.5.

Page 52: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

42 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

7.3 The identity type of a Σ-type

In this section we characterize the identity type of a Σ-type as a Σ-type of identity types. In thiscourse we will be characterizing the identity types of many types, so we will follow the generaloutline of how such a characterization goes:

(i) First we define a binary relation R : A→ A→ U on the type A that we are interested in.This binary relation is intended to be equivalent to its identity type.

(ii) Then we will show that this binary relation is reflexive, by constructing a term of type

∏ (x:A)R(x, x)

(iii) Using the reflexivity we will show that there is a canonical map

(x = y)→ R(x, y)

for every x, y : A. This map is just constructed by path induction, using the reflexivity of R.

(iv) Finally, it has to be shown that the map

(x = y)→ R(x, y)

is an equivalence for each x, y : A.

The last step is usually the most difficult, and we will refine our methods for this step in §9,where we establish the fundamental theorem of identity types.

In this section we consider a type family B over A. Given two pairs

(x, y), (x′, y′) : ∑(x:A)B(x),

if we have a path α : x = x′ then we can compare y : B(x) to y′ : B(x′) by first transporting yalong α, i.e., we consider the identity type

trB(α, y) = y′.

Thus it makes sense to think of (x, y) to be identical to (x′, y′) if there is an identification α : x = x′

and an identification β : trB(α, y) = y′. In the following definition we turn this idea into a binaryrelation on the Σ-type.

Definition 7.3.1. We will define a relation

EqΣ :(

∑(x:A)B(x))→(

∑(x:A)B(x))→ U

by definingEqΣ(s, t) :≡ ∑(α:pr1(s)=pr1(t))trB(α, pr2(s)) = pr2(t).

Lemma 7.3.2. The relation EqΣ is reflexive, i.e., there is a term

reflexive-EqΣ : ∏ (s:∑(x:A) B(x))EqΣ(s, s).

Construction. This term is constructed by Σ-induction on s : ∑(x:A) B(x). Thus, it suffices toconstruct a term of type

∏ (x:A)∏ (y:B(x))∑(α:x=x)trB(α, y) = y.

Here we take λx. λy. (reflx, refly).

Page 53: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

7. EQUIVALENCES 43

Definition 7.3.3. Consider a type family B over A. Then for any s, t : ∑(x:A) B(x) we define amap

pair-eq : (s = t)→ EqΣ(s, t)

by path induction, taking pair-eq(refls) :≡ reflexive-EqΣ(s).

Theorem 7.3.4. Let B be a type family over A. Then the map

pair-eq : (s = t)→ EqΣ(s, t)

is an equivalence for every s, t : ∑(x:A) B(x).

Proof. The maps in the converse direction

eq-pair : EqΣ(s, t)→ (s = t)

are defined by repeated Σ-induction. By Σ-induction on s and t we see that it suffices to define amap

eq-pair :(

∑(p:x=x′)trB(p, y) = y′)→ ((x, y) = (x′, y′)).

A map of this type is again defined by Σ-induction. Thus it suffices to define a dependentfunction of type

∏ (p:x=x′)(trB(p, y) = y′)→ ((x, y) = (x′, y′)).

Such a dependent function is defined by double path induction by sending (reflx, refly) to refl(x,y).This completes the definition of the function eq-pair.

Next, we must show that eq-pair is a section of pair-eq. In other words, we must construct anidentification

pair-eq(eq-pair(α, β)) = (α, β)

for each (α, β) : ∑(α:x=x′) trB(α, y) = y′. We proceed by path induction on α, followed by pathinduction on β. Then our goal becomes to construct a term of type

pair-eq(eq-pair(reflx, refly)) = (reflx, refly)

By the definition of eq-pair we have eq-pair(reflx, refly) ≡ refl(x,y), and by the definition of pair-eq

we have pair-eq(refl(x,y)) ≡ (reflx, refly). Thus we may take refl(reflx ,refly) to complete the construc-tion of the homotopy pair-eq eq-pair ∼ id.

To complete the proof, we must show that eq-pair is a retraction of pair-eq. In other words,we must construct an identification

eq-pair(pair-eq(p)) = p

for each p : s = t. We proceed by path induction on p : s = t, so it suffices to construct anidentification

eq-pair(reflpr1(s), reflpr2(s)) = refls.

Now we proceed by Σ-induction on s : ∑(x:A) B(x), so it suffices to construct an identification

eq-pair(reflx, refly) = refl(x,y).

Since eq-pair(reflx, refly) computes to refl(x,y), we may simply take reflrefl(x,y).

Page 54: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

44 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

Exercises

7.1 Show that the functions

inv : (x = y)→ (y = x)

concat(p) : (y = z)→ (x = z)

concat′(q) : (x = y)→ (x = z)

trB(p) : B(x)→ B(y)

are equivalences, where concat′(q, p) :≡ p q. Give their inverses explicitly.7.2 Show that the maps

inl : X → X + ∅ pr1 : ∅× X → ∅

inr : X → ∅ + X pr2 : X×∅→ ∅

are equivalences.7.3 (a) Consider two functions f , g : A→ B and a homotopy H : f ∼ g. Then

is-equiv( f )↔ is-equiv(g).

(b) Show that for any two homotopic equivalences e, e′ : A ' B, their inverses are alsohomotopic.

7.4 Consider a commuting triangle

A B

X.

h

f g

with H : f ∼ g h.

(a) Suppose that the map h has a section s : B→ A. Show that the triangle

B A

X.

s

g f

commutes, and that f has a section if and only if g has a section.(b) Suppose that the map g has a retraction r : X → B. Show that the triangle

A X

B.

f

h r

commutes, and that f has a retraction if and only if h has a retraction.(c) (The 3-for-2 property for equivalences.) Show that if any two of the functions

f , g, h

are equivalences, then so is the third.

Page 55: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

7. EXERCISES 45

7.5 (a) Show that the negation function on the booleans neg2 : 2→ 2 defined in Example 4.4.2is an equivalence.

(b) Use the observational equality on the booleans, defined in Exercise 6.5, to show that02 6= 12.

(c) Show that for any b : 2, the constant function constb is not an equivalence.7.6 Show that the successor function on the integers is an equivalence.7.7 Construct a equivalences A + B ' B + A and A× B ' B× A.7.8 Consider a section-retraction pair

A B A,i r

with H : r i ∼ id. Show that x = y is a retract of i(x) = i(y).7.9 Let B be a family of types over A, and let C be a family of types indexed by x : A, y : B(x).

Construct an equivalence

assoc-Σ :(

∑(p:∑(x:A) B(x))C(pr1(p), pr2(p)))'(

∑(x:A)∑(y:B(x))C(x, y))

.

7.10 Let A and B be types, and let C be a family over x : A, y : B. Construct an equivalence

swap-Σ :(

∑(x:A)∑(y:B)C(x, y))'(

∑(y:B)∑(x:A)C(x, y))

.

7.11 In this exercise we will show that the laws for abelian groups hold for addition on theintegers. Note: these are obvious facts, but the proof terms that show how the group lawshold are nevertheless fairly involved. This exercise is perfect for a formalization project.

(a) Show that addition satisfies the left and right unit laws, i.e., construct terms

left-unit-law-add-Z : ∏ (x:Z)0 + x = x

right-unit-law-add-Z : ∏ (x:Z)x + 0 = x.

(b) Show that addition respects predecessors and successor on both sides, i.e., constructterms

left-predecessor-law-add-Z : ∏ (x,y:Z)predZ(x) + y = predZ(x + y)

right-predecessor-law-add-Z : ∏ (x,y:Z)x + predZ(y) = predZ(x + y)

left-successor-law-add-Z : ∏ (x,y:Z)succZ(x) + y = succZ(x + y)

right-successor-law-add-Z : ∏ (x,y:Z)x + succZ(y) = succZ(x + y).

Hint: to avoid an excessive number of cases, use induction on x but not on y. Youmay need to use the homotopies succZ predZ ∼ id and predZ succZ constructed inexercise Exercise 7.6.

(c) Use part (b) to show that addition on the integers is associative and commutative, i.e.,construct terms

assoc-add-Z : ∏ (x,y,z:Z)(x + y) + z = x + (y + z)

comm-add-Z : ∏ (x,y:Z)x + y = y + x.

Hint: Especially in the construction of the associator there is a risk of running into anunwieldy amount of cases if you use Z-induction on all arguments. Avoid inductionon y and z.

Page 56: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

46 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

(d) Show that addition satisfies the left and right inverse laws:

left-inverse-law-add-Z : ∏ (x:Z)(−x) + x = 0

right-inverse-law-add-Z : ∏ (x:Z)x + (−x) = 0.

Conclude that the functions y 7→ x + y and x 7→ x + y are equivalences for any x : Z

and y : Z, respectively.

7.12 In this exercise we will construct the functorial action of coproducts.

(a) Construct for any two maps f : A→ A′ and g : B→ B′, a map

f + g : A + B→ A′ + B′.

(b) Show that if H : f ∼ f ′ and K : g ∼ g′, then there is a homotopy

H + K : ( f + g) ∼ ( f ′ + g′).

(c) Show that idA + idB ∼ idA+B.(d) Show that for any

A A′ A′′

B B′ B′′

f f ′

g g′

there is a homotopy

( f ′ f ) + (g′ g) ∼ ( f ′ + g′) ( f g).

(e) Show that if f and g are equivalences, then so is f + g. (The converse of this statementalso holds, see Exercise 9.5.)

7.13 Construct equivalences

Fin(m + n) ' Fin(m) + Fin(n)

Fin(mn) ' Fin(m)× Fin(n).

8 Contractible types and contractible maps

A contractible type is a type which has, up to identification, only one term. In other words, acontractible type is a type that comes equipped with a point, and an identification of this pointwith any point.

We may think of contractible types as singletons up to homotopy, and indeed we show thatthe unit type is an example of a contractible type. Moreover, we show that contractible typessatisfy an induction principle that is very similar to the induction principle of the unit type,provided that we formulate the computation rule using the identity type rather than postulatinga judgmental computation rule. Another example of a contractible type is the total space of thefamily of identifications with a fixed starting point.

We then introduce the notion of fiber of a map, which is the type theoretic analogue of thepre-image of a map, and we say that a map in contractible if all its fibers are contractible. Thus, amap is contractible if the pre-image at any point in the codomain is a singleton. This condition is

Page 57: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

8. CONTRACTIBLE TYPES AND MAPS 47

of course analogous to the set theoretic notion of bijective map, which suggests that on the typetheoretical side of things a map should be contractible if and only if it is an equivalence.

The forward direction of this claim is straightforward, and we prove this direction imme-diately in Theorem 8.2.5. The converse direction can be done directly, but it is certainly moreinvolved. Therefore we prepare the proof of the converse direction by first characterizing theidentity type of a fiber of a map. Then we show that any equivalence e can be given the structureof a invertible map with an additional coherence relating the homotopies

e e−1 ∼ id, and e−1 e ∼ id,

and finally we use these observations in Theorem 8.3.6 to conclude that the fibers of any equiva-lence must be contractible.

8.1 Contractible types

Definition 8.1.1. We say that a type A is contractible if it comes equipped with a term of type

is-contr(A) :≡ ∑(c:A)∏ (x:A)c = x.

Given a term (c, C) : is-contr(A), we call c : A the center of contraction of A, and we callC : ∏ (x:A)c = x the contraction of A.

Remark 8.1.2. Suppose A is a contractible type with center of contraction c and contraction C.Then the type of C is (judgmentally) equal to the type

constc ∼ idA.

In other words, the contraction C is a homotopy from the constant function to the identity function.

Example 8.1.3. The unit type is easily seen to be contractible. For the center of contraction wetake ? : 1. Then we define a contraction ∏ (x:1)? = x by the induction principle of 1. Applyingthe induction principle, it suffices to construct a term of type ? = ?, for which we just take refl?.

Definition 8.1.4. Suppose A comes equipped with a term a : A. Then we say that A satisfiessingleton induction if for every type family B over A, the map

ev-pt :(

∏ (x:A)B(x))→ B(a)

defined by ev-pt( f ) :≡ f (a) has a section. In other words, if A satisfies singleton induction wehave a function and a homotopy

sing-inda : B(a)→ ∏ (x:A)B(x)

sing-compa : ev-pt sing-inda ∼ id

for any type family B over A.

Example 8.1.5. Note that the singleton induction principle is almost the same as the inductionprinciple for the unit type, the difference being that the "computation rule" in the singletoninduction for A is stated using an identification rather than as a judgmental equality. The unittype 1 comes equipped with a function

ind1 : B(?)→ ∏ (x:1)B(x)

Page 58: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

48 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

for every type family B over 1, satisfying the judgmental equality ind1(b, ?) ≡ b for every b : B(?)by the computation rule. Thus we easily obtain the homotopy

λb. reflb : ev-pt ind1 ∼ id,

and we conclude that the unit type satisfies singleton induction.

Theorem 8.1.6. Let A be a type. The following are equivalent:

(i) The type A is contractible.

(ii) The type A comes equipped with a term a : A, and satisfies singleton induction.

Proof. Suppose A is contractible with center of contraction c and contraction C. First we observethat, without loss of generality, we may assume that C comes equipped with an identificationp : C(c) = reflc. To see this, note that we can always define a new contraction C′ by

C′(x) :≡ C(c)−1 C(x),

which satisfies the requirement by the left inverse law, constructed in Definition 5.2.5.To show that A satisfies singleton induction let B be a type family over A equipped with

b : B(a). To define sing-inda(b) : ∏ (x:A)B(x), let x : A. We have an identification C(x) : a = x,and b is in B(a). Therefore we can transport b along the path C(x) to obtain

sing-inda(b) :≡ trB(C(x), b) : B(x).

To see that sing-ind(c) = b note that we have

trB(C(c), b) trB(reflc, b) b.apλω. trB(ω,b)(p) reflb

This completes the proof that A satisfies singleton induction.For the converse, suppose that a : A and that A satisfies singleton induction. Our goal is to

show that A is contractible. For the center of contraction we take the term a : A. By singletoninduction applied to B(x) :≡ a = x we have the map

sing-inda : a = a→ ∏ (x:A)a = x.

Therefore sing-indA,a(refla) is a contraction.

Theorem 8.1.7. For any a : A, the type∑(x:A)a = x

is contractible.

Proof. We will prove the statement by showing that ∑(y:A) x = y satisfies singleton induction,and then use Theorem 8.1.6 to conclude that ∑(x:A) a = x is contractible. We will use the term(a, refla) : ∑(x:A) a = x as the center of contraction.

Now let P be a type family over ∑(x:A) a = x. Note that we have a commuting triangle

∏ (t:∑(x:A) a=x)P(t) ∏ (x:A) ∏ (p:a=x)P(x, p)

P(a, refla)

ev-pt

ev-pair

ev-refl

Page 59: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

8. CONTRACTIBLE TYPES AND MAPS 49

where the maps ev-pair and ev-refl are defined as

f 7→ λx. λp. f (x, p)

g 7→ g(a, refla),

respectively. By the induction principle for Σ-types it follows that ev-pair has a section, and bypath induction it follows that ev-refl has a section. Therefore it follows from Exercise 7.4 that thecomposite ev-pt has a section.

8.2 Contractible maps

Definition 8.2.1. Let f : A → B be a function, and let b : B. The fiber of f at b is defined to bethe type

fib f (b) :≡ ∑(a:A) f (a) = b.

In other words, the fiber of f at b is the type of a : A that get mapped by f to b. One maythink of the fiber as a type theoretic version of the pre-image of a point.

It will be useful to have a characterization of the identity type of a fiber, so we will make sucha characterization immediately.

Definition 8.2.2. Let f : A→ B be a map, and let (x, p), (x′, p′) : fib f (y) for some y : B. Then wedefine

Eq-fib f ((x, p), (x′, p′)) :≡ ∑(α:x=x′)p = ap f (α) p′

The relation Eq-fib f : fib f (y)→ fib f (y)→ U is a reflexive relation, since we have

λ(x, p). (reflx, reflp) : ∏ ((x,p):fib f (y))Eq-fib f ((x, p), (x, p)).

Lemma 8.2.3. Consider a map f : A→ B and let y : B. The canonical map

((x, p) = (x′, p′))→ Eq-fib f ((x, p), (x′, p′))

induced by the reflexivity of Eq-fib f is an equivalence for any (x, p), (x′, p′) : fib f (y).

Proof. The converse map

Eq-fib f ((x, p), (x′, p′))→ ((x, p) = (x′, p′))

is easily defined by Σ-induction, and then path induction twice. The homotopies witnessing thatthis converse map is indeed a right inverse as well as a left inverse is similarly constructed byinduction.

Now we arrive at the notion of contractible map.

Definition 8.2.4. We say that a function f : A→ B is contractible if there is a term of type

is-contr( f ) :≡ ∏ (b:B)is-contr(fib f (b)).

Theorem 8.2.5. Any contractible map is an equivalence.

Page 60: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

50 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

Proof. Let f : A→ B be a contractible map. Using the center of contraction of each fib f (y), weobtain a term of type

λy. (g(y), G(y)) : ∏ (y:B)fib f (y).

Thus, we get map g : B→ A, and a homotopy G : ∏ (y:B) f (g(y)) = y. In other words, we get asection of f .

It remains to construct a retraction of f . Taking g as our retraction, we have to show that∏ (x:A)g( f (x)) = x. Note that we get an identification p : f (g( f (x))) = f (x) since g is a sectionof f . It follows that (g( f (x)), p) : fib f ( f (x)). Moreover, since fib f ( f (x)) is contractible we getan identification q : (g( f (x)), p) = (x, refl f (x)). The base path appr1

(q) of this identification is anidentification of type g( f (x)) = x, as desired.

8.3 Equivalences are contractible maps

In Theorem 8.3.6 we will show the converse to Theorem 8.2.5, i.e., we will show that anyequivalence is a contractible map. We will do this in two steps.

First we introduce a new notion of coherently invertible map, for which we can easily show thatsuch maps have contractible fibers. Then we show that any equivalence is a coherently invertiblemap.

Recall that an invertible map is a map f : A→ B equipped with g : B→ A and homotopies

G : f g ∼ id and H : g f ∼ id.

Then we observe that both G · f and f · H are homotopies of the same type

f g f ∼ f .

A coherently invertible map is an invertible map for which there is a further homotopy G · f ∼f · H.

Definition 8.3.1. Consider a map f : A→ B. We say that f is coherently invertible if it comesequipped with

g : B→ A

G : f g ∼ id

H : g f ∼ id

K : G · f ∼ f · H.

We will write is-coh-invertible( f ) for the type of quadruples (g, G, H, K).

Although we will encounter the notion of coherently invertible map on some further occa-sions, the following lemma is our main motivation for considering it.

Lemma 8.3.2. Any coherently invertible map has contractible fibers.

Proof. Consider a map f : A→ B equipped with

g : B→ A

Page 61: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

8. CONTRACTIBLE TYPES AND MAPS 51

G : f g ∼ id

H : g f ∼ id

K : G · f ∼ f · H,

and let y : B. Our goal is to show that fib f (y) is contractible. For the center of contraction wetake (g(y), G(y)). In order to construct a contraction, it suffices to construct a term of type

∏ (x:A)∏ (p: f (x)=y)Eq-fib f ((g(y), G(y)), (x, p)).

By path induction on p : f (x) = y it suffices to construct a term of type

∏ (x:A)Eq-fib f ((g( f (x)), G( f (x))), (x, refl f (x))).

By definition of Eq-fib f , we have to construct a term of type

∏ (x:A)∑(α:g( f (x))=x)G( f (x)) = ap f (α) refl f (x).

Such a term is constructed as λx. (H(x), K′(x)), where the homotopy H : g f ∼ id is given byassumption, and the homotopy

K′ : ∏ (x:A)G( f (x)) = ap f (H(x)) refl f (x)

is defined asK′ :≡ K htpy-right-unit( f · H)−1.

Our next goal is to show that for any map f : A→ B equipped with

g : B→ A, G : f g ∼ id, and H : g f ∼ id,

we can improve the homotopy G to a new homotopy G′ : f g ∼ id for which there is a furtherhomotopy

f · H ∼ G′ · f .

Note that this situation is analogous to the situation in the proof of Theorem 8.1.6, where weimproved the contraction C so that it satisfied C(c) = refl. The extra coherence f · H ∼ G′ · f isthen used in the proof that the fibers of an equivalence are contractible.

Definition 8.3.3. Let f , g : A→ B be functions, and consider H : f ∼ g and p : x = y in A. Wedefine the identification

htpy-nat(H, p) :≡ ap f (p) H(y) = H(x) apg(p)

witnessing that the square

f (x) g(x)

f (y) g(y)

H(x)

ap f (p) apg(p)

H(y)

commutes. This square is also called the naturality square of the homotopy H at p.

Page 62: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

52 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

Construction. By path induction on p it suffices to construct an identification

ap f (reflx) H(x) = H(x) apg(reflx)

since ap f (reflx) ≡ refl f (x) and apg(reflx) ≡ reflg(x), and since refl f (x) H(x) ≡ H(x), we see that

the path right-unit(H(x))−1 is of the asserted type.

Definition 8.3.4. Consider f : A→ A and H : f ∼ idA. We construct an identification H( f (x)) =ap f (H(x)), for any x : A.

Construction. By the naturality of homotopies with respect to identifications the square

f f (x) f (x)

f (x) x

ap f (H(x))

H( f (x))

H(x)

H(x)

commutes. This gives the desired identification H( f (x)) = ap f (H(x)).

Lemma 8.3.5. Let f : A → B be a map, and consider (g, G, H) : has-inverse( f ). Then there is ahomotopy G′ : f g ∼ id equipped with a further homotopy

K : G′ · f ∼ f · H.

Thus we obtain a map has-inverse( f )→ is-coh-invertible( f ).

Proof. For each y : B, we construct the identification G′(y) as the concatenation

f g(y) f g f g(y) f g(y) y.G( f g(y))−1 ap f (H(g(y))) G(y)

In order to construct a homotopy G′ · f ∼ f · H, it suffices to show that the square

f g f g f (x) f g f (x)

f g f (x) f (x)

G( f g f (x))

ap f (H(g f (x))) ap f (H(x))

G( f (x))

commutes for every x : A. Recall from Definition 8.3.4 that we have H(g f (x)) = apg f (H(x)).Using this identification, we see that it suffices to show that the square

f g f g f (x) f g f (x)

f g f (x) f (x)

G( f g f (x))

ap f g f (H(x)) ap f (H(x))

G( f (x))

commutes. Now we observe that this is just a naturality square the homotopy G f : f g f ∼ f ,which commutes by Definition 8.3.3.

Page 63: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

8. EXERCISES 53

Now we put the pieces together to conclude that any equivalence has contractible fibers.

Theorem 8.3.6. Any equivalence is a contractible map.

Proof. We have seen in Lemma 8.3.2 that any coherently invertible map is a contractible map.Moreover, any equivalence has the structure of an invertible map by Lemma 7.2.3, and anyinvertible map is coherently invertible by Lemma 8.3.5.

Corollary 8.3.7. Let A be a type, and let a : A. Then the type

∑(x:A)x = a

is contractible.

Proof. By Remark 7.2.5, the identity function is an equivalence. Therefore, the fibers of theidentity function are contractible by Theorem 8.3.6. Note that ∑(x:A) x = a is exactly the fiber ofidA at a : A.

Exercises

8.1 Show that if A is contractible, then for any x, y : A the identity type x = y is also con-tractible.

8.2 Suppose that A is a retract of B. Show that

is-contr(B)→ is-contr(A).

8.3 (a) Show that for any type A, the map const? : A→ 1 is an equivalence if and only if A iscontractible.

(b) Apply Exercise 7.4 to show that for any map f : A → B, if any two of the threeassertions(i) A is contractible

(ii) B is contractible(iii) f is an equivalencehold, then so does the third.

8.4 Show that for any two types A and B, the following are equivalent:

(i) Both A and B are contractible.

(ii) The type A× B is contractible.

8.5 Let A be a contractible type with center of contraction a : A. Furthermore, let B be a typefamily over A. Show that the map y 7→ (a, y) : B(a)→ ∑(x:A) B(x) is an equivalence.

8.6 Let B be a family of types over A, and consider the projection map

pr1 :(∑(x:A)B(x)

)→ A.

Show that for any a : A, the map

λ((x, y), p). trB(p, y) : fibpr1(a)→ B(a),

is an equivalence. Conclude that pr1 is an equivalence if and only if each B(a) is contractible.

Page 64: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

54 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

8.7 Construct for any map f : A → B an equivalence e : A ' ∑(y:B) fib f (y) and a homotopyH : f ∼ pr1 e witnessing that the triangle

A ∑(y:B) fib f (y)

B

e

f pr1

commutes. The projection pr1 : (∑(y:B) fib f (y))→ B is sometimes also called the fibrant re-placement of f , because first projection maps are fibrations in the homotopy interpretationof type theory.

9 The fundamental theorem of identity types

For many types it is useful to have a characterization of their identity types. For example, wehave used a characterization of the identity types of the fibers of a map in order to conclude thatany equivalence is a contractible map. The fundamental theorem of identity types is our maintool to carry out such characterizations, and with the fundamental theorem it becomes a routinetask to characterize an identity type whenever that is of interest.

Our first application of the fundamental theorem of identity types in the present lectureis a simple proof that any equivalence is an embedding. Embeddings are maps that induceequivalences on identity types, i.e., they are the homotopical analogue of injective maps. In oursecond application we characterize the identity types of coproducts.

Throughout the rest of this book we will encounter many more occasions to characterizeidentity types. For example, we will show in Theorem 10.2.6 that the identity type of the naturalnumbers is equivalent to its observational equality, and we will show in Theorem 16.5.2 that theloop space of the circle is equivalent to Z.

In order to prove the fundamental theorem of identity types, we first prove the basic factthat a family of maps is a family of equivalences if and only if it induces an equivalence on totalspaces.

9.1 Families of equivalences

Definition 9.1.1. Consider a family of maps

f : ∏ (x:A)B(x)→ C(x).

We define the maptot( f ) : ∑(x:A)B(x)→ ∑(x:A)C(x)

by λ(x, y). (x, f (x, y)).

Lemma 9.1.2. For any family of maps f : ∏ (x:A)B(x) → C(x) and any t : ∑(x:A) C(x), there is anequivalence

fibtot( f )(t) ' fib f (pr1(t))(pr2(t)).

Proof. For any p : fibtot( f )(t) we define ϕ(t, p) : fibpr1(t)(pr2(t)) by Σ-induction on p. Thereforeit suffices to define ϕ(t, (s, α)) : fibpr1(t)(pr2(t)) for any s : ∑(x:A) B(x) and α : tot( f )(s) =

t. Now we proceed by path induction on α, so it suffices to define ϕ(tot( f )(s), (s, refl)) :

Page 65: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

9. THE FUNDAMENTAL THEOREM 55

fib f (pr1(tot( f )(s)))(pr2(tot( f )(s))). Finally, we use Σ-induction on s once more, so it suffices todefine

ϕ((x, f (x, y)), ((x, y), refl)) : fib f (x)( f (x, y)).

Now we take as our definition

ϕ((x, f (x, y)), ((x, y), refl)) :≡ (y, refl).

For the proof that this map is an equivalence we construct a map

ψ(t) : fib f (pr1(t))(pr2(t))→ fibtot( f )(t)

equipped with homotopies G(t) : ϕ(t) ψ(t) ∼ id and H(t) : ψ(t) ϕ(t) ∼ id. In each of thesedefinitions we use Σ-induction and path induction all the way through, until an obvious choiceof definition becomes apparent. We define ψ(t), G(t), and H(t) as follows:

ψ((x, f (x, y)), (y, refl)) :≡ ((x, y), refl)

G((x, f (x, y)), (y, refl)) :≡ refl

H((x, f (x, y)), ((x, y), refl)) :≡ refl.

Theorem 9.1.3. Let f : ∏ (x:A)B(x)→ C(x) be a family of maps. The following are equivalent:

(i) For each x : A, the map f (x) is an equivalence. In this case we say that f is a family ofequivalences.

(ii) The map tot( f ) : ∑(x:A) B(x)→ ∑(x:A) C(x) is an equivalence.

Proof. By Theorems 8.2.5 and 8.3.6 it suffices to show that f (x) is a contractible map for eachx : A, if and only if tot( f ) is a contractible map. Thus, we will show that fib f (x)(c) is contractibleif and only if fibtot( f )(x, c) is contractible, for each x : A and c : C(x). However, by Lemma 9.1.2these types are equivalent, so the result follows by Exercise 8.3.

Now consider the situation where we have a map f : A→ B, and a family C over B. Thenwe have the map

λ(x, z). ( f (x), z) : ∑(x:A)C( f (x))→ ∑(y:B)C(y).

We claim that this map is an equivalence when f is an equivalence. The technique to prove thisclaim is the same as the technique we used in Theorem 9.1.3: first we note that the fibers areequivalent to the fibers of f , and then we use the fact that a map is an equivalence if and only ifits fibers are contractible to finish the proof.

Lemma 9.1.4. Consider an equivalence e : A ' B, and let C be a type family over B. Then the map

σf (C) :≡ λ(x, z). ( f (x), z) : ∑(x:A)C( f (x))→ ∑(y:B)C(y)

is an equivalence.

Proof. We claim that for each t : ∑(y:B) C(y) there is an equivalence

fibσf (C)(t) ' fib f (pr1(t)).

Page 66: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

56 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

We prove this by constructing

ϕ(t) : fibσf (C)(t)→ fib f (pr1(t))

ψ(t) : fib f (pr1(t))→ fibσf (C)(t)

G(t) : ϕ ψ ∼ id

H(t) : ψ ϕ ∼ id.

The construction of these functions and homotopies is by using Σ-induction and path inductionall the way through, just as in the proof of Lemma 9.1.2. We list the definitions

ϕ(( f (x), z), ((x, z), refl)) :≡ (x, refl)

ψ(( f (x), z), (x, refl)) :≡ ((x, z), refl)

G(( f (x), z), (x, refl)) :≡ refl

H(( f (x), z), ((x, z), refl)) :≡ refl.

Now the claim follows, since we see that ϕ is a contractible map if and only if f is a contractiblemap.

We now combine Theorem 9.1.3 and Lemma 9.1.4.

Definition 9.1.5. Consider a map f : A→ B and a family of maps

g : ∏ (x:A)C(x)→ D( f (x)),

where C is a type family over A, and D is a type family over B. In this situation we also say thatg is a family of maps over f . Then we define

tot f (g) : ∑(x:A)C(x)→ ∑(y:B)D(y)

by tot f (g)(x, z) :≡ ( f (x), g(x, z)).

Theorem 9.1.6. Suppose that g is a family of maps over f , and suppose that f is an equivalence. Thenthe following are equivalent:

(i) The family of maps g over f is a family of equivalences.

(ii) The map tot f (g) is an equivalence.

Proof. Note that we have a commuting triangle

∑(x:A) C(x) ∑(y:B) D(y)

∑(x:A) D( f (x))

tot f (g)

tot(g) λ(x,z). ( f (x),z)

By the assumption that f is an equivalence, it follows that the map ∑(x:A) D( f (x))→ ∑(y:B) D(y)is an equivalence. Therefore it follows that tot f (g) is an equivalence if and only if tot(g) is anequivalence. Now the claim follows, since tot(g) is an equivalence if and only if g if a family ofequivalences.

Page 67: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

9. THE FUNDAMENTAL THEOREM 57

9.2 The fundamental theorem

Many types come equipped with a reflexive relation that possesses a similar structure as theidentity type. The observational equality on the natural numbers is such an example. We havesee that it is a reflexive, symmetric, and transitive relation, and moreover it is contained in anyother reflexive relation. Thus, it is natural to ask whether observational equality on the naturalnumbers is equivalent to the identity type.

The fundamental theorem of identity types (Theorem 9.2.2) is a general theorem that canbe used to answer such questions. It describes a necessary and sufficient condition on a typefamily B over a type A equipped with a point a : A, for there to be a family of equivalences∏ (x:A)(a = x) ' B(x). In other words, it tells us when a family B is a characterization of theidentity type of A.

Before we state the fundamental theorem of identity types we introduce the notion of identitysystems. Those are families B over a A that satisfy an induction principle that is similar to thepath induction principle, where the ‘computation rule’ is stated with an identification.

Definition 9.2.1. Let A be a type equipped with a term a : A. A (unary) identity system on A ata consists of a type family B over A equipped with b : B(a), such that for any family of typesP(x, y) indexed by x : A and y : B(x), the function

h 7→ h(a, b) :(

∏ (x:A)∏ (y:B(x))P(x, y))→ P(a, b)

has a section.

The most important implication in the fundamental theorem is that (ii) implies (i). Occasion-ally we will also use the third equivalent statement. We note that the fundamental theorem alsoappears as Theorem 5.8.4 in [3].

Theorem 9.2.2. Let A be a type with a : A, and let B be be a type family over A with b : B(a). Then thefollowing are logically equivalent for any family of maps

f : ∏ (x:A)(a = x)→ B(x).

(i) The family of maps f is a family of equivalences.

(ii) The total space∑(x:A)B(x)

is contractible.

(iii) The family B is an identity system.

In particular the canonical family of maps

path-inda(b) : ∏ (x:A)(a = x)→ B(x)

is a family of equivalences if and only if ∑(x:A) B(x) is contractible.

Proof. First we show that (i) and (ii) are equivalent. By Theorem 9.1.3 it follows that the family ofmaps f is a family of equivalences if and only if it induces an equivalence(

∑(x:A)a = x)'(

∑(x:A)B(x))

Page 68: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

58 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

on total spaces. We have that ∑(x:A) a = x is contractible. Now it follows by Exercise 8.3, appliedin the case

∑(x:A) a = x ∑(x:A) B(x)

1

tot( f )

'

that tot( f ) is an equivalence if and only if ∑(x:A) B(x) is contractible.Now we show that (ii) and (iii) are equivalent. Note that we have the following commuting

triangle

∏ (t:∑(x:A) B(x))P(t) ∏ (x:A) ∏ (y:B(x))P(x, y)

P(a, b)

ev-pair

ev-pt(a,b) λh. h(a,b)

In this diagram the top map has a section. Therefore it follows by Exercise 7.4 that the left maphas a section if and only if the right map has a section. Notice that the left map has a section forall P if and only if ∑(x:A) B(x) satisfies singleton induction, which is by Theorem 8.1.6 equivalentto ∑(x:A) B(x) being contractible.

9.3 Embeddings

As an application of the fundamental theorem we show that equivalences are embeddings. Thenotion of embedding is the homotopical analogue of the set theoretic notion of injective map.

Definition 9.3.1. An embedding is a map f : A→ B satisfying the property that

ap f : (x = y)→ ( f (x) = f (y))

is an equivalence for every x, y : A. We write is-emb( f ) for the type of witnesses that f is anembedding.

Another way of phrasing the following statement is that equivalent types have equivalentidentity types.

Theorem 9.3.2. Any equivalence is an embedding.

Proof. Let e : A ' B be an equivalence, and let x : A. Our goal is to show that

ape : (x = y)→ (e(x) = e(y))

is an equivalence for every y : A. By Theorem 9.2.2 it suffices to show that

∑(y:A)e(x) = e(y)

is contractible for every y : A. Now observe that there is an equivalence

∑(y:A)e(x) = e(y) ' ∑(y:A)e(y) = e(x)

≡ fibe(e(x))

by Theorem 9.1.3, since for each y : A the map

inv : (e(x) = e(y))→ (e(y) = e(x))

Page 69: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

9. THE FUNDAMENTAL THEOREM 59

is an equivalence by Exercise 7.1. The fiber fibe(e(x)) is contractible by Theorem 8.3.6, so itfollows by Exercise 8.3 that the type ∑(y:A) e(x) = e(y) is indeed contractible.

9.4 Disjointness of coproducts

To give a second application of the fundamental theorem of identity types, we characterize theidentity types of coproducts. Our goal in this section is to prove the following theorem.

Theorem 9.4.1. Let A and B be types. Then there are equivalences

(inl(x) = inl(x′)) ' (x = x′)

(inl(x) = inr(y′)) ' ∅

(inr(y) = inl(x′)) ' ∅

(inr(y) = inr(y′)) ' (y = y′)

for any x, x′ : A and y, y′ : B.

In order to prove Theorem 9.4.1, we first define a binary relation Eq-coprodA,B on the coprod-uct A + B.

Definition 9.4.2. Let A and B be types. We define

Eq-coprodA,B : (A + B)→ (A + B)→ U

by double induction on the coproduct, postulating

Eq-coprodA,B(inl(x), inl(x′)) :≡ (x = x′)

Eq-coprodA,B(inl(x), inr(y′)) :≡ ∅

Eq-coprodA,B(inr(y), inl(x′)) :≡ ∅

Eq-coprodA,B(inr(y), inr(y′)) :≡ (y = y′)

The relation Eq-coprodA,B is also called the observational equality of coproducts.

Lemma 9.4.3. The observational equality relation Eq-coprodA,B on A + B is reflexive, and thereforethere is a map

Eq-coprod-eq : ∏ (s,t:A+B)(s = t)→ Eq-coprodA,B(s, t)

Construction. The reflexivity term ρ is constructed by induction on t : A + B, using

ρ(inl(x)) :≡ reflinl(x) : Eq-coprodA,B(inl(x))

ρ(inr(y)) :≡ reflinr(y) : Eq-coprodA,B(inr(y)).

To show that Eq-coprod-eq is a family of equivalences, we will use the fundamental theorem,Theorem 9.2.2. Moreover, we will use the functoriality of coproducts (established in Exercise 7.12),and the fact that any total space over a coproduct is again a coproduct:

∑(t:A+B)P(t) '(

∑(x:A)P(inl(x)))+(

∑(y:B)P(inr(y)))

All of these equivalences are straightforward to construct, so we leave them as an exercise to thereader.

Page 70: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

60 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

Lemma 9.4.4. For any s : A + B the total space

∑(t:A+B)Eq-coprodA,B(s, t)

is contractible.

Proof. We will do the proof by induction on s. The two cases are similar, so we only show thatthe total space

∑(t:A+B)Eq-coprodA,B(inl(x), t)

is contractible. Note that we have equivalences

∑(t:A+B)Eq-coprodA,B(inl(x), t)

'(

∑(x′ :A)Eq-coprodA,B(inl(x), inl(x′)))+(

∑(y′ :B)Eq-coprodA,B(inl(x), inr(y′)))

'(

∑(x′ :A)x = x′)+(

∑(y′ :B)∅)

'(

∑(x′ :A)x = x′)+ ∅

' ∑(x′ :A)x = x′.

In the last two equivalences we used Exercise 7.2. This shows that the total space is contractible,since the latter type is contractible by Theorem 8.1.7.

Proof of Theorem 9.4.1. The proof is now concluded with an application of Theorem 9.2.2, usingLemma 9.4.4.

Exercises

9.1 (a) Show that the map ∅→ A is an embedding for every type A.(b) Show that inl : A→ A + B and inr : B→ A + B are embeddings for any two types A

and B.9.2 Consider an equivalence e : A ' B. Construct an equivalence

(e(x) = y) ' (x = e−1(y))

for every x : A and y : B.9.3 Show that

( f ∼ g)→ (is-emb( f )↔ is-emb(g))

for any f , g : A→ B.9.4 Consider a commuting triangle

A B

X

h

f g

with H : f ∼ g h.

(a) Suppose that g is an embedding. Show that f is an embedding if and only if h is anembedding.

Page 71: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

9. EXERCISES 61

(b) Suppose that h is an equivalence. Show that f is an embedding if and only if g is anembedding.

9.5 Consider two maps f : A→ A′ and g : B→ B′.

(a) Show that if the mapf + g : (A + B)→ (A′ + B′)

is an equivalence, then so are both f and g (this is the converse of Exercise 7.12.e).(b) Show that f + g is an embedding if and only if both f and g are embeddings.

9.6 (a) Let f , g : ∏ (x:A)B(x)→ C(x) be two families of maps. Show that(∏ (x:A) f (x) ∼ g(x)

)→(

tot( f ) ∼ tot(g))

.

(b) Let f : ∏ (x:A)B(x)→ C(x) and let g : ∏ (x:A)C(x)→ D(x). Show that

tot(λx. g(x) f (x)) ∼ tot(g) tot( f ).

(c) For any family B over A, show that

tot(λx. idB(x)) ∼ id.

9.7 Let a : A, and let B be a type family over A.

(a) Use Exercises 8.2 and 9.6 to show that if each B(x) is a retract of a = x, then B(x) isequivalent to a = x for every x : A.

(b) Conclude that for any family of maps

f : ∏ (x:A)(a = x)→ B(x),

if each f (x) has a section, then f is a family of equivalences.

9.8 Use Exercise 9.7 to show that for any map f : A→ B, if

ap f : (x = y)→ ( f (x) = f (y))

has a section for each x, y : A, then f is an embedding.9.9 We say that a map f : A→ B is path-split if f has a section, and for each x, y : A the map

ap f (x, y) : (x = y)→ ( f (x) = f (y))

also has a section. We write path-split( f ) for the type

sec( f )×∏ (x,y:A)sec(ap f (x, y)).

Show that for any map f : A→ B the following are equivalent:

(i) The map f is an equivalence.

(ii) The map f is path-split.

9.10 Consider a triangle

A B

X

h

f g

with a homotopy H : f ∼ g h witnessing that the triangle commutes.

Page 72: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

62 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

(a) Construct a family of maps

fib-triangle(h, H) : ∏ (x:X)fib f (x)→ fibg(x),

for which the square

∑(x:X) fib f (x) ∑(x:X) fibg(x)

A B

tot(fib-triangle(h,H))

h

commutes, where the vertical maps are as constructed in Exercise 8.7.(b) Show that h is an equivalence if and only if fib-triangle(h, H) is a family of equivalences.

10 The hierarchy of homotopical complexity

10.1 Propositions and subtypes

Definition 10.1.1. A type A is said to be a proposition if there is a term of type

is-prop(A) :≡ ∏ (x,y:A)is-contr(x = y).

Given a universe U , we define PropU to be the type of all small propositions, i.e.,

PropU :≡ ∑(X:U )is-prop(A).

Example 10.1.2. Any contractible type is a proposition by Exercise 8.1. However, propositions donot need to be inhabited: the empty type is also a proposition, since

∏ (x,y:∅)is-contr(x = y)

follows from the induction principle of the empty type.

In the following lemma we prove that in order to show that a type A is a proposition, itsuffices to show that any two terms of A are equal. In other words, propositions are types withproof irrelevance.

Theorem 10.1.3. Let A be a type. Then the following are equivalent:

(i) The type A is a proposition.

(ii) Any two terms of type A can be identified, i.e., there is a dependent function

is-prop′(A) :≡ ∏ (x,y:A)x = y.

(iii) The type A is contractible as soon as it is inhabited, i.e., there is a function

A→ is-contr(A).

(iv) The map const? : A→ 1 is an embedding.

Page 73: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

10. HOMOTOPICAL COMPLEXITY 63

Proof. To show that (i) implies (ii), let A be a proposition. Then its identity types are contractible,so the center of contraction of x = y is identification x = y, for each x, y : A.

To show that (ii) implies (iii), suppose that A comes equipped with p : ∏ (x,y:A)x = y. Thenfor any x : A the dependent function p(x) : ∏ (y:A)x = y is a contraction of A. Thus we obtainthe function

λx. (x, p(x)) : A→ is-contr(A).

To show that (iii) implies (iv), suppose that A→ is-contr(A) and let x, y : A. We have to showthat

apconst? : (x = y)→ (? = ?)

is an equivalence. Since we have x : A it follows that A is contractible. Since the unit type iscontractible it follows that const? is an equivalence. Therefore we conclude by Theorem 9.3.2 thatit is an embedding.

To show that (iv) implies (i), note that if A→ 1 is an embedding, then the identity types of Aare equivalent to contractible types and therefore they must be contractible.

In the following lemma we show that propositions are closed under equivalences.

Lemma 10.1.4. Let A and B be types, and let e : A ' B. Then we have

is-prop(A)↔ is-prop(B).

Proof. We will show that is-prop(B) implies is-prop(A). This suffices, because the converse followsfrom the fact that e−1 : B→ A is also an equivalence.

Since e is assumed to be an equivalence, it follows by Theorem 9.3.2 that

ape : (x = y)→ (e(x) = e(y))

is an equivalence for any x, y : A. If B is a proposition, then in particular the type e(x) = e(y) iscontractible for any x, y : A, so the claim follows from Theorem 8.3.6.

In set theory, a set y is said to be a subset of a set x, if any element of y is an element of x, i.e.,if the condition

∀z(z ∈ y)→ (z ∈ x)

holds. We have already noted that type theory is different from set theory in that terms intype theory come equipped with a unique type. Moreover, in set theory the proposition x ∈ yis well-formed for any two sets x and y, whereas in type theory the judgment a : A is onlywell-formed if it is derived using the postulated inference rules. Because of these differences wemust find a different way to talk about subtypes.

Note that in set theory there is a correspondence between the subsets of a set x, and thepredicates on x. A predicate on x is just a proposition P(z) that varies over the elements z ∈ x.Indeed, if y is a subset of x, then the corresponding predicate is the proposition z ∈ y. Conversely,if P is a predicate on x, then we obtain the subset

z ∈ x | P(z)

of x. Now we have the right idea of subtypes in type theory: they are families of propositions.

Definition 10.1.5. A type family B over A is said to be a subtype of A if for each x : A the typeB(x) is a proposition. When B is a subtype of A, we also say that B(x) is a property of x : A.

We will show in Corollary 10.3.8 that a type family B over A is a subtype of A if and only ifthe projection map pr1 :

(∑(x:A) B(x)

)→ A is an embedding.

Page 74: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

64 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

10.2 Sets

Definition 10.2.1. A type A is said to be a set if it comes equipped with a term of type

is-set(A) :≡ ∏ (x,y:A)is-prop(x = y).

Lemma 10.2.2. A type A is a set if and only if it satisfies axiom K, i.e., if and only if it comes equippedwith a term of type

axiom-K(A) :≡ ∏ (x:A)∏ (p:x=x)reflx = p.

Proof. If A is a set, then x = x is a proposition, so any two of its elements are equal. This impliesaxiom K.

For the converse, if A satisfies axiom K, then for any p, q : x = y we have p q−1 = reflx, andhence p = q. This shows that x = y is a proposition, and hence that A is a set.

Theorem 10.2.3. Let A be a type, and let R : A→ A→ U be a binary relation on A satisfying

(i) Each R(x, y) is a proposition,

(ii) R is reflexive, as witnessed by ρ : ∏ (x:A)R(x, x),

(iii) There is a mapR(x, y)→ (x = y)

for each x, y : A.

Then any family of maps∏ (x,y:A)(x = y)→ R(x, y)

is a family of equivalences. Consequently, the type A is a set.

Proof. Let f : ∏ (x,y:A)R(x, y) → (x = y). Since R is assumed to be reflexive, we also have afamily of maps

path-indx(ρ(x)) : ∏ (y:A)(x = y)→ R(x, y).

Since each R(x, y) is assumed to be a proposition, it therefore follows that each R(x, y) is a retractof x = y. Therefore it follows that ∑(y:A) R(x, y) is a retract of ∑(y:A) x = y, which is contractible.We conclude that ∑(y:A) R(x, y) is contractible, and therefore that any family of maps

∏ (y:A)(x = y)→ R(x, y)

is a family of equivalences.Now it also follows that A is a set, since its identity types are equivalent to propositions, and

therefore they are propositions by Lemma 10.1.4.

Definition 10.2.4. A map f : A→ B is said to be injective if for any x, y : A there is a map

( f (x) = f (y))→ (x = y).

Corollary 10.2.5. Any injective map into a set is an embedding.

Page 75: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

10. HOMOTOPICAL COMPLEXITY 65

Proof. Let f : A→ B be an injective map between sets. Now consider the relation

R(x, y) :≡ ( f (x) = f (y)).

Note that R is reflexive, and that R(x, y) is a proposition for each x, y : A. Moreover, by theassumption that f is injective, we have

R(x, y)→ (x = y)

for any x, y : A. Therefore we are in the situation of Theorem 10.2.3, so it follows that the mapap f : (x = y)→ ( f (x) = f (y)) is an equivalence.

Theorem 10.2.6. The type of natural numbers is a set.

Proof. We will apply Theorem 10.2.3. Note that the observational equality EqN : N→ (N→ U )on N (Definition 6.4.2) is a reflexive relation by Exercise 6.1, and moreover that EqN(n, m) is aproposition for every n, m : N (proof by double induction). Therefore it suffices to show that

∏ (m,n:N)EqN(m, n)→ (m = n).

This follows from the fact that observational equality is the least reflexive relation, which wasshown in Exercise 6.2.

10.3 General truncation levels

Definition 10.3.1. We define is-trunc : Z≥−2 → U → U by induction on k : Z≥−2, taking

is-trunc−2(A) :≡ is-contr(A)

is-trunck+1(A) :≡ ∏ (x,y:A)is-trunck(x = y).

For any type A, we say that A is k-truncated, or a k-type, if there is a term of type is-trunck(A).We say that a map f : A→ B is k-truncated if its fibers are k-truncated.

Theorem 10.3.2. If A is a k-type, then A is also a (k + 1)-type.

Proof. We have seen in Example 10.1.2 that contractible types are propositions. This provesthe base case. For the inductive step, note that if any k-type is also a (k + 1)-type, then any(k + 1)-type is a (k + 2)-type, since its identity types are k-types and therefore (k + 1)-types.

Theorem 10.3.3. If e : A ' B is an equivalence, and B is a k-type, then so is A.

Proof. We have seen in Exercise 8.3 that if B is contractible and e : A ' B is an equivalence, thenA is also contractible. This proves the base case.

For the inductive step, assume that the k-types are stable under equivalences, and considere : A ' B where B is a (k + 1)-type. In Theorem 9.3.2 we have seen that

ape : (x = y)→ (e(x) = e(y))

is an equivalence for any x, y. Note that e(x) = e(y) is a k-type, so by the induction hypothesis itfollows that x = y is a k-type. This proves that A is a (k + 1)-type.

Corollary 10.3.4. If f : A→ B is an embedding, and B is a (k + 1)-type, then so is A.

Page 76: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

66 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

Proof. By the assumption that f is an embedding, the action on paths

ap f : (x = y)→ ( f (x) = f (y))

is an equivalence for every x, y : A. Since B is assumed to be a (k + 1)-type, it follows thatf (x) = f (y) is a k-type for every x, y : A. Therefore we conclude by Theorem 10.3.3 that x = y isa k-type for every x, y : A. In other words, A is a (k + 1)-type.

Theorem 10.3.5. Let B be a type family over A. Then the following are equivalent:

(i) For each x : A the type B(x) is k-truncated. In this case we say that the family B is k-truncated.

(ii) The projection map

pr1 :(

∑(x:A)B(x))→ A

is k-truncated.

Proof. By Exercise 8.6 we obtain equivalences

fibpr1(x) ' B(x)

for every x : A. Therefore the claim follows from Theorem 10.3.3.

Theorem 10.3.6. Let f : A→ B be a map. The following are equivalent:

(i) The map f is (k + 1)-truncated.

(ii) For each x, y : A, the mapap f : (x = y)→ ( f (x) = f (y))

is k-truncated.

Proof. First we show that for any s, t : fib f (b) there is an equivalence

(s = t) ' fibap f (pr2(s) pr2(t)−1)

We do this by Σ-induction on s and t, and then we calculate

((x, p) = (y, q)) ' Eq-fib f ((x, p), (y, q))

≡ ∑(α:x=y)p = ap f (α) q

' ∑(α:x=y)ap f (α) q = p

' ∑(α:x=y)ap f (α) = p q−1

≡ fibap f (p q−1).

By these equivalences, it follows that if ap f is k-truncated, then for each s, t : fib f (b) the identitytype s = t is equivalent to a k-truncated type, and therefore we obtain by Theorem 10.3.3 that fis (k + 1)-truncated.

For the converse, note that we have equivalences

fibap f (p) ' ((x, p) = (y, refl f (y))).

It follows that if f is (k + 1)-truncated, then the identity type (x, p) = (y, refl f (y)) in fib f ( f (y)) isk-truncated for any p : f (x) = f (y). We conclude by Theorem 10.3.3 that the fiber fibap f (p) isk-truncated.

Page 77: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

10. EXERCISES 67

Corollary 10.3.7. A map is an embedding if and only if its fibers are propositions.

Corollary 10.3.8. A type family B over A is a subtype if and only if the projection map

pr1 :(

∑(x:A)B(x))→ A

is an embedding.

Theorem 10.3.9. Let f : ∏ (x:A)B(x)→ C(x) be a family of maps. Then the following are equivalent:

(i) For each x : A the map f (x) is k-truncated.

(ii) The induced map

tot( f ) :(

∑(x:A)B(x))→(

∑(x:A)C(x))

is k-truncated.

Proof. This follows directly from Lemma 9.1.2 and Theorem 10.3.3.

Exercises

10.1 (a) Show that succN : N→N is an embedding.(b) Show that n 7→ m + n is an embedding, for each m : N. Moreover, conclude that there

is an equivalencefibaddN(m)(n) ' (m ≤ n).

(c) Show that n 7→ mn is an embedding, for each m > 0 in N. Conclude that thedivisibility relation

d | n

is a proposition for each d, n : N such that d > 0.10.2 Let A be a type, and let the diagonal of A be the map δA : A→ A× A given by λx. (x, x).

(a) Show thatis-equiv(δA)↔ is-prop(A).

(b) Construct an equivalence fibδA((x, y)) ' (x = y) for any x, y : A.(c) Show that A is (k + 1)-truncated if and only if δA : A→ A× A is k-truncated.

10.3 (a) Let B be a type family over A. Show that if A is a k-type, and B(x) is a k-type for eachx : A, then so is ∑(x:A) B(x). Conclude that for any two k-types A and B, the typeA× B is also a k-type. Hint: for the base case, use Exercises 8.3 and 8.5.

(b) Show that for any k-type A, the identity types of A are also k-types.(c) Show that any maps f : A→ B between k-types A and B is a k-truncated map.(d) Use Exercise 8.6 to show that for any type family B : A→ U , if A and ∑(x:A) B(x) are

k-types, then so is B(x) for each x : A.10.4 Show that 2 is a set by applying Theorem 10.2.3 with the observational equality on 2

defined in Exercise 6.5.10.5 Show that for any two (k + 2)-types A and B, the disjoint sum A + B is again a (k + 2)-type.

Conclude that Z is a set.10.6 Use Exercises 8.2 and 7.8 to show that if A is a retract of a k-type B, then A is also a k-type.10.7 Show that a type A is a (k + 1)-type if and only if the map constx : 1 → A is k-truncated

for every x : A.

Page 78: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

68 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

10.8 Consider a commuting triangle

A B

X

h

f g

with H : f ∼ g h, and suppose that g is k-truncated. Show that f is k-truncated if andonly if h is k-truncated.

11 Elementary number theory

One of the things type theory is great for, is for the formalization of mathematics in a computerproof assistant. Those are programs that can compile any type theoretical construction to checkthat this construction indeed has the type it was claimed it has.

At this point in our development of type theory there are two areas of mathematics thatwould be natural to try to do in type theory: discrete mathematics and elementary numbertheory. Indeed, how does one define in type theory the greatest common divisor of two naturalnumbers, or how does one show that there are infinitely many primes? How does one evenformalize that every non-empty subset of the natural numbers has a least element?

To answer these questions we will run into questions of decidability. How do we write a termthat decides wheter a number is prime or not? Or indeed, is it even true that every non-emptysubset of the natural numbers has a least element? What about the subset of N that contains 1,and it contains 0 if and only if Goldbach’s conjecture holds? Finding the least element of thissubset is equivalent to settling the conjecture!

Therefore, we will prove the well-foundedness of the natural numbers for decidable subsetsof N. In fact, we will show it for decidable families, because sometimes we don’t know inadvance whether a family of types is in fact a subtype. A consequence of involving decidabilityin the well-foundedness of the natural numbers is that for many properties one has to prove thatthey are decidable. Luckily this is the case: many of the familiar properties that one encountersin number theory are indeed decidable.

11.1 Decidability

A common way of reasoning in mathematics is via a proof by contradiction: “in order to showthat P holds we show that it cannot be the case that P doesn’t hold". There are no inference rulesin type theory that allow us to obtain a term of type P from a term of type ¬¬P. However, forsome propositions P one can construct a function ¬¬P → P. The decidable propositions from aclass of such propositions P for which we can show ¬¬P→ P.

Definition 11.1.1. A type A is said to be decidable if it comes equipped with a term of type

is-decidable(A) :≡ A + ¬A.

Decidable propositions are called classical. We will write

classical-Prop :≡ ∑(P:Prop)is-decidable(P)

for the type of all classical propositions (with respect to a universe U ).

Page 79: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

11. ELEMENTARY NUMBER THEORY 69

Example 11.1.2. The types 1 and ∅ are decidable. Indeed, we have

inl(?) : is-decidable(1)

inr(id) : is-decidable(∅).

Any type A equipped with a point a : A is decidable.

Lemma 11.1.3. For each m, n : N, the types EqN(m, n), m ≤ n and m < n are decidable.

Proof. The proofs in each of the three cases is similar, so we only show that EqN(m, n) is decidablefor each m, n : N. This is done by induction on m and n. Note that the types

EqN(0N, 0N) ≡ 1

EqN(0N, succN(n)) ≡ ∅

EqN(succN(m), 0N) ≡ ∅

are all decidable. Moreover, the type EqN(succN(m), succN(n)) ≡ EqN(m, n) is decidable by theinductive hypothesis.

Typically we are mostly interested in decidability of propositions. However, we have definedthe notion of decidability for general types, because the condition on an arbitrary type that itsidentity types are decidable is of some interest. We now study such types.

Definition 11.1.4. We say that a type A has decidable equality if the identity type x = y isdecidable for every x, y : A.

Corollary 11.1.5. Equality on the natural numbers is decidable.

Proof. This follows immediately from the equivalences (m = n) ' EqN(m, n), and the fact thatEqN(m, n) is decidable.

Lemma 11.1.6. Suppose that A and B are types with decidable equality. Then the coproduct A + B alsohas decidable equality.

Proof. Our goal is to construct a dependent function

dA+B : ∏ (z,z′ :A+B)is-decidable(z = z′).

This function is constructed by coproduct induction on both z and z′, so we have four cases toconsider. Recall from Theorem 9.4.1 that we have equivalences

(inl(x) = inl(x′)) ' (x = x′)

(inl(x) = inr(y′)) ' ∅

(inr(y) = inl(x′)) ' ∅

(inr(y) = inr(y′)) ' (y = y′).

Therefore the type z = z′ is equivalent to a decidable type in each of the four cases.

Corollary 11.1.7. The type Z has decidable equality.

Page 80: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

70 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

Corollary 11.1.8. For any n : N the type Fin(n) has decidable equality.

We have already shown in Theorem 10.2.6 that the type of natural numbers is a set. In fact,any type with decidable equality is a set. This fact is known as Hedberg’s theorem. Our proof ofHedberg’s theorem might appear to be slightly complicated compared to the proof in [3]. This isdue to the fact that we haven’t introduced function extensionality yet, which is used there toobserve that ¬¬(x = y) is a proposition for any x, y : A.

Theorem 11.1.9 (Hedberg). Any type with decidable equality is a set.

Proof. Let A be a type, and let

d : ∏ (x,y:A)(x = y) + ¬(x = y).

Our proof is an application of Theorem 10.2.3. In order to construct a binary relation R, we firstconsider the type family D(x, y) : ((x = y) + ¬(x = y))→ U given by

D(x, y, inl(p)) :≡ 1

D(x, y, inr(p)) :≡ ∅.

Now we define the binary relation R : A→ (A→ U ) by

R(x, y) :≡ D(x, y, d(x, y)).

It follows that R(x, y) is a proposition for every x, y : A, since D(x, y, z) is a proposition for everyz : (x = y) + ¬(x = y).

To see that R is reflexive it suffices to construct a term of type

ρ′ : ∏ (x:A)∏ (p:(x=x)+¬(x=x))D(x, x, p)

For any x : A we define ρ′(x) by case analysis on p : (x = x) + ¬(x = x). Given p : x = x, wetake ρ′(x, inl(p)) :≡ ?. Given p : ¬(x = x), we obtain p(reflx) : ∅, so there is nothing to define inthis case. This completes the definition of ρ′.

It remains to show that R(x, y)→ (x = y) for any x, y : A. Note that it suffices to construct afunction

α : D(x, y, p)→ (x = y)

for any x, y : A and p : (x = y) + ¬(x = y). This function is constructed by case analisys on p.Given p : x = y, we simply define α(x, y, inl(p)) :≡ p. Given p : ¬(x = y) the type D(x, y, p) isempty, so there is nothing to define.

11.2 The well-ordering principle for decidable families over N

Definition 11.2.1. A family P over a type A is said to be decidable if P(x) is decidable for everyx : A. A decidable subset of a type A is a map

P : A→ classical-Prop.

Definition 11.2.2. Let P be a decidable family over N, and let n : N be a natural numberequipped with p : P(n). We say that n is a minimal P-element if it comes equipped with a termof type

is-minimalP(n, p) :≡(

∏ (m:N)P(m)→ (n ≤ m))

Page 81: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

11. ELEMENTARY NUMBER THEORY 71

Note that the type is-minimalP(n, p) doesn’t depend on p. However, it doesn’t make muchsense that n is a minimal element of P unless we already know that n is in P. Indeed, if we wouldomit the hypothesis that n is in P, it would be more accurate to say that n is a lower bound of P.The following theorem is the well-ordering principle of N.

Theorem 11.2.3. Let P be a decidable family over N. Then there is a function(∑(n:N)P(n)

)→(

∑(m:N)∑(p:P(m))is-minimalP(m, p))

.

Proof. Consider a universe U that contains P. We show by induction on n : N that there is afunction

Q(n)→(

∑(m:N)∑(p:Q(m))is-minimalQ(m, p))

for every decidable family Q : N → U . Note that we performed a swap in the order ofquantification, using the universe that contains P. This slightly strengthens the inductivehypothesis, which we will be able to exploit.

The base case is trivial, since 0N is the least natural number. For the inductive step, supposethat Q(succN(n)) holds. Note that Q(0N) is assumed to be decidable, so we proceed by caseanalysis on Q(0N) +¬Q(0N). Given q : Q(0N), it follows immediately that 0N must be minimal.In the case where ¬Q(0N), we consider the decidable subset Q′ of N given by

Q′(n) :≡ Q(succN(n)).

Since we have q : Q′(n), we obtain a minimal element in Q′ by the inductive hypothesis. Ofcourse, by the assumption that Q(0N) doesn’t hold, the minimal element of Q′ is also the minimalelement of Q.

11.3 The pigeonhole principle

The pigeonhole principle states that if we place more than n balls in n bags, then at least onebag will contain more than one ball. In this section we will give a type theoretical proof of thepigeonhole principle.

First we give a definition of a function that counts the number of elements in a decidablesubset of Fin(n).

Definition 11.3.1. Let P be a decidable subset of Fin(n). We define the number |P| : N ofelements in P.

Construction. We give the construction of |P| by induction on n : N. In the base case we notethat Fin(0N) has no elements, so we define |P| :≡ 0N.

For the inductive step, we define |P| by case analysis on P(inr(?)) + ¬P(inr(?)). Let P′ be thefamily over Fin(n) given by P′(i) :≡ P(inl(i)). In the case where P(inr(?)) holds, then we define|P| :≡ succN|P′|. In the case where P(inr(?)) doesn’t hold we define |P| :≡ |P′|.

Definition 11.3.2. For any i : Fin(succN(n)) we define a function

skip(i) : Fin(n)→ Fin(succN(n)).

Construction. The function skip(i) is defined by induction on n : N. In the base case, the function

skip(i) : Fin(0N)→ Fin(succN(0N))

Page 82: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

72 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

is defined to be the unique map out of the empty type. In the successor case we define

skip(i) : Fin(succN(n))→ Fin(succN(succN(n)))

by induction on i : Fin(succN(succN(n))). The function

skip(inl(i)) : Fin(succN(n))→ Fin(succN(succN(n)))

is a map between coproducts, so it can be defined using the functorial action of coproducts ofExercise 7.12. We take

skip(inl(i)) :≡ skip(i) + id.

The functionskip(inr(i)) : Fin(succN(n))→ Fin(succN(succN(n)))

is just the function inl.

Lemma 11.3.3. For each i : Fin(succN(n)), the function

skip(i) : Fin(n)→ Fin(succN(n))

is an embedding.

Proof. This assertion is proven by induction on n. In the base case, we note that any map outof the empty type is an embedding, by Exercise 9.1.a. In the inductive step we proceed by caseanalysis on i : Fin(succN(succN(n))). In the case of inl(i) we note that

skip(inl(i)) ≡ skip(i) + id

is the functorial action of coproducts on two embeddings. Therefore we conclude by Exer-cise 9.5.b that this map is an embedding. In the case of inr(i) we note that inl is an embedding byExercise 9.1.b.

Lemma 11.3.4. Consider a map g : Fin(m) → Fin(succN(n)). Furthermore, suppose that i :Fin(succN(n)) is not in the image of g, i.e. that ¬(fibg(i)). Then we can construct a commutingtriangle

Fin(n)

Fin(m) Fin(succN(n)).

skip(i)

g

f

Finally, we prove the pigeonhole principle.

Theorem 11.3.5. For any m, n : N and any function f : Fin(m)→ Fin(n), if m > n, then there is ani : Fin(n) which is in the image of more than one point in Fin(m).

Proof. The pigeonhole principle is proven by induction on m, n : N. In the base case for m there isnothing to show because m > n is empty. For the inductive step on m and the base case for n, wenote that Fin(succN(m)) ≡ Fin(m)+ 1 and Fin(0N) ≡ ∅. Therefore f : Fin(succN(m))→ Fin(0N)is a function from a pointed type to the empty type, which gives us a contradiction.

It remains to give the inductive step for n. Let i :≡ f (inr(?)) : Fin(succN(n)). Since theordering relation < on N is decidable, we can decide whether i is in the image of more than onepoint in Fin(m) by deciding whether or not 1 < |P| holds for

P(j) :≡ ( f (j) = i)

Page 83: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

11. ELEMENTARY NUMBER THEORY 73

If this is the case, this completes the proof.Now suppose that 1 6< |P|. Since P(inr(?)) holds it follows that |P| = 1. Now we observe

that i is not in the image of f inl. Therefore we obtain a commuting square

Fin(m) Fin(n)

Fin(succN(m)) Fin(succN(n)).

f ′

inl skip(i)

f

Note that the induction hypothesis the pigeonhole principle applies to the function f ′ :Fin(m)→ Fin(n). Since m > n it follows that there is an element j : Fin(n) that is in the image off ′ of more than one element of Fin(m). Now we observe that there is an equivalence

fib f ′(j) ' fib f (skip(i, j))

because both the left and right maps in the commuting square are embeddings. Therefore weconclude that skip(i, j) is in the image of f of more than one element of Fin(succN(m)).

Corollary 11.3.6. Given m > n, no function Fin(m)→ Fin(n) is an embedding.

It is straightforward to see that the statements of Theorem 11.3.5 and Corollary 11.3.6 areequivalent, and one might argue that the statement of Corollary 11.3.6 is the more ‘type theoreticalway’ of phrasing the pigeonhole principle. However, the relation to counting the number ofpoints that get mapped to

Theorem 11.3.7. For any m, n : N and any function f : Fin(m)→ Fin(n), if m > kn for some k : N,then there is an i : Fin(n) which is in the image of more than k points in Fin(m).

11.4 Defining the greatest common divisor

Lemma 11.4.1. For any d, n : N, the type d | n is decidable.

Proof. We give the proof by case analysis on (d = 0N) + (d 6= 0N). If d = 0N, then d | n holds ifand only if 0N = n, which is decidable.

If d 6= 0N, then it follows that n ≤ nd. Therefore we obtain by the well-ordering principleof the natural numbers a minimal m : N that satisfies the decidable property n ≤ md. Now weobserve that d | n holds if and only if n = md, which is decidable.

Definition 11.4.2. A type family P over N is said to be bounded from above by m for somenatural number m, if it comes equipped with a term of type

is-boundedm(P) :≡ ∏ (n:N)P(n)→ (n ≤ m).

Definition 11.4.3. Let P be a type family over N, and consider p : P(n). We say that n is themaximal P-number if it comes equipped with a term of type

is-maximalP(n, p) :≡ ∏ (m:N)P(m)→ m ≤ n.

In the following lemma we show that if a decidable family P is bounded from above andinhabited, then it possesses a maximal element.

Page 84: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

74 CHAPTER II. BASIC CONCEPTS OF TYPE THEORY

Lemma 11.4.4. Consider a decidable type family P over N which is bounded from above by m. Thenthere is a function

maximumP :(

∑(n:N)P(n))→(

∑(n:N)∑(p:P(n))is-maximalP(n, p))

.

Proof. We define the asserted function by induction on m. In the base case, if we have p : P(n),then it follows from n ≤ 0 that n = 0. It follows by the boundedness of P that (n, p) is maximal.

In the inductive step we proceed by case analysis on P(succN(m)). This is allowed becauseP is decidable. If we have q : P(succN(m)), then it follows by the boundedness of P that(succN(m), q) is maximal. If ¬P(succN(m)), then it follows that P is bounded by m, which allowsus to proceed by recursion.

Definition 11.4.5. For any two natural numbers m, n we define the greatest common divisorgcd(m, n), which satisfies the following two properties:

(i) We have both gcd(m, n) | m and gcd(m, n) | n.

(ii) For any d : N we have d | gcd(m, n) if and only if both d | m and d | n hold.

Construction. Consider the type family P(d) :≡ (d | m)× (d | n). Then P is bounded from aboveby m. Moreover, P(1) holds since 1 | n for any natural number n. Furthermore, the divisibilityrelation is decidable, so it follows that P is a family of decidable types. Now the greatest commondivisor is defined as the maximal P-element, which is obtained by Lemma 11.4.4

11.5 The trial division primality test

Theorem 11.5.1. For any n : N, the proposition is-prime(n) is decidable.

It is important to note that, even when we prove that a type such as is-prime(n) is decidable,it is only after we evaluate the proof term that we know whether the type under considerationhas a term or not. In other words, for any given n we don’t know right away whether it is primeor not. Evaluating whether n is prime can be computationally costly, so it may be desirable inany specific situation to give a separate mathematical argument that decides whether or not thenumber is prime.

11.6 Prime decomposition

We will show now that any natural number n > 0 can be written as a product of primes

n = pk11 · · · p

kmm

This prime decomposition is unique if we require that the primes pi < pi+1 for each 0 < i < m.In order to establish these facts in type theory, we first have to define finite products.

11.7 The infinitude of primes

Theorem 11.7.1. There are infinitely many primes.

Proof. We will show that for every n : N there is a prime number that is larger than n. In otherwords, we will construct a term of type

∏ (n:N)∑(p:N)is-prime(p)× (n ≤ p).

Page 85: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

11. EXERCISES 75

Note that the number n! + 1 is relatively prime to any number m ≤ n. Therefore the primes in itsprime factorization must all be larger than n. Thus, the function that assigns to n the least primefactor of n! + 1 shows that for any n : N there is a prime number p that is larger than n.

Corollary 11.7.2. There is a function

prime : N→ ∑(p:N)is-prime(p)

that sends n to the n-th prime. This function is strictly monotone, so it is an embedding.

Exercises

11.1 Show that for any f : Fin(m)→ Fin(n) and any i : Fin(n), the type fib f (i) is decidable.11.2 Consider a decidable type P(i) indexed by i : Fin(n).

(a) Show that the type∏ (i:Fin(n))P(i)

is decidable.(b) Show that the type

∑(i:Fin(n))P(i)

is decidable.

11.3 (a) Show that N and 2 have decidable equality. Hint: to show that N has decidableequality, show first that the successor function is injective.

(b) Show that if A and B have decidable equality, then so do A + B and A× B. Concludethat Z has decidable equality.

(c) Show that if A is a retract of a type B with decidable equality, then A also has decidableequality.

11.4 Define the prime-counting function π : N→N.11.5 (The Cantor-Schröder-Bernstein theorem) Let X and Y be two sets with decidable equality,

and consider two maps f : X → Y and g : Y → X, both of which we assume to be injective.Construct an equivalence X ' Y.

11.6 For any k : Z, define a function i 7→ i + k mod n of type Fin(n)→ Fin(n). Show that thisfunction is an equivalence.

11.7 For any k : Z, define a function i 7→ i · k mod n of type Fin(n) → Fin(n). Show that thisfunction is an equivalence if and only if gcd(n, k) = 1.

11.8 Show thatn

∑i=0

(n− i

i

)= Fn+1

11.9 Show that if 2n − 1 is prime, then n is prime.11.10 Prove Fermat’s little theorem.

Page 86: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the
Page 87: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

Chapter III

Univalent mathematics

12 Function extensionality

12.1 Equivalent forms of function extensionality

Definition 12.1.1. The axiom of function extensionality asserts that for any type family B overA, and any two dependent functions f , g : ∏ (x:A)B(x), the canonical map

htpy-eq : ( f = g)→ ( f ∼ g)

that sends refl f to htpy-refl f is an equivalence. We will write eq-htpy for its inverse, if it is assumedto exist.

In other words, the axiom of function extensionality asserts that for any two dependent func-tions f , g : ∏ (x:A)B(x), the type of identifications f = g is equivalent to the type of homotopiesf ∼ g from f to g. By the fundamental theorem of identity types (Theorem 9.2.2) there are threeequivalent ways of asserting function extensionality. In the following theorem we state onefurther equivalent condition.

Theorem 12.1.2. The following are equivalent:

(i) The axiom of function extensionality.

(ii) For any type family B over A and any dependent function f : ∏ (x:A)B(x), the total space

∑(g:∏ (x:A)B(x)) f ∼ g

is contractible.

(iii) The principle of homotopy induction: for any type family B over A, any dependent functionf : ∏ (x:A)B(x), and any family of types P(g, H) indexed by g : ∏ (x:A)B(x) and H : f ∼ g, theevaluation function (

∏ (g:∏ (x:A)B(x))∏ (H: f∼g)P(g, H))→ P( f , htpy-refl f )

given by s 7→ s( f , htpy-refl f ) has a section.

(iv) The weak function extensionality principle holds: For every type family B over A one has(∏ (x:A)is-contr(B(x))

)→ is-contr

(∏ (x:A)B(x)

).

77

Page 88: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

78 CHAPTER III. UNIVALENT MATHEMATICS

Proof. The fact that function extensionality is equivalent to (ii) and (iii) follows directly fromTheorem 9.2.2.

To show that function extensionality implies weak function extensionality, suppose that eachB(a) is contractible with center of contraction c(a) and contraction Ca : ∏ (y:B(a))c(a) = y. Thenwe take c :≡ λa. c(a) to be the center of contraction of ∏ (x:A)B(x). To construct the contractionwe have to define a term of type

∏ ( f :∏ (x:A)B(x))c = f .

Let f : ∏ (x:A)B(x). By function extensionality we have a map (c ∼ f )→ (c = f ), so it suffices toconstruct a term of type c ∼ f . Here we take λa. Ca( f (a)). This completes the proof that functionextensionality implies weak function extensionality.

In the remaining part of the proof, we will show that weak function extensionality impliesthat the type

∑(g:∏ (x:A)B(x)) f ∼ g

is contractible for any f : ∏ (x:A)B(x). In order to do this, we first note that we have a section-retraction pair(

∑(g:∏ (x:A)B(x)) f ∼ g) (

∏ (x:A) ∑(b:B(x)) f (x) = b) (

∑(g:∏ (x:A)B(x)) f ∼ g)

.i r

Here we have the functions

i :≡ λ(g, H). λx. (g(x), H(x))

r :≡ λp. (λx. pr1(p(x)), λx. pr2(p(x))).

Their composite is homotopic to the identity function by the computation rule for Σ-types andthe η-rule for Π-types:

r(i(g, H)) ≡ r(λx. (g(x), H(x)))

≡ (λx. g(x), λx. H(x))

≡ (g, H).

Now we observe that the type ∏ (x:A) ∑(b:B(x)) f (x) = b is a product of contractible types, soit is contractible by our assumption of the weak function extensionality principle. The claimtherefore follows, since retracts of contractible types are contractible by Exercise 8.2.

For the remainder of this chapter we will assume that the function extensionality axiom holds.In Theorem 13.2.2 we will derive function extensionality from the univalence axiom.

As a first application of the function extensionality axiom we generalize the weak functionextensionality axiom to k-types.

Theorem 12.1.3. For any type family B over A one has(∏ (x:A)is-trunck(B(x))

)→ is-trunck

(∏ (x:A)B(x)

).

Proof. The theorem is proven by induction on k ≥ −2. The base case is just the weak function ex-tensionality principle, which was shown to follow from function extensionality in Theorem 12.1.2.

For the inductive hypothesis, assume that the k-types are closed under dependent functiontypes. Assume that B is a family of (k + 1)-types. By function extensionality, the type f = g is

Page 89: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

12. FUNCTION EXTENSIONALITY 79

equivalent to f ∼ g for any two dependent functions f , g : ∏ (x:A)B(x). Now observe that f ∼ gis a dependent product of k-types, and therefore it is an k-type by our inductive hypotheses.Therefore, it follows by Theorem 10.3.3 that f = g is an k-type, and hence that ∏ (x:A)B(x) is an(k + 1)-type.

Corollary 12.1.4. Suppose B is a k-type. Then A→ B is also a k-type, for any type A.

12.2 The type theoretic principle of choice

The type theoretic principle of choice asserts that Π distributes over Σ. More precisely, it assertsthat the canonical map

choice :(

∏ (x:A)∑(y:B(x))C(x, y))→(

∑( f :∏ (x:A)B(x))∏ (x:A)C(x, f (x)))

given by λh. (pr1(h(x)), pr2(h(x))), is an equivalence. In order to see this as a principle of choice,one can view the left hand side as the type of functions h that pick for every x : A a term y : B(x)equipped with a term of type C(x, y). The function choice then constructs a dependent functionf : ∏ (x:A)B(x) equipped with a term of type ∏ (x:A)C(x, f (x)). In this section we show thatthe map choice is an equivalence, and we use this to characterize the identity of any dependentfunction type ∏ (x:A)B(x) in terms of any characterization of the identity types of the individualtypes B(x).

Theorem 12.2.1. Consider a family of types C(x, y) indexed by x : A and y : B(x). Then the map

choice :(

∏ (x:A)∑(y:B(x))C(x, y))→(

∑( f :∏ (x:A)B(x))∏ (x:A)C(x, f (x)))

given by λh. (pr1(h(x)), pr2(h(x))) is an equivalence.

Proof. We define the map

choice−1 :(

∑( f :∏ (x:A)B(x))∏ (x:A)C(x, f (x)))→(

∏ (x:A)∑(y:B(x))C(x, y))

by λ( f , g). λx. ( f (x), g(x)). Then we have to construct homotopies

choice choice−1 ∼ id, and choice−1 choice ∼ id.

For the first homotopy it suffices to construct an identification

choice(choice−1( f , g)) = ( f , g)

for any f : ∏ (x:A)B(x) and any g : ∏ (x:A)C(x, f (x)). We compute the left-hand side as follows:

choice(choice−1( f , g)) ≡ choice(λx. ( f (x), g(x)))

≡ (λx. f (x), λx. g(x)).

By the η-rule it follows that f ≡ λx. f (x) and g ≡ λx. g(x). Therefore we have the identification

refl( f ,g) : choice(choice−1( f , g)) = ( f , g).

This completes the construction of the first homotopy.

Page 90: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

80 CHAPTER III. UNIVALENT MATHEMATICS

For the second homotopy we have to construct an identification

choice−1(choice(h)) = h

for any h : ∏ (x:A) ∑(y:B(x)) C(x, y). We compute the left-hand side as follows:

choice−1(choice(h)) ≡ choice−1(λx. pr1(h(x)), (λx. pr2(h(x))))

≡ λx. (pr1(h(x)), pr2(h(x)))

However, it is not the case that (pr1(h(x)), pr2(h(x))) ≡ h(x) for any h : ∏ (x:A) ∑(y:B(x)) C(x, y).Nevertheless, we have the identification

eq-pair(refl, refl) : (pr1(h(x)), pr2(h(x))) = h(x).

Therefore we obtain the required homotopy by function extensionality:

λh. eq-htpy(λx. eq-pair(reflpr1(h(x)), reflpr2(h(x)))) : choice−1 choice ∼ id.

Corollary 12.2.2. For type A and any type family C over B, the map(∑( f :A→B)∏ (x:A)C( f (x))

)→(

A→ ∑(y:B)C(x))

given by λ( f , g). λx. ( f (x), g(x)) is an equivalence.

Remark 12.2.3. The type theoretic choice principle can be used to derive the binomial theorem.We give an informal argument of how this goes. Recall that the binomial theorem asserts that

(n + m)k =k

∑l=0

(kl

)nlmk−l

for any three natural numbers k, m, n.Consider the types A :≡ Fin(k), B :≡ Fin(n) and C :≡ Fin(m). Then we can define the type

family P : 2→ U given by

P(12) :≡ B

P(02) :≡ C.

Now, the type theoretic principle of choice gives us an equivalence(∏ (x:A)∑(t:2)P(t)

)'(

∑( f :A→2)∏ (x:A)P( f (x)))

.

Now we note that the type ( f (x) = 1) + ( f (x) = 0) is contractible for any f : A→ 2 and x : A.Therefore we have equivalences

∑( f :A→2)∏ (x:A)P( f (x)) ' ∑( f :A→2)∏ (x:A)∏ (t:( f (x)=1)+( f (x)=0))P( f (x))

' ∑( f :A→2)(fib f (1)→ B)× (fib f (0)→ C)

Now we note that, because there are (kl) ways to choose a subset of l elements of A, there are

k

∑l=0

(kl

)nlmk−l

elements in the above type.

Page 91: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

12. FUNCTION EXTENSIONALITY 81

12.3 Universal properties

The function extensionality principle allows us to prove universal properties. Universal propertiesare characterizations of all maps out of or into a given type, so they are very important. Amongother applications, universal properties characterize a type up to equivalence. In the followingtheorem we prove the universal property of dependent pair types.

Theorem 12.3.1. Let B be a type family over A, and let X be a type. Then the map

ev-pair :((

∑(x:A)B(x))→ X

)→(

∏ (x:A)(B(x)→ X))

given by f 7→ λa. λb. f (a, b) is an equivalence.

Proof. The map in the converse direction is simply

indΣ :(

∏ (x:A)(B(x)→ X))→((

∑(x:A)B(x))→ X

).

By the computation rules for Σ-types we have

λ f . refl f : ev-pair indΣ ∼ id

To show that indΣ ev-pair ∼ id we will also apply function extensionality. Thus, it suffices toshow that indΣ(λx. λy. f ((x, y))) = f . We apply function extensionality again, so it suffices toshow that

∏ (t:∑(x:A) B(x))indΣ(λx. λy. f ((x, y))

)(t) = f (t).

We obtain this homotopy by another application of Σ-induction.

Corollary 12.3.2. Let A, B, and X be types. Then the map

ev-pair : (A× B→ X)→ (A→ (B→ X))

given by f 7→ λa. λb. f ((a, b)) is an equivalence.

The universal property of identity types is sometimes called the type theoretical Yoneda lemma:families of maps out of the identity type are uniquely determined by their action on the reflexivityidentification.

Theorem 12.3.3. Let B be a type family over A, and let a : A. Then the map

ev-refl :(

∏ (x:A)(a = x)→ B(x))→ B(a)

given by λ f . f (a, refla) is an equivalence.

Proof. The inverse ϕ is defined by path induction, taking b : B(a) to the function f satisfyingf (a, refla) ≡ b. It is immediate that ev-refl ϕ ∼ id.

To see that ϕ ev-refl ∼ id, let f : ∏ (x:A)(a = x)→ B(x). To show that ϕ( f (a, refla)) = f weuse function extensionality (twice), so it suffices to show that

∏ (x:A)∏ (p:a=x)ϕ( f (a, refla), x, p) = f (x, p).

This follows by path induction on p, since ϕ( f (a, refla), a, refla) ≡ f (a, refla).

Page 92: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

82 CHAPTER III. UNIVALENT MATHEMATICS

12.4 Composing with equivalences

We show in this section that a map f : A→ B is an equivalence if and only if for any type X theprecomposition map

– f : (B→ X)→ (A→ X)

is an equivalence. Moreover, we will show in Theorem 12.4.1 that the ‘dependent version’ of thisstatement also holds: a map f : A→ B is an equivalence if and only if for any type family P overB, the precomposition map

– f :(

∏ (y:B)P(y))→(

∏ (x:A)P( f (x)))

is an equivalence.

Theorem 12.4.1. For any map f : A→ B, the following are equivalent:

(i) f is an equivalence.

(ii) For any type family P over B the map(∏ (y:B)P(y)

)→(

∏ (x:A)P( f (x)))

given by h 7→ h f is an equivalence.

(iii) For any type X the map(B→ X)→ (A→ X)

given by g 7→ g f is an equivalence.

Proof. To show that (i) implies (ii), we first recall from Lemma 8.3.5 that any equivalence is alsocoherently invertible. Therefore f comes equipped with

g : B→ A

G : f g ∼ idB

H : g f ∼ idA

K : G · f ∼ f · H.

Then we define the inverse of – f to be the map

ϕ :(

∏ (x:A)P( f (x)))→(

∏ (y:B)P(y))

given by h 7→ λy. trP(G(y), h(g(y))).To see that ϕ is a section of – f , let h : ∏ (x:A)P( f (x)). By function extensionality it suffices

to construct a homotopy ϕ(h) f ∼ h. In other words, we have to show that

trP(G( f (x)), h(g( f (x))) = h(x)

for any x : A. Now we use the additional homotopy K from our assumption that f is coherentlyinvertible. Since we have K(x) : G( f (x)) = ap f (H(x)) it suffices to show that

trP(ap f (H(x)), hg f (x)) = h(x).

Page 93: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

12. EXERCISES 83

A simple path-induction argument yields that

trP(ap f (p)) ∼ trP f (p)

for any path p : x = y in A, so it suffices to construct an identification

trP f (H(x), hg f (x)) = h(x).

We have such an identification by apdh(H(x)).To see that ϕ is a retraction of – f , let h : ∏ (y:B)P(y). By function extensionality it suffices

to construct a homotopy ϕ(h f ) ∼ h. In other words, we have to show that

trP(G(y), h f g(y)) = h(y)

for any y : B. We have such an identification by apdh(G(y)). This completes the proof that (i)implies (ii).

Note that (iii) is an immediate consequence of (ii), since we can just choose P to be theconstant family X.

It remains to show that (iii) implies (i). Suppose that

– f : (B→ X)→ (A→ X)

is an equivalence for every type X. Then its fibers are contractible by Theorem 8.3.6. In particular,choosing X ≡ A we see that the fiber

fib– f (idA) ≡ ∑(h:B→A)h f = idA

is contractible. Thus we obtain a function h : B→ A and a homotopy H : h f ∼ idA showingthat h is a retraction of f . We will show that h is also a section of f . To see this, we use that thefiber

fib– f ( f ) ≡ ∑(i:B→B)i f = f

is contractible (choosing X ≡ B). Of course we have (idB, refl f ) in this fiber. However we claimthat there also is an identification p : ( f h) f = f , showing that ( f h, p) is in this fiber,because

( f h) f ≡ f (h f )

= f idA

≡ f

Now we conclude by the contractibility of the fiber that (idB, refl f ) = ( f h, p). In particular weobtain that idB = f h, showing that h is a section of f .

Exercises

12.1 Show that the functions

htpy-inv : ( f ∼ g)→ (g ∼ f )

htpy-concat(H) : (g ∼ h)→ ( f ∼ h)

htpy-concat′(K) : ( f ∼ g)→ ( f ∼ h)

are equivalences for every f , g, h : ∏ (x:A)B(x). Here, htpy-concat′(K) is the functiondefined by H 7→ H K.

Page 94: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

84 CHAPTER III. UNIVALENT MATHEMATICS

12.2 (a) Show that for any type A the type is-contr(A) is a proposition.(b) Show that for any type A and any k ≥ −2, the type is-trunck(A) is a proposition.

12.3 Let f : X → Y be a map. Show that the following are equivalent:

(i) f is an equivalence.

(ii) The map f – : XA → YA is an equivalence for every type A.

12.4 Let f : A→ B be a function.

(a) Show that if f is an equivalence, then the type ∑(g:B→A) f g ∼ id of sections of f iscontractible.

(b) Show that if f is an equivalence, then the type ∑(h:B→A) h f ∼ id of retractions of fis contractible.

(c) Show that is-equiv( f ) is a proposition.(d) Use Exercises 12.2 and 12.5 to show that is-equiv( f ) ' is-contr( f ).

Conclude that A ' B is a subtype of A → B, and in particular that the map pr1 : (A 'B)→ (A→ B) is an embedding.

12.5 (a) Let P and Q be propositions. Show that

(P↔ Q) ' (P ' Q).

(b) Show that P is a proposition if and only if P→ P is contractible.12.6 Show that path-split( f ) and is-coh-invertible( f ) are propositions for any map f : A → B.

Conclude that we have equivalences

is-equiv( f ) ' path-split( f ) ' is-coh-invertible( f ).

12.7 Construct for any type A an equivalence

has-inverse(idA) '(

idA ∼ idA

).

Note: We will use this fact in Exercise 16.6 to show that there are types for whichis-invertible(idA) 6' is-equiv(idA).

12.8 (a) Show that the type∏ (t:∅)P(t)

is contractible for any P : ∅→ U .(b) Show that for any type X the following are equivalent:

(i) the unique map ∅→ X is an equivalence.(ii) The type YX is contractible for any type Y.

12.9 Consider two types A and B.

(a) Show that the map

ev-inl-inr :(

∏ (t:A+B)P(t))→(

∏ (x:A)P(inl(x)))×(

∏ (y:B)P(inr(y)))

given by f 7→ ( f inl, f inr) is an equivalence.(b) Show that the following are equivalent for any type X equipped with maps i : A→ X

and j : B→ X:(i) The map ind+(i, j) : A + B→ X is an equivalence.

Page 95: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

12. EXERCISES 85

(ii) For any type Y, the map

λ f . ( f i, f j) : (X → Y)→ (A→ Y)× (B→ Y)

is an equivalence.

12.10 (a) Show that the map (∏ (t:1)P(t)

)→ P(?)

given by λ f . f (?) is an equivalence.(b) Consider a type X equipped with a point x : X. Show that the following are equivalent:

(i) The map ind1(x) : 1→ X is an equivalence (i.e., X is contractible).(ii) For any type Y the map

λ f . f (x) : (X → Y)→ Y

is an equivalence.12.11 Consider a commuting triangle

A B

X

h

f g

with H : f ∼ g h.

(a) Show that if h has a section, then sec(g) is a retract of sec( f ).(b) Show that if g has a retraction, then retr(h) is a retract of sec( f ).

12.12 Consider a family fi : Ai → Bi of k-truncated maps, indexed by i : I. Show that the map

λh. λi. fi(h(i)) :(

∏ (i:I)Ai

)→(

∏ (i:I)Bi

)is again k-truncated. Conclude that if each fi is an equivalence, then so is the above map.

12.13 Consider a map f : X → Y. Show that the following are equivalent:

(i) The map f is k-truncated.

(ii) For every type A, the postcomposition function

f – : (A→ X)→ (A→ Y)

is k-truncated.

In particular it follows that f is an embedding if and only if f – is an embedding.Hint: Show that the square

( f = g) (m f = m g)

( f ∼ g) (m f ∼ m g)

apm

htpy-eq htpy-eq

H 7→m·H

commutes, and apply Exercise 12.12.

Page 96: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

86 CHAPTER III. UNIVALENT MATHEMATICS

12.14 Consider a diagram of the formA B

Xf g

(a) Show that the type ∑(h:A→B) f ∼ g h is equivalent to the type of families of maps

∏ (x:X)fib f (x)→ fibg(x).

(b) Show that the type ∑(h:A'B) f ∼ g h is equivalent to the type of families of equiva-lences

∏ (x:X)fib f (x) ' fibg(x).12.15 Consider a diagram of the form

A B

X Y.

f g

h

Show that the type ∑(i:A→B) h f ∼ g i is equivalent to the type of families of maps

∏ (x:X)fib f (x)→ fibg(h(x)).

12.16 Let A and B be sets. Show that type type A ' B of equivalences from A to B is equivalentto the type A ∼= B of isomorphisms from A to B, i.e., the type of quadruples ( f , g, H, K)consisting of

f : A→ B

g : B→ A

H : f g = idB

K : g f = idA.

12.17 Let B be a type family over A, and consider the postcomposition function

pr1 – :(

∑(x:A)B(x))A→ AA.

Construct equivalences (∏ (x:A)B(x)

)' sec(pr1) ' fibpr1– (idA).

12.18 Suppose that A : I → U is a type family over a set I with decidable equality. Show that(∏ (i:I)is-contr(Ai)

)↔ is-contr

(∏ (i:I)Ai

).

12.19 Construct equivalences

Fin(nm) ' (Fin(m)→ Fin(n))

Fin(n!) ' (Fin(n) ' Fin(n)).

12.20 Consider a function f : A→ B, and let P be a family of types over B. Show that the map(∏ (b:B)fib f (b)→ P(b)

)→(

∏ (a:A)P( f (a)))

given by h 7→ h f (a)(a, refl f (a)) is an equivalence.

Page 97: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

13. THE UNIVALENCE AXIOM 87

13 The univalence axiom

13.1 Equivalent forms of the univalence axiom

The univalence axiom characterizes the identity type of the universe. Roughly speaking, it assertsthat equivalent types are equal. It is considered to be an extensionality principle for types.

Definition 13.1.1. The univalence axiom on a universe U is the statement that for any A : U thefamily of maps

equiv-eq : ∏ (B:U )(A = B)→ (A ' B).

that sends reflA to the identity equivalence id : A ' A is a family of equivalences. A universesatisfying the univalence axiom is referred to as a univalent universe. If U is a univalent universewe will write eq-equiv for the inverse of equiv-eq.

The following theorem is a special case of the fundamental theorem of identity types (Theo-rem 9.2.2). Subsequently we will assume that any type is contained in a univalent universe.

Theorem 13.1.2. The following are equivalent:

(i) The univalence axiom holds.

(ii) The type∑(B:U )A ' B

is contractible for each A : U .

(iii) The principle of equivalence induction holds: for every A : U and for every type family

P : ∏ (B:U )(A ' B)→ U ,

the map (∏ (B:U )∏ (e:A'B)P(B, e)

)→ P(A, idA)

given by f 7→ f (A, idA) has a section.

13.2 Univalence implies function extensionality

One of the first applications of the univalence axiom was Voevodsky’s theorem that the univa-lence axiom on a universe U implies function extensionality for types in U . The proof uses thefact that weak function extensionality implies function extensionality.

We will also make use of the following lemma. Note that this statement was also part ofExercise 12.3. That exercise is solved using function extensionality. Since our present goal is toderive function extensionality from the univalence axiom, we cannot make use of that exercise.

Lemma 13.2.1. For any equivalence e : X ' Y in a univalent universe U , and any type A, thepost-composition map

e – : (A→ X)→ (A→ Y)

is an equivalence.

Proof. The statement is obvious for the identity equivalence id : X ' X. Therefore the claimfollows by equivalence induction, which is by Theorem 13.1.2 one of the equivalent forms of theunivalence axiom.

Page 98: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

88 CHAPTER III. UNIVALENT MATHEMATICS

Theorem 13.2.2. For any universe U , the univalence axiom on U implies function extensionality on U .

Proof. Note that by Theorem 12.1.2 it suffices to show that univalence implies weak functionextensionality, where we note that Theorem 12.1.2 also holds when it is restricted to small types.

Suppose that B : A → U is a family of contractible types. Our goal is to show that theproduct ∏ (x:A)B(x) is contractible. Since each B(x) is contractible, the projection map pr1 :(

∑(x:A) B(x))→ A is an equivalence by Exercise 8.6.

Now it follows by Lemma 13.2.1 that pr1 – is an equivalence. Consequently, it follows fromTheorem 8.3.6 that the fibers of

pr1 – :(

A→ ∑(x:A)B(x))→ (A→ A)

are contractible. In particular, the fiber at idA is contractible. Therefore it suffices to show that∏ (x:A)B(x) is a retract of ∑( f :A→∑(x:A) B(x)) pr1 f = idA. In other words, we will construct

(∏ (x:A)B(x)

) (∑( f :A→∑(x:A) B(x)) pr1 f = idA

) (∏ (x:A)B(x)

),i r

and a homotopy r i ∼ id.We define the function i by

i( f ) :≡ (λx. (x, f (x)), reflid).

To see that this definition is correct, we need to know that

λx. pr1(x, f (x)) ≡ id.

This is indeed the case, by the η-rule for Π-types.Next, we define the function r. Let h : A → ∑(x:A) B(x), and let p : pr1 h = id. Then we

have the homotopy H :≡ htpy-eq(p) : pr1 h ∼ id. Then we have pr2(h(x)) : B(pr1(h(x))) andwe have the identification H(x) : pr1(h(x)) = x. Therefore we define r by

r((h, p), x) :≡ trB(H(x), pr2(h(x))).

We note that if p ≡ reflid , then H(x) ≡ reflx. In this case we have the judgmental equalityr((h, refl), x) ≡ pr2(h(x)). Thus we see that r i ≡ id by another application of the η-rule forΠ-types.

13.3 Propositional extensionality and posets

Theorem 13.3.1. Propositions satisfy propositional extensionality: for any two propositions P andQ, the canonical map

iff-eq : (P = Q)→ (P↔ Q)

that sends reflP to (id, id) is an equivalence. It follows that the type Prop of propositions in U is a set.

Note that for any P : Prop, we usually also write P for the underlying type of the propositionP. If we would be more formal about it we would have to write pr1(P) for the underlying type,since Prop is the Σ-type ∑(X:U ) is-prop(X). In the following proof it is clearer if we use the moreformal notation pr1(P) for the underlying type of a proposition P.

Page 99: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

13. THE UNIVALENCE AXIOM 89

Proof. We note that the identity type P = Q is an identity type in Prop. However, since is-prop(X)is a proposition for any type X, it follows that the map

appr1: (P = Q)→ (pr1(P) = pr1(Q))

is an equivalence. Now we observe that we have a commuting square

(P = Q) (P↔ Q)

(pr1(P) = pr1(Q)) (pr1(P) ' pr1(Q))

appr1

equiv-eq

'

Since the left, bottom, and right map are equivalences, it follows that the top map is an equiva-lence.

Definition 13.3.2. A partially ordered set (poset) is a set P equipped with a relation

– ≤ – : P→ (P→ Prop)

that is reflexive (for every x : P we have x ≤ x), transitive (for every x, y, z : P such that x ≤ yand y ≤ z we have x ≤ z), and anti-symmetric (for every x, y : P such that x ≤ y and y ≤ x wehave x = y).

Remark 13.3.3. The condition that X is a set can be omitted from the definition of a poset. Indeed,if X is any type that comes equipped with a Prop-valued ordering relation ≤ that is reflexive andanti-symmetric, then X is a set by Theorem 10.2.3.

Example 13.3.4. The type Prop is a poset, where the ordering relation is given by implication: P isless than Q if P→ Q. The fact that P→ Q is a proposition is a special case of Corollary 12.1.4.The relation P→ Q is reflexive by the identity function, and transitive by function composition.Moreover, the relation P→ Q is anti-symmetric by Theorem 13.3.1.

Example 13.3.5. The type of natural numbers comes equipped with at least two important posetstructures. The first is given by the usual ordering relation ≤, and the second is given by therelation d | n that d divides n.

Theorem 13.3.6. For any poset P and any type X, the set PX is a poset. In particular the type of subtypesof any type is a poset.

Proof. Let P be a poset with ordering ≤, and let X be a type. Then PX is a set by Corollary 12.1.4.For any f , g : X → P we define

( f ≤ g) :≡ ∏ (x:X) f (x) ≤ g(x).

Reflexivity and transitivity follow immediately from reflexivity and transitivity of the originalrelation. Moreover, by the anti-symmetry of the original relation it follows that

( f ≤ g)× (g ≤ f )→ ( f ∼ g).

Therefore we obtain an identification f = g by function extensionality. The last claim followsimmediately from the fact that a subtype of X is a map X → Prop, and the fact that Prop is aposet.

Page 100: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

90 CHAPTER III. UNIVALENT MATHEMATICS

Exercises

13.1 (a) Use the univalence axiom to show that the type ∑(A:U ) is-contr(A) of all contractibletypes in U is contractible.

(b) Use Corollaries 10.3.4 and 12.1.4 and Exercise 12.4 to show that if A and B are (k + 1)-types, then the type A ' B is also a (k + 1)-type.

(c) Use univalence to show that the universe of k-types

U≤k :≡ ∑(X:U )is-trunck(X)

is a (k + 1)-type, for any k ≥ −2.(d) Show that U≤−1 is not a proposition.(e) Show that (2 ' 2) ' 2, and conclude by the univalence axiom that the universe of

sets U≤0 is not a set.13.2 Use the univalence axiom to show that the type ∑(P:Prop) P is contractible.13.3 Let A and B be small types.

(a) Construct an equivalence

(A→ (B→ U )) '(

∑(S:U )(S→ A)× (S→ B))

(b) We say that a relation R : A → (B → U ) is functional if it comes equipped with aterm of type

is-function(R) :≡ ∏ (x:A)is-contr(

∑(y:B)R(x, y))

For any function f : A→ B, show that the graph of f

graph f : A→ (B→ U )

given by graph f (a, b) :≡ ( f (a) = b) is a functional relation from A to B.(c) Construct an equivalence(

∑(R:A→(B→U ))is-function(R))' (A→ B)

(d) Given a relation R : A→ (B→ U ) we define the opposite relation

Rop : B→ (A→ U )

by Rop(y, x) :≡ R(x, y). Construct an equivalence(∑(R:A→(B→U ))is-function(R)× is-function(Rop)

)' (A ' B).

13.4 (a) Show that is-decidable(P) is a proposition, for any proposition P.(b) Show that classical-Prop is equivalent to 2.

13.5 Recall that U∗ is the universe of pointed types.(a) For any (A, a) and (B, b) in U∗, write (A, a) '∗ (B, b) for the type of pointed equiva-

lences from A to B, i.e.,

(A, a) '∗ (B, b) :≡ ∑(e:A'B)e(a) = b.

Show that the canonical map((A, a) = (B, b)

)→((A, a) ' (B, b)

)sending refl(A,a) to the pair (id, refla), is an equivalence.

Page 101: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

14. GROUPS IN UNIVALENT MATHEMATICS 91

(b) Construct for any pointed type (X, x0) an equivalence(∑(P:X→U )P(x0)

)' ∑((A,a0):U∗)(A, a0)→∗ (X, x0).

13.6 Show that any subuniverse is closed under equivalences, i.e., show that there is a map

(X ' Y)→ (P(X)→ P(Y))

for any subuniverse P : U → Prop, and any X, Y : U .

14 Groups in univalent mathematics

In this section we demonstrate a typical way to use the univalence axiom, showing that iso-morphic groups can be identified. This is an instance of the structure identity principle, whichis described in more detail in section 9.8 of [3]. We will see that in order to establish the factthat isomorphic groups can be identified, it has to be part of the definition of a group that itsunderlying type is a set. This is an important observation: in many branches of algebra theobjects of study are set-level structures1.

14.1 Semi-groups and groups

We introduce the type of groups in two stages: first we introduce the type of semi-groups, andthen we introduce groups as semi-groups that possess further structure. It will turn out that thisfurther structure is in fact a property, and this fact will help us to prove that isomorphic groupsare equal.

Definition 14.1.1. A semi-group consists of a set G equipped with a term of type has-associative-mul(G),which is the type of pairs (µG, assocG) consisting of a binary operation

µG : G → (G → G)

and a homotopyassocG : ∏ (x,y.z:G)µG(µG(x, y), z) = µG(x, µG(y, z)).

We write Semi-Group for the type of all semi-groups in U .

Definition 14.1.2. A semi-group G is said to be unital if it comes equipped with a unit eG : Gthat satisfies the left and right unit laws

left-unitG : ∏ (y:G)µG(eG, y) = y

right-unitG : ∏ (x:G)µG(x, eG) = x.

We write is-unital(G) for the type of such triples (eG, left-unitG, right-unitG). Unital semi-groupsare also called monoids.

The unit of a semi-group is of course unique once it exists. In univalent mathematics weexpress this fact by asserting that the type is-unital(G) is a proposition for each semi-group G. Inother words, being unital is a property of semi-groups rather than structure on it. This is typicalfor univalent mathematics: we express that a structure is a property by proving that this structureis a proposition.

1A notable exception is that of categories, which are objects at truncation level 1, i.e., at the level of groupoids. We willbriefly introduce categories in §14.5. For more about categories we recommend Chapter 9 of [3].

Page 102: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

92 CHAPTER III. UNIVALENT MATHEMATICS

Lemma 14.1.3. For a semi-group G the type is-unital(G) is a proposition.

Proof. Let G be a semi-group. Note that since G is a set, it follows that the types of the leftand right unit laws are propositions. Therefore it suffices to show that any two terms e, e′ : Gsatisfying the left and right unit laws can be identified. This is easy:

e = µG(e, e′) = e′.

Definition 14.1.4. Let G be a unital semi-group. We say that G has inverses if it comes equippedwith an operation x 7→ x−1 of type G → G, satisfying the left and right inverse laws

left-invG : ∏ (x:G)µG(x−1, x) = eG

right-invG : ∏ (x:G)µG(x, x−1) = eG.

We write is-group′(G, e) for the type of such triples ((–)−1, left-invG, right-invG), and we write

is-group(G) :≡ ∑(e:is-unital(G))is-group′(G, e)

A group is a unital semi-group with inverses. We write Group for the type of all groups in U .

Lemma 14.1.5. For any semi-group G the type is-group(G) is a proposition.

Proof. We have already seen that the type is-unital(G) is a proposition. Therefore it suffices toshow that the type is-group′(G, e) is a proposition for any e : is-unital(G).

Since a semi-group G is assumed to be a set, we note that the types of the inverse laws arepropositions. Therefore it suffices to show that any two inverse operations satisfying the inverselaws are homotopic.

Let x 7→ x−1 and x 7→ x−1 be two inverse operations on a unital semi-group G, both satisfyingthe inverse laws. Then we have the following identifications

x−1 = µG(eG, x−1)

= µG(µG(x−1, x), x−1)

= µG(x−1, µG(x, x−1))

= µG(x−1, eG)

= x−1

for any x : G. Thus the two inverses of x are the same, so the claim follows.

Example 14.1.6. An important class of examples consists of loop spaces x = x of a 1-type X, forany x : X. We will write Ω(X, x) for the loop space of X at x. Since X is assumed to be a 1-type,it follows that the type Ω(X, x) is a set. Then we have

reflx : Ω(X, x)

inv : Ω(X, x)→ Ω(X, x)

concat : Ω(X, x)→ (Ω(X, x)→ Ω(X, x)),

and these operations satisfy the group laws, since the group laws are just a special case of thegroupoid laws for identity types, constructed in §5.2.

Page 103: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

14. GROUPS IN UNIVALENT MATHEMATICS 93

Example 14.1.7. The type Z of integers can be given the structure of a group, with the groupoperation being addition. The fact that Z is a set follows from Theorem 10.2.6 and Exercise 10.5.The group laws were shown in Exercise 7.11.

Example 14.1.8. Our last class of examples consists of the automorphism groups on sets. Givena set X, we define

Aut(X) :≡ (X ' X).

The group operation of Aut(X) is just composition of equivalences, and the unit of the group isthe identity function. Note however, that although function composition is strictly associativeand satisfies the unit laws strictly, composition of equivalences only satisfies the group laws upto identification because the proof that composites are equivalences is carried along.

Important special cases of the automorphism groups are the symmetric groups

Sn :≡ Aut(Fin(n)).

14.2 Homomorphisms of semi-groups and groups

Definition 14.2.1. Let G and H be semi-groups. A homomorphismhomomorphism!of semi-groups of semi-groups from G to H is a pair ( f , µ f ) consisting of a function f : G → H betweentheir underlying types, and a term

µ f : ∏ (x,y:G) f (µG(x, y)) = µH( f (x), f (y))

witnessing that f preserves the binary operation of G. We will write

hom(G, H)

for the type of all semi-group homomorphisms from G to H.

Remark 14.2.2. Since it is a property for a function to preserve the multiplication of a semi-group, it follows easily that equality of semi-group homomorphisms is equivalent to the typeof homotopies between their underlying functions. In particular, it follows that the type ofhomomorphisms of semi-groups is a set.

Remark 14.2.3. The identity homomorphism on a semi-group G is defined to be the pair consist-ing of

id : G → G

λx. λy. reflxy : ∏ (x,y:G)xy = xy.

Let f : G → H and g : H → K be semi-group homomorphisms. Then the composite functiong f : G → K is also a semi-group homomorphism, since we have the identifications

g( f (xy)) g( f (x) f (y)) g( f (x))g( f (y)).

Since the identity type of semi-group homomorphisms is equivalent to the type of homotopiesbetween semi-group homomorphisms it is easy to see that semi-group homomorphisms satisfythe laws of a category, i.e., that we have the identifications

id f = f

g id = g

Page 104: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

94 CHAPTER III. UNIVALENT MATHEMATICS

(h g) f = h (g f )

for any composable semi-group homomorphisms f , g, and h. Note, however that these equalitiesare not expected to hold judgmentally, since preservation of the semi-group operation is part ofthe data of a semi-group homomorphism.

Definition 14.2.4. Let G and H be groups. A homomorphism of groups from G to H is definedto be a semi-group homomorphism between their underlying semi-groups. We will write

hom(G, H)

for the type of all group homomorphisms from G to H.

Remark 14.2.5. Since a group homomorphism is just a semi-group homomorphism between theunderlying semi-groups, we immediately obtain the identity homomorphism, composition, andthe category laws are satisfied.

14.3 Isomorphic semi-groups are equal

Definition 14.3.1. Let h : hom(G, H) be a homomorphism of semi-groups. Then h is said to be anisomorphism if it comes equipped with a term of type is-iso(h), consisting of triples (h−1, p, q)consisting of a homomorphism h−1 : hom(H, G) of semi-groups and identifications

p : h−1 h = idG and q : h h−1 = idH

witnessing that h−1 satisfies the inverse lawsWe write G ∼= H for the type of all isomorphisms ofsemi-groups from G to H, i.e.,

G ∼= H :≡ ∑(h:hom(G,H))∑(k:hom(H,G))(k h = idG)× (h k = idH).

If f is an isomorphism, then its inverse is unique. In other words, being an isomorphism is aproperty.

Lemma 14.3.2. For any semi-group homomorphism h : hom(G, H), the type

is-iso(h)

is a proposition. It follows that the type G ∼= H is a set for any two semi-groups G and H.

Proof. Let k and k′ be two inverses of h. In Remark 14.2.2 we have observed that the type ofsemi-group homomorphisms between any two semi-groups is a set. Therefore it follows that thetypes h k = id and k h = id are propositions, so it suffices to check that k = k′. In Remark 14.2.2we also observed that the equality type k = k′ is equivalent to the type of homotopies k ∼ k′

between their underlying functions. We construct a homotopy k ∼ k′ by the usual argument:

k(y) k(h(k′(y)) k′(y).

Lemma 14.3.3. A semi-group homomorphism h : hom(G, H) is an isomorphism if and only if itsunderlying map is an equivalence. Consequently, there is an equivalence

(G ∼= H) ' ∑(e:G'H)∏ (x,y:G)e(µG(x, y)) = µH(e(x), e(y))

Page 105: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

14. GROUPS IN UNIVALENT MATHEMATICS 95

Proof. If h : hom(G, H) is an isomorphism, then the inverse semi-group homomorphism alsoprovides an inverse of the underlying map of h. Thus we obtain that h is an equivalence. Thestandard proof showing that if the underlying map f : G → H of a group homomorphism isinvertible then its inverse is again a group homomorphism also works in type theory.

Definition 14.3.4. Let G and H be a semi-groups. We define the map

iso-eq : (G = H)→ (G ∼= H)

by path induction, taking reflG to isomorphism idG.

Theorem 14.3.5. The mapiso-eq : (G = H)→ (G ∼= H)

is an equivalence for any two semi-groups G and H.

Proof. By the fundamental theorem of identity types Theorem 9.2.2 it suffices to show that thetotal space

∑(G′ :Semi-Group)G ∼= G′

is contractible. Since the type of isomorphisms from G to G′ is equivalent to the type of equiva-lences from G to G′ it suffices to show that the type

∑(G′ :Semi-Group)∑(e:G'G′)∏ (x,y:G)e(µG(x, y)) = µG′(e(x), e(y)))

is contractible2. Since Semi-Group is the Σ-type

∑(G′ :Set)has-associative-mul(G′),

it suffices to show that the types

∑(G′ :Set)G ' G′

∑(µ′ :has-associative-mul(G))∏ (x,y:G)µG(x, y) = µ′(x, y)

is contractible. The first type is contractible by the univalence axiom. The second type iscontractible by function extensionality.

Corollary 14.3.6. The type Semi-Group is a 1-type.

Proof. It is straightforward to see that the type of group isomorphisms G ∼= H is a set, for anytwo groups G and H.

2In order to show that a type of the form

∑((x,y):∑(x:A) B(x))∑(z:C(x))D(x, y, z)

is contractible, a useful strategy is to first show that the type ∑(x:A) C(x) is contractible. Once this is established, say withcenter of contraction (x0, z0), it suffices to show that the type ∑(y:B(x0))

D(x0, y, z0) is contractible.

Page 106: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

96 CHAPTER III. UNIVALENT MATHEMATICS

14.4 Isomorphic groups are equal

Analogously to the map iso-eq of semi-groups, we have a map iso-eq of groups. Note, however,that the domain of this map is now the identity type G = H of the groups G and H, so the mapsiso-eq of semi-groups and groups are not exactly the same maps.

Definition 14.4.1. Let G and H be groups. We define the map

iso-eq : (G = H)→ (G ∼= H)

by path induction, taking reflG to the identity isomorphism id : G ∼= G.

Theorem 14.4.2. For any two groups G and H, the map

iso-eq : (G = H)→ (G ∼= H)

is an equivalence.

Proof. Let G and H be groups, and write UG and UH for their underlying semi-groups, respec-tively. Then we have a commuting triangle

(G = H) (UG = UH)

(G ∼= H)

appr1

iso-eq iso-eq

Since being a group is a property of semi-groups it follows that the projection map Group →Semi-Group forgetting the unit and inverses, is an embedding. Thus the top map in this triangleis an equivalence. The map on the right is an equivalence by Theorem 14.3.5, so the claim followsby the 3-for-2 property.

Corollary 14.4.3. The type of groups is a 1-type.

14.5 Categories in univalent mathematics

In our proof of the fact that isomorphic groups are equal we have made extensive use of thenotion of group homomorphism. What we have shown, in fact, is that there is a category ofgroups which is Rezk complete in the sense that the type of isomorphisms between two objects isequivalent to the type of identifications between those objects. In this final section we brieflyintroduce the notion of Rezk complete category. There are many more examples of categories,such as the categories of rings, or modules over a ring.

Definition 14.5.1. A pre-category C consists of

(i) A type A of objects.

(ii) For every two objects x, y : A a sethom(x, y)

of morphisms from x to y.

(iii) For every object x : A an identity morphism

id : hom(x, x)

Page 107: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

14. GROUPS IN UNIVALENT MATHEMATICS 97

(iv) For every two morphisms f : hom(x, y) and g : hom(y, z), a morphism

g f : hom(x, z)

called the composition of f and g.

(v) the following terms

left-unitC : id f = f

right-unitC : g id = g

assocC : (h g) f = h (g f )

witnessing that the category laws are satisfied.

Example 14.5.2. Since the type X → Y of functions between sets is again a set, we have apre-category of sets.

Example 14.5.3. By Remarks 14.2.3 and 14.2.5 we have pre-categories of semi-groups and ofgroups.

Example 14.5.4. A pre-category satisfying the condition that every hom-set is a proposition is apreorder.

Definition 14.5.5. Given a pre-category C, a morphism f : hom(x, y) is said to be an isomor-phism if there exists a morphism g : hom(y, x) such that

g f = id

f gid.

We will write iso(x, y) for the type of all isomorphisms in C from x to y.

Remark 14.5.6. Just as in the case for semi-groups and groups, the condition that f : hom(x, y) isan isomorphism is a property of f .

Definition 14.5.7. A pre-category C is said to be Rezk-complete if the canonical map

(x = y)→ iso(x, y)

is an equivalence for any two objects x and y of C. Rezk-complete pre-categories are also calledcategories.

Example 14.5.8. The pre-category of sets is Rezk complete by the univalence axiom, so it is acategory.

Example 14.5.9. The pre-categories of semi-groups and groups are Rezk-complete. Therefore theyform categories.

Example 14.5.10. A pre-order is Rezk-complete if and only if it is anti-symmetric. In other words,a poset is precisely a category for which all the hom-sets are propositions. Thus, we see that theanti-symmetry axiom can be seen as a univalence axiom for pre-orders.

Page 108: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

98 CHAPTER III. UNIVALENT MATHEMATICS

Exercises

14.1 Let X be a set. Show that the map

equiv-eq : (X = X)→ (X ' X)

is a group isomorphism.14.2 (a) Consider a group G. Show that the function

µG : G → (G ' G)

is an injective group homomorphism.(b) Consider a pointed type A. Show that the concatenation function

concat : Ω(A)→ (Ω(A) ' Ω(A))x

is an embedding.14.3 Let f : hom(G, H) be a group homomorphism. Show that f preserves units and inverses,

i.e., show that

f (eG) = eH

f (x−1) = f (x)−1.

14.4 Give a direct proof and a proof using the univalence axiom of the fact that all semi-groupisomorphisms between unital semi-groups preserve the unit. Conclude that isomorphicmonoids are equal.

14.5 Consider a monoid M with multiplication µ : M→ (M→ M) and unit e. Write

µ :≡ fold-list(e, µ) : list(M)→ M

for the iterated multiplication operation (see Exercise 4.8). Show that the square

list(list(M)) list(M)

list(M) M

flatten-list(M)

list(µ) µ

µ

commutes.14.6 Construct the category of posets.14.7 Consider the walking isomorphism, i.e. the pre-category I given by

0 1f

f−1

satisfying f f−1 = id and f−1 f = id. Show that for any precategory C the following areequivalent:

(i) The precategory C is Rezk complete.

(ii) The precomposition functionC → Fun(I , C)

is an equivalence.

Page 109: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

15. THE CIRCLE 99

15 The circle

We have seen inductive types, in which we describe a type by its constructors and an inductionprinciple that allows us to construct sections of dependent types. Inductive types are freelygenerated by their constructors, which describe how we can construct their terms.

However, many familiar constructions in algebra involve the construction of algebras bygenerators and relations. For example, the free abelian group with two generators is describedas the group with generators x and y, and the relation xy = yx.

In this chapter we introduce higher inductive types, where we follow a similar idea: to allowin the specification of inductive types not only point constructors, but also path constructors thatgive us relations between the point constructors. The ideas behind the definition of higherinductive types are introduced by studying the simplest non-trivial example: the circle.

15.1 The induction principle of the circle

The circle is defined as a higher inductive type S1 that comes equipped with

base : S1

loop : base = base.

Just like for ordinary inductive types, the induction principle for higher inductive types providesus with a way of constructing sections of dependent types. However, we need to take the pathconstructor loop into account in the induction principle.

By applying a section f : ∏ (x:S1)P(x) to the base point of the circle, we obtain a termf (base) : P(base). Moreover, using the dependent action on paths of f of Definition 5.4.2 we alsoobtain for any dependent function f : ∏ (x:S1)P(x) a path

apd f (loop) : trP(loop, f (base)) = f (base)

in the fiber P(base).

Definition 15.1.1. Let P be a type family over the circle. The dependent action on generators isthe map

dgenS1 :(

∏ (x:S1)P(x))→(

∑(y:P(base))trP(loop, y) = y)

(15.1)

given by dgenS1( f ) :≡ ( f (base), apd f (loop)).

We now give the full specification of the circle.

Definition 15.1.2. The circle is a type S1 that comes equipped with

base : S1

loop : base = base,

and satisfies the induction principle of the circle, which provides for each type family P overS1 a map

indS1 :(

∑(y:P(base))trP(loop, y) = y)→(

∏ (x:S1)P(x))

,

and a homotopy witnessing that indS1 is a section of dgenS1

compS1 : dgenS1 indS1 ∼ id

for the computation rule.

Page 110: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

100 CHAPTER III. UNIVALENT MATHEMATICS

Remark 15.1.3. The type of identifications (y, p) = (y′, p′) in the type

∑(y:P(base))trP(loop, y) = y

is equivalent to the type of pairs (α, β) consisting of an identification α : y = y′, and anidentification β witnessing that the square

trP(loop, y) trP(loop, y′)

y y′p

aptrP(loop)(α)

p′

α

commutes. Therefore it follows from the induction principle of the circle that for any (y, p) :∑(y:P(base)) trP(loop, y) = y, there is a dependent function f : ∏ (x:S1)P(x) equipped with anidentification

α : f (base) = y,

and an identification β witnessing that the square

trP(loop, f (base)) trP(loop, y)

f (base) y

apd f (loop)

aptrP(loop)(α)

p

α

commutes.

15.2 The (dependent) universal property of the circle

Our goal is now to use the induction principle of the circle to derive the universal property ofthe circle. This universal property states that, for any type X the canonical map(

S1 → X)→(

∑(x:X)x = x)

given by f 7→ ( f (base), ap f (loop)) is an equivalence. It turns out that it is easier to prove thedependent universal property first. The dependent universal property states that for any typefamily P over the circle, the canonical map(

∏ (x:S1)P(x))→(

∑(y:P(base))trP(loop, y) = y)

given by f 7→ ( f (base), apd f (loop)) is an equivalence.

Theorem 15.2.1. For any type family P over the circle, the map(∏ (x:S1)P(x)

)→(

∑(y:P(base))trP(loop, y) = y)

given by f 7→ ( f (base), apd f (loop)) is an equivalence.

Page 111: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

15. THE CIRCLE 101

Proof. By the induction principle of the circle we know that the map has a section, i.e., we have

indS1 :(

∑(y:P(base))trP(loop, y) = y)→(

∏ (x:S1)P(x))

compS1 : dgenS1 indS1 ∼ id

Therefore it remains to construct a homotopy

indS1 dgenS1 ∼ id.

Thus, for any f : ∏ (x:S1)P(x) our task is to construct an identification

indS1(dgenS1( f )) = f .

By function extensionality it suffices to construct a homotopy

∏ (x:S1)indS1(dgenS1( f ))(x) = f (x).

We proceed by the induction principle of the circle using the family of types Eg, f (x) :≡ g(x) =f (x) indexed by x : S1, where g is the function

g :≡ indS1(dgenS1( f )).

Thus, it suffices to construct

α : g(base) = f (base)

β : trEg, f (loop, α) = α.

An argument by path induction on p yields that(apdg(p) r = aptrP(p)(q) apd f (p)

)→(

trEg, f (p, q) = r)

,

for any f , g : ∏ (x:X)P(x) and any p : x = x′, q : g(x) = f (x) and r : g(x′) = f (x′). Therefore itsuffices to construct an identification α : g(base) = f (base) equipped with an identification βwitnessing that the square

trP(loop, g(base)) trP(loop, f (base))

g(base) f (base)”

apdg(loop)

aptrP(loop)(α)

apd f (loop)

α

commutes. Notice that we get exactly such a pair (α, β) from the computation rule of the circle,by Remark 15.1.3.

As a corollary we obtain the following uniqueness principle for dependent functions definedby the induction principle of the circle.

Corollary 15.2.2. Consider a type family P over the circle, and let

y : P(base)

Page 112: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

102 CHAPTER III. UNIVALENT MATHEMATICS

p : trP(loop, y) = y.

Then the type of functions f : ∏ (x:S1)P(x) equipped with an identification

α : f (base) = y

and an identification β witnessing that the square

trP(loop, f (base)) trP(loop, y)

f (base) y

apd f (loop)

aptrP(loop)(α)

p

α

commutes, is contractible.

Now we use the dependent universal property to derive the ordinary universal property ofthe circle. It would be tempting to say that it is a direct corollary, but we need to address thetransport that occurs in the dependent universal property.

Theorem 15.2.3. For each type X, the action on generators

genS1 : (S1 → X)→ ∑(x:X)x = x

given by f 7→ ( f (base), ap f (loop)) is an equivalence.

Proof. We prove the claim by constructing a commuting triangle

(S1 → X)

(∑(x:X) x = x

) (∑(x:X) trconstX (loop, x) = x

)genS1 dgenS1

'

in which the bottom map is an equivalence. Indeed, once we have such a triangle, we use thefact from Theorem 15.2.1 that dgenS1 is an equivalence to conclude that genS1 is an equivalence.

To construct the bottom map, we first observe that for any constant type family constB over atype A, any p : a = a′ in A, and any b : B, there is an identification

tr-constB(p, b) = b.

This identification is easily constructed by path induction on p. Now we construct the bottommap as the induced map on total spaces of the family of maps

l 7→ tr-constX(loop, x) l,

indexed by x : X. Since concatenating by a path is an equivalence, it follows by Theorem 9.1.3that the induced map on total spaces is indeed an equivalence.

To show that the triangle commutes, it suffices to construct for any f : S1 → X an identifica-tion witnessing that the triangle

trconstX (loop, f (base)) f (base)

f (base)apd f (loop)

tr-constX(loop, f (base))

ap f (loop)

Page 113: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

15. THE CIRCLE 103

commutes. This again follows from general considerations: for any f : A→ B and any p : a = a′

in A, the triangle

trconstB(p, f (a)) f (a)

f (a′)apd f (p)

tr-constB(p, f (a))

ap f (p)

commutes by path induction on p.

Corollary 15.2.4. For any loop l : x = x in a type X, the type of maps f : S1 → X equipped with anidentification

α : f (base) = x

and an identification β witnessing that the square

f (base) x

f (base) x

α

ap f (loop) l

α

commutes, is contractible.

15.3 Multiplication on the circle

One way the circle arises classically, is as the set of complex numbers at distance 1 from theorigin. It is an elementary fact that |xy| = |x||y| for any two complex numbers x, y ∈ C, so itfollows that when we multiply two complex numbers that both lie on the unit circle, then theresult lies again on the unit circle. Thus, using complex multiplication we see that there is amultiplication operation on the circle. And there is a shadow of this operation in type theory,even though our circle arises in a very different way!

Definition 15.3.1. We define a binary operation

mulS1 : S1 → (S1 → S1).

Construction. Using the universal property of the circle, we define mulS1 as the unique mapS1 → (S1 → S1) equipped with an identification

base-mulS1 : mulS1(base) = id

and an identification loop-mulS1 witnessing that the square

mulS1(base) id

mulS1(base) id

base-mulS1

apmulS1

(loop) eq-htpy(H)

base-mulS1

commutes. Note that in this square we have a homotopy H : id ∼ id, which is not yet defined.We use the dependent universal property of the circle with respect to the family Eid,id given by

Eid,id(x) :≡ (x = x),

Page 114: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

104 CHAPTER III. UNIVALENT MATHEMATICS

to define H as the unique homotopy equipped with an identification

α : H(base) = loop

and an identification β witnessing that the square

trEid ,id (loop, H(base)) trEid ,id (loop, loop)

H(base) loop

aptrEid ,id(loop)(α)

apdH(loop) γ

α

commutes. Now it remains to define the path γ : trEid ,id (loop, loop) = loop in the above square.To proceed, we first observe that a simple path induction argument yields a function(

p r = q p)→(

trEid ,id (p, q) = r)

,

for any p : base = x, q : base = base and r : x = x. In particular, we have a function(loop loop = loop loop

)→(

trEid ,id (loop, loop) = loop)

.

Now we apply this function to reflloop loop to obtain the desired identification

γ : trEid ,id (loop, loop) = loop.

Remark 15.3.2. In the definition of H : id ∼ id above, it is important that we didn’t choose H tobe htpy-refl. If we had done so, the resulting operation would be homotopic to x, y 7→ y, whichis clearly not what we had in mind with the multiplication operation on the circle. See alsoExercise 15.2.

The left unit law mulS1(base, x) = x holds by the computation rule of the universal property.More precisely, we define

left-unitS1 :≡ htpy-eq(base-mulS1).

For the right unit law, however, we need to give a separate argument that is surprisingly involved,because all the aspects of the definition of mulS1 will come out and play their part.

Theorem 15.3.3. The multiplication operation on the circle satisfies the right unit law, i.e., we have

mulS1(x, base) = x

for any x : S1.

Proof. The proof is by induction on the circle. In the base case we use the left unit law

left-unitS1(base) : mulS1(base, base) = base.

Thus, it remains to show that

trP(loop, left-unitS1(base)) = left-unitS1(base),

where P is the family over the circle given by

P(x) :≡ mulS1(x, base) = x.

Page 115: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

15. EXERCISES 105

Now we observe that there is a function(htpy-eq(apmulS1

(p))(base) r = q p)→(

trP(p, q) = r)

,

for any

p : base = x

q : mulS1(base, base) = base

r : mulS1(x, base) = x.

Thus we see that, in order to construct an identification

trP(loop, left-unitS1) = left-unitS1 ,

it suffices to show that the square

mulS1(base, base) base

mulS1(base, base) base

htpy-eq(apmulS1

(loop))(base)

left-unitS1 (base)

loop

left-unitS1 (base)

commutes. Now we note that we have an identification H(base) = loop. It is indeed at thispoint, where it is important that H is not the trivial homotopy, because now we can proceed byobserving that the above square commutes if and only if the square

mulS1(base, base) base

mulS1(base, base) base

htpy-eq(apmulS1

(loop))(base)

htpy-eq(base-mulS1 )(base)

H(base)

htpy-eq(base-mulS1 )(base)

commutes. The commutativity of this square easily follows from the identification loop-mulS1

constructed in Definition 15.3.1.

Exercises

15.1 (a) Let P : S1 → Prop be a family of propositions over the circle. Show that

P(base)→ ∏ (x:S1)P(x).

In this sense the circle is connected.(b) Show that any embedding m : S1 → S1 is an equivalence.(c) Show that for any embedding m : X → S1, there is a proposition P and an equivalence

e : X ' S1 × P for which the triangle

X S1 × P

S1

m

e

pr1

commutes. In other words, all the embeddings into the circle are of the form S1× P→S1.

Page 116: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

106 CHAPTER III. UNIVALENT MATHEMATICS

15.2 Show that for any type X and any x : X, the map

indS1(x, reflx) : S1 → X

is homotopic to the constant map constx.15.3 (a) Show that for any x : S1, both functions

mulS1(x, –) and mulS1(–, x)

are equivalences.(b) Show that the function

mulS1 : S1 → (S1 → S1)

is an embedding. Compare this fact with Exercise 14.2.(c) Show that multiplication on the circle is associative and commutative.

15.4 (a) Show that a type X is a set if and only if the map

λx. λt. x : X → (S1 → X)

is an equivalence.(b) Show that a type X is a set if and only if the map

λ f . f (base) : (S1 → X)→ X

is an equivalence.15.5 Show that the multiplicative operation on the circle is commutative, i.e. construct an

identificationmulS1(x, y) = mulS1(y, x).

for every x, y : S1.15.6 Show that the circle, equipped with the multiplicative operation mulS1 is an abelian group,

i.e. construct an inverse operation

invS1 : S1 → S1

and construct identifications

left-invS1 : mulS1(invS1(x), x) = base

right-invS1 : mulS1(x, invS1(x)) = base.

Moreover, show that the square

invS1(base) mulS1(base, invS1(base))

mulS1(invS1(base), base) base

commutes.15.7 Show that for any multiplicative operation

µ : S1 → (S1 → S1)

that satisfies the condition that µ(x, –) and µ(–, x) are equivalences for any x : S1, there isa term e : S1 such that

µ(x, y) = mulS1(x, mulS1(e, y))

for every x, y : S1, where e :≡ invS1(e) is the complex conjucation of e on S1.

Page 117: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

16. THE FUNDAMENTAL COVER OF THE CIRCLE 107

16 The fundamental cover of the circle

In this lecture we show that the loop space of the circle is equivalent to Z by constructing theuniversal cover of the circle as an application of the univalence axiom.

16.1 Families over the circle

The type of small families over S1 is just the function type S1 → U , so in fact we may usethe universal property of the circle to construct small dependent types over the circle. Bythe universal property, small type families over S1 are equivalently described as pairs (X, p)consisting of a type X : U and an identification p : X = X. This is where the univalence axiomcomes in. By the map

eq-equivX,X : (X ' X)→ (X = X)

it suffices to provide an equivalence X ' X.

Definition 16.1.1. Consider a type X and every equivalence e : X ' X. We will construct adependent type D(X, e) : S1 → U with an equivalence x 7→ xD : X ' D(X, e, base) for whichthe square

X D(X, e, base)

X D(X, e, base)

'

e trD(X,e)(loop)

'

commutes. We also write d 7→ dX for the inverse of this equivalence, so that the relations

(xD)X = x (e(x)D) = trD(X,e)(loop, xD)

(dX)D = d (trD(X,e)(d))X = e(dX)

hold.The type ∑(X:U ) X ' X is also called the type of descent data for the circle.

Construction. An easy path induction argument reveals that

equiv-eq(apP(loop)) = trP(loop)

for each dependent type P : S1 → U . Therefore we see that the triangle

(S1 → U )

∑(X:U ) X = X ∑(X:U ) X ' X

genS1 descS1

tot(λX. equiv-eqX,X)

commutes, where the map descS1 is given by P 7→ (P(base), trP(loop)) and the bottom map is anequivalence by the univalence axiom and Theorem 9.1.3. Now it follows by the 3-for-2 propertythat descS1 is an equivalence, since genS1 is an equivalence by Theorem 15.2.3. This means thatfor every type X and every e : X ' X there is a type family D(X, e) : S1 → U such that

(D(X, e, base), trD(X,e)(loop)) = (X, e).

Page 118: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

108 CHAPTER III. UNIVALENT MATHEMATICS

Equivalently, we have p : D(X, e, base) = X and tr(p, trD(X,e)(loop)) = e. Thus, we obtainequiv-eq(p) : D(X, e, base) ' X, for which the square

D(X, e, base) X

D(X, e, base) X

equiv-eq(p)

trD(X,e)(loop) e

equiv-eq(p)

commutes.

16.2 The fundamental cover of the circle

The fundamental cover of the circle is a family of sets over the circle with contractible total space.Classically, the fundamental cover is described as a map R→ S1 that winds the real line aroundthe circle. In homotopy type theory there is no analogue of such a construction.

Recall from Exercise 7.6 that the successor function succ : Z → Z is an equivalence. Itsinverse is the predecessor function defined in Exercise 4.4.

Definition 16.2.1. The fundamental cover of the circle is the dependent type ES1 :≡ D(Z, succ) :S1 → U .

Remark 16.2.2. The fundamental cover of the circle comes equipped with an equivalence

e : Z ' ES1(base)

and a homotopy witnessing that the square

Z ES1(base)

Z ES1(base)

e

succ trES1

(loop)

e

commutes.For convenience, we write kE for the term e(k) : ES1(base), for any k : Z.

The picture of the fundamental cover is that of a helix over the circle. This picture emergesfrom the path liftings of loop in the total space. The segments of the helix connecting k to k + 1 inthe total space of the helix, are constructed in the following lemma.

Lemma 16.2.3. For any k : Z, there is an identification

segment-helixk : (base, kE ) = (base, succ(k)E )

in the total space ∑(t:S1) E(t).

Proof. By Theorem 7.3.4 it suffices to show that

∏ (k:Z)∑(α:base=base)trE (α, kE ) = succ(k)E .

We just take α :≡ loop. Then we have trE (α, kE ) = succ(k)E by the commuting square providedin the definition of E .

Page 119: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

16. THE FUNDAMENTAL COVER OF THE CIRCLE 109

16.3 Contractibility of general total spaces

Consider a type X, a family P over X, and a term c : ∑(x:X) P(x), and suppose our goal is toconstruct a contraction

∏ (t:∑(x:X) P(x))c = t.

Of course, the first step is to apply the induction principle of Σ-types, so it suffices to construct aterm of type

∏ (x:X)∏ (y:P(x))c = (x, y).

In the case where P is the fundamental cover of the circle, we are given an equivalence e : Z 'E(base). Using this equivalence, we obtain an equivalence(

∏ (y:E(y))c = (base, y))→(

∏ (k:Z)c = (base, kE ))

.

More generally, if we are given an equivalence e : F ' P(x) for some x : X, then we have anequivalence (

∏ (y:P(x))c = (x, y))→(

∏ (y:F)c = (x, e(y)))

(16.1)

by precomposing with the equivalence e. Therefore we can construct a term of type ∏ (y:P(x))c =(x, y) by constructing a term of type ∏ (y:F)c = (x, e(y)).

Furthermore, if we consider a path p : x = x′ in X and a commuting square

F P(x)

F′ P(x′)

e

f trP(p)

e′

where e, e′, and f are all equivalences, then we obtain a function

ψ :(

∏ (y:F)c = (x, e(y)))→(

∏ (y′ :F′)c = (x, e′(y′)))

.

The function ψ is constructed as follows. Given h : ∏ (y:F)c = (x, e(y)) and y′ : F′ we have thepath h( f−1(y′)) : c = (x, e( f−1(y′))). Moreover, writing G for the homotopy f f−1 ∼ id, wehave the path

trP(p, e( f−1(y′))) e′( f ( f−1(y′))) e′(y′).H( f−1(y′)) ape′ (G(y′))

From this concatenated path we obtain the path

(x, e( f−1(y′))) (x′, e′(y′)).eq-pair(p,H( f−1(y′)) ape′ (G(y′)))

Now we define the function ψ by

h 7→ λy′. h( f−1(y′)) eq-pair(p, H( f−1(y′)) ape′(G(y′))).

Note that ψ is an equivalence, since it is given as precomposition by the equivalence f−1, followedby postcomposition by concatenation, which is also an equivalence. Now we state the maintechnical result of this section, which will help us prove the contractibility of the total space of thefundamental cover of the circle by computing transport in the family x 7→ ∏ (y:P(x))c = (x, y).

Page 120: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

110 CHAPTER III. UNIVALENT MATHEMATICS

Definition 16.3.1. Consider a path p : x = x′ in X and a commuting square

F P(x)

F′ P(x′)

e

f trP(p)

e′

with H : e′ f trP(p) e, where e, e′, and f are all equivalences. Then there is for any y : F anidentification

segment-tot(y) : (x, e(y)) = (x′, e′( f (y)))

defined as segment-tot(y) :≡ eq-pair(p, H(y)−1).

Lemma 16.3.2. Consider a path p : x = x′ in X and a commuting square

F P(x)

F′ P(x′)

e

f trP(p)

e′

with H : e′ f trP(p) e, where e, e′, and f are all equivalences. Furthermore, let

h : ∏ (y:F)c = (x, e(y))

h′ : ∏ (y′ :F′)c = (x′, e′(y′)).

Then there is an equivalence(∏ (y:F)h

′( f (y)) = h(y) segment-tot(y))'(

trC(p, ϕ(h)) = ϕ′(h′))

.

Proof. We first note that we have a commuting square

∏ (y:B(x))c = (x, y) ∏ (y:F)c = (x, e(y))

∏ (y′ :B(x′))c = (x′, y′) ∏ (y′ :F′)c = (x′, e′(y′))

–e

trC(p)

–e′

ψ

where ψ(h′) = λy. h′( f (y)) segment-tot(y)−1. All the maps in this square are equivalences. Inparticular, the inverses of the top and bottom maps are ϕ and ϕ′, respectively. The claim followsfrom this observation, but we will spell out the details.

Since any equivalence is an embedding, we see immediately that the type trC(p)(ϕ(h)) =ϕ′(h′) is equivalent to the type

ψ(trC(p)(ϕ(h)) e′) = ψ(ϕ′(h′) e′).

By the commutativity of the square, the left hand side is h. The right hand side is ψ(h′). Thereforeit follows that (

trC(p)(ϕ(h)) = ϕ′(h′))'(

h = λy. h′( f (y)) segment-tot(y)−1)

'(

h′ f ∼ (λy. h(y) segment-tot(y))

.

Page 121: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

16. THE FUNDAMENTAL COVER OF THE CIRCLE 111

Applying these observations to the fundamental cover of the circle, we obtain the followinglemma that we will use to prove that the total space of E is contractible.

Corollary 16.3.3. In order to show that the total space of E is contractible, it suffices to construct afunction

h : ∏ (k:Z)(base, 0E ) = (base, kE )

equipped with a homotopy

H : ∏ (k:Z)h(succ(k)E ) = h(k) segment-helix(k).

In the next section we establish the dependent universal property of the integers, which wewill use with Corollary 16.3.3 to show that the total space of the fundamental cover is contractible.

16.4 The dependent universal property of the integers

Lemma 16.4.1. Let B be a family over Z, equipped with a term b0 : B(0), and an equivalence

ek : B(k) ' B(succ(k))

for each k : Z. Then there is a dependent function f : ∏ (k:Z)B(k) equipped with identifications f (0) = b0and

f (succ(k)) = ek( f (k))

for any k : Z.

Proof. The map is defined using the induction principle for the integers, stated in Lemma 4.5.3.First we take

f (−1) :≡ e−1(b0)

f (0) :≡ b0

f (1) :≡ e(b0).

For the induction step on the negative integers we use

λn. e−1neg(S(n)) : ∏ (n:N)B(neg(n))→ B(neg(S(n)))

For the induction step on the positive integers we use

λn. e(pos(n)) : ∏ (n:N)B(pos(n))→ B(pos(S(n))).

The computation rules follow in a straightforward way from the computation rules of Z-induction and the fact that e−1 is an inverse of e.

Example 16.4.2. For any type A, we obtain a map f : Z→ A from any x : A and any equivalencee : A ' A, such that f (0) = x and the square

Z A

Z A

succ

f

e

f

Page 122: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

112 CHAPTER III. UNIVALENT MATHEMATICS

commutes. In particular, if we take A ≡ (x = x) for some x : X, then for any p : x = x we havethe equivalence λq. p q : (x = x)→ (x = x). This equivalence induces a map

k 7→ pk : Z→ (x = x),

for any p : x = x. This induces the degree k map on the circle

deg(k) : S1 → S1,

for any k : Z, see ??.

In the following theorem we show that the dependent function constructed in Lemma 16.4.1is unique.

Theorem 16.4.3. Consider a type family B : Z→ U equipped with b : B(0) and a family of equivalences

e : ∏ (k:Z)B(k) ' B(succ(k)).

Then the type∑( f :∏ (k:Z)B(k))( f (0) = b)×∏ (k:Z) f (succ(k)) = ek( f (k))

is contractible.

Proof. In Lemma 16.4.1 we have already constructed a term of the asserted type. Therefore itsuffices to show that any two terms of this type can be identified. Note that the type ( f , p, H) =( f ′, p′, H′) is equivalent to the type

∑(K: f∼ f ′)(K(0) = p (p′)−1)×∏ (k:Z)K(succ(k)) = (H(k) apek(K(k))) H′(k)−1.

We obtain a term of this type by applying Lemma 16.4.1 to the family C over Z given byC(k) :≡ f (k) = f ′(k), which comes equipped with a base point

p (p′)−1 : C(0),

and the family of equivalences

λ(α : f (k) = f ′(k)). (H(k) apek(α)) H′(k)−1 : ∏ (k:Z)C(k) ' C(succ(k)).

One way of phrasing the following corollary, is that Z is the ‘initial type equipped with apoint and an automorphism’.

Corollary 16.4.4. For any type X equipped with a base point x0 : X and an automorphism e : X ' X,the type

∑( f :Z→X)( f (0) = x0)× (( f succ) ∼ (e f ))

is contractible.

16.5 The identity type of the circle

Lemma 16.5.1. The total space ∑(t:S1) E(t) of the fundamental cover of S1 is contractible.

Page 123: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

16. EXERCISES 113

Proof. By Corollary 16.3.3 it suffices to construct a function

h : ∏ (k:Z)(base, 0E ) = (base, kE )

equipped with a homotopy

H : ∏ (k:Z)h(succ(k)E ) = h(k) segment-helix(k).

We obtain h and H by the elimination principle of Lemma 16.4.1. Indeed, the family P over theintegers given by P(k) :≡ (base, 0E ) = (base, kE ) comes equipped with a term refl(base,0E ) : P(0),and a family of equivalences

∏ (k:Z)P(k) ' P(succ(k))

given by k, p 7→ p segment-helix(k).

Theorem 16.5.2. The family of maps

∏ (t:S1)(base = t)→ E(t)

sending reflbase to 0E is a family of equivalences. In particular, the loop space of the circle is equivalent toZ.

Proof. This is a direct corollary of Lemma 16.5.1 and Theorem 9.2.2.

Corollary 16.5.3. The circle is a 1-type and not a 0-type.

Proof. To see that the circle is a 1-type we have to show that s = t is a 0-type for every s, t : S1.By Exercise 15.1 it suffices to show that the loop space of the circle is a 0-type. This is indeed thecase, because Z is a 0-type, and we have an equivalence (base = base) ' Z.

Furthermore, since Z is a 0-type and not a (−1)-type, it follows that the circle is a 1-type andnot a 0-type.

Exercises

16.1 Show that the mapZ→ Ω(S1)

is a group homomorphism. Conclude that the loop space Ω(S1) as a group is isomorphicto Z.

16.2 (a) Show that∏ (x:S1)¬¬(base = x).

(b) On the other hand, use the fundamental cover of the circle to show that

¬(

∏ (x:S1)base = x)

.

(c) Conclude that¬(

∏ (X:U )¬¬X → X)

for any univalent universe U containing the circle.16.3 (a) Show that for every x : X, we have an equivalence(

∑( f :S1→X) f (base) = x)' (x = x)

Page 124: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

114 CHAPTER III. UNIVALENT MATHEMATICS

(b) Show that for every t : S1, we have an equivalence(∑( f :S1→S1) f (base) = t

)' Z

The base point preserving map f : S1 → S1 corresponding to k : Z is called thedegree k map on the circle, and is denoted by deg(k).

(c) Show that for every t : S1, we have an equivalence(∑(e:S1'S1)e(base) = t

)' 2

16.4 The (twisted) double cover of the circle is defined as the type family T :≡ D(2, neg) :S1 → U , where neg : 2 ' 2 is the negation equivalence of Exercise 7.5.

(a) Show that ¬(∏ (t:S1)T (t)).(b) Construct an equivalence e : S1 ' ∑(t:S1) T (t) for which the triangle

S1 ∑(t:S1) T (t)

S1

e

deg(2) pr1

commutes.

16.5 Construct an equivalence (S1 ' S1) ' S1 + S1 for which the triangle

(S1 ' S1) (S1 + S1)

S1

'

ev-base fold

commutes. Conclude that a univalent universe containing a circle is not a 1-type.16.6 (a) Construct a family of equivalences

∏ (t:S1)

((t = t) ' Z

).

(b) Use Exercise 15.4 to show that (idS1 ∼ idS1) ' Z.(c) Use Exercise 12.7 to show that

has-inverse(idS1) ' Z,

and conclude that has-inverse(idS1) 6' is-equiv(idS1).16.7 Consider a map i : A→ S1, and assume that i has a retraction. Construct a term of type

is-contr(A) + is-equiv(i).

16.8 (a) Show that the multiplicative operation on the circle is associative, i.e. construct anidentification

assocS1(x, y, z) : mulS1(mulS1(x, y), z) = mulS1(x, mulS1(y, z))

for any x, y, z : S1.

Page 125: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

16. EXERCISES 115

(b) Show that the associator satisfies unit laws, in the sense that the following trianglescommute:

mulS1(mulS1(base, x), y) mulS1(base, mulS1(x, y))

mulS1(x, y)

mulS1(mulS1(x, base), y) mulS1(x, mulS1(base, y))

mulS1(x, y)

mulS1(mulS1(x, y), base) mulS1(x, mulS1(y, base))

mulS1(x, y).

(c) State the laws that compute

assocS1(base, base, x)

assocS1(base, x, base)

assocS1(x, base, base)

assocS1(base, base, base).

Note: the first three laws should be 3-cells and the last law should be a 4-cell. Thelaws are automatically satisfied, since the circle is a 1-type.

16.9 Construct the Mac Lane pentagon for the circle, i.e. show that the pentagon

mulS1(mulS1(mulS1(x, y), z), w) mulS1(mulS1(x, y), mulS1(z, w))

mulS1(mulS1(x, mulS1(y, z)), w) mulS1(x, mulS1(y, mulS1(z, w)))

mulS1(x, mulS1(mulS1(y, z), w))

commutes for every x, y, z, w : S1.

Page 126: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the
Page 127: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

Chapter IV

Homotopy pullbacks and pushouts

17 Homotopy pullbacks

Suppose we are given a map f : A → B, and type families P over A, and Q over B. Then anyfamily of maps

g : ∏ (x:A)P(x)→ Q( f (x))

gives rise to a commuting square

∑(x:A) P(x) ∑(y:B) Q(y)

A B

tot f (g)

pr1 pr1

f

where tot f (g) is defined as λ(x, y). ( f (x), g(x, y)). In the main theorem of this chapter we showthat g is a family of equivalences if and only if this square satisfies a certain universal property:the universal property of pullback squares.

Pullback squares are of interest because they appear in many situations. Cartesian products,fibers of maps, and substitutions can all be presented as pullbacks. Moreover, the fact that afamily of maps g : ∏ (x:A)P(x)→ Q( f (x)) is a family of equivalences if and only if it induces apullback square has the very useful corollary that a square of the form

C D

A B

p q

f

is a pullback square if and only if the induced family of maps between the fibers

∏ (x:A)fibp(x)→ fibq( f (x))

is a family of equivalences. This connection between pullbacks and fiberwise equivalences has animportant role in the descent theorem in §20.

A second reason for studying pullback squares is that the dual notion of pushouts is animportant tool to construct new types, including the n-spheres for arbitrary n. The duality ofpullbacks and pushouts makes it possible to obtain proofs of many statements about pushoutsfrom their dual statements about pullbacks.

117

Page 128: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

118 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

17.1 The universal property of pullbacks

Definition 17.1.1. A cospan consists of three types A, X, and B, and maps f : A → X andg : B→ X.

Definition 17.1.2. Consider a cospan

A X Bf g

and a type C. A cone on the cospan A → X ← B with vertex C consists of maps p : C → A,q : C → B and a homotopy H : f p ∼ g q witnessing that the square

C B

A X

q

p g

f

commutes. We writecone(C) :≡ ∑(p:C→A)∑(q:C→B) f p ∼ g q

for the type of cones with vertex C.

It is good practice to characterize the identity type of any type of importance. In the followinglemma we give a characterization of the identity type of the type cone(C) of cones on A→ X ← Bwith vertex C. Such characterizations are entirely routine in homotopy type theory.

Lemma 17.1.3. Let (p, q, H) and (p′, q′, H′) be cones on a cospan f : A → X ← B : g, both withvertex C. Then the type (p, q, H) = (p′, q′, H′) is equivalent to the type of triples (K, L, M) consisting of

K : p ∼ p′

L : q ∼ q′

and a homotopy M : H (g · L) ∼ ( f · K) H′ witnessing that the square

f p f p′

g q g q′

f ·K

H H′

g·L

of homotopies commutes.

Proof. By the fundamental theorem of identity types (Theorem 9.2.2) it suffices to show that thetype

∑((p′ ,q′ ,H′):∑(p′ :C→A) ∑(q′ :C→B) f p′∼gq′)∑(K:p∼p′)∑(L:q∼q′)H (g · L) ∼ ( f · K) H′

is contractible. Using associativity of Σ-types and commutativity of cartesian products, it is easyto show that this type is equivalent to the type

∑((p′ ,K):∑(p′ :C→A) p∼p′)∑((q′ ,L):∑(q′ :C→B) q∼q′)∑(H: f p′∼gq′)H (g · L) ∼ ( f · K) H′

Page 129: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

17. HOMOTOPY PULLBACKS 119

Now we observe that the types ∑(p′ :C→A) p ∼ p′ and ∑(q′ :C→B) q ∼ q′ are contractible, withcenters of contraction

(p, htpy-reflp) : ∑(p′ :C′→A)p ∼ p′

(q, htpy-reflq) : ∑(q′ :C′→B)q ∼ q′.

Thus we apply Exercise 8.5 to see that the type of tuples ((p′, K), (q′, L), (H′, M)) is equivalent tothe type

∑(H′ : f p′∼gq′)H htpy-reflgq ∼ htpy-refl f p H′.

Of course, the type H htpy-reflgq ∼ htpy-refl f p H′ is equivalent to the type H ∼ H′, and∑(H′ : f p∼gq) H ∼ H′ is contractible.

Given a cone with vertex C on a span Af→ X

g← B and a map h : C′ → C, we construct a newcone with vertex C′ in the following definition.

Definition 17.1.4. For any cone (p, q, H) with vertex C and any type C′, we define a map

cone-map(p, q, H) : (C′ → C)→ cone(C′)

by h 7→ (p h, q h, H h).

Definition 17.1.5. We say that a commuting square

C B

A X

q

p g

f

with H : f p ∼ g q is a pullback square, or that it is cartesian, if it satisfies the universalproperty of pullbacks, which asserts that the map

cone-map(p, q, H) : (C′ → C)→ cone(C′)

is an equivalence for every type C′.

We often indicate the universal property with a diagram as follows:

C′

C B

A X

q′

h

p′

q

p g

f

since the universal property states that for every cone (p′, q′, H′) with vertex C′, the type ofpairs (h, α) consisting of h : C′ → C equipped with α : cone-map((p, q, H), h) = (p′, q′, H′) iscontractible by Theorem 8.3.6.

As a corollary we obtain the following characterization of the universal property of pullbacks.

Page 130: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

120 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Lemma 17.1.6. Consider a commuting square

C B

A X

q

p g

f

with H : f p ∼ g q Then the following are equivalent:

(i) The square is a pullback square.

(ii) For every type C′ and every cone (p′, q′, H′) with vertex C′, the type of quadruples (h, K, L, M)consisting of a map h : C′ → C, homotopies

K : p h ∼ p′

L : q h ∼ q′,

and a homotopy M : (H · h) (g · L) ∼ ( f · K) H′ witnessing that the square

f p h f p′

g q h g q′

f ·K

H·h H′

g·L

commutes, is contractible.

Proof. The map cone-map(p, q, H) is an equivalence if and only if its fibers are contractible. ByLemma 17.1.3 it follows that the fibers of cone-map(p, q, H) are equivalent the the described typeof quadruples (h, K, L, M).

In the following lemma we establish the uniqueness of pullbacks up to equivalence via a3-for-2 property for pullbacks.

Lemma 17.1.7. Consider the squares

C B C′ B

A X A X

q

p g

q′

p′ g

f f

with homotopies H : f p ∼ g q and H′ : f p′ ∼ g q′. Furthermore, suppose we have a maph : C′ → C equipped with

K : p h ∼ p′

L : q h ∼ q′

M : (H · h) (g · L) ∼ ( f · K) H′.

Page 131: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

17. HOMOTOPY PULLBACKS 121

If any two of the following three properties hold, so does the third:

(i) C is a pullback.

(ii) C′ is a pullback.

(iii) h is an equivalence.

Proof. By the characterization of the identity type of cone(C′) given in Lemma 17.1.3 we obtainan identification

cone-map((p, q, H), h) = (p′, q′, H′)

from the triple (K, L, M). Let D be a type, and let k : D → C′ be a map. We observe that

cone-map((p, q, H), (h k)) ≡ (p (h k), q (h k), H (h k))

≡ ((p h) k, (q h) k, (H h) k)

≡ cone-map(cone-map((p, q, H), h), k)

= cone-map((p′, q′, H′), k).

Thus we see that the triangle

(D → C′) (D → C)

cone(D)

h–

cone-map(p′ ,q′ ,H′) cone-map(p,q,H)

commutes. Therefore it follows from the 3-for-2 property of equivalences established in Exer-cise 7.4, that if any two of the maps in this triangle is an equivalence, then so is the third. Now theclaim follows from the fact that h is an equivalence if and only if h – : (D → C′)→ (D → C) isan equivalence for any type D, which was established in Exercise 12.3.

Pullbacks are not only unique in the sense that any two pullbacks of the same cospan areequivalent, they are uniquely unique in the sense that the type of quadruples (h, K, L, M) as inLemma 17.1.7 is contractible.

Corollary 17.1.8. Suppose both commuting squares

C B C′ B

A X A X

q

p g

q′

p′ g

f f

with homotopies H : f p ∼ g q and H′ : f p′ ∼ g q′ are pullback squares. Then the type ofquadruples (e, K, L, M) consisting of an equivalence e : C′ ' C equipped with

K : p e ∼ p′

L : q e ∼ q′

M : (H · h) (g · L) ∼ ( f · K) H′.

is contractible.

Page 132: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

122 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Proof. We have seen that the type of quadruples (h, K, L, M) is equivalent to the fiber of cone-map(p, q, H)at (p′, q′, H′). By Lemma 17.1.7 it follows that h is an equivalence. Since is-equiv(h) is a proposi-tion by Exercise 12.4, and hence contractible as soon as it is inhabited, it follows that the type ofquadruples (e, K, L, M) is contractible.

Corollary 17.1.9. For any two maps f : A→ X and g : B→ X, and any universe U , the type

∑(C:U )∑(c:cone( f ,g,C))∏ (C′ :U )is-equiv(cone-mapC′(c))

of pullbacks in U , is a proposition.

Proof. It is straightforward to see that the type of identifications

(C, (p, q, H), u) = (C′, (p′, q′, H′), u′)

of any two pullbacks is equivalent to the type of quadruples (e, K, L, M) as in Corollary 17.1.8.Since Corollary 17.1.8 claims that this type of quadruples is contractible, the claim follows.

17.2 Canonical pullbacks

For every cospan we can construct a canonical pullback.

Definition 17.2.1. Let f : A→ X and g : B→ X be maps. Then we define

A×X B :≡ ∑(x:A)∑(y:B) f (x) = g(y)

π1 :≡ pr1 : A×X B→ A

π2 :≡ pr1 pr2 : A×X B→ B

π3 :≡ pr2 pr2 : f π1 ∼ g π2.

The type A×X B is called the canonical pullback of f and g.

Note that A×X B depends on f and g, although this dependency is not visible in the notation.

Remark 17.2.2. Given (x, y, p) and (x′, y′, p′) in the canonical pullback A×X B, the identity type(x, y, p) = (x′, y′, p′) is equivalent to the type of triples (α, β, γ) consisting of α : x = x′, β : y = y′,and an identification γ : p apg(β) = ap f (α) p′ witnessing that the square

f (x) f (x′)

g(y) g(y′)

ap f (α)

p p′

apg(β)

commutes. The proof of this fact is similar to the proof of Lemma 17.1.3.

Theorem 17.2.3. Given maps f : A→ X and g : B→ X, the commuting square

A×X B B

A X,

π2

π1 g

f

is a pullback square.

Page 133: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

17. HOMOTOPY PULLBACKS 123

Proof. Let C be a type. Our goal is to show that the map

cone-map(π1, π2, π3) : (C → A×X B)→ cone(C)

is an equivalence. Note that we have the commuting triangle

C → ∑(x:A) ∑(y:B) f (x) = g(y)

∑(p:C→A) ∏ (z:C) ∑(y:B) f (p(z)) = g(y)

∑(p:C→A) ∑(q:C→B) f p ∼ g q.

cone-map

choice

choice

In this triangle the functions choice are equivalences by Theorem 12.2.1. Therefore, their compos-ite is an equivalence.

The following corollary is now a special case of ??, where we make sure that f : A→ X andg : B→ X are both maps in U .

Corollary 17.2.4. For any two maps f : A→ X and g : B→ X in U , the type

∑(C:U )∑(c:cone( f ,g,C))∏ (C′ :U )is-equiv(cone-mapC′(c))

of pullbacks in U , is contractible.

Definition 17.2.5. Given a commuting square

C B

A X

q

p g

f

with H : f p ∼ g q, we define the gap map

gap(p, q, H) : C → A×X B

by λz. (p(z), q(z), H(z)).

The following theorem provides a useful characterization of pullback squares, because inmany situations it is easier to show that the gap map is an equivalence.

Theorem 17.2.6. Consider a commuting square

C B

A X

q

p g

f

with H : f p ∼ g q. The following are equivalent:

Page 134: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

124 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

(i) The square is a pullback square

(ii) There is a term of type

is-pullback(p, q, H) :≡ is-equiv(gap(p, q, H)).

Proof. Observe that we are in the situation of Lemma 17.1.7. Indeed, we have two commutingsquares

A×X B B C B

A X A X,

π2

π2 g

q

p g

f f

and we have the gap map gap : C → A×X B, which comes equipped with the homotopies

K : π1 gap ∼ p K :≡ λz. reflp(z)

L : π2 gap ∼ q L :≡ λz. reflq(z)

M : (π3 · gap) (g · L) ∼ ( f · K) H M :≡ λz. right-unit(H(z)).

Since A×X B is shown to be a pullback in Theorem 17.2.3, it follows from Lemma 17.1.7 that C isa pullback if and only if the gap map is an equivalence.

17.3 Cartesian products and fiberwise products as pullbacks

An important special case of pullbacks occurs when the cospan is of the form

A 1 B.

In this case, the pullback is just the cartesian product.

Lemma 17.3.1. Let A and B be types. Then the square

A× B B

A 1

pr2

pr1 const?

const?

which commutes by the homotopy constrefl?is a pullback square.

Proof. By Theorem 17.2.6 it suffices to show that

gap(pr1, pr2, λ(a, b). refl?)

is an equivalence. Its inverse is the map λ(a, b, p). (a, b).

The following generalization of Lemma 17.3.1 is the reason why pullbacks are sometimescalled fiber products.

Page 135: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

17. HOMOTOPY PULLBACKS 125

Theorem 17.3.2. Let P and Q be families over a type X. Then the square

∑(x:X) P(x)×Q(x) ∑(x:X) Q(x)

∑(x:X) P(x) X,

λ(x,(p,q)). (x,q)

λ(x,(p,q)). (x,p) pr1

pr1

which commutes by the homotopyH :≡ λ(x, (p, q)). reflx,

is a pullback square.

Proof. By Theorem 17.2.6 it suffices to show that the gap map is an equivalence. The gap map ishomotopic to the function

λ(x, (p, q)). ((x, p), (x, q), reflx).

It is easy to check that this function is an equivalence. I ts inverse is the map

λ((x, p), (y, q), α). (y, (trP(α, p), q)).

Corollary 17.3.3. For any f : A→ X and g : B→ X, the square

∑(x:X) fib f (x)× fibg(x) B

A X

λ(x,((a,p),(b,q))). b

λ(x,((a,p),(b,q))). a g

f

is a pullback square.

17.4 Fibers of maps as pullbacks

Lemma 17.4.1. For any function f : A→ B, and any b : B, consider the square

fib f (b) 1

A B

const?

pr1 constb

f

which commutes by pr2 : ∏ (t:fib f (b)) f (pr1(t)) = b. This is a pullback square.

Proof. By Theorem 17.2.6 it suffices to show that the gap map is an equivalence. The gap map ishomotopic to the function

tot(()λx. λp. (?, p))

The map λx. λp. (?, p) is a family of equivalences by Exercise 8.5, so it induces an equivalence ontotal spaces by Theorem 9.1.3.

Page 136: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

126 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Corollary 17.4.2. For any type family B over A and any a : A the square

B(a) 1

∑(x:A) B(x) A

λy. (a,y)

const?

λ?. a

pr1

is a pullback square.

Proof. To see this, note that the triangle

B(a) fibpr1(a)

(∑(x:A) B(x)

)×A 1.

λb. ((a,b),refla)

gap gap

Since the top map is an equivalence by Exercise 8.7, and the map on the right is an equivalenceby Lemma 17.4.1, it follows that the map on the left is an equivalence. The claim follows.

17.5 Families of equivalences

Lemma 17.5.1. Let f : A→ B, and let Q be a type family over B. Then the square

∑(x:A) Q( f (x)) ∑(y:B) Q(b)

A B

λ(x,q). ( f (x),q)

pr1 pr1

f

commutes by H :≡ λ(x, q). refl f (x). This is a pullback square.

Proof. By Theorem 17.2.6 it suffices to show that the gap map is an equivalence. The gap map ishomotopic to the function

λ(x, q). (x, ( f (x), q), refl f (x)).

The inverse of this map is given by λ(x, ((y, q), p)). (x, trQ(p−1, q)), and it is straightforward tosee that these maps are indeed mutual inverses.

Theorem 17.5.2. Let f : A→ B, and let g : ∏ (a:A)P(a)→ Q( f (a)) be a family of maps. The followingare equivalent:

(i) The commuting square

∑(a:A) P(a) ∑(b:B) Q(b)

A B

tot f (g)

f

is a pullback square.

Page 137: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

17. HOMOTOPY PULLBACKS 127

(ii) g is a family of equivalences.

Proof. The gap map is homotopic to the composite

∑(x:A) P(x) ∑(x:A) Q( f (x)) A×B

(∑(y:B) Q(y)

)tot(g) gap′

where gap′ is the gap map for the square in Lemma 17.5.1. Since gap′ is an equivalence, it followsby Exercise 7.4 and Theorem 9.1.3 that the gap map is an equivalence if and only if g is a familyof equivalences.

Our goal is now to extend Theorem 17.5.2 to arbitrary pullback squares. Note that everycommuting square

A B

X Y

f

h

g

i

with H : i f g h induces a map

fib-sq : ∏ (x:X)fib f (x)→ fibg( f (x))

on the fibers, byfib-sq(x, (a, p)) :≡ (h(a), H(a)−1 api(p)).

Theorem 17.5.3. Consider a commuting square

A B

X Y

f

h

g

i

with H : i f g h. The following are equivalent:

(i) The square is a pullback square.

(ii) The induced map on fibers

fib-sq : ∏ (x:X)fib f (x)→ fibg( f (x))

is a family of equivalences.

Proof. First we observe that the square

∑(x:X) fib f (x) ∑(x:X) fibg( f (x))

A X×Y B

'

tot(fib-sq)

tot(tot(inv))

gap

commutes. To construct such a homotopy, we need to construct an identification

( f (a), h(a), H(a)) = (x, h(a), (H(a)−1 api(p))−1)

Page 138: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

128 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

for every x : X, a : A, and p : f (a) = x. This is shown by path induction on p : f (a) = x. Thus, itsuffices to show that

( f (a), h(a), H(a)) = ( f (a), h(a), (H(a)−1 refli( f (a)))−1),

which is a routine exercise.Now we note that the left and right maps in this square are both equivalences. Therefore

it follows that the top map is an equivalence if and only if the bottom map is. The claim nowfollows by Theorem 9.1.3.

Corollary 17.5.4. Consider a pullback square

C B

A X.

q

p g

f

If g is a k-truncated map, then so is p. In particular, if g is an embedding then so is p.

Proof. Since the square is assumed to be a pullback square, it follows from Theorem 17.5.3that for each x : A, the fiber fibp(x) is equivalent to the fiber fibg( f (x)), which is k-truncated.Since k-truncated types are closed under equivalences by Theorem 10.3.3, it follows that p is ak-truncated map.

Corollary 17.5.5. Consider a commuting square

C B

A X.

q

p g

f

and suppose that g is an equivalence. Then the following are equivalent:

(i) The square is a pullback square.

(ii) The map p : C → A is an equivalence.

Proof. If the square is a pullback square, then by Theorem 17.5.2 the fibers of p are equivalent tothe fibers of g, which are contractible by Theorem 8.3.6. Thus it follows that p is a contractiblemap, and hence that p is an equivalence.

If p is an equivalence, then by Theorem 8.3.6 both fibp(x) and fibg( f (x)) are contractible forany x : X. It follows by Exercise 8.3 that the induced map fibp(x)→ fibg( f (x)) is an equivalence.Thus we apply Theorem 17.5.3 to conclude that the square is a pullback.

Theorem 17.5.6. Consider a diagram of the form

A B

X Y.

f g

h

Page 139: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

17. HOMOTOPY PULLBACKS 129

Then the type of triples (i, H, p) consisting of a map i : A→ B, a homotopy H : h f ∼ g i, and a termp witnessing that the square

A B

X Y.

f

i

g

h

is a pullback square, is equivalent to the type of families of equivalences

∏ (x:X)fib f (x) ' fibg(h(x)).

Corollary 17.5.7. Let h : X → Y be a map, and let P and Q be families over X and Y, respectively. Thenthe type of triples (i, H, p) consisting of a map

i :(

∑(x:X)P(x))→(

∑(y:Y)Q(y))

,

a homotopy H : h pr1 ∼ pr1 i, and a term p witnessing that the square

∑(x:X) P(x) ∑(y:Y) Q(y)

X Y.

pr1

i

pr1

h

is a pullback square, is equivalent to the type of families of equivalences

∏ (x:X)P(x) ' Q(h(x)).

One useful application of the connection between pullbacks and families of equivalences isthe following theorem, which is also called the pasting property of pullbacks.

Theorem 17.5.8. Consider a commuting diagram of the form

A B C

X Y Z

k

f

l

g h

i j

with homotopies H : i f ∼ g k and K : j g ∼ h l, and the homotopy

(j · H) (K · k) : j i f ∼ h l k

witnessing that the outer rectangle commutes. Furthermore, suppose that the square on the right is apullback square. Then the following are equivalent:

(i) The square on the left is a pullback square.

(ii) The outer rectangle is a pullback square.

Page 140: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

130 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Proof. The commutativity of the two squares and the outer rectangle induces a commutingtriangle

fib f (x) fibg(i(x))

fibh(j(i(x))).

fib-sq( f ,k,H)(x)

fib-sq f ,lk,(j·H) (K·k)(x) fib-sq(g,l,K)(i(x))

A homotopy witnessing that the triangle commutes is constructed by a routine calculation.Since the triangle commutes, and since the map fib-sq(g,l,K)(i(x)) is an equivalence for each

x : X by Theorem 17.5.3, it follows by the 3-for-2 property of equivalences that for each x : X thetop map in the triangle is an equivalence if and only if the left map is an equivalence. The claimnow follows by a second application of Theorem 17.5.3.

17.6 Descent theorems for coproducts and Σ-types

Theorem 17.6.1. Consider maps f : A′ → A and g : B′ → B, a map h : X′ → X, and commutingsquares of the form

A′ X′ B′ X′

A X B X.

f h g h

Then the following are equivalent:

(i) Both squares are pullback squares.

(ii) The commuting square

A′ + B′ X′

A + B X

f+g h

is a pullback square.

Proof. By Theorem 17.5.3 it suffices to show that the following are equivalent:

(i) For each x : A the mapfib-sq : fib f (x)→ fibh(αA(x))

is an equivalence, and for each y : B the map

fib-sq : fibg(y)→ fibh(αB(y))

is an equivalence.

(ii) For each t : A + B the map

fib-sq : fib f+g(t)→ fibh(α(t))

is an equivalence.

Page 141: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

17. HOMOTOPY PULLBACKS 131

By the dependent universal property of coproducts, the second claim is equivalent to the claimthat both for each x : A the map

fib-sq : fib f+g(inl(x))→ fibh(αA(x))

is an equivalence, and for each y : B, the map

fib-sq : fib f+g(inr(y))→ fibh(αB(y))

is an equivalence.We claim that there is a commuting triangle

fib f (x) fib f+g(inl(x))

fibh(αA(x))

for every x : A. To see that the triangle commutes, we need to construct an identificationThe top map is given by

(a′, p) 7→ (inl(a′), apinl(p)).

The triangle then commutes by the homotopy

(a′, p) 7→ eq-pair(refl,apconcat(H(a′)−1)(ap-comp[αA ,αB ],inl))

We note that the top map is an equivalence, so it follows by the 3-for-2 property of equivalencesthat the left map is an equivalence if and only if the right map is an equivalence.

Similarly, there is a commuting triangle

fibg(y) fib f+g(inr(y))

fibh(αB(y))

in which the top map is an equivalence, completing the proof.

In the following corollary we conclude that coproducts distribute over pullbacks.

Corollary 17.6.2. Consider a cospan of the form

Y

A + B X.

Then there is an equivalence

(A + B)×X Y ' (A×X Y) + (B×X Y).

Page 142: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

132 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Theorem 17.6.3. Consider a family of maps fi : A′i → Ai indexed by a type I, a map h : X′ → X, and acommuting square

A′i X′

Ai X

fi h

αi

for each i : I. Then the following are equivalent:

(i) For each i : I the square is a pullback square.

(ii) The commuting square

∑(i:I) A′i X′

∑(i:I) Ai X

tot( f ) h

α

is a pullback square.

Proof. By Theorem 17.5.3 it suffices to show that the following are equivalent for each i : I anda : Ai:

(i) The mapfib-sq : fib fi

(a)→ fibg(αi(a))

is an equivalence.

(ii) The mapfib-sq : fibtot( f )(i, a)→ fibg(αi(a))

is an equivalence.

To see this, note that we have a commuting triangle

fib fi(a) fibtot( f )(i, a)

fibg(αi(a)),

where the top map is an equivalence by Lemma 9.1.2. Therefore the claim follows by the 3-for-2property of equivalences.

In the following corollary we conclude that Σ distributes over coproducts.

Corollary 17.6.4. Consider a cospan of the form

Y

∑(i:I) Ai X.

Then there is an equivalence (∑(i:I)Ai

)×X Y ' ∑(i:I)(Ai ×X Y).

Page 143: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

17. EXERCISES 133

Exercises

17.1 (a) Show that the square

(x = y) 1

1 A

consty

constx

is a pullback square.(b) Show that the square

(x = y) A

1 A× A

constx

const? δA

const(x,y)

is a pullback square, where δA : A → A× A is the diagonal of A, defined in Exer-cise 10.2.

17.2 In this exercise we give an alternative characterization of the notion of k-truncated map,compared to Theorem 10.3.6. Given a map f : A → X define the diagonal of f to be themap δ f : A→ A×X A given by x 7→ (x, x, refl f (x)).

(a) Construct an equivalence

fibδ f ((x, y, p)) ' fibap f (p)

to show that the square

fibap f (p) A

1 A×X A

constx

const?δ f

const(x,y,p)

is a pullback square, for every x, y : A and p : f (x) = f (y).(b) Show that a map f : A→ X is (k + 1)-truncated if and only if δ f is k-truncated.

Conclude that f is an embedding if and only if δ f is an equivalence.17.3 Consider a commuting square

C B

A X

q

p g

f

with H : f p ∼ g q. Show that this square is a pullback square if and only if the square

C A

B X

p

q f

g

with H−1 : g q ∼ f p is a pullback square.

Page 144: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

134 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

17.4 Show that any square of the form

C B

∅ X

commutes and is a pullback square. This is the descent property of the empty type.17.5 Consider a commuting square

C B

A X

q

p g

f

with H : f p ∼ g q. Show that the following are equivalent:

(i) The square is a pullback square.

(ii) For every type T, the commuting square

CT BT

AT XT

q–

p– g–

f –

is a pullback square.

Note: property (ii) is really just a rephrasing of the universal property of pullbacks.17.6 Consider a commuting square

C B

A X

q

p g

f

with H : f p ∼ g q. Show that the following are equivalent:

(i) The square is a pullback square.

(ii) The square

C X

A× B X× X

gq

λx. (p(x),q(x)) δX

f×g

which commutes by λz. eq-pair(H(z), reflg(q(z))) is a pullback square.

17.7 Consider two commuting squares

C1 B1 C2 B2

A1 X1 A2 X2.

Page 145: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

18. HOMOTOPY PUSHOUTS 135

(a) Show that if both squares are pullback squares, then the square

C1 × C2 B1 × B2

A1 × A2 X1 × X2.

is also a pullback square.(b) Show that if there are terms t1 : A1 ×X1 B1 and t2 : A2 ×X2 B2, then the converse of (a)

also holds.

17.8 Consider for each i : I a pullback square

Ci Bi

Ai Xi

qi

pi gi

fi

with Hi : fi pi ∼ gi qi. Show that the commuting square

∏ (i:I)Ci ∏ (i:I)Bi

∏ (i:I)Ai ∏ (i:I)Xi

is a pullback square.

18 Homotopy pushouts

A common way in topology to construct new spaces is by attaching cells to a given space. A0-cell is just a point, an 1-cell is an interval, a 2-cell is a disc, a 3-cell is the solid ball, and soforth. Many spaces can be obtained by attaching cells. For example, the circle is obtained byattaching a 1-cell to a 0-cell, so that both end-points of the interval are mapped to the point. Moregenerally, an n-sphere is obtained by attaching an n-disc to the point, so that its entire boundarygets mapped to the point.

In type theory we can also consider a notion of n-cells. Just as in topology, a 0-cell is just apoint (i.e., a term). A 1-cell, however, is in type theory an identification, i.e., a term of the identitytype. A 1-cell is then an identification of identifications, and so forth. Then we can attach cells toa type by taking a pushout, which is a process dual to taking a pullback.

The idea of pushouts is to glue two types A and B together using a mediating type S andmaps f : S→ A and g : S→ B. In other words, we start with a diagram of the form

A S B.f g

We call such a triple S ≡ (S, f , g) a span from A to B. A span from A to B can be thought of asa relation from A to B, relating f (s) to g(s) for any s : S. The pushout of the span S is then atype X that comes equipped with inclusion maps i : A→ X and j : B→ X and a homotopy H

Page 146: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

136 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

witnessing that the square

S B

A X

f

g

j

i

Note that this homotopy makes sure that there is a path H(s) : i( f (s)) = j(g(s)) for every s : S.In other words, any x : A and y : B that are related by in S become identified in the pushout.The last requirement of the pushout is that it satisfies a universal property that is dual to theuniversal property of pullbacks.

There are several equivalent characterizations of pushouts. Two such characterizationsare studied in this section, establishing the duality between pullbacks and pushouts. Othercharacterizations, including the induction principle of pushouts, and the dependent universalproperty of pushouts, are studied in §20.

Unlike pullbacks, however, it is not automatically the case that pushouts always exist. Wewill therefore postulate as an axiom that pushouts always exist. Moreover, we will assume thatuniverses are closed under pushouts.

18.1 The universal property of pushouts

Definition 18.1.1. Consider a span S ≡ (S, f , g) from A to B, and let X be a type. A cocone withvertex X on S is a triple (i, j, H) consisting of maps i : A→ X and j : B→ X, and a homotopyH : i f ∼ j g witnessing that the square

S B

A X

g

f j

i

commutes. We write coconeS (X) for the type of cocones on S with vertex X.

Remark 18.1.2. Given two cocones (i, j, H) and (i′, j′, H′) with vertex X, the type of identifications(i, j, H) = (i′, j′, H′) in coconeS (X) is equivalent to the type of triples (K, L, M) consisting of

K : i ∼ i′

L : j ∼ j′,

and a homotopy M witnessing that the square

i f i′ f

j g j′ g

H

K· f

H′

L·g

of homotopies commutes.

Page 147: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

18. HOMOTOPY PUSHOUTS 137

Definition 18.1.3. Consider a cocone (i, j, H) with vertex X on the span S ≡ (S, f , g), as indicatedin the following commuting square

S B

A X.

g

f j

i

For every type Y, we define the map

cocone-map(i, j, H) : (X → Y)→ cocone(Y)

by h 7→ (h i, h j, h · H).

Definition 18.1.4. A commuting square

S B

A X.

g

f j

i

with H : i f ∼ j g is said to be a (homotopy) pushout square if the cocone (i, j, H) with vertexX on the span S ≡ (S, f , g) satisfies the universal property of pushouts, which asserts that themap

cocone-map(i, j, H) : (X → Y)→ cocone(Y)is an equivalence for any type Y. Sometimes pushout squares are also called cocartesian squares.

Lemma 18.1.5. Consider a pushout square

S B

A X.

g

f j

i

with H : i f ∼ j g, and consider a commuting square

S B

A X′.

g

f j′

i′

with H′ : i′ f ∼ j′ g. Then the type of maps h : X → X′ equipped with homotopies

K : h i ∼ i′

L : h j ∼ j′

and a homotopy M witnessing that the square

h i f i′ f

h j g j′ g

K· f

h·H H′

L·g

commutes, is contractible.

Page 148: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

138 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Proof. For any map h : X → X’, the type of triples (K, L, M) as in the statement of the lemma isequivalent to the type of identifications

cocone-map((i, j, H), h) = (i′, j′, H′),

by Remark 18.1.2. Therefore it follows that the type of quadruples (h, K, L, M) is equivalent to thefiber of cocone-map(i, j, H) at (i′, j′, H′). Since we have assumed that the cocone (i, j, H) satisfiesthe universal property of the pushout of S , the map cocone-map(i, j, H) is an equivalence, andtherefore it has contractible fibers by Theorem 8.3.6.

Theorem 18.1.6. Consider two cocones

S B S B

A X A X′

g

f j

g

f j′

i i′

on a span S ≡ (S, f , g), and let h : X → X′ be a map equipped with homotopies

K : h i ∼ i′

L : h j ∼ j′

and a homotopy M witnessing that the square

h i f i′ f

h j g j′ g

K· f

h·H H′

L·g

commutes. Then if any two of the following three statements hold, so does the third:

(i) The cocone (i, j, H) satisfies the universal property of the pushout of S .

(ii) The cocone (i′, j′, H′) satisfies the universal property of the pushotu of S .

(iii) The map h is an equivalence.

Proof. First we observe that we have a commuting triangle

(X′ → Y) (X → Y)

coconeS (Y)

–h

cocone-map(i′ ,j′ ,H′) cocone-map(i,j,H)

for any type Y. Therefore it follows from the 3-for-2 property of equivalences that if any two of themaps in this triangle is an equivalence, so is the third. Now the claim follows from the observationin Theorem 12.4.1 that h is an equivalence if and only if the map – h : (X′ → Y)→ (X → Y) isan equivalence for any type Y.

In the following corollary we establish the fact that pushouts are uniquely unique.

Page 149: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

18. HOMOTOPY PUSHOUTS 139

Corollary 18.1.7. Consider two pushouts

S B S B

A X A X′

g

f j

g

f j′

i i′

of a given span S ≡ (S, f , g). Then the type of equivalences e : X ' X′ equipped with homotopies

K : h i ∼ i′

L : h j ∼ j′

and a homotopy M witnessing that the square

h i f i′ f

h j g j′ g

K· f

h·H H′

L·g

commutes, is contractible.

Proof. This follows from combining Lemma 18.1.5 and Theorem 18.1.6.

Corollary 18.1.8. Consider a span

A S Bf g

in a universe U . Then the type

∑(X:U )∑(c:cocone(X))∏ (Y:U )is-equiv(cocone-mapY(c))

of is a proposition.

Proof. It is routine to verify that the type of quadruples (e, K, L, M) as in Corollary 18.1.8 isequivalent to the identity type of the type of pushouts of the span S ≡ (S, f , g). The claim thenfollows, since Corollary 18.1.8 asserts that this type of quadruples is contractible.

18.2 Suspensions

A particularly important class of examples of pushouts are suspensions.

Definition 18.2.1. Let X be a type. A suspension of X is a type ΣX equipped with a north poleN : ΣX, a south pole S : ΣX, and a meridian

merid : X → (N = S),

such that the commuting square

X 1

1 ΣX

const?

const? constS

constN

is a pushout square.

Page 150: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

140 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

We can use suspensions to present the spheres in type theory. The 2-sphere is a space which,like the surface of the earth, has a north pole and a south pole. Moreover, for each point of theequator there is a meridian that connects the north pole to the south pool. Of course, the equatoris a circle, so we see that the 2-sphere is just the suspension of the circle.

Similarly we can see that the (n + 1)-sphere must be the suspension of the n-sphere. The(n + 1)-sphere is the unit sphere in the vector space Rn+2. This vector space has an orthogonalbasis e1, . . . , en+2. Then the north and the south pole are given by en+2 and −en+2, respectively,and for each unit vector in Rn+1 ⊆ Rn+2 we have a meridian connecting the north pole with thesouth pole. The unit sphere in Rn+1 is of course the n-sphere, so we see that the (n + 1)-spheremust be a suspension of the n-sphere.

These observations suggest that we can define the spheres by recursion on n. Note that thespheres in type theory are defined entirely synthetically, i.e., without reference to the ambienttopological space Rn+1. Indeed, from a homotopical point of view each space Rn is contractible,so in type theory it is just presented as the unit type1.

Definition 18.2.2. We define the n-sphere Sn for any n : N by induction on n, by taking

S0 :≡ 2

Sn+1 :≡ ΣSn.

Remark 18.2.3. Note that this recursive definition of the spheres only goes through in type theoryif we have (or assume) a universe that is closed under suspensions.

In the following lemma we give a slight simplification of the universal property of suspen-sions, making it just a little easier to work with them.

Lemma 18.2.4. Let X and Y be types, and let ΣX be a suspension of X. Then the map

(ΣX → Y)→ ∑(y,y′ :Y)X → (y = y′)

given by f 7→ ( f (N), f (S), f ·merid) is an equivalence.

Proof. Note that we have a commuting triangle

(ΣX → Y)

coconeS (Y) ∑(y,y′ :Y) X → (y = y′)

cocone-map f 7→( f (N), f (S), f ·merid)

where S is the span 1 ← X → 1. The bottom map is given by (i, j, H) 7→ (i(?), j(?), H). Thismap is an equivalence, and the map on the left is an equivalence by the assumption that ΣX is asuspension of X. Therefore the claim follows by the 3-for-2 property of equivalences.

1It is an entirely different matter to define the set R rather than the homotopy type of R. See Chapter 11 of [3] fordefinitions of the Dedekind reals and the Cauchy reals.

Page 151: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

18. HOMOTOPY PUSHOUTS 141

18.3 The duality of pullbacks and pushouts

Lemma 18.3.1. For any span S ≡ (S, f , g) from A to B, and any type X the square

coconeS (X) XB

XA XS,

π2

π1 –g

– f

which commutes by the homotopy π′3 :≡ λ(i, j, H). eq-htpy(H), is a pullback square.

Proof. The gap map coconeS (X)→ XA ×XS XB is the function

λ(i, j, H). (i, j, eq-htpy(H)).

This is an equivalence by Theorem 9.1.3, since it is the induced map on total spaces of the familyof equivalences eq-htpy. Therefore, the square is a pullback square by Theorem 17.2.6.

In the following theorem we establish the duality between pullbacks and pushouts.

Theorem 18.3.2. Consider a commuting square

S B

A X,

g

f j

i

with H : i f ∼ j g. The following are equivalent:

(i) The square is a pushout square.

(ii) The square

TX TB

TA TS

–j

–i –g

– f

which commutes by the homotopyλh. eq-htpy(h · H)

is a pullback square, for every type T.

Proof. It is straightforward to verify that the triangle

TX

cocone(T) TA ×TS TB

cocone-map(i,j,H) gap(–i, –j,eq-htpy(– ·H))

gap(i,j,eq-htpy(H))

commutes. Since the bottom map is an equivalence by Lemma 18.3.1, it follows that if either oneof the remaining maps is an equivalence, so is the other. The claim now follows by Theorem 17.2.6.

Page 152: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

142 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Example 18.3.3. The square

XS1X1

X1 X2

–constbase

–constbase –const?

–const?

is a pullback square for each type X. Therefore it follows by the second characterization ofpushouts in Theorem 18.3.2 that the circle is a pushout

2 1

1 S1.

In other words, S1 ' Σ2.

Theorem 18.3.4. Consider the following configuration of commuting squares:

A B C

X Y Z

i

f

k

g h

j l

with homotopies H : j f ∼ g i and K : l g ∼ h k, and suppose that the square on the left is apushout square. Then the square on the right is a pushout square if and only if the outer rectangle is apushout square.

Proof. Let T be a type. Taking the exponent T(– ) of the entire diagram of the statement of thetheorem, we obtain the following commuting diagram

TZ TY TX

TC TB TA.

–l

–h –g

–j

– f

–k –i

By the assumption that Y is the pushout of B← A→ X, it follows that the square on the rightis a pullback square. It follows by Theorem 17.5.8 that the rectangle on the left is a pullbackif and only if the outer rectangle is a pullback. Thus the statement follows by the secondcharacterization in Theorem 18.3.2.

Lemma 18.3.5. Consider a map f : A→ B. Then the cofiber of the map inr : B→ cofib f is equivalentto the suspension ΣA of A.

18.4 Fiber sequences and cofiber sequences

Definition 18.4.1. Given a map f : A→ B, we define the cofiber cofib f of f as the pushout

A B

1 cofib f .

f

inr

inl

Page 153: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

18. HOMOTOPY PUSHOUTS 143

The cofiber of a map is sometimes also called the mapping cone.

Example 18.4.2. The suspension ΣX of X is the cofiber of the map X → 1.

18.5 Further examples of pushouts

Definition 18.5.1. We define the join X ∗ Y of X and Y to be the pushout

X×Y Y

X X ∗Y.

pr2

pr1 inr

inl

Definition 18.5.2. Suppose A and B are pointed types, with base points a0 and b0, respectively.The (binary) wedge A ∨ B of A and B is defined as the pushout

2 A + B

1 A ∨ B.

Definition 18.5.3. Given a type I, and a family of pointed types A over i, with base points a0(i).We define the (indexed) wedge

∨(i:I) Ai as the pushout

I ∑(i:I) Ai

1∨(i:I) Ai.

λi. (i,a0(i))

Definition 18.5.4. Let X and Y be types with base points x0 and y0, respectively. We define thewedge X ∨Y of X and Y to be the pushout

2 X + Y

1 X ∨Y

ind2(inl(x0),inr(y0))

const? inr

inl

Definition 18.5.5. Let X and Y be types with base points x0 and y0, respectively. We define amap

wedge-incl : X ∨Y → X×Y.

as the unique map obtained from the commutative square

2 X + Y

1 X×Y.

ind2(inl(x0),inr(y0))

const? indX+Y(λx. (x,y0),λy. (x0,y))

λt. (x0,y0)

Page 154: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

144 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Definition 18.5.6. We define the smash product X ∧Y of X and Y to be the pushout

X ∨Y X×Y

1 X ∧Y.

wedge-incl

const? inr

inl

Exercises

18.1 Use Theorems 12.4.1 and 18.3.2 and Corollary 17.5.5 to show that for any commutingsquare

S B

A C

g

f ' j

i

where f is an equivalence, the square is a pushout square if and only if j : B → C is anequivalence. Use this observation to conclude the following:

(i) If X is contractible, then ΣX is contractible.

(ii) The cofiber of any equivalence is contractible.

(iii) The cofiber of a point in B (i.e., of a map of the type 1→ B) is equivalent to B.

(iv) There is an equivalence X ' ∅ ∗ X.

(v) If X is contractible, then X ∗ Y is contractible.

(vi) If A is contractible, then there is an equivalence A ∨ B ' B for any pointed type B.

18.2 Let P and Q be propositions.

(a) Show that P ∗ Q satisfies the universal property of disjunction, i.e., that for any proposi-tion R, the map

(P ∗ Q→ R)→ (P→ R)× (Q→ R)

given by f 7→ ( f inl, f inr), is an equivalence.(b) Use the proposition R :≡ is-contr(P ∗ Q) to show that P ∗ Q is again a proposition.

18.3 Let Q be a proposition, and let A be a type. Show that the following are equivalent:

(i) The map (Q→ A)→ (∅→ A) is an equivalence.

(ii) The type AQ is contractible.

(iii) There is a term of type Q→ is-contr(A).

(iv) The map inr : A→ Q ∗ A is an equivalence.

18.4 Let P be a proposition. Show that ΣP is a set, with an equivalence(inl(?) = inr(?)

)' P.

18.5 Show that A tS B ' B tSopA, where Sop :≡ (S, g, f ) is the opposite span of S .

18.6 Use Exercise 17.8 to show that ifS Y

X Z

Page 155: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

18. EXERCISES 145

is a pushout square, then so is

A× S A×Y

A× X A× Z

for any type A.18.7 Use Exercise 17.7 to show that if

S1 Y1 S2 Y2

X1 Z1 X2 Z2

are pushout squares, then so is

S1 + S2 Y1 + Y2

X1 + X2 Z1 + Z2.

18.8 (a) Consider a span (S, f , g) from A to B. Use Exercise 17.6 to show that the square

S + S S

A + B A tS B

f+g

[id,id]

inrg

[inl,inr]

is again a pushout square.(b) Show that ΣX ' 2 ∗ X.

18.9 Consider a commuting triangle

A B

X

h

f g

with H : f ∼ g h.

(a) Construct a map cofib(h,H) : cofibg → cofib f .(b) Use ?? to show that cofibcofib(h,H) ' cofibh.

18.10 Use Exercise 15.4 to show that for n ≥ 0, X is an n-type if and only if the map

λx. constx : X → (Sn+1 → X)

is an equivalence.18.11 (a) Construct for every f : X → Y a function

Σ f : ΣX → ΣY.

(b) Show that if f ∼ g, then Σ f ∼ Σg.

Page 156: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

146 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

(c) Show that ΣidX ∼ idΣX(d) Show that

Σ(g f ) ∼ (Σg) (Σ f ).

for any f : X → Y and g : Y → Z.18.12 Consider a commuting diagram of the form

A0 B0 C0

A1 B1 C1

A2 B2 C2

with homotopies filling the (small) squares. Use ?? to construct an equivalence

(A0 tB0 C0) t(A1tB1 C1) (A2 tB2 C2)

' (A0 tA1 A2) t(B0tB1 B2) (C0 tC1 C2).

This is known as the 3-by-3 lemma for pushouts.18.13 (a) Let I be a type, and let A be a family over I. Construct an equivalence(∨

(i:I)ΣAi

)' Σ

(∨(i:I)

Ai

).

(b) Show that for any type X there is an equivalence(∨(x:X)

2)' X + 1.

(c) Construct an equivalence

Σ(Fin(n + 1)) '∨

(i:Fin(n))S1.

18.14 Show that Fin(n + 1) ∗ Fin(m + 1) ' ∨(i:Fin(n·m)) S1, for any n, m : N.18.15 For any pointed set X, show that the squares

S1 1

∨(x:X) S1 ΣX

and

X× S1 1

∨(x:X) S1 ΣX

are pushout squares.18.16 Show that the square

S1 1

S1 × S1 S2 ∨ S1

is a pushout square.

Page 157: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

19. CUBICAL DIAGRAMS 147

18.17 For any type X, show that the mapping cone of the fold map X + X → X is the suspensionof X + 1, i.e. show that the following square

X + X 1

X ΣX + 1

is a pushout square.18.18 Consider a map f : A→ B. Show that f is a k-truncated map if and only if the square

A ASk+1

B BSk+1

δ

f f Sk+1

δ

is a pullback square.

19 Cubical diagrams

In order to proceed with the development of pullbacks and pushouts, it is useful to studycommuting diagrams of the form

C′

A′ C B′

A X′ B

X.

In these diagrams there are six homotopies witnessing that the faces of the cube commute, aswell as a homotopy of homotopies witnessing that the cube as a whole commutes.

Once the basic definitions of cubes are established, we focus on pullbacks and pushouts thatappear in different configurations in these cubical diagrams. For example, if all the vertical mapsin a commuting cube are equivalences, then the top square is a pullback square if and only if thebottom square is a pullback square. In §20 we will use cubical diagrams in our formulation ofthe universality and descent theorems for pushouts.

In our first main theorem of this lecture we show that given a commuting cube in which thebottom square is a pullback square, the top square is a pullback square if and only if the inducedsquare of fibers of the vertical maps is a pullback square. This theorem should be compared toTheorem 17.5.3, where we showed that a square is a pullback square if and only if it inducesequivalences on the fibers of the vertical maps.

In our second main theorem we use the previous result to derive the 3-by-3 properties forpullbacks and pushouts.

Page 158: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

148 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

19.1 Commuting cubes

Definition 19.1.1. A commuting cube

C′

A′ C B′

A X′ B

X,

p′ q′

hC

hA

p q

g′hB

f

hX

f ′

g

consists of types and maps as indicated in the diagram, equipped with

(i) homotopies

top : f ′ p′ ∼ g′ q′

back-left : p hC ∼ hA p′

back-right : q hC ∼ hB q′

front-left : f hA ∼ hX f ′

front-right : g hB ∼ hX g′

bottom : f p ∼ g q

witnessing that the 6 faces of the cube commute,

(ii) and a homotopy

coh-cube : (( f · back-left) (front-left · p′)) (hX · top)

∼ (bottom · hC) ((g · back-right) (front-right · q′))

filling the cube.

In the following lemma we show that if a cube commutes, then so do its rotations and mirrorsymmetries (that preserve the directions of the arrows).2 This fact is obviously true, but there issome ‘path algebra’ involved that we wish to demonstrate at least once.

2The group acting on commuting cubes of maps is the dihedral group D3 which has order 6.

Page 159: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

19. CUBICAL DIAGRAMS 149

Lemma 19.1.2. Consider a commuting cube

C′

A′ C B′

A X′ B

X.

Then the cubes

C′

C B′ A′

B A X′

X

C′

B′ A′ C

X′ B A

X

C′

C A′ B′

A B X′

X.

C′

A′ B′ C

X′ A B

X.

C′

B′ C A′

B X′ A

X.

also commute.

Proof. We only show that the first cube commutes, which is obtained by a counter-clockwiserotation of the original cube around the axis through C′ and X. The other cases are similar, andthey are formalized in the accompagnying Agda library.

First we list the homotopies witnessing that the faces of the cube commute:

top′ :≡ back-left

back-left′ :≡ back-right−1

back-right′ :≡ top−1

front-left′ :≡ bottom−1

Page 160: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

150 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

front-right′ :≡ front-left−1

bottom′ :≡ front-right.

Thus, to show that the cube commutes, we have to show that there is a homotopy of type((g · back-right−1) (bottom−1 · hC)

) ( f · back-left)

∼ (front-right · q′) ((hX · top−1) (front-left−1 · p′)

).

Recall that h · H−1 ∼ (h · H)−1 and H−1 · h ∼ (H · h)−1, so it suffices to construct a homotopy((g · back-right)−1 (bottom · hC)

−1) ( f · back-left)

∼ (front-right · q′) ((hX · top)−1 (front-left · p′)−1

).

Now we note that pointwise, our goal is of the form

(ε−1 δ−1) α = ζ (γ−1 β−1),

whereas the assumption that the original cube commutes yields an identification of the form

(α β) γ = δ (ε ζ)

Indeed, in the case that α, β, γ, δ, ε, and ζ are general identifications, we can conclude our goalusing path induction on all of them.

Lemma 19.1.3. Given a commuting cube as in Definition 19.1.1 we obtain a commuting square

fib f111(x) fib f011

( f101(x))

fib f110( f101(x)) fib f010

( f001(x))

for any x : A101.

Lemma 19.1.4. Consider a commuting cube

C′

A′ C B′

A X′ B

X,

If the bottom and front right squares are pullback squares, then the back left square is a pullback if andonly if the top square is.

Page 161: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

19. CUBICAL DIAGRAMS 151

Remark 19.1.5. By rotating the cube we also obtain:

(i) If the bottom and front left squares are pullback squares, then the back right square is apullback if and only if the top square is.

(ii) If the front left and front right squares are pullback, then the back left square is a pullbackif and only if the back right square is.

By combining these statements it also follows that if the front left, front right, and bottom squaresare pullback squares, then if any of the remaining three squares are pullback squares, all of themare. Cubes that consist entirely of pullback squares are sometimes called strongly cartesian.

19.2 Families of pullbacks

Lemma 19.2.1. Consider a pullback square

C B

A X

q

p g

f

with H : f p ∼ g h. Furthermore, consider type families PX, PA, PB, and PC over X, A, B, and Crespectively, equipped with families of maps

f ′ : ∏ (a:A)PA(a)→ PX( f (a))

g′ : ∏ (b:B)PB(b)→ PX(g(b))

p′ : ∏ (c:C)PC(c)→ PA(p(c))

q′ : ∏ (c:C)PC(c)→ PB(q(c)),

and for each c : C a homotopy H′c witnessing that the square

PC(c) PB(q(c))

PA(p(c)) PX( f (p(c))) PX(g(q(c)))

q′c

p′c g′q(c)

f ′p(c) trPX (H(c))

(19.1)

commutes. Then the following are equivalent:

(i) For each c : C the square in Eq. (19.1) is a pullback square.

(ii) The square

∑(c:C) PC(c) ∑(b:B) PB(b)

∑(a:A) PA(a) ∑(x:X) PX(x)

totq(q′)

totp(p′) totg(g′)

tot f ( f ′)

(19.2)

is a pullback square.

Page 162: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

152 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Corollary 19.2.2. Consider a pullback square

C B

A X,

q

p g

f

with H : f p ∼ g q, and let c1, c2 : C. Then the square

(c1 = c2) (q(c1) = q(c2))

(p(c1) = p(c2)) f (p(c1)) = g(q(c2)),

apq

app λβ. H(c1) apg(β)

λα. ap f (α) H(c2)

commutes and is a pullback square.

Theorem 19.2.3. Consider a commuting cube

C′

A′ C B′

A X′ B

X

in which the bottom square is a pullback square. Then the following are equivalent:

(i) The top square is a pullback square.

(ii) The square

fibγ(c) fibβ(q(c))

fibα(p(c)) fibϕ( f (p(c)))

is a pullback square for each c : C.

Page 163: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

19. CUBICAL DIAGRAMS 153

19.3 The 3-by-3-properties for pullbacks and pushouts

Theorem 19.3.1. Consider a commuting diagram of the form

AA AX AB

XA XX XB

BA BX BB

A f

f A ⇒ f X

Ag

gB⇐X f Xg

gA

B f

gX gB

Bg

with homotopies

f f : X f f A ∼ A f f X

f g : Xg gB ∼ Ag f X

g f :

filling the (small) squares. Furthermore, consider pullback squares

AC AB XC XB BC BB

AA AX XA XX BA BX

CA BA CX BX CB BB

AA XA AX XX AB XB.

Finally, consider a commuting square

D3 D2

D0 D1.

Then the following are equivalent:

(i) This square is a pullback square.

(ii) The induced square

D3 C3

A3 B3

is a pullback square.

Page 164: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

154 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Proof. First we construct an equivalence

(A0 ×B0 C0)×(A1×B1 C1)(A2 ×B2 C2) ' (A0 ×A1 A2)×(B0×B1 B2)

(C0 ×C1 C2).

Now it follows that we have an equivalence

cone( f0, g0)

Exercises

19.1 Some exercises.

20 Universality and descent for pushouts

We begin this lecture with the idea that pushouts can be presented as higher inductive types. Thegeneral idea behind higher inductive types is that we can introduce new inductive types not onlywith constructors at the level of points, but also with constructors at the level of identifications.Pushouts form a basic class of examples that can be obtained as higher inductive types, becausethey come equipped with the structure of a cocone. The cocone (i, j, H) in the commuting square

S B

A C

g

f j

i

equips the type C with two point constructors

i : A→ C

j : B→ C

and a path constructor

H : ∏ (s:S)i( f (s)) = j(g(s))

that provides an identification H(s) : i( f (s)) = j(g(s)) for every s : S. The induction principlethen specifies how to construct sections of families over C. Naturally, it takes not only the pointconstructors i and j, but also the path constructor H into account.

The induction principle is one of several equivalent characterizations of pushouts. We willprove a theorem providing five equivalent characterizations of homotopy pushouts. Two ofthose we have already seen in Theorem 18.3.2: the universal property and the pullback property.The other three are

(i) the dependent pullback property,

(ii) the dependent universal property,

(iii) the induction principle.

Page 165: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

20. UNIVERSALITY AND DESCENT FOR PUSHOUTS 155

An implication that is particularly useful among our five characterizations of pushouts, is thefact that the pullback property implies the dependent pullback property. We use the dependentpullback property to derive the universality of pushouts (not to be confused with the universalproperty of pushouts), showing that for any commuting cube

S′

A′ S B′

A D′ B

D

in which the back left and right squares are pullback squares, if the front left and right squaresare also pullback squares, then so is the induced square

A′ tS ′ B′ D′

A tS B D

We then observe that the univalence axiom can be used together with the universal propertyof pushouts to obtain such families over pushouts in the first place. We prove the descenttheorem, which asserts that for any diagram of the form

S′

A′ S B′

A B

C

in which the bottom square is a pushout square and the back left and right squares are pullbacksquares, there is a unique way of extending this to a commuting cube

S′

A′ S B′

A C′ B

C

Page 166: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

156 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

in which also the front left and right squares are pullback squares. Thus the converse of theuniversality theorem for pushouts also follows. The descent property used to show that pullbacksdistribute over pushouts, and to compute the fibers of maps out of pushouts (the source of manyexercises).

We note that the computation rules in our treatment for the induction principle of homotopypushouts are weak. In other words, they are identifications. In this course we have no need forjudgmental computation rules. Our focus is instead on universal properties. We refer the readerwho is interested in the more ‘traditional’ higher inductive types with judgmental computationrules to [3].

20.1 Five equivalent characterizations of homotopy pushouts

Consider a commuting square

S B

A H

g

f j

i

(20.1)

with H : i f ∼ j g, where we will sometimes write S for the span A← S→ B. Our first goalis to formulate the induction principle for pushouts, which specifies how to construct a sectionof an arbitrary type family P over X. Like the induction principle for the circle, the inductionprinciple of pushouts has to take both the point constructors and the path constructors of X intoaccount. In our case, the point constructors are the maps

i : A→ X

j : B→ X,

and the path constructor is the homotopy

H : ∏ (s:S)i( f (s)) = j(g(s)).

Therefore, we obtain for any section h : ∏ (x:X)P(x) a triple (hA, hB, hS) consisting of

hA : ∏ (a:A)P(i(a))

hB : ∏ (b:B)P(j(b))

hS : ∏ (s:S)trP(H(s), h(i( f (s)))) = h(j(g(s))).

The dependent functions hA and hB are simply given by

hA :≡ h i

hB :≡ h j.

The homotopy hS is defined by hS(s) :≡ apdh(H(s)), using the dependent action on paths of h.We call such triples (hA, hB, hS) dependent cocones on P over the cocone (i, j, H), and will writedep-cocone(i,j,H)(P) for this type of dependent cocones. Thus, we have a function

ev-pushout(P) :(

∏ (x:X)P(x))→ dep-cocone(i,j,H)(P).

We are now in position to define the induction principle and the dependent universal propertyof pushouts.

Page 167: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

20. UNIVERSALITY AND DESCENT FOR PUSHOUTS 157

Definition 20.1.1. We say that X satisfies the induction principle of the pushout of S if thefunction

ev-pushout(P) :(

∏ (x:X)P(x))→ dep-cocone(i,j,H)(P).

has a section for every type family P over X.

Definition 20.1.2. We say that X satisfies the dependent universal property of the pushout ofS if the function

ev-pushout(P) :(

∏ (x:X)P(x))→ dep-cocone(i,j,H)(P).

is an equivalence for every type family P over X.

Remark 20.1.3. For (hA, hB, hS) and (h′A, h′B, h′S) in dep-cocone(i,j,H)(P), the type of identifications(hA, hB, hS) = (h′A, h′B, h′S) is equivalent to the type of triples (KA, KB, KS) consisting of

KA : ∏ (a:A)hA(a) = h′A(a)

KB : ∏ (b:B)hB(b) = h′B(b),

and a homotopy KS witnessing that the square

trP(H(s), hA( f (s))) trP(H(s), h′A( f (s)))

hB(g(s)) hB(g(s))

aptrP(H(s))(KA( f (s)))

hS(s) h′S(s)

KB(g(s))

commutes for every s : S.Therefore we see that the induction principle of the pushout of S provides us, for every

dependent cocone (hA, hB, hS) of P over (i, j, H), with a dependent function h : ∏ (x:A)P(x)equipped with homotopies

KA : ∏ (a:A)h(i(a)) = hA(a)

KB : ∏ (b:B)h(j(b)) = hB(b),

and a homotopy KS witnessing that the square

trP(H(s), h(i( f (s)))) trP(H(s), hA( f (s)))

h(j(g(s))) hB(g(s))

aptrP(H(s))(KA( f (s)))

apdh(H(s)) hS(s)

KB(g(s))

commutes for every s : S. These homotopies are the computation rules for pushouts. Thedependent universal property is equivalent to the assertion that for every dependent cocone(hA, hB, hS), the type of quadruples (h, KA, KB, KS) is contractible.

Page 168: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

158 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Theorem 20.1.4. Consider a commuting square

S B

A C

f

g

j

i

(20.2)

with H : (i f ) ∼ (j g). Then the following are equivalent:

(i) The square in Eq. (20.2) is a pushout square.

(ii) The square in Eq. (20.2) satisfies the pullback property of pushouts.

(iii) The square satisfies the dependent pullback property of pushouts: For every family P over C, thesquare

∏ (z:C)P(z) ∏ (y:B)P(j(y))

∏ (x:A)P(i(x)) ∏ (s:S)P(i( f (s))) ∏ (s:S)P(j(g(s))),

h 7→hj

h 7→hi h 7→hg

h 7→h fλh. λs. trP(H(s),h(s))

(20.3)

which commutes by the homotopy

λh. eq-htpy(λs. apdh(H(s))),

is a pullback square.

(iv) The type C satisfies the dependent universal property of pushouts.

(v) The type C satisfies the induction principle of pushouts.

Proof. We have already seen in Theorem 18.3.2 that (i) and (ii) are equivalent.To see that (ii) implies (iii), note that we have a commuting cube

∑(h:C→C) ∏ (c:C)P(h(c))

∑(h:A→C) ∏ (a:A)P(h(a))(

∑(c:C) P(c))C

∑(h:B→C) ∏ (b:B)P(h(b))

(∑(c:C) P(c)

)A∑(h:S→C) ∏ (s:S)P(h(s))

(∑(c:C) P(c)

)B

(∑(c:C) P(c)

)S

in which the vertical maps are equivalences. Moreover, the bottom square is a pullback squareby the pullback property of pushouts, so we conclude that the top square is a pullback square.

Page 169: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

20. UNIVERSALITY AND DESCENT FOR PUSHOUTS 159

Since this is a square of total spaces over a pullback square, we invoke Lemma 19.2.1 to concludethat for each h : C → C, the square

∏ (c:C)P(h(c)) ∏ (b:B)P(h(j(b)))

∏ (a:A)P(h(i(a))) ∏ (s:S)P(h(i( f (s)))) ∏ (s:S)P(h(j(g(s))))tr((k:S→C) 7→∏ (s:S)P(k(s)))(eq-htpy(h·H))

is a pullback square. Note that the transport with respect to the family k 7→ ∏ (s:S)(Pk(s)) alongthe identification eq-htpy(h · H) is homotopic to the map

λh. λs. trPh(H(s), h(s)) : ∏ (s:S)P(h(i( f (s))))→ ∏ (s:S)P(h(j(g(s)))).

Therefore we conclude that the square

∏ (c:C)P(h(c)) ∏ (b:B)P(h(j(b)))

∏ (a:A)P(h(i(a))) ∏ (s:S)P(h(i( f (s)))) ∏ (s:S)P(h(j(g(s))))λh. λs. trPh(H(s),h(s))

is a pullback square for each h : C → C. Using the case h ≡ id : C → C we conclude that thecocone (i, j, H) satisfies the dependent pullback property.

To see that (iii) implies (ii) we recall that transport with respect to a trivial family is homotopicto the identity function. Thus we obtain the pullback property from the dependent pullbackproperty using the trivial family λc. T over C.

To see that (iii) implies (iv) we note that ev-pushout(P) is an equivalence if and only if the gapmap of the square in Eq. (20.3) is an equivalence.

It is clear that (iv) implies (v), so it remains to show that (v) implies (iv). If X satisfies theinduction principle of pushouts, then the map

ev-pushout :(

∏ (x:X)P(x))→ dep-cocone(i,j,H)(P)

has a section, i.e., it comes equipped with

ind-pushout : dep-cocone(i,j,H)(P)→(

∏ (x:X)P(x))

comp-pushout : ev-pushout ind-pushout ∼ id.

To see that ev-pushout is an equivalence it therefore suffices to construct a homotopy

ind-pushout(ev-pushout(h)) ∼ h

for any h : ∏ (x:X)P(x). From the fact that ind-pushout is a section of ev-pushout we obtain anidentification

ev-pushout(ind-pushout(ev-pushout(h))) = ev-pushout(h).

Therefore we observe that it suffices to construct a homotopy h ∼ h′ for any two functionsh, h′ : ∏ (x:X)P(x) that come equipped with an identification

ev-pushout(h) = ev-pushout(h′).

Page 170: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

160 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Now we recall from Remark 20.1.3 that this type of identifications is equivalent to the type oftriples (KA, KB, KS) consisting of

KA : ∏ (a:A)h(i(a)) = h′(i(a))

KB : ∏ (b:B)h(j(b)) = h′(j(b))

and a homotopy KS witnessing that the square

trP(H(s), h(i( f (s)))) trP(H(s), h′(i( f (s))))

h(j(g(s))) h′(j(g(s)))

aptrP(H(s))(KA( f (s)))

apdh(H(s)) apdh′ (H(s))

KB(g(s))

commutes for every s : S. Note that from such an identification KS(s) we also obtain anidentification

K′S(s) : trx 7→h(x)=h′(x)(H(s), KA( f (s))) = KB(g(s)).

Indeed, by path inducgtion on p : x = x′ we obtain an identification trx 7→h(x)=h′(x)(p, q) = q′, forany p : x = x′, any q : h(x) = h′(x) and any q′ : h(x′) = h′(x′) for which the square

trP(p, h(x)) trP(p, h′(x))

h(x′) h′(x′)

aptrP(p)(q)

apdh(p) apdh′ (p)

q′

Now we see that the triple (KA, KB, K′S) forms a dependent cocone on the family x 7→ h(x) =h′(x). Therefore we obtain a homotopy h ∼ h′ as an application of the induction principle forpushouts at the family x 7→ h(x) = h′(x).

20.2 Type families over pushouts

Given a pushout square

S B

A X.

g

f j

i

with H : i f ∼ j g, and a family P : X → U , we obtain

P i : A→ U

P j : B→ U

λx. trP(H(x)) : ∏ (x:S)P(i( f (x))) ' P(j(g(x))).

Our goal in the current section is to show that the triple (PA, PB, PS) consisting of PA :≡ P i,PB :≡ P j, and PS :≡ λx. trP(H(x)) characterizes the family P over X.

Page 171: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

20. UNIVERSALITY AND DESCENT FOR PUSHOUTS 161

Definition 20.2.1. Consider a commuting square

S B

A X.

g

f j

i

with H : i f ∼ j g, where all types involved are in U . The type Desc(S) of descent data for X,is defined defined to be the type of triples (PA, PB, PS) consisting of

PA : A→ U

PB : B→ U

PS : ∏ (x:S)PA( f (x)) ' PB(g(x)).

Definition 20.2.2. Given a commuting square

S B

A X.

g

f j

i

with H : i f ∼ j g, we define the map

desc-famS (i, j, H) : (X → U )→ Desc(S)

by P 7→ (P i, P j, λx. trP(H(x))).

Theorem 20.2.3. Consider a pushout square

S B

A X.

g

f j

i

with H : i f ∼ j g, where all types involved are in U , and suppose we have

PA : A→ U

PB : B→ U

PS : ∏ (x:S)PA( f (x)) ' PB(g(x)).

Then the functiondesc-famS (i, j, H) : (X → U )→ Desc(S)

is an equivalence.

Proof. By the 3-for-2 property of equivalences it suffices to construct an equivalence ϕ : coconeS (U )→Desc(S) such that the triangle

UX

coconeS (U ) Desc(S)

cocone-mapS (i,j,H) desc-famS (i,j,H)

Page 172: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

162 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

commutes.Since we have equivalences

equiv-eq :(

PA( f (x)) = PB(g(x)))'(

PA( f (x)) ' PB(g(x)))

for all x : S, we obtain by Exercise 12.12 an equivalence on the dependent products(∏ (x:S)PA( f (x)) = PB(g(x))

)→(

∏ (x:S)PA( f (x)) ' PB(g(x)))

.

We define ϕ to be the induced map on total spaces. Explicitly, we have

ϕ :≡ λ(PA, PB, K). (PA, PB, λx. equiv-eq(K(x))).

Then ϕ is an equivalence by Theorem 9.1.3, and the triangle commutes by ??.

Corollary 20.2.4. Consider descent data (PA, PB, PS) for a pushout square as in Theorem 20.2.3. Thenthe type of quadruples (P, eA, eB, eS) consisting of a family P : X → U equipped with two families ofequivalences

eA : ∏ (a:A)PA(a) ' P(i(a))

eB : ∏ (b:B)PB(a) ' P(j(b))

and a homotopy eS witnessing that the square

PA( f (x)) P(i( f (x)))

PB(g(x)) P(j(g(x)))

eA( f (x))

PS(x) trP(H(x))

eB(g(x))

commutes, is contractible.

Proof. The fiber of this map at (PA, PB, PS) is equivalent to the type of quadruples (P, eA, eB, eS)as described in the theorem, which are contractible by Theorem 8.3.6.

20.3 The flattening lemma for pushouts

In this section we consider a pushout square

S B

A X.

g

f j

i

with H : i f ∼ j g, descent data

PA : A→ U

PB : B→ U

PS : ∏ (x:S)PA( f (x)) ' PB(g(x)),

Page 173: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

20. UNIVERSALITY AND DESCENT FOR PUSHOUTS 163

and a family P : X → U equipped with

eA : ∏ (a:A)PA(a) ' P(i(a))

eB : ∏ (b:B)PB(a) ' P(j(b))

and a homotopy eS witnessing that the square

PA( f (x)) P(i( f (x)))

PB(g(x)) P(j(g(x)))

eA( f (x))

PS(x) trP(H(x))

eB(g(x))

commutes.

Definition 20.3.1. We define a commuting square

∑(x:S) PA( f (x)) ∑(b:B) PB(b)

∑(a:A) PA(a) ∑(x:X) P(x)

f ′

g′

j′

i′

with a homotopy H′ : i′ f ′ ∼ j′ g′. We will write S ′ for the span

∑(a:A) PA(a) ∑(x:S) PA( f (x)) ∑(b:B) PB(b).f ′ g′

Construction. We define

f ′ :≡ tot f (λx. idPA( f (x)))

g′ :≡ totg(eS)

i′ :≡ toti(eA)

j′ :≡ totj(eB).

Then it remains to construct a homotopy H′ : i′ f ′ ∼ j′ g′. In order to construct this homotopy,we have to construct an identification

(i( f (x)), eA(y)) = (j(g(x)), eB(eS(y)))

for any x : S and y : PA( f (x)). Note that have the identification

eq-pair(H(x), eS(x, y)−1)

of this type.

Lemma 20.3.2 (The flattening lemma). The commuting square

∑(x:S) PA( f (x)) ∑(b:B) PB(b)

∑(a:A) PA(a) ∑(x:X) P(x)

f ′

g′

j′

i′

is a pushout square.

Page 174: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

164 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Proof. To show that the square of total spaces satisfies the pullback property of pullbacks, notethat we have a commuting cube

T∑(x:X) P(x)

T∑(a:A) PA(a) ∏ (x:X)TP(x) T∑(b:B) PB(b)

∏ (a:A)TPA(a) T∑(x:S) PA( f (x)) ∏ (b:B)TPB(b)

∏ (x:S)TPA( f (x))

for any type T. In this cube, the vertical maps are all equivalences, and the bottom square is apullback square by the dependent pullback property of pushouts. Therefore it follows that thetop square is a pullback square.

20.4 The universality theorem

Theorem 20.4.1. Consider two pushout squares

S′ B′ S B

A′ C′ A C

and a commuting cube

S′

A′ S B′

A D′ B

D

in which the back left and right squares are pullback squares. The following are equivalent:

(i) The front left and right squares are pullback squares.

(ii) The induced commuting square

C′ D′

C D

is a pullback square.

Page 175: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

20. UNIVERSALITY AND DESCENT FOR PUSHOUTS 165

20.5 The descent property for pushouts

In the previous section there was a significant role for families of equivalences, and we knowby Theorems 17.5.2 and 17.5.3: families of equivalences indicate the presence of pullbacks. Inthis section we reformulate the results of the previous section using pullbacks where we usedfamilies of equivalences before, to obtain new and useful results. We begin by considering thetype of descent data from the perspective of pullback squares.

Definition 20.5.1. Consider a span S from A to B, and a span S ′ from A′ to B′. A cartesiantransformation of spans from S ′ to S is a diagram of the form

A′ S′ B′

A S B

hA

f ′ g′

hS hB

f g

with F : f hS ∼ hA f ′ and G : g hS ∼ hB g′, where both squares are pullback squares.The type cart(S ′,S) of cartesian transformation is the type of tuples

(hA, hS, hB, F, G, p f , pg)

where p f : is-pullback(hS, hA, F) and pg : is-pullback(hS, hB, G), and we write

Cart(S) :≡ ∑(A′ ,B′ :U )∑(S ′ :span(A′ ,B′))cart(S ′,S).

Lemma 20.5.2. There is an equivalence

cart-descS : Desc(S)→ Cart(S).

Proof. Note that by Theorem 17.5.6 it follows that the types of triples ( f ′, F, p f ) and (g′, G, pg)are equivalent to the types of families of equivalences

∏ (x:S)fibhS(x) ' fibhA( f (x))

∏ (x:S)fibhS(x) ' fibhB(g(x))

respectively. Furthermore, by Theorem 24.5.4 the types of pairs (S′, hS), (A′, hA), and (B′, hB)are equivalent to the types S → U , A → U , and B → U , respectively. Therefore it follows thatthe type Cart(S) is equivalent to the type of tuples (Q, PA, ϕ, PB, PS) consisting of

Q : S→ U

PA : A→ U

PB : B→ U

ϕ : ∏ (x:S)Q(x) ' PA( f (x))

PS : ∏ (x:S)Q(x) ' PB(g(x)).

However, the type of ϕ is equivalent to the type PA f = Q. Thus we see that the type of pairs(Q, ϕ) is contractible, so our claim follows.

Page 176: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

166 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Definition 20.5.3. We define an operation

cart-mapS :(

∑(X′ :U )X′ → X

)→ Cart(S).

Construction. Let X′ : U and hX : X′ → X. Then we define the types

A′ :≡ A×X X′

B′ :≡ B×X X′.

Next, we define a span S ′ :≡ (S′, f ′, g′) from A′ to B′. We take

S′ :≡ S×A A′

f ′ :≡ π2.

To define g′, let s : S, let (a, x′, p) : A×X X′, and let q : f (s) = a. Our goal is to construct a termof type B×X X′. We have g(s) : B and x′ : X′, so it remains to show that j(g(s)) = hX(x′). Weconstruct such an identification as a concatenation

j(g(s)) i( f (s)) i(a) hX(x′).H(s)−1 api(q) p

To summarize, the map g′ is defined as

g′ :≡ λ(s, (a, x′, p), q). (g(s), x′, H(s)−1 (api(q) p)).

Then we have commuting squares

A×X X′ S×A A′ B×X X′

A S B.

Moreover, these squares are pullback squares by Theorem 17.5.8.

The following theorem is analogous to Theorem 20.2.3.

Theorem 20.5.4 (The descent theorem for pushouts). The operation cart-mapS is an equivalence(∑(X′ :U )X

′ → X)' Cart(S)

Proof. It suffices to show that the square

X → U Desc(S)

∑(X′ :U ) X′ → X Cart(S)

desc-famS (i,j,H)

map-famX cart-descS

cart-mapS

commutes. To see that this suffices, note that the operation map-famX is an equivalence byTheorem 24.5.4, the operation desc-famS (i, j, H) is an equivalence by Theorem 20.2.3, and theoperation cart-descS is an equivalence by Lemma 20.5.2.

Page 177: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

20. UNIVERSALITY AND DESCENT FOR PUSHOUTS 167

To see that the square commutes, note that the composite

cart-mapS map-famX

takes a family P : X → U to the cartesian transformation of spans

A×X P S×A

(A×X P

)B×X P

A S B,

π1 π1π1

where P :≡ ∑(x:X) P(x).The composite

cart-descS desc-famX

takes a family P : X → U to the cartesian transformation of spans

∑(a:A) P(i(a)) ∑(s:S) P(i( f (s))) ∑(b:B) P(j(b))

A S B

These cartesian natural transformations are equal by Lemma 17.5.1

Since cart-mapS is an equivalence it follows that its fibers are contractible. This is essentiallythe content of the following corollary.

Corollary 20.5.5. Consider a diagram of the form

S′

A′ S B′

A B

X

hSf ′ g′

hAf g

hB

i j

with homotopies

F : f hS ∼ hA f ′

G : g hS ∼ hB g′

H : i f ∼ j g,

and suppose that the bottom square is a pushout square, and the top squares are pullback squares. Thenthe type of tuples ((X′, hX), (i′, I, p), (j′, J, q), (H′, C)) consisting of

(i) A type X′ : U together with a morphism

hX : X′ → X,

Page 178: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

168 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

(ii) A map i′ : A′ → X′, a homotopy I : i hA ∼ hX i′, and a term p witnessing that the square

A′ X′

A X

hA

i′

hX

i

is a pullback square.

(iii) A map j′ : B′ → X′, a homotopy J : j hB ∼ hX j′, and a term q witnessing that the square

B′ X′

B X

hB

j′

hX

j

is a pullback square,

(iv) A homotopy H′ : i′ f ′ ∼ j′ g′, and a homotopy

C : (i · F) ((I · f ′) (hX · H′)) ∼ (H · hS) ((j · G) (J · g′))

witnessing that the cube

S′

A′ S B′

A X′ B

X,

commutes,

is contractible.

The following theorem should be compared to the flattening lemma, Lemma 20.3.2.

Theorem 20.5.6. Consider a commuting cube

S′

A′ S B′

A X′ B

X.

f ′ g′hS

hA

f g

j′hB

ihX

i′

j

If each of the vertical squares is a pullback, and the bottom square is a pushout, then the top square is apushout.

Page 179: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

20. UNIVERSALITY AND DESCENT FOR PUSHOUTS 169

Proof. By Theorem 17.5.3 we have families of equivalences

F : ∏ (x:S)fibhS(x) ' fibhA( f (x))

G : ∏ (x:S)fibhS(x) ' fibhB(g(x))

I : ∏ (a:A)fibhA(a) ' fibhX (i(a))

J : ∏ (b:B)fibhB(b) ' fibhX (j(b)).

Moreover, since the cube commutes we obtain a family of homotopies

K : ∏ (x:S) I( f (x)) F(x) ∼ J(g(x)) G(x).

We define the descent data (PA, PB, PS) consisting of PA : A → U , PB : B → U , and PS :∏ (x:S)PA( f (x)) ' PB(g(x)) by

PA(a) :≡ fibhA(a)

PB(b) :≡ fibhB(b)

PS(x) :≡ G(x) F(x)−1.

We have

P :≡ fibhX

eA :≡ I

eB :≡ J

eS :≡ K.

Now consider the diagram

∑(s:S) fibhS(s) ∑(s:S) fibhA( f (s)) ∑(b:B) fibhB(b)

∑(a:A) fibhA(a) ∑(a:A) fibhA(a) ∑(x:X) fibhX (x)

Since the top and bottom map in the left square are equivalences, we obtain from Exercise 18.1that the left square is a pushout square. Moreover, the right square is a pushout by Lemma 20.3.2.Therefore it follows by Theorem 18.3.4 that the outer rectangle is a pushout square.

Now consider the commuting cube

∑(s:S) fibhS(s)

∑(a:A) fibhA(a) S′ ∑(b:B) fibhB(b)

A′ ∑(x:X) fibhX (x) B′

X′.

Page 180: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

170 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

We have seen that the top square is a pushout. The vertical maps are all equivalences, sothe vertical squares are all pushout squares. Thus it follows from one more application ofTheorem 18.3.4 that the bottom square is a pushout.

Theorem 20.5.7. Consider a commuting cube of types

S′

A′ S B′

A X′ B

X,

and suppose the vertical squares are pullback squares. Then the commuting square

A′ tS′ B′ X′

A tS B X

is a pullback square.

Proof. It suffices to show that the pullback

(A tS B)×X X′

has the universal property of the pushout. This follows by the descent theorem, since the verticalsquares in the cube

S′

A′ S B′

A (A tS B)×X X′ B

A tS B

are pullback squares by Theorem 17.5.8.

Page 181: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

20. EXERCISES 171

20.6 Applications of the descent theorem

Theorem 20.6.1. Consider a commuting cube

S′

A′ S B′

A C′ B

C

in which the bottom square is a pushout square. If the vertical sides are pullback squares, then for eachc : C the square of fibers

fibi f hS(c) fibjghS(c) fibjhB(c)

fibihA(c) fibhC (c)

is a pushout square.

Exercises

20.1 Use the characterization of the circle as a pushout given in Example 18.3.3 to show that thesquare

S1 + S1 S1

S1 S1 × S1

[id,id]

[id,id] λt. (t,base)

λt. (t,base)

is a pushout square.20.2 Let f : A→ B be a map. The codiagonal ∇ f of f is the map obtained from the universal

property of the pushout, as indicated in the diagram

A B

A B tA B

B

f

f

pinr

idBinl

idB

∇ f

Show that fib∇ f (b) ' Σ(fib f (b)) for any b : B.

Page 182: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

172 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

20.3 Consider two maps f : A→ X and g : B→ X. The fiberwise join f ∗ g is defined by theuniversal property of the pushout as the unique map rendering the diagram

A×X B B

A A ∗X B

X

π1

π2

pinr

ginl

f

f ∗g

commutative, where A ∗X B is defined as a pushout, as indicated. Construct an equivalence

fib f ∗g(x) ' fib f (x) ∗ fibg(x)

for any x : X.20.4 Consider two maps f : A→ B and g : C → D. The pushout-product

fg : (A× D) tA×C (B× C)→ B× D

of f and g is defined by the universal property of the pushout as the unique map renderingthe diagram

A× C B× C

A× D (A× D) tA×C (B× C)

B× D

f×idC

idA×g inridB×g

inl

f×idD

fg

commutative. Construct an equivalence

fib fg(b, d) ' fib f (b) ∗ fibg(d)

for all b : B and d : D.20.5 Let A and B be pointed types with base points a0 : A and b0 : B. The wedge inclusion is

defined as follows by the universal property of the wedge:

1 B

A A ∨ B

A× B

inr λb. (a0,b)inl

λa. (a,b0)

wedge-inA,B

Show that the fiber of the wedge inclusion A ∨ B→ A× B is equivalent to Ω(B) ∗ Ω(A).

Page 183: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

21. THE IDENTITY TYPES OF PUSHOUTS 173

20.6 Let f : X ∨ X → X be the map defined by the universal property of the wedge as indicatedin the diagram

1 X

X X ∨ X

X.

x0

x0

pinr

idXinl

idX

f

(a) Show that fib f (x0) ' ΣΩ(X).(b) Show that cof f ' ΣX.

20.7 Consider a pushout square

S B

A X,

g

f j

i

and suppose that f is an embedding. Show that j is an embedding, and that the square isalso a pullback square.

21 The identity types of pushouts

21.1 Characterizing families of maps over pushouts

Definition 21.1.1. Consider a span S

A S B,f g

and consider P, Q : Fam-pushout(S). A morphism of descent data from P to Q over S is definedto be a triple (hA, hB, hS) consisting of

hA : ∏ (x:A)PA(x)→ QA(x)

hB : ∏ (y:B)PB(y)→ QB(y)

equipped with a homotopy hS witnessing that the square

PA( f (s)) QA( f (s))

PB(g(s)) QB(g(s))

hA( f (s))

PS(s) QS(s)

hB(g(s))

commutes for every s : S. We write homS (P, Q) for the type of morphisms of descent data overS .

An equivalence of descent data from P to Q is a morphism h such that hA and hB are familiesof equivalences.

Page 184: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

174 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

Remark 21.1.2. The identity type h = h′ of homS (P, Q) is characterized as the type of triples(HA, HB, HS) consisting of

HA : ∏ (a:A)hA(a) ∼ h′A(a)

HB : ∏ (b:B)hB(b) ∼ h′B(b)

and a homotopy KS(s) witnessing that the square

hB(g(s)) PS(s) QS(s) hA( f (s))

h′B(g(s)) PS(s) QS(s) h′A(g(s))

of homotopies commutes for every s : S.

Definition 21.1.3. Consider a commuting square

S B

A X

g

f j

i

with H : i f ∼ j f , and let P and Q be type families over X. We define a map(∏ (x:X)P(x)→ Q(x)

)→ homS (desc-fam(P), desc-fam(Q)).

Construction. Let h : ∏ (x:X)P(x)→ Q(x). Then we define

hA : ∏ (a:A)P(i(a))→ Q(i(a))

hB : ∏ (b:B)P(j(b))→ Q(j(b))

by hA(a, p) :≡ h(i(a), p) and hB(b, q) :≡ h(j(b), q). Then it remains to define for every s : S ahomotopy hS(s) witnessing that the square

P(i( f (s))) Q(i( f (s)))

P(j(g(s))) Q(j(g(s)))

hA( f (s))

trP(H(s)) trQ(H(s))

hB(g(s))

commutes. Note that every family of maps h : ∏ (x:X)P(x)→ Q(x) is natural in the sense thatfor any path p : x = x′ in X, there is a homotopy ψ(p, h) witnessing that the square

P(x) Q(x)

P(x′) Q(x′)

h(x)

trP(p) trQ(p)

h(x′)

commutes. Therefore we define hS(s) :≡ ψ(H(s), h).

Page 185: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

21. THE IDENTITY TYPES OF PUSHOUTS 175

Theorem 21.1.4. The map defined in Definition 21.1.3 is an equivalence.

Proof. We will first construct a commuting triangle

∏ (x:X)P(x)→ Q(x)

dep-cocone(i,j,H)(x 7→ P(x)→ Q(x)) homS (desc-fam(P), desc-fam(Q))

Recall from Theorem 20.1.4 that X satisfies the dependent universal property, so the map on theleft is an equivalence. Therefore we will prove the claim by showing that the bottom map is anequivalence.

In order to construct the bottom map, we first note that for any two maps α : P(x)→ Q(x)and α′ : P(x′)→ Q(x′) and any path p : x = x′, there is an equivalence

ϕ(p, f , f ′) :(

trx 7→P(x)→Q(x)(p, f ) = f ′)'(

∏ (y:B(x)) f ′(trB(p, y)) = trC(p, f (y)))

.

The equivalence ϕ is defined by path induction on p, where we take

ϕ(refl, f , f ′) :≡ htpy-eq inv.

Now we define the bottom map in the asserted triangle to be the map

(hA, hB, hS) 7→ (hA, hB, λs. ϕ(H(s), hA( f (s)), hB(g(s)), hS(s))).

Note that this map is an equivalence, since it is the induced map on total spaces of an equivalence.It remains to show that the triangle commutes. By Remark 21.1.2 it suffices to construct

families of homotopies

KA : ∏ (a:A)hi(a) ∼ hi(a)

KB : ∏ (b:B)hj(b) ∼ hj(b)

and for each s : S a homotopy KS(s) witnessing that the square

hj(g(s)) trP(H(s)) trQ(H(s)) hi( f (s))

hj(g(s)) trP(H(s)) trQ(H(s)) hi( f (s))

ψ(H(s),h)

ϕ(H(s),hi( f (s)),hj(g(s)),apdh(H(s)))

commutes. Of course, we take KA(a) :≡ htpy-refl and KB(b) :≡ htpy-refl, so it suffices to showthat

ψ(H(s), h) ∼ ϕ(H(s), hi( f (s)), hj(g(s)), apdh(H(s))).

Now we would like to proceed by homotopy induction on H : i f ∼ j g. However, we canonly do so after we generalize the problem sufficiently to a situation where H has free endpoints.It is indeed possible by homotopy induction to construct for every f , g : S→ X equipped with ahomotopy H : f ∼ g, every family of maps h : ∏ (x:X)P(x)→ Q(x) and every s : S, a homotopy

ψ(H(s), h) ∼ ϕ(H(s), h f (s), hg(s), apdh(H(s))).

Page 186: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

176 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

21.2 Characterizing the identity types of pushouts

Definition 21.2.1. Consider a span S equipped with a : A, and consider P : Fam-pushout(S)equipped with p : PA(a). We say that P is universal if for every Q : Fam-pushout(S) theevaluation map

homS (P, Q)→ QA(a)

given by h 7→ hA(a, p) is an equivalence.

Lemma 21.2.2. Consider a pushout square

S B

A X

g

f j

i

with H : i f ∼ j g, and let a : A. Furthermore, let P be the descent data for the type familyx 7→ i(a) = x over X. Then P is universal.

Proof. Since desc-fam is an equivalence, it suffices to show that for every type family Q over X,the map

homS (desc-fam(Id(i(a))), desc-fam(Q))→ Q(i(a))

given by h 7→ hA(a, refli(a)) is an equivalence. Note that we have a commuting triangle

∏ (x:X)(i(a) = x)→ Q(x) homS (desc-fam(Id(i(a))), desc-fam(Q))

Q(i(a))ev-refl

h 7→hA(refli(a))

The map ev-refl is an equivalence by Theorem 12.3.3, and the top map is an equivalence byTheorem 21.1.4. Therefore it follows that the remaining map is an equivalence.

Theorem 21.2.3. Consider a pushout square

S B

A X

g

f j

i

with H : i f ∼ j g, and let a : A. Furthermore consider a pair (P, p0) consisting of P :Fam-pushout(S) and p : PA(a). If P is universal, then we have two families of equivalences

eA : ∏ (x:A)PA(x) ' (i(a) = i(x))

eB : ∏ (y:B)PB(y) ' (i(a) = j(b))

equipped with a homotopy eS witnessing that the square

PA( f (s)) PB(g(s))

(i(a) = i( f (s))) (i(a) = g(s))

e(s)

eA( f (s)) eB(g(s))

λp. p H(s)

Page 187: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

21. EXERCISES 177

commutes for each s : S, and an identification eA(a, r) = refli(a)

Theorem 21.2.4. Let X be a pointed type with base point x0 : X. Then the loop space of ΣX is the initialtype Y equipped with a base point y0 : Y, and a pointed map

X →∗ (Y ' Y).

Proof. The type of pairs (Y, µ) consisting of a pointed type Y and a pointed map µ : X →∗ (Y 'Y) is equivalent to the type of triples (Y, Z, µ) consisting of a pointed type Y, a type Z, and amap µ : X → (Y ' Z).

Corollary 21.2.5. The loop space of S2 is the initial type X equipped with a point x0 : X and a homotopyH : id ∼ id.

Exercises

21.1 Consider the suspensionP 1

1 ΣP

S

N

of a proposition P. Show that (N = S) ' P.21.2 Show that if X has decidable equality, then ΣX is a 1-type.21.3 Consider a pushout square

A 1

B X

f j

i

where f : A→ B is an embedding.(a) Show that there are equivalences

(i(b) = i(y)) ' (b = y) ∗ fib f (b)

(i(b) = j(?)) ' fib f (b)

for any b, y : B.(b) Use Exercise 21.4.b to show that if B is a k-type, then so is X, for any k ≥ 0.

21.4 Consider the join

P× X X

P P ∗ X

pr2

pr1 inr

inl

of a proposition P and an arbitrary type X.(a) Show that for any x, y : X there is an equivalence e : (inr(x) = inr(y)) ' P ∗ (x = y)

for which the triangle

(x = y)

(inr(x) = inr(y)) P ∗ (x = y)

apinr inr

e

Page 188: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

178 CHAPTER IV. HOMOTOPY PULLBACKS AND PUSHOUTS

commutes.(b) Show that if X is a k-type, then so is P ∗ X.

Page 189: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

Chapter V

Homotopy quotients

22 Sequential colimits

Note: This chapter currently contains only the statements of the definitions and theorems, but no proofs. Ihope to make a complete version available soon.

22.1 The universal property of sequential colimits

Type sequences are diagrams of the following form.

A0 A1 A2 · · · .f0 f1 f2

Their formal specification is as follows.

Definition 22.1.1. An (increasing) type sequence A consists of

A : N→ U

f : ∏ (n:N)An → An+1.

In this section we will introduce the sequential colimit of a type sequence. The sequentialcolimit includes each of the types An, but we also identify each x : An with its value fn(x) : An+1.Imagine that the type sequence A0 → A1 → A2 → · · · defines a big telescope, with A0 slidinginto A1, which slides into A2, and so forth.

As usual, the sequential colimit is characterized by its universal property.

Definition 22.1.2. (i) A (sequential) cocone on a type sequence A with vertex B consists of

h : ∏ (n:N)An → B

H : ∏ (n:N) fn ∼ fn+1 Hn.

We write cocone(B) for the type of cones with vertex X.

(ii) Given a cone (h, H) with vertex B on a type sequence A we define the map

cocone-map(h, H) : (B→ C)→ cocone(B)

given by f 7→ ( f h, λn. λx. ap f (Hn(x))).

179

Page 190: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

180 CHAPTER V. HOMOTOPY QUOTIENTS

(iii) We say that a cone (h, H) with vertex B is colimiting if cocone-map(h, H) is an equivalencefor any type C.

Theorem 22.1.3. Consider a cocone (h, H) with vertex B for a type sequence A. The following areequivalent:

(i) The cocone (h, H) is colimiting.

(ii) The cocone (h, H) is inductive in the sense that for every type family P : B→ U , the map(∏ (b:B)P(b)

)→ ∑(h:∏ (n:N) ∏ (x:An)P(hn(x)))

∏ (n:N)∏ (x:An)trP(Hn(x), hn(x)) = hn+1( fn(x))

given bys 7→ (λn. s hn, λn. λx. apds(Hn(x)))

has a section.

(iii) The map in (ii) is an equivalence.

22.2 The construction of sequential colimits

We construct sequential colimits using pushouts.

Definition 22.2.1. Let A ≡ (A, f ) be a type sequence. We define the type A∞ as a pushout

A + A A

A A∞.

[id,σA ]

[id,id] inr

inl

Definition 22.2.2. The type A∞ comes equipped with a cocone structure consisting of

seq-in : ∏ (n:N)An → A∞

seq-glue : ∏ (n:N)∏ (x:An)inn(x) = inn+1( fn(x)).

Construction. We define

seq-in(n, x) :≡ inr(n, x)

seq-glue(n, x) :≡ glue(inl(n, x))−1 glue(inr(n, x)).

Theorem 22.2.3. Consider a type sequence A, and write A :≡ ∑(n:N) An. Moreover, consider the map

σA : A→ A

defined by σA(n, a) :≡ (n + 1, fn(a)). Furthermore, consider a cocone (h, H) with vertex B. Thefollowing are equivalent:

(i) The cocone (h, H) with vertex B is colimiting.

Page 191: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

22. SEQUENTIAL COLIMITS 181

(ii) The defining square

A + A A

A A∞,

[id,σA ]

[id,id] λ(n,x). hn(x)

λ(n,x). hn(x)

of A∞ is a pushout square.

22.3 Descent for sequential colimits

Definition 22.3.1. The type of descent data on a type sequence A ≡ (A, f ) is defined to be

Desc(A) :≡ ∑(B:∏ (n:N)An→U )∏ (n:N)∏ (x:An)Bn(x) ' Bn+1( fn(x)).

Definition 22.3.2. We define a map

desc-fam : (A∞ → U )→ Desc(A)

by B 7→ (λn. λx. B(seq-in(n, x)), λn. λx. trB(seq-glue(n, x))).

Theorem 22.3.3. The mapdesc-fam : (A∞ → U )→ Desc(A)

is an equivalence.

Definition 22.3.4. A cartesian transformation of type sequences from A to B is a pair (h, H)consisting of

h : ∏ (n:N)An → Bn

H : ∏ (n:N)gn hn ∼ hn+1 fn,

such that each of the squares in the diagram

A0 A1 A2 · · ·

B0 B1 B2 · · ·

h0

f0

h1

f1

h2

f2

g0 g1 g2

is a pullback square. We define

cart(A,B) :≡ ∑(h:∏ (n:N)An→Bn)

∑(H:∏ (n:N)gnhn∼hn+1 fn)∏ (n:N)is-pullback(hn, fn, Hn),

and we writeCart(B) :≡ ∑(A:Seq)cart(A,B).

Definition 22.3.5. We define a map

cart-map(B) :(

∑(X′ :U )X′ → X

)→ Cart(B).

which associates to any morphism h : X′ → X a cartesian transformation of type sequences intoB.

Theorem 22.3.6. The operation cart-map(B) is an equivalence.

Page 192: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

182 CHAPTER V. HOMOTOPY QUOTIENTS

22.4 The flattening lemma for sequential colimits

The flattening lemma for sequential colimits essentially states that sequential colimits commutewith Σ.

Lemma 22.4.1. Consider

B : ∏ (n:N)An → U

g : ∏ (n:N)∏ (x:An)Bn(x) ' Bn+1( fn(x)).

and suppose P : A∞ → U is the unique family equipped with

e : ∏ (n:N)Bn(x) ' P(seq-in(n, x))

and homotopies Hn(x) witnessing that the square

Bn(x) Bn+1( fn(x))

P(seq-in(n, x)) P(seq-in(n + 1, fn(x)))

gn(x)

en(x) en+1( fn(x))

trP(seq-glue(n,x))

commutes. Then ∑(t:A∞) P(t) satisfies the universal property of the sequential colimit of the type sequence

∑(x:A0)B0(x) ∑(x:A1)

B1(x) ∑(x:A2)B2(x) · · · .

tot f0(g0) tot f1

(g1) tot f2(g2)

In the following theorem we rephrase the flattening lemma in using cartesian transformationsof type sequences.

Theorem 22.4.2. Consider a commuting diagram of the form

A0 A1 A2 · · ·

X

B0 B1 B2 · · ·

Y

If each of the vertical squares is a pullback square, and Y is the sequential colimit of the type sequence Bn,then X is the sequential colimit of the type sequence An.

Corollary 22.4.3. Consider a commuting diagram of the form

A0 A1 A2 · · ·

X

B0 B1 B2 · · ·

Y

Page 193: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

22. EXERCISES 183

If each of the vertical squares is a pullback square, then the square

A∞ X

B∞ Y

is a pullback square.

Exercises

22.1 Show that the sequential colimit of a type sequence

A0 A1 A2 · · ·f0 f1 f2

is equivalent to the sequential colimit of its shifted type sequence

A1 A2 A3 · · · .f1 f2 f3

22.2 Consider a type sequence

A0 A1 A2 · · ·f0 f1 f2

and suppose that fn ∼ constan+1 for some an : ∏ (n:N)An. Show that the sequential colimitis contractible.

22.3 Define the ∞-sphere S∞ as the sequential colimit of

S0 S1 S2 · · ·f0 f1 f2

where f0 : S0 → S1 is defined by f0(02) ≡ inl(?) and f0(12) ≡ inr(?), and fn+1 : Sn+1 →Sn+2 is defined as Σ( fn). Use Exercise 22.2 to show that S∞ is contractible.

22.4 Consider a type sequence

A0 A1 A2 · · ·f0 f1 f2

in which fn : An → An+1 is weakly constant in the sense that

∏ (x,y:An) fn(x) = fn(y)

Show that A∞ is a mere proposition.

23 The homotopy image of a map

23.1 The universal property of the image of a map

In this section we will construct the homotopy image of an arbitrary map f : A→ X. The idea ofthe image of f is that it is in a way the least subtype of X that contains all the values of f . More

Page 194: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

184 CHAPTER V. HOMOTOPY QUOTIENTS

precisely, the image of f is an embedding i : im( f ) → X that fits in a commuting triangle

A im( f )

X

q

f i

and satisfies the universal property of the image inclusion of f . Informally, the universal propertyof the image asserts that there is a unique map h : im( f )→ B for which the diagram

A B

im( f )

X

q

f m

h

i

commutes. Note that there is quite a lot of information in this diagram: not only are there thethree small commuting triangles; there is also the large commuting triange in the back, and thereis a three-dimensional solid filling the space between the four triangles. We make the followingdefinition, in order to express the universal property of the image efficiently.

Definition 23.1.1. Let f : A → X and g : B → X be maps. A morphism from f to g over Xconsists of a map h : A→ B equipped with a homotopy H : f ∼ g h witnessing that the triangle

A B

X

h

f g

commutes. Thus, we define the type

homX( f , g) :≡ ∑(h:A→B) f ∼ g h.

Composition of morphisms over X is defined by

(k, K) (h, H) :≡ (k h, H (K · h)).

Definition 23.1.2. Consider a commuting triangle

A I

X

q

f i

with H : f ∼ i q, where i is an embedding. We say that i has the universal property of theimage of f if the map

– (q, H) : homX(i, m)→ homX( f , m)

is an equivalence for every embedding m : B→ X.

Page 195: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

23. THE HOMOTOPY IMAGE OF A MAP 185

Remark 23.1.3. Consider a commuting triangle

A I

X

q

f i

with H : f ∼ i q, where i is an embedding. Then it is not hard to see that the embedding isatisfies the universal property of the image inclusion if and only if for every commuting triangle

A B

Xf

g

m

with G : f ∼ m g, where m is an embedding, the type of quadruples (h, K, L, M) consisting of

(i) a map h : I → B,

(ii) a homotopy K : i ∼ m h witnessing that the triangle

I B

X

h

i m

commutes,

(iii) a homotopy L : g ∼ h q witnessing that the triangle

A I

B

q

g h

commutes,

(iv) a homotopy M : H (K · q) ∼ G (m · L) witnessing that the square

f m g

i q m h g

H

G

m·L

K·q

commutes,

is contractible. However, the situation is in fact much simpler, because the type homX( f , m) is aproposition whenever m is an embedding.

Lemma 23.1.4. For any f : A → X and any embedding m : B → X, the type homX( f , m) is aproposition.

Page 196: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

186 CHAPTER V. HOMOTOPY QUOTIENTS

Proof. Recall from Exercise 12.14 that the type homX( f , m) is equivalent to the type

∏ (x:X)fib f (x)→ fibm(x).

Therefore it suffices to show that this type is a proposition. Recall from Corollary 10.3.7 thata map is an embedding if and only if its fibers are propositions. Thus we see that the type∏ (x:X)fib f (x)→ fibm(x) is a product of propositions, hence it is a proposition by Theorem 12.1.3.

Proposition 23.1.5. Consider a commuting triangle

A I

X

q

f i

with H : f ∼ i q, where i is an embedding. Then the following are equivalent:

(i) The embedding i satisfies the universal property of the image inclusion of f .

(ii) For every embedding m : B→ X there is a map

homX( f , m)→ homX(i, m).

Proof. Since homX( f , m) is a proposition for every every embedding m : B → X, the claimfollows immediately by Exercise 12.5.

Just as in the cases for pullbacks and pushouts, the universal property of the image impliesthat the image is determined uniquely. We will show here that the type of image factoriza-tions of any map is a proposition. In §23.4 we will construct the image, after constructing thepropositional truncation.

Proposition 23.1.6. Let f be a map, and consider two commuting triangles

A B A B′

X Xf

q

i f

q′

i′

with I : f ∼ i q and I′ : f ∼ i′ q′, in which i and i′ are assumed to be embeddings. Moreover, consider

(h, H) : homX(i, i′)

equipped with an identification (h, H) (q, I) = (q′, I′) in homX( f , i′). Then, if any two of the followingproperties hold, so does the third:

(i) The embedding i satisfies the universal property of the image inclusion of f .

(ii) The embedding i′ satisfies the universal property of the image inclusion of f .

(iii) The map h is an equivalence.

Page 197: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

23. THE HOMOTOPY IMAGE OF A MAP 187

Proof. Consider an embedding m : C → X. Then we have a commuting triangle

homX(i′, m) homX(i, m)

homX( f , m),

–(h,H)

–(q′ ,I′) –(q,I)

so it follows that if any two of these maps are equivalences, then so is the third. The claim nowfollows by the observation that – (h, H) is an equivalence for every embedding m : C → X ifand only if h is an equivalence.

Corollary 23.1.7. Consider two image factorizations

A B A B′

X Xf

q

i f

q′

i′

of a map f , with I : f ∼ i q and I′ : f ∼ i′ q′. Then the type of (e, H) : homX(i, i′) in which e is anequivalence, equipped with an identification

(e, H) (q, I) = (q′, I′)

in homX( f , i′), is contractible.

23.2 The universal property of propositional truncation

An important special case of the homotopy image of a map is the image of the terminal projection

const? : A→ 1,

which results in an embedding I → 1. Embeddings into the unit type are in fact just propositions.To see this, note that

∑(A:U )∑( f :A→1)is-emb( f ) ' ∑(A:U )is-emb(const?)

' ∑(A:U )∏ (x:1)is-prop(fibconst?(x))

' ∑(A:U )is-prop(fibconst?(?))

' ∑(A:U )is-prop(A).

Therefore, the universal property of the image of the map A→ 1 is equivalently described as aproposition P satisfying the universal property of the propositional truncation:

Definition 23.2.1. Let A be a type, and let P be a proposition that comes equipped with a mapf : A→ P. We say that f : A→ P satisfies the universal property of propositional truncationof A if for every proposition Q, the precomposition map

– f : (P→ Q)→ (A→ Q)

is an equivalence.

Page 198: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

188 CHAPTER V. HOMOTOPY QUOTIENTS

Proposition 23.2.2. Let A be a type, and consider a commuting triangle

A

P P′

f f ′

h

where P and P′ are propositions. If any two of the following three assertions hold, so does the third:

(i) The map f satisfies the universal property of the propositional truncation of A.

(ii) The map f ′ satisfies the universal propertyof the propositional truncation of A.

(iii) The map h is an equivalence.

Proof. Note that the map h : P→ P′ is an equivalence if and only if for every proposition Q, theprecomposition map

– h : (P′ → Q)→ (P→ Q)

is an equivalence. Thus, the claim follows by observing that for every proposition Q we have thetriangle

(P′ → Q) (P→ Q)

(A→ Q).

–h

– f ′ – f

23.3 Constructing the propositional truncation

The propositional truncation can be used to construct the image of a map, so we constructthat first. We construct the propositional truncation of A via a construction called the joinconstruction, as the colimit of the sequence of join-powers of A

A A ∗ A A ∗ (A ∗ A) · · ·

The join-powers of A are defined recursively on n, by taking1

A∗0 :≡ ∅

A∗1 :≡ A

A∗(n+2) :≡ A ∗ A∗(n+1).

We will write A∗∞ for the colimit of the sequence

A A ∗ A A ∗ (A ∗ A) · · · .inr inr inr

1In this definition, the case A∗1 :≡ A is slightly redundant because we have an equivalence

A ∗ ∅ ' A.

Nevertheless, it is nice to have that A∗1 ≡ A.

Page 199: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

23. THE HOMOTOPY IMAGE OF A MAP 189

The sequential colimit A∗∞ comes equipped with maps in-seqn : A∗(n+1) → A∗∞, and we willwrite

η :≡ in-seq0 : A→ A∗∞.

Our goal is to show A∗∞ is a proposition, and that η : A→ A∗∞ satisfies the universal propertyof the propositional truncation of A. Before showing that A∗∞ is indeed a proposition, let usshow in two steps that for any proposition P, the map

(A∗∞ → P)→ (A→ P)

is indeed an equivalence.

Lemma 23.3.1. Suppose f : A→ P, where A is any type and P is a proposition. Then the precompositionfunction

– inr : (A ∗ B→ P)→ (B→ P)

is an equivalence, for any type B.

Proof. Since the precomposition function

– inr : (A ∗ B→ P)→ (B→ P)

is a map between propositions, it suffices to construct a map

(B→ P)→ (A ∗ B→ P).

Let g : B→ P. Then the square

A× B B

A P

pr2

pr1 g

f

commutes since P is a proposition. Therefore we obtain a map A ∗ B → P by the universalproperty of the join.

Proposition 23.3.2. Let A be a type, and let P be a proposition. Then the function

– η : (A∗∞ → P)→ (A→ P)

is an equivalence.

Proof. Since the map– η : (A∗∞ → P)→ (A→ P)

is a map between propositions, it suffices to construct a map in the converse direction.Let f : A→ P. First, we show by recursion that there are maps

fn : A∗(n+1) → P.

The map f0 is of course just defined to be f . Given fn : A∗(n+1) we obtain fn+1 : A ∗ A∗(n+1) → Pby Lemma 23.3.1. Because P is assumed to be a proposition it is immediate that the maps fnform a cocone with vertex P on the sequence

A A ∗ A A ∗ (A ∗ A) · · · .inr inr inr

From this cocone we obtain the desired map (A∗∞ → P).

Page 200: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

190 CHAPTER V. HOMOTOPY QUOTIENTS

Proposition 23.3.3. The type A∗∞ is a proposition for any type A.

Proof. By Theorem 10.1.3 it suffices to show that

A∗∞ → is-contr(A∗∞).

Since the type is-contr(A∗∞) is already known to be a proposition by Exercise 12.2, it followsfrom Proposition 23.3.2 that it suffices to show that

A→ is-contr(A∗∞).

Let x : A. To see that A∗∞ is contractible it suffices by Exercise 22.2 to show that inr :A∗n → A∗(n+1) is homotopic to the constant function constinl(x). However, we get a homotopyconstinl(x) ∼ inr immediately from the path constructor glue.

All the definitions are now in place to define the propositional truncation of a type.

Definition 23.3.4. For any type A we define the type

‖A‖−1 :≡ A∗∞,

and we define η : A→ ‖A‖−1 to be the constructor in-seq0 of the sequential colimit A∗∞. Oftenwe simply write ‖A‖ for ‖A‖−1.

The type ‖A‖−1 is a proposition by Proposition 23.3.3, and

η : A→ ‖A‖−1

satisfies the universal property of propositional truncation by Proposition 23.3.2.

Proposition 23.3.5. The propositional truncation operation is functorial in the sense that for any mapf : A→ B there is a unique map ‖ f ‖ : ‖A‖ → ‖B‖ such that the square

A B

‖A‖ ‖B‖

f

η η

‖ f ‖

commutes. Moreover, there are homotopies

‖idA‖ ∼ id‖A‖

‖g f ‖ ∼ ‖g‖ ‖ f ‖.

Proof. The functorial action of propositional truncation is immediate by the universal propertyof propositional truncation. To see that the functorial action preserves the identity, note that thetype of maps ‖A‖ → ‖A‖ for which the square

A A

‖A‖ ‖A‖

id

η η

commutes is contractible. Since this square commutes for both ‖id‖ and for id, it must be thatthey are homotopic. The proof that the functorial action of propositional truncation preservescomposition is similar.

Page 201: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

23. THE HOMOTOPY IMAGE OF A MAP 191

23.4 The image of a map

The image of a map f : A→ X can now be defined using the propositional truncation:

Definition 23.4.1. For any map f : A→ X we define the image of f to be the type

im( f ) :≡ ∑(x:X)‖fib f (x)‖.

Furthermore, we define

(i) The image inclusioni f : im( f )→ X

to be the projection pr1.

(ii) The mapq f : A→ im( f )

to be the map given by q f (x) :≡ ( f (x), η(x, refl f (x))).

(iii) The homotopy I f : f ∼ i f q f witnessing that the triangle

A im( f )

X

q f

f i f

commutes, to be given by I f (x) :≡ refl f (x).

Proposition 23.4.2. The image inclusion i f : im( f )→ X of any map f : A→ X is an embedding.

Proof. The fiber of i f at x : X is equivalent to the type ‖fib f (x)‖. In particular we see that thefibers are propositions, so i f is an embedding.

Theorem 23.4.3. The image inclusion i f : im( f ) → X of any map f : A → X satisfies the universalproperty of the image inclusion of f .

Proof. Consider an embedding m : B→ X. Note that we have a commuting square

homX(i f , m) homX( f , m)

(∏ (x:X)fibi f (x)→ fibm(x)

) (∏ (x:X)fib f (x)→ fibm(x)

)h 7→λx. hxϕx

The vertical maps are of the form

(h, H) 7→ λx. λ(y, p). (h(y), H(y)−1 p),

and they are both equivalences. The map

ϕx : fib f (x)→ fibi f (x)

given by ϕx(a, p) :≡ ((h(a), η(a, p)), p) is a propositional truncation for every x : X. Therefore itfollows that the map

(fibi f (x)→ fibm(x))→ (fib f (x)→ fibm(x))

is an equivalence, for every x : X. Thus we conclude that the bottom map in the above square isan equivalence, which implies that the top map is an equivalence.

Page 202: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

192 CHAPTER V. HOMOTOPY QUOTIENTS

23.5 Surjective maps

Another application of the propositional truncation is the notion of surjective map.

Definition 23.5.1. A map f : A→ B is said to be surjective if there is a term of type

is-surj( f ) :≡ ∏ (y:B)‖fib f (b)‖.

Example 23.5.2. Any equivalence is a surjective map, and so is any map that has a section (thoseare sometimes called split epimorphisms). Other examples include the base point inclusion1→ Sn for any n ≥ 1.

Proposition 23.5.3. Consider a map f : A→ B. Then the following are equivalent:

(i) The map f : A→ B is surjective.

(ii) For any family P of propositions over B, the precomposition map

– f :(

∏ (y:B)P(y))→(

∏ (x:A)P( f (x)))

is an equivalence.

Proof. Suppose first that f is surjective, and consider the commuting square(∏ (y:B)P(y)

) (∏ (x:A)P( f (x))

)(

∏ (y:B)‖fib f (y)‖ → P(y)) (

∏ (y:B)fib f (y)→ P(y))

– f

h 7→λy. consth(y)

h 7→λy. h(y)η

h 7→λx. h( f (x),(x,refl f (x)))

In this square, the bottom map is an equivalence by the universal property of the propositionaltruncation of fib f (y). The map on the right is also easily seen to be an equivalence. Furthermore,the map on the left is an equivalence by the assumption that f is surjective, from which it followsthat the types ‖fib f (y)‖ are contractible. Therefore it follows that the top map is an equivalence,which completes the proof that (i) implies (ii).

For the converse, it follows immediately from the assumption (ii) that

– f :(

∏ (y:B)‖fib f (y)‖)→(

∏ (x:A)‖fib f ( f (x))‖)

is an equivalence. Hence it suffices to construct a term of type ‖fib f ( f (x))‖ for each x : A. Thisis easy, because we have

η(x, refl f (x)) : ‖fib f ( f (x))‖. .

Theorem 23.5.4. Consider a commuting triangle

A B

X

q

f m

in which m is an embedding. Then the following are equivalent:

Page 203: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

23. THE HOMOTOPY IMAGE OF A MAP 193

(i) The embedding m satisfies the universal property of the image inclusion of f .

(ii) The map q is surjective.

Proof. First assume that m satisfies the universal property of the image inclusion of f , andconsider the composite function

(∑(y:B) ‖fibq(y)‖

)B X.

pr1 m

Note that m pr1 is a composition of embeddings, so it is an embedding. By the universalproperty of m there is a unique map h for which the triangle

B ∑(y:B) ‖fibq(y)‖

X

m

h

mpr1

commutes. Now note that pr1 h is a map such that m (pr1 h) ∼ m. The identity functionis another map for which we have m id ∼ m, so it follows by uniqueness that pr1 h ∼ id. Inother words, the map h is a section of the projection map. Therefore we obtain by Exercise 12.17a dependent function

∏ (b:B)‖fibq(b)‖,

showing that q is surjective.For the converse, suppose that q is surjective. To prove that m satisfies the universal property

of the image factorization of f , it suffices to construct an equivalence

homX( f , m′)→ homX(m, m′),

for any embedding m′ : B′ → X. To see that there is such an equivalence, we make the followingcalculation

homX(m, m′) ' ∏ (x:X)fibm(x)→ fibm′(x)

' ∏ (b:B)fibm′(m(b))

' ∏ (a:A)fibm′(m(q(a)))

' ∏ (a:A)fibm′( f (a))

' ∏ (x:X)fib f (x)→ fibm′(x)

' homX( f , m′).

In this calculation, the first and last equivalence hold by Exercise 12.14. The second and secondto last equivalences hold by Exercise 12.20. The third equivalence holds by Proposition 23.5.3,since q is assumed to be surjective, and the fourth equivalence holds since we have a homotopyf ∼ m f .

Corollary 23.5.5. Every map factors uniquely as a surjective map followed by an embedding.

Page 204: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

194 CHAPTER V. HOMOTOPY QUOTIENTS

Proof. Consider a map f : A→ X, and two factorizations

A B A B′

X X

q

f i

q′

f i′

of f where m and m′ are embeddings, and q and q′ are surjective. Then both m and m′ satisfythe universal property of the image factorization of f by Theorem 23.5.4. Now it follows byCorollary 23.1.7 that the type of (e, H) : homX(i, i′) in which e is an equivalence, equipped withan identification

(e, H) (q, I) = (q′, I′)

in homX( f , i′), is contractible.

23.6 Logic in type theory

Note that, given a family of propositions P over a type A, the type ∑(a:A) P(a) isn’t necessarilya proposition. Instead, we think of ∑(a:A) P(a) of the subtype of A containing the terms thatsatisfies P. Using the propositional truncation we can assert that there exists a term in A thatsatisfies P without requiring one to construct it.

Definition 23.6.1. Let P : A→ Prop be a family of propositions over a type A. Then we define

∃(a:A)P(a) :≡ ‖∑(a:A)P(a)‖.

Similarly, we can define the disjunction of two propositions P and Q to be the proposition‖P + Q‖, which clearly satisfies the universal property of disjunction2. In the following table wegive an overview of the logical connectives on propositions.

Logical connective Interpretation in HoTT

> 1⊥ ∅P ∧Q P×QP ∨Q ‖P + Q‖P→ Q P→ QP↔ Q P ' Q¬P P→ ∅∀x.P(x) ∏ (x:A)P(x)∃x.P(x) ‖∑(x:A) P(x)‖∃!x.P(x) is-contr(∑(x:A) P(x))

2Alternatively, we have shown in Exercise 18.2 that the join P ∗ Q also is a proposition that satisfies the universalproperty of disjunction.

Page 205: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

23. EXERCISES 195

Exercises

23.1 Show that if f : A → X is an embedding, then f itself satisfies the universal property ofthe image inclusion of f .

23.2 Show that‖A‖ ' ∏ (P:Prop)(A→ P)→ P

for any type A : U . This is called the impredicative encoding of the propositional trunca-tion.

23.3 For any B : A→ U , construct an equivalence(∃(a:A)‖B(a)‖

)' ‖∑(a:A)B(a)‖

23.4 Let P0 P1 P2 · · · be a sequence of propositions. Show that

colimn(Pn) ' ∃(n:N)Pn.

23.5 Show that the relation x, y 7→ ‖x = y‖ is an equivalence relation, on any type.23.6 Let f : A→ B be a map. Show that the following are equivalent:

(i) The commuting square

A ‖A‖

B ‖B‖.

f ‖ f ‖

is a pullback square.

(ii) There is a term of type A→ is-equiv( f ).

(iii) The commuting square

A× A B× B

A B

f× f

pr1 pr1

f

is a pullback square.

23.7 Consider a pullback square

A′ A

B′ B,

f ′

p

f

q

in which q : B′ → B is surjective. Show that if f ′ : A′ → B′ is an embedding, then so isf : A→ B.

23.8 Show that a type A is a proposition if and only if the map inl : A→ A ∗ A is an equivalence.23.9 Let A be a type, and let P be a proposition.

(a) Show that inl : P→ P ∗ A is an embedding.(b) Show that inl : P→ P ∗ A is an equivalence if and only if ‖A‖ → P holds.

Page 206: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

196 CHAPTER V. HOMOTOPY QUOTIENTS

23.10 Consider a family of diagrams of the form

Ai C X

Bi D Y

fi g h

indexed by i : I, in which the left squares are pullback squares, and assume that the inducedmap (

∑(i:I)Bi

)→ D

is surjective. Show that the following are equivalent:(i) For each i : I the outer rectangle is a pullback square.

(ii) The right square is a pullback square.Hint: By Theorem 17.6.3 it suffices to prove this equivalence for a single diagram of theform

A C X

B D Y

f g h

where the map B→ D is assumed to be surjective.23.11 (a) Consider a map f : A→ B. Show that the following are equivalent:

(i) The map f is surjective.(ii) For every set C, the precomposition function

– f : (B→ C)→ (A→ C)

is an embedding.Hint: To show that (ii) implies (i), use the assumption with the set C ≡ Prop.

(b) Give an example of a surjective map f : A→ B and a type C which is not a set, suchthat the precomposition function

– f : (B→ C)→ (A→ C)

is not an embedding.23.12 Consider a pushout square

S B

A X.

f

g

j

i

(a) Show that if f is surjective, then so is j.(b) Show that the two small squares in the diagram

S B

im( f ) im(j)

A X

g

q f qj

i f ij

i

Page 207: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

24. SET QUOTIENTS 197

are both pushout squares, and that the bottom square is also a pullback square.

23.13 Consider a pullback square

E′ E

B′ B

p′

g

p

f

in which p is assumed to be surjective. Show that p′ is also surjective, and show that thefollowing are equivalent:

(i) The map f is an equivalence.

(ii) The map g is an equivalence.

23.14 Consider a map f : A→ B. Show that the following are equivalent:

(i) f is an equivalence.

(ii) f is both surjective and an embedding.

24 Set quotients

In this section we construct the quotient of a type by an equivalence relation. By an equivalencerelation we understand a binary relation R : A → (A → Prop) which is reflexive, symmetric,and transitive. In particular, we note that equivalence relations take values in Prop. The quotientA/R is constructed as the type of equivalence classes, which is just the image of the mapR : A→ (A→ Prop). Thus, our construction of the quotient by an equivalence relation is verymuch like the classical construction of a quotient set. Examples of set quotients are abundant.We cover two of them: the type of rational numbers and the set truncation of a type.

There is, however, a subtle issue with our construction of the set quotient as the image of themap R : A→ (A→ Prop). What is the universe level of the quotient A/R? Let us suppose thatU is a universe that contains A and each R(x, y). Then Prop, the type of propositions in U , is atype in the universe U+, constructed in Remark 6.2.1. Therefore the type PropA as well as thequotient A/R are also types in U+. That seems unfortunate, because in Zermelo-Fraenkel settheory the quotient of a set by an equivalence relation is an ordinary set, and not a more generalclass.

In Zermelo-Fraenkel set theory quotients are are sets because of the axiom schema of replace-ment. The replacement axioms assert that the image of any function is again a set. This leads usto wonder about a type theoretical variant of the replacement axioms. Indeed, there is such avariant. The type theoretic replacement property asserts that for any map f : A→ B from a typeA in U to a type B of which the identity types are equivalent to types in U , the image of f is alsoequivalent to a type in U , and in fact this property is a theorem. We prove it in Theorem 24.5.22,using the univalence axiom and a new construction of the image of a map.

24.1 Equivalence relations

Definition 24.1.1. Let R : A→ (A→ Prop) be a binary relation valued in the propositions. Wesay that R is an equivalence relation if R comes equipped with

ρ : ∏ (x:A)R(x, x)

σ : ∏ (x,y:A)R(x, y)→ R(y, x)

Page 208: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

198 CHAPTER V. HOMOTOPY QUOTIENTS

τ : ∏ (x,y,z:A)R(x, y)→ (R(y, z)→ R(x, z)),

witnessing that R is reflexive, symmetric, and transitive.

Definition 24.1.2. Let R : A → (A → Prop) be an equivalence relation. The equivalence classof x : A is defined to be

[x]R :≡ R(x).

More generally, a subtype P : A→ Prop is said to be an equivalence class if it satisfies

is-equivalence-class(P) :≡ ∃(x:A)P = R(x).

Furthermore, we define A/R to be the type of equivalence classes, i.e., we define

A/R :≡ ∑(P:A→Prop)is-equivalence-class(P).

In other words, A/R is the image of the map [−]R : A → (A → Prop). In the followingproposition we characterize the identity type of A/R. As a corollary, we obtain equivalences

([x]R = [y]R) ' R(x, y),

justifying that the quotient A/R is defined to be the type of equivalence classes. Note that in ourcharacterization of the identity type of A/R we make use of the univalence axiom.

Proposition 24.1.3. Let R : A→ (A→ Prop) be an equivalence relation. Furthermore, consider x : Aand an equivalence class P. Then the canonical map

([x]R = P)→ P(x)

is an equivalence.

Proof. By Theorem 9.2.2 it suffices to show that the total space

∑(P:A/R)P(x)

is contractible. The center of contraction is of course [x]R, which satisfies [x]R(x) by reflexivity ofR. It remains to construct a contraction. Since ∑(P:A/R) P(x) is a subtype of A/R, we construct acontraction by showing that

[x]R = P

whenever P(x) holds. Recall that P is an equivalence relation, i.e., that there exists a y : A suchthat P = [y]R. Note that our goal is a proposition, so we may assume that we have such a y. Thenwe obtain that R(x, y) holds from the assumption that P(x) holds. Thus, we have to show that

[x]R = [y]R

given that R(x, y) holds. By function extensionality and the univalence axiom, it is equivalent toshow that

∏ (z:A)R(x, z) ' R(y, z)

We get a function R(x, z)→ R(y, z) by transitivity, since R(y, x) holds by symmetry. Conversely,we get a function R(y, z)→ R(x, z) directly by transitivity. Thus, we obtain that

R(x, z)↔ R(y, z)

for any z : A, which is sufficient to prove that they are equivalent because R is valued in Prop.

Page 209: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

24. SET QUOTIENTS 199

Corollary 24.1.4. Consider an equivalence relation R on a type A, and let x, y : A. Then there is anequivalence

([x]R = [y]R) ' R(x, y).

Proof. By Proposition 24.1.3 we have an equivalence

([x]R = [y]R) ' R(y, x).

Moreover, R(y, x) is equivalent to R(x, y) by symmetry of R.

24.2 The universal property of set quotients

The quotient A/R is constructed as the image of R, so we obtain a commuting triangle

A A/R

PropA,

qR

R iR

and the embedding iR : A/R→ PropA satisfies the universal property of the image of R. Thisuniversal property is, however, not the usual universal property of the quotient.

Definition 24.2.1. Consider a map q : A→ B into a set B satisfying the property that f (x) = f (y)whenever R(x, y) holds. We say that q satisfies the universal property of the set quotient by Rif for every map f : A→ X into a set X such that f (x) = f (y) whenever R(x, y) holds, there is aunique extension

A

B X.

qf

Remark 24.2.2. Formally, we express the universal property of the quotient by R as follows.Consider a map q : A→ B that satisfies the property that

H : ∏ (x,y:A)R(x, y)→ ( f (x) = f (y)).

Then there is for any set X a map

q∗ : (B→ X)→(

∑( f :A→X)∏ (x,y:A)R(x, y)→ ( f (x) = f (y)))

.

This map takes a function h : B→ X to the pair

q∗(h) :≡ (h q, λx. λy. λr. aph(Hx,y(r))).

The universal property of the set quotient of R asserts that the map q∗ is an equivalence for everyset X. It is important to note that the universal property of set quotients is formulated withrespect to sets.

Theorem 24.2.3. Let R : A→ (A→ Prop) be an equivalence relation, and consider a map q : A→ Binto a set B. Then the following are equivalent.

Page 210: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

200 CHAPTER V. HOMOTOPY QUOTIENTS

(i) The map q satisfies the property thatq(x) = q(y)

for every x, y : A for which R(x, y) holds, and moreover q satisfies the universal property of the setquotient of R.

(ii) The map q is surjective and effective, which means that for each x, y : A we have an equivalence

(q(x) = q(y)) ' R(x, y).

(iii) The map R : A→ (A→ Prop) extends along q to an embedding

A B

PropA

q

R i

and the embedding i satisfies the universal property of the image inclusion of R.

Proof. We first show that (ii) is equivalent to (iii), since this is the easiest part. After that, we willshow that (i) is equivalent to (ii).

Assume that (ii) holds. Then q is surjective by Theorem 23.5.4. Moreover, we have

R(x, y) ' R(x) = R(y)

' i(q(x)) = i(q(y))

' q(x) = q(y)

In this calculation, the first equivalence holds by Corollary 24.1.4; the second equivalence holdssince we have a homotopy R ∼ i q; and the third equivalence holds since i is an embedding.This completes the proof that (ii) implies (iii).

Next, we show that (iii) implies (ii). Assuming (iii), we define a map

i : B→ PropA

by i(b, a) :≡ b = q(a). Then the triangle

A B

PropA

q

R i

commutes, since we have an equivalence

i(q(a), a′) ' R(a, a′)

for each a, a′ : A. To show that i is an embedding, it suffices to show that i is injective, i.e., that

∏ (b,b′ :B)(i(b) = i(b′))→ (b = b′)

Page 211: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

24. SET QUOTIENTS 201

Note that this is a property, and that q is assumed to be surjective. Hence by Proposition 23.5.3 itis equivalent to show that

∏ (a,a′ :A)(i(q(a)) = i(q(a′)))→ (q(a) = q(a′)).

Since R ∼ i q, and q(a) = q(a′) is assumed to be equivalent to R(a, a′), it suffices to show that

∏ (a,a′ :A)(R(a) = R(a′))→ R(a, a′),

which follows directly from Corollary 24.1.4. Thus we have shown that the factorization R ∼ i qfactors R as a surjective map followed by an injective map. We conclude by Theorem 23.5.4 thatthe embedding i satisfies the universal property of the image factorization of R, which finishesthe proof that (iii) implies (ii).

Now we show that (i) implies (ii). To see that q is surjective if it satisfies the assumptions in(i), consider the image factorization

A im(q)

B.

q

qq

iq

We claim that the map iq has a section. To see this, we first note that we have

qq(x) = qq(y)

for any x, y : A satisfying R(x, y), because if R(x, y) holds, then q(x) = q(y) and henceiq(qq(x)) = iq(qq(y)) holds and iq is an embedding. Since im(q) is a set, we may apply theuniversal property of q and we obtain a unique extension of qq along q

A

B im(q).

qqq

h

Now we observe that the composite iq h is an extension of q along q, so it must be the identityfunction by uniqueness. Thus we have established that h is a section of iq. Now it follows fromthe fact that iq is an embedding with a section, that iq is an equivalence. We conclude that q issurjective, because q is the composite iq qq of a surjective map followed by an equivalence.

Now we have to show that q(x) = q(y) is equivalent to R(x, y). We first apply the universalproperty of q to obtain for each x : A an extension of R(x) along q

A

B Prop.

qR(x)

R(x)

Since the triangle commutes, we have an equivalence R(x, q(x′)) ' R(x, x′) for each x′ : A. Nowwe apply Theorem 9.2.2 to see that the canonical family of maps

∏ (y:B)(q(x) = y)→ R(x, y)

Page 212: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

202 CHAPTER V. HOMOTOPY QUOTIENTS

is a family of equivalences. Thus, we need to show that the type ∑(y:B) R(x, y) is contractible.For the center of contraction, note that we have q(x) : B, and the type R(x, q(x)) is equivalent tothe type R(x, x), which is inhabited by reflexivity of R. To construct the contraction, it suffices toshow that

∏ (y:B)R(x, y)→ (q(x) = y).

Since this is a property, and since we have already shown that q is a surjective map, we mayapply Proposition 23.5.3, by which it suffices to show that

∏ (x′ :A)R(x, q(x′))→ (q(x) = q(x′)).

Since R(x, q(x′)) ' R(x, x′), this is immediate from our assumption on q. Thus we obtain thecontraction, and we conclude that we have an equivalence R(x, y) ' (q(x) = y) for each y : B. Itfollows that we have an equivalence

R(x, y) ' (q(x) = q(y))

for each x, y : A, which completes the proof that (i) implies (ii).It remains to show that (iii) implies (i). Assume (iii), and let f : A→ X be a map into a set X,

satisfying the property that

∏ (a,a′ :A)R(a, a′)→ ( f (a) = f (a′)).

Our goal is to show that the type of extensions of f along q is contractible. By Exercise 23.11.a itfollows that there is at most one such an extension, so it suffices to construct one.

In order to construct an extension, we will construct for every b : B a term x : X satisfying theproperty

P(x) :≡ ∃(a:A)( f (a) = x) ∧ (q(a) = b).

Before we make this construction, we first observe that there is at most one such x, i.e., that thetype of x : X satisfying P(x) is in fact a proposition. To see this, we need to show that x = x′ forany x, x′ : X satisfying P(x) and P(x′). Since X is assumed to be a set, our goal of showing thatx = x′ is a property. Therefore we may assume that we have a, a′ : A satisfying

f (a) = x q(a) = b

f (a′) = x′ q(a′) = b.

It follows from these assumptions that q(a) = q(a′), and hence that R(a, a′) holds. This in turnimplies that f (a) = f (a′), and hence that x = x′.

Now let b : B. Our goal is to construct an x : X that satisfies the property

∃(a:A)( f (a) = x) ∧ (q(a) = b).

Since q is assumed to be surjective, we have ‖fibq(b)‖. Moreover, since we have shown that atmost one x : X exists with the asserted property, we get to assume that we have a : A satisfyingq(a) = b. Now we see that x :≡ f (a) satisfies the desired property.

Thus, we obtain a function h : B→ X satisfying the property that for all b : B there exists ana : A such that

f (a) = h(b) and q(a) = b.

In particular, it follows that h(q(a)) = f (a) for all a : A, which completes the proof that (ii)implies (i).

Page 213: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

24. SET QUOTIENTS 203

24.3 The rational numbers

24.4 Set truncation

Lemma 24.4.1. For each type A, the relation I(−1) : A→ (A→ Prop) given by

I(−1)(x, y) :≡ ‖x = y‖

is an equivalence relation.

Proof. For every x : A we have |reflx| : ‖x = x‖, so the relation is reflexive. To see that therelation is symmetric note that by the universal property of propositional truncation there is aunique map ‖inv‖ : ‖x = y‖ → ‖y = x‖ for which the square

(x = y) (y = x)

‖x = y‖ ‖y = x‖

inv

|– | |– |

‖inv‖

commutes. This shows that the relation is symmetric. Similarly, we show by the universalproperty of propositional truncation that the relation is transitive.

Definition 24.4.2. For each type A we define the set truncation

‖A‖0 :≡ A/I(−1),

and the unit of the set truncation is defined to be the quotient map.

Theorem 24.4.3. For each type A, the set truncation satisfies the universal property of the set truncation.

24.5 Type theoretic replacement

Essentially small types and maps

It is a trivial observation, but nevertheless of fundamental importance, that by the univalenceaxiom the identity types of U are equivalent to types in U , because it provides an equivalence(A = B) ' (A ' B), and the type A ' B is in U for any A, B : U . Since the identity types of Uare equivalent to types in U , we also say that the universe is locally small.

Definition 24.5.1. (i) A type A is said to be essentially small if there is a type X : U and anequivalence A ' X. We write

ess-small(A) :≡ ∑(X:U )A ' X.

(ii) A map f : A → B is said to be essentially small if for each b : B the fiber fib f (b) isessentially small. We write

ess-small( f ) :≡ ∏ (b:B)ess-small(fib f (b)).

(iii) A type A is said to be locally small if for every x, y : A the identity type x = y is essentiallysmall. We write

loc-small(A) :≡ ∏ (x,y:A)ess-small(x = y).

Page 214: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

204 CHAPTER V. HOMOTOPY QUOTIENTS

Lemma 24.5.2. The type ess-small(A) is a proposition for any type A.

Proof. Let X be a type. Our goal is to show that the type

∑(Y:U )X ' Y

is a proposition. Suppose there is a type X′ : U and an equivalence e : X ' X′, then the map

(X ' Y)→ (X′ ' Y)

given by precomposing with e−1 is an equivalence. This induces an equivalence on total spaces(∑(Y:U )X ' Y

)'(

∑(Y:U )X′ ' Y

)However, the codomain of this equivalence is contractible by Theorem 13.1.2. Thus it follows by?? that the asserted type is a proposition.

Corollary 24.5.3. For each function f : A→ B, the type ess-small( f ) is a proposition, and for each typeX the type loc-small(X) is a proposition.

Proof. This follows from the fact that propositions are closed under dependent products, estab-lished in Theorem 12.1.3.

Theorem 24.5.4. For any small type A : U there is an equivalence

map-famA : (A→ U ) '(

∑(X:U )X → A)

.

Proof. Note that we have the function

ϕ : λB.(

∑(x:A)B(x), pr1

): (A→ U )→

(∑(X:U )X → A

).

The fiber of this map at (X, f ) is by univalence and function extensionality equivalent to the type

∑(B:A→U )∑(e:(∑(x:A) B(x))'X)pr1 ∼ f e.

By Exercise 12.14 this type is equivalent to the type

∑(B:A→U )∏ (a:A)B(a) ' fib f (a),

and by ‘type theoretic choice’, which was established in Theorem 12.2.1, this type is equivalent to

∏ (a:A)∑(X:U )X ' fib f (a).

We conclude that the fiber of ϕ at (X, f ) is equivalent to the type ess-small( f ). However, sincef : X → A is a map between small types it is essentially small. Moreover, since being essentiallysmall is a proposition by Lemma 24.5.2, it follows that fibϕ((X, f )) is contractible for everyf : X → A. In other words, ϕ is a contractible map, and therefore it is an equivalence.

Remark 24.5.5. The inverse of the map

ϕ : (A→ U )→(

∑(X:U )X → A)

.

constructed in Theorem 24.5.4 is the map (X, f ) 7→ fib f .

Page 215: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

24. SET QUOTIENTS 205

Theorem 24.5.6. Let f : A→ B be a map. Then there is an equivalence

ess-small( f ) ' is-classified( f ),

where is-classified( f ) is the type of quadruples (F, F, H, p) consisting of maps F : B→ U and F : A→∑(X:U ) X, a homotopy H : F f ∼ pr1 F, such that the commuting square

A ∑(X:U ) X

B U

F

f pr1

F

is a pullback square, as witnessed by p3. If f comes equipped with a term of type is-classified( f ), we alsosay that f is classified by the universal family.

Proof. From Exercise 12.15 we obtain that the type of pairs (F, H) is equivalent to the type offiberwise transformations

∏ (b:B)fib f (b)→ F(b).

By Theorem 17.5.3 the square is a pullback square if and only if the induced map

∏ (b:B)fib f (b)→ F(b)

is a fiberwise equivalence. Thus the data (F, F, H, pb) is equivalent to the type of pairs (F, e)where e is a fiberwise equivalence from fib f to F. By Theorem 12.2.1 the type of pairs (F, e) isequivalent to the type ess-small( f ).

Remark 24.5.7. For any type A (not necessarily small), and any B : A→ U , the square

∑(x:A) B(x) ∑(X:U ) X

A U

pr1

λ(x,y). (B(x),y)

pr1

B

is a pullback square. Therefore it follows that for any family B : A → U of small types, theprojection map pr1 : ∑(x:A) B(x)→ A is an essentially small map. To see that the claim is a directconsequence of Lemma 17.5.1 we write the asserted square in its rudimentary form:

∑(x:A) El(B(x)) ∑(X:U ) El(X)

A U .

pr1

λ(x,y). (B(x),y)

pr1

B

In the following theorem we show that a type is small if and only if its diagonal is classifiedby U .

Theorem 24.5.8. Let A be a type. The following are equivalent:

3The universal property of the pullback is not expressible by a type. However, we may take the type of p : is-equiv(h),where h : A→ B×U

(∑(X:U ) X

)is the map obtained by the universal property of the canonical pullback.

Page 216: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

206 CHAPTER V. HOMOTOPY QUOTIENTS

(i) A is locally small.

(ii) There are maps I : A× A→ U and I : A→ ∑(X:U ) X, and a homotopy H : I δA ∼ pr1 I suchthat the commuting square

A ∑(X:U ) X

A× A U

I

δA pr1

I

is a pullback square.

Proof. In Exercise 10.2 we have established that the identity type x = y is the fiber of δA at(x, y) : A × A. Therefore it follows that A is locally small if and only if the diagonal δA isessentially small. Now the result follows from Theorem 24.5.6.

Univalent universes are object classifiers

Definition 24.5.9. Consider a map p : E → B and a map f : X → Y. The type cart( f , p) ofcartesian morphisms from f to p is the type of quadruples (g, h, H, t) consisting of maps

g : Y → B

h : X → E,

a homotopy H : g f ∼ p h, and a term t witnessing that the commuting square

X E

Y B

h

f p

g

is a pullback square.

Definition 24.5.10. A map p : E → B is called an object classifier if for every map f : X → Y,the type cart( f , p) of cartesian morphisms

X E

Y B

f p

from f to p is a proposition.

Proposition 24.5.11. Consider a map p : E→ B. The following are equivalent:

(i) The map p is an object classifier.

(ii) The functiontrfibp : (x = y)→ (fibp(x) ' fibp(y))

is an equivalence.

Corollary 24.5.12. A universe is an object classifier if and only if it is univalent.

Page 217: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

24. SET QUOTIENTS 207

Smallness of images

However, the construction of the fiberwise join in Exercise 20.3 suggests that we can also definethe image of f as the infinite join power f ∗∞, where we repeatedly take the fiberwise join of fwith itself. The reasons for defining the image in this way are twofold: we will be able to usethis construction to show that the set-quotients of a small type are small, and second, we manyinteresting types appear in this construction.

Lemma 24.5.13. Consider a map f : A → X, an embedding m : U → X, and h : homX( f , m). Thenthe map

homX( f ∗ g, m)→ homX(g, m)

is an equivalence for any g : B→ X.

Proof. Note that both types are propositions, so any equivalence can be used to prove the claim.Thus, we simply calculate

homX( f ∗ g, m) ' ∏ (x:X)fib f ∗g(x)→ fibm(x)

' ∏ (x:X)fib f (x) ∗ fibg(x)→ fibm(x)

' ∏ (x:X)fibg(x)→ fibm(x)

' homX(g, m).

The first equivalence holds by Exercise 12.14; the second equivalence holds by Exercise 20.3, alsousing Theorem 12.4.1 and Exercise 12.3 where we established that that pre- and postcomposing byan equivalence is an equivalence; the third equivalence holds by Lemma 23.3.1 and Exercise 12.3;the last equivalence again holds by Exercise 12.14.

For the construction of the image of f : A→ X we observe that if we are given an embeddingm : U → X and a map (i, I) : homX( f , m), then (i, I) extends uniquely along inr : A→ A ∗X Ato a map homX( f ∗ f , m). This extension again extends uniquely along inr : A ∗X A → A ∗X(A ∗X A) to a map homX( f ∗ ( f ∗ f ), m) and so on, resulting in a diagram of the form

A A ∗X A A ∗X (A ∗X A) · · ·

U

inr inr inr

Definition 24.5.14. Suppose f : A→ X is a map. Then we define the fiberwise join powers

f ∗n : A∗nX X.

Construction. Note that the operation (B, g) 7→ (A ∗X B, f ∗ g) defines an endomorphism on thetype

∑(B:U )B→ X.

We also have (∅, ind∅) and (A, f ) of this type. For n ≥ 1 we define

A∗(n+1)X :≡ A ∗X A∗nX

f ∗(n+1) :≡ f ∗ f ∗n.

Page 218: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

208 CHAPTER V. HOMOTOPY QUOTIENTS

Definition 24.5.15. We define A∗∞X to be the sequential colimit of the type sequence

A∗0X A∗1X A∗2X · · · .inr inr

Since we have a coconeA∗0X A∗1X A∗2X · · ·

Xf ∗0

inr

f ∗1

inr

f ∗2

we also obtain a map f ∗∞ : A∗∞X → X by the universal property of A∗∞X .

Lemma 24.5.16. Let f : A→ X be a map, and let m : U → X be an embedding. Then the function

– in-seq0 : homX( f ∗∞, m)→ homX( f , m)

is an equivalence.

Theorem 24.5.17. For any map f : A→ X, the map f ∗∞ : A∗∞X → X is an embedding that satisfies theuniversal property of the image inclusion of f .

Lemma 24.5.18. Consider a commuting square

A B

C D.

(i) If the square is cartesian, B and C are essentially small, and D is locally small, then A is essentiallysmall.

(ii) If the square is cocartesian, and A, B, and C are essentially small, then D is essentially small.

Corollary 24.5.19. Suppose f : A→ X and g : B→ X are maps from essentially small types A and B,respectively, to a locally small type X. Then A×X B is again essentially small.

Lemma 24.5.20. Consider a type sequence

A0 A1 A2 · · ·f0 f1 f2

where each An is essentially small. Then its sequential colimit is again essentially small.

Theorem 24.5.21. For any map f : A→ X from a small type A into a locally small type X, the imageim( f ) is an essentially small type.

Recall that in set theory, the replacement axiom asserts that for any family of sets Xii∈Iindexed by a set I, there is a set X[I] consisting of precisely those sets x for which there exists ani ∈ I such that x ∈ Xi. In other words: the image of a set-indexed family of sets is again a set.Without the replacement axiom, X[I] would be a class. In the following corollary we establish atype-theoretic analogue of the replacement axiom: the image of a family of small types indexedby a small type is again (essentially) small.

Theorem 24.5.22. For any map f : A→ B from an essentially small type A into a locally small type B,the image of f is again essentially small.

Page 219: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

24. EXERCISES 209

Exercises

24.1 Consider a map f : A → B into a set B, and let R : A → (A → Prop) be the equivalencerelation given by

R(x, y) :≡ f (x) = f (y).

Show that the map q f : A→ im( f ) satisfies the universal property of the set quotient of R.24.2 Show that the set truncation of a loop space is a group.24.3 Recall that a normal subgroup H of a group G is a subgroup of G such that ghg−1 is in

H for every h : H and g : G. Given a normal subgroup H of G, we write G/H for thequotient of G by the equivalence relation where g ∼ g′ if and only if there is a h : H suchthat gh = g′. Show that G/H is again a group.

24.4 (a) Show that any proposition is locally small.(b) Show that any essentially small type is locally small.(c) Show that the function type A→ X is locally small whenever A is essentially small

and X is locally small.24.5 Let f : A→ B be a map. Show that the following are equivalent:

(i) The map f is locally small in the sense that for every x, y : A, the action on paths of f

ap f : (x = y)→ ( f (x) = f (y))

is an essentially small map.(ii) The diagonal δ f of f as defined in Exercise 17.2 is classified by the universal fibration.

24.6 Use Theorems 12.2.1 and 24.5.4 and Corollary 12.3.2 to show that the type

span(A, B) :≡ ∑(S:U )(S→ A)× (S→ B)

of small spans from A to B is equivalent to the type A→ (B→ U ) of small relations fromA to B.

25 Truncations

25.1 The universal property of the truncations

Definition 25.1.1. Let X be a type. A map f : X → Y into an k-type Y is said to satisfy theuniversal property of k-truncation if the precomposition map

– f : (Y → Z)→ (X → Z)

is an equivalence for every k-type Z.

Remark 25.1.2. A map f : X → Y into an k-type Y satisfies the universal property of k-truncationif of for every g : X → Z the type of extensions

X

Y Z

gf

is contractible. Indeed, the type of such extensions is the type

∑(h:Y→Z)h f ∼ g,

which is equivalent to the fiber of the precomposition map – f at g.

Page 220: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

210 CHAPTER V. HOMOTOPY QUOTIENTS

Theorem 25.1.3. Suppose the map f : X → Y into an k-type Y. The following are equivalent:

(i) The map f satisfies the universal property of k-truncation.

(ii) For any type family P of k-types over Y, the precomposition map

– f :(

∏ (y:Y)P(y))→(

∏ (x:X)P( f (x)))

is an equivalence. This property is also called the dependent universal property of the k-truncation.

Proof. The direction from (ii) to (i) is immediate, so we only have to show that (i) implies (ii).Suppose P is a family of k-truncated types over Y. Then we have a commuting square

(Y → ∑(y:Y) P(y)

) (X → ∑(y:Y) P(y)

)(

Y → Y) (

X → Y)

– f

pr1– pr1–

– f

Since the total space ∑(y:Y) P(y) is again k-truncated by Exercise 10.3, it follows by the universalproperty of the k-truncation that the top map is an equivalence, and by the universal propertythe bottom map is an equivalence too. It follows from Corollary 17.5.5 that this square is apullback square, so it induces equivalences on the fibers by Theorem 17.5.3. In particular wehave a commuting square

(∏ (y:Y)P(y)

) (∏ (x:X)P( f (x))

)

fib(pr1– )(idY) fib(pr1– )( f )

in which the left and right maps are equivalences by Exercise 12.17, and the bottom map is anequivalence as we have just established. Therefore the top map is an equivalence, so we concludethat f satisfies the dependent universal property.

Theorem 25.1.4. For any x, y : X, there is an equivalence

(|x|k+1 = |y|k+1) ' ‖x = y‖k.

Proof. Let x : X. Then we define a family Ex : ‖X‖k+1 → U≤k as the unique extension

X U≤k

‖X‖k

|– |k

y 7→‖x=y‖k

Ex

This unique extension exists by the universal property of (k + 1)-truncation, because the universeU≤k is itself a (k + 1)-truncated type by Exercise 13.1.

Page 221: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

25. TRUNCATIONS 211

To see that there is an equivalence

(|x|k = y) ' Ex(y)

for each y : ‖X‖k+1, it suffices by Theorem 9.2.2 to show that the total space

∑(y:‖X‖k+1)Ex(y)

is contractible. At the center of contraction we have (|x|k+1, |reflx|k). It remains to construct thecontraction

∏ (y:‖X‖k+1)∏ (p:Ex(y))(|x|k+1, |reflx|k) = (y, p).

We note that the type (|x|k+1, |reflx|k) = (y, p) is k-truncated, since it is an identity type in thetotal space

∑(y:‖X‖k+1)Ex(y),

which is (k + 1)-truncated by Exercise 10.3 and Theorem 10.3.2. Therefore it suffices by Theo-rem 25.1.3, applied twice, to construct a term of type

∏ (y:X)∏ (p:x=y)(|x|k+1, |reflx|k) = (|y|k+1, |p|k).

We get such an identification for each p : x = y by path induction on p.

25.2 The truncations as recursive higher inductive types

Recall from Theorem 10.3.6 that a map f : A→ B is (k + 1)-truncated if and only if the action onpaths

ap f : (x = y)→ ( f (x) = f (y))

is a k-truncated map, for each x, y : A. Moreover, in Exercise 17.2 we established that the fibersof the diagonal map δ f : A→ A×B A are equivalent to the fibers of the maps ap f , so it is alsothe case that f is (k + 1)-truncated if and only if the diagonal δ f is k-truncated.

In the following theorem, we add yet another equivalent characterization to the truncatednessof a map. We will use this theorem in two ways. First, a simple corollary gives a usefulcharacterization of k-truncated types. Second, we will use this theorem to derive an eliminationprinciple of the (k + 1)-sphere that can be applied to families of k-types

Theorem 25.2.1. Consider a map f : A→ B. Then the following are equivalent:

(i) The map f is k-truncated.

(ii) The commuting square

A B

ASk+1BSk+1

f

λx. constx λy. consty

f Sk+1

is a pullback square.

Page 222: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

212 CHAPTER V. HOMOTOPY QUOTIENTS

Proof. We prove the claim by induction on k ≥ −2. The base case is clear, because the mapAS−1 → BS−1

is a map between contractible types, hence an equivalence. Therefore the square

A B

AS−1BS−1

is a pullback square if and only if A→ B is an equivalence.For the inductive step, assume that for any map g : X → Y, the map g is k-truncated if and

only if the square

X Y

XSk+1YSk+1

is a pullback square, and consider a map f : A → B. Then f is (k + 1)-truncated if and only ifap f : (x = y)→ ( f (x) = f (y)) is k-truncated for each x, y : A. By the inductive hypothesis thishappens if and only if the square

(x = y) ( f (x) = f (y))

(x = y)Sk+1( f (x) = f (y))Sk+1

is a pullback square, for each x, y : A. Now we observe that this is the case if and only if thesquare on the left in the diagram

∑(x,y:A) x = y ∑(x,y:A)( f (x) = f (y)) ∑(x,y:B) x = y

∑(x,y:A)(x = y)Sk+1∑(x,y:A)( f (x) = f (y))Sk+1

∑(x,y:B)(x = y)Sk+1

is a pullback square. The square on the right is a pullback square, so the square on the left isa pullback if and only if the outer rectangle is a pullback. By the universal property of Sk+2 itfollows that the outer rectangle is a pullback if and only if the square

A B

ASk+2BSk+2

is a pullback.

Theorem 25.2.2. Consider a type A. Then the following are equivalent:

(i) The type A is k-truncated.

Page 223: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

25. TRUNCATIONS 213

(ii) The mapλx. constx : A→ (Sk+1 → A)

is an equivalence.

Proof. We prove the claim by induction on k ≥ −2. The base case is clear, because the map AS−1

is contractible.For the inductive step, assume that any type X is k-truncated if and only if the map

λx. constx : X → (Sk+1 → X)

is an equivalence. Then A is (k + 1)-truncated if and only if its identity types x = y are k-truncated, for each x, y : A. By the inductive hypothesis this happens if and only if

(x = y)→ (Sk+1 → (x = y))

is a family of equivalences indexed by x, y : A. This is a family of equivalences if and only if theinduced map on total spaces(

∑(x,y:A)x = y)→(

∑(x,y:A)(x = y)Sk+1)

is an equivalence. Note that we have a commuting square

A ASk+2

(∑(x,y:A) x = y

) (∑(x,y:A)(x = y)Sk+1

)in which both vertical maps are equivalences. Therefore the top map is an equivalence if andonly if the bottom map is an equivalence, which completes the proof.

Proof. Immediate from the fact that A is k-truncated if and only if the map A→ 1 is k-truncated.

Definition 25.2.3. Consider a type X. A k-truncation of X consist of a k-type Y, and a mapf : X → Y satisfying the universal property of k-truncation, that for every k-type Z the precom-position map

– f : (Y → Z)→ (X → Z)

is an equivalence.

We define ‖X‖k by the ‘hubs-and-spokes’ method, as a higher inductive type. The idea isto force any map SkX → ‖X‖k to be homotopic to a constant function by including enoughpoints (the hubs) for the values of these constant functions, and enough paths (the spokes) forthe homotopies to these constant functions.

Definition 25.2.4. For any type X we define a type ‖X‖k as a higher inductive type, withconstructors

η : X → ‖X‖k.

hub : (Sk+1 → ‖X‖k)→ ‖X‖k

spoke : ∏ ( f :Sk+1→‖X‖k)∏ (t:Sk+1) f (t) = hub( f ).

Page 224: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

214 CHAPTER V. HOMOTOPY QUOTIENTS

Remark 25.2.5. The induction principle for ‖X‖k asserts that for any family P of types over ‖X‖k,if we have a dependent function α : ∏ (x:X)P(η(x)) and a dependent function

β : ∏ ( f :Sk+1→‖X‖k)

(∏ (t:Sk+1)P( f (t))

)→ P(hub( f ))

equipped with an identification

γ( f , g, t) : trP(spoke( f , t), g(t)) = β( f , g),

for every f : Sk+1 → ‖X‖k, g : ∏ (t:Sk+1)P( f (t)), and every t : Sk+1, then we obtain a dependentfunction

h : ∏ (x:‖X‖k)P(η(x))

equipped with an identification H(x) : h(η(x)) = α(x) for any x : X.

Proposition 25.2.6. For any type X, the type ‖X‖k is k-truncated.

Proof. By Theorem 25.2.2 it suffices to show that the map

δ :≡ λx. constx : ‖X‖k → (Sk+1 → ‖X‖k)

is an equivalence. Note that the inverse of this map is simply the map

hub : (Sk+1 → ‖X‖k)→ ‖X‖k,

which is a section of δ by the homotopy spoke. Therefore it remains to show that

hub(constx) = x.

for every x : ‖X‖k. Note that spoke(constx, hub(constx))−1 is such an identification.

Recall that the (k + 1)-sphere is k-connected in the following sense.

Lemma 25.2.7. For any family P of k-types over Sk+1, the evaluation map at the base point

ev∗ :(

∏ (t:Sk+1)P(t))→ P(∗)

is an equivalence.

Theorem 25.2.8. For any family P of k-types over ‖X‖k, the function

– η :(

∏ (x:‖X‖k)P(x)

)→(

∏ (x:X)P(η(x)))

is an equivalence.

Proof. We first show that for any family P of k-types over ‖X‖k, the function

– η :(

∏ (x:‖X‖k)P(x)

)→(

∏ (x:X)P(η(x)))

has a section. To see this, we apply the induction principle of ‖X‖k. For any function α :∏ (x:X)P(η(x)) we need to construct a function h : ∏ (x:‖X‖k)

P(x) such that h η ∼ α, so itsuffices to show that the k-truncatedness of the types in the family P imply the existence of the

Page 225: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

25. TRUNCATIONS 215

terms β and η of the induction principle of ‖X‖k. In other words, we need to show that for everyf : Sk+1 → ‖X‖k and every g : ∏ (t:Sk+1)P( f (t)) there are

β( f , g) : P(hub( f ))

γ( f , g) : ∏ (t:Sk+1)trP(spoke( f , t), g(t)) = β( f , g).

Since we have already shown that ‖X‖k is k-truncated, it suffices to show the above for f :≡constx, for any x : ‖X‖k. Now the type of g is just the function type Sk+1 → P(x), so by thetruncatedness of P(x) it suffices to construct

β(constx, consty) : P(hub(constx))

γ(constx, consty) : ∏ (t:Sk+1)trP(spoke(constx, t), y) = β(constx, consty)

for any x : X and y : P(x). Now we simply define

β(constx, consty) :≡ trP(spoke(constx, ∗), y).

Then it remains to construct an identification

trP(spoke(constx, t), y) = trP(spoke(constx, ∗), y)

for any t : Sk+1, but this follows at once from Lemma 25.2.7, because the identity types of ak-truncated type is again k-truncated. This completes the proof that the precomposition function

– η :(

∏ (x:‖X‖k)P(x)

)→(

∏ (x:X)P(η(x)))

has a section s for every family P of k-types over ‖X‖k.To show that it is an equivalence, we have to show that s is also a retraction of the precompo-

sition function – η, i.e., we have to show that

s(h η) = h

for any h : ∏ (x:‖X‖k)P(x). By function extensionality, it is equivalent to show that

∏ (x:‖X‖k)s(h η)(x) = h(x).

Now we observe that the type s(h η)(x) = h(x) is a k-type, and therefore we already know thatthe function

– η :(

∏ (x:‖X‖k)s(h η)(x) = h(x)

)→(

∏ (x:X)s(h η)(η(x)) = h(η(x)))

has a section. In other words, it suffices to construct a dependent function of type

∏ (x:X)s(h η)(η(x)) = h(η(x)).

Here we simply use that s is a section – η, and we are done.

Corollary 25.2.9. For any type X, the map η : X → ‖X‖k satisfies the universal property of k-truncation.

Page 226: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

216 CHAPTER V. HOMOTOPY QUOTIENTS

25.3 Theorems not to forget

Theorem 25.3.1. Consider a type X and a family P of (k + n)-truncated types over ‖X‖k. Then theprecomposition map

– η :(

∏ (y:‖X‖k)P(y)

)→(

∏ (x:X)P(η(x)))

is (n− 2)-truncated.

Exercises

25.1 Consider an equivalence relation R : A → (A → Prop). Show that the map |– |0 inl :A→ ‖A tR A‖0 satisfies the universal property of the quotient A/R, where A tR A is thecanonical pushout

∑(x,y:A) R(x, y) A

A A tR A.

π2

π1 inr

inl

25.2 Consider the trivial relation 1 :≡ λx. λy. 1 : A→ (A→ Prop). Show that the set quotientA/1 is a proposition satisfying the universal property of the propositional truncation.

25.3 Show that the type of pointed 2-element sets

∑(X:U2)X

is contractible.25.4 Define the type F of finite sets by

F :≡ im(Fin),

where Fin : N→ U is defined in Definition 6.4.1.

(a) Show that F ' ∑(n:N) UFin(n).(b) Show that F is closed under Σ and Π.

25.5 (a) A type Y is called k-separated if for every type X the map

(‖X‖k → Y)→ (X → Y)

is an embedding. Show that Y is k-separated if and only if it is (k + 1)-truncated.(b) A type Y is called n-fold k-separated if for every type X the map

(‖X‖k → Y)→ (X → Y)

is (n − 2)-truncated. Show that Y is n-fold k-separated if and only if it is (k + n)-truncated.

26 The real projective spaces

26.1 The type of 2-element sets

Theorem 26.1.1. The type∑(X:U2)X

is contractible.

Page 227: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

27. THE CLASSIFYING TYPE OF A GROUP 217

Corollary 26.1.2. For any 2-element type X, the map

(2 = X)→ X

given by p 7→ trT (p, 12) is an equivalence.

26.2 Classifying real line bundles

26.3 The finite dimensional real projective spaces

27 The classifying type of a group

27.1 The classifying type of a group

Theorem 27.1.1. For every group G there is a pointed connected 1-type BG equipped with groupisomorphism

Ω(BG) ' G

Page 228: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the
Page 229: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

Chapter VI

Synthetic homotopy theory

28 Homotopy groups of types

28.1 The suspension-loop space adjunction

We get an even better version of the universal property of ΣX if we know in advance that thetype X is a pointed type: on pointed types, the suspension functor is left adjoint to the loopspace functor. This property manifests itself in the setting of pointed types, so we first give somedefinitions regarding pointed types.

Definition 28.1.1. (i) A pointed type consists of a type X equipped with a base point x : X.We will write U∗ for the type ∑(X:U ) X of all pointed types.

(ii) Let (X, ∗X) be a pointed type. A pointed family over (X, ∗X) consists of a type familyP : X → U equipped with a base point ∗P : P(∗X).

(iii) Let (P, ∗P) be a pointed family over (X, ∗X). A pointed section of (P, ∗P) consists of adependent function f : ∏ (x:X)P(x) and an identification p : f (∗X) = ∗P. We define thepointed Π-type to be the type of pointed sections:

∏∗(x:X)P(x) :≡ ∑( f :∏ (x:X)P(x)) f (∗X) = ∗P

In the case of two pointed types X and Y, we may also view Y as a pointed family over X.In this case we write X →∗ Y for the type of pointed functions.

(iv) Given any two pointed sections f and g of a pointed family P over X, we define the type ofpointed homotopies

f ∼∗ g :≡ Π∗(x:X) f (x) = g(x),

where the family x 7→ f (x) = g(x) is equipped with the base point p q−1.

Remark 28.1.2. Since pointed homotopies are defined as certain pointed sections, we can use thesame definition of pointed homotopies again to consider pointed homotopies between pointedhomotopies, and so on.

Example 28.1.3. For any type X, the suspension ΣX is a pointed type where the base point istaken to be the north pole N.

Definition 28.1.4. Let X be a pointed type with base point x. We define the loop space Ω(X, x)of X at x to be the pointed type x = x with base point reflx.

219

Page 230: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

220 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

Definition 28.1.5. The loop space operation Ω is functorial in the sense that

(i) For every pointed map f : X →∗ Y there is a pointed map

Ω( f ) : Ω(X)→∗ Ω(Y),

defined by Ω( f )(ω) :≡ p f ap f (ω) p−1f , which is base point preserving by right-inv(p f ).

(ii) For every pointed type X there is a pointed homotopy

Ω(id∗X) ∼∗ id∗Ω(X).

(iii) For any two pointed maps f : X →∗ Y and g : Y →∗ X, there is a pointed homotopywitnessing that the triangle

Ω(Y)

Ω(X) Ω(Z)

Ω(g)

Ω(g∗ f )

Ω( f )

of pointed types commutes.

In order to introduce the suspension-loop space adjunction, we also need to construct thefunctorial action of suspension.

Definition 28.1.6. (i) Given a pointed map f : X →∗ Y, we define a map

Σ( f ) : ΣX →∗ ΣY

Definition 28.1.7. We define a pointed map

εX : X →∗ Ω(ΣX)

for any pointed type X. This map is called the counit of the suspension-loop space adjunction.Moreover, ε is natural in X in the sense that for any pointed map f : X →∗ Y we have acommuting square

X Ω(ΣX)

Y Ω(ΣY)

εX

f Ω(Σ f )

εX

Construction. The underlying map of εX takes x : X to the concatenation

N S N.merid(x) merid(∗X)

−1

This map preserves the base point, since merid(∗X) merid(∗X)−1 = reflN.

Definition 28.1.8. (i) For any pointed type X, we define the pointed identity function id∗X :≡(idX , refl∗).

Page 231: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

28. HOMOTOPY GROUPS OF TYPES 221

(ii) For any two pointed maps f : X →∗ Y and g : Y →∗ Z, we define the pointed composite

g ∗ f :≡ (g f , apg(p f ) pg).

Definition 28.1.9. Given two pointed types X and Y, a pointed map from X to Y is a pair ( f , p)consisting of a map f : X → Y and a path p : f (x0) = y0 witnessing that f preserves the basepoint. We write

X →∗ Y

for the type of pointed maps from X to Y. The type X →∗ Y is itself a pointed type, with basepoint (consty0 , refly0).

Now suppose that we have a pointed map f : ΣX →∗ Y with p : f (x0) = y0. Then thecomposite

X Ω(ΣX) Ω(Y)εX Ω( f )

yields a pointed map f : X → Ω(Y). Therefore we obtain a map

τX,Y : (ΣX →∗ Y)→ (X →∗ Ω(Y)).

It is not hard to see that also τX,Y is pointed. We leave this to the reader. The following theoremis also called the adjointness of the suspension and loop space functors. This is an extremelyimportant relation that pops up in many calculations of homotopy groups.

Theorem 28.1.10. Let X and Y be pointed types. Then the pointed map

τX,Y : (ΣX →∗ Y)→∗ (X →∗ Ω(Y))

is an equivalence. Moreover, τ is pointedly natural in X and Y.

28.2 Homotopy groups

Definition 28.2.1. For n ≥ 1, the n-th homotopy group of a type X at a base point x : X consistsof the type

|πn(X, x)| :≡ ‖Ωn(X, x)‖0

equipped with the group operations inherited from the path operations on Ωn(X, x). Often wewill simply write πn(X) when it is clear from the context what the base point of X is.

For n ≡ 0 we define π0(X, x) :≡ ‖X‖0.

Example 28.2.2. In ?? we established that Ω(S1) ' Z. It follows that

π1(S1) = Z and πn(S1) = 0 for n ≥ 2.

Furthermore, we have seen in ?? that ‖S1‖0 is contractible. Therefore we also have π0(S1) = 0.

28.3 The Eckmann-Hilton argument

Given a diagram of identifications

x y

p

p′

p′′

r ⇓

r′ ⇓

Page 232: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

222 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

in a type A, where r : p = p′ and r′ : p′ = p′′, we obtain by concatenation an identificationr r′ : p = p′′. This operation on identifications of identifications is sometimes called the verticalconcatenation, because there is also a horizontal concatenation operation.

Definition 28.3.1. Consider identifications of identifications r : p = p′ and s : q = q′, wherep, p′ : x = y, and q, q′ : y = z are identifications in a type A, as indicated in the diagram

x y z.

p

p′

r ⇓

q

q′

s ⇓

We define the horizontal concatenation r h s : p q = p′ q′ of r and s.

Proof. First we induct on r, so it suffices to define reflp h s : p q = p q′. Next, we induct on p,so it suffices to define reflrefly

h s : refly q = refly q′. Since refly q ≡ q and refly q′ ≡ q′, we takereflrefly

h s :≡ s.

Lemma 28.3.2. Horizontal concatenation satisfies the left and right unit laws.

In the following lemma we establish the interchange law for horizontal and vertical concate-nation.

Lemma 28.3.3. Consider a diagram of the form

x y z.

p

p′′

r ⇓

r′ ⇓

q

q′′

s ⇓

s′ ⇓

Then there is an identification

(r r′) h (s s′) = (r h s) (r′ h s′).

Proof. We use path induction on both r and r′, followed by path induction on p. Then it sufficesto show that

(reflrefly reflrefly)

h (s s′) = (reflreflyh s) (reflrefly

h s′).

Using the computation rules, we see that this reduces to

s s′ = s s′,

which we have by reflexivity.

Theorem 28.3.4. For n ≥ 2, the n-th homotopy group is abelian.

Proof. Our goal is to show that∏ (r,s:π2(X))r · s = s · r.

Since we are constructing an identification in a set, we can use the universal property of 0-truncation on both r and s. Therefore it suffices to show that

∏ (r,s:reflx0=reflx0 )|r|0 · |s|0 = |s|0 · |r|0.

Page 233: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

28. EXERCISES 223

Now we use that |r|0 · |s|0 ≡ |r s|0 and |s|0 · |r|0 ≡ |s r|0, to see that it suffices to show thatr s = s r, for every r, s : reflx = reflx. Using the unit laws and the interchange law, this is asimple computation:

r s = (r h reflx) (reflx h s)

= (r reflx) h (reflx s)

= (reflx r) h (s reflx)

= (reflx h s) (r h reflx)

= s r.

Exercises

28.1 Show that the type of pointed families over a pointed type (X, x) is equivalent to the type

∑(Y:U∗)Y →∗ X.

28.2 Given two pointed types A and X, we say that A is a (pointed) retract of X if we havei : A→∗ X, a retraction r : X →∗ A, and a pointed homotopy H : r ∗ i ∼∗ id∗.

(a) Show that if A is a pointed retract of X, then Ω(A) is a pointed retract of Ω(X).(b) Show that if A is a pointed retract of X and πn(X) is a trivial group, then πn(A) is a

trivial group.

28.3 Construct by path induction a family of maps

∏ (A,B:U )∏ (a:A)∏ (b:B)((A, a) = (B, b))→ ∑(e:A'B)e(a) = b,

and show that this map is an equivalence. In other words, an identification of pointed types isa base point preserving equivalence.

28.4 Let (A, a) and (B, b) be two pointed types. Construct by path induction a family of maps

∏ ( f ,g:A→B)∏ (p: f (a)=b)∏ (q:g(a)=b)(( f , p) = (g, q))→ ∑(H: f∼g)p = H(a) q,

and show that this map is an equivalence. In other words, an identification of pointed maps isa base point preserving homotopy.

28.5 Show that if A← S→ B is a span of pointed types, then for any pointed type X the square

(A tS B→∗ X) (B→∗ X)

(A→∗ X) (S→∗ X)

is a pullback square.28.6 Let f : A→∗ B be a pointed map. Show that the following are equivalent:

(i) f is an equivalence.

(ii) For any pointed type X, the precomposition map

– ∗ f : (B→∗ X)→∗ (A→∗ X)

is an equivalence.

Page 234: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

224 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

28.7 In this exercise we prove the suspension-loopspace adjunction.(a) Construct a pointed equivalence

τX,Y : (Σ(X)→∗ Y) '∗ (X → Ω(Y))

for any two pointed spaces X and Y.(b) Show that for any f : X →∗ X′ and g : Y′ →∗ Y, there is a pointed homotopy

witnessing that the square

(Σ(X′)→∗ Y′) (X′ →∗ Ω(Y′))

(Σ(X)→∗ Y) (X →∗ Ω(Y))

τX′ ,Y′

h 7→ghΣ( f ) h 7→Ω(g)h f

τX,Y

28.8 Show that ifC B

A X

is a pullback square of pointed types, then so is

Ω(C) Ω(B)

Ω(A) Ω(X).

28.9 (a) Show that if X is k-truncated, then its n-th homotopy group πn(X) is trivial for eachchoice of base point, and each n > k.

(b) Show that if X is (k + l)-truncated, and for each 0 < i ≤ l the (k + i)-th homotopygroups πk+i(X) are trivial for each choice of base point, then X is k-truncated.

It is consistent to assume that there are types for which all homotopy groups are trivial,but which aren’t contractible nonetheless. Such types are called ∞-connected.

28.10 Consider a cospan

A X Bf g

of pointed types and pointed maps between them.(a) Define the type of pointed cones cone∗(C), where the vertex C is a pointed type. Also

characterize its identity type.(b) Define for any pointed cone (p, q, H) with vertex C the map

cone-map∗(p, q, H) : (C′ →∗ C)→ cone∗(C′).

Now we can say that the cone (p, q, H) satisfies the universal property of the pointedpullback of the cospan A → X ← A if this map is an equivalence for each pointedtype C′.

(c) Now consider a commuting square

C B

A X,

q

p g

f

Page 235: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

29. CONNECTED TYPES AND MAPS 225

where f and g are assumed to be pointed maps between pointed types (they comeequipped with α : f (a0) = x0 and β : g(b0) = x0, respectively). Show that if C is apullback (in the usual unpointed sense), then C can be given the structure of a pointedpullback in a unique way, i.e., show that the type of

c0 : C

γ : p(c0) = a0

δ : q(c0) = b0

ε : ap f (γ) α = H(c0) (apg(δ) β)

for which C satisfies the universal property of a pointed pullback, is contractible.(d) Conclude that a commuting square of pointed types is a pointed pullback square if

and only if the underlying square of unpointed types is an ordinary pullback square.

29 Connected types and maps

In this section we introduce the concept of k-connected types and maps. We define k-connectedtypes to be types with contractible k-truncation, and a k-connected map is just a map of whichthe fibers are k-connected. The idea is that a type is k-connected if and only if its homotopygroups πi(X) are trivial for all i ≤ k.

One of the main theorems in this section is a characterization of k-connected maps in termsof their action on homotopy groups: A map f : X → Y is k-connected if and only if it inducesisomorphisms

πi( f , x) : πi(X, x)→ πi(Y, f (x))

of homotopy groups, for each i ≤ k and each x : X, and a surjective group homomorphism

πk+1( f , x) : πk+1(X, x)→ πk+1(Y, f (x))

on the (k + 1)-st homotopy group, for each x : X. If one drops the condition that f induces asurjective group homomorphism on the (k + 1)-st homotopy group, then the map is only a k-equivalence, i.e., a map of which ‖ f ‖k is an equivalence. We see from the above characterizationthat any k-connected map is a k-equivalence, and also that any (k + 1)-equivalence is a k-connected map. Nevertheless, the difference between the classes of k-equivalences and k-connected maps is somewhat subtle.

We will study k-equivalences and k-connected maps synchronously, because understandingthe subtle differences between the results about either of them will increase the understanding ofboth classes of maps. For instance, we will show that the k-connected maps enjoy a dependentelimination property, while the k-equivalences only satisfy a non-dependent elimination property.We will see that the k-equivalences satisfy the 3-for-2 property, while one of the cases of the3-for-2 property fails for k-connected maps.

The k-connected maps can be characterized as the class of maps that is left orthogonal tothe class of k-truncated maps, where a map f : A → B is said to be left orthogonal to a mapg : X → Y if the type of diagonal fillers of any commuting square of the form

A X

B Y

f g

Page 236: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

226 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

is contractible. Similarly, the class of k-equivalences is the class of maps that is left orthogonalto any map between k-truncated types. However, this result is not entirely sharp, becausethere are more maps that the k-equivalences are left orthogonal to. It turns out that a map is ak-equivalence if and only if it is left orthogonal to any map g : X → Y for which the naturalitysquare

X Y

‖X‖k ‖Y‖k

g

η

‖g‖k

is a pullback square. Such maps are called k-étale, and they induce isomorphisms

πi(g, x) : πi(X, x)→ πi(Y, g(x))

on homotopy groups for i > k.In the final part of this section we will use the results about k-equivalences to show that the

n-sphere is (n− 1)-connected, for each n : N, and that the join A ∗ B is (k + l + 2)-connected ifA is k-connected and B is l-connected.

29.1 Connected types

Definition 29.1.1. A type X is said to be k-connected if its k-truncation ‖X‖k is contractible. Wedefine

is-connk(X) :≡ is-contr‖X‖k.

Remark 29.1.2. Since the (−2)-truncation of any type is just 1, it follows that every type is (−2)-connected. Furthermore, since any proposition is contractible as soon as it comes equipped witha term, it follows that any type is (−1)-connected as soon as it is inhabited.

In Theorem 29.1.4 below, we will see that a type X is 0-connected if and only if it is inhabitedand every two points are connected by an unspecified path. In this sense 0-connected types arealso called path connected, or just connected. Thus, it is immediate that the circle is an exampleof a connected type.

Similarly, in the case where k ≡ 0 the theorem states that a type X is 1-conneced if and only ifit is inhabited and for every x, y : X the identity type x = y is path connected. In other words, atype is simply connected if it is 1-connected! The 2-sphere is an example of a simply connectedtype. This fact is shown in Corollary 29.4.4 below, where we will show more generally that then-sphere is (n− 1)-connected, for each n : N.

Lemma 29.1.3. If a type is (k + 1)-connected, then it is also k-connected.

Proof. This follows from the fact that ‖‖X‖k+1‖k ' ‖X‖k. Indeed, if ‖X‖k+1 is contractible, thenits k-truncation is also contractible, so it follows that ‖X‖k is contractible.

For the following theorem, recall that a type X is said to be inhabited if it comes equippedwith a term ‖X‖−1.

Theorem 29.1.4. Consider a type X. Then the following are equivalent:

(i) The type X is (k + 1)-connected.

(ii) The type X is inhabited, and the type x = y is k-connected for each x, y : X.

Page 237: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

29. CONNECTED TYPES AND MAPS 227

Proof. Suppose first that X is (k + 1)-connected. It is immediate that X is inhabited in this case.Moreover, since we have equivalences

(η(x) = η(y)) ' ‖x = y‖k

for each x, y : X, it follows from the assumption that ‖X‖k+1 is contractible that the type ‖x = y‖kis equivalent to a contractible type. This proves that (i) implies (ii).

To see that (ii) implies (i), suppose that X is inhabited and that its identity types are k-connected. Our goal is to construct a term of type

is-contr‖X‖k+1,

which is a proposition, so we may eliminate the assumption that X is inhabited and assume tohave x : X. Now we simply take η(x) for the center of contraction of ‖X‖k+1. To construct thecontraction, note that by the dependent universal property of (k + 1)-truncation we have anequivalence (

∏ (y:‖X‖k+1)η(x) = y

)'(

∏ (y:X)η(x) = η(y))

.

Therefore it suffices to construct an identification η(x) = η(y) for every y : X. However, thistype is contractible, since it is equivalent to the contractible type ‖x = y‖k. This completes theproof of (ii) implies (i).

In the case where k ≥ −1 we can improve Theorem 29.1.4 and characterize a high degree ofconnectedness entirely in terms of the triviality of homotopy groups. This is what connectednessis all about.

Theorem 29.1.5. Consider a type X, and suppose that k ≥ 0. Then the following are equivalent:

(i) The type X is k-connected.

(ii) The type X is connected, and for every x : X the loop space

Ω(X, x)

is (k− 1)-connected.

(iii) For each i ≤ k and each x : X, the i-th homotopy group πi(X, x) is trivial.

Proof. If X is k-connected for k ≥ 0, then it is certainly connected, and Ω(X, x) is (k − 1)-connected by Theorem 29.1.4. Thus, the fact that (i) implies (ii) is immediate.

To see that (ii) implies (i), note that if X is connected and its loop spaces are (k− 1)-connected,then all its identity types are (k− 1)-connected, since we have

∏ (x,y:X)is-contr(‖x = y‖k−1) ' ∏ (x,y:X)‖x = y‖−1 → is-contr(‖x = y‖k−1)

' ∏ (x,y:X)(x = y)→ is-contr(‖x = y‖k−1)

' ∏ (x:X)is-contr(‖x = x‖k−1).

In the first step of this calculation we use that X is connected, so ‖x = y‖−1 is contractible; thenwe use that is-contr(‖x = y‖k−1) is a proposition; and finally we use the universal property ofidentity types to arrive at our assumption that the loop spaces of X are (k− 1)-connected. Sincewe have shown that the identity types are (k− 1)-connected, it follows by Theorem 29.1.4 that Xis k-connected, which concludes the proof that (ii) implies (i).

It is easy to see by induction on k ≥ 0 that (ii) holds if and only if (iii) holds, since we have

πi+1(X, x) = πi(Ω(X, x)).

Page 238: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

228 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

Remark 29.1.6. If X is assumed to be a pointed type in Theorem 29.1.5, then conditions (ii) and(iii) only have to be checked at the base point.

29.2 k-Equivalences and k-connected maps

We now study two classes of maps that differ only slightly: the k-equivalences and the k-connected maps.

Definition 29.2.1.

(i) A map f : X → Y is said to be k-connected if its fibers are k-connected. We will write

is-connk( f ) :≡ ∏ (y:Y)is-connk(fib f (y)).

(ii) A map f : X → Y is said to be a k-equivalence if

‖ f ‖k : ‖X‖k → ‖Y‖k

is an equivalence. We will write

is-equivk( f ) :≡ is-equiv(‖ f ‖k).

Example 29.2.2. Any equivalence is a k-connected map, as well as a k-equivalence. Moreover, forany k-connected type X the map const? : X → 1 is k-connected. It is also immediate that any mapbetween k-connected types is a k-equivalence.

Example 29.2.3. A (−1)-connected map is a map f : X → Y for which the propositionallytruncated fibers

‖fib f (y)‖−1

are contractible. Since propositions are contractible as soon as they are inhabited, we see that amap is (−1)-connected if and only if it is surjective.

A (−1)-equivalence, on the other hand, is just a map f : X → Y that induces an equivalence‖X‖−1 ' ‖Y‖−1. The map const12 : 1 → 2 is an example of such a map, showing that (−1)-equivalences don’t need to be surjective.

However, it is the case that every surjective map f : X → Y is in fact (−1)-equivalence. Tosee this, we need to show that

‖Y‖−1 → ‖X‖−1.

Such a map is constructed by the universal property of (−1)-truncation. Thus, it suffices toconstruct a function Y → ‖X‖−1. Since we have assumed that f is surjective, we have for everyy : Y a term

s(y) : ‖fib f (y)‖−1.

Thus, we define a function Y → ‖X‖−1 by

y 7→ ‖pr1‖−1(s(y)).

This concludes the proof that f is a (−1)-equivalence, since we have shown that ‖X‖−1 ↔ ‖Y‖−1.

Page 239: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

29. CONNECTED TYPES AND MAPS 229

Remark 29.2.4. An immediate difference between the classes of k-equivalences and k-connectedmaps is that the k-connected maps are stable under base change, while the k-equivalences arenot. By this, we mean that for any pullback square

E′ E

B′ B,

p′

g

p

f

if the map p is k-connected, then the map p′ is also k-connected. In such a pullback diagram,the map p′ is sometimes called the base change of p along f . By Theorem 17.5.3 we have anequivalence

fibp′(b′) ' fibp( f (b′))

for any b′ : B′, so it is indeed the case that if the fibers of p are k-connected, then so are the fibersof p′.

An example showing that the k-equivalences are not stable under base change is given by thepullback square

Ω(Sk+1) 1

1 Sk+1

We will show in Corollary 29.4.4 that the (k + 1)-sphere is k-connected, so the map 1→ Sk+1 isa k-equivalence. However, its loop space is only (k− 1)-connected, and indeed we will showin ?? that πk+1(Sk+1) = Z for k ≥ 0, showing that Ω(Sk+1) is not k-connected. Thus, the mapΩ(Sk+1)→ 1 is not a k-equivalence.

Elimination properties

We will show that a map f : X → Y is a k-equivalence if and only if the precomposition function

– f : (Y → Z)→ (X → Z)

is an equivalence for every k-type Z. On the other hand, we will show that f is k-connected ifand only if the precomposition function

– f :(

∏ (y:Y)P(y))→(

∏ (x:X)P( f (x)))

is an equivalence for every family P of k-types over Y. In other words, the k-connected mapssatisfy a dependent unique elimination property, while the k-equivalences only satisfy a non-dependent unique elimination property.

Theorem 29.2.5. Consider a function f : X → Y. Then the following are equivalent

(i) The map f is a k-equivalence.

(ii) For every k-type Z, the precomposition function

– f : (Y → Z)→ (X → Z)

is an equivalence.

Page 240: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

230 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

Theorem 29.2.6. Let f : X → Y be a map. The following are equivalent:

(i) The map f is k-connected.

(ii) For every family P of k-truncated types over Y, the precomposition map

– f :(

∏ (y:Y)P(y))→(

∏ (x:X)P( f (x)))

is an equivalence.

Proof. Suppose f is k-connected and let P be a family of k-types over Y. Now we may considerthe following commuting diagram

∏ (y:Y)P(y) ∏ (x:X)P( f (x))

∏ (y:Y)‖fib f (y)‖k → P(y) ∏ (x:X) ∏ (y:Y) ∏ (p: f (x)=y)P(y)

∏ (y:Y)fib f (y)→ P(y) ∏ (y:Y) ∏ (x:X) ∏ (p: f (x)=y)P(y)

– f

which commutes by htpy-refl. In this diagram, the five maps going around counter clockwise areall equivalences for obvious reasons, so it follows that the top map is an equivalence.

Now suppose that f satisfies the dependent elimination property stated in (ii). In order toconstruct a center of contraction of ‖fib f (y)‖k for every y : Y, we use the dependent eliminationproperty with respect to the family P given by P(y) :≡ ‖fib f (y)‖k.

Corollary 29.2.7. For any type X, the unit η : X → ‖X‖k of the k-truncation is a k-connected map.

The inclusions

We will prove the following implications

is-equivk+1( f ) is-connk( f ) is-equivk( f )Proposition 29.2.8 Proposition 29.2.9

showing that the class of k-connected maps is contained in the class of k-equivalences, and thatthe class of (k + 1)-equivalences is contained in the class of k-connected maps. Neither of theseimplications reverses.

Proposition 29.2.8. Any k-connected map is a k-equivalence.

Proposition 29.2.9. Any (k + 1)-equivalence is k-connected.

Proof. Consider a (k + 1)-equivalence f : X → Y. Recall that the map ‖ f ‖k+1 comes equippedwith a homotopy H : ‖ f ‖k+1 η ∼ η f witnessing that the square

X Y

‖X‖k+1 ‖Y‖k+1

f

η η

‖ f ‖k+1

Page 241: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

29. CONNECTED TYPES AND MAPS 231

commutes. We be using this homotopy, and we will use Theorem 29.2.6 to show that f isk-connected. Thus, our goal is to show that

– f :(

∏ (y:Y)P(y))→(

∏ (x:X)P( f (x)))

is an equivalence for any family P of k-types over Y.Note that any family P of k-types over Y extends to a family P of k-types over ‖Y‖k+1, since

any univalent universe of k-types that contains P is itself a (k + 1)-type by Exercise 13.1. Theextended family P of k-types over ‖Y‖k+1 comes equipped with a family of equivalences

e : ∏ (y:Y)P(η(y)) ' P(y).

Now consider the commuting diagram

∏ (y:‖Y‖k+1)P(y) ∏ (x:‖X‖k+1)

P(‖ f ‖k+1(x))

∏ (x:X)P(‖ f ‖k+1(η(x)))

∏ (y:Y)P(η(y)) ∏ (x:X)P(η( f (x)))

∏ (y:Y)P(y) ∏ (x:X)P( f (x)).

–‖ f ‖k+1

–η

–η

h 7→λx. trP(H(x),h(x))

h 7→λy. ey(h(y)) h 7→λx. e f (x)(h(x))

– f

This diagram commutes by the homotopy

λh. eq-htpy(λx. ape( f (x))(apdh(H(x)))−1).

In this diagrams all the maps pointing downwards are equivalences for obvious reasons: thetwo maps – η are equivalences since P is a family of k-types, and the remaining three mapspointing downwards are all postcomposing with an equivalence. The top map is an equivalencesince ‖ f ‖k+1 is assumed to be an equivalence. Thus we conclude that the bottom map – f is anequivalence.

The 3-for-2 property

An important distinction between the class of k-equivalences and the class of k-connected mapsis that the k-equivalences satisfy the 3-for-2 property, while the k-connected maps do not.

Remark 29.2.10. It is not hard to see that the k-connected maps don’t satisfy the 3-for-2 property.For example, consider the following commuting triangle

S1 S1

1,

d2

where d2 : S1 → S1 is the degree 2 map. Since the circle is a 0-connected type, it follows thatthe maps S1 → 1 are 0-connected. However, the fiber of d2 at the base point is equivalent to thebooleans, which is a non-contractible set so it is certainly not 0-connected.

Page 242: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

232 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

Lemma 29.2.11. The k-equivalences satisfy the 3-for-2 property, i.e., for any commuting triangle

A B

X,

h

f g

if any two of the three maps are k-equivalences, then so is the third.

Proof. This follows immediately from the fact that equivalences satisfy the 3-for-2 property.

Proposition 29.2.12. Consider a commuting triangle

A B

X

h

f g

with H : f ∼ g h. The following three statements hold:

(i) If f and h are k-connected, then g is k-connected.

(ii) If g and h are k-connected, then f is k-connected.

(iii) If f and g are k-connected, then h is a k-equivalence.

Proof. The first two statements combined assert that if h is k-connected, then f is k-connectedif and only if g is k-connected. To see that this equivalence holds, consider for any family P ofk-truncated types over X the commuting square

∏ (x:X)P(x) ∏ (b:B)P(g(b))

∏ (a:A)P( f (a)) ∏ (a:A)P(g(h(a)))

–g

– f –h

λs. λa. trP(H(a),s(a))

In this square, the bottom map is given by postcomposing with the family of equivalencestrP(H(a)) indexed by a : A, so it is an equivalence. The map on the right is an equivalence byTheorem 29.2.6, using the assumption that h is a k-connected map. The square commutes by thehomotopy

λs. eq-htpy(λa. apds(H(a))

).

Therefore it follows that the precomposition map – f is an equivalence if and only if theprecomposition map – g is. By Theorem 29.2.6 we conclude that f is connected if and only if gis. This proves statements (i) and (ii).

Statement (iii) follows from the facts that any k-connected map is a k-equivalence by ?? andthat the k-equivalences satisfy the 3-for-2 property ??.

Page 243: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

29. CONNECTED TYPES AND MAPS 233

The acion on homotopy groups

Theorem 29.2.13. Consider a map f : X → Y, and suppose that k ≥ −1. The following are equivalent:

(i) The map f is a k-equivalence.

(ii) The map f is a (−1)-equivalence, and for every 0 ≤ i ≤ k and every x : X, the induced grouphomomorphism

πi( f , x) : πi(X, x)→ πi(Y, f (x))

is an isomorphism.

Definition 29.2.14. A map f : X → Y is said to be a weak equivalence if it is a 0-equivalence,and it induces an isomorphism

πi( f , x) : πi(X, x) ∼= πi(Y, f (x))

on homotopy groups, for every x : X and every i ≥ 1.

The following corollary is an instance of Whitehead’s principle, which asserts that a mapbetween any two spaces is a homotopy equivalence if and only if it is a weak equivalence. Thus,by the following corollary, Whitehead’s principle holds for k-types.

Corollary 29.2.15. Consider two k-types X and Y, and consider a map f : X → Y between them. Thenthe following are equivalent:

(i) The map f is an equivalence.

(ii) The map f is a weak equivalence.

Theorem 29.2.16. Consider a map f : X → Y. The following are equivalent:

(i) The map f is (k + 1)-connected.

(ii) The map f is surjective, and for each x, x′ : X the action on paths

ap f : (x = x′)→ ( f (x) = f (x′))

is k-connected.

Theorem 29.2.17. Consider a surjective map f : X → Y. The following are equivalent:

(i) The map f is k-connected.

(ii) The induced maps on loop spaces

Ω( f , x) : Ω(X, x)→ Ω(Y, f (x))

is (k− 1)-connected for every x : X.

(iii) The induced maps on homotopy groups

πi( f , x) : πi(X, x)→ πi(Y, f (x))

are isomorphisms for 0 ≤ i ≤ k, and it is surjective for i = k + 1.

Remark 29.2.18. If f : X → Y is a pointed map between connected types, then conditions (ii) and(iii) in ?? only have to be checked at the base point.

Page 244: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

234 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

29.3 Orthogonality

The idea of orthogonality is that a map f : A → B is left orthogonal to a map g : X → Y if forevery commuting square of the form

A X

B Y,

f

h

g

i

with H : (i f ) ∼ (g h), the type of diagonal fillers is contractible. The type of diagonal fillersis the type of maps j : B→ X equipped with homotopies

K : j f ∼ h

L : g j ∼ i

and a homotopy M witnessing that the triangle

g j f h g

i f

g·K

L· f H

commutes. A slicker way to express this condition is to assert that the map

(B→ X)→ ∑(h:A→X)∑(i:B→Y)i f ∼ g h

given by j 7→ (j f , g j, htpy-refl) is an equivalence. Indeed, the type of triples (h, i, H) in thecodomain is the type of commuting squares with respect to which we stated the orthogonalitycondition. Now we may even recognize the above map as a gap map of a commuting square,and we arrive at our actual definition of orthogonality.

Definition 29.3.1. A map f : A → B is said to be left orthogonal to a map g : X → Y, orequivalently the map g is said to be right orthogonal to f , if the commuting square

XB XA

YB YA

– f

g– g–

– f

is a pullback square.

Theorem 29.3.2. Let f : A→ B be a map. The following are equivalent:

(i) The map f is k-connected.

(ii) The map f is left orthogonal to every k-truncated map. is a pullback square.

Theorem 29.3.3. Let f : A→ B be a map. The following are equivalent:

(i) The map f is a k-equivalence.

Page 245: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

29. CONNECTED TYPES AND MAPS 235

(ii) The map f is left orthogonal to every map between k-truncated types.

(iii) The map f is left orthogonal to every map g : X → Y for which the naturality square

X Y

‖X‖k ‖Y‖k

g

η η

‖g‖k

is a pullback square. Such maps are called k-étale.

29.4 The connectedness of suspensions

We will use connected maps to prove the connectedness of suspensions.

Proposition 29.4.1. Consider a pushout square

S B

A X.

f

g

j

i

If the map f : S→ A is k-connected, then so is the map j : B→ X.

Proof. We claim that the map j : B → X is left orthogonal to any k-truncated map p : Y → Z,which is equivalent to the property that j is k-connected. To see that j is left orthogonal to p,consider the commuting cube

YX

YA YB ZX

YS ZA ZB

ZS.

In this cube, the front left square is a pullback square because the map f : S → A is assumedto be k-connected, and therefore it is left orthogonal to the k-truncated map p. The back leftand front right squares are pullback squares by the pullback property of pushouts. Therefore itfollows that the back right square is a pullback square. This shows that j is left orthogonal top.

Lemma 29.4.2. A pointed type X is (k + 1)-connected if and only if the point inclusion

1→ X

is a k-connected map.

Page 246: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

236 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

Proof. Since X is assumed to have a base point x0 : X, it follows that X is (k + 1)-connected ifand only if its identity types (x = y) are k-connected. Now the claim follows from the fact thatthere is an equivalence

fibconstx0(y) ' (x0 = y).

Theorem 29.4.3. If X is an k-connected type, then its suspension ΣX is (k + 1)-connected.

Proof. The type X is k-connected if and only if the map const? : X → 1 is a k-connected map.Recall that the suspension of X is a pushout

X 1

1 ΣX.

const?

const?

S

N

Therefore we see by Proposition 29.4.1 that the point inclusions N, S : 1 → ΣX are both k-connected maps. By Lemma 29.4.2 it follows that ΣX is a (k + 1)-connected type.

Corollary 29.4.4. The n-sphere is (n− 1)-connected.

Proof. The 0-sphere is (−1)-connected, since it contains a point. Thus the claim follows byinduction on n : N, using Theorem 29.4.3.

29.5 The join connectivity theorem

Theorem 29.5.1. If X is k-connected and Y is l-connected, then their join X ∗ Y is (k + l + 2)-connected.

Theorem 29.5.2. Consider a pullback square

C B

A X.

If the maps A → X and B → X are k- and l-connected, respectively, then the map A tC B → X is(k + l + 2)-connected.

Theorem 29.5.3. The connected maps contain the equivalences, are closed under coproducts, pushouts,retracts, and transfinite compositions.

Exercises

29.1 Show that every type is equivalent to a disjoint union of connected components, i.e., showthat for every type X there is a family of connected types Bi by a set I, with an equivalence

X ' ∑(i:I)Bi.

29.2 Let f : A→∗ B be a pointed map between pointed n-connected types, for n ≥ −1. Showthat the following are equivalent:

(i) f is an equivalence.

(ii) Ωn+1( f ) is an equivalence.

Page 247: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

29. EXERCISES 237

29.3 Show that ifA B

X Y

f g

is k-cocartesian in the sense that the cogap map is k-connected, then the map cofib( f )→cofib(g) is k-connected.

29.4 Show that if f : X → Y is a k-connected map, then so is

‖ f ‖l : ‖X‖l → ‖Y‖l

for any l ≥ −2.29.5 Consider a commuting square

A B

X Y

f g

(a) Show that if the square is k-cartesian and g is k-connected, then so is f .(b) Show that if f is k-connected and g is (k + 1)-connected, then the square is k-cartesian.

29.6 (a) Show that any sequential colimit of k-connected types is again k-connected.(b) Show that if every map in a type sequence

A0 A1 A2 · · ·

is k-connected, then so is the transfinite composition A0 → A∞.29.7 Recall that a commuting square is called k-cartesian, if its gap map is k-connected. Show

that (k + 1)-truncation preserves l-cartesian squares for any l ≤ k, i.e., show that for anyl ≤ k, if a square

C B

A X.

q

p g

f

is l-cartesian, then the square

‖C‖k+1 ‖B‖k+1

‖A‖k+1 ‖X‖k+1

‖q‖k+1

‖p‖k+1 ‖g‖k+1

‖ f ‖k+1

is l-cartesian.29.8 Generalize Remark 29.2.10 to show that for every k ≥ −1, the k-connected maps do not

satisfy the 3-for-2 property.29.9 Consider a commuting square

A B

X Y

f g

Show that the following are equivalent:

Page 248: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

238 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

(i) The map A→ X×Y B is n-connected. In this case the square is called n-cartesian.

(ii) For each x : X the mapfib f (x)→ fibg( f (x))

is n-connected.

29.10 Consider a map f : A→ B. Show that the following are equivalent:

(i) The map f is a weak equivalence.

(ii) The map f is ∞-connected, in the sense that f is k-connected for each k.

(iii) The map f is left orthogonal to any map between truncated types of any truncationlevel.

(iv) The map f is left orthogonal to any truncated map, for any truncation level.

Thus we see that, while the classes of k-connected maps and k-equivalences differ for finitek ≥ −1, they come to agree at ∞.

29.11 Consider a pointed (k + 1)-connected type X. Show that every k-truncated map f : A→ Xtrivializes, in the sense that there is a k-type B and an equivalence e : A ' X× B for whichthe triangle

A X× B

X

e

f pr1

commutes.29.12 Consider a k-equivalence f : B′ → B. Show that the base-change functor induces an

equivalence (∑(E:U )∑(p:E→B)is-etalek(p)

)'(

∑(E′ :U )∑(p′ :E′→B′)is-etalek(p′))

.

In other words, for every k-étale map p′ : E′ → B′ there is a unique k-étale map p : E→ Bequipped with a map q : E′ → E such that the square

E′ E

B′ B

p′

q

p

f

commutes and is a pullback square. In this sense k-étale maps descend along k-equivalences.

30 A second perspective on groups

30.1 The category of pointed connected 1-types

Proposition 30.1.1. Consider a k-connected map f : X → Y, and a family P of (k + n)-truncated typesover Y, where n ≥ 0. Then the precomposition map

– f :(

∏ (y:Y)P(y))→(

∏ (x:X)P( f (x)))

is (n− 2)-truncated.

Page 249: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

30. A SECOND PERSPECTIVE ON GROUPS 239

Proposition 30.1.2. Consider a pointed (k + 1)-connected type X, and a family Y : X → U≤n+k of(n + k)-truncated types over X. Then the map

ev-pt :(

∏ (x:X)Y(x))→ Y(pt)

induced by the point inclusion 1→ X, is an (n− 2)-truncated map.

Proof. Note that we have a commuting triangle(∏ (x:X)Y(x)

)(

∏ (t:1)Y(pt))

Y(pt),

–constpt ev-pt

ev-pt'

so the map on the left is an (n− 2)-truncated map if and only if the map on the right is. For themap on the left, the claim follows immediately from Proposition 30.1.1, since the point inclusionconstpt : 1→ X is a k-connected map by ??.

Definition 30.1.3. If X : Upt and Y : X → Upt, then we introduce the type of pointed sections,

∏∗(x:X) Y(x) :≡ ∑(s:∏ (x:X)Y(x)) s(pt) = pt

This type is itself pointed by the trivial section λx. pt.

Corollary 30.1.4. Consider a pointed k-connected type X, and a family Y : X → U≤n+kpt of pointed

(n + k)-truncated types over X. Then the type ∏∗(x:X) Y(x) is (n− 1)-truncated.

Proof. Note that we have a pullback square

∏∗(x:X) Y(x) 1

∏ (x:X)Y(x) Y(∗),ev-pt

so the claim follows from the fact that ev-pt is an (n− 1)-truncated map.

Theorem 30.1.5. The type hom(n,k)(G, H) is an n-type for any G, H : (n, k)GType.

Proof. If X is (k − 1)-connected, and Y is (n + k)-truncated, then the type of pointed mapsX →pt Y is n-truncated.

Corollary 30.1.6. The type (n, k)GType is (n + 1)-truncated.

Proof. This follows immediately from the preceding corollary, as the type of equivalences G ' His a subtype of the homomorphisms from G to H.

If k ≥ n + 2 (so we’re in the stable range), then hom(n,k)(G, H) becomes a stably groupaln-groupoid. This generalizes the fact that the homomorphisms between abelian groups form anabelian group.

Page 250: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

240 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

Corollary 30.1.7. The automorphism group Aut G of a higher group G : (n, k)GType is a 1-groupal(n + 1)-group, equivalent to the automorphism group of the pointed type BkG.

Proposition 30.1.8. For any two pointed n-connected (n + k + 1)-truncated types X and Y, the type ofpointed maps

X →∗ Y

is k-truncated.

Corollary 30.1.9. For any two pointed n-connected (n + 1)-truncated types X and Y, the type of pointedmaps

X →∗ Y

is a set.

Theorem 30.1.10. The pre-category of n-connected (n + 1)-truncated types in a universe U is Rezkcomplete.

30.2 Equivalences of categories

Definition 30.2.1. A functor is...

Definition 30.2.2. A functor F : C → D is an equivalence if ...

30.3 The equivalence of groups and pointed connected 1-types

Theorem 30.3.1. The loop space functor

Type10 → Group

is an equivalence of categories.

31 The Hopf fibration

Our goal in this section is to construct the Hopf fibration. The Hopf fibration is a fiber sequence

S1 → S3 S2.

More generally, we show that for any type A equipped with a multiplicative operation µ : A→(A→ A) for which µ(x, –) and µ(–, x) are equivalences, there is a fiber sequence

A → A ∗ A ΣA.

The construction of this fiber sequence is known as the Hopf construction. We then get the Hopffibration from the Hopf construction by using the multiplication on S1 constructed in §15.3 afterwe show that S1 ∗ S1 ' S3.

We then introduce the long exact sequence of homotopy groups. The long exact sequence isan important tool to compute homotopy groups which applies to any fiber sequence

F → E B.

In the case of the Hopf fibration, we will use the long exact sequence to show that

πk(S3) = πk(S

2)

Page 251: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

31. THE HOPF FIBRATION 241

for any k ≥ 3.Since the Hopf fibration is closely related to the multiplication operation of the complex

numbers on the unit circle, the Hopf fibration is sometimes also called the complex Hopf fibration.Indeed, there is also a real Hopf fibration

S0 → S1 S1.

This is just the double cover of the circle. There is even a quaternionic Hopf fibration

S3 → S7 S4,

which uses the multiplication of the quaternionic numbers on the unit sphere. The main difficultyin defining the quaternionic Hopf fibration in homotopy type theory is to define the quaternionicmultiplication

mulS3 : S3 → (S3 → S3).

The construction of the octonionic Hopf fibration

S7 → S15 S8

in homotopy type theory is still an open problem. Another open problem is to formalize Adams’theorem [1] in homotopy type theory, that there are no further fiber sequences of the form

Sk → Sl Sm,

for k, l, m ≥ 0.

31.1 Fiber sequences

Definition 31.1.1. A short sequence of maps into a pointed type B with base point b consists ofmaps

F E Bi p

equipped with a homotopy p i ∼ constb. We say that a short sequence as above is an unpointedfiber sequence if the commuting square

F E

1 B

i

const? p

constb

is a pullback square.

Definition 31.1.2. A short sequence of pointed maps into a pointed type B with base point bconsists of pointed maps

F E Bi p

equipped with a pointed homotopy p i ∼∗ constb. We say that a short sequence as above is anfiber sequence if the commuting square

F E

1 B

i

const? p

constb

is a pullback square.

Page 252: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

242 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

31.2 The Hopf construction

The Hopf construction is a general construction of a fiber sequence

A → A ∗ A ΣA,

that applies to any H-space A. Our definition of an H-space is chosen such that it provides onlythe necessary structure to apply the Hopf construction. We give an unpointed and a pointedvariant, and moreover we give a coherent variant that is more closely related to the traditionaldefinition of an H-space.

Definition 31.2.1.

(i) An unpointed H-space structure on a type A consists of a multiplicative operation

µ : A→ (A→ A)

for which µ(x, –) and µ(–, x) are equivalences.

(ii) If A is a pointed type with base point e : A, then an H-space structure on A is an unpointedH-space structure on A equipped with an identification µ(e, e) = e.

(iii) A coherent H-space structure on a pointed type A with base point e : A consists of anunpointed H-space structure µ on A that satisfies the unit laws, i.e., µ comes equippedwith identifications

left-unitµ : µ(e, a) = a

right-unitµ : µ(a, e) = a

coh-unitµ : left-unitµ(e) = right-unitµ(e).

Example 31.2.2. The loop space Ω(A) of any pointed type is a coherent H-space, where themultiplication is given by path concatenation.

By an unpointed fiber sequence, we mean a sequence

F E Bi p

where only the type B is assumed to be pointed (with base point b), and the square

F E

1 B

i

const? p

constb

is a pullback square. The most immediate

Theorem 31.2.3 (The Hopf construction). Consider a type A equipped with an H-space structure µ.Then there is an unpointed fiber sequence

A → A ∗ A ΣA.

If A and the H-space structure are pointed, then this unpointed fiber sequence is an fiber sequence.

Page 253: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

31. THE HOPF FIBRATION 243

Proof. Note that there is a unique map h : A ∗ A→ ΣA such that the cube

A× A

A A A

1 A ∗ A 1

ΣA

µpr1 pr2

h

commutes. By this commuting cube it is enough to show that the two back squares are pullbacksquares, because then it follows by ... that the two front squares are pullback squares. We thendefine the Hopf fibration to be

A A ∗ A ΣA,inl h

which is a fiber sequence by the fact that the front left square in the cube is a pullback square.Thus, we have to show that the two squares

A× A A A× A A

A 1 A 1

pr1

µ µ

pr2

are pullback squares. Thus, we have to show that the maps

fib-sq : fibpr1(x)→ fibconst?(?)

fib-sq : fibpr2(x)→ fibconst?(?)

are equivalences for each x : X. Note that there are commuting squares

fibpr1(x) fibconst?(?) fibpr2(x) fibconst?(?)

A A A A.

fib-sq fib-sq

µ(x, – ) µ(– ,x)

In both squares both vertical maps are equivalences by Exercise 8.6. Moreover, we have assumedthat µ(x, –) and µ(–, x) are equivalences for each x : X, so the claim follows.

Corollary 31.2.4. There is a fiber sequence

S1 → S1 ∗ S1 S2.

Lemma 31.2.5. The join operation is associative

Page 254: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

244 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

Proof.

A A× C A× C

A× B A× B× C A× C

B B× C C

Corollary 31.2.6. There is an equivalence S1 ∗ S1 ' S3.

Theorem 31.2.7. There is a fiber sequence S1 → S3 S2.

Lemma 31.2.8. Suppose f : G → H is a group homomorphism, such that the sequence

0 G H 0f

is exact at G and H, where we write 0 for the trivial group consisting of just the unit element. Then f is agroup isomorphism.

Corollary 31.2.9. We have π2(S2) = Z, and for k > 2 we have πk(S2) = πk(S3).

31.3 The long exact sequence

Definition 31.3.1. A fiber sequence F → E B consists of:

(i) Pointed types F, E, and B, with base points x0, y0, and b0 respectively,

(ii) Base point preserving maps i : F →∗ E and p : E →∗ B, with α : i(x0) = y0 andβ : p(y0) = b0,

(iii) A pointed homotopy H : constb0 ∼∗ p ∗ i witnessing that the square

F E

1 B,

i

p

constb0

commutes and is a pullback square.

Lemma 31.3.2. Any fiber sequence F → E B induces a sequence of pointed maps

Ω(F) Ω(E) Ω(B) F E B,Ω(i) Ω(p) ∂ i p

in which every two consecutive maps form a fiber sequence.

Page 255: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

31. THE HOPF FIBRATION 245

Proof. By taking pullback squares repeatedly, we obtain the diagram

Ω(F) 1

Ω(E) Ω(B) 1

1 F E

1 B.

Ω(i) constreflb0

Ω(p)

∂ consty0

constx0

i

p

constb0

Definition 31.3.3. We say that a consecutive pair of pointed maps between pointed sets

A B Cf g

is exact at B if we have (∃(a:A) f (a) = b

)↔ (g(b) = c)

for any b : B.

Remark 31.3.4. If a pair of consecutive pointed maps between pointed sets

A B Cf g

is exact at B, it directly that im( f ) = fibg(c). Indeed, such a pair of pointed maps is exact at B ifand only if there is an equivalence e : im( f ) ' fibg(c) such that the triangle

im( f ) fibg(c)

B

e

commutes. In other words, im( f ) and fibg(c) are equal as subsets of B.

Lemma 31.3.5. Suppose F → E B is a fiber sequence. Then the sequence

‖F‖0 ‖E‖0 ‖B‖0‖i‖0 ‖p‖0

is exact at ‖E‖0.

Proof. To show that the image im ‖i‖0 is the fiber fib‖p‖0(|b0|0), it suffices to construct a fiberwise

equivalence∏ (x:‖E‖0)

‖fib‖i‖0(x)‖−1 ' ‖p‖0(x) = |b0|0.

By the universal property of 0-truncation it suffices to show that

∏ (x:E)‖fib‖i‖0(|x|0)‖−1 ' ‖p‖0(|x|0) = |b0|0.

Page 256: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

246 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

First we note that

‖p‖0(|x|0) = |b0|0 ' |p(x)|0 = |b0|0' ‖p(x) = b0‖−1.

Next, we note that

fib‖i‖0(|x|0) ' ∑(y:‖F‖0)

‖i‖0(y) = |x|0' ‖∑(y:F)‖i‖0(|y|0) = |x|0‖0

' ‖∑(y:F)|i(y)|0 = |x|0‖0

' ‖∑(y:F)‖i(y) = x‖−1‖0.

Therefore it follows that

‖fib‖i‖0(|x|0)‖−1 ' ‖∑(y:F)‖i(y) = x‖−1‖−1

' ‖∑(y:F)i(y) = x‖−1

Now it suffices to show that(

∑(y:F) i(y) = x)' p(x) = b0. This follows by the pasting lemma

of pullbacks

(p(x) = b0) 1

F E

1 B

Theorem 31.3.6. Any fiber sequence F → E B induces a long exact sequence on homotopy groups

· · ·

πn(F) πn(E) πn(B)

π1(F) π1(E) π1(B)

π0(F) π0(E) π0(B)

πn(i) πn(p)

π1(i) π1(p)

π0(i) π0(p)

31.4 The universal complex line bundle

Definition 31.4.1. A coherently associative unpointed H-space structure on a type X consistsof

Page 257: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

31. EXERCISES 247

31.5 The finite dimensional complex projective spaces

Remark 31.5.1. The universe of types that are merely equal to the circle does not classify complexline bundles.

Exercises

31.1 Consider an unpointed H-space X of which the multiplication is associative, and considerx : X. Construct a unit for the multiplication, and show that it satisfies the coherent unitlaws.

31.2 (a) Show that the type of associative unpointed H-space structures on 2 is equivalent to 2.(b) Show that the type of associative (pointed) H-space structures on (2, 12) is contractible.

31.3 Show that any fiber sequenceF → E B

where the base points are x0 : B, y0 : F, and z0 : E induces a fiber sequence of connectedcomponents

BAut(y0) → BAut(z0) BAut(x0).

31.4 Show that there is a fiber sequence

S3 → S2 ‖S2‖2,

where the map S2 → ‖S2‖2 is the unit of the 2-truncation.31.5 Show that CP∞ is a coherent H-space. Note: the 2-sphere is not an H-space, and yet its

2-truncation is!31.6 Construct for every group G of order n + 1 a fiber sequence

G∨(i:Fin(n2)) S1 ∨

(i:Fin(n)) S1

31.7 Show that there is a fiber sequence

RP∞ → CP∞ CP∞.

31.8 Show that the type of (small) fiber sequences is equivalent to the type of quadruples(B, P, b0, x0), consisting of

B : U

P : B→ U

b0 : B

x0 : P(b0).

32 The Blakers-Massey theorem

The Blakers-Massey theorem is a connectivity theorem which can be used to prove the Freuden-thal suspension theorem, giving rise to the field of stable homotopy theory. It was proven in thesetting of homotopy type theory by Lumsdaine et al, and their proof was the first that wasgiven entirely in an elementary way, using only constructions that are invariant under homotopyequivalence.

Page 258: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

248 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

32.1 The Blakers-Massey theorem

Consider a span A← S→ B, consisting of an m-connected map f : S→ A and an n-connectedmap g : S→ B. We take the pushout of this span, and subsequently the pullback of the resultingcospan, as indicated in the diagram

S

A×(AtSB) B B

A A tS B.

g

f

u

π2

π1 inr

inl

(32.1)

The universal property of the pullback determines a unique map u : S → A ×(AtSB) B asindicated.

Theorem 32.1.1 (Blakers-Massey). The map u : S→ A×(AtSB) B of Eq. (32.1) is (n + m)-connected.

32.2 The Freudenthal suspension theorem

Theorem 32.2.1. If X is a k-connected pointed type, then the canonical map

X → Ω(ΣX)

is 2k-connected.

Theorem 32.2.2. πn(Sn) = Z for n ≥ 1.

32.3 Higher groups

Recall that types in HoTT may be viewed as ∞-groupoids: elements are objects, paths aremorphisms, higher paths are higher morphisms, etc.

It follows that pointed connected types B may be viewed as higher groups, with carrier ΩB.The neutral element is the identity path, the group operation is given by path composition, andhigher paths witness the unit and associativity laws. Of course, these higher paths are themselvessubject to further laws, etc., but the beauty of the type-theoretic definition is that we don’t haveto worry about that: all the (higher) laws follow from the rules of the identity types. WritingG for the carrier ΩB, it is common to write BG for the pointed connected type B, which comesequipped with an identification G = ΩBG. We call BG the delooping of G.

The type of pointed types is Upt :≡ ∑(A:U ) A. The type of n-truncated types is U≤n :≡∑(A:U ) is-truncn A and for n-connected types it is U>n :≡ ∑(A:U ) is-connn(A). We will combinethese notations as needed.

Definition 32.3.1. We define the type of higher groups, or ∞-groups, to be

∞Grp :≡ ∑(G:U )∑(BG:U>0pt )G ' ΩBG.

When G is an ∞-group, we also write G for its first projection, called the carrier of G.

Page 259: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

32. THE BLAKERS-MASSEY THEOREM 249

Remark 32.3.2. Note that we have equivalences

∞Grp ≡ ∑(G:U )∑(BG:U>0pt )G ' ΩBG

' ∑(G:Upt)∑(BG:U>0pt )G 'pt ΩBG

' U>0pt

for the type of higher groups.

Automorphism groups form a major class of examples of ∞-groups. Given any type A and anyobject a : A, the automorphism group at a is defined as automorphism group Aut a :≡ (a = a).This is indeed an ∞-group, because it is the loop space of the connected component of A at a, i.e.we define BAuta :≡ im(a : 1→ A) = (x : A)× ‖a = x‖−1. From this definition it is immediatethat Aut a = ΩBAuta, so we see that Aut a is indeed an example of an ∞-group.

If we take A = Set, we get the usual symmetric groups Sn :≡ Aut(Fin(n)), where Fin(n) is aset with n elements. (Note that BSn = BAut(Fin(n)) is the type of all n-element sets.)

We recover the ordinary set-level groups by requiring that G is a 0-type, or equivalently, thatBG is a 1-type. This leads us to introduce:

Definition 32.3.3. We define the type of groupal (n− 1)-gropuoids, or n-groups, to be

nGrp :≡ ∑(G:U<npt )∑(BG:U>0

pt )G 'pt ΩBG.

We write Grp for the type of 1-groups.

The type of n-groups is therefore equivalent to the type of pointed connected (n + 1)-types.Note that if A is an (n + 1)-type, then Aut a is an (n + 1)-group because Aut a is n-truncated.

For example, the integers Z as an additive group are from this perspective represented bytheir delooping BZ = S1, i.e., the circle. Indeed, any set-level group G is represented as itsdelooping BG :≡ K(G, 1).

Moving across the homotopy hypothesis, for every pointed type (X, x) we have the funda-mental ∞-group of X, Π∞(X, x) :≡ Aut x. Its (n− 1)-truncation (an instance of decategorifi-cation, see §32.4) is the fundamental n-group of X, Πn(X, x), with corresponding deloopingBΠn(X, x) = ‖BAutx‖n.

Double loop spaces are more well-behaved than mere loop spaces. For example, they arecommutative up to homotopy by the Eckmann-Hilton argument [3, Theorem 2.1.6]. Triple loopspaces are even better behaved than double loop spaces, and so on.

Definition 32.3.4. A type G is said to be k-tuply groupal if it comes equipped with a k-folddelooping, i.e. a pointed k-connected BkG : U≥k

pt and an equivalence G ' ΩkBkG.Mixing the two directions, we also define

(n, k)GType :≡ ∑(G:U≤npt )∑(BkG:U≥k

pt )G 'pt ΩkBkG

' U≥k,≤n+kpt

for the type of k-tuply groupal n-groupoids1. We allow taking n = ∞, in which case thetruncation requirement is simply dropped.

1This is called nUk in [BaezDolan1998], but here we give equal billing to n and k, and we add the “G” to indicategroup-structure.

Page 260: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

250 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

Table VI.1: Periodic table of k-tuply groupal n-groupoids.

k \ n 0 1 2 · · · ∞

0 pointed set pointed groupoid pointed 2-groupoid · · · pointed ∞-groupoid1 group 2-group 3-group · · · ∞-group2 abelian group braided 2-group braided 3-group · · · braided ∞-group3 — ” — symmetric 2-group sylleptic 3-group · · · sylleptic ∞-group4 — ” — — ” — symmetric 3-group · · · ?? ∞-group...

......

.... . .

...Ω — ” — — ” — — ” — · · · connective spectrum

Note that nGrp = (n− 1, 1)GType. This shift in indexing is slightly annoying, but we keep itto stay consistent with the literature.

Note that for each k ≥ 0 there is a forgetful map

(n, k + 1)GType→ (n, k)GType,

given by Bk+1G 7→ ΩBk+1G, defining a sequence

· · · (n, 2)GType (n, 1)GType (n, 0)GType.

Thus we define (n, ∞)GType as the limit of this sequence:

(n, ∞)GType :≡ limk(n, k)GType

' ∑(B – G:∏ (k:N)U≥k,≤n+kpt )∏ (k:N)B

kG 'pt ΩBk+1G.

In §32.4 we prove the stabilization theorem (Theorem 32.4.10), from which it follows that(n, ∞)GType = (n, k)GType for k ≥ n + 2.

The type (∞, ∞)GType is the type of stably groupal ∞-groups, also known as connectivespectra. If we also relax the connectivity requirement, we get the type of all spectra, and we canthink of a spectrum as a kind of ∞-groupoid with k-morphisms for all k ∈ Z.

The double hierarchy of higher groups is summarized in Table VI.1. We shall prove thecorrectness of the n = 0 column in ??.

A homomorphism between higher groups is any function that can be suitably delooped.

Definition 32.3.5. For G, H : (n, k)GType, we define

hom(n,k)(G, H) :≡ ∑(h:G→pt H)∑(Bkh:BkG→ptBk H)Ωk(Bkh) ∼pt h

' (Bkh : BkG →pt Bk H).

For (connective) spectra we need pointed maps between all the deloopings and pointed homo-topies showing they cohere.

Note that if h, k : G → H are homomorphisms between set-level groups, then h and k areconjugate if Bh, Bk : BG →pt BH are freely homotopic (i.e., equal as maps BG → BH).

Also observe that

πj(BkG →pt Bk H) ' ‖BkG →pt ΩjBk H‖0

Page 261: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

32. THE BLAKERS-MASSEY THEOREM 251

' ‖ΣjBkG →pt Bk H‖0

' 0

for j > n, which suggests that hom(n,k)(G, H) is n-truncated. To prove this, we deviate slightlyfrom the approach in [BuchholtzDoornRijke] and use the following intermediate result.

32.4 The stabilization theorem for higher groups

Definition 32.4.1. The decategorification Decat G of a k-tuply groupal (n + 1)-group is definedto be the k-tuply groupal n-group ‖G‖n−1, which has delooping ‖BkG‖n+k−1. Thus, decategorifi-cation is an operation

Decat : (n, k)GType→ (n− 1, k)GType.

The functorial action of Decat is defined in the expected way. We also define the ∞-decategorification∞-DecatG of a k-tuply groupal ∞-group as the k-tuply groupal n-group ‖G‖n, which has deloop-ing ‖BkG‖n+k.

Definition 32.4.2. The discrete categorification Disc G of a k-tuply-groupal (n + 1)-group isdefined to be the same ∞-group G, now considered as a k-tuply groupal (n + 2)-group. Thus,the discrete categorification is an operation

Disc : (n, k)GType→ (n + 1, k)GType.

Similarly, the discrete ∞-decategorification ∞-DiscG of a k-tuply groupal (n + 1)-group is de-fined to be the same group, now considered as a k-tuply groupal ∞-group.

Remark 32.4.3. The decategorification and discrete categorification functors make the (n + 1)-category (n, k)GType a reflective sub-(∞, 1)-category of (n + 1, k)GType. That is, there is anadjunction Decat a Disc. These properties are straightforward consequences of the universalproperty of truncation. Similarly, we have ∞-Decat a ∞-Disc such that the counit induces anisomorphism ∞-Decat ∞-Disc = id.

For the next constructions, we need the following properties.

Definition 32.4.4. For A : Upt we define the n-connected cover of A to be A〈n〉 :≡ fibA→‖A‖n .We have the projection p1 : A〈n〉 →pt A.

Lemma 32.4.5. The universal property of the n-connected cover states the following. For any n-connectedpointed type B, the pointed map

(B→pt A〈n〉)→pt (B→pt A),

given by postcomposition with p1, is an equivalence.

Proof. Given a map f : B →pt A, we can form a map f : B → A〈n〉. First note that for b : Bthe type | f b|n =‖A‖n |pt|n is (n− 1)-truncated and inhabited for b = pt. Since B is n-connected,the universal property for connected types shows that we can construct a qb : | f b|n = |pt|n forall b such that q0 : qb0 · ap|– |n( f0) = 1. Then we can define the map f (b) :≡ ( f b, qb). Now f ispointed, because ( f0, q0) : ( f b0, qb0) = (a0, 1).

Now we show that this is indeed an inverse to the given map. On the one hand, we need toshow that if f : B→pt A, then pr1 f = f . The underlying functions are equal because they both

Page 262: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

252 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

send b to f (b). They respect points in the same way, because app1( f0) = f0. The proof that theother composite is the identity follows from a computation using fibers and connectivity, whichwe omit here, but can be found in the formalization.

The next reflective sub-(∞, 1)-category is formed by looping and delooping.

looping Ω : (n, k)GType→ (n− 1, k + 1)GType〈G, BkG〉 7→ 〈ΩG, BkG〈k〉〉

delooping B : (n, k)GType→ (n + 1, k− 1)GType〈G, BkG〉 7→ 〈Ωk−1BkG, BkG〉

We have B a Ω, which follows from Lemma 32.4.5 and Ω B = id, which follows from the factthat A〈n〉 = A if A is n-connected.

The last adjoint pair of functors is given by stabilization and forgetting. This does not form areflective sub-(∞, 1)-category.

forgetting F : (n, k)GType→ (n, k− 1)GType〈G, BkG〉 7→ 〈G, ΩBkG〉

stabilization S : (n, k)GType→ (n, k + 1)GType〈G, BkG〉 7→ 〈SG, ‖ΣBkG‖n+k+1〉,where SG = ‖Ωk+1ΣBkG‖n

We have the adjunction S a F which follows from the suspension-loop adjunction Σ a Ω onpointed types.

The next main goal in this section is the stabilization theorem, stating that the ditto marksin Table VI.1 are justified.

The following corollary is almost [3, Lemma 8.6.2], but proving this in Book HoTT is a bittricky. See the formalization for details.

Lemma 32.4.6 (Wedge connectivity). If A : Upt is n-connected and B : Upt is m-connected, then themap A ∨ B→ A× B is (n + m)-connected.

Let us mention that there is an alternative way to prove the wedge connectivity lemma: Recallthat if A is n-connected and B is m-connected, then A ∗ B is (n+m+ 2)-connected [joinconstruction].Hence the wedge connectivity lemma is also a direct consequence of the following lemma.

Lemma 32.4.7. Let A and B be pointed types. The fiber of the wedge inclusion A ∨ B → A × B isequivalent to ΩA ∗ΩB.

Proof. Note that the fiber of A→ A× B is ΩB, the fiber of B→ A× B is ΩA, and of course thefiber of 1→ A× B is ΩA×ΩB. We get a commuting cube

ΩA×ΩB

ΩB 1 ΩA

A 1 B

A× B

Page 263: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

32. THE BLAKERS-MASSEY THEOREM 253

in which the vertical squares are pullback squares.By the descent theorem for pushouts it now follows that ΩA ∗ΩB is the fiber of the wedge

inclusion.

The second main tool we need for the stabilization theorem is:

Theorem 32.4.8 (Freudenthal). If A : U>npt with n ≥ 0, then the map A→ ΩΣA is 2n-connected.

This is [3, Theorem 8.6.4].The final building block we need is:

Lemma 32.4.9. There is a pullback square

ΣΩA A ∨ A

A A× A

εA

for any A : Upt.

Proof. Note that the pullback of ∆ : A→ A× A along either inclusion A→ A× A is contractible.So we have a cube

ΩA

1 1 1

A A A

A× A

in which the vertical squares are all pullback squares. Therefore, if we pull back along the wedgeinclusion, we obtain by the descent theorem for pushouts that the square in the statement isindeed a pullback square.

Theorem 32.4.10 (Stabilization). If k ≥ n + 2, then S : (n, k)GType → (n, k + 1)GType is anequivalence, and any G : (n, k)GType is an infinite loop space.

Proof. We show that F S = id = S F : (n, k)GType→ (n, k)GType whenever k ≥ n + 2.For the first, the unit map of the adjunction factors as

BkG → ΩΣBkG → Ω‖ΣBkG‖n+k+1

where the first map is 2k− 2-connected by Freudenthal, and the second map is n + k-connected.Since the domain is n + k-truncated, the composite is an equivalence whenever 2k− 2 ≥ n + k.

For the second, the counit map of the adjunction factors as

‖ΣΩBkG‖n+k → ‖BkG‖n+k → BkG,

where the second map is an equivalence. By the two lemmas above, the first map is 2k − 2-connected.

Page 264: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

254 CHAPTER VI. SYNTHETIC HOMOTOPY THEORY

For example, for G : (0, 2)GType an abelian group, we have BnG = K(G, n), an Eilenberg-MacLane space.

The adjunction S a F implies that the free group on a pointed set X is Ω‖ΣX‖1 = π1(ΣX). IfX has decidable equality, ΣX is already 1-truncated. It is an open problem whether this is true ingeneral.

Also, the abelianization of a set-level group G : 1Grp is π2(ΣBG). If G : (n, k)GType is in thestable range (k ≥ n + 2), then SFG = G.

32.5 Eilenberg-Mac Lane spaces

Exercises

32.1 Show that if X is m-connected and f : X → Y is n-connected, then the map

X → fibm f (∗)

where m f : Y → M f is the inclusion of Y into the cofiber of f , is (m + n)-connected.32.2 Suppose that X is a connected type, and let f : X → Y be a map. Show that the following

are equivalent:

(i) f is n-connected.

(ii) The mapping cone of f is (n + 1)-connected.

32.3 Apply the Blakers-Massey theorem to the defining pushout square of the smash productto show that if A and B are m- and n-connected respectively, then there is a (m + n +min(m, n) + 2)-connected map

Ω(A) ∗ Ω(B)→ Ω(A ∧ B).

32.4 Show that the square1 2

X X + 1

is both a pullback and a pushout. Conclude that the result of the Blakers-Massey theoremis not always sharp.

32.5 Show that for every pointed type X, and any n : N, there is a fiber sequence

K(πn+1(X), n + 1) → ‖X‖n+1 ‖X‖n.

Page 265: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

Bibliography

[1] J. F. Adams. “On the nonexistence of elements of Hopf invariant one”. In: Bull. Amer. Math.Soc. 64.5 (Sept. 1958), pp. 279–282. URL: https://projecteuclid.org:443/euclid.bams/1183522680.

[2] Erret Bishop. Foundations of constructive analysis. New York: McGraw-Hill Book Co., 1967,pp. xiii+370.

[3] The Univalent Foundations Program. Homotopy Type Theory: Univalent Foundations of Mathe-matics. Institute for Advanced Study: https://homotopytypetheory.org/book, 2013.

255

Page 266: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the
Page 267: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

Index

(–, –), 21−1Z, 20∅, see empty type02, 1902 6= 12, 450N, 140Z, 201, see unit type12, 191Z, 202, see booleans3-by-3 lemma

for pushouts, 1463-for-2 property

of contractible types, 53of equivalences, 44of pullbacks, 120

A + B, see coproducta = x, see identity typeA→ B, see function typeA ' B, see equivalence

as relation, 90truncatedness, 90

A× B, see cartesian productaction on generators

for the circle, 102action on paths, 28–29

ap-comp, 29ap-concat, 29ap-id, 29ap-inv, 29ap-refl, 29fibers of, 133

addN, 16addN(m) is an embedding, 67

addZ, 23addition on N, 16–17annihilation laws

cartesian product, 44anti-reflexive, 38anti-symmetric

poset, 89ap f , see action on pathsap-comp, 29ap-concat, 29ap-id, 29ap-inv, 29ap-refl, 29apd f , 30associativity

of addition on N, 30of addition on Z, 45of dependent function composition, 12of function composition, 10of multiplication on N, 30of path concatenation, 27of Σ-types, 45

attaching cells, 135Aut, 93automorphism group, 93axiom

function extensionality, 78univalence, 87

axiom K, 64

BA, see function typebase, 99base case, 14β-rule

for Π-types, 9bi-implication, 84, 88bi-invertible map, see equivalencebinomial coefficient, 17, 80binomial theorem, 80Bishop on the positive integers, 13boolean algebra, 19, 23boolean logic, 19

257

Page 268: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

258 INDEX

boolean operations, 19booleans, 19

02, 1912, 19computation rules, 19conjunction, 19constb is not an equivalence, 45disjunction, 19exclusive disjunction, 23if and only if, 23implication, 23induction principle, 19neg2, 19negation, 19Peirce’s arrow, 23rules, 23Sheffer stroke, 23

canonical pullback, 122cart map

cart-mapS , 166is an equivalence, 166

cart(S ,S ′), 165cart-descS , 165cartesian product, 22

annihilation laws, 44as pullback, 124computation rule, 22ind×, 22induction principle, 22rules, 23universal property, 81

cartesian square, 119cartesian transformation

of spans, 165category, 97

of groups, 97of posets, 98of semi-groups, 97of sets, 97poset, 97

category laws, 97for functions, 10

center of contraction, 47change of variables, 5characterization of identity type

contractible type, 53coproduct, 59–60fiber, 49

fundamental theorem of identity types,54–62

Σ-type, 42–43choice, 79choice−1, 79circle, 99–115, 135, 171

base, 99fundamental cover, 107–115

total space is contractible, 112is a 1-type, 113loop, 99S1 ' Σ2, 142

classical-Propclassical-Prop ' 2, 90

classified by the universal family, 205closed term, 2closed type, 2cocartesian square, 137cocone, 136cocone-map, 137coconeS (X), 136

as a pullback, 141codiagonal, 171cofib f , 142cofiber, 142coherently invertible, 82

is a proposition, 84coherently invertible map, 50

is a contractible map, 50commutativity

of addition on N, 30of addition on Z, 45of coproducts, 45of multiplication on N, 30

commuting cube, 148comp(g, f ), 10composition

of dependent functions, 12associativity, 12unit laws, 12

of equivalences, 44of functions, 10

associativity, 10unit laws, 11

of group homomorphisms, 94of morphisms, 97of semi-group homomorphisms, 93

computation rulesfor N, 15

Page 269: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

INDEX 259

for pushouts, 157of booleans, 19of cartesian product, 22of coproduct, 20of Σ-types, 22of the circle, 99of unit type, 18of Z, 21

con-inv, 30concat, 26

is a family of equivalences, 44is an embedding, 98

concat′, 44is a family of equivalences, 44

concat-list, 24concatenation

for identifications, 26of lists, 24

coneon a cospan, 118

cone-map, 119cone(–), 118cons(a, l), 24constx, 11constant family, 5constant function, 11context, 1–3

empty context, 2contractible

retract of, 78weak function extensionality, 77

contractible map, 49–53is an equivalence, 49

contractible type, 46–543-for-2 property, 53center of contraction, 47closed under cartesian product, 53closed under retracts, 53contraction, 47identity types of, 53is a proposition, 62is equivalent to 1, 53

contraction, 47conversion rule

term, 6variable, 3

coproduct, 20–21computation rules, 20disjointness, 59–60

functorial action, 46identity type, 59–60ind+, 20induction principle, 20inl, 20inr, 20is commutative, 45rules, 23unit laws, 44universal property, 84Z, 20

cospan, 118

d | nis a proposition if d > 0, 67

dependent action on generatorsfor the circle, 99

dependent action on paths, 30, 99dependent function

dependent action on paths, 30dependent function type, 7–12

β-rule, 9change of bound variable, 8computation rules, see β- and η-rulescongruence rule, 8elimination rule, see evaluationη-rule, 9evaluation, 9formation rule, 8introduction rule, see λ-abstractionλ-abstraction, 8λ-congruence, 8

dependent pair, 21dependent pair type, 21–22

(–, –), 21computation rule, 22EqΣ, 42identity type, 42–43indΣ, 22induction principle, 22left unit law, 53pr1, 22pr2, 22rules, 23

dependent type theory, 1–7dependent universal property

of the circle, 100derivation, 5–6Desc(S), 161

Page 270: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

260 INDEX

desc-famS , 161is an equivalence, 161

descS1 , 107descent, 117

empty type, 134descent data, 161

for the circle, 107descent theorem

for pushouts, 166dgenS1 , 99diagonal

of a map, 133fibers of, 133

of a type, 206fibers of, 133

disjoint sum, see coproductdisjointness of coproducts, 59–60distributivity

of inv over concat, 30of mulN over addN, 30of Π over Σ, 79

ES1 , 108embedding, 58–59, 184, 185

closed under homotopies, 60diagonal is an equivalence, 133pullbacks of embeddings, 128

empty context, 2empty type, 18–19

ind∅, 18induction principle, 18is a proposition, 62rules, 23universal property, 84

encoding of a type in a universe, 31enough universes, 33–35Eq2, 38Eq-fib, 49EqN, 36EqΣ, 42eq-equiv, 87eq-htpy, 77eq-pair, 43equiv-eq, 87

is a group isomorphism, 98equivalence, 39–46

3-for-2 property, 44closed under homotopies, 44composition, 44

has an inverse, 41inverse, 41is a contractible map, 53is an embedding, 58pointed equivalence, 90postcomposition, 84precomposition, 82pullback of, 128

equivalence induction, 87equivalence relation, 197, 199

observational equality on N, 37ess-small(A), 203ess-small( f ), 203essentially small

is a proposition, 204map, 203type, 203

is locally small, 209η-rule, 88

for Π-types, 9ev-inl-inr, 84ev-pair, 81ev-pt, 47, 85ev-refl, 81evaluation, 9exponentiation function on N, 17extensionality principle

for functions, 77for propositions, 88for types, 87

f + g, see functorial action, of coproductsf ∼ g, see homotopyfactorial operation, 17family, 3

constant family, 5fiber of, 4fibers of projection map, 53of finite types, 36transport, 29trivial family, 5universal family, 32

family of equivalences, 54–56, 127family of maps, 126fib f (b), 49fiber, 49

as pullback, 125characterization of identity type, 49Eq-fib, 49

Page 271: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

INDEX 261

of a family, 4of tot( f ), 54

fiber product, 124fiberwise join, 172Fibonacci sequence, 14, 17, 23fibrant replacement, 54Fin, 80Fin, 36finite types, 36first projection map, 22flatten-list, 24flattening lemma

for pushouts, 163, 168fold-list, 24function

action on paths, 29addition on N, 16–17binomial coefficient, 17const, 11constant function, 11exponentiation on N, 17factorial operation, 17has a retraction, 41has a section, 41has an inverse, 41is an equivalence, 41maxN, 17minN, 17mulN, 17pr1, 22pr2, 22predZ, 23succN, 14succZ, 21swap, 12

is an equivalence, 41function extensionality, 77function type, 1, 9

composition, 10identity function, 10

functorial actionof coproducts, 46

fundamental coverof the circle, 107–115

fundamental theorem of identity types, 42,54–62, 77, 87, 95

formulation with retractions, 61formulation with sections, 61

g f , 10Γ ` a : A, 2Γ ` a ≡ b : A, 2Γ ` A ≡ B type, 2Γ ` A type, 1gap map, 123genS1 , 102Goldbach’s Conjecture, 30graph

of a function, 90Group, 92

identity type, 96is a 1-type, 96is a category, 97

group, 32, 92automorphism group of set, 93homomorphism, 94is a category, 97loop space of 1-type, 92Sn, 93Z, 93

group homomorphismisomorphism, 94preserves units and inverses, 98

group operationson Z, 23

groupoid lawsof homotopies, 39–40of identifications, 26–28

H · f , see homotopy, whiskering operationsh · H, see homotopy, whiskering operationshas an inverse, 41has-inverse( f ), 41

has-inverse(id) ' (id ∼ id), 84helix, 108higher inductive type

circle, 99hom(G, H) for groups, 94hom(G, H) for semi-groups, 93homomorphism

of groups, 94homotopy, 39–40

commutative diagram, 40groupoid laws, 39–40htpy-concat, 39htpy-inv, 39htpy-nat, 51htpy-refl, 39

Page 272: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

262 INDEX

iterated, 39naturality, 51whiskering operations, 40

homotopy fiber, see fiberhomotopy induction, 77Homotopy interpretation, 25horizontal line, see inference rulehtpy-concat, 39

is a family of equivalences, 83htpy-concat′

is a family of equivalences, 83htpy-eq, 77

is an equivalence, 77htpy-inv, 39

is an equivalence, 83htpy-nat, 51htpy-refl, 39hypothetical term, 2

IdA, see identity typeidA, 10identification, 25identification elimination, 25identity function, 5, 10

is an equivalence, 41identity homomorphism

for groups, 94of semi-groups, 93

identity morphism, 96identity system, 57–58identity type, 2, 24–31

action on paths, 28–29as pullback, 133con-inv, 30coproduct, 59–60distributive-inv-concat, 30identification, 25identification elimination, 25induction principle, 25inv-con, 30lift, 30Mac Lane pentagon, 31of a fiber, 49of a Π-type, 77of a Σ-type, 42–43of a universe, 87of cone(C), 118of contractible type, 53of Group, 96

of retract is retract, 45of Semi-Group, 95of U∗, 90path, 25path induction, 25path-ind, 25refl, 25rules, 25–26total space is contractible, 48tower of identity types, 28transport, 29universal property, 81

iff-eq, 88image, 191ind+, 20ind∅, 18ind1, 18ind2, 19indN, 14indΣ, 22ind×, 22indexed term, 3indexed type, 3induction principle

for equivalences, 87for homotopies, 77for N, 15identification elimination, 25list(A), 24of booleans, 19, 23of cartesian products, 22of coproduct, 20of empty type, 18for N, 14of Σ-types, 22of the circle, 99of the identity type, 25of unit type, 18of Z, 20path induction, 25singleton induction, 47

inductive step, 14inductive type, 13–31

booleans, 19cartesian product, 22circle, 99–115coproduct, 20–21dependent pair type, 21–22empty type, 18–19

Page 273: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

INDEX 263

identity type, 24–31list(A), 24natural numbers, 13unit type, 18

inference rule, see ruleconclusion, 1hypotheses, 1

injective function, 64inl, 20

is an embedding, 60inr, 20

is an embedding, 60integers, 20–21, 23−1Z, 200Z, 201Z, 20addZ, 23computation rules, 21Fibonacci sequence, 23group laws, 45in-neg, 20in-pos, 20induction principle, 20mulZ, 23negZ, 23predZ, 23succZ, 21

interchange rule, 6inv, 27

is an equivalence, 44inv-con, 30inverse

of an equivalence, 41is an equivalence, 41

inverse law operationsfor identifications, 28

inverse lawsfor a group, 92for addition on Z, 46for semi-group isomorphisms, 94

inverse operationfor identifications, 27

is a contractible map, 49equivalence, 53

is a propositioncontractible type, 62d | n for d > 0, 67empty type, 62

is a set, 64

natural numbers, 65is an embedding, 58

(−1)-truncated map, 67∅→ A, 60addN(m), 67composite of embeddings, 60equivalence, 58if the action on paths have sections, 61injective map into a set, 64inl (for coproducts), 60inr (for coproducts), 60left factor of embedding if right factor

is an equivalence, 61mulN(m) for m > 0, 67right factor of embedding if left factor

is an embedding, 60succN, 67

is an equivalence, 41action on paths of an embedding, 58concat′(q), 44concat(p), 44contractible map, 49htpy-concat′(K), 83htpy-concat(H), 83htpy-eq, 77htpy-inv, 83identity function, 41inv, 44inverse of an equivalence, 41neg2, 45pair-eq, 43pr1 of contractible family, 53succZ, 45swap function, 41tot( f ) of family of equivalences, 55trB(p), 44

is contractiblefactor of contractible cartesian product,

53fiber of an equivalence, 53identity type of contractible type, 53iff singleton induction, 48is a property, 84total space of an identity system, 57total space of identity type, 48total space of opposite identity type, 53unit type, 47

is family of equivalencesiff tot( f ) is an equivalence, 55

Page 274: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

264 INDEX

is-coh-invertible( f ), 50is-contr(A), see contractible type

is a proposition, 84is-contr( f ), see contractible mapis-decidable

is a proposition, 90is-emb( f ), 58is-equiv( f ), 41

is a proposition, 84is-equiv( f ) ' is-coh-invertible( f ), 84is-equiv( f ) ' is-contr( f ), 84is-equiv( f ) ' path-split( f ), 84

is-function(R), 90is-group, 92

is a proposition, 92is-group′, 92

is a proposition, 92is-iso for semi-groups, 94

is a proposition, 94is-prop′(A), 62is-prop(A), 62

is-prop(A)↔ (A→ is-contr(A)), 62is-prop(A)↔ is-emb(const?), 62is-prop(A)↔ is-prop′(A), 62

is-set(A), 64is-set(A)↔ axiom-K(A), 64

is-trunck(A), 65is-trunck(A)→ is-trunck+1(A), 65

is-unital, 91is a proposition, 92

is-classified( f ), 205iso(x, y), 97iso-eq for groups, 96iso-eq for semi-groups, 95isomorphism, 86

in a pre-category, 97of groups, 94of semi-groups

preserves unit, 98is-trunck

is a proposition, 84iterated homotopies, 39iterated loop space, 35

join, 143X ∗ Y, 143judgment, 1–3

Γ ` a : A, 2Γ ` a ≡ b : A, 2

Γ ` A ≡ B type, 2Γ ` A type, 1

judgmental equalityconversion rules, 3is an equivalence relation, 3of terms, 2of types, 2

k-truncated map, see truncated mapk-truncated type, see truncated typek-type, 65, 78

universe of k-types, 90

λ-abstraction, 8λ-congruence, 8laws

of a category, 97left-inv, 28left-unit, 28left unit law, see unit laws

of Σ-types, 53length-list, 24lift, 30list(A), see lists in Alists in A

concat-list, 24cons, 24flatten-list, 24fold-list, 24induction principle, 24length-list, 24nil, 24reverse-list, 24sum-list, 24

lists in A, 24loc-small(A), 203locally small, 206

map, 209type, 203

loop, 99loop space, 35

of 1-type is a group, 92

Mac Lane pentagon, 31mapping cone, 143maximum function, 17minimum function, 17monoid, 91morphism, 96mulN, 17

Page 275: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

INDEX 265

mulN(m) is an embedding if m > 0, 67mulZ, 23multiplication

on N, 17

N, see natural numbersn-sphere, 140∇ f , 171natural numbers, 2, 13–17

indN, 14is a closed type, 2is a poset with divisibility, 89is a poset with ≤, 89is a set, 65observational equality, 36operations on N

0N, 14addN, 16addition, 16–17binomial coefficient, 17exponentiation, 17Fibonacci sequence, 14, 17maxN, 17minN, 17mulN, 17n!, 17succN, 14

rules for N

computation rules, 15elimination, see inductionformation, 13induction, 15induction principle, 14introduction rules, 14

semi-ring laws, 30naturality square of homotopies, 51¬A, see negationneg2, 19

is an equivalence, 45negZ, 23negation

of types, 19negation function

on booleans, 19nil, 24

objects, 96observational equality

EqΣ, 42

of coproducts, 59of Π-types, 39on 2, 38

is least reflexive relation, 38is reflexive, 38

on booleans02 6= 12, 45

on N, 36is an equivalence relation, 37is least reflexive relation, 37is preserved by functions, 37

Ω, see loop spaceΩn, see iterated loop spaceRop, 90opposite relation, 90order relation, 38

pair-eq, 43is an equivalence, 43

pairing function, 21partially ordered set, see pset89pasting property

for pushouts, 142of pullbacks, 129

path, 25path constructor, 99path induction, 25path-ind, 25path-split, 61

is a proposition, 84path-split( f ), 61pattern matching, 17Π-type, see dependent function typepointed equivalence, 90pointed map, 35pointed type, 35poset, 89

closed under exponentials, 89is a category, 97N with divisibility, 89N with ≤, 89type of subtypes, 89

pr1, 22of contractible family is an equivalence,

53pr2, 22pre-category, 96

identity morphism, 96morphisms, 96

Page 276: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

266 INDEX

objects, 96of groups, 97of semi-groups, 97of sets, 97preorder, 97Rezk complete, 97

pre-image, see fiberprecomposition map, 82predZ, 23predecessor function, 23preorder, 97product of types, 22program, 7projection map

second projection, 22projection maps

first projection, 22proof by contradiction, 19proof of negation, 19Prop, 62

is a poset, 89is a set, 88

property, 63proposition, 62–63

closed under equivalences, 63is locally small, 209

propositional extensionality, 88, 89propositions as types

conjunction, 22ptx, 18pullback

3-for-2 property, 120cartesian products of pullbacks, 134gap map, 123Π-type of pullbacks, 135Σ-type of pullbacks, 151

pullback square, 119characterized by families of equivalences,

127universal property, 134

pushoutpasting property, 142

pushout square, 137pushout-product, 172

refl, 25reflexive

poset, 89reflexive relation, 37

relation, 135anti-reflexive, 38functional, 90opposite relation, 90order, 38reflexive, 37

retr( f ), 41retract

identity type, 45of a type, 41

retraction, 41reverse-list, 24Rezk-complete, 97right-inv, 28right-unit, 28right unit law, see unit lawsrules

for booleans, 23for cartesian product, 23for coproduct, 23for dependent function types

β-rule, 9change of bound variable, 8congruence, 8η-rule, 9evaluation, 9formation, 8λ-abstraction, 8λ-congruence, 8

for dependent pair type, 23for empty type, 23for function types, 9for N

computation rules, 15formation, 13induction principle, 14introduction rules, 14

for type dependencychange of variables, 5interchange, 6rules for judgmental equality, 3–4rules for substitution, 4rules for weakening, 4–5term conversion, 6variable conversion, 3variable rule, 5

for unit type, 23identity type, 25–26

Page 277: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

INDEX 267

S1, 99, see circlesec( f ), 41second projection map, 22section

of a map, 41section of a family, 3Semi-Group, 91

identity type, 95is a 1-type, 95is a category, 97

semi-group, 91has inverses, 92homomorphism, 93is a pre-category, 97unital, 91

semi-ring lawsfor N, 30

set, 32, 64–65isomorphism, 86

set-level structure, 91sets

form a category, 97Σ-type, see dependent pair type

as pullback of universal family, 205associativity of, 45universal property, 81

sing-comp, 47sing-ind, 47singleton induction, 47

iff contractible, 48small type, 33Sn, 93Sn, 140span, 135strongly cartesian cube, 151structure identity principle, 91subset, 63substitution, 4

as pullback, 126subtype, 63

poset, 89subuniverse

closed under equivalences, 91succN, 14

is an embedding, 67succZ, 21

is an equivalence, 45successor function

on N, 14

on Z, 21is an equivalence, 45

sum-list, 24suspension, 139

as cofiber, 143swap function, 12

is an equivalence, 41symmetric groups, 93

T , see universal familyterm, 2

closed term, 2indexed, 3

term conversion rule, 6tot f (g), 56tot( f ), 54

fiber, 54of family of equivalences is an equiva-

lence, 55tower of identity types, 28trB, 29

is a family of equivalences, 44transitive

poset, 89transport, 29trivial family, 5truncated

mapby truncatedness of diagonal, 133pullbacks of truncated maps, 128

truncated family of types, 66truncated map, 65truncated type, 62–68

closed under embeddings, 65closed under equivalences, 65closed under exponentials, 79closed under Π, 78universe of k-types, 90

truncation level, 62–68truth tables, 19Twin Prime Conjecture, 30type, 1

closed type, 2indexed, 3

type family, 3type theoretic choice, 79

U≤k, 90U , V ,W , see universe

Page 278: INTRODUCTION TO HOMOTOPY TYPE THEORYbuchholtz/... · INTRODUCTION TO HOMOTOPY TYPE THEORY EGBERT RIJKE 2019. Total number of exercises: 232 The author gratefully acknowledges the

268 INDEX

uniform family, 6uniform term, 7uniquely uniqueness

of pullbacks, 121unit

of a unital semi-group, 91unit law operations

for identifications, 28unit laws

coproduct, 44dependent function composition, 12for a unital semi-group, 91for addition on N, 30for addition on Z, 45for function composition, 11for multiplication on N, 30

unit type, 18computation rules, 18induction principle, 18ind1, 18is a closed type, 18is contractible, 47rules, 23singleton induction, 47?, 18universal property, 85

unital semi-group, 91has inverses, 92

univalence axiom, 87, 91families over S1, 107implies function extensionality, 88

univalent universe, 87universal family, 31–38universal property

cartesian product, 81coproduct, 84empty type, 84identity type, 81of propositional truncation, 187of pullbacks, 119of pullbacks (characterization), 120of pushouts, 137, 141of suspensions, 140of the circle, 100of the image, 184Σ-types, 81unit type, 85

universe, 31–38enough universes, 33–35

of contractible types, 90of k-types, 90of propositions, 90of sets, 90small types, 33

U∗, 35, 90identity type, 90

variable, 2variable conversion rules, 3variable declaration, 2variable rule, 5vertex

of a cone, 118

weak function extensionality, 77, 78, 88weakening, 2, 4–5(binary) wedge, 143(indexed) wedge, 143wedge inclusion, 172well-formed term, 2well-formed type, 1whiskering operations

of homotopies, 40

Yoneda lemma (type theoretical), 81

Z, see integersfundamental cover of S1, 108is a group, 93