Deformation theory of representations of an algebraic group For an algebraic group G and a representation V, I think it's a standard result (but I don't have a reference) that


*

*the obstruction to deforming V as a representation of G is an element of H2(G,V⊗V*)

*if the obstruction is zero, isomorphism classes of deformations are parameterized by H1(G,V⊗V*)

*automorphisms of a given deformation (as a deformation of V; i.e. restricting to the identity modulo your square-zero ideal) are parameterized by H0(G,V⊗V*)


where the Hi refer to standard group cohomology (derived functors of invariants). The analogous statement, where the algebraic group G is replaced by a Lie algebra g and group cohomology is replaced by Lie algebra cohomology, is true, but the only proof I know is a big calculation. I started running the calculation for the case of an algebraic group, and it looks like it works, but it's a mess. Surely there's a long exact sequence out there, or some homological algebra cleverness, that proves this result cleanly. Does anybody know how to do this, or have a reference for these results? This feels like an application of cotangent complex ninjitsu, but I guess that's true about all deformation problems.
While I'm at it, I'd also like to prove that the obstruction, isoclass, and automorphism spaces of deformations of G as a group are H3(G,Ad), H2(G,Ad), and H1(G,Ad), respectively. Again, I can prove the Lie algebra analogues of these results by an unenlightening calculation.
Background: What's a deformation? Why do I care?
I may as well explain exactly what I mean by "a deformation" and why I care about them. Last things first, why do I care? The idea is to study the moduli space of representations, which essentially means understanding how representations of a group behave in families. That is, given a representation V of G, what possible representations could appear "nearby" in a family of representations parameterized by, say, a curve? The appropriate formalization of "nearby" is to consider families over a local ring. If you're thinking of a representation as a matrix for every element of the group, you should imagine that I want to replace every matrix entry (which is a number) by a power series whose constant term is the original entry, in such a way that the matrices still compose correctly. It's useful to look "even more locally" by considering families over complete local rings (think: now I just take formal power series, ignoring convergence issues). This is a limit of families over Artin rings (think: truncated power series, where I set xn=0 for large enough n).
So here's what I mean precisely. Suppose A and A' are Artin rings, where A' is a square-zero extension of A (i.e. we're given a surjection f:A'→A such that I:=ker(f) is a square-zero ideal in A'). A representation of G over A is a free module V over A together with an action of G. A deformation of V to A' is a free module V' over A' with an action of G so that when I reduce V' modulo I (tensor with A over A'), I get V (with the action I had before). An automorphism of a deformation V' of V as a deformation is an automorphism V'→V' whose reduction modulo I is the identity map on V. The "obstruction to deforming" V is something somewhere which is zero if and only if a deformation exists.
I should add that the obstruction, isoclass, and automorphism spaces will of course depend on the ideal I. They should really be cohomology groups with coefficients in V⊗V*⊗I, but I think it's normal to omit the I in casual conversation.
 A: Here's not a complete answer, but I think an enlightening trick.  Deformations of V over the dual numbers are always in bijection with Ext1(V,V) in any abelian category.  The trick is that if you have a deformation V', you have a long exact sequence:
Hom(V,V) -> Hom(V',V) -> Hom(V,V) -> Ext1(V,V) -> Ext1(V',V) -> Ext1(V,V) -> Ext2(V,V)
You can see that the extension splits if and only if the image of the identity under the boundary map is trivial (using Baer sum, you can extend this trick to show that two extensions are isomorphic if and only if the image of the identity is the same).
I think the obstruction in Ext2(V,V) you had in mind is the image of that class under the next boundary map, by a similar argument.
A: I will offer a sketch of an argument, and maybe someone who knows what a stack is can make it happen for real.  There is probably a non-stacky deformation theory of commutative Hopf algebras, but I don't know what it looks like.
Deforming G as a group should be the same as deforming BG as a plain old geometric object.  Pulling back a point in BG along a cover by a point is very roughly taking a based loop space, and the deformed loop space comes with the deformed composition law.  Similarly, deforming a representation of G should be the same as deforming a sheaf on BG.
I'm going to assume G is smooth.  Then the tangent complex of BG mapping to a point is just the sheaf Ad, concentrated in degree 1.  If we boldly assume that deformation theory of/on stacks works just like deformations of/on schemes, but maybe with some degree shifts, we should get the answers you want.  For deforming G in particular, there is a canonical class in H^2(BG, Ad[-1]) that classifies obstructions, and if that vanishes, H^1(BG, Ad[-1]) classifies deformations and H^0(BG, Ad[-1]) classifies automorphisms of a deformation.  When deforming the sheaf V, one usually sees the sheaf End(V) written as coefficients.
Olsson wrote a paper on deformations of representable morphisms of stacks, and while the morphism BG -> S isn't representable, one might benefit from asking the author for additional details if one were, say, working in the same building as he.
A: About what Anton said at the end about deformations of a group.    Let $m_0$ be the standard multiplication.  Then I want to consider a deformation of the form $m:(G \times \epsilon \mathfrak{g}) \times (G \times \epsilon \mathfrak{g}) \to G \times \epsilon \mathfrak{g}$ where $m(g_1, g_2) = m_{0}(g_1,g_2) + \epsilon m_1 (g_1,g_2)$.  When you write out the associativity condition $m\circ (m \times 1) = m \circ (1 \times m)$ it seems that you find that 
$(g_1,g_2) \mapsto (m_{1}(g_{1},g_{2}))(g_{1}g_{2})^{-1}$ is a group cohomology cocycle for G acting on $\mathfrak{g}$ by the adjoint representation.  Now one has to identify $H^{2}(G,Ad)$ with $H^{2}(BG,Ad)$ (taking care of the topology somehow).
A: A representation of G on a vector space V is a descent datum for V, viewed as a vector bundle over a point, to BG.  That is, linear representations of G are "the same" as vector bundles on BG.  So the question is equivalent to the analogous question about deformations of vector bundles on BG.  We could just as easily ask about deformations of vector bundles on any space X.
Given a vector bundle V on X, consider the category of all first-order deformations of V.  An object is a vector bundle over X', where X' is an infinitesimal thickening (in the example, one may take X = BG x E where E is a local Artin ring and X' = BG x E' where E' is a square-zero extension whose ideal is isomorphic as a module to the residue field).  A morphism is a morphism of vector bundles on X' that induces the identity morphism on V over X.
If X is allowed to vary, this category varies contravariantly with X.  Vector bundles satisfy fppf descent, so this forms a fppf stack over X.
This stack is very special: locally it has a section (fppf locally a deformation exists) and any two sections are locally isomorphic.  It is therefore a gerbe.  Moreover, the isomorphism group between any two deformations of V is canonically a torsor under the group End(V) (this is fun to check).  
Gerbes banded by an abelian group H are classified by H^2(X,H) (this is also fun to check); the class is zero if and only if the gerbe has a section.  If the gerbe has a section, the isomorphism classes of sections form a torsor under H^1(X,H).  The isomorphisms between any two sections form a torsor under H^0(X,H).  (This implies that the automorphism group of any section is H^0(X,H).)
In our case, H = End(V), so we obtain a class in H^2(X,End(V)) and if this class is zero, our gerbe has a section, i.e., a deformation exists.  In this case, all deformations form a torsor under H^1(X,End(V)), and the automorphism group of a deformation is H^0(X,End(V)).
All of the cohomology groups above are sheaf cohomology in the fppf topology.  If you are using a different definition of group cohomology, there is still something to check.
A: The statements about the group and Lie algebra in the question are special cases of a more general fact. 
Namely, if $A$ is an associative algebra and $V$ an $A$-module, then obstructions to deformations of $V$ lie in the Hochschild cohomology group $HH^2(A,{\rm End}(V))$, 
freedom of deformation in $HH^1(A,{\rm End}(V))$, and infinitesimal automorphisms 
in $HH^0(A,{\rm End}(V))$. This is rather easy to check using the bar complex. 
Now, the statement for Lie algebras is the special case $A=U({\mathfrak g})$, recalling that for any $U({\mathfrak g})$-bimodule $M$,
$$
HH^\ast (U({\mathfrak g}),M)=H^\ast({\mathfrak g},M_{ad}).
$$
Similarly, for affine algebraic groups, it is the special case $A=O(G)^\ast$, where $O(G)$ is the coalgebra of regular functions, recalling that for any (algebraic) $G$-bimodule $M$,
$$
HH^\ast(O(G)^\ast,M)=H^\ast(G,M_{ad}).
$$ 
