Solution (source code)

= Solution

In the <Gaussian white noise model>, observe the entire path
$$
\boxed{Y(t)=\int_0^tf(s)\,ds+n^{-1/2}W(t),\qquad0\leq t\leq1,}
$$
where $W$ is standard <Brownian motion> and the deterministic drift belongs to <L2 space> on $[0,1]$. Equivalently, $dY(t)=f(t)\,dt+n^{-1/2}dW(t)$. For every deterministic $h\in L^2[0,1]$, the observed <stochastic integral> satisfies
$$
Y(h):=\int_0^1h(t)\,dY(t)=\langle h,f\rangle+n^{-1/2}W(h),\qquad \operatorname{Cov}(W(h),W(g))=\langle h,g\rangle.
$$
The noise $W(h)=\int h\,dW$ is an <isonormal Gaussian process>. In particular its <variance> is $\|h\|_2^2$. <Gaussian white noise> is interpreted through these integrals, rather than as an ordinary random <function> with a pointwise value at every time. No smoothness of $f$ is needed.

Here is the <Gaussian maximum bound without independence>. Put $M=\max_{1\leq i\leq N}|g_i|$. It is integrable since it is bounded by $\sum_i|g_i|$. For every $\lambda>0$,
$$
e^{\lambda M}\leq\sum_{i=1}^N\left(e^{\lambda g_i}+e^{-\lambda g_i}\right),\qquad E e^{\lambda M}\leq2N e^{\lambda^2/2}.
$$
The second inequality uses only the <moment-generating function> of the <standard normal distribution>, so <independence> is unnecessary. <Jensen inequality> gives $e^{\lambda EM}\leq E e^{\lambda M}$, hence
$$
EM\leq\frac{\log(2N)}\lambda+\frac\lambda2.
$$
Minimizing at $\lambda=\sqrt{2\log(2N)}$ proves
$$
\boxed{E\max_{1\leq i\leq N}|g_i|\leq\sqrt{2\log(2N)}.}
$$

For the <dyadic partition>, let $I_{J,k}=[k2^{-J},(k+1)2^{-J})$, $0\leq k<2^J$, putting the endpoint $1$ into the final interval. The <Haar scaling functions>
$$
\phi_{J,k}=2^{J/2}\mathbf1_{I_{J,k}}
$$
form an <orthonormal basis> of the space $V_J$ of <functions> constant on each interval. The <Haar wavelets> can be written as
$$
\psi_{j,k}=2^{j/2}\left(\mathbf1_{I_{j+1,2k}}-\mathbf1_{I_{j+1,2k+1}}\right).
$$
For $J\geq1$, the constant <function> $\phi_{0,0}=1$ together with $\psi_{j,k}$, $0\leq j<J$, is another <orthonormal basis> of $V_J$. Indeed, each successive level splits a cell's two constants into their sum and difference; the number of basis elements is $1+\sum_{j=0}^{J-1}2^j=2^J$. Thus the <Haar projection> is the <orthogonal projection>
$$
\begin{aligned}
\Pi_{V_J}f&=\sum_{k=0}^{2^J-1}\langle f,\phi_{J,k}\rangle\phi_{J,k}\\
&=\langle f,1\rangle\,1+\sum_{j=0}^{J-1}\sum_{k=0}^{2^j-1}\langle f,\psi_{j,k}\rangle\psi_{j,k}.
\end{aligned}
$$
On cell $I_{J,k}$ its value is $2^J\int_{I_{J,k}}f(t)\,dt$. The first formula also applies to $J=0$.

Estimate each coefficient by its observed <stochastic integral>:
$$
\widehat\alpha_{J,k}=\int_0^1\phi_{J,k}(t)\,dY(t)=2^{J/2}\left[Y((k+1)2^{-J})-Y(k2^{-J})\right],\qquad\widehat\Pi_{V_J}f=\sum_k\widehat\alpha_{J,k}\phi_{J,k}.
$$
This is the <Haar projection estimator in Gaussian white noise>. The noise integrals over disjoint intervals form a <Gaussian vector> with zero off-diagonal <covariance>. The principle that <uncorrelated jointly Gaussian variables are independent> then makes these coefficients <independent>. Therefore
$$
\widehat\alpha_{J,k}=\langle f,\phi_{J,k}\rangle+n^{-1/2}Z_k,\qquad Z_k\overset{\mathrm{iid}}\sim N(0,1).
$$
Taking <expectations> shows that \b[$\widehat\Pi_{V_J}f$ is an <unbiased estimator> of $\Pi_{V_J}f$], both coefficientwise and pointwise for the stated step-function representatives.

Only one scaling <function> is nonzero in each cell, so the <supremum norm> of the error has the exact form
$$
\left\|\widehat\Pi_{V_J}f-\Pi_{V_J}f\right\|_\infty=\sqrt{\frac{2^J}{n}}\max_{0\leq k<2^J}|Z_k|.
$$
The endpoint convention ensures the same identity at $1$. Apply the <Gaussian maximum bound without independence> with $N=2^J$ to obtain the <supremum norm risk of a Haar projection estimator>:
$$
\boxed{E\left\|\widehat\Pi_{V_J}f-\Pi_{V_J}f\right\|_\infty\leq\sqrt{\frac{2^J}{n}}\sqrt{2\log(2^{J+1})}=\sqrt{\frac{2^J(2J+2)\log2}{n}}.}
$$
The factor $2^{J/2}$ comes from cellwise scaling, while the extra square root of $J+1$ comes from taking the maximum over $2^J$ Gaussian errors.