[proofplan]
Let $m:=n-r$ be the complex dimension of $Y$. The Poincaré dual class $[Y]$ is characterized by testing smooth closed forms of complementary degree against integration over $Y$. A form of pure type $(p,q)$ on $X$ restricts to a form of pure type $(p,q)$ on the complex manifold $Y$, and such a form can have nonzero top-degree integral over $Y$ only when $(p,q)=(m,m)$. After decomposing $[Y]$ into Hodge components by the [Hodge decomposition](/theorems/2745), Hodge-compatible [Poincaré duality](/theorems/2291) forces every nonzero component to pair with complementary type $(m,m)$, hence the only possible Hodge type is $(r,r)$.
[/proofplan]
[step:Reduce to the nonempty pure-dimensional case and fix the integration convention]
If $Y=\varnothing$, then its fundamental homology class is $0$, so its Poincaré dual class is $[Y]=0$. Since $H^{r,r}(X)$ is a complex vector subspace of $H^{2r}(X,\mathbb C)$, the conclusion follows. Hence assume $Y\neq\varnothing$.
Set
\begin{align*}
m:=n-r.
\end{align*}
Since $Y\subset X$ is a complex submanifold of complex codimension $r$, every connected component of $Y$ has complex dimension $m$. Let
\begin{align*}
\iota:Y\hookrightarrow X
\end{align*}
denote the inclusion map. For any complex manifold $M$, let
\begin{align*}
A^{p,q}(M)
\end{align*}
denote the complex [vector space](/page/Vector%20Space) of smooth forms of type $(p,q)$ on $M$, and let
\begin{align*}
A^k(M;\mathbb C)
\end{align*}
denote the complex vector space of smooth complex-valued $k$-forms on $M$. We use the complex orientation on $Y$, and we let
\begin{align*}
\operatorname{Int}_Y:A^{2m}(Y;\mathbb C)\longrightarrow \mathbb C
\end{align*}
denote the top-degree integration functional on smooth complex-valued $2m$-forms on the compact oriented real manifold underlying $Y$. The Poincaré dual class $[Y]$ is the unique class in $H^{2r}(X,\mathbb C)$ characterized by the following condition: for every closed smooth complex-valued form
\begin{align*}
\alpha\in A^{2m}(X;\mathbb C),
\end{align*}
the Poincaré pairing of $[Y]$ with $[\alpha]\in H^{2m}(X,\mathbb C)$ is
\begin{align*}
\langle [Y],[\alpha]\rangle_X=\operatorname{Int}_Y(\iota^*\alpha).
\end{align*}
Here
\begin{align*}
\langle\cdot,\cdot\rangle_X:H^{2r}(X,\mathbb C)\times H^{2m}(X,\mathbb C)\longrightarrow \mathbb C
\end{align*}
denotes the Poincaré duality pairing on $X$.
[guided]
If $Y$ is empty, there is no geometry to prove: the fundamental class of the empty submanifold is $0$, so its Poincaré dual is the zero cohomology class, and $0$ belongs to every complex vector subspace, including $H^{r,r}(X)$.
Assume now that $Y\neq\varnothing$. Define
\begin{align*}
m:=n-r.
\end{align*}
Because $Y$ has complex codimension $r$ in the complex $n$-manifold $X$, the complex dimension of $Y$ is $m$. We write
\begin{align*}
\iota:Y\hookrightarrow X
\end{align*}
for the inclusion map. The complex structure on $Y$ determines an orientation on the underlying real manifold of dimension $2m$. With that orientation, define
\begin{align*}
\operatorname{Int}_Y:A^{2m}(Y;\mathbb C)\longrightarrow \mathbb C
\end{align*}
to be the top-degree integration functional on smooth complex-valued forms on $Y$.
The class $[Y]$ in this theorem is not the homology fundamental class itself. It is the Poincaré dual cohomology class. This means that $[Y]\in H^{2r}(X,\mathbb C)$ is characterized by how it pairs with complementary cohomology classes. Namely, for every closed smooth complex-valued form
\begin{align*}
\alpha\in A^{2m}(X;\mathbb C),
\end{align*}
the pairing with the cohomology class $[\alpha]\in H^{2m}(X,\mathbb C)$ is
\begin{align*}
\langle [Y],[\alpha]\rangle_X=\operatorname{Int}_Y(\iota^*\alpha).
\end{align*}
This identity is the bridge between the geometric submanifold $Y$ and the Hodge-theoretic type of its cohomology class.
[/guided]
[/step]
[step:Show that integration over $Y$ kills all complementary bidegrees except $(m,m)$]
Let $p,q\geq 0$ satisfy $p+q=2m$. Let $\alpha\in A^{p,q}(X)$ be a smooth form of pure type $(p,q)$. Since $\iota:Y\hookrightarrow X$ is holomorphic, the pullback of complex-valued forms preserves bidegree, so $\iota^*\alpha\in A^{p,q}(Y)$. On a complex manifold of complex dimension $m$, the bundle of forms of type $(p,q)$ is zero if $p>m$ or $q>m$. If $(p,q)\neq(m,m)$ and $p+q=2m$, then either $p>m$ or $q>m$. Therefore $\iota^*\alpha=0$. Consequently, for every closed form $\alpha\in A^{p,q}(X)$ with $p+q=2m$ and $(p,q)\neq(m,m)$, we have $\langle [Y],[\alpha]\rangle_X=\operatorname{Int}_Y(\iota^*\alpha)=0$.
[guided]
The key point is that the real top degree of $Y$ is $2m$, but the complex type of a top-degree form must be exactly balanced.
Let $p,q\geq 0$ be integers such that $p+q=2m$. Choose a smooth form $\alpha\in A^{p,q}(X)$. Because $Y$ is a complex submanifold, the inclusion $\iota:Y\hookrightarrow X$ is holomorphic. Holomorphic pullback preserves the decomposition of forms into bidegrees: a form with $p$ holomorphic covectors and $q$ antiholomorphic covectors pulls back to a form with the same bidegree. Hence $\iota^*\alpha\in A^{p,q}(Y)$.
Now use the dimension of $Y$. Since $Y$ has complex dimension $m$, there are no nonzero forms on $Y$ with more than $m$ holomorphic covector factors or more than $m$ antiholomorphic covector factors. Thus $A^{p,q}(Y)=0$ whenever $p>m$ or $q>m$.
If $(p,q)\neq(m,m)$ while $p+q=2m$, then one of $p$ and $q$ must be greater than $m$. Indeed, if both $p\leq m$ and $q\leq m$, then $p+q=2m$ forces $p=m$ and $q=m$. Therefore, for every pair $(p,q)\neq(m,m)$ with total degree $2m$, we get $\iota^*\alpha=0$. Using the defining property of the Poincaré dual class from the previous step, if $\alpha$ is also closed, then $\langle [Y],[\alpha]\rangle_X=\operatorname{Int}_Y(\iota^*\alpha)=0$. So the cycle class $[Y]$ has zero period against all complementary pure Hodge types except the type $(m,m)$.
[/guided]
[/step]
[step:Decompose the cycle class into Hodge components]
By the [Hodge Decomposition for Compact Kähler Manifolds](/theorems/24), the complex cohomology group $H^{2r}(X,\mathbb C)$ has the decomposition
\begin{align*}
H^{2r}(X,\mathbb C)=\bigoplus_{a+b=2r}H^{a,b}(X).
\end{align*}
Therefore there are unique classes $\gamma_{a,b}\in H^{a,b}(X)$ for all pairs $a,b\geq 0$ with $a+b=2r$ such that $[Y]=\sum_{a+b=2r}\gamma_{a,b}$. It remains to prove that $\gamma_{a,b}=0$ whenever $(a,b)\neq(r,r)$.
[guided]
The point of this step is to separate the cohomology class $[Y]$ into its Hodge pieces so that we can test each bidegree individually. On a compact Kähler manifold, the [Hodge decomposition theorem](/theorems/3941) gives
\begin{align*}
H^{2r}(X,\mathbb C)=\bigoplus_{a+b=2r}H^{a,b}(X).
\end{align*}
Because this is a direct sum decomposition, there are unique components $\gamma_{a,b}\in H^{a,b}(X)$ with $[Y]=\sum_{a+b=2r}\gamma_{a,b}$. Once we know which Hodge summands can pair nontrivially with the class dual to $Y$, the decomposition lets us eliminate the others one by one. The remaining task is therefore to show that every component except the $(r,r)$-piece vanishes.
[/guided]
[/step]
[step:Use Hodge-compatible Poincaré duality to eliminate the noncentral components]
We use the Hodge-theoretic form of Poincaré duality for compact Kähler manifolds: the Poincaré pairing $\langle\cdot,\cdot\rangle_X:H^{2r}(X,\mathbb C)\times H^{2m}(X,\mathbb C)\longrightarrow \mathbb C$ pairs $H^{a,b}(X)$ nondegenerately with $H^{n-a,n-b}(X)$ and is orthogonal to the other Hodge summands of $H^{2m}(X,\mathbb C)$.
Fix $a,b\geq 0$ with $a+b=2r$. Suppose $\gamma_{a,b}\neq 0$. By the nondegeneracy just stated, there exists a class $\beta\in H^{n-a,n-b}(X)$ such that $\langle\gamma_{a,b},\beta\rangle_X\neq 0$. Choose a closed smooth representative $\alpha\in A^{n-a,n-b}(X)$ of $\beta$. The total degree of $\alpha$ is $(n-a)+(n-b)=2n-(a+b)=2n-2r=2m$. Since the Poincaré pairing is Hodge-orthogonal, the equality $\langle [Y],\beta\rangle_X=\langle\gamma_{a,b},\beta\rangle_X$ holds. Hence $\langle [Y],\beta\rangle_X\neq 0$. By the vanishing proved in the previous step, a nonzero pairing with $[Y]$ is possible only if $(n-a,n-b)=(m,m)$. Since $m=n-r$, this gives $a=r$ and $b=r$. Thus every nonzero Hodge component of $[Y]$ has type $(r,r)$.
[guided]
The Hodge decomposition tells us what pieces exist, but not yet which pieces can survive. The next input is the Kähler fact that Poincaré duality respects Hodge type: a class of type $(a,b)$ can only pair nontrivially with a class of complementary type $(n-a,n-b)$, and the pairing is nondegenerate on that complementary pair. Why is this useful? Because we already proved that the class $[Y]$ pairs trivially with every closed form of total degree $2m$ except those of type $(m,m)$.
Now fix one Hodge component $\gamma_{a,b}\in H^{a,b}(X)$ with $a+b=2r$. If $\gamma_{a,b}\neq 0$, nondegeneracy gives a complementary class $\beta\in H^{n-a,n-b}(X)$ with $\langle\gamma_{a,b},\beta\rangle_X\neq 0$. Choose a closed representative $\alpha\in A^{n-a,n-b}(X)$ of $\beta$. Since $a+b=2r$, the total degree of $\alpha$ is
\begin{align*}
(n-a)+(n-b)=2n-2r=2m.
\end{align*}
The Hodge-orthogonality of the pairing implies that $\langle [Y],\beta\rangle_X=\langle\gamma_{a,b},\beta\rangle_X$. Therefore $\langle [Y],\beta\rangle_X\neq 0$. But the previous step showed that a nonzero pairing with $[Y]$ can occur only in bidegree $(m,m)$, so we must have
\begin{align*}
(n-a,n-b)=(m,m).
\end{align*}
Because $m=n-r$, this forces $a=r$ and $b=r$. So any Hodge component of $[Y]$ other than the middle one must vanish.
[/guided]
[/step]
[step:Conclude that the cycle class lies in $H^{r,r}(X)$]
The decomposition $[Y]=\sum_{a+b=2r}\gamma_{a,b}$ has no nonzero summands except possibly $\gamma_{r,r}$. Therefore $[Y]=\gamma_{r,r}$. Since $\gamma_{r,r}\in H^{r,r}(X)$ by construction, we conclude that $[Y]\in H^{r,r}(X)$. This proves that the Poincaré dual cycle class of the closed complex submanifold $Y$ has Hodge type $(r,r)$.
[guided]
At this point the argument is bookkeeping. The previous step showed that every Hodge component $\gamma_{a,b}$ with $(a,b)\neq(r,r)$ must vanish. Therefore the entire class $[Y]$ is equal to its $(r,r)$-component $\gamma_{r,r}$. Since $\gamma_{r,r}$ lies in $H^{r,r}(X)$ by the Hodge decomposition, the cycle class itself lies in $H^{r,r}(X)$.
This is the desired conclusion: the Poincaré dual of the fundamental class of $Y$ is a Hodge class of type $(r,r)$.
[/guided]
[/step]