Weyl anomaly in 2d CFT (string theory lectures by D.Tong) In his lectures on String Theory (http://www.damtp.cam.ac.uk/user/tong/string.html), Tong gives a proof of the Weyl anomaly, using equation $(4.37)$. It seems wrong to me.
Here he uses the OPE between the stress-energy tensors $T_{zz}T_{ww}$  obtained when trace vanishes, i.e. $T_{z \bar{z}} = 0$: this implies that they are holomorphic functions $T_{zz} = T_{zz}(z)$.
But in this proof he starts from the fact that $T_{z \bar{z}} \neq 0$ (we want to proof this thing after all) and so $T_{zz}$ is not a holomorphic function anymore! In the OPE $(4.37)$ I should have also terms with $(\bar{z}- \bar{w})$.
I can't also understand why he uses in the rest of the proof only the singular term $(z-w)^{-4}$, neglecting the subleading terms $(z-w)^{-2}$, $(z-w)^{-1}$.
(The same proof is given in these lectures https://arxiv.org/abs/1511.04074 on conformal field theory, equation $(6.9)$).
I'll be really thankful if someone could explain me this proof :)
 A: 
TL;DR. The main point is that Tong only needs to identify the leading singularity in order to determine the Weyl anomaly

$$ \langle T^{\alpha}{}_{\alpha}\rangle~=~-\frac{c}{12} R^{(2)}. \tag{4.35}  $$
Concerning OP's question it is indeed unclear how to properly account for subleading terms in Tong's approach. They are presumably either contact terms or vanish on-shell.
Let us introduce a regulator $\varepsilon>0$ in the $XX$ OPE
$$\begin{align} {\cal R} X(z,\bar{z})X(w,\bar{w})~=~&-\frac{\alpha^{\prime}}{2} \ln(|z-w|^2+\varepsilon)\cr
&+~: X(z,\bar{z})X(w,\bar{w}): \end{align}\tag{4.22}$$
to better identify the singular structure. The $\partial X\partial X$ OPE becomes:
$$\begin{align} 
{\cal R} \partial_zX(z,\bar{z})& \partial_wX(w,\bar{w}) \cr
~\stackrel{(4.22)}{=}&~-\frac{\alpha^{\prime}}{2}\frac{(\bar{z}-\bar{w})^2}{(|z-w|^2+\varepsilon)^2}\cr
&~+~:\partial_zX(z,\bar{z}) \partial_wX(w,\bar{w}): ~.\end{align} \tag{4.23}$$
The stress-energy-momentum tensor is
$$ T_{zz}~~=~ -\frac{1}{\alpha^{\prime}} :\partial_zX\partial_zX:~.\tag{4.25} $$
The $TT$ OPE becomes
$$ \begin{align} 
{\cal R}T_{zz}(z,\bar{z}) &T_{ww}(w,\bar{w})\cr 
~\stackrel{(4.23)+(4.25)}{=}&~\frac{c}{2}\frac{(\bar{z}-\bar{w})^4}{(|z-w|^2+\varepsilon)^4} \cr
&-\frac{2}{\alpha^{\prime}} \frac{(\bar{z}-\bar{w})^2}{(|z-w|^2+\varepsilon)^2}:\partial_zX(z,\bar{z}) \partial_wX(w,\bar{w}):\cr
&+~\ldots. \end{align}\tag{4.28}$$
We next use the energy conservation
$$ \partial_z T_{\bar{z}z} + \partial_{\bar{z}} T_{zz}~\approx~0, \tag{4.36z}$$
which holds on-shell up to contact terms.
We calculate$^1$
$$ \begin{align} {\cal R}\partial_z T_{z\bar{z}}(z,\bar{z})
&\partial_wT_{w\bar{w}}(w,\bar{w}) \cr 
~\stackrel{(4.36z)}{\approx}&~{\cal R}\partial_{\bar{z}} T_{zz}(z,\bar{z})\partial_{\bar{w}}T_{ww}(w,\bar{w})\cr
~\stackrel{(4.28)}{=}&~
\partial_{\bar{z}}\partial_{\bar{w}} \left[ \frac{c}{2} \frac{(\bar{z}-\bar{w})^4}{(|z-w|^2+\varepsilon)^4} +\ldots \right] \cr
~=~&\partial_{\bar{w}} \left[ 2c \frac{\varepsilon(\bar{z}-\bar{w})^3}{(|z-w|^2+\varepsilon)^5} +\ldots \right] \cr
~=~&\frac{c}{12}\partial_{\bar{w}}\partial_z\partial_w\partial_z\frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}+\ldots, 
\end{align}\tag{4.37}$$
which leads to the sought-for OPE
$$\begin{align}
{\cal R}T_{z\bar{z}}(z,\bar{z}) &T_{w\bar{w}}(w,\bar{w}) \cr
~\stackrel{(4.37)}{=}&~\frac{c}{12}\partial_z\partial_{\bar{w}}\frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}+\ldots  \cr
~\stackrel{(4.2d)}{=}&~\frac{c\pi}{12}\partial_z\partial_{\bar{w}}\delta^2(z\!-\!w,\bar{z}\!-\!\bar{w})  +\ldots .
\end{align} \tag{4.39}$$
Here we use the following representation of the 2D Dirac delta distribution$^2$
$$\begin{align} \delta^2(z\!-\!w,\bar{z}\!-\!\bar{w})~:=~&
\delta({\rm Re} (z\!-\!w))~\delta({\rm Im} (z\!-\!w))\cr
~=~&\lim_{\varepsilon\searrow 0^+} \frac{1}{\pi}\frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}. \end{align} \tag{4.2d}$$
Now proceed as in Tong's notes. $\Box$
References:

