Guarded Behavioural Functor in Type Theory
- Guarded behavioural functor is a contractive endofunctor that delays recursive occurrences via the later modality to ensure productive coinductive definitions.
- It forms final guarded coalgebras by safely instantiating recursion under delays, aligning abstract bisimilarity with intrinsic path equality.
- The concept underpins practical examples like streams and labelled transition systems, bridging coalgebraic reasoning with type-theoretic productivity.
A guarded behavioural functor is an endofunctor whose recursive argument is delayed by the later modality , 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 -calculus, this means that every recursive occurrence of a type variable appears under at least one ; in Ticked Cubical Type Theory (TCTT), it means that a functor 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 (Møgelberg et al., 2018).
1. Typed delay, ticks, and guarded recursion
TCTT extends Cubical Type Theory with a sort of ticks and a corresponding later, or tick, modality . Contexts may be extended by a tick variable , and the modality behaves like a dependent function space over ticks:
with the usual - and 0-equalities
1
In this setting one has a guarded fixed-point operator 2 under the assumption 3, and from it one derives 4, satisfying
5
up to a path. TCTT also proves that 6 commutes with path types, in the sense that for 7,
8
so delay is extensional (Møgelberg et al., 2018).
The guarded 9-calculus presents the same discipline syntactically. Guarded recursive types are formed by requiring that every recursive occurrence of a variable 0 be under at least one 1: 2 with the side condition that 3 is guarded in 4. Ordinary coinductive types are then recovered by modal quantification or the constant modality: 5 This arrangement separates guarded or step-indexed recursion from fully coinductive types, and it is precisely the guard imposed by 6 that enforces productivity of well-typed programs (Clouston et al., 2016).
2. Definition of the guarded behavioural functor
In TCTT, a guarded behavioural functor is a small endofunctor
7
equipped with functorial action on maps
8
satisfying the identity and composition laws up to path equality, and crucially contractive in the sense that 9 preserves delay. Equivalently, one requires a specified natural path
0
for each 1. Concretely, this yields maps
2
and back up to path equality, so that 3 may be used safely under 4 in guarded definitions. The paper’s summary states the point directly: a guarded behavioural functor is “simply a contractive endofunctor 5 which you can safely instantiate under the tick 6 to form a final guarded coalgebra” (Møgelberg et al., 2018).
In the guarded 7-calculus, the same idea appears as an endo-type-operator
8
whose recursive occurrence is 9-guarded. Equivalently,
0
where 1 may be any polynomial type-operator built from sums, products, arrows, and box. On the categorical side, in the topos of trees 2, a guarded behavioural functor is an endofunctor 3 fitting into a factorisation
4
with 5 itself a strong polynomial functor. In practice, this means that every recursive occurrence of 6 is shifted back one time-step (Clouston et al., 2015).
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 7 in the guarded 8-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 9 in TCTT, its final guarded coalgebra is formed as the guarded-recursive type
0
The unfolding path of the fixed point supplies an equivalence
1
with inverse
2
Up to definitional unfolding, one has judgmental equalities
3
witnessed by paths from the fixed-point constructor. Thus the guarded recursive type is not only defined but carries the expected coalgebraic structure (Møgelberg et al., 2018).
In the guarded 4-calculus and its semantics in the topos of trees, local contractiveness yields a unique guarded fixed point. For the stream-shape endofunctor
5
one obtains
6
and concretely
7
with restriction by dropping the last component. This object is the final 8-coalgebra, so at stage 9 it represents streams of length 0 (Clouston et al., 2016).
To recover a true coinductive datatype from the guarded one, the clock is quantified away: 1 In the topos of trees, the corresponding operation is the constant-object comonad 2, concretely
3
for all 4. 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 (Clouston et al., 2015).
4. Relation lifting and the bisimilarity theorem
For a guarded 5-coalgebra
6
TCTT defines the relation lifting of 7 on a relation 8 by
9
where
0
Then 1 is an 2-bisimulation if
3
The greatest bisimulation is defined guarded-recursively by
4
The construction follows the standard coalgebraic pattern, but here it is internalized in guarded type theory (Møgelberg et al., 2018).
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 5 and 6,
7
Second, relation lifting commutes with delay: 8 for 9. Third, the coalgebra structure
0
is an embedding, indeed an equivalence. Combining these facts by guarded recursion yields
1
In particular, on the final process type, the coinduction principle holds in its strongest form: to prove 2, it suffices to exhibit 3 and 4 in some guarded bisimulation (Møgelberg et al., 2018).
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
5
In the topos of trees, it is defined levelwise by
6
with restriction maps
7
Its unique fixed point 8 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 9 appears only under one time-step of delay (Clouston et al., 2016).
A second canonical example, developed in TCTT, is the guarded labelled transition system functor. For a small set of labels 0,
1
where 2 is the finite-powerset HIT. One checks that 3 is small, functorial, and commutes with delay. The resulting guarded process type is
4
Its unfold map
5
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: 6 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
7
Thus two processes are path-equal exactly when they are guardedly bisimilar (Møgelberg et al., 2018).
Earlier guarded-recursion work also uses guarded behavioural functors to solve Rutten’s behavioural differential equations. A 8-ary stream function is specified by
9
with desired equations for head and tail. In the guarded 00-calculus one first defines a guarded solution 01 by a fixed point whose tail is pushed under one 02, and then lifts it to a fully coinductive solution
03
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 (Clouston et al., 2016).
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 04. Second, they admit denotational semantics in the topos of trees, where objects are sequences
05
and 06 is the shift functor
07
Third, they support proof principles internal to the logic, notably L\"ob induction: 08 which mirrors the fixed-point principle for guarded recursion (Clouston et al., 2015).
The semantic consequences are equally concrete. The guarded 09-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 (Clouston et al., 2016).
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” (Møgelberg et al., 2018). 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.