[guided]For each sufficiently small $h>0$, the local linear construction uses three moment coefficients. For $j\in\{0,1,2\}$, define $s_j(h)\in\mathbb{R}$ by
\begin{align*}
s_j(h):=\int_{\mathbb{R}} u^jK(u)\mathbb{1}_{\{u:hu\in S\}}\,d\mathcal{L}^1(u),
\end{align*}
and define
\begin{align*}
\Delta(0,h):=s_0(h)s_2(h)-s_1(h)^2.
\end{align*}
For $h$ with $\Delta(0,h)>0$, define the equivalent kernel $L_h:\mathbb{R}\to\mathbb{R}$ by
\begin{align*}
L_h(u):=\frac{s_2(h)-us_1(h)}{\Delta(0,h)}K(u)\mathbb{1}_{\{u:hu\in S\}}.
\end{align*}
These definitions are the algebraic core of local linear boundary correction: the denominator is the Gram determinant of the truncated zeroth and first moments, while the numerator is chosen to reproduce constants and cancel linear functions. Since $K:\mathbb{R}\to\mathbb{R}$ is Borel measurable, bounded, and supported in $[-1,1]$, this formula also shows that $L_h$ is Borel measurable, bounded, and supported in $[0,1]$ for every sufficiently small $h>0$ with $\Delta(0,h)>0$.
Let $(\Omega,\mathcal{F},\mathbb{P})$ be the probability space from the theorem statement, let $n\in\mathbb{N}$ be the sample size, and let $X_1,\dots,X_n:(\Omega,\mathcal{F})\to(S,\mathcal{B}(S))$ be the observations, which have common marginal density $f$ with respect to $\mathcal{L}^1$ on $S$. Define the local linear density estimator $\hat f_{h,\mathrm{ll}}(0):\Omega\to\mathbb{R}$ by
\begin{align*}
\hat f_{h,\mathrm{ll}}(0):=\frac{1}{nh}\sum_{i=1}^n L_h\left(\frac{X_i}{h}\right).
\end{align*}
The estimator is an average of summands with the same marginal distribution. For each $i\in\{1,\dots,n\}$, the map $\omega\mapsto L_h(X_i(\omega)/h)$ is measurable because it is a composition of measurable maps, and it is integrable because $L_h$ is bounded. Linearity of expectation and the marginal density $f:S\to[0,\infty)$ of each observation with respect to $\mathcal{L}^1$ give
\begin{align*}
\mathbb{E}[\hat f_{h,\mathrm{ll}}(0)] = \frac{1}{h}\int_S L_h\left(\frac{y}{h}\right) f(y)\,d\mathcal{L}^1(y).
\end{align*}
This computation uses only the common marginal density, not independence. Substitute $y=hu$; the map $u\mapsto hu$ sends $[0,\infty)$ onto $S=[0,\infty)$ and $d\mathcal{L}^1(y)=h\,d\mathcal{L}^1(u)$. Hence
\begin{align*}
\mathbb{E}[\hat f_{h,\mathrm{ll}}(0)] = \int_0^\infty L_h(u)f(hu)\,d\mathcal{L}^1(u).
\end{align*}
Because $K$ is supported in $[-1,1]$ and $hu\in S$ is equivalent to $u\ge 0$, the equivalent kernel vanishes outside $[0,1]$. Therefore
\begin{align*}
\mathbb{E}[\hat f_{h,\mathrm{ll}}(0)] = \int_0^1 L_h(u)f(hu)\,d\mathcal{L}^1(u).
\end{align*}
For sufficiently small $h>0$, the hypothesis $\Delta(0,h)>0$ makes $L_h$ well-defined. The moment definitions give
\begin{align*}
\int_0^1 L_h(u)\,d\mathcal{L}^1(u)=1
\end{align*}
and
\begin{align*}
\int_0^1 uL_h(u)\,d\mathcal{L}^1(u)=0.
\end{align*}
These are the two algebraic facts responsible for bias cancellation: constants are reproduced, and the linear boundary term is annihilated.
By the regularity hypothesis in the statement, choose $r>0$ such that $f:[0,r]\to\mathbb{R}$ and $f_+':[0,r]\to\mathbb{R}$ are absolutely continuous, the second right derivative $f_+''$ exists $\mathcal{L}^1$-a.e. on $[0,r]$, and $f_+''\in L^\infty([0,r])$. Define $M:=\|f_+''\|_{L^\infty([0,r])}<\infty$. Choose $h_0>0$ so that $h_0\le r$ and $\Delta(0,h)>0$ for $0<h<h_0$. For $u\in[0,1]$, $hu\in[0,r]$. The [Fundamental Theorem of Calculus](/theorems/632) for absolutely continuous functions gives the second-order integral Taylor formula
\begin{align*}
f(hu)=f(0)+hu f_+'(0)+R_h(u),
\end{align*}
where
\begin{align*}
R_h(u):=\int_0^{hu}(hu-t)f_+''(t)\,d\mathcal{L}^1(t).
\end{align*}
Indeed, the function $s\mapsto f(0)+s f_+'(0)+\int_0^s(s-t)f_+''(t)\,d\mathcal{L}^1(t)$ is absolutely continuous on $[0,r]$, has derivative $f_+'(s)$ for $\mathcal{L}^1$-a.e. $s\in[0,r]$, and agrees with $f$ at $s=0$; applying the same theorem to the difference gives the formula. The same bound gives
\begin{align*}
|R_h(u)|\le M\int_0^{hu}(hu-t)\,d\mathcal{L}^1(t)=\frac{M}{2}h^2u^2\le\frac{M}{2}h^2.
\end{align*}
Substituting the Taylor formula into the expectation and using linearity of the [Lebesgue integral](/page/Lebesgue%20Integral) yields
\begin{align*}
\mathbb{E}[\hat f_{h,\mathrm{ll}}(0)] = f(0)\int_0^1L_h(u)\,d\mathcal{L}^1(u)+h f_+'(0)\int_0^1uL_h(u)\,d\mathcal{L}^1(u)+\int_0^1L_h(u)R_h(u)\,d\mathcal{L}^1(u).
\end{align*}
The first moment identity turns the constant term into $f(0)$, and the second moment identity removes the order-$h$ term. Thus
\begin{align*}
\mathbb{E}[\hat f_{h,\mathrm{ll}}(0)]-f(0)=\int_0^1L_h(u)R_h(u)\,d\mathcal{L}^1(u).
\end{align*}
Finally, at $x=0$ the truncated set is exactly $[0,1]$ for every $h>0$, so the moments and $L_h$ are independent of $h$ for sufficiently small $h$. Since $K$ is bounded and $\Delta(0,h)>0$, define the finite constant
\begin{align*}
C_K:=\frac{M}{2}\int_0^1|L_h(u)|\,d\mathcal{L}^1(u).
\end{align*}
Then
\begin{align*}
|\mathbb{E}[\hat f_{h,\mathrm{ll}}(0)]-f(0)|\le C_Kh^2
\end{align*}
for all sufficiently small $h>0$, which is exactly $\mathbb{E}[\hat f_{h,\mathrm{ll}}(0)]-f(0)=O(h^2)$ as $h\downarrow0$.[/guided]