Abstract 1 Introduction 2 Ultrarings 3 Annular Theories and Models 4 Computation 5 Discussion and Perspectives References Appendix A Appendix

Unifying Boolean and Algebraic Descriptive Complexity

Baptiste Chanus ORCID Université Sorbonne Paris Nord, LIPN, CNRS, Villetaneuse, France Damiano Mazza ORCID CNRS, LIPN, Université Sorbonne Paris Nord, Villetaneuse, France Morgan Rogers ORCID Université Sorbonne Paris Nord, LIPN, CNRS, Villetaneuse, France
Abstract

We introduce ultrarings, which simultaneously generalize commutative rings and Boolean lextensive categories. As such, they allow to blend together standard algebraic notions (from commutative algebra) and logical notions (from categorical logic), providing a unifying descriptive framework in which complexity classes over arbitrary rings (as in the Blum, Schub, Smale model) and usual, Boolean complexity classes may be captured in a uniform way.

Keywords and phrases:
Descriptive complexity theory, Categorical logic, Blum-Shub-Smale complexity
Copyright and License:
[Uncaptioned image] © Baptiste Chanus, Damiano Mazza, and Morgan Rogers; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Complexity theory and logic
; Theory of computation Complexity classes ; Theory of computation Finite Model Theory
Editors:
Maribel Fernández

1 Introduction

Descriptive complexity measures the difficulty of computational problems in terms of the expressiveness that a logical language needs to describe them, rather than in terms of the power that a machine needs to solve them. Initiated in the 1970s with Fagin’s theorem [14], which provides a characterization of the class 𝖭𝖯, it has since been extended to capture virtually every other so-called “syntactic” complexity class [17].

Computational problems are usually defined as sets of finite objects (graphs, numbers, programs…) encoded as binary strings. Descriptive complexity regards such objects as totally ordered finite structures of a first-order language 𝔖. A formula φ over an extension 𝔗 of 𝔖 plays the role of a machine, accepting a finite structure s of 𝔖 if s is a model of φ. The more expressive 𝔗 is, the more powerful the corresponding machine. Notice that 𝔗 is typically not a first-order extension: for example, 𝖭𝖯 corresponds to allowing second-order existential quantifiers [14], and 𝖯 corresponds to allowing fixpoint operators [16].

Computability and complexity may be meaningfully extended beyond finite objects. An interesting, well-known example is Blum, Shub and Smale’s (BSS) model of computation over the real numbers [5]. Rather than having a tape whose cells contain either 0 or 1, BSS machines have a “tape” whose cells contain arbitrary real numbers. Usual Boolean operations are replaced by field operations, and testing the order relation plays the role of a conditional. Problems become sets of finite sequences of real numbers, and complexity may be developed in the usual way, including a definition of 𝖯, 𝖭𝖯 and complete problems.

Grädel and Meer [15] showed how the descriptive approach may be applied to the BSS model. The idea is to introduce a kind of hybrid finite structure, part logical and part algebraic. The algebraic part takes care of the data manipulated by the machine (real numbers and field operations), the logical part describes the discrete steps of the BSS machine, allowing the transfer of Fagin’s [14] and Immerman’s [16] logical characterizations of 𝖯 and 𝖭𝖯 to the BSS setting.

We provide a framework in which descriptive complexity may be uniformly formulated over Booleans and over real numbers (or other commutative rings) using a single logico-algebraic language. This language arises from a combination of categorical logic and commutative algebra, taking the form of ultrarings, a new algebraic object whose introduction is the main contribution of this paper.

To understand ultrarings, one may start from categorical logic. This is a vast subject [21, 18, 19], so we concentrate on what is relevant for our purposes. Define a Boolean lextensive category to be a category with finite limits and finite pullback-stable disjoint coproducts in which every subobject has a complement. A primordial example is 𝐅𝐢𝐧, the category of finite sets. Call a functor preserving finite limits and finite coproducts logical. Categorical logic gives us a correspondence between Boolean lextensive categories and classical finite-limit theories (or cartesian theories in Johnstone’s terminology [19]). These are theories of first-order classical logic whose axioms are closed formulas of the form x1xn.φ with φ quantifier-free.111Actually, φ may contain provably unique existentials, but this is irrelevant at the present level of detail. The correspondence is as follows:

  • from a classical finite-limit theory 𝔗 one can construct a small Boolean lextensive category Syn(𝔗), the syntactic category of 𝔗;

  • each small Boolean lextensive category induces a classical finite-limit theory Lang() such that Syn(Lang()) is equivalent to ;

  • one may define models of 𝔗 in any Boolean lextensive category 𝒦, and models of 𝔗 in 𝒦 correspond to logical functors Syn(𝔗)𝒦.

In the last point, taking 𝒦=𝐅𝐢𝐧 yields finite models in the usual sense, which suggests a categorical approach to descriptive complexity. In fact, there is a classical finite-limit theory 𝔖𝔱𝔯 such that its finite models, modulo isomorphism, are exactly binary strings. Moreover, an extension 𝔗 of 𝔖𝔱𝔯 induces a logical functor Syn(𝔖𝔱𝔯)Syn(𝔗) (intuitively, an injection), so if we have a binary string seen as a functor s:Syn(𝔖𝔱𝔯)𝐅𝐢𝐧, we may ask whether it factors through Syn(𝔗), which is to say whether s may be extended to a model of 𝔗. This means that extensions of 𝔖𝔱𝔯 express computational problems (i.e., subsets of {0,1}). The results of §4.2 capture the classes 𝖯 and 𝖭𝖯 as certain forms of extensions.

The above framework only expresses Boolean computation. However, the fact that classical finite-limit theories may be regarded as presentations for their Boolean lextensive syntactic categories is analogous to the presentation of a ring by a set X equipped with a set S of integer polynomials with variables in X. The analogy is as follows:

  • each presentation (X,S) induces a commutative ring [X]/S;

  • each commutative ring R admits a presentation (XR,SR) such that [XR]/SRR;

  • given a commutative ring k, a solution in k of the system {p=0}pS is the same thing as a ring homomorphism [X]/Sk.

Notice how finding a model of a theory whose set of (closed) axioms is S may be seen as “solving the system” {¬φ=0}φS, where 0 is false, so the last point still fits the analogy.

Ultrarings turn the above analogy into two instances of a common construction. That is, ultrarings simultaneously generalize Boolean lextensive categories and commutative rings, and we have a notion of annular theory of which classical finite-limit theories and ring presentations are special cases. An annular theory is given by (possibly empty) sets of sorts, generators over the sorts, and equations. The latter are formulated using polynomials, which are a generalization of first-order formulas. Commutative rings are special “sortless” ultrarings: in case the are no sorts, a polynomial is exactly a polynomial in the usual algebraic sense. So ultrarings generalize commutative rings by adding sorts, and they generalize first-order logic by allowing ring operations on truth values.

Technically, an ultraring is a certain kind of small category (Definition 3), and the categories of commutative rings and of small Boolean lextensive categories are full subcategories of the category of ultrarings: to see a commutative ring R as an ultraring, we take the category of free R-modules of finite rank; to see a Boolean lextensive category as an ultraring, we take the Kleisli category of the partiality monad over (see §2.2).

In particular, there is an ultraring corresponding to the field of real numbers and an ultraring 𝔽1 corresponding to the category of finite sets (𝔽1 is in fact the initial ultraring). Let 𝕂 be either or 𝔽1. We will show that there is an annular theory 𝔖𝔱𝔯 and an associated ultraring 𝕂[𝔖𝔱𝔯] such that, modulo isomorphism, a morphism 𝕂[𝔖𝔱𝔯]𝕂 is a finite sequence of real numbers if 𝕂=, or a binary string if 𝕂=𝔽1. The former is a typical input of a BSS machine over , the latter of a Turing machine. This gives a first idea of how both algebraic and Boolean data may be treated uniformly.

Computability and complexity may be expressed in ultrarings by means of algebras: given an ultraring , an -algebra is (roughly) an ultraring 𝒜 together with a morphism 𝒜. A 𝕂[𝔖𝔱𝔯]-algebra 𝒜 expresses a computational problem Γ𝕂(𝒜) as follows: a string 𝕂[𝔖𝔱𝔯]𝕂 is in Γ𝕂(𝒜) iff it factors through 𝒜. Our main result (Theorem 22) identifies classes of 𝕂[𝔖𝔱𝔯]-algebras whose associated problems yield the standard classes 𝖱𝖤 (recursively-enumerable), 𝖭𝖯 and 𝖯 defined either in terms of BSS machines over or in terms of Turing machines, depending on how 𝕂 is instantiated.

In logical terms, a 𝕂[𝔖𝔱𝔯]-algebra 𝒜 may be presented by an extension 𝔗 of the theory 𝔖𝔱𝔯, and xΓ𝕂(𝒜) is equivalent to the fact that x, seen as a model of 𝔖𝔱𝔯 in 𝕂, may be extended to a model of 𝔗. This highlights a shift with respect to descriptive complexity: rather than changing logical language for each complexity class, we fix one language (in the Boolean case, what categorical logicians would call “finite-limit logic”) and express complexity by means of logical extensions of 𝔖𝔱𝔯 in this same language.

The rest of the paper introduces ultrarings (§2), how they may be presented by annular theories in the above sense (§3), and how they may be used to uniformly formulate complexity classes over both Booleans and real numbers (§4). We conclude with some perspectives (§5).

2 Ultrarings

2.1 Main Definitions

In what follows, we often abbreviate composition of arrows fg by fg. If (𝒞,,I,γ) is a symmetric monoidal category, where γ is its symmetry, we denote by β:III the canonical isomorphism. By “symmetric monoidal functor” we will always mean strong symmetric monoidal functor (i.e., tensor and unit are preserved up to iso).

