Yet Another Crtesin Cubicl Type Theory Anders Mörtberg Crnegie Mellon University nd University of Gothenburg Types, Homotopy Type theory, nd Verifiction HIM Bonn June 6, 2018 Anders Mörtberg June 6, 2018 1 / 40
Cubes, cubes, cubes... I will tlk bout my ttempts to understnd the new nd exciting developments on Crtesin cubicl type theories: Computtionl Higher Type Theory III: Univlent Universes nd Exct Equlity (Angiuli, Fvoni, Hrper - AFH) Crtesin Cubicl Type Theory (Angiuli, Brunerie, Coqund, Fvoni, Hrper, Lict - ABCFHL) These provide us with new constructive models of Univlent Foundtions nd higher inductive types Anders Mörtberg Introduction June 6, 2018 2 / 40
ycctt Slogn: the best wy to understnd type theory is to implement it! Together with Crlo Angiuli I hve dpted the code-bse of cubicltt to implement Crtesin cubicl type theory: ycctt: yet nother crtesin cubicl type theory 1 https://github.com/mortberg/ycctt/ Inspired by Cubicl Type Theory: constructive interprettion of the univlence xiom (Cohen, Coqund, Huber, M. - CCHM) 1 https://en.wikipedi.org/wiki/ycc Anders Mörtberg Introduction June 6, 2018 3 / 40
ycctt In this tlk I will present this syntcticlly, however everything I sy cn be done internlly in topos extended with suitble xioms following: Axioms for Modelling Cubicl Type Theory in Topos (Orton, Pitts) Internl Universes in Models of Homotopy Type Theory (Lict, Orton, Pitts, Spitters) This is the pproch tken in ABCFHL Anders Mörtberg Introduction June 6, 2018 4 / 40
ycctt My min motivtion for implementing nother cubicl type theory is to explore the following: 1 How convenient is it to formlize mthemtics in this new system with its new primitives? 2 Does this compute more efficiently thn cubicltt? (Cn we compute the Brunerie number?) Anders Mörtberg Introduction June 6, 2018 5 / 40
ycctt ycctt extends dependent type theory (with et for Π nd Σ) with: Pth types bsed on Crtesin intervl Digonl context restrictions (generting cofibrtions) Generlized Kn opertions (trnsport of structures 2 ) V-types (specil cse of Glue-types tht suffices for univlence) Fibrnt universes Some higher inductive types 2 cf. Bourbki: Theory of sets, 1968 Anders Mörtberg Introduction June 6, 2018 6 / 40
Crtesin intervl Forml representtion of the intervl, I: r, s ::= 0 1 i i, j, k... forml symbols/nmes representing directions/dimensions Contexts cn contin vribles in the intervl: Γ Γ, i : I Anders Mörtberg Crtesin intervl June 6, 2018 7 / 40
Crtesin intervl i : I A corresponds to line: A(0/i) A A(1/i) i : I, j : I A corresponds to squre: A(0/i)(1/j) A(1/j) A(1/i)(1/j) A(0/i) A(j/i) A(1/i) j i A(0/i)(0/j) A(0/j) A(1/i)(0/j) Digonl substitutions re llowed (no linerity constrint s in BCH) Anders Mörtberg Crtesin intervl June 6, 2018 8 / 40
Pth types The Pth types re modelled s: Pth(A) := A I Pth A (, b) := {p Pth(A) p 0 = p 1 = b} In the syntx we write Pth A b for the Pth types nd i u for Pth bstrction These types re defined by the sme rules s in CCHM nd provide convenient syntx for directly resoning bout (higher) equlity types We cn directly prove tht these stisfy function extensionlity (CCHM) Anders Mörtberg Crtesin intervl June 6, 2018 9 / 40
Composition opertions We wnt to be ble to compose pths: p b b q c We do this by computing the dshed line in: c q p b In generl this corresponds to computing the missing sides of n-dimensionl cubes Anders Mörtberg Context restrictions June 6, 2018 10 / 40
Composition opertions Box principle: ny open box hs lid Cubicl version of the Kn condition for simplicil sets: Any horn cn be filled First formulted by Dniel Kn in Abstrct Homotopy I (1955) for cubicl complexes Anders Mörtberg Context restrictions June 6, 2018 11 / 40
Context restrictions To formulte this we need syntx for representing prtilly specified n-dimensionl cubes We dd context restrictions Γ, ϕ where ϕ is fce formul representing subset of the fces of cube ϕ, ψ ::= 0 F 1 F (i = 0) (i = 1) (i = j) ϕ ψ ϕ ψ Key new ide is to llow (i = j) s context restrictions! (AFH) Anders Mörtberg Context restrictions June 6, 2018 12 / 40
Prtil elements Any judgment vlid in context Γ is lso vlid in restriction Γ, ϕ Γ A Γ, ϕ A If Γ A nd Γ, ϕ : A then is prtil element of A of extent ϕ We write Γ b : A[ϕ ] for Γ b : A Γ, ϕ : A Γ, ϕ = b : A Anders Mörtberg Context restrictions June 6, 2018 13 / 40
Box principle in CCHM In CCHM we formulted the box principle s: Γ, i : I A Γ, ϕ, i : I u : A Γ u 0 : A(0/i)[ϕ u(0/i)] Γ comp i A [ϕ u] u 0 : A(1/i)[ϕ u(1/i)] u 0 is the bottom u is the sides comp i A [ϕ u] u 0 is the lid Semnticlly this is structure (nd not property) of type. A type is clled fibrnt if it cn be equipped with this structure Anders Mörtberg Kn opertions June 6, 2018 14 / 40
Composition opertions: exmple With composition we cn justify trnsitivity of pth types: Γ p : Pth A b Γ q : Pth A b c Γ i comp j A [(i = 0), (i = 1) q j] (p i) : Pth A c c q j j i p i b Anders Mörtberg Kn opertions June 6, 2018 15 / 40
Trnsport s composition in CCHM Composition for ϕ = 0 F corresponds to trnsport: Γ, i : I A Γ u 0 : A(i/0) Γ trnsport i A u 0 = comp i A [] u 0 : A(i/1) u 0 trnsport i A u 0 A(0/i) A i A(1/i) Anders Mörtberg Kn opertions June 6, 2018 16 / 40
Kn filling from composition A key observtion in CCHM is tht we cn compute the filler of cube using composition nd connections In ycctt we don t hve ny connections... Wht cn we do? Anders Mörtberg Kn opertions June 6, 2018 17 / 40
Kn filling from composition A key observtion in CCHM is tht we cn compute the filler of cube using composition nd connections In ycctt we don t hve ny connections... Wht cn we do? Solution: strengthen the composition opertion! Anders Mörtberg Kn opertions June 6, 2018 17 / 40
Strengthened composition Compose from r to s: Γ, i : I A Γ r : I Γ s : I Γ ϕ : F Γ, ϕ, i : I u : A Γ u 0 : A(r/i)[ϕ u(r/i)] Γ com r s i A [ϕ u] u 0 : A(s/i)[ϕ u(s/i), r = s u 0 ] We recover comp when r = 0 nd s = 1 We get the filler when r = 0 nd s is dimension vrible j : I Anders Mörtberg Kn opertions June 6, 2018 18 / 40
Strengthened composition We cn now define com by cses on the type A just like in CCHM, however in order to lso be ble to support HITs we first decompose the opertion into homogeneous composition nd coercion: Γ A Γ r : I Γ s : I Γ ϕ : F Γ, ϕ, i : I u : A Γ u 0 : A[ϕ u(r/i)] Γ hcom r s i A [ϕ u] u 0 : A[ϕ u(s/i), r = s u 0 ] Γ, i : I A Γ r : I Γ s : I Γ u : A(r/i) Γ coe r s i A u : A(s/i)[r = s u] Anders Mörtberg Kn opertions June 6, 2018 19 / 40
Coercion exmples Given i : I u : A we get: u(1/i) u u(0/i) A(0/i) A A(1/i) Anders Mörtberg Kn opertions June 6, 2018 20 / 40
Coercion exmples Given i : I u : A we get: u(1/i) u u(0/i) coe 0 1 i A u(0/i) A(0/i) A A(1/i) Anders Mörtberg Kn opertions June 6, 2018 20 / 40
Coercion exmples Given i : I u : A we get: u(1/i) u u(0/i) coe 0 i i A u(0/i) coe 0 1 i A u(0/i) A(0/i) A A(1/i) Anders Mörtberg Kn opertions June 6, 2018 20 / 40
Coercion exmples Given i : I u : A we get: u(1/i) u coe i 1 i A u u(0/i) coe 0 i i A u(0/i) coe 0 1 i A u(0/i) A(0/i) A A(1/i) Anders Mörtberg Kn opertions June 6, 2018 20 / 40
Reversls Given p : Pth A b we cn define p 1 : Pth A b s p 1 := i hcom 0 1 j A [(i = 0) p j, (i = 1) ] This corresponds to the dshed line in: b p 1 p Anders Mörtberg Kn opertions June 6, 2018 21 / 40
Connections Given p : Pth A b we cn define: i j hcom 0 1 k A [(i = 0) hcom 1 0 l A [(k = 0), (k = 1) p l] (p k),(i = 1) hcom 1 j l A [(k = 0), (k = 1) p l] (p k),(j = 0) hcom 1 0 l A [(k = 0), (k = 1) p l] (p k),(j = 1) hcom 1 i l A [(k = 0), (k = 1) p l] (p k)] This hs boundry: p b p Anders Mörtberg Kn opertions June 6, 2018 22 / 40
Connections Given p : Pth A b we cn define: i j hcom 0 1 k A [(i = 0) hcom 1 0 l A [(k = 0), (k = 1) p l] (p k),(i = 1) hcom 1 j l A [(k = 0), (k = 1) p l] (p k),(j = 0) hcom 1 0 l A [(k = 0), (k = 1) p l] (p k),(j = 1) hcom 1 i l A [(k = 0), (k = 1) p l] (p k),(i = j) hcom 1 i l A [(k = 0), (k = 1) p l] (p k)] This hs boundry: p b p p Anders Mörtberg Kn opertions June 6, 2018 22 / 40
Reversls nd connections These definitions of reversls nd connections does not stisfy s mny judgmentl equlities s the corresponding ones in CCHM How does this ffect prcticl formliztion? Anders Mörtberg Kn opertions June 6, 2018 23 / 40
Reversls nd connections These definitions of reversls nd connections does not stisfy s mny judgmentl equlities s the corresponding ones in CCHM How does this ffect prcticl formliztion? For exmple in CCHM we directly get tht (C op ) op = C using reversls However, mny exmples tht use reversls nd connections in CCHM cn be done directly with the generlized Kn opertions Anders Mörtberg Kn opertions June 6, 2018 23 / 40
Coercion bck nd forth Given i : I A nd : A(0/i) we hve: A(0/i) A A(1/i) Anders Mörtberg Kn opertions June 6, 2018 24 / 40
Coercion bck nd forth Given i : I A nd : A(0/i) we hve: A(0/i) A coe 0 1 i A A(1/i) Anders Mörtberg Kn opertions June 6, 2018 24 / 40
Coercion bck nd forth Given i : I A nd : A(0/i) we hve: coe 1 0 i A (coei 0 1 A ) A(0/i) A coe 0 1 i A A(1/i) Anders Mörtberg Kn opertions June 6, 2018 24 / 40
Coercion bck nd forth Given i : I A nd : A(0/i) we hve: coe 1 0 i A (coei 0 1 A ) p? A(0/i) A coe 0 1 i A A(1/i) Anders Mörtberg Kn opertions June 6, 2018 24 / 40
Coercion bck nd forth Given i : I A nd : A(0/i) we hve: coe 1 0 i A (coei 0 1 A ) p? A(0/i) We tke p := j coe j 0 i A (coe 0 j i A ) A coe 0 1 i A A(1/i) Anders Mörtberg Kn opertions June 6, 2018 24 / 40
Coercion bck nd forth Given i : I A nd : A(0/i) we hve: coe 1 0 i A (coei 0 1 A ) p? A(0/i) We tke p := j coe j 0 i A (coe 0 j i A ) A coe 0 1 i A A(1/i) The corresponding result in CCHM is quite bit more involved (it uses 3 non-homogeneous compositions) Anders Mörtberg Kn opertions June 6, 2018 24 / 40
hcom nd coe We define the judgmentl computtion rules for hcom nd coe by cses of the type A There re no surprises for Π, Σ, Pth nd bsic dttypes like N Anders Mörtberg Kn opertions June 6, 2018 25 / 40
hcom nd coe We define the judgmentl computtion rules for hcom nd coe by cses of the type A There re no surprises for Π, Σ, Pth nd bsic dttypes like N The lgorithms for hcom nd coe re often simpler thn the corresponding ones for com, so I would conjecture tht this decomposition is lso good for efficiency The decomposition is lso very nturl for formliztion: we often wnt to compose in constnt type or just coerce without ny constrints Anders Mörtberg Kn opertions June 6, 2018 25 / 40
Univlence nd V-types In order to be ble to prove univlence we need wy to turn equivlences into pths in the universe We could use CCHM Glue-types (s in ABCFHL), but insted we follow AFH nd introduce specil cse of Glue-types clled V-types 3 These llow us to glue n equivlence to one side of line between types (i.e. to extend n equivlence long n endpoint inclusion) 3 V in honour of Voevodsky Anders Mörtberg V-types June 6, 2018 26 / 40
V-types In the cse when r is dimension vrible i : I the V-type V i (A, B, e) cn be drwn s the dshed line in: A e V i (A, B, e) B(0/i) B B(1/i) Anders Mörtberg V-types June 6, 2018 27 / 40
V-types typing rules (slide of deth) Γ r : I Γ, r = 0 A Γ B Γ, r = 0 e : Equiv A B Γ V r (A, B, e)[r = 0 A, r = 1 B] Γ r : I Γ, r = 0 u : A Γ v : B[r = 0 e u] Γ, r = 0 e : Equiv A B Γ Vin r u v : V r (A, B, e)[r = 0 u, r = 1 v] Γ r : I Γ u : V r (A, B, e) Γ Vproj r u e : B[r = 0 e u, r = 1 u] Anders Mörtberg V-types June 6, 2018 28 / 40
V-types Semnticlly V-types correspond to the following specil cse of Glue-types: A e B B Γ, (i = 0) Γ Anders Mörtberg V-types June 6, 2018 29 / 40
V-types Semnticlly V-types correspond to the following specil cse of Glue-types: A e V i (A, B, e) Vproj i B B Γ, (i = 0) Γ Anders Mörtberg V-types June 6, 2018 29 / 40
V-types: fibrncy To prove tht these types re fibrnt we hve to define: hcom r s i (V j (A, B, e)) [ϕ u] u 0 coe r s i (V j (A, B, e)) u Both hcom, nd coe when i j, re strightforwrd Only coe when i = j requires e to be n equivlence, furthermore this cse crucilly uses the digonl constrints/cofibrtions None of the cses uses the i opertion of CCHM Anders Mörtberg V-types June 6, 2018 30 / 40
V-types: coe r s i (V i (A, B, e)) u : V s [r = s u] For this let: u := Vproj r u e(r/i) P := coe r s i B u (C 1, C 2 ) := e(s/i).2 P R := hcomk 1 0 (Fiber e(s/i) P) [r = 0 C 2 (u, P) k, r = 1 C 1 ] C 1 S := hcomk 1 0 B(s/i) [s = 0 R.2 k, r = s Vproj s u e(s/i)] P nd we define coe r s i (V i (A, B, e)) u := Vin s R.1 S Anders Mörtberg V-types June 6, 2018 31 / 40
Fibrnt universes We lso hve universes in ycctt, however s we re not using Glue-types we hve to do more work to prove tht they re fibrnt We follow direct rgument from AFH for glueing on lines of types onto line of types 4 The coe opertion uses i, nd both coe nd hcom uses the digonl constrints/cofibrtions in crucil wy 4 This is similr to n unfolded version of composition for the universe in CCHM, which in fct is wht we implemented in cubicltt for efficiency Anders Mörtberg V-types June 6, 2018 32 / 40
Univlence nd V-types I hve formlized two proofs of univlence in ycctt The first proof uses the observtion tht we cn prove the full univlence xiom from n opertion u : Equiv A B Pth U A B stisfying for ll : A u β : Pth B (coe 0 1 i (u e i) ) (e ) Anders Mörtberg V-types June 6, 2018 33 / 40
Univlence nd V-types Given e : Equiv A B we define: u := i V i (A, B, e) Anders Mörtberg V-types June 6, 2018 34 / 40
Univlence nd V-types Given e : Equiv A B we define: u := i V i (A, B, e) If we unfold the lgorithm for coercion in V-types we see tht coe 0 1 i (u i) = coe 0 1 i (V i (A, B, e)) = coe 0 1 i B (e ) Anders Mörtberg V-types June 6, 2018 34 / 40
Univlence nd V-types Given e : Equiv A B we define: u := i V i (A, B, e) If we unfold the lgorithm for coercion in V-types we see tht We cn hence define coe 0 1 i (u i) = coe 0 1 i (V i (A, B, e)) = coe 0 1 i B (e ) u β := i coe i 1 i B (e ) This is simpler thn in cubicltt where the lgorithm for composition for Glue-types gives two trivil compositions Anders Mörtberg V-types June 6, 2018 34 / 40
V-types nd univlence The second proof of univlence is similr to the one in CCHM where we show tht unglue is n equivlence: A e V i (A, B, e) Vproj i B B Γ, (i = 0) Γ Anders Mörtberg V-types June 6, 2018 35 / 40
V-types nd univlence From this we cn directly prove tht given ny type A : U the type (B : U) Equiv A B is contrctible 5 Corollry (Univlence) For ny term t : (A B : U) Pth U A B Equiv A B the mp t A B is n equivlence for ll A nd B 5 I ws bit surprised tht this worked out so smoothly Anders Mörtberg V-types June 6, 2018 36 / 40
Higher inductive types We hve so fr only dded support for few hrdcoded HITs, but it should be possible to dd schem of them following Computtionl Higher Type Theory IV: Inductive Types (Cvllo, Hrper) The lgorithms for coe in HITs re very similr to those in CCHM: On Higher Inductive Types in Cubicl Type Theory (Coqund, Huber, M.) Anders Mörtberg HITs June 6, 2018 37 / 40
Conclusions We hve implemented simple experimentl proof ssistnt bsed on Crtesin cubicl type theory Some proofs re simpler compred to cubicltt, while some re bit hrder I m optimistic tht the V-types might be bit more efficient thn Glue-types for computing with univlence Anders Mörtberg Conclusions June 6, 2018 38 / 40
Open questions Cn we mke progress on computing Brunerie s number using ycctt? Cn we design super cubicl type theory with connections, reversls nd generlized Kn opertions? Anders Mörtberg Conclusions June 6, 2018 39 / 40
Thnk you for your ttention! https://github.com/mortberg/ycctt/ Anders Mörtberg June 6, 2018 40 / 40