Computing with Univalence Daniel R. Licata with Robert Harper - - PowerPoint PPT Presentation

computing with univalence
SMART_READER_LITE
LIVE PREVIEW

Computing with Univalence Daniel R. Licata with Robert Harper - - PowerPoint PPT Presentation

Computing with Univalence Daniel R. Licata with Robert Harper Carnegie Mellon University 1 Identity Types A type M, N : A Id A (M,N) type 2 Identity Types A type M, N : A Id A (M,N) type C : A type F : A B : Id A (M,N) : Id


slide-1
SLIDE 1

1

Computing with Univalence

Daniel R. Licata with Robert Harper Carnegie Mellon University

slide-2
SLIDE 2

Identity Types

2

A type M, N : A IdA(M,N) type

slide-3
SLIDE 3

C : A → type α : IdA(M,N) P : C[M] substC α P : C[N]

Identity Types

2

Refl : IdA(M,M)

all families respect identity

F : A → B α : IdA(M,N) resp F α : IdB(F M,F N) A type M, N : A IdA(M,N) type

slide-4
SLIDE 4

C : A → type α : IdA(M,N) P : C[M] substC α P : C[N]

Identity Types

Computation rules: substC Refl P ≡ P resp F Refl ≡ Refl

2

Refl : IdA(M,M)

all families respect identity

F : A → B α : IdA(M,N) resp F α : IdB(F M,F N) A type M, N : A IdA(M,N) type

definitional equality: used silently

slide-5
SLIDE 5

C : A → type α : IdA(M,N) P : C[M] substC α P : C[N]

Id in HoTT = Paths

3

Refl : IdA(M,M) F : A → B α : IdA(M,N) resp F α : IdB(F M,F N) Not the least type containing reflexivity (we’ll add other canonical inhabitants soon) Not the greatest type everything respects (not forced to include all consistent equalities)

slide-6
SLIDE 6

Id in HoTT = Paths

4

To define a type, you get to specify: what are its members? what are its paths? Refl subst resp (and a few more operations) are an interface that you must implement

M : A α : IdA(M,N) (really a judgement α : M ≃A N)

slide-7
SLIDE 7

Id in HoTT = Paths

4

To define a type, you get to specify: what are its members? what are its paths? Refl subst resp (and a few more operations) are an interface that you must implement

generalization of the Martin-Löf/NuPRL methodology of members and equality… M : A α : IdA(M,N) (really a judgement α : M ≃A N)

slide-8
SLIDE 8

Univalence

5

“Isomorphic types are identical”

[Hofmann&Streicher, Voevodsky]

slide-9
SLIDE 9

Univalence

5

“Isomorphic types are identical”

in the sense of Id: interchangeable in all contexts

[Hofmann&Streicher, Voevodsky]

slide-10
SLIDE 10

Univalence

5

“Isomorphic types are identical”

in the sense of Id: interchangeable in all contexts really means homotopy equivalence

[Hofmann&Streicher, Voevodsky]

slide-11
SLIDE 11

Univalence

f : A → B α : IdA→A(g o f, id) g : B → A β : IdB→B(f o g, id) (f,g,α,β) : HEquiv(A,B)

6

Univalence axiom entails the existence of a term ua : HEquiv(A,B) → IdU(A,B) A, B : U

universe = type of (small) types

slide-12
SLIDE 12

Univalence

f : A → B α : IdA→A(g o f, id) g : B → A β : IdB→B(f o g, id) (f,g,α,β) : HEquiv(A,B) HEquiv, and therefore Id, have computational content! They are structures, not propositions

6

Univalence axiom entails the existence of a term ua : HEquiv(A,B) → IdU(A,B) A, B : U

universe = type of (small) types

slide-13
SLIDE 13

“Isomorphic Types are Interchangeable”

7

C : U → U (f,g,α,β) : HEquiv(A,B) P : C[A] substC ua(f,g,α,β) P : C[B] ua : HEquiv(A,B) → IdU(A,B)

slide-14
SLIDE 14

Constructivity

8

substC ua(f,g,α,β) P Standard computation rule substC Refl P ≡ P is clearly insufficient: is stuck!

added an introduction rule without adding a new β rule

