License: CC BY 4.0
arXiv:2603.25710v1 [cs.LO] 26 Mar 2026

Stone Duality for Monads

Richard Garner    Alyssa Renata    Nicolas Wu Imperial College London, London, UK Macquarie University, Sydney, Australia
Abstract

We introduce a contravariant idempotent adjunction between (1) the category of ranked monads on 𝖲𝖾𝗍\mathsf{Set}; and (2) the category of internal categories and internal retrofunctors in the category of locales. The left adjoint takes a monad TT—viewed as a notion of computation, following Moggi—to its localic behaviour category 𝖫𝖡T\mathsf{LB}T. This behaviour category is understood as “the universal transition system” for interacting with TT: its “objects” are states and the “morphisms” are transitions. On the other hand, the right adjoint takes a localic category 𝖫𝖢\mathsf{LC}—similarly understood as a transition system—to the monad Γ𝖫𝖢\Gamma\mathsf{LC} where Γ𝖫𝖢A\Gamma\mathsf{LC}A is the set of AA-indexed families of local sections to the source map which jointly partition the locale of objects. The fixed points of this adjunction consist of (1) hyperaffine-unary monads, i.e., those monads where term tt admits a read-only operation t¯\overline{t} predicting the output of tt; and (2) ample localic categories, i.e., whose source maps are local homeomorphisms and whose locale of objects are strongly zero-dimensional. The hyperaffine-unary monads arise in earlier works by Johnstone and Garner as a syntactic characterization of those monads with Cartesian closed Eilenberg-Moore categories. This equivalence is the Stone duality for monads; so-called because it further restricts to the classical Stone duality by viewing a Boolean algebra BB as a monad of BB-partitions and the corresponding Stone space as a localic category with only identity morphisms.

keywords:
behaviour category, comodels, internal categories, internal retrofunctors, monads, stone duality
volume: NNjournal: Electronic Notes in Theoretical Informatics and Computer Sciencethanks: Email: richard.garner@mq.edu.authanks: Email: alyssa.renata19@imperial.ac.ukthanks: Email: n.wu@imperial.ac.uk

1 Introduction

Notions of computation are described by monads, as is well-known from Moggi [22]. Later, Plotkin and Power [25, 26] refined this story: notions of computation are described by a set of basic computational operations Σ\Sigma, possibly of infinite arity, as well as equations \mathcal{E} saying when two program terms (constructed from the basic operations) compute the same way. The pair [Σ|][\Sigma|\mathcal{E}] is known as an algebraic theory, and it is well-known that these correspond to ranked monads on 𝖲𝖾𝗍\mathsf{Set} [21].

But what does it mean for two terms to compute the same way, or even for a term to compute? One answer is that computation is interaction between program terms and a reality external to that program. Thus, to use Plato’s allegory, the equations in a Plotkin–Power notion of computation are merely impoverished shadows on a cave wall, cast by the flame of this interactive process. For example, computations with access to state arises as interaction between programs constructed from the basic operations of 𝗀𝖾𝗍\mathsf{get} and 𝗉𝗎𝗍\mathsf{put}, against an external reality consisting of memory cells. The equation x𝗀𝖾𝗍;y𝗀𝖾𝗍;𝗋𝖾𝗍𝗎𝗋𝗇(x,y)=x𝗀𝖾𝗍;𝗋𝖾𝗍𝗎𝗋𝗇(x,x)x\leftarrow\mathsf{get};y\leftarrow\mathsf{get};\operatorname{\mathsf{return}}(x,y)=x\leftarrow\mathsf{get};\operatorname{\mathsf{return}}(x,x) is merely a syntactic manifestation of the inertia of memory cells.

Regardless, as prisoners in the cave privy only to the equations written on the wall, we still wish to understand the greater reality. One mathematical description of the possible realities inducing the equations are the comodels of Power and Shkaravska [27]. For a monad TT, a TT-comodel (W,)(W,\llparenthesis{-}\rrparenthesis) in a category 𝒞\mathcal{C} consists of an object of states W𝒞W\in\mathcal{C} along with a cointerpretation t:WaAW\llparenthesis{t}\rrparenthesis\colon W\to\sum_{a\in A}W for each computation tTAt\in TA, subject to compatibility with the monad structure of TT. We think of t\llparenthesis{t}\rrparenthesis for tTAt\in TA as a transition on WW which along the way also produces a return value in the set AA. A good intuition is that if tt is the syntax tree of a term for an algebraic theory [Σ|][\Sigma|\mathcal{E}], then each wWw\in W specifies how to deterministically run down a sequence of operations (the trace of tt at ww) to reach a return value—hence their alternative name of stateful runners [28]. As explained by Ahman and Bauer [2], we may also think of runners as virtual machines for Σ\Sigma.

Note that the definition of comodel makes use of the monad TT, and to know TT one must in effect know the equations of one’s notion of computation. To use our cave analogy, it is as if the shadows are dictating the structure of reality. But surely it is possible to find a description of the possible realities that does not depend on a particular shadow/monad TT! In this paper, we present one such description.

The Topological Behaviour Category for Finitary Monads.

For now, let us just consider the finitary monads, which are those generated by operations of finite arity. Here, the possible realities can be described as topological categories, i.e., internal categories in the category 𝖳𝗈𝗉\mathsf{Top} of topological spaces. For each finitary monad TT, there is a distinguished reality best approximating TT, which we term the topological behaviour category 𝔹T\mathbb{B}T.

Qua category, 𝔹T\mathbb{B}T is best thought as a transition system, where objects are states and morphisms are transitions. In detail, objects are certain natural transformations β:T𝗂𝖽𝖲𝖾𝗍\beta\colon T\to\mathsf{id}_{\mathsf{Set}} saying how to run each computation term tTAt\in TA down to its return value β(t)A\beta(t)\in A; while morphisms with domain β\beta are equivalence-classes [t]β[t]_{\beta} of computations tT1t\in T1 considered up to having the same trace at β\beta. In fact, this description of 𝔹T\mathbb{B}T is not new: it is the behaviour category introduced by the first-named author in [10]. What is new is the topology imposed on the sets 𝔹0T\mathbb{B}_{0}T and 𝔹1T\mathbb{B}_{1}T of objects and morphisms.

To motivate the need for topology, we consider how we might attempt to recover TT from 𝔹T\mathbb{B}T as a plain (non-topologised) category. A computation tTAt\in TA interacts with the transition system 𝔹T\mathbb{B}T at some state β\beta by causing a transition [t]β:βtβ[t]_{\beta}\colon\beta\to\partial_{t}\beta and producing an output value β(t)A\beta(t)\in A. The assignments β[t]β\beta\mapsto[t]_{\beta} and ββ(t)\beta\mapsto\beta(t) constitute a pair of functions: (1) s:𝔹0T𝔹1Ts\colon\mathbb{B}_{0}T\to\mathbb{B}_{1}Twhich is a section to the source map σ:𝔹1T𝔹0T\sigma\colon\mathbb{B}_{1}T\to\mathbb{B}_{0}T; and (2) o:𝔹0TAo\colon\mathbb{B}_{0}T\rightarrow A. It seems reasonable, then, to attempt to reconstruct TT by taking all such pairs (s,o)(s,o) as the computations returning values in AA. Indeed, we obtain in this way a monad Γ(𝔹T)\Gamma(\mathbb{B}T).

Now, consider the case where TT encodes the theory of state with countably many memory cells. Here, 𝔹0T\mathbb{B}_{0}T is simply the set of possible memory configurations, while a transition in 𝔹1T\mathbb{B}_{1}T is an assignment of new values to finitely many memory cells. What of the computations (s,o):Γ(𝔹T)(A)(s,o):\Gamma(\mathbb{B}T)(A)? Without further constraint, these may refer to the contents of infinitely many cells of the current memory configuration in determining an update and a return value. Yet, by the finitary nature of syntax, computations in TATA may query only finitely many cells to reach such a determination. So Γ(𝔹T)\Gamma(\mathbb{B}T) admits many more computations than TT, most of which are computationally unreasonable. This gap is closed by introducing a topology of finite information on 𝔹T\mathbb{B}T, and restricting Γ(𝔹T)\Gamma(\mathbb{B}T) to involve only continuous functions.

This brings us to our first main contribution. We show that, with the finite information topology, the construction T𝔹TT\mapsto\mathbb{B}T on finitary monads contravariantly extends to a functor 𝔹:𝖬𝗇𝖽ω(𝖲𝖾𝗍)𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈𝗈𝗉\mathbb{B}\colon\mathsf{Mnd}_{\omega}(\mathsf{Set})\to\mathsf{TopRetro}^{\mathsf{op}}. Here, the category 𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈\mathsf{TopRetro} has topological categories as objects, but as morphisms, not the usual functors but rather retrofunctors [23]. Retrofunctors were originally introduced by Aguiar [1] and later used to classify morphisms of polynomial comonads by Ahman and Uustalu [3, 4]. On the other hand, taking (finitary) sections yields a contravariant functor Γω:𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈𝗈𝗉𝖬𝗇𝖽ω(𝖲𝖾𝗍)\Gamma_{\omega}\colon\mathsf{TopRetro}^{\mathsf{op}}\to\mathsf{Mnd}_{\omega}(\mathsf{Set}), and this gives rise to the first adjunction in fig. 1.

𝔹:𝖬𝗇𝖽ω(𝖲𝖾𝗍){{\mathbb{B}:\mathsf{Mnd}_{\omega}(\mathsf{Set})}}𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈𝗈𝗉:Γω{{\mathsf{TopRetro}^{\mathsf{op}}:\Gamma_{\omega}}}\scriptstyle{\dashv}    𝖫𝖡:𝖬𝗇𝖽r(𝖲𝖾𝗍){{\mathsf{LB}:\mathsf{Mnd}_{r}(\mathsf{Set})}}𝖫𝗈𝖼𝖱𝖾𝗍𝗋𝗈𝗈𝗉:Γ{{\mathsf{LocRetro}^{\mathsf{op}}:\Gamma}}\scriptstyle{\dashv}

Figure 1: The Stone Adjunctions

The Localic Behaviour Category for Infinitary Monads.

Now, suppose we wish to consider a notion of state in which our memory cells contains arbitrary natural numbers: for this, we must adapt our story from finitary to infinitary monads. A simple-minded generalisation would make only this change, and otherwise proceed as before. However, we contend that the correct generalisation also replaces topological categories with localic categories, as in the second adjunction of fig. 1. This is a genuine generalisation: for indeed, when TT is a finitary monad, its localic behaviour category 𝖫𝖡T\mathsf{LB}T is the underlying localic category of its topological behaviour category 𝔹T\mathbb{B}T, and the monads Γ(𝖫𝖡T)\Gamma(\mathsf{LB}T) and Γω(𝔹T)\Gamma_{\omega}(\mathbb{B}T) found from these behaviour categories coincide.

The move to the localic world is perhaps best motivated with an example. Let TT be the monad encoding the theory of state with \mathbb{R}-many memory cells, each storing a natural number, augmented by a further equation expressing that no two memory cells can contain the same value. The admissible memory configurations for this TT correspond to injective functions \mathbb{R}\rightarrowtail\mathbb{N}—of which, of course, there are none; and yet, because the syntax of terms in TT is well-founded, it is impossible to discern this from the perspective of a program. This analysis shows that TT is non-trivial, while 𝔹T\mathbb{B}T and hence also Γ(𝔹T)\Gamma(\mathbb{B}T), are trivial: so again, Γ(𝔹T)\Gamma(\mathbb{B}T) fails badly to approximate our original TT. However, if we instead construct the behaviour category 𝔹T\mathbb{B}T in a point-free way—prioritising the topology of finite information over the global state—we obtain what we term the localic behaviour category 𝖫𝖡T\mathsf{LB}T. For the example just described, the locale of objects of 𝖫𝖡T\mathsf{LB}T is the locale of injective functions \mathbb{R}\rightarrowtail\mathbb{N}, which is known to be a non-trivial locale without points (cf. [19, Example C1.2.9]); and in fact, when we apply the analogous construction to before to obtain Γ(𝖫𝖡T)\Gamma(\mathsf{LB}T), we now recover the original TT perfectly. See example 3.4 for a more in-depth explanation.

Can we always recover TT from 𝖫𝖡T\mathsf{LB}T? In fact, no. The localic behaviour category is our best guess at reality, subject to assumptions of statefulness and determinism underlying the definition of comodels. But reality can be far stranger, in which case the recovered monad Γ𝖫𝖡T\Gamma\mathsf{LB}T is merely an imperfect approximation of the original TT. Two key examples where the imperfection is particularly pronounced (due to Uustalu [28]) are the monads for non-termination—generated by a nullary operation 𝖿𝖺𝗂𝗅\mathsf{fail} satisfying no axioms—and any theory containing a commutative binary operation \oplus, for example the theory of non-deterministic choice. In both cases, 𝖫𝖡T\mathsf{LB}T, and hence Γ(𝖫𝖡T)\Gamma(\mathsf{LB}T), are trivial, though the original monads TT are not.

In general, for a ranked monad TT, the monad Γ(𝖫𝖡T)\Gamma(\mathsf{LB}T) amounts to completing TT with prescience111in reverence to the rollback feature of the package management system nix, we may call this the nixification of TT.: To each term tTAt\in TA, there is a new operation t¯\bar{t} which intuitively performs tt, keeps track of the result, and then rolls back the state of the system to just before performing tt. Such monads were characterised by the first-named author in [12, 13] as the cartesian closed monads, i.e., those whose categories of Eilenberg-Moore algebras are cartesian closed. In the other direction, the source map of the localic behaviour category 𝖫𝖡T\mathsf{LB}T is always a local homeomorphism, and the locale of objects is always strongly zero-dimensional in the sense of Johnstone [16] (also called ultraparacompact by Van Name [30]). Following a common terminology among CC^{\ast}-algebraists [24, Definition 2.2.4], we term localic categories satisfying these conditions ample. It turns out that the cartesian closed monads and the ample localic groupoids are precisely the fixpoints of the adjunction Γ𝖫𝖡\Gamma\dashv\mathsf{LB}, which thus restricts to an equivalence between the two.

This equivalence is the Stone duality for monads of the title. The nomenclature is justified by the fact that this duality extends the classical duality of Boolean algebras and Stone (= totally disconnected compact Hausdorff) spaces. On the one hand, each Stone space is the space of objects of a topological (and hence localic) category with only identity transitions; and on the other, each Boolean algebra has an associated finitary monad of distributions over it [6]. Now restricting our Stone duality for monads to these two classes of objects re-finds the classical duality of Stone.

Outline & Contributions.

We now outline the structure and contributions of the paper. Section 2 collects the basic definitions and preliminary results about comodels, the behaviour category, locales and sheaves. Section 3 is the heart of this paper: we construct the terminal localic comodel 𝖫𝖡0T\mathsf{LB}_{0}T (definition 3.1) and the locale of transitions 𝖫𝖡1T\mathsf{LB}_{1}T (definition 3.11), before combining them into the localic behaviour category 𝖫𝖡T\mathsf{LB}T (definition 3.16). We also show that, when TT is finitary, 𝖫𝖡T\mathsf{LB}T is the underlying localic category of the topological behaviour category 𝔹T\mathbb{B}T. In the short section 4, we functorialize the construction T𝖫𝖡TT\mapsto\mathsf{LB}T and prove that it has a right adjoint Γ\Gamma which takes global sections, so giving us the adjunctions of fig. 1. Finally, section 5 characterizes the fixed points of our adjunctions, obtaining the Stone duality of the title. We then conclude the paper in section 6 and provide directions for future research.

2 Preliminaries

2.1 Monads & Comodels

We start by recalling some basic definitions. A monad (T,>>=,𝗋𝖾𝗍𝗎𝗋𝗇)(T,\mathbin{>\mkern-6.8mu>\mkern-6.9mu=},\operatorname{\mathsf{return}}) on 𝖲𝖾𝗍\mathsf{Set} comprises, for each set AA, a set TATA of computations; for each value aAa\in A, a pure computation 𝗋𝖾𝗍𝗎𝗋𝗇aTA\operatorname{\mathsf{return}}a\in TA; and for all sets A,BA,B a composition operation >>=:TA×TBATB\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\colon TA\times TB^{A}\to TB. These are required to satisfy the equations 𝗋𝖾𝗍𝗎𝗋𝗇a>>=u=u(a)\operatorname{\mathsf{return}}a\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u=u(a), t>>=λa.𝗋𝖾𝗍𝗎𝗋𝗇a=tt\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.\operatorname{\mathsf{return}}a=t and (t>>=u)>>=v=t>>=(λa.u(a)>>=v)(t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u)\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}v=t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}(\lambda a.u(a)\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}v) for all tTA,aA,uTBA,vTCBt\in TA,a\in A,u\in TB^{A},v\in TC^{B}. A monad map γ:TS\gamma\colon T\to S comprises, for each set AA, a function γA:TASA\gamma_{A}\colon TA\to SA satisfying γ(𝗋𝖾𝗍𝗎𝗋𝗇a)=𝗋𝖾𝗍𝗎𝗋𝗇a\gamma(\operatorname{\mathsf{return}}a)=\operatorname{\mathsf{return}}a and γ(t>>=u)=γ(t)>>=λa.γ(u(a))\gamma(t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u)=\gamma(t)\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.\gamma(u(a)). An operation tTAt\in TA is finitary if there is some function f:IAf\colon I\to A from a finite set II and tTIt^{\prime}\in TI such that t=t>>=λi.𝗋𝖾𝗍𝗎𝗋𝗇f(i)t=t^{\prime}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda i.\operatorname{\mathsf{return}}f(i); if here we replace “finite” by “λ\lambda-small” for some regular cardinal λ\lambda, then we instead say that tt is λ\lambda-ary. Now TT itself is finitary if each of its operations is so, and is ranked if there is a regular cardinal λ\lambda for which all of its operations are λ\lambda-ary. We write 𝖬𝗇𝖽ω(𝖲𝖾𝗍)\mathsf{Mnd}_{\omega}(\mathsf{Set}) (resp. 𝖬𝗇𝖽r(𝖲𝖾𝗍)\mathsf{Mnd}_{r}(\mathsf{Set})) for the category of finitary (resp. ranked) monads and monad maps. From now on, any mention of monads will refer to ranked monads only.

Recall that a category 𝒞\mathcal{C} has copowers if for any C𝒞C\in\mathcal{C} and any set AA, the AA-fold coproduct ACA\cdot C exists. For example, both 𝖲𝖾𝗍\mathsf{Set} and 𝖳𝗈𝗉\mathsf{Top} have copowers given by the AA-fold disjoint sum aAC\coprod_{a\in A}C. We will denote the inclusion maps by υa:CAC\upsilon_{a}\colon C\to A\cdot C, and the codiagonal by πC:ACC\pi_{C}\colon A\cdot C\to C.

Definition 2.1.

Let TT be a monad and 𝒞\mathcal{C} a category with copowers. A comodel of TT in 𝒞\mathcal{C} is a pair (W,)(W,\llparenthesis{-}\rrparenthesis) whose data comprises an object W𝗈𝖻𝒞W\in\operatorname{\mathsf{ob}}\mathcal{C} and co-interpretations t:WAW\llparenthesis{t}\rrparenthesis\colon W\to A\cdot W for each computation tTAt\in TA. If we extend this to a cointerpretation u:AWBW\llparenthesis{u}\rrparenthesis\colon A\cdot W\rightarrow B\cdot W of each u:ATBu\colon A\rightarrow TB via u:=[u(a)]aA\llparenthesis{u}\rrparenthesis:=[\llparenthesis{u(a)}\rrparenthesis]_{a\in A}, then the comodel axioms require that t>>=u=ut\llparenthesis{t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u}\rrparenthesis=\llparenthesis{u}\rrparenthesis\circ\llparenthesis{t}\rrparenthesis and 𝗋𝖾𝗍𝗎𝗋𝗇a=υa\llparenthesis{\operatorname{\mathsf{return}}a}\rrparenthesis=\upsilon_{a}. A comodel map (W,W)(W,W)(W,\llparenthesis{-}\rrparenthesis_{W})\to(W^{\prime},\llparenthesis{-}\rrparenthesis_{W^{\prime}}) is a map h:WWh\colon W\to W^{\prime} which preserves each co-interpretation, i.e., for each tTAt\in TA, we have th=(Ah)t\llparenthesis{t}\rrparenthesis\circ h=(A\cdot h)\circ\llparenthesis{t}\rrparenthesis. We write 𝖢𝗈𝗆𝗈𝖽T(𝒞)\mathsf{Comod}_{T}(\mathcal{C}) for the category of TT-comodels in 𝒞\mathcal{C}.

Clearly, any 𝖳𝗈𝗉\mathsf{Top}-comodel is a 𝖲𝖾𝗍\mathsf{Set}-comodel, yielding a forgetful functor U:𝖢𝗈𝗆𝗈𝖽T(𝖳𝗈𝗉)𝖢𝗈𝗆𝗈𝖽T(𝖲𝖾𝗍)U\colon\mathsf{Comod}_{T}(\mathsf{Top})\rightarrow\mathsf{Comod}_{T}(\mathsf{Set}). On the other hand, there is also a coarsest topology on any 𝖲𝖾𝗍\mathsf{Set}-comodel making it a 𝖳𝗈𝗉\mathsf{Top}-comodel [11]:

Definition 2.2.

(Operational Topology) Let WW be a TT-comodel in 𝖲𝖾𝗍\mathsf{Set}. The operational topology on WW is generated by sub-basic open sets [ta]:={wW|t(w)=(a,w) for some w}[t\mapsto a]:=\set{w\in W}{\llparenthesis{t}\rrparenthesis(w)=(a,w^{\prime})\text{ for some }w^{\prime}} for tTAt\in TA and aAa\in A.

Proposition 2.3.

The assignment which endows a comodel with its operational topology yields a right adjoint O:𝖢𝗈𝗆𝗈𝖽T(𝖲𝖾𝗍)𝖢𝗈𝗆𝗈𝖽T(𝖳𝗈𝗉)O\colon\mathsf{Comod}_{T}(\mathsf{Set})\rightarrow\mathsf{Comod}_{T}(\mathsf{Top}) to U:𝖢𝗈𝗆𝗈𝖽T(𝖳𝗈𝗉)𝖢𝗈𝗆𝗈𝖽T(𝖲𝖾𝗍)U\colon\mathsf{Comod}_{T}(\mathsf{Top})\rightarrow\mathsf{Comod}_{T}(\mathsf{Set}).

Proof 2.4.

Let 𝒲\mathcal{W} be a 𝖳𝗈𝗉\mathsf{Top}-comodel and WW a 𝖲𝖾𝗍\mathsf{Set}-comodel. Then any 𝖲𝖾𝗍\mathsf{Set}-comodel morphism f:U𝒲Wf\colon U\mathcal{W}\to W is a continuous function f:𝒲OWf\colon\mathcal{W}\to OW since f1[ta]W=[ta]𝒲=t𝒲1({a}×𝒲)f^{-1}[t\mapsto a]_{W}=[t\mapsto a]_{\mathcal{W}}=\llparenthesis{t}\rrparenthesis_{\mathcal{W}}^{-1}\left(\{a\}\times\mathcal{W}\right).

2.2 The Behaviour Category

Fixing a monad TT on 𝖲𝖾𝗍\mathsf{Set}, we now recall the classification of 𝖢𝗈𝗆𝗈𝖽T(𝖲𝖾𝗍)\mathsf{Comod}_{T}(\mathsf{Set}) via the behaviour category 𝔹T\mathbb{B}T [10]. Objects of 𝔹T\mathbb{B}T are elements of the terminal TT-comodel, which are the observable behaviours of comodel states. Such behaviours describe how the state runs a given computation term down to a value.

Definition 2.5.

(Admissible behaviours) An admissible TT-behaviour is a natural transformation β:T𝗂𝖽𝖲𝖾𝗍{\beta\colon T\to\mathsf{id}_{\mathsf{Set}}} such that for any tTAt\in TA, u:ATBu\colon A\to TB and aAa\in A, we have β(t>>=u)=β(t>>u(β(t)))\beta(t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u)=\beta(t\mathbin{>\mkern-6.9mu>}u(\beta(t))). The set of behaviours 𝔹0T\mathbb{B}_{0}T admits a comodel structure with t(β)=(β(t),tβ)\llparenthesis{t}\rrparenthesis(\beta)=(\beta(t),\partial_{t}\beta) where the next behaviour tβ\partial_{t}\beta is defined by tβ:tβ(t>>t)\partial_{t}\beta\colon t^{\prime}\mapsto\beta(t\mathbin{>\mkern-6.9mu>}t^{\prime}). This in fact makes 𝔹0T\mathbb{B}_{0}T the terminal 𝖲𝖾𝗍\mathsf{Set}-comodel, where for any other comodel WW, the unique comodel map W𝔹0TW\to\mathbb{B}_{0}T sends wWw\in W to the behaviour βw:tTAπA(t(w))\beta_{w}\colon t\in TA\mapsto\pi_{A}(\llparenthesis{t}\rrparenthesis(w)).

For a monad TT generated by operations but no equations, a TT-behaviour β\beta produces from each term tTAt\in TA a sequence of operations, called the trace, which it had to evaluate to run tt down to its return value;these traces are the morphisms of the behaviour category. In fact, the return value itself does not matter for computing the trace, so it is enough to consider the trace of T1T1-terms only. For a general monad 𝕋\mathbb{T}, the notion of trace as a sequence of operations no longer makes literal sense, but we can still define trace-equivalence and recover the traces as the trace-equivalence classes.

Definition 2.6.

