Abstract 1 Introduction 2 Motivating examples 3 Decision problems 4 Results 5 Conclusion References

Complexity of Cubical Cofibration Logics I: coNP-Complete Examples

Robert Rose ORCID Dept. of Mathematics & Computer Science, Wesleyan University, Middletown, CT, USA Daniel R. Licata ORCID Dept. of Mathematics & Computer Science, Wesleyan University, Middletown, CT, USA
Abstract

We provide a comprehensive classification of the cofibration entailment problem, COFENT, for the cofibration logics of various cubical type theories in use today. The problem COFENT arose from the need of cubical proof assistants to automate reasoning about cubical complexes included in an n-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 COFENT are coNP-complete.

Keywords and phrases:
cubical sets, internal language, intuitionistic logic, dependent type theory, homotopy type theory, decision procedures
Funding:
Robert Rose: US Air Force Research Lab, FA-95502110009 and FA-95501510053
Daniel R. Licata: US Air Force Research Lab, FA-95502110009 and FA-95501510053
Copyright and License:
[Uncaptioned image] © Robert Rose and Daniel R. Licata; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Type theory
Funding:
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 Berg

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 f for which any map from a select subfunctor inclusion to f 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 (0,0,0),,(1,1,1). As a cubical set, it is modeled by a representable functor Hom(,X3). The object X is a formal element which corresponds to a single dimension. The identity morphism on X corresponds to a variable x1 along that dimension. Hence, the object X3 corresponds to three dimensions; and x1, x2 and x3 each correspond to a dimension in the given cube. Let us picture x1 as varying from left to right; x2 as varying bottom to top; and x3 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 (x1=0) describes just the left face, and (x1=1) describes just the right face. We can combine these using to get exactly the left and the right faces: (x1=0)(x1=1). The entire 2-dimensional boundary of the 3-cube is described by the formula

