{'fraction_non_alphanumeric': 0.07213434632789471, 'fraction_numerical': 0.00882218624154108, 'mean_word_length': 3.6295406496252163, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Primer on inverse semigroups II

This report assumes the basics of inverse semigroup theory as described in the first primer but goes on to show how they may be analysed using ideas from category theory.


Introduction
We saw in Chapter 1 that underlying every inverse semigroup is a groupoid, but this groupoid is not enough on its own to recover the original inverse semigroup multiplication. This raises the question of what else is needed, and we answer this question in Section 2. The underlying groupoid of an inverse semigroup combined with the natural partial order lead to a structure called an inductive groupoid and inverse semigroups and inductive groupoids are two ways of looking at the same thing. In fact, Ehresmann worked with inductive groupoids rather than inverse semigroups.
Our second categorical description takes its cue from how substructures are represented in a category. This leads to left (or right) cancellative categories and their actions on principal groupoids as a way of constructing arbitrary inverse semigroups. This is described in Section 4. Section 3 forms a bridge between Sections 2 and 4. In it, we describe the extent to which ordered groupoids are related to left cancellative categories. In the case of inverse monoids, this leads to a complete description in terms of categories.

Ordered groupoids
The motivation for this construction is described in Section 2.1 and the main theorem, the Ehresmann-Schein-Nambooripad theorem, is proved in Section 2.3.

2.1.
Motivation. The following result shows how the usual product in an inverse semigroup can be reconstructed from the restricted product and the natural partial order. (1) Let s ∈ S and e an idempotent such that e ≤ s −1 s. Then a = se is the unique element in S such that a ≤ s and a −1 a = e. (2) Let s ∈ S and e an idempotent such that e ≤ ss −1 . Then a = es is the unique element in S such that a ≤ s and aa −1 = e.
(1) From the definition of the natural partial order we have that a ≤ s. Also, a −1 a = (se) −1 se = es −1 se = e. Now let b ≤ s be such that b −1 b = e. Then b = sb −1 b, so that b = se = a.
A function θ : S → T between inverse semigroups is said to be a prehomomorphism if θ(st) ≤ θ(s)θ(t) for all s, t ∈ S. 1 Inverse semigroups and prehomomorphisms form a category that contains the usual category of inverse semigroups and homomorphisms. We can easily construct examples of prehomomorphisms which are not homomorphisms. Let L and M be meet semilattices and let θ : L → M be an order-preserving function. Let e, f ∈ L. Then e ∧ f ≤ e, f and so θ(e ∧ f ) ≤ θ(e), θ(f ) since θ is order-preserving. Thus since M is a meet semilattice. It follows that θ is a prehomomorphism from the inverse semigroup (L, ∧) to the inverse semigroup (M, ∧), but not in general a homomorphism.
Lemma 2.2. Let θ : S → T be a function between inverse semigroups.
(1) θ is a prehomomorphism if, and only if, it preserves the restricted product and the natural partial order. (2) θ is a homomorphism if, and only if, it is a prehomomorphism which satisfies θ(ef ) = θ(e)θ(f ) for all idempotents e, f ∈ S.
Lemma 2.2 implies that every prehomomorphism between inverse semigroups induces a functor between their associated groupoids.
2.2. Inductive groupoids. Let (G, ·) be a groupoid, and let ≤ be a partial order defined on G. Then (G, ·, ≤) is an ordered groupoid if the following axioms hold: (OG1): x ≤ y implies x −1 ≤ y −1 for all x, y ∈ G.
(OG2): For all x, y, u, v ∈ G, if x ≤ y, u ≤ v, ∃xu and ∃yv then xu ≤ yv. (OG3): Let x ∈ G and let e be an identity such that e ≤ d(x).
Then there exists a unique element (x | e), called the restriction of x to e, such that (x | e) ≤ x and d(x | e) = e. (OG3) * : Let x ∈ G and let e be an identity such that e ≤ r(x).
Then there exists a unique element (e | x), called the corestriction of x to e, such that (e | x) ≤ x and r(e | x) = e. An ordered groupoid is said to be inductive if the partially ordered set of identities forms a meet-semilattice. This term was used by Ehresmann to refer to a more restricted class of ordered groupoids than we have defined, but the terminology is now well-established. As we shall see, if the groupoid is actually a group the order degenerates to equality and so ordered groupoids do not generalize ordered groups.
A functor between two ordered groupoids is said to be ordered if it is order-preserving. An ordered functor between two inductive groupoids is said to be inductive if it preserves the meet operation on the set of identities. An isomorphism of ordered groupoids is a bijective ordered functor whose inverse is an ordered functor. Lemma 2.3. Let θ : G → H be an ordered functor between ordered groupoids.
We now establish some of the basic properties of ordered groupoids.
(2) The order ≤ restricted to hom-sets is trivial.
(4) If ∃xy and e is an identity such that e ≤ r(xy) then (5) If z ≤ xy then there exist elements x ′ and y ′ such that ∃x ′ y ′ , x ′ ≤ x, y ′ ≤ y and z = x ′ y ′ . (6) Axiom (OG3) * is a consequence of the axioms (OG1) and (OG3). (7) The set of identities G o is an order ideal of G. Proof.
In particular, d(x) ≤ d(y) and so by axiom (OG3) there is a unique element (y | d(x)) such that But the element x also has the property that x ≤ y and d(x) = d(x). Thus by uniqueness (y | d(x)) = x. However, (y | d(y)) = x since d(x) = d(y). But (y | d(y)) = y. Hence x = y.
Let G be an ordered groupoid and H a subset of G. Then we say that H is an ordered subgroupoid if it is a subgroupoid of G and an ordered groupoid with respect to the induced order. This is equivalent to the condition that H be a subgroupoid of G and that if x ∈ H and e ∈ H o and e ≤ d(x) then (x | e) ∈ H.
Let θ : G → K be an injective ordered functor. The image of θ is a subgroupoid of K, because if θ(x)θ(y) is defined in K then θ(d(x)) = θ(r(y)) and so xy is defined in G; this gives θ(x)θ(y) = θ(xy). However, the image of θ need not be an ordered subgroupoid of K. A stronger notion than an injective ordered functor is what we term an ordered embedding; this is an ordered functor θ : G → K such that for all g, h ∈ G g ≤ h ⇔ θ(g) ≤ θ(h). The image of θ is an ordered subgroupoid of K which is isomorphic to G.
In verifying that a structure is an ordered groupoid, it is sometimes more convenient to use the following characterization. We shall need the following two axioms. Let G be a groupoid and ≤ a partial order defined on G. The axioms (OI) and (OG4) are defined as follows: y ∈ G such that y ≤ x and d(y) = e.
To prove the converse, it is enough to show that axiom (OG3) holds because axiom (OG3) * follows from the other axioms for an ordered groupoid by Lemma 2.4 (6).
2.3. The Ehresmann-Schein-Nambooripad theorem. From our results in Chapter 1 and by Lemma 2.1, we have the following. Proposition 2.6. Let S be an inverse semigroup. Then (S, ·, ≤) is an inductive groupoid.
The inductive groupoid associated with S is denoted by G(S). We now show how to construct an inverse semigroup from an inductive groupoid.
Let G be an ordered groupoid and let x, y ∈ G be such that e = d(x) ∧ r(y) exists. Put and call x ⊗ y the pseudoproduct of x and y. It is immediate from the definition that the pseudoproduct is everywhere defined in an inductive groupoid. The next result provides a neat, order-theoretic way of viewing the pseudoproduct. Lemma 2.7. Let G be an ordered groupoid. For each pair x, y ∈ G put regarded as a subset of the ordered set G × G. Then x ⊗ y exists if, and only if, there is a maximum element (x ′ , y ′ ) of x, y . In which case, Proof. Suppose that x ⊗ y exists. Then e = d(x) ∧ r(y) exists, and ((x | e), (e | y)) ∈ x, y .
Conversely, suppose that the maximum element of x, y exists and equals (x ′ , y ′ ). Put e = d(x ′ ) = r(y ′ ). Clearly, e ≤ d(x), r(y). Now let f be any identity such that f ≤ d(x), r(y). Then Thus ((x | f ), (f | y)) ∈ x, y and so ((x | f ), (f | y)) ≤ (x ′ , y ′ ). Hence f ≤ e, which implies that e = d(x) ∧ r(y). Thus x ⊗ y exists. The proof of the last assertion is now immediate.
It will be an immediate consequence of the following result that the pseudoproduct on an inductive groupoid is associative. Lemma 2.8. Let G be an ordered groupoid. Then for all x, y, z ∈ G if x ⊗ (y ⊗ z) and (x ⊗ y) ⊗ z both exist then they are equal.
If (G, ·, ≤) is an inductive groupoid, then (G, ⊗) will be denoted by S(G). We can now show how to construct an inverse semigroup from an inductive groupoid. Proposition 2.9. Let (G, ·, ≤) be an inductive groupoid.
(3) For any inverse semigroup S we have that S(G(S)) = S. Proof.
(1) By Lemma 2.8, (G, ⊗) is a semigroup. If x, y ∈ G and ∃x · y in the groupoid G then x · y = x ⊗ y. But for each element x ∈ G we have that It is easy to check that the idempotents of (G, ⊗) are precisely the identities of (G, ·). Let e and f be two idempotents of (G, ⊗). Then so that the idempotents commute. It follows that (G, ⊗) is an inverse semigroup.
(2) We show first that the natural partial order on (G, ⊗) is just ≤. Suppose that x = e ⊗ y in (G, ⊗) for some idempotent e. Then x = (e ∧ r(y) | y) and so x ≤ y in (G, ·, ≤). Conversely, suppose that x ≤ y in (G, ·, ≤). Then x = (r(x) | y). But (r(x) | y) = r(x) ⊗ y. Thus x ≤ y in (G, ⊗). Now we turn to the restricted product. The restricted product of x and y is defined in (G, ⊗) precisely when x −1 ⊗x = y⊗y −1 . But from the properties of the pseudoproduct, we have that x −1 ⊗ x = x −1 · x and y ⊗ y −1 = y · y −1 in (G, ·). Thus the restricted product of x and y exists in (G, ⊗) precisely when the product x · y exists in (G, ·). Thus G(S(G, ·, ≤)) = (G, ·, ≤).
(3) The pseudoproduct in G(S) is given by where e = d(s) ∧ r(t) and the product on the right is the restricted product in S. But (s | e) = se and (e | t) = et and e = s −1 stt −1 by Lemma 2.1. Thus s ⊗ t = st. Hence S(G(S)) = S.
Proof. Define a function G from the category of inverse semigroups and prehomomorphisms to the category of inductive groupoids and ordered functors as follows: for each inverse semigroup S we define G(S) = (S, ·, ≤), an inductive groupoid by Proposition 2.6, and if θ : S → T is a prehomomorphism then G(θ) : G(S) → G(T ) is defined to be the same function on the underlying sets; this is an ordered functor by Lemma 2.2. It is easy to check that G defines a functor. Define a function S from the category of inductive groupoids and ordered functors to the category of inverse semigroups and prehomomorphisms as follows: for each inductive groupoid G we define S(G) = (G, ⊗), an inverse semigroup by Proposition 2.9, and if φ : G → H is an ordered functor between inductive groupoids then S(φ) : S(G) → S(H) is defined to be the same function on the underlying sets; this is a prehomomorphism by Lemma 2.2 since it preserves the restricted product of S(G) and the natural partial order. It is easy to check that S is a functor.
By Proposition 2.9, we have that G(S(G, ·, ≤)) = (G, ·, ≤) and S(G(S)) = S. It is now immediate that the category of inverse semigroups and prehomomorphisms is isomorphic to the category of inductive groupoids and ordered functors. By Lemma 2.2 this isomorphism restricts to an isomorphism between the category of inverse semigroups and semigroup homomorphisms and the category of inductive groupoids and inductive functors.
The above theorem can be viewed as a wide-ranging generalization of the result that a commutative idempotent semigroup can also be regarded as a meet semilattice. One of its uses is in proving that a structure suspected of being an inverse semigroup actually is.
As usual in semigroup theory we have the slight annoyance of having to deal with the case of semigroups with and without zero separately. An ordered groupoid is said to be * -inductive if the following condition holds for each pair of identities: if they have a lower bound, they have a greatest lower bound. A * -inductive groupoid gives rise to an inverse semigroup with zero (G 0 , ⊗): adjoin a zero to the set G, and extend the pseudoproduct on G to G 0 in such a way that if s, t ∈ G and s ⊗ t is not defined then put s ⊗ t = 0, and define all products with 0 to be 0. Every inverse semigroup with zero arises in this way.

2.4.
Applications. Ordered groupoids can be viewed as wide-ranging generalizations of inverse semigroups. 'Wide-ranging' because both groupoids and partially ordered sets are examples of ordered groupoids. The category of ordered groupoids provides much more space for working with inverse semigroups. In particular, constructions that lead out of the category of inverse semigroups may actually be possible in the larger category of ordered groupoids. In this section, I shall illustrate this idea.
Let G be an ordered subgroupoid of the ordered groupoid H. We say that H is an enlargement of G if the following three axioms hold: The following is proved in Section 8.3 of [9].
(1) Let p : H → K be an ordered, star injective functor between ordered groupoids. Then there is an ordered groupoid G, an ordered embedding i : H → G, and an ordered covering functor (2) Let j : H → G ′ be any ordered embedding and let p ′′ : G ′ → K be an ordered covering functor such that p ′′ j = p. Then there is a unique ordered functor θ : G → G ′ such that θi = j and The key point of the above theorem is that every star injective ordered functor can be factorized as an enlargement followed by a star bijective ordered functor, and that this can be done in essentially one way. Star bijective or covering functors have pleasant properties, and if an ordered groupoid is an enlargement of another ordered groupoid then it is similar to it in structure.
We shall apply the above theorem to determine the structure of the E-unitary inverse semigroups introduced in Chapter 1. It hinges on two observations. First, in Theorem 2.26, we proved that an inverse semigroup is E-unitary if and only if the natural homomorphism to its maximum group image is star injective; second, in Theorem 3.6 an inverse semigroup is a semidirect product of a semilattice by a group if and only if that selfsame natural map is star bijective.
We begin by defining semidirect products of partially ordered sets by groups. Let G be a group and X a partially ordered set. We suppose that G acts on X by order automorphisms on the left. Define a partial multiplication on X × G by (x, g)(y, h) = (x, gh) if x = g · y and undefined otherwise and define a partial order on X × G by The set X × G equipped with this partial multiplication and partial order is denoted by P (G, X). The following is proved as Theorem 1 of Section 8.1 of [9]. Lemma 2.12. P (G, X) is an ordered groupoid, and the function π 2 : P (G, X) → G defined by π 2 (x, g) = g is a surjective, ordered covering functor.
We say that the ordered groupoid P (G, X) is a semidirect product of a partially ordered set by a group. Such semidirect product ordered groupoids can be characterized abstractly. The proof of the following is Theorem 3 of Section 8.1 of [9]. Proposition 2.13. Let π : Π → G be an ordered covering functor from the ordered groupoid Π onto a group G. Then G acts on the poset X = Π o by order automorphisms, and there is an isomorphism of ordered groupoids θ : Π → P (G, X) such that π 2 θ = π.
The key point of Lemma 2.12 and Proposition 2.13 is that we can recognize when an ordered groupoid is a semidirect product of a partially ordererd set by a group by checking to see if it admits an ordered covering functor onto as group. This is the ordered groupoid version of Theorem 3.6 of Chapter 1. Now let S be an E-unitary inverse semigroup. Then the natural map from S to its maximum group image is star injective. This can be factorized using the maximum enlargment theorem into an enlargement followed by a covering map to a group. It follows that every E-unitary inverse semigroup has an enlargement which is a semidirect product of a partially ordered set and a group. For the full proof of the following see Theorem 4 of Section 8.1 of [9]. Theorem 2.14. Let S be an inverse semigroup with associated inductive groupoid G(S). Then S is E-unitary if, and only if, there is an ordered embedding ι : G(S) → P (G, X) into some semidirect product of a poset by a group such that P (G, X) is an enlargement of ι(G(S)) in such a way that the function π 2 : P (G, X) → G restricted to ι(G(S)) is surjective.
The above result characterizes E-unitary inverse semigroups in terms of semidirect products, but not of semilattices by groups as might be expected but of partially ordered sets by groups. The disadvantage of the above result is that the structure of E-unitary inverse semigroups is described using ordered groupoids. However, the information contained in the theorem can be couched in purely semigroup-theoretic language.
To do this we need the following classical definition.
Let G be a group and X a partially ordered set. We shall suppose that G acts on X on the left by order automorphisms. We denote the action of g ∈ G on x ∈ X by g · x. Let Y be a subset of X partially ordered by the induced ordering. We say that (G, X, Y ) is a McAlister triple if the following three axioms hold: (MT1): Y is an order ideal of X and a meet semilattice under the induced ordering.
Let (G, X, Y ) be a McAlister triple. Put But Y is an order ideal of X and so (gh Define a product on P (G, X, Y ) by It is well-defined by the above lemma.
A proof of the following is Theorem 9 of Section 7.2 of [9].
with semilattice of idempotents isomorphic to Y and maximum group homomorphic image isomorphic to G.
If we combine Theorem 2.4 with Proposition 2.16, we get the following first proved by Don McAlister.
Theorem 2.17 (The P -theorem). An inverse semigroup is E-unitary if and only if it is isomorphic to a P -semigroup.

Ordered groupoids and left/right cancellative categories
This section is a bridge between the inductive groupoid approach to studying inverse semigroups described in Section 2 and the category action approach that we describe in Section 4. Our goal is to show the extent to which ordered groupoids are related to left (respectively, right) cancellative categories. The motivation for this section comes from the category-theoretic definition of a subobject.
3.1. From left cancellative categories to ordered groupoids. A left cancellative category is a category in which xy = xz implies y = z. It is therefore precisely a category of monomorphisms. We define a right cancellative category dually, and a cancellative category is one which is both left and right cancellative. A left (respectively, right) cancellative category with one identity is a left (respectively, right) cancellative monoid. If C is a subcategory of D, we say that it is is full, faithful and essentially surjective; the first two conditions mean that the restriction F : hom(e, f ) → hom(F (e), F (f )) is surjective and injective respectively for all identities e, f ∈ C o , and the last condition means that each identity in D is isomorphic to the image of an identity under F .
We now define two categories of structures, the relationship between them being the subject of this section.
LC: The category of left cancellative categories and their functors. OG: The category of ordered groupoids and ordered functors. We shall construct functors G : LC → OG and L : OG → LC, and describe their composites GL and LG.
Let C be a left cancellative category. We shall construct an ordered groupoid G(C) from C. Put Define a relation ∼ on U as follows: Then ∼ is an equivalence relation on U. Denote the equivalence class containing (a, b) by [a, b], and the set of equivalence classes by G(C). Define Then there exists an isomorphism u in C such that b = cu. In this case, define the partial product The picture below illustrates why: We shall usually denote the partial product by concatenation. Define a relation ≤ on G(C) by This is well-defined and is a partial order.
If θ : C → D is a functor between two left cancellative categories, define the function G(θ) : Proposition 3.1. Let C be a left cancellative category. Then G(C) is an ordered groupoid, and G is a functor from LC to OG.
Proof. The set (G(C), ·) equipped with the partial binary operation defined above is a groupoid in which the set of identities is To show that (G(C), ·, ≤) is an ordered groupoid, we verify that the axioms (OG1)-(OG3) hold. It is immediate that (OG1) holds, and the proof of (OG2) is easy by left cancellativity. We now prove that both (OG3) and (OG3) * hold.
It is easy to check that this is a well-defined restriction whose uniqueness is a consequence of left cancellativity.
It is easy to check that this is a well-defined corestriction, which is likewise unique. It follows that G(C) is an ordered groupoid.
If θ : C → D is a functor between left cancellative categories, then G(θ) is an ordered functor from G(C) to G(D). The proof that G is a functor is also straightforward.
It is useful to know when the pseudoproduct of two elements of G(C) exists.
Lemma 3.2. Let C be a left cancellative category, and G(C) its associated ordered groupoid. In diagrammatic terms this is just: (2) This follows immediately from the proof of (1).
Ordered groupoids of the form G(C) have extra properties. Let G be an ordered groupoid. We say that G has maximal identities if there is a function G o → G o , denoted by e → e • , that has the following two properties: Observe that e • really is a maximal identity, for if e • ≤ f , where f is an identity, then e • ≤ f ≤ f • by (MI1). But then by (MI2), we have that e • = f • , and so e • = f . We define the relation D on an ordered groupoid G by g D h iff they are in the same connected component of the groupoid G. It is immediate that D is an equivalence relation on G. We have shown how to construct an ordered groupoid G(C) from a left cancellative category. It is likewise possible to construct an ordered groupoid G ′ (C) from a right cancellative category C. Just as the construction of G(C) is a generalization of the construction of subobjects, so the construction of G ′ (C) is a generalization of quotient objects. The set U ′ is defined to consist of those pairs of elements (a, b) of C such that r(a) = r(b). The equivalence relation ∼ is defined by for some isomorphism u. We define G ′ (C) to consist of ∼-equivalence classes. The following is immediate Proposition 3.4. Let C be a right cancellative category. Then G ′ (C) is an ordered groupoid with maximal identities. In addition, each Dclass contains a maximal identity.

From ordered groupoids to left cancellative categories.
Let G be an ordered groupoid. Define ) and r(e, x) = (e, e) and define a partial product on L(G) as follows: if d(e, x) = r(f, y) then (e, x)(f, y) = (e, x ⊗ y), otherwise it is undefined. If θ : G → H is an ordered functor between two ordered groupoids, define L(θ) : L(G) → L(H) by L(θ)(e, x) = (θ(e), θ(x)). Since r(x) ≤ e and θ is an order-preserving functor, we have that θ(r(x)) = r(θ(x)) and r(θ(x)) ≤ θ(e). Thus L(θ)(e, x) is an element of L(G), and so L(θ) is a well-defined function. Proof. We regard the element (e, x) in diagrammatic terms as follows The dotted line indicates the natural partial order. The fact that d(e, x) = r(f, y) means, in diagrammatic terms, that we have Thus using the restriction we can construct the following y y t t t t t t t t t t r(x | r(y)) But (x | r(y))y = x⊗y. It is now evident that L(G) is a category whose set of identities is : e ∈ C o }. We prove that it is left cancellative. Suppose that (e, x)(f, y) = (e, x)(f, z).
The proof that L(θ) is a functor follows from the fact that if θ : G → H is an ordered functor and e ≤ d(x), then θ(e) ≤ d(θ(x)) and so θ(x | e) = (θ(x) | θ(e)). Consequently L is a functor.
It is easy to check that the inverse of (r(x), x) is (r(x −1 ), x −1 ), and that only elements of the form (r(x), x) are invertible. The function from G to L(G) defined by x → (r(x), x) induces an isomorphism between G and the groupoid of invertible elements of L(G).
We may also construct a right cancellative category from an ordered groupoid. Let Define d(x, e) = (e, e) and r(x, e) = (r(x), r(x)) and define a partial product on R(G) as follows: if d(x, e) = r(y, f ) then (x, e)(y, f ) = (x ⊗ y, f ), else it is undefined. Proposition 3.6. Let G be an ordered groupoid. Then R(G) is a right cancellative category, and L(G) op is isomorphic to R(G).
Proof. It is easy to check that R(G) is a category. We now prove that L(G) op is isomorphic to R(G). Define a function θ : L(G) op → R(G) by θ(e, x) op = (x −1 , e). It is immediate that this function is bijective and maps identities to identities. Suppose that (f, y) op (e, x) op is defined in L(G) op . By definition  Thus θ is an isomorphism from L(G) op to R(G).

Forward and back.
We shall now describe the relationship between LG(C) and C, and between GL(G) and G. Our first theorem tells us that up to equivalence every left cancellative category can be constructed from an ordered groupoid. Then ι is an injective functor which embeds C in C ′ as a full, isomorphismdense subcategory. In particular, C and LG(C) are equivalent categories.
Proof. Identities of C ′ have the form ([z, z], [z, z]) where z ∈ C. Thus ι maps identities to identities. Suppose that ab is defined in C. Then ι(a)ι(b) is defined in C ′ . From the fact that  We shall now describe the relationship between G and GL(G). This is not as satisfactory and explains why we cannot put ordered groupoids and left cancellative categories on a par.
The ordered groupoid GL(G) is a somewhat complicated object, so to help us see what is going on, we construct an isomorphic copy that is easier to understand.
Let G be an ordered groupoid. Define G as follows: Observe that if f ≤ e where e, f ∈ G o , then d( e, f, f ) = f, f, f and r( e, f, f ) = e, f, e . Lemma 3.8. Let G be an ordered groupoid. Then G is an ordered groupoid with maximal identities in which each D-class contains a maximal identity. The map κ : G → G is an ordered functor that is orderreflecting.
The connection with GL(G) is described in the following result.  Then there is an invertible element (d(x), x) in L(G) such that . It follows that f = f ′ and x = d(w). Thus (d(x), x) is an identity and so (e, w) = (e ′ , w ′ ) and (f, d(w)) = (f ′ , d(w ′ )). It follows that e = e ′ , f = f ′ and w = w ′ . Define Then the two results above show that α is a bijection. We shall prove that it is an isomorphism of ordered groupoids.
Suppose that e, x, f ≤ e, x ′ , f . Then Thus α( e, x, f ) ≤ α( e, x ′ f ), and so α is order-preserving. Suppose that α( e, x, f ) ≤ α( e ′ , x ′ , f ′ ). Then there is an element (i, a) ∈ L(G) such that It readily follows from this that e = e ′ , f = f ′ and x ≤ x ′ . Hence e, x, f ≤ e ′ , x ′ , f ′ . We have therefore proved that α is an order isomorphism. It remains to show that α is a functor. It is easy to check that α maps identities to identities. Suppose that f, x, e e, y, i is defined in G. By definition Observe that (e, d(x)) = (e, y)(d(y), y −1 ) where (d(y), y −1 ) is invertible. It follows that α( f, x, e )α( e, y, i ) is defined in G ′ and is equal to making use of the isomorphism (d(x), y). Thus α is a functor.
To get a sharper connection betweeen G and G we need to assume more about G. Proposition 3.10. Let G be an ordered groupoid with maximal identities in which each D-class contains a maximal identity. Then G is an enlargement of G.
Proof. Define π : G → G by π(g) = (r(g) • , g, d(g) • ). Then π is an ordered embedding and G is an enlargement of the image of π.
3.4. Rooted categories. The results we have obtained so far on ordered groupoids and left cancellative categories show that we almost have a correspondence between them. But to get sharper results, we need to restrict the class of left cancellative categories we consider and correspondingly the class of ordered groupoids. In both cases, we need an 'anchor'.
A weak terminal identity in a category is an identity 1 with the property that for each identity e there is an arrow from e to 1. Proposition 3.13. Let G be an ordered groupoid with maximum identity 1. Then G is isomorphic to G 1 (L(G)).
Proof. From the proof of Proposition 3.10, the function π : G →Ḡ defined by π(x) = 1, x, 1 is a well-defined, injective ordered functor since here e • = 1 for each identity e in G. In addition, G is isomorphic to π(G). Under the isomorphism α : G → GL(G) of Proposition 3.9, we have that απ is contained in G 1 L(G). Let [(1, x), (1, y)] be an arbitrary element of It follows that G is isomorphic to G 1 (L(G)).
We now cast the above results into a more usable form. A left cancellative category C with a weak terminal identity 1 is called a left rooted category. Put Observe that both a and b have codomain 1. Define a relation ∼ on U by Then ∼ is an equivalence relation on U. Denote the equivalence class containing (a, b) by [a, b], and the set of equivalence classes by G l (C). We may think of [a, b] as modelling a partial bijection with domain of definition described by [b, b] and with range described by [a, a] both of these being subobjects of 1. Define Then there exists an isomorphism u in C such that b = cu. In this case, define the partial product This is well-defined and is a partial order. In this way, G l (C) is an ordered groupoid with a maximum identity. Let C and D be two left rooted categories with weak terminal identities 1 C and 1 D respectively. Let θ : C → D be an equivalence of categories such that F (1 C ) = 1 D . Then the function G l (θ) : is an isomorphism of ordered groupoids with maximum identities.
We shall say that a left rooted category has all allowable pullbacks if whenever a and b are elements of C such that r(a) = r(b) and that can be completed to a commutative square aa ′ = bb ′ for some elements a ′ and b ′ , then a and b have a pullback. It is worth noting that it is enough to assume this condition for those pairs a and b where in addition r(a) = r(b). In this case, G l (C) is * -inductive and so when we adjoin a zero we get an inverse monoid with zero. The ordered groupoid G l (C) is inductive when C has all pullbacks.
If S is an inverse monoid with zero, we denote by L(S) the left rooted category of the ordered groupoid of non-zero elements of S, its right rooted category, denoted by R(S), is defined similarly. We therefore have the following theorem with which is associated an evident dual theorem referring to right Leech categories. Theorem 3.14.
(1) Let G be an ordered groupoid with a maximum identity. Then L(G) is a left rooted category and G l (L(G)) is isomorphic to G.
(2) Let C be a left rooted category. Then G l (C) is an ordered groupoid with a maximum identity and L(G l (C)) is a left rooted category equivalent to C. There is now an obvious question which has a familiar answer. and so by right cancellation s = s −1 s, an idempotent as required.
Conversely, suppose that S is E-unitary. We prove that L(S) is right cancellative. Let (e, s)(f, u) = (e, t)(f, u). Then su = tu. It follows that s −1 suu −1 = s −1 tuu −1 and so s −1 t is an idempotent using the fact that S is E-unitary. Similarly st −1 is an idempotent. Hence s and t are compatible but also s −1 s = t −1 t. Thus by Lemma 2.24, we have that s = t as required.
It is interesting to consider what happens in the case when the inverse monoid is 0-bisimple because we can then replace categories by monoids. Let S be 0-bisimple. Put L 1 = {s ∈ S : s −1 s = 1}. Then L 1 is a left cancellative monoid. It is isomorphic to the local monoid at the identity (1, 1) in the left rooted category L(S) and under our assumption on S is actually equivalent to it. We therefore have the following.
Theorem 3.16. Each 0-bisimple inverse monoid with zero is determined by a left cancellative monoid with the property that any two principal right ideals are either disjoint or their intersection is again a principal right ideal.
Remark 3.17. What we have proved in this section for inverse monoids can also be generalized to inverse categories

