Cohomology of Presheaves of Monoids

: The purpose of this work is to extend Leech cohomology for monoids (and so Eilenberg-Mac Lane cohomology of groups) to presheaves of monoids on an arbitrary small category. The main result states and proves a cohomological classiﬁcation of monoidal prestacks on a category with values in groupoids with abelian isotropy groups. The paper also includes a cohomological classiﬁcation for extensions of presheaves of monoids, which is useful to the study of H -extensions of presheaves of regular monoids. The results apply directly in several settings such as presheaves of monoids on a topological space, simplicial monoids, presheaves of simplicial monoids on a topological space, monoids or simplicial monoids on which a ﬁxed monoid or group acts, and so forth.


Introduction And Summary
This work grew out of the problem of stating a precise classification theorem for prestacks [1] on a small category C with values in the 2-category of monoidal abelian groupoids, that is, of tensor groupoids whose isotropy groups are abelian. The non-fibered case, that is, when C is the final category, was treated recently in [2], where it is shown how monoidal abelian groupoids are classified by elements of Leech third cohomology groups of monoids H 3 (M, A) [3,4]. In that classification process, for each monoidal abelian groupoid, M is its monoid of connected components, with multiplication induced by the tensor product, the coefficients A are provided by its automorphism groups, and the classifying datum c ∈ H 3 (M, A) is the cohomology class of a certain 3-cocycle canonically constructed from its structure associativity constraint. For categorical groups (also known as Gr-categories), that is, monoidal groupoids where the objects are quasi-invertible, that cohomological classification goes back to that given by Sinh in [5], where she proved that categorical groups are classified by the elements of the third Eilenberg-Mac Lane cohomology groups. When C is an arbitrary small category, every prestack on C valued in monoidal abelian groupoids produces, by taking connected components, not a monoid as in the punctual case but rather a presheaf on C with values in the category Mon of monoids. Then, we were naturally led to a research for an adequate cohomology theory for presheaves of monoids M : C op → Mon. Here, we provide a proposal for such a cohomology theory, which enjoys desirable properties whose study the paper is dedicated to.
Presheaves on small categories are rather familiar objects and arise in many situations. The cohomology of presheaves of several algebraic structures (groups, rings, etc.) has been object of study with interest along the last decades. Particularly, we should refer here to the seminal work by Gerstenhaber-Shack (in deformation theory) on cohomology of presheaves of algebras (e.g., associative or Lie) [6][7][8], which greatly inspires part of this paper on cohomology of presheaves of monoids. Also, our exposition is strongly influenced by several papers on cohomology of diagrams of simplicial sets (in equivariant homotopy theory). Particularly we should refer those by Dwayer-Kan [9,10], Moerdijk-Svensson [11,12], and Blanc-Johnson-Turner [13]. Notice that, when each monoid is replaced where Z is the constant D(M)-module given by the abelian group of integers. For the second one, which following to Gerstenhaber and Shack [7] we call the simple cohomology theory, we previously When C is the final category, then a presheaf of monoids M on C is simply a monoid and the H n (M, −) above are just the cohomology functors of the monoid M by Leech [3,4]. Furthermore, in this case, there are natural isomorphisms H n (M, −) ∼ = H n s (M, −) for all n ≥ 2, so that both cohomology theories are essentially the same. However, in general the H n (M, −) are different of the simples ones H n s (M, −). For instance, when C = G is a group (regarded as an one-object category) and M = H is a right G-group, then D(M) = H G, the semidirect product group, and the cohomology functors H n (M, −) agree with the ordinary Eilenberg-Mac Lane cohomology functors H n (H G, −), whereas the functors H n s (M, −) agree with the vector cohomology groups H n n−1 (G, H; −) by Whitehead [17]. A main result in this paper states that, for any presheaf of monoids M on a small category C, there is a natural long exact sequence for any D(M)-module A, connecting the cohomology groups of M in both theories with those of the category C with coefficients in the right module obtained by restricting the coefficients A to C op through its natural inclusion into D(M).
Following general methods by Gerstenhaber-Schack and Gabriel-Zisman, we define, for every presheaf M and any D(M)-module A, cochain complexes of abelian groups C • (M, A) and C • s (M, A) such that there are natural isomorphisms H n (M, A) ∼ = H n C • (M, A) ∼ = H n (hocolim NM, A), (n ≥ 0).
When the category C op is cohomologically trivial, for instance whenever C has a final object, we deduce the existence of natural isomorphisms These isomorphisms hold then in several relevant cases we have in mind, as for example when between the set of equivalence classes of extensions (aka coextensions) of M by A and the second simple cohomology group of M with coefficients in A. This classification result is showed to be useful in the study of the structure of H-extensions of M with abelian kernel, that is, locally surjective morphisms of presheaves of monoids f : E → M such that, for any objet U of C, the congruence kernel of f U : E (U) → M(U) is contained in the Green's relation H of E (U) and the Shützenberger groups of the kernel classes are abelian. Following to Grillet [18] and Leech [3], we introduce a certain full subcategory of D(M)-Mod, which we call the category of D(M)-modules, and we prove that when the presheaf of monoids M is locally regular then equivalence classes of H-extensions of M with abelian kernel correspond bijectively to the elements of H 2 s (M, A). Our results on the classification of prestacks on a small category C, that is, of contravariant pseudo-functors from C to the 2-category of monoidal abelian groupoids, by the third simple cohomology groups of presheaves of monoids on C, can be summarized as follows: (i) If M is a presheaf of monoids on C and A is D(M)-module, every simple 3-cocycle h ∈ Z 3 s (M, A) gives rise to a prestack P(M, A, h).
Thus, prestacks on C are classified by triples (M, A, c) where M is a presheaf of monoids on C, A is a D(M)-module, and c ∈ H 3 s (M, A).

