Cartesian Cubical Computational Type Theory Favonia Inst for Adv - - PowerPoint PPT Presentation

cartesian cubical computational type theory
SMART_READER_LITE
LIVE PREVIEW

Cartesian Cubical Computational Type Theory Favonia Inst for Adv - - PowerPoint PPT Presentation

Cartesian Cubical Computational Type Theory Favonia Inst for Adv Study U of Minnesota Joint work with Carlo Angiuli, Evan Cavallo, Daniel R. Grayson, Robert Harper and Jonathan Sterling (a shameless rip-o ff of Carlo's previous talks)


slide-1
SLIDE 1

1

Cartesian Cubical Computational Type Theory

Inst for Adv Study ↦ U of Minnesota

Favonia

Bonn, Germany, 2018/6/5 Joint work with Carlo Angiuli, Evan Cavallo, Daniel R. Grayson, Robert Harper and Jonathan Sterling (a shameless rip-off of Carlo's previous talks)

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 BL 14

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 BL 14

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 BL 14

slide-5
SLIDE 5

3

New Features of HoTT

Univalence

inductive types with path generators 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

Silent in theory 2 + 3 ≡ 5 fst ⟨M,N⟩ ≡ M

slide-7
SLIDE 7

4

Equality and Paths

Deinitional Equality

Silent in theory If A ≡ B and M : A then M : B 2 + 3 ≡ 5 fst ⟨M,N⟩ ≡ M

slide-8
SLIDE 8

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 2 + 3 ≡ 5 fst ⟨M,N⟩ ≡ M

slide-9
SLIDE 9

5

Not Math Equality!

Deinitional Equality Issue #1

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

(various reasonable trade-os)

slide-10
SLIDE 10

6

winding

π1(S1)

ℤ winding(loop) ≢ any numeral

Deinitional Equality Issue #2

Not Math Equality!

slide-11
SLIDE 11

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-12
SLIDE 12

7

Restore Canonicity

Canonicity for ℕ means canonicity for every type

slide-13
SLIDE 13

7

Restore Canonicity

Canonicity for ℕ means canonicity for every type

M : ℕ × A fst(M) ≡ ??? : ℕ

slide-14
SLIDE 14

7

Restore Canonicity

Canonicity for ℕ means canonicity for every type

M : ℕ × A fst(M) ≡ ??? : ℕ By canonicity of pair types, M ≡ ⟨P,Q⟩ and fst(M) ≡ fst ⟨P,Q⟩ ≡ P ≡ some numeral

(rule) (by i.h.) (by i.h.)

slide-15
SLIDE 15

8

Restore Canonicity

But canonicity fails for paths!

Path-elim[p.C](M, x.N) : C[M/p] Path-elim(rel(M), x.N) ≡ N[M/x] : C[rel(M)/p] rel(M) : Path(M,M)

slide-16
SLIDE 16

8

Restore Canonicity

But canonicity fails for paths!

Path-elim[p.C](M, x.N) : C[M/p] Path-elim(rel(M), x.N) ≡ N[M/x] : C[rel(M)/p] rel(M) : Path(M,M) Path-elim(ua(E), x.N) ≡ ??? Path-elim(loop, x.N) ≡ ???

slide-17
SLIDE 17

9

Restore Canonicity

Can we have canonicity + univalence?

Yes with De Morgan cubes (CCHM) Yes with Cartesian cubes (Part III by AFH)

And higher inductive types?

Important examples with De Morgan cubes (CHM) Yes with cartesian cubes (Part IV by CH)

slide-18
SLIDE 18

10

Cubes

Idea: each type manages its own paths

slide-19
SLIDE 19

10

Cubes

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

slide-20
SLIDE 20

10

Cubes

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

slide-21
SLIDE 21

11

Cartesian Cubes

Introducing 𝕁 the formal interval

slide-22
SLIDE 22

11

Cartesian Cubes

Γ, x:𝕁, Γ' ⊦ x:𝕁 Γ ⊦ 0:𝕁 Γ ⊦ 1:𝕁 Introducing 𝕁 the formal interval

slide-23
SLIDE 23

11

Cartesian Cubes

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

⬄ M is an n-cube in A

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

slide-24
SLIDE 24

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⟩

slide-25
SLIDE 25

13

Ordinary Types

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

slide-26
SLIDE 26

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-27
SLIDE 27

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-28
SLIDE 28

15

Kan 1/2: Coercion

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

slide-29
SLIDE 29

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-30
SLIDE 30

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-31
SLIDE 31

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)

slide-32
SLIDE 32

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-33
SLIDE 33

16

Kan 2/2: Homogeneous Comp

M x y N0 N1

slide-34
SLIDE 34

16

Kan 2/2: Homogeneous Comp

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

slide-35
SLIDE 35

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

slide-36
SLIDE 36

17

Kan 2/2: Homogeneous Comp

slide-37
SLIDE 37

18

Fibrant Replacement

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

slide-38
SLIDE 38

18

Fibrant Replacement

S1: hcom as the third constructor (the cubical, syntactical way) add only homogeneous ones ⇨ compat with base changes ⇨ no size blow-up! (category-theoretic argument for sizes mostly learnt from Dan Grayson)

slide-39
SLIDE 39

19

Univalent Kan Universes

  • 0. Vx(A,B,E) type

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

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

Make the universes Kan

slide-40
SLIDE 40

20

Oh, Diagonals!

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

slide-41
SLIDE 41

20

Oh, Diagonals!

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

slide-42
SLIDE 42

20

Oh, Diagonals!

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

hcom...[s↝s'](..., r=r' ↪ ...)

diagonals for coherence conditions

slide-43
SLIDE 43

21

Computational Semantics

A computation system for closed terms

slide-44
SLIDE 44

21

Computational Semantics

A computation system for closed terms

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

slide-45
SLIDE 45

21

Computational Semantics

A computation system for closed terms

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

Computational semantics: values

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

Canonicity as a corollary

slide-46
SLIDE 46

22

Computational Semantics

Directly usable as a type theory

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

with all the extensionalities

See our Part III paper for details

slide-47
SLIDE 47

23

Implementations

RedPRL

Our irst try, in PRL (Nuprl) style

yacc red

redprl.org

(stay tuned for Anders' talk!) (work in progress)

slide-48
SLIDE 48

24

Summary of Cartesian Cubes

Canonicity + univalence?

Yes! (Part III by AFH)

And higher inductive types?

Yes! (Part IV by CH)

And the full HoTT?

Yes! (Parts III & IV)