*

*D. Tong, Lectures on String Theory; Subsection 4.4.2.

--
$^1$ Tong's trick (4.37) suggests another route: Let us instead consider the $\partial X \bar{\partial}X$ OPE
$$\begin{align}
\left. \begin{array}{c} 
{\cal R} \partial_zX(z,\bar{z}) 
\partial_{\bar{w}}X(w,\bar{w})\cr\cr
{\cal R} \partial_{\bar{z}}X(z,\bar{z}) \partial_wX(w,\bar{w})\end{array}\right\}
~=~&\frac{\alpha^{\prime}}{2}\frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}+\ldots
\cr
~\stackrel{(4.2d)}{=}&~\frac{\alpha^{\prime}\pi}{2}\delta^2(z\!-\!w,\bar{z}\!-\!\bar{w}) +\ldots. \end{align}$$
It is comforting that the regularization $\varepsilon>0$ correctly predicts that the leading singularity is a 2D Dirac delta distribution.
Then the $T\bar{T}$ OPE becomes
$$ \begin{align} {\cal R}T_{zz}(z,\bar{z})&T_{\bar{w}\bar{w}}(w,\bar{w})\cr
~=&~\frac{c}{2}\frac{\varepsilon^2}{(|z-w|^2+\varepsilon)^4}\cr 
&+\frac{2}{\alpha^{\prime}} \frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}:\partial_zX(z,\bar{z})\partial_{\bar{w}}X(w,\bar{w}):\cr
&+~\ldots. \end{align}$$
The leading singularity is given by double contractions, which are proportional to the square of the 2D Dirac delta distribution. This is ill-defined, cf. e.g. this Phys.SE post.
Nevertheless, let us now formally apply Tong's trick: Using the energy conservation (4.36z) leads to
$$  {\cal R}\partial_z T_{z\bar{z}}(z,\bar{z}) \partial_{\bar{w}}T_{w\bar{w}}(w,\bar{w}) 
~\stackrel{(4.36z)}{\approx}~{\cal R}\partial_{\bar{z}} T_{zz}(z,\bar{z})\partial_w T_{\bar{w}\bar{w}}(w,\bar{w}), $$
so that the sought-for OPE leads to the square of the 2D Dirac delta distribution as well
$$ \begin{align} {\cal R}T_{z\bar{z}}(z,\bar{z}) &T_{w\bar{w}}(w,\bar{w})\cr
~=~&\frac{c}{2}\frac{\varepsilon^2}{(|z-w|^2+\varepsilon)^4}+\ldots\cr
~\stackrel{(4.2d)}{=}&~\frac{c}{2}\pi^2\delta^2(z\!-\!w,\bar{z}\!-\!\bar{w})^2+\ldots. \end{align}$$
There might be a way to resolve the square of the 2D Dirac delta distribution, and argue that the leading singularity is instead given by the second derivative of the 2D Dirac delta distribution,
$$\begin{align} \frac{c}{12}\partial_z\partial_{\bar{w}}\underbrace{\frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}}_{=\pi\delta^2(z-w,\bar{z}-\bar{w})}
~=~&\frac{c}{2}\underbrace{\frac{\varepsilon^2}{(|z-w|^2+\varepsilon)^4}}_{=\pi^2\delta^2(z-w,\bar{z}-\bar{w})^2}\cr
~-~&\frac{c}{3}\underbrace{\frac{\varepsilon}{(|z-w|^2+\varepsilon)^3}}_{=4\pi^2\delta^2(z-w,\bar{z}-\bar{w})^2},\end{align}$$
as in eq. (4.39), although we shall not pursue the matter here. $\Box$
$^2$ Note that there is a factor of 2 in Tong's definition of the 2D Dirac delta distribution, cf. the end of Section 4.0.1.
A: Ref. 1 has a different proof of the Weyl anomaly

