Fibrational Bisimulations and Quantitative Reasoning

. Bisimulation and bisimilarity are fundamental notions in comparing state-based systems. Their extensions to a variety of systems have been actively pursued in recent years, a notable direction being quantitative extensions. In this paper we present an abstract categorical framework for such extended (bi)simulation notions. We use coalgebras as system models and ﬁbrations for organizing predicates— following the seminal work by Hermida and Jacobs—but our focus is on the structural aspect of ﬁbrational frameworks. Speciﬁcally we use morphisms of ﬁ-brations as well as canonical liftings of functors via Kan extensions. We apply this categorical framework by deriving some known properties of the Hausdor ﬀ pseudometric and approximate bisimulation in control theory.


Introduction
In the study of transition systems, bisimulation relations are a fundamental concept, and their categorical study revealed the importance of coalgebras.One approach to characterise bisimilarity is via liftings of the coalgebra functor along fibrations [HJ98], which are a well-established framework to attach relational structures on categories for modelling transition systems and programming languages [Jac99].
Recently, there has been emerging interest in quantitative analysis of transition systems.Behavioural metrics were introduced in [DJGP02,vBW05] to refine bisimilarity for probabilistic transition systems.Metrics give a real number for each pair of states in a transition system, while a relation can only provide a bit for each pair (whether the pair is in the relation or not).Therefore a metric can indicate a degree to which the behaviour of two states differ, whereas a bisimilarity relation can only indicate whether or not those behaviours differ.From this observation, a common desideratum for behavioral metrics associated with coalgebras is that two states should have distance 0 if and only if they are bisimilar.
Bisimilarity and behavioural metrics are also analogous on a categorical level.Behavioural metrics were recently shown to be constructible from liftings of the coalgebra functor to categories of (pseudo)metrics [BBKK14,BKV15], similar to how Hermida-Jacobs bisimulations are constructed from liftings of a functor to the category of relations.This type of construction is known generally as a coalgebraic predicate and can be performed when a lifting of the coalgebra functor is known.
These developments present two natural issues.The first is an open-ended quest for liftings of functors in general fibrations.These liftings are the rare ingredient in forming coalgebraic predicates, so having a variety of liftings in a variety of fibrations allows us to express more coalgebraic predicates.The second issue is more recent and concerns the desired relationship between behavioural metrics and bisimilarity mentioned above.Given some liftings in different fibrations, is there a relationship between the liftings we can use to verify a relationship between the coalgebraic predicates they define on a given coalgebra?
The main contributions of this paper pertain to these two issues: -We propose two methods to lift functors along fibrations, both of which generalise existing constructions.The first is the codensity lifting of endofunctors, generalising Baldan et al.'s Kantorovich lifting [BBKK14] to arbitrary fibrations.This lifting also represents a further development of the codensity lifting of monads [KS15].
The second is the construction of an enriched left Kan extension using the canonical symmetric monoidal closed structure [KR85] on the total category in fibrations.This generalises Balan et al.'s construction [BKV15] of enriched left Kan extension for quantale-enriched small categories.
Apart from these lifting methods, we derive several methods to combine existing liftings.Using these methods, we construct the Hausdorff metric as the pushforward of the lifting of the list functor along a particular transformation.-We propose the use of predicate morphisms to translate between these liftings.We use these translations to provide facilities for establishing relationships between the coalgebraic predicates provided by these liftings on coalgebras.We illustrate the utility of this approach with two examples.First, we demonstrate the translation of approximate functions to -approximate relations, which is the key technical tool used in control theory.Second, we translate metrics to relations to show the kernels of many behavioural metrics are bisimilarity relations.
Outline.In Section 2, we recall the important technical background for this work, particularly focusing on a class of fibrations where each fibre category is a lattice.In Section 3, we recall the construction of Hermida-Jacobs bisimulations and general coalgebraic predicates.As mentioned above, these require a lifting of a functor.Existence of such liftings is not guaranteed, and in Section 4 we present a few generalizations of extant techniques for producing liftings in particular fibrations to our more general class of fibrations.Finally, in Section 5, we use so-called predicate morphisms to establish relationships between coalgebraic predicates, focusing on deriving approximate functions from -approximate relations and deriving bisimilarity as the kernel of behavioural metrics.

Background
In this paper, we are interested in finding data about a wide variety of state-based transition systems.This data comes in a variety of types: relations, unary predicates, and pseudometrics are frequently found in the literature.Data of a particular type can also satisfy a variety of properties.For example, we are interested in both a relation consisting of the states with exactly the same behaviours, and a relation where the behaviours of the first member in the pair is a subset of the behaviours of the second member of the pair.
We capture these degrees of flexibility with three largely orthogonal categorical abstractions.First, we use coalgebras as a means of modeling many kinds of transition systems.Second, fibrations represent the types of data we are interested in deriving about the states of a coalgebra.Finally, functor liftings together with a property of fibrations allow us to model the different ways the same type of data may be created.We review each of these concepts separately here.
We assume familiarity with basic category theory, but not necessarily with the theory of fibrations.

