Cartesian Cubical Computational Type Theory Favonia U of - - PowerPoint PPT Presentation

cartesian cubical computational type theory
SMART_READER_LITE
LIVE PREVIEW

Cartesian Cubical Computational Type Theory Favonia U of - - PowerPoint PPT Presentation

Cartesian Cubical Computational Type Theory Favonia U of Minnesota Joint work with Carlo Angiuli, Evan Cavallo, Daniel R. Grayson, Robert Harper, Anders Mrtberg and Jonathan Sterling Oxford - 2018/7/8 1 Some History Coquand's notes 20??


slide-1
SLIDE 1

1

Cartesian Cubical Computational Type Theory

U of Minnesota

Favonia

Oxford - 2018/7/8 Joint work with Carlo Angiuli, Evan Cavallo, Daniel R. Grayson, Robert Harper, Anders Mörtberg and Jonathan Sterling

slide-2
SLIDE 2

2

AHW 2016 (CHTT Part I) AH 2017 (CHTT Part II) AFH 2017 (CHTT Part III) CH 2018 (CHTT Part IV) Cartesian cubical + computational Dependent types Univalent Kan universes Higher inductive types Identiication types

Some History

Coquand's notes 20?? BL 2014

slide-3
SLIDE 3

2

AHW 2016 (CHTT Part I) AH 2017 (CHTT Part II) AFH 2017 (CHTT Part III) ABCFHL 2017: CCTT CH 2018 (CHTT Part IV) Cartesian cubical + computational Dependent types Univalent Kan universes Higher inductive types Identiication types Cartesian cubical

Some History

Coquand's notes 20?? BL 2014

slide-4
SLIDE 4

2

AHW 2016 (CHTT Part I) AH 2017 (CHTT Part II) AFH 2017 (CHTT Part III) ABCFHL 2017: CCTT CH 2018 (CHTT Part IV) Cartesian cubical + computational Dependent types Univalent Kan universes Higher inductive types Identiication types Cartesian cubical

Some History

Coquand's notes 20?? BL 2014

slide-5
SLIDE 5

3

New Features of HoTT

Univalence

if e is an equivalence between types A and B, then ua(E):A=B

Higher Inductive Types

circle sphere torus

slide-6
SLIDE 6

4

Equality and Paths

Deinitional Equality

Visible in theory Silent in theory

Paths

If P : Path(A, B) and M : A then transport(M,P) : B If A ≡ B and M : A then M : B

slide-7
SLIDE 7

5

Not Math Equality!

Deinitional Equality Issue #1

Not very extensional x : ℕ, y : ℕ ⊦ x + y ≢ y + x : ℕ

(various reasonable trade-os)

slide-8
SLIDE 8

6 winding : π1(S1) → ℤ winding(loop) ≢ any numeral

Deinitional Equality Issue #2

Not Math Equality!

slide-9
SLIDE 9

6 winding : π1(S1) → ℤ winding(loop) ≢ any numeral

Deinitional Equality Issue #2

Not Math Equality!

For any M : ℕ, there is a numeral N* such that ⊦ M ≡ N* : ℕ

Canonicity

slide-10
SLIDE 10

7

Restore Canonicity

Canonicity for ℕ means canonicity for every type

slide-11
SLIDE 11

7

Restore Canonicity

Canonicity for ℕ means canonicity for every type M : ℕ × A fst(M) ≡ ??? : ℕ

Want M ≡ ⟨P,Q⟩ and then fst(M) ≡ fst ⟨P,Q⟩ ≡ P ≡ some numeral

slide-12
SLIDE 12

8

Restore Canonicity

But canonicity fails for paths!

rel(M) : M =A M M : A J(a.R, P) : C(M,N,P) a:A ⊦ R : C(a,a,rel(a)) P : M =A N J(a.R, rel(M)) ≡ R[M/a] : C(M,M,rel(M)) a:A ⊦ R : C(a,a,rel(a)) M : A

slide-13
SLIDE 13

8

Restore Canonicity

But canonicity fails for paths!

J(ua(E), x.N) ≡ ??? J(loop, x.N) ≡ ??? rel(M) : M =A M M : A J(a.R, P) : C(M,N,P) a:A ⊦ R : C(a,a,rel(a)) P : M =A N J(a.R, rel(M)) ≡ R[M/a] : C(M,M,rel(M)) a:A ⊦ R : C(a,a,rel(a)) M : A

slide-14
SLIDE 14

9

Restore Canonicity

Can we have canonicity + univalence?

Yes with De Morgan cubes [CCHM 2016] Yes with Cartesian cubes [AFH 2017]

And higher inductive types?