slide-15
SLIDE 15

Constructivity

8

substC ua(f,g,α,β) P Standard computation rule substC Refl P ≡ P is clearly insufficient: is stuck! Open problem: Can you normalize a program that is written using univalence?

added an introduction rule without adding a new β rule

slide-16
SLIDE 16

Constructivity

9

Open problem: Can you normalize a program that is written using univalence? Conjecture: yes! univalence is admissible in type theory without U: all constructions respect type isomorphism UA demands that constructions on U do too should be able to eliminate UA using admissibility

slide-17
SLIDE 17

Approaches to Computation

10

Constructive model in simplicial sets/types [Coquand&Huber, next]

  • r in weak ω-groupoids [Altenkirch et al., later today]

This work: progress on special case using syntactic techniques inspired by groupoid model

slide-18
SLIDE 18

Canonicity for 2D type theory

11

Take various equations from the Hofmann/Streicher groupoid model as (strict) definitional equalities ≡ Consistency by groupoid model Prove canonicity If ⋅ ⊢ M : 2 then M ≡ true or M ≡ false by “logical groupoids” [Licata&Harper, POPL’12]

slide-19
SLIDE 19

Canonicity for 2D type theory

12

2 dimensional means

  • E.g. IdU(A,B) can have computational content…
  • but IdId(M,N)(α,β) is trivial (equality reflection + UIP).

Simplifications: If ⋅ ⊢ M : 2 then M ≡ true or M ≡ false

slide-20
SLIDE 20

Canonicity for 2D type theory

13

2 dimensional means

  • E.g. IdU(A,B) can have computational content…
  • but IdId(M,N)(α,β) is trivial (equality reflection + UIP).

All paths between paths are reflexivity: Simplifications: If ⋅ ⊢ M : 2 then M ≡ true or M ≡ false β : IdId(M,N)(α1,α2) α1 ≡ α2 β : IdId(M,N)(α1,α2) β ≡ Refl

slide-21
SLIDE 21

Canonicity for 2D type theory

14

Simplifications: If ⋅ ⊢ M : 2 then M ≡ true or M ≡ false 2 dimensional means

  • E.g. IdU(A,B) can have computational content…
  • but IdId(M,N)(α,β) is trivial (equality reflection + UIP).

We avoid normalizing homotopies. Only proved canonicity up to ≡, which includes equality reflection: not yet an algorithm.

slide-22
SLIDE 22

Canonicity for 2D type theory

14

Simplifications: If ⋅ ⊢ M : 2 then M ≡ true or M ≡ false But proof suggests an algorithm for 2D, and perhaps for low levels of ∞D 2 dimensional means

  • E.g. IdU(A,B) can have computational content…
  • but IdId(M,N)(α,β) is trivial (equality reflection + UIP).

We avoid normalizing homotopies. Only proved canonicity up to ≡, which includes equality reflection: not yet an algorithm.

slide-23
SLIDE 23

Key Idea

15

C : A → type α : IdA(M,N) P : C[M] substC α P : C[N] F : A → B α : IdA(M,N) resp F α : IdB(F M,F N) Admissibility of univalence = generic programs: subst computes guided by the structure of C resp computes guided by the structure of F similar non-uniform definitions for other groupoid operations

not surprising from semantics but need to express it in syntax

slide-24
SLIDE 24

Key Idea

15

C : A → type α : IdA(M,N) P : C[M] substC α P : C[N] F : A → B α : IdA(M,N) resp F α : IdB(F M,F N) Admissibility of univalence = generic programs: subst computes guided by the structure of C resp computes guided by the structure of F similar non-uniform definitions for other groupoid operations

not surprising from semantics but need to express it in syntax [Altenkirch et al.’s OTT does this for sets; we do it for groupoids]

slide-25
SLIDE 25

Computational interpretation

16

(1,2,3 simultaneous)

1.Define each type by members and paths, with Refl -1 o satisfying groupoid laws 2.Define substC α M for each C 3.Define resp F α for each F and α 4.Define full Id-elim rule J using subst

slide-26
SLIDE 26

Computational interpretation

17

1.Define each type by members and paths, with Refl -1 o satisfying groupoid laws 2.Define substC α M for each C 3.Define resp F α for each F and α 4.Define full Id-elim rule J using subst