(β\beta-equivalence, behaviour category) Let β\beta be a TT-behaviour. The relation β\sim_{\beta} on T1T1 is the least equivalence relation such that (t>>=u)β(t>>u(β(t))(t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u)\sim_{\beta}(t\mathbin{>\mkern-6.9mu>}u(\beta(t)) for any tTAt\in TA and u:AT1u\colon A\to T1. Write [t]β[t]_{\beta} for the β\sim_{\beta}-equivalence class of tt. The behaviour category 𝔹T\mathbb{B}T has as objects TT-behaviours, and as morphisms pairs of the form (β,[t]β)(\beta,[t]_{\beta}) but which we will simply write as [t]β[t]_{\beta}. The morphism [t]β[t]_{\beta} has source β\beta and target tβ\partial_{t}\beta. The identity 𝗂𝖽β\mathsf{id}_{\beta} is [𝗋𝖾𝗍𝗎𝗋𝗇]β[\operatorname{\mathsf{return}}]_{\beta}, while the composite [t]β;[s]tβ[t]_{\beta};[s]_{\partial_{t}\beta} is [t>>s]β[t\mathbin{>\mkern-6.9mu>}s]_{\beta}.

Theorem 2.7.

𝖢𝗈𝗆𝗈𝖽T(𝖲𝖾𝗍)[𝔹T,𝖲𝖾𝗍]\mathsf{Comod}_{T}(\mathsf{Set})\simeq[\mathbb{B}T,\mathsf{Set}].

Example 2.8.

Consider the monad generated by a single binary operation 𝖿𝗅𝗂𝗉\mathsf{flip}. For any term tTAt\in TA and behaviour β\beta, we find by successive applications of admissibility that β(t)=β(𝖿𝗅𝗂𝗉>>𝖿𝗅𝗂𝗉>>𝖿𝗅𝗂𝗉(a1,a2))\beta(t)=\beta(\mathsf{flip}\mathbin{>\mkern-6.9mu>}\mathsf{flip}\ldots\mathbin{>\mkern-6.9mu>}\mathsf{flip}(a_{1},a_{2})). In other words, β\beta’s behaviour is determined by the values β(𝖿𝗅𝗂𝗉n)\beta(\mathsf{flip}^{n}) for each nn, where 𝖿𝗅𝗂𝗉n=𝖿𝗅𝗂𝗉>>>>𝖿𝗅𝗂𝗉T2\mathsf{flip}^{n}=\mathsf{flip}\mathbin{>\mkern-6.9mu>}\ldots\mathbin{>\mkern-6.9mu>}\mathsf{flip}\in T2, or more succinctly, by a map β:ω2\beta\colon\omega\to 2. Since the theory is free, any such map will do, so that 𝔹0T\mathbb{B}_{0}T is in bijection with the set of infinite binary streams W2ωW\in 2^{\omega}. The trace of tT1t\in T1 at β\beta is just the number of 𝖿𝗅𝗂𝗉\mathsf{flip}s traversed by β\beta when running down tt, so a morphism in 𝔹T\mathbb{B}T has the form n:WnWn\colon W\rightarrow\partial^{n}W for some nn\in\mathbb{N}.

Example 2.9.

For the state monad T=(S×)ST=(S\times-)^{S}, behaviours are in bijection with the set of states SS, and so is T1/sT1/_{\sim_{s}}: two unary terms t1,t2SSt_{1},t_{2}\in S^{S} are ss-equivalent iff t1(s)=t2(s)t_{1}(s)=t_{2}(s). So 𝔹T\mathbb{B}T is the indiscrete (or chaotic) category with object-set SS. As we can see, since the theory of state has many equations, trace equivalence looks more semantic in nature here. We refer to [10] for more examples.

2.3 Frames & Locales

A frame is a poset with infinite joins and finite limits satisfying the infinite distributive law x(iyi)=i(xyi)x\wedge\left(\bigvee_{i}y_{i}\right)=\bigvee_{i}(x\wedge y_{i}). We write 𝖥𝗋𝗆\mathsf{Frm} for the category of frames and frame homomorphisms, i.e., monotone maps which preserve infinite joins and finite meets. A locale is simply a frame, but the category of locales is 𝖫𝗈𝖼:=𝖥𝗋𝗆𝗈𝗉\mathsf{Loc}:=\mathsf{Frm}^{\mathsf{op}}. We have a functor 𝒪:𝖳𝗈𝗉𝖫𝗈𝖼\mathcal{O}\colon\mathsf{Top}\to\mathsf{Loc} which sends XX to its frame of open sets 𝒪(X)\mathcal{O}(X), and a continuous map f:XYf\colon X\to Y to f1:𝒪(Y)𝒪(X)f^{-1}\colon\mathcal{O}(Y)\rightarrow\mathcal{O}(X). We imagine a general locale to be the lattice of opens of some space, and the data of a continuous map to be given by the inverse image map. To sustain this fantasy, we overload notation by writing 𝒪:𝖫𝗈𝖼𝗈𝗉𝖥𝗋𝗆\mathcal{O}\colon\mathsf{Loc}^{\mathsf{op}}\to\mathsf{Frm} for the identity functor, writing its action on morphisms as 𝒪(f):=f1\mathcal{O}(f):=f^{-1}, and calling elements u𝒪(L)u\in\mathcal{O}(L) opens of LL. Any locale LL induces a topological space 𝗉𝗍(L)\operatorname{\mathsf{pt}}(L) with set of points the locale morphisms x:1Lx\colon 1\to L from the terminal locale 11 and open sets given by [u]={x|x1u=}[u]=\set{x}{x^{-1}u=\top} for u𝒪(L)u\in\mathcal{O}(L). This yields a functor 𝗉𝗍:𝖫𝗈𝖼𝖳𝗈𝗉\operatorname{\mathsf{pt}}\colon\mathsf{Loc}\to\mathsf{Top}, right adjoint to 𝒪\mathcal{O}. A locale LL at which the adjunction counit is invertible is called spatial, while a space at which the unit is invertible is called sober: thus, spatial locales and sober spaces form equivalent categories.

We make use of the fact—see [17, II 2.11]—that frames may be constructed by generators and relations. For example, the (frame of opens of the) copower locale ALA\cdot L can be presented by generating opens of the form au\braket{a\mapsto u} for aAa\in A and u𝒪(L)u\in\mathcal{O}(L), subject to the equations (1) iaui=aiui\bigvee_{i}\braket{a\mapsto u_{i}}=\braket{a\mapsto\bigvee_{i}u_{i}}; (2) ikaui=aikui\bigwedge^{k}_{i}\braket{a\mapsto u_{i}}=\braket{a\mapsto\bigwedge^{k}_{i}u_{i}}; and (3) auav=\braket{a\mapsto u}\wedge\braket{a^{\prime}\mapsto v}=\bot for aaa\neq a^{\prime}. These equations imply that every open is uniquely of the form aAaua\bigvee_{a\in A}\braket{a\mapsto u_{a}}—which is consistent with the fact that AA-fold copowers in 𝖫𝗈𝖼\mathsf{Loc} correspond to AA-fold products in 𝖥𝗋𝗆\mathsf{Frm}. In particular, since 𝖫𝗈𝖼\mathsf{Loc} has copowers, we may consider 𝖢𝗈𝗆𝗈𝖽T(𝖫𝗈𝖼)\mathsf{Comod}_{T}(\mathsf{Loc}) as well as 𝖢𝗈𝗆𝗈𝖽T(𝖳𝗈𝗉)\mathsf{Comod}_{T}(\mathsf{Top}), and we now have:

Proposition 2.10.

The adjunction 𝒪𝗉𝗍:𝖫𝗈𝖼𝖳𝗈𝗉\mathcal{O}\dashv\operatorname{\mathsf{pt}}\colon\mathsf{Loc}\rightarrow\mathsf{Top} lifts to 𝒪𝗉𝗍:𝖢𝗈𝗆𝗈𝖽T(𝖫𝗈𝖼)𝖢𝗈𝗆𝗈𝖽T(𝖳𝗈𝗉)\mathcal{O}\dashv\operatorname{\mathsf{pt}}\colon\mathsf{Comod}_{T}(\mathsf{Loc})\rightarrow\mathsf{Comod}_{T}(\mathsf{Top}).

Proof 2.11.

In sketch, since comodels are defined in terms of copowers, it suffices to verify that 𝒪\mathcal{O} and 𝗉𝗍\operatorname{\mathsf{pt}} preserve copowers. This is obvious for the left adjoint 𝒪\mathcal{O}. As for 𝗉𝗍\operatorname{\mathsf{pt}}, this is one of its standard properties, which follows from fact that the terminal locale 11 is connected, so that homming out of it preserves copowers.

For a finitary monad, the terminal topological comodel—which by proposition 2.3 is the terminal comodel equipped with the operational topology—is always a Stone space. When we go to construct the locale of objects for the localic behaviour category, we will similarly take the terminal localic comodel. This is also always going to be an “infinitary Stone space”, in the sense that it is generated by “clopen sets” but no longer compact. These are the strongly zero-dimensional locales as defined by Johnstone [16], also called ultraparacompact by Van Name [30]. We adopt the latter name since it is more compact (pun intended).

Definition 2.12.

[30] Let LL be a locale. An open u𝒪(L)u\in\mathcal{O}(L) is complemented if it so in the usual lattice-theoretic sense: thus, there is some v𝒪(L)v\in\mathcal{O}(L) with uv=u\wedge v=\bot and uv=u\vee v=\top. The set 𝔅(L)\mathfrak{B}(L) of complemented opens of LL inherits finite meets and joins from LL, and so is a Boolean algebra. We say that LL is zero-dimensional if u𝒪(L)u\in\mathcal{O}(L) is the join of the complemented opens below it.

A cover of LL is a subset J𝒪(L)J\subseteq\mathcal{O}(L) such that j=\bigvee j=\top. A cover JJ refines JJ^{\prime} if for every uJu\in J there is uJu^{\prime}\in J^{\prime} such that uuu\leq u^{\prime}. An extended partition PP is a pairwise disjoint cover, i.e., uv=u\wedge v=\bot for any uvPu\neq v\in P. A partition PP is an extended partition which does not contain \bot, and any extended partition PP induces a partition P=P{}P^{-}=P\setminus\set{\bot}. A zero-dimensional locale LL is strongly zero-dimensional or ultraparacompact if every open cover is refined by a partition.

Stone spaces correspond to Boolean algebras: this is known as Stone duality. Generalizing this, ultraparacompact locales correspond to Grothendieck Boolean algebras. The notion is due to [30] but our nomenclature follows [12, Definition 3.6].

Definition 2.13.

A Grothendieck Boolean algebra B𝒥B_{\mathcal{J}} is a Boolean algebra equipped with a strongly zero-dimensional topology, i.e., a collection 𝒥\mathcal{J} of partitions for BB such that

  1. (i)

    𝒥\mathcal{J} contains every finite partition;

  2. (ii)

    if P𝒥P\in\mathcal{J} and Qb𝒥Q_{b}\in\mathcal{J} for each bPb\in P, then P;Q:={bc|bP,cQb}𝒥P;Q:=\set{b\wedge c}{b\in P,c\in Q_{b}}^{-}\in\mathcal{J} also;

  3. (iii)

    if P𝒥P\in\mathcal{J} and f:PIf\colon P\to I is a surjective function, then each f1(i)\bigvee f^{-1}(i) exists in BB and f1P:={f1(i)|iI}𝒥f^{-1}P:=\set{\bigvee f^{-1}(i)}{i\in I}\in\mathcal{J}.

Theorem 2.14.

[30, Theorem 24] The category of ultraparacompact locales is dually equivalent to the category of Grothendieck Boolean algebras.

Proof 2.15.

We sketch just the constructions. An ultraparacompact locale LL induces a Boolean algebra 𝔅(L)\mathfrak{B}(L) with strongly zero-dimensional topology given by the partitions of LL (the opens in a partition are necessarily complemented). On the other hand, a Grothendieck Boolean algebra B𝒥B_{\mathcal{J}} generates a locale of 𝒥\mathcal{J}-closed ideals in the usual way (as explained by Vickers [31] or Johnstone [17, II 2.11]).

Every Boolean algebra can be regarded as a Grothendieck Boolean algebra under the topology of all finite partitions, and in this way, the above equivalence restricts to the usual Stone duality.

2.4 Sheaves, Local Homeomorphisms & B𝒥B_{\mathcal{J}}-Sets

An important aspect of our results is that the source map σ:𝖫𝖡1T𝖫𝖡0T\sigma\colon\mathsf{LB}_{1}T\rightarrow\mathsf{LB}_{0}T of the localic behaviour category is a local homeomorphism. Here, a map ff of locales is a local homeomorphism if there is a cover {vi}i\set{v_{i}}_{i} of its domain such that, on each part of this cover, the map ff restricts to an open injection. It is well-known that local homeomorphisms into a locale correspond to sheaves on a locale; and since 𝖫𝖡0T\mathsf{LB}_{0}T is ultraparacompact, this leads to a particularly appealing description of the source map. For indeed, sheaves on an ultraparacompact locale—or at least, those possessing a global section—can be described purely algebraically as sets with a suitable action of the corresponding Grothendieck Boolean algebra. This was first shown by Bergman [6] for Boolean algebras, and later extended to the Grothendieck case [12]. One advantage of this presentation is that it makes clear what homomorphisms and congruences of B𝒥B_{\mathcal{J}}-sets are.

Definition 2.16.

(B𝒥B_{\mathcal{J}}-sets) Let BB be a non-degenerate Boolean algebra (i.e., 010\neq 1 in BB). A BB-set FF consists of a set |F||F| equipped with one binary operation b(,)b(-,-) for each bBb\in B satisfying the equations

b(x,x)=x\displaystyle b(x,x)=x\qquad b(b(x,y),z)=b(x,z)\displaystyle b(b(x,y),z)=b(x,z)\qquad b(x,b(y,z))=b(x,z)\displaystyle b(x,b(y,z))=b(x,z) (1)
(x,y)=x\displaystyle\top(x,y)=x\qquad (¬b)(x,y)=b(y,x)\displaystyle(\neg b)(x,y)=b(y,x)\qquad (bc)(x,y)=b(c(x,y),y)\displaystyle(b\wedge c)(x,y)=b(c(x,y),y)

for all x,y,z|F|x,y,z\in|F|. If 𝒥\mathcal{J} is a strongly zero-dimensional topology on BB, then a B𝒥B_{\mathcal{J}}-set FF consists of a BB-set FF further equipped with a PP-ary operation P:|F|P|F|P\colon|F|^{P}\to|F| for each partition P𝒥P\in\mathcal{J}. These operations are required to satisfy, for any z|F|z\in|F| and families x,y|F|Px,y\in|F|^{P}, the axioms

P(λb.z)=zP(λb.b(xb,yb))=P(λb.xb)andb(P(x),xb)=xb .P(\lambda b.z)=z\qquad P(\lambda b.b(x_{b},y_{b}))=P(\lambda b.x_{b})\qquad\text{and}\qquad b(P(x),x_{b})=x_{b}\hbox to0.0pt{ .\hss} (2)

These axioms are rather intuitive if one reads each operation bb as an if-then-else operation, and the infinitary operations PP as infinitary switch statements. To see the correspondence with sheaves, view the elements of a B𝒥B_{\mathcal{J}}-set as a global section. Then the operations perform amalgamation: for example b(x,y)b(x,y) is the unique amalgam of x|bx|_{b} and y|¬by|_{\neg b}. We don’t have to explicitly track local sections because if we have any global section tt at all, then a local section ss over bb manifests as a global section by taking the amalgamation of ss and t|¬bt|_{\neg b}. Hence, the category of non-empty B𝒥B_{\mathcal{J}}-sets is equivalent to the category of sheaves over the locale presented by B𝒥B_{\mathcal{J}} that have a global section.

Because every local section of a B𝒥B_{\mathcal{J}}-set FF comes from some global section, the set of local sections over some bb is a quotient of |F||F|, by the relation b\equiv_{b} defined as follows.

Proposition 2.17.

[13, Proposition 2.6] Let B𝒥B_{\mathcal{J}} be a non-degenerate Grothendieck Boolean algebra. Any B𝒥B_{\mathcal{J}}-set structure on a set |F||F| induces equivalence relations b\equiv_{b} for bBb\in B given by xbyb(x,y)=yx\equiv_{b}y\iff b(x,y)=y. These equivalence relations satisfy: (1) if xbyx\equiv_{b}y and cbc\leq b then xcyx\equiv_{c}y; (2) xyx\equiv_{\top}yiff x=yx=y, and xyx\equiv_{\bot}y always; (3) for any P𝒥P\in\mathcal{J} and xXPx\in X^{P}, there is a unique zXz\in X such that zbxbz\equiv_{b}x_{b} for all bPb\in P. In fact, any BB-indexed family of equivalence relations on |F||F| satisfying (i)–(iii) determine a B𝒥B_{\mathcal{J}}-set, wherein P(λb.xb)P(\lambda b.x_{b}) is the aforementioned unique zz. With this alternative definition, a B𝒥B_{\mathcal{J}}-set homomorphism is a function that preserves the b\equiv_{b} relations.

The sheaf corresponding to the source map will be constructed as a quotient of a free B𝒥B_{\mathcal{J}}-set, so it is instructive to construct the free B𝒥B_{\mathcal{J}}-set explicitly.

Definition 2.18.

(Free B𝒥B_{\mathcal{J}}-sets) Let AA be a set and B𝒥B_{\mathcal{J}} a non-degenerate Grothendieck Boolean algebra. Then the Grothendieck Boolean power A[B]𝒥A[B]^{\mathcal{J}} is the set of functions h:ABh\colon A\to B for which {h(a)|aA}𝒥\set{h(a)}{a\in A}^{-}\in\mathcal{J}.

Proposition 2.19.

[12, Remark 3.17] Let AA be a set. Then A[B]𝒥A[B]^{\mathcal{J}} has a B𝒥B_{\mathcal{J}}-set structure given by P(λb.hb):=λa.bbhb(a)P(\lambda b.h_{b}):=\lambda a.\bigvee_{b}b\wedge h_{b}(a), and this is the free B𝒥B_{\mathcal{J}}-set with AA-many generators. The unit map AA[B]𝒥A\to A[B]^{\mathcal{J}} identifies aAa\in A with the map δa\delta_{a} for which δa(a):=\delta_{a}(a):=\top and δa(a):=\delta_{a}(a^{\prime}):=\bot for aaa^{\prime}\neq a.

Given a sheaf FF on a locale LL, the corresponding local homeomorphism E(F)LE(F)\to L is found by taking 𝒪(E(F))\mathcal{O}(E(F)) as the frame of subsheaves of FF. We can re-express this in terms of the category of sheaves on LL: this is a topos, and in particular admits a subobject classifier Ω\Omega, so subsheaves of FF correspond to sheaf maps FΩF\to\Omega. Now if LL is the ultraparacompact locale presented by B𝒥B_{\mathcal{J}}, then Ω\Omega itself is a B𝒥B_{\mathcal{J}}-set, and so the frame 𝒪(E(F))\mathcal{O}(E(F)) is given by the set of B𝒥B_{\mathcal{J}}-set homomorphisms FΩF\rightarrow\Omega under pointwise ordering. Ω\Omega as a B𝒥B_{\mathcal{J}}-set turns out to be B𝒥B_{\mathcal{J}} itself with the action P(λb.ub)=bP(ubb)P(\lambda b.u_{b})=\bigvee_{b\in P}(u_{b}\wedge b), or equivalently with ubvbu=bvu\equiv_{b}v\iff b\wedge u=b\wedge v.

Definition 2.20.

Let LL be an ultraparacompact locale presented by B𝒥B_{\mathcal{J}}, and FF be a B𝒥B_{\mathcal{J}}-set. The étale space E(F)E(F) corresponding to FF is given by 𝒪(E(F)):=𝖲𝖾𝗍B𝒥(F,𝒪L)\mathcal{O}(E(F)):=\mathsf{Set}_{B_{\mathcal{J}}}(F,\mathcal{O}L), and its associated projection map σ:E(F)L\sigma\colon E(F)\to L is defined by σ1:u𝖼𝗈𝗇𝗌𝗍u\sigma^{-1}\colon u\mapsto\mathsf{const}_{u} (the constant function at uu).

Lemma 2.21.

Let LL be an ultraparacompact locale presented by B𝒥B_{\mathcal{J}}, and FF be a B𝒥B_{\mathcal{J}}-set. Each element x|F|x\in|F| injectively induces an open x^𝒪(E(F))\hat{x}\in\mathcal{O}(E(F)) defined by x^:=λy.{b|xby}\hat{x}:=\lambda y.\bigvee\set{b}{x\equiv_{b}y}. Moreover, these generate 𝒪E(F)\mathcal{O}E(F) because every w𝒪(E(F))w\in\mathcal{O}(E(F)) can be expressed as w=x|F|x^𝖼𝗈𝗇𝗌𝗍w(x)w=\bigvee_{x\in|F|}\hat{x}\wedge\mathsf{const}_{w(x)}.

Proposition 2.22.

Let LL be an ultraparacompact locale presented by B𝒥B_{\mathcal{J}}. Then the corresponding local homeomorphism of a B𝒥B_{\mathcal{J}}-set FF is the map σ:E(F)L\sigma\colon E(F)\to L.

For a sheaf FF, the points of the corresponding local homeomorphism E(F)E(F) are known as germs. Here is the corresponding notion for B𝒥B_{\mathcal{J}}-sets.

Proposition 2.23.

Let LL be an ultraparacompact locale presented by B𝒥B_{\mathcal{J}} and FF a B𝒥B_{\mathcal{J}}-set. Then 𝗉𝗍E(F)p𝗉𝗍L|F|/p\operatorname{\mathsf{pt}}E(F)\cong\sum_{p\in\operatorname{\mathsf{pt}}L}|F|/_{\equiv_{p}}, where xpybp.xbyx\equiv_{p}y\iff\exists b\ni p.x\equiv_{b}y. An element [x]p[x]_{p} of this space is called a germ. The topology on this space is generated by subbasic open sets [x|b]={[x]p|pb}[x|b]=\set{[x]_{p}}{p\in b}.

3 The Localic Behaviour Category

In this section, we construct the localic behaviour category 𝖫𝖡T\mathsf{LB}T. Following the construction of the behaviour category, the locale of objects 𝖫𝖡0T\mathsf{LB}_{0}T can be characterized as the terminal localic comodel. On the other hand, we will construct the locale of morphisms in a rather roundabout way as a sheaf over 𝖫𝖡0T\mathsf{LB}_{0}T, but we hope that this clarifies the nature of the construction.

3.1 The Terminal Localic Comodel

By proposition 2.10, we see that the terminal topological comodel has to be the spatialization of the terminal localic comodel. But by proposition 2.3, the terminal topological comodel is the set of behaviours, equipped with the operational topology. This gives us an idea of what the terminal localic comodel looks like.

Definition 3.1.

Let TT be a monad on 𝖲𝖾𝗍\mathsf{Set}. The behaviour locale 𝖫𝖡0T\mathsf{LB}_{0}T is generated by opens [b][b] for each bT2b\in T2, subject to the following equations for all tTA,u:ATB,aaAt\in TA,u:A\to TB,a\neq a^{\prime}\in A and bBb\in B.

[ta][ta]=[t\mapsto a]\wedge[t\mapsto a^{\prime}]=\bot (𝖫𝖡0\mathsf{LB}_{0}-\bot)
[t>>𝗋𝖾𝗍𝗎𝗋𝗇aa]=[t\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a\mapsto a]=\top (𝖫𝖡0\mathsf{LB}_{0}-η\eta)
[t>>=ub]=aA[ta][t>>u(a)b][t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u\mapsto b]=\bigvee_{a\in A}[t\mapsto a]\wedge[t\mathbin{>\mkern-6.9mu>}u(a)\mapsto b] (𝖫𝖡0\mathsf{LB}_{0}-μ\mu)

Here we write [ta][t\mapsto a] as shorthand for [t>>=λa.δa(a)][t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a^{\prime}.\delta_{a}(a^{\prime})] with δa(a)=1\delta_{a}(a^{\prime})=1 when a=aa=a^{\prime} and 0 otherwise.

Proposition 3.2.

Let TT be a monad on 𝖲𝖾𝗍\mathsf{Set}. Then the following equations hold in 𝖫𝖡0T\mathsf{LB}_{0}T:

aA[ta]=[t>>𝗋𝖾𝗍𝗎𝗋𝗇aa]=[ta][t>>=ub]=[ta][t>>u(a)b],\bigvee_{a\in A}[t\mapsto a]=\top\qquad[t\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a\mapsto a^{\prime}]=\bot\qquad[t\mapsto a]\wedge[t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u\mapsto b]=[t\mapsto a]\wedge[t\mathbin{>\mkern-6.9mu>}u(a)\mapsto b],

where tTAt\in TA, aaAa\neq a^{\prime}\in A, u:ATBu\colon A\to TB and bBb\in B.

In fact, axiom (𝖫𝖡0\mathsf{LB}_{0}-μ\mu) can equivalently be replaced by a combination of the first and third equations of proposition 3.2. We chose axioms (𝖫𝖡0\mathsf{LB}_{0}-μ\mu) and (𝖫𝖡0\mathsf{LB}_{0}-η\eta) because of their resemblance to the admissibility condition of TT-behaviours. In any case, the axioms can be “discovered” as the necessary conditions for proving the universal property of 𝖫𝖡0T\mathsf{LB}_{0}T as the terminal localic comodel, as in the following proposition.

Proposition 3.3.

𝖫𝖡0T\mathsf{LB}_{0}T is the terminal localic comodel with cointerpretation t:𝖫𝖡0TA𝖫𝖡0T\llparenthesis{t}\rrparenthesis\colon\mathsf{LB}_{0}T\to A\cdot\mathsf{LB}_{0}T given by: t1:a0[t0][ta0][t>>t0]\llparenthesis{t}\rrparenthesis^{-1}\colon\braket{a_{0}\mapsto[t_{0}]}\mapsto[t\mapsto a_{0}]\wedge[t\mathbin{>\mkern-6.9mu>}t_{0}].

Now by proposition 2.10 we can conclude that the points of the behaviour locale are simply the admissible behaviours of TT. The following example demonstrates that in general the projection from localic comodels to topological comodels is lossy: it is a monad whose behaviour locale is non-trivial, but which admit no admissible behaviours.

Example 3.4.

Consider the monad TT induced by the theory with generating operations 𝗀𝖾𝗍x/\mathsf{get}_{x}/\mathbb{N} for each xx\in\mathbb{R}. The theory has, in addition to the usual axioms of read-only state with \mathbb{R} memory locations as can be found in e.g. [27], the family of equations 𝗀𝖾𝗍x>>=λn.𝗀𝖾𝗍y>>=λm.𝗋𝖾𝗍𝗎𝗋𝗇(n,m)=𝗀𝖾𝗍x>>=λn.𝗀𝖾𝗍y>>=λm.f(n,m)\mathsf{get}_{x}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda n.\mathsf{get}_{y}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda m.\operatorname{\mathsf{return}}(n,m)=\mathsf{get}_{x}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda n.\mathsf{get}_{y}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda m.f(n,m) where xyx\neq y\in\mathbb{R} and f:××f\colon\mathbb{N}\times\mathbb{N}\to\mathbb{N}\times\mathbb{N} is any function such that f(n,m)=(n,m)f(n,m)=(n,m) for nmn\neq m\in\mathbb{N}. This says two distinct memory cells cannot contain the same value, so 𝔹0T\mathbb{B}_{0}T is empty since the admissible behaviours in this case corresponds to injective memory configurations \mathbb{R}\rightarrowtail\mathbb{N}, of which there are (famously) none.

However, a term in this signature is well-founded, which is to say any particular execution of this computation term can only query finitely many memory locations. So, from the program’s perspective, it can never be sure that it is not in a non-injective state configuration, since it needs to query uncountably-many memory locations to make a pigeonhole principle argument (i.e., non-injectivity is semi-decidable). We can think of this as having a virtual address space of reals over countably many physical memory cells—the moment you try to query more locations than there are actual cells, the program is forced to halt.

Mathematically, this manifests in the non-triviality of the behaviour locale 𝖫𝖡0T\mathsf{LB}_{0}T. By repeated applications of axiom (𝖫𝖡0\mathsf{LB}_{0}-μ\mu) we can see that the behaviour locale for this monad 𝖫𝖡0T\mathsf{LB}_{0}T can instead be generated by opens of the form [𝗀𝖾𝗍xn][\mathsf{get}_{x}\mapsto n]. The axioms of the behaviour locale in this instance are equivalent to the axioms of the locale of injective functions from [19, Example C1.2.9], which generates a non-trivial locale. For these axioms and the proof of correspondence, see section A.5.

The terminal topological comodel can be shown to be a Stone space. Correspondingly, we also have that the terminal localic comodel is ultraparacompact, and this is because 𝖫𝖡0T\mathsf{LB}_{0}T can be presented by generators and partitions, instead of just coverages. See section A.6 for details.

Proposition 3.5.

Let TT be a monad. Then 𝖫𝖡0T\mathsf{LB}_{0}T is ultraparacompact.

3.2 The Locale of Morphisms

For a monad TT, any operation tTAt\in TA induces a section η(t):𝔹0TA𝔹1T\eta(t)\colon\mathbb{B}_{0}T\to A\cdot\mathbb{B}_{1}T of the behaviour category. This suggests we should recover a monad from the behaviour category by taking such sections. But doing so allows “computations” which are computationally unreasonable, as the following example shows.

Example 3.6.

Consider TT induced by the free theory on one binary operation [b/2|][b/2|\emptyset]. The behaviours are infinite binary streams and morphisms are natural numbers, as explained in example 2.8. But we can have a section which maps 𝗋𝖾𝗉𝖾𝖺𝗍(10)42\mathsf{repeat}(10)\mapsto 42 and any other stream to 2121. Using only the operation b/2b/2 which reveals only one digit each time, it is impossible to determine in finite time that the input stream is precisely 𝗋𝖾𝗉𝖾𝖺𝗍(10)=101010\mathsf{repeat}(10)=101010\ldots, so this does not represent a reasonable computation at all. This example also shows how the behaviour category 𝔹T\mathbb{B}T fails to represent TT even if TT is deterministic and stateful, and hence why we really need to consider the topological structure on 𝔹0T\mathbb{B}_{0}T.

Hence, we want the source map of the localic behaviour category such that only the feasible computations η(t)\eta(t) (and as little else) be allowed as sections. Therefore, instead of directly constructing the locale of morphisms 𝖫𝖡1T\mathsf{LB}_{1}T, we will first construct a sheaf—or more precisely a B𝒥B_{\mathcal{J}}-set—over 𝖫𝖡0T\mathsf{LB}_{0}T whose generating sections are the T1T1-computations, and then take the corresponding local homeomorphism as the source map. For the remainder of this section, B𝒥B_{\mathcal{J}} is the Grothendieck Boolean algebra of complemented opens in 𝒪𝖫𝖡0T\mathcal{O}\mathsf{LB}_{0}T. Of course, the sheaf should not be generated freely: we can see in 𝔹T\mathbb{B}T that if a term factors as t>>=ut\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u, then at each β[ta]\beta\in[t\mapsto a] we have t>>=uβt>>u(a)t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u\sim_{\beta}t\mathbin{>\mkern-6.9mu>}u(a), so the global sections t>>=ut\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u and t>>u(a)t\mathbin{>\mkern-6.9mu>}u(a) are equal when restricted to the region [ta][t\mapsto a].

Definition 3.7.

Let TT be a monad. The sheaf of transitions FTF_{T} associated to TT is a quotient of the free B𝒥B_{\mathcal{J}}-set T1[B]𝒥T1[B]^{\mathcal{J}} with generators T1T1, by the smallest B𝒥B_{\mathcal{J}}-congruence identifying t>>=uP(t)(λ[ta].t>>u(a))t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u\approx P^{(t)}(\lambda[t\mapsto a].t\mathbin{>\mkern-6.9mu>}u(a)) where tTAt\in TA, u:AT1u\colon A\to T1 and P(t)={[ta]|aA}P^{(t)}=\set{[t\mapsto a]}{a\in A}^{-} is the partition canonically associated to TT.

This definition is rather intuitive, but it is not at all obvious what its relationship is with the morphisms of the behaviour category introduced in definition 2.6. To see the connection, we prove that two elements x,yT1[B]𝒥x,y\in T1[B]^{\mathcal{J}} are related by \approx just when they are pointwise trace-equivalent, as expressed by the following definition and accompanying lemma.

Definition 3.8.

Let TT be a monad of rank κ\kappa. Define the 𝖫𝖡0T\mathsf{LB}_{0}T-valued relation of trace equivalence on T1T1:

mm\displaystyle\llbracket{m\sim m^{\prime}}\rrbracket =k1mkm where m1kmk={i=1k1mi1mi+1|m2mk1T1}\displaystyle=\bigvee_{k\geq 1}\llbracket{m\sim_{k}m^{\prime}}\rrbracket\quad\text{ where }\quad\llbracket{m_{1}\sim_{k}m_{k}}\rrbracket=\bigvee\set{\textstyle{\bigwedge^{k-1}_{i=1}}\llbracket{m_{i}\sim_{1}m_{i+1}}\rrbracket}{m_{2}\ldots m_{k-1}\in T1} (3)
m1m\displaystyle\llbracket{m\sim_{1}m^{\prime}}\rrbracket ={[ta]|A𝖲𝖾𝗍,|A|κ,t:TA,u,u:AT1,aA,u(a)=u(a),m=t>>=u,m=t>>=u}\displaystyle=\bigvee\left\{[t\mapsto a]~\middle|~\begin{matrix}A\in\mathsf{Set},|A|\leq\kappa,t:TA,u,u^{\prime}\colon A\to T1,a\in A,\\ u(a)=u^{\prime}(a),m=t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u,m^{\prime}=t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u^{\prime}\end{matrix}\right\} (4)

If u𝒪𝖫𝖡0Tu\in\mathcal{O}\mathsf{LB}_{0}T is a complemented open, we define mumm\sim_{u}m^{\prime} to be true whenever ummu\leq\llbracket{m\sim m^{\prime}}\rrbracket (if u=u=\top, we simply write mm)m\sim m^{\prime}). This definition seems complicated, but it is just the point-free transliteration of the definition for β\beta-equivalence.

Lemma 3.9.

\llbracket{-\sim-}\rrbracket is an equivalence relation, in the sense that for all m1,m2,m3T1m_{1},m_{2},m_{3}\in T1,

m1m1=m1m2m2m1m1m2m2m3m1m3.\llbracket{m_{1}\sim m_{1}}\rrbracket=\top\qquad\llbracket{m_{1}\sim m_{2}}\rrbracket\leq\llbracket{m_{2}\sim m_{1}}\rrbracket\qquad\llbracket{m_{1}\sim m_{2}}\rrbracket\wedge\llbracket{m_{2}\sim m_{3}}\rrbracket\leq\llbracket{m_{1}\sim m_{3}}\rrbracket.

Consequentially, all the u\sim_{u} are equivalence relations in the usual sense.

Lemma 3.10.

Let x,yT1[B]𝒥x,y\in T1[B]^{\mathcal{J}}. Then xyx\approx y iff for each m,nT1m,n\in T1, we have mx(m)y(n)nm\sim_{x(m)\wedge y(n)}n. Moreover, mbnmbnm\equiv_{b}n\iff m\sim_{b}n.

Be warned that we abuse notation by confusing elements of T1T1 with the induced element of FTF_{T}, even though the unit map δ:T1|FT|\delta\colon T1\to|F_{T}| from proposition 2.19 is in general not injective.

Recall from proposition 2.22 that the corresponding local homeomorphism is the locale of homomorphisms 𝖲𝖾𝗍B𝒥(FT,𝖫𝖡0T)\mathsf{Set}_{B_{\mathcal{J}}}(F_{T},\mathsf{LB}_{0}T). By the universal property of free algebras, such homomorphisms correspond to functions w:T1𝖫𝖡0Tw\colon T1\to\mathsf{LB}_{0}T respecting the generating equation w(t>>=u)=P(t)(λ[ta].t>>u(a))w(t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u)=P^{(t)}(\lambda[t\mapsto a].t\mathbin{>\mkern-6.9mu>}u(a)). We can restate this in terms of trace equivalence between generators, as follows (proof of correspondence can be found in section A.8).

Definition 3.11.

The locale of transitions 𝖫𝖡1T\mathsf{LB}_{1}T is the pointwise-ordered poset of functions w:T1𝒪(𝖫𝖡0T)w\colon T1\to\mathcal{O}(\mathsf{LB}_{0}T) for which m1bm2m_{1}\sim_{b}m_{2} implies w(m1)bw(m2)w(m_{1})\equiv_{b}w(m_{2}) for any m1,m2T1m_{1},m_{2}\in T1 and bBb\in B.

We are now in the position to introduce the localic behaviour category, but before we do so we specialize lemma 2.21 and proposition 2.23 to our locale of transitions, which relates the localic behaviour category back to the usual behaviour category.

Lemma 3.12.

Every open w𝒪(𝖫𝖡1T)w\in\mathcal{O}(\mathsf{LB}_{1}T) can be expressed as w=mm^𝖼𝗈𝗇𝗌𝗍w(m)w=\bigvee_{m}\hat{m}\wedge\mathsf{const}_{w(m)}, so the frame 𝒪(𝖫𝖡1T)\mathcal{O}(\mathsf{LB}_{1}T) is generated by opens of the form [m|b]:=λn.mn[b][m|b]:=\lambda n.\llbracket{m\sim n}\rrbracket\wedge[b] for mT1m\in T1 and bT2b\in T2.

Proposition 3.13.

The set of points 𝗉𝗍(𝖫𝖡1T)\operatorname{\mathsf{pt}}(\mathsf{LB}_{1}T) is bijective with 𝔹1T\mathbb{B}_{1}T.

Proof 3.14.

By proposition 2.23, we know that 𝗉𝗍(𝖫𝖡1T)Σβ𝗉𝗍𝖫𝖡0TFT/β\operatorname{\mathsf{pt}}(\mathsf{LB}_{1}T)\cong\Sigma_{\beta\in\operatorname{\mathsf{pt}}\mathsf{LB}_{0}T}F_{T}/_{\equiv_{\beta}}. But we know 𝗉𝗍𝖫𝖡0T𝔹0T\operatorname{\mathsf{pt}}\mathsf{LB}_{0}T\cong\mathbb{B}_{0}T, so the β\beta really are just admissible behaviours. Next, observe that every xFTx\in F_{T} can be expressed in the form x=P(λb.mb)x=P(\lambda b.m_{b}), and hence xbmbx\equiv_{b}m_{b} for the bPb\in P with βb\beta\in b. Hence, we have FT/bT1/βT1/βF_{T}/_{\equiv_{b}}\cong T1/_{\equiv_{\beta}}\cong T1/_{\sim_{\beta}} over each β\beta. Therefore 𝗉𝗍(𝖫𝖡1T)Σβ𝔹0TT1/β=𝔹1T\operatorname{\mathsf{pt}}(\mathsf{LB}_{1}T)\cong\Sigma_{\beta\in\mathbb{B}_{0}T}T_{1}/_{\sim_{\beta}}=\mathbb{B}_{1}T.

Finally, the following lemma is useful for we will often have to consider various pullbacks with the source map, such as when we define the composition map of the localic behaviour category in definition 2.6 below.

Lemma 3.15.

The pullback L×𝖫𝖡0T𝖫𝖡1TL\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T of a locale map f:L𝖫𝖡0Tf\colon L\to\mathsf{LB}_{0}T along the source map σ:𝖫𝖡1T𝖫𝖡0T\sigma\colon\mathsf{LB}_{1}T\to\mathsf{LB}_{0}T has frame of opens given by the pointwise-ordered poset of functions h:T1𝒪Lh\colon T1\to\mathcal{O}L for which m1bm2m_{1}\sim_{b}m_{2} implies h(m1)f1b=h(m2)f1bh(m_{1})\wedge f^{-1}b=h(m_{2})\wedge f^{-1}b for any m1,m2T1m_{1},m_{2}\in T1 and bBb\in B.

In terms of points, such a function hh contains all the points (x,[m]β)(x,[m]_{\beta}) for which xh(m)x\in h(m) and f(x)=βf(x)=\beta.

Definition 3.16.

Let TT be a monad. Then the localic behaviour category 𝖫𝖡T\mathsf{LB}T has:

  • locale of objects 𝖫𝖡0T\mathsf{LB}_{0}T given by the terminal localic TT-comodel;

  • source map σ:𝖫𝖡1T𝖫𝖡0T\sigma\colon\mathsf{LB}_{1}T\to\mathsf{LB}_{0}T given by σ1(u):=𝖼𝗈𝗇𝗌𝗍u\sigma^{-1}(u):=\mathsf{const}_{u};

  • target map τ:𝖫𝖡1T𝖫𝖡0T\tau\colon\mathsf{LB}_{1}T\to\mathsf{LB}_{0}T given by τ1(u):=λm.m1u\tau^{-1}(u):=\lambda m.\llparenthesis{m}\rrparenthesis^{-1}u;

  • identity map ι:𝖫𝖡0T𝖫𝖡1T\iota\colon\mathsf{LB}_{0}T\to\mathsf{LB}_{1}T given by ι1(w):=w(𝗋𝖾𝗍𝗎𝗋𝗇)\iota^{-1}(w):=w(\operatorname{\mathsf{return}});

  • composition map μ:𝖫𝖡1T×𝖫𝖡0T𝖫𝖡1T𝖫𝖡1T\mu\colon\mathsf{LB}_{1}T\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T\to\mathsf{LB}_{1}T given by μ1:wλm,n.w(m>>n)\mu^{-1}\colon w\mapsto\lambda m,n.w(m\mathbin{>\mkern-6.9mu>}n), where, by lemma 3.15 we identify 𝒪(𝖫𝖡1T×𝖫𝖡0T𝖫𝖡1T)\mathcal{O}(\mathsf{LB}_{1}T\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T) with the poset of functions h:T1×T1𝒪(𝖫𝖡0T)h\colon T1\times T1\to\mathcal{O}(\mathsf{LB}_{0}T) for which m1bm2m_{1}\sim_{b}m_{2} implies h(m1,n)bh(m2,n)h(m_{1},n)\equiv_{b}h(m_{2},n) and n1bn2n_{1}\sim_{b}n_{2} implies h(m,n1)m1bh(m,n2)h(m,n_{1})\equiv_{\llparenthesis{m}\rrparenthesis^{-1}}bh(m,n_{2}).

A function h:T1×T1𝒪(𝖫𝖡0T)h\colon T1\times T1\to\mathcal{O}(\mathsf{LB}_{0}T) as above corresponds to the open set containing pairs of germs ([m]β,[n]mβ)([m]_{\beta},[n]_{\partial_{m}\beta}) with βh(m,n)\beta\in h(m,n). For the verification that this is a localic category, see section A.10.

3.3 Topological Behaviour Category & Finitary Monads

We have already seen that 𝗉𝗍𝖫𝖡0T𝔹0T\operatorname{\mathsf{pt}}\mathsf{LB}_{0}T\cong\mathbb{B}_{0}T and 𝗉𝗍𝖫𝖡1T𝔹1T\operatorname{\mathsf{pt}}\mathsf{LB}_{1}T\cong\mathbb{B}_{1}T (proposition 3.13). Being a right adjoint, the functor 𝗉𝗍\operatorname{\mathsf{pt}} preserves limits and hence lifts to internal categories. Hence we get a topological behaviour category 𝔹T:=𝗉𝗍(𝖫𝖡T)\mathbb{B}T:=\mathsf{pt}(\mathsf{LB}T), which is just an appropriately topologized version of the behaviour category.

Definition 3.17.

(Topological behaviour category) Let TT be a monad. The operational topology on 𝔹1T\mathbb{B}_{1}T is generated by subbasic opens of the form [m|b]:={[m]β|β[b]}[m|b]:=\set{[m]_{\beta}}{\beta\in[b]}. Taking 𝔹0T\mathbb{B}_{0}T and 𝔹1T\mathbb{B}_{1}T with their operational topologies makes the structure maps of the behaviour category continuous, yielding the topological behaviour category 𝔹T\mathbb{B}T.

While example 3.4 shows that we need the full force of the localic behaviour category for infinitary monads, for finitary monads it suffices to consider the topological behaviour category because the involved locales 𝖫𝖡0T\mathsf{LB}_{0}T and 𝖫𝖡1T\mathsf{LB}_{1}T are spatial, which we shall now prove. The spatiality of 𝖫𝖡0T\mathsf{LB}_{0}T is easily seen from the definition. The finitariness of TT means that axiom (𝖫𝖡0\mathsf{LB}_{0}-μ\mu) of definition 3.1 can be expressed by a finite join, and so the axioms generate a distributive lattice—in fact a Boolean algebra 𝖡𝖡0T\mathsf{BB}_{0}T—from which the frame 𝒪𝖫𝖡0T\mathcal{O}\mathsf{LB}_{0}T is freely generated. Locales freely generated from a distributive lattice in this way are well-known to be spatial [17, II 3.4], and in this case the space 𝔹0T\mathbb{B}_{0}T corresponds to the Stone dual of 𝖡𝖡0T\mathsf{BB}_{0}T.

As for 𝖫𝖡1T\mathsf{LB}_{1}T, it is spatial because 𝖫𝖡1T\mathsf{LB}_{1}T is determined by a sheaf FTF_{T} over a spatial locale 𝖫𝖡0T\mathsf{LB}_{0}T, and sheaves only depend on the lattice of opens of its base space. More precisely, we observe that the source map σ:𝔹1T𝔹0T\sigma\colon\mathbb{B}_{1}T\to\mathbb{B}_{0}T of the topological behaviour category is also a local homeomorphism, and it has the same sections as the (source map of the) localic behaviour category, and is thus the same sheaf.

Lemma 3.18.

Let TT be a finitary monad. Then for any global section ss of σ:𝔹1T𝔹0T\sigma\colon\mathbb{B}_{1}T\to\mathbb{B}_{0}T, there is a finite family of pairs {(bi𝖡𝖡0T,miT1)}iI\set{(b_{i}\in\mathsf{BB}_{0}T,m_{i}\in T1)}_{i\in I} such that {bi}iI\set{b_{i}}_{i\in I} is a finite partition and ss maps βbi[mi]β\beta\in b_{i}\mapsto[m_{i}]_{\beta}. Moreover, this family is unique up to trace equivalence: if we have two such families {(bi,mi)}iI\set{(b_{i},m_{i})}_{i\in I} and {(bj,nj)}jJ\set{(b_{j},n_{j})}_{j\in J} then for all i,ji,j we have mibibjnjm_{i}\sim_{b_{i}\wedge b_{j}}n_{j}.

Proof 3.19.

Each β𝔹0T\beta\in\mathbb{B}_{0}T admits an open neighborhood s1[mβ|𝗋𝖾𝗍𝗎𝗋𝗇1]s^{-1}[m_{\beta}|\operatorname{\mathsf{return}}1] where tβt_{\beta} is some representative of the equivalence class s(β)s(\beta). This induces an open cover on 𝔹0T\mathbb{B}_{0}T which is refined by a finite partition {bi}iI\set{b_{i}}_{i\in I} since 𝔹0T\mathbb{B}_{0}T is a Stone space. It suffices to pick mim_{i} to be the mβm_{\beta} of an open s1[mβ|𝗋𝖾𝗍𝗎𝗋𝗇1]s^{-1}[m_{\beta}|\operatorname{\mathsf{return}}1] refined by bib_{i}. The uniqueness under trace equivalence is easy to see because for any βbibj\beta\in b_{i}\wedge b_{j}, we have [mi]β=s(β)=[mj]β[m_{i}]_{\beta}=s(\beta)=[m_{j}]_{\beta}. The spatiality of 𝖫𝖡0T\mathsf{LB}_{0}T then ensures this corresponds to mibibjmjm_{i}\sim_{b_{i}\wedge b_{j}}m_{j}.

It is not hard to see that a family as in the lemma above defines an element of the free 𝖡𝖡0T\mathsf{BB}_{0}T-set, and that the uniqueness translates to the same condition as in lemma 3.10. That is, the global sections of 𝔹T\mathbb{B}T correspond to the sheaf of transitions over 𝖡𝖡0T\mathsf{BB}_{0}T, and hence 𝒪(𝔹1T)𝖫𝖡1T\mathcal{O}(\mathbb{B}_{1}T)\cong\mathsf{LB}_{1}T. Hence we have:

Proposition 3.20.

For finitary TT, 𝖫𝖡0T\mathsf{LB}_{0}T and 𝖫𝖡1T\mathsf{LB}_{1}T are spatial, i.e., 𝖫𝖡T\mathsf{LB}T has enough states and transitions.

4 The Stone Adjunction for Monads

In this section, we functorialize the construction of the localic behaviour category and prove that it has a right adjoint by taking sections of the source map. Here, the correct morphisms between localic categories are retrofunctors, not functors like usual. Just as we view topological/localic categories as transition systems, we can view a retrofunctor 𝔻\mathbb{C}\rightsquigarrow\mathbb{D} as a simulation of transition systems.

Definition 4.1.

Let \mathbb{C} and 𝔻\mathbb{D} be small categories. A retrofunctor F:𝔻F\colon\mathbb{C}\rightsquigarrow\mathbb{D} consists of two functions F0:0𝔻0F_{0}\colon\mathbb{C}_{0}\to\mathbb{D}_{0} and F1:0×𝔻0𝔻11F_{1}\colon\mathbb{C}_{0}\times_{\mathbb{D}_{0}}\mathbb{D}_{1}\to\mathbb{C}_{1}, where 0×𝔻0𝔻1\mathbb{C}_{0}\times_{\mathbb{D}_{0}}\mathbb{D}_{1} is the pullback of F0F_{0} along σ𝔻\sigma_{\mathbb{D}}. In other words, given c0c\in\mathbb{C}_{0} and f𝔻(F0c,d)f\in\mathbb{D}(F_{0}c,d) we get a lift F1(c,f):ccF_{1}(c,f)\colon c\to c^{\prime} such that F0c=dF_{0}c^{\prime}=d. These are further required to respect identity and composition:

F1(c,𝗂𝖽F0c)=𝗂𝖽cF1(c,gf)=F1(c,g)F1(c,f) where F1(c,f):ccF_{1}(c,\mathsf{id}_{F_{0}c})=\mathsf{id}_{c}\qquad F_{1}(c,g\circ f)=F_{1}(c^{\prime},g)\circ F_{1}(c,f)\quad\text{ where }\quad F_{1}(c,f)\colon c\to c^{\prime} (5)

If \mathbb{C} and 𝔻\mathbb{D} are internal categories, then there is an appropriate notion of internal retrofunctor which make the appropriate diagrams commute, as described by Clarke [7, definition 2.10]. Write 𝖫𝗈𝖼𝖱𝖾𝗍𝗋𝗈\mathsf{LocRetro} and 𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈\mathsf{TopRetro} for the categories of internal categories and retrofunctors in 𝖫𝗈𝖼\mathsf{Loc} and 𝖳𝗈𝗉\mathsf{Top} respectively.

Proposition 4.2.

The assignment T𝖫𝖡TT\mapsto\mathsf{LB}T extends contravariantly to a functor 𝖫𝖡:𝖬𝗇𝖽r(𝖲𝖾𝗍)𝖫𝗈𝖼𝖱𝖾𝗍𝗋𝗈𝗈𝗉\mathsf{LB}\colon\mathsf{Mnd}_{r}(\mathsf{Set})\to\mathsf{LocRetro}^{\mathsf{op}}, and similarly a functor 𝔹:𝖬𝗇𝖽ω(𝖲𝖾𝗍)𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈𝗈𝗉\mathbb{B}\colon\mathsf{Mnd}_{\omega}(\mathsf{Set})\to\mathsf{TopRetro}^{\mathsf{op}}.

Proof 4.3.

A monad morphism φ:TS\varphi\colon T\to S induces a retrofunctor whose action on objects 𝖫𝖡0φ:𝖫𝖡0S𝖫𝖡0T\mathsf{LB}_{0}\varphi\colon\mathsf{LB}_{0}S\to\mathsf{LB}_{0}T is given on generating opens by (𝖫𝖡0φ)1:[b][φ(b)](\mathsf{LB}_{0}\varphi)^{-1}\colon[b]\mapsto[\varphi(b)]. For the action on morphisms (𝖫𝖡1φ):𝖫𝖡0S×𝖫𝖡0T𝖫𝖡1T𝖫𝖡1S(\mathsf{LB}_{1}\varphi)\colon\mathsf{LB}_{0}S\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T\to\mathsf{LB}_{1}S, by lemma 3.15 we can identify 𝒪(𝖫𝖡0S×𝖫𝖡0T𝖫𝖡1T)\mathcal{O}(\mathsf{LB}_{0}S\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T) with an appropriate poset of functions h:T1𝒪(𝖫𝖡0S)h\colon T1\to\mathcal{O}(\mathsf{LB}_{0}S). The action is then simply given by (𝖫𝖡1φ)1:wwφ1(\mathsf{LB}_{1}\varphi)^{-1}\colon w\mapsto w\circ\varphi_{1}. We refer to section A.11 for more details and the verification of functoriality.

On the other hand, if we view a localic category 𝖫𝖢\mathsf{LC} as a transition system, what is a computation on 𝖫𝖢\mathsf{LC}? Well, a computation (of output type AA) should specify, for each state c𝖫𝖢0c\in\mathsf{LC}_{0}, a transition out of cc (the “side-effect” of the computation) along with an output in AA. In other words, the computations are global sections of the source map, or more precisely a disjoint, AA-indexed, jointly global family of partial sections. Indeed, we get a monad of such sections—notice that this looks very much like a state monad except we also keep track which transitions are taken, not just the end state.

Proposition 4.4.

Let 𝖫𝖢\mathsf{LC} be a localic category. Then the endofunctor

Γ𝖫𝖢(A)={s:𝖫𝖢0A𝖫𝖢1|𝗂𝖽𝖫𝖢0=𝖫𝖢𝟢𝑠A𝖫𝖢1π𝖫𝖢1𝖫𝖢1𝜎𝖫𝖢0}\Gamma{\mathsf{LC}}(A)=\set{s\colon\mathsf{LC}_{0}\to A\cdot\mathsf{LC}_{1}}{\mathsf{id}_{\mathsf{LC}_{0}}=\mathsf{LC_{0}}\overset{s}{\to}A\cdot\mathsf{LC}_{1}\overset{\pi_{\mathsf{LC}_{1}}}{\to}\mathsf{LC}_{1}\overset{\sigma}{\to}\mathsf{LC}_{0}}

on 𝖲𝖾𝗍\mathsf{Set} (with the action on f:ABf\colon A\to B given by post-composing f𝖫𝖢1f\cdot\mathsf{LC}_{1}) admits a monad structure given, for arbitrary aAa\in A, sΓ𝖫𝖢A,u:AΓ𝖫𝖢Bs\in\Gamma\mathsf{LC}A,u\colon A\to\Gamma\mathsf{LC}B by 𝗋𝖾𝗍𝗎𝗋𝗇a=𝖫𝖢0{{\operatorname{\mathsf{return}}a=\mathsf{LC}_{0}}}𝖫𝖢1{{\mathsf{LC}_{1}}}A𝖫𝖢1{{A\cdot\mathsf{LC}_{1}}}ι\scriptstyle{\iota}υa\scriptstyle{\upsilon_{a}} and

s>>=u=𝖫𝖢0A𝖫𝖢1𝖫𝖢1×(B𝖫𝖢1)B(𝖫𝖢1×𝖫𝖢1)B𝖫𝖢1sπ,u(Aτ)μ.\hbox to390.27pt{\vbox to16.51pt{\pgfpicture\makeatletter\hbox{\hskip 195.13446pt\lower-5.0pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{\the\pgflinewidth}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{}{}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{{}}{{}}{{}}{{}}{{}}}{{{}}}{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-198.13446pt}{-2.5pt}\pgfsys@invoke{ }\hbox{\vbox{\halign{\pgf@matrix@init@row\pgf@matrix@step@column{\pgf@matrix@startcell#\pgf@matrix@endcell}&#\pgf@matrix@padding&&\pgf@matrix@step@column{\pgf@matrix@startcell#\pgf@matrix@endcell}&#\pgf@matrix@padding\cr\hfil\hskip 32.26862pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-29.26862pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${{s\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u=\mathsf{LC}_{0}}}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope{}}}&\hskip 32.26862pt\hfil&\hfil\hskip 41.92897pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-14.39584pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${{A\cdot\mathsf{LC}_{1}}}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope{}}}&\qquad\hfil&\hfil\hskip 24.53313pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@endscope{}}}&\thinspace\hfil&\hfil\hskip 59.25711pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-31.72398pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${{\mathsf{LC}_{1}\times(B\cdot\mathsf{LC}_{1})}}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope{}}}&\hskip 34.72398pt\hfil&\hfil\hskip 59.25711pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-31.72398pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${{B\cdot(\mathsf{LC}_{1}\times\mathsf{LC}_{1})}}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope{}}}&\hskip 34.72398pt\hfil&\hfil\hskip 42.22237pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-14.68924pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${{B\cdot\mathsf{LC}_{1}}}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}&\qquad\hfil\cr}}}\pgfsys@invoke{ }\pgfsys@endscope}}}{{{{}}}{{}}{{}}{{}}{{}}{{}}}} \pgfsys@invoke{ }\pgfsys@endscope}}} {}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{\the\pgflinewidth}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{-133.39723pt}{0.0pt}\pgfsys@lineto{-109.66406pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-109.46408pt}{0.0pt}\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-123.21783pt}{2.35277pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{s}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope{}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{\the\pgflinewidth}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{-74.07242pt}{0.0pt}\pgfsys@lineto{-25.80612pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-25.60614pt}{0.0pt}\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-70.02156pt}{4.10277pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{\braket{\pi,u\circ(A\cdot\tau)}}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope{}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{\the\pgflinewidth}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{44.4418pt}{0.0pt}\pgfsys@lineto{68.17497pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{68.37495pt}{0.0pt}\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{53.88336pt}{3.75276pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{\cong}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope{}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{\the\pgflinewidth}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{138.4229pt}{0.0pt}\pgfsys@lineto{162.15607pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{162.35605pt}{0.0pt}\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{148.0583pt}{3.71385pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{\mu}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope \pgfsys@invoke{ }\pgfsys@endscope{{ {}{}{}}}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{ }\pgfsys@endscope\hss}}\endpgfpicture}}.

In terms of points, we have 𝗋𝖾𝗍𝗎𝗋𝗇a:c(a,𝗂𝖽c)\operatorname{\mathsf{return}}a\colon c\mapsto(a,\mathsf{id}_{c}) and s>>=u:c(b,gf)s\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u\colon c\mapsto(b,g\circ f) where (a,f)=:s(c)(a,f)=:s(c) and (b,g)=:u(a)(τ(f))(b,g)=:u(a)(\tau(f)), while in terms of opens we have

(𝗋𝖾𝗍𝗎𝗋𝗇a)1\displaystyle(\operatorname{\mathsf{return}}a)^{-1} :aw\displaystyle:\braket{a^{\prime}\mapsto w} if a=a then ι1w else \displaystyle\mapsto\textup{if }a=a^{\prime}\textup{ then }\iota^{-1}w\textup{ else }\bot
(s>>=u)1\displaystyle(s\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u)^{-1} :bw\displaystyle:\braket{b\mapsto w} aAs1a{v1τ1u(a)1bv2}v1×v2μ1(w)|.\displaystyle\mapsto\bigvee_{a\in A}s^{-1}\Braket{a\mapsto\bigvee\set{v_{1}\wedge\tau^{-1}u(a)^{-1}\braket{b\mapsto v_{2}}}{v_{1}\times v_{2}\leq\mu^{-1}(w)}|.}

Moreover, the assignment 𝖫𝖢Γ𝖫𝖢\mathsf{LC}\mapsto\Gamma{\mathsf{LC}} defines a contravariant functor Γ:𝖫𝗈𝖼𝖱𝖾𝗍𝗋𝗈𝗈𝗉𝖬𝗇𝖽r(𝖲𝖾𝗍)\Gamma\colon\mathsf{LocRetro}^{\mathsf{op}}\to\mathsf{Mnd}_{r}(\mathsf{Set}).

Proof 4.5.

A straightforward diagram chase reveals that unitality and associativity of the monad structure is inherited from the unitality and associativity of 𝖫𝖢\mathsf{LC}. Functoriality is automatically obtained when we prove the adjunction of theorem 4.6, so we leave it as an exercise to define the action of retrofunctors.

Any computation tTAt\in TA defines a global section η(t):𝖫𝖡0TA𝖫𝖡1T\eta(t)\colon\mathsf{LB}_{0}T\to A\cdot\mathsf{LB}_{1}T of the behaviour category, defined by η(t)1:aw[ta]w(t>>𝗋𝖾𝗍𝗎𝗋𝗇)\eta(t)^{-1}\colon\braket{a\mapsto w}\mapsto[t\mapsto a]\wedge w(t\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}) on generating opens. This defines the unit map of an adjunction between 𝖫𝖡\mathsf{LB} and Γ\Gamma, which brings us to the main adjunction of this paper.

Theorem 4.6.

𝖫𝖡:𝖬𝗇𝖽r(𝖲𝖾𝗍){{\mathsf{LB}:\mathsf{Mnd}_{r}(\mathsf{Set})}}𝖫𝗈𝖼𝖱𝖾𝗍𝗋𝗈𝗈𝗉:Γ{{\mathsf{LocRetro}^{\mathsf{op}}:\Gamma}}\scriptstyle{\dashv}.

Proof 4.7.

The counit map ε:𝖫𝖢𝖫𝖡Γ𝖫𝖢\varepsilon\colon\mathsf{LC}\rightsquigarrow\mathsf{LB}\Gamma\mathsf{LC} is given by ε01:[s]s11\varepsilon_{0}^{-1}\colon[s]\mapsto s^{-1}\braket{1\mapsto\top}, and ε11:uλmT1.m1u\varepsilon_{1}^{-1}\colon u\mapsto\lambda m\in T1.m^{-1}u. See section A.12 for the verification of the adjunction.

We also have a functor 𝔹:=𝗉𝗍𝖫𝖡:𝖬𝗇𝖽r(𝖲𝖾𝗍)𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈𝗈𝗉\mathbb{B}:=\operatorname{\mathsf{pt}}\mathsf{LB}\colon\mathsf{Mnd}_{r}(\mathsf{Set})\to\mathsf{TopRetro}^{\mathsf{op}}, and this similarly admits a right adjoint Γ\Gamma, but it is not well behaved because 𝔹T\mathbb{B}T loses too much information about the infinitary monad TT, as exemplified by example 3.4. However, by proposition 3.20, if we restrict to T𝖬𝗇𝖽ω(𝖲𝖾𝗍)T\in\mathsf{Mnd}_{\omega}(\mathsf{Set}) then 𝖫𝖡T\mathsf{LB}T is spatial and corresponds to the topological category 𝔹T\mathbb{B}T. The right adjoint of the functor 𝔹:𝖬𝗇𝖽ω(𝖲𝖾𝗍)𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈𝗈𝗉\mathbb{B}\colon\mathsf{Mnd}_{\omega}(\mathsf{Set})\to\mathsf{TopRetro}^{\mathsf{op}} is given by taking the monad of finitary sections Γω\Gamma_{\omega}\mathbb{C} for a topological category \mathbb{C}.

Theorem 4.8.
𝔹:𝖬𝗇𝖽ω(𝖲𝖾𝗍){{\mathbb{B}:\mathsf{Mnd}_{\omega}(\mathsf{Set})}}𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈𝗈𝗉:Γω.{{\mathsf{TopRetro}^{\mathsf{op}}:\Gamma_{\omega}.}}\scriptstyle{\dashv}
Proof 4.9.

The inclusion i:𝖬𝗇𝖽ω(𝖲𝖾𝗍)𝖬𝗇𝖽r(𝖲𝖾𝗍)i\colon\mathsf{Mnd}_{\omega}(\mathsf{Set})\hookrightarrow\mathsf{Mnd}_{r}(\mathsf{Set}) has a right adjoint given by 𝗅𝖺𝗇j(j)\operatorname{\mathsf{lan}}_{j}(-\circ j) where j:𝖲𝖾𝗍ω𝖲𝖾𝗍j\colon\mathsf{Set}_{\omega}\hookrightarrow\mathsf{Set} is the usual full inclusion of the category of finite sets (as follows from relative monad theory [5]). Then we have the desired adjunction by composing 𝔹Γ\mathbb{B}\dashv\Gamma with i𝗅𝖺𝗇j(j)i\dashv\operatorname{\mathsf{lan}}_{j}(-\circ j), noting that Γω:=𝗅𝖺𝗇j(Γ()j)\Gamma_{\omega}:=\operatorname{\mathsf{lan}}_{j}(\Gamma(-)\circ j).

5 The Stone Duality for Hyperaffine-Unary Monads

This final section is devoted to proving that the adjunction 4.6 is idempotent, and to characterize its fixed points. On the monad side, the fixed points correspond to those monads whose category of Eilenberg-Moore algebras are cartesian-closed. These were first syntactically characterized by Johnstone [18], but [12] provided an improved syntactic characterization as those monads which admit a hyperaffine-unary decomposition. On the side of localic categories, the fixed points are the ample localic categories, i.e., whose source maps are local homeomorphisms and whose locales of objects are ultraparacompact.

In fact, this equivalence between hyperaffine-unary monads and ample localic categories is originally due to the first-named author [13]. In addition to filling in details about the equivalence, our contribution is to envelope the equivalence in an adjunction, which yields a process of hyperaffine-unary completion for monads on one hand, and a process of amplification for localic categories on the other.

5.1 Hyperaffine-Unary Monads

What exactly is the difference between TT and Γ𝖫𝖡T\Gamma\mathsf{LB}T? Because of the unit map, all computations in TT live inside Γ𝖫𝖡T\Gamma\mathsf{LB}T. The answer is that TT adds additional operations t¯\overline{t} which predicts the output of tt without performing the side effect of tt. Computationally, this can be thought of as performing tt and then rolling the state back, or more mystically as scrying222A particularly potent analogy is to think of the environment as an (infinite) deck of playing cards, and of the program as the player, in which case a scry allows the player to look at the top nn\in\mathbb{N} cards of their deck before putting it back in the same order. This happens for example in the trading card game Magic:​ The Gathering. the future.

Example 5.1.

(Binary Input with Scrying) Let TT be induced by [b/2|][b/2|\;\;] as in example 3.6. The topology of 𝔹0T\mathbb{B}_{0}T is the cantor space, and hence generated by open sets V𝔟={β|β𝔟}V_{\mathfrak{b}}=\set{\beta}{\beta\sqsupseteq\mathfrak{b}} of infinite streams which extend a given finite string 𝔟\mathfrak{b}. By continuity and compactness of 𝔹0T\mathbb{B}_{0}T, any global section sΓ𝔹T(A)s\in\Gamma\mathbb{B}T(A) is therefore described (non-uniquely) by a pair (B,|s|:B×A)(B,|s|\colon B\to\mathbb{N}\times A) where BB is a finite set of finite strings B2<ωB\subseteq 2^{<\omega} that jointly cover all infinite streams, and |s||s| assigns to each element of BB a pair (n,a)(n,a) consisting of the number nn of digits to consume from the stream, and the output aa. Notice that this rules out the section we introduced in example 3.6. As an example, the binary tree t=b(a0,b(b(a1,a2),a3))TAt=b(a_{0},b(b(a_{1},a_{2}),a_{3}))\in TA, induces a section η(t)\eta(t) which is described by the assignments {0(1,a0);100(3,a1);101(3,a2);11(2,a3)}\set{0\mapsto(1,a_{0});100\mapsto(3,a_{1});101\mapsto(3,a_{2});11\mapsto(2,a_{3})}.

In general, an assignment 𝔟(n,a)\mathfrak{b}\mapsto(n,a) for a section of the form η(t)\eta(t) must satisfy n𝗅𝖾𝗇𝗀𝗍𝗁(𝔟)n\geq\mathsf{length}(\mathfrak{b}). That is, to use information about the first k=𝗅𝖾𝗇𝗀𝗍𝗁(𝔟)k=\mathsf{length}(\mathfrak{b}) digits of the stream you must consume at least kk digits. However, in general sections do not need to respect this: the assignments {0(0,a0);10(1,a1);11(1,a2)}\set{0\mapsto(0,a_{0});10\mapsto(1,a_{1});11\mapsto(1,a_{2})} describe a perfectly acceptable section ss. We can think of ss as looking ahead or scrying the first two digits of the stream, before deciding what to do. Indeed, for any section ss, we have a corresponding s¯Γ𝔹T(A)\overline{s}\in\Gamma\mathbb{B}T(A) which outputs the same values as ss, but only makes identity transitions. Then ss factors as s=s¯>>=λa.s>>𝗋𝖾𝗍𝗎𝗋𝗇as=\overline{s}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.s\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a.

It is easy to see in general that monads of the form Γ𝖫𝖢\Gamma\mathsf{LC} always has this factorization property, since a section ss always admits a cousin s¯\overline{s} which sends objects to the same output, but replaces the morphism by identity morphisms—the scry corresponding to ss. Monads satisfying this factorization property, called hyperaffine-unary monads in [12], suffices to characterize the fixed points of adjunction 4.6.

Definition 5.2.

(Hyperaffine-unary) Let TT be a monad. A computation hTAh\in TA is hyperaffine if

h>>𝗋𝖾𝗍𝗎𝗋𝗇a=𝗋𝖾𝗍𝗎𝗋𝗇a and h>>=λa1.h>>=λa2.𝗋𝖾𝗍𝗎𝗋𝗇(a1,a2)=h>>=λa.𝗋𝖾𝗍𝗎𝗋𝗇(a,a).h\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a=\operatorname{\mathsf{return}}a\qquad\text{ and }\qquad h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a_{1}.h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a_{2}.\operatorname{\mathsf{return}}(a_{1},a_{2})=h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.\operatorname{\mathsf{return}}(a,a). (6)

The monad TT is hyperaffine-unary if for every computation tTAt\in TA, there is a unique hyperaffine t¯TA\overline{t}\in TA such that t=t¯>>=λa.(t>>𝗋𝖾𝗍𝗎𝗋𝗇a)t=\overline{t}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.(t\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a). Any hyperaffine-unary monad admits a submonad HH of hyperaffine operations ([12, Proposition 6.1]).

Proposition 5.3.

Let 𝖫𝖢\mathsf{LC} be a localic category. Then Γ𝖫𝖢\Gamma\mathsf{LC} is hyperaffine-unary.

Proof 5.4.

A computation reveals that (h>>𝗋𝖾𝗍𝗎𝗋𝗇)1w=ah1aw(h\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}})^{-1}w=\bigvee_{a}h^{-1}\braket{a\mapsto w}, while 𝗋𝖾𝗍𝗎𝗋𝗇1w=ι1w\operatorname{\mathsf{return}}^{-1}w=\iota^{-1}w. So these two are equal iff h>>𝗋𝖾𝗍𝗎𝗋𝗇a=𝗋𝖾𝗍𝗎𝗋𝗇ah\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a=\operatorname{\mathsf{return}}a. Notice that we do not use the second condition of being hyperaffine, because it is automatically true for any hh satisfying the first condition (also known as affine). Now, suppose that such a hyperaffine s¯\overline{s} for a section sΓ𝖫𝖢(A)s\in\Gamma\mathsf{LC}(A). Then a straightforward computation (using the characterization of hyperaffines) reveals that the condition s=s¯>>=λa.s>>𝗋𝖾𝗍𝗎𝗋𝗇as=\overline{s}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.s\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a implies s¯1aw=s1aι1w\overline{s}^{-1}\braket{a\mapsto w}=s^{-1}\braket{a\mapsto\top}\wedge\iota^{-1}w which determines s¯1\overline{s}^{-1} as a well-defined frame homomorphism. See section A.13 for the computations.

Hyperaffine-unary monads admit a particularly nice presentation of the localic behaviour category, which greatly aids us in proving the characterization of the fixed points.

Lemma 5.5.

Let TT be a hyperaffine-unary monad with hyperaffine submonad HH. Then 𝒪(𝖫𝖡0T)\mathcal{O}(\mathsf{LB}_{0}T) is generated by H2𝒥H2_{\mathcal{J}} where H2H2 admits a Boolean algebra structure and 𝒥\mathcal{J} is a strongly zero-dimensional topology defined by {P(h)|hHA}\set{P^{(h)}}{h\in HA} with P(h)={[ha]|aA}P^{(h)}=\set{[h\mapsto a]}{a\in A}. Here, we abuse notation by writing [ha][h\mapsto a] for h>>=λa.δa(a)H2h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a^{\prime}.\delta_{a}(a^{\prime})\in H2. Moreover, the map δ:T1FT\delta\colon T1\to F_{T} is an isomorphism, with T1T1 admitting a H2𝒥H2_{\mathcal{J}}-set structure given by P(h)(λa.ma):=h>>=λa.taP^{(h)}(\lambda a.m_{a}):=h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.t_{a}.

Proof 5.6.

The Grothendieck Boolean algebra structure H2𝒥H2_{\mathcal{J}} is established in [12]. The Boolean algebra structure on H2H2 is given by =𝗋𝖾𝗍𝗎𝗋𝗇1\top=\operatorname{\mathsf{return}}1, h1h2=h1>>=(0𝗋𝖾𝗍𝗎𝗋𝗇0;1h2)h_{1}\wedge h_{2}=h_{1}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}(0\mapsto\operatorname{\mathsf{return}}0;1\mapsto h_{2}) and ¬h=h>>=(0𝗋𝖾𝗍𝗎𝗋𝗇1;1𝗋𝖾𝗍𝗎𝗋𝗇0)\neg h=h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}(0\mapsto\operatorname{\mathsf{return}}1;1\mapsto\operatorname{\mathsf{return}}0), and from this it is easy to see that H2H2 satisfies (𝖫𝖡0\mathsf{LB}_{0}-\bot), (𝖫𝖡0\mathsf{LB}_{0}-η\eta), [t>>𝗋𝖾𝗍𝗎𝗋𝗇aa][t\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a\mapsto a^{\prime}], and aA[ta]=\bigvee_{a\in A}[t\mapsto a]=\top for finite sets AA. Then the only missing axioms are aA[ta]=\bigvee_{a\in A}[t\mapsto a]=\top for infinite AA, but these are precisely the partitions in 𝒥\mathcal{J}. Hence H2𝒥H2_{\mathcal{J}} generates 𝒪(𝖫𝖡0T)\mathcal{O}(\mathsf{LB}_{0}T).

The inverse to δ:T1FT\delta\colon T_{1}\to F_{T} is witnessed by δ1:xh>>=λb.x1b\delta^{-1}\colon x\mapsto h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda b.x^{-1}b, where hHPh\in HP is a hyperaffine realizing the partition P(h)P^{(h)} induced by x:T1H2x\colon T1\to H2. On one hand we have δδ1(x)=δ(h>>=λb.x1b)=P(δ(h>>x1b))=P(δ(x1b))=x\delta\delta^{-1}(x)=\delta(h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda b.x^{-1}b)=P(\delta(h\mathbin{>\mkern-6.9mu>}x^{-1}b))=P(\delta(x^{-1}b))=x. On the other hand, δ1δ(t)=𝗋𝖾𝗍𝗎𝗋𝗇>>=λb.δ(t)1b=δ(t)1=t\delta^{-1}\delta(t)=\operatorname{\mathsf{return}}\top\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda b.\delta(t)^{-1}b=\delta(t)^{-1}\top=t.

Proposition 5.7.

A monad TT is hyperaffine-unary iff the unit map ηT:TΓ𝖫𝖡T\eta_{T}\colon T\to\Gamma\mathsf{LB}T is an isomorphism.

Proof 5.8.

(\impliedby) Suppose now the unit map is an isomorphism. Then the hyperaffine-unary factorization of Γ𝖫𝖡T\Gamma\mathsf{LB}T (proposition 5.3) must transfer along the unit map onto TT.

(\implies) For the converse direction, we make use of lemma 5.5, which basically says any global section sΓ𝖫𝖡TAs\in\Gamma\mathsf{LB}TA identifies a hyperaffine hHAh\in HA and a family u:AT1u:A\to T1 of unary computations, and the composite h>>=λa.u(a)>>𝗋𝖾𝗍𝗎𝗋𝗇ah\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.u(a)\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a induces the section ss. See Section A.14 for the details.

5.2 Ample Localic Categories and Stone Duality

On the other side of the adjunction, what is the relationship between a localic category 𝖫𝖢\mathsf{LC} and the behaviour category 𝖫𝖡Γ𝖫𝖢\mathsf{LB}\Gamma\mathsf{LC}? Well, Γ\Gamma only considers the partitioning sections of 𝖫𝖢\mathsf{LC}, so is only sensitive to the ultraparacompact quotient of 𝖫𝖢0\mathsf{LC}_{0}, i.e., whose frame of opens is the ultraparacompact frame generated by taking the zero-dimensional topology of partitions on the Boolean algebra 𝔅(𝖫𝖢0)\mathfrak{B}(\mathsf{LC}_{0}). Moreover, 𝖫𝖡\mathsf{LB} then reconstructs the locale of morphisms from only the sections over this ultraparacompact quotient. So this reconstruction is perfect if in the first place 𝖫𝖢0\mathsf{LC}_{0} is ultraparacompact and the source map is a local homeomorphism. These are called ample localic categories [13].

Definition 5.9.

A localic category 𝖫𝖢\mathsf{LC} is ample if σ𝖫𝖢\sigma_{\mathsf{LC}} is a local homeomorphism and 𝖫𝖢0\mathsf{LC}_{0} is ultraparacompact. A topological category \mathbb{C} is ample if σ\sigma_{\mathbb{C}} is a local homeomorphism and 0\mathbb{C}_{0} is a Stone space. Write 𝖠𝗆𝗉𝖫𝗈𝖼𝖱𝖾𝗍𝗋𝗈\mathsf{AmpLocRetro} (resp. 𝖠𝗆𝗉𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈\mathsf{AmpTopRetro}) for the full subcategory of 𝖫𝗈𝖼𝖱𝖾𝗍𝗋𝗈\mathsf{LocRetro} (resp. 𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈\mathsf{TopRetro}) containing the ample localic (resp. topological) categories.

Proposition 5.10.

A localic category 𝖫𝖢\mathsf{LC} is ample iff the counit map ε𝖫𝖢:𝖫𝖢𝖫𝖡Γ𝖫𝖢\varepsilon_{\mathsf{LC}}\colon\mathsf{LC}\rightsquigarrow\mathsf{LB}\Gamma\mathsf{LC} is an isomorphism.

The combination of propositions 5.7 and 5.10 allow us to derive the titular Stone duality for monads.

Theorem 5.11.

The adjunction of theorem 4.6 is idempotent and its fixed points are the equivalent categories 𝖧𝖴𝖬𝗇𝖽𝗋𝖠𝗆𝗉𝖫𝗈𝖼𝖱𝖾𝗍𝗋𝗈\mathsf{HUMnd_{r}}\simeq\mathsf{AmpLocRetro}. Furthermore, this equivalence restricts to 𝖧𝖴𝖬𝗇𝖽ω𝖠𝗆𝗉𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈\mathsf{HUMnd_{\omega}\simeq\mathsf{AmpTopRetro}}.

Proof 5.12.

It follows from proposition 5.10 that ε𝖫𝖡\varepsilon_{\mathsf{LB}} is an isomorphism, since 𝖫𝖡T\mathsf{LB}T is ample for any monad TT. Hence adjunction 4.6 is idempotent, and propositions 5.7 and 5.10 characterize the fixpoints. For the finitary monad case, we know that 𝒪:𝖳𝗈𝗉𝖫𝗈𝖼\mathcal{O}:\mathsf{Top}\to\mathsf{Loc} preserves pullbacks along local homeomorphisms. So induces a functor 𝒪:𝖠𝗆𝗉𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈𝖠𝗆𝗉𝖫𝗈𝖼𝖱𝖾𝗍𝗋𝗈\mathcal{O}:\mathsf{AmpTopRetro}\to\mathsf{AmpLocRetro}. The equivalence 𝖧𝖴𝖬𝗇𝖽r𝖠𝗆𝗉𝖫𝗈𝖼𝖱𝖾𝗍𝗋𝗈\mathsf{HUMnd}_{r}\simeq\mathsf{AmpLocRetro} when restricted to finitary monads factors through this functor. This factorization 𝖧𝖴𝖬𝗇𝖽ω𝖠𝗆𝗉𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈\mathsf{HUMnd}_{\omega}\to\mathsf{AmpTopRetro} is essentially surjective on objects, because now taking the global sections monad on an ample topological category \mathbb{C}, the compactness of the base space 0\mathbb{C}_{0} ensures this monad is the monad Γω\Gamma_{\omega}\mathbb{C} of finitary sections. Hence, we get an equivalence 𝖧𝖴𝖬𝗇𝖽ω𝖠𝗆𝗉𝖳𝗈𝗉𝖱𝖾𝗍𝗋𝗈\mathsf{HUMnd}_{\omega}\simeq\mathsf{AmpTopRetro}.

Example 5.13.

Every Grothendieck Boolean algebra B𝒥B_{\mathcal{J}} presenting a locale LL is associated to a distributions monad DB(A):=A[B]𝒥D_{B}(A):=A[B]^{\mathcal{J}} whose computations are all hyperaffine, and hence hyperaffine-unary. Under the equivalence of theorem 5.11, DBD_{B} corresponds to the localic category 𝖫𝖡DB\mathsf{LB}D_{B} with 𝖫𝖡0DB=𝖫𝖡1DB=L\mathsf{LB}_{0}D_{B}=\mathsf{LB}_{1}D_{B}=L and source map σ=𝗂𝖽:LL\sigma=\mathsf{id}\colon L\to L. Of course, if 𝒥\mathcal{J} consists of only finite partitions, then L=𝖲𝗉𝖾𝖼(B)L=\mathsf{Spec}(B) is the Stone dual of BB, and so our equivalence subsumes the classical Stone duality.

6 Conclusion & Prospectus

Summary. We constructed the localic behaviour category 𝖫𝖡T\mathsf{LB}T (definition 3.16) associated to a ranked monad, and showed that the functor 𝖫𝖡:𝖬𝗇𝖽r(𝖲𝖾𝗍)𝖫𝗈𝖼𝖱𝖾𝗍𝗋𝗈𝗈𝗉\mathsf{LB}\colon\mathsf{Mnd}_{r}(\mathsf{Set})\to\mathsf{LocRetro}^{\mathsf{op}} admits a right adjoint Γ\Gamma by taking global sections (theorem 4.6). We further showed that this adjunction is idempotent, and restricts to a known equivalence between the full subcategory of hyperaffine-unary monads, and the full subcategory of ample localic categories (theorem 5.11).

On Classifying Comodels. Recall from theorem 2.7 that the behaviour category classifies comodels. It is easy to prove a similar classification theorem for localic TT-comodels, this time as 𝖫𝖡T\mathsf{LB}T-spaces, i.e., locales equipped with an action by 𝖫𝖡T\mathsf{LB}T, which we omit for brevity. In fact, we have a more abstract perspective on this classification, which we shall now quickly sketch. TT-comodels are particular instances of right TT-modules, and the construction of the localic behaviour category can be generalized to arbitrary right TT-modules M:𝖲𝖾𝗍𝖲𝖾𝗍M\colon\mathsf{Set}\to\mathsf{Set} (recovering the original by considering TT as a right module of itself). The resulting construction is no longer a category, but rather a fibred 𝖫𝖡T\mathsf{LB}T-space σ:𝖫𝖡1M𝖫𝖡0M\sigma\colon\mathsf{LB}_{1}M\to\mathsf{LB}_{0}M, i.e., a family of localic TT-comodels varying continuously over 𝖫𝖡0M\mathsf{LB}_{0}M. Following [9], we can explain this σ\sigma as the free comodel associated to MM, with the fibration being necessary because the free comodel lives not in 𝖲𝖾𝗍\mathsf{Set}, but rather in the topos of sheaves 𝖲𝗁(𝖫𝖡0M)\mathsf{Sh}(\mathsf{LB}_{0}M). However, if MM is itself a comodel, then 𝖫𝖡0M1\mathsf{LB}_{0}M\cong 1 is the singleton space, and 𝖫𝖡1M\mathsf{LB}_{1}M, which is now just a 𝖫𝖡T\mathsf{LB}T-space, corresponds exactly to the comodel MM.

Prospectus. Stone dualities underlie completeness theorems for logics. In future work, we hope to use our Stone duality to constructing a logic for reasoning about monadic programs, such as can be expressed in Moggi’s monadic metalanguage [22]. We expect this logic to take the shape of propositional dynamic logic (PDL) [15], since the localic behaviour category 𝖫𝖡T\mathsf{LB}T can be seen as a Kripke model whose propositions are interpreted as clopens of 𝖫𝖡0T\mathsf{LB}_{0}T and whose programs are (generated by) T1T1. The modality [m]φ[m]\varphi is interpreted as m1φ\llparenthesis{m}\rrparenthesis^{-1}\varphi. The advantage of this approach is that, in light of theorem 5.11, we may think of Γ𝖫𝖡T\Gamma\mathsf{LB}T as universally completing TT with propositions (the “scrying” hyperaffines), i.e., we are really interpreting our logic in Γ𝖫𝖡T\Gamma\mathsf{LB}T. This lifts a constraint in previous works on monadic program logics such as Goncharov & Schröder [14] which require the original monad TT to contain sufficient innocent computations to interpret the propositions in the first place.

Having brought up Goncharov & Schröder [14], we also ought to discuss their use of unary computations as propositions, contrasting with our use of binary computations (in Γ𝖫𝖡T\Gamma\mathsf{LB}T). This contrast seems to stem from their assumption that computations may fail to terminate, leading to an information ordering on computations ala domain theory, whereas in this paper, the choice to use comodels (which always return a value) is tantamount to assuming that computations always terminate. Therefore, we hope in the future to explore the Stone-type duality that arises when we consider comodels residual [2, 20, 29] over the lifting monad {}+\set{\bot}+-. Just as the global sections monad is a very fancy state monad, we expect the right adjoint of this duality to take monads of partial sections, i.e., fancy partial state monads.

It is also natural to consider generalizations beyond monads on 𝖲𝖾𝗍\mathsf{Set}. In this paper, many constructions explicitly talk about elements of monads, so an appropriate generalization will replace elements with morphisms in the Kleisli category. We can shed a preliminary light on this too, based on the very general adjunction introduced in [8] between restriction categories realized in 𝖫𝗈𝖼\mathsf{Loc} and partite categories internal in 𝖫𝗈𝖼\mathsf{Loc}. Here, our localic behaviour category is the partite internal category corresponding under this adjunction to a restriction category generated by the functor AA𝖫𝖡0:𝖪𝗅(T)𝖫𝗈𝖼A\mapsto A\cdot\mathsf{LB}_{0}:\mathsf{Kl}(T)\to\mathsf{Loc}. This provides a description of the localic behaviour category which avoids talking about elements of TT, so generalization efforts ought to begin by better understanding the construction of this restriction category.

Finally, the existence of a spectral duality for monads raise the interesting possibility of developing a scheme theory of monads. Recall the notion of a scheme of rings from algebraic geometry: these are locally ringed sheaves which are locally isomorphic to the spectrum of a commutative ring. The analogy here is between rings and (hyperaffine-unary) monads, with the spectrum of a ring (which is a sheaf) analogous to the source map of 𝖫𝖡T\mathsf{LB}T. At first approximation, a scheme of monads should then be a localic category 𝖲\mathsf{S}, which “locally resembles” 𝖫𝖡T\mathsf{LB}T for some TT. The idea is that in a scheme 𝖲\mathsf{S}, the monad (and hence the syntax) in play varies continuously over the base space 𝖲0\mathsf{S}_{0}. This should allow for the modelling of effects whose syntax is not fixed, such as local state—it would be nice if “local state” = “locally a state monad”.

References

  • [1] Aguiar, M., Internal Categories and Quantum Groups, Cornell University (1997).
  • [2] Ahman, D. and A. Bauer, Runners in Action, pages 29–55, Lecture notes in computer science, Springer International Publishing (2020).
    https://doi.org/10.1007/978-3-030-44914-8_2
  • [3] Ahman, D. and T. Uustalu, Directed containers as categories, Electronic Proceedings in Theoretical Computer Science 207, pages 89–98 (2016).
    https://doi.org/10.4204/eptcs.207.5
  • [4] Ahman, D. and T. Uustalu, Taking updates seriously, in: R. Eramo and M. Johnson, editors, Proceedings of the Sixth International Workshop on Bidirectional Transformations, pages 59–73, CEUR Workshop Proceedings (2017).
  • [5] Altenkirch, T., J. Chapman and T. Uustalu, Monads need not be endofunctors, in: C. L. Ong, editor, Foundations of Software Science and Computational Structures, 13th International Conference, FOSSACS 2010, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2010, Paphos, Cyprus, March 20-28, 2010. Proceedings, volume 6014 of Lecture Notes in Computer Science, pages 297–311, Springer (2010).
    https://doi.org/10.1007/978-3-642-12032-9_21
  • [6] Bergman, G. M., Actions of boolean rings on sets, Algebra universalis 28, pages 153–187 (1991).
    https://doi.org/10.1007/bf01190851
  • [7] Clarke, B., Internal split opfibrations and cofunctors, Theory and Applications of Categories 35, pages 1608–1633 (2020).
  • [8] Cockett, R. and R. Garner, Generalising the étale groupoid–complete pseudogroup correspondence, Advances in mathematics 392, page 108030 (2021).
    https://doi.org/10.1016/j.aim.2021.108030
  • [9] Cole, J. C., The bicategory of topoi and spectra, Reprints in Theory and Applications of Categories 25, pages 1–16 (2016).
  • [10] Garner, R., The costructure–cosemantics adjunction for comodels for computational effects, Mathematical structures in computer science 32, pages 374–419 (2022).
    https://doi.org/10.1017/s0960129521000219
  • [11] Garner, R., Stream processors and comodels, Logical Methods in Computer Science 19, Issue 1 (2023).
    https://doi.org/10.46298/lmcs-19(1:2)2023
  • [12] Garner, R., Cartesian closed varieties I: the classification theorem, Algebra universalis 85 (2024).
    https://doi.org/10.1007/s00012-024-00869-1
  • [13] Garner, R., Cartesian closed varieties II: links to algebra and self-similarity, Proceedings of the Royal Society of Edinburgh: Section A Mathematics pages 1–45 (2025).
    https://doi.org/10.1017/prm.2024.80
  • [14] Goncharov, S. and L. Schröder, A relatively complete generic hoare logic for order-enriched effects, in: 2013 28th Annual ACM/IEEE Symposium on Logic in Computer Science, IEEE (2013).
    https://doi.org/10.1109/lics.2013.33
  • [15] Harel, D., D. Kozen and J. Tiuryn, Dynamic logic, pages 99–217, Springer Netherlands (2001).
    https://doi.org/10.1007/978-94-017-0456-4_2
  • [16] Johnstone, P., Cartesian monads on toposes, Journal of pure and applied algebra 116, pages 199–220 (1997).
    https://doi.org/10.1016/s0022-4049(96)00165-x
  • [17] Johnstone, P. T., Stone Spaces, Cambridge University Press (1982).
  • [18] Johnstone, P. T., Collapsed toposes and cartesian closed varieties, Journal of algebra 129, pages 446–480 (1990).
    https://doi.org/10.1016/0021-8693(90)90230-l
  • [19] Johnstone, P. T., Sketches of an Elephant: Volume 2, Oxford University Press (2002).
  • [20] Katsumata, S.-Y., E. Rivas and T. Uustalu, Interaction laws of monads and comonads, in: Proceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science, ACM (2020).
    https://doi.org/10.1145/3373718.3394808
  • [21] Kelly, G. M. and A. J. Power, Adjunctions whose counits are coequalizers, and presentations of finitary enriched monads, Journal of Pure and Applied Algebra 89, pages 163–179 (1993).
    https://doi.org/10.1016/0022-4049(93)90092-8
  • [22] Moggi, E., Notions of computation and monads, Information and Computation 93, pages 55–92 (1991).
    https://doi.org/10.1016/0890-5401(91)90052-4
  • [23] Niu, N. and D. I. Spivak, Polynomial Functors: A Mathematical Theory of Interaction, London Mathematical Society Lecture Note Series, Cambridge University Press (2025).
  • [24] Paterson, A. L. T., Groupoids, inverse semigroups, and their operator algebras, volume 170 of Progress in Mathematics, Birkhäuser (1999).
  • [25] Plotkin, G. and J. Power, Notions of Computation Determine Monads, pages 342–356, Lecture notes in computer science, Springer Berlin Heidelberg (2002).
    https://doi.org/10.1007/3-540-45931-6_24
  • [26] Plotkin, G. and J. Power, Computational effects and operations: An overview, Electronic Notes in Theoretical Computer Science 73, pages 149–163 (2004).
    https://doi.org/10.1016/j.entcs.2004.08.008
  • [27] Power, J. and O. Shkaravska, From comodels to coalgebras: State and arrays, Electronic notes in theoretical computer science 106, pages 297–314 (2004).
    https://doi.org/10.1016/j.entcs.2004.02.041
  • [28] Uustalu, T., Stateful runners of effectful computations, Electronic notes in theoretical computer science 319, pages 403–421 (2015).
    https://doi.org/10.1016/j.entcs.2015.12.024
  • [29] Uustalu, T. and N. Voorneveld, Algebraic and Coalgebraic Perspectives on Interaction Laws, pages 186–205, Lecture notes in computer science, Springer International Publishing (2020).
    https://doi.org/10.1007/978-3-030-64437-6_10
  • [30] Van Name, J., Ultraparacompactness and ultranormality, arXiv:1306.6086v1 [math.GN] (2013).
  • [31] Vickers, S., Topology via Logic, Cambridge University Press (1996).

Appendix A Omitted Proofs

A.1 Proof of lemma 2.21

Each open x^=λy.{b|xby}\hat{x}=\lambda y.\bigvee\set{b}{x\equiv_{b}y} is a B𝒥B_{\mathcal{J}}-set homomorphism since if y1cy2y_{1}\equiv_{c}y_{2} then

cx^(y1)={cb|xby1}={cb|xcby1}={cb|xcby2}=cx^(y2),c\wedge\hat{x}(y_{1})=\bigvee\set{c\wedge b}{x\equiv_{b}y_{1}}\overset{\Diamond}{=}\bigvee\set{c\wedge b}{x\equiv_{c\wedge b}y_{1}}=\bigvee\set{c\wedge b}{x\equiv_{c\wedge b}y_{2}}=c\wedge\hat{x}(y_{2}),

where \Diamond holds from right-to-left because we can take the bb on the LHS to be the bcb\wedge c on the RHS. The assignment xx^x\mapsto\hat{x} is injective, as we now show. Let x,y|F|x,y\in|F| and assume that x^=y^\hat{x}=\hat{y}. Then we have b{b|xby}=x^(y)=y^(y)=\bigvee_{b}\set{b}{x\equiv_{b}y}=\hat{x}(y)=\hat{y}(y)=\top, which implies there is a (cover PP, WLOG refinable into a) partition PP such that for each bPb\in P we have xbyx\equiv_{b}y. But then y=P(λb.y)=P(λb.b(x,y))=P(λb.x)=xy=P(\lambda b.y)=P(\lambda b.b(x,y))=P(\lambda b.x)=x.

Finally, let us show that w=x|F|x^𝖼𝗈𝗇𝗌𝗍w(x)w=\bigvee_{x\in|F|}\hat{x}\wedge\mathsf{const}_{w(x)}. Take an arbitrary y|F|y\in|F|. Then w(y)=w(y)=y^(y)w(y)x|F|x^(y)𝖼𝗈𝗇𝗌𝗍w(x)(y)w(y)=\top\wedge w(y)=\hat{y}(y)\wedge w(y)\leq\bigvee_{x\in|F|}\hat{x}(y)\wedge\mathsf{const}_{w(x)}(y). On the other hand, for the right-to-left inequality, it suffices to show for any bBb\in B with xbyx\equiv_{b}y that bw(x)w(y)b\wedge w(x)\leq w(y). But this is clearly true since xbyx\equiv_{b}y implies w(x)bw(y)bw(x)=bw(y)w(x)\equiv_{b}w(y)\iff b\wedge w(x)=b\wedge w(y).

A.2 Proof of proposition 2.22

The map σ:E(F)L\sigma\colon E(F)\to L is a local homeomorphism by taking the family {x^}x|F|\set{\hat{x}}_{x\in|F|}, which is covering by 2.21. Each such open x^\hat{x} is homeomorphic onto the whole base space 𝒪L\mathcal{O}L.

The set of global sections to E(F)LE(F)\to L forms a B𝒥B_{\mathcal{J}}-set, s1bs2w𝒪E(F).s1(w)b=s2(w)bs_{1}\equiv_{b}s_{2}\iff\forall w\in\mathcal{O}E(F).s_{1}(w)\wedge b=s_{2}(w)\wedge b. Every element x|F|x\in|F| corresponds to a global section sx:LE(F)s_{x}\colon L\to E(F) given by sx1:ww(x)s_{x}^{-1}\colon w\mapsto w(x). This defines a B𝒥B_{\mathcal{J}}-set homomorphism since xbyx\equiv_{b}y implies, for all w𝒪Ew\in\mathcal{O}E that sy(w)b=w(y)b=w(b(x,y))b=(bw(x)¬bw(y))b=bw(x)s_{y}(w)\wedge b=w(y)\wedge b=w(b(x,y))\wedge b=(b\wedge w(x)\vee\neg b\wedge w(y))\wedge b=b\wedge w(x), i.e., that sxbsys_{x}\equiv_{b}s_{y}. Moreover, this assignment is injective by the injectivity of xx^x\mapsto\hat{x} (lemma 2.21).

On the other hand, to see that this assignment is surjective, notice that a global section ss given by a frame homomorphism s1:𝒪E(F)𝒪Ls^{-1}\colon\mathcal{O}E(F)\to\mathcal{O}L induces a map C:xs1(x^):|F|𝒪LC\colon x\mapsto s^{-1}(\hat{x})\colon|F|\to\mathcal{O}L. The image of this map covers 𝒪L\mathcal{O}L because when we take all the opens x^\hat{x} together, they cover 𝒪E(F)\mathcal{O}E(F). Since LL is ultraparacompact, we can refine CC to an (extended) partition P:|F|𝒪LP\colon|F|\to\mathcal{O}L (not uniquely, but we don’t care which one we choose). This yields an element p|F|p\in|F| by taking the amalgamation p:=P[|F|](λb.P1b)p:=P[|F|]^{-}(\lambda b.P^{-1}b). The element pp induces the section sps_{p}, so to see that sp=ss_{p}=s:

sp1(w)=\displaystyle s^{-1}_{p}(w)= w(p)=w(P[|F|](λb.P1b))\displaystyle\;w(p)=w(P[|F|]^{-}(\lambda b.P^{-1}b))
=\displaystyle= bPbw(P1b)=x|F|P(x)w(x)\displaystyle\bigvee_{b\in P}b\wedge w(P^{-1}b)=\bigvee_{x\in|F|}P(x)\wedge w(x)
=\displaystyle= x|F|C(x)w(x)=x|F|s1(x^)w(x)=s1(w)\displaystyle\bigvee_{x\in|F|}C(x)\wedge w(x)=\bigvee_{x\in|F|}s^{-1}(\hat{x})\wedge w(x)=s^{-1}(w)

whereby the last equality follows from lemma 2.21.

A.3 Proof of proposition 2.23

Given a germ [x]p[x]_{p}, we can define a point q𝗉𝗍E(F)𝖲𝖾𝗍B𝒥(F,L)𝒪1q\in\operatorname{\mathsf{pt}}E(F)\cong\mathsf{Set}_{B_{\mathcal{J}}}(F,L)\to\mathcal{O}1 by letting q(w)=q(w)=\top iff pw(x)p\in w(x). This is coherent with respect to the choice of xx, because if xpyx\equiv_{p}y then xbyx\equiv_{b}y for some bpb\ni p, so w(x)bw(y)w(x)\equiv_{b}w(y) which entails bw(x)=bw(y)b\wedge w(x)=b\wedge w(y) by definition. But then pw(x)pbw(x)pbw(y)pw(y)p\in w(x)\iff p\in b\wedge w(x)\iff p\in b\wedge w(y)\iff p\in w(y).

On the other hand, suppose we have a point q:1E(F)q\colon 1\to E(F). This defines a subset q^|F|={x|qx^}\hat{q}\subseteq|F|=\set{x}{q\in\hat{x}}, which has to be non-empty because otherwise qx^q\not\in\hat{x} for all x|F|x\in|F|, and hence q1()=x|F|q1(x^)=q^{-1}(\top)=\bigvee_{x\in|F|}q^{-1}(\hat{x})=\bot contradicting q1q^{-1} being a frame homomorphism. qq also induces a point p:=σqp:=\sigma q, and the germ induced by qq is [x]p[x]_{p} for any xq^x\in\hat{q}. This is coherent: for any x,yq^x,y\in\hat{q} we have qx^y^q\in\hat{x}\wedge\hat{y}, but by lemma 2.21 there is some z|F|z\in|F| such that qz^q\in\hat{z} and p(x^y^)(z)p\in(\hat{x}\wedge\hat{y})(z). Then

p(x^y^)(z)\displaystyle p\in(\hat{x}\wedge\hat{y})(z) p{bb|xbz,zby}\displaystyle\iff p\in\set{b\wedge b^{\prime}}{x\equiv_{b}z,z\equiv_{b^{\prime}}y}
bbp.xbbz and zbby\displaystyle\implies\exists b\wedge b^{\prime}\ni p.x\equiv_{b\wedge b^{\prime}}z\text{ and }z\equiv_{b\wedge b^{\prime}}y
b′′p.xb′′y\displaystyle\implies\exists b^{\prime\prime}\ni p.x\equiv_{b}^{\prime\prime}y
xpy\displaystyle\iff x\equiv_{p}y

From here it is a routine unfolding of definitions to see that a germ induces itself by going back-and-forth. On the other hand, given a point qq, going forth-and-back produces point qq^{\prime} with qwq^{\prime}\in w iff q𝖼𝗈𝗇𝗌𝗍w(x)q\in\mathsf{const}_{w(x)} for some xq^x\in\hat{q} iff qxx^𝖼𝗈𝗇𝗌𝗍w(x)=wq\in\bigvee_{x}\hat{x}\wedge\mathsf{const}_{w(x)}=w, and hence q=qq^{\prime}=q.

The subbasic opens [x|b][x|b] on the set of germs is induced by the opens x^𝖼𝗈𝗇𝗌𝗍b\hat{x}\wedge\mathsf{const}_{b}, which generate all other opens by lemma 2.21.

A.4 Proof of proposition 3.3

We first check that \llparenthesis{-}\rrparenthesis respects >>=\mathbin{>\mkern-6.8mu>\mkern-6.9mu=} and 𝗋𝖾𝗍𝗎𝗋𝗇\operatorname{\mathsf{return}}, making 𝖫𝖡0T\mathsf{LB}_{0}T a comodel. For >>=\mathbin{>\mkern-6.8mu>\mkern-6.9mu=} we have

t>>=u1b0[t0]\displaystyle\llparenthesis{t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u}\rrparenthesis^{-1}\braket{b_{0}\mapsto[t_{0}]}
=\displaystyle= [t>>=ub0][t>>=u>>t0]\displaystyle[t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u\mapsto b_{0}]\wedge[t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u\mathbin{>\mkern-6.9mu>}t_{0}] by definition of t>>=u\displaystyle\text{by definition of }\llparenthesis{t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u}\rrparenthesis
=\displaystyle= aA[ta][t>>u(a)b0][t>>u(a)>>t0]\displaystyle\bigvee_{a\in A}[t\mapsto a]\wedge[t\mathbin{>\mkern-6.9mu>}u(a)\mapsto b_{0}]\wedge[t\mathbin{>\mkern-6.9mu>}u(a)\mathbin{>\mkern-6.9mu>}t_{0}]\qquad apply (𝖫𝖡0\mathsf{LB}_{0}-μ\mu) twice, and simplify
=\displaystyle= a([ta][t>>u(a)b0])([ta][t>>u(a)>>t0])\displaystyle\bigvee_{a}([t\mapsto a]\wedge[t\mathbin{>\mkern-6.9mu>}u(a)\mapsto b_{0}])\wedge([t\mapsto a]\wedge[t\mathbin{>\mkern-6.9mu>}u(a)\mathbin{>\mkern-6.9mu>}t_{0}])\qquad
=\displaystyle= at1a[u(a)b0]t1a[u(a)>>t0]\displaystyle\bigvee_{a}\llparenthesis{t}\rrparenthesis^{-1}\braket{a\mapsto[u(a)\mapsto b_{0}]}\wedge\llparenthesis{t}\rrparenthesis^{-1}\braket{a\mapsto[u(a)\mathbin{>\mkern-6.9mu>}t_{0}]} by definition of t\displaystyle\text{by definition of }\llparenthesis{t}\rrparenthesis
=\displaystyle= t1aa[u(a)b0][u(a)>>t0]\displaystyle\llparenthesis{t}\rrparenthesis^{-1}\bigvee_{a}\braket{a\mapsto[u(a)\mapsto b_{0}]\wedge[u(a)\mathbin{>\mkern-6.9mu>}t_{0}]} by definition of u\displaystyle\text{by definition of }\llparenthesis{u}\rrparenthesis
=\displaystyle= t1u1b0[t0],\displaystyle\llparenthesis{t}\rrparenthesis^{-1}\llparenthesis{u}\rrparenthesis^{-1}\braket{b_{0}\mapsto[t_{0}]},

whereas for 𝗋𝖾𝗍𝗎𝗋𝗇\operatorname{\mathsf{return}}, we compute

𝗋𝖾𝗍𝗎𝗋𝗇aa0[t0]=[𝗋𝖾𝗍𝗎𝗋𝗇aa0][𝗋𝖾𝗍𝗎𝗋𝗇a>>t0]={[t0]if a=a0otherwise,\llparenthesis{\operatorname{\mathsf{return}}a}\rrparenthesis\braket{a_{0}\mapsto[t_{0}]}=[\operatorname{\mathsf{return}}a\mapsto a_{0}]\wedge[\operatorname{\mathsf{return}}a\mathbin{>\mkern-6.9mu>}t_{0}]=\begin{cases}[t_{0}]&\text{if }a=a_{0}\\ \bot&\text{otherwise,}\end{cases}

but this is just υa\upsilon_{a}. Next, we show that this comodel is terminal, so let LL be an arbitrary localic comodel. If a map h:L𝖫𝖡0Th\colon L\to\mathsf{LB}_{0}T exists, then hh being a comodel map implies h1[t0]=h1t011=t0L1(2h)11=t0L11h^{-1}[t_{0}]=h^{-1}\llparenthesis{t_{0}}\rrparenthesis^{-1}\braket{1\mapsto\top}=\llparenthesis{t_{0}}\rrparenthesis_{L}^{-1}(2\cdot h)^{-1}\braket{1\mapsto\top}=\llparenthesis{t_{0}}\rrparenthesis_{L}^{-1}\braket{1\mapsto\top}, and hence this uniquely determines hh. We leave the verification that this map is well-defined as an exercise to the reader.

A.5 Proof of correspondence for example 3.4

Definition A.1.

The locale of injective functions \mathbb{R}\rightarrowtail\mathbb{N} is presented by generators xn\braket{x\mapsto n} for xx\in\mathbb{R} and nn\in\mathbb{N}, required to satisfy, for xyx\neq y and mnm\neq n, the equations

xxn=xnxm=xnyn=\bigvee_{x\in\mathbb{R}}\braket{x\mapsto n}=\top\qquad\braket{x\mapsto n}\wedge\braket{x\mapsto m}=\bot\qquad\braket{x\mapsto n}\wedge\braket{y\mapsto n}=\bot

We must prove that this presentation is bi-interpretable with the behaviour locale of injective state. In one direction, the generator xn\braket{x\mapsto n} is interpreted as [𝗀𝖾𝗍xn][\mathsf{get}_{x}\mapsto n], in which case the first two axioms straightforwardly follow. The third axiom can be proven as follows:

[𝗀𝖾𝗍xn][𝗀𝖾𝗍yn]\displaystyle[\mathsf{get}_{x}\mapsto n]\wedge[\mathsf{get}_{y}\mapsto n]
=\displaystyle=~ [𝗀𝖾𝗍xn][𝗀𝖾𝗍x>>𝗀𝖾𝗍yn]\displaystyle[\mathsf{get}_{x}\mapsto n]\wedge[\mathsf{get}_{x}\mathbin{>\mkern-6.9mu>}\mathsf{get}_{y}\mapsto n]
=\displaystyle=~ [𝗀𝖾𝗍x>>=λm1.𝗀𝖾𝗍y>>=λm2.𝗋𝖾𝗍𝗎𝗋𝗇(m1,m2)(n,n)]\displaystyle[\mathsf{get}_{x}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda m_{1}.\mathsf{get}_{y}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda m_{2}.\operatorname{\mathsf{return}}(m_{1},m_{2})\mapsto(n,n)]
=\displaystyle=~ [𝗀𝖾𝗍x>>=λm1.𝗀𝖾𝗍y>>=λm2.𝗋𝖾𝗍𝗎𝗋𝗇(m1=?n=?m2)]\displaystyle[\mathsf{get}_{x}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda m_{1}.\mathsf{get}_{y}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda m_{2}.\operatorname{\mathsf{return}}(m_{1}\overset{?}{=}n\overset{?}{=}m_{2})]
=\displaystyle=~ [𝗀𝖾𝗍x>>=λm1.𝗀𝖾𝗍y>>=λm2.𝗋𝖾𝗍𝗎𝗋𝗇0]\displaystyle[\mathsf{get}_{x}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda m_{1}.\mathsf{get}_{y}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda m_{2}.\operatorname{\mathsf{return}}0] (by injectivity eqn)
=\displaystyle=~ [𝗋𝖾𝗍𝗎𝗋𝗇0]=\displaystyle[\operatorname{\mathsf{return}}0]=\bot

In the other direction, by recursion we define a map hh interpreting the generators of the behaviour locale:

h:[𝗋𝖾𝗍𝗎𝗋𝗇0][𝗋𝖾𝗍𝗎𝗋𝗇1][𝗀𝖾𝗍x>>=λn.tn]nxnh([tn])h\colon[\operatorname{\mathsf{return}}0]\mapsto\bot\qquad[\operatorname{\mathsf{return}}1]\mapsto\top\qquad[\mathsf{get}_{x}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda n.t_{n}]\mapsto\bigvee_{n\in\mathbb{N}}\braket{x\mapsto n}\wedge h([t_{n}])

We leave the reader to verify that this respects the usual equations satisfied by terms in the theory of state. As an example, we will verify just the injectivity equation from example 3.4:

h[𝗀𝖾𝗍x>>=λn.𝗀𝖾𝗍y>>=λm.𝗋𝖾𝗍𝗎𝗋𝗇f(n,m)(n0,m0)]\displaystyle h[\mathsf{get}_{x}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda n.\mathsf{get}_{y}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda m.\operatorname{\mathsf{return}}f(n,m)\mapsto(n_{0},m_{0})]
=\displaystyle= nmxnymf(n,m)=?(n0,m0)\displaystyle\bigvee_{n}\bigvee_{m}\braket{x\mapsto n}\wedge\braket{y\mapsto m}\wedge f(n,m)\overset{?}{=}(n_{0},m_{0})
=\displaystyle= (nmxnym(n,m)=?(n0,m0))nxnynf(n,m)=?(n0,m0)\displaystyle\left(\bigvee_{n\neq m}\braket{x\mapsto n}\wedge\braket{y\mapsto m}\wedge(n,m)\overset{?}{=}(n_{0},m_{0})\right)\vee\bigvee_{n}\braket{x\mapsto n}\wedge\braket{y\mapsto n}\wedge f(n,m)\overset{?}{=}(n_{0},m_{0})  property of f\displaystyle\text{ property of }f
=\displaystyle= (nmxnym(n,m)=?(n0,m0))\displaystyle\left(\bigvee_{n\neq m}\braket{x\mapsto n}\wedge\braket{y\mapsto m}\wedge(n,m)\overset{?}{=}(n_{0},m_{0})\right)\vee\bot by def. A.1
=\displaystyle= (nmxnym(n,m)=?(n0,m0))n(n,m)=?(n0,m0)\displaystyle\left(\bigvee_{n\neq m}\braket{x\mapsto n}\wedge\braket{y\mapsto m}\wedge(n,m)\overset{?}{=}(n_{0},m_{0})\right)\vee\bigvee_{n}\bot\wedge(n,m)\overset{?}{=}(n_{0},m_{0})
=\displaystyle= (nmxnym(n,m)=?(n0,m0))nxnyn(n,m)=?(n0,m0)\displaystyle\left(\bigvee_{n\neq m}\braket{x\mapsto n}\wedge\braket{y\mapsto m}\wedge(n,m)\overset{?}{=}(n_{0},m_{0})\right)\vee\bigvee_{n}\braket{x\mapsto n}\wedge\braket{y\mapsto n}\wedge(n,m)\overset{?}{=}(n_{0},m_{0})
=\displaystyle= nmxnym(n,m)=?(n0,m0)\displaystyle\bigvee_{n}\bigvee_{m}\braket{x\mapsto n}\wedge\braket{y\mapsto m}\wedge(n,m)\overset{?}{=}(n_{0},m_{0})
=\displaystyle= h[𝗀𝖾𝗍x>>=λn.𝗀𝖾𝗍y>>=λm.𝗋𝖾𝗍𝗎𝗋𝗇(n,m)(n0,m0)]\displaystyle h[\mathsf{get}_{x}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda n.\mathsf{get}_{y}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda m.\operatorname{\mathsf{return}}(n,m)\mapsto(n_{0},m_{0})]

Finally, hh respects the equations of the behaviour locale: for all three axioms (𝖫𝖡0\mathsf{LB}_{0}-\bot), (𝖫𝖡0\mathsf{LB}_{0}-η\eta), and (𝖫𝖡0\mathsf{LB}_{0}-μ\mu) it follows by a straightforward induction on the syntax of tt.

A.6 Proof of proposition 3.5

We follow a similar line of argument to [16, Section 2]. First, notice that we can construct 𝖫𝖡0T\mathsf{LB}_{0}T in two steps. Begin by constructing the meet semi-lattice 𝖬𝖡𝟢𝖳\mathsf{MB_{0}T} generated by opens [b][b] subject to equations [t>>𝗋𝖾𝗍𝗎𝗋𝗇aa]=[t\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a\mapsto a]=\top and [ta][t>>=ub]=[ta][t>>u(a)b][t\mapsto a]\wedge[t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u\mapsto b]=[t\mapsto a]\wedge[t\mathbin{>\mkern-6.9mu>}u(a)\mapsto b]. Then we can generate the frame 𝒪𝖫𝖡0T\mathcal{O}\mathsf{LB}_{0}T from 𝖬𝖡0T\mathsf{MB}_{0}T subject to the equations [ta][ta]=[t\mapsto a]\wedge[t\mapsto a^{\prime}]=\bot and aA[ta]=\bigvee_{a\in A}[t\mapsto a]=\top. Following [17, II 2.11], this can be presented as a covering system instead. The covering system 𝒥\mathcal{J} is generated by the following rules:

  tTA,aaA   J([ta][ta]) \displaystyle\displaystyle{\hbox{\hskip 39.19374pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle t\in TA,a\neq a^{\prime}\in A$}}}\vbox{}}}\over\hbox{\hskip 40.64687pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\emptyset\in\mathcal{J}([t\mapsto a]\wedge[t\mapsto a^{\prime}])$}}}}}}  tTA   {[ta]|aA}J() \displaystyle\displaystyle{\hbox{\qquad\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle t\in TA$}}}\vbox{}}}\over\hbox{\hskip 46.46631pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\set{[t\mapsto a]}{a\in A}\in\mathcal{J}(\top)$}}}}}}  {u}J(u) \displaystyle\displaystyle{\hbox{}\over\hbox{\hskip 20.5163pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\set{u}\in\mathcal{J}(u)$}}}}}}    JJ(u)   {jv|jJ}J(uv) \displaystyle\displaystyle{\hbox{\qquad\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle J\in\mathcal{J}(u)$}}}\vbox{}}}\over\hbox{\hskip 53.30374pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\set{j\wedge v}{j\in J}\in\mathcal{J}(u\wedge v)$}}}}}}  JJ(u)KjJ(j)jJ   jJKjJ(u) \displaystyle\displaystyle{\hbox{\hskip 60.0761pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle J\in\mathcal{J}(u)\quad K_{j}\in\mathcal{J}(j)\;\;\forall j\in J$}}}\vbox{}}}\over\hbox{\hskip 31.70851pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\bigcup_{j\in J}K_{j}\in\mathcal{J}(u)$}}}}}}

