107
Introduction to Homotopy Type Theory Lecture 1: Type theory from a homotopy theory perspective Fredrik Nordvall Forsberg University of Strathclyde, Glasgow EUTypes Summer school, Ohrid, 8 August 2018

Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

  • Upload
    others

  • View
    48

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Introduction to Homotopy Type Theory

Lecture 1: Type theory from a homotopy theory perspective

Fredrik Nordvall ForsbergUniversity of Strathclyde, Glasgow

EUTypes Summer school, Ohrid, 8 August 2018

Page 2: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Course plan

I Today: Type theory from a homotopy theory perspective

I Tomorrow: Equivalences, the Univalence Axiom

I Saturday: Propositional truncation, Univalent logic

I Sunday: Higher inductive types, synthethic homotopy theory

1

Page 3: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Main source material

I

I Homotopy Type Theory blog

I Homotopy Type Theory Google group

I Slides and exercises: https://tinyurl.com/hott-ohrid

2

Page 4: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

(

Homotopy

(

Type

)

Theory

)

3

Page 5: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

(

Homotopy (Type

)

Theory)

3

Page 6: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

(Homotopy

(

Type) Theory

)

3

Page 7: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Univalent Foundations and Homotopy Type TheoryTwo separate origins:I UF: Voevodsky [2010–].

I HoTT: Hofmann-Streicher [1995], Awodey-Warren [2009],Garner-van den Berg [2011], Lumsdaine [2010].

Vladimir Voevodsky (1966–2017)Martin Hofmann (1965–2018) Thomas Streicher

Steve Awodey

Michael Warren Richard Garner Benno van den BergPeter Lumsdaine

4

Page 8: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Univalent Foundations

A higher-dimensional foundation of mathematics: basic objects arenot discrete sets, but ∞-groupoids.

Main motivation: everything we write down should be invariantunder equivalence.

Miracle: Martin-Lof Type Theory essentially already is such afoundation.

Side remark: “univalent” derives from Russian word for “faithful”[Voevodsky IHP talk 2014].

5

Page 9: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Univalent Foundations

A higher-dimensional foundation of mathematics: basic objects arenot discrete sets, but ∞-groupoids.

Main motivation: everything we write down should be invariantunder equivalence.

Miracle: Martin-Lof Type Theory essentially already is such afoundation.

Side remark: “univalent” derives from Russian word for “faithful”[Voevodsky IHP talk 2014].

5

Page 10: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Univalent Foundations

A higher-dimensional foundation of mathematics: basic objects arenot discrete sets, but ∞-groupoids.

Main motivation: everything we write down should be invariantunder equivalence.

Miracle: Martin-Lof Type Theory essentially already is such afoundation.

Side remark: “univalent” derives from Russian word for “faithful”[Voevodsky IHP talk 2014].

5

Page 11: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Univalent Foundations

A higher-dimensional foundation of mathematics: basic objects arenot discrete sets, but ∞-groupoids.

Main motivation: everything we write down should be invariantunder equivalence.

Miracle: Martin-Lof Type Theory essentially already is such afoundation.

Side remark: “univalent” derives from Russian word for “faithful”[Voevodsky IHP talk 2014].

5

Page 12: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Homotopy Type Theory

Started as investigations into models of Martin-Lof Type Theoryinto abstract homotopy theory.

Consequence: can prove results in homotopy theory syntheticallyusing Type Theory, extended by axioms suggested by the models.

Miracle: these axioms imply most of the “missing features” of plainType Theory, such as function extensionality, and quotient types.

We now also know that these axioms are computationallywell-behaved thanks to Cubical Type Theory [Cohen, Coquand,Huber, Mortberg 2017].

6

Page 13: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Homotopy Type Theory

Started as investigations into models of Martin-Lof Type Theoryinto abstract homotopy theory.

Consequence: can prove results in homotopy theory syntheticallyusing Type Theory, extended by axioms suggested by the models.

Miracle: these axioms imply most of the “missing features” of plainType Theory, such as function extensionality, and quotient types.

We now also know that these axioms are computationallywell-behaved thanks to Cubical Type Theory [Cohen, Coquand,Huber, Mortberg 2017].

6

Page 14: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Homotopy Type Theory

Started as investigations into models of Martin-Lof Type Theoryinto abstract homotopy theory.

Consequence: can prove results in homotopy theory syntheticallyusing Type Theory, extended by axioms suggested by the models.

Miracle: these axioms imply most of the “missing features” of plainType Theory, such as function extensionality, and quotient types.

We now also know that these axioms are computationallywell-behaved thanks to Cubical Type Theory [Cohen, Coquand,Huber, Mortberg 2017].

6

Page 15: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Homotopy Type Theory

Started as investigations into models of Martin-Lof Type Theoryinto abstract homotopy theory.

Consequence: can prove results in homotopy theory syntheticallyusing Type Theory, extended by axioms suggested by the models.

Miracle: these axioms imply most of the “missing features” of plainType Theory, such as function extensionality, and quotient types.

We now also know that these axioms are computationallywell-behaved thanks to Cubical Type Theory [Cohen, Coquand,Huber, Mortberg 2017].

6

Page 16: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Intuition

Type Theory Interpretation

A type space Aa : A point a in space AA ≡ B spaces A and B are equal (on the nose)a ≡ a′ : A points a and a′ in space A are equal (on the nose)

x : A ` B(x) type fibration B → A

(Σa : A)B(x) total space of the fibration B → A(Πa : A)B(x) space of sections of fibration B → A0 empty space1 trivial space2 discrete two-point spaceuniverse U space of small spacesa =A a′ space of paths connecting a and a′ in A

7

Page 17: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Intuition

Type Theory Interpretation

A type space Aa : A point a in space AA ≡ B spaces A and B are equal (on the nose)a ≡ a′ : A points a and a′ in space A are equal (on the nose)

x : A ` B(x) type fibration B → A