Organization of The Paper
The plan of the paper is, briefly, as follows. After the first introductory and summary section, the rest is organized in nine sections. Section 2 is preparatory and comprises some notations and a review on cohomology of small categories. In Section 3 we analyze the coefficients we use for the cohomology of presheaves of monoids. Section 4 is dedicated to the notion of derivation of presheaves of monoids. The main Section 5 includes the definition of the cohomology groups H n (M, A) and H n s (M, A) and a first study of their properties. In particular, we state here the above mentioned linking long exact sequences. The following Sections 6 and 7 are dedicated to cochains, cocycles, and coboundaries. We provide in Section 6 of suitable cochain complexes C • (M, A) and C • s (M, A) for computing the cohomology groups H n (M, A) and H n s (M, A), and in the brief Section 7 we specify, for future reference, what low dimensional simple cochains, cocycles, and coboundaries are. Section 8 is mainly devoted to state the classification of extensions of presheaves of monoids by means of the groups H 2 s (M, A), while the long Section 9 is entirely dedicated to show the classification of prestacks by means of the cohomology groups H 3 s (M, A). In the last Section 10, we analyze how our previous results specialize when we focus on presheaves of groups.

Preliminaries on the Cohomology of Small Categories
Let K be a small category. A (left) K-module is a functor A : K → Ab. The category of K-modules, with morphisms the natural transformations, is denoted by K-Mod. We make reference to [19] (Chapter VIII, §3) for formalities but point out that this is an abelian category with sufficiently many projective and injective objects. For any two K-modules A and A , the abelian group structure of Hom K (A, A ) is given by pointwise addition. The zero K-module is the constant functor given by the abelian group 0, and a sequence A → A → A is exact if and only if it is locally exact, that is, every sequence of abelian groups A(U) → A (U) → A (U), U ∈ ObK, is exact. There is a free K-module functor, from the slice category of sets over the set of objects of K to the category of K-modules. For every S = (S, π : S → ObK), the free K-module F S assigns to each U ∈ ObK the free abelian group on the pairs (s, α) where s ∈ S and α ∈ Hom K (πs, U).
Proposition 1. For S = (S, π : S → ObK) any set over ObK and any K-module A, there is a natural isomorphism of abelian groups Proof. This is a straightforward consequence of Yoneda Lemma.
From the above, it is plainly seen that every free K-module is projective.
The cohomology groups of K with coefficients in a K-module A [20,21], denoted H n (K, A), are defined by Above Z : K → Ab denotes the constant functor defined by the group of integers. To exhibit an explicit cochain complex that computes the cohomology groups H n (K, A), let NK be the nerve of K. That is, the simplicial set whose p-simplices are sequences of p composable morphisms in K (objects β0 of K if p = 0), and whose face and degeneracy operators , and s 0 β = 1 β0 if p = 0, and for p ≥ 1 by There is a canonical "last object" functor from the category of simplices of NK to K, ∆NK → K, β → βp. Then, by composing with it, every K-module A defines a system of coefficients on NK [15]) and produces a cosimplicial abelian group, denoted C • (K, A), in which each C p (K, A) is the abelian group of those maps ϕ that assign to each p-simplex β ∈ N p K an element ϕ(β) ∈ A(βp). The coface homomorphisms are given by The so-called standard cochain complex of K with coefficients in A, also written as C • (K, A), is its alternating sum faces cochain complex, whose coboundaries are We have the following (well-known) relevant fact.

Coefficients for the Cohomology of Presheaves Of Monoids
Let C be a fixed small category. A presheaf of monoids on C is a contravariant functor be the category obtained by applying the Grothendieck construction on DM. Its objects are then pairs (U, x) where U ∈ ObC and x ∈ M(U), and an arrow (σ, v 0 , v 1 ) : (U, x) → (V, y), between two such objects of D(M), consists of an arrow σ : V → U in C together with a pair of and the effect of the homomorphism For any morphism σ : V → U in C and any x ∈ M(U), the effect of the homomorphism Thus, for any morphism , so that we can omit the parenthesis and write In these terms, we can say that a D(M)-module A consists of the family of abelian groups A(U, x), U ∈ ObC, x ∈ M(U), together with maps (26), (27) and (28) satisfying the equalities below, whenever they make sense.
The following proposition justifies why the D(M)-modules naturally arise as coefficients for the cohomology of a presheaf of monoids on C. Proof. This can be given paralleling the proof of Theorem 6 in [22] and we omit the details here but briefly let us stress that the abelian group object corresponding to a D(M)-module A can be written as

Derivations of Presheaves Of Monoids
Let M be a presheaf of monoids on C. If A is a D(M)-module, a derivation of M in A, d : M → A, is a function that assigns to each pair (U, x), where U ∈ ObC and x ∈ M(U), an element d(U, x) ∈ A(U, x) satisfying d(U, xy) = x d(U, y) + d(U, x) y, for any object U of C and x, y ∈ M(U), Under pointwise addition, the set of all derivations d : M → A may be given an abelian group structure. We denote this abelian group by Der(M, A). Note that for a D(M)-module morphism becomes a functor. Next we prove that this functor is representable. Let be the D(M)-module which assigns to each object (U, x) of D(M) the abelian group ZM(U, x) which is free on the set of pairs (x 0 , x 1 ) of elements x 0 , x 1 ∈ M(U) such that x 0 x 1 = x, and, for each arrow σ : There is an augmentation morphism over the constant D(M)-module Z which, at each object (U, x) of D(M), is the homomorphism : ZM(U, x) → Z given on generators by (x 0 , x 1 ) = 1. We call the kernel of µ, denoted by IM, the augmentation ideal of M. Thus, we have the short exact sequence of D(M)-modules Notice that each IM(U, x) is the free abelian group on the set of generators and for each arrow σ : Proposition 5. Let M be a presheaf of monoids on C. For any D(M)-module A, there is a natural isomorphism Proof. There is a derivation δ : M → IM given, at each U ∈ ObC and x ∈ M(U), by and then a homomorphism which act on generators by So defined, F d is actually a morphism of D(M)-modules. In effect, for any arrow σ : A quite straightforward verification shows that both maps F → Fδ and d → F d are mutually inverse. For instance, F Fδ = F since, for any U ∈ ObC and x 0 , x 1 ∈ M(U),