slide-27
SLIDE 27

Type A * B

18

Members: (M, N) where M : A and N : B Paths: Refl(M,N) ≡ pair≃ ReflM ReflN (pair≃ α β)-1 ≡ (pair≃ α-1 β-1) (pair≃ α β) o (pair≃ α’ β’) ≡ (pair≃ αoα’ βoβ’) α : IdA(M,N) β : IdB(M’, N’) pair≃ α β : IdA*B(M,N)(M’,N’)

slide-28
SLIDE 28

Type A * B

18

Members: (M, N) where M : A and N : B Paths: Refl(M,N) ≡ pair≃ ReflM ReflN (pair≃ α β)-1 ≡ (pair≃ α-1 β-1) (pair≃ α β) o (pair≃ α’ β’) ≡ (pair≃ αoα’ βoβ’) α : IdA(M,N) β : IdB(M’, N’) pair≃ α β : IdA*B(M,N)(M’,N’)

justifies Refl rule

slide-29
SLIDE 29

Type A * B

18

Members: (M, N) where M : A and N : B Paths: Refl(M,N) ≡ pair≃ ReflM ReflN (pair≃ α β)-1 ≡ (pair≃ α-1 β-1) (pair≃ α β) o (pair≃ α’ β’) ≡ (pair≃ αoα’ βoβ’) α : IdA(M,N) β : IdB(M’, N’) pair≃ α β : IdA*B(M,N)(M’,N’)

justifies Refl rule needed later

slide-30
SLIDE 30

Type U

19

Members: <names for small sets>, which determine types by the type El(A : U) Paths: ReflA ≡ (x:El(A).x,x:El(A).x,x.Reflx,x.Reflx) (ua(f,g,α,β))-1 ≡ … (ua(f’,g’,α’,β’)) o (ua(f’,g’,α’,β’)) ≡ … (f,g,α,β) : HEquiv A B ua(f,g,α,β) : IdU(A, B)

slide-31
SLIDE 31

Circle S1

20

Members: b : S1 Paths: freely generated by --1 and Reflb and (- o -) from loop : b ≃ b such that groupoid laws hold up to ≡ for 2TT up to ≃ for full HoTT

loop b

slide-32
SLIDE 32

Computational interpretation

21

1.Define each type by members and paths, with Refl -1 and o satisfying groupoid laws 2.Define substC α M for each family C 3.Define resp F α for each F and α 4.Define full Id-elim rule J using subst

slide-33
SLIDE 33

Subst

22

C : A → type α : IdA(M,N) P : C[M] substC α P : C[N] To be a family of types over A, C must have an associated operation substC Functionality (à la NuPRL) becomes functoriality

slide-34
SLIDE 34

Case for x.A(x) * B(x)

23

A[θ1] * B[θ1] A[θ2] * B[θ2] → Want substx.A(x) x B(x) α : Have:

Id(θ1,θ2)

slide-35
SLIDE 35

Case for x.A(x) * B(x)

23

A[θ1] * B[θ1] A[θ2] * B[θ2] substA α : A[θ1] → A[θ2] → Want substx.A(x) x B(x) α : Have:

Id(θ1,θ2)

slide-36
SLIDE 36

Case for x.A(x) * B(x)

23

A[θ1] * B[θ1] A[θ2] * B[θ2] substA α : A[θ1] → A[θ2] substB α : B[θ1] → B[θ2] → Want substx.A(x) x B(x) α : Have:

Id(θ1,θ2)

slide-37
SLIDE 37

Case for x.A(x) * B(x)

substx.A(x) x B(x) α (M1,M2) ≡ (substx.A(x) α M1, substX:U.B(x) α M2)

23

A[θ1] * B[θ1] A[θ2] * B[θ2] substA α : A[θ1] → A[θ2] substB α : B[θ1] → B[θ2] → Want substx.A(x) x B(x) α : Have:

Id(θ1,θ2)

slide-38
SLIDE 38

Case for x.A(x) → B(x)

24