Notice that the three base cases are pairwise-disjoint covers, and the inductive cases preserve the pairwise-disjoint property. Hence all the covers in this system are pairwise-disjoint. The frame presented by this system consists of all the 𝒥\mathcal{J}-ideals, i.e., downwards closed subsets I𝖬𝖡0TI\subseteq\mathsf{MB}_{0}T such that for any J𝒥(u)J\in\mathcal{J}(u), JIJ\subseteq I implies uIu\in I. For any subset S𝖬𝖡0TS\subseteq\mathsf{MB}_{0}T, the smallest 𝒥\mathcal{J}-ideal containing SS is S¯={u𝖬𝖡0T|J𝒥(u).JS}\overline{S}=\set{u\in\mathsf{MB}_{0}T}{\exists J\in\mathcal{J}(u).J\subseteq S}, and the join of a family of 𝒥\mathcal{J}-ideals {Ik}k\set{I_{k}}_{k} is the kIk¯\overline{\bigcup_{k}I_{k}}. Also, every u𝖬𝖡0Tu\in\mathsf{MB}_{0}T induces an ideal u\downarrow u.

We now prove that every open cover is refined by a partition, so consider an open cover {Ik}k\set{I_{k}}_{k}. It is covering iff kIk¯\top\in\overline{\bigcup_{k}I_{k}} iff there is J𝒥()J\in\mathcal{J}(\top) such that JkIkJ\subseteq\bigcup_{k}I_{k}. But if we now consider the family {j|jJ}\set{\downarrow j}{j\in J}, then this is precisely a partition (pairwise-disjoint because JJ is) refining {Ik}k\set{I_{k}}_{k}.

