This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

\EventEditors

Serge Haddad and Daniele Varacca \EventNoEds2 \EventLongTitle32nd International Conference on Concurrency Theory (CONCUR 2021) \EventShortTitleCONCUR 2021 \EventAcronymCONCUR \EventYear2021 \EventDateAugust 23–27, 2021 \EventLocationVirtual Conference \EventLogo \SeriesVolume203 \ArticleNo32 stix@largesymbols"0E stix@largesymbols"0F Radboud University, Nijmegen, The Netherlands [email protected]://orcid.org/0000-0001-8993-6486Work forms part of the NWO TOP project 612.001.852 and the DFG-funded project COAX (MI 717/5-2) Friedrich-Alexander-Universität Erlangen-Nürnberg, [email protected]://orcid.org/0000-0002-2021-1644 Work forms part of the DFG-funded project CoMoC (MI 717/7-1) Friedrich-Alexander-Universität Erlangen-Nürnberg, [email protected]://orcid.org/0000-0002-3146-5906Work forms part of the DFG-funded project CoMoC (SCHR 1118/15-1) \CopyrightT. Wißmann, S. Milius, and L. Schröder \relatedversion \relatedversiondetailsFull Version with Appendixhttps://arxiv.org/abs/2105.00669 {CCSXML} <ccs2012> <concept> <concept_id>10003752.10003790</concept_id> <concept_desc>Theory of computation Logic</concept_desc> <concept_significance>500</concept_significance> </concept> </ccs2012> \ccsdesc[500]Theory of computation Logic {CCSXML} <ccs2012> <concept> <concept_id>10003752.10010124.10010138.10010143</concept_id> <concept_desc>Theory of computation Program analysis</concept_desc> <concept_significance>500</concept_significance> </concept> </ccs2012> \ccsdesc[500]Theory of computation Program analysis

Explaining Behavioural Inequivalence Generically
in Quasilinear Time

Thorsten Wißmann    Stefan Milius    Lutz Schröder
Abstract

We provide a generic algorithm for constructing formulae that distinguish behaviourally inequivalent states in systems of various transition types such as nondeterministic, probabilistic or weighted; genericity over the transition type is achieved by working with coalgebras for a set functor in the paradigm of universal coalgebra. For every behavioural equivalence class in a given system, we construct a formula which holds precisely at the states in that class. The algorithm instantiates to deterministic finite automata, transition systems, labelled Markov chains, and systems of many other types. The ambient logic is a modal logic featuring modalities that are generically extracted from the functor; these modalities can be systematically translated into custom sets of modalities in a postprocessing step. The new algorithm builds on an existing coalgebraic partition refinement algorithm. It runs in time 𝒪((m+n)logn)\mathcal{O}((m+n)\log n) on systems with nn states and mm transitions, and the same asymptotic bound applies to the dag size of the formulae it constructs. This improves the bounds on run time and formula size compared to previous algorithms even for previously known specific instances, viz. transition systems and Markov chains; in particular, the best previous bound for transition systems was 𝒪(mn)\mathcal{O}(mn).

keywords:
bisimulation, partition refinement, modal logic, distinguishing formulae, coalgebra

1 Introduction

For finite transition systems, the Hennessy-Milner theorem guarantees that two states are bisimilar if and only if they satisfy the same modal formulae. This implies that whenever two states are not bisimilar, then one can find a modal formula that holds at one of the states but not at the other. Such a formula explains the difference of the two states’ behaviour and is thus usually called a distinguishing formula [13]. For example, in the transition system in Figure 2, the formula \Box\Diamond\top distinguishes the states xx and yy because xx satisfies \Box\Diamond\top whereas yy does not. Given two states in a finite transition system with nn states and mm transitions, the algorithm by Cleaveland [13] computes a distinguishing formula in time 𝒪(mn)\mathcal{O}(mn). The algorithm builds on the Kanellakis-Smolka partition refinement algorithm [28, 29], which computes the bisimilarity relation on a transition system within the same time bound.

\bulletxx\bullet\bulletyy\bullet
Figure 1: Example of a transition system
\bulletyy\bulletxx\bullet\bullet10.510.5
Figure 2: Example of a Markov chain

Similar logical characterizations of bisimulation exist for other system types. For instance, Desharnais et al. [16, 17] characterize probabilistic bisimulation on (labelled) Markov chains, in the sense of Larsen and Skou [33] (for each label, every state has either no successors or a probability distribution on successors). In their logic, a formula pϕ\Diamond_{\geq p}\phi holds at states that have a transition probability of at least pp to states satisfying ϕ\phi. For example, the state xx in Figure 2 satisfies 0.51\Diamond_{\geq 0.5}\Diamond_{\geq 1}\top but yy does not. Desharnais et al. provide an algorithm that computes distinguishing formulae for labelled Markov chains in run time (roughly) 𝒪(n4)\mathcal{O}(n^{4}).

In the present work, we construct such counterexamples generically for a variety of system types. We achieve genericity over the system type by modelling state-based systems as coalgebras for a set functor in the framework of universal coalgebra [40]. Examples of coalgebras for a set functor include transition systems, deterministic automata, or weighted systems (e.g. Markov chains). Universal coalgebra provides a generic notion of behavioural equivalence that instantiates to standard notions for concrete system types, e.g. bisimilarity (transtion systems), language equivalence (deterministic automata), or probabilistic bisimilarity (Markov chains). Moreover, coalgebras come equipped with a generic notion of modal logic that is parametric in a choice of modalities whose semantics is constructed so as to guarantee invariance w.r.t. behavioural equivalence; under easily checked conditions, such a coalgebraic modal logic in fact characterizes behavioural equivalence in the same sense as Hennessy-Milner logic characterizes bisimilarity [39, 42]. Hence, as soon as suitable modal operators are found, coalgebraic modal formulae serve as distinguishing formulae.

In a nutshell, the contribution of the present paper is an algorithm that computes distinguishing formulae for behaviourally inequivalent states in quasilinear time, and in fact certificates that uniquely describe behavioural equivalence classes in a system, in coalgebraic generality. We build on an existing efficient coalgebraic partition refinement algorithm [46], thus achieving run time 𝒪(mlogn)\mathcal{O}(m\log n) on coalgebras with nn states and mm transitions (in a suitable encoding). The dag size of formulae is also 𝒪(mlogn)\mathcal{O}(m\log n) (for tree size, exponential lower bounds are known [22]); even for labelled transition systems, we thus improve the previous best bound 𝒪(mn)\mathcal{O}(mn) [13] for both run time and formula size. We systematically extract the requisite modalities from the functor at hand, requiring binary and nullary modalities in the general case, and then give a systematic method to translate these generic modal operators into more customary ones (such as the standard operators of Hennessy-Milner logic).

We subsequently identify a notion of cancellative functor that allows for additional optimization. E.g. functors modelling weighted systems are cancellative if and only if the weights come from a cancellative monoid, such as (,+)(\mathbb{Z},+), or (,+)(\mathbb{R},+) as used in probabilistic systems. For cancellative functors, much simpler distinguishing formulae can be constructed: the binary modalities can be replaced by unary ones, and only conjunction is needed in the propositional base. On labelled Markov chains, this complements the result that a logic with only conjunction and different unary modalities (mentioned above) suffices for the construction of distinguishing formulae (but not certificates) [17] (see also [19]).

Related Work

Cleaveland’s algorithm [13] for labelled transition systems is is based on Kanellakis and Smolka’s partition refinement algorithm [29]. The coalgebraic partition refinement algorithm we employ [46] is instead related to the more efficient Paige-Tarjan algorithm [36]. König et al. [32] extract formulae from winning strategies in a bisimulation game in coalgebraic generality; their algorithm runs in 𝒪(n4)\mathcal{O}(n^{4}) and does not support negative transition weights. Characteristic formulae for behavioural equivalence classes taken across all models require the use of fixpoint logics [21]. The mentioned algorithm by Desharnais et al. for distinguishing formulae on labelled Markov processes [17, Fig. 4] is based on Cleaveland’s. No complexity analysis is made but the algorithm has four nested loops, so its run time is roughly 𝒪(n4)\mathcal{O}(n^{4}). Bernardo and Miculan [10] provide a similar algorithm for a logic with only disjunction. There are further generalizations along other axes, e.g. to behavioural preorders [12]. The TwoTowers tool set for the analysis of stochastic process algebras [9, 8] computes distinguishing formulae for inequivalent processes, using variants of Cleaveland’s algorithm. Some approaches construct alternative forms of certificates for inequivalence, such as Cranen et al.’s notion of evidence [14] or methods employed on business process models, based on model differences and event structures [18, 6, 5].

2 Preliminaries

We first recall some basic notation. We denote by 0=0=\emptyset, 1={0}1=\{0\}, 2={0,1}2=\{0,1\} and 3={0,1,2}3=\{0,1,2\} the sets representing the natural numbers 0, 11, 22 and 33. For every set XX, there is a unique map !:X1!\colon X\to 1. We write YXY^{X} for the set of functions XYX\to Y, so e.g. X2X×XX^{2}\cong X\times X. In particular, 2X2^{X} is the set of 22-valued predicates on XX, which is in bijection with the powerset 𝒫X\mathcal{P}X of XX, i.e. the set of all subsets of XX; in this bijection, a subset A𝒫XA\in\mathcal{P}X corresponds to its characteristic function χA2X\chi_{A}\in 2^{X}, given by χA(x)=1\chi_{A}(x)=1 if xAx\in A, and χ(x)=0\chi(x)=0 otherwise. We generally indicate injective maps by \rightarrowtail. Given maps f:ZXf\colon Z\to X, g:ZYg\colon Z\to Y, we write f,g\langle f,g\rangle for the map ZX×YZ\to X\times Y given by f,g(z)=(f(z),g(z))\langle f,g\rangle(z)=(f(z),g(z)). We denote the disjoint union of sets XXYY by X+YX+Y, with canonical inclusion maps 𝗂𝗇1:XX+Y\mathsf{in}_{1}\colon X\rightarrowtail X+Y and 𝗂𝗇2:YX+Y\mathsf{in}_{2}\colon Y\rightarrowtail X+Y. More generally, we write iIXi\coprod_{i\in I}X_{i} for the disjoint union of an II-indexed family of sets (Xi)iI(X_{i})_{i\in I}, and 𝗂𝗇i:XiiIXi\mathsf{in}_{i}\colon X_{i}\rightarrowtail\coprod_{i\in I}X_{i} for the ii-th inclusion map. For a map f:XYf\colon X\to Y (not necessarily surjective), we denote by ker(f)X×X\ker(f)\subseteq X\times X the kernel of ff, i.e. the equivalence relation

ker(f):={(x,x)X×Xf(x)=f(x)}.\ker(f):=\{(x,x^{\prime})\in X\times X\mid f(x)=f(x^{\prime})\}. (1)
Notation \thetheorem (Partitions).

Given an equivalence relation RR on XX, we write [x]R[x]_{R} for the equivalence class {xX(x,x)R}\{x^{\prime}\in X\mid(x,x^{\prime})\in R\} of xXx\in X. If RR is the kernel of a map ff, we simply write [x]f[x]_{f} in lieu of [x]ker(f)[x]_{\ker(f)}. The intersection RSR\cap S of equivalence relations is again an equivalence relation. The partition corresponding to RR is denoted by X/R={[x]RxX}X/R=\{[x]_{R}\mid x\in X\}. Note that []R:XX/R[-]_{R}\colon X\to X/R is a surjective map and that R=ker([]R)R=\ker([-]_{R}).

A signature is a set Σ\Sigma, whose elements are called operation symbols, equipped with a function a:Σa\colon\Sigma\to\mathbb{N} assigning to each operation symbol its arity. We write σ/nΣ\mathord{\raisebox{1.0pt}{$\sigma$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$n$}}}\in\Sigma for σΣ\sigma\in\Sigma with a(σ)=na(\sigma)=n. We will apply the same terminology and notation to collections of modal operators.

2.1 Coalgebra

Universal coalgebra [40] provides a generic framework for the modelling and analysis of state-based systems. Its key abstraction is to parametrize notions and results over the transition type of systems, encapsulated as an endofunctor on a given base category. Instances cover, for example, deterministic automata, labelled (weighted) transition systems, and Markov chains.

Definition \thetheorem.

A set functor F:𝖲𝖾𝗍𝖲𝖾𝗍F\colon\mathsf{Set}\to\mathsf{Set} assigns to every set XX a set FXFX and to every map f:XYf\colon X\to Y a map Ff:FXFYFf\colon FX\to FY such that identity maps and composition are preserved: F𝗂𝖽X=𝗂𝖽FXF\mathsf{id}_{X}=\mathsf{id}_{FX} and F(gf)=FgFfF(g\cdot f)=Fg\cdot Ff. An FF-coalgebra is a pair (C,c)(C,c) consisting of a set CC (the carrier) and a map c:CFCc\colon C\to FC (the structure). When FF is clear from the context, we simply speak of a coalgebra.

In a coalgebra c:CFCc\colon C\to FC, we understand the carrier set CC as consisting of states, and the structure cc as assigning to each state xCx\in C a structured collection of successor states, with the structure of collections determined by FF. In this way, the notion of coalgebra subsumes numerous types of state-based systems, as illustrated next.

Example \thetheorem.
  1. 1.

    The powerset functor 𝒫\mathcal{P} sends a set XX to its powerset 𝒫X\mathcal{P}X and a map f:XYf\colon X\to Y to the map 𝒫f=f[]:𝒫X𝒫Y\mathcal{P}f=f[-]\colon\mathcal{P}X\to\mathcal{P}Y taking direct images. A 𝒫\mathcal{P}-coalgebra c:C𝒫Cc\colon C\to\mathcal{P}C is precisely a transition system: It assigns to every state xCx\in C a set c(x)𝒫Cc(x)\in\mathcal{P}C of successor states, inducing a transition relation \to given by xyx\to y iff yc(x)y\in c(x). Similarly, coalgebras for the finite powerset functor 𝒫f{\mathcal{P}_{\textsf{f}}} (with 𝒫fX{\mathcal{P}_{\textsf{f}}}X being the set of finite subsets of XX) are finitely branching transition systems.

  2. 2.

    Coalgebras for the functor FX=2×XAFX=2\times X^{A}, where AA is a fixed input alphabet, are deterministic automata (without an explicit initial state). Indeed, a coalgebra structure c=f,t:C2×CAc=\langle f,t\rangle\colon C\to 2\times C^{A} consists of a finality predicate f:C2f\colon C\to 2 and a transition map C×ACC\times A\to C in curried form t:CCAt\colon C\to C^{A}.

  3. 3.

    Every signature Σ\Sigma defines a signature functor that maps a set XX to the set

    TΣX=σ/nΣXn,\textstyle T_{\Sigma}X=\coprod_{\mathord{\raisebox{1.0pt}{$\scriptstyle\sigma$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$\scriptstyle n$}}}\in\Sigma}X^{n},

    whose elements we may understand as flat Σ\Sigma-terms σ(x1,,xn)\sigma(x_{1},\ldots,x_{n}) with variables from XX. The action of TΣT_{\Sigma} on maps f:XYf\colon X\to Y is then given by (TΣf)(σ(x1,,xn))=σ(f(x1),,(T_{\Sigma}f)(\sigma(x_{1},\ldots,x_{n}))=\sigma(f(x_{1}),\ldots, f(xn))f(x_{n})). For simplicity, we write σ\sigma (instead of 𝗂𝗇σ\mathsf{in}_{\sigma}) for the coproduct injections, and Σ\Sigma in lieu of TΣT_{\Sigma} for the signature functor. States in Σ\Sigma-coalgebras describe possibly infinite Σ\Sigma-trees.

  4. 4.

    For a commutative monoid (M,+,0)(M,+,0), the monoid-valued functor M()M^{(-)} [25] is given by

    M(X):={μ:XMμ(x)=0 for all but finitely many xX}M^{(X)}:=\{\mu\colon X\to M\mid\text{$\mu(x)=0$ for all but finitely many $x\in X$}\} (2)

    on sets XX; for a map f:XYf\colon X\to Y, the map M(f):M(X)M(Y)M^{(f)}\colon M^{(X)}\to M^{(Y)} is defined by

    (M(f))(μ)(y)=xX,f(x)=yμ(x).(M^{(f)})(\mu)(y)=\textstyle\sum_{x\in X,f(x)=y}\mu(x).

    A coalgebra c:CM(C)c\colon C\to M^{(C)} is a finitely branching weighted transition system, where c(x)(x)Mc(x)(x^{\prime})\in M is the transition weight from xx to xx^{\prime}. For the Boolean monoid 𝔹=(2,,0){\mathbb{B}}=(2,\vee,0), we recover 𝒫f=𝔹(){\mathcal{P}_{\textsf{f}}}={\mathbb{B}}^{(-)}. Coalgebras for ()\mathbb{R}^{(-)}, with \mathbb{R} understood as the additive monoid of the reals, are \mathbb{R}-weighted transition systems. The functor

    𝒟X={μ0(X)xXμ(x)=1},\textstyle{\mathcal{D}}X=\{\mu\in\mathbb{R}_{\geq 0}^{(X)}\mid\sum_{x\in X}\mu(x)=1\},

    which assigns to a set XX the set of all finite probability distributions on XX (represented as finitely supported probability mass functions), is a subfunctor of ()\mathbb{R}^{(-)}.

  5. 5.

    Functors can be composed; for instance, given a set AA of labels, the composite of 𝒫\mathcal{P} and the functor A×()A\times(-) (whose action on sets maps a set XX to the set A×XA\times X) is the functor FX=𝒫(A×X)FX=\mathcal{P}(A\times X), whose coalgebras are AA-labelled transition systems. Coalgebras for (𝒟()+1)A({\mathcal{D}}(-)+1)^{A} have been termed probabilistic transition systems [33] or labelled Markov chains [17], and coalgebras for (𝒟(()+1)+1)A({\mathcal{D}}((-)+1)+1)^{A} are partial labelled Markov chains [17]. Coalgebras for SX=𝒫f(A×𝒟X)SX={\mathcal{P}_{\textsf{f}}}(A\times{\mathcal{D}}X) are variously known as simple Segala systems or Markov decision processes.

We have a canonical notion of behaviour on FF-coalgebras:

Definition \thetheorem.

An FF-coalgebra morphism h:(C,c)(D,d)h\colon(C,c)\to(D,d) is a map h:CDh\colon C\to D such that dh=Fhcd\cdot h=Fh\cdot c. States x,yx,y in an FF-coalgebra (C,c)(C,c) are behaviourally equivalent (xyx\sim y) if there exists a coalgebra morphism hh such that h(x)=h(y)h(x)=h(y).

C{C}FC{FC}D{D}FD{FD}c\scriptstyle{c}h\scriptstyle{h}Fh\scriptstyle{Fh}d\scriptstyle{d}

Thus, we effectively define the behaviour of a state as those of its properties that are preserved by coalgebra morphisms. The notion of behavioural equivalence subsumes standard branching-time equivalences:

Example \thetheorem.
  1. 1.

    For F{𝒫,𝒫f}F\in\{\mathcal{P},{\mathcal{P}_{\textsf{f}}}\}, behavioural equivalence on FF-coalgebras, i.e. on transition systems, is bisimilarity in the usual sense.

  2. 2.

    For deterministic automata as coalgebras for FX=2×XAFX=2\times X^{A}, two states are behaviourally equivalent iff they accept the same formal language.

  3. 3.

    For a signature functor Σ\Sigma, two states of a Σ\Sigma-coalgebra are behaviourally equivalent iff they describe the same Σ\Sigma-tree.

  4. 4.

    For labelled transition systems as coalgebras for FX=𝒫(A×X)FX=\mathcal{P}(A\times X), coalgebraic behavioural equivalence precisely captures Milner’s strong bisimilarity [1].

  5. 5.

    For weighted and probabilistic systems, coalgebraic behavioural equivalence instantiates to weighted and probabilistic bisimilarity, respectively [41, Cor. 4.7], [7, Thm. 4.2].

Remark \thetheorem.
  1. 1.

    The notion of behavioural equivalence extends straightforwardly to states in different coalgebras, as one can canonically define the disjoint union of coalgebras.

  2. 2.

    We may assume without loss of generality that a set functor FF preserves injective maps [43] (see also [2, 8.1.12–17]), that is, FfFf is injective whenever ff is.

2.2 Coalgebraic Logics

We briefly review basic concepts of coalgebraic modal logic [38, 42]. Coalgebraic modal logics are parametric in a functor FF determining the type of systems underlying the semantics, and additionally in a choice of modalities interpreted in terms of predicate liftings. For now, we use F=𝒫F=\mathcal{P} as a basic example, deferring further examples to section 5.

Syntax

The syntax of coalgebraic modal logic is parametrized over the choice of signature Λ\Lambda of modal operators (with assigned arities). Then, formulae ϕ\phi are generated by the grammar
ϕ1,,ϕn::=|¬ϕ1|ϕ1ϕ2|(ϕ1,,ϕn)(/nΛ).{\hskip 14.22636pt}\phi_{1},\ldots,\phi_{n}::=\top\leavevmode\nobreak\ |\leavevmode\nobreak\ \neg\phi_{1}\leavevmode\nobreak\ |\leavevmode\nobreak\ \phi_{1}\wedge\phi_{2}\leavevmode\nobreak\ |\leavevmode\nobreak\ \heartsuit(\phi_{1},\ldots,\phi_{n})\qquad(\mathord{\raisebox{1.0pt}{$\heartsuit$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$n$}}}\in\Lambda).

Example \thetheorem.

For F=𝒫F=\mathcal{P}, one often takes Λ={/1}\Lambda=\{\mathord{\raisebox{1.0pt}{$\Diamond$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$1$}}}\}; the induced syntax is that of (single-action) Hennessy-Milner logic. As usual, we write ϕ:¬¬ϕ\Box\phi:\equiv\neg\Diamond\neg\phi.

Semantics

We interpret formulae as sets of states in FF-coalgebras. This interpretation arises by assigning to each modal operator /nΛ\mathord{\raisebox{1.0pt}{$\heartsuit$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$n$}}}\in\Lambda an nn-ary predicate lifting \llbracket\heartsuit\rrbracket [38, 42], i.e. a family of maps X:(2X)n2FX\llbracket\heartsuit\rrbracket_{X}\colon(2^{X})^{n}\to 2^{FX}, one for every set XX, such that the naturality condition

Ff1[Y(P1,,Pn)]=X(f1[P1],,f1[Pn])Ff^{-1}\big{[}\llbracket\heartsuit\rrbracket_{Y}(P_{1},\ldots,P_{n})\big{]}=\llbracket\heartsuit\rrbracket_{X}(f^{-1}[P_{1}],\ldots,f^{-1}[P_{n}]) (3)

for all f:XYf\colon X\to Y and all P1,,Pn2XP_{1},\ldots,P_{n}\in 2^{X} (for categorically-minded readers, \llbracket\heartsuit\rrbracket is a natural transformation (2())n2F𝗈𝗉(2^{(-)})^{n}\to 2^{F^{\mathsf{op}}}); the idea being to lift given predicates on states to predicates on structured collections of states. Given these data, the extension of a formula ϕ\phi in an FF-coalgebra (C,c)(C,c) is a predicate ϕ(C,c)\llbracket\phi\rrbracket_{(C,c)}, or just ϕ\llbracket\phi\rrbracket, on CC, recursively defined by

(C,c)=Cϕψ(C,c)=ϕ(C,c)ψ(C,c)¬ϕ(C,c)=Cϕ(C,c)\displaystyle\llbracket\top\rrbracket_{(C,c)}=C\qquad\llbracket\phi\wedge\psi\rrbracket_{(C,c)}=\llbracket\phi\rrbracket_{(C,c)}\cap\llbracket\psi\rrbracket_{(C,c)}\qquad\llbracket\neg\phi\rrbracket_{(C,c)}=C\setminus\llbracket\phi\rrbracket_{(C,c)}
(ϕ1,,ϕn)(C,c)=c1[C(ϕ1(C,c),,ϕn(C,c))](/nΛ)\displaystyle\llbracket\heartsuit(\phi_{1},\ldots,\phi_{n})\rrbracket_{(C,c)}=c^{-1}\big{[}\llbracket\heartsuit\rrbracket_{C}\big{(}\llbracket\phi_{1}\rrbracket_{(C,c)},\ldots,\llbracket\phi_{n}\rrbracket_{(C,c)}\big{)}\big{]}\qquad\text{($\mathord{\raisebox{1.0pt}{$\heartsuit$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$n$}}}\in\Lambda$)}

(where we apply set operations to predicates with the evident meaning). We say that a state xCx\in C satisfies ϕ\phi if ϕ(x)=1\llbracket\phi\rrbracket(x)=1. Notice how the clause for modalities says that xx satisfies (ϕ1,,ϕn)\heartsuit(\phi_{1},\ldots,\phi_{n}) iff c(x)c(x) satisfies the predicate obtained by lifting the predicates ϕ1,,ϕn\llbracket\phi_{1}\rrbracket,\ldots,\llbracket\phi_{n}\rrbracket on CC to a predicate on FCFC according to \llbracket\heartsuit\rrbracket.

Example \thetheorem.

Over F=𝒫F=\mathcal{P}, we interpret \Diamond by the predicate lifting

X:2X2𝒫X,P{KXxK:xP}={KXKP},\llbracket\Diamond\rrbracket_{X}\colon 2^{X}\to 2^{\mathcal{P}X},\quad P\mapsto\leavevmode\nobreak\ \{K\subseteq X\mid\exists x\in K\colon x\in P\}=\{K\subseteq X\mid K\cap P\neq\emptyset\},

The arising notion of satisfaction over 𝒫\mathcal{P}-coalgebras (C,c)(C,c) is precisely the standard one: xϕ(C,c)x\in\llbracket\Diamond\phi\rrbracket_{(C,c)} iff yϕ(C,c)y\in\llbracket\phi\rrbracket_{(C,c)} for some transition xyx\to y.

The naturality condition (3) of predicate liftings guarantees invariance of the logic under coalgebra morphisms, and hence under behavioural equivalence:

Proposition 2.1 (Adequacy [38, 42]).

Behaviourally equivalent states satisfy the same formulae: xyx\sim y implies that for all formulae ϕ\phi, we have xϕx\in\llbracket\phi\rrbracket iff yϕy\in\llbracket\phi\rrbracket.

In our running example F=𝒫F=\mathcal{P}, this instantiates to the well-known fact that modal formulae are bisimulation-invariant, that is, bisimilar states in transition systems satisfy the same formulae of Hennessy-Milner logic.

3 Constructing Distinguishing Formulae

A proof method certifying behavioural equivalence of states x,yx,y in a coalgebra is immediate by definition: One simply needs to exhibit a coalgebra morphism hh such that h(x)=h(y)h(x)=h(y). In fact, for many system types, it suffices to relate xx and yy by a coalgebraic bisimulation in a suitable sense (e.g. [1, 40, 24, 34]), generalizing the Park-Milner bisimulation principle [35, 37]. It is less obvious how to certify behavioural inequivalence x≁yx\not\sim y, showing that such a morphism hh does not exist. By 2.1, one option is to exhibit a (coalgebraic) modal formula ϕ\phi that is satisfied by xx but not by yy. In the case of (image-finite) transition systems, such a formula is guaranteed to exist by the Hennessy-Milner theorem, which moreover is known to generalize to coalgebras [39, 42]. More generally, we consider separation of sets of states by formulae, following Cleaveland [13, Def. 2.4]:

Definition 1.

Let (C,c)(C,c) be an FF-coalgebra. A formula ϕ\phi distinguishes a set XCX\subseteq C from a set YCY\subseteq C if XϕX\subseteq\llbracket\phi\rrbracket and Yϕ=Y\cap\llbracket\phi\rrbracket=\emptyset. In case X={x}X=\{x\} and Y={y}Y=\{y\}, we just say that ϕ\phi distinguishes xx from yy. We say that ϕ\phi is a certificate of XX if ϕ\phi distinguishes XX from CXC\setminus X, that is if ϕ=X\llbracket\phi\rrbracket=X.

Note that ϕ\phi distinguishes XX from YY iff ¬ϕ\neg\phi distinguishes YY from XX. Certificates have also been referred to as descriptions [22]. If ϕ\phi is a certificate of a behavioural equivalence class [x][x]_{\sim}, then by definition ϕ\phi distinguishes xx from yy whenever x≁yx\not\sim y. To obtain distinguishing formulae for behaviourally inequivalent states in a coalgebra, it thus suffices to construct certificates for all behavioural equivalence classes, and our algorithm does just that. Of course, every certificate must be at least as large as a smallest distinguishing formula. However, already on transition systems, distinguishing formulae and certificates have the same asymptotic worst-case size (cf. section 6).