Cohomologies for Presheaves Of Monoids
Let M be a presheaf of monoids on C. For any D(M)-module A and each integer n ≥ 0, we define the n-th cohomology group of M with coefficients in A by H n (M, A) = H n (D(M), A), that is, Also, for each n ≥ 1, we define the n-th simple cohomology group of M with coefficients in a A by where R n−1 Der(M.−) is the (n − 1)-th right derived functor of the left-exact functor of derivations (35) or, equivalently, by Proposition 5, as (we refer the reader to Section 6, to justify the above terminology of "simple," which is taken from Gersterhaber and Schack [7]).
Example 1. Let Γ be a monoid, regarded as a small category with only one object, say * , in which the arrows are the elements of Γ and the composition of two of them * x → * y → * is given by the monoid multiplication * xy → * , and the identity is e : * → * . Then, a presheaf of monoids M on Γ is the same thing as a monoid enriched with a left Γ-action by endomorphisms, and the corresponding simple cohomology groups H n s (M, A) above are just the equivariant cohomology groups of the Γ-monoid M introduced and studied recently in [23]. When both Γ and M are groups, the cohomology groups H n s (M, A) agree with those H n n−1 (Γ, M; A) introduced by Whitehead in [17] on the cohomology of groups with operators, while the cohomology groups H n (M, A) above agree with the ordinary Eilenberg-Mac Lane cohomology groups H n (M Γ, A) of the semidirect product group.

Example 2.
If C = * , the final category, then a presheaf of monoids M on C is simply a monoid and the H n (M, A) above are just the cohomology groups of the monoid by Leech [3,4]. Furthermore, in this case, ZM is a projective D(M)-module, as it is free on the inclusion map e = {e} → M = ObD(M), whence there are natural isomorphisms for all n ≥ 2.
But notice that in general the cohomology groups H n are different of the simple ones H n s , as the following example shows. Example 3. let e be the constant presheaf on a small category C defined by the trivial monoid. Then, D(e) ∼ = C op and, for any C op -module A, we have H n (e, A) = H n (C op , A), whereas H n s (e, A) = 0 as Der(e, −) = 0. Let, for instance, C = C k be the finite cyclic group of order k (regarded as a category with only one object). Then D(e) = C k and, for the trivial C k -module Z, we have H 2 (e, Z) The following property is naturally expected for the simple cohomology groups H n s (M, A) but it is not satisfied by the cohomology groups H n (M, A). Recall that the free presheaf of monoids on a set S endowed with a map π : S → ObC is defined to be where, for any set X, FX denotes the free monoid on X. For instance, the free presheaf on the empty set is e, the constant presheaf on C defined by the trivial monoid e. As we showed in Example 3 above, the cohomology groups of the free presheaf e are the same as the cohomology groups of the category C op which, obviously, do not vanish in general. However, for the simple cohomology groups, we have the following. denote the presheaf of abelian groups on C (= C op -module) which assigns to any U ∈ ObC the abelian group A(U, e), and to any morphism σ : V → U of C the homomorphism (28) As we shall establish below, in Theorem 1, there is a natural long exact sequence linking the cohomology groups Proof. Below, we represent the p-simplices β of NC op as sequences β = (β0 For each integer p ≥ 0, let the set N p C op of p-simplices of the nerve of the category C op be endowed with the map π : These Q p form an augmented complex of D(M)-modules whose differential operators, at an object (U, Every Q p is free, and therefore projective. Furthermore, Q • → ZM → 0 is exact owing to, at any object (U, x) of D(M), the augmented chain complex Q • (U, x) → ZM(U, x) has a contracting homotopy Φ, which is given by the homomorphisms defined on generators by A). Now, we have the isomorphisms of abelian groups which provide an isomorphism , whence the result follows from Proposition 2.
Theorem 1 (The linking long exact sequences). Let M be a presheaf of monoids on C. For any D(M)-module A, there is a natural long exact sequence Proof. This follows from the long exact sequence in Theorem 1 and Proposition 3.

Cochains, Cocycles, Coboundaries
In this section we provide suitable cochain complexes for computing the cohomologies of presheaves of monoids.
Below we regard each monoid Γ as a small category with only one object, as in Example 1. Then, the simplicial set NΓ is just its classifying space, that is, the reduced simplicial set whose p-simplices τ = ( * τ 1 → · · · τ p → * ) = (τ 1 , . . . , τ p ) are the elements of Γ p . Let M be a presheaf of monoids on C. By composing with the nerve functor, it gives rise to a presheaf of simplicial sets NM : C op → SSet. Let Ψ(M) denote the simplicial replacement construction by Bousfield-Kan [14] on NM; that is, the bisimplicial set whose set of (p, q)-bisimplices is Here, we represent the p-simplices β of NC op as sequences of p composable arrows in C (objects β0 of C if p = 0). The vertical face and degeneracy operators are defined by those of the simplicial sets NM(β0), and the horizontal face operators by those of NC op , except that d h Then, by composition with it, every D(M)-module A defines a system of coefficients on Ψ(M) and gives rise to a bicosimplicial abelian group, denoted in which each C p,q (M, A) is the abelian group of all functions ϕ that assign to each (p, q)-bisimplex (β, τ) ∈ Ψ p,q (M) an element The horizontal and vertical coface homomorphisms are respectively given by Let also write C •,• (M, A) for its alternating faces sum cochain bicomplex, whose horizontal and vertical coboundaries are Definition 1. Let M be a presheaf of monoids on C. We define the complex of cochains of M with coefficients in Notice that the homotopy colimit of NM is the simplicial set diagonal of Ψ(M): Then, every D(M)-module A defines a coefficient system on hocolim NM and the corresponding cohomology groups are justly calculated as where C • (hocolim NM, A) is the alternating faces sum cochain complex of the diagonal cosimplicial abelian group diagC •,• (M, A); that is, Proof. This is a direct application of the generalized Eilenberg-Zilber theorem of Dold-Puppe (see, e.g., Reference [24] (Chapter IV, Theorem 2.4), which shows that both cochain complexes C • (M, A) and C • (hocolimNM, A) are cohomology equivalent in a natural way.
A subcomplex of C • (M, A) plays an important role in our development. Following Gerstenhaber-Schack [7], we establish the following Definition 2. Let M be a presheaf of monoids. If A is a D(M)-module, we say that a n-cochain so that C 0 s (M, A) = 0 and, for n ≥ 1, Proof. To start, we construct a bisimplicial D(M)-module Q •,• and a simplicial D(M)-module B • , as follows.
The horizontal and vertical face morphisms at an object (U, x) of D(M), are defined on generators by In B • , each D(M)-module B q assigns to an object (U, x) of D(M) the free abelian group B q (U, x) whose generators are those τ ∈ N q+2 M(U) such that τ 1 · · · τ q+2 = x.
Let us point out that, regarding B • as a constant in the horizontal direction bisimplicial D(M)-module, a bisimplicial augmentation is determined by the morphisms µ : Q 0,q → B q which, at each object (U, x) of D(M), consist of the homomorphisms µ : Now, let also write Q •,• for its associated alternating faces sum chain bicomplex, in which the horizontal and vertical boundaries are and let TotQ •,• be its total complex. Thus, Hence, if we denote also by B • to its associated alternating faces sum chain complex, in which the boundaries are ∂ q = ∑ q j=0 (−1) j d j : B q → B q−1 , we have an augmented morphism of chain bicomplexes of D(M)-modules µ : Q •,• → B • , were B • is here view as bicomplex concentrated in degree zero in the horizontal direction, which, we claim, induces a homology equivalence between the associated total complexes Tot Q •,• → Tot B • = B • , and therefore natural isomorphisms In effect, it suffices to prove that, for any q ≥ 0, the augmented chain complex of D(M)-modules Q •,q µ → B q → 0 is exact. But this holds since, at any object (U, x) of D(M), the augmented chain complex of abelian groups admits a contraction Φ, which is given by the homomorphisms defined on generators by has a contracting homotopy defined by the homomorphisms Ψ q , which act on generators by Therefore, H 0 B • ∼ = Z and H q B • = 0 for all q ≥ 1. It follows that H 0 Tot Q •,• ∼ = Z and H n Tot Q •,• = 0 for all n ≥ 1. Since, at every degree n ≥ 0, Tot n Q •,• = p+q=n Q p,q is a projective D(M)-module, we conclude that Tot Q •,• is actually a projective resolution of the constant D(M)-module Z. Therefore, for any D(M)-module A, there are natural isomorphisms Now, there are isomorphisms which, as a direct and straightforward verification shows, provide a natural isomorphism of cochain complexes . Thus, we conclude the claimed isomorphisms (76), namely To show the remaining isomorphisms (75), let Q •,• be the chain bicomplex of D(M)-modules obtained from Q •,• by taking Q p,q = Q p,q+1 , with coboundaries ∂ h p,q = ∂ h p,q+1 and ∂ v p,q = ∂ v p,q+1 , let also B • be the chain complex constructed from B • by taking B q = B q+1 and coboundary ∂ q = ∂ q+1 , and let µ : Q •,• → B • be the augmentation obtained from µ by taking µ q = µ q+1 . Then, as every augmented chain complex µ : Q •,q → B q → 0 is exact, there are induced natural isomorphisms H n Tot Q •,• ∼ = H n B • . Now, for q ≥ 1, we have H q ( B • ) = H q+1 (B • ) = 0. To compute H 0 ( B • ), notice that B 0 = ZM and that the morphism : B 0 → Z above is just the augmentation : ZM → Z in (38). Then, as B • → Z → 0 is exact,

Low Dimensional Simple Cochains, Cocycles And Coboundaries
In the rest of the paper we will only use the simple cohomology groups H n s (M, A) for n ≤ 3. Therefore, for future reference we specify below the relevant truncated subcomplex of the complex where: A 1-cochain f ∈ C 1 s (M, A) is a map assigning an element f (U; x) ∈ A(U, x), to every U ∈ ObC and x ∈ M(U).
A 2-cochain g ∈ C 2 s (M, A) is a function assigning elements g(U; x, y) ∈ A(U, xy), to each U ∈ ObC and x, y ∈ M(U), The coboundary ∂ : A 3-cochain h ∈ C 3 s (M, A) is a function assigning elements x, y, z) ∈ A(U, xyz), to every U ∈ ObC and x, y, z ∈ M(U), h(α; x, y) ∈ A(U 1 , x α y α ), to every arrow U 0 α ← U 1 of C and x, y ∈ M(U 0 ), The coboundary ∂ : C 2 s (M, A) → C 3 s (M, A) acts on a 2-cochain g by (∂g)(U; x, y, z) = x g(U; y, z) − g(U; xy, z) + g(U; x, yz) − g(U; x, y) z, x, y, z, t) ∈ A(U, xyzt), to each U ∈ ObC and x, y, z, t ∈ M(U), ϕ(α; x, y, z) ∈ A(U 1 , x α y α z α ), to every arrow U 0 α ← U 1 of C and x, y, z ∈ M(U 0 ), ϕ(α, β; x, y) ∈ A(U 2 , x αβ y αβ ), to each arrows U 0 α ← U 1 β ← U 2 of C and x, y ∈ M(U 0 ). The As usually, we write Z n s (M, A) and B n s (M, A) for the respective groups of n-cocycles and n-coboundaries of the cochain complex C • s (M, A), and refer to them as the abelian groups of simple n-cocycles and simple n-coboundaries of the presheaf of monoids M with coefficients in the D(M)-module A, respectively.
A direct comparison shows that simple 1-cocycles are the same as derivations, that is In the next sections we give natural interpretations to simple 2-and 3-cocycles.