A Frobenius sesquimonoid in a symmetric monoidal category is an object A equipped with arrows δ:AAA, ε:AI, δ:AAA such that (A,δ,ε) is a commutative comonoid, δ is commutative (δγA,A=δ), associative (δ(idδ)=δ(δid), left inverse to δ (δδ=idA) and verifies the Frobenius law (idAδ)(δidA)=δδ=(δidA)(idAδ).

Initial objects will be denoted by 0. Recall that a (binary) coproduct diagram over an object A is a pair of arrows ι1:A1A, ι2:A2A, called injections, such that, for every f1:A1B, f2:A2B there is a unique arrow [f1,f2]:AB such that [f1,f2]ιi=fi. In that case, we write A=A1A2.

A distributive monoidal category is a symmetric monoidal category with finite coproducts such that, for all objects A,B,C, A0 is initial and the arrow χA,B,C:=[idAι1,idAι2]:(AB)(AC)A(BC) is an isomorphism.

Recall that an initial object which is also terminal is called a zero object and that any category with a zero object has, for any pair of objects A,B, a zero morphism 0A,B:AB obtained by composing the terminal and initial arrows A0B. Also, for any pair of objects A1,A2, the category has coinjections222We refer to these as coinjections rather than projections to avoid the reader assuming that the coproducts are also products. defined by:

ι1 :=[idA1,0A2,A1]:A1A2A1, ι2 :=[0A1,A2,idA2]:A1A2A2.

It immediately follows that these verify

ιiιj={idAiif i=j0Aj,Aiif ij. (1)
Definition 1.

A δ-category is a distributive monoidal category (𝒞,,I,γ) with a zero object such that each object A is equipped with a Frobenius sesquimonoid structure δA,εA,δA satisfying, for every objects A,B,A1,A2,

δAB =(idAγA,BidB)(δAδB) εAB =β(εAεB) δI =β1,
δAB =(δAδB)(idAγA,BidB) εI =idI δI =β,
δA1A2(ιiιj) ={ιiδAiif i=j0AiAj,A1A2if ij δA1A2ιi =(ιiιi)δAi εA1A2ιi =εAi,

and such that, for all f,g:AB, δB(fid)=δB(gid) implies f=g.

A morphism F:𝒞𝒟 of δ-categories is a finite-coproduct-preserving symmetric monoidal functor with structural isomorphisms φA,B:FAFBF(AB) and ψ:IFI such that, for each object A of 𝒞, FδA=φA,AδFA, FδA=δFAφA,A1 and FεA=ψεFA.

In the sequel, subscripts such as those in idA,δA,εA will be dropped when unambiguously retrievable from the context.

Lemma 2.

In a δ-category, coinjections are jointly monic.

Proof.

See §A.1.

By the above lemma, for every arrows f1:BA1, f2:BA2 of a δ-category, there is at most one arrow f1,f2:BA1A2, which we call pairing, such that ιif1,f2=fi. Some pairings automatically exist. For instance, by (1), ι1:A1A1A2 is the pairing idA1,0A1,A2 and dually for ι2. The pairing 0B,A1,0B,A2 is simply 0B,A1A2. More subtly, the inverse χA,B1,B21 of the distributivity isomorphism is the pairing idAι1,idAι2, which can be deduced using the fact that injections into a coproduct are jointly epic.

Definition 3.

An ultraring is a small δ-category such that:

  1. 1.

    disjoint pairings: for every f:CA and g:CB, if (fg)δ=0 then their pairing f,g exists;

  2. 2.

    complements: for every p:AI such that (pp)δ=p, there exist a unique p¯:AI such that (pp¯)δ=0 and p,p¯=ε, where :III is the codiagonal.

A morphism of ultrarings is just a morphism of δ-categories. We denote by 𝐔𝐑𝐢𝐧𝐠 the strict 2-category whose objects are ultrarings, whose arrows are morphisms between them and whose 2-cells are monoidal natural transformations.

2.2 Examples of Ultrarings

Let R be a commutative ring. We denote by 𝒰R the category of free R-modules of finite rank, and linear maps between them. This may be equivalently described as the category whose objects are natural numbers and whose arrows nm are m×n matrices (m rows, n columns) with coefficients in R, and where composition is matrix multiplication.

This category is distributive monoidal: the (strict) monoidal structure is given by multiplication of natural numbers for objects and by the standard tensor product of matrices (also known as Kronecker product) for morphisms. Coproduct is addition and 0 is easily seen to be a zero object. The Frobenius sesquimonoid structure is as follows: δn is the n2×n matrix whose i-th column has the element 1 at position n(i1)+i and is zero everywhere else; εn is the row matrix (11); and δn is the transpose of δn.

Under matrix addition, 𝒰R is actually an additive category, which means it has biproducts, so point (1) of Definition 3 is immediate. For what concerns point (2), any p:n1 is a row matrix (p1pn), and the condition (pp)δ=p amounts to pi2=pi for all i. It is then a matter of elementary calculations to show that p¯:=(1p11pn) is the unique morphism n1 verifying (pp¯)δ=0 and p,p¯=ε. So 𝒰R is an ultraring.

A ring homomorphism h:RS induces a morphism of ultrarings 𝒰h:𝒰R𝒰S by applying h pointwise to matrices. It is well known (see for instance [7]) that every symmetric monoidal, finite-coproduct-preserving functor 𝒰R𝒰S is monoidally isomorphic to a functor of the form 𝒰h for some h:RS. Therefore, if we consider the category of commutative rings 𝐂𝐑𝐢𝐧𝐠 to be a 2-category in which every hom-category is discrete, this defines a 2-functor 𝒰:𝐂𝐑𝐢𝐧𝐠𝐔𝐑𝐢𝐧𝐠, and we have:

Proposition 4.

𝒰:𝐂𝐑𝐢𝐧𝐠𝐔𝐑𝐢𝐧𝐠 is fully faithful.

Let 𝐅𝐢𝐧 be the category of finite sets and partial functions. Observe that the cartesian product induces a symmetric monoidal structure on 𝐅𝐢𝐧 (which is not a categorical product), whose unit is the singleton set {}, and that 𝐅𝐢𝐧 is obviously distributive (coproducts are disjoint unions) and has a zero object (the empty set). A Frobenius sesquimonoid structure may be defined by letting δA:AA×A be the diagonal, εA:A{} be the unique total function and δA:A×AA be the function which is defined on (a,a) exactly when a=a.

We invite the reader to check that, if f:CA and g:CB are partial functions, the condition (fg)δ=0 amounts to the domains of f and g being disjoint. In that case, the pairing f,g:CAB is the evident partial function whose domain is the union of the domains of f and g. Furthermore, observe that any partial function p:A{} satisfies (pp)δ=p, and corresponds to a subset PA. The partial function p¯:A{} corresponding to the complement of P is easily seen to be the unique one verifying the desired properties of point (2) of Definition 3.

The above shows that 𝐅𝐢𝐧 has the structure of an ultraring, except that it is not small. This is easily fixed: let 𝔽1 be the category whose objects are natural numbers and whose arrows nm are partial functions {1,,n}{1,,m}, or equivalently, m×n matrices with coefficients in {0,1} such that 1 appears at most once in each column. As a skeleton of 𝐅𝐢𝐧, 𝔽1 is an ultraring. In fact, it is the initial ultraring: since 𝔽1 is generated under finite coproducts by the monoidal unit 1 and its identity arrow, any finite-coproduct-preserving functor F:𝔽1 with an ultraring is determined by the image of 1; since morphisms of ultrarings are monoidal, F1I and 𝐔𝐑𝐢𝐧𝐠(𝔽1,) is equivalent to the terminal category.

Observe that 𝐅𝐢𝐧 is the Kleisli category of the partiality monad +{} over the category 𝐅𝐢𝐧 of finite sets and total functions. This is a special case of a more general situation. A category is lextensive if it has finite limits and disjoint, pullback-stable finite coproducts. A lextensive category is called Boolean if every subobject has a complement; see [8]. A primordial example is 𝐅𝐢𝐧. In fact, for what concerns finite limits and finite coproducts, the objects of Boolean lextensive categories may be thought of as sets and their arrows as total functions. In particular, if is a Boolean lextensive category whose terminal object is 1, the endofunctor +1 is a monad and the Kleisli category may again be seen as a category of “sets and partial functions”. The Kleisli categories of the partiality monad on small Boolean lextensive categories may be characterized as certain ultrarings, which we introduce below.

Definition 5.

An ultraring is Boolean if every arrow f satisfies δf=(ff)δ and if for every p:AI there exists a unique coproduct diagram (ιp,ι¯p) over A such that p=ειp, ι¯p=ιp¯ and, for every arrow f, ιεf=(idε)ιεδ(fid).

In the following, we denote by 𝐁𝐨𝐨𝐥𝐔𝐑𝐢𝐧𝐠 the full sub-2-category of 𝐔𝐑𝐢𝐧𝐠 on Boolean ultrarings, and by 𝐁𝐨𝐨𝐥𝐋𝐞𝐱𝐭 the 2-category of small Boolean lextensive categories, finitely continuous functors which preserve finite coproducts, and natural transformations.

Proposition 6.

The categories 𝐁𝐨𝐨𝐥𝐔𝐑𝐢𝐧𝐠 and 𝐁𝐨𝐨𝐥𝐋𝐞𝐱𝐭 are equivalent.

Proof.

We omit this proof due to space constraints.

3 Annular Theories and Models

3.1 Presentations of Ultrarings

Having introduced the motivating examples of ultrarings, we now wish to provide presentations of these objects, which will subsequently enable us to perform essential constructions on them, as well as providing the basis for a syntax having a natural semantics in ultrarings.

Definition 7.

A signature 𝔖 is a pair (Sort(𝔖),Gen(𝔖)) such that:

  • Sort(𝔖) is a set of sorts. A tensor of arity n is a sequence of n sorts A1An. The unique tensor of arity 0 is denoted by I.

  • Gen(𝔖) is a set of generators, each with a type g:Tj=1kUj where T,Uj are tensors.

We fix a countably infinite set of variables, ranged over by x,y,z… and we use x,y,…to denote finite sequences of variables. Given a signature 𝔖, the monomials over 𝔖 are defined as follows:

p,q::=(x=Ay)|(gj(x)=y)|1|p¯|pq|xp,

where A ranges over Sort(𝔖), g:Tj=1kUj ranges over Gen(𝔖), 1jk and the length of x and y matches that of T and Uj, respectively. We write gj(x), (gj=y) and gj rather than (gj(x)=), (gj()=y) and (gj()=), respectively. We abbreviate (x1=A1y1)(xn=Anyn) to (x=Ay). The notation xa is a binder: x is bound in a and is subject to the usual renaming conventions. If x=x1,,xn, we write xa for x1xna. When x is empty, xa is just a. We call a monomial positive if it contains no instances of the negation operator p¯.

Monomials generalize logical formulas. Intuitively, in the Boolean case, the monomials 1, p¯, pq and xp could be written , ¬p, pq, x.p, and the monomial (gj(x)=y) corresponds to a relation symbol gj(x,y) satisfying that gj(x,y)gj(x,z) implies y=z, i.e., a functional relation. The equality monomial (x=Ay) is already a standard Boolean formula.

A pre-polynomial is a formal finite sum of monomials, with 0 representing the empty sum. We can extend the operations of multiplication and integration in the definition of monomials (the last two operations) to pre-polynomials by assuming distributivity and linearity, respectively.

A context is a finite list of type assignments of the form x:A where x is a variable and A a sort, such that no variable appears twice. If x=x1,,xn is repetition-free and T=i=1nAi, we also write the context x1:A1,,xn:An as x:T. In particular, in x:I the sequence x is empty. If Γ and Δ are contexts, Γ,Δ denotes their concatenation (the variables appearing in each are assumed disjoint).

Figure 1: Monomials in context. We omit a rule allowing to permute type assignments in contexts.

A monomial-in-context is an expression of the form Γp::Δ, where p is a monomial and Γ and Δ are contexts, which is derivable by means of the inductive rules of Fig. 1. If Γp::Δ is derivable, we say that p is well-typed, that Γ is a domain for p and that the context Γ,Δ matches p. Note that, thanks to the penultimate rule of Fig. 1, any context matching p is also a domain for it. Pre-polynomials-in-context are defined similarly, adding a rule to derive ΓiIpi::Δ whenever Γpi::Δ is derivable for all iI (in particular, Γ0::Δ is derivable for any Γ,Δ). From now on, we will only consider well-typed monomials and pre-polynomials.

xyp Γyxp y(x=y) Γ,x:A1
(x=Ay)p Γ,x:A,y:A(x=Ay)p[x/y] (x=Ax) Γ,x:A1
(x=Ay) Γ,x:A,y:A(y=Ax) p+p¯ Γ1
xpq Γpxqif x is not free in p
Figure 2: Basic equations for congruences on pre-polynomials. p[x/y] denotes usual substitution.

A congruence is a context-indexed family of equivalence relations :=(Γ)Γ on pre-polynomials matching Γ, closed under associativity and commutativity of multiplication pq, neutrality of 1, every equation of Fig. 2 and such that:

  • pΓq implies p¯Γq¯, prΓqr for all r matching Γ and pΓq for every context Γ including the assignments of Γ, possibly in a different order;

  • pΓ,x:Aq implies xpΓxq;

  • pΓq iff p+rΓq+r for any r matching Γ (we call this cancellativity).

Given a set S of equations of the form pΓq where p,q are pre-polynomials matching Γ, the congruence generated by S is the smallest congruence containing the equations of S.

In the sequel, if is a congruence and we write pq, we mean pΓq for every Γ matching both p,q.

Lemma 8.

For any congruence and any pre-polynomial p, p2p iff pp¯0. Moreover, either condition implies p¯2p¯.

Proof.

See §A.1.

Figure 3: Compatibility of pre-polynomials. The side condition () is: Γ,y:U,z:V (for some U,V) are domains for r,s,t, respectively, and x are the outputs of r.

Given a congruence over a signature 𝔖, we define -compatibility to be the context-indexed family of smallest symmetric relations Γ on monomials of 𝔖 closed under the rules of Fig. 3 such that pΓq implies that Γ is a domain for both p and q. We write pq to mean pΓq for every Γ which is a domain for both p and q.

A -polynomial (or simply polynomial when this is unambiguous) is a pre-polynomial p such that there exists Γ such that qΓr for all monomials q,r of p and such that, whenever the expression q¯ appears in p, we have q2q.

Definition 9.

An annular theory 𝔗 (which we abbreviate to theory in the remainder) is a triple (Sort(𝔗),Gen(𝔗),Eq(𝔗)) where (Sort(𝔗),Gen(𝔗)) is a signature and Eq(𝔗) is a well-founded set of equations of the form pΓq where p,q are pre-polynomials matching Γ, such that, calling such an equation e, we have that p and q are -polynomials with the congruence generated by the equations of Eq(𝔗) strictly below e in the order. We denote by 𝔗 the congruence generated by Eq(𝔗).

Definition 10.

A -matrix (or simply matrix) of type kKxk:TkjJyj:Uj consists of a (J×K)-indexed family of -polynomials-in-context (xk:Tkpjk::yj:Uj)(j,k)J×K which we abbreviate to (pjk), such that,

for every jjJkK, and monomials r in pjk and r in pjkrxk:Tkr.()

We always identify -matrices whose entries are equal modulo .

Lemma 11.

Let (pjk) and (qhj) be -matrices of type kKxk:TkjJyj:Uj and jJyj:UjhHzh:Vh, respectively. Then, the family of pre-polynomials-in-context indexed by H×J defined by

(qp)hk:=(xk:TkjJyjqhjpjk::zh:Vh)(h,k)H×K

is a -matrix of type kKxk:TkhHzh:Vh.

Proof.

See §A.1.

Let 𝔗 be a theory. We define a category 𝔽1[𝔗] as follows:

  • the objects are formal finite coproducts jJxj:Tj of contexts of 𝔗, modulo injective renaming of variables.

  • If A:=kKxk:Tk and B:=jJyj:Uj, 𝔽1[𝔗](A,B) is the set of 𝔗-matrices of type AB.

  • Composition is given by Lemma 11, and idA is the diagonal matrix indexed by K×K which, at position (k,k), is equal to (xk=Tkzk), where we used the fact that, since objects are defined up to variable renaming, by renaming each xhk to zhk, we may write A as kKzk:Tk.

As defined, 𝔽1[𝔗] is not small, because the finite sets indexing the objects are arbitrary. This may be circumvented by restricting to finite subsets of a fixed, countably infinite set of indices. We leave this implicit for notational convenience, but treat 𝔽1[𝔗] as a small category.

Proposition 12.

𝔽1[𝔗] is an ultraring.

Proof.

We spell out the required structures and properties, without entering into the details. Here “polynomial”, “matrix”, etc. mean 𝔗-polynomial, 𝔗-matrix, etc.

Let A:=jJxj.Tj and B:=kKyk.Uk be generic objects of 𝔽1[𝔗]. The (strict) symmetric monoidal structure of 𝔽1[𝔗] is given by AB:=(j,k)J×Kxjyk.TjUk on objects, with I as unit. On morphisms, tensor is matrix product, valid by a similar argument to the proof of Lemma 11, but without the integrals. The empty sum 0 is a zero object, the all-zero matrix of suitable size is the zero morphism between any two objects. The coproduct of A and B (where we may suppose JK= and xj,yk to be disjoint) is given by lJKzl.Vl, where zl and Vl are equal to xj and Tj (resp. yk and Uk) if lJ (resp. lK). This obviously satisfies strict distributivity. The injections ι1,ι2 are the block column matrices (id0) and (0id), respectively, whereas the copairing of two matrices P,Q is the block row matrix (PQ).

For what concerns the Frobenius sesquimonoid structure, δA is the matrix indexed over J2×J whose column for jJ has the element (xj=yj)(xj=zj) at position (j,j) and is zero everywhere else, where we are renaming variables so that AA=j,jJyjzj.TjTj. εA is the row matrix which is equal to the monomial 1 everywhere. δA is the transpose of δA.

Thanks to the above definition, elementary calculations show that, if P=(pkj)jJ,kK and Q=(qlj)jJ,lL are matrices corresponding to morphisms AB and AC for some other object C (indexed by L, which we may supposed to be disjoint from K even if C=B), then (PQ)δA𝔗0 is equivalent to asking that, for all jJ, kK and lL, we have pkjqlj𝔗0, which implies pkjqlj, so we may form the block column matrix R:=(PQ) (with KL rows and J columns). The reader may check that the coinjections are the block row matrices (id 0) and (0id), so R is the (unique) pairing of P,Q, as desired.

Let now P=(pk)kK be a matrix of type AI. This means that P is a row matrix, and elementary calculations show that (PP)δ𝔗P is equivalent to asking that pk2𝔗pk for all kK, so we are allowed to consider the polynomials pk¯ and define P¯:=(pk¯)kK. We need to show that (PP¯)δ𝔗0. By similar calculations as above, this is equivalent to pkpk¯𝔗0 for all kK, which holds by Lemma 8. We are left with proving that P,P¯𝔗ε. Notice that, in general, Q,R=Q+R as matrices. This sum exists because, as shown above, Q,R is the block column matrix (QR). So we need to show that pk+pk¯𝔗1 for all kK, but this is one of the equations of Fig. 2.

3.2 Models and the Canonical Theory

The term “annular theory” in Definition 9 is not merely an analogy with logic: it is chosen so that ultraring morphisms out of 𝔽1[𝔗] become models of 𝔗, in a sense that we now establish.

Definition 13.

Given a signature 𝔖 and an ultraring 𝒜, an 𝔖-structure in 𝒜 consists of:

  • An assignment M0:Sort(𝔖)ob(𝒜). This extends to an assignment on tensors given by M0(iAi):=iM0(Ai).

  • An assignment M1:Gen(𝔖)mor(𝒜) such that if g:TU then M1(g):M0(T)M0(U).

For 𝔖-structures M,M in 𝒜, a homomorphism m:MM consists of a collection of morphisms mX:M0(X)M0(X) in 𝒜 indexed by XSort(𝔖) such that for each g:iAijBjGen(𝔖), M1(g);jmBj=imAi;M1(g).

Given a theory 𝔗 over a signature 𝔖 and a 𝔖-structure M, we can define an interpretation over M of any 𝔗-polynomial-in-context, as detailed in §A.2. The notion of model is then defined in the expected way:

Definition 14.

Let 𝔗 be a theory over signature 𝔖 and 𝒜 an ultraring. A model of 𝔗 in 𝒜 is a 𝔖-structure M in 𝒜 such that for each equation pΓ,Δq of 𝔗, we have M(Γp::Δ)=M(Γq::Δ).

For models M,M of 𝔗 in 𝒜, a homomorphism MM is simply a homomorphism of 𝔖-structures. We denote by 𝔗-Mod(𝒜) the category of models of 𝔗 in 𝒜 and homomorphisms between them.

Proposition 15.

Let 𝔗 be a theory. There is an 𝒜-natural equivalence of categories 𝔗-Mod(𝒜)𝐔𝐑𝐢𝐧𝐠(𝔽1[𝔗],𝒜).

Proof.

See §A.2.

Proposition 15 implies in particular the existence of a generic model of any annular theory 𝔗, corresponding to the identity functor on 𝔽1[𝔗], of which a model in any ultraring is an image by naturality.

If Proposition 12 shows us that we can generate ultrarings from theories, it may not be a surprise that every ultraring arises in this way up to equivalence.

Definition 16.

We define the canonical theory of an ultraring to be the theory 𝔗 where:

  • Sort(𝔗)=ob(), where we denote the sort corresponding to A by A;

  • Gen(𝔗) has a generator g:jJAjkKlLkBk,l for each morphism g:jJAjkKlLkBk,l in ,333This is a mild abuse of notation, since the name g can refer to multiple generators depending on how the domain and codomain are decomposed. When not specified, the type will be the one with the minimal decomposition.

  • Eq(𝔗) consists of equations:

    • (id(x)=y)(x=y) for id:jJAijJAi,

    • y(f(x)=y)(g(y)=z)(gf(x)=z) for composable f,g in (with no coproduct decomposition of the codomains).

    • (ιjg(x)=y)(gj(x)=y).

    • (fg(x,u)=y,v)(f(x)=y)(g(u)=v).

    • (0(x)=y)x:T,y:U,Γ0, for any typing of 0.

    • (δ(x)=x1,x2)(x=x1)(x=x2)

    • ε(x)x:T,Γ1

    • (δ(x1,x2)=x)(x1=x)(x2=x).

Theorem 17.

Let be an ultraring and 𝔗 its canonical theory, as defined in Definition 16. Then 𝔽1[𝔗].

Proof.

See §A.2.

3.3 Examples of Annular Theories

In what follows, we let 𝕂 denote either 𝔽1 or the ultraring corresponding to a commutative ring R with no non-trivial idempotent, i.e., in which r2=r implies r{0,1} for all rR. Examples include any field or, more generally, any integral domain such as .

We define a predicate of a theory 𝔗 to be a 𝔗-polynomial p:TI such that p2x:T𝔗p. Observe that, if M is a model of 𝔗 in 𝕂, then M(p) must be a row vector of zeros and ones: the equation p2x:T𝔗p becomes (M(p)M(p))δT=M(p), and we already observed that this is equivalent to all entries of M(p) being idempotent. Furthermore, M(T)=In for some n (all objects of 𝕂 are of this form). If we see M(T) as the set {1,,n}, M(p) may be identified with the subset of M(T) of all i such M(p)i=1, justifying the terminology.

Predicates are closed under Boolean logic: 0 and 1 are predicates; if p and q are predicates, then pq and p¯ are predicates (Lemma 8). Also, by the second row of Fig. 2, (x=Ay) is always a predicate: (x=Ay)2x:A,y:A(x=Ay)(x=Ax)x:A,y:A(x=y). Moreover, models in 𝕂 are consistent with Boolean logic: if M and p are as above, M(0)=, M(1)=M(T), M(pq)=M(p)M(q), M(p¯)=M(T)M(p) and M(x=Ty) is the diagonal of M(T)×M(T).

In the sequel, when we say that a generator P is a predicate over T, we mean that P:TI and that the equation P2x:T𝔗P is added to the theory. By the above, a monomial φ consisting entirely of generators which are predicates is like a Boolean formula and, if x:T matches φ, we may impose that x.φ holds by adding the equation φx:T1.

For example, we define the theory 𝔒𝔯𝔡 with one sort N and one predicate over NN with equations making is a total order. We write (xy) rather than (x,y). A model of 𝔒𝔯𝔡 in 𝕂 is precisely a finite total order; modulo iso, we may assume it to be of the form [n]:={1<<n}. The theory 𝔖𝔱𝔯 is obtained from 𝔒𝔯𝔡 by adding a generator X:NI with no further equations. A model s of 𝔖𝔱𝔯 in 𝕂 is a finite total order indexing a row vector s(X) of zeros and ones if 𝕂=𝔽1, or of elements of R otherwise. In other words, s represents a binary string when 𝕂=𝔽1, or a string of elements of R otherwise. We denote the i-th bit/element by s(X)i.

4 Computation

4.1 Computability over Ultrarings

Let 𝕂 be as in §3.3. A 𝕂-string is a binary string if 𝕂=𝔽1, or a string over elements of R otherwise. A 𝕂-problem is a set of 𝕂-strings.

We define 𝕂-operations to be the following functions R×RR, where R is {0,1} if 𝕂=𝔽1 or the underlying ring of 𝕂 otherwise: 𝔽1-operations are conjunction, the constant function 1 and the function negating the first bit and discarding the second; otherwise, 𝕂-operations are constant functions, addition and multiplication of R and, in case R is a field, also division (the value of a division by zero is chosen arbitrarily). We also define Test𝕂R to be the set of non-negative elements when R is , or , or {0} otherwise.

Definition 18.

A 𝕂-RAM, where RAM stands for random access machine, is a (possibly empty) list I0,,Im1 of instructions, m, chosen among: 𝖼𝗈𝗆𝗉(op) where op is a 𝕂-operation (a computation); 𝗓𝖾𝗋𝗈𝗋, 𝗓𝖾𝗋𝗈𝗐, 𝗂𝗇𝖼𝗋 or 𝗂𝗇𝖼𝗐 (an update); 𝖻𝗋𝖺𝗇𝖼𝗁(l) where 0lm+1; and 𝖼𝗈𝗉𝗒.

A configuration of the machine is a tuple (i,s,r,w) where 0im+1, s is a 𝕂-string, whose j-th element is denoted by sj and said to be the content of register j, and r,w. The initial configuration is (0,s,0,0), where s is the input of the machine. On configuration (i,s,r,w), the machine acts as follows. If 0im1, then the next configuration c is determined according to Ii (the string s is considered to be padded with infinitely many 0’s on the right, so sj is defined for all j):

  • Ii=𝖼𝗈𝗆𝗉(op): c is (i+1,s,r,w), where s0=op(s0,s1), and sj=sj for all j>0;

  • Ii=𝖻𝗋𝖺𝗇𝖼𝗁(l): c is (l,s,r,w) if s0Test𝕂 or (i+1,s,r,w) otherwise;

  • Ii=𝖼𝗈𝗉𝗒: c is (i+1,s,r,w) where sw=sr and sj=sj for all jw;

  • Ii=𝗓𝖾𝗋𝗈𝗋, 𝗓𝖾𝗋𝗈𝗐, 𝗂𝗇𝖼𝗋 or 𝗂𝗇𝖼𝗐: c is (i+1,s,0,w), (i+1,s,r,0), (i+1,s,r+1,w) or (i+1,s,r,w+1), respectively.

Otherwise, the machine accepts if i=m and rejects if i=m+1.

It is immediate to see that a 𝕂-RAM with 𝕂 one of , or is equivalent to a BSS machine [5] over those rings, modulo a polynomial slowdown (because computation steps of BSS machines are rational functions of arbitrary finite arity). On the other hand, an 𝔽1-RAM is obviously equivalent to a deterministic Turing machine on the alphabet {0,1}.

The notion of acceptance/decision of a 𝕂-problem by a 𝕂-RAM is as usual. A polytime 𝕂-RAM is a 𝕂-RAM which always terminates in polynomially many steps in the size of the input. We denote by 𝖱𝖤𝕂 the class of 𝕂-problems accepted by a 𝕂-RAM, by 𝖯𝕂 the class of 𝕂-problems decided by a polytime 𝕂-RAM, and by 𝖭𝖯𝕂 the class of 𝕂-problems which are projections over the first component of a 𝕂-problem in 𝖯𝕂 whose 𝕂-strings encode pairs (s1,s2) such that the length of s2 is polynomially bounded by the length of s1. By the above observations, 𝖱𝖤𝔽1, 𝖯𝔽1 and 𝖭𝖯𝔽1 are the usual classes 𝖱𝖤, 𝖯 and 𝖭𝖯, whereas 𝖱𝖤, 𝖯 and 𝖭𝖯 are the usual classes defined using the BSS model [5].

By contrast, 𝖯 and 𝖭𝖯 do not coincide with the corresponding BSS classes. Indeed, BSS sort of “tweak” their definition of computability over in order to recover the usual, Boolean 𝖯 and 𝖭𝖯: they consider an integer to have size equal to its representation as a binary string. We do not need to do this, as we use 𝔽1 to capture Boolean computation.

4.2 Capturing Complexity Classes

Let be an ultraring. We define an -algebra to be an ultraring 𝒜 equipped with a structure map 𝒜 and an equivalence . Typical examples are given by extensions of theories: if 𝔗 is defined by adding sorts and/or generators and/or equations to a theory 𝔖, then there is an obvious inclusion functor 𝔽1[𝔖]𝔽1[𝔗], mapping every object and morphism of 𝔽1[𝔖] to “itself”, making 𝔽1[𝔗] into an 𝔽1[𝔖]-algebra, with equality as equivalence. In general, if is presented by 𝔖 with a chosen equivalence e:𝔽1[𝔖], and if 𝔗 extends 𝔖, to make it clear that we are viewing 𝔽1[𝔗] as an -algebra with inclusion as structure map and equivalence e, we write [𝔗𝔖] rather than 𝔽1[𝔗].

For example, if 𝕂 is as in §3.3, we may fix a presentation 𝔗𝕂 of 𝕂 and an equivalence 𝔽1[𝔗𝕂]𝕂 (taking 𝔗𝔽1 to be the empty theory), and add to 𝔗𝕂 the sort, generators, and equations of 𝔖𝔱𝔯, obtaining a theory 𝔖𝔱𝔯𝕂 (so 𝔖𝔱𝔯𝔽1=𝔖𝔱𝔯) and a 𝕂-algebra that we denote by 𝕂[𝔖𝔱𝔯], which is equal to 𝔽1[𝔖𝔱𝔯𝕂] with structure map the inclusion of 𝔽1[𝔗𝕂]𝕂.

Definition 19.

Let 𝒜 be an 𝔽1[𝔖𝔱𝔯]-algebra with structure map f:𝒮𝒜 and equivalence e:𝒮𝔽1[𝔖𝔱𝔯]. We say that 𝒜 accepts a 𝕂-string s if any morphism 𝔽1[𝔖𝔱𝔯]𝕂 corresponding to s as a model of 𝔖𝔱𝔯 in 𝕂 (via Proposition 15) factors through f, modulo isomorphism. That is, given a morphism g:𝔽1[𝔖𝔱𝔯]𝕂 representing s, there exists a morphism h:𝒜𝕂 and a monoidal natural isomorphism between ge and hf. We denote by Γ𝕂(𝒜) the set of 𝕂-strings accepted by 𝒜.

Notice that the above definition does not depend on the choice of g representing s: if h exists for some g, then it exists for all g representing s, because in that case gg and therefore gegehf as well.

Also observe that, by initiality of 𝔽1, every 𝕂[𝔖𝔱𝔯]-algebra is an 𝔽1[𝔖𝔱𝔯]-algebra. Moreover, if 𝕂 has no non-identity endomorphism (for instance, if 𝕂 is , , or 𝔽p with p prime or 1), 𝕂-strings still correspond to morphisms 𝕂[𝔖𝔱𝔯]𝕂. In this case, the above definition may be equivalently formulated by speaking of 𝕂[𝔖𝔱𝔯]-algebras. Concretely, if 𝒜=𝕂[𝔗], a 𝕂-string s, seen as a model of 𝔖𝔱𝔯 in 𝕂, is in Γ𝕂(𝒜) iff we may extend it to a model in 𝕂 of 𝔖𝔱𝔯 augmented with the extra sorts, generators and equations of 𝔗. This is how the definition is applied in the statement of Theorem 22 below. The above definition is more general because, if 𝕂 has non-trivial endomorphisms (for example 𝕂=), a morphism 𝕂[𝔖𝔱𝔯]𝕂 may not correspond to a 𝕂-string, but a morphism 𝔽1[𝔖𝔱𝔯]𝕂 always does.

We say that an -algebra of the form [𝔗] is

  • of finite presentation if 𝔗 is finite (finitely many sorts, generators and equations are added);

  • plain if 𝔗 has no sorts (no sorts are added).

The latter terminology is justified by the fact that plain -algebras are algebras in the usual sense when is a commutative ring.

Let T be a tensor of a theory 𝔗. We say that is it a chain if there exist a predicate (as defined in §3.3) 𝔗 over TT and 𝔗-polynomials ZT,MaxT:IT and SuccT:TT such that, with respect to 𝔗, T is a total order, ZT and MaxT are functions identifying the minimum and maximum element w.r.t. 𝔗, and SuccT is the successor function (every element has a unique successor and predecessor, except zero and max, which have no predecessor and successor, respectively). Notice that, if T and U are chains, the so is TU via the lexicographic order (it is not hard to see that this is definable in annular theories). Whenever p is a polynomial matching a context Γ,t:T, we will write p(0), p(max) and p(t+1) to mean tZT(t)p(t), tMaxT(t)p(t) and tSuccT(t,t)p(t), respectively.

Definition 20.

Let be an ultraring and 𝒜=[𝔗] a plain -algebra, whose underlying equivalence is 𝔽1[𝔖]. We say that 𝒜 is inductive if there exists a tensor T of 𝔖 which is a chain in 𝔗 such that every added generator gGen(𝔗) is either making T into a chain or has type TUV for some U and V and belongs to one of the following classes:

  • inductive generators: generators with equations of the form

    • initialization: iφig(0)Γiφici,

    • induction: iψi(t)g(t+1)Γ,t:Tiψi(t)fi(t),

    and, possibly, equations stating that g is a predicate and/or final value equations of the form iφig(max)Γiφici, where ci,ci,fi are polynomials and φi,φi,ψi are predicates such that, for all ij, φiφjΓ𝔗0, φiφjΓ𝔗0 and ψiψjΓ,t:T𝔗0;

  • harmless predicates and ancillary generators: predicates P over T coming with their ancillary generators X1P,,XkP:TI and their defining equations Ppt:T0 and P¯qit:T0 for 1ik, where p and qi are polynomials such that:

    • the degree of p in the ancillary generators of P is at most 2;

    • no harmless predicate appears in p or any qi;

    • in any model M of 𝔖 in 𝕂, the equation M(p)=0 has a solution in 𝕂 (with respect to the ancillary generators) iff the system (M(qi)=0)i=1k has no solution in 𝕂.

    Moreover, the ancillary generators of P do not appear in any equation of 𝔗 except the defining equations of P.

Inductive algebras are inspired by fixed point operators in logic [16, 15]. Let 𝕂 be an integral domain or 𝔽1. The idea is that, given a model M in 𝕂 of the base theory 𝔖 (i.e., a morphism f:𝕂), finding whether M may be extended to a model M of 𝔖 plus the generators and equations of 𝔗 (i.e., whether f factors via the inclusion 𝒜) may be done inductively on T, which is like a time parameter. Indeed, to build M one must find an interpretation in 𝕂 for the generators of 𝔗. For an inductive generator, the initialization equation gives the value when t=0 and, once the value at t is known, the induction equation gives the value for t+1. For a harmless predicate P with defining equations involving p and (qi), one may know whether P holds at time t by testing whether p=0 has a solution in 𝕂. This may be done efficiently (at least for certain 𝕂 of interest, such as and 𝔽1) because p has degree at most two (it involves something like computing a discriminant, or solving a 2-CNF). The definition guarantees that, if p=0 has a solution, then one of the qi=0 does not, therefore P¯(t)=0 (because 𝕂 has no zero divisor) hence P is true at time t. Otherwise, if p=0 has no solution, then P must be false at time t.

The following results hold more generally than stated (for example, they also hold for , and 𝔽p with p prime), but for succinctness we prove them only for 𝔽1 and .

Lemma 21.

Let 𝕂 be 𝔽1 or . For any polytime 𝕂-RAM M there exists a finite extension 𝔛 of 𝔖𝔱𝔯 such that:

  • 𝕂[𝔛] is an inductive 𝕂[𝔖𝔱𝔯]-algebra of finite presentation;

  • a model of 𝔛 in 𝕂 is an accepting run of M, and its restriction to 𝔖𝔱𝔯 is the input of M for that run.

Proof.

Let the running time of M be bounded by nk, with n the input length and k a constant. The theory 𝔛 adds a chain structure on N (the sort of 𝔖𝔱𝔯), so that T:=Nk is also a chain, which will play the role of the time parameter. Then, 𝔛 adds the inductive generators Reg:TNkI (the work tape, which is of length at most nk because it cannot be longer than the running time of M), Pr,Pw:TNk (the values of r and w), and the inductive predicates In0,,Inm over T (where Ini(t) holds iff instruction i is executed at time t). If 𝕂=, 𝔛 also adds the harmless predicate Gez over T, with ancillary generators Pos,Neg,Neg1:TI (for the Test𝕂 relation), and the harmless predicate Div over T, with ancillary generator Quo:TI (for division).

The equations added by 𝔛 are as follows (we will explain them momentarily):

In0(0)1,Ink(0)0fork0max(t)Inm(t)Ini(t)Inj(t)0forallij (2)
Gez(t)(Pos(t)2Reg(t,0))0Gez(t)¯(Neg(t)2+Reg(t,0))0Gez(t)¯(Neg(t)Neg1(t)1)0 (3)
Div(t)(Reg(t,0)Reg(t,1)Quo(t))0Div(t)¯Reg(t,0)0 (4)
(Pw(0)=0)1(Pr(0)=0)1 (5)
xInk(t)(Pi(t)=x)(Pi(t+1)=x+1)+(Pi(t+1)=0)¯0withi{r,w} (6)
xInk(t)(Pi(t)=x)(Pi(t+1)=x)¯0 (7)
In0(t)In1(t+1)¯++Ink(t)Gez(t)Inl(t+1)¯+Ink(t)Gez(t)¯Ink+1(t+1)¯++Inm1(t)Inm(t+1)¯0 (8)
Ink(t)Reg(t+1,0)Ink(t)(Reg(t,0)Reg(t,1))where{+,,×} (9)
Ink(t)Reg(t+1,0)Ink(t)Div(t)(Reg(t,1)/Reg(t,0))+Ink(t)Div(t)¯ (10)
xInk(t)(Pw(t)=x)Reg(t+1,x)yInk(t)(Pr(t)=y)Reg(t,y) (11)
(iIIni(t))+(jCInj(t))(Pw(t)=0)¯Reg(t,0)(iIIni(t))+(jCInj(t))(Pw(t)=0)¯Reg(t+1,0) (12)
s(iCIni(t))(Pw(t)s)(s0)Reg(t,s)s(iCIni(t))(Pw(t)s)(s0)Reg(t+1,s) (13)
(i<TmaxN)Reg(0,i)+(i<TmaxN)¯Reg(0,i)(i<TmaxN)X(i) (14)

Equations (2) state that the first (resp. last) instruction is the instruction of index 0 (resp. m) and that only one instruction is executed at a time; (3) define the predicates Gez (which is true iff s00, where s0 is the content of register 0, as in Definition 18), Pos (resp. Neg and Neg1) which is a witness of positivity (resp. negativity); (4) define the predicates Div,Quo which are witnesses of divisibility and the quotient; (5) and (6) state that Pw and Pr are initialized to 0 and how they are updated, note that, due to the chain structure of Nk, x+10 and thus (Pi(t)=x+1)(Pi(t)=0)0 so the sum is well defined; (7) states that when Ink is not an update(i) the Pi addresses is not modified; (8) defines the jump instructions, (9) and (10) the operations and (11) the copy instructions; (12) states that the first cell of the tape is only modified by computations and copies, where I is the set of indices of computation and C the one of copy instructions, also, note that the sets I and C are disjoints which is important for summability; (13) states that the other cells can only change if the instruction is a copy and the writing register is the right one; (14) states that the work tape initially contains the input and is filled with zeros after that, note that maxN is the maximum of the sort N (which 𝔛 equips with a chain structure), whereas <T is the strict order on the tensor T=Nk (which is lexicographically ordered from the order on N).

By definition, 𝔛 adds no sorts and is finite. Towards proving the second point of the statement, we observe that a finite model of 𝔛 consists of a 𝕂-string x of length |N| (the underlying model of 𝔖𝔱𝔯 in 𝕂), where |N| is the interpretation of N, plus seven additional functions and m+3 predicates.

Let us prove the second point of the statement by induction on |N|k: if this is 1 (i.e., there is only one time step), then by equations 1 and 2 we have that m=0, so the machine has only one state, which is accepting. Therefore, any model is an accepting run of the machine. If |N|k={t0,,tn+1} (note that, by definition, (tn)+1=tn+1), by induction all the functions and predicates are defined at time tn, then, for some i we have that Ini(tn) is defined. Also, i cannot be m by equation 2. This means that the current instruction is either a branch, an update, a copy or a computation.

First, if it is a branch(l), then, since we supposed that Gez(tn) is defined, by equation 9 we have that either Inl(tn+1) or Ini+1(tn+1) is defined, in any of those cases, Inj(tn+1) is also defined by equation 3. By equations 13 and 14 we have that Reg(tn+1,s) is also defined for any s. Axioms 4 and 5 ensure that Gez,Pos,Neg,Neg1,Div and Quo are defined at time tn+1, and equation 8 gives us that Pr(tn+1) and Pw(tn+1) are both defined.

Then, if the instruction is an update, again, equations 13 and 14 ensure the definition of Reg(tn+1,s) for any s, equations 4 and 5 for the definitions of Gez,Pos,Neg,Neg1,Div and Quo, equation 7 for Pj(tn+1) and 8 for Pj(tn+1), with j,j{r,w} and jj.

If the instruction is a copy, since Pr(tn) and Pw(tn) are defined we have that, for some sNk, Reg(tn+1,s) is defined by equation 12, if s0 then Reg(tn+1,0) is defined thanks to equation 13 and for all other yNk Reg(tn+1,y) is defined by equation 14. Again all other functions and predicates are defined by the same equations as before.

Finally, if the instruction is a computation, then either it is a division and Reg(tn+1,0) is defined by equation 11 (Reg(t,0) is divisible by Reg(t,1), if not then the behavior of the machine is not defined) either it is not a division and Reg(tn+1,0) is defined by equation 10. For all s0,Reg(tn+1,s) is defined by equation 14 and the other functions and predicates are still defined as before.

We have thus proved that, at any given t|N|k, if i is the unique element of {0,,m} such that Ini(t) holds, (i,Reg(t),Pr(t),Pw(t)) is the configuration obtained by running M for t steps from the initial configuration on input x. Equation 2 guarantees that this is an accepting run, as the machine must have entered instruction m at some point before time |N|k (after which it stays there).

We are left with checking that the resulting algebra is inductive. The inductive generators are clearly of the right form, so we just need to check that the other predicates are indeed harmless: for Gez, in any model, at any time t either Reg(t,0) is positive and there exists a real number Pos(t) such that Pos(t)2Reg(t,0)=0 either it is negative and there exists Neg(t) and Neg1(t) such that Neg(t)Neg1(t)=1 and Neg2+Reg(t,0)=0, in any case (Pos(t)2Reg(t,0))(Neg2+Reg(t,0)) and (Pos(t)2Reg(t,0))(NegNeg11) have a solution. The same is true for Div, either Reg(t,0) is 0, either is not and there is a real number Quo(t) such that (Reg(t,0)Reg(t,1)Quo(t))=0, in any case Reg(t,0)(Reg(t,0)Reg(t,1)Quo(t)) has a solution. Hence, the theory is inductive.

Theorem 22.

Let 𝕂 be 𝔽1 or and let L be a 𝕂-problem. Then:

  1. 1.

    L𝖱𝖤𝕂 iff L=Γ𝕂(𝒜) with 𝒜 a 𝕂[𝔖𝔱𝔯]-algebra of finite presentation;

  2. 2.

    L𝖭𝖯𝕂 iff L=Γ𝕂(𝒜) with 𝒜 a plain 𝕂[𝔖𝔱𝔯]-algebra of finite presentation;

  3. 3.

    L𝖯𝕂 iff L=Γ𝕂(𝒜) with 𝒜 an inductive 𝕂[𝔖𝔱𝔯]-algebra of finite presentation.

Proof.

For (1), consider an arbitrary 𝕂-RAM M. We slightly modify the proof of Lemma 21: rather than using Nk as chain, we introduce a new sort T, with the structure of a chain, and reproduce the proof with T instead of Nk. The theory thus obtained is no longer inductive but is still of finite presentation, and its models are accepting runs of M, with the interpretation of T giving its running time, which may now be arbitrary.

Conversely, if we are given an algebra 𝕂[𝔗] with 𝔗 finitely extending 𝔖𝔱𝔯 and a 𝕂-string s, we have that a model of 𝔗 extending s has finitely more data than s, namely the data interpreting the additional sorts and generators of 𝔗. Given such extra data, checking whether it verifies the additional equations of 𝔗, of which there are finitely many, is certainly doable in a finite time (in fact, in polynomial time) on a 𝕂-RAM.

For (2), let L𝖭𝖯𝕂. This means that there exists a polytime 𝕂-RAM M and a constant c such that, for every 𝕂-string s, sL iff there exists a string s of length at most |s|c such that M accepts the pair (s,s). We let k be the maximum between c and the exponent of the polynomial bound on the running time of M, and construct a 𝕂[𝔖𝔱𝔯]-algebra just like in the proof of Lemma 21, expect that we do not initialize the work tape beyond the input length. The algebra thus obtained is still plain (no sort is added) of finite presentation, but it is no longer inductive because the generator Reg now is missing some initialization equations. The models of the resulting theory are still accepting runs of M, on which the tape is now initialized non-deterministically beyond the input s. In particular, it may be initialized with the witness s, which is small enough to fit in Nk.

The converse is much like point (1), except that this time we only need to account for the interpretation of the extra generators, which are of polynomial size (because these have types of the form NkjNkj with k and kj constants) and may therefore be guessed and then checked with a polytime 𝕂-RAM.

For (3), the implication from left to right is Lemma 21. For the converse, if we have an inductive algebra 𝕂[𝔗] with 𝔗 finitely extending 𝔖𝔱𝔯, and we have a 𝕂-string s, we check whether s may be extended to a model of 𝔗 as outlined after Definition 20. The only thing left to verify is that computing harmless generators takes no more than polynomial time.

Let us start with the case 𝕂=. For each harmless predicate P we have an equation of the form P(t)φ(t)Γ0, so for each t, to know whether P(t) is true in a given model in we just need to check whether the interpretation of φ(t) has a root in . The idea here is to generalize the discriminant to multivariate polynomials of degree two. See the appendix for details (Lemma 24).

When 𝕂=𝔽1, the truth of a harmless generator at time t is controlled by a polynomial φ(t) of degree two. In 𝔽1, this is interpreted as a 2-DNF. Therefore, testing the equation φ(t)=0 is testing whether a 2-DNF is falsifiable, which is well-known to be polytime [20].

Let us conclude with a few words about when 𝕂=. In this case, Lagrange’s four square theorem may be used to implement Test. Moreover, combined with the Davis-Putnam-Robinson-Matiyasevich theorem, Theorem 22 implies that 𝖱𝖤=𝖭𝖯.

5 Discussion and Perspectives

As implicitly shown in §2.2, ultrarings generalize commutative rings by generalizing their categories of modules (free of finite rank). This is not a new idea: it has already been mentioned or directly used in at least a few attempts to generalize algebraic geometry beyond commutative rings [13, 10, 6, 4]. What is new in ultrarings is the emphasis on presenting such generalized algebraic objects by means of a language which is directly derived from first-order logic and which still captures all ring presentations.

Speaking of algebraic geometry, it is very interesting to point out that the ultraring 𝔽1 has some of the properties typically expected of the “field with one element”. In fact, the full subcategory of ultrarings which are plain 𝔽1-algebras (i.e., of the form 𝔽1[𝔗] with 𝔗 sortless) may be fully and faithfully embedded in the category of generalized commutative rings studied by Durov [12]. Under this embedding, 𝔽1 is mapped to Durov’s version of the “field with one element”.

The reader may have observed that the field 𝔽2 could also have been used capture Boolean computation: 𝔽2-strings are just binary strings and 𝖱𝖤𝔽2, 𝖭𝖯𝔽2 and 𝖯𝔽2 coincide with the usual Boolean classes. We contend that this is sort of an accident, and that Boolean computability is really over 𝔽1. Indeed, any 𝕂-RAM may be restricted to operate only on {0,1}, simulating a Boolean machine. This is routinely used in BSS or algebraic complexity to define the “Boolean part” of the language decided by a machine. Our approach nicely explains this by the existence of a unique morphism 𝔽1𝕂 saying that “Booleans are everywhere”. By contrast, there is no morphism 𝔽2𝕂 unless 𝕂 has characteristic 2.

In this paper, we have not developed the theory of ultrarings to the extent necessary to give a technical content to the above statement, but to the acquainted reader we may say that the above observation becomes a change of base along 𝔽1𝕂. In fact, the definition of ultraring in this paper has been intentionally restricted to give “logical-looking” presentations. We already know that ultrarings may be given a more liberal definition, still allowing presentations, but of a different flavor than the ones introduced here. Modules for these ultrarings may open interesting perspectives in terms of computational complexity: at least in the plain case (i.e., for the class 𝖭𝖯 and below), modules generalize algebras and could potentially be used to give finer characterizations of complexity classes.

In a different direction, if we restrict to Boolean lextensive categories (which, as §2.2 shows, are special cases of ultrarings) we know that more Boolean complexity classes may be captured by adapting ideas from descriptive complexity. These include deterministic and nondeterministic logarithmic space, the logtime hierarchy and the polynomial hierarchy, as well as non-uniform complexity classes, and will be the subject of another paper [9].

Finally, let us mention that descriptive complexity has well-known tools, taking the form of various pebble games [17], allowing one to establish lower bound results. These have been reformulated categorically [1, 3, 11, 2, 22]. Knowing if and how these reformulations interface with our work is an interesting question for the future.

References

  • [1] Samson Abramsky, Anuj Dawar, and Pengming Wang. The pebbling comonad in finite model theory. In Proceedings of LICS, pages 1–12. IEEE Computer Society, 2017. doi:10.1109/LICS.2017.8005129.
  • [2] Samson Abramsky and Luca Reggio. Arboreal categories: An axiomatic theory of resources. Log. Methods Comput. Sci., 19(3), 2023. doi:10.46298/LMCS-19(3:14)2023.
  • [3] Samson Abramsky and Nihil Shah. Relating structure and power: Comonadic semantics for computational resources. J. Log. Comput., 31(6):1390–1428, 2021. doi:10.1093/LOGCOM/EXAB048.
  • [4] John C. Baez, Joe Moeller, and Todd Trimble. 2-rig extensions and the splitting principle. arXiv:2410.05598 [math.CT], 2024.
  • [5] Lenore Blum, Mike Shub, and Steve Smale. On a theory of computation and complexity over the real numbers. Bulletin of the American Mathematical Society, 21(1):1–46, 1989.
  • [6] Martin Brandenburg. Tensor categorical foundations of algebraic geometry. Ph.d. thesis, University of Münster, 2014.
  • [7] Martin Brandenburg and Alexandru Chirvasitu. Tensor functors between categories of quasi-coherent sheaves. Journal of Algebra, 399:675–692, 2014.
  • [8] Aurelio Carboni, Stephen Lack, and R.F.C. Walters. Introduction to extensive and distributive categories. Journal of Pure and Applied Algebra, 84(2):145–198, 1993.
  • [9] Baptiste Chanus and Damiano Mazza. A categorical approach to describing complexity classes. In preparation. Available on the authors’ web page, 2024.
  • [10] Alexandru Chirvasitu and Theo Johnson-Freyd. The fundamental pro-groupoid of an affine 2-scheme. Appl. Categ. Structures, 21(5):469–522, 2013. doi:10.1007/S10485-011-9275-Y.
  • [11] Anuj Dawar, Tomás Jakl, and Luca Reggio. Lovász-type theorems and game comonads. In Proceedings of LICS, pages 1–13. IEEE, 2021. doi:10.1109/LICS52264.2021.9470609.
  • [12] Nikolai Durov. New Approach to Arakelov Geometry. arXiv 0704.2030 [math.AG], 2007.
  • [13] Nikolai Durov. Classifying vectoids and operad kinds. Proc. Steklov Inst. Math., 273:48–63, 2011.
  • [14] Ronald Fagin. Generalized first-order spectra and polynomial-time recognizable sets. In Complexity of Computation, SIAM-AMS Proccedings, volume 7, pages 43–73, 1974.
  • [15] Erich Grädel and Klaus Meer. Descriptive complexity theory over the real numbers. In Proceedings of STOC, pages 315–324. ACM Press, 1995. doi:10.1145/225058.225151.
  • [16] Neil Immerman. Relational queries computable in polynomial time. Information and Control, 68(1):86–104, 1986. doi:10.1016/S0019-9958(86)80029-8.
  • [17] Neil Immerman. Descriptive complexity. Graduate texts in computer science. Springer, 1999. doi:10.1007/978-1-4612-0539-5.
  • [18] Bart P. F. Jacobs. Categorical Logic and Type Theory, volume 141 of Studies in logic and the foundations of mathematics. North-Holland, 2001.
  • [19] Peter T. Johnstone. Sketches of en Elephant. A Topos Theory Compendium. Volume 2. Oxford University Press, 2002.
  • [20] Melven R. Krom. The decision problem for a class of first-order formulas in which all disjunctions are binary. Zeitschrift für Mathematische Logik und Grundlagen der Mathematik, 13(1–2):15–20, 1967.
  • [21] Saunders Mac Lane and Ieke Moerdijk. Sheaves in Geometry and Logic. Springer, 1994.
  • [22] Yoàv Montacute and Glynn Winskel. Concurrent games over relational structures: The origin of game comonads. In Proceedings of LICS, pages 58:1–58:14. ACM, 2024. doi:10.1145/3661814.3662075.

Appendix A Appendix

A.1 Proofs of Some Lemmas

Proof of Lemma 2.

We start by observing that, if ιi:BiB1B2 are injections, then ιiδBi(ιiidBi)=δB1B2(idB1B2ιi). We prove this for i=1, the other case is essentially identical. We omit obvious subscripts for identity arrows. Let χ=[ι1id,ι2id]:(B1B1)(B2B1)(B1B2)B1 be the distributivity isomorphism. We have, using (1), ι1δB1(ι1id)χ=ι1δB1[ι1ι1id,ι1ι2id]=ι1δB1[id,0]=[ι1δB1,0]=[δB1B2(ι1ι1),δB1B2(ι2ι1)]=δB1B2(idι1)χ, which proves the claim because χ is invertible. We will also need that, if κi:ABi(AB1)(AB2) are injections and χ:(AB1)(AB2)A(B1B2) another instance of distributivity, then χκi=idιi, which holds by definition of χ.

Suppose now that we have f,g:AB1B2 with ιif=ιig for i=1,2. Using the above observations, we have δB1B2(fid)χκi=δB1B2(fιi)=ιiδBi(ιifid)=ιiδBi(ιigid), from which, applying the first two equalities in reverse order, we obtain δB1B2(fid)χκi=δB1B2(gid)χκi for i=1,2. Since injections are jointly epic and χ is invertible, we infer δB1B2(fid)=δB1B2(gid), from which we conclude f=g by definition δ-category.

Proof of Lemma 8.

We start by observing that cancellativity implies p¯¯p, as well as 1¯0. Next, we claim that, whenever q matches the same contexts as p and q2q, we have pq¯p¯q+pq¯+p¯q¯. Indeed, pq+pq¯1(p+p¯)(q+q¯)pq+p¯q+pq¯+p¯q¯, so we conclude by cancellativity.

Suppose that pp¯0. Then, pp(p+p¯)p2+pp¯p2. For the converse, if p2p, then using the above claim we have pp¯¯=p2+p¯2+p¯p=p+p¯(p¯+p)=p+p¯=1, so pp¯=0 by the first two observations. Finally, we have p¯p2¯pp¯+p¯p+p¯2p¯2.

Proof of Lemma 11.

For indices h,j,j,k, let r,r,s,s be monomials in pjk,pjk,qhj,qhj, respectively. We need to check that each (qp)hk is a polynomial by verifying that, when jj we have yjsrxk:Tkyjsr. By hypothesis, rxk:Tkr, so we conclude by the last rule of Fig. 3. We must also check that the context is valid. By hypothesis, qhjpjk is matched by xk:Tk,yj:Uj,zh:Vh, with yj and zh being outputs, hence each monomial yjrs is well-typed and matched by xk:Tk,zh:Vh, as required. Finally, we must check condition () of Definition 10. Given hh, we require yjsrxk:Tkyjtr, where t is a monomial of qhj. If jj, we conclude as above. If j=j, by hypothesis we have syj:Ujt, so we conclude by applying the last rule of Fig. 3 to these instead.

A.2 Interpreting Polynomials in a 𝕾-structure

Let M be a 𝔖-structure. We start by inductively defining an interpretation over M for positive monomials-in-context, following Fig. 1.

  • As a base case, we interpret monomials over 𝔖 with the maximal codomain context of all outputs and the minimal domain of all remaining free variables, for each of the basic constructions of monomials:

    • M(x:A(x=Ay)::y:A) is idM0(A),

    • M(x:T(gj(x)=y)::y:U) is M1(g);ιj,

    • M(1::) is εI=idI,

  • Next, we describe the effect of expanding and reorganizing contexts.

    • Given f:=M(Γp::Δ,x:A), let M(Γ,x:Ap::Δ):=εM0(A)δM0(A)(fidA).

    • Relatedly, given f:=M(Γp::Δ), we define M(x:A,Γp::Δ) to be β(εM0(A)f), (recalling that β:III is the canonical isomorphism).

    • Given M(Γp::Δ), permutations of Γ and Δ are interpreted by pre- or post-composing with the corresponding symmetry morphisms.

  • Finally, we specify how monomials combine.

    • Given f:=M(Γp::Δ,x:T) and g:=M(x:T,Γq::Δ) we can define M(Γ,Γx:Tpq::Δ,Δ) to be (idg)(fid); to recover an interpretation of xp, we identify this with xp1.

    • Given f:=M(x1:A,x2:A,Γp::Δ) and a variable x not appearing in p, we define M(x:A,Γp[x1/x][x2/x]::Δ) to be f(δM0(A)id).

    • Dually, given f:=M(Γp::x1:B,x2:B,Δ) and a variable x not appearing in p, we define M(Γp[y1/y][y2/y]::y:B,Δ) to be (δM0(B)id)f.

Let us check that the above interpretations are well-defined. The first set of rules give unambiguous interpretations. For the second set, there is exactly one way to arrive a given context using these rules up to reordering, so it suffices to check that the order of operations does not affect the result; this is straightforward, relying on the fact that δ is symmetric.

The only place where ambiguity is introduced in the third set of rules, where the interpretation ostensibly depends on how the domain and codomain contexts are partitioned. We take these case by case.

  • Consider M(Γ,Γx:Tpq::Δ,Δ). By disjointness, Δ and Δ must respectively contain only outputs of p and q, so this is unambiguous; the remaining free variables of p and q must respectively go into Γ and Γ. Any remaining free variables, whether assigned to Γ or Γ, must be interpreted by ε, which eliminates any remaining ambiguity.

  • In M(x:A,Γp[x1/x][x2/x]::Δ), there is formally a choice to make about how to assign the instances of x to x1 or x2; however, since the inductive construction will eventually disambiguate between any pair of repeated instances, commutativity and associativity of δ guarantee that any such choice will result in the same interpretation (considering also that the interpretation is invariant under α-equivalence).

  • Similarly, distinguishing duplicates of variables in the codomain produces a well-defined result by commutativity and associativity of δ, so we are done.

Next, given f:=M(Γp::), we have that M(Γp2::) is exactly (ff)δ. As such, when these interpretations are equal, we may take M(Γp¯::) to be f¯ provided by Definition 3, thus extending the above to monomials featuring p¯.

Finally, we define M(Γ0::Δ) to be the zero morphism of the appropriate type.

Lemma 23.

Suppose we are given a theory 𝔗 over a signature 𝔖 and a 𝔖-structure M in 𝒜. Suppose that whenever we have positive monomials-in-context Γp::Δ and Γq::Δ such that pΓ,Δq, it is the case that M(Γp::Δ)=M(Γq::Δ), so that in particular M can interpret all monomials which are -polynomials. Suppose further that M identifies p and q whenever pq when p and q are either monomials or 0. Then p𝔗q implies the pairing p,q exists in 𝒜.

Proof.

It suffices to check the axioms of Fig. 3 which determine the compatibility relation. Indeed, pq0 guarantees that if M respectively interprets p,q as f,g in a given context then the first axiom of ultrarings Definition 3 ensures that the pairing exists.

The pairing of two components j,j of (the interpretation of) a generator g is the result of coinjecting g onto the coproduct of their codomains.

If pq and p,q exists, we can obtain the pairing of the interpretations of x,yspr and x,ztqr by precomposing with r and postcomposing with st.

The existence of pairings in the last instance is immediate, so we are done.

As such, given 𝔗 and a model M satisfying the conditions of Lemma 23, M has a well-defined interpretation of any -polynomial-in-context Γp::Δ as the joint pairing of the monomials appearing in p (with the same context), followed by the codiagonal map.

Proposition 15. [Restated, see original statement.]

Let 𝔗 be a theory. There is an 𝒜-natural equivalence of categories 𝔗-Mod(𝒜)𝐔𝐑𝐢𝐧𝐠(𝔽1[𝔗],𝒜).

Proof.

We have thus far shown that a 𝔗-model M in 𝒜 uniquely determines interpretations of 𝔗-polynomials-in-context. To produce a functor 𝔽1[𝔗]𝒜, we need to extend this to 𝔗-matrices. Each entry of a matrix (pjk) determines a morphism M0(Tk)M0(Uj). Condition () of Definition 10 ensures that for fixed k, the interpretations of pjk can be paired to give a morphism M0(Tk)jJM0(Uj); via the universal property of the coproduct, these produce a morphism kKM0(Tk)jJM0(Uj). This extended construction ensures that the monoidal product and coproduct, as well as δ, δ and ϵ, are preserved.

Conversely, a morphism of ultrarings F:𝔽1[𝔗]𝒜 defines a model M by its restriction to the sorts and generators. The equations of 𝔗 necessarily hold because they correspond to morphisms forced to be equal in 𝔽1[𝔗], so are mapped by F to the equal morphisms in 𝒜.

It is straightforward to verify that a model morphism uniquely determines a monoidal natural transformation, and conversely, since the latter are determined by their components at objects which generate the category under monoidal products and coproducts.

Finally, naturality in 𝒜 follows from the fact that morphisms of ultrafunctors preserve the required structure: composing with an ultraring morphism 𝒜 turns a 𝔗-model in 𝒜 into one in .

Theorem 17. [Restated, see original statement.]

Let be an ultraring and 𝔗 its canonical theory, as defined in Definition 16. Then 𝔽1[𝔗].

Proof.

We have a functor :𝔽1[𝔗] sending each object X to the sort X and each morphism g:XY to the corresponding generator (with no decomposition of X and Y as tensors or coproducts). We show that is an equivalence of ultrarings.

Consider the generators (which we distinguish by a subscript) id1:jJAjjJAj and id2:jJAjjJAj. By the second and first equations, these are mutual inverses in 𝔽1[𝔗]. Moreover, naturality of these morphisms follows from the fourth axiom (applied inductively), so preserves the monoidal product.

Consider the generator id:jJAjjJAj. By the third equation, we have that (idj(x)=y)(ιj(x)=y), so this is equal to the row vector (ιj1,,ιjn).

Dually, we have generators ιi:AijJAj. By the third, first and fifth equations, we have (ιij(x)=y)(ιjιi(x)=y) which gives (x=y) if i=j and 0 otherwise. Thus preserves the coproduct injections; in particular, these morphisms are compatible, so we can construct the column vector (ιj1,,ιjn)t. We can use the second and third axioms to conclude that this column vector is the inverse to id, so preserves coproducts. Formally, we must also check that the universal morphisms are respected by this isomorphism, in the sense that y([f1,,fn](x)=y)(id(y)=z)y(id(x)=y)((f1,,fn)(y)=z). It suffices to check this componentwise by composing with ιi, which works by the preceding observations and the second axiom.

For the δ-category structure, we observe that the sixth, seventh and eighth axioms directly ensure that these are preserved up to the isomorphisms constructed above. With this, we have shown that is a valid morphism of ultrarings.

Conversely, there is a canonical model of the canonical theory 𝔗 in , given by interpreting A as A and g as g (with the relevant typing). The claim that this 𝔖-structure is indeed a model amounts to saying that the interpretations of the monomials appearing in the axioms of Definition 16 are equal in , which is straightforward to check.

Finally, to see that is an equivalence, we simply observe on the one hand that the induced model in 𝔽1[𝔗] is isomorphic to that corresponding to the identity functor and on the other that the induced endofunctor of is naturally isomorphic to the identity. The involved natural isomorphisms are the structural ones constructed above.

A.3 Harmless Predicates Over the Real Numbers

Lemma 24.

In the case 𝕂=, the truth value of a harmless predicate may be computed in constant time on a -RAM.

Proof.

For each harmless predicate P we have an equation of the form P(t)φ(t)Γ0, so for each t, to know whether P(t) is true in a given model in we just need to check whether the interpretation of φ(t) has a root in . The idea here is to reduce this problem as a series of positivity tests that can be done in constant time by generalizing the idea of the discriminant for n variate polynomials of degree two. Let us give some details about this generalization.

If the polynomial is of degree zero the test is trivial because it has no roots. If it is of degree one, since every polynomial of of odd degree have a root in , we know that there is a root in . The only non trivial case is the degree two. Since we work in the polynomial has a root in iff it is reducible. First, let us do the special case of an homogeneous polynomial. A quadratic form q can be written as a matrix multiplication xTAx, where A is the Kronecker matrix of the quadratic form and is a symmetric matrix. We now show that A has rank one iff q is reducible. First if q is reducible then we can write the q as (ibixi)(icixi), by rewriting it with matrices multiplication q=xT(b0bn)(111111111)(c0cn)x so A is of rank 1. Conversely if A is of rank one, since we know that A is a real symmetric matrix, it is diagonalizable. Hence, A is similar to (000000001) which is also similar to (111111111) thus we can rewrite q as a product of two degree one polynomials. Moreover A is of rank one iff it has exactly one non-zero eigenvalue. Hence, we need 0 to be root of its characteristic polynomial with multiplicity m1, m being the number of variables, we can then rewrite the general form of the characteristic polynomial as λm1((1)mλ+(1)m1Tr(A)). By identifying with the formula det(AλIm) we are given a set of constraint on the coefficients of the quadratic form for it to be reducible. Let us now consider a general multivariate polynomial of degree two. We can write it as p=i,jai,jxixj+iaixi+iai′′ the xi being variables taken in a set X. The following polynomial q=i,jai,jxixj+y(iaixi)+y2(iai′′) is a quadratic form. We need to show that q is reducible iff p is. This comes from the fact that if we note x:=(x0,,xm,1) we have p=xAxT where A is the Kronecker matrix of q. To go from a factorisation of q to one of p is simply to replace y by 1 and the other way is only multiplying constant terms of each factor by y.

To conclude, we need to show that these constraints we exhibited are fixed by the theory 𝔗 and can be hardcoded as a sequence into the code of the machine for each harmless predicate in 𝔗. This means the machine doesn’t have to compute the characteristic polynomial each time but only compute the set of constraint we can deduce of it, this can be done in constant time. Since the polynomial might depend on non-harmless generators they should all be computed by the machine before the harmless predicate, which can be done because, by definition, non-harmless generators only depends on t1 generators.