Fibred and Indexed Categories for Abstract Model Theory

Report 1 Downloads 39 Views
Fibred and Indexed Categories for Abstract Model Theory ALFIO MARTINI, Instituto de Inform´atica - PUCRS - Brasil. E-mail: [email protected] UWE WOLTER, Institute of Informatics - University of Bergen Norway. E-mail: [email protected] E. HERMANN HAEUSLER, Departamento de Ciˆencia da Computa¸c˜ ao - PUC-Rio - Brasil. E-mail: [email protected] Abstract Indexed and Fibred category theory have a long tradition in computer science as a language to formalize different presentations of the notion of a logic, as for instance, in the theory of institutions and general logics, and as unifying models of (categorical) logic and type theory as well. Here we introduce the notions of indexed and fibred frames and construct a rich mathematical workspace where many relevant and useful concepts of logics can be elegantly modelled. To demonstrate the applicability of these tools, essential ideas around the theory of institutions are recasted and described.

Keywords: indexed and fibred categories, Grothendieck constructions, logical systems, institutions.

1

Introduction

The issue of providing a general or abstract definition for a well-known concept, and all of its many instances, can be taken as twofold regarding its motivation. One can use the abstract definition in order to obtain an important characterization result, such as it is the case for the Lindstrom’s theorem for elementary logic [17], or even to provide an abstract setting to deal with the many extensions of first-order logic and proving abstract results about the relationships holding between certain properties of these logics, as did the work of Barwise [2] and his followers. On the other hand, such general settings can be used to the general application of a known and successful technique to a circumscribed class of formal objects (logics, models or their integration), as it is the case when one obtains some of the meta-theorems on General Logics [20], or even the naive application of completion techniques to build canonical models in an abstract way, as one can observe in any textbook on Modal Logic and its Applications ([13, 25]). The use of Category Theory as a working tool in Logic has its origin in the Curry-Howard isomorphism [10] and provided fruitful ways of building models for substructural logics. On the other hand, the work of Makkai and Reyes on first-order and coherence logics [18] and the school of Elementary Topoi and foundations [21] provided fine details on dealing with basic issues on modelling as substitution and environments. Type Theory also provided examples (polymorphism, higher-order

L. J. of the IGPL, Vol. 0 No. 0, pp. 1–33 0000

1

c Oxford University Press °

2

Fibred and Indexed Categories for Abstract Model Theory

typed systems, etc) and methods (Proofs-as-Arrows, Internal and External logics, etc) of how the object of study can improve the metalanguage theory. Indexed and Fibred Categories as well as two and higher-dimensional categories are good example of the last mentioned phenomena. On the other hand, the integration of the categorical techniques and the abstract setting for dealing with logics and algebraic languages, as well as the need for a wider framework to cope with the use and reuse of distinct formalisms in the process of software development and validation, produced the concept of Institution [11, 6, 5]. In this way, the theory of Institutions is then an abstract setting for Logics and Specifications, built on top of Category Theory basic concepts and it figures out the main mechanisms for a smooth integration of different logics. Here smooth integration means “almost meta-properties preserving” integration. Institutions and General Logics have provided also important means to explain the mechanism of borrowing theorems from one logic to be reused by another [7] and of models for unification of theories by way of adjunctions [1]. From the strict categorical point of view, indexed and fibred categories [27, 15] provide us with two opposite, yet complementary views to understand and formalize the rich set of notions present in any logical system. The connection of indexed categories and logic can be seen as an attempt to provide structural foundations for computer science in several fields. This can be related with first uses of universal algebra (via heterogeneous data types) and algebraic many-sorted specifications as foundational concepts for software engineering. Later, generalizations of this structural point of view naturally led to the ideas of Institutions and Heterogeneous Logical Systems as we know it today [11, 23, 8]. Fibred category theory, however, have been mostly helpful in order to deal with (unifying) connections between logic and type theory [15]. So, in a certay way, fibred categories arises as the categorical way to use mathematical logic by way of logical properties (theories) as a foundational tool in computer science. Indeed, this kind of duality is already present in the more traditional and well known notion of Galois Connection. To illustrate such claims, we recall that Equational Logic is a well-known Institution and it has been quite useful to specify data-types. In the literature there is a relevant amount of examples of typical data-types specifications in equational logic. Consider a simple programming language PL consisting of assignments, sequencing of commands, selection (if ) and a while command. Apart from introducing structured data-types, the language semantics is naturally (in the categorical sense) invariant under simple data-types indexing. Specifically, there is a PL (bool) language when considering the programming languages variables ranging over booleans, there is another PL (Int) (PL (F loat)) language when these variables range over float numbers or integers and so on. Technically speaking, there is an algebra for expressions (right-hand side of an assignment) for each data-type chosen, thus seeing PL (Σ) as a parametric programming language. Taking into account the existing morphisms between the respective data-types F loat and Int, for instance, there is a mapping from programs in PL (F loat) into programs in PL (Int) that lifts to a natural transformation regarding their respective semantics. This is a mechanism quite well-known from (parametric) polymorphic types semantics. For type-theoreticians this is a typical example of the use of Indexed or Fibred Categories. So to say, the Syntax and the Semantics of programming language are indexed by categories of the (scalar) data-

Fibred and Indexed Categories for Abstract Model Theory

3

types. This motivates the introduction of Indexed Frames allowing the definition of Indexed Institutional Frames, an indexed, complete categorical view of the concept of an Institution. Consider again the programming language PL (−). First-order logic (FOL) is also known to be an Institution. Consider a Hoare Triples definition for the semantics of PL (−). Of course, the indexing provided to PL (−) should be also provided in a natural way to FOL, such that each data-type is mapped a corresponding first-order signature that indexes the first-order theory logically related to the data-type algebra. Following this example, the Hoare Calculus can be better viewed as an Indexed or Fibred construction built up on top of another Indexed construction. It is known that under certain assumptions, Indexed and Fibred constructions are equivalent, but as already pointed out by [15] and [26] the Fibred approach is better suited to deal with modular constructions, as above. This kind of application motivates the Fibred Frame notion that is introduced in this article. It is worthwhile to mention that there are known examples pointing out that the introduction of structured datatypes, namely, arrays, records, graphs and so on, would modify the structure of the semantics assignment to a programming language. So to say, PL extended with these structured data-types would not have their semantics provided by Hoare calculus instances that are parametric. One has to hard wire for each structured data-type a set of essentially distinct Hoare rules. However, in any case there should be a natural relationship between syntax and semantics regarding each Fiber induced by each PL extension. One of our overall research interests is to explore and to investigate the potential room of possible concepts for presenting and investigating logics and their relationships. This paper is devoted to elucidate the equivalence of indexed and fibred categories in view of logics and specification formalisms. We propose two new clean abstract notions of “logical systems” – Indexed Frames and Split Fibred Frames. We show the equivalence of both concepts and we give some evidence that these concepts are reasonable and appropriate for studying logics and their relationships. A thourough analysis of the concept of Institution shows that the satisfaction condition can be equivalently expressed by a naturality requirement if we abstract from single sentences and single models to specifications and model classes, respectively. This observation extends to a construction that lifts any institution to a corresponding Indexed Institutional Frame (and thus also to a corresponding Fibred Institutional Frame).

1.1 Notations and Basics With respect to notation, the collection of objects of a category C will be denoted |C|. Given objects a, b ∈ |C|, the collection (usually a set) of arrows from a to b is denote C(a, b). The category Set is the category of sets and total functions, while Cat is the category of all categories and functors. We represent composition of maps (functors) in diagrammatic order. For instance if F : A → B and G : B → C are functors and a ∈ |A|, then F ; G : A → C and def

(F ; G)(a) = G(F (a)) is an object of C, i.e., G(F (a)) ∈ |C|. Also, different institutions, frames, logics, are identified with primed superscripts (e.g., I, I 0 , I 00 ,etc.), while different objects within an institution (frame, logic), as sig-

4

Fibred and Indexed Categories for Abstract Model Theory

natures, models, etc., are denoted with numbered subscripts (e.g., Σ1 , Σ2 , M1 , M2 ,etc.). Moreover, if α : F ⇒ G : A → B and β : G ⇒ H : A → B are natural transformations, then the vertical composition of α and β is denoted α; β : F ⇒ H : A → B def such that for each a ∈ |A|, (α; β)a = αa ; βa . Also, if F : A → B, G, G0 : B → C, H : C → D are functors and α : G ⇒ G0 : B → C is a natural transformation, then the horizontal compositions of F with α, and α with H are represented as (F ¦ α) : F ; G ⇒ F ; G0 : A → C and (α ¦ H) : G; H ⇒ G0 ; H : B → D such that for def

