Sketches for arithmetic universes

A theory of sketches for arithmetic universes (AUs) is developed. A restricted notion of sketch, called here"context", is defined with the property that every non-strict model is uniquely isomorphic to a strict model. This allows us to reconcile the syntactic, dealt with strictly using universal algebra, with the semantic, in which non-strict models must be considered. For any context T, a concrete construction is given of the AU AUfreely generated by it. A 2-category Con of contexts is defined, with a full and faithful 2-functor to the 2-category of AUs and strict AU-functors, given by T |->AU. It has finite pie limits, and also all pullbacks of a certain class of"extension"maps. Every object, morphism or 2-cell of Con is a finite structure.


Introduction
This paper arises out of a programme [Vic99] to use arithmetic universes (AUs) to provide a predicative and base-free surrogate for Grothendieck toposes as generalized spaces (and covering also point-free ungeneralized spaces such as locales or formal topologies).
Briefly, a generalized space is presented by a geometric theory T that describes -as its models -the points of the space, and then the classifying topos S[T] is a presentation-independent representation of the space. In the case of a theory for an ungeneralized space, the topos is the category of sheaves. In general, it embodies (as its internal logic) the "geometric mathematics" generated by a generic model of T. In other words, it is the Grothendieck topos presented by T as a system of generators and relations.
Continuous maps (geometric morphisms) can be expressed as models of one theory in the classifying topos of another -this is the universal property of "classifying topos" -and so this also provides a logical account of continuity. A map from T 1 to T 2 is defined by declaring, "Let M be a model of T 1 ," and then defining, in that context (in other words, in S[T 1 ], with M the generic model), and within the constraints of geometricity, a model of T 2 . From this point of view one might say that continuity is logical geometricity. See [Vic14] or [Vic07] for a more detailed account of the ideas.
A significant problem in the approach is that the notions of Grothendieck topos and classifying topos are parametrized by the base topos S, whose objects supply the infinities needed for the infinite disjunctions needed in geometric logic, and for the infinite coproducts needed in the category of sheaves -for example, to supply a natural numbers object. Technically, Grothendieck toposes (with respect to S) are then elementary toposes equipped with bounded geometric morphisms to S.
The aim of the AU programme is to develop a framework in which spaces, maps and other constructions can be described in a way that does not depend on any choice of base topos. In this "arithmetic" logic, disjunctions would all be finite, but some countable disjunctions could be dealt with by existential quantification over infinite objects (such as N) defined using the list objects of AUs. Thus those infinite disjunctions become an intrinsic part of the logicalbeit a logic with aspects of a type theory -rather than being extrinsically defined by reference to a natural numbers object in a base topos. Now suppose a geometric theory T can be expressed in this arithmetic way. We write AU T for its classifying AU, which stands in for the base-dependent classifying topos S [T]. An AU-functor 1 h : AU T 1 → AU T 0 will, by composition, transform models of T 0 in any AU into models of T 1 , and is fruitfully thought of a point-free map between "spaces of models" of the two theories. In particular, for any base topos S with nno, h will transform the generic model of T 0 in S[T 0 ] into a model of T 1 and so induce a geometric morphism from S[T 0 ] to S[T 1 ]. Thus a result expressed using AUs would provide a single statement of a topos result valid over any base topos with nno.
It is already known that a range of results proved using geometric logic can in fact be expressed in the setting of AUs. [MV12] develops some techniques for dealing with the fact that AUs are not cartesian closed in general, nor even Heyting pretoposes.
This would be fully predicative, in that it does not at any point rely on the impredicative theory of elementary toposes (with their power objects). Instead of a predicative geometric theory of Grothendieck toposes, parametrized by an impredicative base elementary topos, we have a predicative arithmetic logic of AUs that is itself internalizable in AUs, and so depends on a predicative ambient logic. (This internalizability aspect will be seen in, e.g., Section 9, where we give a concrete construction of the AU presented by a context.) In the present paper we propose a definition of arithmetic theory T (our contexts) and define a 2-category Con (Section 8) that deals with the classifying AUs AU T in an entirely finitary way using presentations.
• The objects are (certain) finite presentations for AUs.
1 For the moment we ignore issues of strictness.
• The collection of objects is rich enough to encompass practical mathematics including the real numbers.
• The morphisms and 2-cells are such as to give a full and faithful 2-functor to AUs when the presentations are interpreted as the AUs that they present.
Presentations: In principle, the quasiequational theories of [PV07] provide a means of presenting AUs by generators and relations. However, for various reasons we find it more convenient to use a technique based on sketches (Section 3). Our "contexts" (Section 4) are then a restricted form of sketches, built up by finitely many steps of adjoining objects, morphisms, commutativities, and "universals" (for limit cones, colimit cocones, and list objects).
The main difference from quasiequational presentations is that the contexts do not allow the possibility of expressing equality between objects, except when they are either declared as the same node or constructed by identical universal constructions from equal data.
This restriction is also relevant when it comes to Strictness: The technology of universal algebra relies on the universal constructions such as pullbacks being interpreted strictly, since in the algebra they appear as expressions. As part of this, when one considers AU-functors between the AUs presented by presentations, it is only the strict AU-functors that can be described exactly in terms of the presentations.
On the other hand, non-strict AU-functors will be important, particularly in topos applications. Although every elementary topos with nno is an AU, and every inverse image functor part of a geometric morphism is an AU-functor, it is highly unlikely to be strict.
Models of an AU sketch can be interpreted in the non-strict way that is usual for sketches, but can also be interpreted strictly. Then an advantage of our contexts is that each non-strict model is uniquely isomorphic to a strict model. (The restrictions on our ability to express equalities between pairs of nodes are important here.) Hence it is straightforward to apply the strict theory to non-strict models.
Full faithfulness: A principal goal (Theorem 50) is that arbitrary strict AUfunctors between presented AUs should be expressible up to equality in terms of the presenting contexts. Our initial notion of morphism between contexts is that of sketch homomorphism, but this is entirely syntax-bound and insufficiently general. It maps nodes to nodes, edges to edges, commutativities to commutativities, etc. We need two technical ingredients to get beyond this.
Object equalities (Section 6) deal with the fact that, although our contexts do not allow us to express arbitrary equalities between objects, implied equalities can arise when identical constructions are applied to equal data. An object equality between objects is a fillin morphism that arises in that kind of way. Note that this is much stronger than simply having an isomorphism. We extend the phrase "object equality" to apply more generally to homomorphisms of models in which every carrier morphism is an object equality.
Equivalence extensions (Section 5) accommodate our need to map elements of one context not just to elements explicitly in another (which is what a context homomorphism does), but also to derived elements. An equivalence extension of a context adjoins elements that are uniquely determined by elements of the original, so that the presented AUs are isomorphic. This is essentially the idea of "schema entailment" as set out in [Vic95].
Our category Con (Section 8), which maps fully and faithfully to AUs and strict AU-functors, is then made by turning object equalities to equalities and making equivalence extensions invertible.
Note on notation: Our default order of composition of morphisms is diagrammatic. For applicational order we shall always use "•". For diagrammatic order we shall occasionally show this explicitly using ";".
More explicitly, as a pretopos an AU A is a category equipped with finite limits, stable finite disjoint coproducts and stable effective quotients of equivalence relations. (For more detailed discussion, see, e.g., [Joh02,A1.4.8].) In addition, it has, for each object A, a parametrized list object List(A). It is equipped with morphisms (where cons(a, x) = a : x is the list x with a appended at the front) and whenever we have the solid part of the following diagram, there is a unique fillin of the dotted parts to make a commutative diagram.
In other words, this recursively defines r = rec A (y, g) by Note that the use of B rather than 1 corresponds to this being a parameterized list object -that is to say, it makes List(A) × B a list object in the slice over B.
Remark 1 For future reference, we note the functoriality of List: If f : A 1 → A 2 , then there is a unique List(f ) : List(A 1 ) → List(A 2 ) making the following diagram commute.
To see this, consider the action of A 1 on List(A 2 ) by We assume the AU structure specifies canonical choices of those colimits, limits and list objects. This enables an approach using the universal algebra of cartesian theories, with (partial) algebraic operators for the canonical choices.
We shall use the quasiequational form of cartesian theories [PV07]. Our cartesian theory of AUs will use primitive operators as suggested by the following proposition, although that particular choice of primitives is not critical. Doubtless there are more efficient characterizations, and the techniques in the remainder of the present paper are intended to be equally applicable for other choices.
Proposition 2 A category A is an arithmetic universe iff the following hold.

1.
A has a terminal object and pullbacks (hence all finite limits).

2.
A has an initial object and pushouts (hence all finite colimits), and they are stable under pullback.
3. Balance (unique choice): if a morphism is both mono and epi, then it is iso.
4. Exactness: any equivalence relation is effective (it is the kernel pair of its own coequalizer).