(Σa : A)B(x) total space of the fibration B → A(Πa : A)B(x) space of sections of fibration B → A

0 empty space1 trivial space2 discrete two-point spaceuniverse U space of small spacesa =A a′ space of paths connecting a and a′ in A

7

Page 18: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Intuition

Type Theory Interpretation

A type space Aa : A point a in space AA ≡ B spaces A and B are equal (on the nose)a ≡ a′ : A points a and a′ in space A are equal (on the nose)

x : A ` B(x) type fibration B → A

(Σa : A)B(x) total space of the fibration B → A(Πa : A)B(x) space of sections of fibration B → A0 empty space1 trivial space2 discrete two-point space

universe U space of small spacesa =A a′ space of paths connecting a and a′ in A

7

Page 19: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Intuition

Type Theory Interpretation

A type space Aa : A point a in space AA ≡ B spaces A and B are equal (on the nose)a ≡ a′ : A points a and a′ in space A are equal (on the nose)

x : A ` B(x) type fibration B → A

(Σa : A)B(x) total space of the fibration B → A(Πa : A)B(x) space of sections of fibration B → A0 empty space1 trivial space2 discrete two-point spaceuniverse U space of small spacesa =A a′ space of paths connecting a and a′ in A

7

Page 20: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Remarks

A fibration is a “parameterised space with a homotopy liftingproperty” — the notion needed if identity is weakened to paths.

The total space of a fibration is the disjoint union of all the fibres.

A section is in particular a continuous function — worth keeping inmind when translating concepts.

8

Page 21: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Thinking of identities as paths

a

bp

p−1 c

reflb

I Inverse paths p−1 (symmetry)

I Path concatenation p � q (transitivity)

I Constant paths reflb (reflexivity)

9

Page 22: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Thinking of identities as paths

a

bp

p−1 c

reflb

I Inverse paths p−1 (symmetry)

I Path concatenation p � q (transitivity)

I Constant paths reflb (reflexivity)

9

Page 23: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Thinking of identities as paths

a

bp

p−1

c

reflb

I Inverse paths p−1 (symmetry)

I Path concatenation p � q (transitivity)

I Constant paths reflb (reflexivity)

9

Page 24: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Thinking of identities as paths

a

bp

p−1 cq

reflb

I Inverse paths p−1 (symmetry)

I Path concatenation p � q (transitivity)

I Constant paths reflb (reflexivity)

9

Page 25: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Thinking of identities as paths

a

bp

p−1 cq

reflb

I Inverse paths p−1 (symmetry)

I Path concatenation p � q (transitivity)

I Constant paths reflb (reflexivity)

9

Page 26: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity Proofs are not Unique

There can be more than one path that connects two points, so weshould not expect identity proofs to be unique.

However, not because of this:

•a

• b

since there is a path (homotopy) between the paths.

10

Page 27: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity Proofs are not Unique

There can be more than one path that connects two points, so weshould not expect identity proofs to be unique.

However, not because of this:

•a

• b

since there is a path (homotopy) between the paths.

10

Page 28: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity Proofs are not Unique

There can be more than one path that connects two points, so weshould not expect identity proofs to be unique.

However, not because of this:

•a

• b

since there is a path (homotopy) between the paths.

10

Page 29: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity Proofs are not Unique

There can be more than one path that connects two points, so weshould not expect identity proofs to be unique.

However, not because of this:

•a

• b

since there is a path (homotopy) between the paths.

10

Page 30: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity Proofs are not Unique

There can be more than one path that connects two points, so weshould not expect identity proofs to be unique.

However, not because of this:

•a

• b

since there is a path (homotopy) between the paths.

10

Page 31: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity Proofs are not Unique

There can be more than one path that connects two points, so weshould not expect identity proofs to be unique.

However, not because of this:

•a

• b

since there is a path (homotopy) between the paths.

10

Page 32: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity Proofs are not Unique

There can be more than one path that connects two points, so weshould not expect identity proofs to be unique.

However, not because of this:

•a

• b

since there is a path (homotopy) between the paths.

10

Page 33: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

More problematic

•a

• b

Stuck!

11

Page 34: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

More problematic

•a

• b

Stuck!

11

Page 35: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

More problematic

•a

• b

Stuck!

11

Page 36: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

More problematic

•a

• b

Stuck!

11

Page 37: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Formal rules for identity types

Page 38: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity type rules

Formation If a : A and a′ : A then a =A a′ type.

Introduction If a : A then refla : a =A a.

Elimination If

I x : A, y : A, p : x =A y ` C (x , y , p) type,

I x : A ` d(x) : C (x , x , reflx), and

I a : A, a′ : A and p : a =A a′

then ind=A(C , d , a, a′, p) : C (a, a′, p).

Computation ind=A(C , d , a, a, refla) = d(a).

Elimination, informally

In order to do something with an arbitrary p : a =A a′, it suffices toconsider the case refla : a =A a.

12

Page 39: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity type rules

Formation If a : A and a′ : A then a =A a′ type.

Introduction If a : A then refla : a =A a.

Elimination If

I x : A, y : A, p : x =A y ` C (x , y , p) type,

I x : A ` d(x) : C (x , x , reflx), and

I a : A, a′ : A and p : a =A a′

then ind=A(C , d , a, a′, p) : C (a, a′, p).

Computation ind=A(C , d , a, a, refla) = d(a).