Want substx.A(x) → B(x) α F : A[θ2] B[θ2] A[θ1] → B[θ1] substx.A(X) → B(X) α F ≡ (λx.substxB(X) α (F (substX:U.A(X) α-1 x)) F →

Id(θ1,θ2)

slide-39
SLIDE 39

Case for x.A(x) → B(x)

24

substA α-1 Want substx.A(x) → B(x) α F : A[θ2] B[θ2] A[θ1] → B[θ1] substx.A(X) → B(X) α F ≡ (λx.substxB(X) α (F (substX:U.A(X) α-1 x)) F →

Id(θ1,θ2)

slide-40
SLIDE 40

Case for x.A(x) → B(x)

24

substA α-1 substB α Want substx.A(x) → B(x) α F : A[θ2] B[θ2] A[θ1] → B[θ1] substx.A(X) → B(X) α F ≡ (λx.substxB(X) α (F (substX:U.A(X) α-1 x)) F →

Id(θ1,θ2)

slide-41
SLIDE 41

Case for x.A(x) → B(x)

24

substA α-1 substB α Want substx.A(x) → B(x) α F : A[θ2] B[θ2] A[θ1] → B[θ1] substx.A(X) → B(X) α F ≡ (λx.substxB(X) α (F (substX:U.A(X) α-1 x)) F →

need inverses Id(θ1,θ2)

slide-42
SLIDE 42

Case for x:U.El(x)

25

Want substx:U.El(x) α : El(A) → El(B) Have α : IdU(A, B)

slide-43
SLIDE 43

Case for x:U.El(x)

25

Want substx:U.El(x) α : El(A) → El(B) Have α : IdU(A, B)

the only paths in the universe are constructed by univalence

slide-44
SLIDE 44

Case for x:U.El(x)

25

Want substx:U.El(x) α : El(A) → El(B) substx.El(x) α ≡ f when α ≡ ua(f:El(A)→El(B),g,α,β) Have α : IdU(A, B)

the only paths in the universe are constructed by univalence

slide-45
SLIDE 45

Case for x:U.El(x)

25

Want substx:U.El(x) α : El(A) → El(B) substx.El(x) α ≡ f when α ≡ ua(f:El(A)→El(B),g,α,β)

β-reduction for univalence: deploy the isomorphism

Have α : IdU(A, B)

the only paths in the universe are constructed by univalence

slide-46
SLIDE 46

Case for x.IdA(M,N)

26

Want substx.IdA(M(x),N(x)) α β : M[θ2] N[θ2] M[θ1] ≃ N[θ1] β ≃

Id(θ1,θ2)

slide-47
SLIDE 47

Case for x.IdA(M,N)

26

(resp M α)-1 Want substx.IdA(M(x),N(x)) α β : M[θ2] N[θ2] M[θ1] ≃ N[θ1] β ≃

Id(θ1,θ2)

slide-48
SLIDE 48

Case for x.IdA(M,N)

26

(resp M α)-1 resp N α Want substx.IdA(M(x),N(x)) α β : M[θ2] N[θ2] M[θ1] ≃ N[θ1] β ≃

≃ ≃

Id(θ1,θ2)

slide-49
SLIDE 49

Case for x.IdA(M,N)

26

(resp M α)-1 resp N α Want substx.IdA(M(x),N(x)) α β : M[θ2] N[θ2] M[θ1] ≃ N[θ1]

  • substx. IdA(M(x),N(x)) α β

≡ (resp N α) o β o (resp M α)-1 β ≃

≃ ≃

Id(θ1,θ2)

slide-50
SLIDE 50

Case for x.IdA(M,N)

26

(resp M α)-1 resp N α Want substx.IdA(M(x),N(x)) α β : M[θ2] N[θ2] M[θ1] ≃ N[θ1]

  • substx. IdA(M(x),N(x)) α β

≡ (resp N α) o β o (resp M α)-1 β

need inverses, composition, resp

≃ ≃

Id(θ1,θ2)

slide-51
SLIDE 51

Case for x.IdA(M,N)

26

(resp M α)-1 resp N α Want substx.IdA(M(x),N(x)) α β : M[θ2] N[θ2] M[θ1] ≃ N[θ1]

  • substx. IdA(M(x),N(x)) α β

≡ (resp N α) o β o (resp M α)-1 β

need inverses, composition, resp

≃ ≃

Id(θ1,θ2) action of Hom functor

slide-52
SLIDE 52

Computational interpretation

27

1.Define each type by members and paths, with Refl -1 and o satisfying groupoid laws 2.Define substC α M for each C 3.Define resp F α for each F and α 4.Define full Id-elim rule J using subst

slide-53
SLIDE 53

Resp

28

To be a family of terms over A, F must have an associated operation resp F α Functionality (à la NuPRL) becomes functoriality F : A → B α : IdA(M,N) resp F α : IdB(F M,F N)

slide-54
SLIDE 54

Want :

Resp for (M,N)

29

resp (x.(M(x),N(x))) α (M[θ1],N[θ1]) (M[θ2],N[θ2]) ≃ Have

Id(θ1,θ2)

slide-55
SLIDE 55

Want :

Resp for (M,N)

29

resp (x.(M(x),N(x))) α (M[θ1],N[θ1]) (M[θ2],N[θ2]) resp M α : M[θ1] ≃ M[θ2] ≃ Have

Id(θ1,θ2)

slide-56
SLIDE 56

Want :

Resp for (M,N)

29

resp (x.(M(x),N(x))) α (M[θ1],N[θ1]) (M[θ2],N[θ2]) resp M α : M[θ1] ≃ M[θ2] resp N α : N[θ2] ≃ N[θ2] ≃ Have

Id(θ1,θ2)

slide-57
SLIDE 57

Want :

Resp for (M,N)

29

resp (x.(M(x),N(x))) α (M[θ1],N[θ1]) (M[θ2],N[θ2]) resp M α : M[θ1] ≃ M[θ2] resp N α : N[θ2] ≃ N[θ2] ≃ Have

Id(θ1,θ2)

resp (x.(M(x),N(x))) α ≡ pair≃ (resp M α) (resp N α)

slide-58
SLIDE 58

Want :

Resp for fst

30

resp (x:(A*B).fst(x)) α fst (M[θ1]) fst(M[θ2]) ≃ Have

slide-59
SLIDE 59

Want :

Resp for fst

30

resp (x:(A*B).fst(x)) α fst (M[θ1]) fst(M[θ2]) α : IdA*B(M[θ1], M[θ2]) ≃ Have

slide-60
SLIDE 60

Want :

Resp for fst

30

resp (x:(A*B).fst(x)) α fst (M[θ1]) fst(M[θ2]) α : IdA*B(M[θ1], M[θ2]) Therefore α ≡ pair≃ α1 α2 ≃ Have

slide-61
SLIDE 61

Want :

Resp for fst

30

resp (x:(A*B).fst(x)) α fst (M[θ1]) fst(M[θ2]) α : IdA*B(M[θ1], M[θ2]) Therefore α ≡ pair≃ α1 α2 ≃ Have resp (x.fst(x)) (pair≃ α1 α2) ≡ α1

slide-62
SLIDE 62

Want :

Resp for fst

30

resp (x:(A*B).fst(x)) α fst (M[θ1]) fst(M[θ2]) α : IdA*B(M[θ1], M[θ2]) Therefore α ≡ pair≃ α1 α2 ≃ Have

2D β redex

resp (x.fst(x)) (pair≃ α1 α2) ≡ α1

slide-63
SLIDE 63

Computational interpretation

31

1.Define each type by members and paths, with Refl -1 and o satisfying groupoid laws 2.Define substC α M for each C 3.Define resp F α for each F and α 4.Define full Id-elim rule J using subst

slide-64
SLIDE 64

J from subst

32

C : (Σx:A.Id M x) → type α : IdA(M,N) P : C(M,Refl) JB P α : C(N,α)

Fix A : type, M : A Paths from M with free endpoint are inductively generated by (M,Refl)

slide-65
SLIDE 65

J from subst

32

C’ : A’ → type α’ : IdA’(M’,N’) P’ : C’[M’] substC’ α’ P’ : C’[N’] C : (Σx:A.Id M x) → type α : IdA(M,N) P : C(M,Refl) JB P α : C(N,α)

Fix A : type, M : A Paths from M with free endpoint are inductively generated by (M,Refl)

slide-66
SLIDE 66

J from subst

32

C’ : A’ → type α’ : IdA’(M’,N’) P’ : C’[M’] substC’ α’ P’ : C’[N’] C : (Σx:A.Id M x) → type α : IdA(M,N) P : C(M,Refl) JB P α : C(N,α)

Fix A : type, M : A Paths from M with free endpoint are inductively generated by (M,Refl)

Take A’ = Σx:A.Id M x

slide-67
SLIDE 67

J from subst

33

C’ : (Σx:A.Id M x) → type α’ : IdΣx:A.Id M x(M’,N’) P’ : C’[M’] substC’ α’ P’ : C’[N’] C : (Σx:A.Id M x) → type α : IdA(M,N) P : C(M,Refl) JB P α : C(N,α)

Fix A : type, M : A Paths from M with free endpoint are inductively generated by (M,Refl)

Take A’ = Σx:A.Id M x Take C’ = C, M’ = (M, Refl), N’ = (N, α), P’ = P

slide-68
SLIDE 68

J from subst

34

C : (Σx:A.Id M x) → type α’ : Id Σx:A.Id M x(M,Refl)(N,α) P : C(M,Refl) substC α’ P : C(N,α) C : (Σx:A.Id M x) → type α : IdA(M,N) P : C(M,Refl) JB P α : C(N,α)

Fix A : type, M : A Paths from M with free endpoint are inductively generated by (M,Refl)

Take A’ = Σx:A.Id M x Take C’ = C, M’ = (M, Refl), N’ = (N, α), P’ = P Therefore suffices to have α’ : Id Σx:A.Id M x(M,Refl)(N,α)

[Awodey]

slide-69
SLIDE 69

J from subst

35

Given α : IdA(M,N) want α’ : Id Σx:A.Id M x(M,Refl)(N,α) But have pairing for IdΣ α : IdA(M,M’) β : IdB[N’](substB α N, N’) pair≃ α β : Id Σx:A.B(M,N)(M’,N’)

:B[M] :B[M’]

slide-70
SLIDE 70

J from subst

35

Given α : IdA(M,N) want α’ : Id Σx:A.Id M x(M,Refl)(N,α) But have pairing for IdΣ α : IdA(M,M’) β : IdB[N’](substB α N, N’) pair≃ α β : Id Σx:A.B(M,N)(M’,N’) = (pair≃ α Refl)

:B[M] :B[M’]

slide-71
SLIDE 71

J from subst

35

Given α : IdA(M,N) want α’ : Id Σx:A.Id M x(M,Refl)(N,α) But have pairing for IdΣ α : IdA(M,M’) β : IdB[N’](substB α N, N’) pair≃ α β : Id Σx:A.B(M,N)(M’,N’) and computation rule for subst at Id:

substx:A.Id M x α Refl ≡ α o Refl ≡ α

= (pair≃ α Refl)

:B[M] :B[M’]

slide-72
SLIDE 72

Technical details

36

1.Need simultaneous subst for many variables to generalize subst→ to substΠ: explicit substitution calculus 2.Judgemental formulation: Path judgement α : M ≃ N comes first, subst and resp are judgemental concepts. ≃ internalized as Id type. 3.“Definitional” equality includes the equations

  • f GPD (e.g. interchange law, functoriality of

subst), though simpler axiomatizations are possible using Id type and equality reflection [Garner]

slide-73
SLIDE 73

Examples

37

Code reuse via isomorphism Algebraic topology: π1(S1) is Z Programming: Math: Once you know to look for them, subst/resp reductions show up often Often apply in situations where it’s hard to find a fibration to use J with

slide-74
SLIDE 74

Monoid

Monoid : U → U Monoid X = Σ ⊙ : X → X → X. Σ u : X. (Πx,y,z. Id (x ⊙ (y ⊙ z)) ((x ⊙ y) ⊙ z)) * (Πx.Id (x ⊙ u) x) * (Πx.Id (u ⊙ x) x)

38

slide-75
SLIDE 75

Monoid : type → type Monoid X = Σ ⊙:X→X→X. Σ u:X. … (⊙,u,…) : Monoid(A) (⊙’,u’,…) : Monoid(B) (f,f-1,α,β) : HEquiv(A, B) Given and make

39

By hand:

slide-76
SLIDE 76

Monoid : type → type Monoid X = Σ ⊙:X→X→X. Σ u:X. … (⊙,u,…) : Monoid(A) (⊙’,u’,…) : Monoid(B) (f,f-1,α,β) : HEquiv(A, B) Given and ⊙’ = λ y1,y2:B . f ((f-1 y1) ⊙ (f-1 y2)) u’ = f u make

39

By hand:

slide-77
SLIDE 77

Monoid : type → type Monoid X = Σ ⊙:X→X→X. Σ u:X. … (⊙,u,…) : Monoid(A) (⊙’,u’,…) : Monoid(B) (f,f-1,α,β) : HEquiv(A, B) Given and ⊙’ = λ y1,y2:B . f ((f-1 y1) ⊙ (f-1 y2)) u’ = f u make

39

(y ⊙’ u’) ≃ f ((f-1 y) ⊙ (f-1 (f u))) ≃ f (f-1 y ⊙ u) by α ≃ f (f-1 y) by unit law for ⊙ and u ≃ y by β By hand:

slide-78
SLIDE 78

Automatically!

40

α = ua (f,f-1,α,β) : A ≃ B

Monoid(A) : Monoid(B)

slide-79
SLIDE 79

Automatically!

substX:U.Monoid(X) α (⊙,u,…) ≡ (λy1,y2. f ( (f-1 y1) ⊙ (f-1 y2) ) f u, …)

40

α = ua (f,f-1,α,β) : A ≃ B

Monoid(A) : Monoid(B)

slide-80
SLIDE 80

Automatically!

substX:U.Monoid(X) α (⊙,u,…) ≡ (λy1,y2. f ( (f-1 y1) ⊙ (f-1 y2) ) f u, …)

40

α = ua (f,f-1,α,β) : A ≃ B ≡ substX:U.Σ⊙:X→X→X.Σu:X…. α (⊙,u,…)

Monoid(A) : Monoid(B)

slide-81
SLIDE 81

Automatically!

substX:U.Monoid(X) α (⊙,u,…) ≡ (λy1,y2. f ( (f-1 y1) ⊙ (f-1 y2) ) f u, …)

40

α = ua (f,f-1,α,β) : A ≃ B ≡ substX:U.Σ⊙:X→X→X.Σu:X…. α (⊙,u,…) ≡ (substX.X→X→X α ⊙, substX.X α u, …)

Monoid(A) : Monoid(B)

slide-82
SLIDE 82

Automatically!

substX:U.Monoid(X) α (⊙,u,…) ≡ (λy1,y2. f ( (f-1 y1) ⊙ (f-1 y2) ) f u, …)

40

α = ua (f,f-1,α,β) : A ≃ B ≡ substX:U.Σ⊙:X→X→X.Σu:X…. α (⊙,u,…) ≡ (substX.X→X→X α ⊙, substX.X α u, …) ≡ (λy1,y2. substX.X α ( (substX.X α-1 y1) ⊙ (substX.X α-1 y2) ) substX.X α u, …)

Monoid(A) : Monoid(B)

slide-83
SLIDE 83

Examples

41

Code reuse via isomorphism Algebraic topology: π1(S1) is Z (HoTT blog) Programming: Math:

Shulman, 2011 simplification Licata, 2012

slide-84
SLIDE 84

Work in progress

42

working on normalization judgement based

  • n above explanation

Challenges for higher dimensions: Conjectured algorithm for 2D: What does the operational semantics need to be for IdId IdIdId … ? Some computation steps are Id not ≡

where constructive higher-dimensional models will help

slide-85
SLIDE 85

Constructivity

43

Open problem: Can you normalize a program that is written using univalence? Canonicity up to ≡ for 2D case Working on normalization algorithm for 2D With some minor adjustments, steps valid for low dimensions in full HoTT So far:

slide-86
SLIDE 86

Thanks for listening!

44

slide-87
SLIDE 87

Reducibility

45

slide-88
SLIDE 88

Reducibility

46

slide-89
SLIDE 89

Interpretation of Types

47

slide-90
SLIDE 90

Canonicity

48