Important examples with De Morgan cubes [CHM 2018] Yes with Cartesian cubes [CH 2018]

slide-15
SLIDE 15

10

Cubes

Idea: each type manages its own paths

slide-16
SLIDE 16

10

Cubes

Idea: each type manages its own paths loop : base = base

slide-17
SLIDE 17

10

Cubes

Idea: each type manages its own paths loopx: a constructor of the circle loop : base = base x:𝕁 ⊦ loopx : S1 loop0 ≡ base : S1 loop1 ≡ base : S1

slide-18
SLIDE 18

11

Cartesian Cubes

Γ, x:𝕁, Γ' ⊦ x:𝕁

⬄ M is an n-cube in A

Γ ⊦ 0:𝕁 Γ ⊦ 1:𝕁 Introducing 𝕁 the formal interval x1:𝕁, x2:𝕁, ..., xn:𝕁 ⊦ M : A

slide-19
SLIDE 19

12

Cartesian Cubes

Γ, x:𝕁, Γ' ⊦ x:𝕁 Γ ⊦ 0:𝕁 Γ ⊦ 1:𝕁 Introducing 𝕁 the formal interval Cartesian: works as normal contexts M⟨0/x⟩ M⟨1/x⟩ M⟨y/x⟩ x y

slide-20
SLIDE 20

13

Ordinary Types

Γ ⊦ λa.M : (a:A) → B Γ, a:A ⊦ M : B Ordinary typing rules hold uniformly with any number of 𝕁 in the Γ

slide-21
SLIDE 21

13

Ordinary Types

Γ ⊦ λa.M : (a:A) → B Γ, a:A ⊦ M : B Ordinary typing rules hold uniformly with any number of 𝕁 in the Γ apF(M) F(Mx) F(Mx⟨0/x⟩) F(Mx⟨1/x⟩)

slide-22
SLIDE 22

14

New Path Types

⟨x⟩M : Pathx.A(M⟨0/x⟩,M⟨1/x⟩) x:𝕁 ⊦ M : A Dimension abstraction

(⟨x⟩M)@r ≡ M⟨r/x⟩ : A⟨r/x⟩ x:𝕁 ⊦ M : A P@0 ≡ N0 : A⟨0/x⟩ P : Pathx.A(N0,N1) P@r : A⟨r/x⟩ P : Pathx.A(N0,N1) P@1 ≡ N1 : A⟨1/x⟩ P : Pathx.A(N0,N1)

slide-23
SLIDE 23

15

Kan 1/2: Coercion

