Git as a HIT Dan Licata Wesleyan University 1 1 Darcs Git as a - - PowerPoint PPT Presentation

git as a hit
SMART_READER_LITE
LIVE PREVIEW

Git as a HIT Dan Licata Wesleyan University 1 1 Darcs Git as a - - PowerPoint PPT Presentation

Git as a HIT Dan Licata Wesleyan University 1 1 Darcs Git as a HIT Dan Licata Wesleyan University 1 1 HITs 2 Generator for 2 HITs Homotopy Type Theory is an extension of Agda/Coq based on connections with homotopy theory


slide-1
SLIDE 1

1

Git as a HIT

Dan Licata Wesleyan University

1

slide-2
SLIDE 2

1

Git as a HIT

Dan Licata Wesleyan University

Darcs

1

slide-3
SLIDE 3

2

Generator for

HITs

2

slide-4
SLIDE 4

2

Generator for

HITs

Homotopy Type Theory is an extension of Agda/Coq based on connections with homotopy theory

[Hofmann&Streicher,Awodey&Warren,Voevodsky,Lumsdaine,Garner&van den Berg]

2

slide-5
SLIDE 5

2

Generator for

HITs

Homotopy Type Theory is an extension of Agda/Coq based on connections with homotopy theory

[Hofmann&Streicher,Awodey&Warren,Voevodsky,Lumsdaine,Garner&van den Berg]

Higher inductive types (HITs) are a new type former!

2

slide-6
SLIDE 6

2

Generator for

HITs

Homotopy Type Theory is an extension of Agda/Coq based on connections with homotopy theory

[Hofmann&Streicher,Awodey&Warren,Voevodsky,Lumsdaine,Garner&van den Berg]

Higher inductive types (HITs) are a new type former! They were originally invented[Lumsdaine,Shulman,…] to model basic spaces (circle, spheres, the torus, …) and constructions in homotopy theory

2

slide-7
SLIDE 7

2

Generator for

HITs

Homotopy Type Theory is an extension of Agda/Coq based on connections with homotopy theory

[Hofmann&Streicher,Awodey&Warren,Voevodsky,Lumsdaine,Garner&van den Berg]

Higher inductive types (HITs) are a new type former! They were originally invented[Lumsdaine,Shulman,…] to model basic spaces (circle, spheres, the torus, …) and constructions in homotopy theory But they have many other applications, including some programming ones!

2

slide-8
SLIDE 8

Patches

3

a b c diff 2c2 < b

  • > d

a d c

=

Patch

3

slide-9
SLIDE 9

4

a b c id a b c

4

slide-10
SLIDE 10

4

a b c id a b c a b c p a d c q a d e

4

slide-11
SLIDE 11

4

a b c id a b c a b c p a d c q a d e q o p

4

slide-12
SLIDE 12

4

a b c id a b c a b c p a d c q a d e q o p a b c p a d c

4

slide-13
SLIDE 13

4

a b c id a b c a b c p a d c q a d e q o p a b c p a d c !p

4

slide-14
SLIDE 14

4

a b c id a b c a b c p a d c q a d e q o p a b c p a d c !p

undo/rollback

4

slide-15
SLIDE 15

4

a b c id a b c a b c p a d c q a d e q o p a b c p a d c !p

undo/rollback [Yorgey,Jacobson,…]

4

slide-16
SLIDE 16

Simple Setup

5

a u s s

  • i

s a u s b u s

a ↔ b at 0 a ↔ b at 0

5

slide-17
SLIDE 17

Simple Setup

5

“Repository” is a char vector of fixed length n

a u s s

  • i

s

Basic patch is a ↔ b at i where i<n

a u s b u s

a ↔ b at 0 a ↔ b at 0

5

slide-18
SLIDE 18

Domain-Specific Language

6 6

slide-19
SLIDE 19

Domain-Specific Language

7 7

slide-20
SLIDE 20

Domain-Specific Language

7

swapat a b i v permutes a and b at position i in v

7

slide-21
SLIDE 21