A natural approach to computing certificates for behavioural equivalence classes is to extend algorithms that compute these equivalence classes. In particular, partition refinement algorithms compute a sequence C/R0,C/R1,C/R_{0},C/R_{1},\ldots of consecutively finer partitions (i.e. Ri+1RiR_{i+1}\subseteq R_{i}) on the state space, where every block BC/RiB\in C/R_{i} is a union of behavioural equivalence classes, and the final partition is precisely C/C/\mathord{\sim}. Indeed, Cleaveland’s algorithm for computing certificates on labelled transition systems [13] correspondingly extends Kanellakis and Smolka’s partition refinement algorithm [28, 29], which runs in 𝒪(mn)\mathcal{O}(mn) on systems with n=|C|n=|C| states and mm transitions. Our generic algorithm will be based on a more efficient partition refinement algorithm.

3.1 Paige-Tarjan with Certificates

Before we turn to constructing certificates in coalgebraic generality, we informally recall and extend the Paige-Tarjan algorithm [36], which computes the partition modulo bisimilarity of a given transition system with nn states and mm transitions in time 𝒪((m+n)logn)\mathcal{O}((m+n)\log n). We fix a given finite transition system, viewed as a 𝒫\mathcal{P}-coalgebra c:C𝒫Cc\colon C\to\mathcal{P}C.

The algorithm computes two sequences (C/Pi)i(C/P_{i})_{i\in\mathbb{N}} and (C/Qi)i(C/Q_{i})_{i\in\mathbb{N}} of partitions of CC (with Qi,PiQ_{i},P_{i} equivalence relations), where only the most recent partition is held in memory and ii indexes the iterations of the main loop. Throughout the execution, C/PiC/P_{i} is finer than C/QiC/Q_{i} (that is, PiQiP_{i}\subseteq Q_{i} for all ii), and the algorithm terminates when Pi=QiP_{i}=Q_{i}. Intuitively, PiP_{i} is ‘one transition ahead’ of QiQ_{i}: if QiQ_{i} distinguishes states xx and yy, then PiP_{i} is based on distinguishing transitions to xx from transitions to yy.

Initially, C/Q0:={C}C/Q_{0}:=\{C\} consists of only one block and C/P0C/P_{0} of two blocks: the live states and the deadlocks (i.e. states with no outgoing transitions). If PiQiP_{i}\subsetneqq Q_{i}, then there is a block BC/QiB\in C/Q_{i} that is the union of at least two blocks in C/PiC/P_{i}. In such a situation, the algorithm chooses SBS\subseteq B in C/PiC/P_{i} to have at most half the size of BB and then splits the block BB into SS and BSB\setminus S in the partition C/QiC/Q_{i}:

C/Qi+1=(C/Qi{B}){S,BS}.C/Q_{i+1}=(C/Q_{i}\setminus\{B\})\leavevmode\nobreak\ \cup\leavevmode\nobreak\ \{S,B\setminus S\}.

This is correct because every state in SS is already known to be behaviourally inequivalent to every state in BSB\setminus S. By the definition of bisimilarity, this implies that every block TC/PiT\in C/P_{i} with some transition to BB may contain behaviourally inequivalent states as illustrated in Figure 3; that is, TT may need to be split into smaller blocks, as follows:

  1. (C1)

    states in TT with successors in SS but not in BSB\setminus S (e.g. x1x_{1} in Figure 3),

  2. (C2)

    states in TT with successors in SS and BSB\setminus S (e.g. x2x_{2}), and

  3. (C3)

    states in TT with successors BSB\setminus S but not in SS (e.g. x3x_{3}).

x1x_{1}x2x_{2}x3x_{3}y1y_{1}y2y_{2}y3y_{3}y4y_{4}\ldots\ldotsTTBBSSBSB\setminus S\ldots\ldots\ldots\ldotsC/P:C/P:C/Q:C/Q:CC𝒫C\mathcal{P}Cc\scriptstyle c
Figure 3: The refinement step as illustrated in [46, Figure 6].

The partition C/Pi+1C/P_{i+1} arises from C/PiC/P_{i} by splitting all such predecessor blocks TT of BB accordingly. If no such TT is properly split, then Pi+1=Qi+1P_{i+1}=Q_{i+1}, and the algorithm terminates. It is straightforward to construct certificates for the blocks arising during the execution:

  • The certificate for the only block CC/Q0C\in C/Q_{0} is \top, and the blocks for live states and deadlocks in C/P0C/P_{0} have certificates \Diamond\top and ¬\neg\Diamond\top, respectively.

  • In the refinement step, suppose that δ,β\delta,\beta are certificates of SC/PiS\in C/P_{i} and BC/QiB\in C/Q_{i}, respectively, where SBS\subsetneqq B. For every predecessor block TT of BB, the three blocks obtained by splitting TT are distinguished (see 1) as follows:

    (C1)¬(β¬δ)\neg\Diamond(\beta\wedge\neg\delta),   (C2)(δ)(β¬δ)\Diamond(\delta)\wedge\Diamond(\beta\wedge\neg\delta),   (C3)¬δ\neg\Diamond\delta. (4)

    Of course these formulae only distinguish the states in TT from each other (e.g. there may be states in other blocks with transitions to both SS and BB). Hence, given a certificate ϕ\phi of TT, one obtains certificates of the three resulting blocks in C/Pi+1C/P_{i+1} via conjunction: ϕ¬(β¬δ)\phi\wedge\neg\Diamond(\beta\wedge\neg\delta), etc.

Upon termination, every bisimilarity class [x][x]_{\sim} in the transition system is annotated with a certificate. A key step in the generic development will be to come up with a coalgebraic generalization of the formulae for (C1)(C3).

3.2 Generic Partition Refinement

The Paige-Tarjan algorithm has been adapted to other system types, e.g. weighted systems [44], and it has recently been generalized to coalgebras [46, 20]. A crucial step in this generalization is to rephrase the case distinction (C1)(C3) in terms of the functor 𝒫\mathcal{P}: Given a predecessor block TT in C/PiC/P_{i} for SBC/QiS\subsetneqq B\in C/Q_{i}, the three cases distinguish between the equivalence classes [x]𝒫χSBc[x]_{\mathcal{P}\chi_{S}^{B}\cdot c} for xTx\in T, where the map χSB:C3\chi_{S}^{B}\colon C\to 3 in the composite 𝒫χSBc:C𝒫3\mathcal{P}\chi_{S}^{B}\cdot c\colon C\to\mathcal{P}3 is defined by

χSB:C3χSB(x)={2if xS,1if xBS,0if xCB,for sets SBC.\chi_{S}^{B}\colon C\to 3\qquad\chi_{S}^{B}(x)=\begin{cases}2&\text{if $x\in S$},\\ 1&\text{if $x\in B\setminus S$},\\ 0&\text{if $x\in C\setminus B$},\end{cases}\qquad\text{for sets $S\subseteq B\subseteq C$}. (5)

Every case is a possible value of t:=𝒫χSB(c(x))𝒫3t:=\mathcal{P}\chi_{S}^{B}(c(x))\in\mathcal{P}3: (C1) 2t12\in t\not\mkern 1.0mu\ni 1, (C2) 2t12\in t\ni 1, and (C3) 2t12\notin t\ni 1. Since TT is a predecessor block of BB, the ‘fourth case’ 2t12\not\in t\not\mkern 1.0mu\ni 1 is not possible. There is a transition from xx to some state outside of BB iff 0t0\in t. However, because of the previous refinement steps performed by the algorithm, either all or no states states of TT have an edge to CBC\setminus B (a property called stability [36]), hence no distinction on 0t0\in t is necessary.

It is now easy to generalize from transition systems to coalgebras by simply replacing the functor 𝒫\mathcal{P} with FF in the refinement step. We recall the algorithm:

Algorithm 3.1 ([46, Alg. 4.9, (5.1)]).

Given a coalgebra c:CFCc\colon C\to FC, put

C/Q0:={C}andP0:=ker(C𝑐FCF!F1).C/Q_{0}:=\{C\}\qquad\text{and}\qquad P_{0}:=\ker(C\xrightarrow{c}{FC}\xrightarrow{F!}F1).

Starting at iteration i=0i=0, repeat the following while PiQiP_{i}\neq Q_{i}:

  1. (A1)

    Pick SC/PiS\in C/P_{i} and BC/QiB\in C/Q_{i} such that SBS\subsetneqq B and 2|S||B|2\cdot|S|\leq|B|

  2. (A2)

    C/Qi+1:=(C/Qi{B}){S,BS}C/Q_{i+1}:=(C/Q_{i}\setminus\{B\})\cup\{S,B\setminus S\}

  3. (A3)

    Pi+1:=Piker(CFCF3cFχSB)P_{i+1}:=P_{i}\cap\ker(\leavevmode\hbox to130.11pt{\vbox to15.73pt{\pgfpicture\makeatletter\hbox{\hskip 65.057pt\lower-8.65137pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{\offinterlineskip{}{}{{{}}{{}}{{}}}{{{}}}{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-65.057pt}{-7.07637pt}\pgfsys@invoke{ }\hbox{\vbox{\halign{\pgf@matrix@init@row\pgf@matrix@step@column{\pgf@matrix@startcell#\pgf@matrix@endcell}&#\pgf@matrix@padding&&\pgf@matrix@step@column{\pgf@matrix@startcell#\pgf@matrix@endcell}&#\pgf@matrix@padding\cr\hfil\hskip 8.23679pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-3.93124pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${C}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}}}&\hskip 8.23679pt\hfil&\hfil\hskip 41.83704pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-7.84097pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${FC}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}}}&\hskip 12.14651pt\hfil&\hfil\hskip 48.94162pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-6.40973pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${F3}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}&\hskip 10.71527pt\hfil\cr}}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}{{{{}}}{{}}{{}}{{}}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.39998pt}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{-48.38344pt}{-4.57637pt}\pgfsys@lineto{-19.49287pt}{-4.57637pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-19.2929pt}{-4.57637pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} {\pgfsys@beginscope\pgfsys@invoke{ }\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{ }\pgfsys@rect{-36.2528pt}{-7.08331pt}{5.02927pt}{5.01389pt}\pgfsys@fill\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-35.2528pt}{-6.08331pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{c}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.39998pt}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{5.60011pt}{-4.57637pt}\pgfsys@lineto{43.0265pt}{-4.57637pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{43.22649pt}{-4.57637pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} {\pgfsys@beginscope\pgfsys@invoke{ }\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{ }\pgfsys@rect{17.2449pt}{-8.65137pt}{14.53677pt}{8.15pt}\pgfsys@fill\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{18.2449pt}{-6.2847pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{F\chi_{S}^{B}}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{ {}{}{}}}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}})

This algorithm formalizes the intuitive steps from subsection 3.1. Again, two sequences of partitions P1P_{1}QiQ_{i} are constructed, and Pi=QiP_{i}=Q_{i} upon termination. Initially, Q0Q_{0} identifies all states and P0P_{0} distinguishes states by only their output behaviour; e.g. for F=𝒫F=\mathcal{P} and xCx\in C, the value 𝒫!(c(x))𝒫1\mathcal{P}!(c(x))\in\mathcal{P}1 is \emptyset if xx is a deadlock, and {1}\{1\} if xx is a live state, and for FX=2×XAFX=2\times X^{A}, the value F1(c(x))F1=2×1A2F1(c(x))\in F1=2\times 1^{A}\cong 2 indicates whether xx is a final or non-final state.

In the main loop, blocks SC/PiS\in C/P_{i} and BC/QiB\in C/Q_{i} witnessing PiQiP_{i}\subsetneqq Q_{i} are picked, and BB is split into SS and BSB\setminus S, like in the Paige-Tarjan algorithm. Note that step (A2) is equivalent to directly defining the equivalence relation Qi+1Q_{i+1} as

Qi+1:=QikerχSB.Q_{i+1}:=Q_{i}\cap\ker{\chi_{S}^{B}}.

A similar intersection of equivalence relations is performed in step (A3). The intersection splits every block TC/PiT\in C/P_{i} into smaller blocks such that x,xTx,x^{\prime}\in T end up in the same block iff FχSB(c(x))=FχSB(c(x))F\chi_{S}^{B}(c(x))=F\chi_{S}^{B}(c(x^{\prime})), i.e. TT is replaced by {[x]FχSB(c(x))xT}\{[x]_{F\chi_{S}^{B}(c(x))}\mid x\in T\}. Again, this corresponds to the distinction of the three cases (C1)(C3). For example, for FX=2×XAFX=2\times X^{A}, there are |F3|=23|A||F3|=2\cdot 3^{|A|} cases to be distinguished, and so every TC/PiT\in C/P_{i} is split into at most that many blocks.

The following property of FF is needed for correctness [46, Ex. 5.11].

Definition 2 ([46]).

A functor FF is zippable if map

F(A+!),F(!+B):F(A+B)F(A+1)×F(1+B)\langle F(A+!),F(!+B)\rangle\colon\leavevmode\nobreak\ F(A+B)\longrightarrow F(A+1)\times F(1+B)

is injective for all sets A,BA,B.

Intuitively, tF(A+B)t\in F(A+B) is a term in variables from AA and BB. If FF is zippable, then tt is uniquely determined by the two elements in F(A+1)F(A+1) and F(1+B)F(1+B) obtained by identifying all BB- and all AA-variables with 010\in 1, respectively. E.g. FX=X2FX=X^{2} is zippable: t=(𝗂𝗇1(a),𝗂𝗇2(b))(A+B)2t=(\mathsf{in}_{1}(a),\mathsf{in}_{2}(b))\in(A+B)^{2} is uniquely determined by (𝗂𝗇1(a),𝗂𝗇2(0))(A+1)2(\mathsf{in}_{1}(a),\mathsf{in}_{2}(0))\in(A+1)^{2} and (𝗂𝗇1(0),𝗂𝗇2(b))(1+B)2(\mathsf{in}_{1}(0),\mathsf{in}_{2}(b))\in(1+B)^{2}, and similarly for the three other cases of tt. In fact, all signature functors as well as 𝒫\mathcal{P} and all monoid-valued functors are zippable. Moreover, the class of zippable functors is closed under products, coproducts, and subfunctors but not under composition, e.g. 𝒫𝒫\mathcal{P}\mathcal{P} is not zippable [46].

Remark 3.

To apply the algorithm to coalgebras for composites FGFG of zippable functors, e.g. 𝒫(A×())\mathcal{P}(A\times(-)), there is a reduction [46, Section 8] that embeds every FGFG-coalgebra into a coalgebra for the zippable functor (F+G)(X):=FX+GX(F+G)(X):=FX+GX. This reduction preserves and reflects behavioural equivalence, but introduces an intermediate state for every transition.

Theorem 3.2 ([46, Thm 4.20, 5.20]).

On a finite coalgebra (C,c)(C,c) for a zippable functor, 3.1 terminates after i|C|i\leq|C| loop iterations, and the resulting partition identifies precisely the behaviourally equivalent states (Pi=P_{i}=\mathord{\sim}).

3.3 Generic Modal Operators

The extended Paige-Tarjan algorithm (subsection 3.1) constructs a distinguishing formula according to the three cases (C1)(C3). In the coalgebraic 3.1, these cases correspond to elements of F3F3, which determine in which block an element of a predecessor block TT ends up. Indeed, the elements of F3F3 will also serve as generic modalities in characteristic formulae for blocks of states, essentially by the known equivalence between nn-ary predicate liftings and (in this case, singleton) subsets of F(2n)F(2^{n}) [42] (termed tests by Klin [30]):

Definition 4.

The signature of F3F3-modalities for a functor FF is

Λ={t/2tF3};\Lambda=\{\mathord{\raisebox{1.0pt}{${\ulcorner t\urcorner}$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$2$}}}\mid t\in F3\};

that is, we write t{\ulcorner t\urcorner} for the syntactic representation of a binary modality for every tF3t\in F3. The interpretation of t{\ulcorner t\urcorner} for F3F3 is given by the predicate lifting

t:(2X)22FX,t(S,B)={tFXFχSBB(t)=t}.\llbracket{\ulcorner t\urcorner}\rrbracket\colon(2^{X})^{2}\to 2^{FX},\qquad\llbracket{\ulcorner t\urcorner}\rrbracket(S,B)=\{t^{\prime}\in FX\mid F\chi_{S\cap B}^{B}(t^{\prime})=t\}.

The intended use of t{\ulcorner t\urcorner} is as follows: Suppose a block BB is split into subblocks SBS\subseteq B and BSB\setminus S with certificates δ\delta and β\beta, respectively: δ=S\llbracket\delta\rrbracket=S and β=B\llbracket\beta\rrbracket=B. As in Figure 3, we then split every predecessor block TT of BB into smaller parts, each of which is uniquely characterized by the formula t(δ,β){\ulcorner t\urcorner}(\delta,\beta) for some tF3t\in F3.

Example 3.3.

For F=𝒫F=\mathcal{P}, {0,2}(δ,β){\ulcorner{\{0,2\}}\urcorner}(\delta,\beta) is equivalent to ¬β‘0’¬(β¬δ)‘1’(δβ)‘2’\smash{\overbrace{\Diamond\neg\beta}^{\text{\text{`0'}}}}\wedge\neg\smash{\overbrace{\Diamond(\beta\wedge\neg\delta)}^{\text{\text{`1'}}}}\wedge\smash{\overbrace{\Diamond(\delta\wedge\beta)}^{\text{\text{`2'}}}}.

Lemma 3.4.

Given an FF-coalgebra (C,c)(C,c), xCx\in C, and formulae δ\delta and β\beta such that δβC\llbracket\delta\rrbracket\subseteq\llbracket\beta\rrbracket\subseteq C, we have xt(δ,β)x\in\llbracket{\ulcorner t\urcorner}(\delta,\beta)\rrbracket if and only if Fχδβ(c(x))=tF\chi_{\llbracket\delta\rrbracket}^{\llbracket\beta\rrbracket}(c(x))=t.

In the initial partition C/P0C/P_{0} on a transition system (C,c)(C,c), we used the formulae \Diamond\top and ¬\neg\Diamond\top to distinguish live states and deadlocks. In general, we can similarly describe the initial partition using modalities induced by elements of F1F1:

Notation 3.5.

Define the injective map j1:13j_{1}\colon 1\rightarrowtail 3 by j1(0)=2j_{1}(0)=2. Then the injection Fj1:F1F3Fj_{1}\colon F1\rightarrowtail F3 provides a way to interpret elements tF1t\in F1 as nullary modalities t{\ulcorner t\urcorner}:

t:=Fj1(t)(,)for tF1.{\ulcorner t\urcorner}:={\ulcorner Fj_{1}(t)\urcorner}(\top,\top)\qquad\text{for $t\in F1$.}

(Alternatively, we could introduce t{\ulcorner t\urcorner} directly as a nullary modality.)

Lemma 3.6.

For xCx\in C, c:CFCc\colon C\to FC, and tF1t\in F1, we have xtx\in\llbracket{\ulcorner t\urcorner}\rrbracket if and only if F!(c(x))=tF!(c(x))=t.

3.4 Algorithmic Construction of Certificates

The F3F3-modalities introduced above (4) induce an instance of coalgebraic modal logic (subsection 2.2). We refer to coalgebraic modal formulae employing the F3F3-modalities as F3F3-modal formulae, and write \mathcal{M} for the set of F3F3-modal formulae. As in the extended Paige-Tarjan algorithm (subsection 3.1), we annotate every block arising during the execution of 3.1 with a certificate in the shape of an F3F3-modal formula. Annotating blocks with formulae means that we construct maps

βi:C/Qiandδi:C/Pifor i.\beta_{i}\colon C/Q_{i}\to\mathcal{M}\qquad\text{and}\qquad\delta_{i}\colon C/P_{i}\to\mathcal{M}\qquad\text{for $i\in\mathbb{N}$}.

As in 3.1, ii indexes the loop iterations. For blocks B,SB,S in the respective partition, βi(B)\beta_{i}(B), δi(S)\delta_{i}(S) denote corresponding certificates: we will have

BX/Qi:βi(B)=BandSX/Pi:δi(S)=S.\forall B\in X/Q_{i}\colon\llbracket\beta_{i}(B)\rrbracket=B\qquad\text{and}\qquad\forall S\in X/P_{i}\colon\llbracket\delta_{i}(S)\rrbracket=S. (6)

We construct βi(B)\beta_{i}(B) and δi(S)\delta_{i}(S) iteratively, using certificates for the blocks SBS\subsetneqq B at every iteration:

Algorithm 3.7.

We extend 3.1 by the following. Initially, put

β0({C}):=andδ0([x]P0):=F!(c(x))for every xC.\beta_{0}(\{C\}):=\top\qquad\text{and}\qquad\delta_{0}([x]_{P_{0}}):={\ulcorner F!(c(x))\urcorner}\quad\text{for every $x\in C$.}

In the ii-th iteration, extend steps (A2) and (A3) by the following assignments:

  1. (A’2)

    βi+1(D)={δi(S)if D=Sβi(B)¬δi(S)if D=BSβi(D)if DC/Qi\mathrlap{\beta_{i+1}(D)}\phantom{\delta_{i+1}([x]_{P_{i+1}})}=\begin{cases}\delta_{i}(S)&\text{if }D=S\\ \beta_{i}(B)\wedge\neg\delta_{i}(S)&\text{if }D=B\setminus S\\ \beta_{i}(D)&\text{if }D\in C/Q_{i}\\ \end{cases}

  2. (A’3)

    δi+1([x]Pi+1)={δi([x]Pi)if [x]Pi+1=[x]Piδi([x]Pi)FχSB(c(x))(δi(S),βi(B))otherwise.\delta_{i+1}([x]_{P_{i+1}})=\begin{cases}\delta_{i}([x]_{P_{i}})&\text{if }[x]_{P_{i+1}}=[x]_{P_{i}}\\ \delta_{i}([x]_{P_{i}})\wedge{\ulcorner F\chi_{S}^{B}(c(x))\urcorner}(\delta_{i}(S),\beta_{i}(B))&\text{otherwise.}\\ \end{cases}

Upon termination, return δi\delta_{i}.

Like in subsection 3.1, the only block of C/Q0C/Q_{0} has β0({C})=\beta_{0}(\{C\})=\top as a certificate. Since the partition C/P0C/P_{0} distinguishes by the ‘output’ (e.g. final vs. non-final states), the certificate of [x]P0[x]_{P_{0}} specifies what F!(c(x))F1F!(c(x))\in F1 is (3.6).

In the ii-th iteration of the main loop, we have certificates δi(S)\delta_{i}(S) and βi(B)\beta_{i}(B) for SBS\subsetneqq B in step (A1) satisfying (6) available from the previous iterations. In (A’2), the Boolean connectives describe how BB is split into SS and BSB\setminus S. In (A’3), new certificates are constructed for every predecessor block TC/PiT\in C/P_{i} that is refined. If TT does not change, then neither does its certificate. Otherwise, the block T=[x]PiT=[x]_{P_{i}} is split into the blocks [x]FχSB(c(x))[x]_{F\chi_{S}^{B}(c(x))} for xTx\in T in step (A3), which is reflected by the F3F3 modality FχSB(c(x)){\ulcorner F\chi_{S}^{B}(c(x))\urcorner} as per 3.4.

Remark 5.

In step (A’2), βi+1(D)\beta_{i+1}(D) can be simplified to be no larger than δi(S)\delta_{i}(S). To see this, note that for SBCS\subseteq B\subseteq C, SX/PiS\in X/P_{i}, and BX/QiB\in X/Q_{i}, every conjunct of βi(B)\beta_{i}(B) is also a conjunct of δi(S)\delta_{i}(S). In βi(B)¬δi(S)\beta_{i}(B)\wedge\neg\delta_{i}(S), one can hence remove all conjuncts of βi(B)\beta_{i}(B) from δi(S)\delta_{i}(S), obtaining a formula δ\delta^{\prime}, and then equivalently use βi(B)¬δ\beta_{i}(B)\wedge\neg\delta^{\prime} in the definition of βi+1(D)\beta_{i+1}(D).

Theorem 3.8.

For zippable FF, 3.7 is correct, i.e. (6) holds for all ii. Thus, upon termination δi\delta_{i} assigns certificates to each block of C/=C/PiC/\mathord{\sim}=C/P_{i}.

Corollary 3.9 (Hennessy-Milner).

For zippable FF, states x,yx,y in a finite FF-coalgebra are behaviourally equivalent iff they agree on all F3F3-modal formulae.

Remark 6.

A smaller formula distinguishing a state xx from a state yy can be extracted from the certificates in time 𝒪(|C|)\mathcal{O}(|C|). It is the leftmost conjunct that is different in the respective certificates of xx and yy. This is the subformula starting at the modal operator introduced in δi\delta_{i} for the least ii with (x,y)Pi(x,y)\notin P_{i}; hence, xx satisfies t(δ,β){\ulcorner t\urcorner}(\delta,\beta) but yy satisfies t(δ,β){\ulcorner t^{\prime}\urcorner}(\delta,\beta) for some ttt^{\prime}\neq t in F3F3.

3.5 Complexity Analysis

The operations introduced by 3.7 can be implemented with only constant run time overhead. To this end, one implements β\beta and δ\delta as arrays of formulae of length |C||C| (note that at any point, there are at most |C||C|-many blocks). In the refinable-partition data structure [45], every block has an index (a natural number) and there is an array of length |C||C| mapping every state xCx\in C to the block it is contained in. Hence, for both partitions C/PC/P and C/QC/Q, one can look up a state’s block and a block’s certificate in constant time.

It is very likely that the certificates contain a particular subformula multiple times and that certificates of different blocks share common subformulae. For example, every certificate of a block refined in the ii-th iteration using SBS\subsetneqq B contains the subformulas δi(S)\delta_{i}(S) and βi(B)\beta_{i}(B). Therefore, it is advantageous to represent all certificates constructed as one directed acyclic graph (dag) with nodes labelled by modal operators and conjunction and having precisely two outgoing edges. Moreover, edges have a binary flag indicating whether they represent negation ¬\neg. Initially, there is only one node representing \top, and the operations of 3.7 allocate new nodes and update the arrays for β\beta and δ\delta to point to the right nodes. For example, if the predecessor block TC/PiT\in C/P_{i} is refined in step (A’3), yielding a new block [x]Pi+1[x]_{P_{i+1}}, then a new node labelled \wedge is allocated with edges to the nodes δi(T)\delta_{i}(T) and to another new node labelled FχSB(c(x))F\chi_{S}^{B}(c(x)) with edges to the nodes δi(S)\delta_{i}(S) and δi(B)\delta_{i}(B).

For purposes of estimating the size of formulae generated by the algorithm, we use a notion of transition in coalgebras, inspired by the notion of canonical graph [26].

Definition 3.10.

For states x,yx,y in an FF-coalgebra (C,c)(C,c), we say that there is a transition xyx\to y if c(x)FCc(x)\in FC is not in the image Fi[F(C{y})](FC)Fi[F(C\setminus\{y\})]\leavevmode\nobreak\ (\subseteq FC), where i:C{y}Ci\colon C\setminus\{y\}\rightarrowtail C is the inclusion map.

Theorem 3.11.

For a coalgebra with nn states and mm transitions, the formula dag constructed by 3.7 has size 𝒪(mlogn+n)\mathcal{O}(m\cdot\log n+n) and height at most n+1{n+1}.

Theorem 3.12.

3.7 adds only constant run time overhead, thus it has the same run time as 3.1 (regardless of the optimization from 5).

For a tighter run time analysis of the underlying partition refinement algorithm, one additionally requires that FF is equipped with a refinement interface [46, Def. 6.4], which is based on a given encoding of FF-coalgebras in terms of edges between states (encodings serve only as data structures and have no direct semantic meaning, in particular do not entail a semantic reduction to relational structures). This notion of edge yields the same numbers (in 𝒪\mathcal{O}-notation) as 3.10 for all functors considered. All zippable functors we consider here have refinement interfaces [46, 15]. In presence of a refinement interface, step (A3) can be implemented efficiently, with resulting overall run time 𝒪((m+n)lognp(c))\mathcal{O}((m+n)\cdot\log n\cdot p(c)) where n=|C|n=|C|, mm is the number of edges in the encoding of the input coalgebra (C,c)(C,c), and the run-time factor p(c)p(c) is associated with the refinement interface. In most instances, e.g. for 𝒫\mathcal{P}, ()\mathbb{R}^{(-)}, one has p(c)=1p(c)=1; in particular, the generic algorithm recovers the run time of the Paige-Tarjan algorithm.

Remark 7.

The claimed run time relies on close attention to a number of implementation details. This includes use of an efficient data structure for the partition C/PiC/P_{i} [31, 45]; the other partition C/QiC/Q_{i} is only represented implicitly in terms of a queue of blocks SBS\subsetneqq B witnessing PiQiP_{i}\subsetneqq Q_{i}, requiring additional care when splitting blocks in the queue [44, Fig. 3]. Moreover, grouping the elements of a block by F3F3 involves the consideration of a possible majority candidate [44].

Theorem 3.13.

On a coalgebra with nn states and mm transitions for a zippable set functor with a refinement interface with factor p(c)p(c), 3.7 runs in time 𝒪((m+n)lognp(c))\mathcal{O}((m+n)\cdot\log n\cdot p(c)).

4 Cancellative Functors

Our use of binary modalities relates to the fact that, as observed already by Paige and Tarjan, when splitting a block according to an existing partition of a block BB into SBS\subseteq B and BSB\setminus S, it is not in general sufficient to look only at the successors in SS. However, this does suffice for some transition types; e.g. Hopcroft’s algorithm for deterministic automata [27] and Valmari and Franceschinis’ algorithm for weighted systems (e.g. Markov chains) [44] both split only with respect to SS. In the following, we exhibit a criterion on the level of functors that captures that splitting w.r.t. only SS is sufficient:

Definition 8.

A functor FF is cancellative if the map

Fχ{1,2},Fχ{2}:F3F2×F2\langle F\chi_{{\{1,2\}}},F\chi_{{\{2\}}}\rangle\colon F3\to F2\times F2

is injective.

To understand the role of the above map, recall the function χSB:C3\chi_{S}^{B}\colon C\to 3 from (5) and note that χ{1,2}χSB=χB\chi_{{\{1,2\}}}\cdot\chi_{S}^{B}=\chi_{B} and χ{2}χSB=χS\chi_{{\{2\}}}\cdot\chi_{S}^{B}=\chi_{S}, so the composite Fχ{1,2},Fχ{2}FχSB\langle F\chi_{{\{1,2\}}},F\chi_{{\{2\}}}\rangle\cdot F\chi_{S}^{B} yields information about the accumulated transition weights into BB and SS but not about the one into BSB\setminus S; the injectivity condition means that for cancellative functors, this information suffices in the splitting step for SBCS\subseteq B\subseteq C. The term cancellative stems from the respective property on monoids; recall that a monoid MM is cancellative if s+b1=s+b2s+b_{1}=s+b_{2} implies b1=b2b_{1}=b_{2} for all s,b1,b2Ms,b_{1},b_{2}\in M.

Proposition 4.1.

The monoid-valued functor M()M^{(-)} for a commutative monoid MM is cancellative if and only if MM is a cancellative monoid.

Hence, ()\mathbb{R}^{(-)} is cancellative, but 𝒫f{\mathcal{P}_{\textsf{f}}} is not. Moreover, all signature functors are cancellative:

Proposition 4.2.

The class of cancellative functors contains the all constant functors as well as the identity functor, and it is closed under subfunctors, products, and coproducts.

For example, 𝒟{\mathcal{D}} is cancellative, but 𝒫\mathcal{P} is not because of its subfunctor 𝒫f{\mathcal{P}_{\textsf{f}}}.

Remark 9.

Cancellative functors are neither closed under quotients nor under composition. Zippability and cancellativity are independent properties. Zippability in conjunction with cancellativity implies mm-zippability for all mm\in\mathbb{N}, the mm-ary variant [32] of zippability.

Theorem 4.3.

If FF is a cancellative functor, FχSB(c(x))(δi(S),βi(B)){\ulcorner F\chi_{S}^{B}(c(x))\urcorner}(\delta_{i}(S),\beta_{i}(B)) in 3.7 can be replaced with FχSC(c(x))(δi(S),){\ulcorner F\chi_{S}^{C}(c(x))\urcorner}(\delta_{i}(S),\top). Then, the algorithm still correctly computes certificates in the given FF-coalgebra (C,c)(C,c).

Note that in this optimized algorithm, the computation of β\beta can be omitted because it is not used anymore. Hence, the resulting formulae only involve \wedge, \top, and modalities from the set F3F3 (with the second parameter fixed to \top). These modalities are equivalently unary modalities induced by elements of F2F2, which we term F2F2-modalities; hence, the corresponding Hennessy-Milner Theorem (3.9) adapts to F2F2 for cancellative functors, as follows:

Corollary 4.4.

For zippable and cancellative FF, states in an FF-coalgebra are behaviourally equivalent iff they agree on modal formulae built using \top, \wedge, and unary F2F2-modalities.

5 Domain-Specific Certificates

On a given specific system type, one is typically interested in certificates and distinguishing formulae expressed via modalities whose use is established in the respective domain, e.g. \Box and \Diamond for transition systems. We next describe how the generic F3F3 modalities can be rewritten to domain-specific ones in a postprocessing step. The domain-specific modalities will not in general be equivalent to F3F3-modalities, but still yield certificates.

Definition 10.

The Boolean closure Λ¯\bar{\Lambda} of a modal signature Λ\Lambda has as nn-ary modalities propositional combinations of atoms of the form (i1,,ik)\heartsuit(i_{1},\dots,i_{k}), for /kΛ\mathord{\raisebox{1.0pt}{$\heartsuit$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$k$}}}\in\Lambda, where i1,,iki_{1},\dots,i_{k} are propositional combinations of elements of {1,,n}\{1,\ldots,n\}. Such a modality λ/n\mathord{\raisebox{1.0pt}{$\lambda$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$n$}}} is interpreted by predicate liftings λX:(2X)nFX\llbracket\lambda\rrbracket_{X}\colon(2^{X})^{n}\to FX defined inductively in the obvious way.

For example, the boolean closure of Λ={/1}\Lambda=\{\mathord{\raisebox{1.0pt}{$\Diamond$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$1$}}}\} contains the unary modality =¬¬\Box=\neg\Diamond\neg.

Definition 11.

Given a modal signature Λ\Lambda for a functor FF, a domain-specific interpretation consists of functions τ:F1Λ¯\tau\colon F1\to\bar{\Lambda} and λ:F3Λ¯\lambda\colon F3\to\bar{\Lambda} assigning to each oF1o\in F1 a nullary modality τo\tau_{o} and to each tF3t\in F3 a binary modality λt\lambda_{t} such that the predicate liftings τoX2FX\llbracket\tau_{o}\rrbracket_{X}\in 2^{FX} and λtX:(2X)22FX\llbracket\lambda_{t}\rrbracket_{X}\colon(2^{X})^{2}\to 2^{FX} satisfy

τo1={o}(in 2F1) and [t]Fχ{1,2}λt3({2},{1})={t}(in 2F3).\llbracket\tau_{o}\rrbracket_{1}=\{o\}\quad\text{(in $2^{F1}$)}\quad\text{ and }\quad[t]_{F\chi_{\{1,2\}}}\cap\llbracket\lambda_{t}\rrbracket_{3}(\{2\},\{1\})=\{t\}\quad\text{(in $2^{F3}$)}.

(Recall that χ{1,2}:32\chi_{\{1,2\}}\colon 3\to 2 is the characteristic function of {1,2}3\{1,2\}\subseteq 3, and [t]Fχ{1,2}F3[t]_{F\chi_{\{1,2\}}}\subseteq F3 denotes the equivalence class of tt w.r.t. Fχ{1,2}:F3F2F\chi_{\{1,2\}}\colon F3\to F2.)

Thus, τo\tau_{o} holds precisely at states with output behaviour oF1o\in F1. Intuitively, λt(δ,ρ)\lambda_{t}(\delta,\rho) describes the refinement step of a predecessor block TT when splitting B:=δρB:=\llbracket\delta\rrbracket\cup\llbracket\rho\rrbracket into S:=δS:=\llbracket\delta\rrbracket and BS:=ρB\setminus S:=\llbracket\rho\rrbracket (Figure 3), which translates into the arguments {2}\{2\} and {1}\{1\} of λt3\llbracket\lambda_{t}\rrbracket_{3}. In the refinement step, we know from previous iterations that all elements have the same behaviour w.r.t. BB. This is reflected in the intersection with [t]Fχ{1,2}[t]_{F\chi_{{\{1,2\}}}}. The axiom guarantees that λt\lambda_{t} characterizes tF3t\in F3 uniquely, but only within the equivalence class representing a predecessor block. Thus, λt\lambda_{t} can be much smaller than equivalents of t{\ulcorner t\urcorner} (cf. 3.3):

Example 5.1.
  1. 1.

    For F=𝒫F=\mathcal{P}, we have a domain-specific interpretation over the modal signature Λ={/1}\Lambda={\{\Diamond/1\}}. For ,{0}𝒫1\emptyset,\{0\}\in\mathcal{P}1, take τ{0}=\tau_{{\{0\}}}=\Diamond\top and τ=¬\tau_{\emptyset}=\neg\Diamond\top. For t𝒫3t\in\mathcal{P}3, we put

    λt(δ,ρ)=¬ρif 2t1λt(δ,ρ)=δρif 2t1λt(δ,ρ)=¬δif 2t1λt(δ,ρ)=if 2t1.\begin{array}[]{rl@{~~~}l@{\qquad}rl@{~~~}l}\lambda_{t}(\delta,\rho)&=\neg\Diamond\rho\hfil\leavevmode\nobreak\ \leavevmode\nobreak\ \leavevmode\nobreak\ &\text{if }2\in t\not\mkern 1.0mu\ni 1&\lambda_{t}(\delta,\rho)&=\Diamond\delta\wedge\Diamond\rho\hfil\leavevmode\nobreak\ \leavevmode\nobreak\ \leavevmode\nobreak\ &\text{if }2\in t\ni 1\\ \lambda_{t}(\delta,\rho)&=\neg\Diamond\delta\hfil\leavevmode\nobreak\ \leavevmode\nobreak\ \leavevmode\nobreak\ &\text{if }2\notin t\ni 1&\lambda_{t}(\delta,\rho)&=\top\hfil\leavevmode\nobreak\ \leavevmode\nobreak\ \leavevmode\nobreak\ &\text{if }2\not\in t\not\mkern 1.0mu\ni 1.\end{array}

    The certificates obtained via this translation are precisely the ones generated in the example using the Paige-Tarjan algorithm, cf. (4), with ρ\rho in lieu of β¬δ\beta\wedge\neg\delta.

  2. 2.

    For a signature (functor) Σ\Sigma, take Λ={σ/0σ/nΣ}{=I/1I𝒫f()}\Lambda=\{\mathord{\raisebox{1.0pt}{$\sigma$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$0$}}}\mid\mathord{\raisebox{1.0pt}{$\sigma$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$n$}}}\in\Sigma\}\cup\{\mathord{\raisebox{1.0pt}{${\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}\raisebox{-1.0pt}{$\scriptstyle I$}$}}\rangle}$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$1$}}}\mid I\in{\mathcal{P}_{\textsf{f}}}(\mathbb{N})\}. We interpret Λ\Lambda by the predicate liftings

    σX\displaystyle\llbracket\sigma\rrbracket_{X} ={σ(x1,,xn)x1,,xnX}ΣX,\displaystyle=\{\sigma(x_{1},\ldots,x_{n})\mid x_{1},\ldots,x_{n}\in X\}\subseteq\Sigma X,
    =I(S)\displaystyle\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}\raisebox{-1.0pt}{$\scriptstyle I$}$}}\rangle}\rrbracket(S) ={σ(x1,,xn)ΣXi:iI(1inxiS)}.\displaystyle=\{\sigma(x_{1},\ldots,x_{n})\in\Sigma X\mid\forall i\in\mathbb{N}\colon i\in I\leftrightarrow(1\leq i\leq n\leavevmode\nobreak\ \wedge\leavevmode\nobreak\ x_{i}\in S)\}.

    Intuitively, =Iϕ{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}\raisebox{-1.0pt}{$\scriptstyle I$}$}}\rangle}\,\phi states that the iith successor satisfies ϕ\phi iff iIi\in I. We then have a domain-specific interpretation (τ,λ)(\tau,\lambda) given by τo:=σ\tau_{o}:=\sigma for o=σ(0,,0)Σ1o=\sigma(0,\ldots,0)\in\Sigma 1 and λt(δ,ρ):==Iδ\lambda_{t}(\delta,\rho):={\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}I$}}\rangle}\delta for t=σ(x1,,xn)Σ3t=\sigma(x_{1},\ldots,x_{n})\in\Sigma 3 and I={i{1,,n}xi=2}I=\{i\in\{1,\ldots,n\}\mid x_{i}=2\}.

  3. 3.

    For a monoid-valued functor M()M^{(-)}, take Λ={=m/1mM}\Lambda=\{\mathord{\raisebox{1.0pt}{${\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}m$}}\rangle}$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$1$}}}\mid m\in M\}, interpreted by the predicate liftings =mX:2X2M(X)\llbracket{{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}m$}}\rangle}}\rrbracket_{X}\colon 2^{X}\to 2^{M^{(X)}} given by

    =mX(S)={μM(X)m=xSμ(x)}.\llbracket{{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}m$}}\rangle}}\rrbracket_{X}(S)=\{\mu\in M^{(X)}\mid m=\textstyle\sum_{x\in S}\mu(x)\}.

    A formula =mδ{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}m$}}\rangle}\,\delta thus states that the accumulated weight of the successors satisfying δ\delta is exactly mm. A domain-specific interpretation (τ,λ)(\tau,\lambda) is then given by τo==o(0)\tau_{o}={\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}o(0)$}}\rangle}\,\top for oM(1)o\in M^{(1)} and λt(δ,ρ)==t(2)δ=t(1)ρ\lambda_{t}(\delta,\rho)={\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}t(2)$}}\rangle}\,\delta\wedge{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}t(1)$}}\rangle}\,\rho for tM(3)t\in M^{(3)}. In case MM is cancellative, we can also simply put λt(δ,ρ)==t(2)δ\lambda_{t}(\delta,\rho)={\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}t(2)$}}\rangle}\,\delta.

  4. 4.

    For labelled Markov chains, i.e. FX=(𝒟X+1)AFX=({\mathcal{D}}X+1)^{A}, let Λ={ap/1aA,p[0,1]}\Lambda=\{\mathord{\raisebox{1.0pt}{$\langle a\rangle_{p}$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$1$}}}\mid a\in A,p\in[0,1]\}, where apϕ\langle a\rangle_{p}\phi denotes that on input aa, the next state will satisfy ϕ\phi with probability at least pp, as in cited work by Desharnais et al. [17]. This gives rise to the interpretation:

    τo=aAo(a)𝒟1a1aAo(a)1¬a1λt(δ,ρ)=aAt(a)𝒟3(at(a)(2)δat(a)(1)ρ)\tau_{o}=\bigwedge_{\begin{subarray}{c}a\in A\\ o(a)\in{\mathcal{D}}1\end{subarray}}\langle a\rangle_{1}\top\wedge\bigwedge_{\begin{subarray}{c}a\in A\\ o(a)\in 1\end{subarray}}\neg\langle a\rangle_{1}\top\qquad\lambda_{t}(\delta,\rho)=\bigwedge_{\begin{subarray}{c}a\in A\\ t(a)\in{\mathcal{D}}3\end{subarray}}(\langle a\rangle_{t(a)(2)}\,\delta\wedge\langle a\rangle_{t(a)(1)}\,\rho)