5.
A has parameterized list objects.
Proof. ⇒: (1), (3) and (4) are properties of any pretopos, as is the existence of stable finite coproducts. (5) is a postulate for AUs. Hence it remains to show the existence of stable coequalizers for all pairs X ⇒ Y . First, because, as pretopos, A is regular, we can take the image R in Y × Y , a relation on Y . Next, in a pretopos we can find the reflexive-symmetric closure of R. Next, in an AU we can find the free category over any directed graph, and in particular we can find the transitive closure of any relation. We end up with the equivalence relation generated by R, and at each step, we keep the same set of morphisms from Y that compose equally with the two morphisms from X or R. Thus the coequalizer of the equivalence relation, existing because of exactness of A as pretopos, also serves as a coequalizer for X ⇒ Y .
Stability follows from the stability, in a pretopos, of image factorization and of coequalizers of equivalence relations.
⇐: Two properties of pretoposes remain to be proved. First, for binary coproduct, the injections are monic and disjoint. Second, any epi is the coequalizer of its kernel pair.
Consider a coproduct cocone (bottom row here) pulled back along one of the injections. The two squares are pullbacks, ∆ is diagonal.
By stability the top row is a coproduct cocone, and so we can define a copairing morphism f = [Id K , q 2 ∆] : X → K and calculate that f = p −1 2 . Since the kernel pair projection p 2 is an isomorphism, it follows that i 1 is monic.
We can now replace K and the projections by X and identity morphisms, and the coproduct property of the top row can be rephrased as follows: every Now consider ! : 0 → L. By stability of the initial object, we see that ! is mono. It is also epi. For suppose we have two morphisms f 1 , f 2 : L → Z. Consider the following diagram, where j 1 and j 2 are coproduct injections.
Both squares must commute, and we already know that j 1 is monic, so f 1 = f 2 . By balance, it follows that L ∼ = 0. It remains to show that any epi e : X → Y is the coequalizer of its kernel pair. In fact we show something slightly more general, without assuming e is epi. Let K 2 be its kernel pair, with projections p 1 and p 2 , and let e ′ : X → Y ′ be their coequalizer, with factorization e = e ′ e ′′ . Then we show that e ′′ is mono.
(If e is epi then so too is e ′′ , so e ′′ is an isomorphism by balance.) In the following diagram, where the bottom row is pulled back along e, we see that the top row is a split fork and hence a coequalizer.
Next, a pairing operator ·, · ·,· : arr 4 → arr, with v 1 , v 2 u1,u2 the fillin to the pullback of u 1 and u 2 for a cone (v 1 , v 2 ). It is defined iff the four arrows make a commutative square in the obvious way, and it has the expected domain and codomain and commutativities.
For uniqueness of fillins, • We shall also use some derived notation in a self-explanatory way for products X × Y = P ! 1 , and the fillins require no subscripts.
Also, we shall write eq u1,u2 : E u1,u2 → X for the equalizer of u 1 , u 2 : X → Y , defined in a canonical way. Specifically, eq u1,u2 p 1 id(X),u1 , id(X),u2 (The two projections are equal.) • Ingredients for initial objects and pushouts. They are dual to those for terminal objects and pullbacks. (We can also express coproducts and coequalizer, by dualizing the treatment for products and equalizers.) For initial objects we have a constant 0 : obj, an operator ! 0 · : obj → arr, and a conditional equation that if d(u) = 0, then u = ! 0 c(u) . Operators q 1 ·,· , q 2 ·,· : arr 2 → arr are for pushout injections. If u 1 and u 2 have a common domain, then q 1 u1,u2 and q 2 u1,u2 are the two injections to the pushout. We also write q u1,u2 for q 1 u1,u2 • u 1 , the diagonal of the pushout square, and Q u1,u2 for c(q u1,u2 ), the pushout object itself.
For uniqueness of fillins, • Ingredients for stability of colimits under pullback.
For stability of the initial object, it suffices to say that any morphism with 0 for codomain is an isomorphism: For stability of pushouts, we have an operator stab ·,· (·) : arr 3 → arr, with stab u1,u2 (w) defined iff c(w) = Q u1,u2 . To express its equations, we define notation as shown in this diagram. Here the base diamond is a pushout, and it is pulled back along w. The inner top diamond is also a pushout, with fillin e, and the equations for the operator, when it is defined, are those required to say that stab u1,u2 (w) = e −1 .
We have an operator uc : arr → arr, with uc(u) defined if p 1 u,u = p 2 u,u and q 1 u,u = q 2 u,u (i.e. u is monic and epi). When it is defined we have uc(u) = u −1 .
We require that π in monic; that X 2 = P π2,π1 ; that r, s, t compose correctly with π 1 and π 2 ; that γ is the canonical coequalizer of π 1 and π 2 ; that K is the kernel pair of γ; and that e is the fillin. Our characterizing equations for ex are to say ex(π 1 , π 2 , r, s, t) = e −1 .
• Ingredients for list objects.
We have total operators ε, cons: obj → arr for the principal structure, and we also write List(A) for c(ε(A)).
Let us write, temporarily, the following. (See diagram (1).) Here φ expresses the domain of definition of the fillin rec A (y, g), and ψ is the condition (on r) that it needs to satisfy. The axioms are now - Definition 4 A strict AU-functor from one AU to another is a homomorphism for the quasiequational theory of AUs. In other words, it is a functor that preserves terminals, pullbacks, intials, pushouts and list objects strictly.
An AU-functor is a functor that preserves those constructions (and hence also all finite limits and finite colimits) up to isomorphism.
In AUs we have a general ability to construct free algebras. For theories given by finite product (FP) sketches this is described in some detail in [Mai05]. That paper also alludes to the ability to generalize to finite limit (FL) sketches, in other words to cartesian theories. [PV07] gives a general account of the cartesian construction, and it is valid in AUs.

AU-sketches
We shall be interested in generators and relations for AUs, but we shall generally not express them directly using the quasiequational algebra. Instead, we borrow the ideas of sketches.
In their most general form (in this section), they are equivalent in expressive power to the quasiequational algebra. In one direction we make this explicit by giving the equations that correspond to ingredients of a sketch. The other direction is less clear, but comes down to the question of how to express the operators in the quasiequational theory of AUs. The operators for pullbacks and their projections, and analogous operators for other universal constructions, can be captured using the "universals" in a sketch. The operators for fillins, being the unique solutions to certain equational constraints on edges, can be captured with edges constrained by suitable commutativities.
Our main reason for using the sketches is that they give us better control of the important issue of strictness of models (Section 3.1). In Section 4 we shall restrict our attentions from general sketches to "contexts", finite sketches for which we have good coherence properties for strictness.
Definition 5 An AU-sketch (or just sketch) is a structure with sorts and operations as shown in this diagram.
They are required to satisfy the following equations: If T 1 and T 2 are sketches, then a homomorphism of sketches from T 1 to T 2 , written f : T 1 ⋖ T 2 , is defined in the obvious way -a family of carrier functions, one for each sort, preserving the operators.
However, we shall consider two sketch homomorphisms to be equal if they agree merely on G 0 and G 1 .
We write Sk ⋖ for the category of sketches and sketch homomorphisms.
The structures are a formalization of the sketches well known from e.g. [BW84], but adapted for AUs. We shall describe the parts in more detail below, but as a preliminary let us introduce some language that indicates the connection. The elements of G 0 , G 1 and G 2 are referred to as nodes, edges and commutativities.
The elements of the other sorts are universals, and specify universal properties of various kinds for their subjects. For example, an element of U pb is a pullback universal and corresponds to a cone in a finite limit sketch. Its subjects are the pullback node and the three projection edges of the pullback cone. Similarly, an element of U list is a list universal. Its subjects are the list object and the two structure maps, for ε and cons. It will also have indirect subjects, since it needs terminal and pullback universals to express the domains of the structure maps.
Any sketch can be used as a system of generators (the nodes and edges) and relations to present an AU. We shall list these implied relations in the general description below. Note that in each case the equations constraining sketches ensure that all the terms used in the relations are defined. G 0 , s, G 1 , d 0 , d 1 form the graph (which we take to be reflexive) of nodes and edges, declaring some objects and arrows and specifying their identities, domains and codomains. The elements of G 0 and G 1 are taken as generators of sorts obj and arr. The implied relations are - G 2 , with d 0 , d 2 and d 1 , comprises the commutativities, stipulating commu- shall write uv ∼ XY Z w for the existence of a commutativity with that triangle.
(Note the diagrammatic order.) We shall also write u ∼ XY u ′ for a unary commutativity, meaning a commutativity s(X)u ∼ XXY u ′ . We shall omit the node subscripts where convenient. Equationally, each commutativity ω corresponds to a relation U 1 and U pb , using t, Γ 1 , Γ 2 , are universals for finite limits, here terminal objects or pullbacks. For each pullback universal (in U pb ) we describe the cone by two commutative triangles (Γ 1 , Γ 2 ), the two halves of the pullback square. For universals ω ∈ U 1 or ω ∈ U pb , the implied relations are - are similar, and dual, for finite colimits.

Models
Definition 6 Let T be a sketch and A an AU.
A strict model of T in A is an interpretation of nodes and edges in T as objects (carriers) and morphisms (operations) in A, in a way that respects all the implied relations of the sketch strictly, i.e. up to equality.
A model of T in A is an interpretation of nodes and edges in T as objects and morphisms in A, in a way that respects up to equality all the domains, codomains, identities and commutativities of the sketch, and up to isomorphism all the universals. In other words, the subjects of each universal have to have the appropriate universal property, but do not have to be the canonical construction.
A homomorphism between models of T in an AU A comprises a carrier morphism for each node, together commuting with the operations in the appropriate way. This can be conveniently expressed as a model of T in the comma category A ↓ A, also an AU. (See [MV12] for results concerning these comma categories and their AU structure, and also for the related pseudopullback A ↓∼ = A. )

