Constraints in DPF at Present

Following [15] and analogous to [14], we use in DPF until now, instead of sketch constraints in the sense of Definition 29, only plain sketch arrows *ϕ* : L → R and call them (positive) universal constraints or negative universal constraints, respectively [18,21]. We define the satisfaction of universal constraints in DPF by means of the closedness property in Definition 23. That is, a sketch G satisfies the "universal constraint" *ϕ* : L → R if, and only if, for any strict sketch arrow *τ* : L → G there is a strict sketch arrow : R → G such that *ϕ*; = *τ*.

By Proposition 7, we can transfer many findings in Sections 5.2.3 and 5.2.4 into the sketch constraints setting. Corollary 6 and Definition 28 ensure that the satisfaction of a universal constraint *ϕ* : L → R in a sketch G can be equivalently expressed by the assertion that G satisfies the general constraint (*uc*, !*G*) with (compare Corollary 3):

$$\mathcal{g}\mathcal{c} := \mathbf{0} \blacktriangleright \forall (L: (\bigwedge \mathcal{S}t^{\mathbb{L}} \to \exists (\varphi, \mathcal{R}: \bigwedge \mathcal{S}t^{\mathbb{R}}))).$$

Be aware that the identifier *ϕ* in *gc* does not refer to the sketch arrow *ϕ* : L → R but to the underlying context morphism *<sup>ϕ</sup>* : *<sup>L</sup>* <sup>→</sup> *<sup>R</sup>*. Note further that we can replace *St*<sup>R</sup> by (*St*<sup>R</sup> \ *<sup>ϕ</sup>*(*St*L)) without losing the equivalence!

Furthermore, we say that a sketch G satisfies the "negative universal constraint" *ϕ* : L → R if, and only if, for any strict sketch arrow *τ* : L → G, there does not exist a strict sketch arrow : R → G such that *ϕ*; = *τ*. This requirement is equivalent to the statement that G satisfies the general constraint (*ngc*, !*G*) with:

$$\mathfrak{mgc} := \mathbf{0} \blacktriangleright \forall (L : (\bigwedge \mathcal{S}t^{\mathbb{L}} \to \neg \exists (\mathfrak{q}, \mathcal{R} : \bigwedge \mathcal{S}t^{\mathbb{R}})))$$

What can we do if a sketch G does not satisfy a general constraint (*c*, !*G*) for a simple condition of the form *c* = **0** ∀(*L* : ( *St*<sup>1</sup> <sup>→</sup> *<sup>∃</sup>*(*ϕ*, *<sup>R</sup>* : *St*2))) where *St*<sup>1</sup> is a set of statements in *L* and *St*<sup>2</sup> a set of statements in *R*, respectively?

We can repair this flaw by applying the sketch arrow *<sup>ϕ</sup>* : (*L*, *St*1) <sup>→</sup> (*R*, *St*<sup>2</sup> <sup>∪</sup> *<sup>ϕ</sup>*(*St*1)) as a transformation rule for all sketch morphisms *<sup>τ</sup>* : (*L*, *St*1) <sup>→</sup> <sup>G</sup> not satisfying the conclusion in condition *c*. In other words, a match of the transformation rule is given by a context morphism *<sup>τ</sup>* : *<sup>L</sup>* <sup>→</sup> *<sup>G</sup>* such that <sup>G</sup> <sup>|</sup>= ( *St*1, *<sup>τ</sup>*) and <sup>G</sup> <sup>|</sup>= (¬∃(*ϕ*, *<sup>R</sup>* : *St*2), *τ*). Note that the negative application condition G |= (¬∃(*ϕ*, *R* : *St*2), *τ*) ensures that we do not apply the rule twice for the same match *<sup>τ</sup>* : (*L*, *St*1) <sup>→</sup> <sup>G</sup>. Applying the rule *<sup>ϕ</sup>* via the match *τ* means nothing but to construct a pushout in the category Sk*<sup>a</sup> <sup>s</sup>* of sketches and strict sketch arrows (compare Remark 32).

(*L*, *St*1) *<sup>ϕ</sup> τ PO* (*R*, *St*<sup>2</sup> <sup>∪</sup> *<sup>ϕ</sup>*(*St*1)) *τ*∗ <sup>G</sup> *<sup>ϕ</sup>*<sup>∗</sup> H

Depending on the properties of the context morphism *ϕ* : *L* → *R* the pushout construction may have different effects. The context *G* can be extended and/or factorized and, if *St*<sup>2</sup> <sup>=</sup> <sup>∅</sup>, we will add new statements to the statements originating from <sup>G</sup>.

In terms of sketch constraints, we can describe the crucial effect of the rule application as follows: H satisfies the constraint ( *St*2, *τ*∗) in addition to the constraint ( *St*1, *τ*; *ϕ*∗) inherited from G.

**Example 52** (Repairing Stm*CT*-sketches)**.** *As discussed in Example 51, there is one violation of the general constraints* (*guc*, !*G*) uniqueness of composition *by the* Stm*CT-sketch* G = (*G*, *St*G) *in Example 49 and one violation of* (*ct*3, !*G*) decomposition of monomorphisms*. Repairing these two violations by pushout constructions, as described above, will result in a* Stm*CT-sketch* H *like the one visualized below.*

G *also does not satisfy the general constraint* (*gec*, !*G*) definedness of composition *and the general constraint* existence of identities *that has not been formalized in Example 51. We do not want to require that any* Stm*CT-sketch satisfies these two general constraints since we do not intend to use* Stm*CT-sketches just as encodings of categories but rather as (hopefully finite) representations of (possibly infinite) categories. This is the original purpose of sketches in category theory. See also the later discussion in Remark 40.*