Extensions of Presheaves Of Monoids
If M is a presheaf of monoids on C, by an extension (or coextension) of M we shall mean a morphism of presheaves of monoids f : E → M which is locally surjective, that is, for any U ∈ ObC, the homomorphism f U : E (U) → M(U) is surjective. If A is a D(M)-module, an extensionĒ = (E , f, +) of M by A is an extension f : E → M of M endowed, for each U ∈ ObC and x ∈ M(U), with a simply-transitive action of the group A(U, x) on the fibre f −1 U (x) ⊆ E (U) of f U : E (U) → M(U) at x, such that the following two conditions hold: Two such extensions of M by A, sayĒ andĒ , are equivalent if there is an isomorphism of presheaves of monoids g : E ∼ = E such that f g = f and g U (a + w) = a + g U (w), for any U ∈ ObC, w ∈ E (U) and a ∈ A(U, f U (w)). Let Ext(M, A) denote the set of equivalence classes [Ē ] of extensionsĒ of M by A.
The classification result we show in Theorem 3 below, for extensions of a presheaf of monoids M by D(M)-modules, is useful to analyze the structure of H-extensions of M with abelian kernel, that is, extensions f : E → M such that, for every object U of C, the congruence kernel of the surjective homomorphism f U : E (U) → M(U) is included in the Green's relation H of E (U) and, for any element x ∈ M(U), the (left) Schützenberger group of the kernel class f −1 U (x) is abelian. The results by Grillet in [18] and, mainly, by Leech in References [3,4] on group extensions of monoids lie behind the content of the next proposition, where by a D(M)-module we mean a D(M)-module A which restricts to a D(M(U))-module [3] for every object U of C, that is, such that for any x, u 0 , u 1 , u 0 , u 1 ∈ M(U) with u 0 x = u 0 x and xu 1 = xu 1 , the equality u 0 a u 1 = u 0 a u 1 holds for all a ∈ A(U, x).
for some (and then by any) ω . The extension f : E → M is recognized to be an extension of M by the its D(M)-module kernel Σ thanks to the simply-transitive actions (118).
(ii) At any object U of C, every extension of M by a D(M)-module is an extension of the regular monoid M(U) by an D(M(U))-module. Hence, the result follows from Leech's Theorems 3.9 and 5.18 in Reference [3].
is defined as follows: -for any object U of C and x, y ∈ M(U), let g(U; x, y) be the element of A(U, xy) determined by the equation S U (xy) = g(U; x, y) + S U (x) S U (y).
-for each arrow U 0 α ← U 1 of C and x ∈ M(U 0 ), let g(α; x) be the element of A(U 1 , x α ) determined by the equation To verify the cocycle condition (∂g)(U; x, y, z) = 0, see (105), we see that and by comparison the result follows. Analogously, the cocycle condition (∂g)(α; x, y) = 0, see (106), follows from the equality x α y α = (xy) α , since while the cocycle condition (∂g)(α, β; x) = 0, see (107), follows from the equality x αβ = (x α ) β : The Then, let f ∈ C 1 (M, A) be the 1-cochain where, for any U ∈ ObC and any x ∈ M(U), the element For any x, y ∈ M(U), if we compute S U (xy) ∈ E (U) in the following two ways it follows, by comparison, that gĒ ,S (U; x, y) = (gĒ ,S + ∂ f )(U; x, y), see (102). Similarly, for any arrow α : U 1 → U 0 in C and any x ∈ M(U 0 ), we can compute (S U 0 (x)) α ∈ E (U 1 ) in two ways 2. The map F is surjective: For every g ∈ Z 2 (M, A), an extensionĒ g = (E g , f, +) of M by A can be constructed as follows. For each object U of C, we define A straightforward verification shows that this multiplication (126) is associative thanks to the cocycle condition (∂g)(U; x, y, z) = 0 in (105). Moreover, from equations (∂g)(U; x, e, e) = 0 and (∂g)(U; e, e, x) = 0 we get x g(U; e, e) = g(U; x, e) and g(U; e, e) x = g(U; e, x), whence it is easy to see that the multiplication (126) is unitary, with identity (e, g(U; e, e)). Hence, E g (U) is actually a monoid. For any arrow α : U 1 → U 0 of C, the homomorphism ( ) α : E g (U 0 ) → E g (U 1 ) is given by (x, a) α = (x α , g(α, x) + a α ).
The locally surjective morphism f : E g → M is defined, at each U ∈ ObC, by the projection For any x ∈ M(U), the simply transitive action Conditions (115) and (116) are easily verified, so thatĒ g = (E g , f, +) is actually an extension of M by A. Now, for each U ∈ ObC, let S U : M(U) → E g (U) be the obvious section map with S U (x) = (x, 0). Then, the equalities, for any x, y ∈ M(U) and α : U 1 → U 0 , (xy, 0) = g(U; x, y) + (x, 0)(y, 0), (x, 0) α = g(α; x) + (x α , 0), show that g¯E g,S = g, and therefore F[Ē g ] = [g]. 3. The map F is injective: For any extensionĒ = (E , f, +) of M by A and any family of section maps S = (S U : M(U) → E (U)) U∈ObC , there is an isomorphism of extensionsĒ gĒ ,S ∼ =Ē which is locally defined by the isomorphisms of monoids Furthermore, if g, g ∈ Z 2 (M, A) are cohomologous, say g = g + ∂ f for some f ∈ C 1 (M, A), then there is an isomorphism of extensionsĒ g ∼ =Ē g which is defined by the isomorphisms of monoids Hence, the injectivity of F follows.