A.7 Proof of lemma 3.10

First, for self-containedness we lay out precisely the definition of B𝒥B_{\mathcal{J}}-congruence.

Definition A.2.

Let XX be a B𝒥B_{\mathcal{J}}-set. An equivalence relation X×X\mathop{\approx}\subseteq X\times X is a B𝒥B_{\mathcal{J}}-set congruence if for every partition P𝒥P\in\mathcal{J}, and two families x,x:PXx,x^{\prime}\colon P\to X such that for each bb, xbxbx_{b}\approx x^{\prime}_{b}, we have

P(x)RP(x).P(x)~R~P(x^{\prime}).

Given a set of pairs GX×XG\subseteq X\times X, The congruence G\approx_{G} generated by GG is given by the following inference rules

gen   (x1,x2)G   Gx1x2 \displaystyle\displaystyle{\hbox{\hskip 26.43504pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle(x_{1},x_{2})\in G$}}}\vbox{}}}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{1}\approx_{G}x_{2}$}}}}}}    refl   xX   Gxx \displaystyle\displaystyle{\hbox{\qquad\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x\in X$}}}\vbox{}}}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x\approx_{G}x$}}}}}}    trans   Gx1x2  Gx2x3   Gx1x3 \displaystyle\displaystyle{\hbox{\hskip 45.12875pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{1}\approx_{G}x_{2}$}\hskip 20.44434pt\hbox{\hbox{$\displaystyle\displaystyle x_{2}\approx_{G}x_{3}$}}}}\vbox{}}}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{1}\approx_{G}x_{3}$}}}}}}    symm   Gx1x2   Gx2x1 \displaystyle\displaystyle{\hbox{\qquad\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{1}\approx_{G}x_{2}$}}}\vbox{}}}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{2}\approx_{G}x_{1}$}}}}}}    cong-P\displaystyle P   GxbxbbP   GP(x)P(x) \displaystyle\displaystyle{\hbox{\hskip 37.23102pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{b}\approx_{G}x^{\prime}_{b}\quad\forall b\in P$}}}\vbox{}}}\over\hbox{\hskip 31.3765pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle P(x)\approx_{G}P(x^{\prime})$}}}}}}