def

each c ∈ |C|, a ∈ |A|, (F ¦ α)c = αF (c) whereas (α ¦ H)a = H(αa ). G F

A

ÂÂ ÂÂ ®¶

/B

G

(

6C

α

H

/D

0

We have immediately according the definition of composition idB ¦ α = α

and α ¦ idC = α

(1.1)

and since functors map identities to identities we have also F ¦ idG = idF ;G

and

idG ¦ H = idG;H

(1.2)

Moreover we have for functors F : A → B, G : B → C, H, H 0 , H 00 : C → D, I : D → E and natural transformations γ : H ⇒ H 0 , δ : H 0 ⇒ H 00 the following laws H

A

F

/B

G

/C

ÂÂ ÂÂ

γ

®¶

ÂÂ ÂÂ

®¶

δ

! /D =

I

/E

H 00

(F ; G) ¦ γ = F ¦ (G ¦ γ) and (G ¦ γ) ¦ I = G ¦ (γ ¦ I) and

2

G ¦ (γ; δ) = (G ¦ γ); (G ¦ δ)

(1.3)

(γ; δ) ¦ I = (γ ¦ I); (δ ¦ I)

(1.4)

Indexed Logical Systems

2.1 Indexed Frames Definition 2.1 (Indexed Functor) Let F : Ind → Cat and G : Ind → Cat be Ind-indexed categories. Then an Ind-indexed functor is a natural transformation α : F ⇒ G : Ind → Cat, such that for each σ : i → j in Ind the following diagram commutes: i σ

F (i)

α(i)

F (σ)

² j

² F (j)

/ G(i) G(σ)

α(i)

² / G(j)

The category of Ind-indexed categories and Ind-indexed functors will be denoted IndFun(Ind, Cat).

Fibred and Indexed Categories for Abstract Model Theory

5

Definition 2.2 (Indexed Frame) An Indexed Frame IF = (Ind, Syn, Den, sem, f ml) is given by the following data and operations: + a category Ind; + an indexed category Syn : Ind → Cat. + an indexed category Den : Ind → Cat. + an indexed functor sem : Syn =⇒ Den : Ind → Cat, that is to say, for each i ∈ |Ind|, we have a functor sem(i) : Syn(i) → Den(i) such that for each σ : i → j in Ind, sem(i); Den(σ) = Syn(σ); sem(j); + for each i ∈ |Ind| a functor f ml(i) which is locally left-adjoint to sem(i), i.e., f ml(i) a sem(i). Syn

/

Ind

i

Cat

sem

®¶

Den

Syn(i)

o

/

f ml(i) ⊥

/ Den(i)

sem(i) σ

Syn(σ)

² j

² o Syn(j)

Den(σ) f ml(j) ⊥

² / Den(j)

sem(j)

Remark 2.3 (Interpretation) In the context of this work, Ind can be understood as representing the syntactical entities (presentation) for the generation of the formulae of a given logical system. L, Syn and Den denote, respectively, the specifications and semantics of L, while f ml (syntax) and sem (semantic models) capture the fact that syntax and semantics are always adjoint to each other (Galois Connection) via a concept of satisfaction or validity. It is quite natural to require that a map between indexed frames should be a compatible parallel translation of syntax and semantics, respectively: Definition 2.4 (Maps of Indexed Frames) Let IF = (Ind, Syn, Den, sem, f ml) and IF 0 = (Ind0 , Syn0 , Den0 , sem0 , f ml0 ) be indexed frames. A map ξ = (Υ, γ, δ) : IF → IF 0 between indexed frames is comprised of the following data and operations: + a functor Υ : Ind → Ind0 + a natural transformation γ : Den ⇒ Υ; Den0 : Ind → Cat, and + a natural transformation δ : Syn ⇒ Υ; Syn0 : Ind → Cat,

6

Fibred and Indexed Categories for Abstract Model Theory Syn

/

????? ????sem ???? ? δ ¾#

Ind Den

/

Υ Syn0

²

®¶

Ind0 Den0

Cat ????? ???? ??? 0 ??

sem

/

γ

¾# ®¶ /

such that sem; γ = δ; sem0 Due to the clean categorical simplicity of our definitions we obtain a Definition 2.5 (Category of Indexed Frames) Indexed frames and Maps of indexed frames define a category IndFra. The identities def

idIF : IF → IF are given by idIF = (idInt , idDen , idSyn ). And, given maps ξ = (Υ, γ, δ) : IF → IF 0 and ξ 0 = (Υ0 , γ 0 , δ 0 ) : IF 0 → IF 00 the composition ξ; ξ 0 : IF → IF 00 is defined as follows: def

ξ; ξ 0 = (Υ; Υ0 , γ; (Υ ¦ γ 0 ), δ; (Υ ¦ δ 0 )) : IF → IF 00 . Den

Ind ®¶

ÂÂ ÂÂ

Syn

*

γ

4 Cat

Υ;Den0

Ind

δ

*

4 Cat

Υ;Syn0 Den0

Υ

ÂÂ ÂÂ ®¶

Ind

/ Ind0 ®¶

ÂÂ ÂÂ

γ

0

Syn0

*

4 Cat

Υ0 ;Den00

Ind

Υ

ÂÂ ÂÂ ®¶

/ Ind0 0

δ0

Υ ;Syn

*

4 Cat

00

Proof. Neutrality: We obtain according to the definition of identities and composition, and due to 1.1 idIF ; ξ

= (idInt ; Υ, idDen ; (idInt ¦ γ), idSyn ; (idInt ¦ δ)) = (idInt ; Υ, idDen ; γ, idSyn ; δ) = (Υ, γ, δ) = ξ

And taking into account 1.1 we obtain ξ; idIF 0

= (Υ; idInt0 , γ; (Υ ¦ idDen0 ), idSyn ; δ(Υ ¦ idSyn0 )) = (Υ, γ; idΥ;Den0 , δ; idΥ;Syn0 ) = (Υ, γ, δ) = ξ

Associativity: Let be given maps ξ = (Υ, γ, δ) : IF → IF 0 , ξ 0 = (Υ0 , γ 0 , δ 0 ) : IF 0 → IF 00 . and ξ 00 = (Υ00 , γ 00 , δ 00 ) : IF 00 → IF 000 . We have to show (ξ; ξ 0 ); ξ 00 = ξ; (ξ 0 ; ξ 00 ). For the first component we have (Υ; Υ0 ); Υ00 = Υ; (Υ0 ; Υ00 ) since the composition of functors is associative.

Fibred and Indexed Categories for Abstract Model Theory

7

For the second composition we obtain the required equation due to the associativity of the composition of functors and of the vertical composition of natural transformations, and due to 1.3 (γ; (Υ ¦ γ 0 )); ((Υ; Υ0 ) ¦ γ 00 )

= γ; ((Υ ¦ γ 0 ); ((Υ; Υ0 ) ¦ γ 00 )) = γ; ((Υ ¦ γ 0 ); (Υ ¦ (Υ0 ¦ γ 00 ))) = γ; (Υ ¦ (γ 0 ; (Υ0 ¦ γ 00 )))

The required equation for the third component is obtained in the same way.

2.2 Institutions The concept of an institution introduced by Goguen and Burstall [11] formally captures the notion of logical systems and allowed them to reformulate and to generalize the work they had done in the 70’s on structuring (equational) specification independently of the underlying logic. A similiar proposal of an abstract concept of a logic had been given already by Barwise [2]. Definition 2.6 (Institution) An Institution I = (Sign, Sen, M od, |=) consists of the following data and operations: + a category of abstract signatures Sign; + a syntax functor Sen : Sign → Set, defining for each signature its set of sentences; + a model functor M od : Signop → Cat, defining for each signature, its corresponding category of models; + an indexed family of satisfaction relations |=Σ ⊆ |Mod(Σ)| × Sen(Σ), Σ ∈ |Sign|, such that the following institution condition M od(φ)(M2 ) |=Σ1 ϕ1 ⇐⇒ M2 |=Σ2 Sen(φ)(ϕ1 ) holds for each φ : Σ1 → Σ1 in Sign, M2 ∈ |Mod(Σ2 )|, and ϕ1 ∈ Sen(Σ1 ). Σ1 φ

² Σ2

M od(Σ1 ) o O

|=Σ1

M od(φ)

M od(Σ2 ) o

/ Sen(Σ1 ) Sen(φ)

|=Σ2

² / Sen(Σ2 )

Remark 2.7 (Component Implications) It will be essential for us to have a deeper understanding of the above institution condition when we see it from the perspective of the two component implications. Therefore, we label them for future reference. ICSen⇒Mod M od(φ)(M2 ) |=Σ1 ϕ1 ⇐ M2 |=Σ2 Sen(φ)(ϕ1 ) ICMod⇒Sen M od(φ)(M2 ) |=Σ1 ϕ1 ⇒ M2 |=Σ2 Sen(φ)(ϕ1 )

8

Fibred and Indexed Categories for Abstract Model Theory

To keep the exposition short and accessible for a broader audience we concentrate on two well-known examples of institutions – equational logic and many-sorted equational logic. For more elaborated examples we refer to the literature [11, 19, 20, 24, 28, 29]. Example 2.8 (Institution EQ of Equational Logic) This is the classical unsorted universal algebra and goes back to Birkhoff. Signatures Σ = (OP, ar) are given by a set OP of operation symbols and an arity function ar : OP → N∗ . Signature morphisms φ : Σ1 → Σ2 are given by a map φ : OP1 → OP2 such that ar2 (φ(op1 )) = ar1 (op1 ) for every op1 ∈ OP1 . Signatures and signature morphisms form the category of signatures SignEQ . For any signature Σ and any set X of variables we define inductively the set T (Σ, X) of Σ-terms over X. Thus we can assign to any signature Σ the set SenEQ (Σ) of Σequations (l = r) where l, r ∈ T (Σ, X). Every signature morphism φ : Σ1 → Σ2 induces inductively a translation φ : T (Σ1 , X) → T (Σ2 , X) of Σ1 -terms over X into Σ2 -terms over X and provides a functor SenEQ (φ) : SenEQ (Σ1 ) → SenEQ (Σ2 ) where SenEQ (φ)(l = r) = (φ(l) = φ(r)). The sets SenEQ (Σ) and the translation functors SenEQ (φ) constitute the syntax functor SenEQ : SignEQ → Set. For any signature Σ we define the category M odEQ (Σ) of Σ-algebras as follows. The objects are Σ-algebras A, i.e. there is a non- empty carrier set A and for every op ∈ OP , ar(op) = n there is an operation A(op) : An → A. The morphisms are Σhomomorphisms h : A → B translating the carriers compatible with the operations, i.e. h(A(op)(a1 , . . . , an )) = B(op)(h(a1 ), . . . , h(an )), for every op ∈ OP and ai ∈ A. Given a signature morphism φ : Σ1 → Σ2 any Σ2 -algebra A2 defines a Σ1 -algebra M odEQ (A2 ) with the same carrier A2 and with M odEQ (A2 )(op1 ) = A2 (φ(op1 )) for every op1 ∈ OP1 . This construction also applies to Σ2 -homomorphisms thus we obtain a forgetful functor M odEQ (φ) : M odEQ (Σ2 ) → M odEQ (Σ1 ). The categories M odEQ (Σ) and the forgetful functors M odEQ (φ) constitute the model functor M odEQ : Signop EQ → Cat. Given a signature Σ, a Σ-algebra A, and a set X of variables any variable assignment α : X → A can be extended inductively to a term evaluation α : T (Σ, X) → A. A Σ-equation (l = r) is satisfied in A, A |=Σ (l = r) in symbols, iff α(l) = α(r) for all assignments α. Let be given a signature morphism φ : Σ1 → Σ2 , a Σ1 -equation (l = r), and a Σ2 -algebra A2 . The crucial technical result for proving the institution condition M odEQ (φ)(A2 ) |=Σ1 (l = r)



A2 |=Σ2 (φ(l) = φ(r))

is that the assignments of X into M odEQ (φ)(A2 ) coincide with the assignements of X into A2 and that we have α(t) = α(φ(t)) for any assignment α : X → A2 and for any t ∈ T (Σ1 , X) (compare [29]). Example 2.9 (Institution MEQ of Many-Sorted Equational Logic) Signatures are of the form Σ = (S, OP, dom, cod) with S a set of sort symbols, OP a set of operation symbols, the domain function dom : OP → S ∗ , and the codomain function cod : OP → S. Signature morphisms φ : Σ1 → Σ2 translate sort and operation symbols compatible with the domain and codomain functions, i.e. dom2 (φ(op1 )) = φ∗ (dom1 (op1 )) and cod2 (φ(op1 )) = φ(cod1 (op1 )) for every op1 ∈ OP1 . Signatures and signature morphisms form the category of many-sorted signatures SignMEQ .

Fibred and Indexed Categories for Abstract Model Theory

9

For any signature Σ and any S-set X = (Xs | s ∈ S) of variables we define inductively the S-set T (Σ, X) of Σ-terms over X. Thus we can assign to any signature Σ the set SenMEQ (Σ) of Σ-equations (X : l = r) where l, r ∈ T (Σ, X)(s), s ∈ S. Every signature morphism φ : Σ1 → Σ2 induces a translation of S1 -sets X U = (X(s1 ) | s1 ∈ S1 ) of variables into S2 -sets φ(X) of variables where φ(X)(s2 ) = {X(s1 ) | φ(s1 ) = s2 } for any s2 ∈ S2 . This translation extends inductively to a family φ(s1 ) : T (Σ1 , X)(s1 ) → T (Σ2 , φ(X))(φ(s1 )), s1 ∈ S1 of translations of Σ1 -terms over X into Σ2 -terms over φ(X) and provides, finally, a functor SenMEQ (φ) : SenMEQ (Σ1 ) → SenMEQ (Σ2 ) where SenMEQ (φ)(X : l = r) = (φ(X) : φ(s1 )(l) = φ(s1 )(r)). The sets SenMEQ (Σ) and the translation functors SenMEQ (φ) constitute the syntax functor SenMEQ : SignMEQ → Set. For any signature Σ we define the category M odMEQ (Σ) of Σ-algebras as follows. The objects are Σ-algebras A, i.e. for every s ∈ S there is a (possibly empty) carrier set A(s) and for every op : s1 . . . sn → s in OP there is an operation A(op) : A(s1 ) × . . . × A(sn ) → A(s). The morphisms are Σ-homomorphisms h = (h(s) : A(s) → B(s) | s ∈ S) translating the carriers compatible with the operations, i.e. h(s)(A(op)(a1 , . . . , an )) = B(op)(h(s1 )(a1 ), . . . , h(sn )(an )), for every op : s1 . . . sn → s in OP and ai ∈ A(si ), i = 1, . . . , n . A signature morphism φ : Σ1 → Σ2 defines an interpretation of the components of Σ1 by suitable components of Σ2 . Analogously a Σ2 -algebra A2 is given by an interpretation of the components of Σ2 by suitable components of Set. Composing these two interpretations we obtain an interpretation of Σ1 in Set, i.e. a Σ1 algebra M odMEQ (A2 ) with M odMEQ (A2 )(s1 ) = A2 (φ(s1 )) for every s1 ∈ S1 and with M odMEQ (A2 )(op1 ) = A2 (φ(op1 )) for every op1 ∈ OP1 . This construction also applies to Σ2 -homomorphisms thus we obtain a forgetful functor M odMEQ (φ) : M odMEQ (Σ2 ) → M odMEQ (Σ1 ). The categories M odMEQ (Σ) and the forgetful functors M odMEQ (φ) constitute the model functor M odMEQ : Signop MEQ → Cat. Given a signature Σ, a Σ-algebra A, and an S-set X = (Xs | s ∈ S) of variables any variable S-assignment α = (α(s) : X(s) → A(s) | s ∈ S) can be extended inductively to a term evaluation α = (α(s) : T (Σ, X)(s) → A(s) | s ∈ S). A Σ-equation (X : l = r) is satisfied in A, A |=Σ (X : l = r) in symbols, iff α(s)(l) = α(s)(r) for all assignments α. Note, that (X : l = r) is vacuously satisfied if X(s) 6= ∅ and A(s) = ∅ for one s ∈ S. Let be given a signature morphism φ : Σ1 → Σ2 , a Σ1 -equation (X : l = r), and a Σ2 -algebra A2 . The crucial technical result for proving the institution condition M odMEQ (φ)(A2 ) |=Σ1 (X : l = r)



A2 |=Σ2 (φ(X) : φ(s1 )(l) = φ(s1 )(r))

is that there is a one-to-one corresponcence between the assignments of X into M odMEQ (φ)(A2 ) and the assignments of φ(X) into A2 , respectively, and that there is a coincidence between the corresponding term evaluations. That is, for any S1 assignment α : X → M odMEQ (φ)(A2 ) there is a S2 -assignment β : φ(X) → A2 defined by β(φ(s1 ))(x) = α(s1 )(x) for all s1 ∈ S1 and x ∈ X(s1 ) such that α(s1 )(t) = β(φ(s1 ))(φ(s1 )(t)) for all t ∈ T (Σ1 , X)(s1 ) [29]. There are three essential traditional features of logics reflected by the concept of institution: First, also in accordance with indexed frames, logics are described in a modular, stepwise manner: We fix a signature, i.e., the syntactical building blocks,

10

Fibred and Indexed Categories for Abstract Model Theory

and then we construct the actual syntax for this fixed signature. And, these constructions are canonical in a way that they are compatible w.r.t. translations between signatures. Moreover, we define what the models for a fixed signature are assumed to be. Second, in contrast to indexed frames, syntax and semantics are connected on the level of single sentences and single models by a corresponding concept of satisfaction. Third, syntax and semantics behave contravariant w.r.t. translations. That is, any signature morphism induces a translation of syntax in one direction and a respective translation of semantics in the opposite direction. Since institutions build on single sentences and models it is natural to define transitions between institutions also on this level. Moreover, the contravariance between syntax and semantics will also appear in those transitions. The following concept is equivalent to the original concept of “plain map of institution” in [20] (compare [19]), but we adopt the up-to-date terminology from [12]. It formalizes how a target logic I 0 can code a source logic I. It requires that the syntax of I 0 is rich enough to define the subclasses of models of I 0 which can be understood as models of I. Definition 2.10 (Institution Comorphisms) An Institution Comorphisms µ = (Φ, α, β) : I → I 0 consists of: + A functor Φ : Sign → Sign0 ; + A natural transformation α : Sen =⇒ Φ; Sen0 : Sign → Set; + A natural transformation β : Φop ; M od0 =⇒ M od : Signop → Cat, such that the following comorphism condition: β(Σ)(M 0 ) |=Σ ϕ ⇐⇒ M 0 |=0Φ(Σ) α(Σ)(ϕ) holds for each Σ ∈ |Sign|, ϕ ∈ Sen(Σ) and M 0 ∈ |Mod0 (Φ(Σ)|. Sign Φ

² Sign0

Σ _

M od(Σ) o O

|=Σ

β(Σ)

² Φ(Σ)

M od0 (Φ(Σ)) o

/ Sen(Σ) α(Σ)

|=0Φ(Σ)

² / Sen0 (Φ(Σ))

Example 2.11 (Institution Comorphism from MEQ into EQ) The process of “omitting sorts” provides a comorphism from MEQ into EQ. We map a many-sorted signature Σ = (S, OP, dom, cod) to the signature (OP, ar) such that ar(op) = n iff dom(op) has length n. This defines a functor Φ : SignMEQ → SignEQ . For any many-sorted signature U Σ and U any S-set X = (Xs | s ∈ S) of variables we obtain the “unsorted” set X = {X(s) | s ∈ S} = {hs, xi | s ∈ S, x ∈ X(s)} U of variables and for every s ∈ S we have an inclusion T (Σ, X)(s) ⊆ T (Φ(Σ), X). This means that we have a natural transformation α : Sen U MEQ =⇒ Φ; SenEQ with α(Σ)(X : l = r) = (l = U r). Note, that in most cases {T (Σ, X)(s) | s ∈ S} is a proper subset of T (Φ(Σ), X) because many-sortedness means essentially, to put, in addition to the arity constraints, further constraints on the construction of terms. Moreover, we can associate to any Φ(Σ)-algebra A a Σ-algebra β(Σ)(A) with carriers β(Σ)(A)(s) = A for all s ∈ S and operations β(Σ)(A)(op) = A(op) for all

Fibred and Indexed Categories for Abstract Model Theory

11

op ∈ OP . This gives a functor β(Σ) : M odEQ (Φ(Σ)) → M odMEQ (Σ), and globally defines a natural transformation β : Φop ; M odEQ =⇒ M odMEQ . In accordance with the institution conditions the comorphism condition β(Σ)(A) |=Σ (X : l = r)



A |=Φ(Σ) (l = r)

is due to a one-to-one U corresponcence between the assignments of X into β(Σ)(A) and the assignments of X into A, respectively, and due to the coincidence between the corresponding term evaluations. That is, for any S-assignment α : X → β(Σ)(A) U there is an assignment β : X → A defined by β(hs, xi) = α(s)(x) for all s ∈ S, x ∈ X(s) such that α(s)(t) = β(t) for all t ∈ T (Σ, X)(s). Definition 2.12 (Category of Institutions) Institutions and institution comorphisms define a category InstCom. The identities def

idI : I → I are given by idI = (idSign , idSen , idM od ). And, given comorphisms µ = (Φ, α, β) : I → I 0 and µ0 = (Φ0 , α0 , β 0 ) : I 0 → I 00 , the composition µ; µ0 : I → I 00 is defined as follows: def

µ; µ0 = (Φ; Φ0 , α; (Φ ¦ α0 ), (Φop ¦ β 0 ); β) : I → I 00 . Sen

ÂÂ ÂÂ ®¶

Sign

α

*

4 Set

Sign

op

Φop

Φ0op ;M od00

/ Sign0 op

Φ;Sen0

M od Sen0

Sign

Φ

/ Sign0

ÂÂ ÂÂ ®¶

ÂÂ ÂÂ

®¶

α0

β0

4 Set

Φ0 ;Sen00

Signop

4 Cat

0

Φop ;M od0

*

*

ÂÂ ÂÂ ®¶

β

* 4 Cat

M od

Proof. Analogously to the proof of Definition 2.5.

2.3 Indexed Institutional Frames Institutions are based on a pointwise assignment of signatures, sentences, and models. In design (programming), however, the relevant objects are not sentences (program lines), but, specifications (programs). Now we systematically reveal the categorical structures that are intrinsic to logical systems on this relevant level of specifications (and subcategories of models). Firstly, these investigations provide new insights into the conceptual nature of logical systems so that we can, for instance, give a very simple, although enlightening categorical description of the institution condition. Secondly, the derived structures establish special instances of indexed frames. Assuming an institution I, and a set of Σ-sentences Γ ⊆ Sen(Σ), we define the category mod(Σ)(Γ) as the full subcategory induced by those models in |Mod(Σ)| that satisfy Γ, i.e., def

|mod(Σ)(Γ)| = {M ∈ |Mod(Σ)| | ∀ϕ ∈ Γ : M |=Σ ϕ}.

(2.1)

Analogously, we define for a given subcategory M ⊆ M od(Σ) of Σ-models, the set of theorems th(Σ)(M) ⊆ Sen(Σ) given by those sentences ϕ ∈ Sen(Σ) which are satisfied by all models in M, i.e., we have

12

Fibred and Indexed Categories for Abstract Model Theory def

th(Σ)(M) = {ϕ ∈ Sen(Σ) | ∀M ∈ |M| : M |=Σ ϕ}.

(2.2)

Obviously, mod(Σ) and th(Σ) induce mappings between Σ-specifications and categories of Σ-models and vice-versa. Definition 2.13 (Partial Order Categories) Given a signature Σ ∈ |Sign|, we define the partial order category Spec(Σ) of strict specifications, the category where the objects are all sets Γ ⊆ Sen(Σ), and the arrows are all the inverse inclusions Γ1 ⊇ Γ2 . Analogously, the partial order category Sub(Σ) has as objects all subcategories M ⊆ Mod(Σ) and as arrows all inclusion functors M1 ⊆ M2 . By definition of Spec(Σ) and Sub(Σ), we can formulate the usual categorical presentation of the Galois correspondence arising from any (satisfaction) relation as an adjunction th(Σ) a mod(Σ): Proposition 2.14 (Galois Correspondence) Given a signature Σ ∈ |Sign|, the equations (2.1) and (2.2) define functors mod(Σ) : Spec(Σ) → Sub(Σ)

and th(Σ) : Sub(Σ) → Spec(Σ)

such that th(Σ) is left-adjoint to mod(Σ), written th(Σ) a mod(Σ), where for any M, M1 , M2 ∈ |Sub(Σ)|, and Γ, Γ1 , Γ2 ∈ |Spec(Σ)|, we have: • • • • •

th(Σ) functor: M1 ⊆ M2 implies th(Σ)(M1 ) ⊇ th(Σ)(M2 ); mod(Σ) functor: Γ2 ⊇ Γ1 implies mod(Σ)(Γ2 ) ⊆ mod(Σ)(Γ1 ); unit: M ⊆ mod(Σ)(th(Σ)(M)); counit: th(Σ)(mod(Σ)(Γ)) ⊇ Γ; adjointness: M ⊆ mod(Σ)(Γ) iff th(Σ)(M) ⊇ Γ.

The powerset and power category construction lift also a function or a functor, respectively, to a functor between the corresponding partial order categories: Fact 2.15 (Power Functors) For a set A let P(A) be the partial order (℘(A), ⊇) considered as a category, where ℘(A) is the powerset of A. And for a category C let P(C) be the partial order category over C, where the objects are all subcategories M ⊆ C and arrows all inclusion functors M1 ⊆ M2 . Then we obtain + for any function f : A → B the existential image powerset functor f : P(A) → P(B), by setting f (A0 ) = {f (a)|a ∈ A0 } for any A0 ∈ ℘(A), and + for any functor F : C → D the inverse image power category functor F −1 : P(D) → P(C), where for any M ⊆ D: C ∈ |F −1 (M)| iff F (C) ∈ M and g an arrow in F −1 (M) iff F (g) an arrow in M. In such a way, we obtain for any signature morphism φ : Σ1 → Σ2 functors Sen(φ) : Spec(Σ1 ) → Spec(Σ2 ) and

M od(φ)−1 : Sub(Σ1 ) → Sub(Σ2 ).

Thus the presented simple abstraction step from the conceptual level of single sentences and single models to the level of specifications and subcategories of models

Fibred and Indexed Categories for Abstract Model Theory

13

produces a diagram of adjunctions that keeps the complete information provided by the triple (Sen, M od, |=) for any signature morphism φ : Σ1 → Σ2 : th(Σ1 )

Sub(Σ1 ) o

Σ1

/

Spec(Σ1 )

⊥ mod(Σ1 )

φ

M od(φ)−1

Sen(φ)

² Sub(Σ2 ) o

² Σ2

th(Σ2 ) ⊥

/

² Spec(Σ2 )

mod(Σ2 )

The crucial insight is now that the institution condition turns out to be equivalent to a commutativity requirement for this diagram: Lemma 2.16 (Institution Condition) Let I = (Sign, Sen, M od, |=) be an institution. Then we have for any signature morphism φ : Σ1 → Σ2 in Sign: The following inequality is equivalent to condition ICSen⇒Mod : 1. mod(Σ2 )(Sen(φ)(Γ1 )) ⊆ M od(φ)−1 (mod(Σ1 )(Γ1 )) for all Γ1 ∈ |Spec(Σ1 )|. Any of the following inequalities is equivalent to condition ICMod⇒Sen : 2. M od(φ)−1 (mod(Σ1 )(Γ1 )) ⊆ mod(Σ2 ) (Sen(φ)(Γ1 )), for all Γ1 ∈ |Spec(Σ1 )|. ¡ ¢ 3. th(Σ2 ) M od(φ)−1 (M1 ) ⊇ Sen(φ) (th(Σ1 )(M1 )), for all M1 ∈ |Sub(Σ1 )|.

Σ1

Sub(Σ1 )

φ

M od(φ)−1

² Σ2

² Sub(Σ2 )

th(Σ1 )

⊇ th(Σ2 )

/ Spec(Σ1 )

mod(Σ1 )

=

Sen(φ)

² / Spec(Σ2 )

mod(Σ2 )

/ Sub(Σ1 ) M od(φ)−1

² / Sub(Σ2 )

Proof. ICSen⇒Mod implies inequality 1: For any M2 ∈ |Mod(Σ2 )| we obtain M2 ∈ |mod(Σ2 )(Sen(φ)(Γ1 ))| ⇔ M2 |=Σ2 Sen(φ)(ϕ1 ) for all ϕ1 ∈ Γ1 ⇒ M od(φ)(M2 ) |=Σ1 ϕ1 for all ϕ1 ∈ Γ1 ⇔ M od(φ)(M2 ) ∈ |mod(Σ1 )(Γ1 )| ⇔ M2 ∈ |M od(φ)−1 (mod(Σ1 )(Γ1 ))|

(def. mod(Σ2 )) (ICSen⇒Mod )) (def. mod(Σ1 )) (def. M od(φ)−1 )

Inequality 1 implies ICSen⇒Mod : For any M2 ∈ |Mod(Σ2 )| we obtain M2 |=Σ2 Sen(φ)(ϕ1 )

⇔ M2 ∈ |mod(Σ2 )(Sen(φ)(ϕ1 ))| ⇒ M2 ∈ |M od(φ)−1 (mod(Σ1 )(ϕ1 ))| ⇔ M od(φ)(M2 ) ∈ |mod(Σ1 )(ϕ1 )| ⇔ M od(φ)(M2 ) |=Σ1 ϕ1

(def. mod(Σ2 )) (inequality 1) (def. M od(φ)−1 ) (def. mod(Σ1 ))

The equivalence of ICMod⇒Sen and inequality 2 is shown analogously.

14

Fibred and Indexed Categories for Abstract Model Theory

Inequality 2 implies inequality 3: Due to the unit law in Proposition 2.14, the monotonicity of M od(φ)−1 , and inequality 2 we obtain M od(φ)−1 (M1 )

⊆ M od(φ)−1 (mod(Σ1 )(th(Σ1 )(M1 ))) ⊆ mod(Σ2 )(Sen(φ)(th(Σ1 )(M1 )))

but, by the adjointness law in Proposition 2.14 this is equivalent to ¡ ¢ th(Σ2 ) M od(φ)−1 (M1 ) ⊇ Sen(φ) (th(Σ1 )(M1 )) Inequality 3 implies inequality 2: The instance of inequality 3 ¡ ¢ th(Σ2 ) M od(φ)−1 (mod(Σ1 )(Γ1 )) ⊇ Sen(φ) (th(Σ1 )(mod(Σ1 )(Γ1 ))) is due to the adjointness law in in Proposition 2.14 equivalent to M od(φ)−1 (mod(Σ1 )(Γ1 )) ⊆ mod(Σ2 )(Sen(φ)(th(Σ1 )(mod(Σ1 )(Γ1 )))) But, the counit law in Proposition 2.14, the monotonicity of Sen(φ) and the functor property of mod(Σ2 ) entail mod(Σ2 )(Sen(φ)(th(Σ1 )(mod(Σ1 )(Γ1 )))) ⊆ mod(Σ2 )(Sen(φ)(Γ1 ))

Concerning Lemma 2.16.1 and 2.16.2, the reader has to bear in mind that the inverse image of a full subcategory becomes a full subcategory as well. Since the categories Spec(Σ) and Sub(Σ) are partial order categories, i.e., only the existence of arrows matters, lemma 2.16 shows that the institution condition is equivalent to the following equation: mod(Σ1 ); M od(φ)−1 = Sen(φ); mod(Σ2 ).

(2.3)

To summarize our analysis and to give an overall picture we have to remind: Fact 2.17 (Power Construction Functors) 1. The assignments A 7→ P(A) and (f : A → B) 7→ (f : P(A) → P(B)), due to Fact 2.15, define a functor P : Set → Cat. 2. The assignments C 7→ P(C) and (F : C → D) 7→ (F −1 : P(D) → P(C)), due to Fact 2.15, define a functor P − : Catop → Cat. Now, our definitions can be compressed to def

Spec = Sen; P : Sign → Cat and

def

Sub = M odop ; P − : Sign → Cat

(2.4)

and equation 2.3 says that mod(Σ) is the component at Σ of an indexed functor mod : Spec ⇒ Sub : Sign → Cat, i.e., the institution condition is equivalent to a naturality requirement. Theorem 2.18 (Indexed Institutional Frame) A 4-tuple I = (Sign, Sen, M od, |=) is an Institutions iff the 5-tuple P(I) = (Sign, Spec, Sub, mod, th) is an indexed frame, called the indexed institutional frame for I.

Fibred and Indexed Categories for Abstract Model Theory

15

Proof. Immediately by Proposition 2.14, Lemma 2.16, and Fact 2.17. Similar to the institution condition also the comorphism condition turns out to be equivalent to a commutativity requirement: Lemma 2.19 (Comorphism Condition) Let µ = (Φ, α, β) : I → I 0 be an institution comorphism. Then for any signature Σ ∈ |Sign| the comorphism condition is equivalent to the equation mod(Σ); β(Σ)−1 = α(Σ); mod(Φ(Σ)). Proof. Analogously to the proof of Lemma 2.19. In such a way, composing the components of an institution comorphism with the power construction functors, we obtain two natural transformations α ¦ P : Spec =⇒ Φ; Spec0 : Sign → Cat and

β op ¦ P − : Sub =⇒ Φ; Sub0 : Sign → Cat,

where we have to bear in mind that opposing categories causes an inversion for natural transformations, i.e., β op : M odop =⇒ Φop ; M od0op : Sign → Catop . Lemma 2.19 can be reformulated now according to Theorem 2.18 as Theorem 2.20 (Map of Indexed Institutional Frame) A triple µ = (Φ, α, β) is an institution comorphism from I into I 0 def

op

iff

the triple



P(µ) = (Φ, α ¦ P, β ¦ P ) is a map of indexed frames from the indexed institutional frame P(I) into the indexed institutional frame P(I 0 ). Since the transitions from I to P(I) and from µ to P(µ), respectively, are defined in a well-structured way by post-composing the corresponding components with power construction functors we obtain Proposition 2.21 (Map of Indexed Institutional Frame) The assignments I 7→ P(I) due to Theorem 2.18 and µ 7→ P(µ), due to Theorem 2.20 define a functor P : InstCom → IndFra. Proof. Identities: P(idI ) = (idSign , idSen ¦ P, idM odop ¦ P − ) (Def. 2.12 and Theorem 2.20) = (idSign , idSen¦P , idM odop ¦P − ) (Equation 1.2) = (idSign , idSpec , idSup ) (Equation 2.4) = idP(I) (Definition 2.5) Composition: = = = = = = =

P(µ); P(µ0 ) (Φ, α ¦ P, β op ¦ P − ); (Φ0 , α0 ¦ P, β 0op ¦ P − ) (Φ; Φ0 , (α ¦ P); (Φ ¦ (α0 ¦ P)), (β op ¦ P − ); (Φ ¦ (β 0op ¦ P − ))) (Φ; Φ0 , (α ¦ P); ((Φ ¦ α0 ) ¦ P), (β op ¦ P − ); ((Φ ¦ β 0op ) ¦ P − )) (Φ; Φ0 , (α; (Φ ¦ α0 )) ¦ P), (β op ; (Φ ¦ β 0op )) ¦ P − ) (Φ; Φ0 , (α; (Φ ¦ α0 )) ¦ P), ((Φop ¦ β 0 ); β)op ¦ P − ) P(Φ; Φ0 , α; (Φ ¦ α0 ), (Φop ¦ β 0 ); β) P(µ; µ0 )

