Lax extensions (also called relators or relation liftings) are a categorical notion to reason about functors acting on functions and relations in a compatible way. They play a central role to develop sound proof principles for behavioral equivalence of state-based systems and are also important for establishing contextual equivalence for effectful programs.
In this paper, we develop the theory of lax extensions for parametrized functors and monads and consider notions of behavioral preorders, equivalence relations or metrics which can now be modulated by additional parameters. From an operational viewpoint, we replace standard contextual equivalence where we quantify over all possible contexts by a refined notion of equivalence where the user can regulate the allowed contexts via chosen parameters.
2012 ACM Subject Classification Theory of computation → Categorical semantics; Theory of computation → Operational semantics
Keywords and phrases categorical semantics, parametrized monads, effects, relations, lax extensions, behavioral equivalence, coalgebra, global state
Digital Object Identifier 10.4230/LIPIcs.CONCUR.2026.21
Acknowledgements The first author was partly supported by the ANR Project HOPR (ANR-24-CE48-5521-01) and the second author was supported by the Research Institute for Mathematical Sciences (RIMS) and by the JSPS KAKENHI Grant 26K21167.
Introduction
Relations play a central role in modeling various notions of behavioral preorders and equivalences for state-based systems and programming languages. In particular, coinductive techniques on relations provide a formal framework to reason about circular or infinite objects and they are an important tool in concurrency theory and in operational semantics for establishing behavioral equivalence of processes or programs [38]. Simulation and bisimulation are among the main examples of relations defined coinductively and they have a categorical counterpart in the world of coalgebras. Coalgebras are morphisms S⟶F(S) where S represents the state space and F is a functor encoding the branching type of the system [37, 23]. By varying the functor, we can capture a wide range of state-based systems: streams, labelled transition systems, automata, Markov chains, etc.
A fundamental component of the study of behavioral preorders and equivalences is to extend the behavior functor of the system from sets to relations using the notion of lax extension. This notion also plays an important role in the operational semantics of higher-order functional languages with monadic effects where applicative bisimulation is generalized to the effectful setting using lax extensions of monads from sets to relations [13].
Lax extensions are also used in modal logic, effectful intersection type systems, monoidal topology and in the theory of double categories [30, 15, 22, 27]. They were initially considered by Barr for the ultrafilter monad on sets and were since then generalized to quantale-enriched
37th International Conference on Concurrency Theory (CONCUR 2026).
Editors: Ana Sokolova and Patrick Totzke; Article No. 21; pp. 21:1–21:26
Leibniz International Proceedings in Informatics
LIPICS Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany
21:2 Coinductive reasoning for parametrized functors and monads
relations [8, 36, 46, 40, 39, 10] to measure the behavioral distance between two states for non-deterministic and probabilistic systems [44, 7, 26].
The main purpose of this paper is to extend the theory of lax extensions for endofunctors and monads to parametrized functors and monads. A first generalization is to replace endofunctors F:C→C with functors F:P×C→C where P is viewed as a parameter category. This simple generalization allows us to vary the parameter and consider notions of behavioral preorders or equivalences which depend on relations on the parameter.
In the case of monads, the underlying endofunctor of an ordinary monad T:C→C is replaced by a functor T:Pop×P×C→C [5]. A parametrized monad has therefore two additional parameters providing information about the starting and ending state of a computation. It is important to note that the input parameter is contravariant and the output parameter is covariant, following the intuition of preconditions and postconditions for program logics. Parametrized monads were introduced by Atkey [5] and they offer a convenient setting to model sequential effectful computations, they also have a categorical characterization as the notion of monads arising from parametrized adjunctions [28, 12] (also called adjunction with a parameter or multivariable adjunction) offering the natural generalization of the standard monad-adjunction correspondence. One of the motivating examples is the global state monad: in the ordinary case, the set of global stores is fixed and remains constant which is not flexible enough to keep track of which memory regions a computation has access to and can modify. In the parametrized case, the change in the state type over time is captured by additional parameters corresponding to the memory region before and after the execution of a computation.
In this paper, we develop the theory of lax extensions for parametrized monads to have a framework that allows us to modulate the notion of program equivalence or metric depending on the power we want to give to contexts. For example, if programs can read and write on some memory locations, standard contextual equivalence means that contexts have access to the same memory locations as programs. We are interested in having well-behaved notions of program equivalence where contexts only have access to a restricted set of memory locations. In this setting, our framework allows to weaken the notion of equivalence by explicitly controlling the power we give to contexts depending on the relations added to parameters.
Plan of the paper
After a background section on parametrized monads (Section 1), we introduce the notion of parametrized lax extensions for parametrized functors and monads in Section 2.
In Section 3, we generalize the Barr canonical extension to the parametrized setting and show how additional nuances need to be addressed in the presence of mixed variance variables. In particular, there are several options for the Barr extension, and we study their properties.
In Section 4, we study notions of bisimulation and behavioral equivalence in the parametrized setting where the behavior of two states is compared relative to some chosen relations on the parameters.
Lastly, we instantiate our framework in Section 5 to coalgebras for parametrized functors in the first order setting (Mealy machines) and to parametrized monadic higher order languages where we introduce a parametrized version of contextual equivalence.
21:3
1 Background on parametrized monads
We begin by recalling the notion of parametrized (strong) monad and provide some examples. While the term “parametrized” has been used in various contexts, we would like to emphasize that the notion of parametrized monad we consider in this paper is the one by Atkey [5] and is distinct from the other generalizations of monads considered in the literature such as indexed monads [14], parametric effect monads [25], Dijkstra monads [29], graded monads [42], etc.
▶ Definition 1 (Definitions 5.2.7 and 5.2.9 in [3]). For categories C and D, a parametrized monad consists of a functor T:Cop×C×D→D together with
■ a family of morphisms ηS,X:X→T(S,S,X) indexed by objects S in C and X in D natural in X and dinatural in S
■ a family of morphisms μS1,S2,S3,X:T(S1,S2,T(S2,S3,X))→T(S1,S3,X) indexed by objects S1,S2,S3 in C and X in D natural in X,S1,S3 and dinatural in S2
satisfying some compatibility axioms. If (D,⊗,1) is monoidal, a parametrized strong monad is additionally equipped with
■ a family of morphisms strS1,S2,X,Y:X⊗T(S1,S2,Y)→T(S1,S2,X⊗Y) in D indexed by objects S1,S2 in C and X,Y in D, natural in all variables, and satisfying some compatibility axioms.
▶ Example 2. 1. The parametrized state monad [5, Section 2.3.2]: for a fixed set of states S, the global state monad maps a set X to the set (X×S)S while the parametrized version allows for the set of input states and output states to vary, its underlying functor T:Setop×Set×Set→Set has the following action on objects: (S1,S2,A)↦(A×S2)S1.
The composable continuation monad [3, Example 5.2.6]: for a fixed response object R in a cartesian closed category, the ordinary continuation monad maps an object X to (X⇒R)⇒R. In the parametrized case, we obtain the notion of composable continuations where the response type may vary: the composable continuation monad T:Setop×Set×Set→Set is given by (R1,R2,X)↦(X⇒R1)⇒R2.
The parametrized I/O monad [5, Section 2.3.4]: for a fixed set of inputs I and observable outputs O, the interactive input-output (I/O) monad is the functor mapping a set X to the underlying set of the initial algebra μZ.(X+ZI+O×Z). It induces three possible types of computations: either compute a value, wait for an input and then resume or produce an output and then resume [31, Example 1.1]. The parametrized I/O-monad Setop×Set×Set→Set maps a triple (I,O,X) to the underlying set of μZ.(X+ZI+O×Z).
The parametrized action monad [3, Example 5.2.5]: any monoid (M,e:I→M,m:M⊗M→M) internal to a monoidal category C induces a monad (called the writer, output or action monad) on C given by X↦M⊗X. This construction has been generalized by Atkey in the case of parametrized monads where any category P induces a parametrized monad Pop×P×Set→Set whose action on objects is (A,B,X)↦P(A,B)×X.
2 Parametrized lax extensions
2.1 Relations and dualities
The simplest notion of relation is a binary relation between sets R⊆X×Y which we denote R:X⟼Y. The identity relation idX:X⟼X is the diagonal {(x,x)∣x∈X} and the composite of two relations R:X⟼Y and S:Y⟼Z is the relation S∘R:X⟼Z given
21:4 Coinductive reasoning for parametrized functors and monads
by {(x,z)∣∃y∈Y(x,y)∈R and (y,z)∈S}. We will also use the sequential notation R;S for the composite S∘R and we denote by Rel the category of sets and binary relations.
The underlying functor of a parametrized monad T:Setop×Set×Set→Set has both contravariant and covariant inputs so it is important to understand the dualities it induces on relations to motivate the definition of parametrized extension. They are better understood in light of the 2-categorical structure of Rel: for two relations R,S:X→Y, the inclusion R⊆S viewed as subsets of X×Y induces an ordering on hom-sets (Rel(X,Y),≤). Composition of relations is monotone with respect to this ordering which implies that Rel is a posetal 2-category.
For a general 2-category C, we have the “op” operator which reverses the direction of 1-morphisms and we also have the “co” operator which reverses the direction of 2-morphisms. For example, the transpose operator that maps a relation R:X→Y to the relation Rt={(y,x)∣(x,y)∈R}:Y→X can be seen as a 2-functor (−)t:Relop→Rel.
The exponentiation operation in Set is a functor Setop×Set→Set mapping a pair (X,Y) to YX, the set of all functions from X to Y. It induces an exponentiation 1 2-functor Relco×Rel→Rel that maps a pair of relations (R:X1→X2,S:Y1→Y2) to
which reverses the inclusion of relations in the first argument, i.e. R≤R′ implies SR′≤SR. This operation will guide the formulation of the theory of parametrized lax extensions, and the exponentiation of relations will provide the canonical extension for the state monad.
Another important fact for the theory of lax extensions is the inclusion of functions into relations: any function f:X→Y induces two relations f∗:X→Y and f∗:Y→X given by f∗:={(x,f(x))∣x∈X} and f∗:={(f(x),x)∣x∈X}. Moreover, f∗ is left adjoint to f∗ in (the posetal 2-category) Rel.
2.2 Parametrized (lax) extensions
In the non-parametrized setting, for an endofunctor F:Set→Set, a strict extension (or simply an extension) of F to Rel consists of an endofunctor F:Rel→Rel that agrees with F on objects (F(A)=F(A)) and that is compatible with the inclusion of functions into relations, i.e. for a function f:A→B, (F(f))∗=F(f∗). An extension F is said to be monotone if it preserves the inclusion of relations: if R≤R′, then F(R)≤F(R′). Equivalently, F is a 2-functor Rel→Rel.
The general idea is that, in the strict case, a monotone extension of a functor T:Setop×Set×Set→Set will be a 2-functor T:Relco×Rel×Rel→Rel and not T:Relop×Rel×Rel→Rel.
▶ Definition 3. For a functor T:Setop×Set×Set→Set, a 1-functor T:Rel×Rel×Rel→Rel extends T strictly if the following holds:
for all f:A→B, g:C→D and h:X→Y, T(f∗,g∗,h∗)=(T(f,g,h))∗
we say that T is monotone if for all M′≤M:A→B, N≤N′:C→D and R≤R′:X→Y, T(M,N,R)≤T(M′,N′,R′).
Strict extensions are in practice too restrictive and various weakenings have been considered in the non-parametrized setting. In this paper, we focus on the notion of lax extension
1 While Rel is not a cartesian closed category, we still use the terminology of exponentiation because Rel is cartesian closed as a double category [32].
21:5
considered by Barr and later generalized to the quantale-enriched setting [8, 46, 40, 39, 9, 10, 16].
▶ Definition 4. For a functor F:Set→Set, a lax extension of F to Rel consists of an indexed family of functions T:Rel(X,Y)⟶Rel(TX,TY) satisfying the following axioms:
T is monotone: if R≤R′:X↦Y, then T(R)≤T(R′);
for composable relations R:X↦Y, S:Y↦Z, T(S)∘T(R)≤T(S∘R);
for all functions f:X→Y; (T(f))∗≤T(f∗) and (T(f))∗≤T(f∗).
If T preserves identities strictly, i.e. idTX=T(idX), we say that it is a normal lax extension (also called flat). If conditions 2. and 3. are equalities, then we recover exactly the notion of monotone strict extension.
Lax extensions are not unique, there can be more than one lax extension for the same functor:
▶ Example 5. In the case of the power set functor P:Set→Set, for a relation R:X↦Y, the following mappings
are all lax extensions. The last one corresponds to the canonical Barr extension in Section 3.1.
In the parametrized case, we are also interested in the lax version where the strict equalities in Definition 3 are relaxed to inequalities.
▶ Definition 6. For a functor T:Setop×Set×Set→Set, a parametrized lax extension consists of a family of functions: T:Rel(A,B)×Rel(C,D)×Rel(X,Y)→Rel(T(A,C,X),T(B,D,Y)) indexed by A,B,C,D,X,Y that satisfies the following axioms:
it is antitone in the first argument and monotone in the last two arguments: for all M′≤M:A↦B, N≤N′:C↦D and R≤R′:X↦Y,
T(M,N,R)≤T(M′,N′,R′)
lax composition: for all M:A1↦A2, M′:A2↦A3, N:B1↦B2, N′:B2↦B3, R:X1↦X2 and R′:X2↦X3,
If T preserves identities strictly ( idT(A,B,X)=T(idA,idB,idX)), we say that it is a normal parametrized lax extension. If conditions 2. and 3. are equalities, then we obtain a monotone strict extension. If T commutes with the transpose operation as below, it is called symmetric:
for all M:A↦B, N:C↦D and R:X↦Y, (T(M,N,R))t=T(Mt,Nt,Rt)
▶ Example 7. The underlying functor of the parametrized state monad (Example 2.1) has a parametrized lax extension T which we describe explicitly: for relations M:A↦B, N:C↦D and R:X↦Y, T(M,N,R):(C×X)A↦(D×Y)B is given by:
(N×R)M:={(φ,ψ)∣∀(a,b)∈M,(φ(a),ψ(b))∈N×R}.
21:6 Coinductive reasoning for parametrized functors and monads
3 The Parametrized Barr extensions
3.1 Extending functors from Set to Rel
The span representation of relations
The Barr extension (also called canonical relation lifting) is based on the universal representation of relations as pairs of functions which we recall here. A relation R:X→Y induces a pair of projection functions π1R:gr(R)→X and π2R:gr(R)→Y where gr(R):={(x,y)∈X×Y∣(x,y)∈R}≤X×Y is called the graph or tabulator of R. These two functions completely describe the relation in the following sense:
tabulator universal property: for every other span of functions (h:A→X,k:A→Y) satisfying h∗;k∗≤R, there exists a unique function u:A→gr(R) such that π1R∘u=h and π2R∘u=k.
tabulators are strong: we can recover the original relation R=(π1R)∗;(π2R)∗.
The cospan representation of relations
There is a dual cospan representation of relations with the notion of collage or cotabulator. It is used to define the Barr extension of quantale-enriched relations, we will only define it for ordinary relations on sets and make use of its universal property in Section 4. For a relation R:X→Y, if we take the pushout of the span (π1R:gr(R)→X,π2R:gr(R)→Y), we obtain a pair of functions in1R:X→cl(R) and in2R:Y→cl(R) where cl(R):=X+Y/∼ is the quotient of the disjoint union X+Y by the equivalence relation ∼ generated by (2,y)∼(1,x) for (x,y)∈R. It verifies the following:
cotabulator universal property: for every other cospan of functions (h:X→A,k:Y→A) satisfying R≤h∗;k∗, there exists a unique function u:cl(R)→A such that u∘in1R=h and u∘in1R=k.
Rel does not have strong cotabulators, we only have R≤(in1R)∗; (in2R)∗ in general. Relations for which the cotabulator is strong are called difunctional and they subsume equivalence relations [35, 21, 17].
The Barr extension
The representation of a relation by a universal span of functions is at the heart of the Barr extension construction. The Barr extension T:Rel(X,Y)⟶Rel(TX,TY) is the operator mapping a relation R:X→Y to the relation T(R):=(Tπ1R)∗;(Tπ2R)∗:TX→TY.
Without any additional assumptions on T, the operator T is monotone (axiom (1) of Definition 4) and satisfies axiom (3) strictly. However, it is not in general a lax extension since it does not always satisfy the lax composition axiom (2), it preserves composition in the reverse op-lax direction instead. To obtain a lax-extension, we need to assume additional properties on T based on the notion of weak pullback:
▶ Definition 8. A commutative square h∘f=k∘g in Set as below is a weak pullback if the universal map from A to the pullback of h and k is split epi.
D
21:7
This notion (also called Beck-Chevalley property) plays a central role in the theory of lax extensions as weak pullback squares can be equivalently characterized by the equality g∗∘f∗=k∗∘h∗ in Rel allowing to commute the left (−)∗ and right adjoints (−)∗.
▶ Theorem 9 ([8, 43, 11]). For a functor T:Set→Set, T preserves weak-pullbacks if and only if the Barr extension is a monotone strict extension and it is the unique one.
Before considering the extension of functors T:Setop×Set×Set→Set, we first explain how to extend functors Setop→Set and Set×Set→Set to isolate the different issues that each generalization entails.
3.2 Extending contravariant functors
For a functor T:Setop→Set, we define its Barr extension as the operator mapping a relation R:X→Y to the relation T(R):=(Tπ1R)∗;(Tπ2R)∗:TX→TY. The operator T is antitone with respect to the inclusion of relations, is normal and verifies T(f∗)=(Tf)∗ and T(f∗)=(Tf)∗ for a function f. The important point is that it always preserves composition of relations laxly without requiring additional conditions on T. To obtain a strict extension, it suffices for T to map weak pullback squares to weak pullback squares in the following sense:
Note however that this condition is quite strong and that the typical examples built from the functor (−)⇒A:Setop→Set do not satisfy this property as the exponentiation functor is only lax in Rel.
3.3 Extending multivariable functors
We consider here functors of the form T:Set×Set→Set with two arguments but this can be generalized to functors Setn→Set. We define the parametrized Barr extension of T as the operator T mapping a pair of relations (N:C→D,R:X→Y) to T(N,R):=(T(π1N,π1R))∗;T(π2N,π2R))∗:T(C,X)→T(D,Y). It verifies the expected properties which we do not prove as they are a special case of Theorem 10 where we have an additional contravariant variable. Instead, we want to emphasize the fact that in the multivariable case, we have other possibilities for the choice of extensions we can define:
We have that T(N,R)≤L1(N,R) and T(N,R)≤L2(N,R). While T preserves composition oplaxly in both variables, L1 and L2 preserve composition oplaxly in each variable separately: Li(N′∘N,id)≤Li(N′,id)∘Li(N,id) and Li(id,R′∘R)≤Li(id,R′)∘Li(id,R).
Recall that for an oplax 2-functor, we have both T(f,g)≤T(f,id)∘T(id,g) and T(f,g)≤T(id,g)∘T(f,id) but T(f,id)∘T(id,g) and T(id,g)∘T(f,id) are not in general comparable. For multivariable oplax 2-functors, the equality T(f,id)∘T(id,g)=T(id,g)∘T(f,id) (or coherent isomorphism if we are not in the posetal case) corresponds to the intermediate notion of cubical or quasi-functors [20, 24] between strict (or pseudo) 2-functors and oplax ones. If for every f:A→B, g:C→D, the following interchange square is a weak-pullback
21:8 Coinductive reasoning for parametrized functors and monads
then T=L1=L2 which intuitively means that we can commute the order in which we do the Barr extension. This issue will be relevant in the mixed variance case where we have to consider the covariant and contravariant variables separately.
3.4 Combining both
For a functor T:Setop×Set×Set→Set, we obtain a lattice of parametrized Barr extensions: for a triple of relations (M:A→B,N:C→D,R:X→Y), we define
their image by T as on the right is a weak pullback, then for all N:B1→B2, N′:B2→B3, R:X1→X2 and R′:X2→X3, Li(id,N′,R′)∘Li(id,N,R)≤Li(id,N′∘N,R′∘R).
However, this is not sufficient to obtain a parametrized lax extension as in Definition 6. The important point is the question of interchange of variables we explained in the previous section when dealing with two covariant variables. Here, we consider the interaction between the contravariant variable and the covariant ones. We do not obtain
Li(M′,N′,R′)∘Li(M,N,R)≤Li(M′∘M,N′∘N,R′∘R)
from the inclusions Li(id,N′,R′)∘Li(id,N,R)≤Li(id,N′∘N,R′∘R) and Li(M′,id,id)∘Li(M,id,id)≤Li(M′∘M,id,id). In order to obtain a parametrized lax extension, it suffices to have the following:
▶ Proposition 12. We say that T satisfies the strong interchange property if for every f:A→B, g:C→D and h:X→Y, the following square is a weak pullback
If T preserves weak pullbacks in its last two arguments as in Lemma 11 and satisfies the strong interchange property, then all the operators L1, L2, L3 and L4 become equal and are parametrized lax extensions.
Intuitively, the strong interchange property means that the contravariant variable is independent from the covariant variables. For example, if T(A,C,X)=F(A)×G(C,X) for some functors F:Setop→Set and G:Set×Set→Set, then T satisfies this property. An example which does not satisfy this property is the underlying functor of the state monad T(A,C,X)=(C×X)A for which the operators L1, L2, L3 and L4 are all distinct, and only L4 is a parametrized lax extension. The functor T satisfies a weaker form of interchange:
▶ Proposition 13. We say that T satisfies the weak interchange property if for every spans (g:P→C,h:P→D) and (u:Q→X,v:Q→Y) and split epi f:A→B, the canonical inclusion
is an equality. If T preserves weak pullbacks in its last two arguments as in Lemma 11 and satisfies the weak interchange property, then L4 is a parametrized lax extension.
We spelled out the results for functors of type Setop×Set×Set→Set because they correspond to the underlying functor of parametrized monads, but the constructions presented above extend to arbitrary mixed variance functor Setv1×…Setvn→Set where Setvi is
21:10 Coinductive reasoning for parametrized functors and monads
either Set or Set op. For example, for a functor T:Setop×Set×Setop×Set×Set→Set, we define L4(M,N,O,P,Q) as
Recall that for an ordinary natural transformation α:F⇒G:Set→Set with lax extensions F and G respectively, its canonical extension α:F⇒G has components (α)X:=(αX)∗:F(X)→G(X). If F and G are the Barr extensions of F and G, then α is in general an oplax transformation: i.e. for a relation R:X→Y, F(R);(αY)∗≤(αX)∗;G(R). To obtain (strict) naturality, we need α to be a weakly cartesian transformation, i.e. that all its naturality squares are weak pullbacks.
▶ Definition 14. A lax extension of a strong monad (T,μ,η,str) on Set to Rel consists a lax extension T of T, as in Definition 4, satisfying the following axioms:
for all R:X→Y, (ηY)∗∘R≤T(R)∘(ηX)∗;
for all R:X→Y, (μY)∗∘T(T(R))≤T(R)∘(μX)∗.
for all R:A→B and S:X→Y, (strB,Y)∗∘(R×T(S))≤T(R×S)∘strA,X.
If T is a strict extension for T and conditions 1.-3. are equalities, we say that (T,μ∗,η∗,str∗) is a strict extension for (T,μ,η,str).
Notable examples of monads that do not have a strict extension are the powerset monad, the probability distribution monad, the ultrafilter monad and the global state monad. In the parametrized case, the unit and multiplication are transformations which are both natural in some variables and dinatural in others. We therefore need to understand what it means to extend a dinatural transformation. Recall that for ordinary 1-categorical functors F,G:Cop×C→D, a dinatural transformation F⇒G is a family of morphisms θX:F(X,X)→G(X,X) in D such that for all f:X→Y in C, the hexagon axiom holds:
G(id,f)∘θX∘F(f,id)=G(f,id)∘θY∘F(id,f)
. In the general 2-categorical setting, the notion of 2-dinaturality takes into account the various possible dualities and we have transformations between functors of type Ccoop×Cop×Cco×C→D which satisfy coherences with 2-morphisms [41]. In our case, we are only working with posetal 2-categories so the situation is simplified. For 2-functors F,G:Relco×Rel→Rel, a dinatural transformation F⇒G is simply a family of relations θX:F(X,X)→G(X,X) such that for all R:X→Y, θX;G(R,R)=F(R,R);θY. It is oplax if F(R,R);θY≤θX;G(R,R) and lax if we have the reverse inclusion.
▶ Definition 15. For a parametrized monad (T,η,μ), a parametrized lax extension consists of a lax extensions T as in Definition 6, such that the relations (ηA,X)∗ and (μA1,A2,A3,X)∗ verify:
for all M:A→B and R:X→Y,
R;(ηB,Y)∗≤(ηA,X)∗;T(M,M,R)
for all M:A1→B1, N:A2→B2, O:A3→B3 and R:X→Y,
If the parametrized monad is equipped with a strength str, then a strong lax extension for T is a lax extension as above satisfying the additional axiom:
for all M:A1↦B1, N:A2↦B2, R:X1↦Y1 and S:X2↦Y2
A strict parametrized extension consists of a strict extension T as in Definition 3 for which the inequalities 1. – 3. above are equalities.
▶ Proposition 16. For a strong parametrized monad (T,η,μ,str), if L4 is a parametrized lax extension for T, then (L4,η∗,μ∗,str∗) is a parametrized lax extension for (T,η,μ,str) as in Definition 15.
Note that if any of L1, L2 or L3 are lax extensions, they must be equal to L4 by Theorem 10.7.
▶ Example 17. The parametrized state monad has underlying functor T as in Example 2.1. For sets A,X, the unit has components ηA,X:X→(A×X)A given by the function x↦λa.(a,x). For sets A,B,C and X, the component of the multiplication μA,B,C,X:T(A,B,T(B,C,X))→T(A,C,X) maps φ∈(B×(C×X)B)A to λa.(π2(φ(a))(π1(φ(a))). It is a strong monad: for sets A,B,X and Y, the component of the strength strA,B,X,Y:X×(B×Y)A→(B×X×Y)A maps (x,ψ)∈X×(B×Y)A to λa.(π1(ψ(a)),x,π2(ψ(a))). We obtain a parametrized lax extension (L4,η∗,μ∗,str∗), it corresponds to the monad structure induced from the parametrized adjunction for the (double) cartesian closed structure of Rel.
4 Parametrized behavioral equivalence
Many coinductive preorders and equivalences to reason on systems can be described coal-gebraically. In this paper, we will focus on the three following notions: Aczel-Mendler bisimulation, F-bisimulation (for some lax extension F) and behavioral equivalence. An important problem is how to develop sound and/or complete proof principles to establish behavioral equivalence of states, which is often difficult to show directly in practice. This problem has been well-studied for set-functors [1], and it has also been addressed in the quantale-enriched setting [46, 16].
4.1 Non-parametrized bisimulation and behavioral equivalence
For an endofunctor F:Set→Set and coalgebras (X,α:X→F(X)),(Y,β:Y→F(Y)), a relation R:X→Y is a behavioral equivalence if there exists a coalgebra (Z,ζ:Z→F(Z)) and coalgebra morphisms f:(X,α)→(Z,ζ),g:(Y,β)→(Z,ζ) as on the left below such that the diagram on the right is a weak pullback:
Two states x∈X and y∈Y are behaviorally equivalent if there exists a relation R as above such that (x,y)∈R. An important characterization of behavioral equivalence is that if F has a final coalgebra outF:νF→F(νF), then two states x and y are behaviorally equivalent if and only if they have the same final semantics i.e. they are mapped to equal
21:12 Coinductive reasoning for parametrized functors and monads
states in the final coalgebra. We typically restrict to the case where α=β and R is an actual equivalence relation, not just a difunctional relation as above.
Two states x∈X and y∈Y are Aczel-Mendler bisimilar (AM-bisimilar) if there exists a relation R:X⟼Y and a coalgebra γ:gr(R)→F(gr(R)) such that (x,y)∈R and the projection maps π1:gr(R)→X and π2:gr(R)→Y are coalgebra morphisms.
▶ Definition 18. For coalgebras (X,α) and (Y,β) as above, a relation R:X⟼Y is sound for behavioral equivalence if for any (x,y)∈R, the states x and y are behaviorally equivalent. It is complete if the reverse inclusion holds and it is fully abstract if both inclusions hold.
▶ Theorem 19 ([37]). AM-bisimilarity is sound for behavioral equivalence; if F preserves weak-pullbacks, then it is also fully abstract.
We are mainly interested in this paper in the notion of equivalence induced by a lax extension Fˉ of F, two states x∈X and y∈Y are Fˉ-bisimilar if there exists a relation R:X⟼Y such that (x,y)∈R and R is included in α∗; Fˉ(R); β∗.
Bisimulations induced by lax extensions subsume AM-bisimulations.
▶ Proposition 20. If R is an AM-bisimulation, then it is a Fˉ-bisimulation for any lax extension Fˉ.
▶ Theorem 21 ([30, 18]). For a lax extension Fˉ, Fˉ-bisimilarity is complete for behavioral equivalence and if Fˉ is normal, then Fˉ-bisimilarity is fully abstract.
4.2 Parametrized bisimulation from lax extensions
We fix a parametrized lax-extension T of a functor T:Setop×Set×Set→Set. We first need to determine what is the notion of coalgebra in this setting. In this paper, we do not follow the approach of [4] where a parametrized coalgebra would be a functor c:Setop→Set equipped with a family of functions αA,C:c(C)→T(A,C,c(C)) natural in A and dinatural in C. This definition requires the state space to depend on the output parameter, which is too restrictive for some of the examples we consider. Moreover, we want to be able to consider a single coalgebra α:X→T(A,C,X) at a time, together with relations between parameters chosen by the user, without requiring those relations to be defined for all sets. In our setting, we fix coalgebras α:X→T(A,C,X) and β:Y→T(B,D,Y) and relations M:A⟼B and N:C⟼D on the parameters. We want to understand what it means for a relation R:X⟼Y between states to be a bisimulation with respect to (M,N). The most straightforward generalization to our setting is the lax-extension notion of bisimulation:
▶ Definition 22. A relation R:X⟼Y is a T-bisimulation w.r.t (M,N) if it satisfies R≤α∗; T(M,N,R); β∗.
Since T is monotone in its third argument, the mapping R↦α∗; T(M,N,R); β∗ has a greatest fixpoint which we call T-bisimilarity w.r.t (M,N). Note that using the formalism of [33], T(M,N,−) is an example of relational connector between the functors T(A,C,−) and T(B,D,−) and the notion of T-bisimilarity w.r.t (M,N) coincides with the notion of bisimilarity induced by this relational connector.
Assume now that β=α (so that M:A⟼A and N:C⟼C), in the non-parametrized case, the axioms of lax extension ensure that T-bisimulations are closed under composition and identity which implies that T-bisimilarity is a preorder. In our case, we need additional conditions on M and N:
21:13
▶ Lemma 23. If M≤idA and idC≤N, then idX is a T-bisimulation w.r.t (M,N). If M≤M∘M, N∘N≤N and R is a T-bisimulation w.r.t (M,N), then so is R∘R.
In practice, the conditions on M are too restrictive and we typically want M to be a preorder. While T-bisimilarity will not be a preorder for arbitrary coalgebras α, it will hold for the specific cases we are interested in.
To obtain that T-bisimilarity is an equivalence relation, we need it to be symmetric and it suffices to require that T commutes with the operation of taking the transpose of relations:
▶ Lemma 24. Assume that Mt=M, Nt=N and T is symmetric (axiom 4. in Definition 6). If R is a T-bisimulation w.r.t (M,N), then so is Rt.
4.3 Parametrized AM-bisimulation
A relation R:X↦Y is an AM-bisimulation w.r.t (M,N) if there exists a coalgebra γ:gr(R)→T(gr(M),gr(N),gr(R)) such that the two pentagons below commute:
This notion can be defined without any restrictions on the parameter relations M and N, and from the axioms of parametrized lax extension, we obtain soundness similarly to Proposition 20:
▶ Lemma 25. If R is an AM-bisimulation w.r.t (M,N), then it is a T-bisimulation w.r.t (M,N).
4.4 Parametrized behavioral equivalence
We consider the case where α=β and M:A↦A and N:C↦C are endorelations. For the notion of (M,N)-behavioral equivalence, we also require the relation N to be difunctional: there exists h:C→W and k:C→W such that the left square below is a weak-pullback
In this setting, two states x,y∈X are (M,N)-behaviorally equivalent if there exist a relation R:X↦X and functions f:X→Z, g:X→Z such that the middle square above is a weak-pullback, (x,y)∈R, and there exists a coalgebra ζ:Z→T(gr(M),W,Z) such that the two squares on the right commute.
▶ Lemma 26. For α and (M,N) as above, if the functor T(gr(M),W,−):Set→Set has a final coalgebra ω:Ω→T(gr(M),W,Ω), then two states (x,y)∈X×X are behaviorally equivalent if and only if [x]1=[y]2 where [−]1 and [−]2 are the two unique coalgebra morphisms as below:
21:14 Coinductive reasoning for parametrized functors and monads
▶ Proposition 27. If T preserves weak-pullbacks in the last two variables, then (M,N)-behavioral equivalence is sound for AM-bisimilarity w.r.t (M,N).
Before stating the full-abstraction result analogous to Theorem 21, we give a useful lemma which is similar to Proposition III.1.4.3 [22] for the non-parametrized setting:
▶ Lemma 28. For relations M, N, R and functions f, g, h, k, i, j as below
▶ Theorem 29. T-bisimilarity w.r.t (M,N) is complete for (M,N)-behavioral equivalence and if T is normal, then it is fully abstract.
5 Case studies
5.1 Mealy Machines
We first consider a simple example of deterministic finite state machines: for fixed sets I and O of inputs and outputs respectively, a Mealy machine is a triple M=(X∈Set,next:X×I→X,out:X×I→O), or equivalently a coalgebra for the functor F:X↦(X×O)I (e.g. [34]) which has a strict extension F to Rel. For two machines M1 and M2, a relation R:X1↦X2 between their state spaces is an F-bisimulation if for every (x1,x2)∈R, and i∈I, (next1(x1,i),next2(x2,i))∈R and out1(x1,i)=out2(x2,i).
In the parametrized case, we allow the sets of inputs and outputs to vary and consider the parametrized functor T:(I,O,X)↦(O×X)I which verifies the conditions of Proposition 13 and therefore has a parametrized lax extension T. We can now consider two machines M1,M2 on different sets of inputs I1,I2 and outputs O1,O2. For relations M:I1↦I2 and N:O1↦O2 specifying how inputs and outputs can be related, the induced notion of T-bisimulation w.r.t (M,N) relaxes the notion of bisimulation above by requiring only that on two related inputs, the two corresponding outputs should be related: for all (x1,x2)∈R, (i1,i2)∈M, (next1(x1,i1),next2(x2,i2))∈R and (out1(x1,i1),out2(x2,i2))∈N.
5.2 Parametrized state contextual equivalence
We finally instantiate our framework to a higher-order calculus with parametrized monadic effects and sketch how it supports notions of parametrized contextual equivalence that cannot be directly addressed using the ordinary notion of lax extension (Definition 4).
21:15
We fix a (possibly partial) monoid (L,ε,⋅,≤). Our motivating example is the monoid of memory regions for a fixed set of locations Loc, a memory region is simply a subset L⊆Loc. The monoid multiplication L1⋅L2 is defined when the two subsets are disjoint and it is given by their union. We consider a monadic type system with state and computation types, programs are terms in a standard λ-calculus given in fine-grain call-by-value style, which we give below.
The metavariable op stands for an operation accessing or modifying the underlying store. Examples of operations are setℓL:(bool,L)→(1,L) and getℓL:(1,L)→(bool,L) where ℓ is a location in the region L and newℓL:(bool,L)→(1,L⋅{l}) for a new location ℓ∈Loc∖L. For simplicity, we restrict locations to carry only boolean values.
We denote by Λ(L1,L2,A) the set of terms M such that ∅;L1⊢cM:A;L2 and by V(A) is the set of values V such that ∅⊢vV:A. The small step operational semantics is an indexed family of partial functions {Λ(L1,L2,A)⇀T(L1,L2,Λ(L1,L2,A)}L1,L2,A where T is the parameterized state monad defined as T(L1,L2,X)=([L2]×X)[L1] and [L] is the set of stores (functions mapping locations in L to boolean values). Examples of small step reductions are:
where [s,ℓ↦t]:L∪{ℓ}→{t,f} maps ℓ′∈L to s(ℓ′) and ℓ to t. The induced big step operational semantics is an indexed family of functions {⇓:Λ(L1,L2,A)→T(L1,L2,V(A))}A,L1,L2.
We are interested in comparing terms, a term relation consists of a pair of families of relations (RV:V↦V,RΛ:Λ↦Λ) indexed following the aforementioned pattern. Standard contextual equivalence is the largest equivalence that is adequate with respect to the big step operational semantics and compatible with respect to all term constructors. The theory we have developed allows us to refine this notion by modulating the power of contexts depending on which memory region they have access to. This is precisely what happens in the so-called adversarial rules often used in security proofs (e.g. [2]), where the role of the context is played by an adversary that has access only to some (and not all) of the memory locations available to the honest parties.
Consider a memory region L=L1⊎L2 and a term ∅;L1⊢cM:A;L1 which has access only to the region L1. Assume that we make changes to the memory outside of L1, for example, define N:=let x=setℓ2Lt in M where ℓ2∈L2, then a context which has access to the whole region L will be able to distinguish M from N (even if the variable x does not occur in M). Indeed, for M and N to be contextually equivalent, the following must hold
∀s,r∈[L],(C[M](s)⇓(t,r)⇔C[N](s)⇓(t,r))
21:16 Coinductive reasoning for parametrized functors and monads
for every context C[⋅] such that ∅;L⊢cC[M],C[N]:bool;L. We can easily construct a context in which the equivalence above fails, for instance by using getl2L.
Instead, M and N are equivalent for weaker contexts that can access only the region L1. We define an equivalence relation E on stores [[L]]=Set(L,{t,f}) as
E:={(s,s′)∣∀ℓ∈L1,s(ℓ)=s′(ℓ)}
where two stores are equivalent when they are equal in the restricted region L1. We say that two terms M,N are L1-equivalent if for all (s1,s1′)∈E:
for every context C[⋅] containing only constructors with locations in L1 and such that ∅;L⊢cC[M],C[N]:bool;L. Coming back to our example, M and N will be equivalent for this notion of refined equivalence. This equivalence can further be used to capture a finer form of commutativity for effects acting on disjoint sets of memory locations which we cannot show using ordinary contextual equivalence since the state monad is a typical example of a non-commutative monad where the effect of writing on the memory is not commutative. We can also recover standard contextual equivalence by replacing E with the equality relation and allowing contexts C[⋅] to be built with constructor accessing and modifying all locations.
This refined notion of contextual equivalence can be coinductively characterized as the largest term equivalence relation R=(RV,RA) satisfying the following conditions:
R is (E,E)-adequate with respect to the big step operational semantics, which corresponds to a T-bisimulation w.r.t (E,E): RA(L,L,A)≤(⇓)∗; T(E,E,RV(A)); (⇓)∗ where T is the lax-extension of Example 7.
R is L1-compatible: when defining the compatible closure of R, we restrict the standard definition to term constructors with locations in L1.
So far, we used the same relation E for both parameters to restrict the scope of testing contexts but our framework also allows the user to specify different predicates on the memory region before and after the execution of a computation.
Conclusion and future work
In this paper, we have extended the theory of lax extensions to parametrized functors and monads on sets, and showed that it allows to refine the usual notions of behavioral equivalence by studying conditions on the parameters to derive sound and complete proof principles establishing behavioral equivalence. The parametrized setting is particularly well-suited for monadic effects where the parameters correspond to a notion of pre and post condition updated by the execution of a program such as global state and I/O (input/output) effects.
In the ordinary non-parametrized setting, there is a close connection between predicate liftings and lax extensions [6, 30, 45, 19, 17] which we aim to develop in the parametrized case. In particular, the adequate notion of coalgebraic logics derived from liftings and lax extensions in the parametrized case remains to be investigated.
21:17
References
1 Peter Aczel and Nax Mendler. A final coalgebra theorem. In Category Theory and Computer Science: Manchester, UK, September 5–8, 1989 Proceedings, pages 357–365. Springer, 2005.
2 Alejandro Aguirre, Gilles Barthe, Marco Gaboardi, Deepak Garg, Shin-ya Katsumata, and Tetsuya Sato. Higher-order probabilistic adversarial computations: categorical semantics and program logics. Proc. ACM Program. Lang., 5(ICFP):1–30, 2021.
3 Robert Atkey. Substructural Simple Type Theories for Separation and In-place Update. PhD thesis, University of Edinburgh, College of Science and Engineering., 2006.
4 Robert Atkey. Algebras for parameterised monads. In International Conference on Algebra and Coalgebra in Computer Science, pages 3–17. Springer, 2009.
5 Robert Atkey. Parameterised notions of computation. Journal of functional programming, 19(3-4):335–376, 2009.
6 Paolo Baldan, Filippo Bonchi, Henning Kerstan, and Barbara König. Behavioral metrics via functor lifting. arXiv preprint arXiv:1410.3385, 2014.
7 Paolo Baldan, Filippo Bonchi, Henning Kerstan, and Barbara König. Coalgebraic behavioral metrics. Logical Methods in Computer Science, 14, 2018.
8 Michael Barr. Relational algebras. In Reports of the Midwest Category Seminar IV, pages 39–55. Springer, 1969.
9 Marta Bilková, Alexander Kurz, Daniela Petrișan, and Jiří Velebil. Relation liftings on preorders and posets. In Algebra and Coalgebra in Computer Science: 4th International Conference, CALCO 2011, Winchester, UK, August 30–September 2, 2011. Proceedings 4, pages 115–129. Springer, 2011.
10 Marta Bilkova, Alexander Kurz, Daniela Petrisan, and Jiri Velebil. Relation lifting, with an application to the many-valued cover modality. Logical Methods in Computer Science, 9, 2013.
11 Aurelio Carboni, G Max Kelly, and Richard J Wood. A 2-categorical approach to change of base and geometric morphisms i. Cahiers de topologie et géométrie différentielle catégoriques, 32(1):47–95, 1991.
12 Eugenia Cheng, Nick Gurski, and Emily Riehl. Cyclic multicategories, multivariable adjunctions and mates. Journal of K-Theory, 13(2):337–396, 2014. doi:10.1017/is013012007jkt250.
13 Ugo Dal Lago and Francesco Gavazzo. A relational theory of effects and coefficients. Proceedings of the ACM on Programming Languages, 6(POPL):1–28, January 2022. doi:10.1145/3498692.
14 Soichiro Fujii. A 2-categorical study of graded and indexed monads. arXiv preprint arXiv:1904.08083, 2019.
15 Francesco Gavazzo, Riccardo Treglia, and Gabriele Vanoni. Monadic intersection types, relationally. In European Symposium on Programming, pages 22–51. Springer, 2024.
16 Sergey Goncharov, Dirk Hofmann, Pedro Nora, Lutz Schröder, and Paul Wild. Quantalic behavioural distances.
17 Sergey Goncharov, Dirk Hofmann, Pedro Nora, Lutz Schröder, and Paul Wild. Identity-Preserving Lax Extensions and Where to Find Them. In 42nd International Symposium on Theoretical Aspects of Computer Science (STACS 2025), volume 327, pages 40:1–40:20, Dagstuhl, Germany, 2025. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.STACS.2025.40.
18 Sergey Goncharov, Dirk Hofmann, Pedro Nora, Lutz Schröder, and Paul Wild. Relators and notions of simulation revisited. In 2025 40th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), pages 776–789. IEEE, 2025.
19 Sergey Goncharov, Dirk Hofmann, Pedro Nora, Lutz Schröder, and Paul Wild. Kantorovich Functors and Characteristic Logics for Behavioural Distances. In Orna Kupferman and Pawel Sobocinski, editors, Foundations of Software Science and Computation Structures, volume 13992, pages 46–67. Springer Nature Switzerland, Cham, 2023. Series Title: Lecture Notes in Computer Science. doi:10.1007/978-3-031-30829-1_3.
20 John W Gray. Formal category theory: adjointness for 2-categories, volume 391. Springer, 2006.
21:18 Coinductive reasoning for parametrized functors and monads
21 H Peter Gumm and Mehdi Zarrad. Coalgebraic simulations and congruences. In International Workshop on Coalgebraic Methods in Computer Science, pages 118–134. Springer, 2014.
22 Dirk Hofmann, Gavin J Seal, and Walter Tholen. Monoidal Topology: A Categorical Approach to Order, Metric, and Topology, volume 153. Cambridge University Press, 2014.
23 Bart Jacobs. Introduction to coalgebra, volume 59. Cambridge University Press, 2017.
24 Niles Johnson and Donald Yau. 2-dimensional categories. Oxford University Press (UK), 2021.
25 Shin-ya Katsumata. Parametric effect monads and semantics of effect systems. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 633–645, 2014.
26 Barbara König and Christina Mika-Michalski. (metric) bisimulation games and real-valued modal logics for coalgebras. In 29th International Conference on Concurrency Theory (CONCUR 2018), pages 37–1. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2018.
27 Michael Lambert. Characterizing double categories of relations. Applied Category Theory, 2021.
28 Saunders Mac Lane. Categories for the working mathematician, volume 5. Springer Science & Business Media, 1998.
29 Kenji Maillard, Danel Ahman, Robert Atkey, Guido Martínez, Cătălin Hrițcu, Exequiel Rivas, and Éric Tanter. Dijkstra monads for all. Proceedings of the ACM on Programming Languages, 3(ICFP):1–29, 2019.
30 Johannes Marti and Yde Venema. Lax extensions of coalgebra functors and their logic. Journal of Computer and System Sciences, 81(5):880–900, 2015.
31 Eugenio Moggi. Notions of computation and monads. Information and computation, 93(1):55–92, 1991.
32 Susan Niefield. Cartesian closed double categories. Theory and Applications of Categories, 40(3):63–79, 2024.
33 Pedro Nora, Jurriaan Rot, Lutz Schröder, and Paul Wild. Relational connectors and heterogeneous simulations. In International Conference on Foundations of Software Science and Computation Structures, pages 111–132. Springer, 2025.
34 Dirk Pattinson. An introduction to the theory of coalgebras. Course notes for NASSLLI, 2003.
35 Jacques Riguet. Relations binaires, fermetures, correspondances de galois. Bulletin de la société mathématique de France, 76:114–155, 1948.
36 Jan JMM Rutten. Relators and metric bisimulations. Electronic Notes in Theoretical Computer Science, 11:252–258, 1998.
37 Jan JMM Rutten. Universal coalgebra: a theory of systems. Theoretical computer science, 249(1):3–80, 2000.
38 Davide Sangiorgi. Introduction to bisimulation and coinduction. Cambridge University Press, 2011.
39 Christoph Schubert and Gavin J Seal. Extensions in the theory of lax algebras. Theory and Applications of Categories [electronic only], 21:118–151, 2008.
40 Gavin J Seal. Canonical and op-canonical lax algebras. Theory Appl. Categ, 14(10):221–243, 2005.
42 AL Smirnov. Graded monads and rings of polynomials. Journal of Mathematical Sciences, 151(3):3032–3051, 2008.
43 Věra Trnková. Relational automata in a category and their languages. In International Conference on Fundamentals of Computation Theory, pages 340–355. Springer, 1977.
44 Franck Van Breugel and James Worrell. A behavioural pseudometric for probabilistic transition systems. Theoretical Computer Science, 331(1):115–142, 2005.
45 Paul Wild and Lutz Schröder. Characteristic logics for behavioural hemimetrics via fuzzy lax extensions. Logical Methods in Computer Science, 18, 2022.
21:19
46 James Worrell. On coalgebras and final semantics. PhD thesis, University of Oxford, 2000.
A Proofs for Section 3
A.1 Extending parametrized functors from Set to Rel
▶ Lemma 30. If a function f:A→B is split epi, then f∗;f∗=idB:B→B and if a function f:A→B is split mono, then f∗:f∗=idA:A→A.
▶ Lemma 31. For relations R:A→B and S:B→C, if we take the pullback as on the left below (or equivalently the composition of the two tabulation spans), then the unique morphism u:P→gr(S∘R) as on the right is split epi.
Proof of Theorem 10. We will only prove the theorem for L1, the proofs for i=2,3,4 follow the same pattern.
To obtain that L1 is normal, we use the fact that the tabulation of the identity relation is isomorphic to the identity span.
If M′≤M:A→B, N≤N′:C→D and R≤R′:X→Y, then there exist functions α:gr(M′)→gr(M), β:gr(N)→gr(N′) and γ:gr(R)→gr(R′) such that \pi_1^M \circ \alpha = \pi_1^M', \pi_2^M \circ \alpha = \pi_2^M', \pi_1^N' \circ \beta = \pi_1^N, \pi_2^N' \circ \beta = \pi_2^N, \pi_1^R' \circ \gamma = \pi_1^R and \pi_2^R' \circ \gamma = \pi_2^R. We obtain:
Proof of Proposition 12. It is straightforward to obtain L1=L2=L3=L4 from the strong interchange property. We show that L1 satisfies axiom (2) in Definition 6:
21:21
For relations M:A1↦A2, M′:A2↦A3, N:B1↦B2, N′:B2↦B3, R:X1↦X2 and R′:X2↦X3, we have:
We use that T preserves pullbacks in the last two variables for the second equality and that the interchange squares are weak pullbacks for the penultimate equality.
Proof of Proposition 13. We show that L4 satisfies axiom (2) in Definition 6:
For relations M:A1↦A2, M′:A2↦A3, N:B1↦B2, N′:B2↦B3, R:X1↦X2 and R′:X2↦X3, we have:
Since L4 is a lax extension, the two variable operator L4(id,−,−) preserves composition strictly. Indeed, we have L4(id,N;N′,R;R′)≥L4(id,N,R);L4(id,N′,R′) because it is a lax extension, and by construction, we always have L4(id,N;N′,R;R′)≤L4(id,N,R);L4(id,N′,R′) (Theorem 10.4). Therefore, using Lemma 28, the desired inequality above becomes:
Proof of Lemma 25. Assume that we have an AM-bisimulation w.r.t (M,N) as in Section 4.3, then we obtain that it is a T-bisimulation w.r.t (M,N) from the axioms of parametrized lax extension:
21:24 Coinductive reasoning for parametrized functors and monads
Assume that (x, y) are behaviorally equivalent. Let J−K3 : Z → Ω be the unique coalgebra
morphism from γ to ω. By uniqueness, we obtain J−K1 = J−K3 ◦ f and J−K2 = J−K3 ◦ g.
Since (x, y) ∈ gr(R) and f(x) = g(y), we obtain JxK1 = JyK2.
For the other direction, assume that JxK1 = JyK2. Let (P, p1, p2) be the following pullback:
X
Z
X
P
f g
p1 p2
pb
and define R := f∗; g
∗
. From the universal property of tabulators, we obtain that the
span (P, p1, p2) is isomorphic to (gr(R), πR
1
, πR
2
) which finishes the proof. ◀
Proof of Proposition 27. Assume that N : C C is difunctional i.e. that there exists
h : C → W and k : B → W such that the left square below is a weak-pullback
C
W
C
gr(N)
h k
π
N
1 π
N
2
wpb X
Z
X
gr(R)
f g
π
R
1 π
R
2
wpb
By definition, a relation R : X X is a behavioral equivalence w.r.t (M, N) if there exists
f : X → Z and g : X → Z and a coalgebra ζ : Z → T(gr(M), W, Z) such that the right
square above is a weak-pullback and the following two squares below commute:
T(A, C, X)
T(gr(M), W, Z)
X
Z
X
T(A, C, X)
α
T(πM
1
, h, f) T(πM
2
, k, g)
f g
α
ζ
We want to show that R is an AM-bisimulation w.r.t (M, N). Since T preserves weak
pullbacks in the last two variables, the square below is a weak pullback.
T(gr(M), C, X)
T(gr(M), W, Z)
T(gr(M), C, X)
T(gr(M), gr(N), gr(R))
T(id, h, f) T(id, k, g)
T(id, π
N
1
, π
R
1
) T(id, π
N
2
, π
R
2
)
wpb
Note that we see here why both N and R are assumed to be difunctional. By the universal
property of weak-pullbacks, since the diagram below commutes,
21:25
there exists a morphism γ:gr(R)→T(gr(M),gr(N),gr(R)) such that:
For the other direction, we want to show that T-bisimilarity w.r.t (M,N) is an (M,N)-behavioral equivalence.
The operator Rel(X,X)→Rel(X,X) mapping R:X→X to α∗; T(M,N,R); α∗ is monotone in R so it has a greatest fixpoint which we denote E:X→X. If M≤idA,
21:26 Coinductive reasoning for parametrized functors and monads
M≤M∘M,M≤Mt,idC≤N,N∘N≤N,Nt≤N and T verifies axiom (6) in Definition 6, then E is an equivalence relation (in particular it is difunctional). Since N and E are difunctional, taking the collage of N and E, the two squares below are both pushout and weak pullback squares.
In particular, we have N=(ι1N)∗; (ι2N)∗ and E=(ι1E)∗; (ι2E)∗. By Lemma 28,
so if T is normal, we have T(M,N,R)=(T(π1M,ι1N,ι1R))∗; (T(π2M,ι2N,ι2R))∗. By the universal property of the collage, we obtain that there is a unique function cl(E)→T(gr(M),cl(N),cl(E)) such that:
In particular, we obtain that ζ∘ι1E=T(π1M,ι1N,ι1R)∘α and ζ∘ι2E=T(π2M,ι2N,ι2R)∘α as desired.