jcreed blog > Semisimplicial Types

Semisimplicial Types

The following is allegedly a definition of semisimplicial types in type theory, specifically in Agda. Since this is supposed to be an open problem, and the definition I have below is fairly simple, I expect it's probably wrong in some way. Perhaps understanding why it's mistaken is a good puzzle.

The code described here, plus examples and further lemmas, is in this github repo.

First we have the standard Agda module header.

{-# OPTIONS --without-K #-}
module SemiSimplicialType where
We define equality in the usual way.
data _≡_ {} {A : Set } : (a b : A)  Set  where refl : {a : A}  a  a
We define the square of a type; Sq A is just A × A.
record Sq (A : Set) : Set where constructor ⟨_,_⟩ ; field fst snd : A
open Sq
We define a notion of $n$-dimensional cubes in a type $C$. A value of Cube C is a value of type $C^{2^n}$ for some $n$.
data Cube : (C : Set)  Set1 where
 leaf : {C : Set}  C  Cube C
 node : {C : Set}  Cube (Sq C)  Cube C
We can depict these as tables. Here's an example 3-dimensional cube, assuming $c_0, \ldots, c_7$ are some values in $C$:
$\chi \quad=$$c_0$$c_1$$c_4$$c_5$
$c_2$$c_3$$c_6$$c_7$
This would be represented in Agda syntax as
node (node (node (leaf ⟨ ⟨ ⟨ c0 ,  c1 ⟩ , ⟨ c2 , c3 ⟩ ⟩ ,
                         ⟨ ⟨ c4 ,  c5 ⟩ , ⟨ c6 , c7 ⟩ ⟩ ⟩)))
We define a map combinator on Cube which hits every leaf with a given function.
cmap : {C D : Set}  (f : C  D)  Cube C  Cube D
cmap f (leaf x) = leaf (f x)
cmap f (node c) = node (cmap  ( x , y )   f x , f y ) c)
Next we define a "subcube" relation between a pair of Cubes that says that the former arises from the latter by maybe deleting some dimensions, and leaving only the data that's closer to the "upper-left" corner of the cube.
data _≤_ : {C : Set}  Cube C  Cube C  Set1 where
  ε : {C : Set} {c : C}  leaf c  leaf c
  Y_ : {C : Set} {χ χ' : Cube (Sq C)}  χ  χ'  node χ  node χ'
  N_ : {C : Set} {χ χ' : Cube (Sq C)}  χ  χ'  cmap fst χ  node χ'
So for example, the subcubes of $\chi$ above consist of the 0-dimensional cube that contains only $c_0$, the three 1-dimensional cubes $(c_0\ c_1)$, $(c_0\ c_2)$, and $(c_0\ c_4)$, the three 2-dimensional cubes
$c_0$$c_1$,$c_0$$c_2$,$c_0$$c_1$
$c_2$$c_3$$c_4$$c_6$$c_4$$c_5$
and finally $\chi$ itself.

Next we define a function that helps us get the "upper-left-most" cell and "lower-right-most" cell in a cube.

pole : {C : Set}  ({C : Set}  Sq C  C)  Cube C  C
pole f (leaf c) = c
pole f (node s) = f (pole f s)
We call the "upper-left-most" cell the "nadir" and "lower-right-most" cell the "apex".
nadir = λ {C : Set}  pole {C} fst
apex = λ {C : Set}  pole {C} snd
We can now define the (large) type of semisimplicial types.
record SemiSimplicialType : Set1 where
  constructor sst
  field
    C : Set
     : C
     : (c : C)  Cube C
    apex-axiom : (c : C)  apex ( c)  c
    nadir-axiom : (c : C)  nadir ( c)  
    reduce-axiom : (c : C) {χ : Cube C}  χ   c   (apex χ)  χ
We require: