Giacomo E Alessandra

Lucia Luca E Giulia

Keywords: dualité de Stone, quantificateurs, théorie des langages, mesure, demi-anneau, algèbre profinie, monade de codensité, interpolation uniforme, logique intuitionniste propositionnelle, théorème de l'application ouverte, espaces compacts, pretopos Stone duality, quantifiers, language theory, measure, semiring, profinite algebra, codensity monad, uniform interpolation, intuitionistic propositional calculus, open mapping theorem, compact Hausdorff spaces, pretopos. iii

Quantificateurs et dualité Résumé: Le thème central de la présente thèse est le contenu sémantique des quantificateurs logiques. Dans leur forme la plus simple, les quantificateurs permettent d'établir l'existence, ou la non-existence, d'individus répondant à une propriété. En tant que tels, ils incarnent la richesse et la complexité de la logique du premier ordre, par delà la logique propositionnelle. Nous contribuons à l'analyse sémantique des quantificateurs, du point de vue de la théorie de la dualité, dans trois domaines différents des mathématiques et de l'informatique théorique. D'une part, dans la théorie des langages formels à travers la logique sur les mots. D'autre part, dans la logique intuitionniste propositionnelle et dans l'étude de l'interpolation uniforme. Enfin, dans la topologie catégorique et dans la sémantique catégorique de la logique du premier ordre.

First, I would like to thank Mai for her guidance during these three years. Her enthusiasm and energy, despite sometimes difficult circumstances, have been a great source of inspiration and motivation during my research project. Her intuitions and insights, which would often take me months to understand, have taught me a lot about doing research. One thing I have learnt is that very often it is more important, and difficult, to ask the right question, rather than giving the answer.

My thanks also go to my other co-authors, Daniela, Sam, and Enzo. From each of them I have learnt a lot, both about doing and writing research. Several chapters of this thesis are based on joint works with them, which I enjoyed very much. Moreover, I want to thank Daniela for dedicating much of her time to supervising me during my first year of Ph.D., Sam for being always available to discuss with me and for giving me useful advices, and Enzo for several inspiring discussions and for his guidance since my Master's studies. I would also like to thank the rapporteurs for my thesis, Mamuka Jibladze and Achim Jung, for kindly accepting the task of reading the manuscript and for their valuable comments, and the other members of my Ph.D. committee, Samson Abramsky, Clemens Berger, and Paul-André Melliès, for the interest they showed in my Ph.D. research.

During the last three years I have profited from stimulating discussions with several researchers, from which I learnt a lot. I would like to thank all of them, and in particular: Samson Abramsky, Matthias Baaz, Clemens Berger, Olivia Caramello, Olivier Carton, Thomas Colcombet, Paul-André Melliès, Frédéric Patras, Jean-Éric Pin, and Marek Zawadowski. I spent the first two years of my Ph.D. studies in Paris, and the third one in Nice. I am very grateful to both the Institut de Recherche en Informatique Fondamentale (IRIF) of Paris-Diderot, and to the Laboratoire J. A. Dieudonné in Nice, for hosting me and providing me with the best environment to focus on my Ph.D. project. I am also grateful to the organisers and participants of the local seminars for the lively and stimulating atmosphere they provided.

Overview of the thesis

Duality theory is a powerful tool in the study of propositional logic, and it provides a bridge between syntax and semantics. As a first step towards a duality theoretic understanding of logical quantification, we study quantifiers in connection with formal language theory. This investigation is of independent interest, since it is related to the separation of language classes defined by fragments of logic. Further, we study uniform interpolation for the intuitionistic propositional calculus, a form of quantifier elimination, and categorical interpretations of quantifiers through the lens of duality.

The thesis is divided in two parts. The common theme is the modelling of quantifiers, either from an algebraic or categorical point of view, and the dual mirroring constructions.

Part I is concerned with 'Formal languages and duality', and it consists of four chapters. In Chapter 1 we provide the relevant background on duality and formal language theory. In more detail, we recall Stone duality for Boolean algebras, along with some examples, and we illustrate its connection with formal languages. We also recall the algebraic approach to language theory, and the logic one based on so-called logic on words. Finally, we introduce topo-algebraic recognisers for arbitrary languages, which we call BiMs (Boolean spaces with internal monoids), which arise naturally from a duality theoretic perspective.

Chapter 2 investigates the first-order existential quantifier in logic on words from the point of view of duality. This leads to a unary construction on BiMs relying on the classical construction of the Vietoris hyperspace. A binary version of this construction is shown to generalise the Schützenberger product for monoids, well known in formal language theory.

Chapter 3 is a preparation for the following chapter. We study profinite algebras arising as limits of inverse systems of finite semimodules over semirings S. Under the appropriate assumptions on S, these profinite algebras are characterised as algebras of finitely additive S-valued measures. In this chapter we adopt a categorical approach based on profinite monads.

The measure theoretic characterisation described above is applied in Chapter 4 to investigate so-called semiring quantifiers in logic on words. In particular, we show that algebras of measures arise as duals of the effect of applying a layer of semiring quantifiers to Boolean algebras of languages. These constructions are proved to be natural from the standpoint of duality theory; several results of Chapter 2 can then be recovered by taking as semiring the two-element Boolean algebra.

Part II deals with 'Logic, spaces and coherent categories', and it consists of three chapters. In Chapter 5 we provide an introduction to the theory of coherent categories and their connection to logic; roughly, coherent categories are to the ( , ⊥, ∧, ∨, ∃)-fragment of first-order logic as Boolean algebras are to classical propositional logic. We also recall a result of Ghilardi and Zawadowski showing that the uniform interpolation property of the intuitionistic propositional calculus, and the existence of a model completion for the first-order theory of Heyting algebras, are tightly connected to the theory of certain coherent categories, namely Heyting categories.

In Chapter [START_REF] Adámek | Profinite Monads, Profinite Equations, and Reiterman's Theorem[END_REF] we prove an open mapping theorem for the spaces dual to finitely presented Heyting algebras. In turn, this result is used to obtain a new proof of Pitts' uniform interpolation theorem for the intuitionistic propositional calculus. While Pitts adopted a proof theoretic approach to prove this theorem, our proof is semantic in nature and relies on Esakia duality for Heyting algebras.

Finally, in Chapter 7 we provide a characterisation of the category of compact Hausdorff spaces and continuous maps in the spirit of Lawvere's ETCS (Elementary Theory of the Category of Sets). The characterisation, and the techniques involved, hinge in large part on the fact that the category of compact Hausdorff spaces is a pretopos, hence a coherent category. To capture compactness and Hausdorffness of the objects we introduce the notion of filtrality, a condition on certain posets of subobjects which has its origins in the work of Magari in universal algebra.

The dependences between the chapters of the thesis are indicated in Figure 1. Where appropriate, at the end of the chapters we have included sections collecting concluding remarks, open questions, and some possible directions for future work.

Chapter 1

Introduction: duality and recognition

Duality theory provides a mathematical framework to study connections such as those between algebra and geometry, syntax and semantics, and observables and states, which abound both in the mathematics and physics worlds. It was initiated by mathematician M. H. Stone who showed, in his own words [123, p. 383], that "The algebraic theory of Boolean rings is mathematically equivalent to the topological theory of Boolean spaces...". This is the content of Stone duality for Boolean algebras. Dualities appear naturally in several fields. In analysis, in the study of Fourier transforms through Pontryagin duality for locally compact groups, in logic in the semantic approach to propositional and modal logics, and in physics in the theory of C * -algebras, to name a few. They allow to translate properties and questions from one field of mathematics to another, and back. This applies, for instance, to the algebraic and spatial approaches to logic. In order to prove a certain property of a logic, we can translate the statement into a topological one and then exploit the tools of general topology. For example, Gödel's completeness theorem for first-order logic can be seen as a consequence of Baire category theorem via Stone duality, cf. [START_REF] Rasiowa | A Proof of the Completeness Theorem of Gödel[END_REF]. The language of category theory provides a way of formalising the intuition of duality: it is an equivalence between a category C and the opposite of a category D. If we regard the objects of C as algebras, then the objects of D should be thought of as spaces, and the opposite category is obtained by formally reversing the arrows. This simple process of looking at a transformation A → B as a transformation A ← B accounts for the difference between equivalence and duality, and it is at the heart of duality theory.

Formal language theory, initiated by Chomsky in the 1950s, is a branch of theoretical computer science which is concerned with the specification and manipulation of sets of strings of symbols, so-called formal languages.

It abstracts away from the semantic content of words, i.e. their meaning, that is fundamental in natural languages, and it only retains the syntactical aspects. As such it is the perfect setting for complexity theory, allowing the study of typical problems arising from the study of hierarchies of families of languages, such as decidability, separation and comparison of complexity classes. Formal language theory is tightly related to the theory of monoids (more generally, semigroups) through the concept of language recognition. For example, one of the fundamental classes of formal languages, consisting of the regular languages, corresponds precisely to the class of finite monoids. Formal languages are also strongly related to finite automata, finite-state machines providing mathematical models of computation. Automata, just like monoids, are used to recognise languages. As we shall argue in the sequel, the finite (and profinite) monoids arising in formal language theory are dual to certain Boolean algebras of regular languages. Thus they should be thought of as spaces, and not as algebras. In this sense, monoids and automata have the same spatial nature.

The link between Stone duality and languages, in the form of profinite completions of algebras, was exhibited by Birkhoff [START_REF] Birkhoff | Moore-Smith Convergence in General Topology[END_REF] already in 1937. 1 The connection was then rediscovered by Almeida in [START_REF] Almeida | Residually finite congruences and quasi-regular subsets in uniform algebras[END_REF], but it was not until Pippenger [START_REF] Pippenger | Regular languages and stone duality[END_REF] that duality theory was used as a tool in formal language theory. Only recently, starting with [START_REF] Gehrke | A topological approach to recognition[END_REF][START_REF] Gehrke | Duality and equational theory of regular languages[END_REF], the deep connection between Stone duality and formal languages started to emerge. In these papers a new notion of language recognition, based on topological methods, was proposed for the setting of non-regular languages. Moreover, the scene was set for a new duality-theoretic understanding of the celebrated Eilenberg-Reiterman theorems, establishing a connection between varieties of languages, pseudo-varieties of finite algebras and profinite equations. This showed that several fundamental phenomena in formal language theory are instances of duality, and led to an active research area where categorical and duality-theoretic methods are used to encompass notions of language recognition for various automata models. Among the contributions in this direction are the monadic approach to language recognition put forward by Boja ńczyk [START_REF] Boja | Recognisable Languages over Monads[END_REF], and the series of papers on a category-theoretic approach to Eilenberg-Reiterman theory, see [START_REF] Adámek | Varieties of Languages in a Category[END_REF] and references therein.

Formal language theory is also closely related to logic. Indeed, many classes of languages correspond to fragments of so-called logic on words, which has its origins in the works of Büchi [START_REF] Büchi | Weak second-order arithmetic and finite automata[END_REF], Elgot [START_REF] Elgot | Decision problems of finite automata design and related arithmetics[END_REF] and Trakhtenbrot [START_REF] Trakhtenbrot | Finite automata and the logic of single-place predicates[END_REF]. In turn, in the search for separation results for complexity classes corresponding to logic fragments, it is crucial to identify equations corresponding to the effect of applying a layer of quantifiers to Boolean algebras of languages. In Part I of this thesis we focus on modelling binding of first-order variables via duality.

Outline of the chapter. In Section 1.1 we provide a gentle introduction to Stone duality for Boolean algebras, which will be employed throughout the thesis. The rôle of Stone duality in the theory of formal languages is illustrated in Section 1.2, while in Section 1.3 we discuss the connection between formal languages and logic. In Section 1. 4 Stone duality is used to extend the notion of recognition by finite monoids, central to the theory of regular languages, to the setting of arbitrary languages. Finally, having provided the necessary background, in Section 1.5 we can state precisely the research questions which are addressed in the remainder Part I of the thesis.

Stone duality for Boolean algebras

Duality theory as we will study it here has its origins in the work of M. H. Stone, and can be regarded as a fruitful synthesis of algebra, topology and logic. In 1936, Stone [START_REF] Stone | The theory of representations for Boolean algebras[END_REF] developed what is nowadays known as Stone duality for Boolean algebras. In modern terms, it can be formulated as follows.

Theorem 1.1 [START_REF] Stone | The theory of representations for Boolean algebras[END_REF]Theorem 67]). The category of Boolean algebras and their homomorphisms is dually equivalent to the category of Boolean spaces and continuous maps.

The aim of this section is to provide the necessary background to understand the theorem above. Along the way, we shall provide examples of this duality, and point at its connection with logic. Before proceeding, we remark that in 1938 Stone generalised this duality from Boolean algebras to bounded distributive lattices [START_REF] Stone | Topological representations of distributive lattices and Brouwerian logics[END_REF]. For more details, see Section 6.1.

Recall that a lattice is a partially ordered set L in which any two elements x, y have a least upper bound x ∨ y, and a greatest lower bound x ∧ y. For the basics of lattice theory, we refer the interested reader to [START_REF] Balbes | Distributive lattices[END_REF]. If L contains a least element 0, and a top element 1, then it is said to be bounded. Moreover, it is a distributive lattice provided the binary operations ∨ and ∧ distribute one over the other. If L is a bounded distributive lattice, and x ∈ L, a complement of x is an element ¬x ∈ L such that

x ∧ ¬x = 0 and x ∨ ¬x = 1.

In the presence of distributivity such a complement, if it exists, is unique. A Boolean algebra is a bounded distributive lattice in which every element has a complement. Bounded distributive lattices and Boolean algebras can both be described by means of operations and equations, i.e., they form varieties of algebras (cf. [START_REF] Burris | A course in universal algebra[END_REF]).

The properties defining a Boolean algebra are meant to abstract those of the collection of all subsets of a given set. Thus, the prototypical example of Boolean algebra is the power-set algebra ℘ (X) of a set X, equipped with set-theoretic operations. The elements of ℘ (X) of the form {x}, for x ∈ X, have the property of being minimal among the non-zero elements. Such elements of a Boolean algebra (and, more generally, of a poset with 0) are called atoms. An elementary, and yet crucial, observation is that a finite Boolean algebra is completely determined by its atoms.

Let Boole f be the category of finite Boolean algebras and their homomorphisms (i.e., those functions preserving the basic operations), and write Set f for the category of finite sets and functions between them. In one direction, we have the contravariant power-set functor

℘ : Set f → Boole f
which sends a function f : X → Y to f -1 : ℘ (Y) → ℘ (X). In the other direction, we can define a contravariant functor At : Boole f → Set f taking a finite Boolean algebra B to its set of atoms At B. To define the behaviour of this functor on morphisms, we need the following observation. Recall that a pair g : P Q : h of functions between posets is an adjoint pair provided ∀p ∈ P, ∀q ∈ Q g(p) q ⇔ p h(q).

If this happens, g is said to be lower adjoint to h, h is upper adjoint to g, and they are both monotone maps.

Lemma 1.2. Let g : P Q : h be an adjoint pair of functions between Boolean algebras. If h preserves finite suprema, then g sends atoms to atoms. By general category-theoretic results, we can extend this duality in two different directions by taking either the ind-completion, or the pro-completion, of Boole f (see, e.g., [START_REF] Johnstone | Stone spaces[END_REF]Chapter VI]). The pro-completion of Boole f , which is roughly obtained by adding cofiltered limits, can be identified with the category CABA of complete and atomic Boolean algebras, and complete homomorphisms. Here, a complete Boolean algebra is one in which every set of elements has a supremum and an infimum, and atomic means that every element is the join of all the atoms that are below it. A homomorphism between complete Boolean algebras is complete if it preserves arbitrary suprema and infima. Complete and atomic Boolean algebras are precisely those of the form ℘ (X), for a (possibly infinite) set X. The category CABA is thus dual to the ind-completion of the category Set f , obtained essentially by adding filtered colimits, which is the category Set of sets and functions. The ensuing duality is called discrete duality, or Lindenbaum-Tarski duality [START_REF] Tarski | Zur Grundlegung der Boole'schen Algebra I[END_REF]. The functors involved are the obvious extensions of the functors At and ℘ .

On the other hand, we can consider the ind-completion of Boole f . Since the ind-completion of the category of finitely presented algebras of a variety V coincides with V, 2 the ind-completion of Boole f is the category Boole of Boolean algebras and their homomorphisms. Hence Boole is dually equivalent to the pro-completion of Set f , which can be identified with the category BStone of so-called Boolean spaces and continuous maps. Several authors, see e.g. [START_REF] Johnstone | Stone spaces[END_REF], call Stone spaces what we refer to as Boolean spaces. As the name Stone space is often used to indicate the dual space of a bounded distributive lattice, we chose to adopt Stone's terminology [124, p. 198]: "These theorems show that the theory of Boolean algebras is coextensive with the theory of totally-disconnected bicompact spaces. In the sequel, therefore, we shall refer to spaces of this type as Boolean spaces."

The duality between Boolean algebras and Boolean spaces is known as Stone duality for Boolean algebras, and it is displayed at the bottom of Figure 1.2. Next we give an explicit description of the functors involved in this duality. To extend the functor At : Boole f → Set f to a functor Boole → BStone, we need a generalisation of the concept of atom. Indeed, in an infinite Boolean algebra there might be too few atoms to recover the algebraic structure, cf. Example 1.8. This leads to the notion of ultrafilter. Definition 1.5. A subset F of a bounded distributive lattice B is a filter if it satisfies the following conditions:

• non-emptiness: 1 ∈ F;

• upward closure: if a ∈ F and b ∈ B satisfy a b, then b ∈ F;

• closure under finite meets: if a, b ∈ F, then a ∧ b ∈ F.

A filter F ⊆ B is proper if F = B. If B is a Boolean algebra, then an ultrafilter of B is a filter that is maximal (with respect to inclusion) among the proper ones. Equivalently, it is a proper filter F such that, for each a ∈ B, either a ∈ F or ¬a ∈ F.

If a is any element of a Boolean algebra B, then the set

↑a = {b ∈ B | a b} (1.1)
is a filter of B, and it is an ultrafilter precisely when a is an atom. Ultrafilters of this form are called principal ultrafilters. If B is finite, then every ultrafilter is principal, so that the notion of ultrafilter generalises that of atom of a finite Boolean algebra. However, as soon as B is infinite, it admits an ultrafilter that is free, i.e. non-principal. This is the source of the richness of the theory. Let X B be the collection of all the ultrafilters of B. The fundamental insight of Stone was that, if one equips X B with the appropriate topology, the Boolean algebra B can be recovered from X B . The elements of X B will be denoted by x, y, z, . . .. Consider the Boolean algebra homomorphism

(-) : B → ℘ (X B ), a → a = {x ∈ X B | a ∈ x}. (1.2)
The latter is an embedding in view of Stone's prime ideal theorem [125, Theorem 64], also known as the ultrafilter lemma. The Stone topology on X B is the topology generated by the image of the embedding in (1.2). One can show that X B , equipped with the Stone topology, is compact and Hausdorff (cf. Remark 1.6). Moreover, each a is clopen because a c = ¬a for any a ∈ B. Therefore X B is a Boolean space, the dual space of B. If h : B → B is a Boolean algebra homomorphism, the inverse-image function h -1 : ℘ (B ) → ℘ (B) sends ultrafilters to ultrafilters. Its restriction h -1 : X B → X B turns out to be continuous with respect to the Stone topologies. This yields a functor Boole → BStone, which is half of the duality.

Remark 1.6. The set of ultrafilters of a Boolean algebra B can be identified with the set hom(B, 2) of Boolean algebra homomorphisms from B into the two-element Boolean algebra 2. The homomorphism associated to an ultrafilter x ∈ X B is the characteristic function χ x : B → 2 of x. Conversely, a homomorphism h : B → 2 yields the ultrafilter h -1 (1) on B. Under this correspondence, the Stone topology on X B corresponds to the subspace topology with respect to the product topology on 2 B , where 2 is equipped with the discrete topology. Note that hom(B, 2) is a closed subspace of 2 B , which in turn is compact (by Tychonov's theorem), Hausdorff, and it admits a basis of clopens. We conclude that X B is a Boolean space because the relevant properties are closed-hereditary.

In the other direction, for any Boolean space X, we take the Boolean algebra B X of its clopen subsets equipped with the obvious set-theoretic operations. We refer to B X as the dual algebra of X. If f : X → Y is a continuous map, then f -1 : B Y → B X is a homomorphism of Boolean algebras. This gives a functor BStone → Boole. Note that any topological space X yields a Boolean algebra of clopens. However, if X is not Boolean, in this process we 'lose essential information' about the space.

The two processes of assigning to a Boolean algebra its dual space, and to a Boolean space its dual algebra, are (up to a natural isomorphism) inverse to each other. This is the content of the celebrated Stone duality for Boolean algebras [START_REF] Stone | The theory of representations for Boolean algebras[END_REF], stated above as Theorem 1.1. One of the most useful aspects of a duality is that it does not only take objects into account, but also morphisms. For instance, Boolean subalgebras of B correspond to continuous images of X B , and homomorphic images of B to closed subspaces of X B . This will be illustrated in the following examples.

Example 1.7 (Stone-Čech compactification). Let S be any set. The dual space of the power-set algebra ℘ (S) is denoted by β(S), and it is known as the Stone-Čech compactification of the set S. The map η S : S → β(S), sending s ∈ S to the principal ultrafilter ↑{s} of (1.1), is injective. If S is equipped with the discrete topology, then η S embeds S as a dense subspace of β(S). The fact that β(S) has a dense subset of isolated points corresponds to the fact that its dual Boolean algebra is atomic. Indeed, there is a bijection between atoms of a Boolean algebra and isolated points of its dual space.

The space β(S) is characterised by the following universal property: for any compact Hausdorff space X and function f : S → X, there is a unique continuous extension g : β(S) → X of f .

S β(S)

X η S f g
In particular, any function f : S → T between two sets can be extended to a continuous map β f : β(S) → β(T). Note that this extension can be obtained by first applying the discrete duality to the function f , and then applying Stone duality to the resulting Boolean algebra homomorphism. Explicitly, for any ultrafilter x ∈ β(S),

β f (x) = {L ∈ ℘ (T) | f -1 (L) ∈ x}.
(1.

{L ∈ ℘ (S) | L c is finite} (1.4)
of the cofinite subsets of S. This is known as the Fréchet filter, and the ultrafilters that are free are precisely those extending the Fréchet filter. Therefore the dual algebra of S * is isomorphic to the quotient of ℘ (S) with respect to the filter (1.4). 3 Such a quotient has no atoms. Recalling the correspondence between atoms of a Boolean algebra and isolated points of the dual space, we conclude that S * has no isolated points. That is, regarded as a subset of β(S), S * is dense-in-itself.

Example 1.9 (One-point compactification of N). Consider the power-set algebra ℘ (N) of the set N of natural numbers. Let B be the Boolean sub- algebra of ℘ (N) consisting of the finite and cofinite subsets of N. Each singleton {n}, with n ∈ N, is an atom of B. Therefore the dual space of B will contain countably many isolated points. As recalled in the previous example, an ultrafilter is free precisely when it extends the filter of cofinite subsets. Thus the dual space of B contains only one non-isolated point, and it is homeomorphic to the one-point (or Alexandroff ) compactification

N ∞ = N ∪ {∞}
of the discrete space N, pictured in Figure 1.3. The open subsets of N ∞ are the subsets that are either cofinite, or do not contain the limit point ∞. This space can be obtained as a continuous image of the Stone-Čech compactification β(N), by collapsing all the free ultrafilters into one single point.

Example 1.10 (Vietoris hyperspace). Let X be any Boolean space. Write V (X) for the set of closed subsets of X, and equip it with the topology generated by the sets of the form

C = {V ∈ V (X) | V ⊆ C} and ♦C = {V ∈ V (X) | V ∩ C = ∅}, (1.5)
for C a clopen of X. The ensuing topological space is called the Vietoris hyperspace of X, and is again a Boolean space [START_REF] Michael | Topologies on Spaces of Subsets[END_REF]Theorem 4.9]. This is a particular case of the hyperspace of an arbitrary topological space first introduced by Vietoris in 1922, see [START_REF] Vietoris | Bereiche zweiter Ordnung[END_REF].

For any continuous function f : X → Y between Boolean spaces, defining V f : V (X) → V (Y) as the forward image function V → f (V) yields a functor V : BStone → BStone. This functor turns out to be part of a monad, whose unit is

η X : X → V (X), x → {x},
and whose multiplication is

µ X : V 2 (X) → V (X), S → V∈S V.
The definition of the components µ X goes back at least to [81, Theorem 5 p. 52]. Note that, in (1.5), the sets of the form ♦C can be replaced by the complements of those of the form C (and vice versa). Indeed, ♦C = ( C c ) c . Also, note that is ∧-preserving. If B is the dual algebra of X, it is not difficult to see that the dual algebra of V (X) is obtained from the free Boolean algebra on the set

{ a | a ∈ B} by imposing the conditions 1 = 1, (a ∧ b) = a ∧ b.
I.e., the dual algebra of V (X) is the free Boolean algebra on the ∧-semilattice reduct of B. Recall that a ∧-semilattice is a pair (S, ∧) where S is a set and ∧ is an associative and commutative binary operation which is idempotent, i.e. s ∧ s = s for every s ∈ S. A semilattice is bounded if it contains an element 1 ∈ S satisfying s ∧ 1 = s for every s ∈ S.

In contrast with the embedding S → β(S) of a set into its Stone-Čech compactification, η X : X → V (X) does not have dense image. However, it is not difficult to see that the set ℘ f (X) of finite subsets of X is dense in V (X). For a proof see, e.g., [80, p. 163]. This fact will play a crucial rôle in the next chapters.

The algebraic approach to automata theory

The best way to illustrate the rôle of Stone duality in the theory of formal languages is probably through the algebraic approach to automata theory, that we sketch below. Roughly, one might say that finite automata (or, rather, the associated monoids) are dual spaces, and their dual algebras are Boolean algebras of languages. To make this statement precise we introduce the notion of language recognition, both through automata and monoids, and show its connection with Stone duality. For a gentle introduction to this point of view we refer the interested reader to [START_REF] Gehrke | Duality and Recognition[END_REF].

Automata are devices designed to recognise languages. Consider a set A, the alphabet. A word (in the alphabet A) is an element of the monoid A * free over A. A language (in the alphabet A, also called an A-language) is a set of words, i.e. a subset of A * . Throughout the thesis, we shall consider only finite alphabets A.

Definition 1.11.

A finite A-automaton (or simply a finite automaton, if the alphabet A is clear from the context) is a tuple

A = (Q, A, δ, I, F)
where Q is a finite set whose elements are called states, A is a finite alphabet and δ ⊆ Q × A × Q is a relation, called the transition relation. The sets I and F are subsets of Q, and their elements are called initial and final states, respectively. If I is a singleton and the relation δ is the graph of a function Q × A → Q, then the automaton A is said to be deterministic.

A finite automaton A can be thought of as a directed graph whose nodes are the elements of Q, and where an edge q 1 q 2 a between two states q 1 and q 2 corresponds to an element a ∈ A satisfying (q 1 , a, q 2 ) ∈ δ. An example of a (non-deterministic) finite automaton on the alphabet {a, b} is provided in Figure 1.4, where the initial state is indicated by the label 'start', and the final state is represented by a grey circle. A path in A is a finite sequence

(q 0 , a 1 , q 1 )(q 1 , a 2 , q 2 ) • • • (q k-1 , a k , q k )
where each (q i-1 , a i , q i ) belongs to δ. A word w = a 1 • • • a n in A * is recognised by the automaton A if there is a path (q 0 , a 1 , q 1 ) • • • (q n-1 , a n , q n ) in A such that q 0 ∈ I and q n ∈ F. That is, there is a path in the automaton which starts in an initial state, it ends in a final state, and it is labeled by the word ). However, from the standpoint of language recognition, deterministic finite automata are as powerful as possibly non-deterministic ones. In the following, whenever convenient, we tacitly assume that the automaton at hand is deterministic.

Definition 1.12. A language L ⊆ A * is called regular if there is a (deterministic) finite A-automaton A such that L = L(A). The set of all regular languages on the alphabet A is denoted by Reg(A * ).

An important operation on languages is the (complex) multiplication, also known as concatenation. Given two languages K, L ∈ ℘ (A * ), set

KL = {uv ∈ A * | u ∈ K, v ∈ L}.
This multiplication gives rise to an adjoint family of binary operations on ℘ (A * ), called residuals, which are uniquely determined by the laws:

∀J, K, L ∈ ℘ (A * ), K J ⊆ L ⇔ J ⊆ K\L ⇔ K ⊆ L \J.
Explicitly, these are given by

K\L = {w ∈ A * | ∀u ∈ K, uw ∈ L}, L \J = {w ∈ A * | ∀v ∈ J, wv ∈ L}.
In the particular case where K = {w}, the operations L → {w}\L are called left quotients and the language {w}\L is denoted by w -1 L. Similarly for the right quotients L \{w}, denoted by Lw -1 .

If L is a regular language, then so is the language x -1 Ly -1 for every x, y ∈ A * . Indeed, x -1 Ly -1 is recognised by the automaton obtained by moving the initial states of a finite automaton A recognising L along the paths labeled by x, and the final states (backwards) along paths labeled by y. Given that the automaton A is finite, the set {x -1 Ly -1 | x, y ∈ A * } is finite. Further, since the quotienting operations x -1 ( ) are Boolean algebra homomorphisms and S\( ) = x∈S x -1 ( ) for all x ∈ A * and S ∈ ℘ (A * ) (and the same on the right), we obtain the following lemma.

Lemma 1.13. The finite Boolean subalgebra of ℘ (A * ) defined by

B(L) = <{x -1 Ly -1 ∈ ℘ (A * ) | x, y ∈ A * }> BA (1.6)
is closed under the operations S\( ) and ( ) \S, for all S ∈ ℘ (A * ). In particular, B(L) is closed under the binary operations \, \.

A subalgebra of ℘ (A * ) that is closed under the binary operations \, \ is called a residuation subalgebra. The stronger property of being closed under residuation with respect to arbitrary denominators yields the concept of residuation ideal; note that every residuation ideal is a residuation algebra. With this terminology, the previous lemma states that B(L) is a residuation ideal of ℘ (A * ). In particular, regarding (B(L), \, \) as a Boolean algebra with additional operations, it has an extended dual space. Dualities for additional operations originate in Jónsson and Tarski [START_REF] Jónsson | Boolean algebras with operators. I[END_REF][START_REF] Jónsson | Boolean algebras with operators. II[END_REF] in the context of canonical extensions, and the first duality theoretic account in the setting of Priestley duality for bounded distributive lattices is due to Goldblatt [START_REF] Goldblatt | Varieties of complex algebras[END_REF]. Next we show that the dual relation common to the two additional operations \, \ is a functional ternary relation, which yields a monoid structure on the dual of the Boolean algebra B(L).

∼ L v ⇔ ∀x, y ∈ A * (xuy ∈ L ⇔ xvy ∈ L).
(1.7)

Proof. As observed above, the quotients of the form x -1 Ly -1 correspond to moving around the initial and final states of a finite automaton recognising L. Therefore there are only finitely many such quotients, say

{x -1 1 Ly -1 1 , . . . , x -1 n Ly -1 n },
and the generated Boolean algebra B(L) is finite. The atoms of B(L) are the elements of the form

i∈π 1 x -1 i Ly -1 i ∩ j∈π 2 (x -1 j Ly -1 j ) c
for some partition {π 1 , π 2 } of {1, . . . , n}. Note that two words u, v ∈ A * belong to the same atom if, and only if, they satisfy

∀x, y ∈ A * (u ∈ x -1 Ly -1 ⇔ v ∈ x -1 Ly -1 ).
In turn, this is equivalent to u ∼ L v, where ∼ L is as in (1.7). It is not difficult to see that ∼ L is a congruence on A * . Then the atoms of B(L) are the equivalence classes for ∼ L , which are the elements of M L = A * /∼ L . We now show that the duality between B(L) and M L extends to the additional operations. Since all the operations of an adjoint family have the same dual relation, up to the order of the coordinates, we focus on the operation \. The latter is meet preserving in each coordinate when regarded as an operation \ : B(L) op × B(L) → B(L). Its dual relation is given by

R \ (X, Y, Z) ⇔ F X \ I Y ⊆ I Z ,
where F X is the prime filter of B(L) associated to X, while I Y and I Z are the prime ideals associated to Y and Z, respectively (i.e. the complements of the prime filters associated to Y and Z). For more details, cf. [START_REF] Gehrke | Duality and Recognition[END_REF][START_REF] Gehrke | Stone duality, topological algebra, and recognition[END_REF]. Since the Boolean algebra B(L) is finite, we can identify F X with the atom X, and I Y , I Z with the co-atoms Y c , Z c , respectively. Thus we have

R \ (X, Y, Z) ⇔ X\Y c ⊆ Z c ⇔ Z ⊆ X\Y c ⇔ ∃x ∈ X, ∃z ∈ Z such that xz ∈ Y ⇔ ∃x, z such that X = [x] ∼ L , Z = [z] ∼ L , Y = [xz] ∼ L ,
where in the second equivalence we used the fact that in a finite Boolean algebra an element is not above an atom p if, and only if, it is below the co-atom ¬p. This shows that, up to the order of the variables, the relation R \ is the graph of the monoid operation of M L .

It is not difficult to see that, for every language L ∈ ℘ (A * ), the relation

∼ L defined in (1.7
) is a congruence on A * . It is the coarsest congruence of A * for which L is saturated, and it is called the syntactic congruence of L.

The quotient morphism A * A * /∼ L is called the syntactic morphism of L, and the monoid M L = A * /∼ L is the syntactic monoid of L. So, Lemma 1.14 states that, if L is regular, the extended dual space of the Boolean algebra B(L) is the syntactic monoid M L . Note that, in this case, the syntactic morphism of L is the discrete dual of the embedding B(L) → ℘ (A * ).

The following well known fact, which is the starting point for the algebraic approach to automata theory, can be seen as a consequence of finite Stone duality. Proposition 1.15. A language L ⊆ A * is regular if, and only if, its syntactic monoid M L is finite.

Proof. If L is regular, then the Boolean algebra B(L) is finite. By Lemma 1.14 the syntactic monoid M L is the (extended) dual space of B(L), hence it is finite. Conversely, if M L is finite then the action of A on M L defines a deterministic finite automaton which recognises L. For more details see, e.g., [START_REF] Straubing | Finite Automata, Formal Logic, and Circuit Complexity[END_REF]Theorem V.1.1].

We are naturally led to an algebraic notion of language recognition. Let us say that a monoid morphism Using the previous proposition it is easy to see that the set Reg(A * ) of regular languages is a Boolean subalgebra of ℘ (A * ). Reasoning as in the case of the Boolean algebra B(L), we deduce that Reg(A * ) is a residuation ideal of ℘ (A * ). In particular, (Reg(A * ), \, \) is a residuation algebra.

h : A * → M recognises a language L ⊆ A * if L = h -1 (h(L)).
While the dual space of Reg(A * ) was already understood in [START_REF] Birkhoff | Moore-Smith Convergence in General Topology[END_REF], its extended dual space was first identified in [START_REF] Gehrke | Duality and equational theory of regular languages[END_REF]. Write A * for the free profinite monoid on the set A. This coincides with the profinite completion of the monoid A * and it can be described either as the codirected limit of the finite homomorphic images of A * , or as the completion of A * with respect to an appropriate (ultra)metric, cf. [101, VI.2].

Theorem 1.17 [START_REF] Gehrke | Duality and equational theory of regular languages[END_REF]Theorem 6.1]). The extended dual space of the Boolean algebra (Reg(A * ), \, \) is the free profinite monoid A * on A. In particular, the dual relation common to the binary operations \, \ on Reg(A * ) is the continuous monoid operation of A * .

Roughly, the previous theorem says that studying the Boolean algebra of all regular languages Reg(A * ) with its residuation operations is the same thing as studying the profinite monoid A * . This hints at the effectiveness of profinite methods in the study of regular languages. We remark that Theorem 1.17 was generalised in [START_REF] Gehrke | Stone duality, topological algebra, and recognition[END_REF]Theorem 4.5] by replacing the finitely generated free monoid A * with any Birkhoff algebra.

Remark 1.18. In this section we have looked at regular languages from the standpoint of recognition. We have defined a regular language as one that is recognised by a finite automaton, and we have seen that this is equivalent to being recognised by a homomorphism into a finite monoid. Whilst in the next section we will characterise regular languages in terms of logical definability, there is one more approach that ought to be mentioned. We have remarked that the collection Reg(A * ) of all regular languages in a finite alphabet A is closed under the operations of union (K, L) → K ∪ L and (complex) multiplication (K, L) → KL. There is another operation on ℘ (A * ) that is of interest, namely the Kleene star. Given a language L ⊆ A * , and regarding ℘ (A * ) as a monoid with respect to complex multiplication, write L * for the submonoid of ℘ (A * ) generated by L. Explicitly, if ε de- notes the empty word,

L * = {ε} ∪ L ∪ LL ∪ LLL ∪ • • •
The set of regular languages is closed under the star operation L → L * . Indeed, if A is a finite automaton recognising L, there is a finite automaton A satisfying L(A ) = L * . Roughly, A is obtained by adding copies of the initial state to A so to match the number of final states, and then 'bending' the automaton to glue each final state with a single initial state. Kleene's Theorem [START_REF] Kleene | Representation of events in nerve nets and finite automata[END_REF] states that Reg(A * ) is the smallest subset of ℘ (A * ) which contains all the singletons consisting of one letter words {a}, for a ∈ A, and which is closed under the operations of union, multiplication and star. Let us say that a rational expression is an expression of the form (ab) * ∪ a * (bb ∪ bc) * , containing letters from the alphabet A, and the latter three operations. With this terminology, a language is regular if, and only if, it is definable by a regular expression. For example, the automaton in Figure 1.5 recognises the language aa * ba * ∪ aa * b(aa * b) * .

Logic on words

There is a deep connection between formal language theory and logic, which is due in large part to Büchi [START_REF] Büchi | Weak second-order arithmetic and finite automata[END_REF][START_REF] Büchi | Symposium on Decision Problems: On a Decision Method in Restricted Second Order Arithmetic[END_REF]. For a thorough treatment of the subject see, e.g., [START_REF] Straubing | Finite Automata, Formal Logic, and Circuit Complexity[END_REF]. The basic idea is that a word w in a finite alphabet A can be regarded as a relational structure on the initial segment of the natural numbers {1, . . . , |w|},

where |w| denotes the length of the word, equipped with a unary relation P a for each a ∈ A which singles out the positions in the word where the letter a appears. For a sentence ϕ (i.e., a formula in which every variable is in the scope of a quantifier) in a language interpretable over words, the satisfaction relation w ϕ is defined inductively on the complexity of ϕ. It is clear how to interpret the predicates P a and Boolean combinations of sentences. If x is a firstorder variable and ϕ = ∃x.ψ(x), then the word w satisfies ϕ if there is a position i in w such that ψ is true in w when the variable x points at i. For example, w ∃x.P a (x)

holds whenever the word w contains the letter a. If ϕ is any sentence, we denote by L ϕ the set of all words in A * satisfying ϕ. Among the additional relations that are often considered are the identity relation =, the (appropriate restrictions of the) order < on N and the successor relation

σ = {(i, i + 1) | i ∈ N}. For example, the sentence ∃x∀y∀z(x y ∧ P a (x) ∧ (σ(x, z) → P b (z)))
defines the language containing the word a, along with all the words admitting ab as a prefix. A regular expression defining this language is a ∪ abA * .

In this logic, first-order variables are interpreted as positions in the word. But one might consider also (monadic) second-order variables, and interpret them as sets of positions in the word. Büchi's Theorem [START_REF] Büchi | Symposium on Decision Problems: On a Decision Method in Restricted Second Order Arithmetic[END_REF] shows that monadic second order logic captures precisely the class of regular languages:

Theorem 1.19. A language is regular if, and only if, it is definable by a monadic second-order sentence using the additional relation σ.

Remark 1.20. The question arises, what are the languages recognised by first-order sentences. McNaughton and Papert [START_REF] Mcnaughton | Counter-free automata[END_REF] showed that, allowing < as the unique additional relation, the languages definable by first-order sentences are precisely the star-free ones. These are the languages obtained from the one-letter words by applying Boolean operations and multiplication, but not the Kleene star. In turn, a result of Schützenberger [START_REF] Schützenberger | On finite monoids having only trivial subgroups[END_REF] identifies the star-free languages precisely as those whose syntactic monoids are aperiodic, i.e. they contain no non-trivial subgroup. In other words, firstorder logic (on words) corresponds to finite aperiodic monoids.

So far we have looked only at sentences. We now illustrate how to deal with free variables in the context of logic on words. Since our focus is on first-order quantifiers, we shall study the case of first-order variables only. Assume ϕ(x) is a formula with a free first-order variable x. That is, x is not in the scope of any quantifier. In order to be able to interpret the free variable, we consider the extended alphabet A × 2 which we think of as consisting of two copies of A. That is, we identify

A × 2 with A ∪ {a | a ∈ A},
and we call the elements of the second copy of A marked letters. Given a word w = a 1 • • • a |w| and a position 1 i |w|, we set

w (i) = a 1 • • • a i-1 a i a i+1 • • • a |w| . (1.8)
This is the word in the alphabet A × 2 having the same shape as w but with the letter in position i marked. We can now extend the notion of satisfaction from sentences to formulae. For every u ∈ (A × 2) * we set u ϕ(x) iff there exists w ∈ A * , and 1 i |w|, such that u = w (i) and ϕ(x) is true in w when the variable x is interpreted as the position i. Define

L ϕ(x) ⊆ (A × 2) *
to be the set of all words in the alphabet A × 2 which satisfy ϕ(x). The generalisation to formulae containing any finite number of free (first-order) variables is straightforward, and we omit it. Now, given L ⊆ (A × 2) * , denote by

L ∃ ⊆ A * (1.9)
the language consisting of those words w ∈ A * such that there exists 1 i |w| with w (i) ∈ L. Observe that

L = L ϕ(x) ⇒ L ∃ = L ∃x.ϕ(x) ,
thus we recover the usual existential quantification of formulae. Among the generalisations of the existential quantifier that are of interest in formal language theory are the modular quantifiers [START_REF] Straubing | Regular Languages Defined with Generalized Quantifiers[END_REF]. Consider the ring Z/qZ of integers modulo q, and pick p ∈ Z/qZ. We say that a word w satisfies the sentence ∃ p mod q x.ϕ(x) if the number of positions in w for which the formula ϕ(x) holds is equal to p modulo q. Moreover, for an arbitrary language L ⊆ (A × 2) * , we define

L ∃ p mod q
as the set of words w = a 1 • • • a n such that the cardinality of the set

{1 i |w| | w (i) ∈ L} (1.10)
is congruent to p modulo q. If the language L is defined by the formula ϕ(x), then L ∃ p mod q is defined by the formula ∃ p mod q x.ϕ(x).

Finally, generalising the preceding situations, consider a semiring (S, +, •, 0 S , 1 S ) and an element k ∈ S (for the notion of semiring, see Definition 3.1 in Chapter 3). Given L ⊆ (A × 2) * , consider the language of all words w ∈ A * such that

1 S + • • • + 1 S m times = k,
where m is the cardinality of the set in (1.10). The ensuing quantifier ∃ S,k is an instance of what we call semiring quantifiers, and it allows to count the number of witnesses for a formula in a given semiring (cf. the introduction to Chapter 4).

In Chapters 2 and 4 we will investigate the effect, at the level of recognising objects, of applying a layer of existential and semiring quantifiers, respectively, to Boolean algebras of (languages defined by) formulae. Since we do not assume that these Boolean algebras are contained in Reg(A * ), and finite monoids are not well-suited for recognition outside the class of regular languages, we need a suitable notion of recognition in the general setting. This is the topic of the next section.

Boolean spaces with internal monoids

In Section 1.2 we illustrated how finite and profinite monoids are central to the theory of regular languages. However, monoid theory does not allow for a fine-grained analysis of arbitrary languages. Indeed, there are several (non-regular) languages L whose syntactic morphism is the identity of A * . This implies that every monoid recognising L recognises any language in the alphabet A. We give an example of such a language L. Set

L = {ww R ∈ A * | w ∈ A * },
where w R is the reversal of w. For example, (abbc) R = cbba. We claim that the syntactic morphism A * → M L is the identity of A * . If u ∼ L v then vu R , uv R ∈ L. Thus it suffices to note that any two words in the same equivalence class must have the same length, for then they have to be equal. In turn, this can be proved directly. We give an example for A = {a, b}, u = aa and v = aaaa. To see that the words u and v cannot be equivalent modulo ∼ L , pick x = baabb and y = b. Then xuy ∈ L, but xvy / ∈ L. We thus need to introduce a new class of recognising objects that extends the collection of finite monoids, and that is well-suited for the recognition of arbitrary languages. This leads to the notion of Boolean spaces with internal monoids (BiMs). Instead of giving the precise definition up front, we derive it from the analysis of Boolean algebras of languages closed under quotients introduced in Section 1.2.

Define a biaction of a monoid M on a set X as a pair (λ, ρ) of compatible (or commuting) left and right actions of M on X. That is, λ : M × X → X, ρ : X × M → X are left and right actions, respectively, and for any m, n ∈ M and x ∈ X,

λ(m, ρ(x, n)) = ρ(λ(m, x), n).
Throughout, we write λ m : X → X for the function λ(m, -), and ρ n : X → X for ρ(-, n). With this notation, the compatibility condition amounts to saying that, for each m, n ∈ M,

λ m • ρ n = ρ n • λ m .
Every monoid acts in the obvious way on itself, both on the left and on the right. The two actions are compatible precisely because the monoid operation is associative. If X is equipped with a topology, and the functions λ m , ρ n are continuous for every m, n ∈ M, then we say that the biaction (λ, ρ) has continuous components. Now, recall from Section 1.2 that, for any two words v, w ∈ A * , the map that is closed under the quotients L → v -1 Lw -1 for every v, w ∈ A * . Then we have a commutative square as follows.

v -1 ( )w -1 : ℘ (A * ) → ℘ (A * ), L → v -1 Lw -1
℘ (A * ) ℘ (A * ) B B v -1 ( )w -1 v -1 ( )w -1 (1.11)
Write X for the dual space of the Boolean algebra B, and f : β(A * ) X for the continuous surjection corresponding to the embedding B → ℘ (A * ).

The diagram in (1.11) corresponds, by duality, to a commutative square as follows.

β(A * ) β(A * ) X X β(α (v,w) ) f f β(α (v,w) ) (1.12)
Thus the space X is equipped with a biaction with continuous components of the monoid A * . This biaction can be 'internalised' in the following way. Consider the image f (A * ) of the restriction of f : β(A * )

X to the dense subspace A * .

β(A * ) X A * f (A * ) f (1.13)
Chapter 1. Introduction: duality and recognition

The subset f (A * ) is dense in X because

X = f (β(A * )) = f (A * ) ⊆ f (A * ).
Moreover, since the continuous map f is equivariant with respect to the biaction of A * by (1.12), the monoid operation of A * induces a monoid operation on f (A * ). Indeed, for any

x ∈ f (A * ) pick w x ∈ f -1 (x). If x ∈ f (A * ), we set x • x = λ w x (x ).
It is not hard to see that this operation is well defined and it is a monoid operation making the restriction of f to A * a monoid morphism. The biaction of A * on X can then be regarded as a biaction of the monoid f (A * ) on X. Therefore, similarly to β(A * ), the Boolean space X admits a dense subspace with a monoid structure whose biaction lifts to a biaction with continuous components on X. Note that, if B = B(L) for some language

L ⊆ A * (cf. equation (1.6)), then f (A * ) is the syntactic monoid M L of L.
Thus X is a compactification of the syntactic monoid M L . As opposed to β(A * ), it is second countable. That is, its Boolean algebra of clopens is countable, being the Boolean algebra B(L) generated by L under the biaction of the countable monoid A * .

Definition 1.21. The syntactic space of a language L ⊆ A * is the Boolean space X dual to the Boolean algebra B(L) generated by the quotients of L, cf. equation (1.6).

The discussion above leads to the following notion of topological recognisers for arbitrary languages. Definition 1.22. A Boolean space with an internal monoid (BiM, for short) is a pair (X, M) such that 1. X is a Boolean space; 2. M is a dense subspace of X equipped with a monoid structure; 3. the biaction of M on itself extends to a biaction (λ, ρ) of M on X with continuous components.

In item 3, saying that the biaction (λ, ρ) extends the biaction of M on itself means that, for every m ∈ M, the following two squares commute.

M X M X M X M X m•- λ m -•m ρ m
Before proceeding, a few remarks are in order.

Remark 1.23. Let L ⊆ A * be an arbitrary language, and X its syntactic space. Then L is regular if, and only if, its syntactic monoid M L is finite. In turn, this is equivalent to X being finite and coinciding with M L . Hence, if L is regular, X admits a (continuous) monoid operation. If L is not regular, it is never the case that the biaction of the internal monoid is given by the left and right components of a continuous monoid operation on X (cf. Theorem 1.29 below). For example, consider the monoid N free on one generator. By the universal property of the Stone-Čech compactification, the biaction of N on itself extends to a biaction of N on β(N) with continuous components. However the space β(N) is not equipped with a continuous monoid operation extending the one on N, see [START_REF] Hindman | Algebra in the Stone-Čech compactification[END_REF]Chapter 4].

Remark 1.24. In Chapter 4 we will need a slight generalisation of the notion of BiM. Instead of imposing that the monoid is a dense subset of the space, we will only require a function from the monoid to the space with dense image. The reason is that the more restrictive notion introduced above is not well-suited when considering monads on the category of BiMs, cf. Theorem 4.4.

Remark 1.25. Boolean spaces with internal monoids were first defined in [START_REF] Gehrke | The Schützenberger product for syntactic spaces[END_REF]. However, a closely related notion of topological recognisers already existed in the form of semiuniform monoids [START_REF] Gehrke | A topological approach to recognition[END_REF]. These are monoids equipped with a uniform space structure, namely the Pervin uniformity given by a Boolean algebra of subsets of the monoid, such that the biaction of the monoid on itself has uniformly continuous components. As it was shown in [START_REF] Gehrke | A topological approach to recognition[END_REF]Theorem 1.6], if (M, U ) is a semiuniform monoid, then its uniform completion X is a Boolean space containing M as a dense subspace. Also, by uniform continuity, the biaction of M on itself has a unique extension to a biaction with continuous components on X. Thus (X, M) is a BiM. Conversely, given a BiM (X, M), since preimages of clopens under the components of the actions of M on X are clopens, the actions of M on itself are uniformly continuous with respect to the Pervin uniformity U on M given by the Boolean algebra

{C ∩ M | C is clopen in X}.
Thus (M, U ) is a semiuniform monoid. It is not hard to see that these two constructions are inverse to each other. A related approach, also based on a topological notion of recognition, was put forward in [START_REF] Steinberg | Topological dynamics and recognition of languages[END_REF].

Next we introduce the notion of recognition associated with BiMs, generalising the recognition of languages through morphisms to finite monoids. To do so, we need to define what a morphism between two Boolean spaces with internal monoids is. Definition 1.26. A morphism between two BiMs (X, M) and (Y, N) is a continuous map f : X → Y that restricts to a monoid morphism M → N.

We now show that morphisms, as just defined, preserve the relevant left and right actions.

• λ m = λ f (m) • f and f • ρ m = ρ f (m) • f .
Proof. We only consider the left actions; the proof for the right actions is the same, mutatis mutandis. Consider the continuous functions

f • λ m , λ f (m) • f : X → Y.
Since Y is Hausdorff, it suffices to show that the two functions coincide when restricted to the dense subset M. In turn, this follows at once from the fact that f restricts to a monoid morphism M → N.

An example of a BiM morphism is the map f of (1.13). In fact, note that the syntactic space X of the language L, displayed in the latter equation, carries the structure of a BiM whose internal monoid is f (A * ).

To define recognition through BiM morphisms, recall from Example 1.7 that the Boolean algebra of clopens of β(A * ) is isomorphic to the power-set ℘ (A * ). Concretely, for every L ∈ ℘ (A * ), the isomorphism is given by

L → L = {x ∈ β(A * ) | L ∈ x}.
(1.14) Definition 1.28. Let A be a finite alphabet, and L ⊆ A * a language. We say that L (or L) is recognised by the BiM morphism

f : (β(A * ), A * ) → (X, M) if there is a clopen C ⊆ X such that L = f -1 (C), i.e. L = f -1 (C ∩ M).
Moreover, the language L is recognised by the BiM (X, M) if there is a morphism (β(A * ), A * ) → (X, M) recognising L. Similarly, we say that a morphism (or a BiM) recognises a Boolean algebra of languages if it recognises all its elements.

For regular languages the previous definition coincides with the notion of language recognition through morphisms into finite monoids defined on page 21, for then X = M is a finite monoid. However, it is finer-grained than discrete recognition by the syntactic monoid in the non-regular setting, because the topology of X specifies which subsets of M can be used for recognition. These are precisely those of the form

C ∩ M, for C a clopen subset of X.
We conclude by showing that, outside the regular languages, the dual spaces of Boolean algebras of languages closed under quotients cannot be equipped in a natural way with continuous monoid operations. In this sense, outside regular languages profinite monoids have to be replaced by BiMs. The following theorem first appeared in [START_REF] Gehrke | A topological approach to recognition[END_REF]Theorem 4.1]; here, we provide an idea of the proof. Theorem 1.29. Let B be a Boolean subalgebra of ℘ (A * ) closed under the quo- tient operations L → v -1 Lw -1 for every v, w ∈ A * . The following statements are equivalent.

1. The inclusion morphism B → ℘ (A * ) factors through Reg(A * ), i.e. every language in B is regular.

2. The dual space X of B is equipped with a (jointly) continuous monoid operation which extends the monoid operation of its internal monoid.

Proof. Assume that item 1 holds. By Theorem 1.17, the dual of the inclusion morphism B → Reg(A * ) is a continuous surjective map f : A * X. For any x, y ∈ X, set x • y = f (uv) where u ∈ f -1 (x) and v ∈ f -1 (y). Since B is closed under the quotient operations, this monoid operation is welldefined, it is continuous, and it turns f into a monoid morphism. Since the canonical surjection β(A * )

A * is also equivariant, item 2 follows. Now, suppose item 2 holds. Then the composition

A * → β(A * ) X
is a monoid morphism from A * to the profinite monoid X. By the universal property of A * there is a unique continuous monoid morphism A * → X such that the bottom triangle in the diagram below commutes.

β(A * )

A * A *

X

It then follows that the right vertical triangle commutes. That is, by Theorem 1.17, the morphism B → ℘ (A * ) factors through Reg(A * ).

An overview of the following chapters

Having introduced BiMs and the ensuing notion of recognition, we can formulate the problem that will be addressed in the remaining chapters of Part I of this thesis. The question is the following: let L be a language defined by a formula ϕ(x) with a free first-order variable x, and X a BiM recognising it. If Q is some quantifier (e.g., Q = ∃, or a modular quantifier introduced in Section 1.3), write X for the syntactic space of the language defined by the formula Qx.ϕ(x). What is the relation between X and X ? That is, what is the effect at the level of topological recognisers of applying a layer of first-order quantifiers to Boolean algebras of formulae?

In Chapter 2 we deal with the case Q = ∃. There we avoid any categorical machinery, and we rather exploit algebraic and topological intuitions. We will see that the effect on BiMs of applying a layer of existential quantifier involves two main ingredients: the Vietoris hyperspace construction from general topology and the bilateral semidirect product of two monoids, a generalisation of the semidirect product of group theory. Our construction is closely related to a construction on finite (and profinite) monoids, namely that of Schützenberger product. This product is a central ingredient in Schützenberger's characterisation of star-free languages; cf. the introduction to Chapter 2. Indeed, we show that a binary variant of our construction on BiMs corresponds to the concatenation of languages on the algebraic side. This leads to the generalisation of classical results of Schützenberger and Reutenauer concerning the concatenation of regular languages.

In the case of the semiring quantifiers ∃ S,k , the Vietoris hyperspace must be replaced by the free profinite S-semimodule on a Boolean space. In Chapter 3 we provide a characterisation of these profinite objects as algebras of finitely additive S-valued measures, provided S is a finite semiring. More generally, we study algebras of measures with values in profinite semirings. In turn, this allows us to identify in Chapter 4 the construction on BiMs dual to applying a layer of semiring quantifiers ∃ S,k with S finite.

Chapter 2

On existentially quantified languages

In the theory of regular languages, a fundamental tool in studying the connection between algebra and logic is the availability of constructions on monoids which mirror the action of quantifiers. That is, given the syntactic monoid for a language defined by a formula with a free variable, one wants to construct a monoid recognising the language defined by the quantified formula. Constructions of this type abound, and are all versions of semidirect products. In particular, a central rôle is played by the so-called block product which allows one to construct recognisers for many different quantifiers [START_REF] Tesson | Logic Meets Algebra: the Case of Regular Languages[END_REF].

In this chapter we focus on this problem, but in the setting of arbitrary languages. Suppose we are given a (possibly non-regular) language L in the extended alphabet A × 2, and a Boolean space with an internal monoid (X, M) recognising L. As explained on page 24, we can consider the 'quantified language' L ∃ ⊆ A * associated to L. In the case where L was defined by a formula ϕ(x) with a free first-order variable x, the language L ∃ will be defined by the sentence ∃x.ϕ(x). We want to construct a BiM recognising the language L ∃ and as little else as possible. In other words, what is the effect on topological recognisers corresponding to applying a layer of existential quantifier on Boolean algebras of languages? Using the standard semantic view of quantification as projection, we derive a notion of unary Schützenberger product for BiMs. This makes heavy use of the Vietoris construction from general topology, which is also central to the coalgebraic treatment of classical modal logic, and it extends the Schützenberger product for monoids. The binary Schützenberger product was originally introduced in [START_REF] Schützenberger | On finite monoids having only trivial subgroups[END_REF] as a main ingredient towards the characterisation of star-free languages as those whose syntactic monoids contain no non-trivial subgroups. We show that the unary Schützenberger product of a BiM provides a recogniser for the quantified languages L ∃ , and we prove that it is 'optimal' by characterising the Boolean algebra of languages that it recognises. The results concerning the unary Schützenberger product of a BiM will be further generalised in Chapter 4, where we will consider semiring quantifiers. However, in the present chapter we avoid any categorical machinery and rather use algebraic and topological tools. This concrete approach will allow us to guess how to deal with more general quantifiers, and it will provide a running example in the general setting.

When considering the binary Schützenberger product of BiMs we obtain a generalisation of the classical results on the concatenation of regular languages. The Schützenberger product for two monoids was also generalised, in a different direction, in [START_REF] Chen | Schützenberger Products in a Category[END_REF]. There, the authors replace monoids (that is, monoid objects in the category of sets) with monoid objects in different categories, and generalise the notion of Schützenberger product to that setting. It would be interesting to find a common framework for our extension, involving BiMs, and theirs.

Finally, we give an equational characterisation of the Boolean algebras obtained by taking the unary Schützenberger product of a BiM. In the setting of regular languages, equations have played an essential rôle in providing decidability results for so-called varieties of languages. For classes of arbitrary languages decidability is not to be expected and separation of classes is the main focus. For this reason soundness becomes more important than completeness per se. However, complete axiomatisations are useful for obtaining decidability results for the class of regular languages within a fragment. The basis of equations we provide in this chapter is not optimal, however this represents a first step in this research direction. This chapter is a modified version of the paper [START_REF] Gehrke | The Schützenberger product for syntactic spaces[END_REF].

Outline of the chapter. In Section 2.1 we analyse the relation between recognisers for a language L ⊆ (A × 2) * , and recognisers for the existentially quantified language L ∃ ⊆ A * . To this end, we introduce a unary version of the Schützenberger product, first at the level of (internal) monoids and then for Boolean spaces. We prove in Theorem 2.9 that if a BiM (X, M) recognises L, then its unary Schützenberger product (♦X, ♦M) recognises L ∃ . Further, we characterise the languages recognised by (♦X, ♦M) through length preserving morphisms (see Theorem 2.10).

In Section 2.2 we introduce the binary version of the Schützenberger product for BiMs. Theorem 2.12 extends results of Reutenauer in the regular setting and establishes the connection with the concatenation product for arbitrary languages. Finally, in Section 2.3 we provide equations for the Boolean algebra recognised by the binary Schützenberger product of a BiM with the one-element space.

The unary Schützenberger product of a BiM

Let A be a finite alphabet. Recall from Section 1.3 that a formula ϕ(x) (in a language interpretable over words) with a free first-order variable x can be interpreted in those words w ∈ A * containing a marked position, which prescribes what the interpretation of the free variable should be. If w ∈ A * and 1 i |w|, w (i) denotes the word obtained from w by marking the ith position. This can naturally be seen as a word on the extended alphabet A × 2, as explained in Section 1.3. Write

A * ⊗ N = {(w, i) ∈ A * × N | 1 i |w|}.
Throughout this section we will make use of the following three maps

γ 0 : A * → (A × 2) * , γ 1 : A * ⊗ N → (A × 2) * , π : A * ⊗ N → A * .
• The map γ 0 : A * → (A × 2) * is the embedding given by w → w 0 , where w 0 has the same length as w = w 1 • • • w |w| and (w 0 ) j = (w j , 0) for each 1 j |w|.

That is, w 0 is copy of the word w with no marked letter.

• The map γ 1 : A * ⊗ N → (A × 2) * is the embedding (w, i) → w (i) , where we recall from equation (1.8) that w (i) has the same length as

w = w 1 • • • w |w| and
(w (i) ) j = (w j , 1) if i = j (w j , 0) otherwise.

• The map π : A * ⊗ N → A * is the projection onto the first coordinate.

Remark 2.1. If L ϕ(x) is the language defined by a formula ϕ(x), then

L ∃x.ϕ(x) = π(γ -1 1 (L ϕ(x) )).
More generally, given any language L ⊆ (A × 2) * , we have

L ∃ = π(γ -1 1 (L)),
where the language L ∃ is defined as in equation (1.9).

Remark 2.2. Unlike γ 0 , the maps γ 1 and π are not monoid morphisms. Indeed, A * ⊗ N does not have a suitable monoid structure. However, it does admit a biaction of A * . For any v ∈ A * and (w, i) ∈ A * ⊗ N, the components of the left and right actions are given by

λ v (w, i) = (vw, i + |v|), ρ v (w, i) = (wv, i).
It is clear that both γ 1 and π preserve the actions of A * .

Assume that a language1 L ⊆ (A × 2) * is recognised by a monoid morphism τ : (A × 2) * → M. Then we have a span as follows. Note that this span is not a relational morphism in the sense of Tilson's definition given in [START_REF] Eilenberg | Automata, languages, and machines[END_REF], since the domain A * ⊗ N does not have a compatible monoid structure.

A * ⊗ N A * (A × 2) * M π γ 1 τ
The latter gives rise to a relation R :

A * M defined by (w, m) ∈ R ⇐⇒ ∃ (w, i) ∈ π -1 (w) such that (τ • γ 1 )(w, i) = m ⇐⇒ ∃ 1 i |w| such that τ(w (i) ) = m.
Though π is not injective, it does have finite preimages. As will be crucial in what follows, this allows us to represent R as a function (which, in general, is not a monoid morphism with respect to the complex multiplication on ℘ f (M))

ξ 1 : A * → ℘ f (M), w → {τ(w (i) ) | 1 i |w|} (2.1)
where ℘ f (M) denotes the set of finite subsets of M. Consider the monoid structure on ℘ f (M) with union as the binary operation, and the empty set as unit. Notice that the monoid M acts on ℘ f (M) both to the left and to the right, and the two actions are compatible. The left action

M × ℘ f (M) → ℘ f (M) is given, for m ∈ M and S ∈ ℘ f (M), by m • S = {m • s | s ∈ S}.
Similarly, the right action is given by

S • m = {s • m | s ∈ S}.
Definition 2.3. We define the unary Schützenberger product ♦M of the monoid M as the bilateral semidirect product of the monoids ( ℘ f (M), ∪)

and (M, •). Explicitly, the underlying set of ♦M is the Cartesian product ℘ f (M) × M, and the multiplication is given by

(S, m) * (T, n) = (S • n ∪ m • T, m • n).
We point out that the construction M → ♦M is functorial. Also, note that the projection onto the second coordinate, π 2 : ♦M → M, is a monoid morphism.

Remark 2.4. What is nowadays called the Schützenberger product of two monoids was introduced by Schützenberger [120, p. 191] in connection with the concatenation product, and it was later generalised by Straubing [START_REF] Straubing | A generalization of the Schützenberger product of finite monoids[END_REF] to any finite number of monoids and by Pin [START_REF] Pin | Algebraic tools for the concatenation product[END_REF] to ordered monoids. Using Straubing's construction, the unary Schützenberger product of M is simply M, and hence is different from ♦M introduced above. When dealing with the binary case in Section 2.2, we shall work with the binary operation as originally introduced by Schützenberger.

Proposition 2.5. If τ : (A × 2) * → M is a monoid morphism recognising the language L ⊆ (A × 2) * , then there exists a monoid morphism ξ : A * → ♦M that recognises the language L ∃ and makes the following diagram commute.

A * ♦M (A × 2) * M ξ γ 0 π 2 τ
Proof. Define ξ : A * → ♦M as the pairing of the maps ξ 1 :

A * → ℘ f (M) from (2.1), and τ • γ 0 : A * → M. Explicitly, ξ : w → ({τ(w (i) ) | 1 i |w|}, τ(w 0 )).
A straightforward computation shows that ξ is a monoid morphism. In order to see that ξ recognises the language L ∃ , pick V ⊆ M such that L = τ -1 (V), and set

V = {S ∈ ℘ f (M) | S ∩ V = ∅}. Then ξ -1 ( V × M) = {w ∈ A * | {τ(w (i) ) | 1 i |w|} ∈ V} = {w ∈ A * | {τ(w (i) ) | 1 i |w|} ∩ V = ∅} = {w ∈ A * | ∃1 i |w| s.t. w (i) ∈ τ -1 (V)} = L ∃ .
That is, ξ recognises the language L ∃ through the subset V.

Remark 2.6. Definition 2.3 (and consequently also the upcoming Definition 2.7) was 'pulled out of a hat'. However one can derive by duality, by a careful analysis of how quotients in ℘ (A * ) of quantified languages are calculated relative to those in ℘ ((A × 2) * ), that the operation given in the definition of ♦M is the right one. We shall do this in greater generality in Section 4.4.

We now extend the previous construction from monoids to Boolean spaces with internal monoids. To this end, suppose the language L ⊆ (A × 2) * is recognised by a BiM morphism

τ : (β(A × 2) * , (A × 2) * ) → (X, M).
Notice that in this case we have a pair of continuous maps

β(A * ⊗ N) β(A * ) β(A × 2) * X βπ βγ 1 τ (2.2)
which, as before, yields a relation β(A * ) X. We describe this relation as a continuous map on β(A * ). In the topological setting, the analogue of the finite power-set construction is provided by the Vietoris hyperspace V (X) introduced in Example 1.10. Just as in the monoid case, diagram (2.2) yields a map

ξ 1 : β(A * ) → V (X) (2.3) defined as the composition τ • βγ 1 • (βπ) -1
, or equivalently as the unique continuous extension of the map ξ 1 :

A * → ℘ f (M) defined in (2.

1).

Definition 2.7. The unary Schützenberger product of a BiM (X, M) is the pair (♦X, ♦M), where ♦X is the Boolean space V (X) × X equipped with the product topology and ♦M is as in Definition 2.3.

Lemma 2.8. If (X, M) is a BiM, then so is its unary Schützenberger product (♦X, ♦M).

Proof. The obvious embedding ℘ f (M) → V (X) has dense image (cf. Ex- ample 1.10), thus the monoid ♦M is a dense subset of ♦X. We show that, for each S ∈ ℘ f (M) and m ∈ M, the function l (S,m) : ♦X → ♦X given by

l (S,m) : (K, x) → ({λ s (x) | s ∈ S} ∪ λ m (K), λ m (x))
is continuous. It is clear that the above map extends the left action of ♦M on itself. Uniqueness will then follow automatically from continuity. The continuity of the right action can be proved in a similar fashion.

To settle the continuity of l (S,m) : ♦X → ♦X it is enough to prove that π 1 • l (S,m) and π 2 • l (S,m) are both continuous, where π 1 : ♦X → V (X) and π 2 : ♦X → X denote the first and second projections, respectively. Note that π 2 • l (S,m) = λ m , which is continuous. Hence it suffices to prove that, whenever V ⊆ X is clopen, the preimage under the map

π 1 • l (S,m) of the subbasic clopen V from (1.5) is again clopen. Now, (π 1 • l (S,m) ) -1 ( V) = {(K, x) ∈ V (X) × X | ({λ s (x) | s ∈ S} ∪ λ m (K)) ∩ V = ∅} = {(K, x) ∈ V (X) × X | ∃s ∈ S s.t. λ s (x) ∈ V} ∪ ( λ -1 m (V) × X) = (V (X) × s∈S λ -1 s (V)) ∪ ( λ -1 m (V) × X), exhibiting (π 1 • l (S,m) ) -1 ( V) as a clopen in ♦X.
Similarly to the monoid case, the projection π 2 : ♦X → X onto the second coordinate is a BiM morphism. Next we extend Proposition 2.5 from monoids to BiMs, thus providing topological recognisers for the existentially quantified languages. Theorem 2.9.

If τ : (β(A × 2) * , (A × 2) * ) → (X, M) is a BiM morphism recognising the language L ⊆ (A × 2) * , then there is a BiM morphism ξ : (β(A * ), A * ) → (♦X, ♦M)
recognising the language L ∃ and such that the following diagram commutes.

β(A * ) ♦X β(A) * X ξ βγ 0 π 2 τ
Proof. The map ξ : β(A * ) → ♦X is given by the pairing of ξ 1 :

β(A * ) → V (X) from (2.
3) with τ • βγ 0 . This is clearly continuous, and it restricts to a monoid morphism A * → ♦M by (the proof of) Proposition 2.5. If the morphism τ recognises the language L through the clopen V ⊆ X, it is easy to see that ξ recognises the language L ∃ through the clopen V × X.

The previous theorem exhibits a recogniser for the existentially quantified languages of the form L ∃ , but it does not say whether the construction is somehow optimal. For instance, (β(A * ), A * ) is another BiM recognising L ∃ , but it is clearly far from being optimal because it recognises any A-language.

The next theorem states that, restricting to the appropriate class of recognising morphisms (β(A * ), A * ) → (♦X, ♦M), the Boolean algebra closed under quotients of languages recognised by (♦X, ♦M) is as small as one could hope for. The proof of this result is postponed to Chapter 4, where an analogous fact is shown to hold in greater generality (see Theorem 4.29). Let us say that a BiM morphism

τ : (β(A * ), A * ) → (♦X, ♦M) is length preserving if, for each a ∈ A, the first component of τ(a) ∈ ℘ f (M) × M is of the form {m a } for some m a ∈ M.
For any finite al- phabet A and BiM (X, M), write B(X, A) for the Boolean algebra of all languages over A recognised by some BiM morphism into (X, M). Further, let B(X, A × 2) ∃ denote the Boolean subalgebra of ℘ (A * ) generated by the set {L ∃ | L ∈ B(X, A × 2)}. We have Theorem 2.10. Let (X, M) be a BiM, and A a finite alphabet. The Boolean subalgebra closed under quotients of ℘ (A * ) generated by all the languages recognised by a length preserving morphism (β(A * ), A * ) → (♦X, ♦M) is generated as a Boolean algebra by the union of B(X, A) and B(X, A × 2) ∃ .

The Schützenberger product of two BiMs

The unary operation on BiMs (X, M) → (♦X, ♦M) introduced in the previous section can be lifted to a binary operation. We first deal with the internal monoids. Given two monoids (M, •) and (N, •), their Schützenberger product ♦(M, N), introduced in [START_REF] Schützenberger | On finite monoids having only trivial subgroups[END_REF], has underlying set

℘ f (M × N) × M × N
and it is equipped with the monoid operation

(S, m 1 , n 1 ) • (T, m 2 , n 2 ) = (m 1 • T ∪ S • n 2 , m 1 • m 2 , n 1 • n 2 ).
The latter operation can be viewed as a matrix multiplication:

m 1 S 0 n 1 m 2 T 0 n 2 = m 1 • m 2 m 1 • T ∪ S • n 2 0 n 1 • n 2 .
Now, consider two Boolean spaces with internal monoids (X, M) and (Y, N). We define the Boolean space ♦(X, Y) as the product

V (X × Y) × X × Y.
The monoid ♦(M, N) is dense in ♦(X, Y). Moreover, the left action of ♦(M, N) on itself can be extended to ♦(X, Y) by setting, for any (S, m 1 , n 1 ) ∈ ♦(M, N),

λ (S,m 1 ,n 1 ) : ♦(X, Y) → ♦(X, Y), (Z, x, y) → (m 1 Z ∪ Sy, λ m 1 (x), λ n 1 (y)), (2.4)
where

m 1 Z = {(λ m 1 (x), y) ∈ X × Y | (x, y) ∈ Z} and Sy = {(m, λ n (y)) ∈ X × Y | (m, n) ∈ S}.
Similarly, the right action can be defined by

ρ (S,m 1 ,n 1 ) : ♦(X, Y) → ♦(X, Y), (Z, x, y) → (Zn 1 ∪ xS, ρ m 1 (x), ρ n 1 (y)), (2.5)
where

Zn 1 = {(x, ρ n 1 (y)) ∈ X × Y | (x, y) ∈ Z} and xS = {(ρ m (x), n) ∈ X × Y | (m, n) ∈ S}.
It is easy to see that this yields a biaction of ♦(M, N) on ♦(X, Y).

Lemma 2.11. The biaction of ♦(M, N) on ♦(X, Y) defined in (2.4) and (2.5) has continuous components. Thus (♦(X, Y), ♦(M, N)) is a BiM.

Proof. We show that the components of the left action are continuous, the proof for the right action being the same, mutatis mutandis. It suffices to prove that the map

g : V (X × Y) × Y → V (X × Y), (Z, y) → m 1 Z ∪ Sy is continuous, for every m 1 ∈ M and S ∈ ℘ f (M × N). Since L = ( L c ) c
and preserves finite joins, it suffices to show that g -1 ( (L 1 × L 2 )) is clopen whenever L 1 , L 2 are clopens of X and Y, respectively. We have

g -1 ( (L 1 × L 2 )) = {(Z, y) ∈ V (X × Y) × Y | (m 1 Z ∪ Sy) ∩ (L 1 × L 2 ) = ∅} = (V (X × Y) × {y | Sy ∩ (L 1 × L 2 ) = ∅}) ∪ ({Z | m 1 Z ∩ (L 1 × L 2 ) = ∅} × Y).
We remark that

m 1 Z ∩ (L 1 × L 2 ) = ∅ ⇐⇒ Z ∈ (λ -1 m 1 (L 1 ) × L 2 )
and

Sy ∩ (L 1 × L 2 ) = ∅ ⇐⇒ π 1 (S) ∩ L 1 = ∅ and y ∈ n∈π 2 (T) λ -1 n (L 2 ),
where

T = π -1 1 (L 1 ) ∩ S. Therefore g -1 ( (L 1 × L 2 )) = V (X × Y) × n∈π 2 (T) λ -1 n (L 2 ) ∪ ( (λ -1 m 1 (L 1 ) × L 2 ) × Y), exhibiting g -1 ( (L 1 × L 2 )) as a clopen.
The next result establishes the connection between concatenation of possibly non-regular languages, and the binary Schützenberger product of two Boolean spaces with internal monoids. In particular, it extends the theorems of Schützenberger [START_REF] Schützenberger | On finite monoids having only trivial subgroups[END_REF] and Reutenauer [START_REF] Reutenauer | Theoretical Computer Science 4th GI Conference: Aachen[END_REF].

Theorem 2.12. Consider BiMs (X, M) and (Y, N). Let B be the Boolean algebra generated by all the A-languages of the form L 1 , L 2 and L 1 aL 2 , where L 1 (respectively L 2 ) is recognised by X (respectively Y) and a ∈ A. Then an A-language is recognised by the BiM (♦(X, Y), ♦(M, N)) if, and only if, it belongs to B.

Proof. In one direction, suppose the languages L 1 , L 2 are recognised by two BiM morphisms

τ 1 : (β(A * ), A * ) → (X, M) and τ 2 : (β(A * ), A * ) → (Y, N) through the clopens C 1 ⊆ X and C 2 ⊆ Y, respectively. Fix an arbitrary a ∈ A. We will define a morphism (β(A * ), A * ) → (♦(X, Y), ♦(M, N))
recognising the concatenation L 1 aL 2 . By abuse of notation, we write

τ 1 × τ 2 : β(A * × {a} × A * ) → X × Y for the unique continuous extension of the product map A * × {a} × A * → X × Y whose components are (w, a, w ) → τ 1 (w) and (w, a, w ) → τ 2 (w ). Let ζ a : β(A * ) → V (X × Y) be the continuous function induced by the span β(A * × {a} × A * ) β(A * ) X × Y βc τ 1 ×τ 2 just as for diagram (2.
2), where c :

A * × {a} × A * → A * is the concate- nation map (w, a, w ) → waw . We claim that the map ζ a recognises the language L 1 aL 2 through the clopen (C 1 × C 2 ). Indeed, ζ -1 a ( (C 1 × C 2 )) ∩ A * = {w ∈ A * | ((τ 1 × τ 2 ) • (βc) -1 (w)) ∩ (C 1 × C 2 ) = ∅} = {w ∈ A * | (βc) -1 (w) ∩ (L 1 × {a} × L 2 ) = ∅} = {w ∈ A * | ∃u ∈ L 1 , ∃v ∈ L 2 s.t. w = uav} = L 1 aL 2 .
Therefore the continuous product map

ζ a , τ 1 , τ 2 : β(A * ) → X♦Y recog- nises the language L 1 aL 2 through the clopen (C 1 × C 2 ) × X × Y. Further, it induces a morphism (β(A * ), A * ) → (X♦Y, M♦N) because ζ a , τ 1 , τ 2 re- stricts to a monoid morphism A * → M♦N.
This amounts to saying that τ 1 , τ 2 restrict to monoid morphisms, and for all w, w ∈ A *

τ 1 (w) • ζ a (w ) ∪ ζ a (w) • τ 2 (w ) = τ 1 (w) • {(τ 1 (u), τ 2 (v)) | u, v ∈ A * , w = uav} ∪ {(τ 1 (u), τ 2 (v)) | u, v ∈ A * , w = uav} • τ 2 (w ) = {(τ 1 (wu), τ 2 (v)) | u, v ∈ A * , w = uav} ∪ {(τ 1 (u), τ 2 (vw )) | u, v ∈ A * , w = uav} = ζ a (ww ).
We remark that the morphism

ζ a , τ 1 , τ 2 : (β(A * ), A * ) → (X♦Y, M♦N) recognises also the languages L 1 and L 2 through the clopens V (X × Y) × C 1 × Y and V (X × Y) × X × C 2 .
For the converse direction, consider an arbitrary BiM morphism

ζ, τ 1 , τ 2 : (β(A * ), A * ) → (X♦Y, M♦N).
It suffices to show that the languages

ζ -1 ( (C 1 × C 2 )) ∩ A * belong
{w ∈ A * | ∃u, v ∈ A * s.t. w = uav and τ 1 (u)ζ(a)τ 2 (v) ∈ (C 1 × C 2 )} belongs to the Boolean algebra B. Proof of Claim. Since ζ(a) ∈ ℘ f (M × N), there is s ∈ N such that ζ(a) = {(m 1 , n 1 ), . . . , (m s , n s )}
for some {m 1 , . . . , m s } ⊆ M and {n 1 , . . . , n s } ⊆ N. We will show that

L C 1 ×C 2 ,a = s i=1 A i aB i , (2.6)
where

A i = τ -1 1 (ρ -1 m i (C 1 )) ∩ A * and B i = τ -1 2 (λ -1 n i (C 2 )) ∩ A * .
(Recall that ρ m i is the continuous component of the right action of M on X, and λ n i is the continuous component of the left action of N on Y). This will settle the claim. Pick w ∈ A * . Then w ∈ L C 1 ×C 2 ,a if, and only if, there exist u, v ∈ A * with w = uav and τ

1 (u)ζ(a)τ 2 (v) ∈ (C 1 × C 2 ) if,
and only if, w = uav and there is i ∈ {1, . . . , s} such that

(τ 1 (u) • m i , n i • τ 2 (v)) = τ 1 (u) • (m i , n i ) • τ 2 (v) ∈ C 1 × C 2 , i.e. u ∈ τ -1 1 (ρ -1 m i (C 1 )) ∩ A * and v ∈ τ -1 2 (λ -1 n i (C 2 )) ∩ A * .
∈ A * ζ(w) = u,v∈A * a∈A w=uav τ 1 (u)ζ(a)τ 2 (v). Thus w ∈ ζ -1 ( (C 1 × C 2 )) ∩ A * if, and only if, there are u, v ∈ A * and a ∈ A such that w = uav and τ 1 (u)ζ(a)τ 2 (v) ∈ (C 1 × C 2 ). Therefore, by the claim, ζ -1 ( (C 1 × C 2 )) ∩ A * = a∈A L C 1 ×C 2 ,a
is a finite union of elements of B.

Remark 2.13. From the proof of Theorem 2.12 it is possible to extract a 'local version' of this result, dealing with single BiM morphisms into (♦(X, Y), ♦(M, N)). See [START_REF] Gehrke | The Schützenberger product for syntactic spaces[END_REF]Theorem 18].

Finally, the next corollary follows by Theorem 2.12, by noting that

L 1 L 2 = a∈A L 1 a(a -1 L 2 ) if ε / ∈ L 2 a∈A L 1 a(a -1 L 2 ) ∪ L 1 otherwise
where ε denotes the empty word.

Corollary 2.14. The BiM (♦(X, Y), ♦(M, N)) recognises the concatenation L 1 L 2 of languages L 1 , L 2 recognised by (X, M) and (Y, N), respectively.

Ultrafilter equations

Identifying simple equational bases for the Boolean algebras of languages recognised by Schützenberger products, in terms of the equational theories of the input Boolean algebras, is an important step in studying classes built up by repeated application of quantification or language concatenation. See, e.g., [START_REF] Pin | Profinite Semigroups, Malcev Products, and Identities[END_REF][START_REF] Branco | Equations defining the polynomial closure of a lattice of regular languages[END_REF] for examples of such work in the regular setting.

As a proof-of-concept and first step, we provide a fairly easy completeness result for the Boolean algebra of languages recognised by the Schützenberger product of a BiM with the one-element space. The set of equations we provide is far from being optimal, and we believe smaller bases of equations could be exhibited. For more on equations and their use in the setting of non-regular languages, we refer the interested reader to [START_REF] Gehrke | Duality and equational theory of regular languages[END_REF][START_REF] Gehrke | Ultrafilters on words for a fragment of logic[END_REF][START_REF] Gehrke | Stone duality, topological algebra, and recognition[END_REF]. We start by introducing some notation that will be useful in the following. Definition 2.15. Let B 1 and B 2 be Boolean algebras of A-languages closed under quotients. We define the Boolean algebra

B 1 ♦ +B 2 = <B 1 ∪ B 2 ∪ {L 1 aL 2 | L 1 ∈ B 1 , L 2 ∈ B 2 , a ∈ A}> BA .
Note that this Boolean algebra is also closed under quotients. In fact, by Theorem 2.12, its dual is the BiM obtained as the binary Schützenberger product of the BiMs corresponding to B 1 and B 2 . Let B ⊆ ℘ (A * ) be a Boolean algebra closed under quotients. We shall give equations for B♦ +2, where 2 is the two-element Boolean algebra. Explicitly, B♦ +2 is the Boolean algebra generated by the set B ∪ {LaA * | L ∈ B}. Dually, this corresponds to taking the binary Schützenberger product of a BiM (X, M) with the oneelement space, which is isomorphic to the unary Schützenberger product of (X, M).

Recall that an (ultrafilter) equation for a Boolean subalgebra of ℘

(A * ) is a pair µ ≈ ν, where µ, ν ∈ β(A * ). A language L ∈ ℘ (A * ) satisfies the ultrafilter equation µ ≈ ν provided L ∈ µ if, and only if, L ∈ ν.
A Boolean subalgebra of ℘ (A * ) satisfies an ultrafilter equation provided each of its elements satisfies it. If B is any Boolean subalgebra of ℘ (A * ), there is always a set of ultrafilter equations that is (trivially) complete for B, namely the kernel of the continuous map dual to the inclusion B → ℘ (A * ). The point is finding a manageable basis of equations that generates this kernel. Now, set

f a : A * ⊗ N → A * , (w, i) → w(a@i + 1), and f r : A * ⊗ N → A * , (w, i) → w |i = w 1 • • • w i ,
where a ∈ A and, if 1 i |w|, w(a@i) denotes the word obtained by replacing the ith letter of the word w = w 1 • • • w |w| by an a. Further, define w(a@|w| + 1) = wa.

The intuition is that the extension β f a will allow us to factor an ultrafilter at an occurrence of the letter a, whereas the extension β f r gives us access to the prefix of this factorisation. Definition 2.16. Let E (B♦ +2) denote the set of all ultrafilter equations µ ≈ ν so that

• µ ≈ ν holds in B; • for each γ ∈ β(A * ⊗ N) with µ = β f a (γ), there exists δ ∈ β(A * ⊗ N) such that ν = β f a (δ) and the equation β f r (γ) ≈ β f r (δ) holds in B; • for each δ ∈ β(A * ⊗ N) with ν = β f a (δ), there exists γ ∈ β(A * ⊗ N) such that µ = β f a (γ) and the equation β f r (γ) ≈ β f r (δ) holds in B.
In order to prove that the ultrafilter equations above characterise the Boolean algebra B♦ +2, we prepare two technical lemmas.

Lemma 2.17. Let γ ∈ β(A * ⊗ N). If µ = β f a (γ) and L ∈ β f r (γ), then LaA * ∈ µ. Proof. Recall from equation (1.3) that L ∈ β f r (γ) iff f -1 r (L) ∈ γ. Moreover f -1 r (L) = {(w, i) ∈ A * ⊗ N | w |i ∈ L} ⊆ {(w, i) ∈ A * ⊗ N | w(a@i + 1) ∈ LaA * } = f -1 a (LaA * ), so that f -1 a (LaA * ) ∈ γ, i.e. LaA * ∈ β f a (γ) = µ. Lemma 2.18. Let F ⊆ ℘ (A * ) be a proper filter, µ ∈ β(A * ) and a ∈ A. If LaA * ∈ µ for all L ∈ F, then there exists γ ∈ β(A * ⊗ N) such that µ = β f a (γ) and F ⊆ β f r (γ).
Proof. It suffices to show that the collection

{ f -1 a (K) ∩ f -1 r (L) | K ∈ µ, L ∈ F} is a filter basis (i.e.
, the intersection of any finite number of its elements is not empty), for then the Ultrafilter Extension Theorem will provide an ultrafilter satisfying the conditions in the statement. Furthermore, since µ and F are closed under finite intersections, it is enough to show that each set f -1 a (K) ∩ f -1 r (L) is not empty. Since LaA * ∈ µ by hypothesis, the intersection K ∩ LaA * is non-empty because it belongs to µ. Thus there exists w ∈ K and 1 i < |w| such that

w |i ∈ L and w i+1 = a. That is, (w, i) ∈ f -1 a (K) ∩ f -1 r (L).
We can finally prove that the set of equations in Definition 2.16 is sound and complete with respect to the Boolean algebra of languages B♦ +2.

Theorem 2.19. The equations in E (B♦ +2) characterise the Boolean algebra B♦ +2.

Proof. We first prove soundness, i.e. every language in B♦ +2 satisfies the set of ultrafilter equations E (B♦ +2). Given the symmetric nature of the latter it is enough to check that, for any L ∈ B, a ∈ A and µ ≈ ν ∈ E (B♦ +2), the language LaA * belongs to ν whenever it belongs to µ. By applying Lemma 2.18 with F = {L}, the condition LaA * ∈ µ entails that there exists

γ ∈ β(A * ⊗ N) such that µ = β f a (γ) and L ∈ β f r (γ). Then, by hypothesis, there is δ ∈ β(A * ⊗ N) satisfying ν = β f a (δ) and L ∈ β f r (δ).
Hence LaA * ∈ ν by Lemma 2.17. Now, we prove completeness. That is, every language K ∈ ℘ (A * ) satis- fying all the equations in E (B♦ +2) must belong to B♦ +2. Let us denote the dual map of the embedding B → ℘ (A * ) by τ : β(A * ) X. Recall from equation (1.14) the bijection K → K between subsets of A * and clopens of β(A * ). For any ultrafilter µ ∈ K set

C µ = τ -1 (τ(µ)) ∩ { LaA * | a ∈ A, L ∈ B, LaA * ∈ µ} ∩ {( LaA * ) c | a ∈ A, L ∈ B, LaA * / ∈ µ}. Claim. Let K ∈ ℘ (A * ). Then K ∈ B♦ +2 if, and only if, C µ ⊆ K for all µ ∈ K.
Proof of Claim. Let µ be an arbitrary element of K, and assume that C µ ⊆ K. Then

τ -1 (τ(µ)) = { H | H ∈ B, H ∈ µ}.
By compactness there are

H 1 , . . . , H h , L 1 , . . . , L l , M 1 , . . . , M m ∈ B such that ( h i=1 H i ) ∩ ( l i=1 L i a i A * ) ∩ ( m i=1 ( M i a i A * ) c ) ⊆ K.
Write D µ for the intersection on the left-hand side of the display above. Then D µ is a clopen containing µ, and the language

L µ = D µ ∩ A * belongs to B♦ +2. Further L µ = D µ ⊆ K, hence K = µ∈ K L µ
since µ is arbitrary. Again by compactness there are ultrafilters µ 1 , . . . ,

µ n ∈ K such that K = n i=1 L µ i . Thus K ∈ B♦ +2 because each L µ i belongs to B♦ +2. For the converse direction, pick ν ∈ C µ , for some µ ∈ K. Then B♦ +2 satisfies the equation µ ≈ ν. Since K ∈ B♦ +2 and µ ∈ K, we have K ∈ ν. That is, ν ∈ K.
In view of the previous claim it is enough to fix an arbitrary µ ∈ K and show that C µ ⊆ K. Pick ν ∈ C µ and notice that it suffices to prove

µ ≈ ν ∈ E (B♦ +2), for then µ ∈ K entails ν ∈ K, since K is assumed to satisfy all the equations in E (B♦ +2). Clearly, ν ∈ τ -1 (τ(µ)) entails that µ ≈ ν holds in B.
For the second condition in Definition 2.16, suppose that µ = β f a (γ) for some γ ∈ β(A * ⊗ N), and consider the collection

F = {L | L ∈ B, L ∈ β f r (γ)}.
Then LaA * ∈ µ for every L ∈ F, by Lemma 2.17. Moreover, since µ ≈ ν holds in B, LaA * ∈ ν for all L ∈ F. Since F is a filter basis closed under finite intersections, upon considering the proper filter generated by F, Lemma 2.18 entails the existence of δ ∈

β(A * ⊗ N) such that ν = β f a (δ) and F ⊆ β f r (δ). Notice that F = τ(β f r (γ)), thus τ(β f r (γ)) = τ(β f r (δ)). That is, B satisfies the equation β f r (γ) ≈ β f r (δ).
The third condition can be proved in a similar fashion.

Chapter 3

Profinite algebras, and semiring-valued measures

In the previous chapter we studied the effect, at the level of topological recognisers, of applying one layer of existential quantifier ∃ to Boolean algebras of languages defined by formulae with free first-order variables. We have seen that applying the quantifier ∃ on the algebra side corresponds essentially to taking the Vietoris hyperspace on the space side. We aim to generalise this result to the semiring quantifiers introduced in Section 1.3. The case of the existential quantifier is recovered by considering the twoelement distributive lattice 2, regarded as a semiring. The key observation is that the Vietoris space V (X) of a Boolean space X is the free profinite semilattice on X. In turn, semilattices are semimodules over 2. Thus, to understand the effect of applying a layer of semiring quantifiers, we should first have a good understanding of the profinite S-semimodules free on Boolean spaces, for S a semiring. This is achieved in the present chapter, while the representation result obtained here will be applied in Chapter 4 in the logic setting.

Semirings generalise rings by relaxing the conditions on the additive structure requiring just a monoid rather than a group. The analogue of the notion of module over a ring is that of semimodule over a semiring, or more concisely of an S-semimodule where S is the semiring. A profinite S-semimodule is one that is isomorphic to the inverse limit (or cofiltered limit) of finite S-semimodules. Every profinite S-semimodule carries a topology turning it into a Boolean space. We show in our main result, Theorem 3.23, that the free profinite S-semimodule on a Boolean space X is isomorphic to the algebra of all measures on X taking values in S, provided S is finite. Here, the measurable subsets of X are the clopens, and the measures on X are only required to be finitely additive (cf. Definition 3.14).

Our measure-theoretic representation provides a bridge between several topics of interest. Firstly, it connects measures and profinite algebras. In this respect, it is related to Leinster integration and of codensity monads are tightly related [START_REF] Leinster | Codensity and the ultrafilter monad[END_REF]. Codensity monads are a special case of the concept of right Kan extension. Leinster's observation is that sometimes they can be seen as providing a correspondence akin to the one between 'integration operators' and 'measures'. This analogy becomes concrete in our measure-theoretic representation. Indeed, profinite algebras arise from a special class of codensity monads (see Section 3.1), and we isolate a class of such monads admitting a concrete representation in terms of genuine measures. On the other hand, our main result makes a connection between measures and logic, as outlined above. Similar connections already exist and have proved useful. For example, in model theory Keisler measures [START_REF] Keisler | Measures and forking[END_REF] are probability measures on Boolean algebras of definable subsets of models, and generalise the notion of (complete) types. Finally, we connect measures and semirings in the form of integration theory with coefficients in a semiring, which is the main focus of idempotent analysis [START_REF] Kolokoltsov | Idempotent analysis and its applications[END_REF]. In the particular case of the tropical semiring, see Example 3.13, this leads to tropical geometry.

The results presented in this chapter will be the topic of [START_REF] Reggio | Codensity, profiniteness and algebras of semiringvalued measures[END_REF]. The characterisation of the free profinite S-semimodules, for S finite, was already announced in [START_REF] Gehrke | Quantifiers on languages and codensity monads[END_REF], where many details of the proofs were omitted. Here, we contribute a complete account of the topic and we consider the main result from a wider perspective, by studying algebras of measures with values in profinite semirings.

Outline of the chapter. In dealing with profinite algebras, we adopt a categorical approach. While monads allow for a categorical treatment of algebra, profinite algebra can be studied by means of profinite monads [START_REF] Boja | Recognisable Languages over Monads[END_REF][START_REF] Adámek | Profinite Monads, Profinite Equations, and Reiterman's Theorem[END_REF], a special case of right Kan extensions. Therefore, in Section 3.1 we give a complete account of the basic theory of profinite monads meant to be accessible to non-experts in category theory. In particular, we show in Proposition 3.10 that profinite monads yield the expected notion of profinite algebra for varieties of Birkhoff algebras. This covers the case of the profinite S-semimodules free on Boolean spaces, for any S (Corollary 3.11).

We only obtain our measure-theoretic characterisation of the free profinite S-semimodule on a Boolean space for finite semirings S, but in Section 3.2 we study the more general situation where S is profinite. We show that the algebras of S-valued measures yield those semimodules in which the scalar multiplication of S is jointly continuous, that we call 'strongly continuous' semimodules (cf. Theorem 3.21). The case of finite semirings is considered in Section 3.3. If S is finite then every profinite S-semimodule is strongly continuous. Thus we obtain our main result, Theorem 3.23.

Finally, in Section 3.4 we consider the case where S is profinite and idempotent. In this setting, every measure is uniquely determined by its density function (see Theorem 3.34). Provided S is finite and idempotent, this yields a characterisation of the free profinite S-semimodule on a Boolean space X as the algebra of all the continuous S-valued functions on X, with respect to an appropriate topology on S.

Codensity and profinite monads

The purpose of this first section is to introduce the notion of a profinite monad. This is a special case of a more general construction, namely that of a codensity monad (which, in turn, is a special case of right Kan extension). Profinite monads provide a way of associating to a monad T on the category of sets a monad T on the category of Boolean spaces. We show in Proposition 3.10 that, whenever the monad T is finitary, TX is the free profinite T-algebra on the Boolean space X. Although its content is categorical in nature, and the reader is supposed to be familiar with the basics of category theory, the section is written so as to be accessible to non-experts in category theory. In particular, we provide an elementary exposition of the notions involved up to the concept of monad as a categorical approach to algebra. For a more thorough introduction to the theory of codensity monads we refer the interested reader to [START_REF] Leinster | Codensity and the ultrafilter monad[END_REF].

Codensity monads: a brief introduction

We start by introducing a class of finitary monads on Set that will play a crucial rôle in the following, namely the semiring monads. First, let us recall the following notions from algebra. Definition 3.1. A semiring is a tuple S = (S, +, •, 0, 1) such that (S, +, 0) is an Abelian monoid, (S, •, 1) is a monoid, and for all s, t, u ∈ S the laws

s • (t + u) = (s • t) + (s • u), (t + u) • s = (t • s) + (u • s), s • 0 = 0 = 0 • s are satisfied. A semimodule over S (an S-semimodule, for short) is an Abelian monoid M = (M, + M , 0 M ) equipped with a 'scalar multiplication' of S, that is, a function S × M → M, (s, m) → sm satisfying s(m + M n) = sm + M sn, (s + t)m = sm + M tm, (s • t)m = s(tm), 1m = m, 0m = 0 M = s0 M
for all s, t ∈ S and m, n ∈ M. Example 3.2. Semimodules over semirings can be obtained as algebras for certain monads on Set, called semiring monads. Indeed, every semiring S gives rise to a functor S : Set → Set that associates to a set X the set of all finitely supported S-valued functions on X, i.e. SX = { f : X → S | f (x) = 0 for all but finitely many x ∈ X}.

(3.1)

If ϕ : X → Y is any function, we get a function Sϕ : SX → SY by setting

Sϕ : f → y → ∑ ϕ(x)=y f (x) .
Every element f ∈ SX can be represented as a formal sum ∑ n i=1 s i x i , where {x 1 , . . . , x n } ⊆ X is the support of f and f (x i ) = s i for each i. With this notation, we have

S f (∑ n i=1 s i x i ) = ∑ n i=1 s i f (x i ). It is straightforward to check that S : Set → Set is a functor. In fact, it is part of a monad (S, η, µ) whose unit is η X : X → SX, η X (x) : x → 1 if x = x 0 otherwise
(in other words, η X (x) is the S-valued characteristic function of {x}), and whose multiplication is

µ X : S 2 X → SX, n ∑ i=1 s i f i → x → n ∑ i=1 s i f i (x) .
We remark that the only place where the multiplication of S plays a rôle is in the definition of the multiplication µ of the monad. We refer to S as the semiring monad associated to S. Note that the finite power-set functor ℘ f is the semiring monad associated to the two-element distributive lattice 2 = ({0, 1}, ∨, ∧, 0, 1), regarded as a semiring. The algebras for the monad S are precisely the S-semimodules. For example, if S is 2, N = (N, +, •, 0, 1) or Z = (Z, +, •, 0, 1), then the algebras for S are semilattices, Abelian monoids and Abelian groups, respectively.

An interesting example of a Set-monad which is not finitary is the ultrafilter monad. Recall the category BStone of Boolean spaces and continuous maps. The underlying-set functor

| -| : BStone → Set has a left adjoint β : Set → BStone (3.2)
that sends a set X, regarded as a discrete space, to its Stone-Čech compactification β(X) (cf. Example 1.7). This adjunction induces a monad on Set, the ultrafilter monad, that is not finitary. By a theorem of Manes (see [90, Section 1.5] for a detailed exposition), its algebras are precisely the compact Hausdorff spaces. We briefly recall some basic facts from the theory of monads, see e.g. [START_REF] Adámek | Abstract and concrete categories[END_REF]. If T = (T, η, µ) is a monad on a category C, we write C T for the category of (Eilenberg-Moore) algebras for T. In the special case where T is a monad with rank and C is the category Set of sets and functions, the categories of the form Set T are, up to equivalence, exactly the varieties of algebras (with operations of possibly infinite, but bounded, arity). This correspondence restricts to categories of algebras for finitary Set-based monads (i.e., monads preserving filtered colimits) and varieties of Birkhoff algebras. See, e.g., [START_REF] Adámek | Abstract and concrete categories[END_REF]VI.24]. Whether T is finitary or not, the category Set T is always equipped with a (regular epi, mono) factorisation system. In the category of compact Hausdorff spaces, this is the factorisation of a continuous map into a continuous surjection followed by a continuous injection. If T is finitary, we recover the usual decomposition of a homomorphism of Birkhoff algebras into a surjective homomorphism followed by an injective one.

Codensity monads allow us to assign to (almost) any functor a monad on its codomain, and are a special case of a more general construction, namely that of right Kan extension. Henceforth, if F and G are any two parallel functors, F ⇒ G denotes a natural transformation from F to G.

C D K • G F E K • G G F κ εG κ K K ε κ
We remark that the fact that T G is a monad, i.e. it can be equipped with a unit and a multiplication, is a consequence of the universal property of the right Kan extension. For instance, its multiplication µ :

T G • T G ⇒ T G is obtained by taking K = T G • T G and κ = κ • T G κ.
The right Kan extension of a functor along another one does not exist in general. However, it does exist under mild assumptions on the categories at hand, and can be computed as a limit. We state this precisely in the next lemma, in the special case of codensity monads. To do so, we first need to recall the notion of comma category. For a functor G : C → D and an object d of D, the comma category d ↓ G has as objects pairs (α, c), where c is an object of C and α : An example of codensity monad is provided by a result of Kennison and Gildenhuys [START_REF] Kennison | Equational completion, model induced triples and pro-objects[END_REF], which identifies the codensity monad of the inclusion Set f → Set of finite sets into sets as the ultrafilter monad on Set. Recently, Leinster [START_REF] Leinster | Codensity and the ultrafilter monad[END_REF] reinterpreted Kennison and Gildenhuys' result as a correspondence between measures (i.e., ultrafilters, or two-valued measures) and integration operators (i.e., elements of the free algebras for the codensity monad). He then took the analogy further to study the codensity monad of the inclusion of finite-dimensional vector spaces into the category of vector spaces [84, Section 7]. Proposition 3.10 and Theorem 3.23 together identify a class of codensity monads whose (free) algebras admit a description as algebras of bona fide measures, thus providing a setting in which the analogy above is concretely realised. The Giry monad on measurable spaces provides another example, as proved in [START_REF] Avery | Codensity and the Giry monad[END_REF].

d → Gc is a morphism in D. A morphism between two objects (α 1 , c 1 ), (α 2 , c 2 ) of d ↓ G is a morphism f : c 1 → c 2 in C such that G f • α 1 = α 2 .
Example 3.5. The algebras for the finite power-set monad ℘ f on sets are semilattices (cf. Example 3.2), thus the finitely carried algebras are the finite semilattices. Let G be the functor from the category of finite semilattices and semilattice homomorphisms, to the category BStone of Boolean spaces, which regards the underlying set of a finite semilattice as a discrete space. The codensity monad T G of this functor exists and it is the Vietoris monad on BStone defined in Example 1.10. Although this fact can be proved directly, it will follow at once from equation (3.8) below, along with the fact that the Vietoris functor on BStone preserves codirected limits [36, 3.12.27(f)]. Monads on BStone arising in this manner are called profinite monads.

Profinite monads and their algebras

Profinite monads allow us to associate to every monad T = (T, η, µ) on the category of sets a monad T = ( T, η, µ) on the category of Boolean spaces, called the profinite monad of T. If Set T f denotes the full subcategory of Set T on the finitely carried T-algebras, we can consider the composition

G : Set T f → Set f → BStone
of the underlying-set functor from finite T-algebras to finite sets, followed by the full embedding of finite sets into the category of Boolean spaces. Note that Set T f is essentially small and BStone is complete, so that Lemma 3.4 applies to G. The profinite monad T is defined as the codensity monad of the functor G. That is,

T = T G : BStone → BStone, TX = lim X→G(Y,h) G(Y, h). (3.3)
Remark 3.6. Profinite monads were first introduced as a natural categorical extension of the profinite algebraic methods that are heavily used in the theory of regular languages. In [START_REF] Boja | Recognisable Languages over Monads[END_REF], Boja ńczyk associates to a Set-monad T another Set-monad which models the profinite version of the objects modelled by T. Profinite monads, as defined above, first appeared in [START_REF] Adámek | Profinite Monads, Profinite Equations, and Reiterman's Theorem[END_REF], where it is pointed out that Boja ńczyk's construction can be recovered by composing the monad T with the adjunction β : Set BStone : | -| in (3.2). We point out that in [START_REF] Adámek | Profinite Monads, Profinite Equations, and Reiterman's Theorem[END_REF] the authors consider, more generally, monads on a variety of Birkhoff algebras V. The associated profinite monad is then a monad on the category of profinite V-algebras. Here, we shall deal only with the case where V = Set. The monadic approach to formal language theory, put forward by Boja ńczyk in op. cit., is also adopted in Chapter 4, as it allows to deal with different kinds of quantifiers at the same time.

The Vietoris hyperspace monad V on Boolean spaces, which coincides with the profinite monad of the finite power-set monad ℘ f on the category of sets (see Example 3.5), provides a prime example of the profinite monad construction. The original monad ℘ f and its profinite extension V come equipped with a 'comparison map': for each Boolean space X there is a function τ X : ℘ f (X) → V (X) which views a finite subset of the space X as a closed subspace. The ensuing natural transformation τ plays a key rôle, and can be defined for any profinite monad, as we shall now explain. Write

κ : T • G ⇒ G (3.
Set T f Set BStone BStone BStone Set Set G |-|•G T |-| |-| |-|κ |-|• T T•|-| τ T τ
There is an obvious natural transformation α : In view of equation (3.3), the components of the natural transformation τ admit explicit descriptions as limit maps. Since the functor | -| preserves limits, we have

T • | -| • G ⇒ | -| • G whose component at a finite T-algebra (X, h) is simply α (X,h) = h.
| TX| = | lim X→G(Y,h) G(Y, h)| = lim X→G(Y,h) Y.
In turn, each object (X

ϕ -→ G(Y, h), (Y, h)) of the comma category X ↓ G yields a function ϕ * : T|X| → Y given by ϕ * = h • T|ϕ|. Note that ϕ *
→ Y | (ϕ, (Y, h)) ∈ X ↓ G}.
In [5, Proposition B.7.(a)] the authors prove that the natural transformation τ behaves well with respect to the units and multiplications of the monads T and T. That is, using the terminology of [START_REF] Street | The formal theory of monads[END_REF], the pair (| -|, τ) : (BStone, T) → (Set, T) is a monad functor. This means that the next two diagrams commute.

| -| | -| • T T • | -| |-| η η|-| τ (3.6) T 2 • | -| T • | -| T • | -| • T | -| • T 2 | -| • T Tτ µ|-| τ τ T |-| µ
An immediate consequence is that the forgetful functor | -| : BStone → Set lifts to a functor BStone T → Set T , thus showing that every algebra for the profinite monad T admits a T-algebra reduct, and every morphism of T-algebras preserves this structure. For a free T-algebra TX on a Boolean space X, its T-algebra reduct is provided by the composition

T| TX| | T 2 X| | TX|. τ TX | µ X | (3.7)
Lemma 3.8. For every Set-monad T and Boolean space X, the map in (3.7) yields a T-algebra structure on (the underlying set of ) the space TX such that the map

τ X : T|X| → | TX| from Definition 3.7 is a morphism of T-algebras.
In the case of the map τ X : ℘ f (X) → V (X) the previous lemma states that the Vietoris space V (X) is a semilattice when equipped with the binary operation ∪, and the inclusion τ X : ( ℘ f (X), ∪) → (V (X), ∪) is a semilattice homomorphism. Another important property of the map

τ X : ℘ f (X) → V (X)
(X ϕ -→ G(Y, h), (Y, h)) in the comma category X ↓ G such that |p| • τ X = ϕ * : T|X| → Y.
To settle the statement, it thus suffices to prove (ϕ * ) -1 (y) = ∅.

Recall that ϕ * is the T-algebra morphism obtained as the free extension of the function |ϕ| : |X| → Y. We can then consider its (regular epi, mono) factorisation in the category of T-algebras as displayed below.

(T|X|, µ |X| ) (Y, h) (Y , h ) ϕ * e m
The map e : T|X| Y is surjective, hence it is enough to prove m -1 (y) = ∅. Note that m is a morphism in the category X ↓ G. Indeed, e • η |X| : |X| → Y is the underlying function of a continuous map ϕ : X → Y (namely, an appropriate corestriction of ϕ) and m • ϕ = ϕ. Hence

m : (ϕ , (Y , h )) → (ϕ, (Y, h)) is a morphism in X ↓ G. It follows that there exists p : | TX| → Y satisfying m • p = p.
Since y is in the image of p by hypothesis, it is also in the image of m, as was to be shown.

In general, the morphisms τ X : T|X| → | TX| do not have to be injective. A counterexample is provided by the power-set monad ℘ on Set, whose profinite monad is again the Vietoris monad. In this case the map τ X : ℘ (X) → V (X) sends a subset of X to its topological closure, and it is injective precisely when X is finite.

However, the components of the natural transformation τ are injective provided the monad T is finitary and restricts to finite sets. To see this observe that, whenever T restricts to finite sets, the underlying-set functor Set T f → Set f is right adjoint and is thus preserved by right Kan extensions. It follows that the limit formula in (3.3) can be considerably simplified to yield, for every Boolean space X, TX = lim X f Y TY.

(3.8)

Here, the notation X f Y means that Y is a finite continuous image of X. Moreover, the limit is computed in BStone by equipping the finite sets TY with the discrete topology. In this setting the function τ X is the limit map for the cone {T|ϕ| :

T|X| → TY | ϕ : X f Y}
and hence it is injective if, and only if, this cone is jointly monic. Suppose f , g : S → T|X| are any two functions, and f (s) = g(s) for some s ∈ S. If T is finitary, and F is the collection of finite subsets of |X|,

T|X| = T(colim F∈F F) = colim F∈F TF
implies the existence of a finite subset F of X such that f (s), g(s) ∈ TF. Since X is a Boolean space, there is a finite discrete space Z and a continuous surjection ψ : X f Z such that ψ separates any two distinct elements of F. Then T|ψ| distinguishes f (s) and g(s), showing that the cone is jointly monic.

Regarding the injectivity of τ X , it will follow from Proposition 3.10 below that the hypothesis that T restricts to finite sets cannot, in general, be dropped. Indeed, for a finitary monad T and a finite discrete space X, injectivity of τ X corresponds to the free finitely generated T-algebra T|X| being residually finite. In turn, Birkhoff varieties containing no non-trivial finite member (see, e.g., [START_REF] Austin | A note on models of identities[END_REF]) yield obvious examples of finitary monads T for which τ X fails to be injective.

We conclude the section by showing that, whenever the T is finitary, the algebraic and topological structures on TX are compatible, i.e. TX is a topological T-algebra. In fact, it is the free profinite T-algebra on the space X. That is, T is the monad induced by the forgetful functor from the category of profinite T-algebras to the category of Boolean spaces, and its left adjoint. We thus recover the folklore result stating that, for any Boolean space X, the Vietoris space V (X) is the free profinite semilattice on X. Proposition 3.10. Let T be a finitary Set-monad, and X a Boolean space. Then TX is the free profinite T-algebra on the Boolean space X.

Proof. We first show that TX is a profinite T-algebra. Let

{π Y : TX → Y | (ϕ, (Y, h)) ∈ X ↓ G}
be the cone of continuous functions defining TX has an inverse limit. It suffices to show that each |π Y | is a T-algebra homomorphism. In turn, this amounts to saying that the outer rectangle below commutes,

T| TX| | T 2 X| | TX| | TY| TY Y τ TX T|π Y | | µ X | | Tπ Y | |π Y | |κ (Y,h) | τ Y h where κ : T • G ⇒ G is as in (3.4).
• Tκ : T 2 • G ⇒ G. For the second equality, it suffices to show that |π Y | • τ X = |κ (Y,h) • Tϕ| • τ X .
In turn, this follows from naturality of τ, and the fact that |π

Y | • τ X = h • T|ϕ|.
It remains to prove that TX satisfies the universal property with respect to the unit η X : X → TX. That is, for every profinite T-algebra Y and every continuous map f : X → Y there is a unique continuous morphism of Talgebras TX → Y making the following diagram commute.

X TX Y η X f (3.9)
First observe that, if such a map exists, it is unique. Indeed, assume g 1 , g 2 : TX → Y are continuous T-algebra morphisms making diagram (3.9) commute. By Lemma 3.9, along with the fact that

TX is Hausdorff, if we prove |g 1 | • τ X = |g 2 | • τ X it will follow that g 1 = g 2 .
→ Y such that ρ i • ϕ = ϕ i for every i ∈ D.
We claim that ϕ is a solution to (3.9). It is enough to prove

ρ i • ϕ • η X = ρ i • f for every i ∈ D.
In turn, this follows from the definition of ϕ and the commutativity of the left-hand diagram in (3.6).

Recall from Example 3.2 the notion of semiring monad on Set. We conclude by specialising Proposition 3.10 to the particular case of a semiring monad S, and its profinite monad S on BStone. Corollary 3.11. Let S be any semiring, and X a Boolean space. Then SX is the free profinite S-semimodule on the Boolean space X.

Measures with values in profinite semirings

In the previous section we saw that, for any semiring S, the free profinite S-semimodule on a Boolean space X is isomorphic to SX (Corollary 3.11), where S is the profinite monad of the semiring monad associated to S. We are interested in a concrete description of the profinite algebra SX. It turns out that SX can be identified with the algebra of all the S-valued measures on X (in the sense of Definition 3.14), provided S is finite. This is the content of Section 3.3. In the present section we deal with the more general case of profinite semirings S. Here, it is not true that the free profinite Ssemimodule on a Boolean space X is isomorphic to the algebra of all the S-valued measures on X (cf. Remark 3.22). However, we shall see in Theorem 3.21 that the latter algebra enjoys a universal property relative to those profinite S-semimodules in which the scalar multiplication of S is jointly continuous. If S is finite, then separate and joint continuity coincide, thus providing the desired measure-theoretic representation of SX.

Throughout this section we fix a profinite semiring S = (S, +, •, 0, 1), i.e. S is the limit of an inverse system of finite semirings and semiring homomorphisms. Every profinite semiring is a Boolean topological semiring. 1 In view of [START_REF] Schneider | Profinite algebras and affine boundedness[END_REF]Proposition 7.2], the converse is also true. That is, a semiring is profinite if, and only if, it is equipped with a Boolean topology which makes the operations + and • continuous. Every finite semiring, endowed with the discrete topology, is trivially profinite. Two infinite profinite semirings are described in Examples 3.12 and 3.13 below.

In the remainder of the chapter we will make use of Stone duality for Boolean algebras; for the basics of this duality we refer the reader to Section 1.1. The connection between Stone duality and profinite algebra is a deep one, and it was fully exposed in [START_REF] Gehrke | Stone duality, topological algebra, and recognition[END_REF].

Example 3.12. Let N ∞ be the one-point compactification of the set N of natural numbers, defined in Example 1.9. The usual addition and multiplication on N can be extended to

N ∞ by setting ∀x ∈ N ∞ , x + ∞ = ∞ and x • ∞ = 0 if x = 0 ∞ otherwise.
This gives a semiring (N ∞ , +, •, 0, 1) that is easily seen to be topological, hence profinite.

Example 3.13. We equip the Boolean space N ∞ with a different semiring structure. Define the addition of the semiring to be the min operation (with identity element ∞), and the multiplication to be +. The ensuing idempotent semiring (N ∞ , min, +, ∞, 0) is called (min-plus) tropical semiring. The operations min and + are continuous with respect to the Boolean topology, hence this is a profinite semiring. The tropical semiring plays an important rôle in the theory of formal languages, see e.g. the survey [START_REF] Pin | Tropical semirings[END_REF].

Next we introduce the notion of measure, that will play a central rôle throughout the chapter. Definition 3.14. Let X be a Boolean space with dual algebra B. An S-valued measure (or simply a measure, if the semiring is clear from the context) on X is a function µ : B → S which is finitely additive, i.e.

µ(

0) = 0; 2. µ(a ∨ b) = µ(a) + µ(b) whenever a, b ∈ B satisfy a ∧ b = 0.
Item 2 can be expressed without reference to disjointness, in the following way:

∀a

, b ∈ B, µ(a ∨ b) + µ(a ∧ b) = µ(a) + µ(b).
For any Boolean space X, write M(X, S) = {µ : B → S | µ is a measure} for the set of all the S-valued measures on X. The latter is naturally equipped with a structure of S-semimodule, whose operations are computed pointwise: for all s ∈ S and for all µ 1 , µ 2 ∈ M(X, S),

µ 1 + µ 2 : b → µ 1 (b) + µ 2 (b) and s • µ 1 : b → s • µ 1 (b).
On the other hand, M(X, S) can also be equipped with a natural topology, namely the subspace topology induced by the product topology of S B . This coincides with the initial topology for the set of evaluation functions ev b : M(X, S) → S, µ → µ(b), (3.11) for b ∈ B. Note that ev b is the restriction of the b-th projection S B → S. A subbasis for this topology is given by the sets of the form

b, U = {µ ∈ M(X, S) | µ(b) ∈ U}, (3.12)
for b ∈ B and U a clopen subset of S. With respect to this topology, M(X, S) is a Boolean space:

Lemma 3.15. For any Boolean space X, the space M(X, S) of all the S-valued measures on X is Boolean.

Proof. By Tychonov's theorem, the product topology on S B is compact. Since S admits a basis of clopens, so does S B . Hence S B is a Boolean space. Since a closed subspace of a Boolean space is Boolean, it is enough to prove that M(X, S) is a closed subset of S B . If b ∈ B, write π b : S B → S for the b-th projection. By definition of measure, we have Remark 3.16. Let X be a Boolean space, and {X i | i ∈ I} the codirected diagram of its continuous finite images. One can show that the space of measures M(X, S) coincides with the limit in BStone of the diagram {S X i | i ∈ I}, where each S X i is equipped with the product topology.

M(X, S) = π -1 0 (0) ∩ a∧b=0 { f ∈ S B | f (a ∨ b) = f (a) + f (b)}. (3.13) The set π -1 0 (0) is closed because so is {0} ⊆ S. Further, for each a, b ∈ B, { f ∈ S B | f (a ∨ b) = f (a) + f (b)}
We will see in Lemma 3.19 below that the S-semimodule structure on M(X, S) is compatible with the Boolean topology in a strong sense. Recall from Definition 3.1 that a semimodule over S is given by an Abelian monoid M, along with a 'scalar multiplication' α : S × M → M satisfying certain compatibility conditions. Suppose M is equipped with a topology making the monoid operation continuous, i.e. M is a topological monoid. If α is separately continuous, i.e. the functions α(s, -) : M → M are continuous for each s ∈ S, then M is a topological S-semimodule. Further, Definition 3.17. An S-semimodule M is strongly continuous if the scalar multiplication α of S on M is not only separately continuous, but also jointly continuous. That is, α : S × M → M is continuous with respect to the product topology on S × M.

Not every topological S-semimodule is strongly continuous, as the next example shows.

Example 3.18. We give an example of a finite and discrete S-semimodule that is not strongly continuous. Denote by A the semilattice on the set {0, 1, ω} whose order is 0 < 1 < ω. In other words, its join operation is defined as follows.

0

1 ω 0 0 1 ω 1 1 1 ω ω ω ω ω
Recall from Example 3.12 the profinite semiring (N ∞ , +, •, 0, 1). The obvious action of N on A (obtained by regarding A as an Abelian monoid) can be extended to an action α : N ∞ × A → A of N ∞ on A by setting α(∞, 0) = 0, and α(∞, 1) = α(∞, ω) = ω. This action yields a structure of N ∞ -semimodule on A. If A is equipped with the discrete topology, then the scalar multiplication is obviously separately continuous. However, it is not jointly continuous. Indeed, one has

α -1 (ω) = (∞, 1) ∪ (N ∞ \ {0}) × {ω}, which is not clopen because ∞ is not an isolated point of N ∞ .
The spaces of measures M(X, S) turn out to be strongly continuous, hence topological, S-semimodules. Lemma 3.19. For any Boolean space X, M(X, S) is a strongly continuous Ssemimodule.

Proof. Let X be an arbitrary Boolean space with dual algebra B. To prove that M(X, S) is a topological monoid it suffices to show that, for each b ∈ B, the composition

M(X, S) × M(X, S) M(X, S) S + ev b
is continuous, where ev b is the evaluation map defined in (3.11). In turn, this follows from the commutativity of the next diagram, and the fact that

+ : S × S → S is continuous. M(X, S) × M(X, S) S × S M(X, S) S ev b ×ev b + + ev b
The same argument, mutatis mutandis, shows that the function S × M(X, S) → M(X, S) taking (s, µ) to s • µ is continuous. Therefore M(X, S) is a strongly continuous S-semimodule.

By Lemmas 3.15 and 3.19, for any Boolean space X, M(X, S) is a strongly continuous topological S-semimodule on a Boolean space. In [START_REF] Schneider | Profinite algebras and affine boundedness[END_REF]Proposition 7.5] it is shown that every such semimodule is the limit of an inverse system of finite and discrete strongly continuous S-semimodules. In particular, M(X, S) is a profinite S-semimodule. However M(X, S) is not, in general, the free profinite S-semimodule on X (cf. Remark 3.22). Nonetheless, we will see in Theorem 3.21 that M(X, S) enjoys a universal property relative to those Boolean topological S-semimodules that are strongly continuous. In order to prove the latter theorem we need a preliminary result, Lemma 3.20 below, relating finitely supported functions and measures.

Let X be a Boolean space. Recall from equation (3.1) the set S|X| of finitely supported S-valued functions on X. Every f ∈ S|X| gives a measure on X, namely

f : B → S, b → b f = ∑ x∈b f (x). (3.14)
(Throughout, we identify a sum over the empty set with the identity element 0). The 'integration map' f → f allows us to identify S|X| with a dense subset of M(X, S).

Lemma 3.20. The map S|X| → M(X, S) sending f to f , defined as in equation (3.14), is injective with dense image.

Proof. To prove the injectivity, assume f , g are distinct elements of S|X|, and pick x ∈ X such that f (x) = g(x). Write σ for the union of the supports of f and g, and note that x ∈ σ. Since X is Boolean, there is

a clopen b ∈ B such that b ∩ σ = {x}. Therefore b f = f (x) = g(x) = b g,
showing that the assignment f → f is injective. With respect to the density, we must prove that every non-empty basic open subset of M(X, S) contains a measure of the form f , for some f ∈ S|X|. In view of equation (3.12), such a basic open can be written as

O = b 1 , U 1 ∩ • • • ∩ b m , U m
where b 1 , . . . , b m ∈ B, and U 1 , . . . , U m are clopens of S. Let {c 1 , . . . , c n } be the clopen partition of the set m i=1 b i induced by the covering {b 1 , . . . , b m }, and assume without loss of generality that each c j is non-empty. In other words, the c j 's are the atoms of the Boolean subalgebra of B generated by the b i 's. Fix an element x j ∈ c j for each j = 1, . . . , n. Since O is not empty, it contains a measure µ. Define a function f : X → S with support {x 1 , . . . , x n } such that f (x j ) = µ(c j ) for each j. By finite additivity of µ we have b i f = µ(b i ) for all i = 1, . . . , m, so that f ∈ O.

We are now ready to prove the main result of this section, which provides a characterisation of the profinite algebra M(X, S) by means of a universal property. Let us say that a strongly continuous S-semimodule is profinite if it is the inverse limit of finite and discrete strongly continuous S-semimodules. As observed after Lemma 3. 19,M(X,S) is a profinite strongly continuous S-semimodule. The next theorem shows that M(X, S) is free on X with respect to this structure. Theorem 3.21. Let S be a profinite semiring. For any Boolean space X, the collection M(X, S) of all the S-valued measures on X is the free profinite strongly continuous S-semimodule on X.

Proof. Let η X : X → M(X, S) be the continuous function sending x to the measure µ x concentrated in x, i.e. µ x (b) = 1 if x ∈ b, and µ x (b) = 0 otherwise. We will prove that M(X, S) satisfies the universal property with respect to the map η X . That is, for every profinite strongly continuous Ssemimodule Y and continuous function f : X → Y, there exists a unique continuous homomorphism of S-semimodules g : M(X, S) → Y such that the following triangle commutes.

X M(X, S) Y η X f g (3.15)
By Lemma 3.20 the function S|X| → M(X, S), mapping f to f , is injective and has dense image. Observe that any measure on X of the form f , for f ∈ S|X|, is a finite linear combination with coefficients in S of measures concentrated at a point. Thus any two continuous homomorphisms making diagram (3.15) commute must coincide on the image of S|X| → M(X, S). Since the latter is dense in M(X, S), and Y is Hausdorff, there is at most one solution to the diagram above.

To exhibit such a solution, we proceed as follows. Let {π i : Y → Y i | i ∈ I} be a cone of continuous homomorphisms defining Y as the inverse limit of the finite and discrete strongly continuous S-semimodules Y i , and set

f i = π i • f : X → Y i .
We will define a cone of continuous homomorphisms {g i : M(X, S) → Y i | i ∈ I} such that the induced limit map M(X, S) → Y provides the desired solution. For each i ∈ I consider the square

X M(X, S) Y i M(Y i , S) η X f i f * i h Y i
where f * i : M(X, S) → M(Y i , S) sends a measure µ to its pushforward with respect to f i , i.e.

f * i µ(b) = µ( f -1 i (b)) for every clopen b of Y i , and ∀ν ∈ M(Y i , S), h Y i (ν) = ∑ y∈Y i ν(y) • y.
Here, ν(y) stands for ν({y}), and the expression makes sense because Y i is discrete. It is not difficult to see that the pushforward maps f * i are continuous homomorphisms of S-semimodules. Suppose for a moment that the h Y i are also continuous homomorphisms. Then, for each i ∈ I, (3.15). Hence it remains to show that each h Y i is a continuous homomorphism. To improve readability, we write Z instead of Y i , and assume that Z = {y 1 , . . . , y n }. We only check that h Z is continuous, for the preservation of the algebraic structure is easily verified. Consider the composition γ :

g i = h Y i • f * i would be a continuous homomorphism satisfying g i • η X = f i . Indeed, ∀x ∈ X (g i • η X )(x) = ∑ y∈Y i f * i µ x (y) • y = f i (x) because f * i µ x is the measure on Y i concentrated in f i (x). If g : M(X, S) → Y is the continuous homomorphism of S-semimodules induced by the cone {g i : M(X, S) → Y i | i ∈ I}, we have g • η X = f . That is, g is a solution to diagram
(S × Z) n → Z n → Z
where the first map sends ((

1 , z 1 ), . . . , ( n , z n )) to ( 1 • z 1 , . . . , n • z n )
, and the second one sends (z 1 , . . . ,

z n ) to z 1 + • • • + z n .
Since Z is a strongly continuous S-semimodule, γ is a continuous function. For any z ∈ Z, let T z be the closed subset of S n obtained by projecting the clopen set γ -1 (z) ⊆ (S × Z) n onto the S-coordinates. Then one has

h -1 Z (z) = ν ∈ M(Z, S) | ∑ y∈Z ν(y) • y = z = (ev y 1 × • • • × ev y n ) -1 (T z )
for any z ∈ Z, where ev y 1 × • • • × ev y n : M(Z, S) → S n . The latter function is continuous, whence h -1 Z (z) is a closed subset of M(Z, S), showing that the function h Z is continuous. Hence the statement.

We conclude the section by showing that, in general, M(X, S) is not the free profinite S-semimodule on X. This is due to the fact that separate continuity of the scalar multiplication on an S-semimodule does not imply joint continuity. However, it clearly does if S if finite, for then the two notions coincide. The latter case will be treated in the next section. Remark 3.22. Let X be any Boolean space. We claim that every profinite S-semimodule that is a continuous homomorphic image of M(X, S) is a strongly continuous S-semimodule. Note that this implies that M(X, S) cannot be the free profinite S-semimodule on X, for otherwise every profinite S-semimodule would be strongly continuous (and we know by Example 3.18 that this is not the case). To settle the claim, let A be a profinite S-semimodule and f : M(X, S)

A a continuous surjective homomorphism. Write α : S × M(X, S) → M(X, S), β : S × A → A for the scalar multiplications on M(X, S) and A, respectively. We have the following commutative square.

S × M(X, S)

M(X, S)

S × A A α id S × f f β
We must prove that β is continuous. Note that f , and hence also id S × f , are topological quotients. Thus, for every open subset

U ⊆ A, β -1 (U) is open if, and only if, β • (id S × f ) -1 (U) is open in S × M(X, S).
In turn, the latter set is open because the diagram commutes and f • α is continuous.

The case of finite semirings: the main result

Recall that we aim to give a concrete representation of the free profinite S-semimodule on a Boolean space X. In view of Proposition 3.10 the latter is isomorphic to SX, where S is the profinite monad of the Set-monad S associated to the semiring S. In Theorem 3.21 we saw that, if S is profinite, then the algebra M(X, S) of all the S-valued measures on X is the free profinite strongly continuous S-semimodule on X. Provided S is finite, every topological S-semimodule is strongly continuous. Therefore we obtain the following theorem as a corollary.

Theorem 3.23. Let S be a finite semiring, and X a Boolean space. Then SX, the free profinite S-semimodule on X, is isomorphic to the algebra M(X, S) of all the S-valued measures on X.

In the remainder of the section we indicate how one could give a direct proof of Theorem 3.23, exploiting the finiteness of the semiring. Throughout the section we assume S = (S, +, •, 0, 1) is a finite semiring. We first describe the dual algebra of SX in terms of the dual algebra of the Boolean space X. Recall from (3.1) the set S|X| of finitely supported S-valued functions on X, and the integration map S|X| → M(X, S), f → f of (3.14). Lemma 3.24. Let X be a Boolean space with dual algebra B. The algebra B dual to SX is isomorphic to the Boolean subalgebra of ℘ (S|X|) generated by the elements of the form

[b, k] = f ∈ S|X| | b f = k , for b ∈ B and k ∈ S.
Proof. Let X be a Boolean space. Then X is the limit of the codirected diagram {X i | i ∈ I} of its finite continuous images. Write π i : X → X i for the ith limit map. Since S is finite, by equation (3.8) the Boolean space SX is homeomorphic to the inverse limit of the finite discrete spaces SX i . Let p i : SX → SX i be the ith limit map. As observed in Section 3.1, under these hypotheses the 'comparison map' τ X : S|X| → | SX| from Definition 3.7 is injective and satisfies

Sπ i = p i • τ X
for each i ∈ I. The dual algebra of SX consists of the clopens of the form p -1 i ( f ), where f ∈ SX i . By Lemma 3.9 the map τ X has dense image, thus the clopen p -1 i ( f ) can be identified with its restriction to S|X|, i.e. with (Sπ i ) -1 ( f ). In turn, we have

(Sπ i ) -1 ( f ) = x∈X i g ∈ S|X| | π -1 i (x) g = f (x) = x∈X i [π -1 i (x), f (x)]
showing that B is isomorphic to the subalgebra of ℘ On the other hand, let µ : B → S be a measure on X. We will exhibit an ultrafilter x on B such that µ = µ x . Consider the set

F = {[b, µ(b)] | b ∈ B} ⊆ ℘ (S|X|). Observe that [b, k] = ∅ if,
, k] / ∈ x implies [b, k] c ∈ x. Assume [b, k] / ∈ x. Then k = µ(b) entails [b, µ(b)] ⊆ [b, k] c , thus [b, k] c ∈ x.
This shows that the map in (3.16) is a bijection. One can check that it is also a continuous homomorphism of S-semimodules, so that we recover the result in Theorem 3.23. Theorem 3.25. Let S be a finite semiring, and X a Boolean space. The map in (3.16) yields a continuous isomorphism of S-semimodules between SX and M(X, S). Thus, the free profinite S-semimodule on X is isomorphic to the algebra M(X, S) of all the S-valued measures on X.

Upon identifying an element of SX with the corresponding measure on X, the 'comparison map' τ X : S|X| → | SX| of Definition 3.7 can be concretely described as the integration function

τ X : S|X| → M(X, S), f → f .
The latter map is an embedding with dense image and, for each b ∈ B and k ∈ S, the closure of the subset

[b, k] = f ∈ S|X| | b f = k of M(X, S) is the subbasic clopen subset b, k = {µ ∈ M(X, S) | µ(b) = k}.
Moreover, for any continuous map h : X → Y and measure µ ∈ M(X, S), the continuous homomorphism Sh : M(X, S) → M(Y, S) sends a measure µ on X to its pushforward with respect to h. That is,

Sh(µ) : b → µ(h -1 (b))
for every clopen b of Y.

Further, recall from (3.2) the adjunction | -| : BStone Set : β. Since adjoints compose, the free profinite S-semimodule on a set A is isomorphic to M(β(A), S), where β(A) is the Stone-Čech compactification of the discrete space A. Note that an element of M(β(A), S) is a finitely additive function ℘ (A) → S, i.e. the measurable subsets of β(A) are in bijection with the subsets of A. Remark 3.26. Theorem 3.23 yields, in the case of the two-element distributive lattice 2, a representation of the Vietoris space V (X) of a Boolean space X as the space of 2-valued measures over X. This should be compared with the representations by Shapiro [START_REF] Shapiro | Extension operators for functions and normal functors[END_REF] and Radul [START_REF] Radul | A functional representation of the hyperspace monad[END_REF] of V (X), for X a compact Hausdorff space, in terms of real-valued functionals.

The case of profinite idempotent semirings: algebras of continuous functions

In this final section we show that, if S is a profinite idempotent semiring, then all the S-valued measures are uniquely given by continuous density functions (Theorem 3.34). By Theorem 3.23, this yields a representation of the free profinite S-semimodule on a Boolean space X in terms of continuous S-valued functions on X, provided S is a finite idempotent semiring. Suppose (S, +, •, 0, 1) is a profinite semiring that is idempotent, i.e. it satisfies s + s = s for every s ∈ S. Any idempotent semiring is equipped with a natural partial order defined by s t if, and only if, there is u such that s + u = t. The operation + is then a join-semilattice operation with identity 0. Accordingly, we write ∨ instead of +. In particular, a profinite idempotent semiring is a topological join-semilattice on a Boolean space. 2Next we recall some basic facts about such topological semilattices that we will use in the following. We warn the reader that, while we work with join-semilattices, most of the literature (cf. [65,[START_REF] Johnstone | Stone spaces[END_REF][START_REF] Gierz | Continuous lattices and domains[END_REF]) deals with meetsemilattices. Definition 3.27. An element k in a complete lattice L is compact if, for every subset S ⊆ L such that k S, there is a a finite subset F ⊆ S with k F. An algebraic lattice is a complete lattice in which every element is the supremum of the compact elements below it.

Let L be a directed complete poset (dcpo, for short). That is, L is a poset in which every directed subset admits a supremum. A subset

U ⊆ L is called Scott open if it is upward closed and, for every directed subset D ⊆ L, D ∈ U ⇒ D ∩ U = ∅.
The collection of all Scott open subsets is a topology, the Scott topology of L. Further, the lower topology on L is the topology generated by the sets of the form (↑x) c for x ∈ L. Definition 3.28. The Lawson topology of a dcpo L is the smallest topology containing both the Scott topology and the lower topology.

The following theorem identifies the topology of a topological meetsemilattice on a Boolean space as the Lawson topology. For a proof see, e.g., [START_REF] Gierz | Continuous lattices and domains[END_REF]].

Theorem 3.29. Let L be a topological meet-semilattice with 1 whose underlying space is Boolean. Then L is an algebraic lattice and its topology is the Lawson topology.

In the case of the profinite idempotent semiring S, the previous theorem entails that S is a complete lattice in which every element is the infimum of the co-compact elements above it (the concept of co-compact element is the order-dual of that of compact element). Thus the topology of S, the dual Lawson topology (i.e., the Lawson topology of the order-dual of S), has as basic opens the sets of the form

↓k ∩ (↓l 1 ) c ∩ • • • ∩ (↓l n ) c , (3.17)
where k, l 1 , . . . , l n are co-compact elements of S. Every set of the form ↓k, with k co-compact, is clopen [65,Theorem II.3.3]; this shows that the sets in (3.17) provide a basis of clopens for S. Finally, any directed subset of S considered as a net converges to a unique limit, namely its least upper bound. Similarly, for codirected subsets and greatest lower bounds (see, e.g., [65, II.1]).

In view of the completeness of S, for each measure µ ∈ M(X, S) we can define a function

δ µ : X → S, x → x∈b µ(b) (3.18)
that intuitively provides the value of the measure µ at a point. In general, the functions δ µ : X → S are not continuous with respect to the dual Lawson topology of S. However, they are continuous with respect to the dual Scott topology, i.e. the Scott topology of the order-dual of S. Definition 3.30. Let S be a profinite idempotent semiring. We define S ↓ to be the topological space obtained by equipping S with the dual Scott topology.

Lemma 3.31. Let S be a profinite idempotent semiring, and X a Boolean space.

For every measure µ ∈ M(X, S), δ µ : X → S ↓ is a continuous function.

Proof. Let µ be a measure on X, and U an open down-set of S. We must prove that the preimage

δ -1 µ (U) = {x ∈ X | x∈b µ(b) ∈ U}
δ -1 µ (U) ⊆ {b ∈ B | µ ∈ b, U }.
The converse inclusion holds because U is a down-set. This shows that δ

-1 µ (U) is open in X.
Let C(X, S ↓ ) denote the set of all the S-valued functions on X which are continuous with respect to the dual Scott topology of S. This can be regarded as a semilattice, with respect to the pointwise order. Similarly for M(X, S). In view of the previous lemma, there is a function

δ : M(X, S) → C(X, S ↓ ), µ → δ µ (3.19)
which is readily seen to be monotone. In the converse direction, since S is complete, for every function f : X → S and clopen b of X we can define the integral of f over b as

b f = x∈b f (x).
This notion of integration with values in an idempotent semiring is wellknown, and it is studied in particular in idempotent analysis (see, e.g., [START_REF] Kolokoltsov | Idempotent analysis and its applications[END_REF]). So we have the integration map

: C(X, S ↓ ) → M(X, S), f → b → b f (3.20)
which is also monotone. Proof. We must prove that, for any µ ∈ M(X, S) and f ∈ C(X, S ↓ ), we have f µ ⇔ f δ µ . This follows from the definitions of f and δ µ .

The set C(X, S ↓ ) of continuous S ↓ -valued functions on X carries a natural structure of S-semimodule, where both the monoid operation and the scalar multiplication are defined pointwise. With respect to this structure, the functions δ : M(X, S) C(X, S ↓ ) : are seen to be homomorphisms of S-semimodules. Moreover, they are continuous if the set C(X, S ↓ ) is equipped with the topology generated by the sets of the form

f ∈ C(X, S ↓ ) | b f ∈ U ,
for b a clopen of X, and U an open subset of S. We will see that, in fact, the adjoint pair in Proposition 3.32 provides an isomorphism of topological algebras between M(X, S) and C(X, S ↓ ). We first show that δ µ can be regarded as the density function of the measure µ. Lemma 3.33. Let S be a profinite idempotent semiring, and X a Boolean space with dual algebra B. For every µ ∈ M(X, S) and b ∈ B, µ(b) = b δ µ .

Proof. Fix x ∈ B. We show that µ(b) is the limit in S of the directed set

N = { x∈F δ µ (x) | F ∈ ℘ f (b)},
considered as a net. Since b δ µ is also a limit for this net, it will follow that µ(b) = b δ µ because S is Hausdorff. Let k, l 1 , . . . , l n be co-compact elements of S such that the basic open set

U = ↓k ∩ (↓l 1 ) c ∩ • • • ∩ (↓l n ) c
contains µ(b). We prove that the net N is eventually in the open neighbourhood U of µ(b). Note that, for each x ∈ b, δ µ (x) is below µ(b) whence it belongs to ↓k. So it suffices to find, for every i ∈ {1, . . . , n}, a point x i ∈ b such that δ µ (x i ) ∈ (↓l i ) c , for then every element of N above n i=1 δ µ (x i ) will belong to U. Assume by contradiction that there exists i ∈ {1, . . . , n}

with b ∩ δ -1 µ ((↓l i ) c ) = ∅. That is, b ⊆ δ -1 µ (↓l i ).
Since ↓l i is clopen, for each x ∈ b there is an open neighbourhood U x of δ µ (x) contained in ↓l i . By definition, δ µ (x) is the limit of the net {µ(b) | x ∈ b}, so for every x ∈ b there is b x ∈ B such that x ∈ b x and µ(b x ) ∈ U x . We can assume without loss of generality that each b x is contained in b. Then the clopen covering {b x | x ∈ b} of b has a finite subcover {b x 1 , . . . , b x p }. For every j ∈ {1, . . . , p} we have

µ(b x j ) ∈ U x ⊆ ↓l i , thus µ(b) = µ(b x 1 ) ∨ • • • ∨ µ(b x p ) l i , a contradiction.
Theorem 3.34. Let S be a profinite idempotent semiring, and X a Boolean space. Then the continuous homomorphisms of S-semimodules δ : M(X, S) C(X, S ↓ ) : of (3.19)-(3.20) are inverse to each other. Thus M(X, S), the algebra of all the Svalued measures on X, is isomorphic to the algebra C(X, S ↓ ) of all the continuous S ↓ -valued functions on X.

Proof. In view of Lemma 3.33 we know that • δ is the identity of M(X, S), for every Boolean space X. It remains to prove that, whenever f :

X → S ↓ is a continuous function, the measure µ = f satisfies f = δ µ . That is, for each x ∈ X, f (x) = b f | x ∈ b, b ∈ B ,
where B is the dual algebra of X. Regarding the codirected set

N = { b f | x ∈ b, b ∈ B}
as a net, this is equivalent to say that the limit of N is f (x). Consider cocompact elements k, l 1 , . . . , l n of S such that the basic open set as was to be proved.

U = ↓k ∩ (↓l 1 ) c ∩ • • • ∩ (↓l n ) c . contains f (x). We must prove that N is eventually in U. Of course we have b f ∈ (↓l 1 ) c ∩ • • • ∩ (↓l n ) c
Note that, if the semiring S is finite, the dual Scott topology on S is simply the down-set topology, i.e. the Alexandroff topology of the order-dual of S. In this situation, the previous theorem has the following immediate corollary. Theorem 3.35. Let S be a finite idempotent semiring, and X a Boolean space. Then SX, the free profinite S-semimodule on X, is isomorphic to the algebra C(X, S ↓ ) of all the continuous S ↓ -valued functions on X.

Proof. This follows from Theorems 3.23 and 3.34.

Remark 3.36.

If S is the two-element distributive lattice 2, then S ↓ is homeomorphic to the Sierpi ński space. We thus recover from Theorem 3.35 the classical representation of the Vietoris space V (X) of a Boolean space X as the semilattice of all the continuous functions from X into the Sierpi ński space.

Concluding remarks

The contributions of this chapter are twofold. On the one hand, we spelled out in detail the basics of the theory of profinite monads as a categorical approach to profinite algebra. While the categorical approach to universal algebra is well known, profinite monads have been introduced only recently and they seem to have received attention only from the computer science community. To the best of our knowledge, the only relevant publications on the subject are [START_REF] Adámek | Profinite Monads, Profinite Equations, and Reiterman's Theorem[END_REF]4].

One the other hand, we contribute a connection between profinite algebra and measure theory, in the form of measures on Boolean algebras. These objects were investigated, with different motivations, also in the framework of fuzzy mathematics. There, one studies fuzzy measures taking values in the real interval [0, 1] equipped with a co-norm ⊥, see e.g. [START_REF] Dubois | A class of fuzzy measures based on triangular norms. A general framework for the combination of uncertain information[END_REF][START_REF] Weber | ⊥-decomposable measures and integrals for Archimedean t-conorms ⊥[END_REF]. Although our results do not seem to be directly applicable when ⊥ is not idempotent (e.g., when ⊥ is the truncated sum ⊕), it would be interesting to know if the same kind of ideas could be applied in that context.

It would also be interesting to investigate further the relation between our representation result in terms of measures and the functional representations of Shapiro and Radul of V (X), for X a compact Hausdorff, mentioned in Remark 3.26. In other words, can our result be somehow extended to spaces that are not zero-dimensional? Finally, another possible direction for future work consists in exploring in more depth the rôle of measures in logic, hence establishing a link between measures as they appear in logic on words, and in other contexts such as model theory [START_REF] Keisler | Measures and forking[END_REF] or finite model theory [START_REF] Nešetřil | A unified approach to structural limits[END_REF]. In this direction, there might be a connection between our measure-theoretic characterisation and the quantum monad on relational structures introduced by Abramsky et al. in [START_REF] Abramsky | The Quantum Monad on Relational Structures[END_REF]. Cf. also the comonadic approach to game theory put forward in [START_REF] Abramsky | The pebbling comonad in Finite Model Theory[END_REF].

Chapter 4

Semiring quantifiers and measures

In the context of logic on words, semiring quantifiers generalise the usual existential quantifier ∃ by counting the number of witnesses for a formula in a given semiring. Let (S, +, •, 0 S , 1 S ) be a semiring, and k an element of S. If ϕ(x) is a formula with a free first-order variable x in a language interpretable over words, and w ∈ A * is a word on a finite alphabet A, set w ∃ S,k x.ϕ(x) if and only if

1 S + • • • + 1 S m times = k,
where m is the cardinality of the set {1 i |w| | w (i) ϕ(x)} and w (i) is the word obtained from w by marking the i-th position (cf. Section 1.3).

If S = Z/qZ, then we obtain the so-called modular quantifiers, introduced by Straubing, Thérien and Thomas in [START_REF] Straubing | Regular Languages Defined with Generalized Quantifiers[END_REF]. In op. cit. it is shown that the languages definable using modular quantifiers of modulus q are exactly the languages whose syntactic monoids are solvable groups of cardinality dividing a power of q. Studying modular quantifiers is relevant for tackling open problems in Boolean circuit complexity, see for example [START_REF] Straubing | Modular quantifiers[END_REF] for a discussion. Since Boolean circuit classes contain non-regular languages, expanding the automata theoretic techniques beyond the regular setting is relevant for addressing these problems.

In Chapter 2 we showed that applying a layer of existential quantifier ∃ to a Boolean algebra of languages corresponds to a transformation, at the level of topological recognisers, sending a Boolean space with internal monoid (X, M) to (♦X, ♦M), see Theorems 2.9 and 2.10. The underlying space of the BiM (♦X, ♦M) is the Cartesian product V (X) × X, where V (X) is the Vietoris hyperspace of X, and the internal monoid is given by a semidirect product construction. Here we will generalise this construction to semiring quantifiers.

As already observed on page 60, V (X) is the free profinite semilattice on the Boolean space X, and semilattices are semimodules over the Boolean algebra 2. Thus, when moving from 2 to an arbitrary semiring S, we will replace V (X) with SX, the free profinite S-semimodule on X. In Chapter 3 we provided a measure-theoretic characterisation of SX, whenever S is a finite semiring (Theorem 3.23). Exploiting this result, we will be able to identify optimal recognisers (♦ S X, ♦ S M) for the languages obtained by applying semiring quantifiers ∃ S,k with S finite. In this respect, the main result of this chapter is Theorem 4.29. Setting S = 2 we recover the main results of Chapter 2 concerning the unary Schützenberger product of a BiM. This chapter is a modified and extended version of the paper [START_REF] Gehrke | Quantifiers on languages and codensity monads[END_REF]. A journal version is currently in preparation.

Outline of the chapter. In Section 4.1 we show that every finitary commutative monad on the category of sets can be lifted to the category of Boolean spaces with internal monoids. This result is instantiated in Section 4.2 in the case of the semiring monads S with S finite, and the measure-theoretic characterisation of Chapter 3 is used to provide a concrete description of the constructions involved.

In Section 4.3 we develop a generic approach to build recognisers for languages obtained by applying operations modelled by (finitary and commutative) monads. This relies on the result on the lifting of set monads obtained in Section 4.1. In particular, we will be able to build BiMs (♦ S X, ♦ S M) recognising the quantified languages. Finally, Section 4.4 explains how these constructions are natural from a duality theoretic viewpoint, and provides a Reutenauer-like result characterising the Boolean algebra closed under quotients generated by the languages recognised by the BiM (♦ S X, ♦ S M).

In contrast with Chapter 3, in this chapter we often omit to mention explicitly the underlying-set functor | -| : BStone → Set to ease readability.

Extending Set-monads to BiMs

One of the main constructions of Chapter 2 relies on the fact that the finite power-set monad ℘ f on Set lifts to a functor taking a BiM (X, M) to the BiM (V (X), ℘ f (M)). The main result of this section, Theorem 4.4, states that any Set-monad satisfying appropriate conditions can be lifted to a monad on the category of BiMs. However, for this to work, we need a slight generalisation of the notion of BiM given in Section 1.4. More precisely, we do not impose that the monoid is a dense subset of the space, but we only require a function from the monoid to the space whose image is dense. This is stated formally in Definition 4.1 below.

Throughout this chapter, we adopt the following notations. For a Boolean space X we write [X, X] for the set of continuous endofunctions on X, which comes equipped with the obvious monoid operation • given by composition. Given a monoid (M, •), we will denote by l : M → M M and r : M → M M the two maps induced from the monoid multiplication via currying, which correspond to the obvious left, respectively right action of M on itself. Definition 4.1. A Boolean space with an internal monoid (BiM) is a tuple

(X, M, h, λ, ρ)
where X is a Boolean space, M is a monoid, h : M → X, λ : M → [X, X] and ρ : M → [X, X] are functions such that h has a dense image and for all m ∈ M the following diagrams commute in Set.

M

X M X M X M X h l(m) λ(m) h r(m) ρ(m) h h (4.1)
If no confusion arises, we write (X, M), or even just X, for the BiM (X, M, h, λ, ρ). A morphism between two BiMs (X, M) and (X , M ) is a pair ( f , f ) where f : X → X is a continuous map, and f :

M → M is a monoid morphism such that f • h = h • f .
Note that since the image of h is dense in X, given f , f is uniquely determined if it exists. Accordingly, we will sometimes just write f to designate the pair as well as each of its components. We denote the ensuing category of BiMs by BiM.

Remark 4.2.

From the above definition it follows that λ and ρ induce compatible left and right actions of M on X with continuous components, and h is equivariant. Indeed, since the image of h is dense in X it follows that λ(m) and ρ(m) are the unique extensions to X of l(m) and r(m), respectively. But the left and right actions of M on itself commute, hence λ and ρ must enjoy the same properties. Therefore (X, h(M)) is a Boolean space with an internal monoid as defined in Section 1.4. Also, note that an equivalent way of saying that the diagrams (4.1) commute for all m ∈ M is to say that the following two diagrams commute in Set.

[

X, X] X M [X, X] X M M M M M M M -•h -•h λ l h•- ρ r h•-
The same notion of recognition introduced in Definition 1.28 applies to this setting: a language L on a finite alphabet A is recognised by a morphism of BiMs

f : (β(A * ), A * ) → (X, M) if there is a clopen C ⊆ X satisfying f -1 (C) = L, where L is the clopen of β(A * ) corresponding to L. That is, f -1 (h -1 (C)) = L.
As usual, we say that (X, M) recognises a language L if there is a morphism f : (β(A * ), A * ) → (X, M) recognising L, and it recognises a Boolean subalgebra B ⊆ ℘ (A * )

if it recognises each L ∈ B.
Let us fix, for the remainder of the section, a monad T on Set. In Theorem 4.4 we will provide sufficient conditions for T to admit a lifting to the category of BiMs, thus generalising the transformation (X, M) → (V (X), ℘ f (M)).

In Section 3.1.2 of the previous chapter we have seen that the profinite monad T associated to T provides a canonical way of extending T to the category of Boolean spaces. We will now consider ways of lifting T to the category of monoids.

It is well known that there are two 'canonical' natural transformations of bifunctors ⊗, ⊗ : TX × TY → T(X × Y), defined intuitively as follows. Thinking of elements in TX as terms t(x 1 , . . . , x n ), the element t(x 1 , . . . , x n ) ⊗ s(y 1 , . . . , y m ) is defined as t(s((x 1 , y 1 ), . . . , (x 1 , y m )), . . . , s((x n , y 1 ), . . . , (x n , y m ))), whereas t(x 1 , . . . , x n ) ⊗ s(y 1 , . . . , y m ) is defined as s(t((x 1 , y 1 ), . . . , (x n , y 1 )), . . . , t((x 1 , y m ), . . . , (x n , y m ))).

In general ⊗ and ⊗ do not coincide, and when they do the monad is called commutative, a notion due to Kock [START_REF] Kock | Monads on symmetric monoidal closed categories[END_REF]. Given a monoid (M, •, 1), one has two possibly different 'canonical' ways of defining a binary operation on TM, obtained as either of the two composites

TM × TM T(M × M) TM. ⊗ ⊗ T(•) (4.2)
If e : 1 → M denotes the map selecting the unit of the monoid, we can also define a map 1 → TM obtained as the composite Te • η 1 . That these data (with either of the two binary operations) give rise to monoid structures on TM is a consequence of [77, Theorem 2.1]. In Theorem 4.4 we shall assume that the monad T is commutative and therefore the two monoid structures on TM coincide. In order to prove the latter theorem, we need the following lemma. Proof. In universal algebraic terms, the first part of the lemma follows by observing that, for any set A and algebra B, the power B A is again an algebra with respect to pointwise operations. It thus suffices to instantiate this fact to the free T-algebra TM on M, and to the T-algebra structure on TX given in Lemma 3.8. For the second part of the statement, recall from Section 3.1.2 that TX is the cofiltered limit of finite sets Y i carrying T-algebra structures α i : TY i → Y i . We have the following isomorphisms in Set:

[ TX, TX] ∼ = [ TX, lim i Y i ] ∼ = lim i [ TX, Y i ] ∼ = lim i [lim j Y j , Y i ] ∼ = lim i colim j [Y j , Y i ],
where for the last isomorphism we have used the fact that the Y i are finite spaces, whence finitely copresentable (cf. Definition 5.8 in Chapter 5). Moreover, notice that the colimit above is filtered. In view of the observation above, since the sets Y i carry T-algebra structures, so do the sets

[Y j , Y i ] ∼ = Y Y j i .
If T is finitary, the forgetful functor Set T → Set creates both limits and filtered colimits (cf. Proof. We first give the definition of the monad on an object (X, M, h, λ, ρ). We will show that this is mapped to a BiM where the natural transformation τ is as in Definition 3.7. By Lemma 3.9, this function has dense image. Since both Th and τ X are T-algebra morphisms (cf. Lemma 3.8), we conclude that h is also a T-algebra morphism.

To define λ, consider the composite of the following two maps, where T X,X is given by the application of the functor T to a continuous function in [X, X]: In order to prove that ( TX, TM, h, λ, ρ) is a BiM, it remains to show that the functions h, λ and ρ make the diagrams in Definition 4.1 commute. Equivalently, in view of Remark 4.2, that the next square (and the analogous one with λ replaced by ρ, and l by r) commutes,

M [X, X] [ TX, TX]. λ T X,X (4.4
[ TX, TX] TX TM TM TM TM -• h λ l h•- (4.5)
where l and r denote the left and right action, respectively, of TM on itself. To this end, observe that the following diagram commutes. The two trapezoids are easily seen to be commutative using the definition of h and the naturality of τ, whereas the inner square is a reformulation of the left commuting square in (4.1).

[

TX, TX] TX TM [X, X] X M M M M TM TM -• h T X,X -•h τ X •T- λ l h•- T M,M h•-

Claim. The functions h •and -• h are T-algebra morphisms.

Proof of Claim. To see that h •is a T-algebra morphism, we use the fact that whenever α i :

TB i → B i for i ∈ {1, 2} are T-algebras and f : B 1 → B 2 is a T-algebra morphism, then Set(A, f ) : B A 1 → B A 2 is also a T-algebra morphism.
On the other hand, the function -• h is obtained as the composite of the two T-algebra morphisms

[ TX, TX] TX TX TX TM , TX h
hence it is a T-algebra morphism.

We derive the commutativity of (4.5) using the universal property of the free T-algebra on M and by observing that a) in the outer square above, the top horizontal and the right vertical arrows are morphisms of T-algebras by the previous claim; b) the map λ was defined as the unique extension of T X,X • λ to the free algebra TM; and, c) the map l is the unique algebra morphism extending T M,M • l to TM.