Coalgebras
Coalgebras are our tool of choice for modeling state-based transition systems.Given a Set endofunctor F, an F-coalgebra is a pair (I, f ) consisting of a set I and a function f : I → FI.The set is often called the carrier of the coalgebra, while the function provides the transition structure of the coalgebra.
This pair is usually interpreted as a transition system under the following scheme.The (object part of the) functor F is thought of as an operation which sends a set of states to the set of all possible transition structures on that set.The set I is the set of states of a transition system.Under this interpretation, FI is then set of all the possible transition structures available using the set of states I, so the transition structure map f : I → FI assigns one of these possible transition structures to every state in I.
A coalgebra morphism φ : (I, f ) → (J, g) is a function on the underlying state sets φ : I → J which respects the transitions in the source coalgebra, meaning g•φ = Fφ• f .F-coalgebras together with their morphisms form a category we denote by Coalg(F).
By varying the functor F, we can capture a wide variety of transition system types, including deterministic and nondeterministic finite automata, Mealy and Moore machines, probabilistic transition systems, Markov decision processes, Segala systems and many more.For more background on the theory of coalgebra, we recommend consulting [Rut00].

Fibrations
A fibration over a category B is a functor π : E → B with a cartesian lifting property.We will describe this property later, but intuitively, it allows us to take the inverse image of objects in E along morphisms in B. The source category of the fibration, E, is referred to as the "total category" and the target is the "base category".
Often the total category of a fibration is depicted vertically above the base category and language referencing this physical configuration is common.An object or morphism ȧ in E is above or over an object or morphism a in B means πȧ = a.The collection of objects and morphisms above an object I and the id I morphism is called the fibre over I.Each of these fibres is itself a subcategory of E, denoted by E I .Now we discuss the cartesian lifting property.In a fibration 1 over B, for every morphism f : I → J in B and every object Y in E above J, there is a morphism ḟ : f * Y → Y such that ḟ is above f (hence f * Y is above I).This morphism is called a cartesian lifting of f with Y and is further required to satisfy the following universal property: for all morphisms g : K → I in B and ḣ : The operation sending Y to f * Y is often called pullback.2Pullback also sends morphisms in E J to morphisms in E I by the universal property.Straightforward checks show that the assignment Y → f * Y extends to a functor f * : E J → E I .When g * f * = ( f • g) * and id * I = Id E I holds, we say that the fibration is split.A functor π is a cofibration if π op : E op → B op is a fibration, and bifibration if π and π op are fibrations.Pullback in π op is denoted by f * , and called pushforward.In a bifibration, the pullback f * is a right adjoint to pushforward f * [Jac99, Lemma 9.1.2].
A common scenario encountered in the study of fibrations is that each fibre E I has a categorical structure, say X, and pullback functors preserve these fibrewise structures.When this is the case, we say that the fibration has fibred X.For instance, a fibration π : E → B has fibred final objects if 1) each fibre E I has a final object, and 2) for any morphism f : I → J, the pullback functor f * : E J → E I preserves final objects.The fibrewise structure and the structure on the total category often have a close relationship.We state it next for the case X = "limit".
Theorem 1 ([Jac99]).Let π : E → B be a fibration and D be a category.If B has limits of shape D, and π has fibred limits of shape D, then E also has limits of shape D.
The dual version of this theorem also holds, replacing fibration with cofibration, limit with colimit and pullback with pushforward.
We also mention the preservation of fibrations by functor-category construction: Theorem 2. For any fibration π : E → B and category In this work, we are interested in state-based transition systems.Hence, the fibrations we are most interested in have B = Set.Indeed, most of the total categories we are interested in are sets equipped with some extra structure, such as sets with relations or sets with a metric.In these cases, the forgetful functor is usually a fibration.We list some examples of this situation next.
Example 3. The forgetful functors from the following categories to Set are fibrations: -Pre is the category of preorders and monotone functions between them.
-ERel is the category of endorelations.An object is a pair (I, R) of I ∈ Set and R ⊆ I × I. Morphisms are Set functions which preserve the relation: -RERel is the category of R + -indexed endorelations. 3 That is, an object is a pair (I, R) of I ∈ Set and a R + -indexed family {R } ∈R + of endorelations on I monotone in the index, so δ ≤ implies R δ ⊆ R .Morphisms are required to preserve the relation at each value , meaning i R i implies f (i) S f (i ) for all .
-BVal is the category of all R + -valued binary endorelations.Objects in this category are pairs (I, r) of a set I together with a function r : I × I → R + , with no constraints.Morphisms in this category are required to be non-expansive, meaning f : (I, r) → (J, s) satisfies s( f (i), f (i )) ≤ r(i, i ) for all i, i ∈ I. -PMet b is the full subcategory of BVal consisting of b-bounded pseudometric spaces, for a fixed bound b ∈ (0, ∞]. 4 An extended pseudometric is an ∞-bounded pseudometric, and the category of extended pseudometrics is called EPMet.-Top, Meas are the categories of all topological / measurable spaces and continuous / measurable functions between them, respectively.-V-Cat, with a commutative quantale V, is the category of small V-categories and V-functors between them.The forgetful functor extracts the object part of small Vcategories.This category is used in [BKV15] as a generalisation of metric spaces.
Technically, a fibration is a functor, particularly the forgetful functor in the examples above.In these examples, however, the functor is relatively unremarkable, so we will abuse terminology slightly and refer to the fibration by the name of the total category.
Cartesian morphisms in ERel preserve and reflect their source relation, in RERel they preserve and reflect the relation at each index, and in BVal and PMet b they are isometries, replacing the ≤ in the condition for non-expansiveness with =.