Elimination, informally

In order to do something with an arbitrary p : a =A a′, it suffices toconsider the case refla : a =A a.

12

Page 40: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity type rules

Formation If a : A and a′ : A then a =A a′ type.

Introduction If a : A then refla : a =A a.

Elimination If

I x : A, y : A, p : x =A y ` C (x , y , p) type,

I x : A ` d(x) : C (x , x , reflx), and

I a : A, a′ : A and p : a =A a′

then ind=A(C , d , a, a′, p) : C (a, a′, p).

Computation ind=A(C , d , a, a, refla) = d(a).

Elimination, informally

In order to do something with an arbitrary p : a =A a′, it suffices toconsider the case refla : a =A a.

12

Page 41: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity type rules

Formation If a : A and a′ : A then a =A a′ type.

Introduction If a : A then refla : a =A a.

Elimination If

I x : A, y : A, p : x =A y ` C (x , y , p) type,

I x : A ` d(x) : C (x , x , reflx), and

I a : A, a′ : A and p : a =A a′

then ind=A(C , d , a, a′, p) : C (a, a′, p).

Computation ind=A(C , d , a, a, refla) = d(a).

Elimination, informally

In order to do something with an arbitrary p : a =A a′, it suffices toconsider the case refla : a =A a.

12

Page 42: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Identity type rules

Formation If a : A and a′ : A then a =A a′ type.

Introduction If a : A then refla : a =A a.

Elimination If

I x : A, y : A, p : x =A y ` C (x , y , p) type,

I x : A ` d(x) : C (x , x , reflx), and

I a : A, a′ : A and p : a =A a′

then ind=A(C , d , a, a′, p) : C (a, a′, p).

Computation ind=A(C , d , a, a, refla) = d(a).

Elimination, informally

In order to do something with an arbitrary p : a =A a′, it suffices toconsider the case refla : a =A a.

12

Page 43: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is symmetric

In practice: if you can write it down, it is trivial to prove it.

TheoremIf p : a =A b then there is p−1 : b =A a.

Proof.Consider elimination motive C (x , y , q) ≡ y =A x . We can gived(x) :≡ reflx : C (x , x , refl), hence by the elimination principle wecan take p−1 :≡ ind=A

(C , d , a, b, p) : b =A a.

Second proof.

By the elimination principle, we can assume p is refl, in which casewe need to give refl−1

a : a = a. Obviously refl−1a :≡ refla works.

13

Page 44: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is symmetric

In practice: if you can write it down, it is trivial to prove it.

TheoremIf p : a =A b then there is p−1 : b =A a.

Proof.Consider elimination motive C (x , y , q) ≡ y =A x . We can gived(x) :≡ reflx : C (x , x , refl), hence by the elimination principle wecan take p−1 :≡ ind=A

(C , d , a, b, p) : b =A a.

Second proof.

By the elimination principle, we can assume p is refl, in which casewe need to give refl−1

a : a = a. Obviously refl−1a :≡ refla works.

13

Page 45: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is symmetric

In practice: if you can write it down, it is trivial to prove it.

TheoremIf p : a =A b then there is p−1 : b =A a.

Proof.Consider elimination motive C (x , y , q) ≡ y =A x . We can gived(x) :≡ reflx : C (x , x , refl), hence by the elimination principle wecan take p−1 :≡ ind=A

(C , d , a, b, p) : b =A a.

Second proof.

By the elimination principle, we can assume p is refl, in which casewe need to give refl−1

a : a = a. Obviously refl−1a :≡ refla works.

13

Page 46: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is symmetric

In practice: if you can write it down, it is trivial to prove it.

TheoremIf p : a =A b then there is p−1 : b =A a.

Proof.Consider elimination motive C (x , y , q) ≡ y =A x . We can gived(x) :≡ reflx : C (x , x , refl), hence by the elimination principle wecan take p−1 :≡ ind=A

(C , d , a, b, p) : b =A a.

Second proof.

By the elimination principle, we can assume p is refl, in which casewe need to give refl−1

a : a = a. Obviously refl−1a :≡ refla works.

13

Page 47: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is transitive

TheoremIf p : a = b and q : b = c then there is p � q : a = c .

Proof.We may assume b is a and p is refla, in which case q : a = c hasthe right type, so refl � q :≡ q works.

Second proof.

Elimination with motive C (x , y , r) ≡ (Πs : y =A c)(x =A c)applied to p (for r) and q (for s).

14

Page 48: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is transitive

TheoremIf p : a = b and q : b = c then there is p � q : a = c .

Proof.We may assume b is a and p is refla, in which case q : a = c hasthe right type, so refl � q :≡ q works.

Second proof.

Elimination with motive C (x , y , r) ≡ (Πs : y =A c)(x =A c)applied to p (for r) and q (for s).

14

Page 49: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is transitive

TheoremIf p : a = b and q : b = c then there is p � q : a = c .

Proof.We may assume b is a and p is refla, in which case q : a = c hasthe right type, so refl � q :≡ q works.

Second proof.

Elimination with motive C (x , y , r) ≡ (Πs : y =A c)(x =A c)applied to p (for r) and q (for s).

14

Page 50: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is unique?

Claim?If p, q : a =A b, then p =a=Ab q?

Proof?We may assume p and q are refl; if so, reflrefla obviously works.

Second proof?

Let’s do this formally: we want to prove

(Πx , y : A)(Πr : x = y)(Πs : x = y)(r = s)

so our motive should be C (x , y , r) ≡ (Πs : x = y)(r = s). Weneed to give d(x) : C (x , x , refl)

, i.e.

d(x) : (Πs : x = x)(refl =x=x s)