Affine systems
Inverse monoids and, more generally, ordered groupoids with maximum identities can be described by means of suitable left cancellative categories equipped with weak terminal identities or by means of suitable right cancellative categories equipped with weak initial identities. The problem now is describing arbitrary inverse semigroups or, more generally, arbitrary ordered groupoids. The solution is similar to what happens when we want to replace vector spaces, which have a distinguished origin, with affine spaces which don't: we have to work with actions. In our case, and choosing sides, we work with (right cancellative) categories acting on the left on principal groupoids, the groupoids arising from equivalence relations. We shall see that our earlier description of inverse monoids or ordered groupoids with maximum identities is a special case. In outline, we do the following • A category C acts on a principal groupoid H on the left.
• This action induces a preorder on H whose associated equivalence relation is ≡. • The quotient structure H/ ≡ is a groupoid on which the preorder induces an order. • The groupoid H/ ≡ is ordered and every ordered groupoid is isomorphic to one constructed in this way.

4.1.
From category actions to ordered groupoids. Before I give the formal definition, I want to motivate it by reconsidering how we defined an ordered groupoid with identity from a right cancellative category C with a weak initial identity 1. Incidently, the shift from left to right rooted categories is simply a consequence of the fact that I shall work with left actions below. Form the set of ordered pairs We may define a partial action of C on U by defining c · (a, b) = (ca, cb) only when d(c) = r(a). If we define π(a, b) = r(a) then we can rewrite the condition for the action of c on (a, b) to be defined by d (a) = π(a, b).
What is U? It is the groupoid corresponding to an equivalence relation defined on the set C1: namely a and b are related if and only if r(a) = r(b). Suppose that (a, b) = c(a ′ , b ′ ) and (a ′ , b ′ ) = d (a, b). Then because C is right cancellative, the elements c and d are mutually invertible. It follows that (a, b) ∼ (a ′ , b ′ ). Thus the action of C on U can be used to construct the elements of the ordered groupoid G r (C). In order to define U in this case we needed a weak initial identity, but the same construction would go through if we started with the pair (G, U). By axiomatizing the properties of such pairs leads to the construction of ordered groupoids from categories acting on principal groupoids which we now describe. Let C be a category and G a groupoid. Let π : G → C o be a function to the set of identities of C. Define We say that C acts on G if there is a function from C * G to G, denoted by (a, x) → a · x, which satisfies the axioms (A1)-(A6) below. Note that I write ∃a · x to mean that (a, x) ∈ C * G. I shall also use ∃ to denote the existence of products in the categories C and G.
We write (C, G) to indicate the fact that C acts on G. If C acts on G and x ∈ G define Define x y in G iff there exists a ∈ C such that x = a · y. The relation is a preorder on G. Let ≡ be the associated equivalence: x ≡ y iff x y and y x. Observe that x y iff C · x ⊆ C · y. Thus x ≡ y iff C · x = C · y. Denote the ≡-equivalence class containing x by  (1) Axioms (A1), (A2) and (A3) are the usual axioms for the action of a category on a set. (2) If x ≡ y then d(x) ≡ d(y) and r(x) ≡ r(y) by axiom (A4).
Thus ∃e · x and so by axiom (A4), we also have that ∃e · d(x) and ∃e · r(x). Thus d(x), r(x) ∈ G e . Also ∃d(x) means that e · (x −1 x) and so by axiom (A6), we have that ∃e · x −1 and so x −1 ∈ G e . By axiom (A5), if x, y ∈ G e and xy is defined then xy ∈ G e . It follows that G e is a subgroupoid of G, and by axiom (A4) it must be a union of connected components of G. If x is an identity in G and ∃a · x then a · x is an identity in G. This follows by (A4), since d(a · x) = a · d(x) = a · x. Combining this with axiom (A6), we see that if f a ←− e in C, then the function x → a · x from G e to G f is a functor.
We shall be interested in actions of categories C on groupoids G that satisfy two further conditions: . Condition (A7) is to be expected; condition (A8) will make everything work, as will soon become clear. The axioms (A7) and (A8) together imply that if d(a · x) = d(b · x) then a · x = b · x.
Theorem 4.2. Let C be a category acting on the groupoid G, and suppose in addition that both (A7) and (A8) hold. Then (1) J(C, G) is an ordered groupoid.
(2) J(C, G) is * -inductive iff for all identities e, f ∈ G we have that C · e ∩ C · f non-empty implies there exists an identity i such that C · e ∩ C · f = C · i. . Then d(x) ≡ r(y). There exist elements a, b ∈ C such that d(x) = a · r(y) and r(y) = b · d(x). Thus by (A3) and (A4), we have that r(b · (a · y)) = r(y).
2 Strictly speaking, I should write d([x]) but I shall omit the outer pair of brackets.
By (A7), this means that y = b · (a · y). Hence y ≡ a · y and ∃x(a · y), as required. The converse follows by Remarks 4.1 (2).
We define a partial product on J(C, G) and there exist s, t, u, v ∈ C such that y ′ = s · y, y = t · y ′ , y ′′ = u · y, y = v · y ′′ .
Thus . Then x = a · y. By axiom (A4), we have that d(x) = a · d(y). Thus x −1 x = a · (y −1 y). By axiom (A6), x −1 x = (a · y −1 )(a · y). Similarly xx −1 = (a · y)(a · y −1 ). But G is a principal groupoid and so x −1 = (a · y −1 ) and so [ ] so that there exist a, b ∈ C such that x ′ = a · y ′ and u ′ = b · v ′ . We need to show that x ′ u ′ y ′ v ′ . Now d(x ′ ) = r(u ′ ) and so a · d(y ′ ) = b · r(v ′ ). But d(y ′ ) = r(v ′ ). Thus By (A8), we therefore have that r(a · y ′ ) = r(b · y ′ ), and so a · y ′ = b · y ′ by (A7). Thus . Now ∃y ′ v ′ and so by (A5) and (A6) we have that (b·y ′ )(b·v ′ ) = b·(y ′ v ′ ). Thus Then y = b · x for some b ∈ C and d(y) ≡ e. Because of the latter, there exists c ∈ C such that e = c · d(y). Thus e = (cb) · d(x). But e = a·d(x) and so (cb)·d(x) = a·d(x). By (A7) and (A8), we therefore have that c · y = a · x. It follows that we have shown that a · x y. From d(y) ≡ e, there exists d ∈ C such that d(y) = d · e. Using (A7) and (A8), we can show that y = d · (a · x), and so y a · x. We have therefore proved that y ≡ a · x. Hence [y] = [a · x], as required.
(OG3) * holds: although this axiom follows from the others, we shall need an explicit description of the corestriction. Let [e] ≤ r[x] where e ∈ G o . Then e r(x) and so e = b · r(x) for some b ∈ C. Now ∃b · x by (A4). Define The proof that this has the required properties is similar to the one above.
(2) We now turn to the properties of the pseudoproduct in J(C, G).

