Solution (source code)

= Solution

Assume the consistency regularity implicit in the requested rate, for example $u\in C^4$ on the closed square. Bounded fourth derivatives and <Taylor's theorem> give a uniform residual $\tau_{ij}=\Delta_hu(ih,jh)-f(ih,jh)$ with $|\tau_{ij}|\le C_0h^2$. Subtracting the exact grid values from the numerical equations gives $\Delta_he=-\tau$, with zero boundary error.

Let $A=-h^2\Delta_h$ be the unscaled positive Dirichlet matrix. Its <eigenvectors> are products of discrete sine vectors, which form an <orthogonal basis>; direct substitution gives <eigenvalues>
$$
\lambda_{pq}=4\sin^2\frac{p\pi h}{2}+4\sin^2\frac{q\pi h}{2}\quad(1\le p,q\le M).
$$
Since $\sin(\pi h/2)\ge h$ for $0<h\le1$, $\lambda_{11}\ge8h^2$. Therefore $\|A^{-1}\|_2\le1/(8h^2)$. The error equation is $Ae=h^2\tau$, and its residual has <norm> $\|\tau\|_2\le MC_0h^2\le C_0h$. Combining the bounds yields
$$
\boxed{\left(\sum_{i,j=1}^M|e_{ij}|^2\right)^{1/2}\le\frac{C_0}{8}h.}
$$
This is the <unweighted grid error for the five-point Poisson formula>. The unweighted <norm> loses one power of $h$ because the grid has order $h^{-2}$ points; the area-weighted <norm> is second-order accurate. A regularity assumption is needed for the uniform truncation estimate and hence for this rate; the question does not specify it explicitly.