---
title: Guarded Behavioural Functor in Type Theory
url: https://www.emergentmind.com/topics/guarded-behavioural-functor
type: topic
---

# Guarded Behavioural Functor in Type Theory

A guarded behavioural functor is an endofunctor whose recursive argument is delayed by the later modality $\triangleright$, so that guarded fixed points, final guarded coalgebras, and productive coinductive definitions can be formed inside a type-theoretic or categorical setting. In the guarded $\lambda$-calculus, this means that every recursive occurrence of a type variable appears under at least one $\triangleright$; in Ticked Cubical Type Theory (TCTT), it means that a functor $F:U\to U$ preserves delay in a path-theoretic sense and can therefore be instantiated safely under ticks. The notion is central to two linked goals: encoding productivity in types and aligning behavioural equivalence with the internal equality notion. For guarded recursive types in TCTT, the main result is that the abstract bisimilarity of the final guarded coalgebra coincides with path equality, while earlier guarded-recursion work used the same contractive structure to obtain productive coinductive programs, adequacy in the topos of trees, and solutions to Rutten’s behavioural differential equations [1810.13261].

## 1. Typed delay, ticks, and guarded recursion

TCTT extends Cubical Type Theory with a sort $T$ of ticks and a corresponding later, or tick, modality $\triangleright A$. Contexts may be extended by a tick variable $\alpha:T$, and the modality behaves like a dependent function space over ticks:
\[
(\triangleright\text{-Intro})\quad
\Gamma,\alpha:T \vdash t:A
\;\Rightarrow\;
\Gamma \vdash \lambda \alpha.\, t : \triangleright A
\]
\[
(\triangleright\text{-Elim})\quad
\Gamma \vdash t:\triangleright A
\;\Rightarrow\;
\Gamma,\alpha:T \vdash t[\alpha]:A
\]
with the usual $\beta$- and $\eta$-equalities
\[
(\lambda \alpha.\, t)[\alpha]\equiv t,
\qquad
\lambda \alpha.\, t[\alpha]\equiv t.
\]
In this setting one has a guarded fixed-point operator $dfix^i\,x.t:\triangleright A$ under the assumption $\Gamma,x:\triangleright A\vdash t:A$, and from it one derives $fix\,x.t:A$, satisfying
\[
fix\,x.t \equiv t[x\mapsto next(fix\,x.t)]
\]
up to a path. TCTT also proves that $\triangleright$ commutes with path types, in the sense that for $x,y:\triangleright A$,
\[
Path_{\triangleright A}(x,y)\simeq Path_A(x[\alpha],y[\alpha]),
\]
so delay is extensional [1810.13261].

The guarded $\lambda$-calculus presents the same discipline syntactically. Guarded recursive types are formed by requiring that every recursive occurrence of a variable $X$ be under at least one $\triangleright$:
\[
A ::= X \mid A\to B \mid \triangleright A \mid \mu X.\,A,
\]
with the side condition that $X$ is guarded in $A$. Ordinary coinductive types are then recovered by modal quantification or the constant modality:
\[
\nu X.\,A = \forall \kappa.\,\mu X.\,(\triangleright_\kappa A)
\quad\text{or}\quad
\nu X.\,A=\blacksquare\,\mu X.\,\triangleright A.
\]
This arrangement separates guarded or step-indexed recursion from fully coinductive types, and it is precisely the guard imposed by $\triangleright$ that enforces productivity of well-typed programs [1606.09455].

## 2. Definition of the guarded behavioural functor

In TCTT, a guarded behavioural functor is a small endofunctor
\[
F:U\to U
\]
equipped with functorial action on maps
\[
F(f):F\,X\to F\,Y
\]
satisfying the identity and composition laws up to path equality, and crucially contractive in the sense that $F$ preserves delay. Equivalently, one requires a specified natural path
\[
\theta_X : Path_U(F(\triangleright X),\triangleright F(X))
\]
for each $X:U$. Concretely, this yields maps
\[
F(\triangleright X)\to \triangleright F(X)
\]
and back up to path equality, so that $F$ may be used safely under $\triangleright$ in guarded definitions. The paper’s summary states the point directly: a guarded behavioural functor is “simply a contractive endofunctor $F:U\to U$ which you can safely instantiate under the tick $\triangleright$ to form a final guarded coalgebra” [1810.13261].

In the guarded $\lambda$-calculus, the same idea appears as an endo-type-operator
\[
F:\mathrm{Type}\to\mathrm{Type}
\]
whose recursive occurrence is $\triangleright_\kappa$-guarded. Equivalently,
\[
F = G\circ \triangleright_\kappa,
\qquad
F(X)\coloneqq G(\triangleright_\kappa X),
\]
where $G$ may be any polynomial type-operator built from sums, products, arrows, and box. On the categorical side, in the topos of trees $S=\mathrm{Set}^{\omega^{op}}$, a guarded behavioural functor is an endofunctor $F:S\to S$ fitting into a factorisation
\[
F=G\circ \triangleright
\]
with $G$ itself a strong polynomial functor. In practice, this means that every recursive occurrence of $X$ is shifted back one time-step [1501.02925].