Let [e], [f ] be a pair of identities in J(C, G). It is immediate from the definition of the partial order that [e] and [f ] have a lower bound iff
It will be useful to have a description of the pseudoproduct itself. If C · i = C · e ∩ C · f then denote by e * f and f * e elements of C, not necessarily unique, such that The condition that if C · e ∩ C · f is non-empty, where e and f are identities, then there exists an identity i such that C ·e∩C ·f = C ·i will be called the orbit condition for the pair (C, G). Part (2) of Theorem 4.1 can therefore be stated thus: J(C, G) is * -inductive iff (C, G) satisfies the orbit condition.

4.2.
Universality of the construction. In this section, I shall show that every ordered groupoid is isomorphic to one of the form J(C, H) for some action of a category C on a principal groupoid H.
Let G be an ordered groupoid. There are three ingredients needed to construct J(C, H): a category, which I shall denote by R(G), a principal groupoid, which I shall denote by R(G), and a suitable action of the former on the latter. We define these as follows: • We define the category R(G) as in Section 3 as follows: an element of R(G) is an ordered pair (x, e) where (x, e) ∈ G × G o and d(x) ≤ e. We define a partial product on R(G) as follows: if (x, e), (y, f ) ∈ R(G) and e = r(y) then (x, e)(y, f ) = (x ⊗ y, f ). Thus R(G) is a right cancellative category with identities (e, e) ∈ G o × G o . • We define the groupoid R(G) as follows: its elements are pairs (x, y) where r(x) = r(y). Define d(x, y) = (y, y) and r(x, y) = (x, x). The partial product is defined by (x, y)(y, z) = (x, z). Evidently, R(G) is the groupoid associated with the equivalence relation that relates x and y iff r(x) = r(y). • We shall now define what will turn out to be an action of R(G) on R(G). Define π : R(G) → R(G) o by π(x, y) = (r(x), r(y)), a well-defined function. Define (g, e) · (x, y) = (g ⊗ x, g ⊗ y) iff e = r(x) = r(y). This is a well-defined function from R(G) * R(G) to R(G). Then s ⊗ x = t ⊗ x. The groupoid product x −1 y is defined, and the two ways of calculating the pseudoproduct of the triple (s, x, x −1 y) are defined, and the two ways of calculating the pseudoproduct of the triple (t, x, x −1 y) are defined. It follows that s ⊗ y = t ⊗ y; that is, The converse is proved similarly.
The next theorem establishes what we would hope to be true is true.
Theorem 4.4. Let G be an ordered groupoid. Then J(R(G), R(G)) is isomorphic to G.
Theorem 4.4 tells us that ordered groupoids can be constructed from pairs (C, G) satisfying some additional conditions. First, we may assume that C is right cancellative. Second, π : G → C o is a surjective map. Third if a · x = b · x then a = b; we call this the right cancellation condition. A pair satisfying these three additional condition is called an affine system and are the big sisters to the RP-systems of classical semigroup theory [23,29]. In an affine system, the equivalence relation ≡ is determined by the isomorphisms in C; for suppose that y = a · x and x = b · y then y = (ab) · y and x = (ba) · x and so by the right cancellation condition a is invertible with inverse b.

