40
Appl Categor Struct DOI 10.1007/s10485-013-9339-2 Fibred Amalgamation, Descent Data, and Van Kampen Squares in Topoi Uwe Wolter · Harald K ¨ onig Received: 18 February 2013 / Accepted: 7 November 2013 © Springer Science+Business Media Dordrecht 2013 Abstract Reliable semantics for software systems has to follow the semantics-as-instance principal (fibred semantics) rather than the semantics-as-interpretation principal (indexed semantics). While amalgamation of interpretations is simple and nearly always possible, amalgamation of instances is very much involved and not possible in many cases. A con- dition when two compatible instances (a span of pullbacks) are amalgamable, is presented for presheaves, i.e. functor categories SET S . Based on this individual condition we prove further a total condition for amalgamation which simultaneously yields a necessary and suf- ficient condition for pushouts to be Van Kampen squares. As a necessary and adequate basis to achieve these results we provide a full revision and adaption of the theory of descent data in topoi for applications in diagrammatic specifications including graph transforma- tions. Especially, we characterize Van Kampen squares in arbitrary topoi by pullbacks of categories of descent data. Keywords Van Kampen square · Amalgamation · Descent data · Fibred semantics · Diagrammatic specification · Graph transformation Mathematics Subject Classifications (2010) 03G30 · 18B25 · 18D30 · 18F20 · 68Q55 · 68Q65 1 Introduction Explaining formal arrangements like type diagrams, entity-relationship (ER) diagrams, class diagrams, state charts, process models or metamodels is challenging. The artefacts of U. Wolter () Department of Informatics, University of Bergen, P.O. Box 7803, 5020 Bergen, Norway e-mail: [email protected] H. K ¨ onig University of Applied Sciences, FHDW Hannover, Freundallee 15, 30173 Hannover, Germany e-mail: [email protected]

Fibred Amalgamation, Descent Data, and Van Kampen Squares in Topoi

  • Upload
    harald

  • View
    214

  • Download
    2

Embed Size (px)

