I would like to understand the following statement that I found in some of Sorger's lecture notes (Lectures on moduli of principal G-bundles over algebraic curves).


Let X be a projective and smooth curve and $G$ a reductive group. 
We have the universal $G$-bundle $\mathcal{E}$ on $Bun\_G(X)\times X$ and we can form the adjoint vector bundle $\mathcal{E}(\mathfrak{g})$ and then the determinant bundle $D\_{\mathcal{E}(\mathfrak{g})}$ on $Bun\_G(X)$ (i.e. $\det(Rp\_\*(\mathcal{E}(\mathfrak{g})))^{-1}$ ). The claim is that this determinant bundle is the canonical bundle on $Bun\_G(X)$.
Could someone explain me how to prove and/or see this?



canonical bundle on the stack of G bundles on a curve
The tangent complex is a complex of quasi-coherent sheaves on $Bun\_G(X)$, i.e. a compatible family of complexes of quasi-coherent sheaves on every affine scheme $f:U\rightarrow Bun\_G(X)$ (i.e. a $G$-bundle $P\_0\rightarrow X\times U$) mapping smoothly.


The global sections $\Gamma(U, f^\* T\_{Bun\_G(X)})$ of the tangent complex over $U$ is the complex associated to the Picard groupoid given by the fiber of $Hom(D\times U, Bun\_G(X))\rightarrow Hom(\mathrm{pt}\times U, Bun\_G(X))$, where $D=\mathrm{Spec}\ \mathbf{C}[\epsilon]/\epsilon^2$. Since this is a *Picard* groupoid, $\pi\_0$ and $\pi\_1$ are abelian groups, which are $H^0$ and $H^{-1}$ of the tangent complex.


One can explicitly describe this groupoid as follows: its objects are $G$-bundles $P\rightarrow X\times U\times D$ together with an isomorphism $P|\_{X\times U\times\mathrm{pt}}\cong P\_0$ on $X\times U$.


$\pi\_1$ computed at the trivial bundle $P=P\_0\times D$ is the group of $G$-equivariant automorphisms $P\rightarrow P$ which commute with the projection to $X\times U\times D$. This is precisely the space of vertical vector fields $\pi\_1=H^0(X\times U, \mathrm{ad}\ P\_0)$.


The computation of $\pi\_0$ is trickier, let me just write down the answer: $\pi\_0=H^1(X\times U, \mathrm{ad}\ P\_0)$. The derivation relies on the fact that there are no deformations over an affine scheme, so you just have to pass to an affine cover of $X\times U$ (see Sam Raskin's [notes](http://www.math.harvard.edu/~gaitsgde/grad_2009/SeminarNotes/Sept22%28Dmodstack1%29.pdf) for details).


So, on each affine $U$ mapping to $Bun\_G(X)$ the tangent complex has cohomology computed by $\mathbf{R}\pi\_\*\ \mathrm{ad}\ P\_0[1]$, where $\pi: U\times X\rightarrow U$. With some work one can show that the actual tangent complex $f^\* T\_{Bun\_G(X)}$ is quasi-isomorphic to $\mathbf{R}\pi\_\*\ \mathrm{ad}\ P\_0[1]$.


Finally, let me explain why this implies that the tangent complex on $Bun\_G(X)$ is $T\_{Bun\_G(X)}=\mathbf{R} p\_\*\ \mathrm{ad}\ \mathcal{E}[1]$ for $p:Bun\_G(X)\times X\rightarrow Bun\_G(X)$. The point is that for nice morphisms of stacks $p$, $\mathbf{R} p\_\*$ can be defined by the usual pushforward for every base change to an affine scheme. See the proof of proposition 2.1.1 [here](http://www.math.harvard.edu/~gaitsgde/GL/QCohtext.pdf).


To conclude, the canonical bundle is the inverse of the determinant of the tangent complex, i.e. $K=det(\mathbf{R} p\_\*\ \mathrm{ad}\ \mathcal{E})$.