It is now straightforward to check that the assignment (X, M) → ( TX, TM) yields the functor part of a monad on the category of BiMs. We remark that the commutativity of the monad T is used in order to show that ( TX, TM) is a well-defined BiM (cf. the next remark) and, also, to prove that we have indeed obtained a monad. Remark 4.5. Suppose that the monad T is not commutative and we attempt to use in the proof of Theorem 4.4 the monoid multiplication on TM given by ⊗. All is fine for the right action and indeed the right action r of TM on itself is the unique extension of T M,M • r. However, this is not the case for the left action. Symmetrically, if we chose the multiplication of TM stemming from ⊗ , then the left action l would be the extension of the map T M,M • l, but this property would fail for the right action.

Extending the free semimodule monad to BiMs

In Theorem 4.4 we showed how to lift any finitary commutative monad on Set to a monad on BiM. The purpose of the present section is then twofold.

On the one hand we provide an example of a family of Set-monads to which this result applies, and on the other hand we give explicit descriptions of the various objects, maps and actions of the associated monads on BiM. This will be essential for our further work on recognisers for the quantified languages. Given a semiring (S, +, •, 0, 1), recall from Example 3.2 the free Ssemimodule monad S on Set. Notice that S is a commutative monad if, and only if, S is a commutative semiring, i.e. the multiplication • is commutative. Indeed, for a monoid M, the two monoid operations one can define on SM (cf. equation (4.2)) are given as follows. If f , f ∈ SM and x ∈ M, then one can define f f (x) either by

∑ mm =x f (m) • f (m ) or ∑ m m=x f (m ) • f (m),
and the two coincide precisely when the semiring is commutative. Along with the monad S, we consider its profinite monad S on BStone. In virtue of Corollary 3.11 we know that, for any Boolean space X, SX is the free profinite S-semimodule on X. In turn, provided S is finite, Theorem 3.23 allows us to identify SX with the algebra M(X, S) of all the S-valued measures on X. For this reason, for the rest of the chapter we assume that S is a finite and commutative semiring.

As explained in Section 3.2, the set of measures M(X, S) is a topological S-semimodule with respect to the pointwise operations

µ 1 + µ 2 : b → µ 1 (b) + µ 2 (b) and s • µ : b → s • µ(b),
for every s ∈ S. Now assume that X is not just a Boolean space, but a BiM.

To improve readability, we assume h : M → X is injective and identify M with its image. Firstly, we observe that SM sits as a dense subspace of SX by composing the map Sh : SM → SX with the integration map f → f of equation (3.14). This is the concrete incarnation of the 'comparison map' τ X , introduced in Definition 3.7, in the case of the monad S.

Lemma 4.6. Let (X, M) be a Boolean space with an internal monoid. Then SM → SX, f → f Lemma 4.9. Let (X, M) be a BiM. Consider the map

SM × X → SX, ( f , x) → f x,
where f x(y) = ∑ mx=y f (m). Then we have

f µ x = f x.
Furthermore, for each f ∈ SM, the assignment x → f x is continuous.

Recognisers for operations given by S-valued transductions

In this section we will see how we can use the extension of a Set-monad T to BiM obtained in Section 4.1 to generate recognisers for languages obtained by applying an operation modelled by the monad T, specifically by a Kleisli map R : A * → T(B * ). If T is the power-set monad, then the Kleisli maps for T are so-called transductions,1 and it is by now a standard result in formal language theory that transductions can be used to model operations on languages, see [START_REF] Pin | Some Operations and Transductions That Preserve Rationality[END_REF]; in Section 4.3.2 we see how semiring quantifiers fit into this pattern. In Section 4.3.1 we present the blueprint of our approach, using an additional assumption on the T-Kleisli map under consideration (namely that it is a monoid morphism), and in Section 4.3.2 we instantiate T to the free S-semimodule monads for finite commutative semirings S and we adapt the general theory developed previously.

Recognising operations modelled by a monad

Let T be an arbitrary commutative and finitary monad on Set, and let A, B be finite sets. We start by observing that a function R : A * → T(B * ), i.e. a morphism in the Kleisli category Kl(T) of T, could be used to transform languages in the alphabet B into languages in the alphabet A (for background on Kleisli categories the reader can consult, e.g., [START_REF] Lane | Categories for the working mathematician[END_REF]VI.5]). Assume that L = ϕ -1 (P) for some monoid morphism ϕ : B * → M and some P ⊆ M. We consider the function

A * T(B * ) TM.

R Tϕ

Since T is a commutative monad, we know that it lifts to the category of monoids, and hence we can see Tϕ as a monoid morphism. If R is also a monoid morphism, and we will assume this only in this subsection, then so is Tϕ • R, and it could be used for language recognition in the standard way. Assuming that we have a way of turning the recognising sets in M into recognising sets in TM, i.e., that we have a predicate transformer ℘ (M) → ℘ (TM) mapping P to P, we obtain a language L in A * as the preimage of P under the monoid morphism Tϕ • R.

Remark 4.10. In the running example of the next subsection we will need maps R that are not monoid morphisms, and in that setting we will have to use a matrix representation of the transduction instead. Nevertheless, the techniques used in the next subsection can be seen as an adaptation of the theory developed here for the case where R is indeed a monoid morphism.

We are interested in languages recognised by a BiM morphism as follows.

β(B * ) X B * M φ ϕ h (4.6)
We recall that to improve readability, and since φ is uniquely determined by its restriction to B * , we sometimes denote such a morphism of BiMs simply by ϕ instead of ( φ, ϕ). By This is a rather standard construction in category theory, see for example [START_REF] Street | The formal theory of monads[END_REF]Theorem 9]. It follows that, just like τ, the natural transformation τ # : βT ⇒ Tβ also behaves well with respect to the units and multiplications of the monads. That is, in the terminology of [START_REF] Street | The formal theory of monads[END_REF], the pair (β, τ # ) is a monad opfunctor. This in turn implies that β can be lifted to a functor β between the Kleisli categories making the square in (4.8) commute, where the vertical functors are the free functors from the base to the Kleisli categories.

β(A * ) Tβ(B * ) TX A * T(B * ) TM R T φ ι R Tϕ τ X •Th

Kl(T) Kl( T)

( T φ • R, Tϕ • R) described in Figure 4.1.
Proof. Using the definition of R, we need to show that next diagram commutes.

|β(A * )| |βT(B * )| | Tβ(B * )| | TX| T|β(B * )| T|X| A * T(B * ) TM |βR| |τ # | | T φ| T| φ| τ τ ι R ι Tι Tϕ Th
The two rectangles commute by naturality of ι, respectively τ, and the bottom right rhombus commutes because ϕ is a morphism of BiMs. Finally, recalling from equation (4.7) the definition of the natural transformation τ # , one can prove that the middle trapezoid is also commutative.

Recognising quantified languages via S-transductions

We now show how to construct BiMs recognising quantified languages. We start with a language L in the extended alphabet A × 2 recognised by a BiM morphism as displayed below.

β((A × 2) * ) X (A × 2) * M φ ϕ h
In other words, there exists a clopen C of X such that L = ϕ -1 (h -1 (C)).

Fix a finite and commutative semiring (S, +, •, 0, 1), and pick k ∈ S. The aim of this subsection is to construct recognisers for the quantified languages

Q k (L)
(we omit reference to S to ease readability) of those w ∈ A * such that

1 S + • • • + 1 S m times = k,
where m is the cardinality of the set

{1 i |w| | w (i) ∈ L}.
If the language L is defined by the formula ϕ(x), then Q k (L) is defined by the sentence ∃ S,k x.ϕ(x), as illustrated at the beginning of the chapter. If S = 2 and k = 1, or S = Z/qZ and k = p, we denote the language Q k (L) by L ∃ and L ∃ p mod q , respectively. Consider the function

R : A * → S((A × 2) * ), w → |w| ∑ i=1 1 S • w (i) .
If S is the Boolean algebra 2, then R simply associates to each word w the set of all words in (A × 2) * with the same shape as w and with exactly one marked letter. The framework developed in the previous subsection does not immediately apply, since R is not a monoid morphism. So the first step we have to take is to obtain a monoid morphism from R, which will then be used to construct BiM recognisers for the quantified languages.

Upon viewing R as an S-transduction (see, e.g., [START_REF] Sakarovitch | Elements of Automata Theory[END_REF]), we observe that it is realised by the rational S-transducer T R pictured in ducer provides the following representation of R in terms of a monoid morphism R :

A * → M 2 (S((A × 2) * )), (4.10)
where M n (S((A × 2) * )) denotes the set of n × n-matrices over the semimodule S((A × 2) * ). For a word w ∈ A * , the matrix R(w) has at position (i, j) the formal sum of output words obtained from the transducer T R by going from state i to state j while reading the input word w. Recalling that w 0 represents the word w with no marked position, as defined on page 35, R is given by

w → 1 S • w 0 ∑ i 1 S • w (i) 0 S 1 S • w 0 .
Example 4.12. Assume S is the Boolean algebra 2, regarded as a semiring.

Then S = ℘ f is the finite power-set monad and

R(w) = {w (i) | 1 i |w|}.
The language L ∃ ⊆ A * is recognised by the following composite monoid morphism, that will be denoted by ϕ ∃ .

A * M 2 ( ℘ f ((A × 2) * )) M 2 ( ℘ f (M)) R M 2 ( ℘ f ϕ)
Indeed, if L = ϕ -1 (P) for some P ⊆ M, then L ∃ = ϕ -1 ∃ ( P), where P is the set of matrices in M 2 ( ℘ f (M)) such that the finite set in position [START_REF] Abramsky | The pebbling comonad in Finite Model Theory[END_REF][START_REF] Abramsky | The Quantum Monad on Relational Structures[END_REF] intersects P.

Example 4.13. Assume S is the semiring Z/qZ. The language L ∃ p mod q ⊆ A * is recognised by the following composite monoid morphism, denoted where R is the map obtained as the unique continuous extension of the following composition:

A * M n (S(B * )) M n (βS(B * )) M n ( Sβ(B * )). R M n (ι) M n (τ # )
Proof. This follows essentially by Lemma 4.11 by setting T = S, along with the functoriality of M n ( ). Note that the lemma applies to this setting because R is a monoid morphism.

When we apply the previous lemma to the monoid morphism R of (4.10) we obtain the BiM (M 2 ( SX), M 2 (SM)) which, when instantiated with the appropriate semiring S, recognises e.g. the quantified languages L ∃ and L ∃ p mod q .

For instance, suppose the semiring S is Z/qZ. If L is recognised by a clopen C ⊆ X then, upon recalling from (3.12) that subbasic clopens of SX are of the form b, k for b a clopen of X and k ∈ S, one can easily prove that the quantified language L ∃ p mod q is recognised by the clopen subset of M 2 ( SX) given by the product

SX × C, p × SX × SX,
where the elements of the clopen C, p should appear in position [START_REF] Abramsky | The pebbling comonad in Finite Model Theory[END_REF][START_REF] Abramsky | The Quantum Monad on Relational Structures[END_REF] in the matrix view of the space.

However, notice that the image of the morphism M 2 (S φ) • R is contained in the subspace of M 2 ( SX) which can be represented by the matrix

X SX 0 X .
As a consequence, we can use for the same recognition purpose a smaller BiM, through which the morphism M 2 (S φ) • R factors. We denote this morphism by

♦ S ϕ : (β(A * ), A * ) → (♦ S X, ♦ S M), (4.11)
where ♦ S X = SX × X and ♦ S M = SM × M. (4.12)

The monoid structure on ♦ S M, and the biaction of ♦ S M on ♦ S X, are defined essentially by identifying the products above with upper triangular matrices, and then using the matrix multiplication and the concrete description of several monoid actions from Lemmas 4.7 and 4.9. Using the notations described in these lemmas, the left action can be described by

m f 0 m x µ 0 x = mx mµ + f x 0 mx ,
where ( f , m) ∈ ♦ S M and (µ, x) ∈ ♦ S X. Recall from the discussion at the beginning of this subsection that the language Q k (L) in the alphabet A is obtained by 'quantifying' the language L ⊆ (A × 2) * with respect to the quantifier associated to a semiring S and an element k ∈ S. We summarise the preceding observations in the following theorem which, in a sense, states that our construction is sound. Completeness will be established in the next section, cf. Theorem 4.29.

Theorem 4.16. Let S be a finite commutative semiring, and k ∈ S. Suppose a language L ⊆ (A × 2) * is recognised by a BiM morphism

ϕ : (β((A × 2) * ), (A × 2) * ) → (X, M).
Then the quantified language Q k (L) ⊆ A * is recognised by the BiM morphism

♦ S ϕ : (β(A * ), A * ) → (♦ S X, ♦ S M)
in equation (4.11).

Remark 4.17. The notation (♦ S X, ♦ S M) introduced in equation (4.12) is consistent with the one in Chapter 2. Indeed, if S is the Boolean algebra 2 and k = 1, the BiM (♦ 2 X, ♦ 2 M) coincides with the unary Schützenberger product (♦X, ♦M) of Definition 2.7. Therefore we recover the results in Chapter 2 on existential quantification. In particular, Theorem 2.9 follows at once from the theorem above.

Duality-theoretic account of the construction

In the previous section we defined a BiM (♦ S X, ♦ S M) that recognises the quantified languages Q k (L) we are interested in. However, this construction was 'pulled out of a hat'. The aim of this section is to derive, by duality, that the space ♦ S X and the actions of the monoid ♦ S M are, indeed, the right ones. To improve readability, we simply write ♦X, ♦M and ♦ϕ instead of ♦ S X, ♦ S M and ♦ S ϕ (cf. equations (4.11) and (4.12)).

Let S be a finite and commutative semiring, (X, M) a BiM and B the dual algebra of the Boolean space X. Further, consider a BiM morphism

ϕ : (β((A × 2) * ), (A × 2) * ) → (X, M)
and let B be the preimage under ϕ of B. That is, B is the Boolean algebra, closed under quotients in ℘ ((A × 2) * ), of languages recognised by ϕ.

In equation (4.11) we introduced the map ♦ϕ as a recogniser for the quantified languages obtained from the languages in B. Here we prove that ♦ϕ is in fact the dual of a certain morphism of Boolean algebras with quotient operations whose image B is generated as a Boolean algebra closed under quotients by the languages obtained either by quantification of languages from B, or by direct recognition via the composition of ϕ with the embedding

( ) 0 : β(A * ) → β((A × 2) * ), w → w 0 .
In the process we also show that the actions of ♦M on ♦X, given by matrix multiplication in Section 4.3.2, arise by duality from the quotient operations on B .

We then conclude with a Reutenauer-type result (Theorem 4.29), showing that the Boolean algebra closed under quotients generated by the Alanguages recognised by length preserving morphisms into ♦X is precisely the Boolean algebra generated by those recognised by X directly and those obtained by quantification from languages in (A × 2) * recognised by X.

The BiM ♦X by duality

Recall from (4.9) the Kleisli map R. Notice that the continuous map

ϕ Q : β(A * ) Sβ((A × 2) * ) SX R Sϕ which is given for w ∈ A * by ϕ Q (w) = f w ,
where

f w = |w| ∑ i=1 1 S • ϕ(w (i) ), (4.13)
recognises the quantified languages Q k (L) for k ∈ S and L ∈ B. In fact, the clopen in

β(A * ) corresponding to Q k (L) is ϕ Q -1 ( K, k )
where K ⊆ X is the clopen in X recognising L via ϕ, and K, k is as in equation (3.12). Since the clopens of SX are generated by the sets of the form K, k with k ∈ S and K ⊆ X clopen, we have: Note that QB, as defined in the previous proposition, is not closed under quotients. This is the reason we had to make an adjustment between Sections 4.3.1 and 4.3.2 above.

We denote by B 0 the Boolean algebra of languages closed under quotients which is recognised by the composite BiM morphism

ϕ 0 : (β(A * ), A * ) (β(A × 2) * , (A × 2) * ) (X, M). ( ) 0 ϕ
Note that B 0 consists of all languages of the form L 0 = ϕ 0 -1 (K), obtained as the preimage under ( ) 0 of languages L = ϕ -1 (K) in B. Taking the product map, it now follows that

♦ϕ = ϕ Q × ϕ 0 : β(A * ) → SX × X,
viewed just as a map of Boolean spaces, recognises the Boolean algebra generated by QB ∪ B 0 . However, since QB is not closed under quotients, a priori, neither is <QB ∪ B 0 > BA .

The Boolean algebra B that we are interested in is the closure under quotients of <QB ∪ B 0 > BA . The important observation is that <QB ∪ B 0 > BA is already closed under the quotient operations, thus explaining why SX × X, with the above product map, is the right recogniser space-wise.

(L) = ϕ Q -1 ( K, k ) where K ⊆ X is the clopen recognising L via ϕ. For u ∈ A * we have u -1 Q k (L) = {w ∈ A * | uw ∈ Q k (L)} = {w ∈ A * | f uw ∈ K, k }.
Since the free variable in the word uw occurs either in u or in w,

f uw = ϕ(u 0 ) f w + f u ϕ(w 0 ). Further, since (ϕ(u 0 ) f w + f u ϕ(w 0 )) = ϕ(u 0 ) f w + f u ϕ(w 0 ), we have u -1 Q k (L) = {w ∈ A * | ϕ(u 0 ) f w + f u ϕ(w 0 ) ∈ K, k } = k 1 +k 2 =k {w ∈ A * | ϕ(u 0 ) f w ∈ K, k 1 and f u ϕ(w 0 ) ∈ K, k 2 }. Now, ϕ(u 0 ) f w ∈ K, k 1 ⇐⇒ f w ∈ ϕ(u 0 ) -1 K, k 1 (4.14)
which in turn is equivalent to w ∈ Q k 1 ((u 0 ) -1 L), which is an element of QB. We now proceed with the second condition. We have f u ϕ(w 0 ) ∈ K, k 2 if, and only if, there is a set

I ⊆ Sup( f u ),
where Sup(

f u ) = {m ∈ M | f u (m) = 0}, satisfying • I f u = k 2 ;
• mϕ(w 0 ) ∈ K for each m ∈ I;

• mϕ(w 0 ) ∈ K for each m ∈ I.

Observe that mϕ(w 0 ) ∈ K if, and only if,

w ∈ ϕ 0 -1 (m -1 K). Thus {w ∈ A * | f u ϕ(w 0 ) ∈ K, k 2 } is equal to I⊆Sup( f u ) I f u =k 2 [ m∈I ϕ 0 -1 (m -1 K)] ∩ [ m∈I c ϕ 0 -1 (m -1 K c )] , (4.15)
which is in B 0 .

Corollary 4.20. The dual space of B is a closed subspace of SX × X. In particular, B is recognised as a Boolean algebra by SX × X.

Proof. By the previous proposition, B = <QB ∪ B 0 > BA . But B 0 is the preimage of the dual of X under ϕ 0 , and QB is the preimage of the dual of SX under ϕ Q . Thus B is the preimage of the dual of SX × X under ♦ϕ, and therefore B is recognised as a Boolean algebra by SX × X. Now, factoring the map ♦ϕ, we obtain a closed subspace Y of SX × X:

♦ϕ : β(A * ) Y → SX × X.

Since the dual of the quotient map β(A * )

Y is an embedding whose image is B , the dual of Y is isomorphic to B . Now, we want to understand why the actions on ♦X are as described in Section 4.3.2. For this purpose let us recall that the internal monoid in ♦X is ♦M = SM × M and that for ( f , m) ∈ ♦M, the component of the left action λ( f , m) : ♦X → ♦X is given by its two components:

λ 1 ( f , m) : SX × X → SX, (µ, x) → mµ + f x,
and λ 2 ( f , m) : SX × X → X, (µ, x) → mx.
We will show by duality that this is the appropriate action on ♦X for making ♦ϕ a BiM morphism. For this purpose, we consider the homomorphism dual to ♦ϕ:

δ : B + B → ℘ (A * ), K, k → ϕ Q -1 ( K, k ), K → ϕ 0 -1 (K).
We already know, by Proposition 4.19, that the image of δ is closed under quotients. The point is, in fact, that Proposition 4.19 tells us that we can define a biaction on B + B so that δ becomes a homomorphism of Boolean algebras with biactions. Thus, for each ( f , m) ∈ ♦M, we want to define a 'left quotient' by ( f , m) (that is, the component at ( f , m) of a right action) on B + B (and a 'right quotient', which is a left action) so that δ becomes a homomorphism of Boolean algebras with biactions. The monoid morphism from A * to ♦M is given by sending the internal monoid element u ∈ A * to the internal monoid element ( f u , ϕ(u 0 )) in SM × M, where f u is defined as in equation (4.13). Now, the component at ( f , m) of a 'left quotient' operation on B + B is a homomorphism

Λ( f , m) : B + B → B + B.

Such a homomorphism is determined by its components

Λ 1 ( f , m) : B → B + B and Λ 2 ( f , m) : B → B + B.
Our goal then, is to show that:

• the computation of quotient operations in the image of δ combined with wanting δ to be a morphism of Boolean algebras with biactions, dictates what Λ 1 ( f , m) and Λ 2 ( f , m) must be;

• Λ 1 ( f , m) is dual to λ 1 ( f , m) and Λ 2 ( f , m) is dual to λ 2 ( f , m).
The symmetric facts for the right action are similar and thus we only consider the left action. Also, note that we will not prove directly that the Λ( f , m)'s that we define are components of a right action on a Boolean algebra, as this will follow from the second bullet point above since we have seen in Section 4.3 that λ is a left action on the dual space. So, we want to define the action such that δ becomes a homomorphism sending the action of ( f u , ϕ(u 0 )) to the action of the quotient operation

u -1 ( ) on ℘ (A * ).
( f u , ϕ(u 0 )) and it sends K, k to (ϕ(u 0 )) -1 K, k . Stating it for an arbitrary element ( f , m) ∈ SM × M, we have Λ 11 ( f , m) : B → B, K, k → m -1 K, k .
Similarly, the computation in (4.15), stated for an arbitrary element

( f , m) ∈ SM × M, yields Λ 12 ( f , m) : B → B given by K, k → I⊆Sup( f ) I f =k [ n∈I n -1 K] ∩ [ n∈I c n -1 K c ] . ( 4
Λ 1 ( f , m) : K, k → k 1 +k 2 =k (Λ 11 ( K, k 1 ) ∧ Λ 12 ( K, k 2 ))
and on B by

Λ 2 ( f , m) : K → m -1 K.
It is now an easy verification that the maps Λ 11 ( f , m) and Λ 12 ( f , m) are dual to the summands of the first component of the action of ( f , m) on ♦X, and that Λ 1 ( f , m) and Λ 2 ( f , m) are dual to λ 1 ( f , m) and λ 2 ( f , m) as defined in Section 4.3, respectively. Proof.

λ 11 ( f , m)µ ∈ K, k ⇐⇒ µ ∈ Λ 11 ( f , m) K, k . But λ 11 ( f , m)µ = mµ, so λ 11 ( f , m)µ ∈ K, k ⇐⇒ mµ ∈ K, k ⇐⇒ mµ(K) = k ⇐⇒ µ(m -1 K) = k ⇐⇒ µ ∈ m -1 K, k = Λ 11 ( f , m),
as was to be proved.

f x : B → S, K → Kx -1 f . Proof. Let x ∈ X and [K, k] ∈ B. Then f x ∈ [K, k] ⇐⇒ K f x = k ⇐⇒ Kx f = k ⇐⇒ ∑ x∈n -1 K f (n) = k,
and the latter is true if, and only if, there exists

I ⊆ Sup( f ) with I f = k satisfying x ∈ n -1 K for each n ∈ I and x ∈ n -1 K for each n ∈ I. That is, f x ∈ [K, k] ⇐⇒ x ∈ λ 12 ( f , m)[K, k].
→ mµ + f x. Proof. Let (µ, x) ∈ SX × X and [K, k] ∈ B.
Then

λ 1 ( f , m)(µ, x) ∈ [K, k] ⇐⇒ λ 11 ( f , m)µ + λ 12 ( f , m)x ∈ [K, k] ⇐⇒ ∃k 1 , k 2 (k 1 + k 2 = k, λ 11 ( f , m)µ ∈ [K, k 1 ], and λ 12 ( f , m)x ∈ [K, k 2 ]) ⇐⇒ ∃k 1 , k 2 (k 1 + k 2 = k, µ ∈ Λ 11 ( f , m)[K, k 1 ], and x ∈ Λ 12 ( f , m)[K, k 2 ]) ⇐⇒ (µ, x) ∈ Λ 1 [K, k],
as was to be shown. A similar result holds for the right action. As a consequence, we have is of the form ♦ϕ for some BiM morphism ϕ : (β((A × 2) * ), (A × 2) * )→(X, M).

It is straightforward that Λ 2 ( f , m) : K → m -1 K is dual to λ 2 : x → mx. We conclude that

Proof. Consider an arbitrary length preserving BiM morphism

ψ : (β(A * ), A * ) → (♦X, ♦M). We define ϕ : (β((A × 2) * ), (A × 2) * ) → (X, M) by ϕ : (A × 2) * → M, (a, 0) → π 2 • ψ(a) (a, 1) → m a where m a ∈ M is such that π 1 • ψ(a) = χ m a .
The universal property of the Stone-Čech compactification guarantees that ϕ is a BiM morphism with the topological component φ = βϕ. It now suffices to show that ψ(a) = ♦ϕ(a) for each a ∈ A. We have

♦ϕ(a) = ( f a , ϕ 0 (a)) = (χ ϕ(a,1) , ϕ(a, 0)) = (χ m a , π 2 • ψ(a)) = (π 1 • ψ(a), π 2 • ψ(a)) = ψ(a),
which concludes the proof.

We can finally prove our Reutenauer-like result, which characterises the Boolean algebra closed under quotients of languages recognised by length preserving morphisms into ♦X. In a sense, the theorem states that the BiM ♦X is optimal for the recognition of quantified languages. Theorem 4.29. Let X be a BiM, and A a finite alphabet. The Boolean subalgebra closed under quotients of ℘ (A * ) generated by all languages over A which are recognised by a length preserving BiM morphism into ♦X is generated as a Boolean algebra by the languages over A recognised by X, and the quantified languages Q k (L) for L a language over A × 2 recognised by X.

Proof. Let us denote by B the Boolean algebra generated by the languages over A recognised by X and the languages Q k (L) for L a language over A × 2 recognised by X.

If L ∈ ℘ (A * ) is recognised by a length preserving BiM morphism ψ : (β(A * ), A * ) → (♦X, ♦M),
then by Proposition 4.28 there is a BiM morphism

ϕ : (β((A × 2) * ), (A × 2) * ) → (X, M) such that ♦ϕ = ψ.

Introduction: coherent categories and their neighbourhoods

The purpose of the second part of this thesis is to present two results which talk about the ability of certain categories to interpret an appropriate fragment of first-order logic, and in particular some quantifiers. In Chapter 6

we prove an open mapping theorem for certain ordered Boolean spaces. Via duality, this result implies the uniform interpolation property for the propositional intuitionistic calculus, which in turn is related to the implicit definition of propositional quantifiers. In Chapter 7 we provide a 'categorical axiomatisation' of the category of compact Hausdorff spaces and continuous maps, which is the result of trying to understand the 'logic' of this category and its ability to interpret the existential quantifier.

The way in which one can associate a category to a fragment of firstorder logic, or more generally to a theory in such a fragment, is analogous to the classical Lindenbaum-Tarski construction yielding a Boolean algebra attached to a propositional theory. 1 We briefly recall how the latter works.

Assume a set V of propositional variables is given. To any propositional theory T, i.e. to any set of propositional formulae over the set of atoms V, one can associate the Boolean algebra

F(V)/τ,
where F(V) is the free Boolean algebra on V and τ is the filter generated by T. This is called the Lindenbaum-Tarski algebra of the theory T, and it provides a way to associate to any theory an algebraic object, which is syntactic in nature. Explicitly, elements of F(V)/τ are equivalence classes of propositional formulae over V, and two formulae ϕ, ψ are in the same class precisely when the theory T proves both ϕ → ψ and ψ → ϕ. That is, when ϕ and ψ are T-equiprovable. Conversely, every Boolean algebra arises as the Lindenbaum-Tarski algebra of some propositional theory. From this point of view, the dual space of a Boolean algebra is the space of models of the associated propositional theory.

When moving to first-order theories, due to the presence of quantifiers, Boolean algebras do not suffice anymore. Maintaining the intuition of algebraic logic, starting in the 1950s several kinds of algebraic structures have been introduced to deal with first-order theories: polyadic, monadic and cylindric algebras to name a few (see, e.g., [START_REF] Halmos | Polyadic Boolean algebras[END_REF][START_REF] Henkin | Cylindric algebras. Part I. With an introductory chapter: General theory of algebras[END_REF]). There, the idea is that of modelling quantifiers by adding structure, i.e. operations, to Boolean algebras. On the other hand, in the 1960s Lawvere observed that quantifiers arise as adjoints to certain maps [START_REF] Lawvere | Adjointness in foundations[END_REF]. This means that they are part of the internal structure, and not an additional external construct. Lawvere's insight led to what is nowadays called categorical logic.

To illustrate how quantifiers can be interpreted as adjoints, we start by considering the fragment of first-order logic on the propositional connectives , ⊥, ∧, ∨, and the quantifier ∃. 2 The associated logic is known as coherent logic. What makes first-order logic more powerful and expressive than propositional logic is the presence of free variables, and consequently the possibility of quantifying over them. This explains the importance of the notion of context in first-order logic. Let us fix a countable set X of first-order variables. A context is a finite list of variables x = x 1 , . . . , x n from X, with no repetitions. As in usual first-order logic, we can define by induction the set of coherent formulae. Then, if ϕ is a coherent formula and x is a context, we will say that x is suitable for ϕ if all the free variables appearing in ϕ are contained in x. A formula in context is an expression of the form x.ϕ, where x is a context suitable for ϕ. A coherent sequent is an expression of the form ϕ x ψ where ϕ, ψ are coherent formulae, and x is a context suitable for both ϕ and ψ. Any formula ϕ, with free variables x, can be identified with a sequent, namely x ϕ. Although over full first-order logic any sequent ϕ x ψ can be identified with a formula, namely

∀ x(ϕ → ψ),
this is not the case in general. We thus need to replace formulae by the more general notion of sequents. Accordingly, by a coherent theory we understand any set of coherent sequents. The coherent fragment of first-order logic admits a natural sequent calculus. This consists of the usual rules of inference for the propositional connectives (see, e.g., [24, Chapter 1]), along with the following rule for the existential quantifier

ϕ x,y ψ (∃y)ϕ x ψ (5.1)
where y does not occur freely in ψ. A coherent sequent is said to be provable from a coherent theory T if it can be obtained from the sequents in T by applying finitely many instances of the inference rules.

We can now introduce the syntactic structures that play the rôle of Lindenbaum-Tarski algebras in the first-order setting. The free Boolean algebra F(V) is replaced by the category C whose objects are coherent formulae in context, 3 and a morphism in C is of the form x.ϕ ȳ.ψ ϑ where ϑ is a coherent formula in the free variables x, ȳ that is provably functional. Assuming without loss of generality that the contexts x, ȳ are disjoint, this means that the sequents

ϕ x (∃ ȳ)ϑ, ϑ x, ȳ ϕ ∧ ψ, ϑ ∧ ϑ[ z/ ȳ] x, ȳ, z ȳ = z
are provable, where ϑ[ z/ ȳ] denotes the formula obtained by replacing the variables in ȳ with those of a context z of the same length. Now, if T is any coherent theory then the syntactic category of the theory T, denoted

C T ,
has the same objects as C, and its morphisms are equivalence classes (modulo T-equiprovability) of coherent formulae that are T-provably functional.

The category C T plays the same rôle of the Lindenbaum-Tarski algebra in the propositional setting. For more details, the reader can consult [START_REF] Makkai | First order categorical logic[END_REF] or [68, D1.4]. Note that the syntactic category C T has all finite limits. The terminal object is represented by the formula in the empty context; assuming x and ȳ are disjoint contexts, the product of x.ϕ and ȳ.ψ is the conjunction x, ȳ.ϕ ∧ ψ. More generally, for any two morphisms ϑ : x.ϕ → z.ω and γ : ȳ.ψ → z.ω, the following diagram is a pullback square.

x, ȳ.(∃ z)ϑ ∧ γ ȳ.ψ x.ϕ z.ω γ ϑ (5.2)
Furthermore, every morphism ϑ : x.ϕ → ȳ.ψ factors through its image, namely

x.ϕ ȳ.(∃ x)ϑ ȳ.ψ

ϑ (∃ x)ϑ
and such images are seen to be stable under pullbacks. In any category, the image of a morphism f : X → Y, if it exists, is a subobject of Y, i.e. a monomorphism m : S → Y, such that:

• f factors through m; • if m : S → Y is another subobject through which f factors, then m factors through m .
That is, the image of f is the 'smallest' subobject of Y through which f factors. The discussion above then accounts for the structure of regular category of C T : Definition 5.1. A regular category is a finitely complete category with pullback-stable image factorisations.

Example 5.2.

• Any ∧-semilattice with 1, regarded as a category, is regular.

• Every variety of algebras is a regular category, with morphisms all the homomorphisms. Images are the usual homomorphic images.

• The categories BStone of Boolean spaces, and KH of compact Hausdorff spaces, are regular. Finite limits and images are liftings of those in Set. In particular, images are simply continuous images and they are stable.

• The category Top of topological spaces and continuous maps is not regular because images are provided by regular epis, 4 which are not stable under pullbacks. See, e.g., [99, p. 180].

Given an object X in a category D, the set of monomorphisms with codomain X, i.e. the set of subobjects of X, admits a pre-order defined as follows. For any two monomorphisms m 1 : S 1 → X, m 2 : S 2 → X, say that m 1 m 2 iff there exists a morphism S 1 → S 2 making the following diagram commute.

S 1 X S 2 m 1 m 2
We can canonically associate to this pre-order an equivalence relation ∼, by setting

m 1 ∼ m 2 iff m 1 m 2 and m 2 m 1 . Note that m 1 ∼ m 2 if
, and and only if, there is an isomorphism f : S 1 → S 2 satisfying m 1 = m 2 • f . Write Sub X for the set5 of ∼-equivalences classes of monomorphisms with codomain X. The pre-order defined above descends to a partial order on Sub X, that we denote again by . We refer to Sub X as the poset of subobjects of X.

If D is a regular category then, due to the existence of pullbacks, each Sub X is a ∧-semilattice whose top element is the identity morphism. Moreover, for any morphism f : X → Y in D, the pullback functor f * : Sub Y → Sub X sending a subobject m : S → Y to its pullback along f is a ∧-semilattice homomorphism. Note that the function f * is well-defined because in any category the pullback of a mono, if it exists, is again a mono. For example, if f : S → X is a monomorphism, then f * = S ∧ -: Sub X → Sub S. In the other direction, there is an order-preserving function

∃ f : Sub X → Sub Y sending a subobject m : S → X to the image of the composition f • m : S → Y.
It turns out that this map is lower adjoint to the pullback functor f * , i.e.

∃ f f * .

In the syntactic category C T , the subobjects of x.ϕ are (up to isomorphism) precisely those formulae ψ in the context x such that the sequent ψ ϕ is provable modulo the theory T, see [68, p. 844]. Write f for the morphism x, y. → x. in C T . The adjunction ∃ f f * then corresponds to the rule (5.1) of introduction and elimination of the existential quantifier.

That is, for every x, y.ϕ and x.ψ, ϕ x,y ψ ⇔ (∃y)ϕ x ψ. This exhibits the existential quantifier ∃ as an adjoint map. In the syntactic category C T , the posets of subobjects admit also finite suprema, i.e. they are lattices. Indeed, if x.ϕ and x.ψ are subobjects of x.ω, then their join is x.ϕ ∨ ψ. Exploiting the description of pullbacks provided in (5.2), it is not hard to see that such joins are stable under pullback. Definition 5.3. A coherent category is a regular category in which the posets of subobjects have finite joins and, for every morphism f : X → Y, the pullback functor f * : Sub Y → Sub X preserves them.

Thus we have proved that, for every coherent theory T, its syntactic category C T is coherent. The next proposition, which should be compared to the analogous statement for Boolean algebras and classical propositional theories, states that the converse is also true. For a proof, see [89, p. 128].

Proposition 5.4. If T is a coherent theory, then C T is a coherent category. Moreover, every coherent category is equivalent to one of the form C T , for some coherent theory T.

For basic facts about regular and coherent categories, we refer the interested reader to [67, Sections A1.3, A1.4] and [START_REF] Makkai | First order categorical logic[END_REF]Chapter 3]. We record for future use the following elementary, yet important, result on the structure of the posets of subobjects in a coherent category. Lemma 5.5. Let D be a coherent category. For every object X of D, its poset of subobjects Sub X is a bounded distributive lattice.

Proof. By definition, Sub X is a bounded lattice. It remains to show that it is distributive. For any subobject m : S → X, the map S ∧ -: Sub X → Sub X coincides with the composition ∃ m • m * . The map m * is a pullback functor, hence it preserves finite joins. Further, ∃ m preserves finite joins because it is lower adjoint. Therefore their composition preserves finite joins, i.e., finite infima distribute over finite suprema in Sub X.

We now give some examples of categories that are, or that are not, coherent.

Example 5.6.

• Any bounded distributive lattice, regarded as a category, is coherent.

• The categories BStone and KH are coherent. The join of two subspaces is simply their (set-theoretic) union. Categorically, the join of two subobjects S 1 , S 2 ∈ Sub X can be computed as the pushout of their intersection, i.e. as the pushout of the diagram

S 1 S 1 ∩ S 2 S 2 .
In other words, unions of subobjects in BStone and KH are effective.

• The category Top of topological spaces and continuous maps is not regular, and a fortiori not coherent.

• The category of groups is not coherent, because the lattice of all subgroups of a given group is not distributive, in general. For instance, consider the product of cyclic groups Z/4Z × Z/6Z. Let G 1 , G 2 , G 3 be the subgroups generated by (1, 1), (1, 0) and (0, 1), respectively.

Then

G 1 ∩ (G 2 ∪ G 3 ) = G 1 , but (G 1 ∩ G 2 ) ∪ (G 1 ∩ G 3 ) = <{(2, 0), (0, 2), (0, 4)}>.
To sum up, coherent categories are precisely those categories that are rich enough to encode a coherent theory, and in particular the existential quantifier ∃. The next two chapters can be understood from this point of view:

• In Chapter 6 we deduce from an open mapping theorem the uniform interpolation property of the intuitionistic propositional calculus, which is tightly connected to the theory of a certain type of coherent categories. These are the so-called Heyting categories.

• In Chapter 7 we provide a categorical characterisation of the category KH of compact Hausdorff spaces. This result relies heavily on the coherent structure of KH. That is, in view of the discussion above, on the fact that KH is rich enough to represent a coherent theory.

Let us briefly sketch the connection between uniform interpolation and Heyting categories mentioned in the first bullet point. Recall that a Heyting algebra is a bounded distributive lattice A in which the operation ∧ has a residual →, that is

∀a, b, c ∈ A, a ∧ b c ⇔ b a → c.
The order-dual of the latter condition defines the notion of co-Heyting algebra. For instance, if X is a topological space then the collection Ω(X) of all open subsets of X is a Heyting algebra. In fact it is an example of frame, i.e. a complete lattice L satisfying the infinite distributive law

a ∧ i∈I b i ) = i∈I (a ∧ b i ) (5.3)
for every subset {a} ∪ {b i | i ∈ I} ⊆ L. The order-dual of the latter condition defines a co-frame. By the adjoint functor theorem for posets, for any element a of a frame the operation a ∧has a residual a → -. Thus every frame is a Heyting algebra; more precisely, frames (resp. co-frames) are exactly complete Heyting (resp. co-Heyting) algebras. However, not every (complete) Heyting algebra is of the form Ω(X) for some space X, see e.g. [START_REF] Johnstone | Stone spaces[END_REF]II.2.14]. This leads to Esakia duality, which provides in particular a topological representation of any Heyting algebra (cf. Chapter 6 for more details). Heyting categories can be regarded as the categorical generalisation of Heyting algebras. They are coherent categories that are rich enough to interpret, in addition to the existential quantifier ∃, the universal quantifier ∀. Definition 5.7. A Heyting category is a coherent category in which, for every morphism f : X → Y, the pullback functor