(Theorem 2.20) (Definition 2.5) (Equation 1.4) (Equation 1.4) (opposing) (Theorem 2.20) (Definition 2.12)

16

Fibred and Indexed Categories for Abstract Model Theory

Remark 2.22 (General Map of Institutions) Note, that the functor P : InstCom → IndFra is not full, and that the original general concept of a “map of institution” in [20] covers exactly also all the maps between the corresponding indexed institutional frames not reached by this functor. In [12] those general maps are classified as “theoroidal comorphisms”.

3

Fibred Logical Systems

3.1 Split Opfibrations In generalizing the formation of the disjoint union of a family of sets all the components of an indexed category can be put together into a single “flat” category by the so-called Grothendieck construction. Note that the following presentation differs with respect to the more traditional one given in the literature [3]. Definition 3.1 (Grothendieck Constructions and Indexed Categories) Given an indexed category C : Ind → Cat we define the category F lat(C) as follows: + objects: are pairs hi, ai where i ∈ |Ind| and a ∈ |C(i)|. + arrows: from hi, ai to hj, bi are pairs hσ, f i where σ : i → j is an arrow in Ind and f : b → C(σ)(a) is an arrow in C(j). + composition: Given arrows hσ, f i : hi, ai → hj, bi and hτ, gi : hj, bi → hk, ci in def