We also define G\rightsquigarrow_{G} as the relation derivable by exactly one use of gen, any use of cong-PP for any finite partition PP, and any use of refl.

If 𝒥\mathcal{J} only contains finite partitions, then the algebraic theory of B𝒥B_{\mathcal{J}}-sets only has finite operations and we can easily show that G\approx_{G} is the symmetric transitive closure of G\rightsquigarrow_{G}. However, if 𝒥\mathcal{J} has infinite partitions, then this is no longer the case, but we can still prove that G\approx_{G} is always derivable by one congruence applied to Gω\leftrightsquigarrow_{G}^{\omega}, i.e., the transitive symmetric closure of the relation G\rightsquigarrow_{G}.

Lemma A.3.

If x1Gx2x_{1}\rightsquigarrow_{G}x_{2}, then this can be derived with exactly one application of the cong rule.

Proof A.4.

By induction on derivation of x1Gx2x_{1}\rightsquigarrow_{G}x_{2}. In the base case, we clearly have zero applications, but we can add an application of the cong rule over the one-element partition {}\set{\top}. In the inductive case, we have a derivation which looks like

  GxbybbP   GP(x)P(y) .\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\hskip 38.72084pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{b}\rightsquigarrow_{G}y_{b}\quad\forall b\in P$}}}\vbox{}}}\over\hbox{\hskip 30.85799pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle P(x)\rightsquigarrow_{G}P(y)$}}}}}}$}}.