Given a domain-specific interpretation (τ,λ)(\tau,\lambda) for a modal signature Λ\Lambda for the functor FF, we can postprocess certificates ϕ\phi produced by 3.7 by replacing the modalities t{\ulcorner t\urcorner} for tF3t\in F3 according to the translation TT recursively defined by the following clauses for modalities and by commutation with propositional operators:

T(t(,))=τF!(t)T(t(δ,β))=λt(T(δ),T(β)¬T(δ)).T\big{(}{\ulcorner t\urcorner}(\top,\top)\big{)}=\tau_{F!(t)}\qquad T\big{(}{\ulcorner t\urcorner}(\delta,\beta))=\lambda_{t}\big{(}T(\delta),T(\beta)\wedge\neg T(\delta)\big{)}.

Note that one can replace T(β)¬T(δ)T(\beta)\wedge\neg T(\delta) with T(β)¬T(δ)T(\beta)\wedge\neg T(\delta^{\prime}) for the optimized δ\delta^{\prime} from 5; the latter conjunction has essentially the same size as T(δ)T(\delta).

Proposition 5.2.

For every certificate ϕ\phi of a behavioural equivalence class of a given coalgebra produced by either 3.7 or its optimization (Theorem 4.3), T(ϕ)T(\phi) is also a certificate for that class.

Thus, the domain-specific modal signatures also inherit a Hennessy-Milner Theorem.

Example 5.3.

For labelled Markov chains (FX=(𝒟X+1)AFX=({\mathcal{D}}X+1)^{A}) and the interpretation via the modalities ap\langle a\rangle_{p} (5.1.4), this yields certificates (thus in particular distinguishing formulae) in run time 𝒪(|A|mlogn)\mathcal{O}(|A|\cdot m\cdot\log n), with the same bound on formula size. Desharnais et al. describe an algorithm [17, Fig. 4] that computes distinguishing formulae in the negation-free fragment of the same logic (they note also that this fragment does not suffice for certificates). They do not provide a run-time analysis, but the nested loop structure indicates that the asymptotic complexity is roughly |A|n4|A|\cdot n^{4}.

6 Worst Case Tree Size of Certificates

In the complexity analysis (subsection 3.5), we have seen that certificates – and thus also distinguishing formulae – have dag size 𝒪(mlogn+n)\mathcal{O}(m\cdot\log n+n) on input coalgebras with nn states and mm transitions. However, when formulae are written in the usual linear way, multiple occurrences of the same subformula lead to an exponential blow up of the formula size in this sense, which for emphasis we refer to as the tree size.

Figueira and Gorín [22] show that exponential tree size is inevitable even for distinguishing formulae. The proof is based on winning strategies in bisimulation games, a technique that is also applied in other results on lower bounds on formula size [23, 3, 4].

Open Problem 6.1.

Do states in ()\mathbb{R}^{(-)}-coalgebras generally have certificates of subexponential tree size in the number of states? If yes, can small certificates be computed efficiently?

We note that for another cancellative functor, the answer is well-known: On deterministic automata, i.e. coalgebras for FX=2×XAFX=2\times X^{A}, the standard minimization algorithm constructs distinguishing words of linear length.

Remark 12.

Cleaveland [13, p. 368] also mentions that minimal distinguishing formulae may be exponential in size, however for a slightly different notion of minimality: a formula ϕ\phi distinguishing xx from yy is minimal if no ϕ\phi obtained by replacing a non-trivial subformula of ϕ\phi with the formula \top distinguishes xx from yy. This is weaker than demanding that the formula size of ϕ\phi is as small as possible. For example, in the transition system

\bulletxx\bullet\bulletyy\bullet\bullet\cdotsnn

for nn\in\mathbb{N},

the formula ϕ=n+2\phi=\Diamond^{n+2}\top distinguishes xx from yy and is minimal in the above sense. However, xx can in fact be distinguished from yy in size 𝒪(1)\mathcal{O}(1), by the formula ¬\Diamond\neg\Diamond\top.

7 Conclusions and Further Work

We have presented a generic algorithm that computes distinguishing formulae for behaviourally inequivalent states in state-based systems of various types, cast as coalgebras for a functor capturing the system type. Our algorithm is based on coalgebraic partition refinement [46], and like that algorithm runs in time 𝒪((m+n)lognp(c))\mathcal{O}((m+n)\cdot\log n\cdot p(c)), with a functor-specific factor p(c)p(c) that is 11 in many cases of interest. Independently of this factor, the distinguishing formulae constructed by the algorithm have dag size 𝒪(mlogn+n)\mathcal{O}(m\cdot\log n+n); they live in a dedicated instance of coalgebraic modal logic [39, 42], with binary modalities extracted from the type functor in a systematic way. We have shown that for cancellative functors, the construction of formulae and, more importantly, the logic can be simplified, requiring only unary modalities and conjunction. We have also discussed how distinguishing formulae can be translated into a more familiar domain-specific syntax (e.g. Hennessy-Milner logic for transition systems).

There is an open source implementation of the underlying partition refinement algorithm [15], which may serve as a basis for a future implementation.

In partition refinement, blocks are successively refined in a top-down manner, and this is reflected by the use of conjunction in distinguishing formulae. Alternatively, bisimilarity may be computed bottom-up, as in a recent partition aggregation algorithm [11]. It is an interesting point for future investigation whether this algorithm can be extended to compute distinguishing formulae, which would likely be of a rather different shape than those computed via partition refinement.

References

  • [1] Peter Aczel and Nax Mendler. A final coalgebra theorem. In Proc. Category Theory and Computer Science (CTCS), volume 389 of LNCS, pages 357–365. Springer, 1989.
  • [2] Jiří Adámek, Stefan Milius, and Lawrence S. Moss. Initial algebras, terminal coalgebras, and the theory of fixed points of functors. draft book, available online at https://www8.cs.fau.de/ext/milius/publications/files/CoalgebraBook.pdf, 2021.
  • [3] Micah Adler and Neil Immerman. An n! lower bound on formula size. In LICS 2001, pages 197–206. IEEE Computer Society, 2001.
  • [4] Micah Adler and Neil Immerman. An n! lower bound on formula size. ACM Trans. Comput. Log., 4(3):296–314, 2003.
  • [5] Abel Armas-Cervantes, Paolo Baldan, Marlon Dumas, and Luciano García-Bañuelos. Behavioral comparison of process models based on canonically reduced event structures. In Business Process Management, pages 267–282. Springer, 2014.
  • [6] Abel Armas-Cervantes, Luciano García-Bañuelos, and Marlon Dumas. Event structures as a foundation for process model differencing, part 1: Acyclic processes. In Web Services and Formal Methods, pages 69–86. Springer, 2013.
  • [7] Falk Bartels, Ana Sokolova, and Erik de Vink. A hierarchy of probabilistic system types. Theoret. Comput. Sci., 327:3–22, 2004.
  • [8] Marco Bernardo. TwoTowers 5.1 user manual, 2004.
  • [9] Marco Bernardo, Rance Cleaveland, Steve Sims, and W. Stewart. TwoTowers: A tool integrating functional and performance analysis of concurrent systems. In Formal Description Techniques and Protocol Specification, Testing and Verification, FORTE / PSTV 1998, volume 135 of IFIP Conference Proceedings, pages 457–467. Kluwer, 1998.
  • [10] Marco Bernardo and Marino Miculan. Constructive logical characterizations of bisimilarity for reactive probabilistic systems. Theoretical Computer Science, 764:80 – 99, 2019. Selected papers of ICTCS 2016.
  • [11] Johanna Björklund and Loek Cleophas. Aggregation-based minimization of finite state automata. Acta Informatica, 2020.
  • [12] Ufuk Celikkan and Rance Cleaveland. Generating diagnostic information for behavioral preorders. Distributed Computing, 9(2):61–75, 1995.
  • [13] Rance Cleaveland. On automatically explaining bisimulation inequivalence. In Computer-Aided Verification, pages 364–372. Springer, 1991.
  • [14] Sjoerd Cranen, Bas Luttik, and Tim A. C. Willemse. Evidence for Fixpoint Logic. In 24th EACSL Annual Conference on Computer Science Logic (CSL 2015), volume 41 of LIPIcs, pages 78–93. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2015.
  • [15] Hans-Peter Deifel, Stefan Milius, Lutz Schröder, and Thorsten Wißmann. Generic partition refinement and weighted tree automata. In Formal Methods – The Next 30 Years, Proc. 3rd World Congress on Formal Methods (FM 2019), volume 11800 of LNCS, pages 280–297. Springer, 10 2019.
  • [16] J. Desharnais, A. Edalat, and P. Panangaden. A logical characterization of bisimulation for labeled markov processes. In Proceedings. Thirteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.98CB36226), pages 478–487, 1998.
  • [17] Josée Desharnais, Abbas Edalat, and Prakash Panangaden. Bisimulation for labelled markov processes. Information and Computation, 179(2):163–193, 2002.
  • [18] Remco Dijkman. Diagnosing differences between business process models. In Business Process Management, pages 261–277, Berlin, Heidelberg, 2008. Springer Berlin Heidelberg.
  • [19] Ernst-Erich Doberkat. Stochastic Coalgebraic Logic. Springer, 2009.
  • [20] Ulrich Dorsch, Stefan Milius, Lutz Schröder, and Thorsten Wißmann. Efficient coalgebraic partition refinement. In Proc. 28th International Conference on Concurrency Theory (CONCUR 2017), LIPIcs. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2017.
  • [21] Ulrich Dorsch, Stefan Milius, Lutz Schröder, and Thorsten Wißmann. Predicate liftings and functor presentations in coalgebraic expression languages. In Coalgebraic Methods in Computer Science, CMCS 2018, volume 11202 of LNCS, pages 56–77. Springer, 2018.
  • [22] Santiago Figueira and Daniel Gorín. On the size of shortest modal descriptions. In Advances in Modal Logic 8, papers from the eighth conference on "Advances in Modal Logic," held in Moscow, Russia, 24-27 August 2010, pages 120–139. College Publications, 2010.
  • [23] Tim French, Wiebe van der Hoek, Petar Iliev, and Barteld Kooi. On the succinctness of some modal logics. Artificial Intelligence, 197:56 – 85, 2013.
  • [24] Daniel Gorín and Lutz Schröder. Simulations and bisimulations for coalgebraic modal logics. In Algebra and Coalgebra in Computer Science - 5th International Conference, CALCO 2013, volume 8089 of LNCS, pages 253–266. Springer, 2013.
  • [25] H. Peter Gumm and Tobias Schröder. Monoid-labeled transition systems. In Coalgebraic Methods in Computer Science, CMCS 2001, volume 44(1) of ENTCS, pages 185–204. Elsevier, 2001.
  • [26] H.Peter Gumm. From TT-coalgebras to filter structures and transition systems. In Algebra and Coalgebra in Computer Science, volume 3629 of LNCS, pages 194–212. Springer, 2005.
  • [27] John Hopcroft. An nlognn\log n algorithm for minimizing states in a finite automaton. In Theory of Machines and Computations, pages 189–196. Academic Press, 1971.
  • [28] Paris C. Kanellakis and Scott A. Smolka. Ccs expressions, finite state processes, and three problems of equivalence. In Proceedings of the Second Annual ACM Symposium on Principles of Distributed Computing, PODC ’83, pages 228–240. ACM, 1983.
  • [29] Paris C. Kanellakis and Scott A. Smolka. CCS expressions, finite state processes, and three problems of equivalence. Inf. Comput., 86(1):43–68, 1990.
  • [30] Bartek Klin. The least fibred lifting and the expressivity of coalgebraic modal logic. In Algebra and Coalgebra in Computer Science, CALCO 2005, volume 3629 of LNCS, pages 247–262. Springer, 2005.
  • [31] Timo Knuutila. Re-describing an algorithm by Hopcroft. Theor. Comput. Sci., 250:333 – 363, 2001.
  • [32] Barbara König, Christina Mika-Michalski, and Lutz Schröder. Explaining non-bisimilarity in a coalgebraic approach: Games and distinguishing formulas. In Coalgebraic Methods in Computer Science, pages 133–154. Springer, 2020.
  • [33] Kim Guldstrand Larsen and Arne Arne Skou. Bisimulation through probabilistic testing. Inform. Comput., 94(1):1–28, 1991.
  • [34] Johannes Marti and Yde Venema. Lax extensions of coalgebra functors and their logic. J. Comput. Syst. Sci., 81(5):880–900, 2015.
  • [35] R. Milner. Communication and Concurrency. International series in computer science. Prentice-Hall, 1989.
  • [36] Robert Paige and Robert E. Tarjan. Three partition refinement algorithms. SIAM J. Comput., 16(6):973–989, 1987.
  • [37] D. Park. Concurrency and automata on infinite sequences. In Proceedings of 5th GI-Conference on Theoretical Computer Science, volume 104 of LNCS, pages 167–183, 1981.
  • [38] Dirk Pattinson. Coalgebraic modal logic: soundness, completeness and decidability of local consequence. Theoretical Computer Science, 309(1):177 – 193, 2003.
  • [39] Dirk Pattinson. Expressive logics for coalgebras via terminal sequence induction. Notre Dame J. Formal Log., 45(1):19–33, 2004.
  • [40] Jan Rutten. Universal coalgebra: a theory of systems. Theor. Comput. Sci., 249:3–80, 2000.
  • [41] Jan Rutten and Erik de Vink. Bisimulation for probabilistic transition systems: a coalgebraic approach. Theoret. Comput. Sci., 221:271–293, 1999.
  • [42] Lutz Schröder. Expressivity of coalgebraic modal logic: The limits and beyond. Theor. Comput. Sci., 390(2-3):230–247, 2008.
  • [43] Věra Trnková. On a descriptive classification of set functors I. Commentationes Mathematicae Universitatis Carolinae, 12(1):143–174, 1971.
  • [44] Antti Valmari and Giuliana Franceschinis. Simple 𝒪(mlogn)\mathcal{O}(m\log n) time Markov chain lumping. In Tools and Algorithms for the Construction and Analysis of Systems, TACAS 2010, volume 6015 of LNCS, pages 38–52. Springer, 2010.
  • [45] Antti Valmari and Petri Lehtinen. Efficient minimization of dfas with partial transition. In Theoretical Aspects of Computer Science, STACS 2008, volume 1 of LIPIcs, pages 645–656. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Germany, 2008.
  • [46] Thorsten Wißmann, Ulrich Dorsch, Stefan Milius, and Lutz Schröder. Efficient and Modular Coalgebraic Partition Refinement. Logical Methods in Computer Science, Volume 16, Issue 1, January 2020.