but we are stuck: the elimination rule does not apply!

We could try to generalise the inner motive, but then refl does nottype check anymore. We cannot write it down.

15

Page 51: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is unique?

Claim?If p, q : a =A b, then p =a=Ab q?

Proof?We may assume p and q are refl; if so, reflrefla obviously works.

Second proof?

Let’s do this formally: we want to prove

(Πx , y : A)(Πr : x = y)(Πs : x = y)(r = s)

so our motive should be C (x , y , r) ≡ (Πs : x = y)(r = s). Weneed to give d(x) : C (x , x , refl)

, i.e.

d(x) : (Πs : x = x)(refl =x=x s)

but we are stuck: the elimination rule does not apply!

We could try to generalise the inner motive, but then refl does nottype check anymore. We cannot write it down.

15

Page 52: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is unique?

Claim?If p, q : a =A b, then p =a=Ab q?

Proof?We may assume p and q are refl; if so, reflrefla obviously works.

Second proof?

Let’s do this formally: we want to prove

(Πx , y : A)(Πr : x = y)(Πs : x = y)(r = s)

so our motive should be C (x , y , r) ≡ (Πs : x = y)(r = s). Weneed to give d(x) : C (x , x , refl)

, i.e.

d(x) : (Πs : x = x)(refl =x=x s)

but we are stuck: the elimination rule does not apply!

We could try to generalise the inner motive, but then refl does nottype check anymore. We cannot write it down.

15

Page 53: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is unique?

Claim?If p, q : a =A b, then p =a=Ab q?

Proof?We may assume p and q are refl; if so, reflrefla obviously works.

Second proof?

Let’s do this formally: we want to prove

(Πx , y : A)(Πr : x = y)(Πs : x = y)(r = s)

so our motive should be C (x , y , r) ≡ (Πs : x = y)(r = s).

Weneed to give d(x) : C (x , x , refl)

, i.e.

d(x) : (Πs : x = x)(refl =x=x s)

but we are stuck: the elimination rule does not apply!

We could try to generalise the inner motive, but then refl does nottype check anymore. We cannot write it down.

15

Page 54: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is unique?

Claim?If p, q : a =A b, then p =a=Ab q?

Proof?We may assume p and q are refl; if so, reflrefla obviously works.

Second proof?

Let’s do this formally: we want to prove

(Πx , y : A)(Πr : x = y)(Πs : x = y)(r = s)

so our motive should be C (x , y , r) ≡ (Πs : x = y)(r = s). Weneed to give d(x) : C (x , x , refl)

, i.e.

d(x) : (Πs : x = x)(refl =x=x s)

but we are stuck: the elimination rule does not apply!

We could try to generalise the inner motive, but then refl does nottype check anymore. We cannot write it down.

15

Page 55: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is unique?

Claim?If p, q : a =A b, then p =a=Ab q?

Proof?We may assume p and q are refl; if so, reflrefla obviously works.

Second proof?

Let’s do this formally: we want to prove

(Πx , y : A)(Πr : x = y)(Πs : x = y)(r = s)

so our motive should be C (x , y , r) ≡ (Πs : x = y)(r = s). Weneed to give d(x) : C (x , x , refl), i.e.

d(x) : (Πs : x = x)(refl =x=x s)

but we are stuck: the elimination rule does not apply!

We could try to generalise the inner motive, but then refl does nottype check anymore. We cannot write it down.

15

Page 56: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is unique?

Claim?If p, q : a =A b, then p =a=Ab q?

Proof?We may assume p and q are refl; if so, reflrefla obviously works.

Second proof?

Let’s do this formally: we want to prove

(Πx , y : A)(Πr : x = y)(Πs : x = y)(r = s)

so our motive should be C (x , y , r) ≡ (Πs : x = y)(r = s). Weneed to give d(x) : C (x , x , refl), i.e.

d(x) : (Πs : x = x)(refl =x=x s)

but we are stuck: the elimination rule does not apply!

We could try to generalise the inner motive, but then refl does nottype check anymore. We cannot write it down.

15

Page 57: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Equality is unique?

Claim?If p, q : a =A b, then p =a=Ab q?

Proof?.We may assume p and q are refl; if so, reflrefla obviously works.

Second proof?

Let’s do this formally: we want to prove

(Πx , y : A)(Πr : x = y)(Πs : x = y)(r = s)

so our motive should be C (x , y , r) ≡ (Πs : x = y)(r = s). Weneed to give d(x) : C (x , x , refl), i.e.

d(x) : (Πs : x = x)(refl =x=x s)

but we are stuck: the elimination rule does not apply!

We could try to generalise the inner motive, but then refl does nottype check anymore. We cannot write it down.

15

Page 58: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Groupoid structure of paths

Theorem

I p � reflb = p

I refla� p = p

I p � p−1 = refla

I p−1 � p = reflb

I (p−1)−1 = p

I p � (q � r) = (p � q) � r

These equalities are not strict; they only hold up to paths, which inturn are coherent, but only up to higher paths, . . .

Theorem (Lumsdaine [2010], van den Berg-Garner [2011])

For every type A, (A,=A,==A, . . .) form an ∞-groupoid.

16

Page 59: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Groupoid structure of paths

Theorem

I p � reflb = p

I refla� p = p

I p � p−1 = refla

I p−1 � p = reflb

I (p−1)−1 = p

I p � (q � r) = (p � q) � r

These equalities are not strict; they only hold up to paths, which inturn are coherent, but only up to higher paths, . . .

Theorem (Lumsdaine [2010], van den Berg-Garner [2011])

For every type A, (A,=A,==A, . . .) form an ∞-groupoid.