F lat(C), let hσ, f i; hτ, gi = hσ; τ, g; C(τ )(f )i . def

+ identites: Given an object hi, ai of F lat(C), its identity is defined as idhi,ai = hidi , ida i : hi, ai → hi, ai. + Moreover we obtain a projection functor P rC : F lat(C) → Ind with P rC (hi, ai) = i and P rC (hσ, f i) = σ for any hi, ai and any hσ, f i : c → C(τ )(C(σ)(a)) in F lat(C). c ²

C(τ )(b)

b f

C(i)

i

C(τ )(f )

² C(σ)(a)

a

C(σ)

σ

/ C(j)

/j

g

² C(τ )(C(σ)(a))

C(τ )

τ

/ C(k)

/k

Example 3.2 Given an Institution I, we consider first the indexed category Spec : Sign → Cat. Then we have F lat(Spec) as follows: the objects are pairs hΣ, Γi, where Σ ∈ |Sign|

Fibred and Indexed Categories for Abstract Model Theory

17

and Γ is an object of Spec(Σ). Now an arrow hφ, ⊇i : hΣ1 , Γ1 i → hΣ2 , Γ2 i is such that σ : Σ1 → Σ2 is an arrow in Sign and Γ2 ⊇ Sen(φ)(Γ1 ) is a specification morphism in Spec(Σ2 ). There is also the projection functor P rSpec : F lat(Spec) → Sign, such that hΣ, Γi 7→ Σ. By the same token, considering Sub : Sign → Cat an object in F lat(Sub) is a pair hΣ, Mi such that Σ is an object of Sign and M is a category of models and an object of Sub(Σ). An arrow hφ, ⊆i : hΣ1 , M1 i → hΣ2 , M2 i is such that φ : Σ1 → Σ2 is a signature morphism and M2 ⊆ M od(φ)−1 (M1 ) is a model morphism in Sub(Σ2 ). Note that we also have a projection functor P rSub : F lat(Sub) → Sign. One question that arises naturally is that if there is an axiomatic characterization of those “fibred categories” resulting from the Grothendieck construction. First, we look for an axiomatization of the fact that an object b can be seen as the result of applying to an object a a translation induced by a morphism σ between indices. Definition 3.3 (Op-Cartesian Arrows) Let Ind and C be arbitrary categories and P : C → Ind be a functor. Let σ : i → j be an arrow in C and a be an object of C such that P (a) = i. An arrow k : a → b in C is op-cartesian for σ and a if the following two conditions are satisfied: OC-1 P (k) = σ; OC-2 given any other arrow v : a → c, each factorization of P (v) through σ uniquely determines a factorization of v through k, i.e., for any arrow ² : j → P (c) in C such that P (v) = σ; ² there exists a unique w : b → c such that v = k; w and P (w) = ². k