Domain-Specific Language

8

Spec: ∀ p. interp p is a bijection: ∀ v. g (f v) = v where (f,g)=interp p ∀ v. f (g v) = v

8

slide-22
SLIDE 22

Domain-Specific Language

8

Spec: ∀ p. interp p is a bijection: ∀ v. g (f v) = v where (f,g)=interp p ∀ v. f (g v) = v

undo really un-does

8

slide-23
SLIDE 23

Domain-Specific Language

8

Spec: ∀ p. interp p is a bijection: ∀ v. g (f v) = v where (f,g)=interp p ∀ v. f (g v) = v

undo really un-does

Can package this as:

8

slide-24
SLIDE 24

Merging

9

a b c p a d c q a b e

9

slide-25
SLIDE 25

Merging

9

a b c p a d c q a b e a d e q’ p’

9

slide-26
SLIDE 26

Merging

9

a b c p a d c q a b e a d e q’ p’ p=b↔d at 1 q=c↔e at 2

9

slide-27
SLIDE 27

Merging

9

a b c p a d c q a b e a d e q’ p’ p=b↔d at 1 q=c↔e at 2 p’=p q’=q

9

slide-28
SLIDE 28

Merging

9

a b c p a d c q a b e a d e q’ p’

=

p=b↔d at 1 q=c↔e at 2 p’=p q’=q

9

slide-29
SLIDE 29

Merging

10

merge : (p q : Patch) Σq’,p’:Patch. Maybe(q’ o p = p’ o q)

10

slide-30
SLIDE 30

Merging

10

merge : (p q : Patch) Σq’,p’:Patch. Maybe(q’ o p = p’ o q) When are two patches equal?

10

slide-31
SLIDE 31

Patch Equality

11

(a↔b at i)o(c↔d at j) = (c↔d at j)o(a↔b at i) if i≠j

11

slide-32
SLIDE 32

Patch Equality

11

(a↔b at i)o(c↔d at j) = (c↔d at j)o(a↔b at i) if i≠j (a↔a at i) = id !(a↔b at i) = (a↔b at i) (a↔b at i) = (b↔a at i)

11

slide-33
SLIDE 33

Patch Equality

11

(a↔b at i)o(c↔d at j) = (c↔d at j)o(a↔b at i) if i≠j (a↔a at i) = id !(a↔b at i) = (a↔b at i) (a↔b at i) = (b↔a at i) Basic Axioms:

11

slide-34
SLIDE 34

Patch Equality

12

(a↔b at i)o(c↔d at j) =(c↔d at j)o(a↔b at i)

Basic axioms:

12

slide-35
SLIDE 35

Patch Equality

12

id o p = p = p o id po(qor) = (poq)or !p o p = id = p o !p

(a↔b at i)o(c↔d at j) =(c↔d at j)o(a↔b at i)

Basic axioms: Group laws:

12

slide-36
SLIDE 36

Patch Equality

12

id o p = p = p o id po(qor) = (poq)or !p o p = id = p o !p p=p p=q if q=p p=r if p=q and q=r !p = !p’ if p = p’ p o q = p’ o q’ if p = p’ and q = q’

(a↔b at i)o(c↔d at j) =(c↔d at j)o(a↔b at i)

Basic axioms: Group laws: Congruence:

12

slide-37
SLIDE 37

Patch as Quotient Type

13

id o p ~ p ~ p o id po(qor) ~ (poq)or !p o p ~ id ~ p o !p p~p p~q if q~p p~r if p~q and q~r !p ~ !p’ if p ~ p’ p o q ~ p’ o q’ if p ~ p’ and q ~ q’ (a↔b at i)o(c↔d at j)~ (c↔d at j)o(a↔b at i) ...

Elements: Equality:

13

slide-38
SLIDE 38

Patch as Quotient Type

13

id o p ~ p ~ p o id po(qor) ~ (poq)or !p o p ~ id ~ p o !p p~p p~q if q~p p~r if p~q and q~r !p ~ !p’ if p ~ p’ p o q ~ p’ o q’ if p ~ p’ and q ~ q’ (a↔b at i)o(c↔d at j)~ (c↔d at j)o(a↔b at i) ...

