TITLE: Why is the standard definition of cocycle the one that _always_ comes up??
QUESTION [49 upvotes]: This question might not have a good answer. It was something that occurred to me yesterday when I found myself in a pub, needing to do an explicit calculation with 2-cocycles but with no references handy (!).
Review of group cohomology.
Let $G$ be a group acting (on the left) on an abelian group $M$. Then $H^0(G,M)=M^G=Hom_{\mathbf{Z}[G]}(\mathbf{Z},M)$ and hence $$H^i(G,M)=Ext^i_{\mathbf{Z}[G]}(\mathbf{Z},M).$$ Now $Ext$s can be computed using a projective resolution of the first variable, so we're going to get a formula for group cohomology in terms of "cocycles over coboundaries" if we write down a projective resolution of $\mathbf{Z}$ as a $\mathbf{Z}[G]$-module.
There's a very natural projective resolution of $\mathbf{Z}$: let $P_i=\mathbf{Z}[G^{i+1}]$ for $i\geq0$ (with $G$ acting via left multiplication on $G^{i+1}$) and let
$d:P_i\to P_{i-1}$ be the map that so often shows up in this sort of thing: $$d(g_0,\ldots,g_i)=\sum_{0\leq j\leq i}(-1)^j(g_0,\ldots,\widehat{g_j},\ldots,g_i).$$
Check: this is indeed a resolution of $\mathbf{Z}$. So now we have a "formula" for group cohomology.
But it's not the usual formula because I need to do one more trick yet. Currently, the formula looks something like this: the $i$th cohomology group is $G$-equivariant maps $G^{i+1}\to M$ which are killed by $d$ (that is, which satisfy some axiom involving an alternating sum), modulo the image under $d$ of the $G$-equivariant maps $G^i\to M$.
The standard way to proceed from this point.
The "formula" for group cohomology derived above is essentially thought-free (which was why I could get this far in a noisy pub with no sources). But we want something more useful and it was at this point I got stuck. I remembered the nature of the trick: instead of a $G$-equivariant map $G^{i+1}\to M$ we simply "dropped one of the variables", and considered arbitrary maps of sets $G^i\to M$. So we need to give a dictionary between the set-theoretic maps $G^i\to M$ and the $G$-equivariant maps $G^{i+1}\to M$. I could see several choices. For example, given $f:G^{i+1}\to M$ I could define $c:G^i\to M$ by $c(g_1,g_2,\ldots,g_i)=f(1,g_1,g_2,\ldots,g_i)$, or $f(g_1,g_2,\ldots,g_i,1)$, or pretty much anything else of this nature. The point is that given $c$ there's a unique $G$-equivariant $f$ giving rise to it. Which choice of dictionary do we use. Each one will give a definition of group cohomology as "cocycles" over "coboundaries". But which one will give the "usual" definition? Well---in some sense, who cares! But at some point maybe someone somewhere made a decision as to what the convention from moving from $f$ to $c$ was, and now we all stick with it. The standard decision was the rather clunky
$$c(g_1,g_2,\ldots,g_i)=f(1,g_1,g_1g_2,g_1g_2g_3,\ldots,g_1g_2g_3\ldots g_i).$$
Why is the standard definition ubiquitous?
Actually though, I bet that no-one really made that decision. I bet that the notion of a 1-cocycle and a 2-cocycle preceded general homological nonsense, and the dictionary between $f$s and $c$s was worked out so that it agreed with the definitions which were already standard in low degree.
But this got me thinking: if, as it seems to me, there is no "natural" way of moving from $f$s to $c$s, then why do the 1-cocycles and 2-cocycles that naturally show up in mathematics all satisfy the same axioms??. Why doesn't someone do a calculation, and end up with $c:G^2\to M$ satisfying some random axiom which happens not to be the "standard" 2-cocycle axiom but which is an axiom which, under a non-standard association of $c$s with $f$s, becomes the canonical cocycle axiom for $f$ that we derived without moving our brains? Does this ever occur in mathematics? I don't think I've ever seen a single example.
In some sense it's even a surprise to me that there is a uniform choice which specialises to the standard choices in degrees 1 and 2.
Examples of cocycles in group theory.
1) Imagine you have a 2-dimensional upper-triangular representation of a group $G$, so it sends $g$ to the $2\times 2$ matrix $(\chi_1(g),c(g);0,\chi_2(g))$. Here $\chi_1$ and $\chi_2$ are group homomorphisms. What is $c$? Well, bash it out and see that $c$ is precisely a 1-cocycle in the sense that everyone means when they're talking about 1-cocycles. So we must have used the dictionary $c(g)=f(1,g)$ when moving between $c$s and $f$s above. Why didn't we use $c(g)=f(g,1)$? 
2) Imagine you're trying to construct the boundary map $H^0(C)\to H^1(A)$. Follow your nose. Claim: your nose-following will lead you to the standard cocycle representing the cohomology class. Why did it not lead to a non-standard notion? Why do the notions (1) and (2) agree? 
3) Imagine we have a group hom $G\to P/M$ where $M$ is an abelian normal subgroup of the group $P$. Can we lift it to a group hom $G\to P$? Well, let's take a random set-theoretic lifting $L:G\to P$. What is the "error"? A completely natural thing to write down is the map $(g,h)\mapsto L(g)L(h)L(gh)^{-1}$ because this will be $M$-valued. This is a 2-cocycle in the standard sense of the word. Why did the natural thing to do come out to be the standard notion of a 2-cocycle? Aah, you say: there are other natural things that one can try. For example we could have sent $(g,h)$ to $L(gh)^{-1}L(g)L(h)$. For a start this "looks slightly less natural to me" (why does it look less natural? That's somehow the question!). Secondly, this is really just applying a canonical involution to everything: we're inverting on $G$ and inverting on $M$, which is something that we'll always be able to do. It certainly does not correspond to the "more natural" dictionary that I confess I tried down the pub, namely $c(g,h)=f(1,g,h)$, which gave much messier answers. Why does my "obvious" choice of dictionary lead me to 20 minutes of wasted calculations? Why is it "wrong"?
The real question.
Has anyone ever found themselves in a situation where a natural cocycle-like construction is staring them in the face, and they make the construction, and find themselves with a non-standard cocycle? That is, a cocycle which will induce an element of a cohomology group but only after a non-standard dictionary is applied to move from $f$s to $c$s?
Edit: Here is what I hope is a clarification of the question. To turn the cocycles from $G$-equivariant maps $G^{i+1}\to M$ to maps of sets $G^i\to M$ we need to choose a transversal for the action of $G$ on $G^{i+1}$ and identify this with $G^i$. There seems to be one, and only one, way to do this that gives rise to the "standard" definition of n-cocycle that I (possibly incorrectly) percieve to be ubiquitous in mathematics. I call this "the clunky way" because the map seems odd to me. Why is it so clunky? And why, whenever a 2-cocycle falls out of the sky, does it always seem to satisfy the axioms induced by this clunky method? Why aren't there people popping up in this thread saying "well here's a completely natural "cocycle" $c(g,h)$ coming from theory X that I study, and it doesn't satisfy the usual cocycle axioms, we have to modify it to be $c'(g,h)=c(g,gh)$ before it does, and this boils down to the fact that in theory X we would have been better off if history had chosen a non-clunky identification?"

REPLY [14 votes]: Late to the party as usual, but: the goal of this answer is to convince you that the standard convention for $2$-cocycles is so natural that you should consider it perverse to consider any other convention, modulo "applying a canonical involution to everything," as you say. To keep things simple let's only deal with trivial action on coefficients. The motivating question is the following:

What does it mean for a group $G$ to act on a category $C$?

For starters we should attach to each element of $G$ a functor $F(g) : C \to C$. Next we could require that $F(g) \circ F(h) = F(gh)$, but we should really weaken equalities of functors to natural isomorphisms whenever possible. Hence we should attach to each pair of elements of $G$ a natural isomorphism
$$\eta(g, h) : F(g) \circ F(h) \to F(gh).$$
This is the point at which we pick a convention for how we're going to represent $2$-cocycles. Instead of talking about $\eta(g, h)$ we could talk about its inverse; which we choose corresponds to whether we prefer to talk about lax monoidal or oplax monoidal functors, since what we're going to end up writing down is a lax monoidal resp. an oplax monoidal functor from $G$ (regarded as a discrete monoidal category) to $\text{Aut}(C)$ (regarded as a monoidal category under composition). 
In any case, let's stick to the above choice (the lax one). Then the isomorphisms $\eta(g, h)$ should satisfy some coherence conditions, the important one being the "associativity" condition that the two obvious ways of going from $F(g_1) \circ F(g_2) \circ F(g_3)$ to $F(g_1 g_2 g_3)$ should agree.
Now let's assume that in addition all of the functors $F(g)$ are the identity functor $\text{id}_C : C \to C$. Then the only remaining data in a group action is a collection of natural automorphisms
$$\eta(g, h) : \text{id}_C \to \text{id}_C$$
of the identity functor. For any category $C$, the natural automorphisms of the identity functor naturally form an abelian (by the Eckmann-Hilton argument) group which here I'll call its center $Z(C)$ (but this notation is also used for the commutative monoid of natural endomorphisms of the identity). So we get a function
$$\eta : G \times G \to Z(C).$$
The important coherence condition I mentioned above now reduces (again by the Eckmann-Hilton argument) to the condition that for any $g_1, g_2, g_3 \in G$ we have
$$\eta(g_1, g_2) \eta(g_1 g_2, g_3) = \eta(g_2, g_3) \eta(g_1, g_2 g_3)$$
which is precisely the standard cocycle condition. (Coboundaries come in when you ask what it means for two group actions to be equivalent; I'm going to ignore this.) 
The only reason this condition, which recall is in general just the statement that the two obvious ways of going from $F(g_1) \circ F(g_2) \circ F(g_3)$ to $F(g_1 g_2 g_3)$ should agree, could ever have looked anything other than completely natural is that it's a degenerate special case where the sources and targets of the various maps involved have been obscured because they are identical. In particular, of course I could have instead chosen to think about the natural isomorphisms
$$\eta(g, g^{-1} h) : F(g) \circ F(g^{-1} h) \to F(h)$$
(which corresponds to your $f(1, g, h)$), but now

it's no longer at all obvious how to state the associativity condition succinctly, and
this requires that I make explicit use of the fact that $G$ is a group.

The discussion up til now in fact gives a perfectly reasonable definition for what it means for a monoid to act on a category. (If I want to weaken "natural isomorphism" to "natural transformation," though, I get two genuinely different possibilities depending on whether I pick lax or oplax monoidal functors.) 
Reflecting on associativity suggests that, for a more "unbiased" point of view, we should consider families of natural isomorphisms
$$\eta(g_1, g_2, \dots g_n) : F(g_1) \circ F(g_2) \circ \dots \circ F(g_n) \to F(g_1 g_2 \dots g_n)$$
and then impose a "generalized associativity" condition that every way of composing them to get a natural isomorphism with the same source and target as $\eta(g_1, g_2, \dots g_n)$ should give $\eta(g_1, g_2, \dots g_n)$. Another way to say this is that the cocycle condition (in the $F(g) = \text{id}_C$ special case, at least) should really be written
$$\eta(g_1, g_2, g_3) = \eta(g_1, g_2) \eta(g_1 g_2, g_3) = \eta(g_2, g_3) \eta(g_1, g_2 g_3).$$
This is in the same way that we can consider a monoid operation to be a family $m(g_1, g_2,  \dots g_n) = g_1 g_2 \dots g_n$ of operations satisfying a generalized associativity condition, and in particular satisfying
$$m(g_1, g_2, g_3) = m(m(g_1, g_2), g_3) = m(g_1, m(g_2, g_3)).$$
Namely, by "associativity" we usually mean that the middle expression equals the right, but really the reason that the middle expression equals the right is that they both equal the left.