/ a _ PPPP _b DD PPP DD w v PPP DD PPPDD PPD"( _c ² ² σ i OOO / j AA OOO OOO AAA² OO A P (v) OOOAAÃ ² ' P (c) Definition 3.4 (Opfibration) A functor P : C → Ind is said to be an opfibration if there exists an op-cartesian arrow for every arrow σ : i → j and object a ∈ |C| for which P (a) = i in Ind. If P : C → Ind is an opfibration, then we say that C is fibered over Ind. We can now make for any object a and any morphism σ an “individual local choice” between all the possible results of applying to a the translation induced by σ. Definition 3.5 (Cleavage) If P : C → Ind is an opfibration, a cleavage for P : C → Ind is a function κ that takes an arrow σ : i → j and a such that P (a) = i to an arrow κ(σ, a) that is op-cartesian for σ and a.

18

Fibred and Indexed Categories for Abstract Model Theory

The individual local choices will, in general, not ensure global compositionality, i.e., κ(σ, a); κ(τ, b) will be, in general, different from κ(σ; τ, a). But, in some cases we can globally coordinate the local choices in such a way that we obtain Definition 3.6 (Split Opfibrations) Let P : C → Ind be an opfibration. Then, a given cleavage κ is called split if the following conditions are satisfied: SC-1 κ(idi , a) = ida , where P (a) = i. SC-2 κ(σ, a); κ(τ, b) = κ(σ; τ, a), where σ : i → j, τ : j → k, such that P (a) = i and P (b) = j.