By the inductive hypothesis, each subderivation of xbGybx_{b}\rightsquigarrow_{G}y_{b} can be rewritten to use exactly one cong rule, so each subderivation is associated with a partition QbQ_{b}, defining a map Q:P𝒥Q\colon P\to\mathcal{J}. The derivation now looks like the derivation on the left-hand side below, which is derivable as on the right-hand side.

cong  cong      gen or refl     Gxcbycb cQb          xb=Qb(λc.xcb)GQb(λc.ycb)=yb bP   GP(x)P(y) \displaystyle\displaystyle{\hbox{\hskip 97.87094pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\raise 5.0pt\hbox{\hbox to0.0pt{\hss$\displaystyle\hbox{\small\small{cong}}\;$}$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\hskip 42.64134pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\raise 4.54362pt\hbox{\hbox to0.0pt{\hss$\displaystyle\hbox{\small\small{gen or refl}}\;$}$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\enskip\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\ldots$}}}\vbox{}}}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x^{c}_{b}\rightsquigarrow_{G}y^{c}_{b}$}}}}}}$}}\hbox{}$ }\quad\forall c\in Q_{b}$}}}\vbox{}}}\over\hbox{\hskip 75.22932pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{b}=Q_{b}(\lambda c.x^{c}_{b})\rightsquigarrow_{G}Q_{b}(\lambda c.y^{c}_{b})=y_{b}$}}}}}}$}}\hbox{}$ }\quad\forall b\in P$}}}\vbox{}}}\over\hbox{\hskip 30.85799pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle P(x)\rightsquigarrow_{G}P(y)$}}}}}}      cong  gen or refl     Gxcbycb (bc)P;Q   P;Q(λbc.xcb)GP;Q(λbc.ycb) \displaystyle\displaystyle{\hbox{\hskip 57.56604pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\raise 4.54362pt\hbox{\hbox to0.0pt{\hss$\displaystyle\hbox{\small\small{gen or refl}}\;$}$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\enskip\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\ldots$}}}\vbox{}}}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x^{c}_{b}\rightsquigarrow_{G}y^{c}_{b}$}}}}}}$}}\hbox{}$ }\quad\forall(b\wedge c)\in P;Q$}}}\vbox{}}}\over\hbox{\hskip 77.46252pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle P;Q(\lambda b\wedge c.x^{c}_{b})\rightsquigarrow_{G}P;Q(\lambda b\wedge c.y^{c}_{b})$}}}}}}

The right-hand derivation uses only one cong, concluding the proof.

Lemma A.5.

If x1Gx2x_{1}\approx_{G}x_{2} then this is derivable by a derivation of the form

cong      ωGxbyb bP   x1=P(x)P(y)=x2 \displaystyle\displaystyle{\hbox{\hskip 41.86006pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\raise 4.54362pt\hbox{$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\enskip\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\vdots$}}}\vbox{}}}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{b}\leftrightsquigarrow^{\omega}_{G}y_{b}$}}}}}}$}}\hbox{}$ }\quad\forall b\in P$}}}\vbox{}}}\over\hbox{\hskip 50.04196pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{1}=P(x)\approx P(y)=x_{2}$}}}}}}
Proof A.6.

By induction on the derivation of x1Gx2x_{1}\approx_{G}x_{2}. The base cases and the inductive cases for symm and cong-PP are easy, so we only work out the case for trans. By induction hypothesis we know that our derivation will look like

trans  =cong          Δxb     ωGxbxb bP      GP(x)P(x) cong          Δyc     ωGycyc cQ      GQ(y)Q(y) P(x)Q(y)   x1=P(x)GQ(y)=x2 \displaystyle\displaystyle{\hbox{\hskip 156.839pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\raise 5.25891pt\hbox{\hbox to0.0pt{\hss$\displaystyle\hbox{\small\small{cong}}\;$}$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\hskip 41.48135pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\raise 4.75891pt\hbox{$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\quad\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\vdots^{\Delta^{x}_{b}}$}}}\vbox{}}}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{b}\leftrightsquigarrow^{\omega}_{G}x^{\prime}_{b}$}}}}}}$}}\hbox{}$ }\quad\forall b\in P$}}}\vbox{}}}\over\hbox{\hskip 31.3765pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle P(x)\approx_{G}P(x^{\prime})$}}}}}}$}}\hbox{}$ }\qquad\qquad\raise 5.25891pt\hbox{\hbox to0.0pt{\hss$\displaystyle\hbox{\small\small{cong}}\;$}$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\hskip 41.12242pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\raise 4.98112pt\hbox{$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\quad\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\vdots^{\Delta^{y}_{c}}$}}}\vbox{}}}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle y^{\prime}_{c}\leftrightsquigarrow^{\omega}_{G}y_{c}$}}}}}}$}}\hbox{}$ }\quad\forall c\in Q$}}}\vbox{}}}\over\hbox{\hskip 31.01933pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle Q(y^{\prime})\approx_{G}Q(y)$}}}}}}$}}\hbox{}$ }\qquad\qquad P(x^{\prime})=Q(y^{\prime})$}}}\vbox{}}}\over\hbox{\hskip 52.0335pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{1}=P(x)\approx_{G}Q(y)=x_{2}$}}}}}}

We can re-arrange this into the following derivation,

cong  trans                      =cong         Δxb     ωGxbxb    G refl         G(bc)(xb,)(bc)(xb,) cong          Δyc     ωGycyc    G refl         G(bc)(yc,)(bc)(yc,) (bc)(xb,)(bc)(yc,)                   G(bc)(xb,)(bc)(yc,)bcP;Q   P;Q(λbc.(bc)(xb,)GP;Q(λbc.(bc)(yc,) \displaystyle\displaystyle{\hbox{\hskip 211.92078pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\raise 5.0pt\hbox{\hbox to0.0pt{\hss$\displaystyle\hbox{\small\small{trans}}\;$}$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\hskip 210.1319pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\raise 5.25891pt\hbox{\hbox to0.0pt{\hss$\displaystyle\hbox{\small\small{cong}}\;$}$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\hskip 40.80518pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\raise 4.75891pt\hbox{$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\quad\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\vdots^{\Delta^{x}_{b}}$}}}\vbox{}}}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{b}\leftrightsquigarrow^{\omega}_{G}x^{\prime}_{b}$}}}}}}$}}\hbox{}$ }\quad\raise 3.1656pt\hbox{$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle*\approx_{G}*$}}}}}}$}}\hbox{\hbox{}\hbox to0.0pt{$\displaystyle\;\hbox{\small\small{refl}}$\hss}}$ }$}}}\vbox{}}}\over\hbox{\hskip 60.96039pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle(b\wedge c)(x_{b},*)\approx_{G}(b\wedge c)(x^{\prime}_{b},*)$}}}}}}$}}\hbox{}$ }\qquad\quad\raise 5.25891pt\hbox{\hbox to0.0pt{\hss$\displaystyle\hbox{\small\small{cong}}\;$}$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\hskip 41.01413pt\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\raise 4.98112pt\hbox{$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{\quad\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\vdots^{\Delta^{y}_{c}}$}}}\vbox{}}}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle y_{c}^{\prime}\leftrightsquigarrow^{\omega}_{G}y_{c}$}}}}}}$}}\hbox{}$ }\quad\raise 3.1656pt\hbox{$\displaystyle{\hbox{$\displaystyle\displaystyle{\hbox{}\over\hbox{\qquad\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle*\approx_{G}*$}}}}}}$}}\hbox{\hbox{}\hbox to0.0pt{$\displaystyle\;\hbox{\small\small{refl}}$\hss}}$ }$}}}\vbox{}}}\over\hbox{\hskip 61.16936pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle(b\wedge c)(y_{c}^{\prime},*)\approx_{G}(b\wedge c)(y_{c},*)$}}}}}}$}}\hbox{}$ }\qquad(b\wedge c)(x_{b}^{\prime},*)=(b\wedge c)(y_{c}^{\prime},*)$}}}\vbox{}}}\over\hbox{\hskip 154.8739pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle(b\wedge c)(x_{b},*)\approx_{G}(b\wedge c)(y_{c},*)\qquad\qquad\qquad\qquad\qquad\qquad\;\;\forall b\wedge c\in P;Q$}}}}}}$}}\hbox{}$ }$}}}\vbox{}}}\over\hbox{\hskip 115.59637pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle P;Q(\lambda b\wedge c.(b\wedge c)(x_{b},*)\approx_{G}P;Q(\lambda b\wedge c.(b\wedge c)(y_{c},*)$}}}}}}

where * is allowed to be any element of the B𝒥B_{\mathcal{J}}-set XX (if XX is empty the theorem is vacuously true anyway). Here, the equality (bc)(xb,)=(bc)(yc,)(b\wedge c)(x_{b}^{\prime},*)=(b\wedge c)(y_{c}^{\prime},*) follows from P(x)=Q(y)P(x^{\prime})=Q(y^{\prime}), since (bc)(P(x),)=c(b(P(x),),)=c(b(b(P(x),xb),),)=c(b(xb,),)=(bc)(xb,)(b\wedge c)(P(x^{\prime}),*)=c(b(P(x^{\prime}),*),*)=c(b(b(P(x^{\prime}),x^{\prime}_{b}),*),*)=c(b(x^{\prime}_{b},*),*)=(b\wedge c)(x^{\prime}_{b},*) and similarly (bc)(Q(y),)=(bc)(yc,)(b\wedge c)(Q(y^{\prime}),*)=(b\wedge c)(y^{\prime}_{c},*).

Now, we see on the lefthand-side that P(x)=P;Q(λbc.xb)=P;Q(λbc.(bc)(xb,))P(x)=P;Q(\lambda b\wedge c.x_{b})=P;Q(\lambda b\wedge c.(b\wedge c)(x_{b},*)), and similarly for Q(y)Q(y) on the righthand-side. Each of the derivations of (bc)(xb,)G(bc)(yc,)(b\wedge c)(x_{b},*)\approx_{G}(b\wedge c)(y_{c},*) only uses finite congruences, so can be re-arranged into derivations of (bc)(xb,)Gω(bc)(yc,)(b\wedge c)(x_{b},*)\leftrightsquigarrow^{\omega}_{G}(b\wedge c)(y_{c},*), which concludes this inductive case and hence the proof.

Now let GG be the generating equation of definition 3.7, and for which we will omit the subscript from this point on. The proof of the actual lemma proceeds in two steps. We first prove lemma A.7, which is the version of lemma 3.10 for Gω\rightsquigarrow^{\omega}_{G} (which actually suffices to prove lemma 3.10 in the case where 𝒥\mathcal{J} is finitary), and then prove the statement for \approx.

Lemma A.7.

For any x,yT1[B]𝒥x,y\in T1[B]^{\mathcal{J}}, if xωyx\leftrightsquigarrow^{\omega}y then for each m,nT1m,n\in T1, we have mx(m)y(n)nm\sim_{x(m)\wedge y(n)}n.

Proof A.8.

A derivation of xωyx\leftrightsquigarrow^{\omega}y is a (composable) chain of either \rightsquigarrow or \mathrel{\mathchoice{\reflectbox{$\displaystyle\rightsquigarrow$}}{\reflectbox{$\textstyle\rightsquigarrow$}}{\reflectbox{$\scriptstyle\rightsquigarrow$}}{\reflectbox{$\scriptscriptstyle\rightsquigarrow$}}} derivations, e.g. x=x0x1x2x3x4xk=yx=x_{0}\rightsquigarrow x_{1}\mathrel{\mathchoice{\reflectbox{$\displaystyle\rightsquigarrow$}}{\reflectbox{$\textstyle\rightsquigarrow$}}{\reflectbox{$\scriptstyle\rightsquigarrow$}}{\reflectbox{$\scriptscriptstyle\rightsquigarrow$}}}x_{2}\rightsquigarrow x_{3}\rightsquigarrow x_{4}\mathrel{\mathchoice{\reflectbox{$\displaystyle\rightsquigarrow$}}{\reflectbox{$\textstyle\rightsquigarrow$}}{\reflectbox{$\scriptstyle\rightsquigarrow$}}{\reflectbox{$\scriptscriptstyle\rightsquigarrow$}}}\ldots\rightsquigarrow x_{k}=y (arrow directions non-indicative). Each such derivation xixi+1x_{i}\rightsquigarrow x_{i+1}, by lemma A.3, can be rewritten with exactly one cong rule over an associated partition RR. This means that the derivation looks like

    xi=R(h)R(h)=x+i1 \displaystyle\displaystyle{\hbox{\enskip\vbox{\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle\vdots$}}}\vbox{}}}\over\hbox{\hskip 56.59578pt\vbox{\vbox{}\hbox{\thinspace\hbox{\hbox{$\displaystyle\displaystyle x_{i}=R(h)\rightsquigarrow R(h^{\prime})=x_{i+1}$}}}}}}

where for a unique b0Rb_{0}\in R, we have hb0=t>>=uh_{b_{0}}=t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u and hb0=P(t)(λa.t>>u(a))h^{\prime}_{b_{0}}=P^{(t)}(\lambda a.t\mathbin{>\mkern-6.9mu>}u(a)) and for bb0Rb\neq b_{0}\in R, we have hb=hbh_{b}=h^{\prime}_{b}. Associate to xix_{i} the partition Pi:=RP^{\leftarrow}_{i}:=R, and to xi+1x_{i+1} the partition

