TITLE: Why does non-abelian group cohomology exist?
QUESTION [37 upvotes]: If $K$ is a non-abelian group on which a group $G$ acts via automorphisms, we can define 1-cocycles and 1-coboundaries by mimicking the explicit formulas coming from the bar resolution in ordinary group cohomology, and thus we have a reasonable notion of $H^1(G, K)$.
It turns out we have a part of the expected long exact sequence, until this construction breaks down for building $H^i$ when $i > 1$, where the long exact sequence stops. There are other analogues to ordinary group cohomology as well. The only proof I've ever seen of any of this is by hand. Is there some deeper explanation of why non-abelian group cohomology exists (and then ceases to exist)?

REPLY [22 votes]: A concrete and arithmetically useful way to interpret it without appeal to explicit cocycle formulas is to express everything in the language of torsors.  More specifically, for arithmetic purposes if the group G is Gal(F'/F) for a Galois extension F'/F and if the group K is H(F') for an F-group scheme H of finite type and K is equipped with the evident left G-action then ${\rm{H}}^1(G,K)$ is the set of isomorphism classes of H-torsors over F which split over F' (i.e.,, admit an F'-rational point).  The low-degree exact sequence can then be expressed entirely in such terms, using pushouts and pullbacks with torsors. (Implicit in the argument is effectivity of Galois descent for H-torsors, which uses that H is quasi-projective over F.)
This is useful in settings as varied as H an abelian variety and H a linear algebraic group, and even the non-smooth case. In fact, when using non-smooth H it is rather restrictive to use Galois cohomology (but not unnatural if studying Tate-Shafarevich sets with coefficients in an Aut-functor, such as for a projective variety), and in such cases the "right" variant that is often more useful is to work with torsors for the fppf topology over F. The torsor viewpoint also gives a useful perspective when working over richer base rings than fields, such as rings of S-integers in a global field, even in the case of a smooth coefficient group (over the ring of S-integers), for which the etale topology is "enough". See section 5.3 in Chapter I of Serre's book on Galois cohomology for the Galois case, Milne's "Etale cohomology" book for generalization with flat and 'etale topologies, and Appendix B in my paper on "Finiteness theorems for algebraic groups over function fields" for a concrete fleshing out of the dictionary between the torsor and Galois languages (where I work with affine group schemes, due to the context of that paper).
Some papers of Mazur and Grothendieck (not as co-authors...) on abelian varieties make creative use of the torsor viewpoint when working with Tate-Shafarevich groups.  The exact sequence for Brauer groups in global class field theory also has a useful interpretation via torsors; see Grothendieck's papers on Brauer groups for more in that direction (and  somewhere in there he also discusses Tate-Shafarevich). Beware that when the base is not a field (or even when it is a field but we relax "quasi-projective" to "locally finite type" on $H$, such as for Aut-schemes of projective or proper varieties) then effectivity of descent for torsors is not at all clear, even with quasi-projective hypotheses, and so the torsors often need to be understood to be taken in the category of algebraic spaces (for which fppf descent is always effective).  In the Néron Models book they have a discussion (somewhere in Chapter 6, I think) on effectivity of descent for torsors if one wishes to avoid algebraic spaces (under suitable hypotheses on the "coefficient group"), but working with algebraic spaces isn't so bad once one gets used to them and it is a more natural setting due to their better general behavior with respect to descent.