κ(idi ,a)

κ(σ,a)

κ(τ,b)

/ D a _ PPPP a _ PPP DDD v v PPP DD PPPDD PPD"( _c

/ /c a _ PPPP _b DD z_ PPP DD w 0 zz w z v PPP DD zz PPPDD PPD"( }zzz _c

² idi ² i OOO / i BB OOO OOO BBBP (v) OO BB P (v) OOO ' BÃ ² P (c)

² ² ² σ τ /c i OOO / j AA } OOO }} OOO AAAP (w) }} 0 OOO AA } P (v) OO' AÃ ² ~}} P (w ) P (c)

An opfibration with a splitting κ is called a split opfibration. Note that the universal property of op-cartesian arrows provides for arbitrary fibrations at least an isomorphism iσ,τ such that κ(σ, a); κ(τ, b); iσ,τ = κ(σ; τ, a). For indexed categories the global coordination of the local choices is “built-in” thus the property “split obfibration” has to be part of our intended axiomatization. Fact 3.7 (Grothendieck Construction and Split Obfibrations) Given an indexed category C : Ind → Cat, F lat(C) is a category and the projection functor P rC : F lat(C) → Ind, defined in 3.1, is a split opfibration, with splitting κ(σ, hi, ai) = hσ, idC(σ)(a) i : hi, ai → hj, C(σ)(a)i for any arrow σ : i → j of C and object hi, ai of F lat(C). Proof. Note that F lat(C) is a category by definition 3.1. We must show that κ(σ, hi, ai) is op-cartesian for any σ : i → j and and any hi, ai. We consider an arbitrary arrow hδ, hi : hi, ai → hk, ci such that σ; ² = δ for a certain arrow ² : j → k and obtain the following diagram