Prestacks of Monoidal Abelian Monoids
To start, we fix some notation. Recall that a groupoid G is termed abelian whenever its automorphism groups Aut G (x), x ∈ ObG, are abelian. We shall use additive notation for them. Thus, if a : x → y, b : y → z are morphisms an abelian groupoid G, their composite is written as b + a : x → z, the identity morphism of an object x is denoted by 0 x , and the inverse of a : x → y is −a : y → x.
If C is any fixed small category, by a prestack of monoidal abelian groupoids on C we mean a contravariant pseudo-functor from C to the 2-category of monoidal abelian groupoids, see Reference [1] for instance. Thus, such a prestack P consists of the data (PDi) and axioms (PAj) that follow.
(PD2) a monoidal functor ( ) α = (( ) α , φ α , φ α ) : P(U 0 ) → P(U 1 ), for each arrow U 0 α ← U 1 of C; that is, a functor between the underlying groupoids endowed with natural morphisms φ α x,y : x α ⊗ y α → (x ⊗ y) α and a morphism φ α : ι → ι α , satisfying the commutativities (PD3) a monoidal transformation θ α,β : (( ) α ) β ⇒ ( ) αβ , for each two arrows U 0 (PD4) a monoidal transformation θ U : id P(U) ⇒ ( ) 1 U , for each object U of C; that is, a family of natural morphisms θ U x : x → x 1 u making commutative the diagrams All these data are subject to the following two coherence conditions: (PA1) for any three composable arrows U 0 (PA2) for each U 0 α ← U 1 in C and x ∈ ObP(U 0 ), both inner triangles in the square If P and P are two such prestacks on C, then an equivalence F : P → P is a pseudo-natural equivalence, in other words it consists of the following data (EPD1) a monoidal equivalence F U = (F U , Ψ U , Ψ U ) : P(U) → P (U), for each object U of C; that is, an equivalence between the underlying groupoids F U : P(U) → P (U) enriched with natural morphisms Ψ U x,y : (EPD2) a monoidal transformation for each morphism U 0 α ← U 1 of C; that is, a family of natural morphisms making commutative the diagrams All subject to the following two axioms: (EPA1) for any two composable arrows U 0 (EPA2) for any objects U of C and x of P(U), the triangle below commutes.
The following is an useful result about transporting prestack structure.