Elements: Equality: Quotient Type: Patch := Patch’/~

13

slide-39
SLIDE 39

Patch as Quotient Type

13

id o p ~ p ~ p o id po(qor) ~ (poq)or !p o p ~ id ~ p o !p p~p p~q if q~p p~r if p~q and q~r !p ~ !p’ if p ~ p’ p o q ~ p’ o q’ if p ~ p’ and q ~ q’ (a↔b at i)o(c↔d at j)~ (c↔d at j)o(a↔b at i) ...

Elements: Equality: Elimination rule: define on Patch’ as before, then prove p ~ q implies interp p = interp q for all 14+ rules for ~ Quotient Type: Patch := Patch’/~

13

slide-40
SLIDE 40

Patches as a HIT

14

1.How do you define Patch using a higher inductive type? 2.What is the elimination rule? 3.How do you use the elim. rule to define interp?

14

slide-41
SLIDE 41

Patches as a HIT

15

1.How do you define Patch using a higher inductive type? 2.What is the elimination rule? 3.How do you use the elim. rule to define interp?

15

slide-42
SLIDE 42

Higher Inductive Type

16

Generator for

16

slide-43
SLIDE 43

Higher Inductive Type

16

Type freely generated by constructors for elements, equalities, equalities between equalities, … Generator for

16

slide-44
SLIDE 44

Higher Inductive Type

16

Type freely generated by constructors for elements, equalities, equalities between equalities, … RepoDesc : Type Generator for

16

slide-45
SLIDE 45

Higher Inductive Type

16

Type freely generated by constructors for elements, equalities, equalities between equalities, … RepoDesc : Type vec : RepoDesc Generator for

generator for element

16

slide-46
SLIDE 46

Higher Inductive Type

16

Type freely generated by constructors for elements, equalities, equalities between equalities, … RepoDesc : Type vec : RepoDesc (a↔b at i) : vec = vec Generator for

generator for element generator for equality

16

slide-47
SLIDE 47

Higher Inductive Type

16

Type freely generated by constructors for elements, equalities, equalities between equalities, … RepoDesc : Type vec : RepoDesc (a↔b at i) : vec = vec Generator for

proof-relevant! generator for element generator for equality

16

slide-48
SLIDE 48

Higher Inductive Type

16

Type freely generated by constructors for elements, equalities, equalities between equalities, … RepoDesc : Type vec : RepoDesc (a↔b at i) : vec = vec commute: (a↔b at i)o(c↔d at j) =(c↔d at j)o(a↔b at i) Generator for

proof-relevant! generator for element generator for equality generator for equality between equalities

16

slide-49
SLIDE 49

17

id o p = p = p o id po(qor) = (poq)or !p o p = id = p o !p p=p p=q if q=p p=r if p=q and q=r !p = !p’ if p = p’ p o q = p’ o q’ if p = p’ and q = q’ (a↔b at i)o(c↔d at j)= (c↔d at j)o(a↔b at i) ...

Elements: Equality: Type: Patch

17

slide-50
SLIDE 50

17

id o p = p = p o id po(qor) = (poq)or !p o p = id = p o !p p=p p=q if q=p p=r if p=q and q=r !p = !p’ if p = p’ p o q = p’ o q’ if p = p’ and q = q’ (a↔b at i)o(c↔d at j)= (c↔d at j)o(a↔b at i) ...

Elements: Equality: Type: RepoDesc Type: Patch

17

slide-51
SLIDE 51

17

id o p = p = p o id po(qor) = (poq)or !p o p = id = p o !p p=p p=q if q=p p=r if p=q and q=r !p = !p’ if p = p’ p o q = p’ o q’ if p = p’ and q = q’ (a↔b at i)o(c↔d at j)= (c↔d at j)o(a↔b at i) ...

