5.2.2. Elementary Diagrams

To establish sketch-based mechanisms to encode structures "syntactically", we have to assume an Institution of Statements IS = (Cxt, Stm, Int, |=) with Carr Cxt and At(*K*) ⊆ Stm(*K*) for all contexts *K* in Cxt, i.e., Stm(*K*) contains all atomic statements in *K*.

There are two canonical ways to transform a Ξ-structure U = (*U*, Φ<sup>U</sup> ) into an Stm-sketch. The atomic variant SU <sup>Φ</sup> = (*U*, *St*<sup>U</sup> <sup>Φ</sup>) encodes only the semantics of feature symbols and uses therefore only atomic statements:

$$\mathsf{St}\_{\Phi}^{\mathsf{df}} := \{ (aF, F(\mathrm{id}\_{aF}), \gamma) \mid F \in \Phi, \gamma \in [F]^{\mathsf{U}} \} \subseteq \mathsf{Act}(\mathsf{U}).\tag{12}$$

The full variant S<sup>U</sup> = (*U*, *St*<sup>U</sup> ) is available if XE(Ξ, *X*) = FE(Ξ, *X*) for all *X* ∈ Var*Obj* and encodes the semantics of all feature expressions:

$$\mathcal{S}^{\mathsf{Id}} := \{ (X, \mathsf{Ex}, \gamma) \mid X \in \mathsf{Var}\_{\mathsf{Cb}/\prime} \,\,\exists x \in \mathsf{FE}(\Xi, X), \,\gamma \in [\mathsf{Ex}]\_X^{\mathsf{Id}} \} \subseteq \mathsf{Stm}(\mathsf{U}).\tag{13}$$

We obviously have *St*U <sup>Φ</sup> ⊂ *St*<sup>U</sup> . For any statement (*X*, *Ex*, *γ*) in *U* we obtain, according to (13) and the definition of satisfaction relations in Definition 14,

$$(\mathcal{X}, \mathcal{E}x, \gamma) \in \mathcal{S}^{\mathcal{U}} \quad \text{iff} \quad \gamma; \operatorname{id}\_{\mathcal{U}} = \gamma \in [\mathcal{E}x]\_{\mathcal{X}}^{\mathcal{U}} \quad \text{iff} \quad (\operatorname{id}\_{\mathcal{U}}, \mathcal{U}) \succeq\_{\mathcal{U}} (\mathcal{X}, \mathcal{E}x, \gamma). \tag{14}$$

thus (*idU*, U) is a valid interpretation of S<sup>U</sup> <sup>Φ</sup> as well as of S<sup>U</sup> .

In traditional First-Order Logic, we meet the full variant in the form of elementary diagrams [39]. The difference to our encoding is that the carrier of a first-order structure is not considered as a context. Instead, each element of the carrier is added as a constant to the signature. The encoding of structures as sketches avoids this kind of circularity. The "signature extension trick" works only for first-order signatures with constants symbols and, more critically, it requires that the carriers of first-order structures are sets! It looks like the sketch encoding mechanism is much more flexible and general.

The elementary diagrams in [2] give an abstract account of the signature extension approach but are based on an atomic variant of encoding.

There are no structures at all in [15] only atomic sketches! In [13], we followed Makkai and have not considered structures either. Instead, we worked, directly, with the atomic sketch encodings SU <sup>Φ</sup> of structures.

To validate, in retrospective, the approaches in [13,15], a noticeable portion of the remaining part of the paper, will be spent to answer the following question:

> Question 4: Is there any justification to ignore completely the concept of semantic structure (model)?

By construction, any Ξ-structure U = (*U*, Φ<sup>U</sup> ) in Sem(Ξ) is freely generated in Sem(Ξ) by the Stm-sketch SU <sup>Φ</sup> = (*U*, *St*<sup>U</sup> <sup>Φ</sup>) with the universal interpretation (*idU*, U). *St*<sup>U</sup> <sup>Φ</sup> contains only atomic statements thus (SU <sup>Φ</sup>, *idU*) becomes a sketch representation of U in the sense of the last subsection. In particular, there is an isomorphism between Int(SU <sup>Φ</sup>) and U/Sem(Ξ).

The crucial observation is, however, that the assignments U → S<sup>U</sup> <sup>Φ</sup> define an embedding Enc : Str(Ξ) <sup>→</sup> Sk(Stm)*<sup>a</sup>* of Str(Ξ) into the category Sk(Stm)*<sup>a</sup>* of all Stm-sketches and all Stm-sketch arrows defined in the next subsection in Definition 20. This embedding establishes, moreover, an isomorphism between Str(Ξ) and the subcategory atSk(Stm)*<sup>a</sup> <sup>s</sup>* of Sk(Stm)*<sup>a</sup>* given by all atomic Stm-sketches and all strict Stm-sketch arrows between them. An Stm-sketch <sup>K</sup> = (*K*, *St*K) is atomic if *St*<sup>K</sup> <sup>⊆</sup> At(*K*) (see Remark 14).

The concepts (atomic) Stm-sketch and (strict) Stm-sketch arrow concern only the "structure" of sketches and are completely semantics-independent. That is, the transition along the encoding functor Enc from the category Str(Ξ) to the isomorphic category atSk(Stm)*<sup>a</sup> <sup>s</sup>* implements an abstraction from the concept semantic structure (model) to the concept atomic sketch. In case Sem(Ξ) = Str(Ξ), this abstraction is exhaustive. In case Sem(Ξ)*Obj* - Str(Ξ)*Obj*, however, we need an additional semantics-independent, purely structural characterization identifying exactly all those atomic Stm-sketches SU <sup>Φ</sup> in atSk(Stm)*<sup>a</sup> <sup>s</sup>* with U in Sem(Ξ), to make the abstraction complete (see Remark 29).

A sketch is constituted by a context and a set of statements. The informal term "structure of a sketch" takes into account the context; for each statement, the syntactic structure of the corresponding expression and its "location", i.e., its binding morphism, the set of statements as such and the "distribution" of the statements over the context.