Citation preview

  • Appl Categor StructDOI 10.1007/s10485-013-9339-2

    Fibred Amalgamation, Descent Data, and Van KampenSquares in Topoi

    Uwe Wolter Harald Konig

    Received: 18 February 2013 / Accepted: 7 November 2013 Springer Science+Business Media Dordrecht 2013

    Abstract Reliable semantics for software systems has to follow the semantics-as-instanceprincipal (fibred semantics) rather than the semantics-as-interpretation principal (indexedsemantics). While amalgamation of interpretations is simple and nearly always possible,amalgamation of instances is very much involved and not possible in many cases. A con-dition when two compatible instances (a span of pullbacks) are amalgamable, is presentedfor presheaves, i.e. functor categories SET S . Based on this individual condition we provefurther a total condition for amalgamation which simultaneously yields a necessary and suf-ficient condition for pushouts to be Van Kampen squares. As a necessary and adequate basisto achieve these results we provide a full revision and adaption of the theory of descentdata in topoi for applications in diagrammatic specifications including graph transforma-tions. Especially, we characterize Van Kampen squares in arbitrary topoi by pullbacks ofcategories of descent data.

    Keywords Van Kampen square Amalgamation Descent data Fibred semantics Diagrammatic specification Graph transformation

    Mathematics Subject Classifications (2010) 03G30 18B25 18D30 18F20 68Q55 68Q65

    1 Introduction

    Explaining formal arrangements like type diagrams, entity-relationship (ER) diagrams,class diagrams, state charts, process models or metamodels is challenging. The artefacts of

    U. Wolter ()Department of Informatics, University of Bergen, P.O. Box 7803, 5020 Bergen, Norwaye-mail: [email protected]

    H. KonigUniversity of Applied Sciences, FHDW Hannover, Freundallee 15, 30173 Hannover, Germanye-mail: [email protected]

  • U. Wolter and H. Konig

    a computer scientist are syntactic constructs. While, in most cases, we have accurate meansavailable to specify correct syntax, like contextfree grammars or metamodels, for example,the description of the semantics, i.e. of the intended meaning, of our artefacts still remainsintuitive and approximate. Basically, one can distinguish between static semantics, whichexplains the artefacts meaning by means of static structures like sets and functions, forexample, and operational semantics, which provides meaning in terms of behaviour. Thispaper is mainly motivated by problems related to static semantics of diagrammatic specifi-cations [7, 30, 33]. The presented concepts and results, however, are probably also usefulfor operational semantics.

    A software engineer questions the meaning of an element x of a syntactic structure S. Thesyntactic shape of x may vary. In diagrammatic specifications, it may be a rectangle, a point,an arrow, a line, or some other graphical template. A (static) interpretation i of S may assignto elements of S a set or a map between sets. If the semantics of x is a set, each element ofi(x) appears, in this context, as indexed by x. If S is a set, the resulting family of sets is oftendenoted by (i(x))xS and called an indexed set. If S is a category (compare Section 4.2), aninterpretation of S becomes a functor from S or Sop , respectively, into SET. More generally,interpretations may assign to syntactic elements categories and functors instead of sets andfunctions respectively. This gives rise then to interpretations as functors i : S CAT ori : Sop CAT also called indexed categories. The common codomain of a certain kind ofinterpretations, as the categories SET or CAT, for example, is called a semantic universe in[33] because it contains all necessary correctness knowledge. Bearing in mind the specialcases of indexed sets and indexed categories, respectively, we will refer to any incarnationof the semantics-as-interpretation pattern as indexed semantics.

    Software engineering is a discipline which has to understand and to deal also with therelation between different specifications S and S and their potential co-evolution: S mightbe a graphical class model which represents classes of an object-oriented program, S mightbe an entity relationship diagram describing how these entities are stored in a database.

    Relations between specifications are usually formalized by specification morphismsturning the collection of all specifications into a category C . The collection of all inter-pretations of a fixed object S in C together with natural transformations between themconstitute then a category Mod(S). In this indexed setting, any specification morphismm : S S gives rise, by simple pre-composition with m, to a (forgetful) functor Mod(m) :Mod(S) Mod(S). Thus we obtain, on the global level, a functor Mod : C op CAT .

    A paradigmatic example for indexed semantics are algebraic specifications [10, 11],where S is a signature (containing sorts and operation symbols) or a specification, in whichaxioms like equations or conditional equations [3, 28, 32] are added to a signature. Algebrasinterpret sort symbols by sets and operation symbols by functions, respectively. Homomor-phisms between algebras are families of functions, indexed by sort symbols, satisfying ahomomorphism/naturality condition for each operation symbol. If we denote the categoryof all algebras and homomorphisms for a given S by Alg(S), any specification morphismm : S S induces a forgetful functor from Alg(S) to Alg(S), where specification mor-phisms are given by compatible and axiom preserving pairs of functions between sets ofsort symbols and sets of operation symbols, respectively.

    Equations and conditional equations can also be formalized diagrammatically by productand limit sketches, respectively [1]. An extension of this framework are generalized sketches[6, 7, 25]. They are an appropriate underpinning for diagrammatic specifications in modeldriven engineering [7, 29, 30]: Diagrammatic specifications contain (data) types, directedassociations between them, and probably distinguished and labeled subdiagrams to expressconstraints. Sketch morphisms relate different specifications. The original definitions of

  • Fibred Amalgamation in Topoi

    sketch semantics [1, 4, 5, 25] are indexed. In most applications interpretations of typesare sets and arrows are interpreted as functions between sets.

    Compositionality is an important and well-known concept in theoretical computer sci-ence [9]. It is a method to uniquely and correctly compose (overlapping) semantics ofcomponents of an already composed specification. The composition of specifications isusually carried out with the help of colimits. I.e. the category C of specifications andspecification morphisms is assumed to be cocomplete. E.g. in the left diagram of Fig. 1components A and R are related via the common part L whose role as substructure of A andR is formalized with specification morphisms a and r, resp. Syntactic composition is carriedout by constructing the pushout of a and r.

    Assume there are interpretations , , and of the components A, L, and R resp., whichare related to each other according to the action of the functor Mod, i.e. Mod(a)() = = Mod(r)(). The compositionality problem is formulated in [9], p. 10, as follows: Canthese interpretations for the component specifications uniquely be composed in the sameway as the specifications, such that the composed interpretation is correct w.r.t. the com-posed specification? Of course, such an implication is something we know from all overthe mathematical world: It is very desirable to infer global correctness from local correct-ness, because proofs can then be carried out locally. A prominent examples are sheavesover topological spaces [27], where e.g. local properties like (analytic) continuity ensure thecorresponding global property.

    Compositionality can shortly be circumscribed by the equation

    Mod(Colim(D)) = Lim(Mod Dop)where D : C is an arbitrary diagram (in Fig. 1 is the pattern )and Colim and Lim denote colimit and limit of diagrams. I.e. compositionality is continuityof Mod.

    As an example consider the Amalgamation Lemma of [10], cf. Fig. 1. It states that (2) isa pullback in the category CAT of categories if (1) is a pushout of specifications. Here Vmdenotes the above mentioned forgetful functor along a specification morphism m.

    Note that the philosophy of semantic universes and of semantics-as-interpretationimplies two important facts: On the one hand, elements of a set (objects) can be mul-tiply interpreted (typed) (if e.g. i(t1) i(t2) = for two different elements t1, t2 ofspecification S). On the other hand, i is a fixed assignment which maps an element t to allobjects that are t-typed.

    Fig. 1 Amalgamation lemma (indexed version)

  • U. Wolter and H. Konig

    Fig. 2 Fibred amalgamation of and with common part

    Reliable semantics for model-driven structures, however, has to drop the philosophyof semantic universes, because in software environments each object possesses exactly onetype and it should not be possible to determine the set of t-typed objects. The second require-ment is important since it enables external extensions of software systems using inheritanceand specialization techniques.

    This mismatch between indexed semantics and software engineering requirements callsfor a shift of paradigm. First, we have to give up the strict separation of syntax and seman-tics. Instead of the syntax, on one side, and a semantic universe, on the other side, we haveto allow that syntactic and semantic entities live all together in the same category C , andthat, in addition, certain entities may play, at the same time, a syntactic and a semantic role.Second, we have to switch to fibred semantics [7, 33]. Fibred semantics means semantics-as-instance, i.e., the semantics of specifications are instances and are formalized by objectsof the slice categories C A, C L, C R, and C S. Mod gets traded for a functorInst assigning to a specification S the category C S or a subcategory of it. Moreover Instassigns to each specification morphism m : S S the pulling back-functor along m(e.g. the functor r which constructs the pullback of r and C R, this is the back facein Fig. 2). Since the meaning of an element x of a specification S in terms of an instance C S is now given by 1(x), i.e. the fibre of over x, this approach is called fibredsemantics.

    A crucial question arises whether compositionality smoothly carries over to the fibredsetting, i.e.

    Inst (Colim(D))?= Lim(Inst Dop). (1)

    Unfortunately and surprisingly it turns out, that this is not the case. We encounter two seri-ous problems. First, Inst : C op CAT is only a pseudofunctor, i.e. composition is onlyunique up to isomorphism.

    The second problem can be uncovered already in the special case of amalgamation:Given two instances C A and C R with common part , i.e. r = = a ,one wants to prove that the syntactic composition (pushout of a and r) is reflected on theinstance level by a unique construction. The counterpart for correctness is the requirementto obtain an S-instance in C S, such that its pullbacks along a and r yield and , resp.,see Fig. 2. This question, however, is closely related to the following concept:

  • Fibred Amalgamation in Topoi

    Definition 1 (Van Kampen Square) A pushout as in the bottom of Fig. 2 is called a VanKampen square if for all commutative cubes as in Fig. 2 (without question marks) with twopullbacks as rear faces the following equivalence holds: The top face is a pushout if andonly if the front and right faces are pullbacks.

    In indexed semantics we have amalgamation for arbitrary pushouts. In contrast, we knowthat already in the category SET there are pushouts that are not Van Kampen squares (see[8] and the forthcoming examples). In these cases there are rear pullback spans for whichamalgamation fails as well as spans that can successfully be amalgamated. Thus fibredamalgamation may or may not fail, if a and r together with their pushout do not enjoy VanKampen exactness.

    One way out of this dilemma is to restrict ourself to pushouts with a special propertyensuring Van Kampen exactness in most of the relevant application areas. A variant of thisrestrictive policy is the concept of adhesive categories [31] where it is required that pushoutsalong monomorphisms are Van Kampen squares. This means that if either a and r are monic,we can construct the pushout of a and r and know that front and right face are pullbacksas desired. Topoi are adhesive [21] thus this restriction works fine for a wide spectrum ofrelevant categories, as e.g. SET and GRAPH. It is well-known, however, that already in SETthere are many more Van Kampen squares than the ones where one participating morphismis monic. A precise characterization of all Van Kampen squares in our categories of interestremained an open problem which is as well theoretical as practically relevant.

    Another way out of the dilemma could be to restrict the quantification in Definition 1to the good pullback spans. The crucial observation is that for those pullback spans thatarise by applying a corresponding Grothendieck construction to coherent pairs of interpre-tations the equivalence in Definition 1 is satisfied [33]. A feasible characterization of thosegood pullback spans is practical relevant and would give us, at the same time, a betterunderstanding of the essential differences between indexed and fibred semantics.

    A category possesses all finite colimits if there are pushouts and an initial object. Ele-mentary conditions for amalgamation of spans (by pushouts), if there are any, can easily becarried over to all coequalizers, because a coequalizer of f, g : A B is given by onearrow in the cocone of the pushout of [f, g] : A + A B and [id, id] : A + A A.

    If the underlying category is extensive, i.e. if in the diagram

    C is the coproduct of X and Y if and only if both squares are pullbacks (which is the casein our most general setting, as we will see soon), these conditions can directly be usedto describe compositional colimits, because any colimit is constructed from a coequalizerand a coproduct. Hence understanding (the limits and conditions for) fibred amalgamabilitymeans to understand the circumstances for fibred compositionality in general.

    In this paper we want to draw and to describe an exact line which marks this bor-der for amalgamation. We distinguish between a total and an individual view. The totalview addresses the problem when a diagram of specifications yields amalgamation for allinstance constellations, i.e. under which conditions (1) holds for pushouts (or equivalentlythe resulting diagram is a Van Kampen square). The goal is to find a feasible condition which

  • U. Wolter and H. Konig

    is well-applicable for corresponding situations in software engineering (see e.g. Example 3below).

    A precursor of the total view will be an individual view: It shall produce a similarlyuseful condition for successful amalgamation of a fixed rear pullback span (especially, if thebottom square is not Van Kampen). This condition should come in terms of the structuresof the two rear pullbacks only. A request for such a condition was first raised in [33].

    To sum this up, the goal of this paper is to find answers for the following two questions:

    Question 1 Can we find necessary and sufficient conditions for a pushout to be a VanKampen square in terms of the span (a, r) only?

    Question 2 Can we find feasable conditions which characterize successful amalgamationof a fixed pullback span in terms of the structure of the span (even in the case that the bottomsquare is not a Van Kampen square)?

    We are interested to perform a comprehensive investigation of these questions in a moregeneral categorical setting that subsumes our main motivating application areas as graphtransformations and generalized sketches. The category GRAPH of multi graphs, as manyother categories of graph structures, can be described as presheaves, i.e., as functor cate-gories SET S with S a finite meta schema category (see Section 4.2). Also the categoryof generalized multi sketches becomes a presheaf as long as the underlying base category isa presheaf [25]. In such a way, presheaves appear as an adequate abstraction level to answerthe above questions.

    Presheaves are topoi [14], which are thus a good common biotop to develop and topresent the theoretical foundation for our investigations. A topos is a category with finitelimits, which is cartesian closed, and where the subobject functor is representable. Wemention some properties of a topos C which will be used frequently throughout the paper:

    1. C has all finite colimits [14], 4.3.2. C is extensive [14].3. If an arrow is monic and epic, it is an isomorphism [14], 5.1.4. Pullbacks preserve epimorphisms [14], 5.3.5. Pushouts preserve monomorphisms and, moreover, pushouts with a monomorphism

    involved are also pullbacks [14], 13.3.6. The pullback functor preserves colimits [14], 15.3.7. Epimorphisms are regular epimorphisms [26], Lemma 16.18.Topoi are adhesive [21], i.e. pushouts along monomorphisms are Van Kampen squares. Thusthe above questions are relevant especially for the case where both a and r in Fig. 2 havenon-trivial kernel relations.

    The paper is organized as follows. In Section 2 we give examples which show the sub-tleties which may destroy successful compositionality and how difficult it may be to decidewhether a square is Van Kampen or whether a given pullback span can be amalgamated. Inorder to show that the problems may frequently occur in practice, we include an examplefrom software engineering. Section 3 discusses related work.

    Descent Theory [15] is a good tool for quantifying the interrelation of kernels on a com-mon domain and it turns out that its theoretical results unfold their power in categorieswhich are essentially the same as sets [22]. As one of the main contributions of the paperSection 4.1 presents a full revision and adaption of the theory of descent data in topoi forapplications in diagrammatic specifications and, especially, in graph transformations. We

  • Fibred Amalgamation in Topoi

    point out the two main facets of descent data: On the one hand, it describes algebraic struc-tures, on the other hand, it codes lifted equivalence relations in pullback squares. Because acareful investigation of the relation of these algebraic structures and all possible pullbacks(even differentiating isomorphic pairs) is necessary, a well-known result on effective decentmorphisms [27] is slightly sharpened (Proposition 1).

    In Section 4.2 we investigate, in more detail, descent data in presheaves. We show thatthere is a bijective correspondence between abstract objects of the category of descent dataand families of bijections on the fibres over related elements (Proposition 2). Moreover,we emphasize the role of descent data as information that codes how to construct pullbackcomplements in the spirit of [18].

    In Section 5 we introduce the precise notions of amalgamability of pullback spans andof coherence of pairs of algebraic structures. Algebraic structures are coherent if they arereducts of a uniquely determined larger algebraic structure. Pullback spans are amalgam-able, if they are simultaneous projections of an essentially unique larger pullback. Weinvestigate the strong relationship between these two concepts.

    We introduce several useful functorial relations on the level of pullbacks (where amalga-mation is carried out) as well as on the level of descent data (where the question of coherencearises) and interrelate them according to the results of Section 4. The central technical resultis Lemma 9 which is the precondition for the validity of Propositions 4 and 5, one of themain contributions of this paper. In these propositions, we basically prove that amalgama-bility is equivalent to coherence. Although still in an abstract context, this already providesand prepares a more feasable answer to Question 2.

    There is also an easy consequence of this result (Theorem 1) which provides a fibredamalgamation lemma in terms of descent data. Theorem 1 gives us a nice (but still unprac-tical) equivalent characterization of Van Kampen squares in terms of the limit (pullback)of certain categories (cf. (1)). However, the theorem provides the prerequisite to gain apractical answer to Question 1 for presheaves.

    Section 6 investigates amalgamation and coherence in presheaves. A general analysis inthe context of the results of Section 4.2 is performed. It turns out that the aforemetionedborder between failure of and successful amalgamation can be characterized with the helpof so-called domain cycles, i.e. conglomerates of elements in carrier sets that let the kernelsof morphisms overly interact. Based on this definition, Theorem 2 provides a full answer toQuestion 2 whereas Proposition 6 yields the missing link to the total view.

    It can be observed here that the answer for Question 2 indeed was a precondition to finda full answer to Question 1 in Theorem 3 which is the desired equivalent characterizationof Van Kampen squares in terms of the interacting kernels of a and r. In order to show theeffects of the results, the examples from Section 2 are revisited.

    Finally, Section 7 discusses open problems and outlines interesting directions forapplications and future research.

    2 The Problem of Successful Amalgamation

    In contrast to indexed amalgamation, there are intrinsic difficulties in the fibred setting,because the given rear pullback span can be located over a non-Van Kampen square. In otherwords, a reasonable construction on the instance level fails if and only if the pullback spanis not amalgamable. This is demonstrated in

  • U. Wolter and H. Konig

    Fig. 3 Amalgamation fails

    Example 1 In Fig. 3, elements in the domain of instances are denoted i : t . Instances mapthese elements to their types t. a and r map according to the letters. i : t, j : s I areconnected via dashed lines if r (i : t) = r (j : s). Dotted lines depict the kernel of a. It caneasily be computed that the two rear squares establish a pullback span in SET.

    However, the span can not successfully be amalgamated: On the one hand, pullbackcomplements for the right and the front face with sets over S containing two elements willalways yield a non-commutative top face. On the other hand, the pushout on the top facecreates a C S-object (the mediator out of the pushout), whose domain is a singleton set.But pulling back this instance along r and a does not yield and , resp.

    These effects can not occur in the indexed setting because multiple typing was allowed.The transition from indexed to fibred semantics, however, entails the production of copies.E.g. in the indexed setting, it would be sufficient to let map each element of L to the set{1, 2}, whereas the transformation to the fibred setting produces 4 copies of this 2-elementset (yielding the set I in Fig. 3).

    As pointed out before, we can consider specifications as categories and each interpre-tation becomes a functor to CAT (probably only reaching discrete categories, i.e. sets). Itis well-known that these indexed categories are related to fibrations via the Grothendieckconstruction [1, 33]. However, since the image of this construction is the category of splitfibrations, all produced copies behave in a uniform way.

    Example 2 In the pullback span in Fig. 4, for example, fibres are lifted in a uniformway. The pullback span can now be amalgamated. The instance over S is : {1 : xyzw,2:xyzw} S.

    But if pullback spans are not results of the Grothendieck construction, we suffer from theenlarged degree of freedom for defining the relationship between fibres, i.e. the equivalencerelations of a and r may chaotically be intertwined as in Example 1. Moreover, instancesmust no longer be fibrations. Intuitively the set of possible instances for a specification ismuch larger than the set of interpretations. The problems immediately occur in practicalenvironments as demonstrated by the next example:

  • Fibred Amalgamation in Topoi

    Fig. 4 Amalgamation is successful

    Example 3 In this example we consider a (parametric) specification with data types Personand Business Partner, both of which shall possess two different kinds of contact infor-mation (abbreviated cInf o1/2) as in Fig. 5. Specification morphism a replaces the formalparameters by strings, which is reasonable because both types of information may be tex-tual. Moreover, the architects of the system will simplify matters by identifying Person andBusiness Partner (formalized by r : L R). The combined entity type will be calledIndividual. This is reasonable, especially because Person and Business Partner possessedthe same attributes.

    The specification morphisms together with its pushout are shown in Fig. 5. The pushoutobject is the result of passing an actual parameter into the restructuring procedure r. The

    Fig. 5 Software system reengineering with simultaneous parameter passing

  • U. Wolter and H. Konig

    question arises whether each compatible pair (, ) of instances of A and R, resp. can beamalgamated. In Section 6 we will give a proof that this is not the case.

    3 Related Work

    To our best knowledge this is the first journal paper elucidating the close connectionbetween Van Kampen squares and fibred amalgamation. This connection was presented anddiscussed the first time by the first author at WADT 2008 and some results, based on descentdata, have been presented at ACCAT 2012. The present paper extends essentially the paper[20] published in the post-proceedings of ACCAT 2012 in two ways. First, the foundationalpart on descent data, amalgamation, coherence, and Van Kampen is completely revised andessentially extended. Second, the characterization of amalgamable pushout spans (and thusof Van Kampen squares) has been revised and generalized to arbitrary presheaves instead ofSET only.

    The result that topoi are adhesive [21] provides the equivalence of amalgamability andcoherence for the simple cases of pushouts with, at least, one monomorphism involved (seeLemma 10) and is integrated in the proof of Proposition 5. Lack and Sobocinski [21] usesalso some results of descent theory and some similar auxiliary results from topos theory.Besides a full revision and adaption of descent theory the present paper exceeds [21] alsoby addressing amalgamability for arbitrary pushouts.

    Heindel and Sobocinski [17] shows that being a Van Kampen square in a category C isequivalent to saying that its embedding into a certain span category over C is a pushout. Incontrast to this abstract reformulation of Van Kampen exactness by means of higher levelcategorical structures, we are looking here for an elementary and feasable characterizationof Van Kampen squares locally within C .

    Finally, we have to mention that the crucial technical observation about domain cyclesand Van Kampen squares goes back to Michael Lowe and has been elaborated in SET(without any references to descent data) in [23].

    4 Descent Theory

    In this section the underlying category C is a topos. We will use the following notations:ObC , MorC denote objects and arrows of C , resp. x C means x ObC . The applica-tion of a functor F to an object or an arrow x will often be denoted without parenthesis:Fx. The composition of functors F : C D and G : D S is denoted by G F.

    denote monomorphism, epimorphism, isomorphism, resp inevery category.

    For an arrow p : E B of C we sometimes want pullbacks along p to be uniquelydetermined. Thus we work with chosen pullbacks. Its well-known that any fixed choice ofpullbacks gives rise to a pullback functor p : C B C E where (p, 2(p, ))denotes the chosen pullback of (, p). The image pf of an arrow f MorCB(, ) isgiven by the unique arrow pf := idE B f : E B A E B A of C such that

    p (idE B f ) = p and 2(p, ) (idE B f ) = f 2(p, ). (2)

  • Fibred Amalgamation in Topoi

    Whenever we use notations p or 2(p, ) (or shortly 2 if p and are fixed), werely on a fixed choice of pullbacks. Sometimes we use the analogical notation for the firstprojection of the pullback: 1(p, ) := p (or shortly 1 if p and are fixed).

    It is an old observation that pullback functors establish adjoint situations:Lemma 1 Let C be a category with pullbacks and be an arrow of C . Let p :C B C E be the pullback functor for a fixed choice of pullbacks and p : C E C B be the post composing functor, which sends an arrow h MorCE(, ) toh : p p , an arrow of MorCB . Then p is left-adjoint to p, p p in symbols,with unit p : idCE p p and co-unit p : p p idCB where

    p := 2(p, ) for each C B , and

    p := , idC for each C E, i.e., p is the unique arrow such that

    pp p = idC and pp p = . (3)

    A proof can be found e.g. in [13], p. 16.The monad arising from the adjunction p p is denoted by (Tp, p,p), i.e. Tp :=

    p p : C E C E with natural transformations p : idCE Tp and p :=pp : (Tp)2 Tp (see [2] for a quite comprehensive investigation on this subject).

    4.1 Descent Data in Topoi

    In this first subsection, monadic descent theory [15, 16] is introduced: Grothendieck usedthe term descent because any arrow p : E B of a category C can be used to reasonabout structures in C B (which may be difficult) by reasoning about monadic algebraicstructures over C E, thus in a sense descending along p. In this first subsection C isa general topos, the second subsection deals with a more practical view on descent data inpresheaves, i.e. in functor categories C = SET S .

    This subsection revises, adapts and extends results in [18] to facilitate our intended char-acterization of amalgamation in terms of descent data. The main result will be Proposition1 which extends a theorem on effective descent in [18] in that it avoids a certain degreeof freedom when passing from C B to algebraic structures: By exchanging C B withthe category of all possible pullbacks along p we obtain a more precise description of therelationship between these algebraic structures and pullbacks.

  • U. Wolter and H. Konig

    Fig. 6 Monadic descent data

    Definition 2 (Descent Data) Let be given and (Tp, p, p) be themonad on C E arising from the adjunction p p. Descent data for relative to p is anarrow

    : Tp of C E with p = idC and Tp = p . (4)

    The situation is as in Fig. 6. Besides the C B-arrow 2 := 2(p, p ), the right-handside shows objects and the arrow after applying the left-adjoint p only.

    According to the definition of the pullback monad and Lemma 1 we have2 p = idC and p = p2. (5)

    Note that, for some and p, an arrow as in Definition 2 may not exist or may be notunique, in case it exists. For future reference, we note that can be reconstructed from theE B C-endomorphism := 2, , i.e. the uniquely determined for which

    Tp = 2 and 2 = . (6)Janelidze and Tholen [18] gives a detailed investigation on that topic. It is also shown that

    = idEBC. (7)

    Definition 3 (Category of Descent Data) The category des(p) of all descent data relativeto an arrow p : E B in C has objects (, ) with the properties of Definition 2 andarrows h : (, ) ( , ) the morphisms h : of C E with Tph = h .

    Let | |p : des(p) C E be the carrier functor, i.e. |(, )|p = and |h|p = h.

    Now we consider not only chosen but arbitrary pullbacks along p.

    Fig. 7 The categories des(p) and pb(p)

  • Fibred Amalgamation in Topoi

    Definition 4 (Category of Pullbacks) For any arrow p : E B in C let pb(p) denotethe category with objects (, q, ) commutative diagrams of arbitrary pullbacks along ptogether with morphism pairs (f1, f2) MorCEMorCB such that the rear square in theright diagram in Fig. 7 commutes. Note that (by the decomposition property of pullbacks)the rear face is a pullback, too.

    Let p : pb(p) C E be the (left) projection functor p(, q, ) = ,

    p(f1, f2) = f1.

    Our goal is now to establish the relationship between pb(p) and des(p) with the help ofsuitable functors in both directions. Since the monoidal conditions (4) (neutrality and asso-ciativity) imply that des(p) is the Eilenberg-Moore Category associated with the monadTp , there is the comparison functor p : C B des(p) [2]. Because pb(p) is equiva-lent to C B via chosen pullbacks, the composition of this equivalence and the comparisonfunctor seems to be a good choice for the direction from pb(p) to des(p). For our purposes,however, we omit the stopover C B and construct directly a functor

    p : pb(p) des(p) with |p|p = p (8)(which, in fact, yields the above mentioned composed functor up to natural isomorphism,such that we still use the name p for this functor).

    For this let us consider an arbitrary pullback (, q, ) along p in C , i.e., an arbitrarypullback complement (q, ) of (, p), cf. the square (pb) in Fig. 8. We denote by (q,) theunique arrow for which

    q (q,) = q 2 and (q,) = Tp, (9)(the dashed arrow in Fig. 8) which establishes, in such a way, also an arrow (q,) : Tp . From (5), (9), and the uniqueness of mediating morphisms for the original pullback oneeasily deduces

    (q,) p = idC.Moreover, mapping the commutative diagram (in C B) q (q,) = q 2 by p yields

    (q,) Tp (q,) = (q,) p

    Fig. 8 The assignment (, q, ) (, (q,)) of p

  • U. Wolter and H. Konig

    by the second equation of (5) (see Fig. 8). Hence (q,) fulfills (4) such that the functorp : pb(p) des(p) can now be defined by

    p(, q, ) :=(, (q,)

    )

    on objects. Mapping the rear square in Fig. 7 (which also lives in C B) by p yields (q

    ,) Tpf1 = f1 (q,) for any (f1, f2) Morpb(p), hence p extends to arrows:p(f1, f2) := f1.

    This implies especially

    p(, q , ) = p(, q, ) for all (id, f ) : (, q, ) (, q , ) in pb(p).(10)

    Moreover, we have |p|p = p .Now we are looking for a functor in the opposite direction

    p : des(p) pb(p) with p p = | |p. (11)For each (, ) Obdes(p) we have p 2 = p Tp = p since : Tp is an arrow in C E and due to the definition of Tp (cf. the diagram in Lemma 1). Hencethere is an assignment p : Obdes(p) Obcomm(p) which maps (, ) to the commutativesquare (, c , ) along p where is the unique arrow, which mediates p and a (fixedchoice of) coequalizer c of 2 and (see Fig. 9). p extends to a functor because anyh Mordes(p)((, ), ( , )) not only results in a commutative square h = Tphbut also yields by (2)

    h 2(p, p ) = 2(p, p ) Tph.Thus there is a unique arrow h which mediates c h out of the coequalizer c . The unique-ness of mediating morphisms out of c entails h = thus h : establishesan arrow in C B . We define ph := (h, h).

    It remains to show that (, c , ) is not only a commutative but a pullback square alongp. Although this can be deduced from considerations on discrete fibrations in topoi ([27],Remark VIII, 2.7.), we give here a short proof introducing, along the way, some conceptsand results we will need later on. We need an auxiliary result (cf. [27], Chapter VIII):

    Lemma 2 Let C be a topos and a commutative diagram be given with an epimorphism asindicated. If (1) + (2) and (1) are pullbacks, then (2) is a pullback, too.

    Fig. 9 The assignment(, ) (, c , ) of p

  • Fibred Amalgamation in Topoi

    By pullback decomposition the span( (q,), 2

    )in Fig. 8 becomes a pullback of the

    cospan (q, q) which means that (q,), 2

    is the kernel pair of q and thus an equivalence.

    Definition 5 (Equivalence Relation) An equivalence relation on A ObC is a pair ofarrows a, b : U A, such that is a monomorphism, and which is1. reflexive: r : A U : a r = b r = id ,2. symmetric: s : U U : a s = b, b s = a, and3. transitive: If (p : P U, q : P U) is the pullback of (a, b) (especially b p =

    a q), there is t : P U , such that a t = a p and b t = b q .

    Not only canonical descent data (q,) but arbitrary descent data provide equivalences:

    Lemma 3 establishes an equivalence relation for any descent data : Tp .

    Proof Since for any pullback Tp, 2 is monic, the equation = Tp implies that, 2 is monic as well. For reflexivity, let r := p and use (4) and (5). Symmetry followswith s := , (6), and (7). Transitivity can be established via t := p using both commutingtop squares in Fig. 8

    (with instead of (q,)

    ), that are also pullbacks by decomposition,

    and (4).

    The crucial consequence of Lemma 3 is that , 2 is the kernel pair of its coequalizer,because in topoi, equivalence relations are effective (see [19], A 2.4.1.). Consider now theabove introduced coequalizer construction for p.

    Lemma 4 The right square in Fig. 10 is a pullback.

    Proof By Lemma 3 and because equivalence relations are the kernel pair of their coequal-izer, the left square in Fig. 10 is a pullback. Because = Tp , by assumption : Tp , and c = p , by definition of , the outer rectangle in Fig. 10 is thechosen pullback of p and p. Since c is epic, the result follows from Lemma 2.

    After having proved that p is indeed a functor with codomain pb(p) and p p =| |p we are going to show now that both functors establish an adjunction p p betweenthe categories des(p) and pb(p).

    It is well-known [24] that two functors F : C D , G : D C are adjoint, F G insymbols, iff there exist natural transformations : idC G F, the unit of the adjunction,

    Fig. 10 Coequalizerconstruction

  • U. Wolter and H. Konig

    and : F G idD , the co-unit, such that the following two equations hold for thecorresponding horizontal compositions of functors and natural transformations:

    G G = idG and F F = idF. (12)

    In our case of descent data and pullbacks the unit : iddes(p) p p is the identity:

    Lemma 5 p p = iddes(p).

    Proof By the definition of p and p , respectively, we have (p p)(, ) =(, (c

    , ))

    for all objects (, ) in des(p). Both arrows , (c , ) : E B C C satisfythe defining equations (9), with q = c the coequalizer of and 2, thus = (c , ) byuniqueness. For morphisms we have trivially (p p)(h) = p(h, h) = h.

    The co-unit : p p idpb(p) is provided by epi-mono-factorization. For this weneed the following Lemma, cf. [14].

    Lemma 6 Let f : A B be an arrow in a topos C and let c be a coequalizer of the(chosen) kernel pair (p1, p2) of f. Then the mediator m of f out of the coequalizer c is monic.This epi-mono-factorization f = m c is unique up to a unique isomorphism, see Fig. 11.

    Given (, q, ) in pb(p) we consider a coequalizer c (q,) of the kernel pair(2,

    (q,))

    ofq. The monic mediator according to Lemma 6 is denoted by m(q,) and will establishfora fixed choice of coequalizerthe co-unit for (, q, ), see Fig. 11:

    (,q,) :=(idC,m

    (q,))

    :(, c

    (q,)

    , (q,)

    ) (, q, ). (13)

    We assume q = idA q to be the epi-mono-factorization of epic q, i.e. (,q,) = id(,q,)whenever q is epic.

    m(q,) = (q,) and naturality for the co-unit (,q,) is ensured by uniqueness ofmediators out of the coequalizers c (q,) , cf. the definition of p.

    It remains to show adjointness. By Lemma 5 the two equations in (12) reduce, in ourcase, to the requirements

    p = idp and p = idp . (14)The first equation follows immediately from (10) and the definition of and p , respec-tively. The second equation is an immediate consequence of Lemma 5. Since in topoi epimorphisms are preserved under pullbacks, we have shown

    Fig. 11 Epi-mono factorization

  • Fibred Amalgamation in Topoi

    Proposition 1 (Adjunction between Pullbacks and Descent Data) For any topos C andany fixed choice of pullbacks and coequalizers in C , respectively, we have for any arrowp : E B in C functors p : des(p) pb(p) and p : pb(p) des(p) such thata) p p with p p = iddes(p).b) If p is an epimorphism, p p becomes an equivalence of categories.

    Note that b) outlines the well-known fact that in topoi the class of epimorphisms isprecisely the class of all effective descent morphisms, i.e. those morphisms for which thecomparison functor becomes an equivalence [18]. The novelty, however, is that we showedthis result in terms of an equivalence involving the category of pullbacks along p.

    4.2 Descent Data in Presheaves

    4.2.1 Diagrammatic Specifications and Presheaves

    As pointed out in the introduction, the paper is devoted to investigate amalgamation forfibred semantics of diagrammatic specifications as it has been defined, for instance, in theDiagram Predicate Framwork (DPF) [7, 29, 30]. Thereby diagrammatic is not meant asa synonym for visual but rather for graph-based. DPF is generic in the sense that itcan be instantiated for a wide range of graph-based structures. A specification in DPF is ageneralized sketch in the sense of [25].

    The kind of underlying graph-based structure, we use in a certain application area, canbe described, in general, by a meta schema, i.e. by a small (schema) category. As a simplemeta schema we can consider, for instance, the following schema category for multi graphs:

    Another example are attributed graphs [12]. They are based on so-called E-graphs whichconform to the schema category

    where edges (E1) connect complex vertices (V1) and attributes (E2) link complex and prim-itive vertices (V2). Moreover edges may be annotated (E3) with primitive types (e.g. tospecify list indices).

    A third prominent example is the schema category for Petri-nets:

  • U. Wolter and H. Konig

    (pre- and postconditions specify places that are consumed/produced by a consumer/producer transition).

    A structure which conforms to such a schema category S is a functor F : S SET .Structure morphisms are given by natural transformations between them. Hence presheaves,i.e. functor categories C = SET S with a small schema category S are an appropriatelevel of abstraction for our intended applications. This is underlined by the fact that thecategory of generalized multi sketches over a chosen category of underlying structures isequivalent to a presheaf as long as the category of underlying structures is equivalent to apresheaf as well [25].

    An object of S will sometimes be called a sort, an arrow of S will be called a (neces-sarily unary) operation symbol. Accordingly, we also use the more intuitive spelling for theapplication of a functor F SET S to an object/sort X:

    FX := FX.Likewise, the application of F to an arrow op : X Y will be the function

    opF : FX FY .In natural transformations n : F G, n = (nX)XObS , we often omit the index X andwrite n : FX GX if there is no danger of confusion.

    For any functor F : S SET and X ObC we call the set FX the carrier set ofsort X. E.g. for Petri-nets there are four sorts Pre, Post, P, T and four non-identity operationsymbols specifying the causal producer-consumer relation.

    Our previous theoretical results apply to presheaves since any presheaf SET S is a topos([14], Section 9.3).

    In fibred semantics, restriction of instances along some specification morphism is pull-back. By Proposition 1 the cleavage kernels generated by the pullback procedure canprecisely be described with descent data. Compositionality problems (see the examplesin Section 2) arise from uncoordinated kernel generation of two morphisms on a com-mon domain. The following subsections shall foster a better understanding of descentdata in presheaves in terms of its action on carrier sets and shall significantly support theunderstanding of these effects.

    First, we analyse descent data in SET (Section 4.2.2). Since limits and colimits in apresheaf are constructed componentwise by limits and colimits in SET, respectively, ouranalysis extends then smoothly to presheaves SET S in Section 4.2.3.

    4.2.2 Descent Data in SET

    If C = SET , p : E B , and : C E, we choose as canonical pullbacksE B C = {(e, c) E C | p(e) = p( (c))} and

    E B (E B C) = {(e, (e, c)) E (E C) | p(e) = p(e) = p( (c))}.A purely set-oriented description of descent data (, ) emerges from the following

    observations: Because products in comma categories are pullbacks in the underlying cate-gory, p Tp = p 2(p, p ) : E B C B in Definition 2 provides a productp (p ) in C B with projections Tp and 2(p, p ), respectively. Moreover, any : E B C C in C which is an arrow : Tp in C E establishes also an arrow : p (p ) p in C B . C B , however, is also a topos by the fundamentaltheorem of Freyd [13] and thus, espcially cartesian closed, such that

    HomCB(p (p ), p ) = HomCB(p, (p )p ) .

  • Fibred Amalgamation in Topoi

    Like in [14] par. 15,3, one can show that the exponent (p )p is defined on the set ofall endomaps

    {k : (p )1(b) (p )1(b) | b B} and each k is mapped to its base

    point b. In such a way, can be regarded as a map that assigns to any element e E anendomap (e, ) of the fibre of p over p(e).

    Let us make this intuition more precise: For any e E we have p1(p(e)) =[e]ker(p).1 Thus the fibre of p over p(e) is the set 1([e]ker(p)) and can be described,in such a way, as the union of all pairwise disjoint fibres 1(e) with (e, e) ker(p). Welet e,e be the map (e, ) restricted to 1(e). If c 1(e) we obtain ((e, c)) = esince Tp = 1(p, p ). Thus the codomain of e,e is 1(e) and represents a family

    (e,e : 1(e) 1(e)

    )

    (e,e)ker(p) (15)for which by definition

    (e, c) = e,e(c) whenever (c) = e. (16)Let us now investigate the influence of neutrality and associativity (4) to this family. FromLemma 1 and (2) we obtain

    p (c) = ( (c), c), p (e, (e, c)) = (e, c), Tp(e, (e, c)) = (e, (e, c)). (17)Thus (4) and the first equation in (17) yield

    e,e(c) = c for all c 1(e), i.e. e,e = id1(e), (18)whereas (4) (applied to a triple (e, (e, c))) and the second and third equation of (17) imply

    e,e(e,e(c)) = e,e(c) for all c 1(e), i.e. e,e e,e = e,e (19)for all (e, e), (e, e) ker(p). By choosing e = e, both properties force each e,e to bebijective.

    By reversing the whole argumentation, it is easy to see that a familiy(e,e : 1(e) 1(e) | (e, e) ker(p)

    )

    which satisfies (18) and (19) yields a descent data : E B C C of relative to p inC = SET by defining as in (16) for e := (c).

    4.2.3 Descent Data in SET S

    Pullbacks in SET S are constructed componentwise by pullbacks in SET. Applied to oursituation, this means that the pullback of two morphisms p : E B and p : C Bin SET S is given by the functor E B C : S SET defined by

    (E B C)X := EX BX CX on objects X ObS and (20)

    opEBC := opE opB opC on arrows op : X Y (21)(see Fig. 12) together with the natural transformation 1 : EB C E, 2 : EB C Cdefined by ordinary set projections

    (1)X := 1 : (E B C)X EX and (2)X := 2 : (E B C)X CX. (22)We rely on the same canonical choice of pullbacks as in Section 4.2.2 pointwise for each

    X ObS . In such a way, for each descent data : E B C C in C = SET S the

    1[ ] denotes the canonical map from a set A to A/ for any equivalence relation on A.

  • U. Wolter and H. Konig

    Fig. 12 Componentwise construction of pullbacks

    component X : (EB C)X CX is uniquely described by a family ((X)e,e)(e,e)ker(pX)of bijections satisfying neutrality (18) and associativity (19).

    It remains to show that compatibility with operation symbols, that is the naturality of ,can be expressed equivalently on the level of pre-images of fibres: Given any op : X Y MorS , naturality of ensures that opC : CX CY restricts to a map opCe : 1X (e) 1Y (opE(e)) for each e E.

    Naturality of means, according to (21) and our choice of pullbacks, that we haveY (op

    E(e), opC(c)) = opC(X(e, c)) for all e EX and c CX where pX(e) =pX(X(c)) (see Fig. 13). By (16) this is equivalent to the requirement

    (Y )opE(e),opE(e)(opCe (c)

    )= opCe

    ((X)e,e(c)

    )

    for all (e, e) ker(pX) and c 1X (e).Altogether we obtain the following statement which subsumes the monoidal nature of

    descent data in SET S .

    Proposition 2 (Descent Data in SET S ) Let C = SET S , and p MorC . There is abijective correspondence between objects (, ) of des(p) and families

    ((X)e,e : 1X (e) 1X (e))XObS ,(e,e)ker(pX)of bijections which satisfy

    (X)e,e = id1X (e) , (X)e,e = (X)e,e (X)e,e

    Fig. 13 Naturality of descent data in SET S

  • Fibred Amalgamation in Topoi

    for all X ObS , (e, e), (e, e) ker(pX), and

    (Y )opE(e),opE(e) opCe = opCe (X)e,e

    for all op : X Y MorS , (e, e) ker(pX).

    We want to close this section with descent datas role as congruence relation (i.e. equiva-lence relation compatible with operation symbols). Recall that the functor p : des(p) pb(p) created a pullback with the help of the coequalizer c of and 2, cf. Fig. 9, where(, 2) is the kernel pair of c.

    For X ObS any pair (x, x ) ker(cX) gives rise to the existence of a unique (e, x ) EX BX CX with 2(e, x ) = x and X(e, x ) = x , because kernel pairs are pullbacks.Hence x = x such that (x, x ) = (x, X(e, x)) = (x, (X)X(x),e(x)) with pX(e) =pX(X(x)) by (16). Since we know that y := (X)X(x),e(x) is in the fibre over e, we obtain

    ker(cX) = {(x, (X)X(x),X(y)(x)) | x, y CX, (X(x), X(y)) ker(pX)} (23)

    for each X ObS . By Lemma 4 and Fig. 10, the resume can be stated as follows:Each (, ) des(p) represents a congruence relation on C which highlights one

    pullback complement of and p.

    5 Amalgamation, Van Kampen, and Coherence in Topoi

    As pointed out in the introduction, amalgamation of instances provides the basis for compo-sitionality. The goal of this section is to characterize those pullback spans in arbitrary topoithat can be successfully amalgamated, see Fig. 14.

    We will demonstrate that the close relationship between descent data and pullbacks inProposition 1 provides such a theorem in terms of the degree of coherence of descent dataof the two pullbacks. Surprisingly, this result (Propositions 4 and 5) leads to an analogonof the classical amalgamation lemma for indexed semantics (see Theorem 1). It will turn

    Fig. 14 Is amalgamationpossible for the rear pullbackspan (pb1, pb2)?

  • U. Wolter and H. Konig

    Fig. 15 Pullback decompositionalong h : f g

    out in Section 6 that Theorem 1 prepares a more feasible and easily checkable criterion foramalgamability in typical contexts of computer science, i.e. presheaves.

    5.1 Amalgamation and Van Kampen Squares

    To lift our following discussion of amalgamation to a more structural level we consider thecoslice category L C . Taking this abstract viewpoint, the assignments f pb(f ) formorphisms f : L F in C define a map from the objects in LC to the objects in CAT.We show now that these assignments can be extended to morphisms in LC .

    Let objects f : L F , g : L G and a morphism h : f g in LC be given, i.e.a morphism h : F G in C with h f = g, see Fig. 15. We can decompose any pullbackin pb(g) into a pulback in pb(f ) and a pullback along h:

    First, we calculate the chosen pullback h . Second, the pullback (, f , h) in pb(f )arises uniquely from the mediator f from the outer pullback into the right chosen pullback.The assignment of the outer pullback to the left pullback extends to a functor h : pb(g) pb(f ) (the notation is meant to remind of decomposition).

    Since chosen pullbacks do not necessarily compose to chosen pullbacks, we will, ingeneral, not have h2h1 = h1 h2 for arbitrary morphisms h1 : f1 f2, h2 : f2 f3in L C but only that h2h1 and h1 h2 are natural isomorphic. In such a way, theassignments f pb(f ) and h h do not define, on the global level, a functor but onlya contravariant pullback decomposition pseudo functor

    PDL : (LC )op CAT . (24)

    For a commuting square, as in the bottom of Fig. 14, we consider the pairing

    r,a : pb(s) pb(a) CL pb(r).

    where pb(a) CL pb(r) is the category of all pullback spans over (a, r) together withmorphism triples (m1,m2, m3), i.e. pb(a) CL pb(r) is given by a standard constructionof pullbacks in CAT, see Fig. 16 and (25). 2

    2A similar construction with pb(s) replaced by (the equivalent category) C S has been considered indifferent investigations on adhesive categories, cf. [21, 31].

  • Fibred Amalgamation in Topoi

    Fig. 16 Objects and morphisms in the category pb(a) CL pb(r)

    Definition 6 (Amalgamability) A pullback span in pb(a)CL pb(r) is amalgamable, ifthe span is in the image of r,a up to a pb(a) CL pb(r)-isomorphism of the form(m1, id ,m3).

    (25)

    That is, we require that the pairing of the decomposition procedure (based on chosen pull-backs) almost reaches the given pullback span: The instances and may isomorphicallybe distorted while is reached exactly. We have to work with reachable up to isomor-phism since we decided to consider pb as a functorial construction, based on chosenpullbacks, and not just as a relation.

    For future reference, we note that any arrow (m1, m2,m3) between two amalgamablespans has a preimage under the pairing functor:

    r,a(m2, m) = (m1, m2,m3) (26)

    where m is the mediator between the two resulting top pushouts during amalgamation (recallthat pushouts are stable under pullbacks in topoi).

    Finally, we mention that universal amalgamability is equivalent to the Van Kampenproperty [31]:

    Proposition 3 A pushout square, as in the bottom face of Fig. 14, is a Van Kampen squareif and only if each rear pullback span over this square is amalgamable.

    5.2 Coherence in Topoi

    We now investigate conditions for amalgamability in terms of the descent data of the twoback face pullbacks in Fig. 14 by applying the methodology of Section 4. Again, a morestructured view is achieved by extending the assignment f des(f ) to a functor fromLC into CAT.

  • U. Wolter and H. Konig

    Fig. 17 Monad embedding

    Let f : L F , g : L G and h : f g in L C be given as in Section 5.1. Weconsider the pullbacks f (f ) and g(g ) as in Fig. 6 (with C := I , E := L, andp : E B replaced by f : L F , g : L G, resp.), see Fig. 17.

    Because g = h f , we obtain g 2(f, f ) = g Tf . Hence there is a uniqueuh : L F I L G I such that

    2(g, g ) uh = 2(f, f ) and Tg uh = Tf . (27)Note, that in SET S , Tf , 2(f, f ) and Tg, 2(g, g ) are componentwise first andsecond projections (of sets), which actually makes uh invariant under projections: IndeedL F I = {(l, i) | f ( (i)) = f (l)} {(l, i) | g( (i)) = g(l)} = L G I for each carrier,where the inclusion is uh . This justifies the use of the hooked arrow in Fig. 17.

    The uniqueness of mediators ensures that the uh establish a natural transformation uh :Tf Tg . Moreover, this natural transformation provides a perfect embedding of a smallinto a larger monad: The proof of the following lemma consists of a collection of routinecalculations and can be found in [34].

    Lemma 7 For any morphism h : f g in L C the natural transformation uh : Tf Tg is monic and defines a monad morphism from (Tf , f , f ) to (Tg, g, g), i.e. thefollowing laws are satisfied

    uh f = g and uh f = g (uh)2

    where (uh)2 : (Tf )2 (Tg)2 is the horizontal composition of uh with itself.

    Monad morphisms give rise, by simple pre-composition, to forgetful functors betweenthe corresponding categories of descent data:

    Lemma 8 For any morphism h : f g in LC we can define a functor Uh : des(g) des(f ) by

    Uh(, ) :=(, uh

    )

  • Fibred Amalgamation in Topoi

    on objects and on arrows by

    Proof Since des(p) is the category of Eilenberg-Moore-Algebras associated with Tp forp {f, g}, the result follows from Lemma 7 and the proof of a theorem of Barr and Wells([2], Theorem 6.3 in Chapter 3).

    The intutition that descent data abstract from the monic part of a morphism can begrasped, in a formal way, by the statement that each monic h establishes an isomorphismbetween categories of descent data.

    Corollary 1 The functor Uh : des(g) des(f ) is an isomorphism for all morphismsh : f g in LC with h monic in C .

    Proof In case h monic, the right square in Fig. 17 is already a pullback, such that itscomposition with the pullback of f and f already yields the outer pullback (of g andg ) up to a canonical isomorphism. By (27) this isomorphism must be uh . We denote theinverse of uh by vh .

    The vh establish a natural transformation (isomorphism) vh : Tg Tf with vh uh =idTf and uh vh = idTg . In such a way, uh f = g and uh f = g (uh)2entail f = vh g and f (vh)2 = vh g , respectively, thus vh defines a monadmorphism from (Tg, g, g) to (Tf , f , f ). By the same construction as in Lemma 8 weobtain, finally, the required functor V h : des(f ) des(g) with V h Uh = iddes(g) andUh V h = iddes(f ).

    By uniqueness of mediators we have uidf = idTf and uh2h1 = uh2 uh1 . Accordingto the construction of our forgetful functors this entails Uidf = iddes(f ) and Uh2h1 =Uh1 Uh2 . In such a way, the assignments f des(f ) and h Uh define, on the globallevel, for any object L in C a contravariant descent data functor

    DDL : (LC )op CAT . (28)

    We are now able to settle a close interrelation between the assignments DDLh = Uh andPDLh = h which will allow us to replace pseudoriality (of PDL) by compositionalityon the nose (of DDL):

    Lemma 9 For any morphism h : f g in LC we have

    Uh g = f h : pb(g) des(f ).

  • U. Wolter and H. Konig

    Proof Take any pullback (, g, ) pb(g) and decompose it by h:

    Due to the definition of Uh, g, f , and h we have to show that (g,) uh = (f , ):We obtain

    h f (g,) uh = h f 2(g, g ) uh By (9)= h f 2(f, f ) By (27)

    and f (g,) uh = f (g

    ,) uh Left square commutes= f Tg uh (g

    ,) : Th = f Tf By (27)= f 2(f, f ) Definition of Tf = f 2(f, f ) Left square commutes

    Since h and are jointly monic, we obtain f (g,) uh = f 2(f, f ). By (g

    ,) : Th and (27) we have, moreover, (g,) uh = Tf thus the desiredequality follows from the fact that (f , ) is unique with these two properties (cf. (9)).

    A commutative square as in the bottom of Fig. 14 can be seen, equivalently, as a com-mutative square of morphims a : r s, r : a s, a : idL a, r : idL r in L Cgiving rise, in such a way, to a commutative diagram of forgetful functors as in the top ofFig. 18. des(idL) represents the common parts of objects in the categories des(a) anddes(r), respectively. des(idL) is isomorphic to C L and if we assume pullbacks to bechosen such that idL = , 2(idL, idL ) = id , we have by (4) and (5)

    ObdesidL = ((, id ))CL.Now we can define coherence by adapting the same methodology used to define amal-gamability. First, we construct the pullback of Ua and Ur (see (29)) which yields thecategory des(a) des(idL) des(r). It has objects pairs ((, 1), (, 2)) of descent data andmorphisms are given by those morphisms h : in C L providing a morphismh : (, 1) ( , 1) in des(a) as well as a morphism h : (, 2) ( , 2) in des(r).Second, we consider the pairing

    Ur,Ua : des(s) des(a) des(idL) des(r)which gives rise to

    Definition 7 (Coherence) Descent data (, 1) des(a) and (, 2) des(r) are calledcoherent, if the pair ((, 1), (, 2)) is in the image of Ur,Ua, i.e. there exists (, )

  • Fibred Amalgamation in Topoi

    Fig. 18 Amalgamation andcoherence

    des(s) such that Ur(, ) = (, 1) and Ua(, ) = (, 2). Any (, ) des(s) with thisproperty will be called a coherence witness (for (, 1) and (, 2)).

    (29)

    This means that two algebraic structures (, 1) and (, 2) are coherent if they can becombined faithfully into a single algebraic structure over relative to s. In other words,(, 1) and (, 2) are independent/orthogonal in the sense that an interaction of bothalgebraic effects does not distort any of the two structures.

    In accordance with the fact that topoi are adhesive [21], coherence is trivially satisfiedfor pushouts with at least one monomorphism involved (compare Theorem 1).

    Corollary 2 (Pushout along mono implies Coherence) For any pushout square as in thebottom of Fig. 14 with a or r monic Ur, Ua becomes an isomorphism between categories.

    Proof In case a (or r) monic, we have also a (or r) monic since pushouts preservemonomorphisms. According to Corollary 1 this means that Ua and Ua (or Ur and Ur ) areisomorphisms thus the outer diamond in (29) becomes a pullback. Thus Ur,Ua is thecanonical isomorphism.

    5.3 Amalgamation vs. Coherence in Topoi

    The complete picture so far is depicted in Fig. 18, in which all squares commute exceptfront and left face involving . According to Proposition 1 these squares commute only upto the co-unit of the adjunction a a and r r , respectively.

  • U. Wolter and H. Konig

    We fix the rear pullback span ((, a, ), (, r , )) in Fig. 14 and consider the associateddescent data:(

    , (a, )

    )= a (, a, ) and

    (, (r

    ,))

    = r (, r , ) .First, we show that amalgamability entails coherence for arbitrary commutative squares.

    Proposition 4 [Amalgamation entails Coherence] Let in a topos C a diagram be givenlike the solid arrows in Fig. 14 where the bottom square is commutative. If a span ((, a, ),(, r , )) of pullbacks is amalgamable then

    (, (a

    , ))

    and(, (r

    ,))

    are coherent.

    Proof By assumption there exists a pullback (, s , ) pb(s) withr,a(, s , ) = ((, a, ), (, r , ))

    (this is Fig. 14 without question marks). The isomorphism from r(, s , ) to (, a, )has the form (id , i) such that a(, a, ) = (a r)(, s , ) by (10) and the definitionof a. Analogously, we obtain r(, r , ) = (r a)(, s , ). Hence, by Lemma 9with a : r s and r : a s((

    , (a, )

    ),(, (r

    ,)))

    = Ur,Uas(, s , ) = Ur,Ua(, (s

    , ))

    which is coherence with witness(, (s

    , ))

    .

    To ensure thatvice versacoherence entails amalgamation we have to require not only acommutative but a pushout square. Descent data represent (up to isomorphism) only the epi-part of a morphism and due to Corollary 2 coherence concerns only the interaction betweenthe epi-parts of two morphisms. To put this observation into work and to take advantage ofthe fact that topoi are adhesive [21], we first state an auxiliary result which allows us todecompose any pushout square into epi-mono tiles.

    Lemma 10 Let C be a topos. Let a = am ae and r = rm re be epi-mono-factorized(cf. Lemma 6). Any pushout of a and r can be divided into pushout quarters, as shown inFig. 19. In this way each involved arrow of the original pushout is factorized. Moreover, thediagonal arrows sm and se are an epi-mono-factorization of s = a r = r a.

    Fig. 19 Division into epi-mono tiles

  • Fibred Amalgamation in Topoi

    Proof One starts with the pushout of ae and r together with the mediator m : N S fromthis inner square into the outer pushout. m is then part of a second rectangle which is apushout by the decomposition property of pushouts. The two resulting rectangles can bothbe split up in the same way yielding four squares, in which each newly created arrow oppo-site to an epimorphism / a monomorphism is an epimorphism / a monomorphism again,because pushouts preserve epis and monos. Hence, s = sm se is an epi-mono-factorizationof s.

    Proposition 5 (Coherence entails Amalgamation) Let in a topos C a diagram be givenas the solid arrows in Fig. 14 where the bottom square is a pushout. Then any pullback span((, a, ), (, r , )

    )is amalgamable if (, (a, )) = a(, a, ) and

    (, (r

    ,))

    =r(, r , ) are coherent.

    Moreover, the coherence witness for(, (a

    , ))

    and(, (r

    ,))

    is unique.

    Proof Let (, ) des(s) be a coherence witness. Assume first, we already knew the resultfor arbitrary pushouts of epimorphisms. We consider then the decomposition of the pushoutinto tiles according to Lemma 10, and decompose both pullbacks (, a, ) and (, r , ).We obtain two inner pullbacks am(, a, ) and rm(, r , ) along ae and re, respec-tively, and for the corresponding descent data ae(am(, a, )) and re (rm(, r , ))we have

    (ae(am(, a, )),re (rm(, r , )))= ((Uam a)(, a, ), (Urm r)(, r , )) Lemma 9=

    (Uam

    (, (a

    , )), Urm

    (, (r

    ,)))

    Definition of p

    = ((Uam Ur)(, ), (Urm Ua)(, )) Coherence assumption= (Uram(, ), Uarm(, )) (28)= (Usmr e (, ), Usmae (, )) Lemma 10= Ur e , Uae (Usm(, )) (28)

    thus the descent data of these inner pullbacks are also coherent with coherence witnessUsm(, ). By assumption, the inner pullback span (am(, a, ), rm(, r , )) is amal-gamable. Since topoi are adhesive [21], this amalgamation can be continued along the otherpairs of bottom arrows (of which either one or both are now monic) by constructing top facepushouts each time. All side face pullbacks compose to 4 side pullbacks of the whole cube,which amalgamates the original pullback span.

    Now, we assume that r and a are epic. For the coherence witness (, ) des(s) wecan construct the pullback span r,a(s(, )) and we only need to show that thispullback span is related to the original one by an isomorphism of the form (m1, id ,m3) (cf.Definition 6): By coherence assumption, we have (, (a, )) = Ur(, ) thus the definitionof a, Proposition 1 (a) and Lemma 9 give us

    a(, a, ) = Ur(, ) = (Ur s s)(, ) = (a r s)(, ). (30)

  • U. Wolter and H. Konig

    Since a is epic, the co-unit of the adjunction a a is a natural isomorphism by Proposi-tion 1 (b). Applying a to (30) yields a composite isomorphism of the required form fromr(s(, )) to (, a, ):

    (id ,m1) := (,a, ) 1r(s (,)) .The isomorphism (id ,m3) from a(s(, )) to (, r , ) is obtained analogously.

    Uniqueness of witness: Assume there are two coherence witnesses (, ), (, ). Asshown above, Usm(, ) and Usm(, ) are then coherence witnesses for the pullback spanreduced to the epi-parts ae and re. Usm is, according to Corollary 1, an isomorphism thus itsuffices to restrict again to the case where a and r are both epic.

    From the construction above, we obtain two cubes each of which possess 4 pullbacksas side faces with diagonal pullbacks s(, ) and s(, ). The cubes possess the samearrows except for a, r , and , see Fig. 14. But the two variants of the arrows a, r bothform a top pushout of a and r because, in topoi, pullbacks (along ) preserve colimits.Moreover, the two variants of are mediators out of these pushouts with the appropri-ate universal property. The mediating isomorphism between the two pushouts can then beshown to mediate between the two variants of . Hence

    s(, ) = s(, )with an isomorphism of the form (id , i), s. t. (, ) = (s s)(, ) = (s s)(, ) = (, ) by Proposition 1 (a) and (10).

    This proposition is a significant step towards an answer to Question 2. It characterizes,in terms of local data, those situations where instances can be amalgamated. It is, however,still too abstract in the sense that it does not provide an algorithm which tests for amalgam-ability. In the slightly more special setting of presheaves, however, we can provide such aprocedure, see Section 6, where we will also recall the introductory examples from Section 2to elucidate the practical importance of the theoretical results gained so far.

    Question 1 addresses the global universal view on amalgamation. An answer to it couldhave been given in terms of the involved categories of pullbacks: Amalgamation is alwayspossible and hence the bottom square in Fig. 14 is Van Kampen iff the functor r,aestablishes an equivalence between the categories pb(s) and pb(a)CL pb(r). Althoughthe inner diamond in (25) is a pullback in CAT, this still does not mean that the outerdiamond, which is also the bottom square in Fig. 18, is a pullback. It is only a kind of apullback up to equivalence. Hence, in order to obtain a global view on amalgamation interms of these pullback categories one would have to define such a concept formally whichseems to be inappropriate or even impossible.

    Considering, however, descent data instead of pullbacks, we get astonishingly compo-sitionality on the nose as we know it from and use it intensively in traditional specificationformalisms with indexed semantics [911]. Thus the following theorem provides a betteranswer to Question 1.

    Theorem 1 (Descent Version of Fibred Amalgamation Lemma) Let C be a topos. InFig. 20, the pushout (1) is a Van Kampen square if and only if (2) is a pullback in CAT.

    Proof Square (2) commutes by (28). Thus it is a pullback iff the functor Ur, Ua :des(s) des(a) des(idL) des(r) is an isomorphism, cf. (29).: Bijectivity of Ur, Ua on objects follows from coherence (by Propositions 3, 4),

  • Fibred Amalgamation in Topoi

    Fig. 20 Amalgamation lemma (fibred setting)

    which is surjectivity, and uniqueness of coherence witness (Proposition 5), which isinjectivity.

    The definition of U induces injectivity on arrows (cf. Lemma 8) and it induces sur-jectivity, if we can show that any arrow h of des(a) des(idL) des(r) is also an arrow ofdes(s). But this follows from the fact that the arrow (ah, h,rh) between two amal-gamable pullback spans yields the existence of an arrow (h, h) in pb(s) by (26). Thush = s(h, h) Mordes(s). Ur,Ua an isomorphism means that all the pairs indes(a) des(idL) des(r) are coherent thus this direction follows directly from Propositions5 and 3.

    6 Amalgamation and Van Kampen Squares in Presheaves

    This section illustrates the use of Propositions 4/5 and develops a simply checkable charac-terization of amalgamable pullback spans as well as a new characterization of Van Kampensquares in presheaves. In the sequel C = SET S and, again, we use the more intuitivenotations FX and opF for the application of a functor F : S SET to an object X andan operation symbol op, resp.

    6.1 General Analysis

    In SET S the monad embeddings ua : Tr Ts and ur : Ta Ts are component-wise inclusions, as discussed in Section 5.2. Hence coherence (cf. Definition 7) means theexistence of descent data relative to s = a r = r a with

    (x, x ) ker(rX) : x,x = x,x and (y, y ) ker(aX) : y,y = y,y (31)

    for all X ObS , where all mappings are understood as the components of the families ofbijections from Proposition 2. Note, that we use throughout this section instead of (r ,)and instead of (a, ), respectively.

    We observe Propositions 4 and 5 at work: Recall the situation in Fig. 3 (here S = 1).By Proposition 2, the associated descent data and map within I along the dashed anddotted lines, resp. E.g. x,z(1 : x) = 2 : z, x,z(2 : x) = 1 : z. Amalgamation is possible, ifwe can determine an equivalence relation , 2(s, s ) in which the restriction of to

  • U. Wolter and H. Konig

    the kernels of a and r coincide with and , resp., and which is monadic. However,associativity can not be fulfilled since

    x,z = x,z = w,z y,w x,y = w,z y,w x,yon the fibre over x, see Fig. 3. This shows that Proposition 4 provides indeed an a priori testfor the failure of amalgamability.

    Obviously, in the example, the kernels of r and a, are intertwined through the cycle(x, z),(z,w), (w, y), (y, x) ker(s) and are thus not enough separated.

    Definition 8 (Separated Kernels) Let X ObS and a and r be given as in Fig. 14. Asequence (xi)i{0,1,...,2k+1} of elements in LX is called an X -domain cycle of aX and rX (orjust domain cycle of a and r, if the carrier is fixed), if k N and the following conditionshold:

    1. j {0, 1, . . . , 2k + 1} : xj = xj+12. i {0, . . . , k} : (x2i, x2i+1) ker(aX)3. i {0, . . . , k} : (x2i+1, x2i+2) ker(rX)where the sums are understood modulo 2k + 2 (i.e. x2k+2 = x0). We call 2k + 2 thelength of the domain cycle. Moreover, a domain cycle is proper if we have for all i, j {0, 1, . . . , 2k + 1} that xi = xj if i = j .

    The pair a and r is said to have separated kernels, if it has no domain cycle.

    We draw attention to the fact that having separated kernels is not sufficient but onlynecessary for being jointly monic. Indeed, being jointly monic induces a domain cycle oflength 2. But longer domain cycles occur for jointly monic a and r (see Fig. 3).

    Domain cycles are connected to coherence as follows:

    Theorem 2 Let a commutative square be given like the bottom square in Fig. 14 and let thetwo rear faces be pullbacks with associated descent data and , resp.

    and are coherent iff for all proper domain cycles (xi)i{0,1,...,2k+1} of a and r wehave

    x2k+1,x0 x2k,x2k+1 x2,x3 x1,x2 x0,x1 = id1(x0) (32)

    The statement is illustrated in Example 2, where coherence is now achieved by harmoniz-ing the equivalences of a and r in the two copies of L that make up the domain of .Alternatively, we can use Proposition 5 to check amalgamability: A coherence witness canbe constructed by taking the transitive closure of the union of the two equivalence relationsarising from and (cf. (23)).

    Based on this observation, Theorem 2 provides a feasible criterion to check amalgama-bility without computing explicitly a coherence witness or trying to complete the cube withpullbacks and thus it is an answer to Question 2. Although the proof is a bit technical, weinclude it here, because it sheds light on the set-theoretical correlations of descent theory.We first need:

    Definition 9 (Alternating Sequence) Let X ObS . We call a sequence (yi)i{0,1,...,m}of elements in LX an (X-)alternating sequence (of a and r), if m N and the followingconditions hold:

    a) for all even i {0, . . . , m 1} : (yi, yi+1) ker(pX)b) for all odd i {0, . . . ,m 1} : (yi, yi+1) ker(pX)

  • Fibred Amalgamation in Topoi

    where p {a, r} and a = r and r = a. A sequence is called proper if yi = yj for alli {0, 1, ,m} and j {1, 2, ,m 1} with i = j .3

    Proof of Theorem 2 () follows immediately from (31) and Proposition 2 applied to thecoherence witness .

    (): By Proposition 2 the desired coherence witness is given by a family((X)x,x : 1(x) 1(x )

    )

    (x,x )ker(s)

    of bijections on fibres in each carrier set IX . It is well-known that pushouts in SET S areconstructed componentwise by pushouts in SET. Thus (x, x ) ker(sX) iff there exists analternating sequence = (yi)i{0,1,...,m} with y0 = x and ym = x . Since must obey therestriction property (31), we must define x,x := : 1(x) 1(x ) by

    := !ym1,ym p!y1,y2 p!y0,y1 (33)

    (where a! = and r! = ). For m = 0 this reduces to = id1(y0).Note, that any domain cycle c = (xi)i{0,1,...,2k+1} gives rise to two alternating sequences

    connecting x0 with x0, namely c = (x0, x1, . . . , x2k+1, x0) and c = (x0), thus condition(32) in Theorem 2 can be rewritten as c = c .

    In generalizing this observation, it can be shown by assumption and induction that con-dition (32) is equivalent to the requirement that = for arbitrary x and x and any twoalternating sequences and connecting x and x . This makes definition (33) independentof the choice of sequence.

    It remains to show validity of neutrality, associativity as well as compatibility withoperation symbols (cf. Proposition 2). Neutrality follows from (33) for m = 0. To showassociativity we define the composition of two alternating sequences by

    := (y0, . . . , ym = z0, . . . , zn) if either mn = 0 or m,n 1 and (ym1, ym) ker(p), (z0, z1) ker(p)

    := (y0, . . . , ym1, z1, . . . , zn) if m,n 1 and (ym1, ym) ker(p), (z0, z1) ker(p)

    By independence of representative we obtain for each pair (x, x ), (x , x ) ker(sX) (withrepresenting alternating sequences , ): = , hence associativity.

    In order to show compatibility with operation symbols, let op : X Y be any arrow ofS . Let (x, x ) ker(sX) and = (yi)i{0,1,...,m} with y0 = x and ym = x be an associatedalternating sequence. Clearly, opL() := (opL(yi)

    )i{0,1,...,m} is an alternating sequence

    for(opL(x), opL(x )

    ) ker(sY ). Then from the definitions of ((X)x,x )(x,x )ker(sX) and

    3Thus, the only allowed equality is y0 = ym.

  • U. Wolter and H. Konig

    ((Y )y,y )(y,y )ker(sY ) in (33) as well as the compatibility of and (cf. Proposition 2)we have

    (Y )opL(x),opL(x ) opIx= (Y )opL( ) opIx=

    ( !Y

    )

    opL(ym1),opL(ym)

    (p!Y

    )

    opL(y1),opL(y2)

    (p!Y

    )

    opL(y0),opL(y1) opIx

    = opIx ( !X

    )

    ym1,ym

    (p!X

    )

    y1,y2

    (p!X

    )

    y0,y1

    = opIx (X)x,x

    Theorem 2 also tells us that the descent data of all pullback spans are coherent, if thereare no domain cycles, i.e. if a and r have separated kernels. If the bottom square is a pushout,this means that having separated kernels implies successful amalgamation by Proposition 5.In the rest of this section we show that the converse also holds.

    Proposition 6 Let C = SET S and a commutative square be given like the bottom squarein Fig. 14. If all pullback spans in the rear are amalgamable, then a and r have separatedkernels.

    Proof Assume to the contrary that a and r possess an X-domain cycle (xi)i{0,1,...,2k+1} forsome k N. This cycle can be reduced to a proper subcycle by a straightforward construc-tion (see [34]). Thus we may assume that the cycle is already proper. We can define then apullback span where amalgamation fails by defining instances : IA A, : IL L,and : IR R as follows: For M {A,L,R} let

    IMY ={

    MY if Y = XM1X + M2X + M3X if Y = X

    where(MiX = {(x, i) | x MX}

    )i{1,2,3} are three copies of MX . For each arrow op : Z

    Z in S , we define opIM : IMZ IMZ byopI

    M = opM if Z = X and Z = X,opI

    M :{

    MZ M1X + M2X + M3Xx (opM(x),3) if Z = X and Z

    = X,

    opIM :

    {M1X + M2X + M3X MZ(x, i) opM(x) if Z = X and Z

    = X,

    opIM :

    {M1X + M2X + M3X M1X + M2X + M3X(x, i) (opM(x),3) if Z = X and Z

    = X.

    Then we let Y := idIAY , if Y = X and X(a, i) := a for each i {1, 2, 3}. In the same waywe define : IL L and : IR R, i.e. they are identical on the carriers of sort Y = Xand forget indices on the carrier of X. A straightforward calculation shows that , , arenatural transformations.

    Elementary arguments (using pointwise pullback construction as mentioned inSection 4.2.3) show that defining r : IL IR by r Y = rY if Y = X and r X(x, i) =(rX(x), i) defines a natural transformation establishing a pullback square over r. Thedefinition of r furthermore yields

    r X(x, i) = r X(y, j) (i = j and (x, y) ker(rX)). (34)

  • Fibred Amalgamation in Topoi

    To establish the left rear square, we have to define a : IL IA. As before, aY := aYfor Y = X, but in order to create a situation where amalgamation fails, the definitionintroduces a twist in ILX as follows: Recall that there was a domain cycle in LX whichoccurs threefold in ILX . Because k 0 and the cycle is proper, there are at least x0 = x1 inthe cycle for which aX(x0) = aX(x1). Let aX : L1X + L2X + L3X A1X + A2X + A3X bedefined by

    aX(x, i) =

    (aX(x), i) if x {x0, x1} or i = 3(aX(x), i) if i = 3 and x = x0(aX(x),3 i) if i = 3 and x = x1

    (35)

    This means that a maps according to a on the fibres but interchanges the positions of theimages of x1 in the first two copies:

    aX(x0, 1) = aX(x1, 2) and aX(x0, 2) = aX(x1, 1) (36)whereas aX(x, i) = aX(y, j) (i = j and (x, y) ker(rX)) whenever x {x0, x1}or y {x0, x1} or i = 3. A routine calculation shows that this special definition of a stillyields a pullback square over a.

    By assumption, the constructed pullback span is amalgamable, hence by Proposition 4,the associated descent datas and are coherent such that by Theorem 2

    x2k+1,x0 x2k,x2k+1 x2,x3 x1,x2 x0,x1 = id1(x0). (37)Eqs. (36), (23), and the definition of , however, yield

    x0,x1(x0, 1) = (x1, 2)and

    x,x (x, i) = (x , i)whenever (x, x ) ker(a) and x {x0, x1} or x {x0, x1}. Similarly x,x (x, i) = (x , i)for all (x, x ) ker(r) by (34). Thus

    (x2k+1,x0 x2k,x2k+1 x2,x3 x1,x2 x0,x1

    )(x0, 1) = (x0, 2)

    which contradicts (37).

    While Theorem 2 was a statement to check successful amalgamation individually for onegiven pullback span, we can summarize the other results with the following total statement,which simultaneously provides an answer to Question 1, i.e. a practical criterion to checkthe Van Kampen property.

    Theorem 3 Let C = SET S and the bottom square in Fig. 14 be a pushout. The followingconditions are equivalent:

    1. The square is a Van Kampen square.2. a and r do have separated kernels.3. Each pullback span is amalgamable.

    Proof 1 and 3 are equivalent by Proposition 3.23 follows from Theorem 2 and 5.32 isguaranteed by Proposition 6

    A computer scientist reasoning about the ability to merge instances of specificationsalong a common part may wish to encounter a Van Kampen square, because in this case,

  • U. Wolter and H. Konig

    amalgamation is always possible. With the theorem above he can check this property in analgorithmic manner.

    6.2 Examples (revisited)

    Recall Example 3. The class diagram can simply be coded as a diagram of graphs:

    There is the domain cycle a(e) = a(f ), r(f ) = r(h), a(h) = a(g), r(g) = r(e) henceamalgamation may fail by Theorem 3. The proof of Proposition 6 gives a hint how to findan instance constellation where this happens: We just have to provide one object for eachnode and each time a three element set as fibre over an edge. In this example, in fact, twoelements in each fibre over the edges are enough. The instance : I L has domain

    and a may be defined to interchange edges: a(e1) = a(f2), a(e2) = a(f1). If all otherassignments respect indices, amalgamation fails.Assume finally, identification of elementswould be slightly different from Example 3: If (private) persons would possess only onetype of contact info, i.e. if the specification is as in Fig. 21, the morphisms are still both

    Fig. 21 Compositionality holds

  • Fibred Amalgamation in Topoi

    non-injective with complicated entanglement, but it follows immediately from Theorem 3that amalgamation is successful for each pullback span and that the square is a Van Kampensquare.

    7 Outlook

    The paper presents major outcomes of a comprehensive collaborative project based on [7,23, 33] and addressing compositionality of fibred semantics in topoi. There are severalopen problems and interesting topics for future research.

    Categorical characterization of domain cycles In the light of Theorem 3 we can considerthe Van Kampen property as a categorical characterization of separateness, i.e., of theabsence of domain cycles. An open question is if there is a simpler and more feasable cate-gorical characterization of domain cycles in terms of the span (a, r) only. We had a closerlook at the following candidate for such a characterization: The pushout (a, r) of (a, r) is aVan Kampen square if for all factorizations a = a2 a1 and r = r2 r1 with a1 and r1 epicthe following implicaton holds:

    If (a r2, r a2) is pushout of a1 and r1, then r2, a2 are isomorphisms.

    The idea is that the square does not possess the VK property if the kernels of a and r aretoo much intertwined in L. So one tries to postpone a portion of the identification potentialof both a and r in such a way that the intertwining is broken but still the pushout can beproduced. One can show that this characterization works indeed for sets. But already forgraphs it does not work since one has to be careful with identifications in the environmentof domain cycles.

    Example 4 The pushout

  • U. Wolter and H. Konig

    Fig. 22 Conditionalamalgamability

    in the category GRAPH is not a Van Kampen square (because nodes y and z constitutea domain cycle), but neither a nor r can be factorized as in the conjecture, because edgeidentification takes place in the vicinity of this cycle.

    Conditional Van Kampen If we are not able to characterize the absence of domain cycles,in a feasable way, it may be worth to see if we can, instead, localize domain cyclescategorically in arbitrary topoi.

    A closer look at our results shows that Theorem 2 gives us actually for presheaves a kindof conditional amalgamation: We consider the smallest subobject C of L containing allproper domain cycles and the corresponding inclusion morphism i : C L. Let (rC, aC)be the pushout of (aC, rC), with aC = ai and rC = r i, and (r, a) be the pushout of (a, r)(see Fig. 22). By pulling back along i any pullback span over (a, r) reduces to a pullbackspan over (aC, rC) and Theorem 2 can be transformed into the statement: A pullback spanover (a, r) is amalgamable, if the reduced pullback span over (aC, rC) is amalgamable. Incase this implication is true for all pullback spans over (a, r), we say that the span (a, r) isVan Kampen relative to C.

    If there are no cycles, i.e., C is the (componentwise) empty set in C = SET S , thereduced pullback span is always amalgamable, since C = SET S is extensive. That is,Van Kampen relative to coincides with the traditional Van Kampen property. Any span(a, r) is trivially Van Kampen relative to L and the essence of Theorem 2 is that thereexists for any span (a, r) in a presheaf a minimal object C of L such that (a, r) is VanKampen relative to C.

    Our conjecture is that also in arbitrary topoi such a minimal condition C can beconstructed for any span (a, r).

    Full local compositionality As a matter of fact we can not assume global identities for ourentities in programming and software engineering. This obstacle is reflected by the insight,presented in this paper, that compositionality of fibred semantics is only a local propertyrelative to an arbitrary but fixed context/base L.

    To reflect locality even better, we could describe the descent data functor DDL as afunctor from (L C )op into CAT (C L). Taking such a viewpoint, Theorem 2 statesthat sums in LC are mapped by the descent data functor into products in CAT (C L).With the machinery, developed in the paper, it should be possible to prove correspondingstatements for arbitrary (finite) colimits in LC . We let this as a topic of future work.

    Change of base To get a more complete picture of compositionality of fibred semantics wehave to consider also the change of context/base. The situation for those changes should bethe following: Any morphism l : L L induces, by pre-composition, a functor l : L C L C . Pulling back along l provides for each object f : L F in LC a functor

  • Fibred Amalgamation in Topoi

    from des(f) into des(l(f )) = des(f l), And the collection of these functors constitutes anatural transformation from DDL to DDL l. In case, l monic, this natural transformationhas local left-adjoints. We presume that these local left-adjoints will be useful to prove ourconjecture concerning conditional Van Kampen in arbitrary topoi.

    Sketches Finally, an interesting topic for future research are more general categories. Wecould, for example, extend our meta-schema categories to finite product sketches, to coveralgebraic operations and equations, or even to finite limit sketches, to cover conditionalequations.

    References

    1. Barr, M., Wells, C.: Category Theory for Computing Sciences. Prentice Hall International Series (1990)2. Barr, M., Wells, C.: Toposes, triples and theories. Repr Theory Appl Categories 12, 1287 (2005). http://

    www.case.edu/artsci/math/wells/pub/pdf/ttt.pdf3. Claen, I., Groe-Rhode, M., Wolter, U.: Categorical concepts for parameterized partial specifications.

    Math. Struct. Comput. Sci. 5(2), 153188 (1995). doi:10.1017/S09601295000007004. Diskin, Z.: Databases as diagram algebras: specifying queries and views via the graph-based logic of

    sketches. Tech. Rep. 9602, Frame Inform Systems/LDBD, Riga. http://citeseer.ist.psu.edu/116057.html(1996)

    5. Diskin, Z.: Towards algebraic graph-based model theory for computer science. Bull. Symb. Log. 3, 144145 (1997). Presented (by title) at Logic Colloquium95

    6. Diskin, Z., Kadish, B.: A graphical yet formalized framework for specifying view systems. In: Advancesin Databases and Information Systems, vol. 2(5) pp. 123132. ACM SIGMOD Digital Anthology:ADBIS97 (19