4.3.
Morphisms between affine systems. Let (C, G) and (D, H) be affine systems. A morphism from (C, G) to (D, H) is a pair α = (α 1 , α 2 ) where α 1 : C → D and α 2 : G → H are functors such that if a · x is defined then α 1 (a) · α 2 (x) is defined and α 2 (a · x) = α 1 (a) · α 2 (x). Proof. Observe that if x y then α 2 (x) α 2 (y). Thus the function α is well-defined. Since α 2 is a functorᾱ maps identities to identities. Suppose that [x][y] is defined in J(C, G). Then there exist x ′ ≡ x and y ′ ≡ y such that x ′ y ′ is defined in G. Thus α 2 (x)α 2 (y) is defined in H. We have that which is justᾱ[x]ᾱ[y]. Thusᾱ is a functor and it is an ordered by our first observation.
pairs (s, t) such that s and t are both non-zero and ss −1 = tt −1 . By Theorem 4.4, the ordered groupoid S * is isomorphic to J(R, R). Thus the inverse semigroup S is isomorphic to J(R, R) 0 equipped with the pseudoproduct. We may summarize these results as follows.
Theorem 4.9. Every inverse semigroup with zero S is determined upto isomorphism by three ingredients: the right cancellative category R(S * ), Green's R-relation on the non-zero elements, and the action of the category on the groupoid determined by Green's R-relation.
One obvious question is how categories acting on principal groupoids arise. We now describe one example. Let (C, X) be a pair consisting of a category C acting on a set X where we denote by π : X → C o the function used in defining the action. Define the relation R * on the set X as follows: x R * y iff π(x) = π(y) and for all a, b ∈ C we have that, when defined, Observe that R * is an equivalence relation on the set X. In addition, x R * y implies that c · x R * c · y for all c ∈ C where c · x and c · y are defined. Consequently, we get a principal groupoid G(C, X) = {(x, y) : x R * y}.
Define π ′ : G(C, X) → C o by π ′ (x, y) = π(x), and define an action of C on G(C, X) by a · (x, y) = (a · x, a · y) when d(a) = π ′ (x, y). It is easy to check that axioms (A1)-(A8) hold. We may therefore construct an ordered groupoid from the pair (C, G(C, X)). This is identical to the ordered groupoid constructed in [10] directly from the pair (C, X).
Constructing inverse semigroups from rooted categories and affine systems has practical applications. One can try to relate the categorical properties of the rooted category to the algebraic properties of the inverse monoid [21]. It also leads to the perspective that inverse semigroup theory can be viewed not just as the abstract theory of partial bijections but also the abstract theory of bijections between quotients [4,5]. The theory restricted to a class of 0-bisimple inverse monoids allows self-similar group actions [26] to be described in terms of a class of inverse semigroups [17]. Graph inverse semigroups can be constructed from free categories [10]. Such inverse semigroups are important in the theory of C * -algebras [28]. Finally, general affine systems [16] can be used to better understand the nature of the inverse semigroups that Dehornoy first constructed [2].

