Crank-Nicolson maximum principle under a step restriction (source code)

= Crank-Nicolson maximum principle under a step restriction
{c}
{title2=$\Delta t[(\Delta x)^{-2}+(\Delta y)^{-2}]\leq1$}

For the two-dimensional <heat equation> with zero <Dirichlet boundary conditions>, the <Crank-Nicolson diffusion scheme> preserves the interval between the minimum and maximum of the initial nodal values and zero under the displayed restriction. The old-time coefficients form a <convex combination>, while the new-time matrix has positive diagonal, nonpositive off-diagonal entries and row diagonal-dominance margin one. A hypothetical new value above the old maximum makes the new-time row at least that value while its right side is at most the old maximum, a contradiction; apply the reversed inequality at a new minimum. In particular initial nonnegative or nonpositive values preserve their sign. The step restriction guarantees these value bounds even though scalar <A-stability> holds without it.