Lemma 2.
Suppose P is a prestack of monoidal abelian groupoids on C, and F U : P(U) → P (U) is a ObC-indexed family of equivalences of groupoids. Then, there is a prestack of monoidal abelian groupoids P and an equivalence F : P → P which agrees on the underlying groupoids with the given functors F U .
Proof. Notice that to provide the datum (PD1) in the construction of our prestack P, we can simultaneously provide the datum (EPD1) for the construction of F, since F U and F U × F U are equivalences: For each object U of C, let us select objects x ⊗ y and ι in P(U) together with morphisms Ψ U x,y : F U (x) ⊗ F U (y) → F U (x ⊗ y) and Ψ U : ι → F U (ι) in P (U). Then, there is a unique monoidal structure on P(U) such that F U together with the morphisms Ψ U x,y and Ψ U turns to be a monoidal equivalence. The tensor product f ⊗ f : x ⊗ y → x ⊗ y of morphisms f : x → y and f : x → x in P(U) is determined by the commutativity of the diagram the unit object is ι, and the structure constraints a, l and r are uniquely determined by Equations (142) and (143). Similarly, (EPD2) tell us how to satisfy (PD2): For each arrow α : U 1 → U 0 in C, let us choose objects x α in P(U 1 ) together with morphisms Γ α x : (F U 0 (x)) α → F U 1 (x α ). Then, the assignment x → x α is the function on objects of the functor ( ) α : P(U 0 ) → P(U 1 ), whose effect on a morphism f : x → y of P(U 0 ) is the morphism f α : x α → y α determined by the commutative square This functor ( ) α becomes a monoidal functor in a unique way such that Γ α turns to be a monoidal transformation, since its structure constraints φ α and φ α are uniquely determined by the Equations (145) and (146). Finally, axiom (EPA1) uniquely determines the datum (PD3) for P, while (EPA2) do the same with the datum (PD4). All the requirements (132)-(141) for P are consequence of the corresponding ones for P since the F U are faithful. In getting P we have also got the equivalence F : P → P .
Theorem 4 below shows a classification for equivalence classes of prestacks of monoidal abelian groupoids on C by means of triads (M, A, c), where M is a presheaf of monoids on C, A is a D(M)-module, and c is a cohomology class c ∈ H 3 s (M, A). Previously, we show how every 3-cocycle h ∈ Z 3 s (M, A) gives rise to a prestack of monoidal abelian groupoids on C which, for abbreviation, we also denote by P h . Its data are as follows: (PD1) For each object U of C, the underlying groupoid P h (U) has as set of objects the elements of the monoid M(U). If x = y are different elements of M(U), then Hom P h (U) (x, y) = ∅, whereas its isotropy group at an x is Aut P h (U) (x) = A(U, x), the abelian group that A attaches to the object (U, x) of D(M). Its tensor product is given by The identity of the monoid M(U) provides the unit object, that is, ι = e, and the associativity and unit constraints are which just is (133).
(PD4) For each object U of C, the monoidal transformation θ U : id P h (U) ⇒ ( ) 1 U is given, at each object x, by Taking which, taking opposites, says that (138) holds. Even more, taking x = e = y in the above equation, we obtain that is, (139) is satisfied. Finally, we verify axioms (PA1) and (PA2) for P h : Here (140) reads which follows directly from the cocycle condition ∂h = 0 in (112). But we have even more, since if we take β = 1 U 1 = γ in the above equality we get while taking α = 1 U 0 = β and then replacing γ by α we obtain and these last two equalities just mean that (141) holds.
In the theorem below, we will use that the cohomology groups of presheaves of monoids Proof. (i) Let P be a prestack of monoidal abelian groupoids on C. By Lemma 2, we can assume that for any object U of C the groupoid P(U) is skeletal, that is, there is no morphisms between different objects. Then, we can construct a presheaf of monoids M, a D(M)-module A, a 3-cocycle h ∈ Z 3 s (M, A), and an equivalence P(M, A, h) = P h P as follows: The presheaf of monoids M: For any object U of C, let M(U) = ObP(U) be the set of objects of the monoidal abelian groupoid P(U). The effect on objects of tensor functor ⊗ : P(U) × P(U) → P(U) gives a multiplication on M(U), simply by putting xy = x ⊗ y, which is associative and unitary, with identity e = ι, the unit object of P(U), since being P(U) skeletal the existence of the structure constraints a x,y,z , l x , and r x forces the equalities (xy)z = x(yz) and ex = x = xe.  (27), A(U, x) → A(U, xu), are respectively defined by the functors u ⊗ − : P(U) → P(U) and − ⊗ u : P(U) → P(U); that is, for every a ∈ A(U, x), u a = 0 u ⊗ a and a u = a ⊗ 0 u . If α : V → U is an arrow in C, the homomorphism (28), A(U, x) → A(V, x α ), a → a α , is defined by the monoidal functor ( ) α : P(U) → P(V). For u, x, u ∈ M(U) and a ∈ A(U, x), the equality (ua)u = u(au ) holds since the naturality of associativity constraint a u,x,u of P(U) tell us that, in the abelian group A(U, uxu ), we have u(au ) + a u,x,u = a u,x,u + (ua)u . Similarly, the equality ea = a = ae follows from the naturality of the unit constraints l x and r x , which imply the equalities l x + ea = a + l x and r x + ae = a + r x , and the abelianity of the group A(U, x). If α : V → U is an arrow in C, the naturality of the structure morphisms φ α u,x and φ α x,u , in (PD2), gives the equalities (ua) σ + φ α u,x = φ α u,x + u σ a σ and (au) σ + φ α x,u = φ α x,u + a σ u σ . Then, as the group A(U, x α ) is abelian, we conclude that (ua) α = u α a α and (au) α = a α u α . If β : W → V is any other arrow C, the equalities (a α ) β = a αβ are consequence of being the group A(U, x αβ ) abelian and the naturality of the structure morphisms θ α,β x in (PD3), which tell us that (a α ) β + θ α,β x + a αβ . Similarly, the equality a 1 u = a follows from the naturality of the morphisms θ U x , which says that θ U x + a 1 U = a + θ U x , and the abelianity of the group A(U, x). Thus, all the requirements in (30) are verified and we conclude that A is actually a D(M)-module.  The equivalence P h P: Previously to show such an equivalence, it is worth analyzing P h in relation to P: Concerning the data in (PD1), a direct comparison shows that, for each object U of C, both monoidal groupoids P h (U) and P(U) have the same underlying groupoid and the same tensor product, as for any a ∈ Aut P(U) (x) and b ∈ Aut P(U) (y), x ⊗ y = xy and as well as the same associativity constraint a and the same unit object ι. However, they have different left and right unit constraints, since in the original P(U) they are l x : ι ⊗ x = x → x and r x : With regards to the data in (PDA2), a direct comparison shows that, for any arrow α : U 1 → U 0 in C, both monoidal functors ( ) α : P h (U 0 ) → P h (U 1 ) and ( ) α : P(U 1 ) → P(U 0 ) coincide on objects and on morphisms, as well as they have the same structure morphisms φ α x,y : x α ⊗ y α → (x ⊗ y) α . But they have different unit structure morphism since, while in the original P it is φ α Similarly, we see that the data in (PDA3) and in (PDA4) for both P h and P are given by the same monoidal transformations θ α,β and the same morphisms θ U x : x → x 1 U = x (for these last, note that the equalities θ U x = −θ 1 U ,1 U x follow from (141) by taking Then, an equivalence F U : P h → P is defined by the following data: (EPD1) For each object U of C, the monoidal functor F U : P h (U) → P(U) acts between the underlying groupoids as the identity, that is, x,y : x ⊗ y → x ⊗ y are all identities, that is, Ψ U x,y = 0 x⊗y , and the structure morphism Ψ U : ι → ι is defined by Ψ U = l ι : ι ⊗ ι = ι → ι (= r ι , see Proposition 1.1 in Reference [25]), the unit constraint of P(U) at the unit object ι.
(EPD2) For any arrow α : U 1 → U 0 , the monoidal transformation Γ α is the identity transformation on the functor ( ) α : P(U 0 ) → P(U 1 ), that is, Γ α x = 0 x α for any object x of P(U 0 ). Notice that, for any object U of C, the naturality of the morphisms Ψ U x,y = 0 x⊗y simply means that the tensor product ⊗ is the same in both P h (U) and P(U), which is true as we commented before, and the coherence condition (142) is obviously satisfied, since the associativity constraints also agree in both monoidal groupoids. Here, the requirements in (143) read To verify them, first observe that, by naturality, we have the equalities r x + (r x ⊗ 0 ι ) = r x + r x⊗ι and l x + (0 ι ⊗ l x ) = l x + l ι⊗x , whence r x ⊗ 0 ι = r x⊗ι = r x and 0 ι ⊗ l x = l ι⊗x = l x . Then, taking y = ι in (133) we obtain the equality (0 x ⊗ l ι ) + a x,ι,ι = r x ⊗ 0 ι = r x , while taking x = ι and replacing y with x in (133) we obtain (r ι ⊗ 0 x ) − a ι,ι,x = 0 ι ⊗ l x = l x . Hence, Equation (170) hold since the group Aut P(U) (x) is abelian.
Suppose first that f : M ∼ = M an isomorphism of presheaves and F : ). This means that there is a 2-cochain g ∈ C 2 (M , f * A) such that the equations below hold.
(EPD2) For each arrow α : U 1 → U 0 of C, the monoidal transformation Γ α is given by So defined, it is plain to see that every F U is an isomorphism of groupoids. The naturality of the isomorphisms Ψ U x,y holds since F is a morphism of D(M)-modules and the groups A(U, f(xy)) are abelian. Equation (171) directly provides the verification of the coherence condition (142), as well as that of (143) just by taking y = e = z therein. Similarly, the naturality of the morphisms Γ α x follows from being F a morphism of D(M)-modules and the groups A(U, f(x)) abelian, whereas Equation (172) implies conditions (145) and (146), taking x = e = y for the last one. Finally, say that (147) holds thanks to (173), from which one verifies also (148) by taking α = 1 U = β therein.
Finally, we can prove the converse simply by retracting our above steps: Suppose we have an isomorphism F : P h ∼ = P h . Then, for each U of C, let f = F U : M (U) → M(U) be the function on objects of the monoidal isomorphism F U : P h (U) → P h (U). Since P h (U) is skeletal, the existence of the morphisms data Ψ U x,y and Ψ U * in (EPD1) forces the equalities f(xy) = f(x)f(y) and f(e) = e. Similarly, for each α : U 1 → U 0 in C, the presence of the morphisms Γ α x in the data (EPD2) implies the equalities f(x α ) = f(x) α . Thus f : M → M is an isomorphism of presheaves of monoids. Now, if for each object U of C and x ∈ M (U), we define the isomorphism F : A (U, x) → A(U, f(x)) by F(a) = F U (a), the naturality of the morphisms Ψ U x,y and Γ α x just tell us that F : A → f * A is an isomorphism of D(M )-modules. Finally, if we take the 2-cochain g ∈ C 2 (M , f * A) defined by g(U; x, y) = Ψ U x,y and g(α; x) = Γ α x , we easily see that that the coherence conditions (142), (145) and (147)