f * : Sub Y → Sub X has an upper adjoint ∀ f : Sub X → Sub Y. Hence ∃ f f * ∀ f .
The posets of subobjects in a Heyting category are always Heyting algebras, since the maps S ∧ -: Sub X → Sub X, for S ∈ Sub X, are pullback functors and thus admit upper adjoints. Also, for every morphism f : X → Y, the pullback functor f * : Sub Y → Sub X is a Heyting algebra homomorphism.

Before providing some examples of Heyting categories, we recall the concept of finitely copresentable object. Definition 5.8. Let D be a locally small category. An object X of D is called finitely copresentable (in the sense of Gabriel and Ulmer [41, Definition 6.1]) if the functor hom D (-, X) : D op → Set preserves filtered colimits.

Example 5.9.

• Any Heyting algebra, regarded as a category, is Heyting.

• The full subcategory of BStone on the finitely copresentable objects is Heyting. Indeed, by finite Stone duality, the latter can be identified with the category Set f of finite sets and functions, which is Heyting. More generally, every elementary topos is a Heyting category [67, Corollary A2.3.5].

• The full subcategory of KH on the finitely copresentable objects can also be identified with the category Set f of finite sets and functions (cf. [92, Proposition 1.3]), hence it is Heyting. A similar result, for the (finitely copresentable) spaces dual to Heyting algebras, will be discussed below.

• The categories BStone and KH are not Heyting, since their posets of subobjects are not Heyting algebras, in general. For instance, consider the Boolean space N ∞ , the one-point compactification of the natural numbers (see Example 1.9). Its poset of subobjects is the lattice of those subsets of N ∞ that are either finite, or contain ∞. This lattice is not a Heyting algebra. For example, the pseudocomplement {∞} → ∅ does not exist, for this would be a largest finite subset of N. However, Sub N ∞ carries a structure of co-Heyting algebra (in fact, of co-frame).

An analogue of Proposition 5.4 holds for Heyting categories, to the effect that Heyting categories capture precisely intuitionistic first-order logic. The latter is defined by extending coherent logic with the connective → and the quantifier ∀, and by adding the appropriate inference rules (except for the law of excluded middle, i.e. contraction on the right). The construction of the syntactic category of a coherent theory extends in the obvious way to first-order theories. For more details, see [68, D1.4]. Proposition 5.10. A category is Heyting if, and only if, it is the syntactic category of an intuitionistic first-order theory.

The connection between the theory of Heyting categories and the uniform interpolation property for the intuitionistic propositional calculus was already implicit in [START_REF] Pitts | On an interpretation of second-order quantification in first-order intuitionistic propositional logic[END_REF], and it was then fully exposed by Ghilardi and Zawadowski, cf. the monograph [START_REF] Ghilardi | Sheaves, games, and model completions[END_REF]. The intuitionistic propositional calculus (IPC) is essentially obtained from the classical one by dropping the law of excluded middle ϕ ∨ ¬ϕ = .

If ϕ(p, v) is a formula of IPC, then a right uniform interpolant for ϕ is a formula ϕ R (p) such that, for any formula ψ(p, q) not containing v,

ϕ IPC ψ ⇐⇒ ϕ R IPC ψ.
Similarly, a left uniform interpolant for ϕ is a formula ϕ L (p) such that, for any formula ψ(p, q) not containing v,

ψ IPC ϕ ⇐⇒ ψ IPC ϕ L .
In 1992 Pitts [START_REF] Pitts | On an interpretation of second-order quantification in first-order intuitionistic propositional logic[END_REF] showed that every formula of IPC admits both right and left uniform interpolants. This can be seen as a weak form of quantifier elimination, by regarding uniform interpolants as the result of applying a propositional quantifier (for an introduction to these ideas the reader can consult the survey [START_REF] Agostino | Interpolation in non-classical logics[END_REF]). Indeed, ϕ R = (∃v)ϕ and ϕ L = (∀v)ϕ.

Ghilardi and Zawadowski observed that Pitts' result implies that the class of existentially closed Heyting algebras is first-order axiomatisable, that is, the first-order theory of Heyting algebras admits a model completion (for all the undefined notions we refer the reader to [START_REF] Ghilardi | Sheaves, games, and model completions[END_REF]). Further, they proved that this can be translated into a statement concerning Heyting categories: in these terms, Pitts' result states that the dual of the category of finitely presented Heyting algebras is a Heyting category (for a definition of finitely presented Heyting algebra, see page 121).

In fact, Ghilardi and Zawadowski proved a more general result, which applies to a large class of propositional logics: let V be the variety of algebras associated to an algebraizable propositional logic, and T the first-order theory of the latter collection of algebras. Then, under mild assumptions on V, the theory T admits a model completion if, and only if, the dual of the category of finitely presented algebras in V is r-Heyting. For a precise statement, see [START_REF] Ghilardi | Sheaves, games, and model completions[END_REF]Theorem 3.11]. The notion of r-Heyting category is obtained by replacing monomorphisms with regular monomorphisms in all relevant definitions. This is because quotients in a variety of algebras are exactly the regular epimorphisms, which dually correspond to regular monomorphisms. In the case of Heyting algebras, Beth's definability theorem for IPC, cf. [54, Chapter 2], implies that every monomorphism between finitely presented Heyting algebras is regular. Therefore the fact that the dual of the category of finitely presented Heyting algebras is a Heyting category, along with Ghilardi and Zawadowski's theorem, entail that the first-order theory of Heyting algebras has a model completion.

In the next chapter we will prove an open mapping theorem for the spaces dual to finitely presented Heyting algebras, and show how Pitts' uniform interpolation theorem for IPC follows from it. We will also explain how the openness of these morphisms is connected to the existence of upper and lower adjoints to the pullback functors, i.e. to the Heyting structure of the dual of the category of finitely presented Heyting algebras.

Chapter 6

Uniform interpolation for IPC, topologically

In this chapter we provide a short and self-contained proof of an open mapping theorem for the spaces dual to finitely presented Heyting algebras. Our proof relies only on Esakia duality for Heyting algebras and a combinatorial argument in the spirit of [START_REF] Ghilardi | Sheaf representation and duality for finitely generated Heyting algebras[END_REF], but it avoids the machinery of sheaves and games used there. This open mapping theorem in particular yields as a corollary an alternative proof of the uniform interpolation theorem for intuitionistic propositional logic (IPC), first proved by Pitts in [START_REF] Pitts | On an interpretation of second-order quantification in first-order intuitionistic propositional logic[END_REF] using proof-theoretic methods.

Uniform interpolation is a strong property possessed by certain propositional logics. On the one hand, uniform interpolants give implicit definitions of second-order quantifiers in a propositional logic [START_REF] Pitts | On an interpretation of second-order quantification in first-order intuitionistic propositional logic[END_REF]. On the other hand, as outlined in Chapter 5, uniform interpolation is tightly related to the existence of a model completion for the first-order theory of the class of algebras associated to a logic [START_REF] Ghilardi | Sheaves, games, and model completions[END_REF]. While the connection between ordinary deductive interpolation for propositional logics and amalgamation properties of the associated variety of algebras has been extensively investigated (see e.g. [START_REF] Metcalfe | Amalgamation and interpolation in ordered algebras[END_REF]), the first systematic study of uniform interpolation from an algebraic standpoint appears to be [START_REF] Van Gool | Uniform interpolation and compact congruences[END_REF], following [START_REF] Ghilardi | Sheaves, games, and model completions[END_REF].

This chapter is a modified version of the paper [START_REF] Van Gool | An open mapping theorem for finitely copresented Esakia spaces[END_REF].

Outline of the chapter. In Section 6.1 we briefly recall Esakia duality for Heyting algebras, along with the relevant facts that we will use. In Section 6.2 we formulate an open mapping theorem and we show how Pitts' uniform interpolation theorem follows from it. We also show that our open mapping theorem is slightly stronger than Pitts' theorem. Sections 6.3 -6.5 contain the proof of the main theorem. In Section 6.3 we introduce an ultrametric on the dual spaces, which shows how the step-by-step construction of finitely generated free Heyting algebras [START_REF] Ghilardi | An algebraic theory of normal forms[END_REF] relates to the topological setting. In Section 6.4, we use this ultrametric to reduce the open mapping theorem to a lemma concerning finite Kripke models. We prove this lemma in the final Section 6.5.

Esakia duality for Heyting algebras

We will introduce Esakia duality for Heyting algebras as a refinement of Stone-Priestley duality for bounded distributive lattices. Note that, historically, Esakia and Priestley dualities were developed independently. For more details on Esakia duality we refer the reader to [START_REF] Gehrke | Canonical extensions, Esakia spaces, and universal models[END_REF], or to the forthcoming English translation [START_REF] Esakia | Heyting Algebras: Duality Theory[END_REF] of Leo Esakia's book [START_REF] Esakia | Algebry Geȋtinga. I. "Metsniereba[END_REF], originally written in Russian.

Throughout, by a distributive lattice we understand a bounded distributive lattice, and we write DL for the category of distributive lattices and lattice homomorphisms. The first duality for DL is due to Stone [START_REF] Stone | Topological representations of distributive lattices and Brouwerian logics[END_REF] and it was published in 1938, shortly after his landmark paper on the duality for Boolean algebras. He showed that the category DL is dually equivalent to the category of certain non-Hausdorff compact spaces, so-called spectral spaces. 1 There are mainly two features of this duality that make it 'less elementary' than the one for Boolean algebras. First, one has to work with non-Hausdorff spaces, thus loosing a large part of the usual spatial intuition. Second, the category of spectral spaces and their natural morphisms is not a full subcategory of the category of topological spaces (cf. footnote 1). Thirty years later, in 1970, Hilary Priestley [START_REF] Priestley | Representation of distributive lattices by means of ordered stone spaces[END_REF] showed that one can ameliorate Stone's duality for distributive lattices by working in a larger ambient category of ordered topological spaces. This led to Priestley duality for distributive lattices. We briefly recall how this works; for more details the reader can consult [START_REF] Priestley | Representation of distributive lattices by means of ordered stone spaces[END_REF] or [START_REF] Davey | Introduction to lattices and order[END_REF]Chapter 11].

The idea of combining topology and order goes back to Nachbin's work, see the monograph [START_REF] Nachbin | Topology and order. Translated from the Portuguese by Lulu Bechtolsheim[END_REF]. He defined a compact ordered space to be a pair (X, ) where X is a compact space, and ⊆ X × X is a partial order that is closed in the product topology. Note that every such space is Hausdorff, because the diagonal ∆ = ∩ is closed in the product topology. The existence of a basis of clopens, which characterises Boolean spaces among the compact Hausdorff spaces, can be generalised to the ordered case by means of the notion of total order-disconnectedness. In order to give a precise definition, we introduce the following notations. Given a poset (X, ) and an element x ∈ X, write ↑x = {y ∈ X | x y} and ↓x = {y ∈ X | y x}. 1 A spectral space is a compact sober T 0 space in which the collection of all compact open subsets is closed under finite intersections, and forms a basis for the topology. The morphisms between spectral spaces are the perfect maps, i.e. those continuous maps f : X → Y such that f -1 sends compact subsets of Y to compact subsets of X.

For any S ⊆ X, we set ↑S = x∈S ↑x and ↓S = x∈S ↓x. If S = ↑S (resp. S = ↓S) then we say that S is an up-set (resp. a down-set). Definition 6.1. A Priestley space is a compact ordered space (X, ) which is totally order-disconnected, i.e. for every x, y ∈ X with x y there is a clopen up-set in X that contains x but not y.

Recall from Definition 1.5 the concept of filter of a distributive lattice. A prime filter of a distributive lattice A is a proper filter F such that, for every a, b ∈ A, a ∨ b ∈ F implies either a ∈ F or b ∈ F. 2 The set X A of prime filters of A partially ordered by set-theoretic inclusion is a Priestley space when equipped with the Boolean topology generated by the sets

a = {x ∈ X A | a ∈ x} and a c = {x ∈ X A | a / ∈ x}, (6.1)
for a ∈ A. Moreover, if h : A → B is a lattice homomorphism then h -1 : X B → X A is continuous and order-preserving. This gives a contravariant functor DL → Pries,

where Pries denotes the category of Priestley spaces and continuous orderpreserving maps. In the converse direction, to a Priestley space (X, ) we can associate the distributive lattice of its clopen up-sets with set-theoretic operations. If f : X → Y is a morphism in Pries, then f -1 is a lattice homomorphism from the lattice of clopen up-sets of Y to the lattice of clopen up-sets of X. This yields a contravariant functor Pries → DL.

Priestley duality for distributive lattices states that these two functors together induce a dual equivalence of categories.

Theorem 6.2 ([107]

). The category DL of bounded distributive lattices and lattice homomorphisms is dually equivalent to the category Pries of Priestley spaces and continuous order-preserving maps.

In particular, a distributive lattice A can be recovered up to isomorphism from its dual Priestley space as the algebra of clopen up-sets of X A , where the assignment a → a of (6.1) is a lattice isomorphism. The following lemma provides a duality theoretic characterisation of those lattice homomorphisms admitting a lower or upper adjoint, and it is a straightforward consequence of the previous theorem. Lemma 6.3. Let h : A → B be a homomorphism in DL, and f : X B → X A the dual morphism in Pries. The following statements hold.

1. h has a lower adjoint iff ↑ f (S) is open whenever S ⊆ X B is a clopen up-set.

2. h has an upper adjoint iff ↓ f (S) is open whenever S ⊆ X B is a clopen down-set.

Proof. We prove item 1. The proof of item 2 is the same, mutatis mutandis. By Priestley duality, for any a ∈ A and b ∈ B, we have

b h(a) ⇔ b ⊆ h(a) ⇔ b ⊆ f -1 ( a) ⇔ f ( b) ⊆ a ⇔ ↑ f ( b) ⊆ a.
Thus h has a lower adjoint if, and only if, there exists a monotone map The inclusion functor Boole → DL of the category of Boolean algebras into the category of distributive lattices has a left adjoint, which sends a distributive lattice A to its Booleanisation A -(see [11, V.4], where it appears under the name of free Boolean extension). Up to isomorphism, A -is the unique Boolean algebra that contains A as a sublattice and is generated as a Boolean algebra by A. Concretely, if j : A → B is a lattice embedding of A into any Boolean algebra B, then the Boolean algebra generated by the image of j is isomorphic to A -. Further, if (X, ) is the dual Priestley space of A, the dual Boolean algebra of X is isomorphic to A -. For any distributive lattice A, the unit of this adjunction provides a lattice embedding A → A - of A into its Booleanisation. Heyting algebras can be characterised as those distributive lattices A such that the embedding A → A -has an upper adjoint (details on this algebraic perspective on Esakia duality for Heyting algebras can be found in [START_REF] Gehrke | Canonical extensions, Esakia spaces, and universal models[END_REF]). Thus, by item 2 in Lemma 6.3, the dual distributive lattice of a Priestley space (X, ) is a Heyting algebra iff ↓C is clopen whenever C is a clopen subset of X. This motivates the following definition. Definition 6.4. An Esakia space is a Priestley space (X, ) such that ↓C is clopen whenever C is a clopen subset of X.

g : B → A satisfying g( b) ⊆ a ⇔ ↑ f ( b) ⊆ a (6.
Write Heyt for the category of Heyting algebras and their homomorphisms, that is, those functions preserving the operations 0, 1, ∧, ∨ and →. Note that Heyt is not a full subcategory of DL, due to the presence of →. Under Priestley duality, one can prove that the lattice homomorphisms between Heyting algebras that preserve the Heyting implication → correspond precisely to those continuous maps f : X → Y of Esakia spaces satisfying the condition ∀S ∈ ℘ (Y), ↑ f -1 (S) = f -1 (↑S). (6.3) A function between posets satisfying condition (6.3) is called p-morphism, and it is automatically order-preserving. Let Esa denote the category of Esakia spaces and continuous p-morphisms between them. Then Priestley duality restricts to a dual equivalence, known as Esakia duality, between the categories Heyt and Esa. Theorem 6.5 ([39]). The category Heyt of Heyting algebras and their homomorphisms is dually equivalent to the category Esa of Esakia spaces and continuous p-morphisms.

As for distributive lattices, a Heyting algebra A can be recovered up to isomorphism from its dual Esakia space X A as the algebra of clopen up-sets, where the assignment a → a in (6.1) is a Heyting algebra isomorphism.

In dealing with properties of IPC, a key rôle is played by finitely generated free Heyting algebras and their dual spaces. Let F(p) be the Heyting algebra free on a finite set p, that is, the algebra of IPC-equivalence classes of propositional intuitionistic formulae in the variables p, and E(p) its dual Esakia space. A Heyting algebra is finitely presented if it is the quotient of F(p) under a finitely generated congruence; such congruences can in fact always be generated by a single pair of the form (ϕ, ). A finitely presentable Heyting algebra is one that is isomorphic to a finitely presented Heyting algebra. We call an Esakia space finitely copresentable if its Heyting algebra of clopen up-sets is finitely presentable (this coincides with the notion of finitely copresentable object á la Gabriel-Ulmer, cf. Definition 5.8). Equivalently, an Esakia space is finitely copresentable if it is order-homeomorphic to a clopen up-set of E(p) for some finite p. We recall two basic facts about such spaces in Proposition 6.6. The first item amounts to the completeness of IPC with respect to its canonical model, and the second item is the dualization of the universal property of free algebras. Proposition 6.6. Let p = {p 1 , . . . , p l } be any finite set of variables. Proof. For item 1, we have ϕ IPC ψ iff [ϕ] [ψ] in F(p), which in turn is equivalent to ϕ ⊆ ψ because (-) is an isomorphism of Heyting algebras. For item 2, note that the choice of the clopen up-sets C 1 , . . . , C l gives a function from p to the algebra of clopen up-sets of Y. The dual map of the unique homomorphism lifting this function is h Y .

Open maps and uniform interpolation

The main aim of this chapter is to prove the following theorem. Theorem 6.7. Every continuous p-morphism between finitely copresentable Esakia spaces is an open map.

We first show that Pitts' uniform interpolation theorem follows in a straight-forward manner from Theorem 6.7 and the Craig interpolation theorem for IPC [START_REF] Schütte | Der Interpolationssatz der intuitionistischen Prädikatenlogik[END_REF]. Throughout, p denotes a finite set of variables and v a variable not in p. Theorem 6.8 (Pitts [106]). Let ϕ(p, v) be a propositional formula. There exist propositional formulae ϕ R (p) and ϕ L (p) such that, for any formula ψ(p, q) not containing v,

ϕ IPC ψ ⇐⇒ ϕ R IPC ψ, ψ IPC ϕ ⇐⇒ ψ IPC ϕ L .
Proof. By the Craig interpolation theorem for IPC, it suffices to prove the statement for any formula ψ whose variables are contained in p (cf., e.g., [START_REF] Van Gool | Uniform interpolation and compact congruences[END_REF]Prop. 3.5]). Since ϕ ⊆ E(p, v) is a clopen up-set, it follows at once from Theorem 6.7, and the definitions of Esakia space and p-morphism, that f ( ϕ) and (↓ f ( ϕ c )) c are clopen up-sets of E(p). Thus there exist formulae ϕ R (p) and ϕ L (p) such that ϕ R = f ( ϕ) and ϕ L = (↓ f ( ϕ c )) c . It is easy to see, using the first part of Proposition 6.6, that ϕ R and ϕ L satisfy the conditions in the statement.

As a first step towards proving Theorem 6.7, we show that the theorem follows from a special case, namely Proposition 6.9 below. Denote by i the embedding of free Heyting algebras F(p) → F(p, v) that is the identity on p. Let f : E(p, v) E(p) be the continuous p-morphism dual to i. Proof that Proposition 6.9 implies Theorem 6.7. Let g : X A → X B be any continuous p-morphism between Esakia spaces. If X A and X B are dual to finitely presented Heyting algebras A and B, respectively, then (see, e.g., [START_REF] Van Gool | Uniform interpolation and compact congruences[END_REF]Lemma 3.11]) there are finite presentations j A : F(p, q) A and j B : F(p) B such that j A • i = g -1 • j B , where i : F(p) → F(p, q) is the natural embedding. Dually, we have the following commutative square

E(p, q) E(p) X A X B g
where the top horizontal map is open by Proposition 6.9. Since the presentation j A is finite, the dual map identifies the Esakia space X A with a clopen up-set of E(p, q), so that the left vertical map is open. Therefore g : X A → X B is also open. If X A and X B are dual to finitely copresentable Heyting algebras A and B, respectively, then we can apply the argument above to any two isomorphic copies of A and B that are finitely presented.

The connection between the existence of uniform interpolants and open maps can be explained in terms of adjoints. Indeed, it was already observed in [START_REF] Pitts | On an interpretation of second-order quantification in first-order intuitionistic propositional logic[END_REF] that the uniform interpolation theorem is equivalent to the existence of both left and right adjoints for the embeddings F(p) → F(p, v). In turn, Lemma 6.3 says that if a morphism in Esa is open, then its dual Heyting algebra homomorphism has left and right adjoints. Theorem 6.7 implies that these properties always hold for homomorphisms between finitely presented Heyting algebras. We will see in Example 6.10 below that the two properties are distinct in general. In this sense, our open mapping theorem establishes a slightly stronger property than uniform interpolation.

As promised in the previous chapter, we explain the connection between the open mapping theorem for finitely copresentable Esakia spaces and the Heyting structure of the category D op , where D denotes the full subcategory of Heyt on the finitely presented objects. First, note that every epimorphism between finitely presented Heyting algebras is regular. This is the algebraic translation of Beth's definability theorem for IPC, cf. [START_REF] Ghilardi | Sheaves, games, and model completions[END_REF]Chapter 2]. Hence every monomorphism in D is regular. If A is an object of D, then the poset of subobjects of A in the larger category Heyt op is isomorphic to the lattice of congruences of A. The latter is isomorphic to the lattice of filters of A. Now, the subobjects of A in D op correspond to the compact filters of A, which in turn are precisely the principal ones. That is, the lattice of subobjects of A in D op is isomorphic to A. Theorem 6.7, along with Lemma 6.3, then provide the upper and lower adjoints to the pullback functors that are crucial in order to show that D op is a Heyting category.

Example 6.10. We give an example of a Heyting algebra homomorphism h : A → B such that h is both left and right adjoint, but its dual map is not open. Consider the one-point compactification N ∞ of the natural numbers (cf. Example 1.9), partially ordered by x y iff x = y or y = ∞. For any natural number n 1, denote by n = {1 < • • • < n} the finite chain with n elements and the discrete topology. Let X = 1 + 2 + • • • , the disjoint ordertopological sum of countably many finite discrete chains, and let X ∞ = X ∪ {∞} its one-point compactification. Extend the partial order on X to a partial order on X ∞ by defining x ∞ for all x ∈ X ∞ . Then X ∞ and N ∞ are both Esakia spaces. Define a function f : Remark 6.11. The viewpoint of adjoint maps establishes a link between uniform interpolation for IPC and the theory of monadic Heyting algebras. Indeed, recall that a monadic Heyting algebra can be described as a pair (H, H 0 ) of Heyting algebras such that H 0 is a subalgebra of H and the inclusion H 0 → H has left and right adjoints [START_REF] Bezhanishvili | Varieties of monadic Heyting algebras. I[END_REF]Theorem 5]. The relation between adjointness of a Heyting algebra homomorphism, and openness of the dual map, was already investigated in this framework. See, e.g., [14, p. 32] where an example akin to the one above is provided.

X ∞ → N ∞ by f (∞) = ∞, and ∀x ∈ n ⊆ X ∞ , f (x) = ∞ if x = n, n otherwise. Note that f is a continuous p-morphism. Let h : A → B be the dual Heyting algebra homomorphism. If U ⊆ X ∞ is a clopen up-set, then f (U) = ↑ f (U) is a clopen up-set, and if V ⊆ X ∞ is a clopen down-set then ↓ f (V)

Clopen up-sets step-by-step

The →-degree (also called implicational degree) of a propositional formula ϕ, denoted by |ϕ|, is the maximum number of nested occurrences of the connective → in ϕ; ϕ has →-degree 0 if the connective → does not occur in ϕ. Fix a finite set of variables p. For a point x in E(p) and n ∈ N, we write T n (x) for the degree n theory of x, i.e.

T n (x) = {ϕ(p) | |ϕ| n and ϕ ∈ x}.

We define a quasi-order n on E(p) by setting

x n y ⇐⇒ T n (x) ⊆ T n (y), and we standardly define an equivalence relation ∼ n on E(p) by:

x ∼ n y ⇐⇒ x n y and y n x ⇐⇒ T n (x) = T n (y) .

We remark that n∈N n = , the natural order of E(p). Moreover, for every n ∈ N, there are only finitely many formulae of →-degree at most n.

In particular, ∼ n has finite index. Remark 6.12. Notice that: a subset S ⊆ E(p) is of the form ϕ for some formula ϕ(p) of →-degree n if, and only if, it is an up-set with respect to n . Thus, S is a clopen up-set if, and only if, it is an up-set with respect to n for some n ∈ N. Hence, in particular, ∼ n -equivalence classes are clopen. In this sense, the quasiorders n yield the clopen up-sets of the space E(p) 'step-by-step'.

The next proposition accounts for the Ehrenfeucht-Fraissé games employed in [START_REF] Ghilardi | Sheaf representation and duality for finitely generated Heyting algebras[END_REF]. In our setting, these combinatorial structures reflect the interplay between the natural order of E(p) and the quasi-orders n . Proposition 6.13. Suppose x, y ∈ E(p) and n ∈ N. The following equivalences hold.

1. x 0 y if, and only if, for each variable p i ∈ p, p i ∈ x implies p i ∈ y; 2. x n+1 y if, and only if, for each y ∈ ↑y there exists x ∈ ↑x such that x ∼ n y .

Proof. Item 1 follows at once from the fact that every formula ϕ(p) of →degree 0 is equivalent to a finite disjunction of finite conjunctions of variables, along with the fact that x, y are prime filters.

In order to prove the left-to-right implication in item 2, assume x n+1 y. Since ∼ n has finite index, choose a finite set {y 1 , . . . , y k } ⊆ ↑y such that each y ∈ ↑y is ∼ n -equivalent to some y i . It suffices to prove that for each i ∈ {1, . . . , k} there is x i ∈ ↑x with x i ∼ n y i . To this aim, consider the formula ϕ of →-degree n + 1 defined by

ϕ = k i=1 T n (y i ) → T n (y i ) c ,
where the complement is relative to the set of formulae of →-degree at most n. It follows from the definitions of the logical connectives and of ∼ n that, for every z ∈ E(p), ϕ / ∈ z ⇐⇒ ∀i ∈ {1, . . . , k} ∃z i z with z i ∼ n y i .

In particular, ϕ ∈ y. Since x n+1 y, also ϕ ∈ x. Therefore, for each i ∈ {1, . . . , k} there is x i ∈ ↑x satisfying x i ∼ n y i , as was to be shown.

For the right-to-left implication, it is enough to show that ϕ → ψ ∈ y whenever ϕ(p), ψ(p) are formulae of →-degree n such that ϕ → ψ ∈ x. This follows easily from the definitions and the assumption.

Reduction to finite Kripke models

Fix a finite set of variables p. The Esakia space E(p) has a countable basis, and thus admits a compatible metric by Urysohn metrization theorem, and even an ultrametric (see, e.g., [36, 7.3.F]). We explicitly define such an ultrametric. Set

d : E(p) × E(p) → [0, 1], (x, y) → 2 -min{|ϕ| | ϕ ∈ x y}
where x y denotes the symmetric difference of x and y. We adopt the conventions min ∅ = ∞ and 2 -∞ = 0. It is immediate to check that d is an ultrametric on the set E(p), i.e. for all x, y, z ∈ E(p) the following hold: Since the latter union is over finitely many clopen sets, it follows that ϕ is clopen in the topology induced by the ultrametric d.

In order to prove that the map f :

E(p, v) E(p)
is open, it is useful to see the spaces at hand as approximated by finite posets, in the following sense. For each k ∈ N define the finite set of balls

X k = {B(x, 2 -k ) | x ∈ E(p, v)} = {[x] k | x ∈ E(p, v)} ,
partially ordered by k , and write q k : E(p, v) X k for the natural quotient x → [x] k . For every k k, there is a monotone surjection ρ k ,k :

X k X k sending [x] k to [x] k . Since f is non-extensive, it can be 'approximated' by the monotone map f k : X k → Y k , [x] k → [ f (x)] k , where Y k = {B(y, 2 -k ) | y ∈ E(p)}. E(p, v) E(p) X k Y k X k Y k f q k ρ k ,k f k
To prove the open mapping theorem for the dual spaces of free finitely generated Heyting algebras (i.e., Proposition 6.9), it is enough to show that for every clopen ball B = B(x, 2 -n ) in E(p, v), f (x) lies in the interior of f (B). This is equivalent to finding, for every n, a number R(n) such that

B( f (x), 2 -R(n) ) ⊆ f (B(x, 2 -n ))
for all x ∈ E(p, v). Since f (B(x, 2 -n )) is closed, it suffices to construct, for any y with y ∼ R(n) f (x), a sequence (x m ) in B(x, 2 -n ) such that f (x m ) converges to y. For the construction of such a sequence we will use Lemma 6.15, which is a variant of the lemmas in [START_REF] Ghilardi | Sheaf representation and duality for finitely generated Heyting algebras[END_REF]Section 4] and in [139, Section 5].

Before stating Lemma 6.15 and showing how it completes the above argument, we introduce some notation. Recall that a Kripke model on the finite set of variables p (a p-model, for short) is a partially ordered set (M, ) equipped with a monotone map c M : M → 2 p . If M is a finite p-model, then by the second part of Proposition 6.6 there is a unique p-morphism

h M : M → E(p) such that h -1 M ( p i ) = c -1
M (↑p i ) for every p i ∈ p. In Lemma 6.15 we will construct a (p, v)-model M which is a sub-poset of X n × Y m , where m n.

Given any sub-poset M of X n × Y m , we have a diagram M X n Y m X m π 1 π 2 ξ ρ m,n f m (6.4)
where ξ : M → X m is defined as ξ = q m • h M and π 1 : M → X n , π 2 : M → Y m are the natural projections. Lemma 6.15. Let n ∈ N. There is an integer R(n) n such that, for every m R(n), there is a finite (p, v)-model M which is a sub-poset of X n × Y m and satisfies the following properties:

1. {([x] n , [y] m ) | y ∼ R(n) f (x)} ⊆ M; 2. ρ m,n • ξ = π 1 ; 3. f m • ξ = π 2 .
In particular, items (2) and (3) together correspond to the commutativity of diagram (6.4).

The proof of Lemma 6.15 is the content of the next section. We conclude by showing how Proposition 6.9, and hence Theorem 6.7, follow from it.

Proof of Proposition 6.9. It suffices to prove that

B( f (x), 2 -R(n) ) ⊆ f (B(x, 2 -n ))
for every point x ∈ E(p, v) and n ∈ N. Let y ∼ R(n) f (x). For every m R(n), ([x] n , [y] m ) ∈ M by item 1 in Lemma 6.15; we define

x m = h M ([x] n , [y] m ). By item 2 in Lemma 6.15, we have [x m ] n = ρ m,n (ξ([x] n , [y] m )) = [x] n , so x m ∈ B(x, 2 -n ). Item 3 in Lemma 6.15 entails that [ f (x m )] m = f m (ξ([x] n , [y] m )) = [y] m ,
so that f (x m ) converges to y.

Proof of Lemma 6.15

Fix n ∈ N. For every x ∈ E(p, v), define r(x) to be the number of ∼ nequivalence classes in E(p, v) above x, i.e.,

r(x) = #{[x ] n | x ∈ ↑x} = #q n (↑x)
where #S denotes the cardinality of a set S. Further, set R(n) = 2(#X n ) -1. To improve readability, instead of R(n) we simply write R.

Fix an arbitrary integer m R. For elements (x, y) and (x , y ) in E(p, v) × E(p), we say that (x , y ) is a witness for (x, y) if x

x, y y, x ∼ n x, f (x) ∼ 2r(x)-1 y , and f (x ) ∼ 2r(x)-2 y. Note that, by definition, f (x) ∼ 2r(x)-1 y if, and only if, (x, y) is a witness for itself.

Define

M = {([x] n , [y] m ) ∈ X n × Y m
| there exists a witness for (x, y)}, and equip it with the product order. Defining c M :

M → 2 (p,v) by c M ([x] n , [y] m ) = {u ∈ (p, v) | x ∈ u }
turns M into a (p, v)-model. We prove that it satisfies the three required properties.