CLat ∧ -Fibrations over Set
In this paper, we focus on the fibrations over Set such that 1) each fibre category is a complete lattice and 2) pullbacks preserve all meets in fibres.Such fibrations bijectively correspond to functors of type Set op → CLat ∧ via the Grothendieck construction, where the codomain is the category of complete lattices and meet-preserving functions between them.Following [AdAGH + 17, Secrion 4.3], we call such fibrations CLat ∧fibrations over Set, or simply CLat ∧ -fibrations in this paper.This is a restricted class of topological functors to Set [Her74], where each fibre category is a poset.
There are indeed many examples of CLat ∧ -fibrations over Set, covering a wide range of mathematical objects, including preorders, predicates, relations, pseudometrics, topologies, σ-fields and so on.In particular, every fibration listed in Example 3 is a CLat ∧ -fibration.
We introduce a notation: for objects X, Y ∈ E in a CLat ∧ -fibration π : E → Set and a function f : πX → πY, by f : X → Y we mean the sentence: "there exists a (necessarily unique) ḟ : Despite their simple definition, CLat ∧ -fibrations have many useful properties.Let π : E → Set be a CLat ∧ -fibration.The following properties are well-known: π is a split bifibration.(Each fibre is a poset and each pullback functor f * : E J → E I has a left adjoint f * : E I → E J by the adjoint functor theorem.)-π is faithful and has left and right adjoints, mapping I ∈ Set to the least and greatest elements in E I , respectively.We name the left adjoint ∆ : Set → E. Intuitively, it constructs discrete spaces of given sets.-E has small limits and colimits by Theorem 1.
π uniquely lifts arbitrary limits and colimits that exist in Set, including large ones.
We describe this for the case of colimits.Another less known, but important fact is that the total category E of any CLat ∧fibration over Set carries a canonical (affine) symmetric monoidal closed (SMC for short) structure.The one on Top is described in [ Č79,Bor94].The following construction of the SMC structure is a reformulation of the one given in [KR85] using fibred category theory.
The tensor unit is a chosen terminal object 1.The tensor product of X, Y ∈ E is constructed as follows.Let us define πX • Y to be the coproduct of πX-many copies of Y.We explicitly construct it above πX × πY by where (x, −) : πY → πX × πY is the function that pairs an argument with a specified x ∈ πX.We similarly define X • πY to be the coproduct of πY-many copies of X, again constructed above πX × πY.We then define the tensor product of X and Y to be the join of these two in the fibre over πX × πY: This tensor product classifies bi-E-morphisms in the following sense: a function f where −(x) : Set(πX, πY) → πY is the function that evaluates an argument function with a specified x ∈ πX.We then define the closed structure X Y to be the pullback of πX Y along the morphism part π X,Y : E(X, Y) → Set(πX, πY) of π: We note that both π : E → Set and its left adjoint ∆ : Set → E are strict symmetric monoidal (for Set we take the cartesian monoidal structure).
Example 4. We illustrate the bifibrational structure of BVal.Let us recall the order relation in the fibre categories.The following are equivalent: (1) in the fibre BVal I , (I, r) ≤ (I, s) holds, (2) id I is a nonexpansive function from (I, r) to (I, s), and (3) s(x, y) ≤ r(x, y) holds for all x, y ∈ I.Note the apparent disparity between (1) and (3): though r ≤ s in the fibre order, s has smaller values than r pointwise.
Next, let (I, r) ∈ BVal and H f / / I g / / J be functions.The pullback (H, f * r) and the pushforward (J, g * r) are given by The fibrational construction of the canonical SMC structure on BVal yields the following tensor product and closed structure:

Liftings
Another major object of study in this work are liftings of a functor.Given a Set endofunctor F and two functors π : E → Set and ρ : F → Set, a lifting of F is a functor Ḟ : In many of the cases we consider π = ρ, so Ḟ is an endofunctor on the domain of π.To emphasize this particular situation we will call such an Ḟ an endolifting.In [HCKJ13], endoliftings were called modalities.Obviously, we will also usually be considering a situation where π and ρ are CLat ∧fibrations.In such a case, restricting a lifting to a particular fibre yields a functor between fibre categories: Ḟ| I : E I → F FI .Some liftings also specially respect the cartesian morphisms of the fibrations they operate between.A lifting is called a fibration morphism if it sends cartesian morphisms in E to cartesian morphisms in F.
Notation.We pause here to set out some notational conventions, some of which have already been used.Set is the category of sets and functions.Typical objects of Set are denoted I, J, and K and typical morphisms are denoted f , g, and h.Generally, F is a Set endofunctor, C I is the constant-to-I Set endofunctor, − * is the list functor, and P fin is the finite (covariant) powerset functor.
Abstract categories are denoted D, E, and F and are often the total category for a CLat ∧ -fibrations over Set with functors π or ρ.In such a case, applying a dot or two over a Set-related entity denotes an entity in the total category above the named Setrelated entity.For example, İ is an object in the total category, ḟ is a morphism in the total category, × is the binary product in the total category, and Ḟ is a lifting of F to the total category.We will also generally use X, Y, and Z as objects in a total category.Two fibrations-BVal and ERel-are important enough to merit their own notations.Generally, r and s will denote the function in a BVal object, while R and S are the relation in an ERel object.Generally, writing a • or • over a Set-related entity has the same meaning as a dot over that entity, but particularly for the total categories BVal and ERel, respectively.
The length of a list is denoted len and subscripts shall be used to select an element from a list at the indicated (zero-indexed) list position.