$$ T^{\alpha}_{\alpha}~=~-\frac{c}{12} R^{(2)},  \tag{4.9.8} $$

which we outline in this answer, and which is possibly more convincing than the proofs in Refs. 2 & 3.
Sketched proof of eq. (4.9.8):

*

*We start with a $(1,1)$ Hermitian metric
$$\begin{align} \mathbb{g}~=~&2g_{z\bar{z}} \mathrm{d}z \odot \mathrm{d}\bar{z}, \cr
 g_{zz}~=~&0~=~g_{\bar{z}\bar{z}}. \end{align} \tag{A}$$
The Levi-Civita Christoffel symbols are
$$\begin{align}  \Gamma^{z}_{zz}~=~&g^{z\bar{z}}\partial_{z} g_{z\bar{z}}, \cr \Gamma^{\bar{z}}_{\bar{z}\bar{z}}~=~&g^{z\bar{z}}\partial_{\bar{z}} g_{z\bar{z}}, \cr
 \Gamma(\text{mixed indices})~=~&0, \end{align} \tag{B}$$
i.e. the Levi-Civita connection $\nabla$ is Hermitian.


*Under a holomorphic coordinate transformation $$z^{\prime}~=~f(z),\tag{C}$$
the Christoffel symbol does not transform as a tensor
$$ \Gamma^{z}_{zz}~\stackrel{(B)+(C)}{=}~f^{\prime}\Gamma^{z^{\prime}}_{z^{\prime}z^{\prime}}+\frac{f^{\prime\prime}}{f^{\prime}}. \tag{D}$$
We construct for later an object
$$r_{zz}~:=~ \partial_{z}\Gamma^{z}_{zz} -\frac{1}{2}(\Gamma^{z}_{zz})^2, \tag{E}$$
which transforms with the Schwarzian derivative:
$$\begin{align}  r_{zz}~\stackrel{(D)+(E)}{=}&~(f^{\prime})^2 r_{z^{\prime}z^{\prime}} +\{f,z\}, \cr \{f,z\}~:=~~&\frac{f^{\prime\prime\prime}}{f^{\prime}}-\frac{3}{2} \left(\frac{f^{\prime\prime}}{f^{\prime}}\right)^2.\end{align} \tag{F}$$
The holomorphic SEM tensor component also transforms with a Schwarzian derivative
$$ T_{zz}~=~(f^{\prime})^2 T_{z^{\prime}z^{\prime}} +\frac{c}{12}\{f,z\},\tag{4.9.2} $$
where
$$ \partial_{\bar{z}}T_{zz}~=~0. \tag{G} $$
We can therefore define the difference
$$\hat{T}_{zz}~:=~T_{zz} - \frac{c}{12}r_{zz},\tag{4.9.3} $$
which transforms as a tensor
$$ \hat{T}_{zz}~=~(f^{\prime})^2 \hat{T}_{z^{\prime}z^{\prime}}. \tag{4.9.4}$$