The Particular Case Where the Monoids Are Groups
In this section, we review how our results above specialize when we limit our attention to presheaves of groups G : C op → Gp.

the Coefficients for the Cohomology of a Presheaf Of Groups
The coefficients for the cohomology of a presheaf of groups admit an easier description than that given in Section 3 for the coefficients for the cohomology of a presheaf of monoids. This is as follows.
Definition 3. Let G be a presheaf of groups on C. A G-module is a presheaf of abelian groups on C (= C op -module) A such that for each object U of C the abelian group A(U) is a left G(U)-module and for each arrow σ : V → U of C the induced homomorphism ( ) σ : A(U) → A(V) is compatible with the modules structures via the group homomorphism ( ) σ : G(U) → G(V); that is, for x ∈ G(U) and a ∈ A(U) (x · a) σ = x σ · a σ . (175) In other words, such that the action maps G(U) × A(U) → A(U), (x, a) → x · a, define a natural transformation G × A → A. A morphism A → A of G-modules is a morphism of presheaves of abelian groups such that, for each object U of C, the homomorphism A(U) → A (U) is of G(U)-modules.
Let G-Mod denote the category of G-modules. There is a full and faithful embedding G-Mod → D(G)-Mod (176) which identifies each G-module A to the D(G)-module, equally denoted by A, such that A(U, x) = A(U) for each object U of C and x ∈ G(U), and v 0 a σ v 1 = v 0 · a σ , for each σ : V → U in C and v 0 , v 1 ∈ G(V).