We write T-Mod(A) for the category of models of T in A, and T-Mod s (A)
for the full subcategory of strict models.
If h : A → B is an AU-functor, then we obtain a functor If h is a strict AU-functor, then T-Mod(h) preserves strictness of models.
As we remarked earlier, any sketch T can be treated as generators and relations for presenting an arithmetic universe, using the fact that the theory of AUs is cartesian (see [PV07]). We shall write this as AU T . It is the AU version of the notion of classifying category, and we shall call it the classifying AU for T. It is the analogue of the classifying topos when geometric logic is replaced by an arithmetic form.
The injection of generators provides a strict generic model M G of T in AU T , and then the universal property is that any strict model M of T in an AU A extends uniquely to a strict AU-functor h : AU T → A for which T-Mod(h) transforms M G to M -up to equality. (This is analogous to the universal property for classifying toposes, with strict AU-functors corresponding to the inverse image parts of geometric morphisms, but note that the AU property is stricter.) Thus strict models of T are in bijection with strict AU-functors out of AU T . We have already seen that a non-strict AU functor out of AU T will also give rise to a non-strict model of T, the non-strict image of the generic model. However, the universal property does not allow us to recover the nonstrict AU-functor from the model. Hence the universal algebra is less precise for non-strict models and AU-functors. In Section 4 we restrict the notion of sketch in a way that gives better control over the non-strict models.
Definition 7 Let f : T 1 ⋖ T 0 be a homomorphism of sketches, 2 and M a model of T 0 in A. Then the f -reduct of M , written M |f , is the model of T 1 whose carriers and operations are got by taking those for M corresponding by f . It is a model because the sketch homomorphism transforms all the implied relations of T 1 into implied relations of T 0 .
Model reduction is functorial with respect to model homomorphisms, and so the assignment T → T-Mod(A) is the object part of a contravariant categoryvalued functor (−)-Mod(A) on Sk ⋖ , with sketch homomorphisms assigned to model reduction.
Model reduction preserves strictness.
By taking the f -reduct of the generic model in AU T 0 , we get a strict model of T 1 in AU T 0 and hence a strict AU-functor AU f : AU T 1 → AU T 0 .

Examples of sketches
Here are some examples of sketches. Again, the notation is adapted to thinking of the sketch as prescribing a class of models in each AU.
1. The empty sketch 1 1 has a unique model in any AU.
2. The sketch O has a single node and its identity edge and nothing else. Its models in A are the objects of A.
3. Let T and U be two sketches. Their disjoint union is called the product sketch T × U. Its models are pairs of models of T and U. We also use notation such as T 2 for T × T.

Let
T be a sketch. The hom sketch T → is made as follows. First, take two disjoint copies of T as in T 2 , distinguished by subscripts 0 and 1. These give two sketch homomorphisms i 0 , i 1 : T → T → . Next, for each node X of T, adjoin an edge θ X : X 0 → X 1 ; and, for each edge u : X → Y of T, adjoin an edge θ u : X 0 → Y 1 together with two commutativities to make a commutative diagram Then a model of T → comprises a pair M 0 , M 1 of models of T, together with a homomorphism θ : M 0 → M 1 .
The assignment T → T → extends functorially to sketch homomorphisms, and then i 0 and i 1 become natural transformations. 5. We shall also write T →→ for the theory of composable pairs of homomorphisms of T-models, and analogously for greater numbers of arrows. In fact, for any finite 3 category C we can write T C for the theory of C-diagrams of models of T.
The existence of T → enables us to define 2-cells in . We also say that α is between T 0 and T 1 .
2-cells cannot yet be composed, either vertically or horizontally, because edges cannot be composed in sketches. However, we do have whiskering on both sides, using either αf or f → α, and it has all relevant associativities.
We can also take reducts along 2-cells. If M is a model of T 0 in A, then the homomorphism M |γ : M |f 0 → M |f 1 uses the carrier functions of T → 1 as interpreted in T 0 .

Extensions, contexts
In this section we define a class of sketches, the contexts, for which every nonstrict model can be made strict in a unique way.
What makes this non-trivial is that in general, strictness has the ability to assert equalities between sorts by making a single node X the subject of two different universals, for example making it both A × B and List C. In a nonstrict model this just requires A × B ∼ = List C, whereas strictness would require equality; and in an AU it can easily happen that the first holds but not the second. Such equalities are not really the concern of category theory, so better would be to have universals specifying two nodes X 1 and X 2 as A×B and List C respectively, and then to specify an isomorphism X 1 ∼ = X 2 . Strict models of that are unproblematic.
To enforce the latter kind we shall use each universal with a simple definitional effect, defining its subjects fresh from some other ingredients (nodes and edges) defined previously. This leads to our notion of extension of sketches. To prepare for this, we introduce a notion of protoextension, in which the syntactic notion of freshness is represented using categorical coproducts.
We say that a set is strongly finite if it is isomorphic to a finite cardinal {1, . . . , n} for some n ∈ N. Equivalently, it is Kuratowski finite, has decidable equality, and can be equipped with a decidable total order.
Definition 8 A sketch homomorphism i ′ : U⋖U ′ is a protoextension if for each sketch sort Ξ, we have that U ′ Ξ can be expressed as a coproduct U Ξ + δΞ, with i ′ Ξ a coproduct injection and δΞ strongly finite.
Proposition 9 Let i ′ : U ⋖ U ′ be a sketch homomorphism. Then the following are equivalent.
2. i ′ is a pushout of some strongly finite sketch inclusion, by which we mean a sketch monomorphism i : T ⋖ T ′ in which T and T ′ are strongly finite (i.e. their carriers are). Proof.
(2) ⇒ (1): Let i : T ⋖ T ′ be a strongly finite sketch inclusion. For each sketch sort Ξ, we can write T ′ Ξ as a coproduct T ′ Ξ = T Ξ +δΞ. (Informally in such a situation, we shall often write T ′ as T + δT, although this is not a coproduct of sketches. δT is not a sketch in its own right, as some of its structure may lie in T.) Now let f : T ⋖ U be an arbitrary sketch homomorphism. Then the pushout i ′ : U ⋖ U ′ of i along f can be constructed as follows.
For each sketch sort Ξ, we let U ′ Ξ = U Ξ + δΞ. For elements of U Ξ , their structure is determined as in U. Now suppose ω ∈ δΞ. In T+δT, each structural element of ω (i.e. the result of applying a sketch operator) is in either T or δT. If the latter, then we keep it there in U ′ . If the former, then we apply f to get it in U. We obtain a commutative diagram of sketches that is readily verified to be a pushout: From the construction, i ′ is clearly a protoextension.
(1) ⇒ (2): Use the elements of the δΞs as generators for a sketch T ′ , with relations to say that the sketch operations in U ′ are preserved insofar as they stay in the δΞs. Then T ′ is strongly finite, and the inclusion of the δΞs in U ′ induces a sketch homomorphism f ′ : Let T be the pullback of i ′ and f ′ , with projections i and f . i is monic, because i ′ is. Also, in a coproduct the images of the injections are decidable subobjects, and it follows that the carriers of T are decidable subobjects of those of T ′ , and so T too is strongly finite.
Applying the construction of (2) ⇒ (1), we recover i ′ . It was already clear from the definition that protoextensions are closed under composition. From Proposition 9 it is also clear that protoextensions i ′ are closed under pushout along any sketch homomorphism g. The pushout is called the reindexing of i ′ along g, and written g(i ′ ).