16

Page 60: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Groupoid structure of paths

Theorem

I p � reflb = p

I refla� p = p

I p � p−1 = refla

I p−1 � p = reflb

I (p−1)−1 = p

I p � (q � r) = (p � q) � r

These equalities are not strict; they only hold up to paths, which inturn are coherent, but only up to higher paths, . . .

Theorem (Lumsdaine [2010], van den Berg-Garner [2011])

For every type A, (A,=A,==A, . . .) form an ∞-groupoid.

16

Page 61: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting along paths

TheoremLet x : A ` B(x) type. If p : a =A a′ then there is

transportB(p,−) : B(a)→ B(a′)

with transportB(refla,−) = idB(a).

17

Page 62: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting along paths

•a

• a′p

TheoremLet x : A ` B(x) type. If p : a =A a′ then there is

transportB(p,−) : B(a)→ B(a′)

with transportB(refla,−) = idB(a).

17

Page 63: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting along paths

•a

• a′p

B(a) B(a′)

TheoremLet x : A ` B(x) type. If p : a =A a′ then there is

transportB(p,−) : B(a)→ B(a′)

with transportB(refla,−) = idB(a).

17

Page 64: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting along paths

•a

• a′p

B(a) B(a′)

transportB(p,−)

TheoremLet x : A ` B(x) type. If p : a =A a′ then there is

transportB(p,−) : B(a)→ B(a′)

with transportB(refla,−) = idB(a).

17

Page 65: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting along paths

•a

• a′p

B(a) B(a′)

transportB(p,−)

