Cartesian Cubical Computational Type Theory Favonia U of Minnesota Joint work with Carlo Angiuli, Evan Cavallo, Daniel R. Grayson, Robert Harper, Anders Mörtberg and Jonathan Sterling Oxford - 2018/7/8 1
Some History Coquand's notes 20?? BL 2014 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 20?? BL 2014 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 20?? BL 2014 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 circle sphere torus 3
Equality and Paths De � initional Equality Silent in theory 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 (S 1 ) → ℤ winding(loop) ≢ any numeral 6
Not Math Equality! De � initional Equality Issue #2 winding : π 1 (S 1 ) → ℤ 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) ≡ ??? : ℕ Want M ≡ ⟨ P,Q ⟩ and then fst(M) ≡ fst ⟨ P,Q ⟩ ≡ P ≡ some numeral 7
Restore Canonicity But canonicity fails for paths! a:A ⊦ R : C(a,a,re � l(a)) P : M = A N M : A re � l(M) : M = A M J(a.R, P) : C(M,N,P) a:A ⊦ R : C(a,a,re � l(a)) M : A J(a.R, re � l(M)) ≡ R[M/a] : C(M,M,re � l(M)) 8
Restore Canonicity But canonicity fails for paths! a:A ⊦ R : C(a,a,re � l(a)) P : M = A N M : A re � l(M) : M = A M J(a.R, P) : C(M,N,P) a:A ⊦ R : C(a,a,re � l(a)) M : A J(a.R, re � l(M)) ≡ R[M/a] : C(M,M,re � l(M)) J(ua(E), x.N) ≡ ??? J(loop, x.N) ≡ ??? 8
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] 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 constructor of the circle x: 𝕁 ⊦ loop x : S1 loop 0 ≡ base : S1 loop 1 ≡ base : S1 10
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 ⟩ 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 ↝ 1](M) M A ⟨ 0/x ⟩ A ⟨ 1/x ⟩ coe x.A [r ↝ r](M) ≡ M : A ⟨ r/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 hcom A [r ↝ r'](M; ..., r i =r' i ↪ y.N, ...) : A 16
Kan 2/2: Homogeneous Comp hcom A [r ↝ r'](M; ..., r i =r' i ↪ y.N, ...) : A N 0 N 1 y x M 16
Kan 2/2: Homogeneous Comp hcom A [r ↝ r'](M; ..., r i =r' i ↪ y.N, ...) : A 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 [r ↝ r'](M; ..., r i =r' i ↪ y.N, ...) : A 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
Fiberwise Fibrant Replacement (the cubical way) S1: hcom as the third constructor 18
Fiberwise Fibrant Replacement (the cubical way) S1: hcom as the third constructor add only homogeneous ones ⇨ compat with base changes ⇨ no size blow-up! (known by many experts in cubical TT) 18
Fiberwise Fibrant Replacement (the cubical way) If A has coercion, the replacement of raw susp(A) is Kan 19
Fiberwise Fibrant Replacement (the cubical way) If A has coercion, the replacement of raw susp(A) is Kan If objects on a span have coercion, the replacement of raw pushout is Kan (Note: the raw pushout might not have coercion!) Important examples with De Morgan cubes [CHM 2018] A general schema with Cartesian cubes [CH 2018] 19
Univalent Universes V x (A,B,E) type A line between A ⟨ 0/x ⟩ and B ⟨ 1/x ⟩ witnessed by the equivalence E E : A ≃ B [r=0] A type [r=0] B type V r (A,B,E) type V 0 (A,B,E) ≡ A V 1 (A,B,E) ≡ B expert only 20
Univalent Kan Universes hcom U [r ↝ r'](A; ...) type Make the universes Kan Major di � iculty: Kan structure of the hcom types themselves (Good news: greatly simpli � ied a � er Part III is out) 21
Oh, Diagonals! coe x.hcom[s ↝ s'](A; ...) [r ↝ r'](M) 22
Oh, Diagonals! coe x.hcom[s ↝ s'](A; ...) [r ↝ r'](M) when s=s' ↦ coe x.A [r ↝ r'](M) when r=r' ↦ M 22
Oh, Diagonals! coe x.hcom[s ↝ s'](A; ...) [r ↝ r'](M) when s=s' ↦ coe x.A [r ↝ r'](M) when r=r' ↦ M hcom[s ↝ s'](..., r=r' ↪ ...) diagonals for coherence conditions 22
Computational Semantics Transition system for closed terms λ a.M val ( λ a.M)N ↦ M[N/a] ⟨ x ⟩ M val ( ⟨ x ⟩ M)@r ↦ M ⟨ r/x ⟩ 23
Computational Semantics Transition system for closed terms (other than dim. vars) λ a.M val ( λ a.M)N ↦ M[N/a] ⟨ x ⟩ M val ( ⟨ x ⟩ M)@r ↦ M ⟨ r/x ⟩ A ↦ A' coe x.A [r ↝ r'](M) ↦ coe x.A' [r ↝ r'](M) 23
Computational Semantics Transition system for closed terms (other than dim. vars) λ a.M val ( λ a.M)N ↦ M[N/a] ⟨ x ⟩ M val ( ⟨ x ⟩ M)@r ↦ M ⟨ r/x ⟩ A ↦ A' coe x.A [r ↝ r'](M) ↦ coe x.A' [r ↝ r'](M) Computational semantics: values Canonicity as a corollary 23
Computational Semantics Directly usable as a type theory x : ℕ , y : ℕ ⪢ x + y ≐ y + x ∈ ℕ with all the extensionalities See our Part III for details 24
Implementations RedPRL In Nuprl style redprl.org red � (work in progress) github.com/RedPRL/red � yacc � A proof of concept based on cubical � github.com/mortberg/yacc � 25
Open Problems for HoTT Cubical Simplicial Standard? ??? Yes HITs? ??? Yes 26
Open Problems for HoTT Cubical Simplicial Standard? ??? Yes HITs? ??? Yes HoTTopia Very general construction with HITs 26
Summary of Cartesian Cubes We have everything! Univalent Kan universes Higher inductive types Identi � ication types ...and proof assistants redprl.org github.com/RedPRL/red � github.com/mortberg/yacc � 27
Recommend
More recommend