*The Ricci curvature tensor is
$$\begin{align}  -R_{z\bar{z}}~=~&\partial_{\bar{z}}\Gamma^{z}_{zz}\cr
~=~&\partial_{z}\Gamma^{\bar{z}}_{\bar{z}\bar{z}}, \cr
 R_{zz}~=~&0~=~R_{\bar{z}\bar{z}}.\end{align}  \tag{H}$$
The Ricci scalar curvature is
$$ R^{(2)}~=~2g^{z\bar{z}}R_{z\bar{z}}.\tag{I} $$
Ignoring a possible cosmological constant $\Lambda$, the trace of the SEM tensor must be proportional to the Ricci scalar
$$ T^{\alpha}_{\alpha}~=~A R^{(2)},\tag{4.9.5} $$
or equivalently,
$$\begin{align}  \hat{T}_{z\bar{z}}~:=~&T_{z\bar{z}}\cr
~=~&AR_{z\bar{z}}\cr
~=~&\frac{A}{2}g_{z\bar{z}}R^{(2)}.\end{align} \tag{4.9.6} $$


*From diffeomorphism invariance we have the continuum equation
$$ \nabla_{\alpha} \hat{T}^{\alpha\beta} ~=~0.\tag{J}$$
We calculate
$$\begin{align}  -\frac{c}{12}g^{z\bar{z}}&(\partial_{\bar{z}}\partial_{z}\Gamma^{z}_{zz} -\Gamma^{z}_{zz}\partial_{\bar{z}}\Gamma^{z}_{zz})\cr
~\stackrel{(E)}{=}~~~&-\frac{c}{12}g^{z\bar{z}}\partial_{\bar{z}}r_{zz}\cr
~\stackrel{(G)+(4.9.3)}{=}&g^{z\bar{z}}\partial_{\bar{z}}\hat{T}_{zz}\cr
~=~~~~&\nabla^{z}\hat{T}_{zz}\cr
~\stackrel{(J)}{=}~~~~&-\nabla^{\bar{z}}\hat{T}_{\bar{z}z}\cr
~\stackrel{(4.9.6)}{=}~~& -\nabla^{\bar{z}}T_{z\bar{z}}\cr
~\stackrel{(4.9.6)}{=}~~&
-\frac{A}{2}\nabla^{\bar{z}}(g_{z\bar{z}}R^{(2)})\cr
~=~~~~& -\frac{A}{2}\partial_{z}R^{(2)}\cr ~\stackrel{(B)+(I)}{=}~& -Ag^{z\bar{z}}(\partial_{z} - \Gamma^{z}_{zz}) R_{z\bar{z}}\cr
~\stackrel{(H)}{=}~~~& Ag^{z\bar{z}}(\partial_{z}\partial_{\bar{z}}\Gamma^{z}_{zz} -\Gamma^{z}_{zz}\partial_{\bar{z}}\Gamma^{z}_{zz})
.\end{align} \tag{4.9.7} $$
We therefore deduce the Weyl anomaly
$$ A~\stackrel{(4.9.7)}{=}~-\frac{c}{12}. \tag{K}$$
$\Box$
References:

*

*E. Kiritsis, String Theory in a Nutshell, 2007; Section 4.9. NB: The minus sign in eq. (K) is mentioned in the Errata.


*D. Tong, Lectures on String Theory; Subsection 4.4.2.


*J. Polchinski, String Theory Vol. 1, 1998; Section 3.4.
