# Bisimulation

In theoretical computer science a bisimulation is a binary relation between state transition systems, associating systems that behave in the same way in the sense that one system simulates the other and vice-versa.

Intuitively two systems are bisimilar if they match each other's moves. In this sense, each of the systems cannot be distinguished from the other by an observer.

## Formal definition

Equivalently ${\displaystyle R}$ is a bisimulation if for every pair of elements ${\displaystyle p,q}$ in ${\displaystyle S}$ with ${\displaystyle (p,q)}$ in ${\displaystyle R}$, for all α in Λ:

${\displaystyle p{\overset {\alpha }{\rightarrow }}p'}$
implies that there is a ${\displaystyle q'}$ in ${\displaystyle S}$ such that
${\displaystyle q{\overset {\alpha }{\rightarrow }}q'}$
and ${\displaystyle (p',q')\in R}$;

and, symmetrically, for all ${\displaystyle q'}$ in ${\displaystyle S}$

${\displaystyle q{\overset {\alpha }{\rightarrow }}q'}$
implies that there is a ${\displaystyle p'}$ in ${\displaystyle S}$ such that
${\displaystyle p{\overset {\alpha }{\rightarrow }}p'}$
and ${\displaystyle (p',q')\in R}$.

The bisimilarity relation ${\displaystyle \,\sim \,}$ is an equivalence relation. Furthermore, it is the largest bisimulation relation over a given transition system.

Note that it is not always the case that if ${\displaystyle p}$ simulates ${\displaystyle q}$ and ${\displaystyle q}$ simulates ${\displaystyle p}$ then they are bisimilar. For ${\displaystyle p}$ and ${\displaystyle q}$ to be bisimilar, the simulation between ${\displaystyle p}$ and ${\displaystyle q}$ must be the inverse of the simulation between ${\displaystyle q}$ and ${\displaystyle p}$. Counter-example (in CCS, describing a coffee machine) : ${\displaystyle M=p.{\overline {c}}.M+p.{\overline {t}}.M+p.({\overline {c}}.M+{\overline {t}}.M)}$ and ${\displaystyle M'=p.({\overline {c}}.M'+{\overline {t}}.M')}$ simulate each other but are not bisimilar.

## Alternative definitions

### Relational definition

Bisimulation can be defined in terms of composition of relations as follows.

${\displaystyle R\ ;\ {\overset {\alpha }{\rightarrow }}\quad {\subseteq }\quad {\overset {\alpha }{\rightarrow }}\ ;\ R}$
and
${\displaystyle R^{-1}\ ;\ {\overset {\alpha }{\rightarrow }}\quad {\subseteq }\quad {\overset {\alpha }{\rightarrow }}\ ;\ R^{-1}}$

From the monotonicity and continuity of relation composition, it follows immediately that the set of the bisimulations is closed under unions (joins in the poset of relations), and a simple algebraic calculation shows that the relation of bisimilarity—the join of all bisimulations—is an equivalence relation. This definition, and the associated treatment of bisimilarity, can be interpreted in any involutive quantale.

### Fixpoint definition

Bisimilarity can also be defined in order theoretical fashion, in terms of fixpoint theory, more precisely as the greatest fixed point of a certain function defined below.

Given a labelled state transition system (${\displaystyle S}$, Λ, →), define ${\displaystyle F:{\mathcal {P}}(S\times S)\to {\mathcal {P}}(S\times S)}$ to be a function from binary relations over ${\displaystyle S}$ to binary relations over ${\displaystyle S}$, as follows:

${\displaystyle \forall \alpha \in \Lambda .\,\forall p'\in S.\,p{\overset {\alpha }{\rightarrow }}p'\,\Rightarrow \,\exists q'\in S.\,q{\overset {\alpha }{\rightarrow }}q'\,{\textrm {and}}\,(p',q')\in R}$

and

${\displaystyle \forall \alpha \in \Lambda .\,\forall q'\in S.\,q{\overset {\alpha }{\rightarrow }}q'\,\Rightarrow \,\exists p'\in S.\,p{\overset {\alpha }{\rightarrow }}p'\,{\textrm {and}}\,(p',q')\in R}$

Bisimilarity is then defined to be the greatest fixed point of ${\displaystyle F}$.

### Game theoretical definition

Bisimulation can also be thought of in terms of a game between two players: attacker and defender.

"Attacker" goes first and may choose any valid transition, ${\displaystyle \alpha }$, from ${\displaystyle (p,q)}$. I.e.:

The "Defender" must then attempt to match that transition, ${\displaystyle \alpha }$ from either ${\displaystyle (p',q)}$ or ${\displaystyle (p,q')}$ depending on the attacker's move. I.e., they must find an ${\displaystyle \alpha }$ such that:

Attacker and defender continue to take alternating turns until:

By the above definition the system is a bisimulation if and only if there exists a winning strategy for the defender.

### Coalgebraic definition

A bisimulation for state transition systems is a special case of coalgebraic bisimulation for the type of covariant powerset functor. Note that every state transition system ${\displaystyle (S,\Lambda ,\rightarrow )}$ is bijectively a function ${\displaystyle \xi _{\rightarrow }}$ from ${\displaystyle S}$ to the powerset of ${\displaystyle S}$ indexed by ${\displaystyle \Lambda }$ written as ${\displaystyle {\mathcal {P}}(\Lambda \times S)}$, defined by

${\displaystyle p\mapsto \{(\alpha ,q)\in S:p{\overset {\alpha }{\rightarrow }}q\}.}$
${\displaystyle P\mapsto \{(a,p)\in \Lambda \times S:\exists q.(a,p,q)\in P\}}$

Using the above notations, a relation ${\displaystyle R\subseteq S\times S}$ is a bisimulation on a transition system ${\displaystyle (S,\Lambda ,\rightarrow )}$ if and only if there exists a transition system ${\displaystyle \gamma \colon R\to {\mathcal {P}}(\Lambda \times R)}$ on the relation ${\displaystyle R}$ such that the diagram

commutes, i.e. for ${\displaystyle i=1,2}$, the equations

${\displaystyle \xi _{\rightarrow }\circ \pi _{i}={\mathcal {P}}(\Lambda \times \pi _{i})\circ \gamma }$

hold where ${\displaystyle \xi _{\rightarrow }}$ is the functional representation of ${\displaystyle (S,\Lambda ,\rightarrow )}$.

## Variants of bisimulation

In special contexts the notion of bisimulation is sometimes refined by adding additional requirements or constraints. For example if the state transition system includes a notion of silent (or internal) action, often denoted with ${\displaystyle \tau }$, i.e. actions that are not visible by external observers, then bisimulation can be relaxed to be weak bisimulation, in which if two states ${\displaystyle p}$ and ${\displaystyle q}$ are bisimilar and there is some number of internal actions leading from ${\displaystyle p}$ to some state ${\displaystyle p'}$ then there must exist state ${\displaystyle q'}$ such that there is some number (possibly zero) of internal actions leading from ${\displaystyle q}$ to ${\displaystyle q'}$.

Typically, if the state transition system gives the operational semantics of a programming language, then the precise definition of bisimulation will be specific to the restrictions of the programming language. Therefore, in general, there may be more than one kind of bisimulation, (bisimilarity resp.) relationship depending on the context.

## Bisimulation and modal logic

Since Kripke models are a special case of (labelled) state transition systems, bisimulation is also a topic in modal logic. In fact, modal logic is the fragment of first-order logic invariant under bisimulation (Van Benthem's theorem).

## References

1. {{#invoke:citation/CS1|citation

|CitationClass=conference }}

1. {{#invoke:citation/CS1|citation

|CitationClass=book }}