Stone Duality for Monads
We introduce a contravariant idempotent adjunction between (i) the category of ranked monads on $\mathsf{Set}$; and (ii) the category of internal categories and internal retrofunctors in the category of locales. The left adjoint takes a monad $T$-vie…
Authors: Richard Garner, Alyssa Renata, Nicolas Wu
Stone Dualit y for Monads Ric hard Garner b , 1 Alyssa Renata a , 2 Nicolas W u a , 3 a Imp erial Col le ge L ondon, L ondon, UK b Mac quarie University, Sydney, A ustr alia Abstract W e in tro duce a con trav arian t idemp otent adjunction betw een (i) the category of rank ed monads on Set ; and (ii) the category of in ternal categories and in ternal retrofunctors in the category of lo cales. The left adjoint takes a monad T —view ed as a notion of computation, follo wing Moggi—to its lo c alic b ehaviour c ate gory LB T . This behaviour category is understo o d as “the univ ersal transition system” for interacting with T : its “objects” are states and the “morphisms” are transitions. On the other hand, the righ t adjoin t takes a localic category LC —similarly understo o d as a transition system—to the monad Γ LC where Γ LC A is the set of A -indexed families of lo cal sections to the source map which jointly partition the locale of objects. The fixed p oints of this adjunction consist of (i) hyper affine-unary monads , i.e., those monads where term t admits a read-only op eration t predicting the output of t ; and (ii) ample lo c alic c ate gories , i.e., whose source maps are local homeomorphisms and whose lo cale of ob jects 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-Mo ore categories. This equiv alence is the Stone duality for monads ; so-called because it further restricts to the classical Stone duality by viewing a Bo olean algebra B as a monad of B -partitions and the corresponding Stone space as a lo calic category with only identit y morphisms. K eywor ds: b eha viour category , como dels, in ternal categories, internal retrofunctors, monads, stone duality 1 In tro duction Notions of computation are describ ed b y monads, as is well-kno wn from Moggi [ 22 ]. Later, Plotkin and P ow er [ 25 , 26 ] refined this story: notions of computation are describ ed b y a set of basic computational op erations Σ, possibly of infinite arit y , as w ell as equations E sa ying when t w o program terms (constructed from the basic operations) c ompute the same way . The pair [Σ | E ] is known as an algebraic theory , and it is w ell-known that these correspond to rank ed monads on Set [ 21 ]. But what do es it mean for tw o terms to compute the same wa y , or ev en for a term to compute? One answer is that computation is inter action b et w een program terms and a reality external to that program. Th us, to use Plato’s allegory , the equations in a Plotkin–P o wer notion of computation are merely imp ov erished shado ws on a ca ve wall, cast b y the flame of this in teractive pro cess. F or example, computations with access to state arises as in teraction b et ween programs constructed from the basic op erations of get and put , against an external realit y consisting of memory cells. The equation x ← get ; y ← get ; return ( x, y ) = x ← get ; return ( x, x ) is merely a syntactic manifestation of the inertia of memory cells. Regardless, as prisoners in the ca ve privy only to the equations written on the w all, we still wish to understand the greater realit y . One mathematical description of the p ossible realities inducing the equations 1 Email: richard.garner@mq.edu.au 2 Email: alyssa.renata19@imperial.ac.uk 3 Email: n.wu@imperial.ac.uk Garner, Rena t a, Wu B : Mnd ω ( Set ) T opRetro op : Γ ω ⊣ LB : Mnd r ( Set ) Lo cRetro op : Γ ⊣ Fig. 1. The Stone Adjunctions are the c omo dels of P ow er and Shkaravska [ 27 ]. F or a monad T , a T -como del ( W , L − M ) in a category C consists of an ob ject of states W ∈ C along with a c ointerpr etation L t M : W → P a ∈ A W for each computation t ∈ T A , subject to compatibilit y with the monad structure of T . W e think of L t M for t ∈ T A as a transition on W whic h along the w a y also produces a return v alue in the set A . A go o d in tuition is that if t is the syn tax tree of a term for an algebraic theory [Σ | E ], then eac h w ∈ W sp ecifies how to deterministically run down a sequence of op erations (the trace of t at w ) to reac h a return v alue—hence their alternativ e name of stateful runners [ 28 ]. As explained by Ahman and Bauer [ 2 ], w e may also think of runners as virtual machines for Σ. Note that the definition of como del mak es use of the monad T , and to know T one m ust in effect kno w the equations of one’s notion of computation. T o use our ca v e analogy , it is as if the shadows are dictating the structure of reality . But surely it is possible to find a description of the p ossible realities that does not dep end on a particular shado w/monad T ! In this pap er, we present one suc h description. The T op ological Behaviour Category for Finitary Monads. F or no w, let us just consider the finitary monads, which are those generated by operations of finite arit y . Here, the p ossible realities can b e describ ed as top ological categories, i.e., in ternal categories in the category T op of top ological spaces. F or each finitary monad T , there is a distinguished realit y b est appro ximating T , whic h we term the top olo gic al b ehaviour c ate gory B T . Qua category , B T is b est thought as a transition system, where ob jects are states and morphisms are transitions. In detail, ob jects are certain natural transformations β : T → id Set sa ying how to run eac h computation term t ∈ T A do wn to its return v alue β ( t ) ∈ A ; while morphisms with domain β are equiv alence-classes [ t ] β of computations t ∈ T 1 considered up to ha ving the same trace at β . In fact, this description of B T is not new: it is the b ehaviour c ate gory in tro duced b y the first-named author in [ 10 ]. What is new is the top ology imp osed on the sets B 0 T and B 1 T of ob jects and morphisms. T o motiv ate the need for topology , w e consider ho w we might attempt to recov er T from B T as a plain (non-top ologised) category . A computation t ∈ T A in teracts with the transition system B T at some state β b y causing a transition [ t ] β : β → ∂ t β and producing an output v alue β ( t ) ∈ A . The assignmen ts β 7→ [ t ] β and β 7→ β ( t ) constitute a pair of functions: (i) s : B 0 T → B 1 T whic h is a se ction to the source map σ : B 1 T → B 0 T ; and (ii) o : B 0 T → A . It seems reasonable, then, to attempt to reconstruct T b y taking all suc h pairs ( s, o ) as the computations returning v alues in A . Indeed, we obtain in this w ay a monad Γ( B T ). No w, consider the case where T enco des the theory of state with countably man y memory cells. Here, B 0 T is simply the set of p ossible memory configurations, while a transition in B 1 T is an assignment of new v alues to finitely man y memory cells. What of the computations ( s, o ) : Γ( B T )( A )? Without further constrain t, these ma y refer to the conten ts of infinitely man y cells of the current memory configuration in determining an update and a return v alue. Y et, b y the finitary nature of syntax, computations in T A ma y query only finitely man y cells to reach such a determination. So Γ( B T ) admits many more computations than T , most of whic h are computationally unreasonable. This gap is closed by introducing a top ology of finite information on B T , and restricting Γ( B T ) to in volv e only c ontinuous functions. This brings us to our first main contribution. W e sho w that, with the finite information topology , the construction T 7→ B T on finitary monads con trav ariantly extends to a functor B : Mnd ω ( Set ) → T opRetro op . Here, the category T opRetro has top ological categories as ob jects, but as morphisms, not the usual functors but rather r etr ofunctors [ 23 ]. Retrofunctors w ere originally in tro duced b y Aguiar [ 1 ] and later used to classify morphisms of polynomial comonads b y Ahman and Uustalu [ 3 , 4 ]. On the other hand, taking (finitary) sections yields a contra v ariant functor Γ ω : T opRetro op → Mnd ω ( Set ), and this giv es rise to the first adjunction in fig. 1 . The Lo calic Behaviour Category for Infinitary Monads. No w, supp ose w e wish to consider a notion of state in which our memory cells con tains arbitrary natural n umbers: for this, we must adapt our story from finitary to infinitary monads. A simple-minded 2 Garner, Rena t a, Wu generalisation w ould make only this change, and otherwise pro ceed as b efore. How ever, we contend that the correct generalisation also replaces top ological categories with lo c alic c ate gories , as in the second adjunction of fig. 1 . This is a genuine generalisation: for indeed, when T is a finitary monad, its lo c alic b ehaviour c ate gory LB T is the underlying lo calic category of its topological b ehaviour category B T , and the monads Γ( LB T ) and Γ ω ( B T ) found from these behaviour categories coincide. The mov e to the lo calic world is p erhaps b est motiv ated with an example. Let T b e the monad enco ding the theory of state with R -man y memory cells, each storing a natural n umber, augmented b y a further equation expressing that no t wo memory cells can con tain the same v alue. The admissible memory configurations for this T corresp ond to injectiv e functions R ↣ N —of which, of course, there are none; and y et, because the syn tax of terms in T is w ell-founded, it is imp ossible to discern this from the persp ective of a program. This analysis sho ws that T is non-trivial, while B T and hence also Γ( B T ), are trivial: so again, Γ( B T ) fails badly to appro ximate our original T . How ev er, if we instead construct the behaviour category B T in a p oint-fr e e wa y—prioritising the top ology of finite information ov er the global state—we obtain what w e term the lo c alic b ehaviour c ate gory LB T . F or the example just describ ed, the locale of ob jects of LB T is the locale of injective functions R ↣ N , which is known to b e a non-trivial locale without p oints (cf. [ 19 , Example C1.2.9]); and in fact, when we apply the analogous construction to b efore to obtain Γ( LB T ), w e now reco v er the original T p erfectly . See example 3.4 for a more in-depth explanation. Can we alwa ys reco ver T from LB T ? In fact, no. The lo calic b ehaviour category is our b est guess at realit y , sub ject to assumptions of statefulness and determinism underlying the definition of comodels. But realit y can b e far stranger, in whic h case the recov ered monad Γ LB T is merely an imp erfect appro ximation of the original T . T w o k ey examples where the imp erfection is particularly pronounced (due to Uustalu [ 28 ]) are the monads for non-termination—generated b y a n ullary op eration fail satisfying no axioms—and an y theory containing a commutativ e binary op eration ⊕ , for example the theory of non-deterministic c hoice. In b oth cases, LB T , and hence Γ( LB T ), are trivial, though the original monads T are not. In general, for a rank ed monad T , the monad Γ( LB T ) amoun ts to completing T with pr escienc e 4 : T o eac h term t ∈ T A , there is a new operation ¯ t whic h in tuitiv ely p erforms t , keeps track of the result, and then rolls bac k the state of the system to just b efore p erforming t . Such monads were characterised by the first-named author in [ 12 , 13 ] as the c artesian close d monads, i.e., those whose categories of Eilenberg-Mo ore algebras are cartesian closed. In the other direction, the source map of the lo calic b ehaviour category LB T is alw ays a lo cal homeomorphism, and the lo cale of ob jects is alw ays str ongly zer o-dimensional in the sense of Johnstone [ 16 ] (also called ultr ap ar ac omp act by V an Name [ 30 ]). F ollowing a common terminology among C ∗ -algebraists [ 24 , Definition 2.2.4], we term lo calic categories satisfying these conditions ample . It turns out that the cartesian closed monads and the ample localic group oids are precisely the fixp oints of the adjunction Γ ⊣ LB , which th us restricts to an equiv alence betw een the tw o. This equiv alence is the Stone duality for monads of the title. The nomenclature is justified b y the fact that this dualit y extends the classical dualit y of Boolean algebras and Stone (= totally disconnected compact Hausdorff ) spaces. On the one hand, each Stone space is the space of ob jects of a top ological (and hence lo calic) category with only identit y transitions; and on the other, eac h Boolean algebra has an asso ciated finitary monad of distributions o ver it [ 6 ]. Now restricting our Stone dualit y for monads to these t wo classes of objects re-finds the classical dualit y of Stone. Outline & Contributions. W e now outline the structure and contributions of the pap er. Section 2 collects the basic definitions and preliminary results ab out como dels, the behaviour category , locales and shea ves. Section 3 is the heart of this pap er: w e construct the terminal localic como del LB 0 T (definition 3.1 ) and the lo cale of transitions LB 1 T (definition 3.11 ), b efore com bining them into the lo calic behaviour category LB T (definition 3.15 ). W e also sho w that, when T is finitary , LB T is the underlying lo calic category of the topological b ehaviour category B T . In the short section 4 , we functorialize the construction T 7→ LB T and prov e that it has a right adjoin t Γ which tak es global sections, so giving us the adjunctions of fig. 1 . Finally , section 5 c haracterizes the fixed points of our adjunctions, obtaining the Stone dualit y of the title. W e then conclude the paper in section 6 and pro vide directions for future researc h. 4 in rev erence to the rollbac k feature of the pac kage management system nix, w e may call this the nixific ation of T . 3 Garner, Rena t a, Wu 2 Preliminaries 2.1 Monads & Como dels W e start by recalling some basic definitions. A monad ( T , > > = , return ) on Set comprises, for each set A , a set T A of c omputations ; for eac h value a ∈ A , a pur e c omputation return a ∈ T A ; and for all sets A, B a c omp osition op eration > > = : T A × T B A → T B . These are required to satisfy the equations return a > > = u = u ( a ), t > > = λa. return a = t and ( t > > = u ) > > = v = t > > = ( λa.u ( a ) > > = v ) for all t ∈ T A, a ∈ A, u ∈ T B A , v ∈ T C B . A monad map γ : T → S comprises, for eac h set A , a function γ A : T A → S A satisfying γ ( return a ) = return a and γ ( t > > = u ) = γ ( t ) > > = λa.γ ( u ( a )). An op eration t ∈ T A is finitary if there is some function f : I → A from a finite set I and t ′ ∈ T I suc h that t = t ′ > > = λi. return f ( i ); if here w e replace “finite” b y “ λ -small” for some regular cardinal λ , then w e instead sa y that t is λ -ary . No w T itself is finitary if eac h of its operations is so, and is r anke d if there is a regular cardinal λ for whic h all of its operations are λ -ary . W e write Mnd ω ( Set ) (resp. Mnd r ( Set )) for the category of finitary (resp. rank ed) monads and monad maps. F rom now on, an y men tion of monads will refer to rank ed monads only . Recall that a category C has c op owers if for any C ∈ C and any set A , the A -fold copro duct A · C exists. F or example, both Set and T op ha ve cop ow ers giv en b y the A -fold disjoint sum ` a ∈ A C . W e will denote the inclusion maps b y υ a : C → A · C , and the co diagonal b y π C : A · C → C . Definition 2.1 Let T b e a monad and C a category with cop ow ers. A c omo del of T in C is a pair ( W , L − M ) whose data comprises an ob ject W ∈ ob C and c o-interpr etations L t M : W → A · W for eac h computation t ∈ T A . If w e extend this to a cointerpretation L u M : A · W → B · W of eac h u : A → T B via L u M := [ L u ( a ) M ] a ∈ A , then the como del axioms require that L t > > = u M = L u M ◦ L t M and L return a M = υ a . A c omo del map ( W, L − M W ) → ( W ′ , L − M W ′ ) is a map h : W → W ′ whic h preserves eac h co-in terpretation, i.e., for eac h t ∈ T A , w e ha ve L t M ◦ h = ( A · h ) ◦ L t M . W e write Como d T ( C ) for the category of T -como dels in C . Clearly , any T op -como del is a Set -como del, yielding a forgetful functor U : Como d T ( T op ) → Como d T ( Set ). On the other hand, there is also a coarsest topology on an y Set -como del making it a T op -como del [ 11 ]: Definition 2.2 (Op erational T op ology) Let W b e a T -como del in Set . The op er ational top olo gy on W is generated b y sub-basic op en sets [ t 7→ a ] := { w ∈ W | L t M ( w ) = ( a, w ′ ) for some w ′ } for t ∈ T A and a ∈ A . Prop osition 2.3 The assignment which endows a c omo del with its op er ational top olo gy yields a right adjoint O : Como d T ( Set ) → Como d T ( T op ) to U : Como d T ( T op ) → Como d T ( Set ) . Pro of. Let W b e a T op -como del and W a Set -como del. Then any Set -como del morphism f : U W → W is a con tinuous function f : W → OW since f − 1 [ t 7→ a ] W = [ t 7→ a ] W = L t M − 1 W ( { a } × W ). 2 2.2 The Behaviour Cate gory Fixing a monad T on Set , w e now recall the classification of Como d T ( Set ) via the b ehaviour category B T [ 10 ]. Ob jects of B T are elements of the terminal T -como del, whic h are the observ able behaviours of como del states. Suc h b ehaviours describ e ho w the state runs a giv en computation term down to a v alue. Definition 2.4 (A dmissible b ehaviours) An admissible T -b ehaviour is a natural transformation β : T → id Set suc h that for any t ∈ T A , u : A → T B and a ∈ A , we hav e β ( t > > = u ) = β ( t > > u ( β ( t ))). The set of b eha viours B 0 T admits a como del structure with L t M ( β ) = ( β ( t ) , ∂ t β ) where the next b ehaviour ∂ t β is defined by ∂ t β : t ′ 7→ β ( t > > t ′ ). This in fact mak es B 0 T the terminal Set -como del, where for an y other como del W , the unique como del map W → B 0 T sends w ∈ W to the b eha viour β w : t ∈ T A 7→ π A ( L t M ( w )). F or a monad T generated by op erations but no equations, a T -b eha viour β pro duces from each term t ∈ T A a sequence of op erations, called the tr ac e , which it had to ev aluate to run t do wn to its return v alue;these traces are the morphisms of the behaviour category . In fact, the return v alue itself do es not matter for computing the trace, so it is enough to consider the trace of T 1-terms only . F or a general monad T , the notion of trace as a sequence of op erations no longer mak es literal sense, but we can still define trace-equiv alence and reco ver the traces as the trace-equiv alence classes. Definition 2.5 ( β -equiv alence, b eha viour category) Let β b e a T -b eha viour. The relation ∼ β on T 1 is the least equiv alence relation such that ( t > > = u ) ∼ β ( t > > u ( β ( t )) for an y t ∈ T A and u : A → T 1. W rite 4 Garner, Rena t a, Wu [ t ] β for the ∼ β -equiv alence class of t . The b ehaviour c ate gory B T has as ob jects T -b eha viours, and as morphisms pairs of the form ( β , [ t ] β ) but which w e will simply write as [ t ] β . The morphism [ t ] β has source β and target ∂ t β . The identit y id β is [ return ] β , while the comp osite [ t ] β ; [ s ] ∂ t β is [ t > > s ] β . Theorem 2.6 Como d T ( Set ) ≃ [ B T , Set ] . Example 2.7 Consider the monad generated b y a single binary operation flip . F or an y term t ∈ T A and b eha viour β , we find b y successive applications of admissibilit y that β ( t ) = β ( flip > > flip . . . > > flip ( a 1 , a 2 )). In other words, β ’s b ehaviour is determined b y the v alues β ( flip n ) for eac h n , where flip n = flip > > . . . > > flip ∈ T 2, or more succinctly , by a map β : ω → 2. Since the theory is free, any suc h map will do, so that B 0 T is in bijection with the set of infinite binary streams W ∈ 2 ω . The trace of t ∈ T 1 at β is just the num b er of flip s tra versed by β when running down t , so a morphism in B T has the form n : W → ∂ n W for some n ∈ N . Example 2.8 F or the state monad T = ( S × − ) S , b ehaviours are in bijection with the set of states S , and so is T 1 / ∼ s : tw o unary terms t 1 , t 2 ∈ S S are s -equiv alent iff t 1 ( s ) = t 2 ( s ). So B T is the indiscrete (or c haotic) category with object-set S . As we can see, since the theory of state has man y equations, trace equiv alence lo oks more semantic in nature here. W e refer to [ 10 ] for more examples. 2.3 F r ames & L o c ales A fr ame is a p oset with infinite joins and finite limits satisfying the infinite distributiv e la w x ∧ ( W i y i ) = W i ( x ∧ y i ). W e write F rm for the category of frames and frame homomorphisms, i.e., monotone maps whic h preserv e infinite joins and finite meets. A lo c ale is simply a frame, but the category of lo cales is Lo c := F rm op . W e ha v e a functor O : T op → Lo c whic h sends X to its frame of op en sets O ( X ), and a con tinuous map f : X → Y to f − 1 : O ( Y ) → O ( X ). W e imagine a general locale to b e the lattice of op ens of some space, and the data of a con tinuous map to b e giv en b y the inv erse image map. T o sustain this fan tasy , w e ov erload notation b y writing O : Loc op → Frm for the identit y functor, writing its action on morphisms as O ( f ) := f − 1 , and calling elemen ts u ∈ O ( L ) op ens of L . Any lo cale L induces a top ological space pt ( L ) with set of points the lo cale morphisms x : 1 → L from the terminal locale 1 and op en sets giv en b y [ u ] = { x | x − 1 u = ⊤ } for u ∈ O ( L ). This yields a functor pt : Loc → T op , right adjoint to O . A lo cale L at whic h the adjunction counit is inv ertible is called sp atial , while a space at which the unit is in vertible is called sob er : th us, spatial lo cales and sober spaces form equiv alent categories. W e make use of the fact—see [ 17 , II 2.11]—that frames ma y b e constructed by generators and relations. F or example, the (frame of op ens of the) cop o w er lo cale A · L can b e presented b y generating op ens of the form ⟨ a 7→ u ⟩ for a ∈ A and u ∈ O ( L ), sub ject to the equations (1) W i ⟨ a 7→ u i ⟩ = ⟨ a 7→ W i u i ⟩ ; (2) V k i ⟨ a 7→ u i ⟩ = ⟨ a 7→ V k i u i ⟩ ; and (3) ⟨ a 7→ u ⟩ ∧ ⟨ a ′ 7→ v ⟩ = ⊥ for a = a ′ . These equations imply that every op en is uniquely of the form W a ∈ A ⟨ a 7→ u a ⟩ —whic h is consisten t with the fact that A -fold copow ers in Lo c corresp ond to A -fold pro ducts in F rm . In particular, since Lo c has cop o w ers, w e may consider Como d T ( Lo c ) as w ell as Como d T ( T op ), and w e now hav e: Prop osition 2.9 The adjunction O ⊣ pt : Lo c → T op lifts to O ⊣ pt : Como d T ( Lo c ) → Como d T ( T op ) . Pro of. In sketc h, since como dels are defined in terms of cop ow ers, it suffices to v erify that O and pt preserv e cop o w ers. This is ob vious for the left adjoin t O . As for pt , this is one of its standard prop erties, whic h follo ws from fact that the terminal lo cale 1 is connected, so that homming out of it preserv es copow ers. 2 F or a finitary monad, the terminal top ological como del—whic h by prop osition 2.3 is the terminal como del equipped with the op erational topology—is alwa ys a Stone space. When w e go to construct the lo cale of ob jects for the lo calic b ehaviour category , w e will similarly tak e the terminal localic comodel. This is also alwa ys going to b e an “infinitary Stone space”, in the sense that it is generated b y “clop en sets” but no longer compact. These are the str ongly zer o-dimensional lo cales as defined by Johnstone [ 16 ], also called ultr ap ar ac omp act by V an Name [ 30 ]. W e adopt the latter name since it is more compact (pun intended). Definition 2.10 [ 30 ] Let L b e a lo cale. An op en u ∈ O ( L ) is c omplemente d if it so in the usual lattice-theoretic sense: thus, there is some v ∈ O ( L ) with u ∧ v = ⊥ and u ∨ v = ⊤ . The set B ( L ) of complemen ted op ens of L inherits finite meets and joins from L , and so is a Boolean algebra. W e sa y that L is zer o-dimensional if u ∈ O ( L ) is the join of the complemen ted opens b elow it. 5 Garner, Rena t a, Wu A c over of L is a subset J ⊆ O ( L ) such that W j = ⊤ . A co ver J r efines J ′ if for every u ∈ J there is u ′ ∈ J ′ suc h that u ≤ u ′ . An extende d p artition P is a pairwise disjoint cov er, i.e., u ∧ v = ⊥ for an y u = v ∈ P . A p artition P is an extended partition whic h do es not contain ⊥ , and any extended partition P induces a partition P − = P \ { ⊥ } . A zero-dimensional lo cale L is str ongly zer o-dimensional or ultr ap ar ac omp act if every op en cov er is refined b y a partition. Stone spaces corresp ond to Bo olean algebras: this is known as Stone duality . Generalizing this, ultraparacompact locales corresp ond to Gr othendie ck Bo ole an algebr as . The notion is due to [ 30 ] but our nomenclature follo ws [ 12 , Definition 3.6]. Definition 2.11 A Gr othendie ck Bo ole an algebr a B J is a Boolean algebra equipped with a str ongly zer o-dimensional top olo gy , i.e., a collection J of partitions for B suc h that (i) J contains every finite partition; (ii) if P ∈ J and Q b ∈ J for eac h b ∈ P , then P ; Q := { b ∧ c | b ∈ P , c ∈ Q b } − ∈ J also; (iii) if P ∈ J and f : P → I is a surjective function, then eac h W f − 1 ( i ) exists in B and f − 1 P := { W f − 1 ( i ) | i ∈ I } ∈ J . Theorem 2.12 [ 30 , The or em 24] The c ate gory of ultr ap ar ac omp act lo c ales is dual ly e quivalent to the c ate gory of Gr othendie ck Bo ole an algebr as. Pro of. W e sketc h just the constructions. An ultraparacompact locale L induces a Bo olean algebra B ( L ) with strongly zero-dimensional top ology given b y the partitions of L (the op ens in a partition are necessarily complemen ted). On the other hand, a Grothendieck Bo olean algebra B J generates a lo cale of J -closed ideals in the usual w ay (as explained by Vick ers [ 31 ] or Johnstone [ 17 , I I 2.11]). 2 Ev ery Bo olean algebra can be regarded as a Grothendieck Bo olean algebra under the top ology of all finite partitions, and in this wa y , the ab ov e equiv alence restricts to the usual Stone dualit y . 2.4 She aves, L o c al Home omorphisms & B J -Sets An imp ortant asp ect of our results is that the source map σ : LB 1 T → LB 0 T of the lo calic b ehaviour category is a lo cal homeomorphism. Here, a map f of locales is a lo c al home omorphism if there is a co ver { v i } i of its domain such that, on each part of this co ver, the map f restricts to an op en injection. It is w ell-known that lo cal homeomorphisms in to a lo cale corresp ond to shea ves on a locale; and since LB 0 T is ultraparacompact, this leads to a particularly appealing description of the source map. F or indeed, shea ves on an ultraparacompact lo cale—or at least, those p ossessing a global section—can b e describ ed purely algebraically as sets with a suitable action of the corresp onding Grothendieck Bo olean algebra. This w as first shown by Bergman [ 6 ] for Bo olean algebras, and later extended to the Grothendiec k case [ 12 ]. One adv antage of this presen tation is that it makes clear what homomorphisms and congruences of B J -sets are. Definition 2.13 ( B J -sets) Let B b e a non-degenerate Bo olean algebra (i.e., 0 = 1 in B ). A B -set F consists of a set | F | equipp ed with one binary operation b ( − , − ) for each b ∈ B satisfying the equations b ( x, x ) = x b ( b ( x, y ) , z ) = b ( x, z ) b ( x, b ( y , z )) = b ( x, z ) ⊤ ( x, y ) = x ( ¬ b )( x, y ) = b ( y , x ) ( b ∧ c )( x, y ) = b ( c ( x, y ) , y ) (1) for all x, y , z ∈ | F | . If J is a strongly zero-dimensional topology on B , then a B J -set F consists of a B -set F further equipped with a P -ary operation P : | F | P → | F | for eac h partition P ∈ J . These op erations are required to satisfy , for any z ∈ | F | and families x, y ∈ | F | P , the axioms P ( λb.z ) = z P ( λb.b ( x b , y b )) = P ( λb.x b ) and b ( P ( x ) , x b ) = x b . (2) These axioms are rather intuitiv e if one reads each op eration b as an if-then-else op eration, and the infinitary operations P as infinitary switc h statements. T o see the corresp ondence with sheav es, view the elemen ts of a B J -set as a global section. Then the operations p erform amalgamation: for example b ( x, y ) is the unique amalgam of x | b and y | ¬ b . W e don’t ha ve to explicitly trac k local sections b ecause if we ha ve any 6 Garner, Rena t a, Wu global section t at all, then a lo cal section s o ver b manifests as a global section by taking the amalgamation of s and t | ¬ b . Hence, the category of non-empty B J -sets is equiv alen t to the category of sheav es o ver the lo cale presen ted b y B J that ha ve a global section. Because ev ery lo cal section of a B J -set F comes from some global section, the set of lo cal sections o ver some b is a quotien t of | F | , by the relation ≡ b defined as follows. Prop osition 2.14 [ 13 , Pr op osition 2.6] L et B J b e a non-de gener ate Gr othendie ck Bo ole an algebr a. A ny B J -set structur e on a set | F | induc es e quivalenc e r elations ≡ b for b ∈ B given by x ≡ b y ⇐ ⇒ b ( x, y ) = y . These e quivalenc e r elations satisfy: (i) if x ≡ b y and c ≤ b then x ≡ c y ; (ii) x ≡ ⊤ y iff x = y , and x ≡ ⊥ y always; (iii) for any P ∈ J and x ∈ X P , ther e is a unique z ∈ X such that z ≡ b x b for al l b ∈ P . In fact, any B -indexe d family of e quivalenc e r elations on | F | satisfying (i)–(iii) determine a B J -set, wher ein P ( λb.x b ) is the afor ementione d unique z . With this alternative definition, a B J -set homomorphism is a function that pr eserves the ≡ b r elations. The sheaf corresp onding to the source map will b e constructed as a quotien t of a free B J -set, so it is instructiv e to construct the free B J -set explicitly . Definition 2.15 (F ree B J -sets) Let A b e a set and B J a non-degenerate Grothendieck Bo olean algebra. Then the Gr othendie ck Bo ole an p ower A [ B ] J is the set of functions h : A → B for which { h ( a ) | a ∈ A } − ∈ J . Prop osition 2.16 [ 12 , R emark 3.17] L et A b e a set. Then A [ B ] J has a B J -set structur e given by P ( λb.h b ) := λa. W b b ∧ h b ( a ) , and this is the fr e e B J -set with A -many gener ators. The unit map A → A [ B ] J identifies a ∈ A with the map δ a for which δ a ( a ) := ⊤ and δ a ( a ′ ) := ⊥ for a ′ = a . Giv en a sheaf F on a lo cale L , the corresp onding lo cal homeomorphism E ( F ) → L is found by taking O ( E ( F )) as the frame of subsheav es of F . W e can re-express this in terms of the category of shea ves on L : this is a top os, and in particular admits a sub ob ject classifier Ω, so subshea ves of F corresp ond to sheaf maps F → Ω. Now if L is the ultraparacompact lo cale presented by B J , then Ω itself is a B J -set, and so the frame O ( E ( F )) is given by the set of B J -set homomorphisms F → Ω under p oint wise ordering. Ω as a B J -set turns out to b e B J itself with the action P ( λb.u b ) = W b ∈ P ( u b ∧ b ), or equiv alently with u ≡ b v ⇐ ⇒ b ∧ u = b ∧ v . Definition 2.17 Let L b e an ultraparacompact lo cale presented by B J , and F b e a B J -set. The ´ etale sp ac e E ( F ) corresponding to F is giv en b y O ( E ( F )) := Set B J ( F , O L ), and its associated pr oje ction map σ : E ( F ) → L is defined b y σ − 1 : u 7→ const u (the constan t function at u ). Lemma 2.18 L et L b e an ultr ap ar ac omp act lo c ale pr esente d by B J , and F b e a B J -set. Each element x ∈ | F | inje ctively induc es an op en ˆ x ∈ O ( E ( F )) define d by ˆ x := λy . W { b | x ≡ b y } . Mor e over, these gener ate O E ( F ) b e c ause every w ∈ O ( E ( F )) c an b e expr esse d as w = W x ∈| F | ˆ x ∧ const w ( x ) . Prop osition 2.19 L et L b e an ultr ap ar ac omp act lo c ale pr esente d by B J . Then the c orr esp onding lo c al home omorphism of a B J -set F is the map σ : E ( F ) → L . F or a sheaf F , the p oin ts of the corresp onding local homeomorphism E ( F ) are kno wn as germs . Here is the corresponding notion for B J -sets. Prop osition 2.20 L et L b e an ultr ap ar ac omp act lo c ale pr esente d by B J and F a B J -set. Then pt E ( F ) ∼ = P p ∈ pt L | F | / ≡ p , wher e x ≡ p y ⇐ ⇒ ∃ b ∋ p.x ≡ b y . A n element [ x ] p of this sp ac e is c al le d a germ . The top olo gy on this sp ac e is gener ate d by subb asic op en sets [ x | b ] = { [ x ] p | p ∈ b } . 3 The Lo calic Behaviour Category In this section, we construct the localic b eha viour category LB T . F ollowing the construction of the behaviour category , the locale of ob jects LB 0 T can b e c haracterized as the terminal lo calic comodel. On the other hand, w e will construct the lo cale of morphisms in a rather roundabout w a y as a sheaf ov er LB 0 T , but we hop e that this clarifies the nature of the construction. 7 Garner, Rena t a, Wu 3.1 The T erminal L o c alic Como del By proposition 2.9 , we see that the terminal top ological como del has to b e the spatialization of the terminal lo calic como del. But by prop osition 2.3 , the terminal top ological como del is the set of b ehaviours, equipp ed with the op erational top ology . This giv es us an idea of what the terminal lo calic como del lo oks lik e. Definition 3.1 Let T b e a monad on Set . The b ehaviour lo c ale LB 0 T is generated b y op ens [ b ] for eac h b ∈ T 2, sub ject to the follo wing equations for all t ∈ T A, u : A → T B , a = a ′ ∈ A and b ∈ B . [ t 7→ a ] ∧ [ t 7→ a ′ ] = ⊥ ( LB 0 - ⊥ ) [ t > > return a 7→ a ] = ⊤ ( LB 0 - η ) [ t > > = u 7→ b ] = _ a ∈ A [ t 7→ a ] ∧ [ t > > u ( a ) 7→ b ] ( LB 0 - µ ) Here w e write [ t 7→ a ] as shorthand for [ t > > = λa ′ .δ a ( a ′ )] with δ a ( a ′ ) = 1 when a = a ′ and 0 otherwise. Prop osition 3.2 L et T b e a monad on Set . Then the fol lowing e quations hold in LB 0 T : _ a ∈ A [ t 7→ a ] = ⊤ [ t > > return a 7→ a ′ ] = ⊥ [ t 7→ a ] ∧ [ t > > = u 7→ b ] = [ t 7→ a ] ∧ [ t > > u ( a ) 7→ b ] , wher e t ∈ T A , a = a ′ ∈ A , u : A → T B and b ∈ B . In fact, axiom ( LB 0 - µ ) can equiv alently b e replaced by a com bination of the first and third equations of prop osition 3.2 . W e c hose axioms ( LB 0 - µ ) and ( LB 0 - η ) b ecause of their resem blance to the admissibilit y condition of T -b eha viours. In any case, the axioms can b e “discov ered” as the necessary conditions for pro ving the univ ersal prop ert y of LB 0 T as the terminal localic como del, as in the follo wing prop osition. Prop osition 3.3 LB 0 T is the terminal lo c alic c omo del with c ointerpr etation L t M : LB 0 T → A · LB 0 T given by: L t M − 1 : ⟨ a 0 7→ [ t 0 ] ⟩ 7→ [ t 7→ a 0 ] ∧ [ t > > t 0 ] . No w by prop osition 2.9 we can conclude that the p oin ts of the b ehaviour lo cale are simply the admissible b eha viours of T . The following example demonstrates that in general the pro jection from localic como dels to topological comodels is lossy: it is a monad whose behaviour lo cale is non-trivial, but whic h admit no admissible behaviours. Example 3.4 Consider the monad T induced by the theory with generating operations get x / N for each x ∈ R . The theory has, in addition to the usual axioms of read-only state with R memory locations as can b e found in e.g. [ 27 ], the family of equations get x > > = λn. get y > > = λm. return ( n, m ) = get x > > = λn. get y > > = λm.f ( n, m ) where x = y ∈ R and f : N × N → N × N is an y function such that f ( n, m ) = ( n, m ) for n = m ∈ N . This sa ys t wo distinct memory cells cannot contain the same v alue, so B 0 T is empt y since the admissible behaviours in this case corresp onds to injectiv e memory configurations R ↣ N , of which there are (famously) none. Ho wev er, a term in this signature is w ell-founded, whic h is to say any particular execution of this computation term can only query finitely man y memory locations. So, from the program’s p ersp ectiv e, it can nev er b e sure that it is not in a non-injectiv e state configuration, since it needs to query uncoun tably-many memory locations to mak e a pigeonhole principle argument (i.e., non-injectivit y is semi-decidable). W e can think of this as ha ving a virtual address space of reals o v er coun tably many physical memory cells—the momen t 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 lo cale LB 0 T . By rep eated applica- tions of axiom ( LB 0 - µ ) w e can see that the behaviour lo cale for this monad LB 0 T can instead b e generated b y op ens of the form [ get x 7→ n ]. The axioms of the b ehaviour lo cale in this instance are equiv alen t to the axioms of the lo cale of injective functions from [ 19 , Example C1.2.9], whic h generates a non-trivial locale. F or these axioms and the pro of of corresp ondence, see section A.5 . The terminal top ological como del can b e shown to b e a Stone space. Corresp ondingly , we also hav e that the terminal lo calic como del is ultraparacompact, and this is because LB 0 T can be presen ted b y generators and partitions, instead of just cov erages. See section A.6 for details. Prop osition 3.5 L et T b e a monad. Then LB 0 T is ultr ap ar ac omp act. 8 Garner, Rena t a, Wu 3.2 The L o c ale of Morphisms F or a monad T , an y operation t ∈ T A induces a section η ( t ) : B 0 T → A · B 1 T of the b ehaviour category . This suggests we should reco v er a monad from the b ehaviour category b y taking suc h sections. But doing so allo ws “computations” which are computationally unreasonable, as the follo wing example shows. Example 3.6 Consider T induced by the free theory on one binary op eration [ b/ 2 |∅ ]. The b ehaviours are infinite binary streams an d morphisms are natural num b ers, as explained in example 2.7 . But we can ha ve a section which maps rep eat (10) 7→ 42 and any other stream to 21. Using only the op eration b/ 2 whic h reveals only one digit each time, it is impossible to determine in finite time that the input stream is precisely rep eat (10) = 101010 . . . , so this do es not represen t a reasonable computation at all. This example also sho ws ho w the b eha viour category B T fails to represent T ev en if T is deterministic and stateful, and hence wh y w e really need to consider the top olo gic al structure on B 0 T . Hence, w e w an t the source map of the lo calic b eha viour category such that only the feasible computations η ( t ) (and as little else) b e allo w ed as sections. Therefore, instead of directly constructing the lo cale of morphisms LB 1 T , w e will first construct a sheaf—or more precisely a B J -set—o ver LB 0 T whose generating sections are the T 1-computations, and then take the corresponding local homeomorphism as the source map. F or the remainder of this section, B J is the Grothendiec k Bo olean algebra of complemen ted op ens in O LB 0 T . Of course, the sheaf should not b e generated fr e ely : w e can see in B T that if a term factors as t > > = u , then at eac h β ∈ [ t 7→ a ] w e ha ve t > > = u ∼ β t > > u ( a ), so the global sections t > > = u and t > > u ( a ) are equal when restricted to the region [ t 7→ a ]. Definition 3.7 Let T b e a monad. The she af of tr ansitions F T asso ciated to T is a quotient of the free B J - set T 1[ B ] J with generators T 1, by the smallest B J -congruence identifying t > > = u ≈ P ( t ) ( λ [ t 7→ a ] .t > > u ( a )) where t ∈ T A , u : A → T 1 and P ( t ) = { [ t 7→ a ] | a ∈ A } − is the partition canonically associated to T . This definition is rather intuitiv e, but it is not at all ob vious what its relationship is with the morphisms of the b ehaviour category introduced in definition 2.5 . T o see the connection, w e pro ve that t wo elements x, y ∈ T 1[ B ] J are related by ≈ just when they are p oint wise trace-equiv alent, as expressed b y the follo wing definition and accompanying lemma. Definition 3.8 Let T b e a monad of rank κ . Define the LB 0 T -v alued relation of tr ac e e quivalenc e on T 1: J m ∼ m ′ K = _ k ≥ 1 J m ∼ k m ′ K where J m 1 ∼ k m k K = _ { V k − 1 i =1 J m i ∼ 1 m i +1 K | m 2 . . . m k − 1 ∈ T 1 } (3) J m ∼ 1 m ′ K = _ [ t 7→ a ] A ∈ Set , | A | ≤ κ, t : T A, u, u ′ : A → T 1 , a ∈ A, u ( a ) = u ′ ( a ) , m = t > > = u, m ′ = t > > = u ′ (4) If u ∈ O LB 0 T is a complemen ted open, we define m ∼ u m ′ to b e true whenever u ≤ J m ∼ m ′ K (if u = ⊤ , w e simply write m ∼ m ′ ). This definition seems complicated, but it is just the p oin t-free transliteration of the definition for β -equiv alence. Lemma 3.9 J − ∼ − K is an e quivalenc e r elation, in the sense that for al l m 1 , m 2 , m 3 ∈ T 1 , J m 1 ∼ m 1 K = ⊤ J m 1 ∼ m 2 K ≤ J m 2 ∼ m 1 K J m 1 ∼ m 2 K ∧ J m 2 ∼ m 3 K ≤ J m 1 ∼ m 3 K . Conse quential ly, al l the ∼ u ar e e quivalenc e r elations in the usual sense. Lemma 3.10 L et x, y ∈ T 1[ B ] J . Then x ≈ y iff for e ach m, n ∈ T 1 , we have m ∼ x ( m ) ∧ y ( n ) n . Mor e over, m ≡ b n ⇐ ⇒ m ∼ b n . Be w arned that we abuse notation by confusing elemen ts of T 1 with the induced element of F T , ev en though the unit map δ : T 1 → | F T | from prop osition 2.16 is in general not injective. Recall from proposition 2.19 that the corresp onding lo cal homeomorphism is the lo cale of homomorphisms Set B J ( F T , LB 0 T ). By the univ ersal prop erty of free algebras, such homomorphisms corresp ond to functions 9 Garner, Rena t a, Wu w : T 1 → LB 0 T resp ecting the generating equation w ( t > > = u ) = P ( t ) ( λ [ t 7→ a ] .t > > u ( a )). W e can restate this in terms of trace equiv alence b et w een generators, as follo ws (proof of corresp ondence can b e found in section A.8 ). Definition 3.11 The lo c ale of tr ansitions LB 1 T is the p oint wise-ordered p oset of functions w : T 1 → O ( LB 0 T ) for which m 1 ∼ b m 2 implies w ( m 1 ) ≡ b w ( m 2 ) for any m 1 , m 2 ∈ T 1 and b ∈ B . W e are now in the p osition to in tro duce the lo calic b ehaviour category , but b efore we do so we sp ecialize lemma 2.18 and prop osition 2.20 to our locale of transitions, which relates the localic b ehaviour category bac k to the usual b ehaviour category . Lemma 3.12 Every op en w ∈ O ( LB 1 T ) c an b e expr esse d as w = W m ˆ m ∧ const w ( m ) , so the fr ame O ( LB 1 T ) is gener ate d by op ens of the form [ m | b ] := λn. J m ∼ n K ∧ [ b ] for m ∈ T 1 and b ∈ T 2 . Prop osition 3.13 The set of p oints pt ( LB 1 T ) is bije ctive with B 1 T . Pro of. By prop osition 2.20 , we know that pt ( LB 1 T ) ∼ = Σ β ∈ pt LB 0 T F T / ≡ β . But w e kno w pt LB 0 T ∼ = B 0 T , so the β really are just admissible behaviours. Next, observ e that ev ery x ∈ F T can be expressed in the form x = P ( λb.m b ), and hence x ≡ b m b for the b ∈ P with β ∈ b . Hence, we hav e F T / ≡ b ∼ = T 1 / ≡ β ∼ = T 1 / ∼ β o ver eac h β . Therefore pt ( LB 1 T ) ∼ = Σ β ∈ B 0 T T 1 / ∼ β = B 1 T . 2 Finally , the following lemma is useful for we will often hav e to consider v arious pullbacks with the source map, suc h as when we define the comp osition map of the lo calic b eha viour category in definition 2.5 b elow. Lemma 3.14 The pul lb ack L × LB 0 T LB 1 T of a lo c ale map f : L → LB 0 T along the sour c e map σ : LB 1 T → LB 0 T has fr ame of op ens given by the p ointwise-or der e d p oset of functions h : T 1 → O L for which m 1 ∼ b m 2 implies h ( m 1 ) ∧ f − 1 b = h ( m 2 ) ∧ f − 1 b for any m 1 , m 2 ∈ T 1 and b ∈ B . In terms of p oints, such a function h con tains all the p oin ts ( x, [ m ] β ) for whic h x ∈ h ( m ) and f ( x ) = β . Definition 3.15 Let T be a monad. Then the lo c alic b ehaviour c ate gory LB T has: • lo cale of ob jects LB 0 T giv en b y the terminal lo calic T -como del; • source map σ : LB 1 T → LB 0 T giv en b y σ − 1 ( u ) := const u ; • target map τ : LB 1 T → LB 0 T giv en b y τ − 1 ( u ) := λm. L m M − 1 u ; • iden tity map ι : LB 0 T → LB 1 T giv en b y ι − 1 ( w ) := w ( return ); • comp osition map µ : LB 1 T × LB 0 T LB 1 T → LB 1 T giv en b y µ − 1 : w 7→ λm, n.w ( m > > n ), where, by lemma 3.14 we identify O ( LB 1 T × LB 0 T LB 1 T ) with the p oset of functions h : T 1 × T 1 → O ( LB 0 T ) for whic h m 1 ∼ b m 2 implies h ( m 1 , n ) ≡ b h ( m 2 , n ) and n 1 ∼ b n 2 implies h ( m, n 1 ) ≡ L m M − 1 bh ( m, n 2 ). A function h : T 1 × T 1 → O ( LB 0 T ) as ab ov e corresp onds to the op en set containing pairs of germs ([ m ] β , [ n ] ∂ m β ) with β ∈ h ( m, n ). F or the verification that this is a lo calic category , see section A.10 . 3.3 T op olo gic al Behaviour Cate gory & Finitary Monads W e hav e already seen that pt LB 0 T ∼ = B 0 T and pt LB 1 T ∼ = B 1 T (prop osition 3.13 ). Being a righ t adjoin t, the functor pt preserv es limits and hence lifts to internal categories. Hence w e get a top olo gic al b ehaviour c ate gory B T := pt ( LB T ), which is just an appropriately topologized v ersion of the b eha viour category . Definition 3.16 (T opological b eha viour category) Let T b e a monad. The op er ational top olo gy on B 1 T is generated by subbasic op ens of the form [ m | b ] := { [ m ] β | β ∈ [ b ] } . T aking B 0 T and B 1 T with their op erational topologies mak es the structure maps of the b ehaviour category con tinuous, yielding the top olo gic al b ehaviour c ate gory B T . While example 3.4 shows that we need the full force of the lo calic b ehaviour category for infinitary monads, for finitary monads it suffices to consider the top ological b ehaviour category b ecause the in volv ed lo cales LB 0 T and LB 1 T are spatial, which w e shall no w pro ve. The spatiality of LB 0 T is easily seen from the definition. The finitariness of T means that axiom ( LB 0 - µ ) of definition 3.1 can be expressed by a 10 Garner, Rena t a, Wu finite join, and so the axioms generate a distributiv e lattice—in fact a Bo olean algebra BB 0 T —from whic h the frame O LB 0 T is freely generated. Lo cales freely generated from a distributiv e lattice in this wa y are w ell-known to be spatial [ 17 , I I 3.4], and in this case the space B 0 T corresp onds to the Stone dual of BB 0 T . As for LB 1 T , it is spatial because LB 1 T is determined by a sheaf F T o ver a spatial lo cale LB 0 T , and shea ves only dep end on the lattice of op ens of its base space. More precisely , we observe that the source map σ : B 1 T → B 0 T of the top ological b eha viour category is also a local homeomorphism, and it has the same sections as the (source map of the) lo calic b eha viour category , and is th us the same sheaf. Lemma 3.17 L et T b e a finitary monad. Then for any glob al se ction s of σ : B 1 T → B 0 T , ther e is a finite family of p airs { ( b i ∈ BB 0 T , m i ∈ T 1) } i ∈ I such that { b i } i ∈ I is a finite p artition and s maps β ∈ b i 7→ [ m i ] β . Mor e over, this family is unique up to tr ac e e quivalenc e: if we have two such families { ( b i , m i ) } i ∈ I and { ( b j , n j ) } j ∈ J then for al l i, j we have m i ∼ b i ∧ b j n j . Pro of. Eac h β ∈ B 0 T admits an op en neigh b orho od s − 1 [ m β | return 1] where t β is some representativ e of the equiv alence class s ( β ). This induces an op en cov er on B 0 T whic h is refined by a finite partition { b i } i ∈ I since B 0 T is a Stone space. It suffices to pic k m i to b e the m β of an op en s − 1 [ m β | return 1] refined b y b i . The uniqueness under trace equiv alence is easy to see b ecause for an y β ∈ b i ∧ b j , we hav e [ m i ] β = s ( β ) = [ m j ] β . The spatialit y of LB 0 T then ensures this corresponds to m i ∼ b i ∧ b j m j . 2 It is not hard to see that a family as in the lemma ab ov e defines an element of the free BB 0 T -set, and that the uniqueness translates to the same condition as in lemma 3.10 . That is, the global sections of B T corresp ond to the sheaf of transitions o ver BB 0 T , and hence O ( B 1 T ) ∼ = LB 1 T . Hence w e ha v e: Prop osition 3.18 F or finitary T , LB 0 T and LB 1 T ar e sp atial, i.e., LB T has enough states and tr ansitions. 4 The Stone A djunction for Monads In this section, w e functorialize the construction of the localic b eha viour category and pro ve that it has a righ t adjoint by taking sections of the source map. Here, the correct morphisms betw een lo calic categories are r etr ofunctors , not functors lik e usual. Just as we view topological/lo calic categories as transition systems, w e can view a retrofunctor C ⇝ D as a simulation of transition systems. Definition 4.1 Let C and D b e small categories. A r etr ofunctor F : C ⇝ D consists of tw o functions F 0 : C 0 → D 0 and F 1 : C 0 × D 0 D 1 → C 1 , where C 0 × D 0 D 1 is the pullbac k of F 0 along σ D . In other w ords, giv en c ∈ C 0 and f ∈ D ( F 0 c, d ) we get a lift F 1 ( c, f ) : c → c ′ suc h that F 0 c ′ = d . These are further required to respect iden tity and comp osition: F 1 ( c, id F 0 c ) = id c F 1 ( c, g ◦ f ) = F 1 ( c ′ , g ) ◦ F 1 ( c, f ) where F 1 ( c, f ) : c → c ′ (5) If C and D are in ternal categories, then there is an appropriate notion of internal retrofunctor which mak e the appropriate diagrams comm ute, as describ ed b y Clarke [ 7 , definition 2.10]. W rite Lo cRetro and T opRetro for the categories of in ternal categories and retrofunctors in Loc and T op resp ectiv ely . Prop osition 4.2 The assignment T 7→ LB T extends c ontr avariantly to a functor LB : Mnd r ( Set ) → Lo cRetro op , and similarly a functor B : Mnd ω ( Set ) → T opRetro op . Pro of. A monad morphism ϕ : T → S induces a retrofunctor whose action on ob jects LB 0 ϕ : LB 0 S → LB 0 T is giv en on generating op ens by ( LB 0 ϕ ) − 1 : [ b ] 7→ [ ϕ ( b )]. F or the action on morphisms ( LB 1 ϕ ) : LB 0 S × LB 0 T LB 1 T → LB 1 S , by lemma 3.14 we can iden tify O ( LB 0 S × LB 0 T LB 1 T ) with an appropriate p oset of functions h : T 1 → O ( LB 0 S ). The action is then simply given by ( LB 1 ϕ ) − 1 : w 7→ w ◦ ϕ 1 . W e refer to section A.11 for more details and the verification of functorialit y . 2 On the other hand, if w e view a localic category LC as a transition system, what is a computation on LC ? W ell, a computation (of output type A ) should sp ecify , for eac h state c ∈ LC 0 , a transition out of c (the “side-effect” of the computation) along with an output in A . In other words, the computations are glob al se ctions of the source map, or more precisely a dis join t, A -indexed, jointly global family of partial sections. Indeed, we get a monad of such sections—notice that this lo oks very muc h like a state monad except w e also keep track which transitions are tak en, not just the end state. 11 Garner, Rena t a, Wu Prop osition 4.3 L et LC b e a lo c alic c ate gory. Then the endofunctor Γ LC ( A ) = { s : LC 0 → A · LC 1 | id LC 0 = LC 0 s → A · LC 1 π LC 1 → LC 1 σ → LC 0 } on Set (with the action on f : A → B given by p ost-c omp osing f · LC 1 ) admits a monad structur e given, for arbitr ary a ∈ A , s ∈ Γ LC A, u : A → Γ LC B by return a = LC 0 LC 1 A · LC 1 ι υ a and s > > = u = LC 0 A · LC 1 LC 1 × ( B · LC 1 ) B · ( LC 1 × LC 1 ) B · LC 1 s ⟨ π ,u ◦ ( A · τ ) ⟩ ∼ = µ . In terms of p oints, we have return a : c 7→ ( a, id c ) and s > > = u : c 7→ ( b, g ◦ f ) wher e ( a, f ) =: s ( c ) and ( b, g ) =: u ( a )( τ ( f )) , while in terms of op ens we have ( return a ) − 1 : ⟨ a ′ 7→ w ⟩ 7→ if a = a ′ then ι − 1 w else ⊥ ( s > > = u ) − 1 : ⟨ b 7→ w ⟩ 7→ _ a ∈ A s − 1 D a 7→ _ { v 1 ∧ τ − 1 u ( a ) − 1 ⟨ b 7→ v 2 ⟩ | v 1 × v 2 ≤ µ − 1 ( w ) } E . Mor e over, the assignment LC 7→ Γ LC defines a c ontr avariant functor Γ : Lo cRetro op → Mnd r ( Set ) . Pro of. A straigh tforw ard diagram c hase rev eals that unitalit y and asso ciativit y of the monad structure is inherited from the unitalit y and asso ciativity of LC . F unctorialit y is automatically obtained when w e pro ve the adjunction of theorem 4.4 , so w e lea v e it as an exercise to define the action of retrofunctors. 2 An y computation t ∈ T A defines a global section η ( t ) : LB 0 T → A · LB 1 T of the b ehaviour category , defined b y η ( t ) − 1 : ⟨ a 7→ w ⟩ 7→ [ t 7→ a ] ∧ w ( t > > return ) on generating op ens. This defines the unit map of an adjunction b etw een LB and Γ, whic h brings us to the main adjunction of this pap er. Theorem 4.4 LB : Mnd r ( Set ) Lo cRetro op : Γ ⊣ . Pro of. The counit map ε : LC ⇝ LB Γ LC is giv en b y ε − 1 0 : [ s ] 7→ s − 1 ⟨ 1 7→ ⊤⟩ , and ε − 1 1 : u 7→ λm ∈ T 1 .m − 1 u . See section A.12 for the verification of the adjunction. 2 W e also ha v e a functor B := pt LB : Mnd r ( Set ) → T opRetro op , and this similarly admits a righ t adjoint Γ, but it is not w ell behav ed b ecause B T loses to o muc h information ab out the infinitary monad T , as exemplified b y example 3.4 . How ev er, b y prop osition 3.18 , if w e restrict to T ∈ Mnd ω ( Set ) then LB T is spatial and corresp onds to the topological category B T . The righ t adjoint of the functor B : Mnd ω ( Set ) → T opRetro op is giv en b y taking the monad of finitary se ctions Γ ω C for a top ological category C . Theorem 4.5 B : Mnd ω ( Set ) T opRetro op : Γ ω . ⊣ Pro of. The inclusion i : Mnd ω ( Set ) → Mnd r ( Set ) has a right adjoin t given b y lan j ( − ◦ j ) where j : Set ω → Set is the usual full inclusion of the category of finite sets (as follows from relative monad theory [ 5 ]). Then w e ha ve the desired adjunction by comp osing B ⊣ Γ with i ⊣ lan j ( − ◦ j ), noting that Γ ω := lan j (Γ( − ) ◦ j ). 2 5 The Stone Dualit y for Hyp eraffine-Unary Monads This final section is devoted to pro ving that the adjunction 4.4 is idempotent, and to c haracterize its fixed p oin ts. On the monad side, the fixed p oints corresp ond to those monads whose category of Eilenberg- Mo ore algebras are cartesian-closed. These were first syn tactically c haracterized b y Johnstone [ 18 ], but [ 12 ] pro vided an improv ed syntactic c haracterization as those monads which admit a hyp er affine-unary de c omp osition . On the side of localic categories, the fixed points are the ample lo c alic c ate gories , i.e., whose source maps are lo cal homeomorphisms and whose locales of objects are ultraparacompact. In fact, this equiv alence betw een h yp eraffine-unary monads and ample localic categories is originally due to the first-named author [ 13 ]. In addition to filling in details about the equiv alence, our con tribution is to env elop e the equiv alence in an adjunction, which yields a process of hyp er affine-unary c ompletion for monads on one hand, and a pro cess of amplific ation for lo calic categories on the other. 12 Garner, Rena t a, Wu 5.1 Hyp er affine-Unary Monads What exactly is the difference b et w een T and Γ LB T ? Because of the unit map, all computations in T liv e inside Γ LB T . The answ er is that T adds additional op erations t whic h predicts the output of t without p erforming the side effect of t . Computationally , this can be though t of as p erforming t and then rolling the state back, or more mystically as scrying 5 the future. Example 5.1 (Binary Input with Scrying) Let T b e induced by [ b/ 2 | ] as in example 3.6 . The top ology of B 0 T is the cantor space, and hence generated by op en sets V b = { β | β ⊒ b } of infinite streams whic h extend a giv en finite string b . By contin uity and compactness of B 0 T , any global section s ∈ Γ B T ( A ) is therefore describ ed (non-uniquely) by a pair ( B , | s | : B → N × A ) where B is a finite set of finite strings B ⊆ 2 <ω that join tly cov er all infinite streams, and | s | assigns to eac h element of B a pair ( n, a ) consisting of the num b er n of digits to consume from the stream, and the output a . Notice that this rules out the section w e introduced in example 3.6 . As an example, the binary tree t = b ( a 0 , b ( b ( a 1 , a 2 ) , a 3 )) ∈ T A , induces a section η ( t ) which is described b y the assignmen ts { 0 7→ (1 , a 0 ); 100 7→ (3 , a 1 ); 101 7→ (3 , a 2 ); 11 7→ (2 , a 3 ) } . In general, an assignment b 7→ ( n, a ) for a section of the form η ( t ) must satisfy n ≥ length ( b ). That is, to use information ab out the first k = length ( b ) digits of the stream you must consume at least k digits. How ev er, in general sections do not need to resp ect this: the assignments { 0 7→ (0 , a 0 ); 10 7→ (1 , a 1 ); 11 7→ (1 , a 2 ) } describ e a p erfectly acceptable section s . W e can think of s as lo oking ahe ad or scrying the first tw o digits of the stream, b efore deciding what to do. Indeed, for any section s , we ha ve a corresp onding s ∈ Γ B T ( A ) which outputs the same v alues as s , but only mak es iden tity transitions. Then s factors as s = s > > = λa.s > > return a . It is easy to see in general that monads of the form Γ LC alw ays has this factorization property , since a section s alw ays admits a cousin s whic h sends ob jects to the same output, but replaces the morphism by iden tity morphisms—the scry corresp onding to s . Monads satisfying this factorization prop erty , called hyp er affine-unary monads in [ 12 ], suffices to characterize the fixed points of adjunction 4.4 . Definition 5.2 (Hyp eraffine-unary) Let T b e a monad. A computation h ∈ T A is hyp er affine if h > > return a = return a and h > > = λa 1 .h > > = λa 2 . return ( a 1 , a 2 ) = h > > = λa. return ( a, a ) . (6) The monad T is hyp er affine-unary if for every computation t ∈ T A , there is a unique h yp eraffine t ∈ T A suc h that t = t > > = λa. ( t > > return a ). Any hyperaffine-unary monad admits a submonad H of h yp eraffine op erations ([ 12 , Prop osition 6.1]). Prop osition 5.3 L et LC b e a lo c alic c ate gory. Then Γ LC is hyp er affine-unary. Pro of. A computation reveals that ( h > > return ) − 1 w = W a h − 1 ⟨ a 7→ w ⟩ , while return − 1 w = ι − 1 w . So these t wo are equal iff h > > return a = return a . Notice that we do not use the second condition of being h yp eraffine, b ecause it is automatically true for an y h satisfying the first condition (also known as affine ). No w, suppose that such a h yp eraffine s for a section s ∈ Γ LC ( A ). Then a straigh tforw ard computation (using the characterization of hyperaffines) reveals that the condition s = s > > = λa.s > > return a implies s − 1 ⟨ a 7→ w ⟩ = s − 1 ⟨ a 7→ ⊤⟩ ∧ ι − 1 w whic h determines s − 1 as a w ell-defined frame homomorphism. See section A.13 for the computations. 2 Hyp eraffine-unary monads admit a particularly nice presentation of the lo calic b ehaviour category , whic h greatly aids us in pro ving the c haracterization of the fixed points. Lemma 5.4 L et T b e a hyp er affine-unary monad with hyp er affine submonad H . Then O ( LB 0 T ) is gener ate d by H 2 J wher e H 2 admits a Bo ole an algebr a structur e and J is a str ongly zer o-dimensional top olo gy define d by { P ( h ) | h ∈ H A } with P ( h ) = { [ h 7→ a ] | a ∈ A } . Her e, we abuse notation by writing [ h 7→ a ] for h > > = λa ′ .δ a ( a ′ ) ∈ H 2 . Mor e over, the map δ : T 1 → F T is an isomorphism, with T 1 admitting a H 2 J -set structur e given by P ( h ) ( λa.m a ) := h > > = λa.t a . 5 A particularly p otent analogy is to think of the environmen t as an (infinite) dec k of playing cards, and of the program as the pla yer, in which case a scry allows the play er to lo ok at the top n ∈ N cards of their dec k before putting it back in the same order. This happ ens for example in the trading card game Magic: The Gathering . 13 Garner, Rena t a, Wu Pro of. The Grothendieck Bo olean algebra structure H 2 J is established in [ 12 ]. The Boolean algebra structure on H 2 is giv en b y ⊤ = return 1, h 1 ∧ h 2 = h 1 > > = (0 7→ return 0; 1 7→ h 2 ) and ¬ h = h > > = (0 7→ return 1; 1 7→ return 0), and from this it is easy to see that H 2 satisfies ( LB 0 - ⊥ ) , ( LB 0 - η ) , [ t > > return a 7→ a ′ ], and W a ∈ A [ t 7→ a ] = ⊤ for finite sets A . Then the only missing axioms are W a ∈ A [ t 7→ a ] = ⊤ for infinite A , but these are precisely the partitions in J . Hence H 2 J generates O ( LB 0 T ). The inv erse to δ : T 1 → F T is witnessed by δ − 1 : x 7→ h > > = λb.x − 1 b , where h ∈ H P is a hyperaffine realizing the partition P ( h ) induced b y x : T 1 → H 2. On one hand we hav e δ δ − 1 ( x ) = δ ( h > > = λb.x − 1 b ) = P ( δ ( h > > x − 1 b )) = P ( δ ( x − 1 b )) = x . On the other hand, δ − 1 δ ( t ) = return ⊤ > > = λb.δ ( t ) − 1 b = δ ( t ) − 1 ⊤ = t . 2 Prop osition 5.5 A monad T is hyp er affine-unary iff the unit map η T : T → Γ LB T is an isomorphism. Pro of. ( ⇐ = ) Supp ose no w the unit map is an isomorphism. Then the h yp eraffine-unary factorization of Γ LB T (proposition 5.3 ) m ust transfer along the unit map onto T . ( = ⇒ ) F or the conv erse direction, we make use of lemma 5.4 , which basically sa ys an y global section s ∈ Γ LB T A iden tifies a hyperaffine h ∈ H A and a family u : A → T 1 of unary computations, and the comp osite h > > = λa.u ( a ) > > return a induces the section s . See Section A.14 for the details. 2 5.2 A mple L o c alic Cate gories and Stone Duality On the other side of the adjunction, what is the relationship b et ween a lo calic category LC and the b eha viour category LB Γ LC ? W ell, Γ only considers the partitioning sections of LC , so is only sensitive to the ultr ap ar ac omp act quotient of LC 0 , i.e., whose frame of op ens is the ultraparacompact frame generated b y taking the zero-dimensional top ology of partitions on the Bo olean algebra B ( LC 0 ). Moreo ver, LB then reconstructs the lo cale of morphisms from only the sections o ver this ultraparacompact quotien t. So this reconstruction is p erfect if in the first place LC 0 is ultraparacompact and the source map is a local homeomorphism. These are called ample lo c alic c ate gories [ 13 ]. Definition 5.6 A lo calic category LC is ample if σ LC is a lo cal homeomorphism and LC 0 is ultraparacompact. A top ological category C is ample if σ C is a local homeomorphism and C 0 is a Stone space. W rite AmpLo cRetro (resp. AmpT opRetro ) for the full sub category of Lo cRetro (resp. T opRetro ) con taining the ample localic (resp. top ological) categories. Prop osition 5.7 A lo c alic c ate gory LC is ample iff the c ounit map ε LC : LC ⇝ LB Γ LC is an isomorphism. The com bination of prop ositions 5.5 and 5.7 allow us to derive the titular Stone duality for monads. Theorem 5.8 The adjunction of the or em 4.4 is idemp otent and its fixe d p oints ar e the e quivalent c ate gories HUMnd r ≃ AmpLo cRetro . F urthermor e, this e quivalenc e r estricts to HUMnd ω ≃ AmpT opRetro . Pro of. It follo ws from prop osition 5.7 that ε LB is an isomorphism, since LB T is ample for an y monad T . Hence adjunction 4.4 is idemp otent, and prop ositions 5.5 and 5.7 characterize the fixp oin ts. F or the finitary monad case, we kno w that O : T op → Lo c preserv es pullbacks along lo cal homeomorphisms. So induces a functor O : AmpT opRetro → AmpLo cRetro . The equiv alence HUMnd r ≃ AmpLo cRetro when restricted to finitary monads factors through this functor. This factorization HUMnd ω → AmpT opRetro is essen tially surjectiv e on objects, b ecause no w taking the global sections monad on an ample topological category C , the compactness of the base space C 0 ensures this monad is the monad Γ ω C of finitary sections. Hence, w e get an equiv alence HUMnd ω ≃ AmpT opRetro . 2 Example 5.9 Ev ery Grothendieck Bo olean algebra B J presen ting a lo cale L is asso ciated to a distributions monad D B ( A ) := A [ B ] J whose computations are all hyperaffine, and hence hyperaffine-unary . Under the equiv alence of theorem 5.8 , D B corresp onds to the lo calic category LB D B with LB 0 D B = LB 1 D B = L and source map σ = id : L → L . Of course, if J consists of only finite partitions, then L = Sp ec ( B ) is the Stone dual of B , and so our equiv alence subsumes the classical Stone dualit y . 14 Garner, Rena t a, Wu 6 Conclusion & Prosp ectus Summary . W e constructed the lo calic b eha viour category LB T (definition 3.15 ) asso ciated to a rank ed monad, and show ed that the functor LB : Mnd r ( Set ) → Lo cRetro op admits a right adjoin t Γ by taking global sections (theorem 4.4 ). W e further show ed that this adjunction is idempotent, and restricts to a kno wn equiv alence b etw een the full sub category of h yp eraffine-unary monads, and the full sub category of ample lo calic categories (theorem 5.8 ). On Classifying Como dels. Recall from theorem 2.6 that the b ehaviour category classifies como dels. It is easy to pro v e a similar classification theorem for lo calic T -como dels, this time as LB T -spaces, i.e., lo cales equipp ed with an action b y LB T , which w e omit for brevity . In fact, we hav e a more abstract p ersp ective on this classification, whic h w e shall now quickly sketc h. T -como dels are particular instances of right T -mo dules , and the construction of the localic b ehaviour category can be generalized to arbitrary righ t T -mo dules M : Set → Set (reco vering the original b y considering T as a right mo dule of itself). The resulting construction is no longer a category , but rather a fibr e d LB T -sp ac e σ : LB 1 M → LB 0 M , i.e., a family of lo calic T -como dels v arying con tinuously ov er LB 0 M . F ollo wing [ 9 ], w e can explain this σ as the free comodel asso ciated to M , with the fibration b eing necessary because the free comodel liv es not in Set , but rather in the top os of sheav es Sh ( LB 0 M ). Ho w ever, if M is itself a comodel, then LB 0 M ∼ = 1 is the singleton space, and LB 1 M , whic h is now just a LB T -space, corresp onds exactly to the comodel M . Prosp ectus. Stone dualities underlie completeness theorems for logics. In future w ork, we hop e to use our Stone duality to constructing a logic for reasoning ab out monadic programs, such as can b e expressed in Moggi’s monadic metalanguage [ 22 ]. W e expect this logic to take the shap e of propositional dynamic logic (PDL) [ 15 ], since the lo calic b eha viour category LB T can b e seen as a Kripke mo del whose prop ositions are in terpreted as clop ens of LB 0 T and whose programs are (generated by) T 1. The mo dalit y [ m ] ϕ is in terpreted as L m M − 1 ϕ . The adv antage of this approac h is that, in ligh t of theorem 5.8 , w e may think of Γ LB T as unive rsally completing T with prop ositions (the “scrying” hyperaffines), i.e., w e are really in terpreting our logic in Γ LB T . This lifts a constraint in previous w orks on monadic program logics such as Gonc harov & Schr¨ oder [ 14 ] whic h require the original monad T to con tain sufficient inno c ent c omputations to in terpret the prop ositions in the first place. Ha ving brought up Gonc harov & Schr¨ oder [ 14 ], w e also ought to discuss their use of unary computations as propositions, con trasting with our use of binary computations (in Γ LB T ). This con trast seems to stem from their assumption that computations ma y fail to terminate, leading to an information ordering on computations ala domain theory , whereas in this pap er, the c hoice to use comodels (which always return a v alue) is tan tamount to assuming that computations alw ays terminate. Therefore, we hop e in the future to explore the Stone-t yp e dualit y that arises when we consider como dels r esidual [ 2 , 20 , 29 ] o ver the lifting monad { ⊥ } + − . Just as the global sections monad is a v ery fancy state monad, we exp ect the right adjoin t of this duality to tak e monads of partial sections, i.e., fancy partial state monads. It is also natural to consider generalizations b eyond monads on Set . In this paper, many constructions explicitly talk ab out elements of monads, so an appropriate generalization will replace elemen ts with morphisms in the Kleisli category . W e can shed a preliminary ligh t on this to o, based on the very general adjunction introduced in [ 8 ] b et w een r estriction c ate gories r e alize d in Lo c and p artite c ate gories internal in Lo c . Here, our lo calic b eha viour category is the partite in ternal category corresp onding under this adjunction to a restriction category generated by the functor A 7→ A · LB 0 : Kl ( T ) → Lo c . This pro vides a description of the localic b ehaviour category whic h a voids talking about elemen ts of T , so generalization efforts ough t to b egin by b etter understanding the construction of this restriction category . Finally , the existence of a sp ectral dualit y for monads raise the in teresting possibility of dev eloping a scheme the ory of monads . Recall the notion of a scheme of rings from algebraic geometry: these are lo cally ringed shea ves whic h are locally isomorphic to the spectrum of a commutativ e ring. The analogy here is b et w een rings and (hyperaffine-unary) monads, with the sp ectrum of a ring (whic h is a sheaf ) analogous to the source map of LB T . At first appro ximation, a sc heme of monads should then b e a localic category S , whic h “locally resem bles” LB T for some T . The idea is that in a sc heme S , the monad (and hence the syn tax) in pla y v aries con tinuously ov er the base space S 0 . This should allow for the mo delling of effects whose syn tax is not fixed, suc h as lo c al state—it w ould b e nice if “lo cal state” = “lo cally a state monad” . 15 Garner, Rena t a, Wu References [1] Aguiar, M., Internal Categories and Quantum Gr oups , Cornell Universit y (1997). [2] Ahman, D. and A. Bauer, Runners in A ction , 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, Dir ecte d c ontainers as c ate gories , Electronic Pro ceedings in Theoretical Computer Science 207 , pages 89–98 (2016). https://doi.org/10.4204/eptcs.207.5 [4] Ahman, D. and T. Uustalu, T aking up dates seriously , in: R. Eramo and M. Johnson, editors, Pr o c e e dings of the Sixth International W orkshop on Bidir e ctional T r ansformations , pages 59–73, CEUR W orkshop Pro ceedings (2017). [5] Altenkirc h, T., J. Chapman and T. Uustalu, Monads ne ed not b e endofunctors , in: C. L. Ong, editor, F oundations of Softwar e Scienc e and Computational Structur es, 13th International Confer enc e, FOSSA CS 2010, Held as Part of the Joint Eur op e an Confer enc es on Theory and Pr actic e of Softwar e, ET APS 2010, Paphos, Cyprus, March 20-28, 2010. Pr o c e e dings , v olume 6014 of L e ctur e Notes in Computer Scienc e , pages 297–311, Springer (2010). https://doi.org/10.1007/978- 3- 642- 12032- 9_21 [6] Bergman, G. M., A ctions of b o ole an rings on sets , Algebra universalis 28 , pages 153–187 (1991). https://doi.org/10.1007/bf01190851 [7] Clark e, B., Internal split opfibr ations and c ofunctors , Theory and Applications of Categories 35 , pages 1608–1633 (2020). [8] Co c k ett, R. and R. Garner, Generalising the ´ etale gr oup oid–c omplete pseudo gr oup c orr esp ondence , A dv ances in mathematics 392 , page 108030 (2021). https://doi.org/10.1016/j.aim.2021.108030 [9] Cole, J. C., The bic ate gory of top oi and sp e ctra , Reprints in Theory and Applications of Categories 25 , pages 1–16 (2016). [10] Garner, R., The c ostructur e–c osemantics adjunction for c omo dels for c omputational effe cts , Mathematical structures in computer science 32 , pages 374–419 (2022). https://doi.org/10.1017/s0960129521000219 [11] Garner, R., Str e am pr o c essors and c omodels , Logical Metho ds 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 classific ation the or em , Algebra universalis 85 (2024). https://doi.org/10.1007/s00012- 024- 00869- 1 [13] Garner, R., Cartesian closed varieties II: links to algebr a and self-similarity , Pro ceedings of the Roy al So ciety of Edinburgh: Section A Mathematics pages 1–45 (2025). https://doi.org/10.1017/prm.2024.80 [14] Gonc haro v, S. and L. Schr¨ oder, A r elatively c omplete generic ho ar e lo gic for or der-enriche d effe cts , in: 2013 28th A nnual A CM/IEEE Symp osium on L ogic in Computer Scienc e , IEEE (2013). https://doi.org/10.1109/lics.2013.33 [15] Harel, D., D. Kozen and J. Tiuryn, Dynamic lo gic , pages 99–217, Springer Netherlands (2001). https://doi.org/10.1007/978- 94- 017- 0456- 4_2 [16] Johnstone, P ., Cartesian monads on top oses , 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 Spac es , Cambridge Universit y Press (1982). [18] Johnstone, P . T., Col lapse d top oses and cartesian close d 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: V olume 2 , Oxford Universit y Press (2002). [20] Katsumata, S.-Y., E. Riv as and T. Uustalu, Inter action laws of monads and c omonads , in: Pr o c ee dings of the 35th A nnual A CM/IEEE Symp osium on L ogic in Computer Scienc e , ACM (2020). https://doi.org/10.1145/3373718.3394808 [21] Kelly , G. M. and A. J. Po wer, A djunctions whose c ounits ar e c o e qualizers, and pr esentations of finitary enriche d monads , Journal of Pure and Applied Algebra 89 , pages 163–179 (1993). https://doi.org/10.1016/0022- 4049(93)90092- 8 16 Garner, Rena t a, Wu [22] Moggi, E., Notions of c omputation 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. Spiv ak, Polynomial F unctors: A Mathematical The ory of Inter action , London Mathematical So ciety Lecture Note Series, Cambridge Universit y Press (2025). [24] P aterson, A. L. T., Gr oup oids, inverse semigroups, and their oper ator algebr as , volume 170 of Pr o gr ess in Mathematics , Birkh¨ auser (1999). [25] Plotkin, G. and J. Po wer, Notions of Computation Determine Monads , pages 342–356, Lecture notes in computer science, Springer Berlin Heidelb erg (2002). https://doi.org/10.1007/3- 540- 45931- 6_24 [26] Plotkin, G. and J. Po wer, Computational effe cts and op er ations: An overview , Electronic Notes in Theoretical Computer Science 73 , pages 149–163 (2004). https://doi.org/10.1016/j.entcs.2004.08.008 [27] P ow er, J. and O. Shkaravska, F r om c omo dels to c o algebras: State and arr ays , 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 effe ctful c omputations , 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. V o orneveld, Algebr aic and Co algebr aic Persp e ctives on Inter action L aws , pages 186–205, Lecture notes in computer science, Springer International Publishing (2020). https://doi.org/10.1007/978- 3- 030- 64437- 6_10 [30] V an Name, J., Ultr ap ar acomp actness and ultr anormality , arXiv:1306.6086v1 [math.GN] (2013). [31] Vick ers, S., T op ology via L o gic , Cambridge Universit y Press (1996). 17 Garner, Rena t a, Wu A Omitted Pro ofs A.1 Pr o of of lemma 2.18 Eac h op en ˆ x = λy . W { b | x ≡ b y } is a B J -set homomorphism since if y 1 ≡ c y 2 then c ∧ ˆ x ( y 1 ) = _ { c ∧ b | x ≡ b y 1 } 3 = _ { c ∧ b | x ≡ c ∧ b y 1 } = _ { c ∧ b | x ≡ c ∧ b y 2 } = c ∧ ˆ x ( y 2 ) , where 3 holds from righ t-to-left b ecause we can tak e the b on the LHS to b e the b ∧ c on the RHS. The assignmen t x 7→ ˆ x is injective, as we now show. Let x, y ∈ | F | and assume that ˆ x = ˆ y . Then w e hav e W b { b | x ≡ b y } = ˆ x ( y ) = ˆ y ( y ) = ⊤ , whic h implies there is a (cov er P , WLOG refinable into a) partition P suc h that for each b ∈ P w e ha v e x ≡ b y . But then y = P ( λb.y ) = P ( λb.b ( x, y )) = P ( λb.x ) = x . Finally , let us sho w that w = W x ∈| F | ˆ x ∧ const w ( x ) . T ak e an arbitrary y ∈ | F | . Then w ( y ) = ⊤ ∧ w ( y ) = ˆ y ( y ) ∧ w ( y ) ≤ W x ∈| F | ˆ x ( y ) ∧ const w ( x ) ( y ). On the other hand, for the right-to-left inequality , it suffices to show for any b ∈ B with x ≡ b y that b ∧ w ( x ) ≤ w ( y ). But this is clearly true since x ≡ b y implies w ( x ) ≡ b w ( y ) ⇐ ⇒ b ∧ w ( x ) = b ∧ w ( y ). A.2 Pr o of of pr op osition 2.19 The map σ : E ( F ) → L is a lo cal homeomorphism b y taking the family { ˆ x } x ∈| F | , which is co vering by 2.18 . Eac h such op en ˆ x is homeomorphic on to the whole base space O L . The set of global sections to E ( F ) → L forms a B J -set, s 1 ≡ b s 2 ⇐ ⇒ ∀ w ∈ O E ( F ) .s 1 ( w ) ∧ b = s 2 ( w ) ∧ b . Ev ery element x ∈ | F | corresp onds to a global section s x : L → E ( F ) given by s − 1 x : w 7→ w ( x ). This defines a B J -set homomorphism since x ≡ b y implies, for all w ∈ O E that s y ( w ) ∧ b = w ( y ) ∧ b = w ( b ( x, y )) ∧ b = ( b ∧ w ( x ) ∨ ¬ b ∧ w ( y )) ∧ b = b ∧ w ( x ), i.e., that s x ≡ b s y . Moreov er, this assignmen t is inje ctive b y the injectivit y of x 7→ ˆ x (lemma 2.18 ). On the other hand, to see that this assignment is surje ctive , notice that a global section s giv en b y a frame homomorphism s − 1 : O E ( F ) → O L induces a map C : x 7→ s − 1 ( ˆ x ) : | F | → O L . The image of this map co vers O L b ecause when we take all the op ens ˆ x together, they cov er O E ( F ). Since L is ultraparacompact, w e can refine C to an (extended) partition P : | F | → O L (not uniquely , but we don’t care which one w e c ho ose). This yields an elemen t p ∈ | F | b y taking the amalgamation p := P [ | F | ] − ( λb.P − 1 b ). The elemen t p induces the section s p , so to see that s p = s : s − 1 p ( w ) = w ( p ) = w ( P [ | F | ] − ( λb.P − 1 b )) = _ b ∈ P b ∧ w ( P − 1 b ) = _ x ∈| F | P ( x ) ∧ w ( x ) = _ x ∈| F | C ( x ) ∧ w ( x ) = _ x ∈| F | s − 1 ( ˆ x ) ∧ w ( x ) = s − 1 ( w ) whereb y the last equality follows from lemma 2.18 . A.3 Pr o of of pr op osition 2.20 Giv en a germ [ x ] p , w e can define a p oint q ∈ pt E ( F ) ∼ = Set B J ( F , L ) → O 1 by letting q ( w ) = ⊤ iff p ∈ w ( x ). This is coherent with resp ect to the choice of x , because if x ≡ p y then x ≡ b y for some b ∋ p , so w ( x ) ≡ b w ( y ) whic h en tails b ∧ w ( x ) = b ∧ w ( y ) b y definition. But then p ∈ w ( x ) ⇐ ⇒ p ∈ b ∧ w ( x ) ⇐ ⇒ p ∈ b ∧ w ( y ) ⇐ ⇒ p ∈ w ( y ). On the other hand, supp ose w e ha v e a point q : 1 → E ( F ). This defines a subset ˆ q ⊆ | F | = { x | q ∈ ˆ x } , whic h has to b e non-empt y because otherwise q ∈ ˆ x for all x ∈ | F | , and hence q − 1 ( ⊤ ) = W x ∈| F | q − 1 ( ˆ x ) = ⊥ con tradicting q − 1 b eing a frame homomorphism. q also induces a p oint p := σ q , and the germ induced by q is [ x ] p for an y x ∈ ˆ q . This is coheren t: for an y x, y ∈ ˆ q w e hav e q ∈ ˆ x ∧ ˆ y , but b y lemma 2.18 there is 18 Garner, Rena t a, Wu some z ∈ | F | such that q ∈ ˆ z and p ∈ ( ˆ x ∧ ˆ y )( z ). Then p ∈ ( ˆ x ∧ ˆ y )( z ) ⇐ ⇒ p ∈ { b ∧ b ′ | x ≡ b z , z ≡ b ′ y } = ⇒ ∃ b ∧ b ′ ∋ p.x ≡ b ∧ b ′ z and z ≡ b ∧ b ′ y = ⇒ ∃ b ′′ ∋ p.x ≡ ′′ b y ⇐ ⇒ x ≡ p y F rom here it is a routine unfolding of definitions to see that a germ induces itself b y going bac k-and-forth. On the other hand, given a point q , going forth-and-back pro duces point q ′ with q ′ ∈ w iff q ∈ const w ( x ) for some x ∈ ˆ q iff q ∈ W x ˆ x ∧ const w ( x ) = w , and hence q ′ = q . The subbasic op ens [ x | b ] on the set of germs is induced by the opens ˆ x ∧ const b , which generate all other op ens b y lemma 2.18 . A.4 Pr o of of pr op osition 3.3 W e first c heck that L − M respects > > = and return , making LB 0 T a como del. F or > > = w e ha ve L t > > = u M − 1 ⟨ b 0 7→ [ t 0 ] ⟩ =[ t > > = u 7→ b 0 ] ∧ [ t > > = u > > t 0 ] b y definition of L t > > = u M = _ a ∈ A [ t 7→ a ] ∧ [ t > > u ( a ) 7→ b 0 ] ∧ [ t > > u ( a ) > > t 0 ] apply ( LB 0 - µ ) t wice, and simplify = _ a ([ t 7→ a ] ∧ [ t > > u ( a ) 7→ b 0 ]) ∧ ([ t 7→ a ] ∧ [ t > > u ( a ) > > t 0 ]) = _ a L t M − 1 ⟨ a 7→ [ u ( a ) 7→ b 0 ] ⟩ ∧ L t M − 1 ⟨ a 7→ [ u ( a ) > > t 0 ] ⟩ b y definition of L t M = L t M − 1 _ a ⟨ a 7→ [ u ( a ) 7→ b 0 ] ∧ [ u ( a ) > > t 0 ] ⟩ b y definition of L u M = L t M − 1 L u M − 1 ⟨ b 0 7→ [ t 0 ] ⟩ , whereas for return , w e compute L return a M ⟨ a 0 7→ [ t 0 ] ⟩ = [ return a 7→ a 0 ] ∧ [ return a > > t 0 ] = ( [ t 0 ] if a = a 0 ⊥ otherwise, but this is just υ a . Next, w e sho w that this como del is terminal, so let L b e an arbitrary lo calic comodel. If a map h : L → LB 0 T exists, then h b eing a comodel map implies h − 1 [ t 0 ] = h − 1 L t 0 M − 1 ⟨ 1 7→ ⊤⟩ = L t 0 M − 1 L (2 · h ) − 1 ⟨ 1 7→ ⊤⟩ = L t 0 M − 1 L ⟨ 1 7→ ⊤⟩ , and hence this uniquely determines h . W e lea ve the v erification that this map is w ell-defined as an exercise to the reader. A.5 Pr o of of c orr esp ondenc e for example 3.4 Definition A.1 The lo cale of injectiv e functions R ↣ N is presented b y generators ⟨ x 7→ n ⟩ for x ∈ R and n ∈ N , required to satisfy , for x = y and m = n , the equations _ x ∈ R ⟨ x 7→ n ⟩ = ⊤ ⟨ x 7→ n ⟩ ∧ ⟨ x 7→ m ⟩ = ⊥ ⟨ x 7→ n ⟩ ∧ ⟨ y 7→ n ⟩ = ⊥ W e must pro ve that this presen tation is bi-in terpretable with the b eha viour lo cale of injectiv e state. In one direction, the generator ⟨ x 7→ n ⟩ is in terpreted as [ get x 7→ n ], in which case the first t w o axioms 19 Garner, Rena t a, Wu straigh tforwardly follow. The third axiom can b e prov en as follows: [ get x 7→ n ] ∧ [ get y 7→ n ] = [ get x 7→ n ] ∧ [ get x > > get y 7→ n ] = [ get x > > = λm 1 . get y > > = λm 2 . return ( m 1 , m 2 ) 7→ ( n, n )] = [ get x > > = λm 1 . get y > > = λm 2 . return ( m 1 ? = n ? = m 2 )] = [ get x > > = λm 1 . get y > > = λm 2 . return 0] (b y injectivity eqn) = [ return 0] = ⊥ In the other direction, b y recursion we define a map h in terpreting the generators of the b eha viour lo cale: h : [ return 0] 7→ ⊥ [ return 1] 7→ ⊤ [ get x > > = λn.t n ] 7→ _ n ∈ N ⟨ x 7→ n ⟩ ∧ h ([ t n ]) W e leav e the reader to v erify that this resp ects the usual equations satisfied by terms in the theory of state. As an example, w e will v erify just the injectivity equation from example 3.4 : h [ get x > > = λn. get y > > = λm. return f ( n, m ) 7→ ( n 0 , m 0 )] = _ n _ m ⟨ x 7→ n ⟩ ∧ ⟨ y 7→ m ⟩ ∧ f ( n, m ) ? = ( n 0 , m 0 ) = _ n = m ⟨ x 7→ n ⟩ ∧ ⟨ y 7→ m ⟩ ∧ ( n, m ) ? = ( n 0 , m 0 ) ∨ _ n ⟨ x 7→ n ⟩ ∧ ⟨ y 7→ n ⟩ ∧ f ( n, m ) ? = ( n 0 , m 0 ) property of f = _ n = m ⟨ x 7→ n ⟩ ∧ ⟨ y 7→ m ⟩ ∧ ( n, m ) ? = ( n 0 , m 0 ) ∨ ⊥ b y def. A.1 = _ n = m ⟨ x 7→ n ⟩ ∧ ⟨ y 7→ m ⟩ ∧ ( n, m ) ? = ( n 0 , m 0 ) ∨ _ n ⊥ ∧ ( n, m ) ? = ( n 0 , m 0 ) = _ n = m ⟨ x 7→ n ⟩ ∧ ⟨ y 7→ m ⟩ ∧ ( n, m ) ? = ( n 0 , m 0 ) ∨ _ n ⟨ x 7→ n ⟩ ∧ ⟨ y 7→ n ⟩ ∧ ( n, m ) ? = ( n 0 , m 0 ) = _ n _ m ⟨ x 7→ n ⟩ ∧ ⟨ y 7→ m ⟩ ∧ ( n, m ) ? = ( n 0 , m 0 ) = h [ get x > > = λn. get y > > = λm. return ( n, m ) 7→ ( n 0 , m 0 )] Finally , h resp ects the equations of the behaviour locale: for all three axioms ( LB 0 - ⊥ ) , ( LB 0 - η ) , and ( LB 0 - µ ) it follows by a straigh tforward induction on the syntax of t . A.6 Pr o of of pr op osition 3.5 W e follow a similar line of argument to [ 16 , Section 2]. First, notice that w e can construct LB 0 T in tw o steps. Begin b y constructing the meet semi-lattice MB 0 T generated by op ens [ b ] sub ject to equations [ t > > return a 7→ a ] = ⊤ and [ t 7→ a ] ∧ [ t > > = u 7→ b ] = [ t 7→ a ] ∧ [ t > > u ( a ) 7→ b ]. Then we can generate the frame O LB 0 T from MB 0 T sub ject to the equations [ t 7→ a ] ∧ [ t 7→ a ′ ] = ⊥ and W a ∈ A [ t 7→ a ] = ⊤ . F ollo wing [ 17 , II 2.11], this can b e presented as a co vering system instead. The co v ering system J is generated by the 20 Garner, Rena t a, Wu follo wing rules: t ∈ T A, a = a ′ ∈ A ∅ ∈ J ([ t 7→ a ] ∧ [ t 7→ a ′ ]) t ∈ T A { [ t 7→ a ] | a ∈ A } ∈ J ( ⊤ ) { u } ∈ J ( u ) J ∈ J ( u ) { j ∧ v | j ∈ J } ∈ J ( u ∧ v ) J ∈ J ( u ) K j ∈ J ( j ) ∀ j ∈ J [ j ∈ J K j ∈ J ( u ) Notice that the three base cases are pairwise-disjoint cov ers, and the inductive cases preserve the pairwise- disjoin t prop erty . Hence all the cov ers in this system are pairwise-disjoin t. The frame presen ted by this system consists of all the J -ideals, i.e., down wards closed subsets I ⊆ MB 0 T suc h that for an y J ∈ J ( u ), J ⊆ I implies u ∈ I . F or any subset S ⊆ MB 0 T , the smallest J -ideal con taining S is S = { u ∈ MB 0 T | ∃ J ∈ J ( u ) .J ⊆ S } , and the join of a family of J -ideals { I k } k is the S k I k . Also, ev ery u ∈ MB 0 T induces an ideal ↓ u . W e now prov e that every op en cov er is refined by a partition, so consider an op en cov er { I k } k . It is co v ering iff ⊤ ∈ S k I k iff there is J ∈ J ( ⊤ ) suc h that J ⊆ S k I k . But if w e no w consider the family { ↓ j | j ∈ J } , then this is precisely a partition (pairwise-disjoint b ecause J is) refining { I k } k . A.7 Pr o of of lemma 3.10 First, for self-containedness we lay out precisely the definition of B J -congruence. Definition A.2 Let X b e a B J -set. An equiv alence relation ≈ ⊆ X × X is a B J -set congruence if for ev ery partition P ∈ J , and t wo families x, x ′ : P → X such that for eac h b , x b ≈ x ′ b , w e ha ve P ( x ) R P ( x ′ ) . Giv en a set of pairs G ⊆ X × X , The congruence ≈ G generated by G is given by the follo wing inference rules gen ( x 1 , x 2 ) ∈ G x 1 ≈ G x 2 refl x ∈ X x ≈ G x trans x 1 ≈ G x 2 x 2 ≈ G x 3 x 1 ≈ G x 3 symm x 1 ≈ G x 2 x 2 ≈ G x 1 cong- P x b ≈ G x ′ b ∀ b ∈ P P ( x ) ≈ G P ( x ′ ) W e also define ⇝ G as the relation deriv able b y exactly one use of gen , an y use of cong - P for an y finite partition P , and an y use of refl . If J only con tains finite partitions, then the algebraic theory of B J -sets only has finite op erations and w e can easily show that ≈ G is the symmetric transitiv e closure of ⇝ G . How ev er, if J has infinite partitions, then this is no longer the case, but we can still prov e that ≈ G is alwa ys deriv able b y one congruence applied to ↭ ω G , i.e., the transitiv e symmetric closure of the relation ⇝ G . Lemma A.3 If x 1 ⇝ G x 2 , then this c an b e derive d with exactly one applic ation of the cong rule. Pro of. By induction on deriv ation of x 1 ⇝ G x 2 . In the base case, we clearly ha ve zero applications, but w e can add an application of the cong rule o ver the one-element partition { ⊤ } . In the inductiv e case, w e ha ve a deriv ation which lo oks lik e x b ⇝ G y b ∀ b ∈ P P ( x ) ⇝ G P ( y ) . 21 Garner, Rena t a, Wu By the inductiv e h yp othesis, eac h sub deriv ation of x b ⇝ G y b can be rewritten to use exactly one cong rule, so each sub deriv ation is associated with a partition Q b , defining a map Q : P → J . The deriv ation no w lo oks lik e the deriv ation on the left-hand side b elow, which is deriv able as on the righ t-hand side. cong cong gen or refl . . . x c b ⇝ G y c b ∀ c ∈ Q b x b = Q b ( λc.x c b ) ⇝ G Q b ( λc.y c b ) = y b ∀ b ∈ P P ( x ) ⇝ G P ( y ) cong gen or refl . . . x c b ⇝ G y c b ∀ ( b ∧ c ) ∈ P ; Q P ; Q ( λb ∧ c.x c b ) ⇝ G P ; Q ( λb ∧ c.y c b ) The righ t-hand deriv ation uses only one cong , concluding the proof. 2 Lemma A.4 If x 1 ≈ G x 2 then this is derivable by a derivation of the form cong . . . x b ↭ ω G y b ∀ b ∈ P x 1 = P ( x ) ≈ P ( y ) = x 2 Pro of. By induction on the deriv ation of x 1 ≈ G x 2 . The base cases and the inductive cases for symm and cong - P are easy , so we only work out the case for trans . By induction hypothesis w e kno w that our deriv ation will look lik e trans cong . . . ∆ x b x b ↭ ω G x ′ b ∀ b ∈ P P ( x ) ≈ G P ( x ′ ) cong . . . ∆ y c y ′ c ↭ ω G y c ∀ c ∈ Q Q ( y ′ ) ≈ G Q ( y ) P ( x ′ ) = Q ( y ′ ) x 1 = P ( x ) ≈ G Q ( y ) = x 2 W e can re-arrange this into the follo wing deriv ation, cong trans cong . . . ∆ x b x b ↭ ω G x ′ b ∗ ≈ G ∗ refl ( b ∧ c )( x b , ∗ ) ≈ G ( b ∧ c )( x ′ b , ∗ ) cong . . . ∆ y c y ′ c ↭ ω G y c ∗ ≈ G ∗ refl ( b ∧ c )( y ′ c , ∗ ) ≈ G ( b ∧ c )( y c , ∗ ) ( b ∧ c )( x ′ b , ∗ ) = ( b ∧ c )( y ′ c , ∗ ) ( b ∧ c )( x b , ∗ ) ≈ G ( b ∧ c )( y c , ∗ ) ∀ b ∧ c ∈ P ; Q P ; Q ( λb ∧ c. ( b ∧ c )( x b , ∗ ) ≈ G P ; Q ( λb ∧ c. ( b ∧ c )( y c , ∗ ) where ∗ is allow ed to be an y element of the B J -set X (if X is empty the theorem is v acuously true an ywa y). Here, the equality ( b ∧ c )( x ′ b , ∗ ) = ( b ∧ c )( y ′ c , ∗ ) follo ws from P ( x ′ ) = Q ( y ′ ), since ( b ∧ c )( P ( x ′ ) , ∗ ) = c ( b ( P ( x ′ ) , ∗ ) , ∗ ) = c ( b ( b ( P ( x ′ ) , x ′ b ) , ∗ ) , ∗ ) = c ( b ( x ′ b , ∗ ) , ∗ ) = ( b ∧ c )( x ′ b , ∗ ) and similarly ( b ∧ c )( Q ( y ′ ) , ∗ ) = ( b ∧ c )( y ′ c , ∗ ). No w, w e see on the lefthand-side that P ( x ) = P ; Q ( λb ∧ c.x b ) = P ; Q ( λb ∧ c. ( b ∧ c )( x b , ∗ )), and similarly for Q ( y ) on the righ thand-side. Eac h of the deriv ations of ( b ∧ c )( x b , ∗ ) ≈ G ( b ∧ c )( y c , ∗ ) only uses finite congruences, so can b e re-arranged into deriv ations of ( b ∧ c )( x b , ∗ ) ↭ ω G ( b ∧ c )( y c , ∗ ), whic h concludes this inductiv e case and hence the proof. 2 No w let G b e the generating equation of definition 3.7 , and for whic h w e will omit the subscript from this p oint on. The pro of of the actual lemma pro ceeds in t wo steps. W e first pro ve lemma A.5 , whic h is the v ersion of lemma 3.10 for ⇝ ω G (whic h actually suffices to prov e lemma 3.10 in the case where J is finitary), and then prov e the statement for ≈ . Lemma A.5 F or any x, y ∈ T 1[ B ] J , if x ↭ ω y then for e ach m, n ∈ T 1 , we have m ∼ x ( m ) ∧ y ( n ) n . Pro of. A deriv ation of x ↭ ω y is a (comp osable) c hain of either ⇝ or ⇝ deriv ations, e.g. x = x 0 ⇝ x 1 ⇝ x 2 ⇝ x 3 ⇝ x 4 ⇝ . . . ⇝ x k = y (arro w directions non-indicative). Eac h suc h deriv ation x i ⇝ x i +1 , by 22 Garner, Rena t a, Wu lemma A.3 , can b e rewritten with exactly one cong rule o v er an asso ciated partition R . This means that the deriv ation looks lik e . . . x i = R ( h ) ⇝ R ( h ′ ) = x i +1 where for a unique b 0 ∈ R , w e hav e h b 0 = t > > = u and h ′ b 0 = P ( t ) ( λa.t > > u ( a )) and for b = b 0 ∈ R , w e hav e h b = h ′ b . Asso ciate to x i the partition P ← i := R , and to x i +1 the partition P → i +1 := R > > = λb. ( P ( t ) if b = b 0 { ⊤ } otherwise. F or a deriv ation x i ⇝ x i +1 , p erform the opp osite assignment. So each x i is then asso ciated with t w o partitions P → i and P ← i , except for x 0 and x k . F or these, define P → 0 := P and P ← k := Q . Since there are finitely man y of these partitions, w e can tak e a common refinemen t—call this S . Consider d ∈ S . It refines a unique b ∈ P , whic h identifies the term t 0 d := t b . Now lo ok at the first deriv ation, and suppose it is x 0 ⇝ x 1 . Then d refines a unique c ∈ P → 1 . There are tw o p ossible cases: (i) Either c ∈ P ← 0 , in which case w e define t 1 d := t 0 d ; (ii) or c = c 0 ∧ [ t 7→ a ] for some c 0 ∈ P ← 0 , in which case w e kno w that t 0 d m ust b e of the form t > > = u . So define t 1 d = t > > u ( a ). W e note that in either case, w e ha ve t 0 d ∼ d t 1 d . The other p ossibility is that x 0 ⇝ x 1 . Then d refines a unique c ∈ P ← 0 . There are tw o p ossible cases: (i) Either c ∈ P → 1 , in which case w e define t 1 d := t 0 d ; (ii) or c = c 0 ∧ [ t 7→ a ] for some c 0 ∈ P → 1 , in whic h case w e kno w that t 0 d m ust b e of the form t > > u ( a ). So define t 1 d = t > > = u . No w we may rep eat this process, obtaining t b = t 0 d ∼ d t 1 d ∼ d . . . ∼ d t k d . Here, since d refines some c ∈ Q , w e ha ve that t k d = s c . So w e ma y conclude t b ∼ d s c . T o finish the proof, we see that an y b ∧ c ∈ P ∧ Q is a join of its refinements in S , and since we show t b ∼ d s c for all of its refinemen ts d , we can conclude that t b ∼ b ∧ c s c . 2 Finally , we prov e lemma 3.10 . ( = ⇒ ) supp ose x 1 ≈ x 2 ∈ T 1[ B ] J . Then by lemma A.4 , w e know that x 1 = P ( x ) ≈ P ( y ) = x 2 for some partition P ∈ J and families x, y : P → T 1[ B ] J suc h that for each b ∈ P , x b ↭ ω y b . So by lemma A.5 , we hav e m ∼ x b ( m ) ∧ y b ( n ) n for every m, n ∈ T 1. Now, recall from 2.15 that P ( x )( m ) := W b ∈ P b ∧ x b ( m ), so P ( x )( m ) ∧ P ( y )( n ) = W b ∈ P b ∧ x b ( m ) ∧ y b ( n ). Hence P ( x )( m ) ∧ P ( y )( n ) ≤ J m ∼ n K iff for all b ∈ P , b ∧ x b ( m ) ∧ y b ( n ) ≤ J m ∼ n K , whic h w e ha v e. ( ⇐ = ) Suppose m ∼ x 1 ( m ) ∧ x 2 ( n ) n for eac h m, n ∈ T 1. Let P = { x 1 ( m ) ∧ x 2 ( n ) | m, n ∈ T 1 } − b e the common refinemen t of x 1 and x 2 . Abusing notation, w e will write families indexed b y elemen ts of P as indexed by pairs ( m, n ), for example λ ( m, n ) .x ( m,n ) . Then x 1 = P ( λ ( m, n ) .m ) and x 2 = P ( λ ( m, n ) .n ), and so b y cong- P it suffices to pro ve b ( m, n ) ≈ n for each m, n ∈ T 1 and b ∈ P with m ∼ b n . Consider first the sp ecial case where b ≤ J m ∼ 1 n K . Then [ t 7→ a ] A ∈ Set , | A | ≤ κ, t : T A, u, v : A → T 1 , a ∈ A, u ( a ) = v ( a ) , m = t > > = u, n = t > > = v ∪ { ¬ b } is an op en cov er, so there is a refining partition P . W e can further refine this partition to Q = P ; { b, ¬ b } . No w each q ∈ Q is either q ≤ ¬ b , or q ≤ b and associated with some t q ∈ T A , a q ∈ A and families u q , v q 23 Garner, Rena t a, Wu suc h that q ≤ [ t q 7→ a q ], u q ( a ) = v q ( a ), m = t q > > = u q and n = t q > > = v q . Then w e can deriv e b ( m, n ) = Q λq . ( m q ≤ b n q ≤ ¬ b )! = Q λq . ( t q > > = u q q ≤ b n q ≤ ¬ b )! ≈ Q λq . ( P ( t q ) ( λa.t q > > u q ( a )) q ≤ b n q ≤ ¬ b )! b y definition of ≈ = Q λq . ( t q > > u q ( a q ) q ≤ b n q ≤ ¬ b )! since q ≤ [ t q 7→ a q ] = Q λq . ( t q > > v q ( a q ) q ≤ b n q ≤ ¬ b )! = b ( n, n ) = n b y similar reasoning No w, consider the general case: by ultraparacompactness, it suffices to consider when b ≤ J m ∼ k n K for eac h k ∈ N . Then { V k − 1 i =1 J m i ∼ 1 m i +1 K | m 1 = m, m 2 . . . m k − 1 ∈ T 1 , m k = n } ∪ { ¬ b } is refinable by a partition Q suc h that eac h q ∈ P is either q ≤ ¬ b or q ≤ b and q ≤ V k − 1 i =1 J m i ∼ 1 m i +1 K for some { m i } i ≤ k . Then w e can prov e q ( m i , n ) ≈ q ( m i +1 , n ) b y similar reasoning as the previous paragraph, so b y transitivit y of ≈ w e hav e q ( m, n ) ≈ q ( n, n ) = n . Then w e finally finish the pro of with the follo wing equational reasoning: b ( m, n ) = Q λq . ( m q ≤ b n q ≤ ¬ b )! = Q λq . ( q ( m, n ) q ≤ b n q ≤ ¬ b )! ≈ Q λq . ( q ( n, n ) q ≤ b n q ≤ ¬ b )! = b ( n, n ) = n. A.8 Pr o of that definition 3.11 c orr esp onds to definition 3.7 Supp ose w : T 1 → LB 0 T is a function resp ecting trace equiv alence as in 3.11 . Then we need to sho w w ( t > > = u ) = P ( t ) ( λ [ t 7→ a ] .t > > u ( a )), whic h w e hav e b y w ( t > > = u ) = P ( t ) ( λ [ t 7→ a ] .w ( t > > = u )) ( 2 ) = P ( t ) ( λ [ t 7→ a ] . [ t 7→ a ]( w ( t > > = u ) , w ( t > > u ( a )))) ( 2 ) = P ( t ) ( λ [ t 7→ a ] .w ( t > > u ( a ))) (*) where (*) follows b ecause w resp ects trace equiv alence: t > > = u ∼ [ t 7→ a ] t > > u ( a ) = ⇒ w ( t > > = u ) ≡ [ t 7→ a ] w ( t > > u ( a )) ⇐ ⇒ [ t 7→ a ]( w ( t > > = u ) , w ( t > > u ( a ))) = w ( t > > u ( a )) On the other hand, if ˜ w : F T → LB 0 T is a B J -set homomorphism, then we need to show ˜ w restricts to a function w : T 1 → LB 0 T whic h resp ects trace equiv alence. Consider then t wo trace equiv alen t terms m ∼ b n ∈ T 1. Then we ha v e ˜ w ( m ) ≡ b ˜ w n since b ( ˜ w ( m ) , ˜ w ( n )) = ˜ w ( b ( m, n )) = ˜ w ( n ) 24 Garner, Rena t a, Wu where the last equalit y follows b ecause b ( m, n ) = n ⇐ ⇒ m ∼ b n b y lemma 3.10 . A.9 Pr o of of lemma 3.14 The follo wing decomposition lemma, analogous to lemma 3.12 , will come in handy . Lemma A.6 Every h : T 1 → L with the c onditions of this lemma is of the form h = W m m ∗ ∧ const h ( m ) wher e m ∗ := λn.f − 1 J m ∼ n K . Pro of. W e hav e to sho w h ( n ) = W m f − 1 J m ∼ n K ∧ h ( m ). As in the pro of of lemma 3.12 , the left-to-righ t inequalit y is easy , so we focus on the righ t-to-left inequalit y for which w e ha ve to sho w f − 1 J m ∼ n K ∧ h ( m ) ≤ h ( n ). By ultraparacompactness, f − 1 J m ∼ n K = W { f − 1 b | b ≤ J m ∼ n K , b ∈ B } so it suffices to pro ve for eac h complemen ted b ≤ J m ∼ n K that f − 1 b ∧ h ( m ) ≤ h ( n ), but this immediately follows from the condition on h . It is easy to see that const h ( m ) satisfies the condition since it is just a constan t map. Mean while, for m ∗ whenev er n 1 ∼ b n 2 w e hav e that m ∗ n 1 ∧ f − 1 b = f − 1 J m ∼ n 1 K ∧ f − 1 b = f − 1 ( J m ∼ n 1 K ∧ b ) = f − 1 ( J m ∼ n 2 K ∧ b ) m ∗ n 2 ∧ f ∗ b. Hence m ∗ satisfies the condition of this lemma. 2 The t wo projections π 1 : L × LB 0 T LB 1 T → L and π 2 : L × LB 0 T LB 1 T → LB 1 T are giv en b y π − 1 1 : u 7→ const u and π − 1 2 : w 7→ λm.f − 1 w ( m ). Given a pullback cone i : Z → L and j : Z → LB 1 T , if a univ ersal arrow ⟨ i, j ⟩ exists then it m ust satisfy ⟨ i, j ⟩ − 1 ( const h ( m ) ) = ⟨ i, j ⟩ − 1 π − 1 1 h ( m ) = i − 1 h ( m ) ⟨ i, j ⟩ − 1 ( m ∗ ) = ⟨ i, j ⟩ − 1 π − 1 2 h ( ˆ m ) = j − 1 ˆ m But then by lemma A.6 , the frame of op ens for the pullback is generated by these op ens, so these t w o equations uniquely determine ⟨ i, j ⟩ . It is then straigh tforward to c heck that this is well-defined. A.10 Pr o of that definition 3.15 is a lo c alic c ate gory It is v ery straigh tforward to chec k that the domain and co domain of iden tity and comp ositions corresp ond to what they should b e, so we fo cus on the unitalit y and associativity . It is easy to see from lemma 3.14 that LB 0 T × LB 0 T LB 1 T ∼ = LB 1 T , for which the unitalit y diagram becomes LB 1 T LB 1 T × LB 0 T LB 1 T LB 1 T LB 1 T h 7→ h ( return , − ) w 7→ w ( − > > − ) h 7→ h ( − , return ) and this comm utes b y unitalit y of > > . Finally , by lemma 3.14 the pullbac k of composable triples LB 1 T × LB 0 T LB 1 T × LB 0 T LB 1 T can b e constructed as the frame of appropriate maps T 1 × T 1 × T 1 → O LB 0 T , for which the associativity diagram b elo w obviously commutes due to the asso ciativity of > > . LB 1 T × LB 0 T LB 1 T × LB 0 T LB 1 T LB 1 T × LB 0 T LB 1 T LB 1 T × LB 0 T LB 1 T LB 1 T h 7→ h ( − , − > > − ) h 7→ h ( − > > − , − ) w 7→ w ( − > > − ) w 7→ w ( − > > − ) 25 Garner, Rena t a, Wu A.11 Details to the pr o of of pr op osition 4.2 First w e ha ve to v erify that LB ϕ is an in ternal retrofunctor. F or this we need to consider the pullbac ks Λ 1 LB 1 T Λ 2 LB 2 T LB 0 S LB 0 T Λ 1 LB 1 T π 2 π 1 ⌟ σ π 2 π 1 ⌟ π 1 LB 0 φ π 2 Noting that Λ 2 is the pullback of the second square composed with the first square, and following similar ideas to lemma 3.14 , the second pullback Λ 2 can b e expressed by the frame of maps h : T 1 × T 1 → O LB 0 S suc h that m ∼ b m ′ implies h ( m, n ) ∧ ( LB 0 ϕ ) − 1 b = h ( m, n ) ∧ ( LB 0 ϕ ) − 1 b , and n ∼ b n ′ implies h ( m, n ) ∧ ( LB 0 ϕ ) − 1 L m M − 1 b = h ( m, n ′ ) ∧ ( LB 0 ϕ ) − 1 L m M − 1 b . The requirements on the domain and co domain of the lift is enco ded by requiring the following diagram to comm ute: Λ 1 LB 1 T LB 0 S LB 1 S LB 0 S LB 0 T π 2 π 1 LB 1 φ τ σ τ LB 0 φ but this follows by a straightforw ard chase along the diagram. Next, to see that iden tity and comp osition is respected, w e require the following diagrams to comm ute: Λ 2 Λ 1 LB 0 S LB 2 S LB 1 S id × µ d LB 1 φ ⟨ id ,ι ◦ LB 0 ⟩ ι µ F or the comm utativity inv olving ι , this amounts to c hecking, for w ∈ O LB 1 S , that _ m ∈ T 1 w ( ϕ ( m )) ∧ ( LB 0 ϕ ) − 1 J m ∼ return K = w ( return ) . The pro of of this is similar to the pro of of lemma A.6 . F or the commutativit y in volving µ , the map d is defined on in verse image b y d − 1 : h 7→ h ( ϕ 1 ( − ) , ϕ 1 ). Then the comm utativity of this square amoun ts to c hecking, for w ∈ O LB 1 T , that w ( ϕ ( − ) > > ϕ ( − )) = w ( ϕ ( − > > − )) but this easily follo ws from ϕ b eing a monad map. W e now also m ust v erify that LB is functorial. If ϕ = id : T → T then we see that the definition of LB ϕ is indeed the identit y retrofunctor. F or composition, given ϕ : T → S and ψ : S → R , it is obvious that LB 0 ( ϕ ◦ ψ ) = LB 0 ( ψ ) ◦ LB 0 ( ϕ ). F or the action on morphisms, the composite is giv en b y LB 0 R × LB 0 T LB 1 T LB 0 R × LB 0 S LB 1 S LB 1 R ⟨ π 0 , LB 1 φ ◦ ( LB 0 ψ × id ) ⟩ LB 1 ψ Let us compute the inv erse image of an op en set w ∈ O ( LB 1 R ) along this map. The inv erse along LB 1 ψ giv es w ◦ ψ 1 whic h b y lemma A.6 can b e expressed as W s ∈ S 1 s ∗ ∧ const w ( ψ ( s )) . Now the in verse of const w ( ψ ( s )) along the pair of maps can b e computed as the inv erse of just the left comp onent, which again giv es const w ( ψ ( s )) , but this time as an op en in LB 0 R × LB 0 T LB 1 T . The in v erse of s ∗ along the pair can b e computed as the inv erse of ˆ s along the righ t comp onen t, whic h giv es λt ∈ T 1 . ( LB 0 ψ ) − 1 J s ∼ ϕ ( t ) K . So 26 Garner, Rena t a, Wu com bining the t wo, in the end we get an op en of LB 0 R × LB 0 T LB 1 T defined by λt ∈ T 1 . _ s ∈ S 1 ( LB 0 ψ ) − 1 J s ∼ ϕ ( t ) K ∧ w ( ψ ( s )) and w e ha ve to show this is equal to ( LB 1 ( ψ ◦ ϕ )) − 1 w = w ◦ ψ 1 ◦ φ 1 . But this is again the same t yp e of reasoning as in the proof of lemma A.6 . A.12 Details to the pr o of of the or em 4.4 Let us write Γ as shorthand for Γ LC . It suffices to pro ve, for any retrofunctor F : LC → LB T , there is a unique monad morphism ϕ : T → Γ suc h that LB ϕ ◦ ε = F . F or this, we sho w that this condition uniquely determines ϕ . So consider t ∈ T A and observ e that ϕ ( t ) − 1 ⟨ a 7→ w ⟩ = ϕ ( t ) − 1 ⟨ a 7→ ⊤⟩ ∧ ϕ ( t > > return ) − 1 w . W e then show that (i) F − 1 0 [ t 7→ a ] = ϕ ( t ) − 1 ⟨ a 7→ ⊤⟩ ; and (ii) ( F − 1 1 w )( t > > return ) = ϕ ( t > > return ) − 1 w . This fully determines ϕ ( t ) − 1 ⟨ a 7→ w ⟩ as F − 1 0 [ t 7→ a ] ∧ ( F − 1 1 w )( t > > return ). No w, (i) is a straightforw ard unfolding of definitions on the equation F − 1 0 = ε − 1 0 ( LB 0 ϕ ) − 1 , so we leav e this as an exercise to the reader (if the reader is still reading). F or (ii), w e hav e F 1 = LC 0 × LB 0 T LB 1 T LC 0 × LB 0 Γ LB 1 Γ LC 1 ⟨ π 0 , LB 1 φ ◦ ( ε 0 × id ) ⟩ ε 1 Let us compute the in verse image of w ∈ LC 1 along this map. First, b y lemma A.6 we can decomp ose ε − 1 1 w = W m ∈ Γ1 const m − 1 w ∧ m ∗ . Then the the in verse image of const m − 1 w along the pair is given simply as const m − 1 w while the inv erse image of m ∗ is λn ∈ T 1 .ε − 1 0 J ϕ ( n ) ∼ m K . Therefore, we arrive at the result F − 1 1 w = _ m λn ∈ T 1 .m − 1 w ∧ ε − 1 0 J ϕ ( n ) ∼ m K Hence, if we let n := t > > return , then we hav e F − 1 1 w ( n ) = W m ∈ Γ1 m − 1 w ∧ ε − 1 J ϕ ( n ) ∼ m K . Now, it is easy to see that ϕ ( n ) − 1 w ≤ F − 1 1 w ( n ) b y taking m := ϕ ( n ). On the other hand, for ϕ ( n ) − 1 w ≥ F − 1 1 w ( n ) w e ha ve to reason in terms of witnesses of J ϕ ( n ) ∼ m K . F or simplicity , we simply consider a 1-step witness [ h 7→ b ] for h ∈ Γ B , b ∈ B such that ϕ ( n ) = h > > = u and m = h > > = v , with u ( b ) = v ( b ). Then one can see that m − 1 w ∧ ε − 1 0 [ h 7→ b ] = ( h > > = v ) − 1 w ∧ h − 1 ⟨ b 7→ ⊤⟩ = ( h > > v ( b )) − 1 w ∧ h − 1 ⟨ b 7→ ⊤⟩ = ( h > > = u ) − 1 w ∧ h − 1 ⟨ b 7→ ⊤⟩ ≤ ϕ ( n ) − 1 w This pro ves (ii) and hence w e conclude that ϕ is uniquely determined. A.13 Details to the pr o of of pr op osition 5.3 (affine characterization) Applying the definition of > > = , we find that ( h > > return ) − 1 w = W a h − 1 ⟨ a 7→ w ′ ⟩ where w ′ = W { v 1 ∧ τ − 1 ι − 1 v 2 | v 1 × v 2 ≤ µ − 1 w } . But notice that w ′ is the inv erse image of w along LC 1 LC 1 × LC 0 LC 0 LC 1 × LC 0 LC 0 LC 1 ⟨ id ,τ ⟩ id × ι π LC 1 µ but this inv erse image is equally w ell computed as w ∧ τ − 1 ⊤ = w , and hence w ′ = w . 27 Garner, Rena t a, Wu (determination of s ) Since s = s − 1 > > = λa.s > > return a , we can compute s − 1 ⟨ a 7→ ⊤⟩ as s − 1 * a 7→ _ { v 1 ∧ τ − 1 s − 1 _ a ′ ∈ A | v 1 , v 2 ∈ O LC 1 } + Next, w e kno w ι − 1 w = W a ′′ ∈ A s − 1 ⟨ a ′′ 7→ w ⟩ so ι − 1 w ∧ s − 1 ⟨ a 7→ ⊤⟩ = s − 1 * a 7→ w ∧ _ { v 1 ∧ τ − 1 s − 1 _ a ′ ∈ A ⟨ a ′ 7→ v 2 ⟩ | v 1 , v 2 ∈ O LC 1 } + and no w we hav e w ≤ W { v 1 ∧ τ − 1 s − 1 W a ′ ∈ A ⟨ a ′ 7→ v 2 ⟩ | v 1 , v 2 ∈ O LC 1 } b y taking v 1 = w and v 2 = ⊤ , so this simplifies to s − 1 ⟨ a 7→ w ⟩ . A.14 Pr o of of pr op osition 5.5 It remains to prov e the con verse, so assume T is h yp eraffine-unary , w e hav e to pro v e η T is an isomorphism, i.e., bijective at eac h lev el. T o see that η T is surjective, consider then a section s ∈ Γ LB T A . W e can alw ays factor s = h > > = λi.η ( m i ) > > return f ( i ) for some hyperaffine section h ∈ H C , some family of T 1-terms { m i } i ∈ I and function f : I → A . So it suffices to show that h is in the image of η T . The data of a h yp eraffine section h is completely determined b y the partition { h − 1 ⟨ i 7→ ⊤⟩ | i ∈ I } − ⊆ LB 0 T , but now b ecause T is h yp eraffine-unary , b y lemma 5.4 suc h a partition has to b e of the form { [ h ′ 7→ j ] | j ∈ J } for some h ′ ∈ H J ⊆ T J and J = { i ∈ I | h − 1 ⟨ i 7→ ⊤⟩ = ⊥ } ⊆ I . W e claim that η T ( h ′ ) = h , and this follo ws b y unfolding definitions: η T ( h ′ ) − 1 ⟨ i 7→ w ⟩ = [ h ′ 7→ i ] ∧ w ( h ′ > > return ) = h − 1 ⟨ i 7→ ⊤⟩ ∧ w ( return ) = h − 1 ⟨ i 7→ w ⟩ Finally , to see that η T is injectiv e, consider t 1 = t 2 ∈ T A . Then again b y prop osition 5.3 , b oth admit decomp ositions t 1 = t 1 > > = λa.m 1 > > return a and t 2 = t 2 > > = λa.m 2 > > return a , so if they are not equal it m ust b e that either t 1 = t 2 ∈ H A or m 1 = m 2 ∈ T 1. If the former, then by hyperaffineness of h 1 and h 2 : h 1 = h 1 > > = λa.h 1 > > = λa ′ . return a if a = a ′ else h 2 ( h 1 is h.aff.) = h 1 > > = λa. [ h 1 7→ a ] > > = ( return a, h 2 ) (definition of [ h 1 7→ a ]) = h 1 > > = λa. [ h 2 7→ a ] > > = ( h 2 > > return a, h 2 ) ([ h 1 7→ a ] = [ h 2 7→ a ] and h 2 is h.aff.) = h 1 > > = λa.h 2 > > = λa ′ .h 2 > > = λa ′′ . return a if a = a ′′ else a ′′ (definition of [ h 2 7→ a ]) = h 1 > > = λa.h 2 > > = λa ′ .h 2 > > = λa ′′ . return a ′′ if a ′ = a ′′ else . . . (the . . . do es not matter) = ( h 1 > > = λa.h 2 ) = ( h 1 > > h 2 ) = h 2 ( h 2 is h.aff.) If the latter is true, then η ( m 1 ) , η ( m 2 ) : LB 0 T → LB 1 T , viewed as maps of lo cal homeomorphisms, corresp ond to maps of sheav es δ ( m 1 ) , δ ( m 2 ) : 1 → F T , and from the isomorphism F T ∼ = T 1 of lemma 5.4 we know these cannot b e equal. It can then b e v erified that if w e ha ve t w o h yp eraffines h 1 = h 2 ∈ Γ LB T A or unary sections s 1 = s 2 ∈ Γ LB 1 then h 1 > > = λa.s 1 return a = h 2 > > = λa.s 2 return a , and hence η ( t 1 ) = η ( t 2 ). A.15 Pr o of of pr op osition 5.7 The follo wing lemma come in handy . Lemma A.7 Two internal c ate gories ar e r etr ofunctorial ly isomorphic iff they ar e functorial ly isomorphic. Pro of. Let LC and LD b e in ternal categories. Giv en a functorial isomorphism F : LC → LD with in ve rse F − 1 , define the retrofunctor G b y G 0 := F 0 and G 1 := F − 1 1 ◦ π : LC 0 × LD 0 LD 1 → LD 1 → LC 1 , and vice v ersa for G − 1 . On the other hand, giv en retrofunctors G and G − 1 , define the functor F b y F 0 := G 0 and F 1 := G − 1 1 ◦ ⟨ G 0 σ, id ⟩ where ⟨ G 0 σ, id ⟩ : LC 1 → LD 0 × LC 0 LC 1 . Define the in verse F − 1 similarly . W e leav e it to the reader to v erify the necessary equations. 2 28 Garner, Rena t a, Wu F or brevity , w e omit the subscript LC from ε , and let us also write LB i := LB i Γ LC for i = 0 , 1. ( = ⇒ ) By lemma A.7 , we get an isomorphism LB 0 Γ LC ∼ = LC 0 so LC 0 is also ultraparacompact, and also w e get an isomorphism LB 1 Γ LC ∼ = LC 1 comm uting with the source maps, so the source map of LC is also a lo cal homeomorphism. ( ⇐ = ) By lemma A.7 it suffices to prov e that the counit ε partak es in a functorial isomorphism. The action on ob jects ε 0 : LC 0 → LB 0 has in verse ε 0 giv en on generating clop ens b ∈ B LC 0 b y ε − 1 0 : b 7→ [ b + ] where b + : LC 0 → 2 · LC 1 giv en b y ( b + ) − 1 : ⟨ 1 7→ w ⟩ 7→ b ∧ ι − 1 LC w and ( b + ) − 1 : ⟨ 0 7→ w ⟩ 7→ ¬ b ∧ ι − 1 LC w . This map is well-defined b ecause it realizes all partitions of LC 0 : any partition P manifests as a section P + ∈ Γ LC ( P ) defined analogously to b + , and hence w e ha ve ⊤ = W b ∈ P [ P + 7→ b ] = W b ∈ P [ b + ]. It is straightforw ard to see that ε − 1 0 ε − 1 0 = id . On the other hand, to see that ε − 1 0 ε − 1 0 = id , consider a generating op en [ s ] where s ∈ Γ LC 2. By proposition 5.3 we hav e its corresp onding h yp eraffine s , and it is easy to see that [ s ] = [ s ]. Then, it is a matter of c hecking that ( ε − 1 0 [ s ]) + = s . This giv es us an internal functor E with E 0 := ε 0 and E 1 := LB 1 LC 0 × LB 0 LB 1 LC 1 ⟨ ε 0 σ, id ⟩ ε 1 whic h more explicitly can b e computed as E − 1 1 w = λm. ε − 1 0 m − 1 w . By proposition 5.3 and lemma 5.4 , the lo cal homeomorphism σ LB is induced b y the B J -set Γ LC 1, but this just corresponds to the sheaf induced by the local homeomorphism σ LC , so we m ust hav e σ LC ∼ = σ LB . The map E 1 is the canonical map witnessing this isomorphism, up to a change of base along the isomorphism ε 0 . W e lea ve it to the reader to v erify functorialit y . 29
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment