I have a some naive questions about how to define the cohomology of a commutative monoid.


One way to express the cohomology of a group $G$ with coefficients in a module $A$ is as $\text{Ext}^i\_{\mathbb{Z}[G]}(\mathbb{Z},A)$. If we have a commutative monoid $M$ (you can also assume it's cancellative if you want), we can follow the exact same recipe over the monoid algebra $\mathbb{Z}[M]$; I think this gives derived functors in the category of $M$-modules of "taking $M$-invariants," which is what I'd expect and want. I was wondering if this theory was developed anywhere, in terms of what analogues of standard group cohomology constructions/theorems exist, vanishing theorems, etc.


Incidentally I've found by googling there are various other monoid cohomologies, but constructed in ways that seem arcane to me, e.g. Leech or Gillet symmetric cohomology. I guess you could also take the cohomology of the classifying space of the monoid as a category. Do any of them restrict to/agree with the construction above when restricted to some nice class of commutative monoids? What are the relations between them?



Cohomology of commutative monoid acting on module
There are many different cohomology theories for monoids. Since you are using commutative monoids, you might be interested in Grillet's symmetric cohomology but I am not very familiar with it.


If we ignore Grillet (due to my ignorance mostly) then there are 3 cohomology theories that are popular for monoids: left/right Eilenberg-Mac Lane cohomology, Hochschild-Mitchell cohomology and Leech cohomology. Let me note that all three theories are also studied in the context of cohomology of small categories, but Leech cohomology is called Baues and Wirsching cohomology in that context since they rediscovered the same theory as Leech (but in the context of categories instead of monoids) without knowing it.


For groups, all these cohomology theories give the same answer.


The cohomology theory that you mention, where you look at the trivial $\mathbb ZM$-module $\mathbb Z$, or equivalently the derived functors of the invariants, is somewhat studied due to its connections with string rewriting systems discovered by Anick-Squier-Groves. The problem with it is that the theory has a number of flaws. First it is not left/right dual. For commutative monoids it makes no difference but for noncommutative monoids the cohomology theories obtained by studying left versus right modules is radically different. This also explains why the classifying space approach is not very good. The classifying space for the left version of the theory and the right version are the same. So you can have a contractible classifying space and have interesting cohomology on one or both sides. Probably this is due to the fact that cohomology with coefficients in a module doesn't generally speaking have a natural topological interpretation as local coefficient systems on the classifying space like it does for groups


Another problem is that because monoids can have many idempotents, the trivial module can be projective, for example, if the monoid has a one-sided zero on the appropriate side. I think few semigroup theorist will respect a theory where adjoining a zero makes the whole thing trivial. (There is $0$-cohomology introduced by Novikov that tries to rectify this.)


The biggest problem I think with the cohomology is that $H^2(M,A)$ in this setting does not classify a reasonable notion of extension for monoids. It classifies extensions of $M$ by $A$ that are extensions in a very strong sense and don't really come up much in practice. The main use of $H^2$ is to define twisted monoid algebras over a commutative ring as far as I know.


A better cohomology theory is Hochschild-Mitchell cohomology which for a monoid $M$ amounts to looking at the Hochschild cohomology of $\mathbb ZM$. So you take free resolutions of $\mathbb ZM$ as a bimodule and the coefficients will be a bimodule. It is the derived functor of taking the "center" of the bimodule. I never thought much about what this means for commutative monoids. The nice thing about Hochschild-Mitchell cohomology is that it is left-right dual and does not get affected in a serious way by adjoining a zero. It classifies a slightly more interesting notion of extension than Eilenberg-Mac Lane cohomology but still isn't great.


Leech cohomology is the most powerful cohomology theory. I mean this in the sense that Eilenberg-Mac Lane cohomology can be computed from Hochschild-Mitchell and Hochschild-Mitchell can be computed from Leech.


In Leech cohomology you take coefficients in something more complicated than a module. Baeus-Wirsching call it a natural system. I can't remember what Leech calls it. The basic idea is you replace your monoid $M$ by a small category that I think Leech calls $D(M)$ but I don't remember. Modules become functors. The objects of $D(M)$ are elements of $M$ and the arrows are more complicated. I think category theorists call it something like Quillen's twisted arrow category or something along those lines. The category structure of $D(M)$ contains a lot of important information about $M$. The problem with the other cohomology theories is that if $e$ is an idempotent of $M$, then $eMe$ has a group of units $G\_e$ and we might want to have our extension do something with $G\_e$ that depends on $e$. More generally, attached to any monoid element $m$ is a group $G\_m$ called the Schutzenberger group of $m$, and to classify extensions of $M$ that are determined by grouplike information you want to allow any Schutzenberger group to be extended. In Leech's category $D(M)$ the automorphism groups of the objects are the Schutzenberger groups of $m$ and your extensions can basically treat all Schutzenberger groups of $D$-classes (=isomorphism classes in $D(M)$) separately. So $H^2$ classifies in Leech theory something much more interesting. Also Leech's theory doesn't suffer these left-right issues or problems caused by zeroes. But I do think it is hard to absorb.