Appendix A Appendix: Omitted Proofs

Details for section 2 (Preliminaries)

Details for subsection 2.1.

Given a pair of FF-coalgebra (C,c)(C,c) and (D,d)(D,d), we have a canonical FF-coalgebra structure on the the disjoint union C+DC+D of their carriers:

C+Dc+dFC+FD[F𝗂𝗇1,F𝗂𝗇2]F(C+D).C+D\xrightarrow{c+d}FC+FD\xrightarrow{[F\mathsf{in}_{1},F\mathsf{in}_{2}]}F(C+D).

The canonical inclusion maps 𝗂𝗇1:CC+D\mathsf{in}_{1}\colon C\to C+D and 𝗂𝗇2:DC+D\mathsf{in}_{2}\colon D\to C+D are FF-coalgebra morphisms. We say that states xCx\in C and yDy\in D are behavioural equivalent if 𝗂𝗇1(x)𝗂𝗇2(y)\mathsf{in}_{1}(x)\sim\mathsf{in}_{2}(y).

Note that this definition extends the original definition of \sim, in the sense that x,yx,y in the same coalgebra (C,c)(C,c) are behaviourally equivalent (xyx\sim y) iff 𝗂𝗇1(x)𝗂𝗇2(y)\mathsf{in}_{1}(x)\sim\mathsf{in}_{2}(y) in the canonical coalgebra on C+CC+C.

Details on Predicate Liftings in subsection 2.2.

The naturality of X:(2X)n2FX\llbracket\heartsuit\rrbracket_{X}\colon(2^{X})^{n}\to 2^{FX} in XX for /n\mathord{\raisebox{1.0pt}{$\heartsuit$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$n$}}} means that for every map f:XYf\colon X\to Y, the diagram

(2Y)n{(2^{Y})^{n}}2FY{2^{FY}}(2X)n{(2^{X})^{n}}2FX{2^{FX}}Y\scriptstyle{\llbracket\heartsuit\rrbracket_{Y}}(2f)n\scriptstyle{(2^{f})^{n}}2Ff\scriptstyle{2^{Ff}}Y\scriptstyle{\llbracket\heartsuit\rrbracket_{Y}}

commutes. Since 2()2^{(-)} is contravariant, the map f:XYf\colon X\to Y is sent to 2f:2Y2X2^{f}\colon 2^{Y}\to 2^{X} which takes inverse images; writing down the commutativity element-wise yields (3). By the Yoneda lemma, one can define predicate liftings

Lemma A.1.

A predicate lifting X:(2X)n2FX\llbracket\heartsuit\rrbracket_{X}\colon(2^{X})^{n}\to 2^{FX} for /n\mathord{\raisebox{1.0pt}{$\heartsuit$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$n$}}} is uniquely defined by a map f:F(2n)2f\colon F(2^{n})\to 2. Then X\llbracket\heartsuit\rrbracket_{X} is given by

X(P1,,Pn)(tFX)=f(F(x(P1(x),,Pn(x))X2n)(t))\llbracket\heartsuit\rrbracket_{X}(P_{1},\ldots,P_{n})(\underbrace{t}_{\in\,FX})=f(F(\underbrace{x\mapsto(P_{1}(x),\ldots,P_{n}(x))}_{X\to 2^{n}})(t))

or written as sets (considering fF(2n),PiXf\subseteq F(2^{n}),P_{i}\subseteq X):

X(P1,,Pn)={tFXFχP1,,χPn(t)f}\llbracket\heartsuit\rrbracket_{X}(P_{1},\ldots,P_{n})=\{t\in FX\mid F\langle\chi_{P_{1}},\ldots,\chi_{P_{n}}\rangle(t)\in f\}
Proof A.2.

The following mathematical objects are in one-to-one correspondence

F(2n)2(2n)X2FX natural in X(2X)n2FX natural in Xfptf(Fp(t))(P1,,Pn)tf(FP1,,Pn(t))\dfrac{F(2^{n})\to 2}{\dfrac{(2^{n})^{X}\to 2^{FX}\text{ natural in $X$}}{(2^{X})^{n}\to 2^{FX}\text{ natural in $X$}}}\qquad\qquad\dfrac{f}{\dfrac{p\mapsto t\mapsto f(Fp(t))}{(P_{1},\ldots,P_{n})\mapsto t\mapsto f(F\langle P_{1},\ldots,P_{n}\rangle(t))}}

The first correspondence is the Yoneda lemma and the second correspondence is a power law. On the right, the inhabitants of the sets are listed when starting with f:F(2n)2f\colon F(2^{n})\to 2. By the definition of ,\langle-,-\rangle we have:

P1,,Pn:X2nx(P1(x),,Pn(x))\langle P_{1},\ldots,P_{n}\rangle\colon X\to 2^{n}\qquad x\mapsto(P_{1}(x),\ldots,P_{n}(x))

Details for section 3 (Constructing Distinguishing Formulae)

Verification of 4.

We verify that for every tF3t\in F3

tX:(2X)22FX,tX(S,B)={tFXFχSBB(t)=t}\llbracket{\ulcorner t\urcorner}\rrbracket_{X}\colon(2^{X})^{2}\to 2^{FX},\qquad\llbracket{\ulcorner t\urcorner}\rrbracket_{X}(S,B)=\{t^{\prime}\in FX\mid F\chi_{S\cap B}^{B}(t^{\prime})=t\}

defines a predicate lifting (3). For f:XYf\colon X\to Y and S,B2XS,B\in 2^{X}, note that we have

χSBBf=χf1[SB]f1[B]\chi_{S\cap B}^{B}\cdot f=\chi_{f^{-1}[S\cap B]}^{f^{-1}[B]}

because f(x)Xf(x)\in X^{\prime} iff xf1[X]x\in f^{-1}[X^{\prime}] for all xXx\in X and XXX^{\prime}\subseteq X. We verify:

Ff1[tY(S,B)]\displaystyle Ff^{-1}\big{[}\llbracket{\ulcorner t\urcorner}\rrbracket_{Y}(S,B)\big{]} =Ff1[{tFYFχSBB(t)=t}]\displaystyle=Ff^{-1}\big{[}{\{t^{\prime}\in FY\mid F\chi_{S\cap B}^{B}(t^{\prime})=t\}}\big{]} (4)
={t′′FXFχSBB(Ff(t′′))=t}]\displaystyle={\{t^{\prime\prime}\in FX\mid F\chi_{S\cap B}^{B}(Ff(t^{\prime\prime}))=t\}}\big{]} (def. inv. Image)
={t′′FXF(χSBBf)(t′′))=t}]\displaystyle={\{t^{\prime\prime}\in FX\mid F(\chi_{S\cap B}^{B}\cdot f)(t^{\prime\prime}))=t\}}\big{]} (Functoriality)
={t′′FXFχf1[SB]f1[B](t′′)=t}]\displaystyle={\{t^{\prime\prime}\in FX\mid F\chi_{f^{-1}[S\cap B]}^{f^{-1}[B]}(t^{\prime\prime})=t\}}\big{]} ()(*)
={t′′FXFχf1[S]f1[B]f1[B](t′′)=t}]\displaystyle={\{t^{\prime\prime}\in FX\mid F\chi_{f^{-1}[S]\cap f^{-1}[B]}^{f^{-1}[B]}(t^{\prime\prime})=t\}}\big{]}
=tX(f1[S],f1[B])\displaystyle=\llbracket{\ulcorner t\urcorner}\rrbracket_{X}(f^{-1}[S],f^{-1}[B]) (4)

Hence, t\llbracket{\ulcorner t\urcorner}\rrbracket is a predicate lifting.

Proof of 3.4.

This follows directly from 4 for S:=ϕSS:=\llbracket\phi_{S}\rrbracket and B:=ϕBB:=\llbracket\phi_{B}\rrbracket, using that SB=SS\cap B=S:

t(ϕS,ϕB)\displaystyle\llbracket{\ulcorner t\urcorner}(\phi_{S},\phi_{B})\rrbracket =c1[tC(ϕS,ϕB)]\displaystyle=c^{-1}[\llbracket{\ulcorner t\urcorner}\rrbracket_{C}(\llbracket\phi_{S}\rrbracket,\llbracket\phi_{B}\rrbracket)]
=c1[tC(S,B)]\displaystyle=c^{-1}[\llbracket{\ulcorner t\urcorner}\rrbracket_{C}(S,B)]
=c1[{tFCFχSBB(t)=t}]\displaystyle=c^{-1}[\{t^{\prime}\in FC\mid F\chi_{S\cap B}^{B}(t^{\prime})=t\}]
={xCFχSB(c(x))=t}.\displaystyle=\{x\in C\mid F\chi_{S}^{B}(c(x))=t\}.

Proof of 3.6.

Note that for χCC:C3\chi_{C}^{C}\colon C\to 3, we have χCC=(C!1j13)\chi_{C}^{C}=(C\xrightarrow{\leavevmode\nobreak\ !\leavevmode\nobreak\ }1\xrightarrow{\leavevmode\nobreak\ j_{1}\leavevmode\nobreak\ }3) where j1(0)=2j_{1}(0)=2.

t\displaystyle\llbracket{\ulcorner t\urcorner}\rrbracket =Fj1(t)(,)\displaystyle=\llbracket{\ulcorner Fj_{1}(t)\urcorner}(\top,\top)\rrbracket (3.5)
={xCFχCC(c(x))=Fj1(t)}\displaystyle=\{x\in C\mid F\chi_{C}^{C}(c(x))=Fj_{1}(t)\} (3.4, =C\llbracket\top\rrbracket=C)
={xCFj1(F!(c(x)))=Fj1(t)}\displaystyle=\{x\in C\mid Fj_{1}(F!(c(x)))=Fj_{1}(t)\} (χCC=j1!\chi_{C}^{C}=j_{1}\cdot!)
={xCF!(c(x))=t}\displaystyle=\{x\in C\mid F!(c(x))=t\} (Fj1Fj_{1} injective)

In the last step use that, w.l.o.g., FF preserves injective maps (subsection 2.1). ∎

