Complexity of Cubical Cofibration Logics I: -Complete Examples
Abstract
We provide a comprehensive classification of the cofibration entailment problem, , for the cofibration logics of various cubical type theories in use today. The problem arose from the need of cubical proof assistants to automate reasoning about cubical complexes included in an -dimensional hypercube. Intuitively, it asks: given logical descriptions of two such complexes, is one a subcomplex of the other? We show that the common variants of are -complete.
Keywords and phrases:
cubical sets, internal language, intuitionistic logic, dependent type theory, homotopy type theory, decision proceduresFunding:
Robert Rose: US Air Force Research Lab, FA-95502110009 and FA-95501510053Copyright and License:
2012 ACM Subject Classification:
Theory of computation Type theoryFunding:
This material is based upon work supported by the Air Force Office of Scientific Research under Grant No.FA9550-21-0009 (Tristan Nguyen, program manager). Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author and do not necessarily reflect the views of the Air Force Office of Scientific Research.Editors:
Rasmus Ejlers Møgelberg and Benno van den BergSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
A well-known tool in topos theory for reasoning about a given topos is its Mitchell-Bénabou language [5] (or simply, its “language”), a formal abstraction of the topos as a typed (i.e., multi-sorted) first-order intuitionistic language with a fixed interpretation in that topos. Because the syntax of the Mitchell-Bénabou language is defined directly from the topos (e.g., the types of the logic are just the objects of the topos), this interpretation is nearly trivial: terms denote morphisms and are represented by syntax for certain categorical operations which produce morphisms, such as pairing or post-composition with a given morphism; formulas are, idiosyncratically, terms whose type is the subobject classifier of the topos (or a subobject thereof).
Proving or disproving that a topos has a given property expressed in the Mitchell-Bénabou language is greatly facilitated by the Kripke-Joyal semantics (or “sheaf semantics”, for a topos of sheaves), which provides a rigorous translation of arguments in this language to ordinary classical mathematics. The semantics has the familiar form of a Tarskian truth definition. (However, because the interpretation is fixed, the forcing relation is defined a priori in terms of this definition, and the semantics is presented as a theorem.)
This semantics affords a convenient point of departure for investigating the computability and complexity theoretic properties of formal first-order reasoning in a topos. Specifically, this area gives rise to generalizations of the model-checking problem. It is a rich area which has received relatively little attention.
1.1 Language fragments for cubical homotopy theory
One application of Mitchell-Bénabou language is to the homotopy theory of cubical sets, where by cubical set we mean a contravariant functor on a particular indexing category (a “cube category”). The topos is the category of cubical sets which are sheaves for a given Grothendieck topology on . In this paper, this topology is trivial: the toposes are presheaf toposes.
The language of a topos of cubical sets is expressive enough to define important homotopical structure: notably, to specify which morphisms of cubical sets qualify as maps of spaces (i.e., “fibrations”) and which maps of spaces further qualify as equivalences (i.e., “trivial fibrations”). This is usually achieved first by selecting a collection of subfunctors of representable functors (e.g., in the case of simplicial homotopy theory, a standard choice is the “horn inclusions”) and hence by taking a fibration to be a morphism for which any map from a select subfunctor inclusion to affords an extension to the base representable. Trivial fibrations have this extension property with respect to a larger selection of such subfunctors. These collections of subfunctors form the bases for generating classes of morphisms called, respectively, “trivial cofibrations” and “cofibrations”. Extension of maps along trivial cofibrations is the fundamental operation provided by homotopical structure.
While these extension properties are readily expressible in the language of the topos, a more restricted usage of the language may suffice in certain frameworks (e.g., homotopy type theory). For example, the language of the topos may be used just for the purposes of specifying cofibrations into representables and expressing their inclusion relation. Since cofibrations are classified by , the inclusion relation is naturally expressed by entailment in the language. The sacrifice in expressivity brings significant computational benefits. In Section 3, we will define a number of such language fragments.
1.2 Applications for cubical type theory
Our interest in decision problems arising from the language of a topos indeed began with a practical need. A key component of a proof assistant we were designing would automatically decide formula entailment in a fragment of the language of a topos: namely, presheaves on the finite-product theory of distributive lattices, an important definitional variant of the category of cubical sets. Analogous decision procedures are core components in existing implementations of cubical type theories. For example, entailment in a fragment of the language of the topos of presheaves on the finite-product theory of De Morgan algebras is decided in the proof assistant Agda’s cubical mode, which is an implementation of the cubical type theory presented in [3]. Entailment in a fragment of the language of the topos of presheaves on the finite-product theory of bipointed sets is decided in the proof assistant cooltt, which is an implementation of the cubical type theory presented in [1]. Our original motivation began with investigating the feasibility of implementing the directed cubical type theory presented in [7], which is an adaptation of the directed simplicial type theory presented in [6].
2 Motivating examples
For the sake of intuition, we present some instances and non-instances of the decision problems of interest before launching into the technical development.
2.1 Cube boundary inclusion
Consider a 3-dimensional cube, with 8 corner points . As a cubical set, it is modeled by a representable functor . The object is a formal element which corresponds to a single dimension. The identity morphism on corresponds to a variable along that dimension. Hence, the object corresponds to three dimensions; and , and each correspond to a dimension in the given cube. Let us picture as varying from left to right; as varying bottom to top; and as varying from front to back.
By means of equations involving these variables and end points 0 and 1, we can describe certain parts of this cube. For example, the equation describes just the left face, and describes just the right face. We can combine these using to get exactly the left and the right faces: . The entire 2-dimensional boundary of the 3-cube is described by the formula
| (1) |
We can also describe the 1-dimensional edges of the 3-cube by combining formulas describing faces using . For example, the top-front edge is described by the formula . The 1-dimensional boundary of the 3-cube is described by the formula
| (2) |
(Recall that has higher precedence than .)
2.2 Simplex and pyramid
The last pair of problems are common to all of the cubical type theories mentioned in Section 1.2. We now present an example which, among the three, can be expressed only in the language fragment used in [7].
We just saw how to combine equations using and to describe parts of a cube. It is also possible to combine variables directly to describe the minimum of two variables or the maximum of two variables. The notation is the same: denotes the min of and , while denotes their max.
The 2-simplex below the diagonal from to of the solid square (2-cube) is described by (or alternatively by ). The same formula can be used to describe part of the 3-cube: it is the wedge containing the right face and the bottom face. Similarly, describes the wedge formed between the 2-simplices above the diagonal on the left and right faces. Combining the two wedges with yields a 3-simplex:
The pyramid whose apex is the corner point and whose base is the right face of the 3-cube is described by . Thus, we have two more queries for a decision problem. Is this formula valid?
| (3) |
Or this one?
| (4) |
2.3 Example reduction
In what follows, we will show that the instances (2) (1), (1) (2), (3), and (4) may be decided by an efficient translation into second-order logic, where the problem of checking the truth of the corresponding formula in a suitable model is in the complexity class . For example, the translation of (3) to second-order logic is
where is a formula encoding the constraint that ternary relations assigned to have minimal and maximal elements. The entailment (3) holds if and only if the formula above is true in the model .
The translation alone provides the core of a practical decision procedure. What remains is boilerplate and optimizations. The model-checking instance above may in turn be efficiently encoded in propositional logic and checked with a state-of-the-art -solver. Alternatively, the model-checking instance may be handed almost as-is (after some lightweight wrangling) to an -solver like z3 or to an answer-set programming system like clingo.
3 Decision problems
Because terms in the language of a topos are built directly from its morphisms, this language is not in general recursively enumerable, and is often a proper class. Thus, it may not be that the entire language of a topos can be encoded as a countable set of strings over a finite alphabet. In computability and complexity theory, however, decision problems are ordinarily framed as such. For example, in a sheaf topos, any set at all induces a sheaf, and hence a type in the language. But for the purposes of defining a conventional decision problem, we can reasonably expect to encode no more than a countable number of types.
Furthermore, because terms in the language of a topos are formal combinations of morphisms, morphism equality is reducible to term equality: in particular, if morphism equality is undecidable, so is term equality. In contrast, equality of instances of a conventional decision problem is efficiently reducible to equality of strings over a finite alphabet.
Hence, one straightforward strategy is simply to limit one’s focus to a suitable fragment of the language of the topos, and to define our decision problems relative to this fragment. To this end, we will next consider fragments which are “finitely presented” by formula languages.
3.1 Formula languages
Given a set , we will denote a generic element of by where . We will extend this notational convention to variables, parameters, and terms: will denote an -tuple of variables ; and likewise for and for . Annotations or constructors may be “broadcast” over an -tuple: for example, abbreviates . The concatenation of a -tuple and an -tuple will be denoted by . We will freely omit parentheses when they may be inferred.
3.1.1 Types and terms
We will define a term language prior to the formula language in the conventional way. Fix a finite set of morphisms in . The term types of the fragment are generated by the domains and codomains appearing in . The terms of the formula language will be the fragment of the language of the topos generated by the identity morphisms on term types under the term-forming operations corresponding to post-composition by morphisms , post-composition by projections , and pairing [5, Section VI.5]. Thus, terms can be viewed as composable chains of tuples of morphisms, generated from a finite set of morphisms and projections. For any given domain type , we fix a variable set where each is interpreted by the corresponding projection. We will refer to such a term language as finitely presented. Equality of terms (“syntactic equality”) is clearly efficient to decide.
3.1.2 Parameterized first-order formulas
We consider formulas with parameters, or metavariables. From the point of view of the language of the topos, parameters are just variables defined on a subobject of . In addition to term types, the definition of the fragment includes a finite collection of subobjects . For convenience, we assume that formulas are given with domain in the form . We fix a variable set where each is interpreted by the corresponding projection from .
Definition 1.
Let be a finitely presented term language. The corresponding language of formulas is inductively defined by:
We define the language . For a given denotes the set of subformulas of .
We will usually abbreviate to when and are inferable from context or are arbitrary. When the term type language is generated by a single type, we will index by the length of instead.
3.2 Semantics
Our focus in this paper is on the problem of deciding when a formula in the language of the topos holds when interpreted “locally”. One way to make this concept precise is in terms of a forcing relation, which is the basis the sheaf semantics.
3.2.1 Forcing relation
For an object in a category , will denote the sieve . We first recall the definition of forcing in toposes of sheaves from [5, Section VI.7]:
Definition 2.
Let be a topos of sheaves with indexing category , and let . Let be a formula defined on in the language of . Let , and let . The forcing relation is defined by
where
is a pullback square.
We will refer to the element in Definition 2 as a local assignment. When we say “ forces with local assignment ” we mean that .
The forcing relation models a form of “truth definition”, which is attributed to Kripke and Joyal, and which we also call the sheaf semantics. Furthermore, the truth definition may be usefully refined in light of specific features of the topos of sheaves in question.
3.2.2 Presheaf semantics
Next we present the presheaf semantics for a language fragment (Definition 1). The following theorem is adapted from [5, Theorem VI.7.1]. It will be our main tool for proving the correctness of mapping reductions. We recall that for an element and a morphism , the restriction of along , denoted by , is defined as .
Theorem 3.
Let be a category, and let be the topos of presheaves on . Let . Let with each . Let and be formulas. Let , let , and let .
Remark 4.
We may extend Theorem 3 to formulas in the language of the topos of the form where and is the maximal parameter index in :
Corollary 5.
In the context of Theorem 3, the semantics of the universal quantifier when for some and is Cartesian validates the following equivalence:
3.3 Languages of representable types
One natural way to obtain a finitely presented formula language is to restrict attention to sheaves of the form for a selection of . Elements of would just be morphisms in from to . Thus, we may induce a formula language from a collection of morphisms from .
Coincidentally, elements of then have a compositional structure analogous to that induced by a formal term system. Below, this coincidence will be taken further: the indexing category will be presented as a quotiented term language, and the term language defining will take the place of the term language used to define the formula language. Conveniently, restrictions will then be computed by term substitution.
3.4 Indexing category from a finite algebra
The indexing categories for cubical sets – “cube categories” – are readily and usefully definable as quotients of formal term languages.
Beyond encodability, another requirement for bringing a decision problem under the purview of complexity theory is that it be decidable. But an indexing category may fail to have decidable equality of morphisms; and so even validity of the atomic formulas of the language may fail to be decidable. The following method of construction however ensures that the morphisms of at least have decidable equality.111We are grateful to Alex Kruckman for directing our attention to the central role played by finite algebras in this area. See also [2].
3.4.1 Generation by a finite algebra
Fix a finite algebraic signature . Let be the term algebra of type over the variable set . We will abbreviate to . For , the -fold (left-associated) product algebra will be denoted by . The term algebra is defined by .
For and , the simultaneous substitution of the terms for variables in will be denoted by , by , or simply by . Let be a finite -algebra. The equational theory of contains the universally quantified equations of terms satisfied by . The variety of this theory, denoted by , contains the -algebras which satisfy this theory (i.e., its models). Examples of varieties generated by a finite algebra include Boolean algebras, De Morgan algebras, (bounded) distributive lattices, (bounded) meet (join) semi-lattices, bi-pointed sets, pointed sets, and sets. All save Boolean algebras and sets have been used in the construction of indexing categories of cubical sets. Bounded distributive lattices have also been used to construct the indexing category in a variant definition of simplicial sets.
We may use the term algebra to give a formal definition of a free algebra in generated by variables . We will denote these algebras by , or more briefly by . Given terms , we say that and denote the same elements in if and only if (i.e., their interpretation as term functions on are equal). Recall that this relation respects term substitution: for and , .
3.4.2 Finite product theories
From here, we may use the free algebras to give a formal definition of an indexing category . We will denote these categories by , or more briefly by . The object set of contains a formal object , and its remaining objects are formal -fold (left-associated) products of for . The set of morphisms from to is simply the (left-associated) product algebra . Thus, morphisms are denoted by -tuples of terms in -variables, and two morphisms denoted by tuples of terms and are equal if and only if their interpretations as term functions on are equal. For , the identity morphism on is . Composition of morphisms is given by composition of denoted term functions; which factors through the substitution of the representing tuples of terms.
The category is an example of a finite-product theory (or Lawvere theory). A well-known alternative view of this construction is as the category opposite to a chosen skeleton of the category of free algebras on a finite number of generators and homomorphisms. Note however that the language of a topos is interpreted by contravariant functors on . This usage is different than the usage for which the concept of a finite-product theory was developed by Lawvere: the categorification of universal algebra. Models of this finite-product theory would be product-preserving functors on , not arbitrary functors on satisfying sheaf conditions.
3.5 Cofibration formulas
From now on, we will assume that the formula language is defined over a term algebra corresponding to a finite algebra which induces the indexing category , and that the term translation is the natural one. The letter will denote a generic constant term in the signature of .
Standard cofibration formulas (i.e., those used in cubical type theories) constitute only a small fragment of : specifically, the entailment connective and existential quantifier do not appear in cofibration formulas. Another restriction which appears concerns allowable atomic equations: in some cubical type theories, an equation may compare a given non-constant term only to a constant.
Definition 6.
We define several fragments of by inductive generation:
-
is generated by , , , , , and
-
is generated by , , , , , and
-
is generated by , , , , , and
Each fragment above also has a variant – , , – whose generators also contain .
A formula in is called a cofibration formula. The variants and are called term-constant and variable-constant. The variants containing are called parameterized. Although the focus of our study is on these fragments, it is natural to investigate related decision problems for the full language. In several cases, the methods we use below do apply more generally. In the future, the provisional definition above of what is a cofibration formula may merit revisiting.
3.6 Entailment problems
We are at last in position to define the decision problems we aim to classify in this paper.
Definition 7.
Let be a finite algebra with signature . Let be the term algebra of type over variable set , let be the finite-product theory induced by , and let be the generating object of . The cofibration entailment problem for is the subset of defined by
The parameterized cofibration entailment problem for and is the subset of defined by
Lastly, for algebras with at least one constant, we denote the term-constant and variable-constant variants of each problem with the suffixes TC and VC.
3.7 Problem characterization in terms of derivability
Given the proof-theoretic character of many presentations of cubical type theories, it is reasonable to wonder if there is an alternative, logical characterization of . Is there a suitable notion of derivability such that ?
For this discussion, let us consider the cube category corresponding to the theory of bounded distributive lattices. We know that the language of a topos can be viewed as an intuitionistic first-order logic. A natural first pass is intuitionistic derivability from this theory. This notion of derivability is sound with respect to the Kripke-Joyal semantics. Unsurprisingly, it is not complete. For example,
is valid in the language of the topos; but a corresponding derivation does not exist (not even classically: consider the smallest congruence on the free distributive lattice on two generators which identifies the meet of the generators and 0). Another example is Corollary 5, which is certainly not derivable. The notion of derivability above, it seems, would need to be significantly augmented with axioms to accommodate the structural peculiarities of categories of cubical sets as well as semantic properties specific to the choice of generating algebra and of language fragment.
However, even given a complete axiomatization, we do not expect a notion of derivability to yield an efficient-enough decision procedure to prove our main results. In practice, where this approach has been made to work, it remains the case that the smallest-known derivability proofs may be exponential in the length of the given instance. So instead, we ask, what form might a “short witness” of take? The answer in logic traditionally has been a countermodel.
4 Results
To classify and related problems for various cube categories, we will first show uniformly that they are all -hard by a reduction from the canonical -hard problem . Next we will show more-or-less on a case-by-case basis that they belong to via efficient translations to the fragment of second-order logic SO. Here we rely on Fagin’s theorem, the foundational result in descriptive complexity theory (cf. [4, Section 9.2]). Note that the Cook-Levin theorem is an easy corollary of Fagin’s theorem, and its typical proof contains an efficient translation to (ibid.); so these translations may also be viewed as indirect reductions to .
4.1 Reduction from
Proposition 8.
If has constants 0 and 1 denoting distinct elements of , then the decision problem is -hard.
Proof.
Let be a formula of propositional logic in disjunctive normal form. Assume wlog that . Let be the formula induced by mapping positive literals to equations and negative literals to equations . The edge cases: empty clauses are mapped to while empty formulas are mapped to . We claim that
First, we prove the case where is a single clause . Suppose that is unsatisfiable. Then contains literals and for some . So . Let . Note that implies both and , which is a contradiction. So , as desired. Conversely, suppose that is satisfiable. Let be a satisfying assignment (whereby ). Note that for , if and only if contains . Hence, for , if and only if and if and only if . Therefore, .
We finish with an induction on . If is the empty formula, then is unsatisfiable while . Now suppose . On the one hand, observe that is unsatisfiable if and only if and are unsatisfiable. On the other hand, if and only if and . The conclusion follows by induction.
Corollary 9.
If has constants 0 and 1 denoting distinct elements of , then any of the decision problems defined in Definition 7 is -hard.
4.2 Reduction to SO
4.2.1 Translation of to second-order logic
Consider the equation . We would like to transform this equation into the sentence . Informally, this sentence holds if the equation holds for all -tuples satisfying . Given , the purpose of the following transformation is to replace equations with such formulas.
Below, denotes the conventional formula satisfaction relation from mathematical logic for second-order logic ([4, Section 7.1]). The term function interpreting a tuple of terms will be denoted by .
Definition 10.
Let , and let . We define the second-order formula with a free second-order variable of arity as follows:
When , we will abbreviate to . Note that has no free first-order variables.
Remark 11.
The transformation in Definition 10 admits a reduction of the universal quantifier:
4.2.2 First schema
As it turns out, if a formula in the fragment is forced by a given index with local assignment , it is forced by any other index and local assignment provided it has the same term-functional image as . We now present a reduction schema which takes advantage of this fact to obtain a bound on the number of tuples of terms which must be considered to force an entailment.
Lemma 12 (Term image invariance).
Let . Let and let . If and , then .
Proof.
Induction on . The only interesting case is when . Then it suffices to prove that if , then . Let . By assumption, there exists such that . But then
As a consequence, forcing of a cofibration formula with a local assignment is reducible to checking that holds with respect to the term-functional image of given an assignment to the second-order variable .
Lemma 13.
Let , let , and let . Let . Then
Proof.
Induction on . We omit the cases which follow directly by induction.
-
Suppose or . Immediate.
-
Suppose . Fix , and suppose that . Let satisfy . By assumption, , and so . Hence .
For the converse, we need to show that . Fix . Because , by assumption.
-
Suppose . Recall that if and only if ; while the induction hypothesis is that
The conclusion follows by Remark 11.
In the event that the cofibration is a conjunction of atomic formulas, we can dispense with the translation (Definition 10) altogether:
Corollary 14.
Let , and let be a conjunction of atomic formulas. Let , and let . Then
To extend the translation (Definition 10) of formulas to entailment instances, we must reduce the quantification over all -tuples of terms. Term image invariance allows us to reduce this to quantification over all term-functional images included by . Whence stems the decidability of the problem as well as its inefficiency. Notice that while belonging to a term-functional image of a given defines an -ary relation over , being a term-functional image defines a property of -ary relations over , one which we may try to capture by a second-order formula:
Definition 15.
Let . Let be a formula in the second-order language over the signature of whose only free variable is the second-order variable with arity . We say that characterizes images for -term functions whenever the following conditions are equivalent for all :
-
1.
-
2.
there exist and such that
Indeed, a second-order characterization of term-functional images is all that is needed for this reduction schema.
Theorem 16.
Let , let . Let be a formula which characterizes images for -term functions. Then
Proof.
Fix and . Suppose that . Fix and according to Definition 15. Specializing the assumption, we have that implies . Hence, by Lemma 13, we have that implies .
For the converse, fix and . Let . According to Definition 15, we have that . And by assumption, implies . So, by Lemma 13, implies .
4.2.3 Second schema
We will now present a reduction schema which applies to generating algebras with language fragments which have the property of local factorization (Definition 17). To abstract over the choice of language fragment, we let the variable denote a generic element of .
Definition 17.
Let . A formula is locally prime if does not entail , and for all , if entails , then either entails or entails . An algebra paired with a language fragment has local factorization if for all and formulas , is equivalent to the disjunction (in ) of locally prime formulas which entail .
We assume for the remainder of this section that has local factorization.
Lemma 18.
Let , and let . Let . Assume that for all terms ,
If is locally prime, then
Proof.
Induction on .
-
Suppose or . Trivial.
-
Suppose . By assumption.
-
Suppose . Directly by induction.
-
Suppose . Suppose that . Because is -prime, either or . The conclusion follows by induction. The converse also follows directly by induction.
-
Suppose . Recall that if and only if ; while the induction hypothesis is that
The conclusion follows by Remark 11.
Lemma 19.
Let , and let . Let be the set of locally prime formulas in . Then
Proof.
The forward direction follows directly by the semantics. For the converse, let and suppose that . Let . From local factorization, we have
Fix such that . By definition of and hypothesis, . In particular, .
Definition 20.
Let . Let be the set of locally prime formulas in . Let be a formula in the second-order language over the signature of whose only free variable is the second-order variable with arity . We say that defines (the locally prime formulas in ) when the following are equivalent for all :
-
-
there exists such that
Theorem 21.
Let , and let . Let be the set of locally prime formulas in . Let the formula define (Definition 20). If for all , and for all terms ,
then
Proof.
By Lemma 19, it suffices to show that
Let , and suppose that and . Then, by Lemma 18, there exists such that ; and by assumption, .
For the converse, suppose , and that . Let . Then , and by Lemma 18, ; and by assumption, .
4.3 Parameter elimination
In this section we will prove the following proposition, which will allow us to transport a classification of to :
Proposition 22.
There exist efficient mapping reductions from to , from to , and from to .
Proof.
Corollaries 24 and 29
For the remainder of this subsection, let be defined by for all . Let be an arbitrary subobject satisfying the constraint .
4.3.1 Bivalent parameters
Lemma 23.
Let . Let be the maximal parameter index of . Let , let , and let . Define by
Then if and only if .
Proof.
Induction on . When , we have
When is otherwise atomic, then if and only if ; and likewise for . The induction cases are straightforward.
Corollary 24.
Let . Let be the maximal parameter index of . Then
Proof.
4.3.2 Formula lifting
Next we introduce a piece of technical machinery to weaken a formula in : that is, add to the list of available free variables, irrespective of their non-occurrence. Because variables are bound in order of decreasing index, dummy free variables should be inserted before existing variables.
Definition 25.
Let , and let . We define by
Proposition 26.
Let . Let with maximal index . Let , where for all . Let and let . Let , let , let , and let . Then if and only if .
4.3.3 Grounding
Lemma 27.
Let . Let be the maximal parameter index of . Let , let , and let . Define by
The following are equivalent:
Proof.
Induction on . When , we have
When is otherwise atomic, then
This holds, by Proposition 26, if and only if
The induction cases are straightforward.
Lemma 28.
Let . Let be the maximal parameter index of . Let , let , and let . Define by
Then
Proof.
Induction on . When , we have
When is otherwise atomic, then if and only if ; which holds, by Proposition 26, if and only if . The induction cases are straightforward.
Corollary 29.
Let . Let be the maximal parameter index of . The following are equivalent:
Proof.
4.4 Applications
To apply the first reduction schema to a concrete algebra , it suffices to supply a formula (Definition 15) characterizing local images for . To apply the second reduction schema to a concrete algebra and language , it suffices to supply a formula (Definition 20) which defines the locally prime formulas of .
For either schema, if the prenex normal form of contains no universal second-order quantifiers, and it is efficiently computable from , then the sentence checked in Theorem 16 is in SO; and by Fagin’s theorem, the corresponding model-checking problem is in (cf. [4, Section 9.2]). This is the case for all of the following applications.
Below, will denote the standard ordering on the set , as well as this ordering extended component-wise to . We will denote the minimal and maximal elements of the poset also by 0 and 1.
4.4.1 Bipointed sets
For a theory of bipointed sets, the signature will be . We take the generating algebra to be with the constants interpreted as and . When needed, we will annotate constructions associated to this algebra with .
We apply the first schema. The following second order formula encodes each term function as a second-order variable : the first conjunct ensures that encodes either a projection or a constant, and the second conjunct ensures that is indeed the image of functions encoded by the .
Definition 30.
Let . Define (for terms) to be the formula
Remark 31.
Let be an -tuple of bipointed-set terms. There exist indices in and such that . In particular, for all and , there exists such that .
Proposition 32.
Let . The formula in Definition 30 characterizes images of term functions.
Corollary 33.
The decision problem is -complete.
4.4.2 Distributive lattices
For the theory of bounded distributive lattices, the signature will be and . We take the generating algebra to be with the constants interpreted as and , and with the basic operations defined as and . When needed, we will annotate constructions associated to this algebra with .
Lemma 34.
Proof.
Let . That is monotone follows from the fact that the constant functions, the projections, and are all monotone.
Conversely, let be a monotone function. There are many ways to define so that , and here is one way. Define by
Suppose . Since , . Conversely, suppose that . Then there exists such that and . Hence, . But is monotone, so .
Lemma 35.
Let . Then contains and if and only if there exist and such that .
Proof.
Let be an enumeration of . Define the monotone function by
By Lemma 34, there exists an -tuple of terms such that .
For the converse, observe that and .
Definition 36.
Let . Define (for terms) to be the formula
Proposition 37.
Let . The formula in Definition 36 characterizes images for term functions.
Corollary 38.
The decision problem is -complete.
4.4.3 Variable-constant fragments
We will now apply the second schema to show that irrespective of the choice of algebra , belongs to .
Lemma 39.
Let . On the one hand, if , then is valid; and if not, is equivalent to . On the other hand, for , is equivalent to .
Remark 40.
Let , and let . By Corollaries 5 and 39, we may assume wlog that is, up to equivalence, either , , or a disjunction of conjunctions of equations.
Proposition 41.
Let . Then
Proof.
Induction on (in disjunctive form).
-
Suppose or . Immediate.
-
Suppose that where .
-
–
Suppose that and . Immediate.
-
–
Suppose that and . Suppose that . In particular, when
Therefore, , and the conclusion follows trivially. The converse is analogous.
-
–
Suppose that and . But because while . And likewise, .
-
–
-
Suppose . Directly by induction.
Proposition 42.
Let , and let . Let be the sieve denoted by the equation : that is,
If , then either or .
Proof.
Observe that is principal: i.e., every morphism in factors through
So if (), then ().
Corollary 43.
Equations in are locally prime.
Lemma 44.
Let . A formula is locally prime if and only it is equivalent to a formula of the form
for some non-empty .
Definition 45.
Let . Define (for variable-constant fragments) to be the formula
where is an enumeration of .
Proposition 46.
Let . The formula in Definition 45 defines the locally prime formulas in .
Corollary 47.
If has constants 0 and 1 denoting distinct elements of , the decision problem is -complete.
Proof.
By Propositions 8, 41, 46, and 21.
4.4.4 De Morgan algebras
Lastly, we turn to the theory of De Morgan algebras and the term-constant fragment , which provide the cofibration layer of the cubical type theory in [3]. The strategy below is adapted from [3]: it amounts to reducing the term-constant variant of to the variable-constant variant.
The signature of De Morgan algebras will be , , and . We take the generating algebra to be with the constants interpreted as and , and with the basic binary operations defined as and . The operation of De Morgan negation on is
Note that while Boolean negation swaps and as well as and , De Morgan negation fixes and , and swaps just and . When needed, we will annotate constructions associated to this algebra with .
The following definition is adapted from [3]:
Definition 48.
Let , and let .
Proposition 49.
Let , and let . The formula is equivalent to and is proportional in length.
Corollary 50.
The decision problem is -complete.
5 Conclusion
In this paper, we have assembled a capable framework for studying the computational character of key fragments of the internal languages of cubical sets. We have also put it to use and obtained theoretical results with practical importance: not only have we determined the complexity of variants of , we have reasonable decision procedures. That said, this framework is capable of more:
-
We plan to extend our results to simplicial sets. The cofibration language in [6] corresponds not to all presheaves on the cube category, but to sheaves for a specific Grothendieck topology which defines a topos equivalent to simplicial sets. Preliminary work indicates that our results, summarized above, on presheaves on cubical categories will extend to simplicial sets via this equivalence. This would provide the means to automate the cofibration language layer of a directed type theory based on simplicial sets. It would also provide the means to automate the dependently-typed internal language of simplicial sets.
-
We plan to extend our results to full first-order cofibration languages. For certain finite algebras , either or both schemas will apply: for the first schema, it needs to be shown that term-invariance holds for the more expressive fragment; and for the second schema, that the more expressive fragment has local factorization. Deciding validity in this context will give rise to fresh examples of -complete problems.
-
Finally, we conjecture that there are finite algebras for which the corresponding forcing relation (in presheaves) is undecidable. Our expectation is that counter-examples will help to explain the efficacy of the key properties already discovered: image invariance and local factorization.
References
- [1] Carlo Angiuli, Guillaume Brunerie, Thierry Coquand, Robert Harper, Kuen-Bang Hou (Favonia), and Daniel R. Licata. Syntax and models of cartesian cubical type theory. Mathematical Structures in Computer Science, 31(4):424–468, 2021. doi:10.1017/S0960129521000347.
- [2] Ulrik Buchholtz and Edward Morehouse. Varieties of cubical sets. Lecture Notes in Computer Science, pages 77–92, 2017. doi:10.1007/978-3-319-57418-9_5.
- [3] Cyril Cohen, Thierry Coquand, Simon Huber, and Anders Mörtberg. Cubical type theory: a constructive interpretation of the univalence axiom, 2016. arXiv:1611.02108.
- [4] Leonid Libkin. Elements of Finite Model Theory. Springer Publishing Company, Incorporated, 1st edition, 2010.
- [5] Saunders Mac Lane and Ieke Moerdijk. Sheaves in Geometry and Logic: A First Introduction to Topos Theory. Springer New York, New York, NY, 1994.
- [6] Emily Riehl and Michael Shulman. A type theory for synthetic -categories, 2017. arXiv:1705.07442.
- [7] Matthew Z. Weaver and Daniel R. Licata. A constructive model of directed univalence in bicubical sets. In Proceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ’20, pages 915–928, New York, NY, USA, 2020. Association for Computing Machinery. doi:10.1145/3373718.3394794.
