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) Bonn, Germany, 2018/6/5 1
Some History Coquand's notes BL 14 AHW 2016: CHTT Part I Cartesian cubical + computational AH 2017: CHTT Part II Dependent types AFH 2017: CHTT Part III Univalent Kan universes CH 2018: CHTT Part IV Higher inductive types Identi � ication types 2
Some History Coquand's notes BL 14 AHW 2016: CHTT Part I Cartesian cubical + computational AH 2017: CHTT Part II Dependent types AFH 2017: CHTT Part III Univalent Kan universes ABCFHL 2017: CCTT Cartesian cubical CH 2018: CHTT Part IV Higher inductive types Identi � ication types 2
Some History Coquand's notes BL 14 AHW 2016: CHTT Part I Cartesian cubical + computational AH 2017: CHTT Part II Dependent types AFH 2017: CHTT Part III Univalent Kan universes ABCFHL 2017: CCTT Cartesian cubical CH 2018: CHTT Part IV Higher inductive types Identi � ication types 2
New Features of HoTT Univalence if e is an equivalence between types A and B, then ua(E):A=B Higher Inductive Types inductive types with path generators circle sphere torus 3
Equality and Paths De � initional Equality Silent in theory 2 + 3 ≡ 5 fst ⟨ M,N ⟩ ≡ M 4
Equality and Paths De � initional Equality Silent in theory 2 + 3 ≡ 5 fst ⟨ M,N ⟩ ≡ M If A ≡ B and M : A then M : B 4
Equality and Paths De � initional Equality Silent in theory 2 + 3 ≡ 5 fst ⟨ M,N ⟩ ≡ M If A ≡ B and M : A then M : B Paths Visible in theory If P : Path(A, B) and M : A then transport(M,P) : B 4
Not Math Equality! De � initional Equality Issue #1 Not very extensional x : ℕ , y : ℕ ⊦ x + y ≢ y + x : ℕ (various reasonable trade-o � s) 5
ℤ Not Math Equality! De � initional Equality Issue #2 winding π 1 (S1) winding(loop) ≢ any numeral 6
ℤ Not Math Equality! De � initional Equality Issue #2 winding π 1 (S1) winding(loop) ≢ any numeral Canonicity For any M : ℕ , there is a numeral N* such that ⊦ M ≡ N* : ℕ 6
Restore Canonicity Canonicity for ℕ means canonicity for every type 7
Restore Canonicity Canonicity for ℕ means canonicity for every type M : ℕ × A fst(M) ≡ ??? : ℕ 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 (by i.h.) (rule) (by i.h.) 7
Restore Canonicity But canonicity fails for paths! re � l(M) : Path(M,M) Path-elim[p.C](M, x.N) : C[M/p] Path-elim(re � l(M), x.N) ≡ N[M/x] : C[re � l(M)/p] 8
Restore Canonicity But canonicity fails for paths! re � l(M) : Path(M,M) Path-elim[p.C](M, x.N) : C[M/p] Path-elim(re � l(M), x.N) ≡ N[M/x] : C[re � l(M)/p] Path-elim(ua(E), x.N) ≡ ??? Path-elim(loop, x.N) ≡ ??? 8
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) 9
Cubes Idea: each type manages its own paths 10
Cubes Idea: each type manages its own paths loop : base = base 10
Cubes Idea: each type manages its own paths loop : base = base loop x : a genuine constructor of the circle x: 𝕁 ⊦ loop x : S1 loop 0 ≡ base : S1 loop 1 ≡ base : S1 10
Cartesian Cubes Introducing 𝕁 the formal interval 11
Cartesian Cubes Introducing 𝕁 the formal interval Γ ⊦ 0: 𝕁 Γ ⊦ 1: 𝕁 Γ , x: 𝕁 , Γ ' ⊦ x: 𝕁 11
Cartesian Cubes Introducing 𝕁 the formal interval Γ ⊦ 0: 𝕁 Γ ⊦ 1: 𝕁 Γ , x: 𝕁 , Γ ' ⊦ x: 𝕁 x 1 : 𝕁 , x 2 : 𝕁 , ..., x n : 𝕁 ⊦ M : A ⬄ M is an n-cube in A 11
Cartesian Cubes Introducing 𝕁 the formal interval Γ ⊦ 0: 𝕁 Γ ⊦ 1: 𝕁 Γ , x: 𝕁 , Γ ' ⊦ x: 𝕁 Cartesian: works as normal contexts M ⟨ 0/x ⟩ M ⟨ 1/x ⟩ M ⟨ y/x ⟩ 12
Ordinary Types Ordinary typing rules hold uniformly Γ , a:A ⊦ M : B Γ ⊦ λ a.M : (a:A) → B with any number of 𝕁 in the Γ 13
Ordinary Types Ordinary typing rules hold uniformly Γ , a:A ⊦ M : B Γ ⊦ λ a.M : (a:A) → B with any number of 𝕁 in the Γ ap F (M) F(M x ) F(M x ⟨ 0/x ⟩ ) F(M x ⟨ 1/x ⟩ ) 13
New Path Types Dimension abstraction x: 𝕁 ⊦ M : A ⟨ x ⟩ M : Path x.A (M ⟨ 0/x ⟩ ,M ⟨ 1/x ⟩ ) x: 𝕁 ⊦ M : A P : Path x.A (N 0 ,N 1 ) P@r : A ⟨ r/x ⟩ ( ⟨ x ⟩ M)@r ≡ M ⟨ r/x ⟩ : A ⟨ r/x ⟩ P : Path x.A (N 0 ,N 1 ) P : Path x.A (N 0 ,N 1 ) P@0 ≡ N 0 : A ⟨ 0/x ⟩ P@1 ≡ N 1 : A ⟨ 1/x ⟩ 14
Kan 1/2: Coercion M : A ⟨ r/x ⟩ coe x.A [r ↝ r'](M) : A ⟨ r'/x ⟩ 15
Kan 1/2: Coercion M : A ⟨ r/x ⟩ coe x.A [r ↝ r'](M) : A ⟨ r'/x ⟩ M A ⟨ 0/x ⟩ A ⟨ 1/x ⟩ 15
Kan 1/2: Coercion M : A ⟨ r/x ⟩ coe x.A [r ↝ r'](M) : A ⟨ r'/x ⟩ coe x.A [0 ↝ 1](M) M A ⟨ 0/x ⟩ A ⟨ 1/x ⟩ 15
Kan 1/2: Coercion M : A ⟨ r/x ⟩ coe x.A [r ↝ r'](M) : A ⟨ r'/x ⟩ coe x.A [0 ↝ x](M) coe x.A [0 ↝ 1](M) M A ⟨ 0/x ⟩ A ⟨ 1/x ⟩ 15
Kan 1/2: Coercion M : A ⟨ r/x ⟩ coe x.A [r ↝ r'](M) : A ⟨ r'/x ⟩ coe x.A [0 ↝ x](M) coe x.A [0 ↝ 1](M) M A ⟨ 0/x ⟩ A ⟨ 1/x ⟩ coe x.A [r ↝ r](M) ≡ M : A ⟨ r/x ⟩ 15
Kan 2/2: Homogeneous Comp N 0 N 1 y x M 16
Kan 2/2: Homogeneous Comp hcom A [0 ↝ 1](M; x=0 ↪ y.N 0 , x=1 ↪ y.N 1 ] N 0 N 1 y x M 16
Kan 2/2: Homogeneous Comp hcom A [0 ↝ 1](M; x=0 ↪ y.N 0 , x=1 ↪ y.N 1 ] N 0 N 1 y x M hcom A [r ↝ r](M; ...) ≡ M : A hcom A [r ↝ r'](M; ..., r i =r i ↪ y.N i , ...) ≡ N i ⟨ r'/y ⟩ : A 16
Kan 2/2: Homogeneous Comp 17
Fibrant Replacement (the cubical, syntactical way) S1: hcom as the third constructor 18
Fibrant Replacement (the cubical, syntactical way) S1: hcom as the third constructor add only homogeneous ones ⇨ compat with base changes ⇨ no size blow-up! (category-theoretic argument for sizes mostly learnt from Dan Grayson) 18
Univalent Kan Universes 0. V x (A,B,E) type A line between A ⟨ 0/x ⟩ and B ⟨ 1/x ⟩ witnessed by the equivalence E 1. hcom U [r ↝ r'](A; ...) type Make the universes Kan 19
Oh, Diagonals! coe x.hcom[s ↝ s'](A; ...) [r ↝ r'](M) 20
Oh, Diagonals! coe x.hcom[s ↝ s'](A; ...) [r ↝ r'](M) s=s' ↦ coe x.A [r ↝ r'](M) r=r' ↦ M 20
Oh, Diagonals! coe x.hcom[s ↝ s'](A; ...) [r ↝ r'](M) s=s' ↦ coe x.A [r ↝ r'](M) r=r' ↦ M hcom...[s ↝ s'](..., r=r' ↪ ...) diagonals for coherence conditions 20
Computational Semantics A computation system for closed terms 21
Computational Semantics A computation system for closed terms ( λ a.M)N ↦ M[N/a] ( ⟨ x ⟩ M)@r ↦ M ⟨ r/x ⟩ coe x.A [r ↝ r'](M) ↦ coe x.A' [r ↝ r'](M) 21
Computational Semantics A computation system for closed terms ( λ a.M)N ↦ M[N/a] ( ⟨ x ⟩ M)@r ↦ M ⟨ r/x ⟩ coe x.A [r ↝ r'](M) ↦ coe x.A' [r ↝ r'](M) Computational semantics: values Canonicity as a corollary 21
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 22
Implementations RedPRL Our � irst try, in PRL (Nuprl) style redprl.org yacc � (stay tuned for Anders' talk!) red � (work in progress) 23
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) 24
Recommend
More recommend