Elements: Equality: Type: RepoDesc Element: vec : RepoDesc Type: Patch

17

slide-52
SLIDE 52

17

id o p = p = p o id po(qor) = (poq)or !p o p = id = p o !p p=p p=q if q=p p=r if p=q and q=r !p = !p’ if p = p’ p o q = p’ o q’ if p = p’ and q = q’ (a↔b at i)o(c↔d at j)= (c↔d at j)o(a↔b at i) ...

Elements: Equality: Type: RepoDesc Element: vec : RepoDesc Equality: a↔b at i : vec = vec Type: Patch

17

slide-53
SLIDE 53

17

id o p = p = p o id po(qor) = (poq)or !p o p = id = p o !p p=p p=q if q=p p=r if p=q and q=r !p = !p’ if p = p’ p o q = p’ o q’ if p = p’ and q = q’ (a↔b at i)o(c↔d at j)= (c↔d at j)o(a↔b at i) ...

Elements: Equality: Type: RepoDesc Element: vec : RepoDesc Equality: a↔b at i : vec = vec Type: Patch

{

Patch

17

slide-54
SLIDE 54

17

id o p = p = p o id po(qor) = (poq)or !p o p = id = p o !p p=p p=q if q=p p=r if p=q and q=r !p = !p’ if p = p’ p o q = p’ o q’ if p = p’ and q = q’ (a↔b at i)o(c↔d at j)= (c↔d at j)o(a↔b at i) ...

Elements: Equality: Type: RepoDesc Element: vec : RepoDesc Equality: a↔b at i : vec = vec Equality between equalities:

commute : (a↔b at i)o(c↔d at j)= (c↔d at j)o(a↔b at i)

… basic axioms only! Type: Patch

{

Patch

17

slide-55
SLIDE 55

17

id o p = p = p o id po(qor) = (poq)or !p o p = id = p o !p p=p p=q if q=p p=r if p=q and q=r !p = !p’ if p = p’ p o q = p’ o q’ if p = p’ and q = q’ (a↔b at i)o(c↔d at j)= (c↔d at j)o(a↔b at i) ...

Elements: Equality: Type: RepoDesc Element: vec : RepoDesc Equality: a↔b at i : vec = vec Equality between equalities:

commute : (a↔b at i)o(c↔d at j)= (c↔d at j)o(a↔b at i)

… basic axioms only! Type: Patch

{

Patch

Everything else comes “for free” from the equality type!

17

slide-56
SLIDE 56

Typed Patches

18

RepoDesc : Type vec : RepoDesc a↔b at i : vec = vec Generator for compressed : RepoDesc gzip : vec = compressed

generators for elements generators for equalities

18

slide-57
SLIDE 57

Typed Patches

18

RepoDesc : Type vec : RepoDesc a↔b at i : vec = vec Generator for compressed : RepoDesc gzip : vec = compressed

generators for elements generators for equalities

{

Patch vec compressed

18

slide-58
SLIDE 58

Patches as a HIT

19

1.How do you define Patch using a higher inductive type? 2.What is the elimination rule for RepoDesc? 3.How do you use the elim. rule to define interp?

19

slide-59
SLIDE 59

20

RepoDesc A To define a function it suffices to Generator for

RepoDesc recursion

20

slide-60
SLIDE 60

20

RepoDesc A To define a function it suffices to Generator for map the element generators of RepoDesc to elements of A

RepoDesc recursion

20

slide-61
SLIDE 61

20

RepoDesc A To define a function it suffices to Generator for map the element generators of RepoDesc to elements of A map the equality generators of RepoDesc to equalities between the corresponding elements of A

RepoDesc recursion

20

slide-62
SLIDE 62

20

RepoDesc A To define a function it suffices to Generator for map the element generators of RepoDesc to elements of A map the equality generators of RepoDesc to equalities between the corresponding elements of A map the equality-between-equality generators to equalities between the corresponding equalities in A

RepoDesc recursion

20

slide-63
SLIDE 63

RepoDesc recursion

21

f : RepoDesc A To define a function it suffices to give Generator for

21

slide-64
SLIDE 64

RepoDesc recursion

21

f : RepoDesc A To define a function it suffices to give Generator for

f(vec) := … : A

21

slide-65
SLIDE 65

RepoDesc recursion

21

f : RepoDesc A To define a function it suffices to give Generator for

f(vec) := … : A f1(a↔b at i) := … : f(vec) = f(vec)

21

slide-66
SLIDE 66

RepoDesc recursion

21

f : RepoDesc A To define a function it suffices to give Generator for

f(vec) := … : A f1(a↔b at i) := … : f(vec) = f(vec) f2(compose a b c d i j i≠j) := … : f1((a↔b at i)o(c↔d at j)) = f1((c↔d at j)o(a↔b at j))

21

slide-67
SLIDE 67

RepoDesc recursion

21

f : RepoDesc A To define a function it suffices to give Generator for

f(vec) := … : A f1(a↔b at i) := … : f(vec) = f(vec) f2(compose a b c d i j i≠j) := … : f1((a↔b at i)o(c↔d at j)) = f1((c↔d at j)o(a↔b at j))

You only specify f on generators, not id,o,!,group laws,congruence,… (1 patch and 4 basic axioms, instead of 4 and 14!)

21

slide-68
SLIDE 68

RepoDesc recursion

22

f : RepoDesc A To define a function it suffices to give Generator for

f(vec) := … : A f1(a↔b at i) := … : f(vec) = f(vec) f2(compose a b c d i j i≠j) := … : f1((a↔b at i)o(c↔d at j)) = f1((c↔d at j)o(a↔b at j))

22

slide-69
SLIDE 69

RepoDesc recursion

22

f : RepoDesc A To define a function it suffices to give Generator for

f(vec) := … : A f1(a↔b at i) := … : f(vec) = f(vec) f2(compose a b c d i j i≠j) := … : f1((a↔b at i)o(c↔d at j)) = f1((c↔d at j)o(a↔b at j))

Type-generic equality rules say that functions act homomorphically on id,o,!,…

22

slide-70
SLIDE 70

RepoDesc recursion

22

f : RepoDesc A To define a function it suffices to give Generator for

f(vec) := … : A f1(a↔b at i) := … : f(vec) = f(vec) f2(compose a b c d i j i≠j) := … : f1((a↔b at i)o(c↔d at j)) = f1((c↔d at j)o(a↔b at j))

Type-generic equality rules say that functions act homomorphically on id,o,!,…

=f1(a↔b at i)o f1(c↔d at j)

22

slide-71
SLIDE 71

RepoDesc recursion

23

f : RepoDesc A To define a function it suffices to give Generator for

f(vec) := … : A f1(a↔b at i) := … : f(vec) = f(vec) f2(compose a b c d i j i≠j) := … : f1((a↔b at i)o(c↔d at j)) = f1((c↔d at j)o(a↔b at j))

23

slide-72
SLIDE 72

RepoDesc recursion

23

f : RepoDesc A To define a function it suffices to give Generator for

f(vec) := … : A f1(a↔b at i) := … : f(vec) = f(vec) f2(compose a b c d i j i≠j) := … : f1((a↔b at i)o(c↔d at j)) = f1((c↔d at j)o(a↔b at j))

All functions on RepoDesc respect patches All functions on patches respect patch equality

23

slide-73
SLIDE 73

Patches as a HIT

24

1.How do you define Patch using a higher inductive type? 2.What is the elimination rule for RepoDesc? 3.How do you use the elim. rule to define interp?

24

slide-74
SLIDE 74

Interp

25

Goal is to define: Generator for

interp : vec = vec Bijection (Vec Char n) (Vec Char n) interp(a↔b at i) = swapat a b i interp(q o p) = (interp q) ob (interp p) interp(id) = (λx.x, …) interp(!p) = !b (interp p)

25

slide-75
SLIDE 75

Interp

25

Goal is to define: Generator for But only tool available is RepoDesc recursion: no direct recursion over proofs of equality

interp : vec = vec Bijection (Vec Char n) (Vec Char n) interp(a↔b at i) = swapat a b i interp(q o p) = (interp q) ob (interp p) interp(id) = (λx.x, …) interp(!p) = !b (interp p)

25

slide-76
SLIDE 76

26

Generator for Need to pick A and define

interp : vec = vec Bijection (Vec Char n) (Vec Char n) f(vec) := … : A f1(a↔b at i) := … : f(vec) = f(vec) f2(compose) := … interp(a↔b at i) = swapat a b i

26

slide-77
SLIDE 77

27

Generator for Key idea: pick A = Type and define

interp : vec = vec Bijection (Vec Char n) (Vec Char n) f(vec) := … : Type f1(a↔b at i) := … : f(vec) = f(vec) f2(compose) := … interp(a↔b at i) = swapat a b i

27

slide-78
SLIDE 78

28

Generator for Key idea: pick A = Type and define

interp : vec = vec Bijection (Vec Char n) (Vec Char n) f(vec) := Vec Char n : Type f1(a↔b at i) := … : f(vec) = f(vec) f2(compose) := … interp(a↔b at i) = swapat a b i

28

slide-79
SLIDE 79

29

Generator for Key idea: pick A = Type and define

interp : vec = vec Bijection (Vec Char n) (Vec Char n) interp(a↔b at i) = swapat a b i f(vec) := Vec Char n : Type f1(a↔b at i) := … : Vec Char n = Vec Char n f2(compose) := …

29

slide-80
SLIDE 80

30

Generator for Key idea: pick A = Type and define

interp : vec = vec Bijection (Vec Char n) (Vec Char n) interp(a↔b at i) = swapat a b i f(vec) := Vec Char n : Type f1(a↔b at i) := ua(swapat a b i) : Vec Char n = Vec Char n f2(compose) := …

30

slide-81
SLIDE 81

30

Generator for Key idea: pick A = Type and define

interp : vec = vec Bijection (Vec Char n) (Vec Char n) interp(a↔b at i) = swapat a b i f(vec) := Vec Char n : Type f1(a↔b at i) := ua(swapat a b i) : Vec Char n = Vec Char n f2(compose) := … Voevodky’s univalence axiom ⊃ bijective types are equal

30

slide-82
SLIDE 82

31

Generator for Key idea: pick A = Type and define

interp : vec = vec Bijection (Vec Char n) (Vec Char n) interp(a↔b at i) = swapat a b i f(vec) := Vec Char n : Type f1(a↔b at i) := ua(swapat a b i) : Vec Char n = Vec Char n f2(compose) := <proof about swapat as before>

31

slide-83
SLIDE 83

32

Generator for Key idea: pick A = Type and define

interp : vec = vec Bijection (Vec Char n) (Vec Char n) interp(a↔b at i) = swapat a b i I(vec) := Vec Char n : Type I1(a↔b at i) := ua(swapat a b i) : Vec Char n = Vec Char n I2(compose) := <proof about swapat as before>

32

slide-84
SLIDE 84

33

Generator for Key idea: pick A = Type and define

interp : vec = vec Bijection (Vec Char n) (Vec Char n) I(vec) := Vec Char n : Type I1(a↔b at i) := ua(swapat a b i) : Vec Char n = Vec Char n I2(compose) := <proof about swapat as before> interp(p) = ua-1(I1(p))

33

slide-85
SLIDE 85

34

Generator for

interp : vec = vec Bijection (Vec Char n) (Vec Char n) interp(p) = ua-1(I1(p)) interp(a↔b at i) = swapat a b i interp(q o p) = (interp q) ob (interp p) interp(id) = (λx.x, …) interp(!p) = !b (interp p) Satisfies the desired equations (as propositional equalities):

34

slide-86
SLIDE 86

35

Generator for

Summary

35

slide-87
SLIDE 87

35

Generator for

Summary

I : RepoDesc Type interprets RepoDesc’s as Types, patches as bijections, satisfying patch equalities

35

slide-88
SLIDE 88

35

Generator for

Summary

I : RepoDesc Type interprets RepoDesc’s as Types, patches as bijections, satisfying patch equalities Higher inductive elim. defines functions that respect equality: you specify what happens on the generators; homomorphically extended to id,o,!,...

35

slide-89
SLIDE 89

35

Generator for

Summary

I : RepoDesc Type interprets RepoDesc’s as Types, patches as bijections, satisfying patch equalities Higher inductive elim. defines functions that respect equality: you specify what happens on the generators; homomorphically extended to id,o,!,... Univalence lets you give a computational model of equality proofs (here, patches); guaranteed to satisfy laws

35

slide-90
SLIDE 90

35

Generator for

Summary

I : RepoDesc Type interprets RepoDesc’s as Types, patches as bijections, satisfying patch equalities Higher inductive elim. defines functions that respect equality: you specify what happens on the generators; homomorphically extended to id,o,!,... Univalence lets you give a computational model of equality proofs (here, patches); guaranteed to satisfy laws Shorter definition and code than using quotients: 1 basic patch & 4 basic axioms of equality, instead of 4 patches & 14 equations

35

slide-91
SLIDE 91

36

Generator for

Where does this programming technique come from?

36

slide-92
SLIDE 92

Homotopy type theory

37

a b p

37

slide-93
SLIDE 93

Homotopy type theory

37

a b p

a space is a type A

37

slide-94
SLIDE 94

Homotopy type theory

37

a b p

points are elements a:A a space is a type A

37

slide-95
SLIDE 95

Homotopy type theory

37

a b p

points are elements a:A a space is a type A paths are proofs of equality p : a =A b

37

slide-96
SLIDE 96

Homotopy type theory

37

a b p

points are elements a:A a space is a type A paths are proofs of equality p : a =A b path operations

37

slide-97
SLIDE 97

Homotopy type theory

37

a b p id

points are elements a:A a space is a type A paths are proofs of equality p : a =A b path operations

id : a = a (refl)

37

slide-98
SLIDE 98

Homotopy type theory

37

a b p id !p

points are elements a:A a space is a type A paths are proofs of equality p : a =A b path operations

id : a = a (refl) !p : b = a (sym)

37

slide-99
SLIDE 99

Homotopy type theory

37

a b p c q id !p

points are elements a:A a space is a type A paths are proofs of equality p : a =A b path operations

id : a = a (refl) !p : b = a (sym) q o p : a = c (trans)

37

slide-100
SLIDE 100

Homotopy type theory

37

a b p c q id !p

points are elements a:A a space is a type A paths are proofs of equality p : a =A b path operations

id : a = a (refl) !p : b = a (sym) q o p : a = c (trans)

homotopies

id o p = p !p o p = id r o (q o p) = (r o q) o p

37

slide-101
SLIDE 101

Homotopy type theory

37

points are elements a:A a space is a type A paths are proofs of equality p : a =A b path operations

id : a = a (refl) !p : b = a (sym) q o p : a = c (trans)

homotopies

id o p = p !p o p = id r o (q o p) = (r o q) o p

37

slide-102
SLIDE 102

Equality elimination rule

38

Type of equalities between a and -

a id a

is inductively generated by

y3 y1 y2 p1 p3 p2

38

slide-103
SLIDE 103

Equality elimination rule

38

Fix a type A with element a:A. For a family of types C(y:A, p:a=y), to give an element of C(y,p) for all y and p:a=y, suffices to give an element of C(a,id) Type of equalities between a and -

a id a

is inductively generated by

y3 y1 y2 p1 p3 p2

38

slide-104
SLIDE 104

39

Composition and Assoc

_o_ : a = b b = c a = c id o p = p

  • -assoc : (p : a=b)(q : b=c)(r : c=d)

p o (q o r) = (p o q) o r

  • -assoc id id id = id

39

slide-105
SLIDE 105

40

Functions are functors

f : A B has action at all levels f1 : (a1 a2 : A) a1 =A a2 f(a1) =B f(a2) f2 : (a1 a2 : A)(p p’ : a1 =A a2)

p =a1=a2 p’

f1(p) =f(a1)=f(a2) f1(p’) and so on

40

slide-106
SLIDE 106

The Circle

41

Circle S1 is HIT generated by

loop base

41

slide-107
SLIDE 107

The Circle

41

Circle S1 is HIT generated by base : S1 loop : base = base

loop base

41

slide-108
SLIDE 108

The Circle

41

Circle S1 is HIT generated by base : S1 loop : base = base

loop base

Free type: equipped with

id loop-1

inv : loop o loop-1 = id id loop-1 loop o loop ...

41

slide-109
SLIDE 109

The Circle

42

Circle recursion: function S1 X determined by base’ : X loop’ : base’ = base’

loop base loop’ base’

42

slide-110
SLIDE 110

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

43

slide-111
SLIDE 111

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

id

43

slide-112
SLIDE 112

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

id loop

43

slide-113
SLIDE 113

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

id loop loop-1

43

slide-114
SLIDE 114

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

id loop loop-1 loop o loop

43

slide-115
SLIDE 115

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

id loop loop-1 loop o loop loop-1 o loop-1

43

slide-116
SLIDE 116

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

id loop loop-1 loop o loop loop-1 o loop-1 loop o loop-1

43

slide-117
SLIDE 117

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

= id id loop loop-1 loop o loop loop-1 o loop-1 loop o loop-1

43

slide-118
SLIDE 118

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

= id id loop loop-1 loop o loop loop-1 o loop-1 loop o loop-1

43

slide-119
SLIDE 119

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

= id id loop loop-1 loop o loop loop-1 o loop-1 loop o loop-1 1

43

slide-120
SLIDE 120

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

= id id loop loop-1 loop o loop loop-1 o loop-1 loop o loop-1 1

  • 1

43

slide-121
SLIDE 121

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

= id id loop loop-1 loop o loop loop-1 o loop-1 loop o loop-1 1

  • 1

2

43

slide-122
SLIDE 122

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

= id id loop loop-1 loop o loop loop-1 o loop-1 loop o loop-1 1

  • 1

2

  • 2

43

slide-123
SLIDE 123

Fundamental group of circle

43

How many different loops are there on the circle, up to homotopy?

loop base

= id id loop loop-1 loop o loop loop-1 o loop-1 loop o loop-1 1

  • 1

2

  • 2

43

slide-124
SLIDE 124

Fundamental group of circle

44

  • Theorem. Group of loops on the circle

is isomorphic to ℤ Proof: Define universal cover

44

slide-125
SLIDE 125

Fundamental group of circle

44

  • Theorem. Group of loops on the circle

is isomorphic to ℤ Proof: Define universal cover Cover : S1 Type Cover(base) := ℤ Cover1(loop) := ua(successor) : ℤ = ℤ

44

slide-126
SLIDE 126

Fundamental group of circle

44

  • Theorem. Group of loops on the circle

is isomorphic to ℤ Proof: Define universal cover Cover : S1 Type Cover(base) := ℤ Cover1(loop) := ua(successor) : ℤ = ℤ

interpret loop as “add 1” bijection

44

slide-127
SLIDE 127

Homotopy in HoTT

45

π1(S1) = ℤ πk<n(Sn) = 0 π2(S2) = ℤ Hopf fibration π3(S2) = ℤ πn(Sn) = ℤ Freudenthal π4(S3) = ℤ? James Construction K(G,n) Blakers-Massey Van Kampen Covering spaces Whitehead for n-types Cohomology axioms [Brunerie, Finster, Hou, Licata, Lumsdaine, Shulman]

45

slide-128
SLIDE 128

46

Generator for

What’s next?

Operational semantics of HITs and univalence is still an

  • pen problem in general, though some special cases

are known Have just started exploring programming applications Extensions to this example: more realistic basic patches, patches that can fail (partial bijections), implement merge

46