coex.A[r ↝ r'](M) : A⟨r'/x⟩ M : A⟨r/x⟩

slide-24
SLIDE 24

15

Kan 1/2: Coercion

coex.A[r ↝ r'](M) : A⟨r'/x⟩ A⟨0/x⟩ A⟨1/x⟩ M : A⟨r/x⟩ M

slide-25
SLIDE 25

15

Kan 1/2: Coercion

coex.A[r ↝ r'](M) : A⟨r'/x⟩ A⟨0/x⟩ A⟨1/x⟩ M : A⟨r/x⟩ M coex.A[0↝1](M)

slide-26
SLIDE 26

15

Kan 1/2: Coercion

coex.A[r ↝ r'](M) : A⟨r'/x⟩ A⟨0/x⟩ A⟨1/x⟩ M : A⟨r/x⟩ M coex.A[0↝1](M) coex.A[r ↝ r](M) ≡ M : A⟨r/x⟩

slide-27
SLIDE 27

15

Kan 1/2: Coercion

coex.A[r ↝ r'](M) : A⟨r'/x⟩ A⟨0/x⟩ A⟨1/x⟩ M : A⟨r/x⟩ M coex.A[0↝1](M) coex.A[0↝x](M) coex.A[r ↝ r](M) ≡ M : A⟨r/x⟩

slide-28
SLIDE 28

16

Kan 2/2: Homogeneous Comp

hcomA[r ↝ r'](M; ..., ri=r'i ↪ y.N, ...) : A

slide-29
SLIDE 29

16

Kan 2/2: Homogeneous Comp

M x y N0 N1

hcomA[r ↝ r'](M; ..., ri=r'i ↪ y.N, ...) : A

slide-30
SLIDE 30

16

Kan 2/2: Homogeneous Comp

M x y N0 N1 hcomA[0↝1](M; x=0 ↪ y.N0, x=1 ↪ y.N1]

hcomA[r ↝ r'](M; ..., ri=r'i ↪ y.N, ...) : A

slide-31
SLIDE 31

16

Kan 2/2: Homogeneous Comp

M x y N0 N1 hcomA[0↝1](M; x=0 ↪ y.N0, x=1 ↪ y.N1]

hcomA[r ↝ r](M; ...) ≡ M : A hcomA[r ↝ r'](M; ..., ri=ri ↪ y.Ni, ...) ≡ Ni⟨r'/y⟩ : A hcomA[r ↝ r'](M; ..., ri=r'i ↪ y.N, ...) : A

slide-32
SLIDE 32

17

Kan 2/2: Homogeneous Comp

slide-33
SLIDE 33

18

Fiberwise Fibrant Replacement

S1: hcom as the third constructor (the cubical way)

slide-34
SLIDE 34

18

Fiberwise Fibrant Replacement

S1: hcom as the third constructor (the cubical way) add only homogeneous ones ⇨ compat with base changes ⇨ no size blow-up! (known by many experts in cubical TT)

slide-35
SLIDE 35

19

Fiberwise Fibrant Replacement

If A has coercion, the replacement of raw susp(A) is Kan (the cubical way)

slide-36
SLIDE 36

19

Fiberwise Fibrant Replacement

If A has coercion, the replacement of raw susp(A) is Kan (the cubical way)

Important examples with De Morgan cubes [CHM 2018] A general schema with Cartesian cubes [CH 2018]

If objects on a span have coercion, the replacement of raw pushout is Kan

(Note: the raw pushout might not have coercion!)

slide-37
SLIDE 37

20

Univalent Universes

Vx(A,B,E) type

A line between A⟨0/x⟩ and B⟨1/x⟩ witnessed by the equivalence E

V0(A,B,E) ≡ A V1(A,B,E) ≡ B Vr(A,B,E) type A type [r=0] B type E : A ≃ B [r=0] expert only

slide-38
SLIDE 38

21

Univalent Kan Universes

hcomU[r ↝ r'](A; ...) type

Make the universes Kan

Kan structure of the hcom types themselves

Major diiculty:

(Good news: greatly simpliied aer Part III is out)

slide-39
SLIDE 39

22

Oh, Diagonals!

coex.hcom[s↝s'](A; ...)[r↝r'](M)

slide-40
SLIDE 40

22

Oh, Diagonals!

coex.hcom[s↝s'](A; ...)[r↝r'](M)

when s=s' ↦ coex.A[r↝r'](M) when r=r' ↦ M

slide-41
SLIDE 41

22

Oh, Diagonals!

coex.hcom[s↝s'](A; ...)[r↝r'](M)

when s=s' ↦ coex.A[r↝r'](M) when r=r' ↦ M hcom[s↝s'](..., r=r' ↪ ...)

diagonals for coherence conditions

slide-42
SLIDE 42

23

Computational Semantics

Transition system for closed terms

(λa.M)N ↦ M[N/a] λa.M val (⟨x⟩M)@r ↦ M⟨r/x⟩ ⟨x⟩M val

slide-43
SLIDE 43

23

Computational Semantics

Transition system for closed terms

(λa.M)N ↦ M[N/a] A ↦ A' λa.M val (⟨x⟩M)@r ↦ M⟨r/x⟩ ⟨x⟩M val coex.A[r ↝ r'](M) ↦ coex.A'[r ↝ r'](M) (other than dim. vars)

slide-44
SLIDE 44

23

Computational Semantics

Transition system for closed terms

(λa.M)N ↦ M[N/a]

Computational semantics: values Canonicity as a corollary

A ↦ A' λa.M val (⟨x⟩M)@r ↦ M⟨r/x⟩ ⟨x⟩M val coex.A[r ↝ r'](M) ↦ coex.A'[r ↝ r'](M) (other than dim. vars)

slide-45
SLIDE 45

24

Computational Semantics

Directly usable as a type theory

x : ℕ, y : ℕ ⪢ x + y ≐ y + x ∈ ℕ

with all the extensionalities

See our Part III for details

slide-46
SLIDE 46

25

Implementations

RedPRL

In Nuprl style

redprl.org

yacc

A proof of concept based on cubical

github.com/mortberg/yacc

red

(work in progress)

github.com/RedPRL/red

slide-47
SLIDE 47

26

Open Problems for HoTT

Cubical Simplicial Standard? ??? Yes HITs?

Yes

???

slide-48
SLIDE 48

26

Open Problems for HoTT

Cubical Simplicial Standard? ??? Yes HITs?

Yes

???

Very general construction with HITs

HoTTopia

slide-49
SLIDE 49

27

Summary of Cartesian Cubes

We have everything!

Univalent Kan universes Higher inductive types Identiication types

...and proof assistants

redprl.org github.com/mortberg/yacc github.com/RedPRL/red