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 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 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 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 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 4
Equality and Paths
Deinitional Equality
Silent in theory 2 + 3 ≡ 5 fst ⟨M,N⟩ ≡ M
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 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 5
Not Math Equality!
Deinitional Equality Issue #1
Not very extensional x : ℕ, y : ℕ ⊦ x + y ≢ y + x : ℕ
(various reasonable trade-os)
SLIDE 10 6
winding
π1(S1)
ℤ winding(loop) ≢ any numeral
Deinitional Equality Issue #2
Not Math Equality!
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
7
Restore Canonicity
Canonicity for ℕ means canonicity for every type
SLIDE 13 7
Restore Canonicity
Canonicity for ℕ means canonicity for every type
M : ℕ × A fst(M) ≡ ??? : ℕ
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 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 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 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
10
Cubes
Idea: each type manages its own paths
SLIDE 19
10
Cubes
Idea: each type manages its own paths loop : base = base
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
11
Cartesian Cubes
Introducing 𝕁 the formal interval
SLIDE 22
11
Cartesian Cubes
Γ, x:𝕁, Γ' ⊦ x:𝕁 Γ ⊦ 0:𝕁 Γ ⊦ 1:𝕁 Introducing 𝕁 the formal interval
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
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
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
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 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
15
Kan 1/2: Coercion
coex.A[r ↝ r'](M) : A⟨r'/x⟩ M : A⟨r/x⟩
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
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
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
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
16
Kan 2/2: Homogeneous Comp
M x y N0 N1
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
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
17
Kan 2/2: Homogeneous Comp
SLIDE 37
18
Fibrant Replacement
S1: hcom as the third constructor (the cubical, syntactical way)
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 19
Univalent Kan Universes
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
20
Oh, Diagonals!
coex.hcom[s↝s'](A; ...)[r↝r'](M)
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
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
21
Computational Semantics
A computation system for closed terms
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
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 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 23
Implementations
RedPRL
Our irst try, in PRL (Nuprl) style
yacc red
redprl.org
(stay tuned for Anders' talk!) (work in progress)
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)