Endoliftings and invariants
In this section, we describe how CLat ∧ -fibrations and liftings of a functor F to that fibration can be used to define data about every F-coalgebra.Perhaps the best-known instance of this construction creates Hermida-Jacobs bisimulations from the canonical relation lifting of a functor along ERel → Set.We describe this example first, particularly for polynomial functors F.

Relation Liftings Define Coalgebraic Relations
Recall from the previous section the fibration ERel has objects consisting of pairs (I, R) where I is a set and R ⊆ I × I is a relation on that set.The fibre category ERel I is (isomorphic to) the lattice of relations on I with a vertical morphism from (I, R) to (I, S ) if and only if R ⊆ S .
A consequence of the equivalence between inclusion of relations in a fibre and the existence of a vertical morphism between them is that any functor between fibre categories in ERel is necessarily a monotone function on relations with respect to the usual inclusion ordering.
Two important cases where we can apply this fact are (1) ERel liftings of functors restricted to a fibre and (2) pullbacks along Set functions, since these are both functors between fibre categories.If F is an ERel lifting of F, then F| ERel I is a monotone function Composing the above functions yields a monotone function f * • F| ERel FI on ERel I .Since ERel I is a complete lattice, this composite monotone function has a greatest fixed point, which we denote by (I, ν F (I, f ) ).The relation ν F (I, f ) picked out in this greatest fixed point has historically turned out examples of great interest.
Perhaps foremost among these examples is the so-called canonical relation lifting, which yields bisimilarity as its greatest fixed point.We recall the description of this lifting for polynomial endofunctors. 5The polynomial Set endofunctors are precisely those generated by the following grammar: We can create an ERel lifting for any polynomial P with constructions for each of the inductive cases.
Definition 5 (canonical relation lifting).Let and × be the coproduct and binary product operations in ERel, respectively.(These exist by Theorem 1.) The canonical relation lifting of a polynomial Set functor P is: Given a polynomial Set functor P and a P-coalgebra (I, f ), we can use the canonical relation lifting Rel(P) to form the function f * • Rel(P)| ERel I .Postfixed points of this function in ERel I give a useful general definition of bisimulation on (I, f ) [HJ98].The greatest postfixed point νRel(P) (I, f ) is bisimilarity on this coalgebra.
Example 6.As two examples of the canonical relation lifting, we present bisimulation on coalgebras of the list functor and on coalgebras of the finite powerset functor.These examples will be referenced later when we construct behavioural metrics on the same coalgebra types similarly to how we do it here.
The list functor is defined as (−) * = n∈ω i∈n Id.Following the inductive definition above, each summand in the coproduct, n Id, sends a relation R to the n-fold repetition of R: two lists k, of length n are related by Rel( n Id)(R) if k i R i holds for 0 ≤ i < n.The canonical relation lifting for n∈ω n Id then relates two lists k, of arbitrary length if and only if len(k) = len( ) (they come from the same index in the coproduct), and k i R i holds for 0 ≤ i < len(k).In other words, (k, ) ∈ Rel( n Id)(R).
The finite powerset functor is the quotient of the list functor by the transformation set I : I * → P fin I given by set I : (i 1 , . . ., i n ) → {i 1 , . . ., i n }.The pushforward of the lifting for the list functor along this natural transformation is the usual definition of bisimulation for the finite powerset functor.Explicitly, Rel(P fin )(R) = {(J, K) ∈ P fin I × P fin I : ∀ j ∈ J, ∃k ∈ K. jRk ∧ ∀k ∈ K, ∃ j ∈ J. jRk}

Generalizing Hermida-Jacobs Bisimulation
The necessary components to define Hermida-Jacobs bisimulation conveniently can be found in any CLat ∧ -fibration with any endolifting of any functor.Thus, we can define the abstract counterpart of a bisimulation.This terminology is intended to echo [HCKJ13].
Ḟ-invariants and Ḟ-invariant morphisms together form a category, in fact exactly the category Coalg( Ḟ).Ḟ-invariants also evidently sit over F-coalgebras according to π, so we name the functor sending Coalg( Ḟ) to Coalg(F).Definition 8. Given a endolifting Ḟ on a functor F, the underlying coalgebra functor Coalg(π) : Since π is faithful in a CLat ∧ -fibration, the coalgebra structure α of an Ḟ-invariant (X, α) on (I, f ) is unique.Therefore, an alternative definition of an Ḟ-invariant on (I, f ) is an object X above I such that there exists a (necessarily unique) morphism α : X → ḞX above f .
Yet another definition of an Ḟ-invariant can be derived from the lattice structure of E I .For each coalgebra (I, f ), there is a monotone function f * • Ḟ| E I : E I → E FI → E I as described above.An Ḟ-invariant on (I, f ) is then precisely a postfixed point for this function.
A useful consequence of this last characterization is the observation that since each fibre E I is a complete lattice, Knaster-Tarski ensures the Ḟ-invariants on (I, f ) form a complete sublattice.In particular Definition 9.The greatest Ḟ-invariant on an F-coalgebra (I, f ) always exists and is called the Ḟ-coinductive invariant.We denote the Ḟ-coinductive invariant on (I, f ) by ν Ḟ(I, f ) .
We can alternatively reach ν Ḟ(I, f ) by the final sequence argument inside the fibre E I ; this is the approach taken in [BBKK14].In [HCKJ13], coinducive invariants were called coinductive predicates.
Ḟ-similarities give final objects within each fibre category, but there is no assurance of a final object in the total category, nor that final objects are preserved by coalgebra morphisms.The next result, which reorganizes results presented in [HCKJ13, Section 4], sets out some conditions entailing these desiderata.For the item 2 and 3 of the above theorem, see also [HCKJ13,Corollary 4.3].
This theorem is a fibred counterpart of some results in Section 6 of [BBKK14].To see this, we instantiate Theorem 10 with the following data: the CLat ∧ -fibration π : PMet b → Set (Section 2), a functor F : Set → Set having a final F-coalgebra νF and a lifting Ḟ of F along π that preserves cartesian PMet b morphisms (isometries).Then -Theorem 6.1 in [BBKK14] is equivalent to the conclusion of (this instance of) item 3 of Theorem 10. -Let I = (I, f ) be an F-coalgebra, and !I : I → νF be the unique F-coalgebra morphism.The behavioural distance of I in [BBKK14] corresponds to the pullback !* I (ν ḞνF ) in our fibrational language.-Theorem 6.2 in [BBKK14] corresponds to νF I =! * I (ν ḞνF ), which follows from (this instance of) item 2 of Theorem 10.