Fibred and Indexed Categories for Abstract Model Theory hσ,id

19

i

C(σ)(a) / hj, C(σ)(a)i hi, ai _ FF _ FF rrr r FF r rrω hδ,hi FF # yrrr hk, ci _

² ² σ /j i HH q q HH HH qqq q HH q qq ² δ HH H# ² xqqqq k We have to show that there is a unique ω : hj, C(σ)(a)i → hk, ci such that hδ, hi = hσ, idC(σ)(a) i; ω and P rC (ω) = ². The second condition implies ω = h², xi thus we obtain hσ, idC(σ)(a) i; ω = hσ, idC(σ)(a) i; h², xi = hσ; ², x; C(²))(idC(σ)(a) )i = hσ; ², x; idC(²)(C(σ)(a)) i = hδ, xi

(second condition) (composition in F lat(C)) (functor property) (assumption and identity law)

In such a way, the first condition entails uniquely x = h thus we obatin finally the required unique ω = h², hi. It remains to show that the splitting preserves identities and composition. Condition SC-1 is ensured by κ(idi , hi, ai) = hidi , idC(idi )(a) i = hidi , ididC(i) (a) i = hidi , ida i = idhi,ai . The first equality is due to definition of κ. The second by the functor property, the third by the identity functor and the fourth by definition of identities in F lat(C). On the other hand, condition SC-2 is obtained by κ(σ; τ, hi, ai) = hσ; τ, idC(σ;τ )(a) i (definition of κ) = hσ; τ, id[C(σ);C(τ )](a) i (functor property) = hσ; τ, idC(τ )(C(σ)(a)) i (application) = hσ; τ, C(τ )(idC(σ)(a) )i (functor property) = hσ; τ, idC(σ)(C(τ )(a)) ; C(τ )(idC(σ)(a) )i (identity law) = hσ, idC(σ)(a) i; hτ, idC(τ )(C(σ(a)) i (composition in F lat(C)) = hκ(σ, hi, ai); κ(τ, hj, C(σ)(a)i) (definition of κ)

As a special case of Fact 3.7 we obtain that any arrow hσ, f i : hi, ai → hj, ci can be factored through the splitting as hσ, idC(σ)(a) i; hidj , f i. This factorization reflects perfectly the fact that the arrows in F lat(C) are defined as pairs of arrows. Example 3.8 Consider the opfibration P rSpec : F lat(Spec) → Sign. Now for any φ : Σ1 → Σ2 in

20

Fibred and Indexed Categories for Abstract Model Theory

Sign and any specification hΣ1 , Γ1 i, the splitting is given by κSpec (hφ, hΣ1 , Γ1 ii) = hφ, idSen(φ)(Γ1 ) i : hΣ1 , Γ1 i → hΣ2 , Sen(φ)(Γ1 )i. Note that the opcartesian arrow above shows how to typecast an Σ1 -specification into an Σ2 -one. Also any specification morphism hφ, ⊇i : hΣ1 , Γ1 i → hΣ2 , Γ2 i can be factored as hφ, idSen(φ)(Γ) i; hidΣ2 , ⊇i, where hidΣ2 , ⊇i : hΣ2 , Sen(φ)(Γ1 )i → hΣ2 , Γ2 i. Consider now the opfibration FSub : F lat(Sub) → Sign. Given any φ : Σ1 → Σ2 in Sign and any hΣ1 , M1 i, the splitting is given by κSub (hφ, hΣ1 , M1 ii) = hφ, idM od(φ)−1 (M) i : hΣ1 , M1 i → hΣ2 , M od(φ)−1 (M1 )i Note that M od(φ)−1 is not only reindexing, but also taking all Σ2 extensions of the models in the category M1 . Again, any arrow hφ, ⊆i : hΣ1 , M1 i → hΣ2 , M2 i can be factored as hφ, idM od(φ)−1 (M1 ) i; hidΣ2 , ⊆i, where hidΣ2 , ⊆i : hΣ2 , M od(φ)−1 (M1 )i → hΣ2 , M2 i. Inversing the Grothendieck construction we can split up a “fibred category” into disjoint components. Definition 3.9 (Fibers) For any functor P : C → Ind, the fiber FP (i) over an object i of Ind is the subcategory of C given by the collection of objects a such that P (a) = i, and the arrows u for def

which P (u) = idi , i.e., FP (i) = P −1 (idi ). Example 3.10 Consider the functor P rSpec : F lat(Spec) → Sign. Then for each object Σ of Sign we def

may define (recover) the set of sentences of Σ as typed specifications in SpecP r (Σ) = −1 P rSpec (idΣ ). In the same way, considering the functor P rSub : F lat(Sub) → Sign we def

recover the category of models of the signature Σ as typed models in SubP r (Σ) = −1 P rSub (idΣ ). Note that the objects of SpecP r (Σ) are pairs hΣ, Γi,where Γ ⊆ Sen(Σ). Similarly, the objects of SubP r (Σ) are pairs hΣ, Mi, where M ⊆ M od(Σ). The universal property of op-cartesian arrows ensures that any individual local choice provides “local functoriality”. Definition 3.11 (Cleavages induce Functors) Let P : C → Ind be an opfibration. with cleavage κ. Then we define: 1. Let FP (i) be the fiber over i for each object i of Ind. 2. For σ : i → j in Ind and a an object of FP (i), FP (σ)(a) is defined to be the codomain of the (op-cartesian) arrow κ(σ, a). 3. For σ : i → j in Ind and u : a → a0 in FP (i), FP (σ)(u) is the unique arrow from FP (σ)(a) to FP (σ)(a0 ) (by universality - condition OA-2 - of κ(σ, a)) for which κ(σ, a); FP (σ)(u) = u; κ(σ, a0 )

Fibred and Indexed Categories for Abstract Model Theory

a _ FP (σ)(u) >> >> 0 Á κ(σ,a ) / b0 0 a_ @ _ ?? @@ ?? FP (σ)(v) @@v ?? @@ ?? @Ã ² κ(σ,a00 ) Â ² / b00 00 σ i= a_ / j == _ == == == = = = idj == idi == Á ² Á ² σ /j i @@ ?? @@ ?? @@ ?? @ ?? idj idi @@ Â ² Â ² σ /j i

a _ ?? ?? u ?? ?? Â

By universality of κ(σ, a), FP (σ)(u) is the unique arrow that makes the top bottom diagram commutes. Also, by universality of κ(σ, a0 ), FP (σ)(v) is the unique arrow that makes the top front diagram commutes. So FP (σ)(u); FP (σ)(v) is a solution to the equation (u; v); κ(σ, a00 ) = κ(σ, a); (?) However, by definition 3.11, FP (σ)(u; v) also solves the equation, and therefore they must be equal. Preservation of identities: Let ida : a → a be an arrow in FP (i) and consider the diagram below:

22

Fibred and Indexed Categories for Abstract Model Theory κ(σ,a)

a _ >> >> >> ida >> Á

a _

² i< σ > Á κ(σ,a0 ) / b0 _

² τ /j == == == idj == Á ² σ /j

/c _ >> >> FP (τ )(FP (σ)(u)) >> >> Â κ(τ,b0 ) / c0 _ ² /k == == == idk == Á ² τ /k

But now, both [FP (σ); FP (τ )](u) and FP (σ; τ )(u) are solutions to the equation κ(σ; τ, a); (?) = u; κ(σ; τ, a00 ). Since this solution must be unique, they are equal. Preservation of identities: Let u : a → a0 be an arrow in FP (i) and consider the diagram below:

24

Fibred and Indexed Categories for Abstract Model Theory κ(idi ,a)

a _ @@ @@ @ u @@ Â

a_0

² i ?? ?? idi ?? idi ?? Â ² i

/a _ @@ @@FP (idi )(u) @@ @ κ(idi ,a) / a0 _ ² /i? ?? ??idi ?? ? ² /i id i

By universality of κ(idi , a), FP (idi )(u) is the unique arrow such that the top square commutes. Moreover, since κ is splitting we have that κ(idi , a) = ida and κ(idi , a0 ) = id0a . This means that also u = idFP (i) (u) makes the top square commute. Since the solution of the equation u; κ(idi , a0 ) = κ(idi , a); (?) must be unique, we must have that FP (idi )(u) = idFP (i) (u). Note, that in case of a simple fibration we will only have a natural equivalence between FP (σ); FP (τ ) and FP (σ; τ ). Example 3.15 (Indexed Categories Spec and Sub) The above fact says that the assignments φ : Σ1 → Σ2 7→ SpecP r (φ) : SpecP r (Σ1 ) → SpecP r (Σ2 ) and φ : Σ1 → Σ2 7→ M od−1 (φ) : SubP r (Σ1 ) → SubP r (Σ2 ) extends to indexed categories SpecP r : Sign → Cat and SubP r : Sign → Cat, respectively. It remains to investigate if the equivalence between “indexed categories” and “split opfibrations” extends also to morphisms. Firstly, we have to define Definition 3.16 (Maps of Split Opfibrations) Let P : C → Ind and P : C0 → Ind be two split opfibrations with splittings κ and κ0 , respectively. A map of split opfibrations ζ : P → P 0 is a functor ζ : C → C 0 for which the following conditions are satisfied: MSO-1 Commutativity: The diagram bellow commutes: ζ / C0 CA AA | | AA || A || P 0 P AA | Ã }| Ind

