[step:Reduce the estimator variance to one summand]
Let $(\Omega,\mathcal{F},\mathbb{P})$ denote the probability space on which the random variables $X_1,\dots,X_n$ are defined. For each $h > 0$ and each $i \in \{1,\dots,n\}$, define the real-valued [random variable](/page/Random%20Variable) $Y_{i,h}: \Omega \to \mathbb{R}$ by
\begin{align*}
Y_{i,h}(\omega) = \frac{1}{h}K\left(\frac{x - X_i(\omega)}{h}\right).
\end{align*} Then
\begin{align*}
\hat f_{n,h}(x) = \frac{1}{n}\sum_{i=1}^n Y_{i,h}.
\end{align*}
Since $X_1,\dots,X_n$ are independent and identically distributed, the random variables $Y_{1,h},\dots,Y_{n,h}$ are independent and identically distributed. Therefore the [variance of a sum of independent random variables](/theorems/1119) gives
\begin{align*}
\operatorname{Var}(\hat f_{n,h}(x)) = \operatorname{Var}\left(\frac{1}{n}\sum_{i=1}^n Y_{i,h}\right) = \frac{1}{n^2}\sum_{i=1}^n \operatorname{Var}(Y_{i,h}) = \frac{1}{n}\operatorname{Var}(Y_{1,h}).
\end{align*}
Thus it remains to prove
\begin{align*}
\operatorname{Var}(Y_{1,h})
= \frac{f(x)}{h}R(K) + o\left(\frac{1}{h}\right).
\end{align*}
[/step]