Constructions of Liftings along CLat ∧ -Fibrations
There are many examples of liftings of functors in well-known fibrations, such as the fibration of relations or pseudometrics.Some of these liftings even form classes which cover all functors, such as the canonical relation lifting or the generalized Kantorovich liftings of [BBKK14], which ensure every functor has a lifting in ERel and PMet b respectively.In this work we are considering a variety of fibrations, so a natural concern is whether liftings of Set functors exist in all of these CLat ∧ -fibrations.
In this section, we generalize a variety of constructions known in particular fibrations to arbitrary CLat ∧ -fibrations.In Sections 4.1 and 4.2, we give two constructions, the first using enriched left Kan extensions and the second using codensity liftings.Then in Section 4.3 we mention how to use the categorical structure of the CLat ∧ -fibration to create new liftings from old.
Hence, in this section we find ourselves with the following ingredients: and seek to create an endolifting of F in a variety of ways.

Lifting by Enriched Left Kan Extensions
The canonical SMC structure on E (Section 2) allows us to discuss enriched liftings of F to E e , the self-enriched category of E with its SMC structure.To discuss this, we introduce some E-categories and E-functors.
-By E e we mean the self-enriched E-category of E (that is, E e (X, Y) = X Y).Theorem 11.Consider the situation (1).Let C : Set → E be a functor such that πC = F. Then there is an enriched left Kan extension Ḟ of C : ∆ * Set → E e along ∆ : ∆ * Set → E e such that its underlying functor Ḟ0 : E → E (see [Kel82]) is a lifting of F along π.
Proof.Since the codomain E e of C has E-tensors, the enriched left Kan extension can be computed by the enriched coend: Because the codomain of B is E e , the enriched coend can be computed as an ordinary colimit of the following large diagram in E [Kel82, Section 2.1]: where I, J ranges over all objects in Set, and l I,J and r I,J are the uncurrying of B(I, −) J,I and B(−, J) I,J , respectively.In E, ∆I ⊗ X is a tensor of X with I ∈ Set because We name the passage from right to left φ.The bottom objects of diagram (2) are thus tensors of B(I, J) with Set(J, I) for each I, J ∈ Set, and moreover, by easy calculation, we have l I,J = φ(B(I, −)) and r I,J = φ(B(−, J)).Therefore a colimit of the diagram (2) can be computed as an ordinary coend of B : Set op × Set → E.
To compute this (large) coend of B, it suffices to show that the coend of πB exists in Set, because π uniquely lifts coends.We have a natural isomorphism ι I,J : πB(I, J) → Set(I, πX) × F J, and the right hand side has a coend {i I : Set(I, πX) × FI → FπX} I∈Set defined by i I ( f, x) = F f x.Therefore since π uniquely lifts colimits (Section 2.3), we obtain a coend of B. To summarise, the enriched left Kan extension is computed as Example 12. Let π : Pre → Set be the CLat ∧ -fibration from the category Pre of preorders and F : Set → Set be a functor.We compute the enriched left Kan extension Lan ∆ ∆F.For (X, ≤) ∈ Pre, the enriched left Kan extension Lan ∆ ∆F(X, ≤ X ) is the preorder on FX generated from the following binary relation: where p i : (≤ X ) → X is the composite of the inclusion (≤ X ) → X × X of the preorder relation and the projection function π i : X × X → X.
When F is the powerset functor P, the enriched left Kan extension Lan ∆ ∆P(X, ≤ X ) gives the Egli-Milner preorder X on PX, as computed in [BKV15, Example 3.8]: This is exactly the Kantorovich lifting in [BBKK14, Definition 3.1].

Combining Liftings
We have seen two methods to lift endofunctors.In this section, we discuss building new liftings from existing ones.Below we set up a suitable category in which these operations are characterised as categorical constructions. Let Set] is a partial order bifibration with fibred meets of arbitrary size.We take the following change-ofbase of this fibration along − • π: The vertex of this change-of-base is the category Lift(π) of liftings along π.An object is a pair (F, Ḟ) of an endofunctor F : Set → Set and its lifting Ḟ : E → E along π.A morphism from (F, Ḟ) to (G, Ġ) is a pair (α, α) of natural transformations α : F → G and α : Ḟ → Ġ such that π α = απ.
The derived vertical leg q : Lift(π) → [Set, Set] is also a partial order bifibration with fibred meets (of arbitrary size).Since [Set, Set] has small limits and colimits, by Theorem 1, Lift(π) has small limits and colimits, hence small products and coproducts.
The bifibredness of q, together with these products and coproducts give us a recipe to combine liftings.