Proof of Theorem 3.8.

  1. 1.

    We first observe that given xCx\in C, SBCS\subseteq B\subseteq C, and formulae ϕS\phi_{S} and ϕB\phi_{B} which characterize SS and BB, respectively, we have:

    FχSB(c(x))(ϕS,ϕB)\displaystyle\llbracket{\ulcorner F\chi_{S}^{B}(c(x))\urcorner}(\phi_{S},\phi_{B})\rrbracket ={xCFχϕSϕB(c(x))=FχSB(c(x))}\displaystyle=\{x^{\prime}\in C\mid F\chi_{\llbracket\phi_{S}\rrbracket}^{\llbracket\phi_{B}\rrbracket}(c(x^{\prime}))=F\chi_{S}^{B}(c(x))\} (7)
    =[x]FχSB(c(x)),\displaystyle=[x]_{F\chi_{S}^{B}(c(x))}, (8)

    where (7) uses 3.4 and (8), holds since ϕB=B\llbracket\phi_{B}\rrbracket=B and ϕS=S\llbracket\phi_{S}\rrbracket=S.

  2. 2.

    We proceed to the verification of (6) by induction on ii.

    • In the base case i=0i=0, we have β0({C})=={C}\llbracket\beta_{0}(\{C\})\rrbracket=\llbracket\top\rrbracket=\{C\} for the only block in X/Q0X/Q_{0}. Since P0=ker(F!c)P_{0}=\ker(F!\cdot c), δ0\delta_{0} is well-defined, and by 3.6 we have

      δ0([x]P0)=F!(c(x))={yCF!(c(x))=F!(c(y))}=[x]P0.\llbracket\delta_{0}([x]_{P_{0}})\rrbracket=\llbracket{\ulcorner F!(c(x))\urcorner}\rrbracket=\{y\in C\mid F!(c(x))=F!(c(y))\}=[x]_{P_{0}}.
    • The inductive hypothesis states that

      δi(S)=Sandβi(B)=B.\llbracket\delta_{i}(S)\rrbracket=S\qquad\text{and}\qquad\llbracket\beta_{i}(B)\rrbracket=B.

      We prove that βi+1\beta_{i+1} is correct:

      βi+1([x]Qi+1)\displaystyle\llbracket\beta_{i+1}([x]_{Q_{i+1}})\rrbracket
      ={δi(S)if [x]Qi+1=S, hence S=[x]Piβi(B)Cδi(S)if [x]Qi+1=BS, hence B=[x]Qiβi([x]Qi)if [x]Qi+1C/Qi\displaystyle=\begin{cases}\llbracket\delta_{i}(S)\rrbracket&\text{if }[x]_{Q_{i+1}}=S\text{, hence }S=[x]_{P_{i}}\\ \llbracket\beta_{i}(B)\rrbracket\leavevmode\nobreak\ \cap\leavevmode\nobreak\ C\setminus\llbracket\delta_{i}(S)\rrbracket&\text{if }[x]_{Q_{i+1}}=B\setminus S\text{, hence }B=[x]_{Q_{i}}\\ \llbracket\beta_{i}([x]_{Q_{i}})\rrbracket&\text{if }[x]_{Q_{i+1}}\in C/Q_{i}\\ \end{cases}
      =(IH){Sif [x]Qi+1=SBCSif [x]Qi+1=BS[x]Qiif [x]Qi+1C/Qi\displaystyle\overset{\mathclap{\text{(IH)}}}{=}\begin{cases}S&\text{if }[x]_{Q_{i+1}}=S\\ B\leavevmode\nobreak\ \cap\leavevmode\nobreak\ C\setminus S&\text{if }[x]_{Q_{i+1}}=B\setminus S\\ [x]_{Q_{i}}&\text{if }[x]_{Q_{i+1}}\in C/Q_{i}\\ \end{cases}
      ={[x]Qi+1if [x]Qi+1=S=[x]Pi[x]Qi+1if [x]Qi+1=BS(since BCS=BS)[x]Qi+1if [x]Qi+1C/Qi(since [x]Qi is not split)\displaystyle=\begin{cases}[x]_{Q_{i+1}}&\text{if }[x]_{Q_{i+1}}=S=[x]_{P_{i}}\\ [x]_{Q_{i+1}}&\text{if }[x]_{Q_{i+1}}=B\setminus S\qquad\text{(since $B\cap C\setminus S=B\setminus S$)}\\ [x]_{Q_{i+1}}&\text{if }[x]_{Q_{i+1}}\in C/Q_{i}\qquad\text{(since $[x]_{Q_{i}}$ is not split)}\\ \end{cases}
      =[x]Qi+1.\displaystyle=[x]_{Q_{i+1}}.

      For δi+1\delta_{i+1}, we compute as follows:

      δi+1([x]Pi+1)\displaystyle\llbracket\delta_{i+1}([x]_{P_{i+1}})\rrbracket
      ={δi([x]Pi)if [x]Pi+1=[x]Piδi([x]Pi)FχSB(c(x))(δi(S),βi(B))otherwise\displaystyle=\qquad\begin{cases}\llbracket\delta_{i}([x]_{P_{i}})\rrbracket&\text{if }[x]_{P_{i+1}}=[x]_{P_{i}}\\ \llbracket\delta_{i}([x]_{P_{i}})\rrbracket\cap\llbracket{\ulcorner F\chi_{S}^{B}(c(x))\urcorner}(\delta_{i}(S),\beta_{i}(B))\rrbracket&\text{otherwise}\end{cases}
      =(IH) & (8){[x]Piif [x]Pi+1=[x]Pi[x]Pi[x]FχSB(c(x))otherwise\displaystyle\overset{\mathclap{\text{(IH) \& \eqref{eqF3ModBS}}}}{=}\qquad\begin{cases}[x]_{P_{i}}&\text{if }[x]_{P_{i+1}}=[x]_{P_{i}}\\ [x]_{P_{i}}\cap[x]_{F\chi_{S}^{B}(c(x))}&\text{otherwise}\end{cases}
      =def. Pi+1{[x]Pi+1if [x]Pi+1=[x]Pi[x]Pi+1otherwise\displaystyle\overset{\mathclap{\text{def. }P_{i+1}}}{=}\qquad\begin{cases}[x]_{P_{i+1}}&\text{if }[x]_{P_{i+1}}=[x]_{P_{i}}\\ [x]_{P_{i+1}}&\text{otherwise}\end{cases}
      =[x]Pi+1\displaystyle=\quad[x]_{P_{i+1}}

Details for 6.

In order to verify that the first differing conjunct is a distinguishing formula, we perform a case distinction on the least ii with (x,y)Pi(x,y)\notin P_{i}:

If xx and yy are already split by P0P_{0}, then the conjunct at index 0 in the respective certificates of [x][x]_{\sim} and [y][y]_{\sim} differs, and we have t=F!(c(x))t=F!(c(x)) and t=F!(c(y))t^{\prime}=F!(c(y)). By 3.6, t{\ulcorner t\urcorner} distinguishes xx from yy (and t{\ulcorner t^{\prime}\urcorner} distinguishes yy from xx).

If xx and yy are split by Pi+1P_{i+1} (but (x,y)Pi(x,y)\in P_{i}) in the iith iteration, then

FχSB(c(x))t:=FχSB(c(y))t:=.\underbrace{F\chi_{S}^{B}(c(x))}_{t\leavevmode\nobreak\ :=}\neq\underbrace{F\chi_{S}^{B}(c(y))}_{t^{\prime}\leavevmode\nobreak\ :=}.

Thus, the conjuncts that differs in the respective certificates for [x][x]_{\sim} and [y][y]_{\sim} are the following conjuncts at index i+1i+1:

t(δi(S),βi(B))andt(δi(S),βi(B)).{\ulcorner t\urcorner}(\delta_{i}(S),\beta_{i}(B))\qquad\text{and}\qquad{\ulcorner t^{\prime}\urcorner}(\delta_{i}(S),\beta_{i}(B)).

By 3.4, t(δi(S),βi(B)){\ulcorner t\urcorner}(\delta_{i}(S),\beta_{i}(B)) distinguishes xx from yy (and t(δi(S),βi(B)){\ulcorner t\urcorner}(\delta_{i}(S),\beta_{i}(B)) distinguishes yy from xx).

Proof of Theorem 3.11.

Before proving Theorem 3.11, we need to establish a sequence of lemmas on the underlying partition refinement algorithm. We assume wlog that FF preserves finite intersections; that is pullbacks of pairs of injective maps. In fact, the functor GG mentioned in subsection 2.1, which coincides with FF on all nonempty sets and map and therefore has the same coalgebras, preserves finite intersections..

Let (C,c)(C,c) be a coalgebra for FF. As additional notation, we define for all sets TCT\subseteq C and SCS\subseteq C:

TS:xT,yS:xy.T\to S\qquad:\Longleftrightarrow\qquad\exists x\in T,y\in S\colon x\to y.

In other words, we write TST\to S if there is a transition from (some state of) TT to (some state of) SS. Also we define the set of predecessor states of a set as:

𝗉𝗋𝖾𝖽(S)={xC{x}S}for SC.\mathsf{pred}(S)=\{x\in C\mid\{x\}\to S\}\qquad\text{for }S\subseteq C.
Lemma A.3.

For every FF-coalgebra (C,c)(C,c), xCx\in C, and SBCS\subseteq B\subseteq C with SS finite, we have

{x}↛SFχSB(c(x))=FχB(c(x)).\{x\}\not\to S\qquad\Longrightarrow\qquad F\chi_{S}^{B}(c(x))=F\chi_{\emptyset}^{B}(c(x)).
Proof A.4.

For every ySy\in S, we have that x↛yx\not\to y. Hence, for every ySy\in S, there exists tyF(C{y})t_{y}\in F(C\setminus\{y\}) such that

c(x)=Fi(ty)for i:C{y}C.c(x)=Fi(t_{y})\qquad\text{for }i\colon C\setminus\{y\}\rightarrowtail C.

The set CSC\setminus S is the intersection of all sets C{y}C\setminus\{y\} with ySy\in S:

CS=yS(C{y}).C\setminus S=\bigcap_{y\in S}(C\setminus\{y\}).

Since FF preserves finite intersections and SS is finite, we have that

F(CS)=ySF(C{y}).F(C\setminus S)=\bigcap_{y\in S}F(C\setminus\{y\}).

Since c(x)FCc(x)\in FC is contained in every F(C{y})F(C\setminus\{y\}) (as witnessed by tyt_{y}) it is also contained in their intersection. That is, for m:CSCm\colon C\setminus S\rightarrowtail C being the inclusion map, there is tF(CS)t^{\prime}\in F(C\setminus S) with Fm(t)=c(x)Fm(t^{\prime})=c(x). Now consider the following diagrams:

c(x){c(x)}FC{FC}F3{F3}t{t^{\prime}}F(CS){F(C\setminus S)} \in FχSB\scriptstyle{F\chi_{S}^{B}} \in Fm\scriptstyle{Fm}FχB\scriptstyle{F\chi_{\emptyset}^{B}}      and      FC{FC}F3{F3}F(CS){F(C\setminus S)}FχB\scriptstyle{F\chi_{\emptyset}^{B}}Fm\scriptstyle{Fm}FχB\scriptstyle{F\chi_{\emptyset}^{B}}

Both triangles commute because χB=χSBm\chi_{\emptyset}^{B}=\chi_{S}^{B}\cdot m and χB=χBm\chi_{\emptyset}^{B}=\chi_{\emptyset}^{B}\cdot m. Thus, we conclude

FχSB(c(x))=FχSB(Fm(t))=FχB(t)=FχB(Fm(t))=FχB(c(x)).F\chi_{S}^{B}(c(x))=F\chi_{S}^{B}(Fm(t^{\prime}))=F\chi_{\emptyset}^{B}(t^{\prime})=F\chi_{\emptyset}^{B}(Fm(t^{\prime}))=F\chi_{\emptyset}^{B}(c(x)).
Lemma A.5.

For all (x,x)Pi(x,x^{\prime})\in P_{i} and BC/QiB\in C/Q_{i} in 3.1, we have

FχB(c(x))=FχB(c(x)).F\chi_{\emptyset}^{B}(c(x))=F\chi_{\emptyset}^{B}(c(x^{\prime})).
Proof A.6.

One can show[46, Prop. 4.12] that in every iteration there is a map ci:C/PiF(C/Qi)c_{i}\colon C/P_{i}\to F(C/Q_{i}) that satisfies F[]Qic=ci[]PiF[-]_{Q_{i}}\cdot c=c_{i}\cdot[-]_{P_{i}}:

C{C}FC{FC}C/Pi{C/P_{i}}F(C/Qi){F(C/Q_{i})}c\scriptstyle{c}[]Pi\scriptstyle{[-]_{P_{i}}}F[]Qi\scriptstyle{F[-]_{Q_{i}}}ci\scriptstyle{c_{i}}

where the maps []Pi,[]Qi[-]_{P_{i}},[-]_{Q_{i}} send elements of CC to their equivalence class (section 2). The map χB:C3\chi_{\emptyset}^{B}\colon C\to 3 for BC/QiB\in C/Q_{i} can be decomposes as:

C{C}3{3}C/Qi{C/Q_{i}}[]Qi\scriptstyle{[-]_{Q_{i}}}χB\scriptstyle{\chi_{\emptyset}^{B}}χ{B}\scriptstyle{\chi_{\emptyset}^{\{B\}}}

Combining these two diagrams, we obtain:

FχBc=Fχ{B}F[]Qic=Fχ{B}ci[]Pi.F\chi_{\emptyset}^{B}\cdot c=F\chi_{\emptyset}^{\{B\}}\cdot F[-]_{Q_{i}}\cdot c=F\chi_{\emptyset}^{\{B\}}\cdot c_{i}\cdot[-]_{P_{i}}. (9)

For all (x,x)Pi(x,x^{\prime})\in P_{i}, we have [x]Pi=[x]Pi[x]_{P_{i}}=[x^{\prime}]_{P_{i}}, and thus we have

FχB(c(x))=(9)Fχ{B}(ci([x]Pi))=Fχ{B}(ci([x]Pi))=(9)FχB(c(x)).F\chi_{\emptyset}^{B}(c(x))\overset{\eqref{eqChiEq}}{=}F\chi_{\emptyset}^{\{B\}}(c_{i}([x]_{P_{i}}))=F\chi_{\emptyset}^{\{B\}}(c_{i}([x^{\prime}]_{P_{i}}))\overset{\eqref{eqChiEq}}{=}F\chi_{\emptyset}^{B}(c(x^{\prime})).
Lemma A.7.

For SBC/QiS\subsetneqq B\in C/Q_{i} in the iith iteration of 3.1, any block TC/PiT\in C/P_{i} with no edge to SS is not modified; in symbols:

T↛STC/Pi+1T\not\to S\quad\Longrightarrow\quad T\in C/P_{i+1}
Proof A.8.

Since T↛ST\not\to S, we have {x}↛S\{x\}\not\to S and {x}↛S\{x^{\prime}\}\not\to S for all x,xTx,x^{\prime}\in T. Thus,

FχSB(c(x))\displaystyle F\chi_{S}^{B}(c(x)) =FχB(c(x))\displaystyle=F\chi_{\emptyset}^{B}(c(x)) (A.3, {x}↛S\{x\}\not\to S)
=FχB(c(x))\displaystyle=F\chi_{\emptyset}^{B}(c(x^{\prime})) (A.5, (x,x)Pi(x,x^{\prime})\in P_{i})
=FχSB(c(x))\displaystyle=F\chi_{S}^{B}(c(x^{\prime})) (A.3, {x}↛S\{x^{\prime}\}\not\to S)

as desired.

Lemma A.9.

For SCS\subseteq C and finite CC in the iith iteration of 3.1,

|{TC/Pi+1TC/Pi}| 2|𝗉𝗋𝖾𝖽(S)|.|\{T^{\prime}\in C/P_{i+1}\mid T^{\prime}\not\in C/P_{i}\}|\leavevmode\nobreak\ \leq\leavevmode\nobreak\ 2\cdot|\mathsf{pred}(S)|.
Proof A.10.

Let SBC/QiS\subsetneqq B\in C/Q_{i} be used for splitting in iteration ii. By contraposition, A.7 implies that if TC/Pi+1T^{\prime}\in C/P_{i+1} and TC/PiT^{\prime}\not\in C/P_{i}, then (the unique) TC/PiT\in C/P_{i} with TTT^{\prime}\subseteq T satisfies TC/Pi+1T\not\in C/P_{i+1} and thefore has a transition to SS. By the finiteness of CC, the block TC/PiT\in C/P_{i} is split into finitely many blocks T1,,TkC/Pi+1T_{1},\ldots,T_{k}\in C/P_{i+1}, representing the equivalence classes for FχSBc:CF3F\chi_{S}^{B}\cdot c\colon C\to F3. By A.3 we know that if xTx\in T has no transition to SS, then FχSB(c(x))=FχB(c(x))F\chi_{S}^{B}(c(x))=F\chi_{\emptyset}^{B}(c(x)). Moreover, all elements of TC/PiT\in C/P_{i} are sent to the same value by FχBcF\chi_{\emptyset}^{B}\cdot c (A.5). Hence, there is at most one block TjT_{j} with no transition to SS, and all other blocks TjT_{j^{\prime}}, jjj^{\prime}\neq j, have a transition to SS.Therefore the number blocks TjT_{j} is bounded above as follows: k|T𝗉𝗋𝖾𝖽(S)|+1k\leq|T\cap\mathsf{pred}(S)|+1. Summing over all predecessor blocks TT we obtain:

|{TC/Pi+1TC/Pi}|\displaystyle|\{T^{\prime}\in C/P_{i+1}\mid T^{\prime}\not\in C/P_{i}\}|
\displaystyle\leq\leavevmode\nobreak\ |{TC/Pi+1TTC/Pi and TS}|\displaystyle|\{T^{\prime}\in C/P_{i+1}\mid T^{\prime}\subseteq T\in C/P_{i}\text{ and }T\to S\}| (A.7)
=\displaystyle=\leavevmode\nobreak\ TC/PiTS|{TC/Pi+1TT}|\displaystyle\sum_{\begin{subarray}{c}T\in C/P_{i}\\ T\to S\end{subarray}}|\{T^{\prime}\in C/P_{i+1}\mid T^{\prime}\subseteq T\}|
\displaystyle\leq\leavevmode\nobreak\ TC/PiTS(|T𝗉𝗋𝖾𝖽(S)|+1)\displaystyle\sum_{\begin{subarray}{c}T\in C/P_{i}\\ T\to S\end{subarray}}(|T\cap\mathsf{pred}(S)|+1) (bound on kk above)
\displaystyle\leq\leavevmode\nobreak\ 2TC/PiTS|T𝗉𝗋𝖾𝖽(S)|\displaystyle 2\cdot\sum_{\begin{subarray}{c}T\in C/P_{i}\\ T\to S\end{subarray}}|T\cap\mathsf{pred}(S)| |T𝗉𝗋𝖾𝖽(S)|1|T\cap\mathsf{pred}(S)|\geq 1
\displaystyle\leq\leavevmode\nobreak\ 2|𝗉𝗋𝖾𝖽(S)|\displaystyle 2\cdot|\mathsf{pred}(S)| (TC/PiT\in C/P_{i} are disjoint)

This completes the proof

Lemma A.11.

Throughout the execution of 3.1 for an input coalgebra (C,c)(C,c) with n=|C|n=|C| states and mm transitions, we have

|{TCTC/Pi for some i}|2mlog2n+2m+n.|\{T\subseteq C\mid T\in C/P_{i}\text{ for some }i\}|\leq 2\cdot m\cdot\log_{2}n+2\cdot m+n.
Remark.

Note that the proof is similar to arguments given in the complexity analysis of the Paige-Tarjan algorithm; for instance, compare to [36, p. 980] (or [46, Lem. 7.15]).

Proof A.12.

Because |S|12|B||S|\leq\frac{1}{2}\cdot|B| holds in step (A1) of 3.1, one can show that every state xCx\in C is contained in the set SS in at most (log2(n)+1)(\log_{2}(n)+1) iterations [46, Lem. 7.15]. More formally, let SiBiC/QiS_{i}\subsetneq B_{i}\in C/Q_{i} be the blocks picked in the iith iteration of 3.1. Then we have

|{SixSi}|log2n+1for all xC.|\{S_{i}\mid x\in S_{i}\}|\leq\log_{2}n+1\qquad\text{for all }x\in C. (9)

Let the algorithm terminate after \ell iterations returning C/PC/P_{\ell}. Then, the number of new blocks introduced by step (A3) is bounded as follows (note that after the third step, xSix\in S_{i} is a side condition enforcing that we have a summand |𝗉𝗋𝖾𝖽({x})||\mathsf{pred}({\{x\}})| provided that xx lies in SiS_{i}, whereas before we sum over all xSix\in S_{i}):

0i<|{TC/Pi+1TC/Pi}|\displaystyle\sum_{0\leq i<\ell}|\{T^{\prime}\in C/P_{i+1}\mid T^{\prime}\notin C/P_{i}\}|
\displaystyle\leq\leavevmode\nobreak\ 0i<2|𝗉𝗋𝖾𝖽(Si)|\displaystyle\sum_{0\leq i<\ell}2\cdot|\mathsf{pred}(S_{i})| (A.9)
\displaystyle\leq\leavevmode\nobreak\ 20i<xSi|𝗉𝗋𝖾𝖽({x})|\displaystyle 2\cdot\sum_{0\leq i<\ell}\,\sum_{x\in S_{i}}|\mathsf{pred}(\{x\})|
=\displaystyle=\leavevmode\nobreak\ 2xC0i<xSi|𝗉𝗋𝖾𝖽({x})|\displaystyle 2\cdot\sum_{x\in C}\,\sum_{\begin{subarray}{c}0\leq i<\ell\\ x\in S_{i}\end{subarray}}|\mathsf{pred}(\{x\})|
=\displaystyle=\leavevmode\nobreak\ 2xC|𝗉𝗋𝖾𝖽({x})|0i<xSi1\displaystyle 2\cdot\sum_{x\in C}\,|\mathsf{pred}(\{x\})|\cdot\sum_{\begin{subarray}{c}0\leq i<\ell\\ x\in S_{i}\end{subarray}}1
=\displaystyle=\leavevmode\nobreak\ 2xC|𝗉𝗋𝖾𝖽({x})|(log2n+1)\displaystyle 2\cdot\sum_{x\in C}\,|\mathsf{pred}(\{x\})|\cdot(\log_{2}n+1) by (9)
=\displaystyle=\leavevmode\nobreak\ 2m(log2n+1)=2mlog2n+2m\displaystyle 2\cdot m\cdot(\log_{2}n+1)=2\cdot m\cdot\log_{2}n+2\cdot m

The only blocks we have not counted so far are the blocks of C/P0C/P_{0}, since |C/P0|n|C/P_{0}|\leq n, we have at most 2mlog2n+2m+n2\cdot m\cdot\log_{2}n+2\cdot m+n different blocks in (C/Pi)0i<(C/P_{i})_{0\leq i<\ell}.

We are now ready to prove the main theorem on the dag size of formulae created by 3.7.

Proof A.13 (Proof of Theorem 3.11).

Regarding the height of the dag, it is immediate that δi\delta_{i} and βi\beta_{i} have a height of at most i+1i+1. Since |C/Qi|<|C/Qi+1||C|=n|C/Q_{i}|<|C/Q_{i+1}|\leq|C|=n for all ii, there are at most nn iterations, with the final partition being C/Pn+1=C/Qn+1C/P_{n+1}=C/Q_{n+1}.

In 3.7 we create a new modal operator formula whenever 3.1 creates a new block in C/PiC/P_{i}. By A.11, the number of modalities in the dag is thus bounded by

2mlog2n+2m+n2\cdot m\cdot\log_{2}n+2\cdot m+n

In every iteration of the main loop, β\beta is extended by two new formulae, one for SS and one for BSB\setminus S. The formula βi+1(S)\beta_{i+1}(S) does not increase the size of the dag, because no new node needs to be allocated. For βi+1(BS)\beta_{i+1}(B\setminus S), we need to allocate one new node for the conjunction, so there are at most nn new such nodes allocated throughout the execution of the whole algorithm. Even if the optimization in 5 is applied, the additional run time can be neglected under the 𝒪\mathcal{O}-notation.

Proof of Theorem 3.12.

We implement every operation of 3.7 in constant time. The arrays for β\beta and δ\delta are re-used in every iteration. Hence the index ii is entirely neglected and only serves as an indicator for whether we refer to a value before or after the loop iteration. We proceed by case distinction as follows:

  1. 1.

    Initialization step:

    • The only block {C}\{C\} in C/Q0C/Q_{0} has index 0, and so we make β(0)\beta(0) point to the node \top.

    • For every block TT in C/P0C/P_{0}, 3.1 has computed F!(c(x))F1F!(c(x))\in F1 for some (in fact every) xTx\in T. Since F1F1 canonically embeds into F3F3 (3.5), we create a new node labelled Fj1(F!(c(x))){\ulcorner Fj_{1}(F!(c(x)))\urcorner} with two edges to \top.

      For every TC/P0T\in C/P_{0}, this runs in constant time and can be performed whenever the original 3.1 creates a new such block TT.

  2. 2.

    In the refinement step, we can look up the certificates δi(S)\delta_{i}(S) resp. βi(B)\beta_{i}(B) for SS resp. BB in constant time using the indices of the blocks SS and BB. Whenever the original algorithm creates a new block, we also immediately construct the certificate of this new block by creating at most two new nodes in the dag (with at most four outgoing edges). However, if a block does not change (that is, [x]Qi=[x]Qi+1[x]_{Q_{i}}=[x]_{Q_{i+1}} or [x]Pi=[x]Pi+1[x]_{P_{i}}=[x]_{P_{i+1}}, resp.), then the corresponding certificate is not changed either in steps item (A’2) resp. item (A’3).

    In the loop body we update the certificates as follows:

    1. (A’2)

      The new block SC/Qi+1S\in C/Q_{i+1} just points to the certificate δi(S)\delta_{i}(S) constructed earlier. For the new block (BS)C/Qi+1(B\setminus S)\in C/Q_{i+1}, we allocate a new node \wedge, with one edge to βi(B)\beta_{i}(B) and one negated edge to δi(S)\delta_{i}(S). (See also details for 5 on the run time for computing the optimized negation.)

    2. (A’3)

      Not all resulting blocks have a transition to SS. There may be (at most) one new block TC/Pi+1T^{\prime}\in C/P_{i+1}, TTT^{\prime}\subseteq T with no transition to SS (see the proof of A.9). In the refinable partition structure, such a block will inherit the index from TT (i.e. the index of TT in C/PiC/P_{i} equals the index of TT^{\prime} in C/Pi+1C/P_{i+1}). Moreover, every xTx\in T^{\prime} fulfils FχSB(c(x))=FχB(c(x))F\chi_{S}^{B}(c(x))=F\chi_{\emptyset}^{B}(c(x)) (by A.3), and FχB(c(x))=FχB(c(y))F\chi_{\emptyset}^{B}(c(x))=F\chi_{\emptyset}^{B}(c(y)) for every yTy\in T (by A.5).

      Now, one first saves the node of the certificate δi(T)\delta_{i}(T) in some variable δ\delta^{\prime}, say. Then the array δ\delta is updated at index TT by the formula

      FχB(c(y))(δi(S),βi(B))for an arbitrary yT.{\ulcorner F\chi_{\emptyset}^{B}(c(y))\urcorner}(\delta_{i}(S),\beta_{i}(B))\qquad\text{for an arbitrary $y\in T$.}

      Consequently, any block TT^{\prime} inheriting the index of TT automatically has the correct certificate.

      The allocation of nodes for this formula is completely analogous to the one for an ordinary block [x]Pi+1T[x]_{P_{i+1}}\subsetneqq T having edges to SS: One allocates a new node labelled \wedge with edges to the saved node δ\delta^{\prime} (the original value of δi(T)\delta_{i}(T)) and to another newly allocated node labelled FχSB(c(x)){\ulcorner F\chi_{S}^{B}(c(x))\urcorner} with edges to the nodes δi(S)\delta_{i}(S) and δi(B)\delta_{i}(B). ∎

Details for 5.

In order to keep the formula size smaller, one can implement the optimization of 5, but one has to take care not to increase the run time. To this end, mark every modal operator node t(δ,β){\ulcorner t\urcorner}(\delta,\beta) in the formula dag with a boolean flag expressing whether:

t(δ,β){\ulcorner t\urcorner}(\delta,\beta) is a conjunct of some βi\beta_{i}-formula.

Thus, every new modal operator in (A’3) is flagged ‘false’ initially. When splitting the block BB in C/QiC/Q_{i} into SS and BSB\setminus S in step (A’2), the formula for block BSB\setminus S is a conjunction of βi(B)\beta_{i}(B) and the negation of all ‘false’-marked conjuncts of δi(S)\delta_{i}(S). Afterwards these conjuncts are all marked ‘true’, because they are inherited by βi(S)\beta_{i}(S). The ‘false’-marked conjuncts always form a prefix of all conjuncts of a formula in δi\delta_{i}. It therefore suffices to greedily take conjuncts from the root of a formula graph while they are marked ‘false’.

As a consequence, step (A’3) does not run in constant time but instead takes as many steps as there are ‘false’-marked conjuncts in δi(S)\delta_{i}(S). However, over the whole execution of the algorithm this eventually amortizes because every newly allocated modal operator allocated is initially marked ‘false’ and later marked ‘true’ precisely once.

Proof of Theorem 3.13.

The overall run time is immediate, because the underlying 3.1 has run time 𝒪((m+n)lognp(c))\mathcal{O}((m+n)\cdot\log n\cdot p(c)) and 3.7 preserves this run time by Theorem 3.12.

Details for section 4 (Cancellative Functors)

Proof of 4.1.

First note that for FX=M(X)FX=M^{(X)} the maps in 8 are defined by:

M(χ{1,2}):M(3)M(2),t(t(0),t(1)+t(2)),M(χ{2}):M(3)M(2),t(t(0)+t(1),t(2)),\begin{array}[]{r@{\ }l@{\qquad}l}M^{(\chi_{{\{1,2\}}})}\colon&M^{(3)}\to M^{(2)},&t\mapsto(t(0),t(1)+t(2)),\\[5.0pt] M^{(\chi_{{\{2\}}})}\colon&M^{(3)}\to M^{(2)},&t\mapsto(t(0)+t(1),t(2)),\end{array}

where we write sM(2)s\in M^{(2)} as the pair (s(0),s(1))(s(0),s(1)).

For ()(\Leftarrow), let s,tM(3)s,t\in M^{(3)} with

M(χ{1,2}),M(χ{2})(s)=M(χ{1,2}),M(χ{2})(t),\langle M^{(\chi_{{\{1,2\}}})},M^{(\chi_{{\{2\}}})}\rangle(s)=\langle M^{(\chi_{{\{1,2\}}})},M^{(\chi_{{\{2\}}})}\rangle(t),

which is written point-wise as follows:

(s(0),s(1)+s(2))\displaystyle(s(0),s(1)+s(2)) =(t(0),t(1)+t(2))\displaystyle=(t(0),t(1)+t(2))
(s(0)+s(1),s(2))\displaystyle(s(0)+s(1),s(2)) =(t(0)+t(1),t(2)).\displaystyle=(t(0)+t(1),t(2)).

Hence, s(0)=t(0)s(0)=t(0), s(2)=t(2)s(2)=t(2) and moreover

s(1)+s(2)=t(1)+t(2)=t(1)+s(2).s(1)+s(2)=t(1)+t(2)=t(1)+s(2).

Since MM is cancellative, we have s(1)=t(1)s(1)=t(1), which proves that s=ts=t. Thus, the map M(χ{1,2}),M(χ{2})\langle M^{(\chi_{{\{1,2\}}})},M^{(\chi_{{\{2\}}})}\rangle is injective.

For ()(\Rightarrow), let a,b,cMa,b,c\in M with c+a=c+bc+a=c+b. Define s,tM(3)s,t\in M^{(3)} by

s(0)=s(2)=c,s(1)=aandt(0)=t(2)=c,t(1)=b.s(0)=s(2)=c,\quad s(1)=a\qquad\text{and}\qquad t(0)=t(2)=c,\quad t(1)=b.

Thus,

M(χ{1,2})(s)=(s(0),s(1)+s(2))=(c,a+c)=(c,b+c)=(t(0),t(1)+t(2))=M(χ{1,2})(t),M(χ{2})(s)=(s(0)+s(1),s(2))=(c+a,c)=(c+b,c)=(t(0)+t(1),t(2))=M(χ{2})(t).\begin{aligned} M^{(\chi_{{\{1,2\}}})}(s)&=(s(0),s(1)+s(2))\\ &=(c,a+c)\\ &=(c,b+c)\\ &=(t(0),t(1)+t(2))\\ &=M^{(\chi_{{\{1,2\}}})}(t),\end{aligned}\qquad\qquad\begin{aligned} M^{(\chi_{{\{2\}}})}(s)&=(s(0)+s(1),s(2))\\ &=(c+a,c)\\ &=(c+b,c)\\ &=(t(0)+t(1),t(2))\\ &=M^{(\chi_{{\{2\}}})}(t).\end{aligned}

Since M(χ{1,2}),M(χ{2})\langle M^{(\chi_{{\{1,2\}}})},M^{(\chi_{{\{2\}}})}\rangle is injective, we see that s=ts=t holds. Thus, we have a=s(1)=t(1)=ba=s(1)=t(1)=b, which proves that MM is cancellative.∎

Proof of 4.2.

  1. 1.

    For the constant functor CXC_{X} with value XX, CXχSC_{X}\chi_{S} is the identity map on XX for every set SS. Therefore CXC_{X} is cancellative.

  2. 2.

    The identity functor is cancellative because the map χ{1,2},χ{2}\langle\chi_{{\{1,2\}}},\chi_{{\{2\}}}\rangle is clearly injective.

  3. 3.

    Let α:FG\alpha\colon F\rightarrowtail G a natural transformation with injective components and let GG be cancellative. Combining the naturality squares of α\alpha for χ{1,2}\chi_{{\{1,2\}}} and χ{2}\chi_{{\{2\}}}, we obtain the commutative square:

    F3{F3}F2×F2{F2\times F2}G3{G3}G2×G2{G2\times G2}Fχ{1,2},Fχ{2}\scriptstyle{\langle F\chi_{{\{1,2\}}},F{\chi_{{\{2\}}}}\rangle}α3\scriptstyle{\alpha_{3}}α2×α2\scriptstyle{\alpha_{2}\times\alpha_{2}}Gχ{1,2},Gχ{2}\scriptstyle{\langle G\chi_{{\{1,2\}}},G{\chi_{{\{2\}}}}\rangle}

    Every composition of injective maps is injective, and so by standard cancellation laws for injective maps, Fχ{1,2},Fχ{2}\langle F\chi_{{\{1,2\}}},F\chi_{{\{2\}}}\rangle is injective as well, showing that the subfunctor FF is cancellative.

  4. 4.

    Let (Fi)iI(F_{i})_{i\in I} be a family of cancellative functors, and suppose that we have elements s,t(iIFi)(3)=iIFi3s,t\in(\prod_{i\in I}F_{i})(3)=\prod_{i\in I}F_{i}3 with

    (iIFiχ{1,2})(s)=(iIFiχ{1,2})(t)and(iIFiχ{2})(s)=(iIFiχ{2})(t).\big{(}\prod_{i\in I}F_{i}\chi_{{\{1,2\}}}\big{)}(s)=\big{(}\prod_{i\in I}F_{i}\chi_{{\{1,2\}}}\big{)}(t)\quad\text{and}\quad\big{(}\prod_{i\in I}F_{i}\chi_{{\{2\}}}\big{)}(s)=\big{(}\prod_{i\in I}F_{i}\chi_{{\{2\}}}\big{)}(t).

    Write 𝗉𝗋i\mathsf{pr}_{i} for the iith projection function from the product. For every iIi\in I we have:

    Fiχ{1,2}(𝗉𝗋i(s))=Fiχ{1,2}(𝗉𝗋i(t))andFiχ{2}(𝗉𝗋i(s))=Fiχ{2}(𝗉𝗋i(t)).F_{i}\chi_{{\{1,2\}}}(\mathsf{pr}_{i}(s))=F_{i}\chi_{{\{1,2\}}}(\mathsf{pr}_{i}(t))\qquad\text{and}\qquad F_{i}\chi_{{\{2\}}}(\mathsf{pr}_{i}(s))=F_{i}\chi_{{\{2\}}}(\mathsf{pr}_{i}(t)).

    Since every FiF_{i} is cancellative, we have 𝗉𝗋i(s)=𝗉𝗋i(t)\mathsf{pr}_{i}(s)=\mathsf{pr}_{i}(t) for every iIi\in I. This implies s=ts=t since the product projections (𝗉𝗋i)iI(\mathsf{pr}_{i})_{i\in I} are jointly injective.

  5. 5.

    Again, let (Fi)iI(F_{i})_{i\in I} be a family of cancellative functors. Suppose that we have elements s,t(iIFi)(3)=iIFi3s,t\in(\coprod_{i\in I}F_{i})(3)=\coprod_{i\in I}F_{i}3 satisfying

    (iIFiχ{1,2})(s)=(iIFiχ{1,2})(t)and(iIFiχ{2})(s)=(iIFiχ{2})(t).\big{(}\coprod_{i\in I}F_{i}\chi_{{\{1,2\}}}\big{)}(s)=\big{(}\coprod_{i\in I}F_{i}\chi_{{\{1,2\}}}\big{)}(t)\quad\text{and}\quad\big{(}\coprod_{i\in I}F_{i}\chi_{{\{2\}}}\big{)}(s)=\big{(}\coprod_{i\in I}F_{i}\chi_{{\{2\}}}\big{)}(t).

    This implies that there exists an iIi\in I and t,sFit^{\prime},s^{\prime}\in F_{i} with s=𝗂𝗇i(s)s=\mathsf{in}_{i}(s^{\prime}), t=𝗂𝗇i(t)t=\mathsf{in}_{i}(t^{\prime}), and

    Fiχ{1,2}(s)=Fiχ{1,2}(t)andFiχ{2}(s)=Fiχ{2}(t).F_{i}\chi_{{\{1,2\}}}(s)=F_{i}\chi_{{\{1,2\}}}(t)\qquad\text{and}\qquad F_{i}\chi_{{\{2\}}}(s)=F_{i}\chi_{{\{2\}}}(t).

    Since FiF_{i} is cancellative, we have s=ts=t as desired. ∎

Details for 9.

Operation cancellative non-cancellative
Quotient XnXnX\mapsto\coprod_{n\in\mathbb{N}}X^{n} 𝒫f{\mathcal{P}_{\textsf{f}}}
Composition =()\mathcal{B}=\mathbb{N}^{(-)} \mathcal{B}\mathcal{B}
cancellative non-cancellative
zippable XXX\mapsto X 𝒫f{\mathcal{P}_{\textsf{f}}}
non-zippable see (10) 𝒫f𝒫f{\mathcal{P}_{\textsf{f}}}{\mathcal{P}_{\textsf{f}}}
  1. 1.

    Cancellative functors are not closed under quotients: e.g. the non-cancellative functor 𝒫f{\mathcal{P}_{\textsf{f}}} is a quotient of the signature functor XnXnX\mapsto\coprod_{n\in\mathbb{N}}X^{n} (which is cancellative by 4.2).

  2. 2.

    Cancellative functors are not closed under composition. For the additive monoid (,+,0)(\mathbb{N},+,0) of natural numbers, the monoid-valued functor =()\mathcal{B}=\mathbb{N}^{(-)} sends XX to the set of finite multisets on XX (‘bags’). Since \mathbb{N} is cancellative, \mathcal{B} is a cancellative functor. However, \mathcal{B}\mathcal{B} is not:

    χ{1,2},χ{2}(\lBrace\lBrace0,1\rBrace,\lBrace1,2\rBrace\rBrace\displaystyle\langle\mathcal{B}\mathcal{B}\chi_{{\{1,2\}}},\mathcal{B}\mathcal{B}\chi_{{\{2\}}}\rangle\big{(}{\big{\lBrace}{\lBrace 0,1\rBrace},{\lBrace 1,2\rBrace}\big{\rBrace}}
    =(\lBrace\lBrace0,1\rBrace,\lBrace1,1\rBrace\rBrace,\lBrace\lBrace0,0\rBrace,\lBrace0,1\rBrace\rBrace)\displaystyle=\big{(}{\big{\lBrace}{\lBrace 0,1\rBrace},{\lBrace 1,1\rBrace}\big{\rBrace}},{\big{\lBrace}{\lBrace 0,0\rBrace},{\lBrace 0,1\rBrace}\big{\rBrace}}\big{)}
    =(\lBrace\lBrace0,1\rBrace,\lBrace1,1\rBrace\rBrace,\lBrace\lBrace0,1\rBrace,\lBrace0,0\rBrace\rBrace)\displaystyle=\big{(}{\big{\lBrace}{\lBrace 0,1\rBrace},{\lBrace 1,1\rBrace}\big{\rBrace}},{\big{\lBrace}{\lBrace 0,1\rBrace},{\lBrace 0,0\rBrace}\big{\rBrace}}\big{)}
    =χ{1,2},χ{2}(\lBrace\lBrace0,2\rBrace,\lBrace1,1\rBrace\rBrace)\displaystyle=\langle\mathcal{B}\mathcal{B}\chi_{{\{1,2\}}},\mathcal{B}\mathcal{B}\chi_{{\{2\}}}\rangle\big{(}{\big{\lBrace}{\lBrace 0,2\rBrace},{\lBrace 1,1\rBrace}\big{\rBrace}}\big{)}

    Here, we use \lBrace\rBrace{\lBrace\cdots\rBrace} to denote multisets, so \lBrace0,1\rBrace=\lBrace1,0\rBrace{\lBrace 0,1\rBrace}={\lBrace 1,0\rBrace} but \lBrace1\rBrace\lBrace1,1\rBrace{\lBrace 1\rBrace}\neq{\lBrace 1,1\rBrace}.

  3. 3.

    The identity functor XXX\mapsto X is both zippable [46] and cancellative (4.2).

  4. 4.

    The monoid-valued functor 𝒫f=𝔹(){\mathcal{P}_{\textsf{f}}}={\mathbb{B}}^{(-)} is zippable [46], but not cancellative (4.1), because 𝔹{\mathbb{B}} is a non-cancellative monoid.

  5. 5.

    The functor 𝒫𝒫\mathcal{P}\mathcal{P} is neither zippable [46, Ex. 5.10] nor cancellative because

    𝒫𝒫χ{1,2},𝒫𝒫χ{2}({{0},{2}})\displaystyle\langle\mathcal{P}\mathcal{P}\chi_{{\{1,2\}}},\mathcal{P}\mathcal{P}\chi_{{\{2\}}}\rangle(\big{\{}{\{0\}},{\{2\}}\big{\}}) =({{0},{1}},{{0},{1}})\displaystyle=({\big{\{}{\{0\}},{\{1\}}\big{\}}},{\big{\{}{\{0\}},{\{1\}}\big{\}}})
    =𝒫𝒫χ{1,2},𝒫𝒫χ{2}({{0},{1},{2}}).\displaystyle=\langle\mathcal{P}\mathcal{P}\chi_{{\{1,2\}}},\mathcal{P}\mathcal{P}\chi_{{\{2\}}}\rangle(\big{\{}{\{0\}},{\{1\}},{\{2\}}\big{\}}).
  6. 6.

    Every functor FF satisfying |F(2+2)|>1|F(2+2)|>1 and |F3|=1|F3|=1 is cancellative but not zippable:

    • Indeed, every map with domain 11 is injective, in particular the map

      Fχ{1,2},Fχ{2}:1F3F2×F2,\langle F\chi_{{\{1,2\}}},F\chi_{{\{2\}}}\rangle\colon 1\cong F3\longrightarrow F2\times F2,

      whence FF is cancellative.

    • If |F(2+2)|>1|F(2+2)|>1 and |F3|=1|F3|=1 we have that the map

      2+!,!+2:F(2+2)||>1F(2+1)F31×F(1+2)F311\langle 2+\mathord{!},\mathord{!}+2\rangle\colon\underbrace{F(2+2)}_{|-|\mathrlap{\,>1}}\to\underbrace{F(2+1)}_{\cong F3\cong 1}\times\underbrace{F(1+2)}_{\cong F3\cong 1}\cong 1

      is not injective, whence FF is not zippable.

    An example for such a functor is given by

    FX={SX:|S|=0 or |S|=4}FX=\{S\subseteq X:|S|=0\text{ or }|S|=4\} (10)

    which sends a map f:XYf\colon X\to Y to the map Ff:FXFYFf\colon FX\to FY defined by

    Ff(S)={f[S]if |f[S]|=4otherwise.Ff(S)=\begin{cases}f[S]&\text{if }|f[S]|=4\\ \emptyset&\text{otherwise}.\end{cases}
  7. 7.

    For the proof of

    F zippable &F cancellative F m-zippable for all mF\text{ zippable }\&\leavevmode\nobreak\ F\text{ cancellative }\leavevmode\nobreak\ \leavevmode\nobreak\ \Longrightarrow\leavevmode\nobreak\ \leavevmode\nobreak\ F\text{ $m$-zippable }\qquad\text{for all }m\in\mathbb{N}

    recall from König et al. [32] that a functor FF is mm-zippable if the canonical map

    𝗎𝗇𝗓𝗂𝗉m:F(A1+A2++Am)F(A1+1)×F(A2+1)××F(Am+1)\mathsf{unzip}_{m}\colon\leavevmode\nobreak\ \leavevmode\nobreak\ F(A_{1}+A_{2}+\ldots+A_{m})\leavevmode\nobreak\ \leavevmode\nobreak\ \longrightarrow\leavevmode\nobreak\ \leavevmode\nobreak\ F(A_{1}+1)\times F(A_{2}+1)\times\ldots\times F(A_{m}+1)

    is injective. Formally, 𝗎𝗇𝗓𝗂𝗉m\mathsf{unzip}_{m} is given by

    F[Δi,j]jm¯im¯:Fj=1mAji=1mF(Ai+1)\langle F[\Delta_{i,j}]_{j\in\bar{m}}\rangle_{i\in\bar{m}}\colon\leavevmode\nobreak\ \leavevmode\nobreak\ F\coprod_{j=1}^{m}A_{j}\longrightarrow\prod_{i=1}^{m}F(A_{i}+1)

    where m¯\bar{m} is the set m¯={1,,m}\bar{m}={\{1,\ldots,m\}} and the map Δi,j\Delta_{i,j} is defined by

    Δi,j:AjAi+1Δi,j:={Aj𝗂𝗇1Ai+1if i=jAj!1𝗂𝗇2Ai+1if ij.\Delta_{i,j}\colon A_{j}\to A_{i}+1\qquad\Delta_{i,j}:=\begin{cases}A_{j}\xrightarrow{\mathsf{in}_{1}}A_{i}+1&\text{if }i=j\\ A_{j}\xrightarrow{!}1\xrightarrow{\mathsf{in}_{2}}A_{i}+1&\text{if }i\neq j.\end{cases}

    First, we show that for a zippable and cancellative functor FF, the map

    gA,B:=F(A+1+B)F(A+!),F(!+B)F(A+1)×F(1+B)g_{A,B}\leavevmode\nobreak\ \leavevmode\nobreak\ :=\leavevmode\nobreak\ \leavevmode\nobreak\ F(A+1+B)\xrightarrow{\langle F(A+!),F(!+B)\rangle}F(A+1)\times F(1+B)

    is injective for all sets A,BA,B. Indeed, we have the following chain of injective maps, where the index at the 11 is only notation to distinguish coproduct components more easily:

    F(A+(1M+B))\displaystyle F(A+(1_{M}+B))
    F(A+!),F(!+(1M+B))\displaystyle\quad\leavevmode\hbox to9.36pt{\vbox to11.11pt{\pgfpicture\makeatletter\hbox{\hskip 4.67966pt\lower-5.55557pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ } {{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}{}{}{}{}{} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{0.0}{-1.0}{1.0}{0.0}{-2.54428pt}{5.55557pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\rightarrowtail$}} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}{}{}}{{{}}{{}}}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{{}}}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\langle F(A+!),F(!+(1_{M}+B))\rangle (FF is zippable)
    F(A+1)×F(1A+1M+B)\displaystyle F(A+1)\times F(1_{A}+1_{M}+B)
    𝗂𝖽×F(!+B),F(1A+1M+!)\displaystyle\quad\leavevmode\hbox to9.36pt{\vbox to11.11pt{\pgfpicture\makeatletter\hbox{\hskip 4.67966pt\lower-5.55557pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ } {{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}{}{}{}{}{} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{0.0}{-1.0}{1.0}{0.0}{-2.54428pt}{5.55557pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\rightarrowtail$}} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}{}{}}{{{}}{{}}}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{{}}}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\mathsf{id}\times\langle F(!+B),F(1_{A}+1_{M}+!)\rangle (FF is zippable)
    F(A+1)×F(1+B)×F(1A+1M+1B)\displaystyle F(A+1)\times F(1+B)\times F(1_{A}+1_{M}+1_{B})
    𝗂𝖽×𝗂𝖽×Fχ1M+1B,Fχ1B\displaystyle\quad\leavevmode\hbox to9.36pt{\vbox to11.11pt{\pgfpicture\makeatletter\hbox{\hskip 4.67966pt\lower-5.55557pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ } {{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}{}{}{}{}{} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{0.0}{-1.0}{1.0}{0.0}{-2.54428pt}{5.55557pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\rightarrowtail$}} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}{}{}}{{{}}{{}}}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{{}}}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\mathsf{id}\times\mathsf{id}\times\langle F\chi_{1_{M}+1_{B}},F\chi_{1_{B}}\rangle (FF is cancellative, 1A+1M+1B{0,1,2}1_{A}+1_{M}+1_{B}\cong\{0,1,2\})
    F(A+1)×F(1+B)×F2×F2\displaystyle F(A+1)\times F(1+B)\times F2\times F2

    Call this composition ff. The injective map ff factors through gA,Bg_{A,B}, because it matches with gA,Bg_{A,B} on the components F(A+1)F(A+1) and F(1+B)F(1+B), and for the other components, one has the map

    h:=F(A+1)×F(1+B)Fχ1×FχBF2×F2h\leavevmode\nobreak\ :=\leavevmode\nobreak\ F(A+1)\times F(1+B)\xrightarrow{F\chi_{1}\times F\chi_{B}}F2\times F2

    with f=𝗂𝖽F(A+1)×F(1+B),hgA,Bf=\langle\mathsf{id}_{F(A+1)\times F(1+B)},h\rangle\cdot g_{A,B}. Since ff is injective, gA,Bg_{A,B} must be injective, too.

    Also note that a function FF is cancellative iff equivalently the map

    F(1+!),F(!+1):F(1+1+1)F(1+1)×F(1+1)\langle F(1+!),F(!+1)\rangle\colon F(1+1+1)\longrightarrow F(1+1)\times F(1+1)

    is injective, for !:1+11!\colon 1+1\to 1 and 1+1+131+1+1\cong 3 and 1+121+1\cong 2.

    We now proceed with the proof of the desired implication by induction on mm. In the base cases m=0m=0 and m=1m=1 there is nothing to show because every functor is 0- and 11-zippable, and for m=2m=2, the implication is trivial (zippability and 22-zippability are identical properties). In the inductive step, given that FF is 22-zippable, mm-zippable (m2m\geq 2), and cancellative, we show that FF is (m+1)(m+1)-zippable.

    We have the following chain of injective maps, where we again annotate some of the singleton sets 11 with indices to indicate from which coproduct components they come:

    F(A1++Am1+(Am+Am+1))\displaystyle F(A_{1}+\ldots+A_{m-1}+(A_{m}+A_{m+1}))
    𝗎𝗇𝗓𝗂𝗉m\displaystyle\qquad\leavevmode\hbox to9.36pt{\vbox to11.11pt{\pgfpicture\makeatletter\hbox{\hskip 4.67966pt\lower-5.55557pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ } {{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}{}{}{}{}{} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{0.0}{-1.0}{1.0}{0.0}{-2.54428pt}{5.55557pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\rightarrowtail$}} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}{}{}}{{{}}{{}}}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{{}}}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\mathsf{unzip}_{m} (FF is mm-zippable)
    i=1m1F(Ai+1)×F(Am+Am+1+11..(m1))\displaystyle\prod_{i=1}^{m-1}F(A_{i}+1)\times F(A_{m}+A_{m+1}+1_{1..(m-1)})
    \displaystyle\cong\leavevmode\nobreak\ i=1m1F(Ai+1)×F(Am+11..(m1)+Am+1)\displaystyle\prod_{i=1}^{m-1}F(A_{i}+1)\times F(A_{m}+1_{1..(m-1)}+A_{m+1})
    𝗂𝖽×gAm,Am+1\displaystyle\quad\leavevmode\hbox to9.36pt{\vbox to11.11pt{\pgfpicture\makeatletter\hbox{\hskip 4.67966pt\lower-5.55557pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ } {{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}{}{}{}{}{} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{0.0}{-1.0}{1.0}{0.0}{-2.54428pt}{5.55557pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\rightarrowtail$}} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}{}{}}{{{}}{{}}}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{{}}}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}{\mathsf{id}\times g_{A_{m},A_{m+1}}} (the above injective helper map gg)
    i=1m1F(Ai+1)×F(Am+1)×F(1+Am+1)\displaystyle\prod_{i=1}^{m-1}F(A_{i}+1)\times F(A_{m}+1)\times F(1+A_{m+1})
    \displaystyle\cong\leavevmode\nobreak\ i=1m1F(Ai+1)×F(Am+1)×F(Am+1+1)\displaystyle\prod_{i=1}^{m-1}F(A_{i}+1)\times F(A_{m}+1)\times F(A_{m+1}+1)

    This composition thus is injective as well, and in fact the composition is precisely 𝗎𝗇𝗓𝗂𝗉m+1\mathsf{unzip}_{m+1}, showing that FF is (m+1)(m+1)-zippable. ∎

    The optimization present in the algorithms for Markov chains [44] and automata [27] can now be adapted to coalgebras for cancellative functors, where it suffices to split only according to transitions into SS, neglecting transitions into BSB\setminus S. More formally, this means that we replace the three-valued χSB:C3\chi_{S}^{B}\colon C\to 3 with χS:C2\chi_{S}\colon C\to 2 in the refinement step (A3):

    Proposition A.14.

    Let FF be a cancellative set functor. For SC/PiS\in C/P_{i} in the ii-th iteration of 3.1, we have Pi+1=Piker(C𝑐FCFχSF2).P_{i+1}=P_{i}\cap\ker(C\xrightarrow{c}{FC}\xrightarrow{F\chi_{S}}F2).

    Proof of A.14.

    From the definition (1) of the kernel, we immediately obtain the following properties for all maps f,g:YZf,g\colon Y\to Z, h:XYh\colon X\to Y:

    f injective\displaystyle f\text{ injective}\leavevmode\nobreak\ \leavevmode\nobreak\ ker(fh)=ker(h)\displaystyle\Longrightarrow\leavevmode\nobreak\ \leavevmode\nobreak\ \ker(f\cdot h)=\ker(h) (11)
    ker(f)=ker(g)\displaystyle\ker(f)=\ker(g)\leavevmode\nobreak\ \leavevmode\nobreak\ ker(fh)=ker(gh)\displaystyle\Longrightarrow\leavevmode\nobreak\ \leavevmode\nobreak\ \ker(f\cdot h)=\ker(g\cdot h) (12)
    ker(f,g)\displaystyle\ker(\langle f,g\rangle) =ker(f)ker(g).\displaystyle=\ker(f)\cap\ker(g). (13)

    For every coalgebra c:CFCc\colon C\to FC and SBCS\subseteq B\subseteq C we have

    FχB,FχS=Fχ{1,2},Fχ{2}FχSB.\langle F\chi_{B},F\chi_{S}\rangle=\langle F\chi_{{\{1,2\}}},F\chi_{{\{2\}}}\rangle\cdot F\chi_{S}^{B}.

    Since FF is cancellative, Fχ{1,2},Fχ{2}\langle F\chi_{{\{1,2\}}},F\chi_{{\{2\}}}\rangle is injective, and we thus obtain

    ker(FχB,FχS)=ker(Fχ{1,2},Fχ{2}FχSB)=(11)ker(FχSB).\ker(\langle F\chi_{B},F\chi_{S}\rangle)=\ker(\langle F\chi_{{\{1,2\}}},F\chi_{{\{2\}}}\rangle\cdot F\chi_{S}^{B})\overset{\text{\eqref{kerInjective}}}{=}\ker(F\chi_{S}^{B}). (14)

    By (12), this implies that

    ker(FχB,FχSc)=ker(FχSBc).\ker(\langle F\chi_{B},F\chi_{S}\rangle\cdot c)=\ker(F\chi_{S}^{B}\cdot c). (15)

    Let BC/QiB\in C/Q_{i} be the block that is split into SS and BSB\setminus S in iteration ii. Since PiP_{i} is finer than QiQ_{i} and BC/QiB\in C/Q_{i}, we have PiQiker(FχBc)P_{i}\subseteq Q_{i}\subseteq\ker(F\chi_{B}\cdot c); thus:

    Pi=Piker(C𝑐FCFχBF2).P_{i}=P_{i}\cap\ker(C\xrightarrow{c}{FC}\xrightarrow{F\chi_{B}}F2). (16)

    Now we verify the desired property:

    Pi+1\displaystyle P_{i+1} =Piker(C𝑐FCFχSBF2)\displaystyle=\leavevmode\nobreak\ P_{i}\cap\ker(C\xrightarrow{c}{FC}\xrightarrow{F\chi_{S}^{B}}F2) (by (A3))
    =Piker(FχB,FχSc)\displaystyle\overset{\mathclap{\text{}}}{=}\leavevmode\nobreak\ P_{i}\cap\ker(\langle F\chi_{B},F\chi_{S}\rangle\cdot c) (by (15))
    =Piker(FχBc,FχSc)\displaystyle=P_{i}\cap\ker(\langle F\chi_{B}\cdot c,F\chi_{S}\cdot c\rangle) (def. ,\langle-,-\rangle)
    =Piker(FχBc)ker(FχSc)\displaystyle=P_{i}\cap\ker(F\chi_{B}\cdot c)\cap\ker(F\chi_{S}\cdot c) (by (13))
    =Piker(FχSc)\displaystyle=P_{i}\cap\ker(F\chi_{S}\cdot c) (by (16))

    This completes the proof. ∎

    Example A.15.

    For coalgebras for a signature functor Σ\Sigma or a monoid-valued functor M()M^{(-)} for cancellative MM, the refinement step (A3) of 3.1 can be optimized to compute Pi+1P_{i+1} according to A.14.

    Observe that, in the optimized step (A3), BB is no longer mentioned. It is therefore unsurprising that we do not need a certificate for it when constructing certificates for the blocks of Pi+1P_{i+1}. Instead, we can reflect the map FχSc:CF2F\chi_{S}\cdot c\colon C\to F2 in the coalgebraic modal formula and take F2F2 as the (unary) modal operators. Just like F1F1 in 3.5, the set F2F2 canonically embeds into F3F3:

    Proof of Theorem 4.3.

    Before proving Theorem 4.3, we define a new set of (unary) modalities (A.16), establish a lemma about its semantics (A.17), fully phrase the entire optimized algorithm (A.19), and then show its correctness (Theorem A.21).

    Notation A.16.

    Define the injective map j2:23j_{2}\colon 2\rightarrowtail 3 by j2(0)=1j_{2}(0)=1 and j2(1)=2j_{2}(1)=2. Then the injection Fj2:F2F3Fj_{2}\colon F2\rightarrowtail F3 provides a way to interpret elements tF2t\in F2 as unary modalities t{\ulcorner t\urcorner}:

    t(δ):=Fj2(t)(δ,).{\ulcorner t\urcorner}(\delta):={\ulcorner Fj_{2}(t)\urcorner}(\delta,\top).

    Remark to A.16.

    There are several different ways to define t(δ){\ulcorner t\urcorner}(\delta) for tF2t\in F2, depending on the definition of the inclusion j2j_{2}.

    j2:23j_{2}\colon 2\rightarrowtail 3 j2χSj_{2}\cdot\chi_{S} for SCS\subseteq C Definition for tF2t\in F2
    00,110\mapsto 0,1\mapsto 1 j2χS=χSj_{2}\cdot\chi_{S}=\chi_{\emptyset}^{S} t(δ):=Fj2(t)(,δ){\ulcorner t\urcorner}(\delta):={\ulcorner Fj_{2}(t)\urcorner}(\bot,\delta)
    00,120\mapsto 0,1\mapsto 2 j2χS=χSSj_{2}\cdot\chi_{S}=\chi_{S}^{S} t(δ):=Fj2(t)(δ,δ){\ulcorner t\urcorner}(\delta):={\ulcorner Fj_{2}(t)\urcorner}(\delta,\delta)
    01,120\mapsto 1,1\mapsto 2 j2χS=χSCj_{2}\cdot\chi_{S}=\chi_{S}^{C} t(δ):=Fj2(t)(δ,){\ulcorner t\urcorner}(\delta):={\ulcorner Fj_{2}(t)\urcorner}(\delta,\top)

    All these variants make the following A.17 true because in any case:

    t(δ)=Fj2(t)(ϕ,ψ)impliesj2χδ=χϕψ.{\ulcorner t\urcorner}(\delta)={\ulcorner Fj_{2}(t)\urcorner}(\phi,\psi)\qquad\text{implies}\qquad j_{2}\cdot\chi_{\llbracket\delta\rrbracket}=\chi_{\llbracket\phi\rrbracket}^{\llbracket\psi\rrbracket}. (17)

    Analogously to 3.4 we can show:

    Lemma A.17.

    Given a cancellative functor FF, an FF-coalgebra (C,c)(C,c), tF2t\in F2, a formula δ\delta, and xCx\in C, we have xt(δ)x\in\llbracket{\ulcorner t\urcorner}(\delta)\rrbracket if and only if Fχδ(c(x))=tF\chi_{\llbracket\delta\rrbracket}(c(x))=t.

    In 3.7, the family β\beta is only used in the definition of δi+1\delta_{i+1} to characterize the larger block BB that has been split into the smaller blocks SBS\subseteq B and BSB\setminus S. For a cancellative functor, we can replace

    FχSB(c(x))(δi(S),βi(B)) with FχS(c(x))(δi(S)){\ulcorner F\chi_{S}^{B}(c(x))\urcorner}(\delta_{i}(S),\beta_{i}(B))\quad\text{ with }\quad{\ulcorner F\chi_{S}(c(x))\urcorner}(\delta_{i}(S))

    in the definition of δi+1\delta_{i+1}. Hence, we can omit βi\beta_{i} from 3.7 altogether, obtaining the following algorithm, which is again based on coalgebraic partition refinement (3.1).

    Proof A.18 (Proof of A.17).

    Since we put j2:23j_{2}\colon 2\rightarrowtail 3 with j2(0)=1j_{2}(0)=1 and j2(1)=2j_{2}(1)=2, we have j2χS=χSCj_{2}\cdot\chi_{S}=\chi_{S}^{C} for all SCS\subseteq C.

    t(δ)\displaystyle\llbracket{\ulcorner t\urcorner}(\delta)\rrbracket =Fj2(t)(δ,)\displaystyle=\llbracket{\ulcorner Fj_{2}(t)\urcorner}(\delta,\top)\rrbracket (A.16)
    ={xCFχδC(c(x))=Fj2(t)}\displaystyle=\{x\in C\mid F\chi_{\llbracket\delta\rrbracket}^{C}(c(x))=Fj_{2}(t)\} (3.4, =C\llbracket\top\rrbracket=C)
    ={xCFj2(Fχδ(c(x)))=Fj2(t)}\displaystyle=\{x\in C\mid Fj_{2}(F\chi_{\llbracket\delta\rrbracket}(c(x)))=Fj_{2}(t)\} (χδC=j2χδ\chi_{\llbracket\delta\rrbracket}^{C}=j_{2}\cdot\chi_{\llbracket\delta\rrbracket})
    ={xCFχδ(c(x))=t}\displaystyle=\{x\in C\mid F\chi_{\llbracket\delta\rrbracket}(c(x))=t\} (Fj2Fj_{2} injective)

    In the last step, we use that FF preserves injective maps (subsection 2.1)

    Algorithm A.19.

    We extend 3.1 as follows. Initially, define

    δ0([x]P0)=F!(c(x)).\delta_{0}([x]_{P_{0}})={\ulcorner F!(c(x))\urcorner}.

    In the ii-th iteration, extend step (A3) by the additional assignment

    1. (A\!{}^{\prime}1)

      δi+1([x]Pi+1)={δi([x]Pi)if [x]Pi+1=[x]Piδi([x]Pi)FχS(c(x))(δi(S))otherwise.\delta_{i+1}([x]_{P_{i+1}})=\begin{cases}\delta_{i}([x]_{P_{i}})&\text{if }[x]_{P_{i+1}}=[x]_{P_{i}}\\ \delta_{i}([x]_{P_{i}})\wedge{\ulcorner F\chi_{S}(c(x))\urcorner}(\delta_{i}(S))&\text{otherwise.}\\ \end{cases}

    The certificates thus computed are reduced to roughly half the size compared to 3.7; the asymptotic run time and formula size (subsection 3.5) remain unchanged. More importantly:

    Remark 13.

    The certificates constructed by A.19 do not contain negation (or disjunction); they are built from \top, conjunction \wedge, and unary modal operators t{\ulcorner t\urcorner} for tF2t\in F2 (the nullary operators t{\ulcorner t\urcorner} for tF1t\in F1 embed into F2F2).

    Proof A.20 (Details on 13).

    Define the injective map j12:12j_{12}\colon 1\rightarrowtail 2 by j12(0)=1j_{12}(0)=1. Hence, we can also embed the nullary tF1t\in F1 into F2F2:

    t=Fj12(t)()(cf. A.16).{\ulcorner t\urcorner}={\ulcorner Fj_{12}(t)\urcorner}(\top)\qquad\text{(cf.\leavevmode\nobreak\ \autoref{notationF2Mod})}.

    This is compatible with the notations established so far because we have j2j12=j1:13j_{2}\cdot j_{12}=j_{1}\colon 1\rightarrowtail 3 for the inclusions defined in 3.5 and A.16. Thus, we obtain the same modal operator regardless of whether we embed tF1t\in F1 first into F2F2 and from there into F3F3 (j2j_{2}, A.16) or directly into F3F3 (j1j_{1}, 3.5): t=Fj12(t)()=Fj2(Fj12(t))(,)=Fj1(t)(,).{\ulcorner t\urcorner}={\ulcorner Fj_{12}(t)\urcorner}(\top)={\ulcorner Fj_{2}(Fj_{12}(t))\urcorner}(\top,\top)={\ulcorner Fj_{1}(t)\urcorner}(\top,\top).

    Theorem A.21.

    For cancellative functors, A.19 is correct; that is, for all ii\in\mathbb{N} we have:

    SX/Pi:δi(S)=S.\forall S\in X/P_{i}\colon\llbracket\delta_{i}(S)\rrbracket=S.

    Note that the optimized A.19 can also be implemented by directly constructing certificates for the unary modal operators F2F2. That is, one can treat the modal operators F2F2 as first class citizens, in lieu of embedding them into the set F3F3 as we did in A.16. The only difference between the two implementation approaches w.r.t. the size of the formula dag is one edge per modality, namely the edge to the node \top from the node Fj2(FχS(c(x)))(δi(δi),){\ulcorner Fj_{2}(F\chi_{S}(c(x)))\urcorner}(\delta_{i}(\delta_{i}),\top), which arises when step 21 is expanded according to A.16.

    Proof A.22 (Proof of Theorem A.21).

    We prove the desired correctness by induction over ii, the index of loop iterations.

    The definition of δ0\delta_{0} is identical to the definition in 3.7 whence

    δ0(S)=Sfor all SC/P0,\llbracket\delta_{0}(S)\rrbracket=S\qquad\text{for all }S\in C/P_{0},

    proved completely analogously as in the proof of Theorem 3.8.

    In the ii-th iteration with chosen block SC/PiS\in C/P_{i}, we distinguish two cases, whether a block [x]Pi+1C/Pi+1[x]_{P_{i+1}}\in C/P_{i+1} remains the same or is split into other blocks:

    • If [x]Pi+1=[x]Pi[x]_{P_{i+1}}=[x]_{P_{i}}, then we have

      δi+1([x]Pi)=21δi([x]Pi)=I.H.[x]Pi=[x]Pi+1.\llbracket\delta_{i+1}([x]_{P_{i}})\rrbracket\overset{\text{\ref{defDeltai1Optimized}}}{=}\llbracket\delta_{i}([x]_{P_{i}})\rrbracket\overset{\text{I.H.}}{=}[x]_{P_{i}}=[x]_{P_{i+1}}.
    • If [x]Pi+1[x]Pi[x]_{P_{i+1}}\neq[x]_{P_{i}}, we compute as follows:

      δi+1([x]Pi+1)\displaystyle\llbracket\delta_{i+1}([x]_{P_{i+1}})\rrbracket
      =\displaystyle= δi([x]Pi)FχS(c(x))(δi(S))\displaystyle\llbracket\delta_{i}([x]_{P_{i}})\wedge{\ulcorner F\chi_{S}(c(x))\urcorner}(\delta_{i}(S))\rrbracket 21
      =\displaystyle= δi([x]Pi)FχS(c(x))(δi(S))\displaystyle\llbracket\delta_{i}([x]_{P_{i}})\rrbracket\cap\llbracket{\ulcorner F\chi_{S}(c(x))\urcorner}(\delta_{i}(S))\rrbracket
      =\displaystyle= [x]PiFχS(c(x))(δi(S))\displaystyle[x]_{P_{i}}\cap\llbracket{\ulcorner F\chi_{S}(c(x))\urcorner}(\delta_{i}(S))\rrbracket (I.H.)
      =\displaystyle= [x]Pi{xCFχδi(S)(c(x))=FχS(c(x))}\displaystyle[x]_{P_{i}}\cap\{x^{\prime}\in C\mid F\chi_{\llbracket\delta_{i}(S)\rrbracket}(c(x^{\prime}))=F\chi_{S}(c(x))\} (A.17)
      =\displaystyle= [x]Pi{xCFχS(c(x))=FχS(c(x))}\displaystyle[x]_{P_{i}}\cap\{x^{\prime}\in C\mid F\chi_{S}(c(x^{\prime}))=F\chi_{S}(c(x))\} (I.H.)
      =\displaystyle= [x]Pi{xC(x,x)ker(FχSc)}\displaystyle[x]_{P_{i}}\cap\{x^{\prime}\in C\mid(x,x^{\prime})\in\ker(F\chi_{S}\cdot c)\} (def. ker\ker)
      =\displaystyle= [x]Pi[x]FχSc\displaystyle[x]_{P_{i}}\cap[x]_{F\chi_{S}\cdot c} (def. [x]R[x]_{R})
      =\displaystyle= [x]Pi+1\displaystyle[x]_{P_{i+1}}

      The last step is the block-wise definition of Pi+1=Piker(FχSc)P_{i+1}=P_{i}\cap\ker(F\chi_{S}\cdot c) (see A.14).

    Details for section 5 (Domain-Specific Certificates)

    Details for 10.

    For every set XX, define the set (X){\mathcal{B}\!\ell}(X) as terms KK over the grammar

    K::=X|¬K|KK.K::=X\leavevmode\nobreak\ |\leavevmode\nobreak\ \neg K\leavevmode\nobreak\ |\leavevmode\nobreak\ K\wedge K. (18)

    There is an obvious way to evaluate boolean combinations of predicates using the maps

    eX:(2X)2Xe_{X}\colon{\mathcal{B}\!\ell}(2^{X})\to 2^{X}

    defined inductively as follows:

    eX(SX)=X,eX(¬K)=XK,eX(K1K2)=K1K2.e_{X}(S\subseteq X)=X,\qquad e_{X}(\neg K)=X\setminus K,\qquad e_{X}(K_{1}\wedge K_{2})=K_{1}\cap K_{2}.

    Given a signature Λ\Lambda of modal operators λ\lambda and corresponding predicate liftings λ\llbracket\lambda\rrbracket, we can combine all of them. To this end, write Λ\Lambda for the corresponding signature functor (cf. subsection 2.1.3); we define a family of maps ΛX\llbracket\Lambda\rrbracket_{X} as follows:

    ΛX:Λ(2X)=λ/nΛ(2X)n[λ]λΛ2FX.\llbracket\Lambda\rrbracket_{X}\colon\Lambda(2^{X})=\coprod_{\mathord{\raisebox{1.0pt}{$\scriptstyle\lambda$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$\scriptstyle n$}}}\in\Lambda}(2^{X})^{n}\xrightarrow{\leavevmode\nobreak\ \big{[}\llbracket\lambda\rrbracket\big{]}_{\lambda\in\Lambda}\leavevmode\nobreak\ }2^{FX}.

    Since every λX:(2X)n2FX\llbracket\lambda\rrbracket_{X}\colon(2^{X})^{n}\to 2^{FX} is natural in XX, so is ΛX\llbracket\Lambda\rrbracket_{X}. We can replace Λ\Lambda with the signature

    Λ:=n(Λ((n))),\Lambda^{\prime}:=\coprod_{n\in\mathbb{N}}{\mathcal{B}\!\ell}(\Lambda({\mathcal{B}\!\ell}(n))),

    where 𝗂𝗇n(K)Λ\mathsf{in}_{n}(K)\in\Lambda^{\prime}, K(Λ((n)))K\in{\mathcal{B}\!\ell}(\Lambda({\mathcal{B}\!\ell}(n))) has the arity nn. Observe that {\mathcal{B}\!\ell} is functorial; in fact, it is the (free or term) monad for the signature functor ΣX=X+X×X\Sigma X=X+X\times X associated to the grammar in (18). Thus Λ{\mathcal{B}\!\ell}\cdot\Lambda\cdot{\mathcal{B}\!\ell} is a functor, too. Applying the Yoneda-Lemma to this functor, we have for every t/nΛ\mathord{\raisebox{1.0pt}{$t$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$n$}}}\in\Lambda^{\prime} the (natural) family of maps αt\alpha^{t}:

    αXt:Xn(Λ((X)))for every set X.\alpha^{t}_{X}\colon X^{n}\to{\mathcal{B}\!\ell}(\Lambda({\mathcal{B}\!\ell}(X)))\qquad\text{for every set }X.

    Hence, we obtain a predicate lifting for tt by defining:

    tX:((2X)n(Λ((2X)))(Λ(2X))(2FX)2FX).α2Xt(Λ(eX))(ΛX)(eFX)\llbracket t\rrbracket_{X}\colon\!\!\leavevmode\hbox to304.02pt{\vbox to19.8pt{\pgfpicture\makeatletter\hbox{\hskip 152.0075pt\lower-9.75955pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{\offinterlineskip{}{}{{{}}{{}}{{}}{{}}{{}}}{{{}}}{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-152.0075pt}{-9.65971pt}\pgfsys@invoke{ }\hbox{\vbox{\halign{\pgf@matrix@init@row\pgf@matrix@step@column{\pgf@matrix@startcell#\pgf@matrix@endcell}&#\pgf@matrix@padding&&\pgf@matrix@step@column{\pgf@matrix@startcell#\pgf@matrix@endcell}&#\pgf@matrix@padding\cr\hfil\hskip 17.24788pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-12.94234pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${\big{(}(2^{X})^{n}}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}}}&\hskip 17.24788pt\hfil&\hfil\hskip 53.98427pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-29.7618pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${{\mathcal{B}\!\ell}(\Lambda({\mathcal{B}\!\ell}(2^{X})))}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}}}&\hskip 34.06734pt\hfil&\hfil\hskip 45.30365pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-21.08118pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${{\mathcal{B}\!\ell}(\Lambda(2^{X}))}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}}}&\hskip 25.38672pt\hfil&\hfil\hskip 40.13197pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-15.9095pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${{\mathcal{B}\!\ell}(2^{FX})}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}}}&\hskip 20.21504pt\hfil&\hfil\hskip 35.1736pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-10.95113pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${2^{FX}\big{)}.}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}&\hskip 15.25667pt\hfil\cr}}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}{{{{}}}{{}}{{}}{{}}{{}}{{}}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.39998pt}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{-117.31175pt}{-7.15971pt}\pgfsys@lineto{-98.19478pt}{-7.15971pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-97.9948pt}{-7.15971pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-110.51445pt}{-2.9714pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{\alpha^{t}_{2^{X}}}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.39998pt}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{-29.26015pt}{-7.15971pt}\pgfsys@lineto{-10.14317pt}{-7.15971pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-9.94319pt}{-7.15971pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-33.92447pt}{2.6336pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{{\mathcal{B}\!\ell}(\Lambda(e_{X}))}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.39998pt}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{41.43022pt}{-7.15971pt}\pgfsys@lineto{60.5472pt}{-7.15971pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{60.74718pt}{-7.15971pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{35.86781pt}{2.6336pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{{\mathcal{B}\!\ell}(\llbracket\Lambda\rrbracket_{X})}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.39998pt}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{101.77724pt}{-7.15971pt}\pgfsys@lineto{120.89421pt}{-7.15971pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{121.0942pt}{-7.15971pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{100.70181pt}{2.6336pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{{\mathcal{B}\!\ell}(e_{FX})}$} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{ {}{}{}}}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}

    It is a composition of natural transformations and so is itself natural in XX.

    Definition 14.

    Given a modal signature Λ\Lambda for a functor FF, a simple domain-specific interpretation consists of functions τ:F1Λ¯\tau\colon F1\to\bar{\Lambda} and κ:F2Λ¯\kappa\colon F2\to\bar{\Lambda} assigning a nullary modality τo\tau_{o} to each oF1o\in F1 and a unary modality κs\kappa_{s} to each sF2s\in F2 such that the predicate liftings τoX2FX\llbracket\tau_{o}\rrbracket_{X}\in 2^{FX} and κs:2X2FX\llbracket\kappa_{s}\rrbracket\colon 2^{X}\to 2^{FX} satisfy

    τo1={f}(in 2F1)and[s]F!κs2({1})={s}(in 2F2).\llbracket\tau_{o}\rrbracket_{1}=\{f\}\quad\text{(in $2^{F1}$)}\qquad\text{and}\qquad[s]_{F!}\cap\llbracket\kappa_{s}\rrbracket_{2}(\{1\})=\{s\}\qquad\text{(in $2^{F2}$).}
    Proposition A.23.

    Let Λ\Lambda be a modal signature for a cancellative functor FF, and (τ,κ)(\tau,\kappa) a simple domain-specific interpretation. Define λ:F3Λ¯\lambda\colon F3\to\bar{\Lambda} by λt(δ,ρ)=κFχ{2}(t)(δ)\lambda_{t}(\delta,\rho)=\kappa_{F\chi_{{\{2\}}}(t)}(\delta). Then (τ,λ)(\tau,\lambda) is a domain-specific interpretation.

    Proof A.24.

    We verify that (τ,λ)(\tau,\lambda) is a domain-specific interpretation (11) by verifying that for every tF3t\in F3, defining

    τt(δ,ρ)=κFχ{2}(t)(δ)\tau_{t}(\delta,\rho)=\kappa_{F\chi_{{\{2\}}}(t)}(\delta)

    satisfies

    [t]Fχ{1,2}τt3({2},{1})={t}in 2F3.[t]_{F\chi_{\{1,2\}}}\cap\llbracket\tau_{t}\rrbracket_{3}(\{2\},\{1\})=\{t\}\qquad\text{in $2^{F3}$}.

    In the following, we put s:=Fχ{2}(t)F2s:=F\chi_{{\{2\}}}(t)\in F2. By the naturality of the predicate lifting of κs\kappa_{s}, the following square commutes (recall that 2()2^{(-)} is contravariant):

    22{2^{2}}2F2{2^{F2}}23{2^{3}}2F3{2^{F3}}κs2\scriptstyle{\llbracket\kappa_{s}\rrbracket_{2}}2χ{2}\scriptstyle{2^{\chi_{{\{2\}}}}}2Fχ{2}\scriptstyle{2^{F\chi_{{\{2\}}}}}κs3\scriptstyle{\llbracket\kappa_{s}\rrbracket_{3}} (19)

    We thus have:

    τt3({2},{1})\displaystyle\llbracket\tau_{t}\rrbracket_{3}({\{2\}},{\{1\}}) =κs3({2})\displaystyle=\llbracket\kappa_{s}\rrbracket_{3}({\{2\}}) (def. τt\tau_{t})
    =κs3(χ{2}1[{1}])\displaystyle=\llbracket\kappa_{s}\rrbracket_{3}(\chi_{{\{2\}}}^{-1}[{\{1\}}]) (def. χ{2}\chi_{{\{2\}}})
    =κs3(2χ{2}({1}))\displaystyle=\llbracket\kappa_{s}\rrbracket_{3}(2^{\chi_{{\{2\}}}}({\{1\}})) (def. 2()2^{(-)})
    =2Fχ{2}(κs2({1}))\displaystyle=2^{F\chi_{{\{2\}}}}(\llbracket\kappa_{s}\rrbracket_{2}({\{1\}})) (by (19))
    ={tF3Fχ{2}(t)κs2({1})}\displaystyle=\{t^{\prime}\in F3\mid F\chi_{{\{2\}}}(t^{\prime})\in\llbracket\kappa_{s}\rrbracket_{2}({\{1\}})\}

    For every tF3t^{\prime}\in F3, we have

    t[t]Fχ{1,2}τt3({2},{1})\displaystyle t^{\prime}\in[t]_{F\chi_{\{1,2\}}}\cap\llbracket\tau_{t}\rrbracket_{3}(\{2\},\{1\})
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and tτt3({2},{1})\displaystyle t^{\prime}\in[t]_{F\chi_{\{1,2\}}}\text{ and }t^{\prime}\in\llbracket\tau_{t}\rrbracket_{3}(\{2\},\{1\})
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and Fχ{2}(t)κs2({1})\displaystyle t^{\prime}\in[t]_{F\chi_{\{1,2\}}}\text{ and }F\chi_{{\{2\}}}(t^{\prime})\in\llbracket\kappa_{s}\rrbracket_{2}({\{1\}}) (by the above calculation)
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and Fχ{2}(t)[Fχ{2}(t)]F!κs2({1})\displaystyle t^{\prime}\in[t]_{F\chi_{\{1,2\}}}\text{ and }F\chi_{{\{2\}}}(t^{\prime})\in[F\chi_{{\{2\}}}(t^{\prime})]_{F!}\cap\llbracket\kappa_{s}\rrbracket_{2}({\{1\}}) (ker\ker reflexive)
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and Fχ{2}(t)[Fχ{2}(t)]F!κs2({1})\displaystyle t^{\prime}\in[t]_{F\chi_{\{1,2\}}}\text{ and }F\chi_{{\{2\}}}(t^{\prime})\in[F\chi_{{\{2\}}}(t)]_{F!}\cap\llbracket\kappa_{s}\rrbracket_{2}({\{1\}}) (t[t]Fχ{1,2}t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}})
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and Fχ{2}(t)[s]F!κs2({1})\displaystyle t^{\prime}\in[t]_{F\chi_{\{1,2\}}}\text{ and }F\chi_{{\{2\}}}(t^{\prime})\in[s]_{F!}\cap\llbracket\kappa_{s}\rrbracket_{2}({\{1\}}) (def. ss)
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and Fχ{2}(t){s}\displaystyle t^{\prime}\in[t]_{F\chi_{\{1,2\}}}\text{ and }F\chi_{{\{2\}}}(t^{\prime})\in\{s\} (assumption on κs\kappa_{s})
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and Fχ{2}(t){Fχ{2}(t)}\displaystyle t^{\prime}\in[t]_{F\chi_{\{1,2\}}}\text{ and }F\chi_{{\{2\}}}(t^{\prime})\in\{F\chi_{{\{2\}}}(t)\} (def. ss)
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ Fχ{1,2}(t)=Fχ{1,2}(t) and Fχ{2}(t)=Fχ{2}(t)\displaystyle F\chi_{\{1,2\}}(t^{\prime})=F\chi_{\{1,2\}}(t)\text{ and }F\chi_{{\{2\}}}(t^{\prime})=F\chi_{{\{2\}}}(t)
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ Fχ{1,2},Fχ{2}(t)=Fχ{1,2},Fχ{2}(t)\displaystyle\langle F\chi_{\{1,2\}},F\chi_{\{2\}}\rangle(t^{\prime})=\langle F\chi_{\{1,2\}},F\chi_{\{2\}}\rangle(t) (def. ,\langle-,-\rangle)
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ t=t\displaystyle t^{\prime}=t (FF cancellative)

    Note that Fχ{1,2},Fχ{2}\langle F\chi_{\{1,2\}},F\chi_{\{2\}}\rangle is injective because FF is cancellative.

    Details for 5.1.

    1. (a)

      We verify that 5.1.1 indeed provides domain-specific certificate (11). For t𝒫3t\in\mathcal{P}3, we have

      λt(δ,ρ)={¬ρif 2t1δρif 2t1¬δif 2t1if 2t1\lambda_{t}(\delta,\rho)\leavevmode\nobreak\ =\leavevmode\nobreak\ \begin{cases}\neg\Diamond\rho&\text{if }2\in t\not\mkern 1.0mu\ni 1\\ \Diamond\delta\wedge\Diamond\rho&\text{if }2\in t\ni 1\\ \neg\Diamond\delta&\text{if }2\not\in t\ni 1\\ \top&\text{if }2\not\in t\not\mkern 1.0mu\ni 1\\ \end{cases}

      We proceed by the following case distinction:

      • If 1𝒫χ{1,2}(t)1\notin\mathcal{P}\chi_{{\{1,2\}}}(t), then t=t=\emptyset or t={0}t=\{0\}. In both cases we have [t]𝒫χ1,2={t}[t]_{\mathcal{P}\chi_{1,2}}=\{t\}. Since λt(δ,ρ)=\lambda_{t}(\delta,\rho)=\top,

        [t]𝒫χ1,2λt3({2},{1})={t}[t]_{\mathcal{P}\chi_{1,2}}\cap\llbracket\lambda_{t}\rrbracket_{3}({\{2\}},{\{1\}})=\{t\}

        as desired.

      • If 1𝒫χ{1,2}(t)1\in\mathcal{P}\chi_{{\{1,2\}}}(t), then 2t2\in t or 1t1\in t. This yields

        2t1\displaystyle 2\in t\not\mkern 1.0mu\ni 1 (δ,ρ)¬ρλt3({2},{1})={tF31t}\displaystyle\Longrightarrow\leavevmode\nobreak\ \llbracket\overbrace{(\delta,\rho)\mapsto\mathrlap{\neg\Diamond\rho}\phantom{\Diamond\delta\wedge\Diamond\rho}}^{\textstyle\lambda_{t}}\rrbracket_{3}({\{2\}},{\{1\}})=\{t^{\prime}\in F3\mid 1\notin t^{\prime}\}
        2t1\displaystyle 2\in t\ni 1 (δ,ρ)δρ3({2},{1})={tF32t and 1t}\displaystyle\Longrightarrow\leavevmode\nobreak\ \llbracket(\delta,\rho)\mapsto\Diamond\delta\wedge\Diamond\rho\rrbracket_{3}({\{2\}},{\{1\}})=\{t^{\prime}\in F3\mid 2\in t^{\prime}\text{ and }1\in t^{\prime}\}
        2t1\displaystyle 2\notin t\ni 1 (δ,ρ)¬δ3({2},{1})={tF32t}\displaystyle\Longrightarrow\leavevmode\nobreak\ \llbracket(\delta,\rho)\mapsto\mathrlap{\neg\Diamond\delta}\phantom{\Diamond\delta\wedge\Diamond\rho}\rrbracket_{3}({\{2\}},{\{1\}})=\{t^{\prime}\in F3\mid 2\notin t^{\prime}\}

        Consequently, we have for every tλt3({2},{1})t^{\prime}\in\llbracket\lambda_{t}\rrbracket_{3}({\{2\}},{\{1\}}) that

        1t iff 1tand2t iff 2t.\text{$1\in t$ iff $1\in t^{\prime}$}\qquad\text{and}\qquad\text{$2\in t$ iff $2\in t^{\prime}$}.

        To conclude, note that if t[t]𝒫χ{1,2}t^{\prime}\in[t]_{\mathcal{P}\chi_{{\{1,2\}}}} then 0t0\in t^{\prime} iff 0t0\in t. Thus

        [t]𝒫χ{1,2}λt3({2},{1})={t}.[t]_{\mathcal{P}\chi_{\{1,2\}}}\cap\llbracket\lambda_{t}\rrbracket_{3}(\{2\},\{1\})=\{t\}.
    2. (b)

      5.1.2: For the verification for signature functors, define a helper map v:Σ2𝒫fv\colon\Sigma 2\to{\mathcal{P}_{\textsf{f}}}\mathbb{N} by v(σ(x1,,xn))v(\sigma(x_{1},\ldots,x_{n})) ={ixi=1}=\{i\in\mathbb{N}\mid x_{i}=1\}. The predicate lifting for the (unary) modal operator =I{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}\raisebox{-1.0pt}{$\scriptstyle I$}$}}\rangle}, for II\subseteq\mathbb{N}, is obtained from A.1 by the predicate fI:Σ22f_{I}\colon\Sigma 2\to 2 corresponding to the set

      fI={tΣ2v(t)=I}.f_{I}=\{t\in\Sigma 2\mid v(t)=I\}.

      This gives rise to the predicate lifting

      =IX(P)\displaystyle\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}\raisebox{-1.0pt}{$\scriptstyle I$}$}}\rangle}\rrbracket_{X}(P) ={tΣXFχP(t)fI}\displaystyle=\{t\in\Sigma X\mid F\chi_{P}(t)\in f_{I}\} (A.1)
      ={tΣXv(FχP(t))=I}.\displaystyle=\{t\in\Sigma X\mid v(F\chi_{P}(t))=I\}. (def. fIf_{I})

      Similarly, for the nullary modal operator σ\sigma (for the nn-ary operation symbol σ/nΣ\mathord{\raisebox{1.0pt}{$\sigma$}\mkern-1.5mu/\mkern-1.5mu{\raisebox{-1.0pt}{$n$}}}\in\Sigma), take Σ12\Sigma 1\to 2 given by the set

      gσ={σ(0,,0)}g_{\sigma}=\{\sigma(0,\ldots,0)\}

      (noting that 20=12^{0}=1). This gives rise to the predicate lifting

      σX\displaystyle\llbracket\sigma\rrbracket_{X} ={tΣXF!(t)gσ}\displaystyle=\{t\in\Sigma X\mid F!(t)\in g_{\sigma}\} (A.1)
      ={tΣXFχP(t){σ(0,,0)}}\displaystyle=\big{\{}t\in\Sigma X\mid F\chi_{P}(t)\in\{\sigma(0,\ldots,0)\}\big{\}} (def. gσg_{\sigma})
      ={σ(x1,,xn)x1,,xnX}.\displaystyle=\{\sigma(x_{1},\ldots,x_{n})\mid x_{1},\ldots,x_{n}\in X\}.

      For the verification of the (simple) domain-specific interpretation (14), we put

      κs(δ):==v(s)δfor sΣ2\kappa_{s}(\delta):={\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}v(s)$}}\rangle}\delta\qquad\text{for }s\in\Sigma 2

      with then induces the claimed λt\lambda_{t} via A.23:

      λσ(x1,,xn)(δ,ρ)=={ixi=2}δfor σ(x1,,xn)Σ3\lambda_{\sigma(x_{1},\ldots,x_{n})}(\delta,\rho)={\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}\{i\in\mathbb{N}\mid x_{i}=2\}$}}\rangle}\delta\qquad\text{for }\sigma(x_{1},\ldots,x_{n})\in\Sigma 3

      There is nothing to show for τo:=σ\tau_{o}:=\sigma since it has the correct semantics by the definition of σ1\llbracket\sigma\rrbracket_{1}. Note that F!,v:Σ2Σ1×𝒫f\langle F!,v\rangle\colon\Sigma 2\to\Sigma 1\times{\mathcal{P}_{\textsf{f}}}\mathbb{N} is injective because for every sΣ2s\in\Sigma 2 the operation symbol and all its parameters (from 22) are uniquely determined by F!(s)F!(s) and v(s)v(s). For κs:==v(s)\kappa_{s}:={\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}v(s)$}}\rangle}, sF2s\in F2, we have

      [s]F!={sF2F!(s)=F!(s)}.[s]_{F!}=\{s^{\prime}\in F2\mid F!(s)=F!(s^{\prime})\}.

      Thus, we compute

      [s]F!κs2({1})\displaystyle[s]_{F!}\cap\llbracket\kappa_{s}\rrbracket_{2}({\{1\}})
      =\displaystyle=\leavevmode\nobreak\ {sΣ2s[s]F! and sκs2({1})}\displaystyle\{s^{\prime}\in\Sigma 2\mid s^{\prime}\in[s]_{F!}\text{ and }s^{\prime}\in\llbracket\kappa_{s}\rrbracket_{2}({\{1\}})\}
      =\displaystyle=\leavevmode\nobreak\ {sΣ2F!(s)=F!(s) and s=v(s)2({1})}\displaystyle\{s^{\prime}\in\Sigma 2\mid F!(s)=F!(s^{\prime})\text{ and }s^{\prime}\in\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}v(s)$}}\rangle}\rrbracket_{2}({\{1\}})\}
      =\displaystyle=\leavevmode\nobreak\ {sΣ2F!(s)=F!(s) and v(Fχ{1}(s))=v(s)}\displaystyle\{s^{\prime}\in\Sigma 2\mid F!(s)=F!(s^{\prime})\text{ and }v(F\chi_{{\{1\}}}(s^{\prime}))=v(s)\} (def. =v(s)2\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}v(s)$}}\rangle}\rrbracket_{2})
      =\displaystyle=\leavevmode\nobreak\ {sΣ2F!(s)=F!(s) and v(s)=v(s)}\displaystyle\{s^{\prime}\in\Sigma 2\mid F!(s)=F!(s^{\prime})\text{ and }v(s^{\prime})=v(s)\} (𝗂𝖽2=χ{1}:22\mathsf{id}_{2}=\chi_{{\{1\}}}\colon 2\to 2)
      =\displaystyle=\leavevmode\nobreak\ {sΣ2F!,v(s)=F!,v(s)}\displaystyle\{s^{\prime}\in\Sigma 2\mid\langle F!,v\rangle(s)=\langle F!,v\rangle(s^{\prime})\} (def. ,\langle-,-\rangle)
      =\displaystyle=\leavevmode\nobreak\ {s}\displaystyle\{s\} (F!,v\langle F!,v\rangle injective)
    3. (c)

      5.1.3: For every mMm\in M, define the map

      fm:M(2)2with{μM(2)μ(1)=m}.f_{m}\colon M^{(2)}\to 2\qquad\text{with}\qquad\{\mu\in M^{(2)}\mid\mu(1)=m\}.

      which gives rise to the predicate lifting of the unary modal operator =m{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}m$}}\rangle}:

      =mX(P)\displaystyle\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}m$}}\rangle}\rrbracket_{X}(P) ={μM(X)M(P)(μ)fm}\displaystyle=\{\mu\in M^{(X)}\mid M^{(P)}(\mu)\in f_{m}\} (A.1)
      ={μM(X)M(P)(μ)(1)=m}\displaystyle=\{\mu\in M^{(X)}\mid M^{(P)}(\mu)(1)=m\} (def. fmf_{m})

      For the verification of the axioms of the domain-specific interpretation (11), we have that τ\tau satisfies the axiom:

      τo1==o(0)1\displaystyle\llbracket\tau_{o}\rrbracket_{1}=\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}o(0)$}}\rangle}\top\rrbracket_{1} ={μM(1)x1μ(x)=o(0)}\displaystyle=\{\mu\in M^{(1)}\mid\sum_{x\in\llbracket\top\rrbracket_{1}}\mu(x)=o(0)\}
      ={μM(1)μ(0)=o(0)}={o}\displaystyle=\{\mu\in M^{(1)}\mid\mu(0)=o(0)\}=\{o\} (1=1={0}\llbracket\top\rrbracket_{1}=1=\{0\})

      For the other component of the domain-specific interpretation, we proceed by case distinction:

      • If MM is non-cancellative, we have λt(δ,ρ)==t(2)δ=t(1)ρ\lambda_{t}(\delta,\rho)={\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}t(2)$}}\rangle}\delta\wedge{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}t(1)$}}\rangle}\rho for tM(3)t\in M^{(3)} and thus we have for every tM(3)t^{\prime}\in M^{(3)}:

        t([t]Fχ{1,2}λt3({2},{1}))\displaystyle t^{\prime}\in([t]_{F\chi_{{\{1,2\}}}}\cap\llbracket\lambda_{t}\rrbracket_{3}({\{2\}},{\{1\}}))
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and tλt3({2},{1})\displaystyle t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}}\text{ and }t^{\prime}\in\llbracket\lambda_{t}\rrbracket_{3}({\{2\}},{\{1\}})
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and t(δ,ρ)=t(2)δ=t(1)ρ3({2},{1})\displaystyle t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}}\text{ and }t^{\prime}\in\llbracket(\delta,\rho)\mapsto{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}t(2)$}}\rangle}\delta\wedge{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}t(1)$}}\rangle}\rho\rrbracket_{3}({\{2\}},{\{1\}}) (def. λt\lambda_{t})
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and t=t(2)3({2})=t(1)3({1})\displaystyle t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}}\text{ and }t^{\prime}\in\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}t(2)$}}\rangle}\rrbracket_{3}({\{2\}})\cap\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}t(1)$}}\rangle}\rrbracket_{3}({\{1\}})
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and t=t(2)3({2}) and t=t(1)3({1})\displaystyle t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}}\text{ and }t^{\prime}\in\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}t(2)$}}\rangle}\rrbracket_{3}({\{2\}})\text{ and }t^{\prime}\in\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}t(1)$}}\rangle}\rrbracket_{3}({\{1\}})
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and t(2)=t(2) and t(1)=t(1)\displaystyle t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}}\text{ and }t^{\prime}(2)=t(2)\text{ and }t^{\prime}(1)=t(1) (def. =m\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}m$}}\rangle}\rrbracket)
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ t(0)=t(0) and t(1)+t(2)=t(1)+t(2)\displaystyle t^{\prime}(0)=t(0)\text{ and }t^{\prime}(1)+t^{\prime}(2)=t(1)+t(2)
         and t(2)=t(2) and t(1)=t(1)\displaystyle\leavevmode\nobreak\ \leavevmode\nobreak\ \leavevmode\nobreak\ \leavevmode\nobreak\ \leavevmode\nobreak\ \text{ and }t^{\prime}(2)=t(2)\text{ and }t^{\prime}(1)=t(1)
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ t(0)=t(0) and t(2)=t(2) and t(1)=t(1)\displaystyle t^{\prime}(0)=t(0)\text{ and }t^{\prime}(2)=t(2)\text{ and }t^{\prime}(1)=t(1)
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ t=t\displaystyle t^{\prime}=t
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ t{t}\displaystyle t^{\prime}\in\{t\}
      • If MM is cancellative, we put κs(δ)==s(1)δ\kappa_{s}(\delta)={\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}s(1)$}}\rangle}\,\delta for sM(2)s\in M^{(2)}, which then induces λt(δ,ρ)==s(2)δ\lambda_{t}(\delta,\rho)={\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}s(2)$}}\rangle}\,\delta via A.23. We verify 14 for all sM(2)s^{\prime}\in M^{(2)}:

        s([s]F!κs2({1}))\displaystyle s^{\prime}\in([s]_{F!}\cap\llbracket\kappa_{s}\rrbracket_{2}(\{1\}))
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ s[s]F! and sκs2({1})\displaystyle s^{\prime}\in[s]_{F!}\text{ and }s^{\prime}\in\llbracket\kappa_{s}\rrbracket_{2}(\{1\})
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ F!(s)=F!(s) and s=s(1)2({1})\displaystyle F!(s^{\prime})=F!(s)\text{ and }s^{\prime}\in\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}s(1)$}}\rangle}\rrbracket_{2}(\{1\}) (def. κs\kappa_{s})
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ F!(s)=F!(s) and x{1}s(x)=s(1)\displaystyle F!(s^{\prime})=F!(s)\text{ and }\sum_{x\in\{1\}}s^{\prime}(x)=s(1) (def. =s(1){\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}s(1)$}}\rangle})
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ F!(s)=F!(s) and s(1)=s(1)\displaystyle F!(s^{\prime})=F!(s)\text{ and }s^{\prime}(1)=s(1)
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ s(0)+s(1)=s(0)+s(1) and s(1)=s(1)\displaystyle s^{\prime}(0)+s^{\prime}(1)=s(0)+s(1)\text{ and }s^{\prime}(1)=s(1)
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ s(0)=s(0) and s(1)=s(1)\displaystyle s^{\prime}(0)=s(0)\text{ and }s^{\prime}(1)=s(1) (MM cancellative)
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ s=s\displaystyle s^{\prime}=s
        \displaystyle\Leftrightarrow\leavevmode\nobreak\ s{s}\displaystyle s^{\prime}\in\{s\}
    4. (d)

      5.1.4: For FX=(𝒟X+1)AFX=({\mathcal{D}}X+1)^{A}, the predicate lifting of ap\langle a\rangle_{p}, aAa\in A, p[0,1]p\in[0,1] is:

      apX(S):={if tFXp>0 then t(a)𝒟X and xSt(a)(x)p}\llbracket\langle a\rangle_{p}\rrbracket_{X}(S):=\{\text{if }t\in FX\mid p>0\text{ then }t(a)\in{\mathcal{D}}X\text{ and }\sum_{x\in S}t(a)(x)\geq p\}

      first note that

      a11={oF1o(a)𝒟1} and ¬a11={oF1o(a)1}.\llbracket\langle a\rangle_{1}\top\rrbracket_{1}=\{o\in F1\mid o(a)\in{\mathcal{D}}1\}\qquad\text{ and }\qquad\llbracket\neg\langle a\rangle_{1}\top\rrbracket_{1}=\{o\in F1\mid o(a)\in 1\}.

      Thus, we have:

      τo1\displaystyle\llbracket\tau_{o}\rrbracket_{1} =aAo(a)𝒟1a1aAo(a)1¬a11\displaystyle=\big{\llbracket}\bigwedge_{\begin{subarray}{c}a\in A\\ o(a)\in{\mathcal{D}}1\end{subarray}}\langle a\rangle_{1}\top\wedge\bigwedge_{\begin{subarray}{c}a\in A\\ o(a)\in 1\end{subarray}}\neg\langle a\rangle_{1}\top\big{\rrbracket}_{1}
      =aAo(a)𝒟1{oF1o(a)𝒟1}aAo(a)1{oF1o(a)1}={o}\displaystyle=\bigcap_{\begin{subarray}{c}a\in A\\ o(a)\in{\mathcal{D}}1\end{subarray}}\{o^{\prime}\in F1\mid o^{\prime}(a)\in{\mathcal{D}}1\}\cap\bigcap_{\begin{subarray}{c}a\in A\\ o(a)\in 1\end{subarray}}\{o^{\prime}\in F1\mid o^{\prime}(a)\in 1\}=\{o\}

      For the axiom of λt\lambda_{t}, tF3=(𝒟3+1)At\in F3=({\mathcal{D}}3+1)^{A}, we verify for all tF3t^{\prime}\in F3, where the crucial step is the arithmetic argument for replacing the inequalities by equalities:

      t([t]Fχ{1,2}λt3({2},{1}))\displaystyle t^{\prime}\in([t]_{F\chi_{{\{1,2\}}}}\cap\llbracket\lambda_{t}\rrbracket_{3}({\{2\}},{\{1\}}))
      \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and tλt3({2},{1})\displaystyle t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}}\text{ and }t^{\prime}\llbracket\lambda_{t}\rrbracket_{3}({\{2\}},{\{1\}})
      \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and t(δ,ρ)aAt(a)𝒟3(at(a)(2)δat(a)(1)ρ)3({2},{1})\displaystyle t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}}\text{ and }t^{\prime}\in\big{\llbracket}(\delta,\rho)\mapsto\bigwedge_{\begin{subarray}{c}a\in A\\ t(a)\in{\mathcal{D}}3\end{subarray}}(\langle a\rangle_{t(a)(2)}\,\delta\wedge\langle a\rangle_{t(a)(1)}\,\rho)\big{\rrbracket}_{3}({\{2\}},{\{1\}})
      \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and taAt(a)𝒟3(δ,ρ)at(a)(2)δat(a)(1)ρ3({2},{1})\displaystyle t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}}\text{ and }t^{\prime}\in\bigcap_{\begin{subarray}{c}a\in A\\ t(a)\in{\mathcal{D}}3\end{subarray}}\llbracket(\delta,\rho)\mapsto\langle a\rangle_{t(a)(2)}\,\delta\wedge\langle a\rangle_{t(a)(1)}\,\rho\rrbracket_{3}({\{2\}},{\{1\}})
      \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and taAt(a)𝒟3at(a)(2)3({2})at(a)(1)3({1})\displaystyle t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}}\text{ and }t^{\prime}\in\bigcap_{\begin{subarray}{c}a\in A\\ t(a)\in{\mathcal{D}}3\end{subarray}}\llbracket\langle a\rangle_{t(a)(2)}\rrbracket_{3}({\{2\}})\cap\llbracket\langle a\rangle_{t(a)(1)}\rrbracket_{3}({\{1\}})
      \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and aA,t(a)𝒟3:tat(a)(2)3({2})at(a)(1)3({1})\displaystyle t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}}\text{ and }\forall a\in A,t(a)\in{\mathcal{D}}3:t^{\prime}\in\llbracket\langle a\rangle_{t(a)(2)}\rrbracket_{3}({\{2\}})\cap\llbracket\langle a\rangle_{t(a)(1)}\rrbracket_{3}({\{1\}})
      \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]Fχ{1,2} and aA,t(a)𝒟3:t(a)(2)t(a)(2)t(a)(1)t(a)(1)\displaystyle t^{\prime}\in[t]_{F\chi_{{\{1,2\}}}}\text{ and }\forall a\in A,t(a)\in{\mathcal{D}}3:t^{\prime}(a)(2)\geq t(a)(2)\wedge t^{\prime}(a)(1)\geq t(a)(1) (Def. ap\llbracket\langle a\rangle p\rrbracket)
      \displaystyle\Leftrightarrow\leavevmode\nobreak\ aA:(t(a)1t(a)1) and if a𝒟3 then:\displaystyle\forall a\in A\colon(t^{\prime}(a)\in 1\leftrightarrow t(a)\in 1)\text{ and if }a\in{\mathcal{D}}3\text{ then:}
      t(a)(0)=t(a)(0),t(a)(1)+t(a)(2)=t(a)(1)+t(a)(2),\displaystyle\qquad t^{\prime}(a)(0)=t(a)(0),\leavevmode\nobreak\ \leavevmode\nobreak\ t^{\prime}(a)(1)+t^{\prime}(a)(2)=t(a)(1)+t(a)(2),
      t(a)(2)t(a)(2),t(a)(1)t(a)(1)\displaystyle\qquad t^{\prime}(a)(2)\geq t(a)(2),\leavevmode\nobreak\ \leavevmode\nobreak\ t^{\prime}(a)(1)\geq t(a)(1)
      \displaystyle\Leftrightarrow\leavevmode\nobreak\ aA:(t(a)1t(a)1) and if a𝒟3 then:\displaystyle\forall a\in A\colon(t^{\prime}(a)\in 1\leftrightarrow t(a)\in 1)\text{ and if }a\in{\mathcal{D}}3\text{ then:}
      t(a)(0)=t(a)(0),t(a)(1)=t(a)(2),t(a)(2)=t(a)(2)\displaystyle\qquad t^{\prime}(a)(0)=t(a)(0),\leavevmode\nobreak\ \leavevmode\nobreak\ t^{\prime}(a)(1)=t(a)(2),\leavevmode\nobreak\ \leavevmode\nobreak\ t^{\prime}(a)(2)=t(a)(2) (arithmetic)
      \displaystyle\Leftrightarrow\leavevmode\nobreak\ aA:(t(a)1t(a)1) and if a𝒟3 then t(a)=t(a)\displaystyle\forall a\in A\colon(t^{\prime}(a)\in 1\leftrightarrow t(a)\in 1)\text{ and if }a\in{\mathcal{D}}3\text{ then }t^{\prime}(a)=t(a)
      \displaystyle\Leftrightarrow\leavevmode\nobreak\ t{t}\displaystyle t^{\prime}\in{\{t\}}

    Proof of 5.2.

    Lemma A.25.

    Let (τ,λ)(\tau,\lambda) be a domain-specific interpretation for FF. For all tFCt\in FC and SBCS\subseteq B\subseteq C we have:

    ([t]FχBλFχSB(t)C(S,BS))=[t]FχSBin 2FC.\big{(}[t]_{F\chi_{B}}\leavevmode\nobreak\ \cap\leavevmode\nobreak\ \llbracket\lambda_{F\chi_{S}^{B}(t)}\rrbracket_{C}(S,B\setminus S)\big{)}=[t]_{F\chi_{S}^{B}}\qquad\text{in $2^{FC}$.}
    Proof A.26.

    Put d:=FχSB(t)d:=F\chi_{S}^{B}(t); the naturality square of λd\llbracket\lambda_{d}\rrbracket for χSB:C3\chi_{S}^{B}\colon C\to 3 is

    23×23{2^{3}\times 2^{3}}2F3{2^{F3}}2C×2C{2^{C}\times 2^{C}}2FC{2^{FC}}λd3\scriptstyle{\llbracket\lambda_{d}\rrbracket_{3}}2χSB×2χSB\scriptstyle{2^{\chi_{S}^{B}}\times 2^{\chi_{S}^{B}}}2FχSB\scriptstyle{2^{F\chi_{S}^{B}}}λdC\scriptstyle{\llbracket\lambda_{d}\rrbracket_{C}}

    Hence:

    (FχSB)1[λd3({2},{1})]\displaystyle(F\chi_{S}^{B})^{-1}\big{[}\llbracket\lambda_{d}\rrbracket_{3}({\{2\}},{\{1\}})\big{]} =λdC((χSB)1[{2}],(χSB)1[{1}])\displaystyle=\llbracket\lambda_{d}\rrbracket_{C}((\chi_{S}^{B})^{-1}[{\{2\}}],(\chi_{S}^{B})^{-1}[{\{1\}}])
    =λdC(B,BS).\displaystyle=\llbracket\lambda_{d}\rrbracket_{C}(B,B\setminus S). (*)

    Now we verify for every tFCt^{\prime}\in FC that

    t([t]FχBλFχSB(t)C(S,BS))\displaystyle t^{\prime}\in\big{(}[t]_{F\chi_{B}}\leavevmode\nobreak\ \cap\leavevmode\nobreak\ \llbracket\lambda_{F\chi_{S}^{B}(t)}\rrbracket_{C}(S,B\setminus S)\big{)}
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]FχB and tλFχSB(t)C(S,BS)\displaystyle t^{\prime}\in[t]_{F\chi_{B}}\text{ and }t^{\prime}\in\llbracket\lambda_{F\chi_{S}^{B}(t)}\rrbracket_{C}(S,B\setminus S)
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]FχB and t(FχSB)1[λFχSB(t)3({2},{1})]\displaystyle t^{\prime}\in[t]_{F\chi_{B}}\text{ and }t^{\prime}\in(F\chi_{S}^{B})^{-1}\big{[}\llbracket\lambda_{F\chi_{S}^{B}(t)}\rrbracket_{3}({\{2\}},{\{1\}})\big{]} (*)
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ FχSB(t)[FχSB(t)]Fχ{1,2} and FχSB(t)λFχSB(t)3({2},{1})\displaystyle F\chi_{S}^{B}(t^{\prime})\in[F\chi_{S}^{B}(t)]_{F\chi_{{\{1,2\}}}}\text{ and }F\chi_{S}^{B}(t^{\prime})\in\llbracket\lambda_{F\chi_{S}^{B}(t)}\rrbracket_{3}({\{2\}},{\{1\}}) (χ{1,2}χSB=χB\chi_{{\{1,2\}}}\cdot\chi_{S}^{B}=\chi_{B})
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ FχSB(t)[FχSB(t)]Fχ{1,2}λFχSB(t)3({2},{1})\displaystyle F\chi_{S}^{B}(t^{\prime})\in[F\chi_{S}^{B}(t)]_{F\chi_{{\{1,2\}}}}\cap\llbracket\lambda_{F\chi_{S}^{B}(t)}\rrbracket_{3}({\{2\}},{\{1\}})
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ FχSB(t){FχSB(t)}\displaystyle F\chi_{S}^{B}(t^{\prime})\in\{F\chi_{S}^{B}(t)\} (11)
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ FχSB(t)=FχSB(t)\displaystyle F\chi_{S}^{B}(t^{\prime})=F\chi_{S}^{B}(t)
    \displaystyle\Leftrightarrow\leavevmode\nobreak\ t[t]FχSB.\displaystyle t^{\prime}\in[t]_{F\chi_{S}^{B}}.
    Proof A.27 (Proof of 5.2).

    We prove by induction over the index ii of main loop iterations that T(δi([x]Pi))T(\delta_{i}([x]_{P_{i}})) and T(βi([x]Qi))T(\beta_{i}([x]_{Q_{i}})) are a certificates for [x]Pi[x]_{P_{i}} and [x]Qi[x]_{Q_{i}}, respectively. (In the cancellative case, QiQ_{i} and βi\beta_{i} are not defined; so just put C/Qi={C}C/Q_{i}=\{C\}, βi(C)=\beta_{i}(C)=\top for convenience.)

    1. (a)

      For i=0i=0, we trivially have

      T(β0([x]Pi))=T()==C.\llbracket T(\beta_{0}([x]_{P_{i}}))\rrbracket=\llbracket T(\top)\rrbracket=\llbracket\top\rrbracket=C.

      Furthermore, unravelling 3.5,

      δ0([x]P0)=F!(c(x))=Fj1(F!(c(x)))(,).\delta_{0}([x]_{P_{0}})={\ulcorner F!(c(x))\urcorner}={\ulcorner Fj_{1}(F!(c(x)))\urcorner}(\top,\top).

      Consequently,

      T(δ0([x]P0))=τF!(Fj1(F!(c(x))))=τF!(c(x))T(\delta_{0}([x]_{P_{0}}))=\tau_{F!(Fj_{1}(F!(c(x))))}=\tau_{F!(c(x))}

      using !j1!=!:C1!\cdot j_{1}\cdot\mathord{!}=\mathord{!}\colon C\to 1. The naturality of τo\llbracket\tau_{o}\rrbracket, oF1o\in F1, implies that τoX={tFXF!(t)=o}\llbracket\tau_{o}\rrbracket_{X}=\{t\in FX\mid F!(t)=o\}. Hence,

      T(δ0([x]P0))=c1[τF!(c(x))C]={xCF!(c(x))=F!(c(x))}=[x]P0.\llbracket T(\delta_{0}([x]_{P_{0}}))\rrbracket=c^{-1}[\llbracket\tau_{F!(c(x))}\rrbracket_{C}]=\{x^{\prime}\in C\mid F!(c(x^{\prime}))=F!(c(x))\}=[x]_{P_{0}}.
    2. (b)

      In the inductive step, there is nothing to show for βi+1\beta_{i+1} because it is only a boolean combination of βi\beta_{i} and δi\delta_{i}. For δi+1\delta_{i+1}, we distinguish two cases: whether the class [x]Pi[x]_{P_{i}} is refined or not. If [x]Pi+1=[x]Pi[x]_{P_{i+1}}=[x]_{P_{i}}, then

      T(δi+1([x]Pi+1))=T(δi([x]Pi))=[x]Pi,\llbracket T(\delta_{i+1}([x]_{P_{i+1}}))\rrbracket=\llbracket T(\delta_{i}([x]_{P_{i}}))\rrbracket=[x]_{P_{i}},

      and we are done. Now suppose that [x]Pi+1[x]Pi[x]_{P_{i+1}}\neq[x]_{P_{i}} in the ii-th iteration with chosen SBCS\subsetneqq B\subseteq C. By (A’3) resp. 21 we have:

      δi+1([x]Pi+1)=δi([x]Pi)t(δi(S),β)\delta_{i+1}([x]_{P_{i+1}})=\delta_{i}([x]_{P_{i}})\wedge{\ulcorner t\urcorner}(\delta_{i}(S),\beta^{\prime})

      where β\beta^{\prime} is βi(B)\beta_{i}(B) or \top; in any case δi(S)=Sβ\llbracket\delta_{i}(S)\rrbracket=S\subseteq\llbracket\beta^{\prime}\rrbracket. Note that tt here is either FχSB(c(x))F\chi_{S}^{B}(c(x)) (3.7) or Fj2(FχS(c(x)))Fj_{2}(F\chi_{S}(c(x))) (A.19). Put B=BB^{\prime}=B in the first case and B=CB^{\prime}=C else. Using χSC=j2χS\chi_{S}^{C}=j_{2}\cdot\chi_{S}, we see that

      t=FχSB(c(x))β=B,andT(β)=B,t=F\chi_{S}^{B^{\prime}}(c(x))\qquad\llbracket\beta^{\prime}\rrbracket=B^{\prime},\qquad\text{and}\qquad\llbracket T(\beta^{\prime})\rrbracket=B^{\prime},

      where the last equation follows from the inductive hypothesis. Thus, we have

      δi+1([x]Pi+1)=δi([x]Pi)FχSB(c(x))(δi(S),β),\delta_{i+1}([x]_{P_{i+1}})=\delta_{i}([x]_{P_{i}})\wedge{\ulcorner F\chi_{S}^{B^{\prime}}(c(x))\urcorner}(\delta_{i}(S),\beta^{\prime}),

      and therefore

      T(δi+1([x]Pi+1))=T(δi([x]Pi))λFχSB(c(x))(T(δi(S)),T(β)¬T(δi(S))).T(\delta_{i+1}([x]_{P_{i+1}}))=T(\delta_{i}([x]_{P_{i}}))\wedge\lambda_{F\chi_{S}^{B^{\prime}}(c(x))}\big{(}T(\delta_{i}(S)),T(\beta^{\prime})\wedge\neg T(\delta_{i}(S))\big{)}.

      Moreover, we have

      Pi+1=Piker(FχSBc),P_{i+1}=P_{i}\cap\ker(F\chi_{S}^{B^{\prime}}\cdot c),

      in the first case by item (A3), in the second case by A.14, recalling that χS=χSC\chi_{S}=\chi_{S}^{C}.

      We are now prepared for our final computation:

      T(δi+1([x]Pi+1))\displaystyle\llbracket T(\delta_{i+1}([x]_{P_{i+1}}))\rrbracket
      =\displaystyle=\leavevmode\nobreak\ T(δi([x]Pi))λFχSB(c(x))(T(δi(S)),T(β)¬T(δi(S)))\displaystyle\llbracket T(\delta_{i}([x]_{P_{i}}))\wedge\lambda_{F\chi_{S}^{B^{\prime}}(c(x))}(T(\delta_{i}(S)),T(\beta^{\prime})\wedge\neg T(\delta_{i}(S)))\rrbracket
      =\displaystyle=\leavevmode\nobreak\ T(δi([x]Pi))λFχSB(c(x))(T(δi(S)),T(β)¬T(δi(S)))\displaystyle\llbracket T(\delta_{i}([x]_{P_{i}}))\rrbracket\cap\llbracket\lambda_{F\chi_{S}^{B^{\prime}}(c(x))}(T(\delta_{i}(S)),T(\beta^{\prime})\wedge\neg T(\delta_{i}(S)))\rrbracket
      =\displaystyle=\leavevmode\nobreak\ T(δi([x]Pi))c1[λFχSB(c(x))C(T(δi(S)),T(β)CT(δi(S)))]\displaystyle\llbracket T(\delta_{i}([x]_{P_{i}}))\rrbracket\cap c^{-1}\big{[}\llbracket\lambda_{F\chi_{S}^{B^{\prime}}(c(x))}\rrbracket_{C}(\llbracket T(\delta_{i}(S))\rrbracket,\llbracket T(\beta^{\prime})\rrbracket\cap C\setminus\llbracket T(\delta_{i}(S))\rrbracket)\big{]} (Semantics of \heartsuit)
      =\displaystyle=\leavevmode\nobreak\ [x]Pic1[λFχSB(c(x))C(S,BCS)]\displaystyle[x]_{P_{i}}\cap c^{-1}\big{[}\llbracket\lambda_{F\chi_{S}^{B^{\prime}}(c(x))}\rrbracket_{C}(S,B^{\prime}\cap C\setminus S)\big{]} (I.H.)
      =\displaystyle=\leavevmode\nobreak\ [x]Pic1[λFχSB(c(x))C(S,BS)]\displaystyle[x]_{P_{i}}\cap c^{-1}\big{[}\llbracket\lambda_{F\chi_{S}^{B^{\prime}}(c(x))}\rrbracket_{C}(S,B^{\prime}\setminus S)\big{]} (BCS=BSB^{\prime}\cap C\setminus S=B^{\prime}\setminus S)
      =\displaystyle=\leavevmode\nobreak\ [x]Pi[x]FχBcc1[λFχSB(c(x))C(S,BS)]\displaystyle[x]_{P_{i}}\cap[x]_{F\chi_{B^{\prime}}\cdot c}\cap c^{-1}\big{[}\llbracket\lambda_{F\chi_{S}^{B^{\prime}}(c(x))}\rrbracket_{C}(S,B^{\prime}\setminus S)\big{]} (PikerFχBcP_{i}\subseteq\ker F\chi_{B^{\prime}}\cdot c)
      =\displaystyle=\leavevmode\nobreak\ [x]Pic1[[c(x)]FχB]c1[λFχSB(c(x))C(S,BS)]\displaystyle[x]_{P_{i}}\cap c^{-1}\big{[}[c(x)]_{F\chi_{B^{\prime}}}\big{]}\cap c^{-1}\big{[}\llbracket\lambda_{F\chi_{S}^{B^{\prime}}(c(x))}\rrbracket_{C}(S,B^{\prime}\setminus S)\big{]}
      =\displaystyle=\leavevmode\nobreak\ [x]Pic1[[c(x)]FχBλFχSB(c(x))C(S,BS)]\displaystyle[x]_{P_{i}}\cap c^{-1}\big{[}[c(x)]_{F\chi_{B^{\prime}}}\cap\llbracket\lambda_{F\chi_{S}^{B^{\prime}}(c(x))}\rrbracket_{C}(S,B^{\prime}\setminus S)\big{]}
      =\displaystyle=\leavevmode\nobreak\ [x]Pic1[[c(x)]FχSB]\displaystyle[x]_{P_{i}}\cap c^{-1}\big{[}[c(x)]_{F\chi_{S}^{B^{\prime}}}\big{]} (domain-specific interpret. (A.25))
      =\displaystyle=\leavevmode\nobreak\ [x]Pi[x]FχSBc\displaystyle[x]_{P_{i}}\cap[x]_{F\chi_{S}^{B^{\prime}}\cdot c}
      =\displaystyle=\leavevmode\nobreak\ [x]Pi+1\displaystyle[x]_{P_{i+1}} (Pi+1=Piker(FχSBcP_{i+1}=P_{i}\cap\ker(F\chi_{S}^{B^{\prime}}\cdot c))

    This completes the proof.

    Details for 5.3.

    The 3.7 runs in 𝒪(mlogn)\mathcal{O}(m\cdot\log n) producing certificates of a total size of 𝒪(mlogn)\mathcal{O}(m\cdot\log n). When translating these certificates for the modalities ap\langle a\rangle_{p} by the translation TT, we obtain certificates for the input coalgebra (5.2). However, the formula size has a blow up by the additional factor |A||A| because of the big conjunctions in the domain-specific interpretation (5.1.4).

    This represents is a better run time than that of the algorithm by Desharnais et al. [17, Fig. 4], which nests multiple loops: four loops over blocks all blocks seen so far and one loop over AA, roughly leading to a total run time in 𝒪(|A|n4)\mathcal{O}(|A|\cdot n^{4}).

    Details for section 6 (Worst Case Tree Size of Certificates)

    Details for 12.

    To verify the minimality of φ=n+2\varphi=\Diamond^{n+2}\top, one considers all possible replacements of subformulae of φ\varphi by \top:

    nn+1\Diamond\top\qquad\Diamond\Diamond\top\qquad\ldots\qquad\Diamond^{n}\top\qquad\Diamond^{n+1}\top

    All of these hold at both xx and yy, because xx can perform arbitrarily many transitions and yy can perform n+1n+1 transitions.

    We note additionally that even the optimized algorithm for cancellative functors (cf. A.19) constructs certificates of exponential worst-case tree size:

    Example A.28.

    Define the ()\mathbb{R}^{(-)}-coalgebra cc on C=k{wk,xk,yk,zk}C=\bigcup_{k\in\mathbb{N}}\{w_{k},x_{k},y_{k},z_{k}\} by

    c(wk+1)={wk1,xk2,yk1,zk2}c(w0)={w01}c(xk+1)={wk1,xk2,yk2,zk1}c(x0)={x02}c(yk+1)={wk2,xk1,yk1,zk2}c(y0)={y03}c(zk+1)={wk2,xk1,yk2,zk1}c(z0)={z04}\begin{array}[]{r@{\,}l@{\,}l@{\,}l@{\,}l@{\qquad\qquad}r@{}c@{\,}c@{\,}r}c(w_{k+1})=&\{w_{k}\mapsto 1,&x_{k}\mapsto 2,&y_{k}\mapsto 1,&z_{k}\mapsto 2\}&c(w_{0})=\{&w_{0}&\mapsto&1\}\\ c(x_{k+1})=&\{w_{k}\mapsto 1,&x_{k}\mapsto 2,&y_{k}\mapsto 2,&z_{k}\mapsto 1\}&c(x_{0})=\{&x_{0}&\mapsto&2\}\\ c(y_{k+1})=&\{w_{k}\mapsto 2,&x_{k}\mapsto 1,&y_{k}\mapsto 1,&z_{k}\mapsto 2\}&c(y_{0})=\{&y_{0}&\mapsto&3\}\\ c(z_{k+1})=&\{w_{k}\mapsto 2,&x_{k}\mapsto 1,&y_{k}\mapsto 2,&z_{k}\mapsto 1\}&c(z_{0})=\{&z_{0}&\mapsto&4\}\end{array}

    The optimized A.19 constructs a certificate of size 2k2^{k} in the kk-th layer. In this example, however, linear-sized certificates do exist for all states, e.g.

    =2=3k(=1=4)={xk+1}.\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}2$}}\rangle}{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}3$}}\rangle}^{k}({\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}1$}}\rangle}\top\vee{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}4$}}\rangle}\top)\rrbracket={\{x_{k+1}\}}.

    Details for A.28.

    Define the ()\mathbb{R}^{(-)}-coalgebra c:C(C)c\colon C\to\mathbb{R}^{(C)} on the carrier

    C:=4×{Lkk}for Lk={wk,xk,yk,zk}.C:=4\times\mathbb{N}\cong\bigcup{\big{\{}L_{k}\mid k\in\mathbb{N}\big{\}}}\qquad\text{for }L_{k}={\{w_{k},x_{k},y_{k},z_{k}\}}.

    We put

    c(wk+1)={wk1,xk2,yk1,zk2}c(w0)={w01}c(xk+1)={wk1,xk2,yk2,zk1}c(x0)={x02}c(yk+1)={wk2,xk1,yk1,zk2}c(y0)={y03}c(zk+1)={wk2,xk1,yk2,zk1}c(z0)={z04}\begin{array}[]{r@{\,}l@{\,}l@{\,}l@{\,}l@{\qquad\qquad}r@{}c@{\,}c@{\,}r}c(w_{k+1})=&\{w_{k}\mapsto 1,&x_{k}\mapsto 2,&y_{k}\mapsto 1,&z_{k}\mapsto 2\}&c(w_{0})=\{&w_{0}&\mapsto&1\}\\ c(x_{k+1})=&\{w_{k}\mapsto 1,&x_{k}\mapsto 2,&y_{k}\mapsto 2,&z_{k}\mapsto 1\}&c(x_{0})=\{&x_{0}&\mapsto&2\}\\ c(y_{k+1})=&\{w_{k}\mapsto 2,&x_{k}\mapsto 1,&y_{k}\mapsto 1,&z_{k}\mapsto 2\}&c(y_{0})=\{&y_{0}&\mapsto&3\}\\ c(z_{k+1})=&\{w_{k}\mapsto 2,&x_{k}\mapsto 1,&y_{k}\mapsto 2,&z_{k}\mapsto 1\}&c(z_{0})=\{&z_{0}&\mapsto&4\}\end{array}

    For the complexity class of the formulae generated, consider the subcoalgebra on L0LnL_{0}\cup\cdots\cup L_{n}.

    The initial partition P0={{w0},{x0},{y0},{z0},L1Ln}P_{0}={\big{\{}{\{w_{0}\}},{\{x_{0}\}},{\{y_{0}\}},{\{z_{0}\}},L_{1}\cup\cdots L_{n}\big{\}}} distinguishes on the total out-degree (being 1, 2, 3, 4, or 6). Consider that after ii\in\mathbb{N} iterations of the main loop of the algorithm, the states wk,xk,yk,zkw_{k},x_{k},y_{k},z_{k} have just been found to be behaviourally different and all states of Lk+1LnL_{k+1}\cup\cdots\cup L_{n} are still identified. Then the algorithm has to use some of the blocks {wk}{\{w_{k}\}}, {xk}{\{x_{k}\}}, {yk}{\{y_{k}\}}, {zk}{\{z_{k}\}} as the splitter SS for further refinement. Assume wlog that S:={wk}S:=\{w_{k}\} is used as the splitter, first. This will have the effect that Lk+1LnL_{k+1}\cup\cdots\cup L_{n} will be refined into the blocks

    {wk+1,xk+1},{yk+1,zk+1},Lk+2Ln.\{w_{k+1},x_{k+1}\},\qquad\{y_{k+1},z_{k+1}\},\qquad L_{k+2}\cup\cdots\cup L_{n}.

    Assume, that the formula for wkw_{k} is δ({wk})\delta({\{w_{k}\}}) at this point (we omit the index, since the singleton block {wk}{\{w_{k}\}} can not be refined further). The definition of δ\delta in the algorithm annotates the block {wk+1,xk+1}\{w_{k+1},x_{k+1}\} with =1δ({wk}){\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}1$}}\rangle}\delta({\{w_{k}\}}) and the block {yk+1,zk+1}\{y_{k+1},z_{k+1}\} with =2δ({wk}){\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}2$}}\rangle}\delta({\{w_{k}\}}).

    Splitting by {xk}\{x_{k}\} does not lead to further refinement. However, when splitting by S:={yk}S:=\{y_{k}\} (or equivalently {zk}\{z_{k}\}), {wk+1,xk+1}{\{w_{k+1},x_{k+1}\}} is split into {wk+1}{\{w_{k+1}\}} and {xk+1}{\{x_{k+1}\}} and likewise {yk+1,zk+1}{\{y_{k+1},z_{k+1}\}} into {yk+1}{\{y_{k+1}\}} and {zk+1}{\{z_{k+1}\}}. Let δ({yk})\delta({\{y_{k}\}}) be the certificate constructed for {yk}{\{y_{k}\}}. This implies that the formulas for {wk+1}{\{w_{k+1}\}} and {yk+1}{\{y_{k+1}\}} are respectively extended by the conjunct =1δ({yk}){\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}1$}}\rangle}\delta({\{y_{k}\}}); likewise, the formulas for {xk+1}{\{x_{k+1}\}} and {zk+1}{\{z_{k+1}\}} obtain a new conjunct =2δ{yk}{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}2$}}\rangle}\delta{\{y_{k}\}}. Hence, for every sLk+1s\in L_{k+1} the tree-size of the formula constructed is at least:

    |δ({s})||δ({wk})|+|δ({yk})|.|\delta({\{s\}})|\geq|\delta({\{w_{k}\}})|+|\delta({\{y_{k}\}})|.

    Thus the tree-size of the certificate constructed for cancellative functors may grow exponentially with the state count.

    Despite the exponential tree-size of the formulas constructed, there exist linearly sized certificates for all states in the above coalgebra (C,c)(C,c). First, we have

    ϕk:==3k(=1=4) with ϕk={wk,zk}\phi_{k}:={\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}3$}}\rangle}^{k}({\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}1$}}\rangle}\top\vee{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}4$}}\rangle}\top)\text{ with }\llbracket\phi_{k}\rrbracket={\{w_{k},z_{k}\}}

    This lets us define certificates for xk+1x_{k+1} and yk+1y_{k+1}:

    =2ϕk={xk+1}and=4ϕk={yk+1}\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}2$}}\rangle}\phi_{k}\rrbracket={\{x_{k+1}\}}\quad\text{and}\quad\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}4$}}\rangle}\phi_{k}\rrbracket={\{y_{k+1}\}}

    For the remaining two state sequences ww and zz we first note

    =1=4ϕk={wk+2,yk+2}\llbracket{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}1$}}\rangle}{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}4$}}\rangle}\phi_{k}\rrbracket={\{w_{k+2},y_{k+2}\}}

    and thus have certificates

    ϕk+2=1=4ϕk={wk+2}andϕk+2¬=1=4ϕk={zk+2}.\llbracket\phi_{k+2}\wedge{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}1$}}\rangle}{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}4$}}\rangle}\phi_{k}\rrbracket={\{w_{k+2}\}}\quad\text{and}\quad\llbracket\phi_{k+2}\wedge\neg{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}1$}}\rangle}{\langle{\raisebox{1.0pt}{$\scriptstyle\mathord{=}4$}}\rangle}\phi_{k}\rrbracket={\{z_{k+2}\}}.

    Since ϕk\phi_{k} involves k+2k+2 modal operators, every state in LkL_{k} has a certificate with at most 2k+82\cdot k+8 modal operators.