Extensions: the definition
In the following definition, central to the whole paper, we restrict our protoextensions by restricting the strongly finite sketch inclusions i of Proposition 9. First we define a finite family of inclusions i : T ⋖ T + δT that are generic for simple extensions, and then a general extension (written ⊂) is a composite of simple extensions.
For each kind of simple extension, using an inclusion i, the sketch homomorphism f : T ⋖ U that we reindex along can be understood as a data configuration in U, some tuple of elements satisfying some equations. Thus each kind of simple extension can be understood as a sketch transformation that takes data (given by f ) and delivers a delta, according to Proposition 9.
Since any sketch homomorphism will transform extension data to extension data, we see that reindexing (as sketch pushout) is got by applying the same extension to the transformed data. For an extension c : T 1 ⊂ T ′ 1 , we shall typically write a reindexing square as (4) Definition 10 A simple extension is a proto-extension got as a pushout of one of the following strongly finite sketch inclusions i : T ⋖ T + δT. Where we don't specify δΞ, it is empty.
1. (Adding a new primitive node) No data (i.e. T is 1 1). Deltas: In other words We shall use similar informal notation in the other cases. Note that the "delta" edges are shown dotted.
3. (Adding a commutativity) Data: In other words 4. (Adding a terminal) No data. Deltas: Adding an initial object is similar.
5. (Adding a pullback) Data: Adding a pushout is similar.
6. (Adding a list object) Data: A ∈ G 0 . Deltas: An extension of sketches is a proto-extension that can be expressed as a finite composite of simple extensions. We write T 1 ⊂ T 2 .
An AU-context is an extension of the empty sketch 1 1.
Proposition 11 Let c : T 1 ⊂ T 2 be an extension of sketches. Then for each fresh node or edge α in T 2 there is an AU expression w α , well defined from the structure of T 2 , by which, in any strict model, the interpretation of α can be found from those of the primitives and T 1 .
Proof. By inspecting the cases, we see that for a simple extension each fresh node or edge can be described uniquely in one of the following ways. For nodes: the node is primitive or takes one of the forms For edges: the edge is primitive or takes one of the forms These facts are preserved by subsequent simple extensions, since those forms are only introduced for fresh nodes or edges. It follows that the facts remain true for the composite extension.
We can now apply an induction on the number of composed simple extensions, and use the equations for strict models that are imposed by the sketch structure. We look explicitly at universals for pullbacks and list. Other situations are similar or easier.
First, consider a simple extension in the form of a pullback universal ω, The relations for such a universal tell us that the fresh edge d 0 Γ 1 (ω) has to be interpreted as p 1 u1,u2 , and we use induction to find the expressions for u 1 and u 2 . (The base case is if they are primitive or in T 1 .) The other fresh edges and the fresh node are dealt with in a similar way. Note that if ω = Λ 2 (ω ′ ) for some ω ′ ∈ U list , then the subjects of ω are treated in the same way, but u i = d 2 (Γ i (ω)) gets its expression from ω ′ . Now consider a simple extension in the form of a list universal ω, on object A. All the fresh nodes and edges have expressions in terms of A. For e(ω) and c(ω) and their codomain this is clear. Next, from the terminal universal Λ 0 (ω) we have t(Λ 0 (ω)) = 1. Because this appears as a vertex in the pullback square Λ 2 (ω), it follows from the AU axioms that d 2 (Γ 1 (Λ 2 (ω))) = ! 1 A and d 2 (Γ 2 (Λ 2 (ω))) = ! 1 List(A) . Since these are u 1 and u 2 in the treatment of the pullback universals, it only remains to deal with the easy case of the identity morphisms.
Note that a primitive edge can acquire equality with an AU-expression by subsequently added commutativities. We shall use this later for introducing AU operators that have not been mentioned so far in extensions.

Strictness results
The reason for introducing extensions was for an important property that nonstrict interpretations can be reinterpreted strictly in a unique way. The following definition and lemma will make this precise, albeit in a generality whose usefulness will only be seen in sequel papers.
Definition 12 Let T ⊂ T ′ be a sketch extension. A model of T ′ is strict for the extension if, for each universal, each subject node or edge is equal to the result of its expression.
Note that a model of T ′ is strict in its own right iff it is strict for the extension and its T-reduct is strict.
Lemma 13 Suppose, as in the diagram below, an extension T 1 ⊂ T ′ 1 is reindexed along a sketch homomorphism T 1 ⋖ T 0 . Suppose also that in some AU A we have models M 0 and M ′ 1 of T 0 and T ′ 1 , with an isomorphism φ : 4. φ ′ is equality on all the primitive nodes for the extension T 1 ⊂ T ′ 1 .
Proof. It suffices to cover the cases for a simple extension T 1 ⊂ T ′ 1 . If the extension adjoins a primitive node X, then we can and must take its carrier in M ′ 0 to be equal to its carrier in M ′ 1 , and the carrier function in φ ′ to be the identity.
Suppose the extension adjoins a primitive edge u : X → Y . Then φ ′ must equal φ, and to preserve the homomorphism property we can and must define the operation for u in M ′ 0 to be φ(X)M ′ 1 (u)φ −1 (Y ), using the operation in M ′ 1 . If the extension adjoins a new commutativity, then the morphism equation already holds in M ′ 1 |T 1 and hence in M 0 , so we can and must take M ′ 0 and φ ′ to be given by the same data as M ′ 1 and φ. It remains only to examine the case where the extension adds a universal. We consider the case of a list universal, as the others are similar (and easier). M ′ 0 has to interpret the new nodes and edges in the canonical way. In particular, T , L and P are 1, List(A) and A × List(A). Then the universal properties (of terminal object, list object and binary product) give canonical isomorphisms between those canonical interpretations in M ′ 0 and the corresponding interpretations (possibly non-canonical) in M ′ 1 . The corresponding carrier morphisms of φ ′ can be defined to be those canonical isomorphisms, and indeed by the homomorphism properties and uniqueness of fillins they must be so defined.
By considering the case where T 0 = T 1 = 1 1, we obtain -  2. If T 0 and T 1 are both contexts, then so is T 0 × T 1 . To be specific, we shall adjoin the ingredients of T 0 first, so that T 0 ⊂ T 0 × T 1 is an extension and for T 1 we just have a homomorphism T 1 ⋖ T 0 × T 1 .

Examples of contexts
3. If T is a context, then so is T → . We take it that i 0 : T ⊂ T → is the extension.
More generally, for any strongly finite category C we have that T C can be made a context. The order of simple extensions for it will depend on a total order given to each finite set involved.
4. If T is a context, then it has an extension T ns whose strict models are the non-strict models of T. For each non-primitive node X, we adjoin a primitive node X ′ together with an isomorphism X ′ ∼ = X.
Note that we do need T to be a context here, not an arbitrary sketch. A model of T ns is actually an isomorphic pair of two models, one strict and the other not. We need Corollary 14 to get this pair from any non-strict model.
5. Without going into details, there is a context R for the theory of Dedekind sections. It is defined as outlined in [MV12]. First, the natural numbers N can be defined as List(1). Their (decidable) order and arithmetic can be defined using the universal property. Then the rationals Q can be defined by standard techniques, together with their decidable order and arithmetic. Next, two nodes L and R are adjoined, with edges to Q and conditions to make them monic. Finally the various axioms for Dedekind sections are imposed.
6. For various kinds of presentation of locales, there are context extensions T 0 ⊂ T 1 where a model of T 0 is a presentation, and one of T 1 is a presentation equipped with a point of the corresponding locale.
The same principle also applies in formal topology, with an inductively generated formal topology understood as a presentation.
For example, suppose we take the formal topologies as defined in [CSSV03]. First we declare the base B, a poset. Next, the cover ⊳ 0 can be adjoined as a node, with an edge to B. A node C is adjoined for a disjoint union of all the covering sets, with an edge to ⊳ 0 . The conditions on these can also be expressed using AU structure in a context T 0 . For T 1 we adjoin to T 0 a monic into B, together with conditions to make it a formal point.
Note that we have not attempted here to extract the full cover ⊳.