Identity and Constant
The lifting of Id Set is Id E , while the lifting of the constant functor C I (J) ≡ I is ĊI (X) ≡ ∆I.Product and Coproduct Let (F i , Ḟi ) be an I-indexed family of liftings along π.Then their product and coproduct are computed pointwise.Pullbacks and Pushforwards For a lifting (F, Ḟ) along π and natural transformations In particular, these constructions ensure all polynomial and finitary functors in Set have at least one lifting in every CLat ∧ -fibration.

The Hausdorff Pseudometric
As an example of how liftings can be constructed with these basic operations, we demonstrate the construction of the Hausdorff pseudometric on finite sets in a BVal lifting of the finite powerset functor.Our version of the Hausdorff distance will take a BVal object (I, d) and create a BVal object (P fin I, Hd).
Recall that the finite powerset can be realized as a quotient of a polynomial functor with the following construction.First, recall the list functor: (−) * = n∈ω i∈n Id.This is patently a polynomial functor.Then the finite powerset functor is the quotient of the list functor by the natural transformation set I : I * → P fin I from Example 6.
We can build up a BVal lifting of the finite powerset functor in parallel with this construction.First, using the product and coproduct in BVal we derive a BVal lifting for the list functor.Given a BVal object (I, d) the lifted distance on lists k, ∈ I * is: Then a BVal lifting for the finite powerset functor arises as the pushforward of the list lifting along the transformation set.In Example 4, we found pushforward in BVal explicitly so, Hd(J, K) = inf We have denoted this distance Hd since it turns out to be equal to the usual Hausdorff distance.However, this is not the usual formulation for the Hausdorff distance, so we briefly discuss why this is equivalent.
The usual definition of Hausdorff distance for a metric space is Hd(J, K) = max sup where J, K ⊆ I. Typically the Hausdorff distance is also restricted to nonempty compact subsets of the metric space so that Hd is truly a metric.(Otherwise Hd(J, K) = 0 J = K for example.)Since we are interested in pseudometrics anyway, we do not place any such restriction on the domain of Hd.
In the finite case, the Hausdorff distance has a game theoretic interpretation as the result of a two-turn game played between a lazy walker (Gerry) and an antagonist (Tony).In the first round, Tony picks a starting point from either J or K for Gerry.In the second round, Gerry walks from Tony's starting point in J (K) to any point in K (J).The result of the game is the distance Gerry walks.Gerry's goal is to minimize this distance; Tony's goal is to maximize it.
Gerry's optimal strategy is straightforward.Given a starting point, Gerry finds the distances to the (finitely many) points in the other set and picks the least one.Since Gerry's optimal strategy is clear, Tony can make a list consisting of all the points in J ∪ K and the distance Gerry will have to walk if that point is used as the starting point.Then Tony's optimal strategy is to pick the starting point corresponding to the greatest distance on this list.
This analysis indicates we can interchange the order of the players and obtain a game with the same result: Gerry can first announce where he will walk given every possible choice of starting point, then Tony picks one of the choices offered by Gerry.If Tony is given two lists k and by Gerry, he will be to force the result of this modified game to be where d * is the list distance defined above.Gerry's best strategy is to pick k and with the closest corresponding distances possible, making the final result of this modified game inf where the constraints set(k) = J and set( ) = K express the fact that Gerry must make a choice for every single starting point.Since these games have the same result, we know max sup Therefore, our formulation of the Hausdorff distance is equal to the usual formulation of the Hausdorff distance, modulo the consideration that we are satisfied with a pseudometric and so do not confine our definition to nonempty compact sets.6

