BRST cohomology I am reading some work on Mirror Symmetry from Physics perspective,the physicists seem to use some aspects of BRST quantization and BRST cohomology.  What is BRST Quantization and BRST cohomology, in realm of Mathematics. More precisely, 
What are the BRST complexes, how do we get this cohomology, what is the relation (if any) of this cohomology theory to say de Rham or Cech cohomology. Where do the mathematicians use this theory. What is it in context of $N =2 $ Superconformal field Theory, most relevant for Mirror Symmetry.
I appreciate both physics and mathematical ideas.
 A: There is no way I will be able to answer all of your questions, so instead I will focus on just a tiny part, and try at least to explain "BRST integrals".  Much of what I say is probably well-known, but I am also in the process of writing up some conversations on this and related topics with Dan Berwick Evans, and if there's anything here that's new, then it is joint work with him :)  For many basic ideas and definitions, I am also indebted to Rajan Mehta, as well as to other people here on MO and in person.
Recall that a (Lie) algebroid consists of the data of the following data:


*

*A smooth manifold $X$

*A vector bundle $A \to X$

*A Lie bracket $[,]: \Gamma(A)^{\wedge 2} \to \Gamma(A)$

*A map of vector bundles $\rho : A \to {\rm T}X$


The Lie bracket need not be $\mathcal C^\infty(X)$-linear — rather, for $a,b \in \Gamma(A)$ and $f\in \mathcal C^\infty(X)$, we require that $[a,fb] = \rho(a)[f] \cdot b + f\cdot [a,b]$, where $\rho(a)[f]$ is the action of the vector field $\rho(a) \in \Gamma({\rm T}X)$ on $f$.
There are two main examples of Lie algebroids:


*

*Any integrable subbundle of the tangent bundle ${\rm T}X$ is an algebroid

*If $\mathfrak g$ is a Lie algebra acting on a manifold $X$, then the action equips the trivial vector bundle $\mathfrak g \times X$ with an algebroid structure.


Recall also that a graded vector space is a (real) vector space $V = \bigoplus_{n\in \mathbb Z} [n]V_n$, where $V_n$ is a classical vector space and the functor $[n]$ means "put it in degree $n$".  The category of graded vector spaces is equivalent to the category of $U(1)$-modules.(Edit: As Scott Carnahan points out in the comments, complex graded vector spaces are equivalent to $U(1)$-modules, but real graded vector spaces are not.  To a physicist, the idea is that a graded vector space has a "charge" or "energy" or "number" or whatever you want to call it operator, which is quantized to only take integer values, and this is often called a "$U(1)$ gauge group".)
This category has a symmetric tensor product, which is the same tensor product as in the category of $U(1)$-modules, but with the Koszul sign rule: if $a\in [m]V_m$ and $b\in [n]W_n$, then the canonical isomorphism $[m]V_m \otimes [n]W_n \to [n]V_n \otimes [m]W_n$ is the one that takes $a\otimes b$ to $(-1)^{mn}b\otimes a$.  Given a (finite-dimensional) graded vector space $V$, the algebra of polynomial functions on $V$ is the symmetric algebra (with respect to the Koszul rule) on its dual.  The algebra of smooth functions on $V$ is the completion of this algebra with respect to the natural Frechet topology: $\mathcal C^{\infty}(V) = \widehat{{\rm S}V^*}$.  (In particular, the generator of $\mathcal C^{\infty}([n]\mathbb R)$ is in degree $-n$.)  By partitions of unity, this is a sheaf over $[0]V_0$.
Finally, recall that a graded manifold is a manifold $X$ and a sheaf of algebras over $X$ that looks locally like the sheaf of smooth functions on a graded vector space.  Every graded manifold is "affine": to present the whole sheaf, you just have to present the algebra of all smooth functions.  The category of graded manifolds behaves much like the category of manifolds.  The "shift" functors extend to functors of vector bundles: if $A \to X$ is a vector bundle of (graded) manifolds, then $[n]_XA \to X$ is the vector bundle with the same base, but all fibers shifted by $n$.
A Q-manifold is a graded manifold $X$ along with a square-zero degree-one vector field, i.e. a derivation $Q$ of the algebra $\mathcal C^\infty(X)$ which shifts all homogeneous elements up one degree, and with $Q\circ Q = \frac12 [Q,Q] = 0$.  (The "commutator" $[Q,Q]$ is taken with respect to the Koszul rule.)  Equivalently, a Q-manifold is something so that $(\mathcal C^\infty(X),Q)$ is a dgca.
Any algebroid gives rise to a Q-manifold, by some form of Koszul duality: if $(A\to X,[,],\rho)$ is a (classical) algebroid, then $[-1]_XA$is naturally a Q-manifold.  Let $x^i$ be coordinates on $X$ and $a^\mu$ fiber coordinates on $[-1]_XA$ with corresponding sections $a_\mu(x) \in \Gamma(A)$, and adopt the Einstein summation convention.  Suppose that the Lie bracket is given by the structure constants $[a_\mu(x),a_\nu(x)] = E_{\mu,\nu}^\lambda(x) a_\lambda(x)$, and that $\rho(a)(x) = \rho^i_\mu(x) a^\mu \frac{\partial}{\partial x^i}$.  Then:
$$ Q = \rho^i_\mu(x) a^\mu \frac{\partial}{\partial x^i} + \frac12 E_{\mu,\nu}^\lambda(x) a^\mu a^\nu \frac{\partial}{\partial a^\lambda}$$
Every Q-manifold $X$ for which $\mathcal C^\infty(X)$ is generated by elements of degrees $0$ and $1$ is of this form in a canonical way.
More generally, and I won't explain this in detail, any $\infty$-algebroid gives a Q-manifold.  An $\infty$-algebroid consists of a chain complex $0 \to A_n \to \cdots \to A_1 \to 0$ of vector bundles over $X$, along with various "brackets" of different degrees satisfying compatibility conditions, and also with an "action" $\rho : A_1 \to {\rm T}X$.  Then $\bigoplus_X [-n]A_n$ is a Q-manifold in a natural way.  A Lie-Reinhardt pair is a slightly more general thing than an algebroid — the only difference is that we do not require $A \to X$ to be a vector bundle, but only that $\Gamma(A)$ be a (quasicoherent?) sheaf over $\mathcal C^\infty(X)$.  Then the theory of Lie-Reinhardt pairs is sufficiently geometric that there's a good "infinitized" version of it, and $\infty$-algebroids are the nice version (in the way that vector bundles are nicer than sheaves).  The upshot is that $\infty$-LR-pair structures move well across quasiisomorphisms of chain complexes of sheaves.  In particular, if $X$ is an algebraic manifold and $\mathcal D \subseteq \Gamma({\rm T}X)$ an algebraic integrable subsheaf, then by Hilbert-Syzygy it has a finite resolution in vector bundles, which gives a Q-manifold.
But, anyway, let me continue to talk about just plain algebroids $A\to X$, and their associated Q-manifolds $[-1]A$.  Then $\mathcal C^\infty([-1]A)$ is dgca, as I said, and mathematicians will recognize it as the "Chevalley-Eilenberg complex of $A$", or "the complex that computes Lie algebroid cohomology".  In the two examples above, this algebra is:


*

*For $A = {\rm T}X$, $\mathcal C^\infty([-1]{\rm T}X)$ is nothing but the de Rham complex

*For "action algebroids" $A = \mathfrak g \times X$, then $\mathcal C^\infty([-1]A)$ is precisely the Chevalley-Eilenberg complex of $\mathfrak g$ with coefficients in $\mathcal C^\infty(X)$.


From a mathematician's point of view, the BRST construction is nothing more nor less than a different construction that computes the same cohomology.  In particular:
There is a "forgetful" functor from Q-manifolds to graded manifolds, and its right adjoint is precisely $X \mapsto [-1]{\rm T}X$.  Let $M$ be a Q-manifold (e.g. $M = [-1]A$ for an algebroid $A$), and $M \to X$ a map of graded manifolds, and let $B \to X$ be a submersion of graded manifolds.  By the adjunction, we get a diagram:
$$ \begin{matrix}
 && M \\
 && \downarrow \\
 [-1]{\rm T}B & \rightarrow & [-1]{\rm T}X
\end{matrix} $$
The bottom arrow is a submersion since $B \to X$ is.  The pullback of this diagram in the category of Q-manifolds is the "Q-manifold pullback of $A$ along $B\to X$".  If $M = [-1]A$ for an algebroid $A\to X$, and if $B\to X$ are classical manifolds, then the pullback is naturally an algebroid over $B$.
Let $B \to X$ be a vector bundle now, which is certainly a submersion.  The Euler vector field is the (degree-zero) vector field on $B$ that generates the $\mathbb R^\times$ action (so in particular it points in the fibers of $B$).  It gives rise to a contraction of chain complexes at the level of $[-1]{\rm T}$: the map $B \to X$ determines a map $\mathcal C^\infty([-1]{\rm T}B) \leftarrow \mathcal C^\infty([-1]{\rm T}X)$, which is actually a quasiisomorphism.  (I.e.: the de Rham cohomology of the total space of a vector bundle is the same as the de Rham cohomology of the base.)  Moreover, if $D$ is the pullback of a Q-manifold $M$ along a vector bundle $B \to X$, then $D,M$ are also quasi-iso.
Thus, if you are interested in the cohomology of some Q-manifold $M$, you are free to pull it back.  (Any graded manifold $M$ has a classical-manifolds "base" $X$, which is the vanishing locus of the functions in nonzero degrees, and there always exists a map $M \to X$, although it is not usually canonical.  But often $M$ comes as a vector bundle over $X$ — in the algebroid and $\infty$-algebroid cases, for example, it does.)
In applications, we have $M = [-1]A$ for an algebroid $A \to X$, and usually $A = \mathfrak g \times X$.  When $\mathfrak g = \operatorname{Lie}(G)$ for $G$ a simply-connected connected compact Lie group, the cohomology of $M$ computes the "equivariant cohomology of $G$ acting on $M$", so this is definitely something people care about.
So much for geometry: physicists want to compute integrals.  A good notion of measure with compact support on a (graded) manifold $X$ is a continuous linear functional $\mathcal C^\infty(X) \to 0$.  Temporarily, let $X$ be a (graded) vector space, and $\langle,\rangle$ symmetric (in the Koszul sense) pairing on $X$, represented by the matrix $\langle x,y\rangle = x^T p x$.  Then we would like to have, at least for "smooth" measures $\mu$, a "Gauss" formula: $$\left( \int_{x\in X} \exp( \frac12 \langle x,x \rangle) \mu(x)\right)^2 \to \frac{\#}{\det p} $$
as the support of $\mu$ expands, 
where $\#$ depends on the dimension of $X$ (and the normalization of the measure), and $\det$ is the "super" determinant.  When $p$ is nondegenerate, we can achieve this, but we cannot have a good theory of continuity: in $[0]\mathbb R^2 \oplus [-1]\mathbb R^2$, we have:
$$ \det \left( \begin{array}{cc|cc} \alpha &&& \\ & \alpha && \\ \hline &&& \beta \\ && -\beta & \end{array}\right) = \frac{\alpha^2}{\beta^2} $$
and so there are many paths of symmetric (in the Koszul sense) matrices that tend to $0$, say, with different determinants.
In particular, the action on $\mathbb R^2$ by itself by translation, which is represented by the Q-manifold with underlying graded manifold $X = [0]\mathbb R^2 \oplus [-1]\mathbb R^2$, should have volume $1$, as it should be the same as the quotient of $\mathbb R^2$ by its translation, but we cannot compute $\int_X 1 = \int_X \exp(0) = \frac 0 0$.
Well, we can if we remember that Q-manifolds put restrictions on which functions are "physical".  Namely, really only the "Q-closed" functions — those $f$ with $Q[f] = 0$ — correspond to "physical observables".  So a better definition of a "measure" is a continuous linear functional from the algebra of closed functions to $\mathbb R$.  Moreover, we really should insist that the measure by invariant under the action of $Q$; this condition is the same as the condition that the continuous linear functional vanishes on exact functions.  So: the space of Q-measures on a Q-manifold $M$ is precisely the continuous linear dual to the cohomology of $\mathbb C^\infty(M)$ with respect to the Q-structure.
So, what's the point?  Often, you want to do an oscillating integral of the form $\int \exp(\frac i \hbar s)$.  If $s$ has a nondegenerate critical point, you're in business: you apply the method of stationary phase, and the Feynman/Dyson diagrammatics, and you can really compute things.  But if the critical point of $s$ is degenerate, you're stuck.  Well, almost: you should try to change $s$.  Suppose that you're on a Q-manifold $X$, that $s\in \mathcal C^\infty(X)$ is closed, and that $t \in \mathcal C^\infty(X)$ is exact, and that you're working with respect to a Q-measure.  Then you can check for yourself (hint: do the case when $t$ is infinitesimal) that $\int\exp(\frac i \hbar s) = \int \exp( \frac i \hbar (s+t))$.  So: maybe you can find a $t$ so that $s+t$ has a nondegenerate critical point?
In general, a Q-manifold does not have enough exact functions for this to be viable.  But the point is that measures only see cohomology, so you are free to move to a quasi-isomorphic manifold.  (Functions pull back but measures push forward, so you really do want the quasi-iso property.)  Then you often can win.
In applications, it goes like this.  Let $A \to X$ be an algebroid, $s\in \mathbb C^\infty(X)$ invariant under the $A$-action, and suppose that it has an isolated critical orbit.  Let $M = [-1]A$, $B = [1]A^*$, and form the pullback as above.  Pick any degree-$(-1)$ function $\tau$ on $B$, which is the same as picking a section of $A$, and let $t = Q[\tau]$ be your exact function.  One reason I picked this $B$ is that the degree-zero measures on the pullback (the ones that assign non-zero values to degree-zero functions) can be represented in the form ${\rm d}x^1 \cdots$, and so we can do computations, whereas the cohomologous measures on $M$ cannot be.  Anyway, we wanted $s+t$ to have a nondegenerate critical point.  This happens (in the generic situation) when the vanishing locus of $\tau$ intersects the critical orbit of $s$ transversally.
If you write out what the total integral of $\exp(\frac i \hbar (s+t))$ is over the pullback, you can identify the components (up to Fourier and some arguments at a "physical" level of rigor) with an integral over $X$ of $\exp(\frac i \hbar s)$ against a delta distribution supported on the zero locus of $\tau$ (and there's the correct Jacobi term thrown in).  This delta-distribution integral is what Faddeev and Popov originally did — the BRST argument that I've sketched came later, and I think that "algebroid" language is pretty new.
A: Stepping back from the 'oid and Theo's fascinating answer, I thought I would try to complement it -- after all, the title of my PhD thesis (PDF file) did contain the phrase BRST cohomology.  It also allows me to expand on my answer to this earlier MO question.
For the impatient let me start with a slogan:

BRST is symplectic reduction

Of course, like all slogans this is an oversimplification, but I hope that it gets the main point across.
Let's consider for definiteness a finite-dimensional symplectic manifold $(M,\omega)$ and a connect Lie group $G$ acting on $M$ via symplectomorphisms.  Let us assume, for simplicity, that for every $X \in \mathfrak{g}$, the Lie algebra of $G$, the fundamental vector field on $M$ is hamiltonian and moreover that the map $\mathfrak{g} \to C^\infty(M)$ is a Lie algebra homomorphism, where the Lie algebra structure on $C^\infty(M)$ is given by the Poisson bracket.  In other words, the action of $G$ gives rise to an equivariant moment mapping $\Phi: M \to \mathfrak{g}^*$.
Symplectic reduction is a procedure by which we go from $(M,\omega)$ to a lower-dimensional symplectic manifold $(\tilde M, \tilde \omega)$ and it consists of two steps:


*

*we restrict to the submanifold $M_0 = \Phi^{-1}(0)$, i.e., the zero-momentum submanifold, and

*we descend to the quotient $\tilde M = M_0/G$ with the induced symplectic structure $\tilde \omega$ defined by
$$ \pi^* \tilde \omega = \imath^*\omega $$
where $\pi: M_0 \to \tilde M$ and $\imath: M_0 \to M$ are the natural projection and embedding, respectively.
(This assumes for simplicity that $0$ is a regular value of the moment map and that $G$ acts on $M_0$ in such a way that the quotient is smooth.)
In the simplest case, BRST cohomology is a cohomology theory which yields $C^\infty(\tilde M)$ from $C^\infty(M)$.  It is the cohomology of the total differential of a double complex consisting horizontally of the Koszul complex which defines a resolution of $C^\infty(M_0)$ in terms of free $C^\infty(M)$-modules, and vertically of the Chevalley--Eilenberg complex computing the cohomology of the Lie algebra $\mathfrak{g}$ with coefficients in the $C^\infty(M)$-modules in the Koszul resolution.  The main theorem is the isomorphism
$$H^0_{\mathrm{BRST}}(C^\infty(M)) \cong C^\infty(\tilde M)$$
as Poisson algebras.
This admits a number of generalisations: to not-necessaarily finite-dimensional Poisson manifolds and where there is no group action but just a coisotropic distribution; what in the Physics literature goes by the name of first-class constraints, a nomenclature due to Dirac.
The real power of BRST cohomology lies in the fact that the BRST complex is a complex of Poisson algebras and the differential is an inner Poisson derivation.  This means that it is amenable to quantisation and that is the use to which it is put in the literature mentioned by the OP.
The problem is to quantise a constrained hamiltonian system $(M,\omega)$ whose reduced "phase space" is the symplectic quotient $(\tilde M, \tilde\omega)$.  This means that the physical dynamics are those in $(\tilde M, \tilde \omega)$ and hence that is the classical system one ought to be quantising.  Alas, this is usually difficult: firstly, quantisation is intrinsically difficult but also $(\tilde M, \tilde \omega)$ is usually geometrically complicated.  BRST gives a way to do this by quantising the usually simpler system $(M,\omega)$ and then take the quantum BRST cohomology:
$$
\matrix{C^\infty(M) & \stackrel{\mathrm{quant}}{\longrightarrow} & \mathcal{H}\cr
\downarrow & & \downarrow\cr
C^\infty(\tilde M) & \stackrel{\mathrm{quant}}{\longrightarrow} & \tilde{\mathcal{H}} \cr}
$$
where the horizontal arrows are quantisations and the vertical arrows are (zeroth degree) BRST cohomology: classical in the left and quantum in the right.
The virtues of the "north-east" path is that we get to quantise a simpler system and that symmetries are usually preserved.  In the Physics literature this goes by the name of "covariant quantisation".  This is particularly useful in the quantisation of the bosonic and NSR strings and their brethren.