MSO-2 Cleavage preservation: For any arrow σ : i → j in Ind and object a of C such that P (a) = i, we must have ζ(κ(σ, a)) = κ0 (σ, ζ(a)) The category of Ind-split opfibrations and Ind-maps of split opfibrations will be denoted SO(Ind). Secondly, we can extend the Grothendieck construction to morphisms.

Fibred and Indexed Categories for Abstract Model Theory

25

Proposition 3.17 Let SO(Ind) and IndFun(Ind, Cat) be respectively, the categories of Ind-split opfibrations and Ind-indexed functors. Then we can define a functor J : IndFun(Ind, Cat) → SO(Ind) in the following way: À If F : Ind → Cat is an indexed category, then P rF : F lat(F ) → Ind is the projection functor of definition 3.1. Á If α : F ⇒ G : Ind → Cat is an indexed functor (an arrow in IndFun(Ind, Cat)) then we can define a functor ζα : P rF → P rG through the following assignments: def

objects If hi, ai is an object of F lat(F ) then ζα (hi, ai) = hi, α(i)(a)i is an object of F lat(G). arrows If hσ, f i : hi, ai → hj, bi (i.e., σ : i → j an arrow in Ind and f : b → F (σ)(a)) an arrow in F (j)), then ζα (hσ, f i) = hσ, α(j)(f )i which is an arrow from hi, α(i)(a)i to hj, α(j)(b)i (i.e., σ : i → j in Ind and α(j)(f ) : α(j)(b) → α(j)(F (σ)(a)) = G(σ)(α(i)(a)) in G(j)) and thus an arrow in F lat(G). Proof. To show that ζα is a map of split opfibrations we have to show that it preserves fibers and opcartesian arrows. The first follow directly from definition above. Now let σ : i → j in Ind and hi, ai an object of F lat(F ). Now note that ζα (κ(σ, hi, ai)) = ζα (hσ, idF (σ)(a) i) = hσ, α(j)(idF (σ)(a) )i = hσ, idα(j)(F (σ)(a)) i = hσ, idG(σ)(α(i)(a)) i = κ0 (σ, hi, α(i)(a)i). Preservation of composition and identities follow from the definition of ζα and the fact that α is an indexed functor. Example 3.18 Considering the fact above and given the indexed categories Spec : Ind → Cat and Sub : Ind → Cat, together with the natural transformation mod : Spec ⇒ Sub : Ind → Cat, we can define the map of split opfibrations ζmod : P rSpec → P rSub through the assignments: def

• for hΣ, Γi an object of F lat(Spec), ζmod (hΣ, Γi) = hΣ, mod(Σ)(Γ)i; • for hσ, ⊇i : hΣ1 , Γ1 i → hΣ2 , Γ2 i (i.e., σ : Σ1 → Σ2 and Γ2 ⊇ Sen(φ)(Γ1 )), def

ζmod (hφ, ⊇i) = hφ, ⊆i : hΣ1 , mod(Σ1 )(Γ1 )i → hΣ2 , mod(Σ2 )(Γ2 )i (that is to say, φ : Σ1 → Σ2 and mod(Σ2 )(Γ2 ) ⊆ M od(φ)−1 (mod(Σ1 )(Γ1 ))), an arrow in F lat(Sub). Note also that ζα preserves the splitting, since given φ : Σ1 → Σ2 in Sign and hΣ1 , Γ1 i an object of F lat(Spec), the opcartesian arrow hφ, idSen(φ)(Γ1 ) i : hΣ1 , Γ1 i → hΣ2 , Sen(φ)(Γ1 )i is mapped to hφ, ⊆i : hΣ1 , mod(Σ1 )(Γ1 )i → hΣ2 , mod(Σ2 )(Sen(φ)(Γ1 ))i. But since mod is a natural transformation, we have that mod(Σ2 )(Sen(φ)(Γ1 )) = M od(φ)−1 (mod(Σ1 )(Γ1 )). Thus ζα (hφ, idSen(φ)(Γ1 ) i = hφ, idM od(φ)−1 (mod(Σ1 )(Γ1 ) i, and hence that ζα (κSpec (φ, hΣ1 , Γ1 ii)) = κSub (φ, ζα (hΣ1 , Γ1 i)). Note that we also have a functor ζth : F lat(Sub) → F lat(Spec), such that for each def

object hΣ, Mi of F lat(Sub), ζth (hΣ, Mi) = hΣ, th(M)i. Moreover, that this functor preserves fibers, in the sense that ζth ; P rSpec = P rSub . Thirdly, the inversion of the Grothendieck construction extends also to morphisms.

26

Fibred and Indexed Categories for Abstract Model Theory

Proposition 3.19 Let SO(Ind) and IndFun(Ind, Cat) be respectively, the categories of Ind-split opfibrations and Ind-indexed functors. Then we can define a functor K : SO(Ind) → IndFun(Ind, Cat) in the following way: À If P : C → Ind is a split opfibration in SO(Ind), then FP : Ind → Cat is the functor of fact 3.14. Á If ζ : P → P 0 is a map of split opfibrations, where P : C → Ind and P 0 : C0 → Ind, then we can define an indexed functor αζ : FP ⇒ FP 0 : Ind → Cat by restricting ζ to the fibers of FP , i.e., we assigning to each object i of Ind the restriction def αζ (i) = ζFP (i) : FP (i) → FP 0 (i). Proof. The commutativity ζ; P 0 = P ensures ζ(FP (i)) ⊆ FP 0 (i) thus αζ (i) is indeed defined and, as a restriction of the functor ζ, it is obviously a functor too. It remains to show that the functors αζ (i) = ζFP (i) constitute also a natural transformation. We have to show that for each σ : i → j in Ind, the following diagram commutes: FP (i)

i σ

FP (σ)

² j

ζFP (i)

/ FP 0 (i)

(1) ²

²

FP (j)

ζFP (j)

FP 0 (σ)

/ FP 0 (j)

Now let u : a → a0 in FP (i) and consider the following diagram: a _