1. If ([x] n , [y] m ) ∈ X n × Y m satisfies y ∼ R f (x), then (x, y) is a wit- ness for itself because 2r(x) -1 2(#X n ) -1 = R. Therefore ([x] n , [y] m ) ∈ M. 2. Observe that ρ m,n • ξ = q n • h M . Hence we must show that h M ([x] n , [y] m ) ∼ n x.
Assume, without loss of generality, that (x, y) admits a witness. We will prove by induction on k that, for any 0 k n,

∀([x] n , [y] m ) ∈ M, h M ([x] n , [y] m ) ∼ k x. (P k )
For k = 0, (P k ) is true by definition of c M . We prove (P k ) holds for k + 1 provided it holds for k ∈ {0, . . . , n -1}. We will show that (a)

h M ([x] n , [y] m ) k+1 x and (b) x k+1 h M ([x] n , [y] m ).
(a) Consider an arbitrary w x. In view of Proposition 6.13 it is enough to find z h M ([x] n , [y] m ) such that z ∼ k w. Let (x , y ) be a witness for (x, y). Then x ∼ n x, so that there is x x with x ∼ n-1 w, whence x ∼ k w. Now, two cases:

(i) If x ∼ n x, by the inductive hypothesis h M ([x] n , [y] m ) ∼ k x we have h M ([x] n , [y] m ) ∼ k x ∼ k w. Thus we set z = h M ([x] n , [y] m
). (ii) Else, suppose x ∼ n x. Since f (x ) ∼ 2r(x)-2 y and f (x ) f (x ), there exists z y with z ∼ 2r(x)-3 f (x ). Now, x ∼ n x entails r(x ) < r(x), hence 2r(x ) -1 2r(x) -3, showing that (x , z ) is a witness for itself. Setting z = h

M ([x ] n , [z ] m ) we see that z h M ([x] n , [y] m
) because h M is monotone, and z ∼ k x ∼ k w by the inductive hypothesis applied to z.

(b) Given z h M ([x] n , [y] m ) we must exhibit w x such that w ∼ k z. Since h M is a p-morphism, there is ([x ] n , [y ] m ) ([x] n , [y] m ) such that h M ([x ] n , [y ] m ) = z. By the inductive hypothesis, h M ([x ] n , [y ] m ) ∼ k x . Now, x n x implies the existence of w x satisfying w ∼ n-1 x , therefore w ∼ k x ∼ k z.
3. We first prove the following claim.

Claim. π

2 : M → Y m is a p-morphism.
Proof of Claim. Pick ([x] n , [y] m ) ∈ M and z ∈ E(p) with y m z. We need to prove that there is w ∈ E(p, v) such that ([w] n , [z] m ) ∈ M. Suppose, without loss of generality, that (x, y) admits a witness (x , y ). Then f (x) ∼ 2r(x)-1 y y m z entails f (x) 2r(x)-1 z because m 2r(x) -1. Since f is a p-morphism, there exists x x such that f (x ) ∼ 2r(x)-2 z. We distinguish two cases, as above:

(i) If x ∼ n x, set w = x. Then (x , y ) is a witness for (w, z).

(ii) If x ∼ n x, set w = x . It is easy to see, reasoning as in case (ii) of the proof of item [START_REF] Abramsky | The Quantum Monad on Relational Structures[END_REF], that (w, z) is a witness for itself.

We use the claim to prove the identity f m • ξ = π 2 . We show by induction that, for any 0 k m,

∀([x] n , [y] m ) ∈ M, f (h M ([x] n , [y] m )) ∼ k y. (Q k ) For k = 0, (Q k ) is true because y ∼ 0 f (x).
y k+1 f (h M ([x] n , [y] m )).
(a) Pick w y. By Proposition 6.13 it suffices to find an element

z f (h M ([x] n , [y] m )) satisfying z ∼ k w.
Since by the claim π 2 is a p-morphism and w m y, there is (

[x ] n , [y ] m ) ∈ M such that ([x ] n , [y ] m ) ([x] n , [y] m ) and y ∼ m w. Define z = f (h M ([x ] n , [y ] m )). Then z f (h M ([x] n , [y] m )
) because f and h M are monotone maps, and the inductive hypothesis applied to z yields z ∼ k y ∼ k w.

(b)

The argument is the same, mutatis mutandis, as in the previous item, and it hinges on the fact that both h M and f are pmorphisms.

Concluding remarks

In this chapter we have adopted a topological approach to the study of uniform interpolation for the intuitionistic propositional calculus. In particular, we have exposed the relation between uniform interpolation and open mapping theorems in topology. These kinds of connections between logical properties and topological ones are at the heart of duality theory. A well-known example is Rasiowa and Sikorski's proof [START_REF] Rasiowa | A Proof of the Completeness Theorem of Gödel[END_REF] of Gödel's completeness theorem for first-order classical logic, which exploited Baire Category Theorem.

It would be interesting to investigate further how Theorem 6.7 compares to classical open mapping theorems in functional analysis (e.g. for Banach spaces) and in the theory of topological groups, which typically rely on an application of Baire Category Theorem. Also, it would be important to understand if similar open mapping theorems hold for other propositional logics, and what are the underlying reasons -from a dualitytheoretic perspective -for such theorems to hold.

Another possible direction for future work would consist in exploiting our open mapping theorem to study the descent theory of the category of finitely copresentable Esakia spaces. In [54, p. 204] the authors observe that, if every continuous surjective p-morphism in the latter category is an effective descent morphism, then IPC enjoys a certain property concerning the separation of independent sets of variables. The descent theory of this class of spaces is not yet well understood. Given the classical results on effective descent for open surjections between locales [START_REF] Joyal | An extension of the Galois theory of Grothendieck[END_REF] and topological spaces (see, e.g., [START_REF] Reiterman | Effective descent maps of topological spaces[END_REF]), we expect that our open mapping theorem might play an important rôle in settling the problem.

Chapter 7

An abstract characterisation of compact Hausdorff spaces

In this chapter we give a characterisation of the category KH of compact Hausdorff spaces and continuous maps. It differs from the characterisations already available in the literature [START_REF] Herrlich | Algebra topology=compactness[END_REF][START_REF] Wattel | The compactness operator in set theory and topology[END_REF][START_REF] Franklin | A categorical characterization of CH[END_REF] in that it does not depend on an ambient category of topological spaces, but only on categorical properties. This result ultimately hinges on the fact that the category KH has both a spatial nature, and an algebraic one. We briefly sketch these two aspects of KH.

The spatial nature of the category of compact Hausdorff spaces is evident, and it has proved very rich from a duality theoretic viewpoint. Starting in the forties, several dualities for KH were discovered [START_REF] Krein | On an inner characteristic of the set of all continuous functions defined on a bicompact Hausdorff space[END_REF][START_REF] Kakutani | Concrete representation of abstract (M)-spaces. (A characterization of the space of continuous functions[END_REF][START_REF] Yosida | CABA complete atomic Boolean algebras and their morphisms[END_REF]. The most celebrated is probably Gelfand-Naimark duality between compact Hausdorff spaces and the category of commutative unital C *algebras and their homomorphisms [51]. Note that the concept of norm, central in the definition of C * -algebra, is not algebraic in nature. However, Duskin showed in 1969 that the dual of KH is monadic over Set [32, 5.15.3]. Roughly, this means that KH op is equivalent to a variety of algebras. Although operations of finite arity do not suffice to describe any such variety, Isbell [START_REF] Isbell | Generating the algebraic theory of C(X)[END_REF] proved that finitely many finitary operations, along with a single operation of countably infinite arity, generate the theory of KH op . In joint work with Marra we provided a finite axiomatisation of such a variety [START_REF] Marra | Stone duality above dimension zero: axiomatising the algebraic theory of C(X)[END_REF]. This accounts for the algebraic nature of KH op ; for more on its axiomatisability, we refer the interested reader to [START_REF] Banaschewski | More on compact Hausdorff spaces and finitary duality[END_REF][START_REF] Rosický | Elementary categories[END_REF].

On the other hand, the category KH itself has an algebraic nature. This was first pointed out by Linton, who proved that the category KH is varietal [85, Section 5]. Again, this essentially means that KH can be described by operations (of possibly infinite arity) and identities. An explicit description of such an equational axiomatisation was later given by Manes [90, Section 1.5], who showed that compact Hausdorff spaces are precisely the algebras for the ultrafilter monad on Set. This algebraic nature is one of the distinctive aspects of KH among the categories of topological spaces. In [START_REF] Herrlich | Algebra topology=compactness[END_REF] Herrlich and Strecker exploited this intuition to show that KH is the unique non-trivial full epireflective subcategory of Hausdorff spaces that is varietal in the sense of Linton (see also [START_REF] Richter | An elementary approach to "algebra ∩ topology = compactness[END_REF]). This characterisation is relative to a fixed category of topological spaces, namely Hausdorff spaces. To the best of our knowledge, no 'abstract' characterisation of KH has been provided so far. Our main result, Theorem 7.20, offers one.

Our characterisation relies on the notion of pretopos, that is a coherent and exact category in which finite coproducts exist and are disjoint. The category KH provides an example of pretopos. We prove that, up to equivalence, KH is the only non-trivial well-powered pretopos that is well-pointed, admits all coproducts, and is filtral. Exactness accounts for the algebraic nature of KH, whereas the structure of coherent category reflects the fact that KH is rich enough to encode a certain coherent theory, as explained in Chapter 5. Although we shall not make the connection with logic explicit, the rôle played by the coherent structure of KH will be evident throughout the chapter. The last condition, filtrality, should be understood as a form of compactness of the copowers of the terminal object; it roughly asserts that the I-fold copower of the terminal object behaves like the Stone-Čech compactification of the discrete space I. In a sense, the main result of this chapter consists in identifying the concept of filtrality as crucial to a 'nice' topological representation of a category. To the best of our knowledge, the notion of filtrality, which arises in the work of Magari in universal algebra (cf. Remark 7.15 below), has not been considered elsewhere for categories which are not varieties Birkhoff algebras.

The results of this chapter will be the topic of the forthcoming [START_REF] Marra | A characterisation of the category of compact Hausdorff spaces[END_REF].

Outline of the chapter. In Section 7.1 we study the functor assigning to every object of a well-pointed coherent category X its set of points (i.e., global elements). This functor admits a lifting to the category of topological spaces, yielding a topological representation of X. The notion of filtrality is introduced in Section 7.2, as a condition on certain posets of subobjects in X. Under the appropriate hypotheses, we show that the category X is filtral precisely when its topological representation lands in the category of compact Hausdorff spaces. The full pretopos structure on X is considered in Section 7.3, where we prove our main result, Theorem 7.20. Finally, in Section 7.4 we make explicit the relation between the category X and the category of Boolean spaces by means of the notion of decidable object.

For most of the steps of the construction leading to the main result, we do not need to assume that X satisfies all the assumptions in the statement of the latter. Hence we fix, in each section, an incremental set of hypotheses that the category X is assumed to satisfy. To avoid overcomplicated statements, we have sometimes opted for a set of hypotheses that is not minimal.

Notation. Assuming they exist, the initial and terminal objects of a category are denoted by 0 and 1, respectively, and the unique morphism from an object X to 1 is ! : X → 1. While the coproduct of two objects X, Y is written X + Y, for infinite coproducts we rather use the symbol ∑.

The topological representation

Given a topological space X, a point x ∈ X can be identified with the map { * } → X from the one-point space selecting x. We abstract this idea to an arbitrary category. Definition 7.1. Let X be a category admitting a terminal object 1. For any object X of X, a point of X is a morphism 1 → X in the category X.

If X is locally small, i.e. every hom-set in X is a small set, we can define a functor pt = hom X (1, -) : X → Set (7.1) taking X to its set of points pt X. In category theoretic terminology, points are usually referred to as global elements.

The aim of this section is to lift the functor pt : X → Set to a functor into the category of topological spaces (cf. Corollary 7.12 below), yielding a topological representation of the category X. To do so, we prepare several lemmas concerning the properties of the sets of points. First, note that each point 1 → X is a section of the unique morphism X → 1, hence it is a monomorphism. It follows that every point of X belongs to the poset of subobjects Sub X. Definition 7.2. A category is well-powered if every object has a small set of subobjects.

Every locally small category is well-powered. On the other hand, every well-powered category with finite products is locally small, for then each morphism f : X → Y can be identified with a subobject of X × Y (in the category of sets, this corresponds to identifying a function with its graph). In particular, a well-powered coherent category is locally small.

Since we seek a representation of the category X by means of the functor of points pt : X → Set, it is reasonable to assume that this functor is faithful; i.e., the category X is well-pointed. an extremal mono if, and only if, for every non-initial object X there is an object Y and two distinct morphisms X ⇒ Y. If the category is positive, i.e. it has disjoint finite sums, then one can consider Y = X + X along with the coproduct injections X ⇒ Y. This shows that in every positive coherent category the unique morphism 0 → 1 is an extremal monomorphism. Lemma 7.6. Suppose the unique morphism 0 → 1 is an extremal mono. The following statements hold.

1. Every non-initial object of X has at least one point.

2. Up to isomorphism, 1 is the unique non-initial object of X that has no nontrivial subobjects.

3. The functor pt : X → Set preserves regular epis, i.e. 1 is regular projective.

Proof.

1. Suppose X is an object in X satisfying pt X = ∅. Then ∑ pt X 1 ∼ = 0, showing that the unique morphism 0 → X is an epimorphism. By assumption, the composition 0 → X → 1 is an extremal mono. Hence the unique morphism 0 → X is both an epimorphism and an extremal monomorphism, whence an isomorphism. That is, X is initial.

2. We start by observing that 1 has no non-trivial subobjects. Indeed, assume m : X → 1 is a monomorphism. If X is not initial, then by the previous item there is a point p : 1 → X. Then m • p is the identity of 1, showing that m is a retraction. Since every mono which is a retraction is an isomorphism, we have X ∼ = 1. Now, suppose X is a non-initial object of X that admits no non-trivial subobjects. By item 1 there is a monomorphism 1 → X, whence X ∼ = 1.

3. Let f : X → Y be a regular epimorphism in X, and p : 1 → Y an arbitrary point of Y. We must exhibit q ∈ pt X such that pt f (q) = p. Consider the following pullback square.

Z 1 X Y ! g p f
Since regular epis are pullback stable, Z ! -→ 1 is a regular epi. Hence Z ∼ = 0 because the unique morphism 0 → 1 is a mono, and 0 ∼ = 1. By item 1, Z has a point q : 1 → Z. Defining q ∈ pt X as the composition g • q : 1 → X yields pt f (q) = p, as was to be shown.

1. The operators V : Sub X -→ ℘ (pt X) and I : ℘ (pt X) -→ Sub X, de- fined in (7.2) and (7.3), form an adjoint pair:

℘ (pt X) Sub X. I V (7.4) 2. For each morphism f : X → Y in X, the function pt f : pt X → pt Y is pseudo-continuous, 1 that is, for every T ∈ ℘ (pt X) pt f (V • I(T)) ⊆ V • I(pt f (T)).
Proof. Item 1 is the content of the discussion after Remark 7.7. For item 2, fix an arbitrary subset T ⊆ pt X and suppose that q ∈ pt f (V • I(T)). That is, q = pt f (p) for some point p ∈ pt X that belongs to all the subobjects of X that contain all the points in T. We must prove that q belongs to every subobject of Y containing all the points of the form f • p with p ∈ T. Let S be a subobject of Y satisfying the latter property, and consider the following pullback square in X.

f * (S) S X Y f
By the universal property of the pullback, f * (S) contains all the points in T. Hence p ∈ f * (S). It follows that q = f • p ∈ S, as was to be proved.

We are interested in the situation where the closure operators V • I induce a topology on the sets of points of the objects of X. This is the content of Proposition 7.11 below. We shall also prove that, if the lattice Sub X is atomic, i.e. every element of Sub X is the supremum of the atoms below it, then every element of Sub X is fixed by the operator I • V. Remark 7.10. Assume every poset of subobjects in X is complete. If X is balanced, i.e. every morphism that is both a mono and an epi is an iso, then Sub X is atomic for every X in X. Indeed, for any S ∈ Sub X we always 1 Let g : X → Y be a function between topological spaces, and cl, cl' the natural closure operators on ℘(X) and ℘(Y), respectively. Then g is continuous iff g(cl A) ⊆ cl' f (A) for every A ⊆ X. If X, Y are merely sets, and cl, cl' are (possibly non-topological) closure operators, we speak of pseudo-continuity. Similarly, we say that g is pseudo-closed if it satisfies cl' f (A) ⊆ g(cl A) for every A ⊆ X. Provided the closure operators at hand are topological, a pseudo-closed map is a closed map in the usual topological sense. Observe that

{p : 1 → X | p S} = {S ∈ Sub X | ∀ p : 1 → X (p S ⇒ p S )}.
Write T = {p : 1 → X | p S}, and let m : S → S be a monomorphism witnessing the inequality T S. The functor pt is faithful by Lemma 7.4, hence it reflects monos and epis. If X is balanced then pt is conservative, i.e. it reflects isomorphisms. Therefore, in order to prove that T = S in Sub X, it suffices to show that pt T = pt S . In turn, we have

pt T = {pt S | S ∈ Sub X, pt S ⊆ pt S } = pt S,
where the first equality follows from the fact that the functor pt is representable, hence it preserves limits (cf. Remark 7.8). In fact, one can prove that the functor pt is conservative if, and only if, Sub X is atomic for every X in X. One direction was proved in this remark. For the converse direction, cf. Lemma 7.33 below. Proposition 7.11. Assume every poset of subobjects in X is complete, and the morphism 0 → 1 is an extremal monomorphism. The following statements hold.

For each morphism f

: X → Y in X, the function pt f : pt X → pt Y is pseudo-closed, 2 that is, for every T ∈ ℘ (pt X) V • I(pt f (T)) ⊆ pt f (V • I(T)).
2. For each object X of X, the closure operator V • I on ℘ (pt X) is topological, i.e. it preserves finite unions.

If

Sub X is atomic, then each subobject S ∈ Sub X is a fixed point of the operator I • V, i.e. I • V(S) = S.
Proof.

1. Suppose q ∈ V • I(pt f (T)), i.e. q is a point of Y that belongs to all the subobjects of Y that contain all the points of the form pt f (p) for some p ∈ T. We must prove that q ∈ pt f (V • I(T)). Let ∃ f : Sub X → Sub Y be the lower adjoint to the pullback functor f * : Sub Y → Sub X. Recall that ∃ f sends a subobject m : S → X to the codomain of the (regular epi, mono) factorisation of the morphism f • m, and

∃ f (I(T)) = {S ∈ Sub Y | I(T) f * (S)}. (7.5)
Moreover, in view of item 1 in Proposition 7.11, for every morphism f : X → Y in X the continuous function Spec f : Spec X → Spec Y is closed, i.e. it sends closed sets to closed sets. Finally we remark that, if the poset Sub X is atomic for each X in X, then item 3 in Lemma 7.11 implies that the most general closed subset of Spec X is of the form {p : 1 → X | p factors through S} for some S ∈ Sub X.

Remark 7.13. In this remark we assume the reader is familiar with the basics of point-free topology. It is well known that every complete lattice which is -generated by its join-prime elements is a spatial co-frame. 3 Now, every poset of subobjects in X is a distributive lattice, and every atom in a distributive lattice is join-prime. Therefore, if Sub X is a complete atomic lattice, then it is a spatial co-frame and it is isomorphic to the co-frame of closed subsets of Spec X. Write X σ for the space of points (in the point-free sense) of the frame (Sub X) ∂ order-dual to Sub X. Then X σ is the soberification of Spec X. The two spaces coincide precisely when each join-prime element of Sub X is an atom.

Filtrality

Throughout this section, we make the following assumptions on the category X.

Assumption. The category X is a coherent category that is non-trivial, i.e. 0 ∼ = 1, well-powered, and well-pointed. Moreover, the unique morphism 0 → 1 is an extremal mono, and Sub X is a complete atomic lattice for every X in X.

In the previous section we have seen that, under these assumptions, there is a faithful functor Spec : X → Top.

The latter sends an object X of X to the topological space Spec X whose underlying set is pt X, the set of points of X, and whose closed sets are of the form {p ∈ pt X | p S} where S varies among the subobjects of X. In this section we investigate when the functor Spec takes values in the full subcategory of Top on the compact and Hausdorff spaces. This leads to the notion of filtrality, cf. Theorem 7.17. Suppose that, for every object X of X, the copower ∑ pt X 1 exists in X. Every point of X yields a coproduct injection of 1 into ∑ pt X 1, and this assignment is injective. Whenever convenient, we identify an element of pt X with the corresponding coproduct injection of ∑ pt X 1, i.e. we regard pt X as a subset of pt ∑ pt X 1. Every filter F of the power-set lattice ℘ (pt X)

defines a subobject of ∑ pt X 1, namely F -→ k(F) = {S ∈ Sub ∑ pt X 1 | pt S ∩ pt X ∈ F}. (7.6)
We remark that the condition pt S ∩ pt X ∈ F is equivalent to the existence of some A ∈ F satisfying A ⊆ pt S. Write Filt( ℘ (pt X)) for the lattice of filters of ℘ (pt X), and Filt( ℘ (pt X)) ∂ for its order-dual. The assignment in (7.6) yields an order-preserving map

k : Filt( ℘ (pt X)) ∂ → Sub ∑ pt X 1. (7.7)
We point out that the requirement that F be a filter, and not merely a subset, is not a real restriction. Indeed, the subobject associated to a subset F of ℘ (pt X) coincides with the one associated to the filter generated by F.

However, the phrasing in terms of filters allows for a smooth formulation of the next definition.

Definition 7.14. Assume arbitrary copowers of 1 exist in X. Then the category X is filtral if, for each X in X, the map k from (7.7) is a bijection.

Filtrality should be regarded as a form of compactness, and at the same time Hausdorffness, of certain copowers of the terminal object. In fact, the map k is an abstraction of the lattice isomorphism between (the order-dual of) the lattice of filters of ℘ (I), for I any set, and the lattice of closed sets of the Stone-Čech compactification β(I) of the discrete space I.

Note that in order to formulate the notion of filtrality it is not necessary to assume that all the copowers of the terminal object exist, for those indexed by a set of the form pt X, for some X in X, suffice. For example, the definition above makes sense for the category of finite sets and functions, which is easily seen to be filtral. However, we have opted for a stronger assumption to simplify the set of hypotheses and improve readability.

) ∈ ϑ F ⇔ {i ∈ I | b i = b i } ∈ F coproducts that exist in X are disjoint. That is, if a coproduct X + Y exists in X,
then the pullback of one coproduct injection along the other one is the initial object 0. Theorem 7.17. Suppose arbitrary copowers of 1 exist in X, and any finite coproduct that exists in X is disjoint. The following statements are equivalent.

1. The category X is filtral.

2. Spec ∑ pt X 1 is a compact Hausdorff space for every X in X.

3. Spec X is a compact Hausdorff space for every X in X.

Proof. We recall a well-known topological fact that will be employed below: the continuous image of a compact Hausdorff space through a closed map is again a compact Hausdorff space.

1 ⇒ 2. If X is filtral, then the map k : Filt( ℘ (pt X)) ∂ → Sub ∑ pt X 1 from (7.7
) is a bijective ∨-semilattice homomorphism by Lemma 7.16, hence a lattice isomorphism. In particular, it restricts to a bijection between the atoms of Filt( ℘ (pt X)) ∂ , i.e. the ultrafilters of ℘ (pt X), and the atoms of Sub ∑ pt X 1. The latter coincide, by Remark 7.7, with the points of ∑ pt X 1. Consider β(pt X), the Stone-Čech compactification of the discrete space pt X. We claim that the restriction of k to the set of atoms of Filt( ℘ (pt X)) ∂ yields a homeomorphism ϕ : β(pt X) → Spec ∑ pt X

1,

which in turn exhibits Spec ∑ pt X 1 as a compact Hausdorff space. By the topological fact recalled at the beginning of the proof, it suffices to show that ϕ is continuous and closed. The most general closed subset of Spec ∑ pt X 1 is of the form

C = {p ∈ pt ∑ pt X 1 | p S}
for some S ∈ Sub ∑ pt X 1. If, under the isomorphism k, S corresponds to a filter F of ℘ (pt X) then C corresponds to the set of all ultrafilters of ℘ (pt X) extending F, which is the most general closed subset of β(pt X).

Thus ϕ is continuous and closed.

2 ⇒ 1. Assume Spec ∑ pt X 1 is compact and Hausdorff for every X in X. Write

f : pt X → Spec ∑ pt X 1
for the function sending a point p of X to the corresponding coproduct injection of ∑ pt X 1. By the universal property of the Stone-Čech compactification, there is a (unique) continuous map

g : β(pt X) → Spec ∑ pt X 1 such that the next diagram commutes. pt X β(pt X) Spec ∑ pt X 1 f g
Claim. The map g is a bijection.

Proof of Claim. We first show that g is injective. Recall that, for every x ∈ β(pt X),

g(x) = A∈x {p ∈ pt ∑ pt X 1 | ∀S ∈ Sub ∑ pt X 1 ( f (A) ⊆ V(S) ⇒ p ∈ V(S))}.
Let x, y ∈ β(pt X) be distinct ultrafilters, and T ⊆ pt X such that T ∈ x and T c ∈ y. Since f (T) ⊆ V(∑ T 1), we have g(x) ∈ V(∑ T 1). Similarly, g(y) ∈ V(∑ T c 1). We claim that V(∑ T 1) ∩ V(∑ T c 1) = ∅, which clearly implies g(x) = g(y). The operator V is upper adjoint by Lemma 7.9, thus it suffices to prove

V( ∑ T 1 ∧ ∑ T c 1) = ∅.
The sum ∑ T 1 + ∑ T c 1 exists in X and coincides with ∑ pt X 1. Thus it is disjoint by assumption, that is

∑ T 1 ∧ ∑ T c 1 = 0. It follows that V(∑ T 1 ∧ ∑ T c 1) = ∅.
On the other hand, surjectivity of g follows if we show that the image of pt

X through f is dense in Spec ∑ pt X 1. An arbitrary open subset of Spec ∑ pt X 1 is of the form O = {p ∈ pt ∑ pt X 1 | p does not factor through S}, for some subobject S ∈ Sub ∑ pt X 1. If O = ∅, then S ∼ = ∑ pt X 1.
There- fore, there exists a coproduct injection q : 1 → ∑ pt X 1 which does not factor through S, and hence belongs to O. In turn, q is in the image of pt X through f , showing that the latter set is dense in Spec ∑ pt X 1.

proof by showing that Spec preserves finite and codirected limits, hence all small limits [86, p. 208]. This can be done through a direct inspection of the topology of the limit objects. Next, we indicate how one could prove directly that Spec preserves binary products.

If X, Y are objects of X, then there is a bijection between the underlying sets of Spec (X × Y) and Spec X × Spec Y because the functor pt is representable, hence it preserves limits. In turn, the topology of Spec (X × Y) is finer than the topology of Spec X × Spec Y because it makes the projections continuous. By the previous corollary, these two topologies are both compact and Hausdorff. Therefore Spec (X × Y) ∼ = Spec X × Spec Y because any two distinct compact Hausdorff topologies on the same set are incomparable.

Proposition 7.19. If X is filtral and admits arbitrary copowers of 1, then the functor Spec : X → KH preserves all the limits that exist in X.

Proof. Consider the following commutative diagram of functors.

X KH Set

Spec pt |-|
The functor | -| preserves all limits because it is represented by the onepoint space. Furthermore it is conservative, i.e. any continuous bijection between two compact Hausdorff spaces is a homeomorphism. Since every conservative functor reflects all the limits that it preserves, we conclude that | -| reflects all limits. Since pt preserves them, Spec must preserve all the limits that exist in X.

A characterisation of KH

The aim of this section is to prove our main result, i.e. the following characterisation of the category KH of compact Hausdorff spaces and continuous maps.

Theorem 7.20. Up to equivalence, KH is the unique non-trivial well-powered pretopos that is well-pointed, admits all coproducts, and is filtral.

We now recall the basic definitions and facts needed in order to prove the previous theorem. A category C is said to be (Barr) exact provided it is regular, and every internal equivalence relation in C is effective, i.e. it coincides with the kernel pair of its coequaliser. For instance, every variety of algebras is exact. More generally, every category that is monadic over Set is exact. Roughly speaking, a pretopos is an exact category in which ∞-extensive category arbitrary coproducts are disjoint. From a geometric viewpoint, this means that we allow for infinite discrete objects. Since we aim to capture the category of compact Hausdorff spaces and continuous maps, we assume compactness in the form of filtrality. Given that every locally small cocomplete elementary topos (in particular, every Grothendieck topos) is ∞-extensive [67, p. 100], no such topos is filtral.

Recall that a coherent functor is a functor between coherent categories that preserves finite limits, regular epimorphisms, and finite joins of subobjects. Under the hypotheses of Theorem 7.20, the functor Spec : X → KH turns out to be coherent. Lemma 7.27. Let X be a non-trivial well-powered pretopos that is well-pointed, admits all coproducts, and is filtral. Then the functor Spec : X → KH from (7.9) is well-defined and coherent.

Proof. Assume X is as in the statement. We verify that X satisfies the assumptions at the beginning of Section 7.2. In view of Lemma 7.24, it suffices to show that the morphism 0 → 1 is an extremal mono, and Sub X is a complete atomic lattice for every X in X. Since every monomorphism in a pretopos is regular [67, Corollary A.1.4.9], the morphism 0 → 1 is regular, whence extremal. In view of Remark 7.8, since arbitrary coproducts exist in X, every poset of subobjects in X is complete. On the other hand, X is balanced because every monomorphism is regular. Hence Sub X is an atomic lattice, for each X in X, by Remark 7.10.

Further, arbitrary copowers of 1 exist in X. Hence, by Corollary 7.18, the functor Spec : X → KH is well-defined. We prove that it is a coherent functor. The preservation of limits was proved in Proposition 7.19. Regular epis in KH are simply continuous surjective functions, therefore the functor Spec preserves regular epis by item 3 in Lemma 7.6. It remains to prove that Spec preserves finite joins of subobjects. We first note that Claim. The functor Spec preserves finite coproducts.

Proof of Claim. Since the initial object of X is strict, we have Spec 0 = ∅. It thus suffices to prove that Spec X + Y ∼ = Spec X + Spec Y whenever X, Y are objects of X. At the level of underlying sets, the obvious function pt X + pt Y → pt (X + Y) is injective because sums in X are disjoint. On the other hand, surjectivity follows from universality of sums. To prove that this bijection is actually a homeomorphism, one has to show that every subobject of X + Y can be split as the sum of a subobject of X, and a subobject of Y. In turn, this follows from the universality of sums in X. Indeed, taking the pullback of the coproduct X → X + Y ← Y along a subobject S → X + Y yields a splitting of S of the form S = S 1 + S 2 , with S 1 ∈ Sub X and S 2 ∈ Sub Y.

To conclude, consider X in X and two subobjects S 1 → X and S 2 → X. Write j : S 1 + S 2 → X for their coproduct. Since the functor Spec preserves finite coproducts by the previous claim, Spec j : Spec (S 1 + S 2 ) → Spec X is the sum of the subobjects Spec S 1 → Spec X and Spec S 2 → Spec X. The subobject S 1 ∨ S 2 → X is obtained by taking the (regular epi, mono) factorisation of j. Since the functor Spec preserves regular epis and monos, the image under Spec of the factorisation of j is the (regular epi, mono) factorisation of Spec j. Hence Spec (S 1 ∨ S 2 ) ∼ = Spec S 1 ∨ Spec S 2 , as was to be shown.

The last ingredient we need in order to prove Theorem 7.20 is the following proposition due to Makkai. Suppose C, D are coherent categories, and F : C → D is a coherent functor. We say that F is full on subobjects if, for any X in C, the induced lattice homomorphism Sub X → Sub FX is surjective. Further, F covers D if, for each object Y in D, there exist X in C and an epimorphism FX → Y in D. Finally, a morphism of pretoposes is a functor between pretoposes preserving finite limits, finite coproducts, and coequalisers of internal equivalence relations. 1. Any coherent functor between pretoposes is a morphism of pretoposes.

2. A morphism of pretoposes is an equivalence iff it is conservative, full on subobjects, and it covers its codomain.

We are now ready for the proof of our main result.

Proof of Theorem 7.20. By Lemma 7.27 and Proposition 7.28, it is enough to show that Spec : X → KH is conservative, it is full on subobjects, and it covers KH.

The functor Spec : X → KH is faithful because so is pt : X → Set (cf. Lemma 7.4). Thus, since X is balanced, Spec is conservative. The functor Spec is full on subobjects because monomorphisms in KH are inclusions of closed subsets, and the closed subsets of Spec X, for X in X, correspond precisely to the subobjects of X. Finally, consider any compact Hausdorff space Y. Since X admits arbitrary coproducts, the Y-fold copower of 1 exists in X. Write X = ∑ Y 1. By Corollary 7.18, Spec ∑ pt X 1 is homeomorphic to the Stone-Čech compactification of the discrete space pt X. Note that Y can be identified with a subset of pt X, by sending y ∈ Y to the corresponding coproduct injection of ∑ Y 1. Let f : pt X → Y be any function that is the identity when restricted to Y. By the universal property of the Stone-Čech compactification there is a (unique) continuous map g : Spec ∑ pt X 1 → Y extending f . Since f is surjective, then so is g. This shows that the functor Spec covers KH, thus concluding the proof. Remark 7.29. We comment on the independence of the hypotheses in Theorem 7.20. First, the category Set of sets and functions is a non-trivial wellpowered pretopos that is well-pointed and cocomplete, but it is not filtral. Thus the latter assumption is independent from the others. The existence of all coproducts is also independent, as the example of Set f , the category of finite sets, shows.

To see that the hypothesis that X be a pretopos is also independent, consider the category BStone of Boolean spaces. This is a non-trivial wellpowered coherent category that is well-pointed, cocomplete and filtral, but it is not exact (cf. Example 7.25). Another example of a category that satisfies all the assumptions but the pretopos condition is provided by the category KH of ordered compact spaces and monotone continuous maps. Recall from Section 6.1 that an ordered compact space is a pair (X, ) where X is a compact space, and ⊆ X × X is a partial order closed in the product topology. The category KH is easily seen to be non-trivial, well-powered and well-pointed. Furthermore it is cocomplete (cf. [START_REF] Tholen | Ordered topological structures[END_REF]Corollary 2]), and filtral because the copowers of the terminal object are computed as in KH. However, KH is not a pretopos. For instance, while every monomorphism in a pretopos is regular, this is not the case in KH . Indeed, the regular monomorphisms in KH are precisely the continuous order embeddings (for a proof of this fact see [START_REF] Hofmann | Enriched Stone-type dualities[END_REF]Prop. 4.7]). In turn, the identity function ([0, 1], =) → ([0, 1], ) provides an example of a monomorphism that is not regular.

Decidable objects and Boolean spaces

As observed in Example 7.25, the category BStone is not a pretopos. That is, assuming the exactness of the category X prevents us from capturing the Boolean spaces. We thus take a step back, and drop the assumption that the category X be exact. Throughout the section, we assume X satisfies the following properties, which imply that the functor Spec : X → KH from (7.9) is well-defined.

Assumption. The category X is a coherent positive category that is nontrivial, i.e. 0 ∼ = 1, well-powered, well-pointed, and filtral. Moreover, arbi- trary copowers of 1 exist in X, and Sub X is a complete atomic lattice for every X in X.

Note that, under the assumptions above, the unique morphism 0 → 1 is an extremal mono (cf. Remark 7.5).

Recall that an object X of a finitely complete and extensive category is decidable provided the diagonal morphism δ X : X → X × X is complemented, i.e. there exists a morphism ε X : Y → X × X such that

X X × X Y δ X ε X
is a coproduct diagram. The class of decidable objects contains the initial object 0, the terminal object 1, and it is closed under taking subobjects, finite sums and finite products. For instance, decidable objects in Top are the discrete spaces, while decidable objects in KH are the finite discrete spaces. See [START_REF] Carboni | Decidable (= separable) objects and morphisms in lextensive categories[END_REF] for a proof of these statements, and for the basics of the theory of decidable objects.

Proposition 7.30. The functor Spec : X → KH preserves decidable objects.

Proof. Let X be a decidable object in X, and Y → X × X the complement of the diagonal of X. Note that Spec (X × X) ∼ = Spec X × Spec X because Spec preserves limits by Proposition 7.19. Then the diagonal of X × X is mapped to the diagonal of Spec X × Spec X, and it admits Spec Y as a complement because Spec preserves finite coproducts (cf. the Claim in the proof of Lemma 7.27).

Remark 7.31. Since every decidable object in KH is a finite and discrete space, Proposition 7.30 entails that Spec X is finite and discrete whenever X is a decidable object of X. On the other hand, every finite discrete space arises in this manner. Indeed, suppose Y is a discrete space with n elements. Then Y ∼ = Spec ∑ n i=1 1 because every coproduct injection yields a distinct point of ∑ n i=1 1, and every point is a coproduct injection because sums in X are universal. Note that the object ∑ n i=1 1 is decidable because it is a finite sum of decidable objects.

Denote by Dec X the full subcategory of X on the decidable objects. This subcategory turns out to be equivalent to the category of finite sets: Proposition 7.32. The functor Spec : X → KH restricts to an equivalence between the category Dec X of decidable objects of X, and the category Set f of finite sets.

Proof. The functor Spec : X → KH restricts to a functor Spec : Dec X → Set f by Proposition 7.30. Since the former is faithful, then so is the latter. In turn, Remark 7.31 shows that Spec : Dec X → Set f is essentially surjective. Hence it remains to show that it is full.

To this end, we prove that for every continuous function f : Spec X → Spec Y with Spec Y finite and discrete, there is a morphism g : X → Y in X such that Spec g = f . Since Spec Y is finite and discrete, f induces a partition of Spec X into finitely many clopens, corresponding to complemented subobjects S 1 , . . . , S n of X. Thus X ∼ = ∑ n i=1 S i . For each i ∈ {1, . . . , n}, define g i : S i → Y as the composition

S i 1 Y ! v
where v ∈ pt Y is the value that f assumes on the clopen corresponding to S i . Upon writing g = ∑ n i=1 g i : X → Y, we see that Spec g = f .

Recall from Section 1.1 that the category of Boolean spaces coincides with the pro-completion of the category of finite sets. Therefore, if X has all codirected limits, the equivalence in the previous proposition can be lifted to an equivalence between a full subcategory of X and the category of Boolean spaces. In order to show this fact, we need a preliminary result.

Lemma 7.33. The functor Spec : X → KH is conservative.

Proof. It is enough to show that the functor pt : X → Set is conservative. First, note that pt is conservative on monomorphisms because all the posets of subobjects in X are atomic. That is, whenever m is a mono in X and pt m is a bijection, m must be an isomorphism in X. Now, let f be a morphism in X, and m • e its (regular epi, mono) factorisation. Suppose pt f = pt m • pt e is an iso. We prove that both e and m are isomorphisms. Since pt f is an iso, pt m is an epi. But pt m is also a mono because pt preserves limits, thus it is a bijection. By the observation above, m is an iso. In turn, the functor pt is faithful, hence it reflects monos. Since pt f is an iso, pt e is a mono. We conclude that e is both a mono and a regular epi in X, hence an iso. Therefore f is an isomorphism.

Call pro-decidable an object of X that is the codirected limit of decidable objects, and write proDec X for the full subcategory of X on the prodecidable objects. We will show that proDec X is equivalent to the category of Boolean spaces, provided X has enough limits. Note that the existence of codirected limits of decidable objects of X would suffice. However, to simplify the set of assumptions, we will assume that X admits all codirected limits. Then, since X has finite limits, it has all small limits [86, p. 208].

Theorem 7.34. If X is complete, then the functor Spec : X → KH restricts to an equivalence between the category proDec X of pro-decidable objects of X, and the category BStone of Boolean spaces.

Proof. The functor Spec : X → KH restricts to a functor Spec : proDec X → BStone by Propositions 7.19 and 7.30. Since the former is faithful, then so is the latter. Every Boolean space is the codirected limit of finite discrete spaces, and each finite discrete space is isomorphic to one of the form Spec X, for X in Dec X, by Proposition 7.32. Since the functor Spec preserves limits by Proposition 7.19, we conclude that Spec : proDec X → BStone is essentially surjective. To conclude the proof, we must show that it is full.

Assume f : Spec X → Spec Y is a continuous function, and Spec Y is a Boolean space. Then f is uniquely determined by its compositions with the quotients onto the finite discrete images of Spec Y. Such finite images are in the essential range of Spec : Dec X → Set f , so they are of the form p i : Spec Y → Spec Y i , with each Y i decidable. Thus f is determined by the cone { f i : Spec X → Spec Y i }, where f i = p i • f . Since the Spec Y i are finite and discrete spaces, for each f i there is a morphism ϕ i : X → Y i such that Spec ϕ i = f i (cf. the proof of Proposition 7.32). Similarly, for each p i : Spec Y → Spec Y i there is π i : Y → Y i with Spec π i = p i . The functor Spec is conservative by Lemma 7.33, hence it reflects limits. That is, the limit of the codirected system (Y i , π i ) in X is Y. Let g : X → Y be the morphism induced by the cone {ϕ i : X → Y i } in X. We have

p i • Spec g = Spec (π i • g) = Spec ϕ i = f i
for every i, whence Spec g = f . This concludes the proof.

To state the next corollary we introduce some terminology. We say that a functor is codense if its codensity monad exists and is the identity monad (cf. Section 3.1). Further, a co-frame is 0-dimensional if every element is the infimum of the complemented elements above it. We obtain the following characterisation of the category of Boolean spaces, under the assumptions at the beginning of the section. Corollary 7.35. If X is complete, then the following conditions are equivalent.

1. X is equivalent to the category BStone of Boolean spaces.

2. The inclusion functor Dec X → X is codense.

3. For each X in X, the co-frame Sub X is 0-dimensional.

4. 1 + 1 is a cogenerator for the category X.

5. The category X is cogenerated by a decidable object with at least two points.

Proof. Every category equivalent to BStone satisfies the conditions in items 2 -5. We prove that 2 ⇒ 1. In view of Lemma 3.4, saying that the inclusion Dec X → X is codense means that every object of X is the limit of decidable objects in a canonical way. Since the product of two decidable objects is again decidable, the limit at hand is easily seen to be codirected. Therefore every object of X is pro-decidable. The statement then follows at once from Theorem 7.34.

In view of the conservativity of the functor Spec (Lemma 7.33), if Spec X is a Boolean space then X is pro-decidable in X. In turn, each of the conditions in items 3 -5 ensures that the functor Spec : X → KH takes values in BStone. Indeed, since Sub X is isomorphic to the co-frame of closed subsets of Spec X, the latter is a Boolean space whenever Sub X is 0-dimensional. Moreover, if X is cogenerated by a decidable object Y (with at least two points), then every object X of X admits a monomorphism to a power of Y. Since Spec preserves limits, this means that Spec X is a closed subspace of a Boolean space, hence it is Boolean. Therefore each of the conditions 3 -5 implies that every object of X is pro-decidable. Hence, by Theorem 7.34, they all entail that X is equivalent to BStone.

Concluding remarks

The main novelty of our work consists in identifying the concept of filtrality as the categorical abstraction of compactness and Hausdorffness, in the context of the topological representation provided by the functor Spec.

In Remark 7.15 we indicated the relation between our notion of filtrality, and filtrality as it was introduced by Magari in universal algebra. The latter notion is related to Boolean products and sheaf representations of algebras: it would be interesting to know how our work relates to sheaf representations, and in particular to the recent publication [START_REF] Gehrke | Sheaves and duality[END_REF]. On the other hand, filtrality in the sense of Magari is connected to a certain inconsistency lemma in logic, see [START_REF] Raftery | Inconsistency lemmas in algebraic logic[END_REF]. We leave as an interesting direction for future work the investigation of the relation between this logic property, and filtrality in our sense.

The characterisation of the category of compact Hausdorff spaces presented in this chapter should be compared to Lawvere's Elementary Theory of the Category of Sets (ETCS) outlined in [START_REF] Lawvere | An elementary theory of the category of sets[END_REF]. While we identified a set P of properties such that any category satisfying P is equivalent to the category of compact Hausdorff spaces (Theorem 7.20), in op. cit. Lawvere gives eight elementary axioms (in the language of categories) such that every complete category satisfying these axioms is equivalent to the category of sets and functions. 4 Some of his axioms appear verbatim in our characterisation, e.g. the existence of enough points (elements, in Lawvere's terminology). Also, the assumption that every non-initial object has a point -one of the eight axioms -should be compared to our Lemma 7.6, while our assumption of effective equivalence relations corresponds to [START_REF] Lawvere | An elementary theory of the category of sets[END_REF]Theorem 6]. Where the two constructions, Lawvere's and ours, diverge is about the existence of infinite 'discrete' objects: the third axiom of ETCS states the existence of an object N behaving like the set of natural numbers. We identify a notion that is somehow orthogonal to the latter, namely filtrality, which precisely forbids the existence of such objects. In a sense, our characterisation shows to which extent the categories Set and KH are similar, and where they differ. Note that the condition of filtrality is of a different nature, compared to the other properties in P, because it is external; it would be interesting to know if this condition can be internalised. To conclude the discussion of Lawvere's ETCS, let us mention that his axiomatisation was adapted by Schlomiuk in [START_REF] Schlomiuk | An elementary theory of the category of topological spaces[END_REF] to capture the category of topological spaces. However, Schlomiuk's characterisation does not bear a greater resemblance to ours than Lawvere's does.