Pi+1:=R>>=λb.{P(t)if b=b0{}otherwise.P^{\rightarrow}_{i+1}:=R\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda b.\begin{cases}P^{(t)}&\text{if }b=b_{0}\\ \set{\top}&\text{otherwise.}\end{cases}

For a derivation xixi+1x_{i}\mathrel{\mathchoice{\reflectbox{$\displaystyle\rightsquigarrow$}}{\reflectbox{$\textstyle\rightsquigarrow$}}{\reflectbox{$\scriptstyle\rightsquigarrow$}}{\reflectbox{$\scriptscriptstyle\rightsquigarrow$}}}x_{i+1}, perform the opposite assignment. So each xix_{i} is then associated with two partitions PiP^{\rightarrow}_{i} and PiP^{\leftarrow}_{i}, except for x0x_{0} and xkx_{k}. For these, define P0:=PP^{\rightarrow}_{0}:=P and Pk:=QP^{\leftarrow}_{k}:=Q. Since there are finitely many of these partitions, we can take a common refinement—call this SS.

Consider dSd\in S. It refines a unique bPb\in P, which identifies the term td0:=tbt_{d}^{0}:=t_{b}. Now look at the first derivation, and suppose it is x0x1x_{0}\rightsquigarrow x_{1}. Then dd refines a unique cP1c\in P_{1}^{\rightarrow}. There are two possible cases:

  1. (1)

    Either cP0c\in P^{\leftarrow}_{0}, in which case we define td1:=td0t_{d}^{1}:=t_{d}^{0};

  2. (2)

    or c=c0[ta]c=c_{0}\wedge[t\mapsto a] for some c0P0c_{0}\in P^{\leftarrow}_{0}, in which case we know that td0t_{d}^{0} must be of the form t>>=ut\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u. So define td1=t>>u(a)t_{d}^{1}=t\mathbin{>\mkern-6.9mu>}u(a).

We note that in either case, we have td0dtd1t_{d}^{0}\sim_{d}t_{d}^{1}.

The other possibility is that x0x1x_{0}\mathrel{\mathchoice{\reflectbox{$\displaystyle\rightsquigarrow$}}{\reflectbox{$\textstyle\rightsquigarrow$}}{\reflectbox{$\scriptstyle\rightsquigarrow$}}{\reflectbox{$\scriptscriptstyle\rightsquigarrow$}}}x_{1}. Then dd refines a unique cP0c\in P_{0}^{\leftarrow}. There are two possible cases:

  1. (1)

    Either cP1c\in P^{\rightarrow}_{1}, in which case we define td1:=td0t_{d}^{1}:=t_{d}^{0};

  2. (2)

    or c=c0[ta]c=c_{0}\wedge[t\mapsto a] for some c0P1c_{0}\in P^{\rightarrow}_{1}, in which case we know that td0t_{d}^{0} must be of the form t>>u(a)t\mathbin{>\mkern-6.9mu>}u(a). So define td1=t>>=ut_{d}^{1}=t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u.

Now we may repeat this process, obtaining tb=td0dtd1ddtdkt_{b}=t_{d}^{0}\sim_{d}t_{d}^{1}\sim_{d}\ldots\sim_{d}t_{d}^{k}. Here, since dd refines some cQc\in Q, we have that tdk=sct_{d}^{k}=s_{c}. So we may conclude tbdsct_{b}\sim_{d}s_{c}. To finish the proof, we see that any bcPQb\wedge c\in P\wedge Q is a join of its refinements in SS, and since we show tbdsct_{b}\sim_{d}s_{c} for all of its refinements dd, we can conclude that tbbcsct_{b}\sim_{b\wedge c}s_{c}.

Finally, we prove lemma 3.10.

()(\implies) suppose x1x2T1[B]𝒥x_{1}\approx x_{2}\in T1[B]^{\mathcal{J}}. Then by lemma A.5, we know that x1=P(x)P(y)=x2x_{1}=P(x)\approx P(y)=x_{2} for some partition P𝒥P\in\mathcal{J} and families x,y:PT1[B]𝒥x,y\colon P\to T1[B]^{\mathcal{J}} such that for each bPb\in P, xbωybx_{b}\leftrightsquigarrow^{\omega}y_{b}. So by lemma A.7, we have mxb(m)yb(n)nm\sim_{x_{b}(m)\wedge y_{b}(n)}n for every m,nT1m,n\in T1. Now, recall from 2.18 that P(x)(m):=bPbxb(m)P(x)(m):=\bigvee_{b\in P}b\wedge x_{b}(m), so P(x)(m)P(y)(n)=bPbxb(m)yb(n)P(x)(m)\wedge P(y)(n)=\bigvee_{b\in P}b\wedge x_{b}(m)\wedge y_{b}(n). Hence P(x)(m)P(y)(n)mnP(x)(m)\wedge P(y)(n)\leq\llbracket{m\sim n}\rrbracket iff for all bPb\in P, bxb(m)yb(n)mnb\wedge x_{b}(m)\wedge y_{b}(n)\leq\llbracket{m\sim n}\rrbracket, which we have.

()(\impliedby) Suppose mx1(m)x2(n)nm\sim_{x_{1}(m)\wedge x_{2}(n)}n for each m,nT1m,n\in T1. Let P={x1(m)x2(n)|m,nT1}P=\set{x_{1}(m)\wedge x_{2}(n)}{m,n\in T1}^{-} be the common refinement of x1x_{1} and x2x_{2}. Abusing notation, we will write families indexed by elements of PP as indexed by pairs (m,n)(m,n), for example λ(m,n).x(m,n)\lambda(m,n).x_{(m,n)}. Then x1=P(λ(m,n).m)x_{1}=P(\lambda(m,n).m) and x2=P(λ(m,n).n)x_{2}=P(\lambda(m,n).n), and so by cong-PP it suffices to prove b(m,n)nb(m,n)\approx n for each m,nT1m,n\in T1 and bPb\in P with mbnm\sim_{b}n.

Consider first the special case where bm1nb\leq\llbracket{m\sim_{1}n}\rrbracket. Then

{[ta]|A𝖲𝖾𝗍,|A|κ,t:TA,u,v:AT1,aA,u(a)=v(a),m=t>>=u,n=t>>=v}{¬b}\left\{[t\mapsto a]~\middle|~\begin{matrix}A\in\mathsf{Set},|A|\leq\kappa,t:TA,u,v\colon A\to T1,a\in A,\\ u(a)=v(a),m=t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u,n=t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}v\end{matrix}\right\}\cup\set{\neg b}

is an open cover, so there is a refining partition PP. We can further refine this partition to Q=P;{b,¬b}Q=P;\set{b,\neg b}. Now each qQq\in Q is either q¬bq\leq\neg b, or qbq\leq b and associated with some tqTAt_{q}\in TA, aqAa_{q}\in A and families uq,vqu_{q},v_{q} such that q[tqaq]q\leq[t_{q}\mapsto a_{q}], uq(a)=vq(a)u_{q}(a)=v_{q}(a), m=tq>>=uqm=t_{q}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u_{q} and n=tq>>=vqn=t_{q}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}v_{q}. Then we can derive

b(m,n)\displaystyle b(m,n) =Q(λq.{mqbnq¬b})\displaystyle=Q\left(\lambda q.\left.\begin{cases}m&q\leq b\\ n&q\leq\neg b\\ \end{cases}\right\}\right)
=Q(λq.{tq>>=uqqbnq¬b})\displaystyle=Q\left(\lambda q.\left.\begin{cases}t_{q}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u_{q}&q\leq b\\ n&q\leq\neg b\\ \end{cases}\right\}\right)
Q(λq.{P(tq)(λa.tq>>uq(a))qbnq¬b})\displaystyle\approx Q\left(\lambda q.\left.\begin{cases}P^{(t_{q})}(\lambda a.t_{q}\mathbin{>\mkern-6.9mu>}u_{q}(a))&q\leq b\\ n&q\leq\neg b\\ \end{cases}\right\}\right)\qquad by definition of \displaystyle\text{ by definition of }\approx
=Q(λq.{tq>>uq(aq)qbnq¬b})\displaystyle=Q\left(\lambda q.\left.\begin{cases}t_{q}\mathbin{>\mkern-6.9mu>}u_{q}(a_{q})&q\leq b\\ n&q\leq\neg b\\ \end{cases}\right\}\right)\qquad since q[tqaq]\displaystyle\text{ since }q\leq[t_{q}\mapsto a_{q}]
=Q(λq.{tq>>vq(aq)qbnq¬b})\displaystyle=Q\left(\lambda q.\left.\begin{cases}t_{q}\mathbin{>\mkern-6.9mu>}v_{q}(a_{q})&q\leq b\\ n&q\leq\neg b\\ \end{cases}\right\}\right)
=b(n,n)=n\displaystyle=b(n,n)=n\qquad by similar reasoning

Now, consider the general case: by ultraparacompactness, it suffices to consider when bmknb\leq\llbracket{m\sim_{k}n}\rrbracket for each kk\in\mathbb{N}. Then {i=1k1mi1mi+1|m1=m,m2mk1T1,mk=n}{¬b}\set{\textstyle{\bigwedge^{k-1}_{i=1}}\llbracket{m_{i}\sim_{1}m_{i+1}}\rrbracket}{m_{1}=m,m_{2}\ldots m_{k-1}\in T1,m_{k}=n}\cup\set{\neg b} is refinable by a partition QQ such that each qPq\in P is either q¬bq\leq\neg b or qbq\leq b and qi=1k1mi1mi+1q\leq\textstyle{\bigwedge^{k-1}_{i=1}}\llbracket{m_{i}\sim_{1}m_{i+1}}\rrbracket for some {mi}ik\set{m_{i}}_{i\leq k}. Then we can prove q(mi,n)q(mi+1,n)q(m_{i},n)\approx q(m_{i+1},n) by similar reasoning as the previous paragraph, so by transitivity of \approx we have q(m,n)q(n,n)=nq(m,n)\approx q(n,n)=n. Then we finally finish the proof with the following equational reasoning:

b(m,n)\displaystyle b(m,n) =Q(λq.{mqbnq¬b})\displaystyle=Q\left(\lambda q.\left.\begin{cases}m&q\leq b\\ n&q\leq\neg b\\ \end{cases}\right\}\right)
=Q(λq.{q(m,n)qbnq¬b})\displaystyle=Q\left(\lambda q.\left.\begin{cases}q(m,n)&q\leq b\\ n&q\leq\neg b\\ \end{cases}\right\}\right)
Q(λq.{q(n,n)qbnq¬b})\displaystyle\approx Q\left(\lambda q.\left.\begin{cases}q(n,n)&q\leq b\\ n&q\leq\neg b\\ \end{cases}\right\}\right)
=b(n,n)=n.\displaystyle=b(n,n)=n.

A.8 Proof that definition 3.11 corresponds to definition 3.7

Suppose w:T1𝖫𝖡0Tw\colon T1\to\mathsf{LB}_{0}T is a function respecting trace equivalence as in 3.11. Then we need to show w(t>>=u)=P(t)(λ[ta].t>>u(a))w(t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u)=P^{(t)}(\lambda[t\mapsto a].t\mathbin{>\mkern-6.9mu>}u(a)), which we have by

w(t>>=u)\displaystyle w(t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u) =P(t)(λ[ta].w(t>>=u))\displaystyle=P^{(t)}(\lambda[t\mapsto a].w(t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u)) (2)
=P(t)(λ[ta].[ta](w(t>>=u),w(t>>u(a))))\displaystyle=P^{(t)}(\lambda[t\mapsto a].[t\mapsto a](w(t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u),w(t\mathbin{>\mkern-6.9mu>}u(a)))) (2)
=P(t)(λ[ta].w(t>>u(a)))\displaystyle=P^{(t)}(\lambda[t\mapsto a].w(t\mathbin{>\mkern-6.9mu>}u(a))) (*)

where (*) follows because ww respects trace equivalence:

t>>=u[ta]t>>u(a)\displaystyle t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u\sim_{[t\mapsto a]}t\mathbin{>\mkern-6.9mu>}u(a)
\displaystyle\implies w(t>>=u)[ta]w(t>>u(a))\displaystyle w(t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u)\equiv_{[t\mapsto a]}w(t\mathbin{>\mkern-6.9mu>}u(a))
\displaystyle\iff [ta](w(t>>=u),w(t>>u(a)))=w(t>>u(a))\displaystyle[t\mapsto a](w(t\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u),w(t\mathbin{>\mkern-6.9mu>}u(a)))=w(t\mathbin{>\mkern-6.9mu>}u(a))

On the other hand, if w~:FT𝖫𝖡0T\tilde{w}\colon F_{T}\to\mathsf{LB}_{0}T is a B𝒥B_{\mathcal{J}}-set homomorphism, then we need to show w~\tilde{w} restricts to a function w:T1𝖫𝖡0Tw\colon T1\to\mathsf{LB}_{0}T which respects trace equivalence. Consider then two trace equivalent terms mbnT1m\sim_{b}n\in T1. Then we have w~(m)bw~n\tilde{w}(m)\equiv_{b}\tilde{w}_{n} since

b(w~(m),w~(n))=w~(b(m,n))=w~(n)b(\tilde{w}(m),\tilde{w}(n))=\tilde{w}(b(m,n))=\tilde{w}(n)

where the last equality follows because b(m,n)=nmbnb(m,n)=n\iff m\sim_{b}n by lemma 3.10.

A.9 Proof of lemma 3.15

The following decomposition lemma, analogous to lemma 3.12, will come in handy.

Lemma A.9.

Every h:T1Lh\colon T1\to L with the conditions of this lemma is of the form h=mm𝖼𝗈𝗇𝗌𝗍h(m)h=\bigvee_{m}m^{*}\wedge\mathsf{const}_{h(m)} where m:=λn.f1mnm^{*}:=\lambda n.f^{-1}\llbracket{m\sim n}\rrbracket.

Proof A.10.

We have to show h(n)=mf1mnh(m)h(n)=\bigvee_{m}f^{-1}\llbracket{m\sim n}\rrbracket\wedge h(m). As in the proof of lemma 3.12, the left-to-right inequality is easy, so we focus on the right-to-left inequality for which we have to show f1mnh(m)h(n)f^{-1}\llbracket{m\sim n}\rrbracket\wedge h(m)\leq h(n). By ultraparacompactness, f1mn={f1b|bmn,bB}f^{-1}\llbracket{m\sim n}\rrbracket=\bigvee\set{f^{-1}b}{b\leq\llbracket{m\sim n}\rrbracket,b\in B} so it suffices to prove for each complemented bmnb\leq\llbracket{m\sim n}\rrbracket that f1bh(m)h(n)f^{-1}b\wedge h(m)\leq h(n), but this immediately follows from the condition on hh.

It is easy to see that 𝖼𝗈𝗇𝗌𝗍h(m)\mathsf{const}_{h(m)} satisfies the condition since it is just a constant map. Meanwhile, for mm^{*} whenever n1bn2n_{1}\sim_{b}n_{2} we have that

mn1f1b=f1mn1f1b=f1(mn1b)=f1(mn2b)mn2fb.m^{*}n_{1}\wedge f^{-1}b=f^{-1}\llbracket{m\sim n_{1}}\rrbracket\wedge f^{-1}b=f^{-1}(\llbracket{m\sim n_{1}}\rrbracket\wedge b)=f^{-1}(\llbracket{m\sim n_{2}}\rrbracket\wedge b)m^{*}n_{2}\wedge f^{*}b.

Hence mm^{*} satisfies the condition of this lemma.

The two projections π1:L×𝖫𝖡0T𝖫𝖡1TL\pi_{1}\colon L\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T\to L and π2:L×𝖫𝖡0T𝖫𝖡1T𝖫𝖡1T\pi_{2}\colon L\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T\to\mathsf{LB}_{1}T are given by π11:u𝖼𝗈𝗇𝗌𝗍u\pi^{-1}_{1}\colon u\mapsto\mathsf{const}_{u} and π21:wλm.f1w(m)\pi^{-1}_{2}\colon w\mapsto\lambda m.f^{-1}w(m). Given a pullback cone i:ZLi\colon Z\to L and j:Z𝖫𝖡1Tj\colon Z\to\mathsf{LB}_{1}T, if a universal arrow i,j\braket{i,j} exists then it must satisfy

i,j1(𝖼𝗈𝗇𝗌𝗍h(m))=i,j1π11h(m)=i1h(m)\braket{i,j}^{-1}(\mathsf{const}_{h(m)})=\braket{i,j}^{-1}\pi^{-1}_{1}h(m)=i^{-1}h(m)
i,j1(m)=i,j1π21h(m^)=j1m^\braket{i,j}^{-1}(m^{*})=\braket{i,j}^{-1}\pi^{-1}_{2}h(\hat{m})=j^{-1}\hat{m}

But then by lemma A.9, the frame of opens for the pullback is generated by these opens, so these two equations uniquely determine i,j\braket{i,j}. It is then straightforward to check that this is well-defined.

A.10 Proof that definition 3.16 is a localic category

It is very straightforward to check that the domain and codomain of identity and compositions correspond to what they should be, so we focus on the unitality and associativity. It is easy to see from lemma 3.15 that 𝖫𝖡0T×𝖫𝖡0T𝖫𝖡1T𝖫𝖡1T\mathsf{LB}_{0}T\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T\cong\mathsf{LB}_{1}T, for which the unitality diagram becomes

𝖫𝖡1T{{\mathsf{LB}_{1}T}}𝖫𝖡1T×𝖫𝖡0T𝖫𝖡1T{{\mathsf{LB}_{1}T\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T}}𝖫𝖡1T{{\mathsf{LB}_{1}T}}𝖫𝖡1T{{\mathsf{LB}_{1}T}}hh(𝗋𝖾𝗍𝗎𝗋𝗇,)\scriptstyle{h\mapsto h(\operatorname{\mathsf{return}},-)}ww(>>)\scriptstyle{w\mapsto w(-\mathbin{>\mkern-6.9mu>}-)}hh(,𝗋𝖾𝗍𝗎𝗋𝗇)\scriptstyle{h\mapsto h(-,\operatorname{\mathsf{return}})}

and this commutes by unitality of >>\mathbin{>\mkern-6.9mu>}. Finally, by lemma 3.15 the pullback of composable triples 𝖫𝖡1T×𝖫𝖡0T𝖫𝖡1T×𝖫𝖡0T𝖫𝖡1T\mathsf{LB}_{1}T\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T can be constructed as the frame of appropriate maps T1×T1×T1𝒪𝖫𝖡0TT1\times T1\times T1\to\mathcal{O}\mathsf{LB}_{0}T, for which the associativity diagram below obviously commutes due to the associativity of >>\mathbin{>\mkern-6.9mu>}.

𝖫𝖡1T×𝖫𝖡0T𝖫𝖡1T×𝖫𝖡0T𝖫𝖡1T{{\mathsf{LB}_{1}T\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T}}𝖫𝖡1T×𝖫𝖡0T𝖫𝖡1T{{\mathsf{LB}_{1}T\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T}}𝖫𝖡1T×𝖫𝖡0T𝖫𝖡1T{{\mathsf{LB}_{1}T\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T}}𝖫𝖡1T{{\mathsf{LB}_{1}T}}hh(,>>)\scriptstyle{h\mapsto h(-,-\mathbin{>\mkern-6.9mu>}-)}hh(>>,)\scriptstyle{h\mapsto h(-\mathbin{>\mkern-6.9mu>}-,-)}ww(>>)\scriptstyle{w\mapsto w(-\mathbin{>\mkern-6.9mu>}-)}ww(>>)\scriptstyle{w\mapsto w(-\mathbin{>\mkern-6.9mu>}-)}

A.11 Details to the proof of proposition 4.2

First we have to verify that 𝖫𝖡φ\mathsf{LB}\varphi is an internal retrofunctor. For this we need to consider the pullbacks

Λ1{{\Lambda_{1}}}𝖫𝖡1T{{\mathsf{LB}_{1}T}}Λ2{{\Lambda_{2}}}𝖫𝖡2T{{\mathsf{LB}_{2}T}}𝖫𝖡0S{{\mathsf{LB}_{0}S}}𝖫𝖡0T{{\mathsf{LB}_{0}T}}Λ1{{\Lambda_{1}}}𝖫𝖡1T{{\mathsf{LB}_{1}T}}π2\scriptstyle{\pi_{2}}π1\scriptstyle{\pi_{1}}\scriptstyle{\lrcorner}σ\scriptstyle{\sigma}π2\scriptstyle{\pi_{2}}π1\scriptstyle{\pi_{1}}\scriptstyle{\lrcorner}π1\scriptstyle{\pi_{1}}𝖫𝖡0φ\scriptstyle{\mathsf{LB}_{0}\varphi}π2\scriptstyle{\pi_{2}}

Noting that Λ2\Lambda_{2} is the pullback of the second square composed with the first square, and following similar ideas to lemma 3.15, the second pullback Λ2\Lambda_{2} can be expressed by the frame of maps h:T1×T1𝒪𝖫𝖡0Sh:T1\times T1\to\mathcal{O}\mathsf{LB}_{0}S such that mbmm\sim_{b}m^{\prime} implies h(m,n)(𝖫𝖡0φ)1b=h(m,n)(𝖫𝖡0φ)1bh(m,n)\wedge(\mathsf{LB}_{0}\varphi)^{-1}b=h(m,n)\wedge(\mathsf{LB}_{0}\varphi)^{-1}b, and nbnn\sim_{b}n^{\prime} implies h(m,n)(𝖫𝖡0φ)1m1b=h(m,n)(𝖫𝖡0φ)1m1bh(m,n)\wedge(\mathsf{LB}_{0}\varphi)^{-1}\llparenthesis{m}\rrparenthesis^{-1}b=h(m,n^{\prime})\wedge(\mathsf{LB}_{0}\varphi)^{-1}\llparenthesis{m}\rrparenthesis^{-1}b.

The requirements on the domain and codomain of the lift is encoded by requiring the following diagram to commute:

Λ1{{\Lambda_{1}}}𝖫𝖡1T{{\mathsf{LB}_{1}T}}𝖫𝖡0S{{\mathsf{LB}_{0}S}}𝖫𝖡1S{{\mathsf{LB}_{1}S}}𝖫𝖡0S{{\mathsf{LB}_{0}S}}𝖫𝖡0T{{\mathsf{LB}_{0}T}}π2\scriptstyle{\pi_{2}}π1\scriptstyle{\pi_{1}}𝖫𝖡1φ\scriptstyle{\mathsf{LB}_{1}\varphi}τ\scriptstyle{\tau}σ\scriptstyle{\sigma}τ\scriptstyle{\tau}𝖫𝖡0φ\scriptstyle{\mathsf{LB}_{0}\varphi}

but this follows by a straightforward chase along the diagram. Next, to see that identity and composition is respected, we require the following diagrams to commute:

Λ2{{\Lambda_{2}}}Λ1{{\Lambda_{1}}}𝖫𝖡0S{{\mathsf{LB}_{0}S}}𝖫𝖡2S{{\mathsf{LB}_{2}S}}𝖫𝖡1S{{\mathsf{LB}_{1}S}}𝗂𝖽×μ\scriptstyle{\mathsf{id}\times\mu}d\scriptstyle{d}𝖫𝖡1φ\scriptstyle{\mathsf{LB}_{1}\varphi}𝗂𝖽,ι𝖫𝖡0\scriptstyle{\braket{\mathsf{id},\iota\circ\mathsf{LB}_{0}}}ι\scriptstyle{\iota}μ\scriptstyle{\mu}

For the commutativity involving ι\iota, this amounts to checking, for w𝒪𝖫𝖡1Sw\in\mathcal{O}\mathsf{LB}_{1}S, that

mT1w(φ(m))(𝖫𝖡0φ)1m𝗋𝖾𝗍𝗎𝗋𝗇=w(𝗋𝖾𝗍𝗎𝗋𝗇).\bigvee_{m\in T1}w(\varphi(m))\wedge(\mathsf{LB}_{0}\varphi)^{-1}\llbracket{m\sim\operatorname{\mathsf{return}}}\rrbracket=w(\operatorname{\mathsf{return}}).

The proof of this is similar to the proof of lemma A.9. For the commutativity involving μ\mu, the map dd is defined on inverse image by d1:hh(φ1(),φ1)d^{-1}:h\mapsto h(\varphi_{1}(-),\varphi_{1}). Then the commutativity of this square amounts to checking, for w𝒪𝖫𝖡1Tw\in\mathcal{O}\mathsf{LB}_{1}T, that w(φ()>>φ())=w(φ(>>))w(\varphi(-)\mathbin{>\mkern-6.9mu>}\varphi(-))=w(\varphi(-\mathbin{>\mkern-6.9mu>}-)) but this easily follows from φ\varphi being a monad map.

We now also must verify that 𝖫𝖡\mathsf{LB} is functorial. If φ=𝗂𝖽:TT\varphi=\mathsf{id}:T\to T then we see that the definition of 𝖫𝖡φ\mathsf{LB}\varphi is indeed the identity retrofunctor. For composition, given φ:TS\varphi:T\to S and ψ:SR\psi:S\to R, it is obvious that 𝖫𝖡0(φψ)=𝖫𝖡0(ψ)𝖫𝖡0(φ)\mathsf{LB}_{0}(\varphi\circ\psi)=\mathsf{LB}_{0}(\psi)\circ\mathsf{LB}_{0}(\varphi). For the action on morphisms, the composite is given by

𝖫𝖡0R×𝖫𝖡0T𝖫𝖡1T{{\mathsf{LB}_{0}R\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T}}𝖫𝖡0R×𝖫𝖡0S𝖫𝖡1S{{\mathsf{LB}_{0}R\times_{\mathsf{LB}_{0}S}\mathsf{LB}_{1}S}}𝖫𝖡1R{{\mathsf{LB}_{1}R}}π0,𝖫𝖡1φ(𝖫𝖡0ψ×𝗂𝖽)\scriptstyle{\braket{\pi_{0},\mathsf{LB}_{1}\varphi\circ(\mathsf{LB}_{0}\psi\times\mathsf{id})}}𝖫𝖡1ψ\scriptstyle{\mathsf{LB}_{1}\psi}

Let us compute the inverse image of an open set w𝒪(𝖫𝖡1R)w\in\mathcal{O}(\mathsf{LB}_{1}R) along this map. The inverse along 𝖫𝖡1ψ\mathsf{LB}_{1}\psi gives wψ1w\circ\psi_{1} which by lemma A.9 can be expressed as sS1s𝖼𝗈𝗇𝗌𝗍w(ψ(s))\bigvee_{s\in S1}s^{*}\wedge\mathsf{const}_{w(\psi(s))}. Now the inverse of 𝖼𝗈𝗇𝗌𝗍w(ψ(s))\mathsf{const}_{w(\psi(s))} along the pair of maps can be computed as the inverse of just the left component, which again gives 𝖼𝗈𝗇𝗌𝗍w(ψ(s))\mathsf{const}_{w(\psi(s))}, but this time as an open in 𝖫𝖡0R×𝖫𝖡0T𝖫𝖡1T\mathsf{LB}_{0}R\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T. The inverse of ss^{*} along the pair can be computed as the inverse of s^\hat{s} along the right component, which gives λtT1.(𝖫𝖡0ψ)1sφ(t)\lambda t\in T1.(\mathsf{LB}_{0}\psi)^{-1}\llbracket{s\sim\varphi(t)}\rrbracket. So combining the two, in the end we get an open of 𝖫𝖡0R×𝖫𝖡0T𝖫𝖡1T\mathsf{LB}_{0}R\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T defined by