Proposition 9.
For any presheaf of groups G, the embedding (176) above is an equivalence of categories.
Proof. Let A be a D(G)-module. Define A(e) to be the G-module whose underlying presheaf A(e) : C op → Ab assigns to each U ∈ ObC the abelian group A(U, e) and to each morphism σ : V → U of C the homomorphism ( ) σ : A(U, e) → A(V, e σ = e). For each object U of C, the G(U)-action on A(U, e) is given by u · a = u a u −1 . Then, an isomorphism of D(G)-modules A(e) ∼ = A is given by the isomorphisms F : A(U, e) ∼ = A(U, x) defined by F(a) = a x, for any U ∈ ObC and x ∈ G(U).
It follows that there is no loss of generality in assuming that the coefficients for the cohomology groups of a presheaf of groups G are G-modules. For these, all our constructions and results rewrite more simply and revisit those established in Reference [26]. Notice that, when we plug an G-module A into the complex of cochains C • s (G, A) of Section 6, we just obtain (up to normalization) the cochain complex shown in Reference [26] to compute the cohomology groups of G with coefficients in A.

Derivations of Presheaves Of Groups
Let G be a presheaf of groups on C. By definition, Here, a derivation of G in a G-module A, say d : G → A, simply consists of a natural family of ordinary derivations d U : G(U) → A(U), one for each U ∈ ObC. That is, the maps d U satisfy d U (xy) = x · d U (y) + d U (y) and, for any σ : V → U in C, the equalities d U (x) σ = d V (x σ ) hold.
The G-module ZG in (36) assigns to each object U of C the underlying group of the ordinary integral group ring ZG(U) = Z{x | x ∈ G(U)} turned into an G(U)-module in the obvious way and, if σ : V → U is a morphism of C, the corresponding homomorphism ( ) σ : ZG(U) → ZG(V) is just the induced by ( ) σ : G(U) → G(V). Then, the isomorphism in Proposition 5 reads Der(G, A) ∼ = Hom G (IG, A), where IG = Ker(ZG → Z) is the G-module assigning to each object U of C the ordinary ideal augmentation IG(U) of the group G(U).
Theorem 5. The isomorphism classes of singular extensions of a presheaf of groups G by a G-module A correspond bijectively to the elements of H 2 s (G, A).

Prestacks of Categorical Groups
The results in Section 9 specialize here by giving the cohomological classification of prestacks of categorical groups. Let us recall that a categorical group (aka Gr-category or 2-group) is a monoidal groupoid G = (G, ⊗, ι, a, l, r) such that, for any object x, the endofunctor x ⊗ − : G → G is an autoequivalence [5,25,27,28].

Lemma 3.
In any categorical group, the underlaying groupoid is abelian.
Proof. Let G be a categorical group. The group Aut G (ι) is abelian since the multiplication is a group homomorphisms [29]. For any object x, the group Aut G (x) is also abelian, since we have the group isomorphism Aut G (ι) ∼ = Aut G (x), a → r x (id x ⊗ a)r −1 x .
The 2-category of categorical groups is then a full 2-subcategory of the 2-category of monoidal abelian groupoids and therefore, for any small category C, the 2-category of prestacks of categorical groups on C is a full 2-subcategory of the 2-category of prestacks of monoidal abelian groupoids on C. In particular, two prestacks of categorical groups are equivalent if and only if they are equivalent as prestacks of monoidal abelian groupoids. In order to their classification, recall that a monoidal groupoid (G, ⊗, ι, a, l, r) is a categorical group if and only if every object x has a quasi-inverse with respect to the tensor product, that is, there is an object x with an arrow x ⊗ x → ι. Then, for any presheaf of groups G, any G-module A and any 3-cocycle h ∈ Z 3 (G, A), the prestack of monoidal abelian groupoids P(G, A, h) built as in (149) is easily recognized to be a prestack of categorical groups. Then, Theorem 4 particularizes as follows (cf. Theorem 8.5 in Reference [26]). Theorem 6. (i) For any prestack of categorical groups P, there exist presheaf of groups G, a G-module A, a 3-cocycle h ∈ Z 3 s (G, A) and an equivalence P(G, A, h) P.
(ii) Let h ∈ Z 3 s (G, A) and h ∈ Z 3 s (G , A ) be 3-cocycles, where G and G are presheaves of groups, A is a G-module and A is a G -module. There is an equivalence P(G, A, h) P (G , A , h ) if and only if there is an isomorphism of presheaves of groups f : G ∼ = G and a isomorphism of G -modules F : A ∼ = f * A such that the equality of cohomology classes in H 3 s (G , A ) below holds.
[h ] = F −1 * f * ([h]) Proof. (i) Let P be a prestack of categorical groups on C. By Theorem 4(i), there are a presheaf of monoids M, a D(M)-module A, a 3-cocycle h ∈ Z 3 s (M, A) and an equivalence P(M, A, h) = P h P. Then, P h is a prestack of categorical groups as P is; that is, P h (U) is a categorical group, for every object U of C. Therefore, for any x ∈ M(U) = ObP h (U) it must exist another x ∈ M(U) with a morphism x ⊗ x = xx → ι = e in P h (U). As the groupoid P h (U) is skeletal, necessarily xx = e in M(U), which means that x is an inverse of x in the monoid M(U). Therefore, every M(U) is a group and G = M is actually a presheaf of groups.