5.3.2. Elementary Diagrams for Algebras

For Institutions of Equations, we have chosen Cxt*EQ* = Carr*EQ* = Base*EQ* = Set*S*. An atomic Σ-equation in a context *K* is a Σ-equation of the form:

$$\omega(\mathbb{K}, \omega(k\_1, \dots, k\_n) = k) \quad \text{with } \omega \in \Omega, \ k\_i \in \mathbb{K}\_{\mathbb{s}\_i}, 1 \le i \le n \quad \text{and} \quad k \in \mathbb{K}\_{\text{out}(\omega)} \tag{17}$$

where [*x*1:*s*1, *x*2:*s*2, ... , *xn*:*sn*] is the assumed representation of *in*(*ω*) as a list of variable declarations (see Section 4.2). Note that the usual encoding of n-ary operations by (n + 1)-ary predicates establishes a one-to-one correlation between the corresponding atomic equations and atomic statements, respectively.

By At(*K*), we denote the subset of Eq(*K*) of all atomic Σ-equation in a context *K*. The assignments *K* → At(*K*) extend to a functor At : Cxt*EQ* → Set.

In full analogy to Institutions of Statements, there are two canonical ways to transform a Σ-algebra A = (*A*, ΩA) into an Eq-sketch. The atomic variant E<sup>A</sup> <sup>Ω</sup> = (*A*, *Eq*<sup>A</sup> <sup>Ω</sup>) encodes only the semantics of the operations in ΩA:

$$\mathbb{E}q^{\mathcal{A}}\_{\Omega} := \left\{ (A, \omega \langle a\_1, \dots, a\_n \rangle = \omega^{\mathcal{A}}(a\_1, \dots, a\_n)) \mid \omega \in \Omega, a\_i \in A\_{\mathfrak{s}\_i}, 1 \le i \le n \right\} \tag{18}$$

The full variant EA = (*A*, *Eq*A) encodes the semantics of all terms (derived operations):

$$\mathbb{E}\eta^{\mathcal{A}} := \{ (A, t\_1 = t\_2) \mid t\_1, t\_2 \in T\_\Sigma(A)\_5, \text{ s} \in \mathbb{S}, \ t\_1^{\mathcal{A}}(\mathrm{id}\_A) = t\_2^{\mathcal{A}}(\mathrm{id}\_A) \} \subseteq \mathrm{Eq}(A). \tag{19}$$

We have obviously *Eq*A <sup>Ω</sup> ⊂ *Eq*<sup>A</sup> and (*id*A, A) is a valid interpretation of E<sup>A</sup> <sup>Ω</sup> as well as of EA. Any Σ-algebra A = (*A*, ΩA) is freely generated by the Eq-sketch E<sup>A</sup> <sup>Ω</sup> = (*A*, *Eq*A <sup>Ω</sup>) as well as by the Eq-sketch E<sup>A</sup> = (*A*, *Eq*A) with the universal interpretation (*id*A, A). That is, (E<sup>A</sup> <sup>Ω</sup>, *id*A) as (EA, *id*A) are sketch representations of A in the sense of the last subsection.

Conditional Σ-equations are not atomic; thus, we have to rely on the full encodings of Σ-algebras to have a chance to express the validity of conditional Σ-equations by a closedness property analogously to Proposition 3.

Fortunately, the assignments A → E<sup>A</sup> define an embedding of Alg(Σ) into the category Sk(Eq)*<sup>a</sup>* of all Eq-sketches and all Eq*-sketch arrows* transforming each homomorphism between Σ-algebras into a strict Eq-sketch arrow.
