[proofplan]
We use the [Hodge decomposition](/theorems/2745) in degree $2$ and separate it into its real summands: the real $(1,1)$-part and the real subspace underlying $H^{2,0}(X)\oplus H^{0,2}(X)$. The Hodge index theorem gives signature $(1,h^{1,1}(X)-1)$ on the real $(1,1)$-part. The Hodge-Riemann bilinear relations show that the real subspace coming from holomorphic two-forms is positive definite of real dimension $2h^{2,0}(X)$. Adding the positive and negative dimensions gives the two formulas for $b_2^+(X)$ and $b_2^-(X)$, and subtracting them gives the signature.
[/proofplan]
[step:Define the real and complex intersection forms]
Let
\begin{align*}
Q_{\mathbb R}:H^2(X;\mathbb R)\times H^2(X;\mathbb R)\to \mathbb R
\end{align*}
be the real intersection form, defined by
\begin{align*}
Q_{\mathbb R}(\alpha,\beta)=\langle \alpha\smile \beta,[X]\rangle,
\end{align*}
where $[X]\in H_4(X;\mathbb R)$ is the fundamental class determined by the complex orientation.
Let
\begin{align*}
Q_{\mathbb C}:H^2(X;\mathbb C)\times H^2(X;\mathbb C)\to \mathbb C
\end{align*}
be the complex bilinear extension of $Q_{\mathbb R}$. Thus, for $\alpha_1,\alpha_2,\beta_1,\beta_2\in H^2(X;\mathbb R)$,
\begin{align*}
Q_{\mathbb C}(\alpha_1+i\alpha_2,\beta_1+i\beta_2)
=
Q_{\mathbb R}(\alpha_1,\beta_1)-Q_{\mathbb R}(\alpha_2,\beta_2)
+iQ_{\mathbb R}(\alpha_2,\beta_1)+iQ_{\mathbb R}(\alpha_1,\beta_2).
\end{align*}
The numbers $b_2^+(X)$ and $b_2^-(X)$ are, by definition, the positive and negative dimensions of the nondegenerate symmetric form $Q_{\mathbb R}$.
[/step]
[step:Split degree two cohomology into real Hodge summands]
By [Kahler Cohomology Carries a Pure Hodge Structure][citetheorem:8066] in degree $2$,
\begin{align*}
H^2(X;\mathbb C)=H^{2,0}(X)\oplus H^{1,1}(X)\oplus H^{0,2}(X).
\end{align*}
Complex conjugation on $H^2(X;\mathbb C)$ exchanges $H^{2,0}(X)$ and $H^{0,2}(X)$ and preserves $H^{1,1}(X)$. Define the real $(1,1)$-subspace
\begin{align*}
V_{\mathbb R}^{1,1}:=H^2(X;\mathbb R)\cap H^{1,1}(X)
\end{align*}
and the real transcendental Hodge subspace
\begin{align*}
W_{\mathbb R}:=H^2(X;\mathbb R)\cap \left(H^{2,0}(X)\oplus H^{0,2}(X)\right).
\end{align*}
Then the real form of the [Hodge decomposition](/theorems/3941) is
\begin{align*}
H^2(X;\mathbb R)=V_{\mathbb R}^{1,1}\oplus W_{\mathbb R}.
\end{align*}
Moreover,
\begin{align*}
\dim_{\mathbb R}V_{\mathbb R}^{1,1}=h^{1,1}(X)
\end{align*}
and
\begin{align*}
\dim_{\mathbb R}W_{\mathbb R}=2h^{2,0}(X).
\end{align*}
[guided]
The complex Hodge decomposition gives a decomposition after extending scalars from $\mathbb R$ to $\mathbb C$, but the intersection form whose signature we want is a real form on $H^2(X;\mathbb R)$. Therefore we must identify which real subspaces correspond to the complex Hodge summands.
By [Kahler Cohomology Carries a Pure Hodge Structure][citetheorem:8066], applied to the compact Kähler manifold $X$ and to degree $2$, we have
\begin{align*}
H^2(X;\mathbb C)=H^{2,0}(X)\oplus H^{1,1}(X)\oplus H^{0,2}(X).
\end{align*}
The real [vector space](/page/Vector%20Space) $H^2(X;\mathbb R)$ sits inside $H^2(X;\mathbb C)$ as the fixed locus of complex conjugation. Complex conjugation sends a class of type $(p,q)$ to a class of type $(q,p)$. Hence $H^{1,1}(X)$ is preserved by conjugation, while $H^{2,0}(X)$ and $H^{0,2}(X)$ are paired with each other.
For this reason we define
\begin{align*}
V_{\mathbb R}^{1,1}:=H^2(X;\mathbb R)\cap H^{1,1}(X)
\end{align*}
and
\begin{align*}
W_{\mathbb R}:=H^2(X;\mathbb R)\cap \left(H^{2,0}(X)\oplus H^{0,2}(X)\right).
\end{align*}
Every real class $\alpha\in H^2(X;\mathbb R)$ has a unique complex Hodge decomposition
\begin{align*}
\alpha=\alpha_{2,0}+\alpha_{1,1}+\alpha_{0,2},
\end{align*}
with $\alpha_{p,q}\in H^{p,q}(X)$. Since $\alpha$ is fixed by conjugation, uniqueness of the Hodge decomposition forces $\overline{\alpha_{2,0}}=\alpha_{0,2}$ and $\overline{\alpha_{1,1}}=\alpha_{1,1}$. Thus $\alpha_{1,1}\in V_{\mathbb R}^{1,1}$ and $\alpha_{2,0}+\alpha_{0,2}\in W_{\mathbb R}$, proving
\begin{align*}
H^2(X;\mathbb R)=V_{\mathbb R}^{1,1}\oplus W_{\mathbb R}.
\end{align*}
The dimension of $V_{\mathbb R}^{1,1}$ is $h^{1,1}(X)$ because $H^{1,1}(X)$ is defined over the real fixed subspace in this decomposition. The dimension of $W_{\mathbb R}$ is twice the complex dimension of $H^{2,0}(X)$: every $\sigma\in H^{2,0}(X)$ contributes the two real classes $\operatorname{Re}\sigma$ and $\operatorname{Im}\sigma$, and conjugation identifies $H^{0,2}(X)$ with the conjugate space of $H^{2,0}(X)$. Hence
\begin{align*}
\dim_{\mathbb R}W_{\mathbb R}=2h^{2,0}(X).
\end{align*}
[/guided]
[/step]
[step:Use Hodge type to make the two real summands orthogonal]
We claim that $V_{\mathbb R}^{1,1}$ and $W_{\mathbb R}$ are orthogonal for $Q_{\mathbb R}$. It is enough to prove orthogonality after complexification. If $\alpha\in H^{1,1}(X)$ and $\sigma\in H^{2,0}(X)$, then $\alpha\smile\sigma$ has Hodge type $(3,1)$, which is zero on a complex surface. If $\alpha\in H^{1,1}(X)$ and $\eta\in H^{0,2}(X)$, then $\alpha\smile\eta$ has Hodge type $(1,3)$, which is also zero. Therefore
\begin{align*}
Q_{\mathbb C}(\alpha,\sigma)=0
\end{align*}
and
\begin{align*}
Q_{\mathbb C}(\alpha,\eta)=0.
\end{align*}
Thus $Q_{\mathbb R}$ is the orthogonal direct sum of its restrictions to $V_{\mathbb R}^{1,1}$ and $W_{\mathbb R}$.
[/step]
[step:Compute the signature on the real $(1,1)$-part]
Let $[\omega]\in H^{1,1}(X)\cap H^2(X;\mathbb R)$ be the Kähler class of a Kähler form on $X$. By the [[Hodge Index Theorem for Compact Kähler Surfaces](/theorems/8069)][citetheorem:8069], the restriction of the intersection form to $V_{\mathbb R}^{1,1}$ has signature
\begin{align*}
(1,h^{1,1}(X)-1).
\end{align*}
The positive line is $\mathbb R[\omega]$, and the negative definite subspace is the primitive real $(1,1)$-subspace relative to $[\omega]$. Hence the contribution from $V_{\mathbb R}^{1,1}$ to $b_2^+(X)$ is $1$, and its contribution to $b_2^-(X)$ is $h^{1,1}(X)-1$.
[/step]
[step:Show the holomorphic two-form summand is positive definite]
Let $\sigma\in H^{2,0}(X)$ be nonzero. Write
\begin{align*}
\sigma=a+ib
\end{align*}
with $a,b\in W_{\mathbb R}$. Since $X$ has complex dimension $2$, the products $\sigma\smile\sigma$ and $\overline{\sigma}\smile\overline{\sigma}$ have Hodge types $(4,0)$ and $(0,4)$, so both vanish. Therefore
\begin{align*}
Q_{\mathbb C}(\sigma,\sigma)=0
\end{align*}
and
\begin{align*}
Q_{\mathbb C}(\overline{\sigma},\overline{\sigma})=0.
\end{align*}
Expanding these identities gives
\begin{align*}
Q_{\mathbb R}(a,a)=Q_{\mathbb R}(b,b)
\end{align*}
and
\begin{align*}
Q_{\mathbb R}(a,b)=0.
\end{align*}
Since every class of type $(2,0)$ is primitive on a complex surface, the Hodge-Riemann bilinear relations for primitive Hodge classes, as in [[Hodge--Riemann Bilinear Relations for Primitive Hodge Classes](/theorems/8065)][citetheorem:8065], give
\begin{align*}
Q_{\mathbb C}(\sigma,\overline{\sigma})>0.
\end{align*}
But
\begin{align*}
Q_{\mathbb C}(\sigma,\overline{\sigma})=Q_{\mathbb R}(a,a)+Q_{\mathbb R}(b,b).
\end{align*}
Hence
\begin{align*}
Q_{\mathbb R}(a,a)=Q_{\mathbb R}(b,b)>0.
\end{align*}
Thus each nonzero complex line in $H^{2,0}(X)$ contributes a positive real two-plane in $W_{\mathbb R}$, and the restriction of $Q_{\mathbb R}$ to $W_{\mathbb R}$ is positive definite. Therefore $W_{\mathbb R}$ contributes
\begin{align*}
2h^{2,0}(X)
\end{align*}
positive directions and no negative directions.
[/step]
[step:Add the positive and negative dimensions]
From the [orthogonal decomposition](/theorems/436)
\begin{align*}
H^2(X;\mathbb R)=V_{\mathbb R}^{1,1}\oplus W_{\mathbb R},
\end{align*}
the positive dimension is the sum of the positive dimensions of the two restrictions. The real $(1,1)$-part contributes $1$, and $W_{\mathbb R}$ contributes $2h^{2,0}(X)$. Therefore
\begin{align*}
b_2^+(X)=1+2h^{2,0}(X).
\end{align*}
The only negative directions come from the real $(1,1)$-part, so
\begin{align*}
b_2^-(X)=h^{1,1}(X)-1.
\end{align*}
By definition, the signature is
\begin{align*}
\tau(X)=b_2^+(X)-b_2^-(X).
\end{align*}
Substituting the two formulas gives
\begin{align*}
\tau(X)=\left(1+2h^{2,0}(X)\right)-\left(h^{1,1}(X)-1\right).
\end{align*}
Thus
\begin{align*}
\tau(X)=2h^{2,0}(X)-h^{1,1}(X)+2.
\end{align*}
This proves the stated signature formula and the equivalent formulas for $b_2^+(X)$ and $b_2^-(X)$.
[/step]