(x1=0)(x1=1)(x2=0)(x2=1)(x3=0)(x3=1) (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 (x2=1)(x3=0). The 1-dimensional boundary of the 3-cube is described by the formula

(x1=0)(x2=0)(x1=0)(x2=1)(x1=0)(x3=0)
(x1=0)(x3=1)(x1=1)(x2=0)(x1=1)(x2=1)
(x1=1)(x3=0)(x1=1)(x3=1)(x2=0)(x3=0)
(x2=0)(x3=1)(x2=1)(x3=0)(x2=1)(x3=1) (2)

(Recall that has higher precedence than .)

Let ϕ1 be the formula (1), and let ϕ2 be the formula (2). Here are two queries for a decision problem: does ϕ1 entail ϕ2? or does ϕ2 entail ϕ1? Geometric intuition tells us no and yes. The internal language of the topos of cubical sets will also tell us this.

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: x1x2 denotes the min of x1 and x2, while x1x2 denotes their max.

The 2-simplex below the diagonal from (0,0) to (1,1) of the solid square (2-cube) is described by (x1=x1x2) (or alternatively by (x2=x1x2)). 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, (x2=x2x3) 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:

(x1=x1x2)(x2=x2x3)

The pyramid whose apex is the corner point (0,0,0) and whose base is the right face of the 3-cube is described by (x1=x1x2x3). Thus, we have two more queries for a decision problem. Is this formula valid?

(x1=x1x2)(x2=x2x3)(x1=x1x2x3) (3)

Or this one?

(x1=x1x2x3)(x1=x1x2)(x2=x2x3) (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 coNP. For example, the translation of (3) to second-order logic is

R( χ3x(R(x)x1=x1x2)x(R(x)x2=x2x3)
x(R(x)x1=x1x2x3))

where χ3 is a formula encoding the constraint that ternary relations assigned to R have minimal and maximal elements. The entailment (3) holds if and only if the formula above is true in the model 𝒜=({0,1},0𝒜=0,1𝒜=1,𝒜=min,𝒜=max).

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 SAT-solver. Alternatively, the model-checking instance may be handed almost as-is (after some lightweight wrangling) to an SMT-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 A, we will denote a generic element of Am by aAm where a=(a1,,am). We will extend this notational convention to variables, parameters, and terms: x will denote an m-tuple of variables x=(x1,,xm); and likewise for α=(α1,,αm) and for s=(s1,,sm). Annotations or constructors may be “broadcast” over an m-tuple: for example, xψ abbreviates x1xmψ. The concatenation of a k-tuple a and an m-tuple b will be denoted by a;b. We will freely omit parentheses when they may be inferred.

3.1.1 Types and terms

We will define a term language T prior to the formula language in the conventional way. Fix a finite set F of morphisms in . The term types of the fragment are generated by the domains and codomains appearing in F. 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 fF, post-composition by projections πi, 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 S1××Sm, we fix a variable set {x1,,xm} where each xi 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 ΦiΩ. For convenience, we assume that formulas are given with domain in the form S1××Sm×Φ1××Φk. We fix a variable set {α1,α2,} where each αi is interpreted by the corresponding projection from Φi.

Definition 1.

Let T be a finitely presented term language. The corresponding language of formulas LT,S×Φ is inductively defined by:

LT,S×Φ
LT,S×Φ
αi LT,S×Φwhere 1ik
(f=g) LT,S×Φwhere f,g:SRT for some R
ϕ1ϕ2 LT,S×Φfor ϕ1,ϕ2LT,S×Φ
ϕ2ϕ2 LT,S×Φfor ϕ1,ϕ2LT,S×Φ
ϕ2ϕ2 LT,S×Φfor ϕ1,ϕ2LT,S×Φ
xm+1ψ LT,S×Φfor ψLT,S×Sm+1×Φ
xm+1ψ LT,S×Φfor ψLT,S×Sm+1×Φ

We define the language LT=S×ΦLT,S×Φ. For a given ϕLT denotes the set of subformulas of ϕ.

We will usually abbreviate LT,S×Φ to LS when T and Φ are inferable from context or are arbitrary. When the term type language is generated by a single type, we will index L by the length of S 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 C in a category 𝒞, t(C) will denote the sieve D𝒞Hom(D,C). 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 S. Let ϕ be a formula defined on S in the language of . Let X𝒞, and let sSX. The forcing relation is defined by

Xϕ(s)iffs{xϕ(x)}X

where

is a pullback square.

We will refer to the element sSX in Definition 2 as a local assignment. When we say “X forces ϕ with local assignment s” we mean that Xϕ(s).

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 L (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 sSX and a morphism f:YX, the restriction of s along f, denoted by sf, is defined as S(f)(s).

Theorem 3.

Let 𝒞 be a category, and let be the topos of presheaves on 𝒞. Let S=S1××Sm,Sm+1. Let Φ=Φ1××Φk with each ΦiΩ. Let ϕ1,ϕ2:S×ΦΩ and ψ:S×Sm+1×ΦΩ be formulas. Let X𝒞, let sSX, and let hΦX.

 Remark 4.

We may extend Theorem 3 to formulas in the language of the topos of the form α1αkϕ where ϕL and k is the maximal parameter index in ϕ:

Xα1αkϕ(s) iff for all Y𝒞,tHom(Y,X), and hΦ1××ΦkY,
Yϕ(st;h)
Corollary 5.

In the context of Theorem 3, the semantics of the universal quantifier when Sm+1=Hom𝒞(,U) for some U𝒞 and 𝒞 is Cartesian validates the following equivalence:

Xxm+1(ψ1ψ2)xm+1ψ1xm+1ψ2(x)

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 S=Hom(,U) for a selection of U𝒞. Elements of S would just be morphisms in 𝒞 from X to U. Thus, we may induce a formula language from a collection of morphisms from 𝒞.

Coincidentally, elements of SX=Hom(X,U) 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 𝒯σ,n be the term algebra of type σ over the variable set {x1,,xn}. We will abbreviate 𝒯σ,n to 𝒯n. For m0, the m-fold (left-associated) product algebra 𝒯n××𝒯n will be denoted by 𝒯nm. The term algebra 𝒯 is defined by 𝒯=n𝒯n.

For s𝒯m and t𝒯nm, the simultaneous substitution of the terms ti for variables xi in s will be denoted by s[t1/x1,,tm/xm], by s[t/x], or simply by st. 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 V(𝒜), 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 𝒯n to give a formal definition of a free algebra in V(𝒜) generated by variables x1,,xn. We will denote these algebras by 𝒜,n, or more briefly by n. Given terms r,s𝒯n, we say that r and s denote the same elements in n if and only if r𝒜=s𝒜 (i.e., their interpretation as term functions on 𝒜n are equal). Recall that this relation respects term substitution: for s𝒯m and t𝒯nm, s[t/x]𝒜=s𝒜t𝒜.

3.4.2 Finite product theories

From here, we may use the free algebras n 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 X, and its remaining objects are formal n-fold (left-associated) products of X for n0. The set of morphisms from Xn to Xm is simply the (left-associated) product algebra nm. Thus, morphisms are denoted by m-tuples of terms in n-variables, and two morphisms denoted by tuples of terms r and s are equal if and only if their interpretations as term functions on 𝒜n are equal. For n0, the identity morphism on Xn is (x1,,xn). 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 𝒞𝒜op satisfying sheaf conditions.

3.5 Cofibration formulas

From now on, we will assume that the formula language L 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 c 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 L: 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 f only to a constant.

Definition 6.

We define several fragments of L by inductive generation:

  • L𝑐𝑜𝑓 is generated by , , (f=g), , , and

  • L𝑐𝑜𝑓𝑡𝑐 is generated by , , (f=c), , , and

  • L𝑐𝑜𝑓𝑣𝑐 is generated by , , (xi=c), , , and

Each fragment above also has a variant – L𝑝𝑐𝑜𝑓, L𝑝𝑐𝑜𝑓𝑡𝑐, L𝑝𝑐𝑜𝑓𝑣𝑐 – whose generators also contain αi.

A formula in L𝑐𝑜𝑓 is called a cofibration formula. The variants L𝑐𝑜𝑓𝑡𝑐 and L𝑐𝑜𝑓𝑣𝑐 are called term-constant and variable-constant. The variants containing αi 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 {x1,x2,}, let 𝒞 be the finite-product theory induced by 𝒜, and let X be the generating object of 𝒞. The cofibration entailment problem for 𝒜 is the subset of L𝑐𝑜𝑓×L𝑐𝑜𝑓 defined by

COFENT={(ϕ1,ϕ2)mXmϕ1ϕ2(x)}

The parameterized cofibration entailment problem for 𝒜 and Φ is the subset of L𝑝𝑐𝑜𝑓×L𝑝𝑐𝑜𝑓 defined by

PCOFENT={(ϕ1,ϕ2)mXmα(ϕ1ϕ2)(x)}

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 COFENT. Is there a suitable notion of derivability such that COFENT={(ϕ1,ϕ2)ϕ1ϕ2}?

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,

(x1x2=0)(x1=0)(x2=0)

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 ϕ1ϕ2 take? The answer in logic traditionally has been a countermodel.

4 Results

To classify COFENT and related problems for various cube categories, we will first show uniformly that they are all coNP-hard by a reduction from the canonical coNP-hard problem UNSAT. Next we will show more-or-less on a case-by-case basis that they belong to coNP 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 UNSAT (ibid.); so these translations may also be viewed as indirect reductions to UNSAT.

4.1 Reduction from 𝐔𝐍𝐒𝐀𝐓

Proposition 8.

If σ0 has constants 0 and 1 denoting distinct elements of 𝒜, then the decision problem COFENTVC is coNP-hard.

Proof.

Let F be a formula of propositional logic in disjunctive normal form. Assume wlog that Var(F){x1,,xm}. Let FL𝑐𝑜𝑓,m be the formula induced by mapping positive literals xi to equations (xi=1) and negative literals to equations (xi=0). The edge cases: empty clauses are mapped to while empty formulas are mapped to . We claim that

FUNSATiffXmF(x)

First, we prove the case where F is a single clause C. Suppose that C is unsatisfiable. Then C contains literals xi and ¬xi for some i. So (xi=1),(xi=0)SF(F). Let s𝒯nm. Note that XnC(s) implies both si=0 and si=1, which is a contradiction. So XnC(s), as desired. Conversely, suppose that C is satisfiable. Let b{0,1}m be a satisfying assignment (whereby xibi). Note that for xiVar(C), bi=0 if and only if C contains ¬xi. Hence, for xiVar(C), bi=0 if and only if (xi=0)SF(C) and bi=1 if and only if (xi=1)SF(C). Therefore, X0C(b).

We finish with an induction on F. If F is the empty formula, then F is unsatisfiable while Xm(x). Now suppose F=F1F2. On the one hand, observe that F1F2 is unsatisfiable if and only if F1 and F2 are unsatisfiable. On the other hand, XmF1F2(x) if and only if XmF1(x) and XmF2(x). The conclusion follows by induction.

Corollary 9.

If σ0 has constants 0 and 1 denoting distinct elements of 𝒜, then any of the decision problems defined in Definition 7 is coNP-hard.

4.2 Reduction to SO

4.2.1 Translation of 𝑳𝒄𝒐𝒇 to second-order logic

Consider the equation (f=g)L. We would like to transform this equation into the sentence x(R(x)f(x)=g(x)). Informally, this sentence holds if the equation holds for all m-tuples satisfying R. Given ϕL𝑐𝑜𝑓, the purpose of the following transformation is to replace equations (f=g)SF(ϕ) 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 s𝒯nm will be denoted by s𝒜:𝒜n𝒜m.

Definition 10.

Let m,n0, and let ϕL𝑐𝑜𝑓,m. We define the second-order formula ϕn with a free second-order variable R of arity n as follows:

ϕn={ϕ=ϕ=x(R(x)f(x)=g(x))ϕ=(f=g)ϕ1,nϕ2,nϕ=ϕ1ϕ2ϕ1,nϕ2,nϕ=ϕ1ϕ2xm+1ψnϕ=xm+1ψ

When n=m, we will abbreviate ϕn to ϕ. Note that ϕ has no free first-order variables.

 Remark 11.

The transformation in Definition 10 admits a reduction of the universal quantifier:

𝒜xm+1ψm(M)iff𝒜ψm+1(M×𝒜)

4.2.2 First schema

As it turns out, if a formula in the fragment L𝑐𝑜𝑓 is forced by a given index with local assignment s, it is forced by any other index and local assignment provided it has the same term-functional image as s. 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 ϕL𝑐𝑜𝑓,m. Let s𝒯nm and let t𝒯pm. If img(s𝒜)=img(t𝒜) and Xnϕ(s), then Xpϕ(t).

Proof.

Induction on ϕ. The only interesting case is when ϕ=(f=g). Then it suffices to prove that if fs𝒜=gs𝒜, then ft𝒜=gt𝒜. Let a𝒜p. By assumption, there exists b𝒜n such that s𝒜(b)=t𝒜(a). But then

ft𝒜(a)=fs𝒜(b)=gs𝒜(b)=gt𝒜(a)

As a consequence, forcing of a cofibration formula ϕ with a local assignment s is reducible to checking that ϕ holds with respect to the term-functional image of s given an assignment to the second-order variable R.

Lemma 13.

Let m,n0, let ϕL𝑐𝑜𝑓,m, and let s𝒯nm. Let M=img(s𝒜). Then

Xnϕ(s)iff𝒜ϕ(M)
Proof.

Induction on ϕ. We omit the cases which follow directly by induction.

  • Suppose ϕ= or ϕ=. Immediate.

  • Suppose ϕ=(f=g). Fix a𝒜m, and suppose that aM. Let b𝒜n satisfy s𝒜(b)=a. By assumption, Xn(f=g)(s), and so fs𝒜=gs𝒜. Hence f𝒜(a)=fs𝒜(b)=gs𝒜(b)=g𝒜(a).

    For the converse, we need to show that fs𝒜=gs𝒜. Fix b𝒜n. Because s𝒜(b)M, fs𝒜(b)=gs𝒜(b) by assumption.

  • Suppose ϕ=xm+1ψ. Recall that Xnxm+1ψ(s) if and only if Xn+1ψ(s,xn+1); while the induction hypothesis is that

    Xn+1ψ(s,xn+1)iff𝒜ψm+1(M×𝒜)

    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 m,n0, and let ϕL𝑐𝑜𝑓,m be a conjunction of atomic formulas. Let s𝒯nm, and let M=img(s𝒜). Then

Xnϕ(s)ifffor all aM,𝒜ϕ(a)

To extend the translation (Definition 10) of formulas to entailment instances, we must reduce the quantification over all m-tuples of terms. Term image invariance allows us to reduce this to quantification over all term-functional images included by 𝒜m. Whence stems the decidability of the problem as well as its inefficiency. Notice that while belonging to a term-functional image of a given s𝒯m defines an m-ary relation over 𝒜, being a term-functional image defines a property of m-ary relations over 𝒜, one which we may try to capture by a second-order formula:

Definition 15.

Let m0. Let χm be a formula in the second-order language over the signature of 𝒜 whose only free variable is the second-order variable R with arity m. We say that χm characterizes images for 𝒜-term functions whenever the following conditions are equivalent for all M𝒜m:

  1. 1.

    𝒜χm(M)

  2. 2.

    there exist n0 and s𝒯nm such that M=img(s𝒜)

Indeed, a second-order characterization of term-functional images is all that is needed for this reduction schema.

Theorem 16.

Let m0, let ϕ1,ϕ2L𝑐𝑜𝑓,m. Let χm be a formula which characterizes images for 𝒜-term functions. Then

Xmϕ1ϕ2(x)iff𝒜R(χmϕ1ϕ2)
Proof.

Fix M𝒜m and a𝒜m. Suppose that 𝒜χm(M). Fix n0 and s𝒯nm according to Definition 15. Specializing the assumption, we have that Xnϕ1(s) implies Xnϕ2(s). Hence, by Lemma 13, we have that 𝒜ϕ1(M) implies 𝒜ϕ2(M).

For the converse, fix n0 and s𝒯nm. Let M=img(s𝒜). According to Definition 15, we have that 𝒜χm(M). And by assumption, 𝒜ϕ1(M) implies 𝒜ϕ2(M). So, by Lemma 13, Xnϕ1(s) implies Xnϕ2(s).

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 m0. A formula ρLγ,m is locally prime if ρ does not entail , and for all ϕ1,ϕ2Lγ,m, if ρ entails ϕ1ϕ2, then either ρ entails ϕ1 or ρ entails ϕ2. An algebra 𝒜 paired with a language fragment Lγ has local factorization if for all m and formulas ϕLγ,m, ϕ is equivalent to the disjunction (in Lγ,m) of locally prime formulas which entail ϕ.

We assume for the remainder of this section that (𝒜,Lγ) has local factorization.

Lemma 18.

Let m0, and let ϕ,ρLγ,m. Let M={a𝒜m𝒜ρ(a)}. Assume that for all terms f,g𝒯m,

Xmρ(f=g)(x)iff𝒜(f=g)(M)

If ρ is locally prime, then

Xmρϕ(x)iff𝒜ϕ(M)
Proof.

Induction on ϕ.

  • Suppose ϕ= or ϕ=. Trivial.

  • Suppose ϕ=(f=g). By assumption.

  • Suppose ϕ=ϕ1ϕ2. Directly by induction.

  • Suppose ϕ=ϕ1ϕ2. Suppose that Xmρϕ1ϕ2(x). Because ρ is -prime, either Xmρϕ1(x) or Xmρϕ2(x). The conclusion follows by induction. The converse also follows directly by induction.

  • Suppose ϕ=xm+1ψ. Recall that Xmρxm+1ψ(x) if and only if Xm+1ρψ(x); while the induction hypothesis is that

    Xn+1ρψ(x)iff𝒜ψm+1(M×𝒜)

    The conclusion follows by Remark 11.

Lemma 19.

Let m0, and let ϕ1,ϕ2Lγ,m. Let P be the set of locally prime formulas in Lγ,m. Then

Xmϕ1ϕ2(x)iff
for all ρP,Xmρϕ1(x) implies Xmρϕ2(x)
Proof.

The forward direction follows directly by the semantics. For the converse, let s𝒯nm and suppose that Xnϕ1(s). Let P={ρPXmρϕ1(x)}. From local factorization, we have

Xmϕ1ρPρ(x)

Fix ρP such that Xnρ(s). By definition of P and hypothesis, Xmρϕ2(x). In particular, Xmϕ2(s).

Definition 20.

Let m0. Let P be the set of locally prime formulas in Lγ,m. Let χm be a formula in the second-order language over the signature of 𝒜 whose only free variable is the second-order variable R with arity m. We say that χm defines P (the locally prime formulas in Lγ,m) when the following are equivalent for all M𝒜m:

  • 𝒜χm(M)

  • there exists ρP such that M={a𝒜m𝒜ρ(a)}

Theorem 21.

Let m0, and let ϕ1,ϕ2Lγ,m. Let P be the set of locally prime formulas in Lγ,m. Let the formula χm define P (Definition 20). If for all ρP, and for all terms f,g𝒯m,

Xmρ(f=g)(x)iff𝒜(f=g)(M)

then

Xmϕ1ϕ2(x)iff𝒜R(χmϕ1ϕ2)
Proof.

By Lemma 19, it suffices to show that

for all ρP,Xmρϕ1(x) implies Xmρϕ2(x)
iff𝒜R(χmϕ1ϕ2)

Let M𝒜m, and suppose that 𝒜χm(M) and 𝒜ϕ1(M). Then, by Lemma 18, there exists ρP such that Xmρϕ1(x); and by assumption, 𝒜ϕ2(M).

For the converse, suppose ρP, and that Xmρϕ1(x). Let M={a𝒜m𝒜ρ(a)}. Then 𝒜χm(M), and by Lemma 18, 𝒜ϕ1(M); and by assumption, Xmρϕ2(x).

4.3 Parameter elimination

In this section we will prove the following proposition, which will allow us to transport a classification of COFENT to PCOFENT:

Proposition 22.

There exist efficient mapping reductions from PCOFENT to COFENT, from PCOFENTTC to COFENTTC, and from PCOFENTVC to COFENTVC.

Proof.

Corollaries 24 and 29

For the remainder of this subsection, let BΩ be defined by BC={,t(C)} for all C𝒞. Let Φ be an arbitrary subobject satisfying the constraint BΦΩ.

4.3.1 Bivalent parameters

Lemma 23.

Let ϕL𝑝𝑐𝑜𝑓,m. Let k be the maximal parameter index of ϕ. Let n0, let sHom𝒞(Xn,Xm), and let hΦXn. Define bhBkXn by

bh,i={hihi=t(Xn)otherwise

Then Xnϕ(s;bh) if and only if Xnϕ(s;h).

Proof.

Induction on ϕ. When ϕ=αi, we have

Xnαi(s;bh) iffbh,i=t(Xn)
iffhi=t(Xn)
iffXnαi(s;h)

When ϕ is otherwise atomic, then Xnϕ(s;bh) if and only if Xnϕ(s); and likewise for Xnϕ(s;h). The induction cases are straightforward.

Corollary 24.

Let ϕ1,ϕ2L𝑝𝑐𝑜𝑓,m. Let k be the maximal parameter index of ϕ1ϕ2. Then

XmαΦ(ϕ1ϕ2)(x)iffXmαB(ϕ1ϕ2)(x)
Proof.

The forward direction is trivial. For the converse, fix n0, sHom𝒞(Xn,Xm), and hΦkXn. Our goal is to show that Xnϕ1ϕ2(s;h). Hence, fix p0 and tHom𝒞(Xp,Xn), and suppose that Xpϕ1(st;ft). We must show that Xpϕ2(st;ft). By Lemma 23, it suffices to check that Xpϕ2(st;bft); and by assumption, that Xpϕ1(st;bft); which follows again from Lemma 23.

4.3.2 Formula lifting

Next we introduce a piece of technical machinery to weaken a formula in Lm: 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 l,m0, and let ϕLm. We define liftl,m:LmLl+m by

liftl,m(ϕ)={ϕ=ϕ=(f=g)[xl+1/x1,,xl+m/xm]ϕ=(f=g)αiϕ=αiliftl,m(ϕ1)liftl,m(ϕ2)ϕ=ϕ1ϕ2liftl,m(ϕ1)liftl,m(ϕ2)ϕ=ϕ1ϕ2liftl,m(ϕ1)liftl,m(ϕ2)ϕ=ϕ1ϕ2xl+m+1liftl,m+1(ψ)ϕ=xm+1ψxl+m+1liftl,m+1(ψ)ϕ=xm+1ψ
Proposition 26.

Let k,l,m0. Let ϕLm with maximal index k. Let Φ=Φ1××Φk, where ΦiΩ for all i. Let R=R1××Rl and let S=S1××Sm. Let X𝒞, let hΦX, let rRX, and let sSX. Then Xϕ(s;h) if and only if Xlift(ϕ)(r;s;h).

4.3.3 Grounding

In Lemmas 27, 28, and 29 below, given k0, let ϵL2kk be the k-tuple of equations defined so that ϵi=(xi=xk+i).

Lemma 27.

Let ϕL𝑝𝑐𝑜𝑓,m. Let k be the maximal parameter index of ϕ. Let n,p0, let sHom𝒞(Xn,Xm), and let tHom𝒞(Xp,Xk+n). Define btBkXp by

bt,i={t(Xp)ti=1otherwise

The following are equivalent:

  • Xpϕ(s(tk+1,,tk+n);bt)

  • Xplift(ϕ)[ϵ/α](t1,,tk;1,,1;s(tk+1,,tk+n))

Proof.

Induction on ϕ. When ϕ=αi, we have

Xpαi(s(tk+1,,tk+n);bt)
iff bt,i=t(Xn)
iff ti=1
iff Xp(xi=xk+i)(t1,,tk;1,,1;s(tk+1,,tk+n))

When ϕ is otherwise atomic, then

Xpϕ(s(tk+1,,tk+n);bt)iffXpϕ(s(tk+1,,tk+n))

This holds, by Proposition 26, if and only if

Xplift(ϕ)[ϵ/α](t1,,tk;1,,1;s(tk+1,,tk+n))

The induction cases are straightforward.

Lemma 28.

Let ϕL𝑝𝑐𝑜𝑓,m. Let k be the maximal parameter index of ϕ. Let n0, let sHom𝒞(Xn,Xm), and let bBkXn. Define abBkXn by

ab,i={1bi=t(Xn)0otherwise

Then

Xnϕ(s;b)iffXnlift(ϕ)[ϵ/α](ab;1,,1;s)
Proof.

Induction on ϕ. When ϕ=αi, we have

Xnαi(s;b) iffbi=t(Xn)
iffab,i=1
iffXn(xi=xk+i)(ab;1,,1;s)

When ϕ is otherwise atomic, then Xnϕ(s;b) if and only if Xnϕ(s); which holds, by Proposition 26, if and only if Xnlift(ϕ)[ϵ/α](ab;1,,1;s). The induction cases are straightforward.

Corollary 29.

Let ϕ1,ϕ2L𝑝𝑐𝑜𝑓,m. Let k be the maximal parameter index of ϕ1ϕ2. The following are equivalent:

  • XmαB(ϕ1ϕ2)(x)

  • Xk+mlift(ϕ1ϕ2)[ϵ/α](x1,,xk;1,,1;xk+1,,xk+m)

Proof.

Fix n0 and sHom𝒞(Xn,Xk+m), and suppose that

Xnlift(ϕ1)[ϵ/α](s1,,sk;1,,1;sk+1,,sk+m)

By Lemma 27 and by assumption, Xnϕ2(sk+1,,sk+m;bt). And again by Lemma 27,

Xnlift(ϕ2)[ϵ/α](s1,,sk;1,,1;sk+1,,sk+m)

For the converse, fix n0, sHom𝒞(Xn,Xm), and bBkXn. Our goal is to check that Xnϕ1ϕ2(s;b). So fix p0 and tHom𝒞(Xp,Xn), and suppose that Xpϕ1(st;bt). By Lemma 28 and by assumption,

Xplift(ϕ2)[ϵ/α](abt;1,,1;st)

So by Lemma 28, Xpϕ2(st;bt).

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 Lγ, it suffices to supply a formula χ (Definition 20) which defines the locally prime formulas of Lγ.

For either schema, if the prenex normal form of χ contains no universal second-order quantifiers, and it is efficiently computable from m, then the sentence checked in Theorem 16 is in SO; and by Fagin’s theorem, the corresponding model-checking problem is in coNP (cf. [4, Section 9.2]). This is the case for all of the following applications.

Below, will denote the standard ordering on the set {0,1}, as well as this ordering extended component-wise to {0,1}n. We will denote the minimal and maximal elements of the poset {0,1}n also by 0 and 1.

4.4.1 Bipointed sets

For a theory of bipointed sets, the signature will be σ0={0,1}. We take the generating algebra 𝒜 to be {0,1} with the constants interpreted as 0𝒜=0 and 1𝒜=1. When needed, we will annotate constructions associated to this algebra with bp.

We apply the first schema. The following second order formula encodes each term function si𝒜:𝒜m𝒜 as a second-order variable Tm+1: the first conjunct ensures that T encodes either a projection or a constant, and the second conjunct ensures that R is indeed the image of functions encoded by the Ti.

Definition 30.

Let m0. Define χm (for bp terms) to be the formula

T1m+1Tmm+1 (i(jyx(Ti(y;x)x=yj)
yx(Ti(y;x)x=0)
yx(Ti(y;x)x=1))
x(R(x)y(iTi(y;xi))))
 Remark 31.

Let s𝒯nm be an m-tuple of bipointed-set terms. There exist indices i1<i2<<im in {1,,n} and s𝒯mm such that s=s[xi1/x1,,xim/xm]. In particular, for all n0 and s𝒯nm, there exists s𝒯mm such that img(s𝒜)=img(s𝒜).

Proposition 32.

Let m0. The formula χm in Definition 30 characterizes images of bp term functions.

Corollary 33.

The decision problem PCOFENT𝑏𝑝 is coNP-complete.

4.4.2 Distributive lattices

For the theory of bounded distributive lattices, the signature will be σ0={0,1} and σ2={,}. We take the generating algebra 𝒜 to be {0,1} with the constants interpreted as 0𝒜=0 and 1𝒜=1, and with the basic operations defined as 𝒜=min and 𝒜=max. When needed, we will annotate constructions associated to this algebra with dl.

Lemma 34.
{s𝒜:𝒜n𝒜s𝒯n}{f:𝒜n𝒜f is monotone }
Proof.

Let s𝒯n. That s𝒜 is monotone follows from the fact that the constant functions, the projections, min and max are all monotone.

Conversely, let f be a monotone function. There are many ways to define s𝒯n so that s𝒜=f, and here is one way. Define s by

s=f(a)=1ak=1xk

Suppose f(a)=1. Since (ak=1xk)𝒜(a)=1, s𝒜(a)=1. Conversely, suppose that s𝒜(a)=1. Then there exists a such that f(a)=1 and (ak=1xk)𝒜(a)=1. Hence, aa. But f is monotone, so f(a)=1.

Lemma 35.

Let B𝒜m. Then B contains min(B) and max(B) if and only if there exist n0 and s𝒯nm such that img(s𝒜)=B.

Proof.

Let {b1,,bn} be an enumeration of B. Define the monotone function f:𝒜n𝒜m by

f(a)={min(B)a=0bjak=1 iff j=kmax(B)otherwise

By Lemma 34, there exists an m-tuple of terms s𝒯nm such that s𝒜=f.

For the converse, observe that min(img(s𝒜))=s𝒜(0) and max(img(s𝒜))=s𝒜(1).

Definition 36.

Let m0. Define χm (for dl terms) to be the formula

x(R(x)y(R(y)i(xi=xiyi)))
x(R(x)y(R(y)i(yi=xiyi)))
Proposition 37.

Let m0. The formula χm in Definition 36 characterizes images for dl term functions.

Corollary 38.

The decision problem PCOFENT𝑑𝑙 is coNP-complete.

4.4.3 Variable-constant fragments

We will now apply the second schema to show that irrespective of the choice of algebra 𝒜, PCOFENTVC belongs to coNP.

Lemma 39.

Let m0. On the one hand, if 𝒜{c𝒜}, then xm+1(xm+1=c) is valid; and if not, xm+1(xm+1=c) is equivalent to . On the other hand, for (xi=c)L𝑐𝑜𝑓,m, xm+1(xi=c) is equivalent to (xi=c).

 Remark 40.

Let m0, and let ϕL𝑐𝑜𝑓𝑣𝑐,m. 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 ϕL𝑐𝑜𝑓𝑣𝑐,m. Then

Xmϕ(xj=c)(x)iff𝒜x(ϕxj=c)
Proof.

Induction on ϕ (in disjunctive form).

  • Suppose ϕ= or ϕ=. Immediate.

  • Suppose that ϕ=iI(xi=ci) where I{1,,m}.

    • Suppose that jI and cj=c. Immediate.

    • Suppose that jI and cj=c. Suppose that XmiI(xi=ci)(xj=c)(x). In particular, Xm(xj=c)(s) when

      sk={ckIxkotherwise

      Therefore, 𝒜={c𝒜}, and the conclusion follows trivially. The converse is analogous.

    • Suppose that jI and cjc. But XmiI(xi=ci)(xj=c)(x) because X0(xj=cj)(cj) while X0(xj=c)(cj). And likewise, 𝒜iI(xi=ci)(xj=c)(cj).

  • Suppose ϕ=ϕ1ϕ2. Directly by induction.

Proposition 42.

Let m0, and let S1,S2ΩXm. Let E be the sieve denoted by the equation (xi=c)L𝑐𝑜𝑓𝑣𝑐,m: that is,

E={s:XnXmn0,si=c}ΩXm

If ES1S2, then either ES1 or ES2.

Proof.

Observe that E is principal: i.e., every morphism in E factors through

s=(x1,,xi1,c,xi+1,,xm)

So if sS1 (sS2), then ES1 (ES2).

Corollary 43.

Equations in L𝑐𝑜𝑓𝑣𝑐 are locally prime.

Lemma 44.

Let m0. A formula ρL𝑐𝑜𝑓𝑣𝑐,m is locally prime if and only it is equivalent to a formula of the form

ρ=iI(xi=ci)where c1,,cmσ0

for some non-empty I{1,,m}.

Definition 45.

Let m0. Define χm (for variable-constant fragments) to be the formula

C1Cm (ij(Ci(cj)(xi=cj))
ijj<k(Ci(cj)Ci(ck))
(i,j¬Ci(cj)))

where c1,,c|σ0| is an enumeration of σ0.

Proposition 46.

Let m0. The formula χm in Definition 45 defines the locally prime formulas in L𝑐𝑜𝑓𝑣𝑐.

Corollary 47.

If σ0 has constants 0 and 1 denoting distinct elements of 𝒜, the decision problem PCOFENTVC is coNP-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 L𝑐𝑜𝑓𝑡𝑐, 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 COFENT to the variable-constant variant.

The signature of De Morgan algebras will be σ0={0,1}, σ1={¬}, and σ2={,}. We take the generating algebra 𝒜 to be {0,1}2 with the constants interpreted as 0𝒜=(0,0) and 1𝒜=(1,1), and with the basic binary operations defined as 𝒜=min and 𝒜=max. The operation of De Morgan negation on {0,1}2 is

x¬𝒜(x)(0,0)(1,1)(1,0)(1,0)(0,1)(0,1)(1,1)(0,0)

Note that while Boolean negation swaps (0,1) and (1,0) as well as (0,0) and (1,1), De Morgan negation fixes (0,1) and (1,0), and swaps just (0,0) and (1,1). When needed, we will annotate constructions associated to this algebra with dm.

The following definition is adapted from [3]:

Definition 48.

Let m0, and let ϕL𝑐𝑜𝑓𝑡𝑐,m.

ϕ+ ={ϕ= or (c=c) with ccϕ= or (c=c)(f=1)ϕ=(f=0)(xi=1)ϕ=(xi=1)(f=1)ϕ=(¬f=1)(f1=1)+(f2=1)+ϕ=(f1f2=1)(f1=1)+(f2=1)+ϕ=(f1f2=1)ϕ1+ϕ2+ϕ=ϕ1ϕ2ϕ1+ϕ2+ϕ=ϕ1ϕ2xm+1ψ+ϕ=xm+1ψ
ϕ ={(f=1)+ϕ=(f=0)(xi=0)ϕ=(xi=1)(f=1)+ϕ=(¬f=1)(f1=1)(f2=1)ϕ=(f1f2=1)(f1=1)(f2=1)ϕ=(f1f2=1)
Proposition 49.

Let m0, and let ϕL𝑐𝑜𝑓𝑡𝑐,m. The formula ϕ+L𝑐𝑜𝑓𝑣𝑐,m is equivalent to ϕ and is proportional in length.

Corollary 50.

The decision problem PCOFENTTC𝑑𝑚 is coNP-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 COFENT, 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 PSPACE-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.