The Category of Endoliftings
In Section 3, we defined endoliftings and their instantiations to Ḟ-invariants on particular coalgebras.We showed that with certain constraints on the ambient categories, the Ḟ-coinductive invariant exists and is preserved by coalgebra morphisms.In Section 4, we showed that endoliftings exist in many CLat ∧ -fibrations, and gave several constructions and combinators for producing endoliftings in these general conditions.In this section, we we observe that endoliftings can be collected into a category using the following definition.
Definition 16.A endolifting morphism from one endolifting (π : E → Set, Ḟ) to another (ρ : Endolifting morphisms do not appear in the story of Hermida-Jacobs bisimulations or the coalgebraic predicates defined analogously, but we will observe this category is a useful abstraction for comparing coalgebraic invariants of various endoliftings.
A concrete goal in this section is to establish some general conditions under which a BVal coinductive invariant has an ERel coinductive invariant at its kernel.Results of this type are pursued, for example, in [CGPX14].

Quantitative and Qualitative Liftings
We begin by focusing on three CLat ∧ -fibrations introduced in Section 2.3, namely ERel, RERel, and BVal.These total categories consist of sets together with endorelations, real-indexed families of endorelations, and "distance" functions (which satisfy no metric axioms other than having codomain nonnegative reals), respectively.
These fibrations have many functors between them: where (the object parts of) each of these functors are given by Note that the two functors between ERel and RERel are actually a real-indexed family of functors, where ∈ [0, ∞).It may help to think of S as Stratifying a distance function into a family of relations and L as finding the Least index where the relation holds.As usual, the empty infimum in the definition of L is the maximum element, namely ∞.
These functors patently do not change the index set I associated with each of the objects in the total category.Each of these functors is also defined to be the identity on morphisms. 7Therefore, these are liftings of the identity on Set.
We define the composite functor T = (− ) • S .This functor sends (I, r) ∈ BVal to (I, {(x, y) | r(x, y) ≤ }) ∈ ERel, truncating the distance function r at .The fact that T is a right adjoint, as depicted in the diagram above, will be an important fact later on.
The functor T 0 gives the kernel of a distance function, namely the relation consisting of pairs which are at distance 0. A common desideratum of pseudometric liftings or more generally BVal liftings is that the kernel of the F-coinductive invariant function in BVal is bisimilarity in ERel (i.e. the Rel(F)-coinductive invariant where Rel(F) is the canonical relation lifting of F, defined in Section 3.1).We show how to establish this result for the Hausdorff metric in a highly reusable manner.

T is a Endolifting Morphism between Kripke Polynomial Functors
Next, we show that T is a endolifting morphism from every polynomial functor in BVal to the polynomial functor of parallel shape in ERel.This result is the backbone of our proof that T is a endolifting morphism from the Hausdorff lifting of the finite powerset functor to the canonical relation lifting of the finite powerset functor.
Proposition 17.For all ∈ [0, ∞), T is a endolifting morphism: 1. from Id BVal to Id ERel , 2. from ĈA to C A where C A is the constant-to-A functor, and 3. from F1 × F2 to Rel(F 1 ) × Rel(F 2 ), given that it is a morphism from Fi to Rel(F i ), and 4. from ˆ i Fi to i Rel(F i ), given that it is a morphism from Fi to Rel(F i ) Therefore, T is a endolifting morphism from any polynomial functor in ERel to the polynomial functor of the same shape in BVal.
This establishes T as a endolifting morphism between polynomial functors, but we also want it to be a endolifting morphism from the Hausdorff lifting of P fin to the canonical relation lifting in BVal.That is, we want to show T : H → Rel(P fin ) is a endolifting morphism.A reasonable strategy, given the proof we just completed, would be to hope that if T is a endolifting morphism between two liftings of a functor, then it is a morphism between the pushforward of those functors along a natural transformation in the base category.In general this is not true, but liftings satisfying a simple side condition do have this property.
Proposition 18. Suppose τ : P → F is a natural transformation in Set, T : P → P (Section 5.1) is a endolifting morphism from a BVal lift of P to an ERel lift of P, and F and F are the pushforwards of P and P along τ.Further suppose for every set I, every f, f ∈ FI and r : I × I → R + , the lower bound for { Pr(p, p ) : τp = f and τp = f } is achieved in this set.Then T is a endolifting morphism from F to F.
We can now apply this proposition to obtain the following corollary.
Corollary 19.T is a endolifting morphism from H to Rel(P fin ).
Proof.Proposition 17 shows T is a endolifting morphism from the standard BVal lifting for the list functor to the standard ERel lifting for the list functor.We know H and Rel(P fin ) are the pushforwards of these list functors along set X in their respective total categories.8Hence to apply Proposition 18 we only need to show for all finite sets J, K ⊆ I, and all distances r : I × I → R + , there exist lists k † and † such that r * (k, ).We noted this in the Hausdorff distance section, where these dagger lists represent Gerry's optimal strategy.

Approximate Bisimulations: an Example from Control Theory
Here we present an example from a rather different context: approximate bisimulation by Girard and Pappas [GP07].Defined as a binary relation on a metric space that is subject to the "mimicking" condition, the notion is widely used in control theory as a quantitative relaxation of usual (Milner-Park) bisimulation that allows bounded errors.Its principal use is in bounding errors caused by some abstraction of dynamical systems: given the original dynamics S, one derives its abstraction A; by exhibiting anapproximate bisimulation between S and A, one then shows that the difference between the trajectory of A and that of S is bounded by .Such abstraction methods include: state space discretization (e.g. in [GPT10]) and ignoring switching delays [KSH17].See [GP11] for an overview.
In the above scenario, an -approximate bisimulation between S and A is synthesized through analysis of the continuous dynamics of S: for example the incremental stability of S yields an approximate bisimulation via its Lyapunov-type witness.Another common strategy for finding an approximate bisimulation is via a bisimulation function.Our goal here is to describe the latter strategy in the current coalgebraic and fibrational framework. We The difference from the usual Milner-Park bisimulation is that R is additionally required to witness the -proximity of outputs of related states q and q .A bisimulation function is a quantitative (real-valued) witness for an approximate bisimulation.In many settings in control theory where dynamics are smooth and described by ordinary differential equations, such real-valued functions are easier to come up with than an approximate bisimulation itself.For the above LTS, a function v : Q × Q → R + is a bisimulation function if it satisfies, for each q, q ∈ Q, max d o(q), o(q ) , sup l∈U Hv δ(l, q), δ(l, q ) ≤ v(q, q ) (5) A crucial fact is that a bisimulation function v gives rise to an -approximate bisimulation {(q, q ) | v(q, q ) ≤ }.See e.g.[GP11].We move on to give a categorical account of this construction.We use the following functor as a coalgebra signature: We can then package a U-labelled finitely branching LTS and an output function into a single F-coalgebra Q = (Q, o, δ : Q → FQ).
Indeed, by unfolding the definitions the following can be observed: F -invariants on Q are nothing but -approximate bisimulations; and F-invariants on Q are bisimulation functions.Thanks to Proposition 17 and Corollary 19, the functor T -that sends a function v : Q×Q → R + to the relation {(q, q ) | v(q, q ) ≤ }-is a endolifting morphism from F to F. Therefore T transfers a F-invariant v on Q to a F -invariant T v on Q, that is, a bisimulation function to an -approximate bisimulation.

Endolifting Morphisms Preserve Final Coalgebras
We next state a result which we can use to ensure that the coinductive invariant in the source of a endolifting morphism is sent to the coinductive invariant in the target of that morphism.
Proof.Preservation of top elements ensures H E I = F I .Since H is a fibration map and a endolifting morphism, we get H( f * Ḟ(A I )) = f * F(H(A I )) for all A I ∈ E I .Combining this with the above observation ensures H sends the final sequence in the fiber E I to the final sequence in the fiber F I .Finally, H preserving meets ensures H will send the Ḟ-coinductive invariant for (I, f ) to the F-coinductive invariant for (I, f ).
Note T satisfies most of the conditions in this lemma.Since we are interested in concluding something about the kernel of a behavioural metric, we specialize to the case where = 0 where these conditions are all satisfied.
Corollary 21.If T 0 is a endolifting morphism from ( F, BVal) to ( Ḟ, ERel), then the behavioural metric induced by F has the coalgebraic predicate induced by Ḟ at its kernel.
Proof.T is a fibration map and a right adjoint, and thus preserves all fibred meets.All our work from the previous section establishing that T is a endolifting morphism from H to Rel(P fin ) now pays off.
Corollary 22.The Hausdorff behavioural metric on P fin X has P fin -bisimilarity at its kernel.
Above, we also showed T 0 is a endolifting morphism between many other BVal and ERel liftings (Proposition 17).Therefore, we could also derive an analog of Corollary 21 for these pairs and conclude behavioural metrics of the BVal lift have bisimilarity (the coalgebraic relation of the corresponding ERel lift) at their kernels.

Conclusions and Future Work
We presented a fibrational framework for various extensions of (bi)simulation notions.On the categorical side our focus has been on structural aspects of fibrations such as fibration morphisms and lifting by Kan extensions; on the application side we took examples from quantitative reasoning about systems.This has allowed us to capture known constructions in more abstract and general terms, such as the Hausdorff pseudometric and approximate bisimulation in control theory.
As future work, we shall investigate conditions under which the two liftings in Section 4-one by left Kan extension and the other involving right Kan extensioncoincide.We would then compare this coincidence and the Kantorovich-Wasserstein duality, which is the coincidence of the metric on probability distributions computed by sup and inf.We mentioned that Top and Meas are examples of CLat ∧ -fibrations; their use in reasoning about systems will also be explored.
For any diagram F : D → E and a colimiting cocone {ι D : πFD → C} D∈D of πF in Set, there exists a unique colimiting cocone {ι D : FD → Ċ} D∈D of F in E such that πι D = ι D .The colimit Ċ is given as D∈|D| (ι D ) * (FD).The same statement holds for coends instead of colimits.-The change-of-base of a CLat ∧ -fibration π : E → Set along any F : Set → Set is again a CLat ∧ -fibration.

-
Since the left adjoint ∆ : Set → E of π (see Section 2.3) is strict monoidal, it yields the change-of-base 2-functor ∆ * : CAT → E-CAT.It takes a locally small category C and returns the E-category ∆ * C defined by Obj(∆ * C) = Obj(C) and (∆ * C)(I, J) = ∆(C(I, J)).-For any functor G : C → E, we define the E-functor G : ∆ * C → E e by: GI = GI, and G I,J : (∆ * C)(I, J) → E e (GI, GJ) is the mate of G I,J : C(I, J) → E(GI, GJ) with the adjunction ∆ π; recall that π(E e (X, Y)) = π(X Y) = E(X, Y) by construction.The following is a generalisation of [BKV15, Theorem 3.3].
X) ⊗ CI; see[Kel82, (4.25)].We define the body of this coend by B(I, J) = E e (∆I, X) ⊗ CJ.It is an E-functor of type (∆ * Set) op ⊗ ∆ * Set → E e .Similarly, we define an ordinary functor B : Set op × Set → E by B(I, J) = B(I, J) on objects and B( f, g) = πB (I,J),(I ,J ) ( f, g) on morphisms.A calculation shows that B is equal to the ordinary functor λ(I, J) .(LI X) ⊗ CJ.

F[ 0
, b] → [0, b] be an F-algebra; in [BBKK14] it is called an evaluation function.We then form the following lifting parameter: A = 1, R = ([0, b], α), and S = ([0, b], d e ), where d e is the standard euclidean distance d e (x, y) = |x−y| on [0, b].Then the codensity lifting with this parameter yields the following construction of pseudometric: , y) = inf k∈I * : set(k)=J ∈I * : set( )=K d * (k, ) fix the set O of output values together with a distance function d : O × O → R + , and a U-labelled finitely branching LTS (Q, δ : Q → U P f in Q) with an output function o : Q → O, where denotes the power operation [Lan98, p. 70].Anapproximate bisimulation relation is a binary