A direction for possible future work consists in adapting our characterisation of KH to the category KH of ordered compact spaces which, although not a pretopos, is filtral (cf. Remark 7.29). Here, we believe the right setting is that of categories enriched in the quantale 2 (see [START_REF] Stubbe | An introduction to quantaloid-enriched categories[END_REF] for a gentle introduction to quantaloid-enriched categories). This is related to a question motivated by the logic. In Section 7.4 we identified a class of categories X that contain a full subcategory dually equivalent to the category of Boolean algebras (see Corollary 7.34); this subcategory may be regarded as a Boolean 'core' of the category X. An enriched setting will probably allow us to study categories with a distributive, or Heyting, 'core'.

Another interesting direction is that of a constructive version of our result. While the assumption of well-pointedness yields right away the existence of enough points, one might try to adapt the result to the category of compact regular locales which, under the axiom of choice, is equivalent to KH (see, e.g., [START_REF] Johnstone | Stone spaces[END_REF]Corollary III.1.10]). This would establish a connection with [START_REF] Townsend | Axiomatic characterization of the category of locales[END_REF].

Index of symbols

Index of definitions

3 FIGURE 1 :

 31 FIGURE 1: Dependences and relations between the chapters.

FIGURE 1 . 1 :

 11 FIGURE 1.1: Boolean algebra with eight elements; the atoms are represented by white circles.

Proposition 1 . 3 .

 13 If h : B → B is a morphism in Boole f , then it has a lower adjoint g by the adjoint functor theorem for posets. In view of the previous lemma, we define At f : At B → At B to be the restriction of g to the atoms of B . Explicitly, for every b ∈ At B , At f (b ) is the unique atom b ∈ At B such that b h(b). At the level of finite Boolean algebras, Stone duality states that, up to a natural isomorphism, the functors ℘ and At are inverse to each other. In particular, any finite Boolean algebra B is isomorphic to a power-set algebra, namely B ∼ = ℘ (At B). This is known as the finite duality for Boolean algebras. The functors At : Boole f Set f : ℘ yield a dual equivalence between the category of finite Boolean algebras and the category of finite sets.

Definition 1 . 4 .FIGURE 1 . 2 :

 1412 FIGURE 1.2: Finite duality, discrete duality, and Stone duality for Boolean algebras.

FIGURE 1

 1 FIGURE 1.4: A finite automaton A...

Lemma 1 . 14 .

 114 If L ∈ Reg(A * ), then the extended dual of the Boolean algebra (B(L), \, \) is the finite monoid obtained as the quotient of A * by the congruence u

Lemma 1 . 27 .

 127 Let f : (X, M) → (Y, N) be a morphism of BiMs. Then f is equivariant, i.e. for every m ∈ M f

FIGURE 3 . 1 :

 31 FIGURE 3.1: Measures and their relations. The dashed line indicates the new connection that we contribute in this chapter.

Definition 3 . 3 .

 33 Let F : C → D and G : C → E be any two functors. The right Kan extension of F along G is a pair (K, κ), where K : E → D and κ : K • G ⇒ F, such that the following universal property is satisfied: for every pair (K , κ ) with K : E → D and κ : K • G ⇒ F, there exists a unique natural transformation ε : K ⇒ K such that the right-hand diagram below commutes. If F = G, the right Kan extension of G along itself is called the codensity monad of G, and it is denoted by T G .

Lemma 3 .

 3 4 ([86, Theorem X.3.1]). Let G : C → D be any functor. If C is essentially small (i.e., it is equivalent to a small category) and D is complete, then the codensity monad T G : D → D exists and for every d in D T G d = lim d→Gc Gc where the limit is taken over the comma category d ↓ G.

4 )

 4 for the natural transformation such that the pair ( T, κ) satisfies the universal property defining the right Kan extension. The forgetful functor | -| : BStone → Set is right adjoint, hence it commutes with right Kan extensions [86, Theorem X.5.1]. That is, | -| • T is the right Kan extension of | -| • G along G. Now, consider the left-hand diagram below.

  Therefore, by the universal property of the right Kan extension (| -| • T, | -|κ), there is a unique natural transformation τ : T • | -| ⇒ | -| • T as in the right-hand diagram above, satisfying | -|κ • τG = α. (3.5)

  is the unique T-algebra morphism extending the function |ϕ| : |X| → Y. Definition 3.7. Let T be any monad on Set, and T its profinite monad. Define τ : T • | -| ⇒ | -| • T as the unique natural transformation satisfying (3.5). For any X in BStone, the component τ X : T|X| → | TX| is the unique function induced by the cone {ϕ * : T|X|

  The bottom triangle commutes by(3.5), while the left-hand trapezoid commutes by naturality of τ. Finally, the commutativity of the right-hand trapezoid follows from the equalities κ • Tκ = κ • µG and π Y = κ (Y,h) • Tϕ. The first one is obtained by noticing that µ : T 2 ⇒ T is the unique natural transformation induced by the universal property of the right Kan extension ( T, κ) and the natural transformation κ

  is closed since it is the equaliser of the continuous maps S B S π a∨b π a + π b into the Hausdorff space S. Here, π a + π b is the composition of the continuous product map π a , π b : S B → S 2 with the continuous map + : S 2 → S. Thus (3.13) exhibits M(X, S) as an intersection of closed subsets of S B .

  (S|X|) generated by the elements of the form [b, k], where b ranges over the clopens of X and k ∈ S. Now, let x be a point of SX, i.e. an ultrafilter on the Boolean algebra B. By the previous lemma, for each b ∈ B, {[b, k] | k ∈ S} is a finite set of pairwise disjoint elements of B whose join is the top element. Thus we can define a function SX → M(X, S), x → µ x (3.16) where, for each b ∈ B, we define µ x (b) to be the unique k ∈ S satisfying [b, k] ∈ x. It is not difficult to see that each µ x is, indeed, a measure. This correspondence is injective because the elements of the form [b, k] generate the Boolean algebra B by Lemma 3.24.

  and only if, b = 0 and k = 0. Hence the empty set does not belong to F because µ(0) = 0. Moreover, for every b 1 , . . . , b n ∈ B, [b 1 , µ(b 1 )] ∩ • • • ∩ [b n , µ(b n )] = ∅ by additivity of µ, i.e. F is a filter basis. Let x be the proper filter generated by F. It is enough to prove that x is an ultrafilter, for then µ = µ x . Since the [b, k]'s generate B, it suffices to show that [b

  The latter coincides with the topology of all those open sets (in the dual Lawson topology) which are downward closed, cf. [55, Proposition III-1.6].

  is open. Note that the set {µ(b) | x ∈ b} is codirected. If its infimum belongs to U, which is dual Scott open, there must exist b ∈ B containing x and satisfying µ(b) ∈ U. Thus

Proposition 3 . 32 .

 332 Let S be a profinite idempotent semiring. The maps δ : M(X, S) C(X, S ↓ ) : defined in (3.19) and (3.20) form an adjoint pair, where δ is upper adjoint and is lower adjoint.

  for every b containing x. So it suffices to find a clopen b ∈ B such that x ∈ b and b f k, for then every element of N below b f will belong to U. Since the function f is continuous with respect to the dual Scott topology of S, and ↓k is dual Scott open, f -1 (↓k) is an open neighbourhood of x. Let b ∈ B be a clopen satisfying x ∈ b ⊆ f -1 (↓k). Then b f k,

Lemma 4 . 3 .

 43 For every monad T on Set, the sets TM TM and TX TM carry structures of T-algebras. If in addition T is finitary, then this also holds for the set [ TX, TX].

[ 18 ,

 18 Prop. 3.4.1-3.4.2]). Hence [ TX, TX] carries a Talgebra structure. Further, one can check that [ TX, TX] is a subalgebra of the T-algebra TX TX obtained as in the first part of the proof. Hence the statement.

Theorem 4 . 4 .

 44 Any finitary commutative Set-monad T can be extended to a monad on the category BiM mapping (X, M) to ( TX, TM).

(

  TX, TM, h, λ, ρ), where h, ρ and λ are defined as follows. Define the function h : TM → TX

)

  Note that [ TX, TX] is a T-algebra by Lemma 4.3, hence one can uniquely extend the map in (4.4) to a T-algebra morphism λ : TM → [ TX, TX]. The function ρ is defined similarly, as the unique T-algebra morphism extending T X,X • ρ.

  Theorem 4.4, we know that ( TX, TM) is a BiM, and in what follows we use it for recognising Alanguages by constructing another BiM morphism (β(A * ), A * ) → ( TX, TM) as in Lemma 4.11 below. To this end, we need a way of lifting the Kleisli map R : A * → T(B * ) to a Kleisli map for the monad T. This can be done in a natural way using a natural transformation τ # : βT ⇒ Tβ obtained from the natural transformation τ : T • | -| ⇒ | -| • T (see Definition 3.7) using the unit ι and counit ε of the adjunction β | -| in equation (3.2). Explicitly, τ # is obtained as the composite βT βT| -|β β| -| Tβ Tβ.

FIGURE 4 . 1 :

 41 FIGURE 4.1: BiM morphism obtained from ( φ, ϕ) by means of the Kleisli map R.

8 )Lemma 4 . 11 .

 8411 The functor β sends the Kleisli map R : A * → T(B * ) to the Kleisli map R : β(A * ) → Tβ(B * ) given by the compositeR : β(A * ) βT(B * ) Tβ(B * ).If the pair ( φ, ϕ) from (4.6) is a BiM morphism, then so is the pair

Figure 4 .FIGURE 4 . 2 :

 442 FIGURE 4.2: The S-transducer T R realising R. All the transitions have weights 1 S , and thus the transducer outputs value 1 S for all pairs of the form (w, w (i) ), with w ∈ A * and 1 i |w|.

Proposition 4 . 18 .

 418 The Boolean algebra QB of those languages over A which are inverse images of clopens under ϕ Q is generated by the quantified languages Q k (L), for k ∈ S and L ∈ B.

Proposition 4 . 19 .

 419 The Boolean algebra generated by QB ∪ B 0 is closed under quotients. That is,B = <Q k (L), L 0 | L ∈ B and k ∈ S> BA .Proof. Since B 0 is closed under quotients, it suffices to consider the quotienting of languages of the form Q k

. 16 )

 16 The above observations imply that Proposition 4.21. The map δ : B + B → ℘ (A * ) is a homomorphism of Boolean algebras with biactions when we define the left quotient operation Λ( f , m) of B + B on B by

Lemma 4 . 22 .

 422 The homomorphism Λ 11 ( f , m) : B → B given by K, k → m -1 K, k is dual to the continuous function λ 11 ( f , m) : SX → SX given by µ → mµ, where mµ : B → S, K → µ(m -1 K).

Lemma 4 . 23 .

 423 The homomorphism Λ 12 ( f , m) : B → B given as in (4.[START_REF] Boja | Recognisable Languages over Monads[END_REF]) is dual to the continuous function λ 12 ( f , m) : X → SX given by x → f x, where

Lemma 4 . 24 .

 424 The homomorphism Λ 1 ( f , m) : B → B + B given as in Proposition 4.21 is dual to the continuous function λ 1 ( f , m) : SX × X → SX given by (µ, x)

Corollary 4 . 25 .

 425 The left quotienting operation Λ on B + B defined in Proposition 4.21 is dual to the left action of ♦M on ♦X.

  2) for every a ∈ A and b ∈ B. Note that ↑ f ( b) is closed because the upward closure of a closed set in a Priestley space is again closed. Further, every closed up-set is the intersection of all the clopen up-sets containing it. Hence equation (6.2) holds for every a ∈ A if, and only if, g( b) = ↑ f ( b). We conclude that the lower adjoint g exists exactly when ↑ f ( b) is a clopen up-set for every b ∈ B. In turn, this is equivalent to ↑ f ( b) being open for every clopen up-set b ⊆ X B .

Proposition 6 . 9 .

 69 The map f : E(p, v) E(p) is open.

  is a clopen down-set. Therefore, h admits left and right adjoints by Lemma 6.3.However, the map f is not open. Indeed, for any n 2, n ⊆ X is open, but f (n) = {n, ∞} is not.

Lemma 6 . 14 .

 614 (i) d(x, y) = 0 if, and only if, x = y; (ii) d(x, y) = d(y, x); (iii) d(x, z) max (d(x, y), d(y, z)). Note that, for every x, y ∈ E(p) and n ∈ N, x ∼ n y if, and only if, d(x, y) < 2 -n . Therefore, the open ball B(x, 2 -n ) of radius 2 -n centered in x coincides with the equivalence class [x] n = {y ∈ E(p) | y ∼ n x}, which is clopen by Remark 6.12. The topology of the Esakia space E(p) is generated by the clopen balls of the ultrametric d. Proof. Note that, for any formula ϕ(p), ϕ = x∈ ϕ [x] |ϕ| = x∈ ϕ B(x, 2 -|ϕ| ).

have {p : 1 →

 1 X | p S} S.

Remark 7 . 15 .

 715 Fix a class L of Birkhoff algebras of the same similarity type, and consider a subset {A i | i ∈ I} ⊆ L. If B is a subalgebra of the direct product ∏ i∈I A i , and F is a filter of ℘ (I), then the relation ϑ F defined by ∀b, b ∈ B, (b, b

Proposition 7 .

 7 28 ([88, Prop. 2.4.4 and Lemma 2.4.6]). The following statements hold.

℘

  (X) power-set algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . At B atoms of a Boolean algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a basic clopen of the dual space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 two-element Boolean algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . β(S) Stone-Čech compactification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N natural numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N ∞ one-point compactification of N . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V (X) Vietoris hyperspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C subbasic clopen of the Vietoris topology . . . . . . . . . . . . . . . . . . . . . . . . . . ♦C subbasic clopen of the Vietoris topology . . . . . . . . . . . . . . . . . . . . . . . . . . . ℘ f (X) finite power-set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A * free monoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reg(A * ) regular languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K\L residual operation on languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . w -1 L (left) quotient of a language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B(L) Boolean algebra closed under quotients associated to a language A * free profinite monoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |w| length of a word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

L

  ϕ language defined by a formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . w (i) marked word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . L ∃ existentially quantified language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ∃ S,k semiring quantifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

  This is a (non-empty) closed subspace of the Stone-Čech compactification of S, hence it is a Boolean space with respect to the subspace topology. It is usually called the remainder of the Stone-Čech compactification of S. By definition, its points are the free ultrafilters of the Boolean

	0	1	2	3	∞
		FIGURE 1.3: One-point compactification of N, and the
				open neigbourhoods of ∞.

[START_REF] Adámek | Abstract and concrete categories[END_REF]

In other words, writing KH for the category of compact Hausdorff spaces and continuous maps, the ensuing functor β : Set → KH is left adjoint to the underlying-set functor KH → Set. Example 1.8 (Remainder). For any infinite set S, consider the space S * = β(S) \ S. algebra ℘ (S). By duality, we know that the dual algebra of S * is a quotient of ℘ (S). Consider the filter

Proposition 1.16. A

  Note that the syntactic morphism A * → M L recognises L. In fact it is minimal with respect to this property, in the sense that it factors through any other surjective homomorphism recognising L [128, Theorem V.1.3]. Hence Proposition 1.15 entails at once the following fact. language L ⊆ A * is regular if, and only if, it is recognised by a monoid morphism A * → M into a finite monoid.

  → A * , u → vuw.Note that, taking α (v,ε) (resp. α (ε,w) ), where ε ∈ A * is the identity element, we recover the natural left (resp. right) action of A * on itself. So β(A * ) admits a dense subset with a monoid structure, namely A * , whose natural biaction lifts to a biaction of A * on β(A * ) with continuous components.This structure is inherited by the dual spaces of Boolean algebras of languages closed under quotients. Let B be a Boolean subalgebra of ℘ (A

	is a Boolean algebra homomorphism. By Stone duality, this homomor-
	phism corresponds to a continuous function from the Stone-Čech compact-
	ification β(A * ) to itself. This function coincides with the unique extension
	β(α (v,w) ) : β(A * ) → β(A * )
	of the 'left and right multiplication' function
	α (v,w) : A

* * )

  If a ∈ A and C 1 , C 2 are clopens of X and Y, respectively, then the language L C 1 ×C 2 ,a defined as

to the Boolean algebra B, for arbitrary clopens C 1 ⊆ X and C 2 ⊆ Y. We need the following fact.

Claim.

  is the well-known fact that it has dense image (cf. Since the category X ↓ G is codirected, it is enough to show that every non-empty subbasic open set of TX, in the limit topology, contains an element in the image of τ X . Such an open set is of the form p -1 (y), where p : TX → Y is a continuous function in the limit cone defining TX (cf. equation(3.3)) and y ∈ Y is in the image of p. More precisely, this means that there exists an object

	Example 1.10). This feature turns out to be common to all profinite mon-
	ads. In the special case of a finite discrete space X, this follows from [5,
	Proposition B.7.(b)].

Lemma 3.9. For every Set-monad T and Boolean space X, the component τ X : T|X| → | TX| has dense image.

Proof.

  D}be a collection of finite discrete T-algebras whose limit in the category of (Boolean) topological T-algebras is Y. Since the limit maps ρ i : Y → Y i are continuous T-algebra morphisms, each Y i belongs to the diagram defining TY (see equation(3.3)). Thus, for every i ∈ D, there is a continuous map π i : TY → Y i in the limit cone. As we saw in the first part of the proof, each |π i | is a T-algebra morphism. Consider now the continuous mapϕ i : TX → Y i defined by ϕ i = π i • T f . The function | T f | is a T-algebra morphism,as pointed out before Lemma 3.8. It follows that {ϕ i : TX → Y i | i ∈ D} is a cone of continuous T-algebra morphisms, and it therefore induces a unique continuous T-algebra morphism ϕ : TX

By the universal property of the free T-algebra T|X| there is a unique T-algebra morphism ξ : T|X| → |Y| extending | f | : |X| → |Y|, i.e. satisfying ξ • |η X | = | f |. (3.10) By Lemma 3.8 the maps |g 1 | • τ X , |g 2 | • τ X are T-algebra morphisms. In turn, the left-hand diagram in (3.6) entails that they are both solutions to equation (3.10). We conclude |g 1

| • τ X = |g 2 | • τ X , whence g 1 = g 2 .

To conclude, we prove that diagram (3.9) admits a solution. Let

{(Y i , h i ) | i ∈

  The computations in the proof of Proposition 4.19 tell us the components of u -1 ϕ tells us how to define Λ 1 ( f u , ϕ(u 0 )) using components Λ 11 ( f , m) : B → B and Λ 12 ( f , m) : B → B. By the computation in (4.14), the component Λ 11 ( f , m) : B → B depends only on the second coordinate of the pair

Q -1 ( K, k ) in QB and in B 0 , respectively. Since QB and B 0 are precisely the images under δ of B and B, respectively, the computation

  The function λ 11 ( f , m) is dual to Λ 11 ( f , m) if and only if, for all µ ∈ SX and all K, k ∈ B we have

  1. For any two formulae ϕ(p) and ψ(p), we have ϕ IPC ψ if, and only if, ϕ ⊆ ψ as subsets of E(p). 2. If Y is an Esakia space and C 1 , . . . , C l are clopen up-sets of Y, there exists a unique continuous p-morphism h Y : Y → E(p) satisfying h -1 Y ( p i ) = C i for all i ∈ {1, . . . , l}.

  We prove that (Q k ) holds for k + 1 if it holds for k ∈ {0, . . . , m -1}. As in item 2, we prove that (a) f (h M ([x] n , [y] m )) k+1 y and (b)

In Birkhoff's paper[START_REF] Birkhoff | Moore-Smith Convergence in General Topology[END_REF] there is of course no mention of languages, which were introduced only in the 1950s. However, an easy adaptation of one of his results for groups shows that the Boolean algebra of all regular languages in a finite alphabet A is dual to the underlying space of the profinite completion of the free monoid A * .

For a proof of this fact, see e.g.[START_REF] Johnstone | Stone spaces[END_REF] Corollary VI.2.2]; this also applies to show that the ind-completion of Set f is Set, as mentioned above.

Every filter F of a Boolean algebra B yields a congruence ∼ F on B defined by a ∼ F b ⇔ a ↔ b ∈ F for every a, b ∈ B, where a ↔ b = (¬a ∨ b) ∧ (a ∨ ¬b). Thus the filter F induces a quotient B/∼ F . In fact, this gives a bijection between quotients of B and filters of B.

As long as we are concerned with quantification of languages, we might assume that L is contained in the image of γ 1 . Indeed, if L ⊆ (A ×

2) * and L = L ∩ γ 1 (A * ⊗ N), then L ∃ = L ∃ .

This fact is not specific about semirings, and it holds for any variety of Birkhoff algebras. See, e.g.,[START_REF] Johnstone | Stone spaces[END_REF] Corollary VI.2.4]

Although we shall not need this fact, we remark that the topological semilattices whose underlying spaces are Boolean, are precisely the profinite semilattices[START_REF] Numakura | Theorems on compact totally disconnected semigroups and lattices[END_REF].

Roughly, a finite state transducer can be seen as a finite automaton in which the label of each edge does not only describe an input letter, but also an output word. While automata recognise (or generate) words, transducers transform them.

We remark that the connection between Boolean algebras and classical propositional logic has its origins in the work of Boole[START_REF] Boole | The Mathematical Analysis of Logic -Being an Essay Towards a Calculus of Deductive Reasoning[END_REF], see also the introductory text[START_REF] Halmos | The Dolciani Mathematical Expositions[END_REF].

For simplicity, throughout, we assume a one-sorted signature Σ has been fixed.

Up to α-equivalence, i.e. up to a renaming of the free variables.

A regular epimorphism is a morphism that is the co-equaliser of some pair of parallel morphisms. Dually, a regular monomorphism is a morphism that is the equaliser of some pair of parallel morphisms. Every regular epimorphism (resp. regular monomorphism) is an epimorphism (resp. monomorphism).

Throughout, we assume that D is well-powered, cf. Definition 7.2 in Chapter 7.

Equivalently, a prime filter of A is a meet-prime element of the lattice of filters of A. This explains the terminology prime filter. Note that every ultrafilter of a Boolean algebra is a prime filter and, due to the law of excluded middle x ∨ ¬x = 1, every prime filter of a Boolean algebra is an ultrafilter.

Cf. footnote 1 on page 139.

A co-frame is spatial if it is -generated by the set of its join-prime elements. Spatial coframes are precisely those arising as the collections of all closed subsets of some sober space.

Unlike the other axioms, completeness (i.e., the existence of arbitrary limits) is not expressible by means of a first-order sentence. In this sense, Lawvere's characterisation of Set is almost elementary.

Acknowledgements

This thesis is the result of my Ph.D. research project, carried out between 2015 and 2018 in Paris and Nice. Many people have contributed, directly or indirectly, to the document that you are holding in your hands. I will now try to describe these contributions, hopefully forgetting as few as possible of them.

Émile Ajar v I had the opportunity to carry out my Ph.D. project thanks to Université Sorbonne Paris Cité, which funded my research through a Volant International Fellowship, agreement IDEX-REGGI15RDXMTSPC1GEHRKE. Also, I had the chance to travel, present my own research at conferences, meet researchers in different fields, and discover new places, thanks to the project DuaLL, funded by the European Research Council under the European Union's Horizon 2020 research and innovation programme (grant agreement No.670624). already mentioned, I would like to thank Célia Borlido, Leo Cabrer,

is the map h from (4.3) transporting SM into a dense subspace of SX.

We remark that, since we assumed h is injective, then so is the map h (cf. the discussion after Lemma 3.9). Now, to exhibit the BiM structure of SX, we start by identifying the actions of M on SX. We state these as lemmas and, indeed, one can prove them directly. However, they are just special cases of the more general results proved in the previous section. Using the S-semimodule structure of SX, along with the biaction of M on SX provided by the previous lemma, it is easy to obtain the biaction of SM on SX. The following can be regarded as the specific incarnation of Theorem 4.4. Lemma 4.8. Let (X, M) be a Boolean space with an internal monoid. The map

is a left action of SM on SX with continuous components. A right action with continuous components may be defined similarly. Finally, the two actions are compatible and provide the BiM structure on ( SX, SM).

Next, we consider a restriction of the above action of SM on SX which we will need for the construction of the space ♦ S X in Section 4.3. This is given by precomposing with the unit of the monad S:

where µ x is the measure concentrated in x. That is, µ x (b) = 1 if x ∈ b, and µ x (b) = 0 otherwise. It is immediate that this map embeds X as a (closed) subspace of SX. Thus we obtain an 'action' SM × X → SX, ( f , x) → f µ x , which factors through the integration map τ X : SX → SX. We record this fact in the following lemma. by ϕ ∃ p mod q .

Indeed, if L = ϕ -1 (P) for some P ⊆ M, then L ∃ p mod q = ϕ -1 ∃ p mod q ( P), where P is the set of matrices in M 2 (SM) such that the finitely supported function f : Z/qZ → M in position [START_REF] Abramsky | The pebbling comonad in Finite Model Theory[END_REF][START_REF] Abramsky | The Quantum Monad on Relational Structures[END_REF] has the property that P f = p in Z/qZ.

In view of Theorem 4.4, we know that whenever (X, M) is a BiM, then so is ( SX, SM) with the actions of the internal monoid as in Lemma 4.8. Using this fact as an intermediate step, we can prove the following lemma. Lemma 4.14. If (X, M) is a BiM, then so is

for any integer n 1.

Proof. Notice that the set M n ( SX) is a Boolean space with respect to the product topology of n × n copies of SX. The statement then follows easily upon defining the actions of the monoid M n (SM) on M n ( SX) by using the actions of SM on SX via matrix multiplication, and the S-semimodule structure of SX. For example, the left action of ( f ij ) i,j ∈ M n (SM) on (µ ij ) i,j ∈ M n ( SX) yields a matrix of measures in SX having at position (i, j) the measure ∑ n k=1 f ik µ kj .

Next we will see that the monoid morphisms ϕ ∃ and ϕ ∃ p mod q constructed in Examples 4.12 and 4.13 can be extended to BiM morphisms recognising L ∃ and L ∃ p mod q , respectively.

derived in Section 4.3.2 is dual to the homomorphism of Boolean algebras with biactions

obtained by equipping B + B with the biaction of ♦M as indicated in Proposition 4.21.

A Reutenauer theorem for ♦X

In this last subsection we prove a Reutenauer-like theorem characterising the Boolean algebra closed under quotients generated by all languages recognised by the space ♦X with respect to length preserving morphisms. As already mentioned in Chapter 2, this theorem is akin to the result of Reutenauer [START_REF] Reutenauer | Theoretical Computer Science 4th GI Conference: Aachen[END_REF] characterising the languages recognised by the binary Schützenberger product of two monoids.

Definition 4.27. We call a BiM morphism ψ : (β(A * ), A * ) → (♦X, ♦M) length preserving provided, for each a ∈ A, we have that

Recall that, given any BiM morphism

we obtain a BiM morphism

Note that, upon defining f a = π 1 • ♦ϕ(a), we have

where m a = ϕ(a, 1), so that ♦ϕ is length preserving. Conversely, Proposition 4.28. Let X be a BiM. Every length preserving BiM morphism

For the reverse containment, if L is a language over A × 2 recognised by X, then Q k (L) is recognised by ♦X through a length preserving morphism in view of Theorem 4.16. Finally, suppose L is a language over A recognised by η : β(A * ) → X through the clopen K. Consider any function

Concluding remarks

In this chapter we have identified the construction on Boolean spaces with internal monoids which corresponds to applying a layer of semiring quantifiers on Boolean algebras of languages; the approach we adopted could be easily adapted to model different operations on languages. These results lead to the following question: given an equational basis for the Boolean algebra of languages recognised by a BiM (X, M), what is a simple equational basis for the Boolean algebra of languages recognised by (♦ S X, ♦ S M), described in Theorem 4.29? Answering this question is crucial in order to obtain separation results for language classes corresponding to fragments of logic. A first step was made in Section 2.3, in the particular case where S = 2. We leave this as a topic for future research.

Another interesting direction would consist in generalising the results of this chapter so to deal with infinite semirings. For example the majority quantifier, which plays an important rôle in language theory, is modelled by the semiring Z. Our approach does not directly apply to this quantifier, and we suspect that in defining the actions of the internal monoid an external set-theoretic construction would be needed (cf. [START_REF] Borlido | Stone Duality and the Substitution Principle[END_REF]).

Finally, we mention the question of whether BiMs, employed here as topological recognisers, are in some sense algebras. We suspect the obvious forgetful functors from BiM to BStone, Set and to the category of monoids are not monadic. However, BiMs might be algebras for other monads (or functors), or they might be algebras in a weaker sense (e.g., relational algebras). We leave this for future work.

Part II

Logic, spaces and coherent categories Definition 7.3. Suppose X is a category admitting a terminal object 1. Then X is said to be well-pointed if, for any two distinct morphisms f , g :

In the following, we will study the properties of the functor of points when X is a coherent category satisfying some extra assumptions. Before proceeding, note that every coherent category C has an initial object 0. This can be taken to be the least element of Sub 1. Moreover, 0 is strict, in the sense that every morphism X → 0 must be an isomorphism (for a proof of these facts see, e.g., [67, A.1.4]). In turn, this implies that 0 ∼ = 1 if, and only if, any two objects in the category are isomorphic, and therefore C is equivalent to the terminal category with only one object and one morphism. Thus, if 0 ∼ = 1, we shall say that the category C is trivial. Finally, recall that every poset of subobjects in C is a distributive lattice by Lemma 5.5, and C admits stable images which arise from a (regular epi, mono) factorisation system that is stable under pullback (cf. Definition 5.1). Throughout, whenever convenient, we will tacitly use the fact that in every coherent category there is such a factorisation system. For the remainder of the section, we assume the category X satisfies the following properties.

Assumption. The category X is a coherent category that is non-trivial, i.e. 0 ∼ = 1, well-powered, and well-pointed.

We note in passing that, if X is an object of X such that the copower ∑ pt X 1 exists in X, then the canonical morphism ∑ pt X 1 → X is an epimorphism, by well-pointedness of X. In view of the discussion above, the next lemma is immediate.

Lemma 7.4. The functor pt : X → Set from (7.1) is well-defined and faithful. Some interesting properties of the sets of points can be derived by assuming that the unique morphism ! : 0 → 1 is an extremal monomorphism. Recall that a monomorphism m is extremal if, whenever it can be decomposed as m = f • e with e an epimorphism, then e is an isomorphism. A moment's reflection shows that 1. if g • f is an extremal mono, then so is f ; 2. every extremal mono that is epic must be an isomorphism. Remark 7.5. In a coherent category the unique morphism 0 → 1 is always a monomorphism, but in general it is not extremal. Note that 0 → 1 is Remark 7.7. Items 1 and 2 of Lemma 7.6 together imply that, if 0 → 1 is an extremal mono, then the atoms of the poset Sub X are precisely the points of X. This fact will be important in the following.

Given an object X of X and a subobject S ∈ Sub X, define the set

of all points of X that 'belong to S'. Conversely, we would like to be able to define a subobject of X induced by the choice of a subset of points of X.

Note that the operator V : Sub X -→ ℘ (pt X) preserves all infima existing in Sub X. In particular, it is monotone. If the poset of subobjects Sub X is complete, then V has a lower adjoint I : ℘ (pt X) → Sub X. By the usual description of the lower adjoint to an upper adjoint map between posets, cf. [30, 7.33], for any set T ⊆ pt X of points of X,

That is, I(T) is the smallest subobject of X that 'contains (all the points in) T'. We record the adjunction I V in the lemma below.

Remark 7.8.

The assumption that all the posets of subobjects in X are complete (that is, using categorical terminology, that X is mono-complete) is a weak form of completeness of the category X. Indeed, suppose X is an object of X, and consider any subset

Then, if it exists, the infimum i∈I S i ∈ Sub X is the limit in X of the codirected diagram of the finite intersections of elements from {S i | i ∈ I}, with the obvious monomorphisms between them. Therefore if X has, in addition to all finite limits, all small codirected limits (thus, by [86, p. 208], all small limits) then Sub X is complete for each X in X. However, the completeness of X is not a necessary condition for the existence of arbitrary infima (and suprema) of subobjects: the category of finite sets provides a counterexample. We point out that another sufficient condition for the posets of subobjects in X to be complete is the existence of arbitrary coproducts. Indeed, if the coproduct ∑ i∈I S i exists in X, then the (regular epi, mono) factorisation of the morphism ∑ i∈I S i → X yields the supremum i∈I S i of the set {S i | i ∈ I}. Lemma 7.9. Assume that every poset of subobjects in X is complete. For each object X of X the following statements hold.

Now, if S is an arbitrary subobject of Y satisfying I(T)

f * (S), every point of T must belong to f * (S). Thus S contains every point of the form pt f (p) for p ∈ T, so that q S. By (7.5) we have q ∃ f (I(T)).

To conclude, it is enough to show that

Let e : I(T) → ∃ f (I(T)) be the canonical regular epi. Then pt e is surjective by item 3 in Lemma 7.6, showing that V(∃ f (I(T))) = pt f (V • I(T)).

The operator I preserves arbitrary joins because it is lower adjoint.

Hence it is enough to show that V preserves finite joins. Since X is non-trivial, we have V(0) = ∅. Now, let S 1 , S 2 ∈ Sub X, and pick a point p ∈ pt X. The latter is an atom of Sub X (cf. Remark 7.7). Since the lattice Sub X is distributive by Lemma 5.5, and atoms in a distributive lattice are are always join-prime, we conclude that p S 1 ∨ S 2 iff p S 1 or p S 2 . That is

3. Let S ∈ Sub X be an arbitrary subobject. In view of the previous item, we have I • V(S) S. In the other direction, we must prove that S S whenever S ∈ Sub X is such that every point of X that factors through S factors also through S . In view of Remark 7.7, this holds if Sub X is atomic.

The next corollary is an immediate consequence of item 3 in Lemma 7.9 and item 2 in Proposition 7.11. Corollary 7.12. Suppose every poset of subobjects in X is complete, and 0 → 1 is an extremal monomorphism. Then pt : X → Set can be lifted to a functor Spec : X → Top into the category of topological spaces sending an object X of X to the set pt X equipped with the topology induced by the closure operator V • I in diagram (7.4).

Write | -| : Top → Set for the underlying-set functor. Since the functor pt is faithful (Lemma 7.4) and the diagram below commutes, we conclude that Spec : X → Top is a faithful functor.

X Top Set

is a congruence on B. In [START_REF] Magari | Varietà a quozienti filtrali[END_REF], Magari calls the algebra B filtral if every congruence on B is of the form ϑ F for some filter F. The class L is then said to be filtral if every subdirect product of members of L is a filtral algebra, and semi-filtral if the latter condition is required only for direct products. If L consists of a single algebra A, then L is semi-filtral iff, for every set I, the filters of ℘ (I) are in bijection with the quotients of A I .

Suppose V is a variety of algebras, and A is the initial algebra in V, i.e. the free V-algebra on the empty set. If L = {A} is semi-filtral in the sense of Magari and every monomorphism in V is regular (this happens, for instance, if V satisfies the strong amalgamation property), then the category V op is filtral in the sense of Definition 7.14. For example, one can take V to be the variety of Boolean algebras, and A the two-element Boolean algebra.

The next lemma states that the monotone map k : Filt( ℘ (pt X)) ∂ → Sub ∑ pt X 1 is, in fact, a homomorphism of semilattices. This observation will be exploited in Theorem 7.17 below to show that, if X is filtral, then the spaces of the form Spec ∑ pt X 1 are compact and Hausdorff. Lemma 7.16. For any X in X, the map k from equation (7.7) is a ∨-semilattice homomorphism.

Proof. Suppose F 1 , F 2 are filters of ℘ (pt X). We must prove that

. With respect to the converse inequality, by the infinite distributive law of co-frames (i.e., the order-dual of the distributive law in (5.3)) we have

In turn, recall that pt (S ∨ S ) = pt S ∪ pt S because points are join-prime elements in the lattice Sub X. Thus

This concludes the proof.

The following theorem, which is the main result of the section, says that the category X is filtral if, and only if, the functor Spec : X → Top takes values in the category of compact Hausdorff spaces. However, in order to show the 'if' part of the statement, we have to assume that those finite For any topological space Y, write K(Y) for its lattice of closed subsets. There is a commuting square as follows. The vertical arrows, sending respectively a filter of ℘ (pt X) to the set of ultrafilters extending it, and a subobject of ∑ pt X 1 to the set of its points, are lattice isomorphisms.

In view of the claim, g is a homeomorphism between the spaces β(pt X) and Spec ∑ pt X 1. Therefore the direct image function g[-] is a lattice isomorphism. We conclude that k is also a lattice isomorphism, showing that X is filtral. 2 ⇔ 3. For the non-trivial direction, consider an object X of X and the canonical morphism ε : ∑ pt X 1 → X. Direct inspection shows that the continuous function Spec ε is surjective. Moreover, it is closed by item 1 in Proposition 7.11. Hence, if Spec ∑ pt X 1 is a compact and Hausdorff space, then so is Spec X.

The following corollary follows at once from the previous theorem, and it does not make use of the hypothesis that the existing sums are disjoint. In particular, the characterisation of Spec ∑ pt X 1 follows from the proof of the implication 1 ⇒ 2.

Corollary 7.18. If X is filtral and admits arbitrary copowers of 1, then the functor Spec : X → Top co-restricts to a functor Spec : X → KH.

(7.9)

Furthermore, for each X in X, Spec ∑ pt X 1 is homeomorphic to the Stone-Čech compactification of the discrete space pt X. That is, the following square commutes up to a natural isomorphism.

X X

Set KH

We conclude this section by observing that, under the hypotheses of the previous corollary, the functor Spec : X → KH preserves all the limits that exist in X. The proof hinges on the fact that the underlying-set functor | -| : KH → Set is conservative. However, one could give a direct finite sums exist and are 'well-behaved'. The latter property is formalised by the notion of extensivity. Definition 7.21. A category C is extensive provided it has finite coproducts, and the canonical functor

is an equivalence for every X 1 , X 2 in C.

In the presence of enough limits a more intuitive reformulation of this notion is available. Given two objects X 1 , X 2 in C, the coproduct

along any morphism yields a coproduct diagram. Moreover, recall that the coproduct X 1 + X 2 is said to be disjoint if pulling back a coproduct injection along the other one yields the initial object of C. Pretoposes are often defined as positive and effective coherent categories.

Here, positive means that finite coproducts exist and are disjoint, while an effective regular category is what has been called an exact category above. The two definitions are equivalent, since finite coproducts in a positive and effective coherent category are universal, and an exact extensive category is automatically coherent. We record this fact for future use. 1. The category of sets and functions is a pretopos. Its full subcategory on the finite sets is also a pretopos. More generally, every elementary topos is a pretopos.

2. The category KH of compact Hausdorff spaces and continuous maps is a pretopos. The hard bit is checking that KH is exact. In turn, this follows from the fact that KH is monadic over Set [START_REF] Linton | Some aspects of equational categories[END_REF].

3. The category BStone of Boolean spaces and continuous maps is a positive coherent category, but it is not effective. Thus it is not a pretopos. In fact, its pretopos completion is the category KH (cf. [START_REF] Carboni | Regular and exact completions[END_REF]).