Equivalence extensions
An equivalence extension is an extension, but one in which the simple extension steps are grouped together in a way that guarantees that the fresh ingredients (nodes, edges, properties, equations) introduced in the extension are all already known to exist uniquely. The most intricate parts are for the edges. In an ordinary extension, an unconstrained fresh edge can subsequently be specified uniquely up to equality by commutativities (equations). In an equivalence extension when we introduce an edge we must also document the justification for its existence (as a composite or a fillin; universal structure edges such as limit projections are introduced along with the universal objects). In addition, we must also include steps for proving equations between edges -this is to provide images for commutativities under a sketch morphism. These steps essentially codify the rules for congruences in universal algebra. (The reason this is not needed for nodes is that essentially algebraic theories of categories do not normally have any axioms to imply equations between objects.) The game now is to describe simple equivalence extensions sufficient to generate all the operators of the the theory of AUs and all the arrow equalities generated by the axioms. (For object equalities see Section 6.) Definition 15 A simple equivalence extension is a proto-extension of one of the following forms (or rules). Note that each is in fact an extension.
In each case, every node or edge introduced will, in any strict model, become equal to a certain AU expression in terms of the data. For nodes, which are all introduced by simple extensions of universal kind, this has already been covered in Definition 10. For edges the expressions are given in δG 1 . Those expressions do indeed satisfy the commutativities listed in δG 2 . On the other hand, any edges satisfying them will be equal to the expressions by the AU equations for uniqueness of fillins.
First, there are various rules associated with morphisms and their composition. They are summarized in this table.
Data Delta Second, for each kind of universal (terminal, pullback, initial, pushout, list), we have three rules. The first will be the simple extension that introduces the corresponding node, the second will introduce fillins by adjoining a primitive edge with the appropriate equations, and the third will introduce equations for the uniqueness of fillins. We illustrate this for pullbacks and for list objects. The rules for terminals, initials and pushouts follow the same principles as for pullbacks.
For pullbacks: • A simple extension for a pullback universal is also an equivalence extension.
• Suppose we have a pullback universal ω ∈ U pb , and another cone given as Then our equivalence extension has • Suppose we have a pullback universal ω ∈ U pb as above, and edges v 1 , v 2 , w, w ′ with commutativities wp 1 ∼ v 1 , wp 2 ∼ v 2 , w ′ p 1 ∼ v 1 , w ′ p 2 ∼ v 2 . Then our equivalence extension has For list objects: • A simple extension for a list universal is also an equivalence extension.
and edges for ! 1 B ε, B , cons ×B and the associativity isomorphism, together with auxiliary edges and commutativities needed to characterize them.
Using the notation of the following diagrams, our equivalence extension has δG 1 = {r, r ′ , r ′′ , g ′ , g ′′ }, where r = rec A (y, g), and δG 2 comprises the seven commutativities shown. The second diagram is what is needed to specify that r ′ = A × r.
• Suppose, given the configuration for the above fillin, we have two solutions with fillins r 1 , r 2 . Then our equivalence extension has (Equivalence of the other edges can then be deduced.) Finally, we have rules for balance, stability and exactness. In each case, the given configuration contains a particular edge u : X → Y for which the equivalence extension adjoins an inverse. Hence • Rule for balance. Suppose we are given pullback and pushout universals ω ∈ U pb , ω ′ ∈ U po , expressing the kernel pair and cokernel pair for the same edge u : X → Y .
ω has P u,u Suppose we also have commutativities p 1 u,u ∼ p 2 u,u (u is monic) and q 1 u,u ∼ q 2 u,u (u is epi). Then our equivalence extension has δG 1 = {u −1 = uc(u)}. • Rule for stability of initial objects. Suppose we are given a universal ω ∈ U 0 for an initial object 0, and an edge u : X → 0. Then δG 1 = {u −1 = ! 0 X }. • Rule for stability of pushouts. Suppose we have data as outlined in diagram (2). This will include two pushout universals (bottom square and inner square on top), three pullback universals for vertical squares (front and right faces, and also one stretching diagonally over v), the extra edge e, and other diagonal edges where necessary. Then the equivalence extension inverts e, δG 1 = {e −1 = stab u1,u2 (w)}.
• Rule for exactness. Suppose we have data as outlined in diagram (3). This will include pullback universals to specify that X 0 × X 0 , X 2 and K are the appropriate limits, pushout universals to specify that γ is a coequalizer, and commutativities to specify that π and e are fillins. Then the equivalence extension inverts e, δG 1 = {e −1 = ex(π 1 , π 2 , r, s, t)}.
An equivalence extension, written T ⋐ T ′ , is a proto-extension that can be expressed as a composite of finitely many simple equivalence extensions.
Note also that if T ⋐ T ′ is an equivalence extension, then so too is its reindexing along any sketch homomorphism.
If e i : T ⋐ T i (i = 1, 2) are two equivalence extensions of a context T, then e 2 is a refinement of e 1 , by ε, if ε : T 1 → T 2 is a homomorphism such that e 1 ε = e 2 .
For any two equivalence extensions e i of T, we can reindex e 2 along e 1 (or vice versa), compose, and thereby get a common refinement of e 1 and e 2 .
Equality between morphisms u, u ′ : X → Y is expressed using unary commutativities u ∼ u ′ , defined as s(X)u ∼ u ′ . Since the rules used in equivalence extensions must be capable of supplying proofs of equality, we verify that the standard rules for equality can be derived as composite rules of equivalence extensions. Given these, it will be clear that all proofs of equality of morphisms in the essentially algebraic theory of categories can be represented by commutativities in a suitable equivalence extension.
Proposition 16 Let T be a sketch. In the following results we are interested in properties holding in T, and properties derivable from them in the sense that they hold in some equivalence extension of T.
1. For any two nodes X and Y , ∼ XY is an equivalence relation on the edges between them. This is in the sense that for each of the three properties for an equivalence relation, if the hypothesis holds in some sketch then the conclusion holds in some equivalence extension.
2. If u, u ′ are two edges from X to Y , then the commutativities s(X)u ∼ u ′ and u ′ s(Y ) ∼ u are mutually derivable.
It follows that we have four mutually derivable characterizations of u ∼ u ′ , namely s(X)u ∼ u ′ , s(X)u ′ ∼ u, us(Y ) ∼ u ′ and u ′ s(Y ) ∼ u.
3. Suppose we have u ∼ XY u ′ and v ∼ Y Z v ′ , and also w, w ′ : X → Z with uv ∼ w. Then the commutativities u ′ v ′ ∼ w ′ and w ∼ w ′ are mutually derivable.
From left to right is congruence. From right to left (with u ′ = u and v ′ = v) shows that the set of composites uv is the entire congruence class of w. Proof.
(1) Reflexivity is immediate from the left unit law.
For symmetry, suppose u ∼ XY u ′ . By the left unit law we derive and then right associativity gives s(X)u ′ ∼ u.
For transitivity, suppose u ∼ u ′ ∼ u ′′ . By the left unit law we get X s(X) and then s(X)u ∼ u ′′ is derived by left associativity.
(2) The two directions follow by applying associative laws to the two diagrams X s(X) (3) First, consider the case when v = v ′ , and the diagram The two associativities give the two directions we want. A similar proof, but dual (using (2)), deals with the case u = u ′ . Putting these together gives the general result.
Proposition 17 Let T ⋐ T ′ be an equivalence extension, and let M be a strict model of T in an AU A. Then there is a unique strict model M ′ of T ′ in A whose restriction to T is M .
We call this the extension of M to T ′ .
Proof. Each node or edge introduced in T ′ has a canonical description as an AU-expression in terms of older nodes and edges, and so has a canonical interpretation already in AU T . For a node, strictness implies already that we must use this interpretation. For an edge, the commutativities introduced at the same time are enough to force equality in A between the interpretations of the edge and the canonical description. It remains to show that all the commutativities f g ∼ h in T ′ are respected. Let us write [f ] for the interpretation of the canonical expression for f in M , and similarly for g and h. We We have to examine the rule that introduces the commutativity, and use induction on the number of simple equational extensions needed.
For the rules that introduce nodes or edges, the commutativities introduced follow directly from quasiequational rules for AUs. It is also clear for unit laws and associativity.
There remain the uniqueness rules for fillins. Suppose we have one expressing f ∼ f ′ . Then in A we have that f and f ′ are both equal to the fillin, and so equal to each other.
Proposition 18 Let e : T ⋐ T ′ be an equivalence extension. Then the corresponding AU-functor AU e : AU T → AU T ′ is an isomorphism.
Proof. In terms of strict AU-functors, Proposition 17 says that for any strict M : AU T → A there is a unique strict M ′ : AU T ′ → A such that AU e M ′ = M . Applying this with Id AU T for M gives us an F : AU T ′ → AU T for M ′ , and then for more general M we see that M ′ = F M . From this we deduce that F is an inverse for AU e .

Object equalities
The notion of equality between two context homomorphisms (Definition 5) is very strong, and in essence syntactic. The homomorphisms must act equally on the nodes and edges as sketch ingredients. In practice we usually want a more semantic notion that allows us to say when nodes and edges are equal in the sense that they must be interpreted equally in strict models. This will allow us to get faithfulness for a functor that takes T to AU T .
For edges, we already have a machinery for proving equality as morphisms by using commutativities. For nodes we have deliberately avoided anything analogous, beyond equality in the graph. However, semantic equality can still arise when two nodes are declared by universals for two identical constructions from equal data. We define certain kinds of edges as being "object equalities" between their domains and codomains; semantically they must be equal to identity morphisms. We then extend the phrase to apply also to "object equality" between edges or context homomorphisms.
We use the phrase object equality for a situation where a context already has the required structure, and objectively equal, or objective equality, for a situation where an equivalence extension can provide it.
Definition 19 Let T be a context, and suppose γ : X → Y is an edge in T. Then γ is an object equality, written γ : X ⇒ Y , if either X = Y as nodes and γ ∼ s(X) in T, or γ can be provided with structure in T in one of the following ways.
1. If X, Y are subjects of terminal universals: no extra structure needed.
2. Suppose X and Y are subjects of pullback universals, for the back and front faces of the following diagram, and suppose also we have we have object equalities γ i : U i ⇒ V i and edges and commutativities to name such composites as are required and to assert u i γ 3 ∼ γ i v i and their consequence p 1 γ 1 v 1 ∼ p 2 γ 2 v 2 , and γq i ∼ p i γ i (characterizing γ as a fillin p 1 γ 1 , p 2 γ 2 v1,v2 ).
Then γ : : X ⇒ Y is an object equality.
3. Similarly for initial objects and pushouts.
4. Suppose we have two list universals for L i = List(A i ) (i = 1, 2) and an object equality γ A : A 1 ⇒ A 2 , and an edge γ L : L 1 → L 2 with sufficient data to characterize it as List(γ A ) (Remark 1). Then γ L is an object equality.
Lemma 20 Let T be a context.
1. If γ : X ⇒ Y is an object equality, then in AU T we have X = Y and γ is the identity morphism.
2. If γ : X ⇒ X is an object equality, then there is some equivalence extension T ⋐ T ′ in which s(X) ∼ γ.
3. If γ : X ⇒ Y and γ ′ : Y ⇒ Z are object equalities, then there is some T ⋐ T ′ in which we have an object equality δ : X ⇒ Z and γγ ′ ∼ δ.
4. If γ : X ⇒ Y is an object equality, then there is some T ⋐ T ′ in which γ is an isomorphism, and its inverse is also an object equality.
5. If γ, γ ′ : X ⇒ Y are two object equalities, then there is some Proof.
(1) is immediate from the definition, bearing in mind that for a list universal the expression for A × L is defined to be that for the pullback of ! L and ! A .
(4) follows because all the cases for object equality are symmetric, and we can then apply (3) and (2).
(5) again follows from the uniqueness clauses for fillins. We shall use the phrase "object equality" more generally than just for objects.
Definition 21 Let T be a context. 1, 2) are edges in T, then an object equality from u 1 to u 2 is the data of a commutative diagram such that γ X and γ Y are object equalities.
Let f 0 , f 1 : T 1 ⋖ T 0 be two context homomorphisms. Then an object equality from f 0 to f 1 is a 2-cell γ from f 0 to f 1 , for which every carrier edge is an object equality γ X : f 0 (X) ⇒ f 1 (X). (It follows that for each edge u : X → Y of T 1 , we get an object equality (γ X , γ u , γ Y ) from f 0 (u) to f 1 (u).) By taking T 1 as either O or O → , we see that object equality for homomorphisms subsumes the cases for nodes and edges.
We say that two context homomorphisms are objectively equal in T, symbolized = o , if there is some equivalence extension of T in which they have an object equality.
Proposition 22 Objective equality of context homomorphisms is an equivalence relation.
Proof. This is a straightforward extension of Lemma 20. For transitivity f 0 = o f 1 = o f 2 , note that we may have different equivalence extensions for f 0 = o f 1 and for f 1 = o f 2 . Work in a common refinement.

Context maps
In Section 8 we shall define a 2-category Con whose objects are contexts, and whose morphisms T 0 → T 1 are in bijection with strict AU-functors AU T 0 ← AU T 1 . In fact, its 1-cells will be what we shall define here as context maps.
In this section we investigate the 1-category Con ⋐⋗ of contexts and context maps, from which Con is got by factoring out a congruence based on objective equality. To save repetition, we shall exploit the fact that object equalities are a special case of 2-cells, and the present section is really a collection of ad hoc preliminary results about 2-cells in the not-a-2-category Con ⋐⋗ .
We already have a category Con ⋖ of contexts and context homomorphisms -and we shall also write Con ⋗ for its opposite. Recall that we consider two sketch homomorphisms equal if they agree on the nodes and edges.
Definition 23 Let T 0 , T 1 be contexts. Then a context map from T 0 to T 1 is an opspan (e, f ) from T 0 to T 1 , where e is an equivalence extension: Using reindexing, we can compose context maps.
Definition 24 Suppose we have context maps as in the bottom two rows of the following diagram, and we reindex e 1 along f 0 .
Contexts and context maps form a category Con ⋐⋗ , with composition as defined and identity maps (Id, Id). Note that (e, f ) is the composite (e, Id)(Id, f ).
Definition 25 A 2-cell in Con ⋐⋗ , between T 0 and T 1 , is a context map (e, α) from T 0 to T → 1 . Its domain and codomain are (e, α • i λ ) (λ = 0, 1). An object equality is a 2-cell (e, γ) in which γ is an object equality. Two context maps (e i , f i ), with the same domain and codomain, are objectively equal if e 0 and e 1 have a common refinement e such there is an object equality from f 0 ε 0 to f 1 ε 1 .
From Proposition 22 it is easy to see that objective equality is an equivalence relation on each hom-set of Con ⋐⋗ .
Con ⋐⋗ is not a 2-category -it lacks vertical and horizontal composition. For example, suppose we have two vertically composable 2-cells between T 0 and T 1 . To compose them we need to be able to compose the carrier edges in T 0 .
For the time being we examine whiskering, horizontal composition of 2-cells with 1-cells.
Left whiskering 4 is done by composition of context maps T 0 Right whiskering by context maps (Id, f ) is similar, with a composition For whiskering as defined so far, it is clear that -1. all possible associativities hold, and 2. whiskering preserves object equalities.
The remaining case is right whiskering by maps (e, Id). For these we start to need equivalence extensions.
For any such e 0 and α ′ as in (1), suppose we also have (for the same e 0 ) α ′′ satisfying the same conditions as for α ′ . Then α ′ = o α ′′ . (This just means that unary commutativities can be found between the actions of α ′ and α ′′ on edges, since their actions on nodes are already constrained up to equality by f 0 and f 1 .) Proof. It suffices to consider simple equivalence extensions e 1 , and the only non-trivial ones are those that introduce nodes or edges. If e 1 introduces only commutativities, then the action of α ′ is already explicit in that of α and e 0 just has to introduce the images under f 0 and f 1 of those commutativities. This applies to the unit and associativity rules, and to the rules for the uniqueness of fillins. For the first case, suppose e 1 adjoins a composite uv ∼ XY Z w. In any case where e 1 introduces an edge w : X → Z, in T ′→ 1 we have fresh edges i λ (w) and θ w , whose interpretations under α ′ must be f λ (w) and α X f 1 (w). This is already enough to prove the uniqueness, (2). For existence, we can certainly adjoin the composite α X f 1 (w) in an equivalence extension. Algebraically we check that appropriate square for w commutes: By Proposition 16 we can find an equivalence extension with sufficient edges and commutativities to express this.
A similar argument applies to all those equivalence extensions that adjoin an inverse to a particular edge u : X → Y . We check Next, suppose a node X is introduced by a universal. The commutativities required for a homomorphism ensure that α ′ X has to be the canonical fillin, and then the appropriate squares commute with respect to the structure edges to ensure that we have a homomorphism.
Finally we consider fillins.
We first look at pullbacks. These will show the method also for pushouts, terminals and initials, although list objects are more complicated.
Suppose in T 1 we have a pullback P of some opspan, and suppose that u : Y → P fills in for a cone that has, for each projection p : P → X, a morphism q : Y → X. We need to show f 0 (u)α P ∼ α Y f 1 (u), and it suffices to show that when composed with each pullback projection for f 1 (p).
The bounding quadrangle, the lower small rectangle and the two side-bows all commute, and so (in some suitable equational extension) we can show f 0 (u)α P f 1 (p) ∼ α Y f 1 (u)f 1 (p).
Finally we look at list fillins. Suppose T 1 has the data for a list fillin (see diagrams (5)) and T ′ 1 adjoins the fillin r. Our task is to show that the two composites f 0 (r)α Y and α L×B f 1 (r) are equal in some equivalence extension, and it suffices to show that they are both fillins for This is left to the reader. Note that if α is an object equality then so is α ′ . In other words, we can cancel equivalence extensions e from objective equalities: if there is an object equality from ef 1 to ef 2 , then f 1 and f 2 are objectively equal.
Definition 27 Let α : T → 1 ⋖ T 0 be a 2-cell, with domain and codomain f 0 and f 1 , and let e 1 : T 1 ⋐ T ′ 1 be an equivalence extension. Reindexing e 1 along f 0 and f 1 gives two equivalence extensions f λ (e 1 ) of T 0 , by homomorphisms ε i . (See diagram (7).) Then a right whiskering (Id, α)(e 1 , Id) is a map (e, α ′ ) where e is a common refinement of f 0 (e 1 ) and f 1 (e 1 ), and α ′ is a 2-cell from ε 0 to ε 1 in e.
Note that, because of the need to use a common refinement of f 0 (e 1 ) and f 1 (e 1 ), the domain of the whiskering is not strictly equal to what it should be at the 1-cell level. However, they are objectively equal. The codomain is similar.
Proposition 28 Right whiskering (Id, α)(e 1 , Id) exists and is unique up to objective equality.
y y The uniqueness part (2) of Lemma 26 now tells us that the 2-cell α ′ is unique up to unary commutativities of edges, so the right whiskering is unique up to objective equality.

Proposition 29
1. Whiskering obeys the usual associative laws up to objective equality.
(1) After what we said earlier, the only remaining issue is the associativity of (Id, α)(e 0 , Id)(e 1 , Id).
(2) Clear from the remark after Lemma 26. Finally we prove the following lemma. Note that if cg is equal to f , then e can be trivial, with εg ′ = g. With object equalities there is a little more work, and it is embodied in e.

Lemma 30
1. Suppose we have the solid parts of the following diagram, where c is an extension, the square is the reindexing, and we have an object equality γ : f ⇒ cg.
Then we can find an equivalence extension e : T 0 ⋐ T ′′ 0 and a homomorphism g ′ : T ′ 0 → T ′′ 0 such that f (c)g ′ is strictly equal to e and there is an object equality γ ′ : εg ′ ⇒ ge such that cγ ′ = γe.
2. Suppose, in the situation above, we have an equivalence extension e and two homomorphisms g ′ i with the properties described. Then g ′ 1 and g ′ 2 are objectively equal in T ′′ 0 . Proof.
(1) By induction we can assume that c is a simple extension. If c adjoins a primitive node X, then we define e as trivial, and g ′ (X) = g(X).
If c adjoins a primitive edge u : X → Y then in T 0 we have the solid part of and in a suitable equivalence extension of T 0 we can define g ′ (u) to make the square commute. Suppose c adjoins a commutativity vw ∼ XY Z u. We have y y s s s s s s s s s The square faces all commute because they are object equalities. Once c has made the right-hand triangle commute, in a suitable equivalence extension we can deduce that so does the left-hand one. If c adjoins a universal, then we let e adjoin the same universal.
(2) Every ingredient of T ′ 0 is in the image of either f (c) or ε. It therefore suffices to note that f (c)g ′ 1 and f (c)g ′ 2 are strictly equal, while εg ′ 1 and εg ′ 2 are objectively equal by Proposition 22.