λtT1.sS1(𝖫𝖡0ψ)1sφ(t)w(ψ(s))\lambda t\in T1.\bigvee_{s\in S1}(\mathsf{LB}_{0}\psi)^{-1}\llbracket{s\sim\varphi(t)}\rrbracket\wedge w(\psi(s))

and we have to show this is equal to (𝖫𝖡1(ψφ))1w=wψ1ϕ1(\mathsf{LB}_{1}(\psi\circ\varphi))^{-1}w=w\circ\psi_{1}\circ\phi_{1}. But this is again the same type of reasoning as in the proof of lemma A.9.

A.12 Details to the proof of theorem 4.6

Let us write Γ\Gamma as shorthand for Γ𝖫𝖢\Gamma\mathsf{LC}. It suffices to prove, for any retrofunctor F:𝖫𝖢𝖫𝖡TF\colon\mathsf{LC}\to\mathsf{LB}T, there is a unique monad morphism φ:TΓ\varphi\colon T\to\Gamma such that 𝖫𝖡φε=F\mathsf{LB}\varphi\circ\varepsilon=F. For this, we show that this condition uniquely determines φ\varphi. So consider tTAt\in TA and observe that φ(t)1aw=φ(t)1aφ(t>>𝗋𝖾𝗍𝗎𝗋𝗇)1w\varphi(t)^{-1}\braket{a\mapsto w}=\varphi(t)^{-1}\braket{a\mapsto\top}\wedge\varphi(t\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}})^{-1}w. We then show that (1) F01[ta]=φ(t)1aF_{0}^{-1}[t\mapsto a]=\varphi(t)^{-1}\braket{a\mapsto\top}; and (2) (F11w)(t>>𝗋𝖾𝗍𝗎𝗋𝗇)=φ(t>>𝗋𝖾𝗍𝗎𝗋𝗇)1w(F_{1}^{-1}w)(t\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}})=\varphi(t\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}})^{-1}w. This fully determines φ(t)1aw\varphi(t)^{-1}\braket{a\mapsto w} as F01[ta](F11w)(t>>𝗋𝖾𝗍𝗎𝗋𝗇)F_{0}^{-1}[t\mapsto a]\wedge(F_{1}^{-1}w)(t\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}).

Now, (i) is a straightforward unfolding of definitions on the equation F01=ε01(𝖫𝖡0φ)1F_{0}^{-1}=\varepsilon_{0}^{-1}(\mathsf{LB}_{0}\varphi)^{-1}, so we leave this as an exercise to the reader (if the reader is still reading). For (ii), we have

F1=𝖫𝖢0×𝖫𝖡0T𝖫𝖡1T{{F_{1}=\mathsf{LC}_{0}\times_{\mathsf{LB}_{0}T}\mathsf{LB}_{1}T}}𝖫𝖢0×𝖫𝖡0Γ𝖫𝖡1Γ{{\mathsf{LC}_{0}\times_{\mathsf{LB}_{0}\Gamma}\mathsf{LB}_{1}\Gamma}}𝖫𝖢1{{\mathsf{LC}_{1}}}π0,𝖫𝖡1φ(ε0×𝗂𝖽)\scriptstyle{\braket{\pi_{0},\mathsf{LB}_{1}\varphi\circ(\varepsilon_{0}\times\mathsf{id})}}ε1\scriptstyle{\varepsilon_{1}}

Let us compute the inverse image of w𝖫𝖢1w\in\mathsf{LC}_{1} along this map. First, by lemma A.9 we can decompose ε11w=mΓ1𝖼𝗈𝗇𝗌𝗍m1wm\varepsilon_{1}^{-1}w=\bigvee_{m\in\Gamma 1}\mathsf{const}_{m^{-1}w}\wedge m^{*}. Then the the inverse image of 𝖼𝗈𝗇𝗌𝗍m1w\mathsf{const}_{m^{-1}w} along the pair is given simply as 𝖼𝗈𝗇𝗌𝗍m1w\mathsf{const}_{m^{-1}w} while the inverse image of mm^{*} is λnT1.ε01φ(n)m\lambda n\in T1.\varepsilon_{0}^{-1}\llbracket{\varphi(n)\sim m}\rrbracket. Therefore, we arrive at the result

F11w=mλnT1.m1wε01φ(n)mF_{1}^{-1}w=\bigvee_{m}\lambda n\in T1.m^{-1}w\wedge\varepsilon_{0}^{-1}\llbracket{\varphi(n)\sim m}\rrbracket

Hence, if we let n:=t>>𝗋𝖾𝗍𝗎𝗋𝗇n:=t\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}, then we have F11w(n)=mΓ1m1wε1φ(n)mF_{1}^{-1}w(n)=\bigvee_{m\in\Gamma 1}m^{-1}w\wedge\varepsilon^{-1}\llbracket{\varphi(n)\sim m}\rrbracket. Now, it is easy to see that φ(n)1wF11w(n)\varphi(n)^{-1}w\leq F_{1}^{-1}w(n) by taking m:=φ(n)m:=\varphi(n). On the other hand, for φ(n)1wF11w(n)\varphi(n)^{-1}w\geq F_{1}^{-1}w(n) we have to reason in terms of witnesses of φ(n)m\llbracket{\varphi(n)\sim m}\rrbracket. For simplicity, we simply consider a 11-step witness [hb][h\mapsto b] for hΓB,bBh\in\Gamma B,b\in B such that φ(n)=h>>=u\varphi(n)=h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u and m=h>>=vm=h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}v, with u(b)=v(b)u(b)=v(b). Then one can see that

m1wε01[hb]\displaystyle m^{-1}w\wedge\varepsilon_{0}^{-1}[h\mapsto b] =(h>>=v)1wh1b\displaystyle=(h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}v)^{-1}w\wedge h^{-1}\braket{b\mapsto\top}
=(h>>v(b))1wh1b\displaystyle=(h\mathbin{>\mkern-6.9mu>}v(b))^{-1}w\wedge h^{-1}\braket{b\mapsto\top}
=(h>>=u)1wh1b\displaystyle=(h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}u)^{-1}w\wedge h^{-1}\braket{b\mapsto\top}
φ(n)1w\displaystyle\leq\varphi(n)^{-1}w

This proves (ii) and hence we conclude that φ\varphi is uniquely determined.

A.13 Details to the proof of proposition 5.3

(affine characterization) Applying the definition of >>=\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}, we find that (h>>𝗋𝖾𝗍𝗎𝗋𝗇)1w=ah1aw(h\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}})^{-1}w=\bigvee_{a}h^{-1}\braket{a\mapsto w^{\prime}} where w={v1τ1ι1v2|v1×v2μ1w}w^{\prime}=\bigvee\set{v_{1}\wedge\tau^{-1}\iota^{-1}v_{2}}{v_{1}\times v_{2}\leq\mu^{-1}w}. But notice that ww^{\prime} is the inverse image of ww along

𝖫𝖢1{{\mathsf{LC}_{1}}}𝖫𝖢1×𝖫𝖢0𝖫𝖢0{{\mathsf{LC}_{1}\times_{\mathsf{LC}_{0}}\mathsf{LC}_{0}}}𝖫𝖢1×𝖫𝖢0𝖫𝖢0{{\mathsf{LC}_{1}\times_{\mathsf{LC}_{0}}\mathsf{LC}_{0}}}𝖫𝖢1{{\mathsf{LC}_{1}}}𝗂𝖽,τ\scriptstyle{\braket{\mathsf{id},\tau}}𝗂𝖽×ι\scriptstyle{\mathsf{id}\times\iota}π𝖫𝖢1\scriptstyle{\pi_{\mathsf{LC}_{1}}}μ\scriptstyle{\mu}

but this inverse image is equally well computed as wτ1=ww\wedge\tau^{-1}\top=w, and hence w=ww^{\prime}=w.

(determination of s¯\overline{s}) Since s=s¯1>>=λa.s>>𝗋𝖾𝗍𝗎𝗋𝗇as=\overline{s}^{-1}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.s\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a, we can compute s1as^{-1}\braket{a\mapsto\top} as

s¯1a{v1τ1s1aA}v1,v2𝒪𝖫𝖢1|Next,weknowι1w=a′′As¯1a′′wso∧⁢ι-1w⁢s-1⟨↦a⊤⟩=⁢¯s-1⟨↦a∧w⋁⁢{∧v1⁢τ-1s-1⋁∈a′A⟨↦a′v2⟩}v1,∈v2⁢OLC1|⟩andnowwehavew≤⋁⁢{∧v1⁢τ-1s-1⋁∈a′A⟨↦a′v2⟩|∈v1,v2⁢OLC1}bytakingv1=⁢wandv2=⊤,⁢sothissimplifiesto¯s-1⟨↦aw⟩.A.14subsection A.14sectionSectionsectionsSectionsA.14§A.14A.14Proofofproposition5.7Itremainstoprovetheconverse,soassumeTishyperaffineunary,wehavetoproveηTisanisomorphism,i.e.,bijectiveateachlevel.ToseethatηTissurjective,considerthenasectionsΓ𝖫𝖡TA.Wecanalwaysfactors=h>>=λi.η(mi)>>𝗋𝖾𝗍𝗎𝗋𝗇f(i)forsomehyperaffinesectionhHC,somefamilyofT1terms{mi}iIandfunctionf:IA.SoitsufficestoshowthathisintheimageofηT.Thedataofahyperaffinesectionhiscompletelydeterminedbythepartition{h1i|iI}𝖫𝖡0T,butnowbecauseTishyperaffineunary,bylemma5.5suchapartitionhastobeoftheform{[hj]|jJ}forsomehHJTJandJ={iI|h1i}I.WeclaimthatηT(h)=h,andthisfollowsbyunfoldingdefinitions:⁢ηT(h′)-1⟨↦iw⟩=∧[↦h′i]⁢w(>>h′return)=∧⁢h-1⟨↦i⊤⟩⁢w(return)=⁢h-1⟨↦iw⟩Finally,toseethatηTisinjective,considert1t2TA.Thenagainbyproposition5.3,bothadmitdecompositionst1=t1¯>>=λa.m1>>𝗋𝖾𝗍𝗎𝗋𝗇aandt2=t2¯>>=λa.m2>>𝗋𝖾𝗍𝗎𝗋𝗇a,soiftheyarenotequalitmustbethateithert1¯t2¯HAorm1m2T1.Iftheformer,thenbyhyperaffinenessofh1andh2:h1=h1>>=λa.h1>>=λa.𝗋𝖾𝗍𝗎𝗋𝗇a if a=a else h2(h1 is h.aff.)=h1>>=λa.[h1a]>>=(𝗋𝖾𝗍𝗎𝗋𝗇a,h2)(definition of [h1a])=h1>>=λa.[h2a]>>=(h2>>𝗋𝖾𝗍𝗎𝗋𝗇a,h2)([h1a]=[h2a] and h2 is h.aff.)=h1>>=λa.h2>>=λa.h2>>=λa′′.𝗋𝖾𝗍𝗎𝗋𝗇a if a=a′′ else a′′(definition of [h2a])=h1>>=λa.h2>>=λa.h2>>=λa′′.𝗋𝖾𝗍𝗎𝗋𝗇a′′ if a=a′′ else (the  does not matter)=(h1>>=λa.h2)=(h1>>h2)=h2(h2 is h.aff.)Ifthelatteristrue,thenη(m1),η(m2):𝖫𝖡0T𝖫𝖡1T,viewedasmapsoflocalhomeomorphisms,correspondtomapsofsheavesδ(m1),δ(m2):1FT,andfromtheisomorphismFTT1oflemma5.5weknowthesecannotbeequal.Itcanthenbeverifiedthatifwehavetwohyperaffinesh1h2Γ𝖫𝖡TAorunarysectionss1s2Γ𝖫𝖡1thenh1>>=λa.s1𝗋𝖾𝗍𝗎𝗋𝗇ah2>>=λa.s2𝗋𝖾𝗍𝗎𝗋𝗇a,andhenceη(t1)η(t2).\overline{s}^{-1}\Braket{a\mapsto\bigvee\set{v_{1}\wedge\tau^{-1}s^{-1}\bigvee_{a^{\prime}\in A}}{v_{1},v_{2}\in\mathcal{O}\mathsf{LC}_{1}}|$$}Next,weknow\iota^{-1}w=\bigvee_{a^{\prime\prime}\in A}\overline{s}^{-1}\braket{a^{\prime\prime}\mapsto w}so$$\iota^{-1}w\wedge s^{-1}\braket{a\mapsto\top}=\overline{s}^{-1}\Braket{a\mapsto w\wedge\bigvee\set{v_{1}\wedge\tau^{-1}s^{-1}\bigvee_{a^{\prime}\in A}\braket{a^{\prime}\mapsto v_{2}}}{v_{1},v_{2}\in\mathcal{O}\mathsf{LC}_{1}}|$$}andnowwehavew\leq\bigvee\set{v_{1}\wedge\tau^{-1}s^{-1}\bigvee_{a^{\prime}\in A}\braket{a^{\prime}\mapsto v_{2}}}{v_{1},v_{2}\in\mathcal{O}\mathsf{LC}_{1}}bytakingv_{1}=wandv_{2}=\top,sothissimplifiesto\overline{s}^{-1}\braket{a\mapsto w}.\par\par\@@numbered@section{subsection}{toc}{Proof of proposition \ref{prop:left-fixpoints-are-haffun}}\par Itremainstoprovetheconverse,soassumeTishyperaffine-unary,wehavetoprove\eta_{T}isanisomorphism,i.e.,bijectiveateachlevel.Toseethat\eta_{T}issurjective,considerthenasections\in\Gamma\mathsf{LB}TA.Wecanalwaysfactors=h\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda i.\eta(m_{i})\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}f(i)forsomehyperaffinesectionh\in HC,somefamilyofT1-terms\set{m_{i}}_{i\in I}andfunctionf\colon I\to A.Soitsufficestoshowthathisintheimageof\eta_{T}.Thedataofahyperaffinesectionhiscompletelydeterminedbythepartition\set{h^{-1}\braket{i\mapsto\top}}{i\in I}^{-}\subseteq\mathsf{LB}_{0}T,butnowbecauseTishyperaffine-unary,bylemma\ref{lemma:H2-of-hyperaffine-unary-monad}suchapartitionhastobeoftheform\set{[h^{\prime}\mapsto j]}{j\in J}forsomeh^{\prime}\in HJ\subseteq TJandJ=\set{i\in I}{h^{-1}\braket{i\mapsto\top}\neq\bot}\subseteq I.Weclaimthat\eta_{T}(h^{\prime})=h,andthisfollowsbyunfoldingdefinitions:$$\eta_{T}(h^{\prime})^{-1}\braket{i\mapsto w}=[h^{\prime}\mapsto i]\wedge w(h^{\prime}\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}})=h^{-1}\braket{i\mapsto\top}\wedge w(\operatorname{\mathsf{return}})=h^{-1}\braket{i\mapsto w}$$Finally,toseethat\eta_{T}isinjective,considert_{1}\neq t_{2}\in TA.Thenagainbyproposition\ref{prop:global-sections-monad-is-haffun},bothadmitdecompositionst_{1}=\overline{t_{1}}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.m_{1}\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}aandt_{2}=\overline{t_{2}}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.m_{2}\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a,soiftheyarenotequalitmustbethateither\overline{t_{1}}\neq\overline{t_{2}}\in HAorm_{1}\neq m_{2}\in T1.Iftheformer,thenbyhyperaffinenessofh_{1}andh_{2}:\begin{aligned} h_{1}&=h_{1}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.h_{1}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a^{\prime}.\operatorname{\mathsf{return}}a\text{ if }a=a^{\prime}\text{ else }h_{2}&\text{($h_{1}$ is h.aff.)}\\ &=h_{1}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.[h_{1}\mapsto a]\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}(\operatorname{\mathsf{return}}a,h_{2})&\text{(definition of $[h_{1}\mapsto a]$)}\\ &=h_{1}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.[h_{2}\mapsto a]\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}(h_{2}\mathbin{>\mkern-6.9mu>}\operatorname{\mathsf{return}}a,h_{2})&\text{($[h_{1}\mapsto a]=[h_{2}\mapsto a]$ and $h_{2}$ is h.aff.)}\\ &=h_{1}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.h_{2}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a^{\prime}.h_{2}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a^{\prime\prime}.\operatorname{\mathsf{return}}a\text{ if }a=a^{\prime\prime}\text{ else }a^{\prime\prime}&\text{(definition of $[h_{2}\mapsto a]$)}\\ &=h_{1}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.h_{2}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a^{\prime}.h_{2}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a^{\prime\prime}.\operatorname{\mathsf{return}}a^{\prime\prime}\text{ if }a^{\prime}=a^{\prime\prime}\text{ else }\ldots\qquad&\text{(the $\ldots$ does not matter)}\\ &=(h_{1}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.h_{2})=(h_{1}\mathbin{>\mkern-6.9mu>}h_{2})=h_{2}&\text{($h_{2}$ is h.aff.)}\end{aligned}Ifthelatteristrue,then\eta(m_{1}),\eta(m_{2})\colon\mathsf{LB}_{0}T\to\mathsf{LB}_{1}T,viewedasmapsoflocalhomeomorphisms,correspondtomapsofsheaves\delta(m_{1}),\delta(m_{2})\colon 1\to F_{T},andfromtheisomorphismF_{T}\cong T1oflemma\ref{lemma:H2-of-hyperaffine-unary-monad}weknowthesecannotbeequal.Itcanthenbeverifiedthatifwehavetwohyperaffinesh_{1}\neq h_{2}\in\Gamma\mathsf{LB}TAorunarysectionss_{1}\neq s_{2}\in\Gamma\mathsf{LB}1thenh_{1}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.s_{1}\operatorname{\mathsf{return}}a\neq h_{2}\mathbin{>\mkern-6.8mu>\mkern-6.9mu=}\lambda a.s_{2}\operatorname{\mathsf{return}}a,andhence\eta(t_{1})\neq\eta(t_{2}).\par

A.15 Proof of proposition 5.10

The following lemma come in handy.

Lemma A.11.

Two internal categories are retrofunctorially isomorphic iff they are functorially isomorphic.

Proof A.12.

Let 𝖫𝖢\mathsf{LC} and 𝖫𝖣\mathsf{LD} be internal categories. Given a functorial isomorphism F:𝖫𝖢𝖫𝖣F\colon\mathsf{LC}\to\mathsf{LD} with inverse F1F^{-1}, define the retrofunctor GG by G0:=F0G_{0}:=F_{0} and G1:=F11π:𝖫𝖢0×𝖫𝖣0𝖫𝖣1𝖫𝖣1𝖫𝖢1G_{1}:=F^{-1}_{1}\circ\pi\colon\mathsf{LC}_{0}\times_{\mathsf{LD}_{0}}\mathsf{LD}_{1}\to\mathsf{LD}_{1}\to\mathsf{LC}_{1}, and vice versa for G1G^{-1}. On the other hand, given retrofunctors GG and G1G^{-1}, define the functor FF by F0:=G0F_{0}:=G_{0} and F1:=G11G0σ,𝗂𝖽F_{1}:=G^{-1}_{1}\circ\braket{G_{0}\sigma,\mathsf{id}} where G0σ,𝗂𝖽:𝖫𝖢1𝖫𝖣0×𝖫𝖢0𝖫𝖢1\braket{G_{0}\sigma,\mathsf{id}}\colon\mathsf{LC}_{1}\to\mathsf{LD}_{0}\times_{\mathsf{LC}_{0}}\mathsf{LC}_{1}. Define the inverse F1F^{-1} similarly. We leave it to the reader to verify the necessary equations.

For brevity, we omit the subscript 𝖫𝖢\mathsf{LC} from ε\varepsilon, and let us also write 𝖫𝖡i:=𝖫𝖡iΓ𝖫𝖢\mathsf{LB}_{i}:=\mathsf{LB}_{i}\Gamma\mathsf{LC} for i=0,1i=0,1.

()(\implies) By lemma A.11, we get an isomorphism 𝖫𝖡0Γ𝖫𝖢𝖫𝖢0\mathsf{LB}_{0}\Gamma\mathsf{LC}\cong\mathsf{LC}_{0} so 𝖫𝖢0\mathsf{LC}_{0} is also ultraparacompact, and also we get an isomorphism 𝖫𝖡1Γ𝖫𝖢𝖫𝖢1\mathsf{LB}_{1}\Gamma\mathsf{LC}\cong\mathsf{LC}_{1} commuting with the source maps, so the source map of 𝖫𝖢\mathsf{LC} is also a local homeomorphism.

()(\impliedby) By lemma A.11 it suffices to prove that the counit ε\varepsilon partakes in a functorial isomorphism. The action on objects ε0:𝖫𝖢0𝖫𝖡0\varepsilon_{0}\colon\mathsf{LC}_{0}\to\mathsf{LB}_{0} has inverse ε0\reflectbox{$\varepsilon$}_{0} given on generating clopens b𝔅𝖫𝖢0b\in\mathfrak{B}\mathsf{LC}_{0} by ε01:b[b+]\reflectbox{$\varepsilon$}_{0}^{-1}\colon b\mapsto[b^{+}] where b+:𝖫𝖢02𝖫𝖢1b^{+}\colon\mathsf{LC}_{0}\to 2\cdot\mathsf{LC}_{1} given by (b+)1:1wbι𝖫𝖢1w(b^{+})^{-1}\colon\braket{1\mapsto w}\mapsto b\wedge\iota_{\mathsf{LC}}^{-1}w and (b+)1:0w¬bι𝖫𝖢1w(b^{+})^{-1}\colon\braket{0\mapsto w}\mapsto\neg b\wedge\iota_{\mathsf{LC}}^{-1}w. This map is well-defined because it realizes all partitions of 𝖫𝖢0\mathsf{LC}_{0}: any partition PP manifests as a section P+Γ𝖫𝖢(P)P^{+}\in\Gamma\mathsf{LC}(P) defined analogously to b+b^{+}, and hence we have =bP[P+b]=bP[b+]\top=\bigvee_{b\in P}[P^{+}\mapsto b]=\bigvee_{b\in P}[b^{+}]. It is straightforward to see that ε01ε01=𝗂𝖽\varepsilon^{-1}_{0}\reflectbox{$\varepsilon$}^{-1}_{0}=\mathsf{id}. On the other hand, to see that ε01ε01=𝗂𝖽\reflectbox{$\varepsilon$}^{-1}_{0}\varepsilon^{-1}_{0}=\mathsf{id}, consider a generating open [s][s] where sΓ𝖫𝖢2s\in\Gamma\mathsf{LC}2. By proposition 5.3 we have its corresponding hyperaffine s¯\overline{s}, and it is easy to see that [s¯]=[s][\overline{s}]=[s]. Then, it is a matter of checking that (ε01[s])+=s¯(\varepsilon^{-1}_{0}[s])^{+}=\overline{s}.

This gives us an internal functor \mathcal{E} with 0:=ε0\mathcal{E}_{0}:=\reflectbox{$\varepsilon$}_{0} and 1:=𝖫𝖡1𝖫𝖢0×𝖫𝖡0𝖫𝖡1𝖫𝖢1ε0σ,𝗂𝖽ε1\mathcal{E}_{1}:=\hbox to170.36pt{\vbox to16.51pt{\pgfpicture\makeatletter\hbox{\hskip 85.18065pt\lower-4.72221pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{\the\pgflinewidth}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{}{}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{{}}{{}}{{}}}{{{}}}{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-88.18065pt}{-2.22221pt}\pgfsys@invoke{ }\hbox{\vbox{\halign{\pgf@matrix@init@row\pgf@matrix@step@column{\pgf@matrix@startcell#\pgf@matrix@endcell}&#\pgf@matrix@padding&&\pgf@matrix@step@column{\pgf@matrix@startcell#\pgf@matrix@endcell}&#\pgf@matrix@padding\cr\hfil\qquad\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-8.28474pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${{\mathsf{LB}_{1}}}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope{}}}&\qquad\hfil&\hfil\hskip 23.99997pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@endscope{}}}&\thinspace\hfil&\hfil\hskip 53.75008pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-26.7501pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${{\mathsf{LC}_{0}\times_{\mathsf{LB}_{0}}\mathsf{LB}_{1}}}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope{}}}&\hskip 29.7501pt\hfil&\hfil\hskip 35.14583pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-8.14586pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{${{\mathsf{LC}_{1}}}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}&\qquad\hfil\cr}}}\pgfsys@invoke{ }\pgfsys@endscope}}}{{{{}}}{{}}{{}}{{}}}} \pgfsys@invoke{ }\pgfsys@endscope}}} {}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{\the\pgflinewidth}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{-65.41116pt}{0.27779pt}\pgfsys@lineto{-18.21118pt}{0.27779pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-18.0112pt}{0.27779pt}\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-53.81929pt}{4.38055pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{\braket{\reflectbox{$\scriptstyle\varepsilon$}_{0}\sigma,\mathsf{id}}}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope{}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{\the\pgflinewidth}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{42.08899pt}{0.27779pt}\pgfsys@lineto{65.289pt}{0.27779pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{65.48898pt}{0.27779pt}\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@invoke{ }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{50.0485pt}{3.63055pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{$\scriptstyle{\varepsilon_{1}}$} }}\pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope}}} \pgfsys@invoke{ }\pgfsys@endscope \pgfsys@invoke{ }\pgfsys@endscope{{ {}{}{}}}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{ }\pgfsys@endscope\hss}}\endpgfpicture}} which more explicitly can be computed as 11w=λm.ε01m1w\mathcal{E}_{1}^{-1}w=\lambda m.\reflectbox{$\varepsilon$}_{0}^{-1}m^{-1}w. By proposition 5.3 and lemma 5.5, the local homeomorphism σ𝖫𝖡\sigma_{\mathsf{LB}} is induced by the B𝒥B_{\mathcal{J}}-set Γ𝖫𝖢1\Gamma\mathsf{LC}1, but this just corresponds to the sheaf induced by the local homeomorphism σ𝖫𝖢\sigma_{\mathsf{LC}}, so we must have σ𝖫𝖢σ𝖫𝖡\sigma_{\mathsf{LC}}\cong\sigma_{\mathsf{LB}}. The map 1\mathcal{E}_{1} is the canonical map witnessing this isomorphism, up to a change of base along the isomorphism ε0\reflectbox{$\varepsilon$}_{0}. We leave it to the reader to verify functoriality.

BETA