A common misconception is to treat the notion as if it were merely an arbitrary endofunctor used in coalgebra. The guarded setting is stricter. The endofunctor must be contractive, either by explicit preservation of delay in TCTT or by a syntactic/categorical factorisation through $\triangleright$ in the guarded $\lambda$-calculus. That contractiveness is the condition that supports both productivity and guarded coinduction.

## 3. Final guarded coalgebras and recovery of coinduction

Given a guarded behavioural functor $F$ in TCTT, its final guarded coalgebra is formed as the guarded-recursive type
\[
\nu_F := fix\,X.\,F(\triangleright X):U.
\]
The unfolding path of the fixed point supplies an equivalence
\[
unfold:\nu_F \simeq F(\triangleright \nu_F)
\]
with inverse
\[
fold:F(\triangleright \nu_F)\to \nu_F.
\]
Up to definitional unfolding, one has judgmental equalities
\[
fold\circ F(next)\equiv id_{\nu_F},
\qquad
unfold\circ fold\equiv id_{F(\triangleright \nu_F)},
\]
witnessed by paths from the fixed-point constructor. Thus the guarded recursive type is not only defined but carries the expected coalgebraic structure [1810.13261].

In the guarded $\lambda$-calculus and its semantics in the topos of trees, local contractiveness yields a unique guarded fixed point. For the stream-shape endofunctor
\[
F(X)\cong A\times \triangleright X,
\]
one obtains
\[
\Str_A := \mu X.\,F(X)\cong \mu X.\,(A\times \triangleright X),
\]
and concretely
\[
(\Str_A)_i = A_i\times A_{i-1}\times\cdots\times A_1,
\]
with restriction by dropping the last component. This object is the final $F$-coalgebra, so at stage $i$ it represents streams of length $i$ [1606.09455].

To recover a true coinductive datatype from the guarded one, the clock is quantified away:
\[
\nu F \coloneqq \forall \kappa.\,\mu X.\,\triangleright_\kappa F(X).
\]
In the topos of trees, the corresponding operation is the constant-object comonad $\Box$, concretely
\[
(\Box X)_n = X_\omega
\]
for all $n$. This means that guarded fixed points and ordinary coinductive types are related but not identical: the former are step-indexed objects, while the latter arise by clock quantification or boxing [1501.02925].

## 4. Relation lifting and the bisimilarity theorem

For a guarded $F$-coalgebra
\[
f:X\to F(\triangleright X),
\]
TCTT defines the relation lifting of $F$ on a relation $R:X\to X\to U$ by
\[
Rel_F(R)(x,y)
\;:=\;
\Sigma\, t:F(tot\,R).\;
Path_{F\,X}(F\,\pi_0\,t,x)\times Path_{F\,X}(F\,\pi_1\,t,y),
\]
where
\[
tot\,R := \Sigma x,y.\,R\,x\,y.
\]
Then $R$ is an $F$-bisimulation if
\[
isBisim_f(R):=\forall x,y.\,R\,x\,y\to Rel_F(R)(f\,x,f\,y).
\]
The greatest bisimulation is defined guarded-recursively by
\[
x\sim_\nu y
\;:=\;
fix\,R.\,\lambda x,y.\,Rel_F(\lambda u,v.\,\triangleright R(u,v))(f\,x,f\,y).
\]
The construction follows the standard coalgebraic pattern, but here it is internalized in guarded type theory [1810.13261].

The main theorem identifies this abstract bisimilarity with the primitive equality notion of cubical type theory on the final guarded coalgebra. Its proof proceeds through three key facts. First, for every $X$ and $x,y:F\,X$,
\[
Rel_F(Path_X)(x,y)\simeq Path_{F\,X}(x,y).
\]
Second, relation lifting commutes with delay:
\[
Rel_F(R)(x,y)\simeq Rel_F(R\circ next)(x,y)
\]
for $x,y:F(\triangleright X)$. Third, the coalgebra structure
\[
unfold:\nu_F\to F(\triangleright \nu_F)
\]
is an embedding, indeed an equivalence. Combining these facts by guarded recursion yields
\[
\forall p,q:\nu_F.\;(p\sim q)\simeq Path_{\nu_F}(p,q).
\]
In particular, on the final process type, the coinduction principle holds in its strongest form: to prove $p=q$, it suffices to exhibit $p$ and $q$ in some guarded bisimulation [1810.13261].