The 2-category of contexts
We now define our 2-category Con in which the 0-cells are contexts, and the 1cells between T 0 and T 1 are in bijection with strict AU-functors from AU T 1 to AU T 0 . At the same time, we shall make the reversal of direction by which a strict AU-functor can be thought of as a transformation of models. Thus we shall think of a 1-cell as a "map" from the "space of models of T 0 " to the "space of models of T 1 ".

Con as a 1-category
Proposition 31 Objective equality of context maps is a congruence on Con ⋐⋗ .
Hence contexts and their maps modulo objective equality form a category Con.
Proof. It has already been remarked that objective equality is an equivalence relation on each hom-set. To show that it is a congruence, we show that if two context maps are objectively equal, then their composites with any (e, f ) are also objectively equal. On the left, we just reindex everything along f . On the right, we apply right whiskering by (e, f ), and use the fact that this preserves objective equality.
We now have a functor (Id, −) : Con ⋗ → Con given by Theorem 32 Con is free over Con ⋗ subject to object equalities becoming equalities, and equivalence extensions becoming invertible.
Proof. If e : T 0 ⋐ T ′ 0 is an equivalence extension, then (Id, e) has inverse (e, Id) in Con.
We have (e, Id); (Id, e) = (e, e), and this is objectively equal to (Id, Id) using e as a refinement of Id.
For the other composite we get (e(e), ε) by reindexing. Now by the remark preceding Lemma 30, with g as an identity, we get a homomorphism g ′ with e(e); g ′ = ε; g ′ = Id, showing that (e(e), ε) is equal to the identity.
It follows that, in Con, every morphism can be expressed in the form (Id, e) −1 ; (Id, f ), where e is an equivalence extension. Now suppose we have a functor F : Con ⋗ → C with those properties. We must show it factors uniquely via (Id, −), with F ′ : Con → C. Uniqueness is clear: we must have For existence, first we show that F ′ thus defined transforms objective equality to equality. Suppose (e i , f i ) (i = 0, 1) are objectively equal, as in diagram (6). Then and these are equal for i = 0, 1 because F transforms object equality to equality. It is obvious that F ′ preserves identities, and for composition it suffices to consider the composite (Id, f ); (e, Id) = (f (e), ε). In C we have

Lemma 33
1. Any reindexing square (4) for a context extension becomes a pullback square in Con.
2. In Con, extension maps (i.e. those of the form (Id, c) where c is an extension) can be pulled back along any morphism. Proof.
(1) Consider a diagram as on the left here, with the outer square commuting.
Taking a common refinement of e 1 and e 2 , we might as well assume that they are both trivial and that we have an object equality f g 1 ⇒ cg 2 . Now consider the diagram on the right, and apply Lemma 30 with g 2 for g. We obtain e and g ′ 2 , with e an equivalence extension, strict equality g 1 (f (c)); g ′ 2 = e, and an object equality εε ′ g ′ 2 ⇒ g 2 e. The required fillin is (e, ε ′ g ′ 2 ). It has the correct composites with (Id, f (c)) and (Id, ε). Moreover, uniqueness follows by the same argument as in Lemma 30.
(2) After part (1), it suffices to show that (Id, c) can be pulled back along any map (e, Id) where e : T 0 ⋐ T 1 is an equivalence extension. This is trivial, because pullbacks along invertible morphisms always exist.

Con as 2-category
We now develop the 2-categorical structure.
Proof. We shall write i λµ (λ, µ = 0, 1) for the composite In (T → ) → we write θ for the first level homomorphism, in T → , represented in (T → ) → by i µ (θ), and φ for the second level homomorphism. Note that i λ i → µ = i µ i λ . It follows that any model of (T → ) → has a square of four models of T, got from the i λµ s, and four homomorphisms between them, got from the i µ s and the i → µ s. In fact, the square will commute, because φ is homomorphic with respect to the i µ s. Conversely, any such commutative square of homomorphisms gives a model of (T → ) → .
Reflecting the square about its leading diagonal gives another such square, and that is the essential action of τ . The only remaining issue is that in the context (T → ) → , we need an equivalence extension to introduce some composites and associativities -mere commutativity of the squares (of carrier edges) does not explicitly have all the data for a homomorphism between homomorphisms.
Lemma 36 Let e : T 1 ⋐ T 0 be an equivalence extension. Then e → is invertible in Con.
Theorem 37 The functor − → on Con ⋖ gives an endofunctor on Con.
Proof. Theorem 32 reduces this to Lemmas 35 and 36. We now define an internal category in the functor category [Con, Con] in which the object of objects is Id, and the object of morphisms is − → .
The structure operations will be natural transformations. Note that to prove naturality, it suffices to prove it with respect to maps of the form (Id, f ), since the rest follows from invertibility of (e, Id).
The domain and codomain, natural transformations from − → to Id, are given by the maps dom = (Id, i 0 ) and cod = (Id, i 1 ).
The identity Id : Id → − → is given by maps (e, γ) where γ : T → ⋖ T ′ takes θ to the equality homomorphism on the generic model of T. The equivalence extension e : T ⋐ T ′ uses instances of the unit laws to provide the necessary commutativities.
Since i 0 is an extension, we can reindex along i 1 , and in fact this gives T →→ as a pullback in Con.
i 1 (i 0 ) maps the ingredients of T → to the 0-and 1-copies in T →→ , and adjoins the 2-copies with the carriers from 1 to 2.
In an equivalence extension of T →→ , the two model homomorphisms can be composed, and this provides composition as a natural transformation from − →→ to − → . It is vertical composition of the two 2-cells T → ⋖ T →→ .
Thus for each T we get an internal category N (T) in Con, on objects T and morphisms T → .
Using the category structure of N (T 1 ), this makes Con(T 0 , T 1 ) into a category, with objects and morphisms the 1-cells and 2-cells between T 0 and T 1 .
We already have vertical composition of 2-cells. (We shall compose from top to bottom, so the codomain of the upper 2-cell must equal the domain of the lower.) We deal with horizontal composition by whiskering. Using the functor − → , we can make Con(−, − → ) into a profunctor from Con to Con, and this provides whiskering on both sides. The proof of Lemma 36 shows that this agrees with the whiskering we already have.
Horizontal composition can now be defined as The interchange law follows from - Proof. Suppose we have the following.
By whiskering (e, α)(e ′ , Id) we might as well assume that e and e ′ are both identities. In Con ⋖ we now have The two vertical composites in the statement are the images in T 0 of the two routes round the square of homomorphisms in (T → 2 ) → (see Lemma 34) and so are equal.
Putting together the properties proved so far, we can deduce -Theorem 39 Con is a 2-category.

Limits in Con
We have two main results here. The first (Theorem 47) is that Con has finite PIE-limits (products, inserters, equifiers [PR91]). This is a large class of finite weighted limits, but a notable lack is equalizers and pullbacks. Although by universal algebra AU s has all pushouts and AU op s has all pullbacks, in general we cannot replicate this in contexts. For example, suppose we have two context homomorphisms f i : T 0 ⋖ T i where T 0 has just a single node, and the f i s map it to nodes introduced by two different kinds of universals. Then the pushout must specify an equality between those two different nodes, and that cannot be done with a context.
The second main result (Theorem 41) is that, nonetheless, pullbacks of extension maps do exist, essentially by reindexing. In fact this has already been addressed in Lemma 33. All that remains here is to show that they are 2categorical conical limits (in other words, they take proper account of 2-cells between fillins).
Note that all our weighted limits are strict, with strict cones, as in [PR91]. We do not follow the convention in [Joh02, p.244] of interpreting them in a "pseudo" sense.
Also note that we do not claim to have constructed the limits in a canonical way, at least not those -such as pullbacks, inserters and equifiers -that depend on maps. This is because the construction will depend on the representatives (e, f ) of the maps.

