Motivation
When smoothing a finite image, the pixels at its edge have no neighbors outside the recorded field. An implementation must decide what happens there. Connecting opposite edges invents a periodic image; declaring an exterior value to be zero models contact with a dark reservoir; allowing no flux keeps intensity inside the field. These are different models, not interchangeable ways to fill an array boundary. A uniform nonzero gray image should remain unchanged in the no-flux model, but it is not in equilibrium when its edge is held against a zero reservoir.
We study a one-dimensional row of pixels first. Its complete finite-dimensional analysis makes the boundary mechanism visible without assuming a continuum existence theorem. The same graph construction extends to a rectangular image by including every horizontal and vertical neighbor pair once; the zero-reservoir model also uses one exterior edge per boundary face, so a corner has two. Pixel values are real numbers; negative values are mathematically admissible, although intensities may have a narrower physical range. The time scale below uses unit grid spacing and unit diffusivity.
Definitions
Definition 9.1.1
(Discrete no-flux (Neumann) model)
Let , with . For the no-flux or discrete Neumann model, define
There is no edge from pixel to pixel , and no term involving an exterior value. The negative gradient gives , where
for interior indices .
Equivalently, using the centered second difference at the endpoints, set ghost values and : the differences across the outer faces are zero. The endpoint equations become and . This convention places the boundary faces half a grid step beyond the endpoint centers; a different placement may change boundary coefficients.
Definition 9.1.2
(Discrete zero-reservoir (Dirichlet) model)
For a homogeneous discrete Dirichlet model, attach each endpoint to a fixed zero-valued exterior node by an edge of the same weight. Define
where is the gradient matrix of . Thus its interior rows agree with , but and .
The Dirichlet operator is the centered difference with fixed ghost values . The prescribed zero is located at the exterior node, one whole grid step beyond the endpoint center. Imposing zero at a half-step face instead would give a different endpoint coefficient. The two exterior nodes represent prescribed data and are not included in the image mass. If physical spacing is and diffusivity is , multiplying either matrix by changes the rate; scaling its energy by the same factor preserves the displayed gradient-flow identities. The sums used below are unweighted for clarity.
Theorem/proposition
Theorem 9.1.3
(Global solution and energy identities)
For either or and every , there is a unique solution for all . Along it,
The two boundary models agree on these identities. They differ in what happens to total intensity and in the long-time limit.
Proposition 9.1.4
(Mass balance and long-time limits)
The no-flux mass is constant and tends to its initial mean times the all-ones vector. In contrast, the zero-reservoir model obeys
and . Thus Dirichlet mass need not be conserved; the sign of its rate depends on the boundary values.
Proof sketch or proof idea
Proof
(Factorization, spectral solution, and energy laws)
Let be the matrix whose rows take the differences . Then . For , add two rows selecting and to ; the resulting matrix gives . Hence both matrices are real symmetric and positive semidefinite, and .
By the finite-dimensional spectral theorem, with orthogonal and nonnegative diagonal entries . The explicit formula gives a differentiable global solution. Uniqueness follows by projecting any other solution onto each eigenvector and solving the scalar equation with its initial value. Differentiation and symmetry give
Proof
(Column sums and kernels)
The row sums of vanish; by symmetry so do its column sums, giving and hence . The only vectors with have all consecutive entries equal; the kernel is the span of . All other eigenvalues are strictly positive, so the spectral formula tends to the orthogonal projection of onto that kernel, namely its mean. For the Dirichlet model, summing the equations cancels each interior edge contribution but leaves from the exterior edges. Also forces all entries to vanish: the two endpoint terms and the connecting differences are squares. Thus has only positive eigenvalues and the spectral formula tends to zero.
Proof X-ray
Where did the mass go?
The factorization is used twice. Symmetry is what allows the spectral theorem, hence the explicit solution and uniqueness; semidefiniteness makes every , so no mode grows and the solution exists for all forward time. The energy identities then need nothing beyond symmetry.
The key move for mass is to read a column sum instead of a row sum. Every interior edge transfers equal and opposite amounts between its endpoints, so it cancels in the sum. Neumann removes the exterior edges entirely, giving . Dirichlet retains two edges whose other endpoints are fixed outside the image; rows and of sum to , which leaves . Energy dissipation alone does not imply mass conservation.
The limits use connectedness of the row of pixels. Equal consecutive entries force a constant vector only because every pixel is linked to the next. If an image graph had two components with no edge between them, the Neumann kernel would contain each component's indicator, and the limit would be the mean on each component separately. Likewise, the Dirichlet limit is zero because every component touches a reservoir edge.
The equations are discrete definitions, not a proof that a sampled solution converges to a continuum boundary-value problem. With appropriate grid placement and scaling they are consistent with familiar no-flux and prescribed-value interpretations, but a convergence theorem needs a specified domain, sampling rule, norm and boundary treatment. In particular, the ghost-point convention and the location assigned to the physical boundary must be stated together.
Concept lensAlgebraic
The two boundary models as cosine and sine modes
Both spectra are explicit. For , the Neumann eigenvectors are with eigenvalues , ; the Dirichlet eigenvectors are with eigenvalues , . The cosine modes have zero slope at the half-step faces and the sine modes vanish at the exterior nodes, matching the two ghost conventions. Only Neumann has the constant mode, and every eigenvalue is below , so satisfies the Euler energy criterion for every .
Worked examples
Worked example 9.1.5
(Two pixels, two boundary models)
Take and . The constant vector and the contrast vector are eigenvectors. For Neumann their eigenvalues are and , hence
The mass is exactly and the contrast decays. For Dirichlet their eigenvalues are and , giving
Now the mass is and tends to zero. At time zero , agreeing with . The same starting image therefore has a different long-time brightness under the two boundary assumptions.
Worked example 9.1.6
(One explicit time step and its energy)
Forward Euler replaces the exact flow by . For an eigenvector with eigenvalue , one step multiplies its amplitude by and its energy contribution by . Therefore energy is nonincreasing for every initial state exactly when for every eigenvalue. For the two-pixel Dirichlet model, , so this energy criterion is . At equality the contrast mode alternates sign without decaying: nonincrease is not convergence to equilibrium.
Worked example 9.1.7
(A nonnegative step needs a stronger condition)
Each no-flux endpoint update is ; an interior update is . The zero-reservoir formula has the same interior expression and an endpoint update . Thus makes each update a nonnegative combination of old pixel values and, for Dirichlet, a zero reservoir value. Nonnegative input then remains nonnegative. This sufficient bound is a positivity statement, distinct from the exact spectral energy bound.
Common mistakes
Counterexample mode
A stable-looking formula can increase energy
In the three-pixel Neumann model, is an eigenvector with eigenvalue . With , one Euler step sends to , quadrupling . The continuous flow always dissipates energy, but the time-discrete method need not. Moreover, energy stability alone does not ensure nonnegative pixels: in the two-pixel Dirichlet model, satisfies the energy bound but sends to .
Both failures concern the time step, not the flow. The next two errors concern the flow itself.
Common mistake
(Energy, squared intensity, and mass are different quantities)
The quantity measures roughness plus any reservoir penalty, whereas measures squared intensity. Their derivatives are different: the first loses , the second loses . Neither is generally the total intensity . Do not assume total intensity is conserved simply because the data are smoothed; conservation depends on the boundary model.
Common mistake
(A zero reservoir does not always remove intensity)
For real-valued inputs the sign of is not fixed. In the two-pixel Dirichlet model with , the solution is , so and . The reservoir pulls the mass toward zero from either side.
Summary
An edge-based quadratic energy supplies both an unambiguous boundary convention and its diffusion equation. Omitting exterior edges gives no-flux mass conservation; fixing exterior values at zero introduces a reservoir and allows mass exchange. Both finite flows exist globally and dissipate energy, but a numerical time step needs its own stability and positivity checks. These conclusions are for the specified discrete models and do not establish a general continuum boundary theorem.
Exercises
Exercise 9.1.8
(For the three-pixel Neumann model, write and find its eigenvalues and mutually orthogonal eigenvectors. Use them to solve the flow from .)
Foundation
Solution(3)
- 1
Write the matrix and its eigenpairs
The matrix is . Eigenpairs are , and ; direct multiplication verifies each, and their vectors are mutually orthogonal.
- 2
Decompose the initial vector
Key step
.
- 3
Attach the exponential factors
, with limit .
Exercise 9.1.9
(In the two-pixel Dirichlet model, start with . Compute , , and ; verify both energy identities.)
Foundation
Solution(3)
- 1
Solve the flow
The initial vector is a eigenvector, so . The interior difference vanishes and the two boundary squares give .
- 2
Check the energy identities
, since . Also has derivative .
- 3
Check the mass balance
and .
Exercise 9.1.10
(Show that forward Euler preserves Neumann mass for every step size. For , find an initial nonnegative vector showing that can destroy nonnegativity.)
Core
Solution(2)
- 1
Sum one Euler step
Summing gives exactly the previous mass for every real .
Because: .
- 2
Exhibit an undershoot
For initial data , the center after one step is , which is negative when . Mass preservation does not prevent this undershoot.
Exercise 9.1.11
(For the two-pixel Dirichlet model and a step size , find all for which every initial vector converges to zero under forward Euler. Explain the endpoints.)
Core
Solution(3)
- 1
Reduce to the two eigenmodes
The eigenvalues are and , with multipliers and .
- 2
Require both multipliers to have modulus below one
Key step
and intersect in .
- 3
Examine the endpoints
At no mode decays; at the contrast multiplier is and oscillates forever. For larger positive steps the contrast multiplier has magnitude greater than one, so some initial data diverge.