TheoremLet x : A ` B(x) type. If p : a =A a′ then there is

transportB(p,−) : B(a)→ B(a′)

with transportB(refla,−) = idB(a).

17

Page 66: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Functions act on paths

•a

• b f

TheoremLet f : A→ B. There is

apf : (Πx , y : A)(x =A y → f (x) =B f (y)

)with apf (x , x , reflx) :≡ reflf (x).

TheoremLet f : (Πx : A)B(x). There is

apdf : (Πx , y : A)(Πp : x =A y)(f (x) =

pf (y)

)with apdf (x , x , reflx) :≡ reflf (x).

18

Page 67: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Functions act on paths

•a

• b f •f (a)

• f (b)

TheoremLet f : A→ B. There is

apf : (Πx , y : A)(x =A y → f (x) =B f (y)

)with apf (x , x , reflx) :≡ reflf (x).

TheoremLet f : (Πx : A)B(x). There is

apdf : (Πx , y : A)(Πp : x =A y)(f (x) =

pf (y)

)with apdf (x , x , reflx) :≡ reflf (x).

18

Page 68: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Functions act on paths

•a

• b f •f (a)

• f (b)

TheoremLet f : A→ B. There is

apf : (Πx , y : A)(x =A y → f (x) =B f (y)

)with apf (x , x , reflx) :≡ reflf (x).

TheoremLet f : (Πx : A)B(x). There is

apdf : (Πx , y : A)(Πp : x =A y)(f (x) =

pf (y)

)with apdf (x , x , reflx) :≡ reflf (x).

18

Page 69: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Functions act on paths

•a

• b f •f (a)

• f (b)

TheoremLet f : A→ B. There is

apf : (Πx , y : A)(x =A y → f (x) =B f (y)

)with apf (x , x , reflx) :≡ reflf (x).

TheoremLet f : (Πx : A)B(x). There is

apdf : (Πx , y : A)(Πp : x =A y)(f (x) =

pf (y)

)with apdf (x , x , reflx) :≡ reflf (x).

18

Page 70: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Functions act on paths

•a

• b f •f (a)

• f (b)

TheoremLet f : A→ B. There is

apf : (Πx , y : A)(x =A y → f (x) =B f (y)

)with apf (x , x , reflx) :≡ reflf (x).

TheoremLet f : (Πx : A)B(x). There is

apdf : (Πx , y : A)(Πp : x =A y)(f (x) =

pf (y)

)with apdf (x , x , reflx) :≡ reflf (x).

18

Page 71: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths over paths (dependent paths)

Formation If a, a′ : A and p : a =A a′, and b : B(a), b′ : B(a′)then b =

pb′ type.

Introduction If b : B(a) then reflb : b =refla

b.

Elimination . . .

Computation . . .

Can by implemented by e.g.

(b =pb′) :≡ (transportB(p, b) =B(a′) b

′)

or(b =

refla

b′) :≡ (b =B(a) b′) (using path induction)

19

Page 72: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths over paths (dependent paths)

Formation If a, a′ : A and p : a =A a′, and b : B(a), b′ : B(a′)then b =

pb′ type.

Introduction If b : B(a) then reflb : b =refla

b.

Elimination . . .

Computation . . .

Can by implemented by e.g.

(b =pb′) :≡ (transportB(p, b) =B(a′) b

′)

or(b =

refla

b′) :≡ (b =B(a) b′) (using path induction)

19

Page 73: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths over paths (dependent paths)

Formation If a, a′ : A and p : a =A a′, and b : B(a), b′ : B(a′)then b =

pb′ type.

Introduction If b : B(a) then reflb : b =refla

b.

Elimination . . .

Computation . . .

Can by implemented by e.g.

(b =pb′) :≡ (transportB(p, b) =B(a′) b

′)

or(b =

refla

b′) :≡ (b =B(a) b′) (using path induction)

19

Page 74: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths over paths (dependent paths)

Formation If a, a′ : A and p : a =A a′, and b : B(a), b′ : B(a′)then b =

pb′ type.

Introduction If b : B(a) then reflb : b =refla

b.

Elimination . . .

Computation . . .

Can by implemented by e.g.

(b =pb′) :≡ (transportB(p, b) =B(a′) b

′)

or(b =

refla

b′) :≡ (b =B(a) b′) (using path induction)

19

Page 75: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Characterising path spaces

Page 76: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting in Cartesian products

Theorem

transportz 7→A(z)×B(z)(p, x) =

(transportA(p, fst(x)), transportB(p, snd(x)))

Proof.It is enough to consider p ≡ reflx , in which case the problemreduces to x = (fst(x), snd(x)).

True by the η-rule (or an inductionon x).

20

Page 77: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting in Cartesian products

Theorem

transportz 7→A(z)×B(z)(p, x) =

(transportA(p, fst(x)), transportB(p, snd(x)))

Proof.It is enough to consider p ≡ reflx , in which case the problemreduces to x = (fst(x), snd(x)).

True by the η-rule (or an inductionon x).

20

Page 78: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting in Cartesian products

Theorem

transportz 7→A(z)×B(z)(p, x) =

(transportA(p, fst(x)), transportB(p, snd(x)))

Proof.It is enough to consider p ≡ reflx , in which case the problemreduces to x = (fst(x), snd(x)). True by the η-rule (or an inductionon x).

20

Page 79: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in Cartesian productsGiven p : (a, b) =A×B (a′, b′), we have

(apfst(p), apsnd(p)) : (a =A a′)× (b =B b′)

Conversely:

TheoremThere is a function

pair= : (a =A a′)× (b =B b′)→ (a, b) =A×B (a′, b′)

These two maps are inverse to each other in a precise sense; moretomorrow, but for now, this can be summarised by:

Theorem((a, b) =A×B (a′, b′)

)'

((a =A a′)× (b =B b′)

)In particular, we have isEquiv((apfst(−), apsnd(−))).

21

Page 80: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in Cartesian productsGiven p : (a, b) =A×B (a′, b′), we have

(apfst(p), apsnd(p)) : (a =A a′)× (b =B b′)

Conversely:

TheoremThere is a function

pair= : (a =A a′)× (b =B b′)→ (a, b) =A×B (a′, b′)

These two maps are inverse to each other in a precise sense; moretomorrow, but for now, this can be summarised by:

Theorem((a, b) =A×B (a′, b′)

)'

((a =A a′)× (b =B b′)

)In particular, we have isEquiv((apfst(−), apsnd(−))).

21

Page 81: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in Cartesian productsGiven p : (a, b) =A×B (a′, b′), we have

(apfst(p), apsnd(p)) : (a =A a′)× (b =B b′)

Conversely:

TheoremThere is a function

pair= : (a =A a′)× (b =B b′)→ (a, b) =A×B (a′, b′)

These two maps are inverse to each other in a precise sense; moretomorrow, but for now, this can be summarised by:

Theorem((a, b) =A×B (a′, b′)

)'

((a =A a′)× (b =B b′)

)In particular, we have isEquiv((apfst(−), apsnd(−))).

21

Page 82: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in sigma types

Suppose a, a′ : A and b : B(a) and b′ : B(a′). A path

(a, b) =(Σx :A)B(x) (a′, b′)

should consist of:

I a path p : a =A a′

I a path q : b =B(a) b′

I a path q : b =pb′

Theorem((a, b) =(Σx :A)B(x) (a′, b′)

)' (Σp : a =A a′)(b =

pb′)

In particular, we have isEquiv((apfst(−), apdsnd(−))).

22

Page 83: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in sigma types

Suppose a, a′ : A and b : B(a) and b′ : B(a′). A path

(a, b) =(Σx :A)B(x) (a′, b′)

should consist of:

I a path p : a =A a′

I a path q : b =B(a) b′

I a path q : b =pb′

Theorem((a, b) =(Σx :A)B(x) (a′, b′)

)' (Σp : a =A a′)(b =

pb′)

In particular, we have isEquiv((apfst(−), apdsnd(−))).

22

Page 84: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in sigma types

Suppose a, a′ : A and b : B(a) and b′ : B(a′). A path

(a, b) =(Σx :A)B(x) (a′, b′)

should consist of:

I a path p : a =A a′

I a path q : b =B(a) b′

I a path q : b =pb′

Theorem((a, b) =(Σx :A)B(x) (a′, b′)

)' (Σp : a =A a′)(b =

pb′)

In particular, we have isEquiv((apfst(−), apdsnd(−))).

22

Page 85: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in sigma types

Suppose a, a′ : A and b : B(a) and b′ : B(a′). A path

(a, b) =(Σx :A)B(x) (a′, b′)

should consist of:

I a path p : a =A a′

I a path q : b =B(a) b′ not well-typed!

I a path q : b =pb′

Theorem((a, b) =(Σx :A)B(x) (a′, b′)

)' (Σp : a =A a′)(b =

pb′)

In particular, we have isEquiv((apfst(−), apdsnd(−))).

22

Page 86: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in sigma types

Suppose a, a′ : A and b : B(a) and b′ : B(a′). A path

(a, b) =(Σx :A)B(x) (a′, b′)

should consist of:

I a path p : a =A a′

I a path q : b =B(a) b′ not well-typed!

I a path q : b =pb′

Theorem((a, b) =(Σx :A)B(x) (a′, b′)

)' (Σp : a =A a′)(b =

pb′)

In particular, we have isEquiv((apfst(−), apdsnd(−))).

22

Page 87: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in sigma types

Suppose a, a′ : A and b : B(a) and b′ : B(a′). A path

(a, b) =(Σx :A)B(x) (a′, b′)

should consist of:

I a path p : a =A a′

I a path q : b =B(a) b′ not well-typed!

I a path q : b =pb′

Theorem((a, b) =(Σx :A)B(x) (a′, b′)

)' (Σp : a =A a′)(b =

pb′)

In particular, we have isEquiv((apfst(−), apdsnd(−))).

22

Page 88: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting in path types

A prime example of “if you can write it down, it will be trivial toprove it”.

LemmaLet a : A and p : x =A x ′.

Let f , g : A→ B.

I transportz 7→a=z(p, q) = q � p

I transportz 7→z=a(p, q) = p−1 � q

I transportz 7→z=z(p, q) =

p−1 � q � p

I transportz 7→f (z)=g(z)(p, q) =

apf (p−1) � q � apg (p)

We don’t expect a general characterisation of paths in =A — thiswill depend on A.

23

Page 89: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting in path types

A prime example of “if you can write it down, it will be trivial toprove it”.

LemmaLet a : A and p : x =A x ′.

Let f , g : A→ B.

I transportz 7→a=z(p, q) = q � p

I transportz 7→z=a(p, q) = p−1 � q

I transportz 7→z=z(p, q) =

p−1 � q � p

I transportz 7→f (z)=g(z)(p, q) =

apf (p−1) � q � apg (p)

We don’t expect a general characterisation of paths in =A — thiswill depend on A.

23

Page 90: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting in path types

A prime example of “if you can write it down, it will be trivial toprove it”.

LemmaLet a : A and p : x =A x ′.

Let f , g : A→ B.

I transportz 7→a=z(p, q) = q � p

I transportz 7→z=a(p, q) = p−1 � q

I transportz 7→z=z(p, q) =

p−1 � q � p

I transportz 7→f (z)=g(z)(p, q) =

apf (p−1) � q � apg (p)

We don’t expect a general characterisation of paths in =A — thiswill depend on A.

23

Page 91: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting in path types

A prime example of “if you can write it down, it will be trivial toprove it”.

LemmaLet a : A and p : x =A x ′.

Let f , g : A→ B.

I transportz 7→a=z(p, q) = q � p

I transportz 7→z=a(p, q) = p−1 � q

I transportz 7→z=z(p, q) = p−1 � q � p

I transportz 7→f (z)=g(z)(p, q) =

apf (p−1) � q � apg (p)

We don’t expect a general characterisation of paths in =A — thiswill depend on A.

23

Page 92: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting in path types

A prime example of “if you can write it down, it will be trivial toprove it”.

LemmaLet a : A and p : x =A x ′. Let f , g : A→ B.

I transportz 7→a=z(p, q) = q � p

I transportz 7→z=a(p, q) = p−1 � q

I transportz 7→z=z(p, q) = p−1 � q � p

I transportz 7→f (z)=g(z)(p, q) =

apf (p−1) � q � apg (p)

We don’t expect a general characterisation of paths in =A — thiswill depend on A.

23

Page 93: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting in path types

A prime example of “if you can write it down, it will be trivial toprove it”.

LemmaLet a : A and p : x =A x ′. Let f , g : A→ B.

I transportz 7→a=z(p, q) = q � p

I transportz 7→z=a(p, q) = p−1 � q

I transportz 7→z=z(p, q) = p−1 � q � p

I transportz 7→f (z)=g(z)(p, q) = apf (p−1) � q � apg (p)

We don’t expect a general characterisation of paths in =A — thiswill depend on A.

23

Page 94: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Transporting in path types

A prime example of “if you can write it down, it will be trivial toprove it”.

LemmaLet a : A and p : x =A x ′. Let f , g : A→ B.

I transportz 7→a=z(p, q) = q � p

I transportz 7→z=a(p, q) = p−1 � q

I transportz 7→z=z(p, q) = p−1 � q � p

I transportz 7→f (z)=g(z)(p, q) = apf (p−1) � q � apg (p)

We don’t expect a general characterisation of paths in =A — thiswill depend on A.

23

Page 95: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in pi types

Suppose f , g : (Πx : A)B(x). What should a path

f =(Πx :A)B(x) g

consist of?

Theorem (using the Univalence Axiom)

(f =(Πx :A)B(x) g

)' (Πx : A)(f (x) =B(x) g(x))

In particular, we have isEquiv(happly), where

happly :(f = g

)→ (Πx : A)(f (x) =B(x) g(x))

is defined by happly(p, x) = aph 7→h(x)(p).

24

Page 96: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in pi types

Suppose f , g : (Πx : A)B(x). What should a path

f =(Πx :A)B(x) g

consist of?

Theorem (using the Univalence Axiom)

(f =(Πx :A)B(x) g

)' (Πx : A)(f (x) =B(x) g(x))

In particular, we have isEquiv(happly), where

happly :(f = g

)→ (Πx : A)(f (x) =B(x) g(x))

is defined by happly(p, x) = aph 7→h(x)(p).

24

Page 97: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Strong function extensionality from weak

Before HoTT, it was common to assume as an axiom a term

funext : (Πx : A)(f (x) =B(x) g(x))→(f = g

)(the non-trivial direction of

(f = g

)' (Πx : A)(f (x) =B(x) g(x))).

Surprisingly, this weaker statement implies the stronger one:

Theorem (Voevodsky [Lumsdaine, HoTT blog])

If there is a term funext as above, then isEquiv(happly), i.e.(f =(Πx :A)B(x) g

)' (Πx : A)(f (x) =B(x) g(x))

In cubical type theory, funext is trivial to define.

25

Page 98: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Strong function extensionality from weak

Before HoTT, it was common to assume as an axiom a term

funext : (Πx : A)(f (x) =B(x) g(x))→(f = g

)(the non-trivial direction of

(f = g

)' (Πx : A)(f (x) =B(x) g(x))).

Surprisingly, this weaker statement implies the stronger one:

Theorem (Voevodsky [Lumsdaine, HoTT blog])

If there is a term funext as above, then isEquiv(happly), i.e.(f =(Πx :A)B(x) g

)' (Πx : A)(f (x) =B(x) g(x))

In cubical type theory, funext is trivial to define.

25

Page 99: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Strong function extensionality from weak

Before HoTT, it was common to assume as an axiom a term

funext : (Πx : A)(f (x) =B(x) g(x))→(f = g

)(the non-trivial direction of

(f = g

)' (Πx : A)(f (x) =B(x) g(x))).

Surprisingly, this weaker statement implies the stronger one:

Theorem (Voevodsky [Lumsdaine, HoTT blog])

If there is a term funext as above, then isEquiv(happly), i.e.(f =(Πx :A)B(x) g

)' (Πx : A)(f (x) =B(x) g(x))

In cubical type theory, funext is trivial to define.

25

Page 100: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in the universeSuppose A,B : U . What should a path

A =U B

consist of?

Only sensible notion(?): (A =U B) ' (A ' B).

Again we can be more precise: we can define

idtoeqv : (A =U B)→ (A ' B)

by path induction: if p : A = B is reflA, we let

idtoeqv(reflA) :≡ idA ≡ (idA, idA, . . .)

Univalence Axiom

(A =U B) ' (A ' B)

in particular, we have isEquiv(idtoeqv).

In cubical type theory, Univalence is a theorem, not an axiom.

26

Page 101: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in the universeSuppose A,B : U . What should a path

A =U B

consist of? Only sensible notion(?): (A =U B) ' (A ' B).

Again we can be more precise: we can define

idtoeqv : (A =U B)→ (A ' B)

by path induction: if p : A = B is reflA, we let

idtoeqv(reflA) :≡ idA ≡ (idA, idA, . . .)

Univalence Axiom

(A =U B) ' (A ' B)

in particular, we have isEquiv(idtoeqv).

In cubical type theory, Univalence is a theorem, not an axiom.

26

Page 102: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in the universeSuppose A,B : U . What should a path

A =U B

consist of? Only sensible notion(?): (A =U B) ' (A ' B).

Again we can be more precise: we can define

idtoeqv : (A =U B)→ (A ' B)

by path induction: if p : A = B is reflA, we let

idtoeqv(reflA) :≡ idA ≡ (idA, idA, . . .)

Univalence Axiom

(A =U B) ' (A ' B)

in particular, we have isEquiv(idtoeqv).

In cubical type theory, Univalence is a theorem, not an axiom.

26

Page 103: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Paths in the universeSuppose A,B : U . What should a path

A =U B

consist of? Only sensible notion(?): (A =U B) ' (A ' B).

Again we can be more precise: we can define

idtoeqv : (A =U B)→ (A ' B)

by path induction: if p : A = B is reflA, we let

idtoeqv(reflA) :≡ idA ≡ (idA, idA, . . .)

Univalence Axiom

(A =U B) ' (A ' B)

in particular, we have isEquiv(idtoeqv).

In cubical type theory, Univalence is a theorem, not an axiom.26

Page 104: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Consequences of Univalence

I “Isomorphic structures are equal”

I Propositional extensionality: (P ↔ Q) ' (P = Q) forpropositions P, Q.

I Function extensionality

I Large quotients exists

I Homotopy theory is non-trivial (there are two paths 2 =U 2)

I Enough slack for large elimination of higher inductive types(Sunday)

I . . .

27

Page 105: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Summary

New perspective on identity types based on intuitions fromhomotopical models.

Lack of uniqueness of identity proofs leads to path algebra: “if youcan write it down, it is trivial to prove it”.

Important characterisations/axioms: function extensionality andUnivalence (more tomorrow).

28

Page 106: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

Exercises

1. How does transportB interact with the groupoid structure ofpaths? What about apf ? Prove your claims.

2. State and prove lemmas for decomposing a transport infunction types and sigma types (the latter is messier).

3. Use paths over paths to state and prove that the empty vectoris a unit for vector concatenation, and that vectorconcatenation is associative. (Hint: you will need togeneralise apf to paths over paths.)

29

Page 107: Introduction to Homotopy Type Theory - Lecture 1: Type ... · into abstract homotopy theory. Consequence: can prove results in homotopy theorysynthetically using Type Theory, extended

References

S. Awodey and M. Warren

Homotopy theoretic models of identity typesMathematical Proceedings of the Cambridge Philosophical Society 146, no. 1, 45–55, 2009.

M. Hofmann and T. Streicher

The groupoid interpretation of type theoryTwenty-five years of constructive type theory, pp. 83–111, 1998.

C. Cohen, T. Coquand, S. Huber and A. Mortberg

Cubical Type Theory: a constructive interpretation of the univalence axiomTo appear in the post-proceedings of TYPES 2016

P. Lumsdaine

Weak ω-Categories from Intensional Type TheoryLogical Methods in Computer Science, Vol. 6, issue 23, paper 24, 2010

B. van den Berg and R. Garner

Types are weak ω-groupoidsProceedings of the London Mathematical Society (3) 102, pp. 370–394, 2011

P. Lumsdaine

Strong functional extensionality from weakHomotopy Type Theory blog,https://homotopytypetheory.org/2011/12/19/strong-funext-from-weak

V. Voevodsky

The equivalence axiom and univalent models of type theoryTalk at CMU on February 4, 2010

30