Pullbacks and products
Lemma 40 Consider a context reindexing square (4). Then the following square becomes a pullback in Con.
Proof. If c → were an extension, then we could apply Lemma 33. In fact it is not, but only for bureaucratic reasons based on the concrete definition of coproduct "+" (see Section 9). The issue is that the steps constructing T ′→ 1 are applied in an order that does not start off with all those for T → 1 . Those steps can be reordered to give an extension c ′ : T → 1 ⊂ T ′′ 1 isomorphic to c → , and moreover that reordering can be reindexed along f → to get a reindexing square isomorphic to (8): By Lemma 33 the reindexing square is a pullback in Con, and it follows that so too is (8).
Theorem 41 Con has pullbacks of extension maps along any map.
Proof. Lemma 33 has already shown the 1-categorical form of this. It remains to show that we also have 2-cell fillins, and the ability to do this follows from Lemma 40.
Lemma 42 Con has all finite products.
Proof. The empty theory 1 1 is initial in Con ⋖ . After that one easily shows that it is terminal in Con.
The case for binary products follows from Theorem 41, since the unique homomorphism 1 1 ⋖ T is an extension.
Definition 43 Let f λ : T 1 ⋖T 0 (λ = 0, 1) be two context homomorphisms. Then we define an extension c : T 0 ⊂ Ins(f 0 , f 1 ) by adjoining: • for every node Y in T 1 , an edge θ Y : f 0 (Y ) → f 1 (Y ); and • for every edge u : Y → Y ′ in T 1 , an edge θ u and two commutativities The map from Ins(f 0 , f 1 ) to T 0 is got by inverting the equivalence extension e : T 0 ⋐ T ′ 0 . Suppose we have a map from U to T 0 and a 2-cell between its composites with the f λ s. By replacing U by a suitable equivalence extension U ′ , we may assume that the 2-cell, between maps from U ′ to T 1 , is entirely in Con ⋗ as in the above diagram, and we get a unique factorization U ′ → Ins(f 0 , f 1 ) in Con ⋗ . This then gives us a unique factorization in Con.
The remarks before the lemma now enable us to extend this to 2-cells in the manner required for a weighted limit. (Now we need an equivalence extension of U ′ for the associativities needed.)

Equifiers
Again, we start off in Con ⋗ .
Definition 45 Suppose we have two homomorphisms α, β : T → 1 ⋖ T 0 that, as 2-cells, have the same domain and codomainf λ = i λ α = i λ β (λ = 0, 1). (Equality is in the sense of agreeing on nodes and edges.) Then we define an extension c : T 0 ⊂ Eq(α, β) that adjoins unary commutativities α Y ∼ β Y and α v ∼ β v for the nodes Y and edges v in T 1 .
A homomorphism g ′ : Eq(α, β)⋖U is equivalent to a homomorphism g : T 0 ⋖U such that αg and βg are equal in the sense that there are unary commutativities in U equating the images under g of the θ Y s and the θ v s.
We can extend this precisely to 2-cells in Con ⋗ . If g ′ λ are two homomorphisms from Eq(α, β) to U, then a 2-cell from g ′ 0 to g ′ 1 is equivalent to a 2-cell from cg ′ 0 to cg ′ 1 .
Proof. Suppose in Con we have two 2-cells between T 0 and T 1 with equal domain and codomain. Then by taking common refinements, and vertically composing one of the 2-cells with object equalities, we can suppose without loss of generality that our 2-cells are given by a suitable equivalence extension e : T 0 ⋐ T ′ 0 and, entirely in Con ⋗ , two 2-cells between T ′ 0 and T 1 with equal domain and codomain. Then Eq(α, β), mapped through to T 0 using (Id, e), provides the equifier we seek.
The rest is similar to Lemma 44.
Theorem 47 Con has finite pie limits.
Proof. This is the combined content of Lemmas 42, 44 and 46.

A concrete construction of AU T
We can define a 2-functor AU − : Con → AU op s , acting on objects as T → AU T . (At the 1-category level this is immediate from Theorem 32, using Proposition 18 and Lemma 20.) The main result of this section, Theorem 48, is that this 2-functor is representable, with AU T isomorphic to Con(T, O). We also show, Theorem 50, that it is full and faithful: thus all strict AU-functors between AUs of the form AU T , with T a context, can be got by the finitary means of constructions in Con.
Finally we shall show how the construction itself can be conducted entirely within the logic of AUs. This is in the spirit of the idea that AU constructions should be internalizable within AUs, the idea that inspired Joyal's original use of them with regard to Gödel's Theorem.
For the 2-cells, first note that AU T → is a tensor 2 ⊗ AU T in AU s . This is because a strict AU-functor AU T → → A is equivalent to a strict model of T → in A, which is equivalent to a strict model of T in A ↓ A, which is equivalent to a strict AU-functor AU T → A ↓ A, which is equivalent to a 2-cell between AU T and A with domain and codomain both strict.
Hence AU T → is a cotensor 2 ⋔ AU T in AU op s . Thus we find that 2-cells in Con, which are 1-cells to some T → , are mapped to 2-cells in AU op s , and this preserves vertical and horizontal composition.
We next investigate the categories Con(T, O). The objects and morphisms of this are the nodes and edges of equivalence extensions of T, all modulo objective equality.
Theorem 48 Let T be a context. Then Con(T, O) is an AU freely presented by T, in other words AU T ∼ = Con(T, O).
Proof. All the AU constructions can be captured by equivalence extensions, and have the necessary properties. The rules of object equalities (for nodes) and fillin uniqueness (for edges) ensure that the constructions yield equals when applied to equals, and so have canonical representatives. Thus Con(T, O) is an AU.
If M is a strict model of T in A, then any object or morphism in Con(T, O) gets a unique interpretation in A by model extension along the equivalence extension used. This respects objective equality, and so yields a well defined interpretation of the object or morphism.
Proposition 49 Let T, T 0 be contexts. If (e, f ) is a context map from T to T 0 , then the nodes and edges of T 0 , translated along f , give a strict model of T 0 in Con(T, O). This induces a bijection between • context maps from T to T 0 (modulo objective equality), and • strict models of T 0 in Con(T, O).
Proof. Objective equality of the context maps is determined solely by objective equalities for their nodes and edges, which is equality of the models in Con(T, O). Hence we have injectivity.
For surjectivity, each piece of data for a strict model of T 0 is expressed in an equivalence extension of T. There are only finitely many of these, so they have a common refinement e, say, and then the strict model can be expressed as a context map (e, f ).
Theorem 50 The 2-functor AU − is full and faithful on 1-cells and 2-cells.
Proof. Let T 0 and T 1 be contexts. Strict AU-functors AU T 1 → AU T 0 are equivalent to strict models of T 1 in AU T 0 ∼ = Con(T, O), and these are equivalent to 1-cells in Con.
The result for 2-cells follows by considering maps to arrow contexts T → 1 . We now look at the concrete construction in AU logic. Each kind σ of simple extension or simple equivalence extension takes some given data, and produces a delta. The possible data are given by a functor Dat σ from sketches to sets. More carefully, an element of Dat σ (T) is some finite tuple of elements of carriers in T, subject to some equations. Hence Dat σ can be understood as an object of the cartesian classifying category for the unary theory of sketches, and for any sketch T in a cartesian category C, Dat σ (T) is an object of C. If the sketch T is in an AU, then, for each element of Dat σ (T), the delta now gives us a proto-extension T ⋖ T ′ .
Since there are only finitely many kinds of simple extension or simple equivalence extension, in an AU we can sum over them and get Let us now restrict ourselves to strongly finite sketches, in other words, sketches in the category Fin whose objects are natural numbers and whose morphisms are functions between the corresponding finite cardinals. This can be defined internally in any AU. We obtain an internal graph Sk s⊂ whose nodes are strongly finite sketches T, and whose edges are pairs (T, e ∈ Dat s⊂ (T))the source is T, the target is the corresponding simple extension T ′ . Note that we can, and shall, choose the deltas in such a way that, for every carrier, the corresponding carrier function for the extension is the natural inclusion for some natural numbers m ≤ n. We write Sk ⊂ for the path category of Sk s⊂ , its morphisms being the composable tuples of edges. (Note that two different paths could still give the same extension. ) We can now take the contexts to be the targets of extensions whose domains are the empty sketch 1 1.
Next we do the same with equivalence extensions, to obtain a graph Sk s⋐ and its path category Sk ⋐ .
Note that if f : T 1 ⋖T 2 then f extends to a function Dat s⊂ (T 1 ) → Dat s⊂ (T 2 ), and so transforms any extension c of T 1 into one f (c) of T 2 . This is the reindexing, and it applies similarly to equivalence extensions.
From these ingredients we can now, internally in any AU, define the 2category Con and also, from any internal context T, define Con(T, O) and hence AU T .

Conclusion
The present paper has fulfilled a technical goal, that of providing a finitary means of dealing with arbitrary strict AU-functors between certain finitely presented AUs.
Many of the technical details are open to change. It would be great, for instance, if a simpler characterization of AUs could be found. Nonetheless, I believe the broad approach of sketches, with equivalence extensions and object equalities, has the potential for a more enduring usefulness. One piece of necessary further work is to clarify the connection with the type theory for AUs as set out in [Mai03].
The present construction is surely a necessary technical first step in pursuing the programme set out in [Vic99], with its goal of providing a uniform, base-independent technique for proving results about toposes as generalized spaces, and even of providing a satisfactory alternative account of generalized spaces.
Over the years, experience with using geometric logic has shown that much of the argument can be conducted with the "arithmetic" AU constraints. An immediate direction of investigation is to attempt to express them within the finitary formalism developed in the present paper.
Another pressing need is for a coherent account of the "geometricity" properties of point-free hyperspaces and related constructions. Current accounts such as that of [Vic04] prove that the constructions are preserved up to isomorphism by pullback of bundles, but do not express any coherence properties of those isomorphisms. It is to be hoped that that will become clearer in the arithmetic account when bundles are understood as extensions.

Acknowledgements
I am grateful to the organizers of the 5th Workshop on Formal Topology, held at the Institute Mittag-Leffler, Stockholm, on 8-10 June 2015, for the opportunity to outline the ideas of this paper there.