Notes on Chapter 2
The theory described in Section 2 originates in Ehresmann's work [3] and was first developed within inverse semigroup by Boris Schein [30] and then successfully generalized to arbitrary regular semigroups by Nambooripad [25]. The maximum enlargement theorem comes under scrutiny in [31] and [12]. I wrote extensively about the ordered groupoid approach to inverse semigroup theory in my book [9] so I will say no more here.
The origins of Section 3 go right back to the beginnings of inverse semigroup theory. Clifford [1] showed how to describe inverse monoids in terms of left cancellative monoids. The realization that this could be generalized to arbitrary inverse monoids by replacing left cancellative monoids by left cancellative categories is due to Leech [20] who gives duw credit to Logananthan's trail-blazing paper [22] on how category theory can be applied to semigroup theory; Loganathan showed that the cohomology of an inverse semigroup, introduced by Lausch [8], was the same as the cohomology of the associated left rooted category.
The extension of Clifford's original construction to 0-bisimple inverse monoids is due to Reilly [29] and McAlister [23]. The routine extension of Leech's construction to inverse monoids with zero may be found in [11]. Note that the fact that this paper is labelled 'I' and that the references refer to two further papers by the same author labelled 'II' and 'III' can safely be ignored. The more general results on ordered groupoids were proved in [14] and [19]. In Section 2.4, I described how ordered groupoids could be used to find a structural description of E-unitary inverse semigroups. In [7], the authors show how the left rooted category associated with an E-unitary inverse monoid has a groupoid of fractions from which a proof of the P -theorem can also be deduced. There are almost as many proofs of the P -theorem as there are semigroup theorists and a survey of some of them can be found in [18]. Chapter X of Petrich [27] contains much more on the theory of bisimple inverse monoids. Section 4 arises as unfinished business from Section 3. We know how to construct inverse monoids with zero from left rooted categories but the question remains of how to deal with the semigroup case.
McAlister [23] and Reilly [29] discovered how to deal with bsimple inverse smeigroups and 0-bisimple inverse semigroups by using what were called RP-systems and generalized RP-systems. As a result of reading a paper by Girard on linear logic [6], I was led to the construction described in [10], which shows how inverse semigroups can be constructed from categories acting on sets. Claas Röver pointed out to me that the paper by Dehornoy [2]. Dehornoy constructs an inverse semigroup from any variety, in the sense of universal algebra, that is described by equations which are balanced, meaning that the same variables occur on either side of the equation. This construction was clearly related to the construction in [10] and an analysis of the connections between the two that led to [15] and the affine systems described in this section. This raises the obvious question: what have inverse semigroups got to do with linear logic?