This theorem addresses a central difficulty emphasized in the paper’s abstract: in proof assistants based on type theory, reasoning about coinductive types is hindered both by productivity constraints and by the lack of coincidence between built-in identity types and bisimilarity. For guarded recursive types in TCTT, the theorem removes the second obstacle by showing that the abstract behavioural equivalence collapses to identity.

## 5. Canonical examples: streams, labelled transition systems, and behavioural differential equations

The basic stream example is the guarded behavioural functor
\[
F(X)=A\times \triangleright X.
\]
In the topos of trees, it is defined levelwise by
\[
(FX)_1=A_1,
\qquad
(FX)_{i+1}=A_{i+1}\times X_i,
\]
with restriction maps
\[
(a,x)\mapsto (r_i^A(a),r_{i-1}^X(x)).
\]
Its unique fixed point $\Str_A$ is the stream object, and the final coalgebra semantics models infinite streams through their finite approximations. This is the prototypical case in which guardedness is visible both syntactically and semantically: the recursive occurrence of $X$ appears only under one time-step of delay [1606.09455].

A second canonical example, developed in TCTT, is the guarded labelled transition system functor. For a small set of labels $A$,
\[
F(X):=P_{fin}(A\times X),
\]
where $P_{fin}(-)$ is the finite-powerset HIT. One checks that $F$ is small, functorial, and commutes with delay. The resulting guarded process type is
\[
Proc := \nu_F = fix\,X.\,P_{fin}(A\times \triangleright X).
\]
Its unfold map
\[
unfold:Proc\to P_{fin}(A\times \triangleright Proc)
\]
is the usual one-step observation of a process. Specializing the abstract definition of bisimulation yields the familiar guarded bisimulation condition for labelled transition systems:
\[
R(x,y)\to
(\forall x',a.\,(a,x')\in unfold\,x \to \exists y'.\,(a,y')\in unfold\,y \wedge R(x',y'))
\]
together with the symmetric clause. Proposition 5.2 shows that this concretely truncated notion agrees with the relation-lifting version after propositional truncation, and Theorem 4.6 implies
\[
p\simeq q \iff Path_{Proc}(p,q).
\]
Thus two processes are path-equal exactly when they are guardedly bisimilar [1810.13261].

Earlier guarded-recursion work also uses guarded behavioural functors to solve Rutten’s behavioural differential equations. A $k$-ary stream function is specified by
\[
h_f(x_1,\dots,x_k):A
\quad\text{and}\quad
t_f(x_1,\dots,x_k,y_1,\dots,y_k,z_1,\dots,z_k):\Str_A,
\]
with desired equations for head and tail. In the guarded $\lambda$-calculus one first defines a guarded solution $f^\dagger$ by a fixed point whose tail is pushed under one $\mathsf{next}$, and then lifts it to a fully coinductive solution
\[
f=\mathcal L_k(f^\dagger):\Str_A^k\to \Str_A
\]
via the constant modality, equivalently clock quantification. The result is a unique productive stream solution of the behavioural differential equation, and adequacy transfers the semantic uniqueness claim back to operational contextual equivalence [1606.09455].

## 6. Logical and semantic significance

Guarded behavioural functors organize a convergence of three themes. First, they provide a type-theoretic productivity discipline: recursive definitions are accepted only when every self-reference is delayed by $\triangleright$. Second, they admit denotational semantics in the topos of trees, where objects are sequences
\[
X_0 \leftarrow X_1 \leftarrow X_2 \leftarrow \cdots
\]
and $\triangleright$ is the shift functor
\[
(\triangleright X)_0 = 1,
\qquad
(\triangleright X)_{n+1}=X_n.
\]
Third, they support proof principles internal to the logic, notably L\"ob induction:
\[
\infer[\mathsf{L\"ob}]
{\Gamma\mid \Xi,\;\triangleright\phi\to\phi\;\vdash\;\phi}{}
\]
which mirrors the fixed-point principle for guarded recursion [1501.02925].

The semantic consequences are equally concrete. The guarded $\lambda$-calculus has a call-by-name operational semantics, adequate denotational semantics in the topos of trees, and an adequacy proof that entails that the evaluation of a program always terminates. In this setting, one proves contextual equivalence via the internal logic and L\"ob reasoning, while guarded behavioural functors provide the coalgebraic shapes that make productive coinduction possible [1606.09455].

Within TCTT, the significance is more specific: final guarded coalgebras enjoy an identification of bisimilarity with path equality. This implies that guarded recursion can be used to give simple equational reasoning proofs of bisimilarity, and the paper explicitly presents the result as “a step towards obtaining bisimilarity as path equality for coinductive types using the encodings mentioned above” [1810.13261]. A plausible implication is that guarded behavioural functors serve not only as a productivity device but also as a bridge between coalgebraic behavioural reasoning and the intrinsic equality structure of cubical type theory.

Source: https://www.emergentmind.com/topics/guarded-behavioural-functor