# What remains after the linear error?

Henry Shin · Refactor · Mathematical companion · November 27, 2026

Count the backward weights whose signs disagree with the checkerboard. Twice their combined magnitude reveals a logarithmic correction to the linear error and a definite extra cost each time the wall distance doubles.

Count the backward weights whose signs disagree with the checkerboard. A weight of magnitude a on a disagreeing cell contributes +a to the worst-case thermometer error, even though the checkerboard assigns it −a. The difference is 2a. Which cells disagree, and how much weight do they carry?

## Count one disagreement by hand

Put walls at −3 and 3 on a line. Each interior cell takes one third of the old value at its left neighbor, one third of its own, and one third at its right neighbor. Values at the walls are zero. This is the rule h = 1/d with wall distance d = 3. The thermometer reads the center minus the mean of its two neighbors. To find what an error three ticks ago does to that reading, start with the five final weights below and apply the same symmetric update three times.

Backward weights on the five interior cells. The first tick averages each entry with its two neighbors, using zero at either wall.

| Lag | −2 | −1 | 0 | 1 | 2 |
| --- | --- | --- | --- | --- | --- |
| 0 | 0 | −1/2 | 1 | −1/2 | 0 |
| 1 | −1/6 | 1/6 | 0 | 1/6 | −1/6 |
| 2 | 0 | 0 | 1/9 | 0 | 0 |
| 3 | 0 | 1/27 | 1/27 | 1/27 | 0 |

Give the center a positive checkerboard sign at lag zero. Alternate the signs as you move from cell to cell, then reverse all of them at each tick. At lag three the signs on cells −1, 0, 1 are +, −, +. All three actual weights are positive. The checkerboard reads (1 − 1 + 1)/27 = 1/27, while the sum of the absolute weights is 3/27. Twice the magnitude of the center weight accounts for the whole difference.

## Which part sums to d?

Now put the walls at ±d on every axis. The dimension n and the positive probabilities a_{i} of choosing each axis stay fixed. They sum to one. A moving step chooses either neighbor on its axis with equal probability. Write B for the moving update and A = hI + (1 − h)B for the update with holding. Keep h = 1/d from here on. As in the [shrinking-hold companion](https://refactor.press/refactors/shrinking-hold), the final thermometer weights are q = (I − B)e₀, with e₀ a unit at the center. Starting from an exact grid, the sharp all-run factor C(d,1/d) is the sum over all lags of the absolute masses of the backward weights A^{t}q. Multiply it by the per-cell, per-tick tolerance to get a temperature allowance.

First take the walls away. Let w_{t}(x) be the resulting backward weight at cell x and lag t. Its expected checkerboard sign is j_{t}(x) = (−1)^{t + ∑xᵢ}. Multiply each weight by that sign and sum. Initially the signed sum is 2. A move reverses the spatial color and a hold preserves it. After allowing for the reversal of j at each tick, the signed sum is multiplied by r = 1 − 2/d. Thus at lag t it equals 2r^{t}. Summed over all lags this gives 2/(1 − r) = d.

Call the excess of the absolute mass over the signed sum E_{t}. The five-cell calculation gives an identity valid for any array of weights. Applied to this unrestricted array it becomes

E_{t} = ‖w_{t}‖₁ − 2r^{t}

= 2 ∑_{x with jₜ(x)wₜ(x) < 0} |w_{t}(x)|.

The signs can also be counted inside the box, as in the opening example. A wall absorbs some of the signed pulse, so the box’s signed sum at a given lag can differ from 2r^{t}. To see how far we may use the unrestricted count, we will first find the lags that matter and then estimate how much of their weight reaches a wall.

## When do the colors lose control of the signs?

The backward weights have two components. Near the checkerboard frequency they look like a spreading Gaussian multiplied by the alternating sign. Near frequency zero they look like the change in a smooth Gaussian over one tick. The same cell receives both components. If the checkerboard component is strong enough to dictate the sign on that cell, adding a smooth weight can change its magnitude without creating any disagreement.

We can read both sizes from the [one-step Fourier multiplier](https://refactor.press/refactors/shrinking-hold#the-smooth-part-keeps-adding). For frequency θ a moving tick has multiplier b(θ) = ∑ a_{i} cos θ_{i}. The thermometer contributes 1 − b and t backward ticks contribute [h + (1 − h)b]^{t}. At the checkerboard frequency b = −1, so the absolute amplitude decays as r^{t}, about exp(−2t/d). Near zero b is close to 1. The thermometer takes a difference there, which gives the smooth component an absolute mass of about α_{n}/[(1 − h)t]. Here α_{n} = ½ E|X − n|, where X is a sum of squares of n independent standard normal variables.

Compare exp(−2t/d) with 1/t. After order d ticks the checkerboard has lost a fixed fraction of its amplitude, but 1/t is already very small. The later crossing solves 2t/d ≈ log t. Its leading location is (d/2) log d. The smooth contribution then accumulates until the wall time of order d². Its harmonic sum has logarithm

log [d² / ((d/2) log d)] = log d − log log d + log 2.

The delayed start explains the subtraction of log log d. It leaves a proof obligation. Could small sign disagreements spread over many earlier ticks add another constant? Counting just their mass lets us answer.

## Bound the disagreeing mass through the crossing

Write the free weight as U_{t} + j_{t} r^{t}V_{t}. The first term is the smooth change in the pulse. The second is a checkerboard-signed Gaussian to leading order. Near the checkerboard frequency retain the first correction to that Gaussian. It is a Gaussian times a polynomial in x/√t, divided by t. This extra term brings the error in the absolute sum of the approximation down to O(t^{−2}), uniformly for d ≥ 4.

There is a small inequality behind the sign estimate. Start with a positive weight a and add a perturbation b. Its negative part, max(0, −a − b), is at most b²/(4a), since (b + 2a)² ≥ 0. Take a to be the positive checkerboard Gaussian after multiplying by j_{t}. The smooth Gaussian is at least as narrow, so summing the squared perturbation divided by a costs at most a constant times (1 + r^{−t})/t². Bounding the two components separately also gives E_{t} = O(1/t). These estimates have different jobs.

- Early ticks. Up to d ticks the first bound is summable uniformly. At each fixed lag, letting h tend to zero restores perfect parity, so the total excess here tends to zero. The same bound continues to control the sum up to T₋ = (d/2)(log d − 2 log log d).
- The crossing. From T₋ to T₊ = (d/2)(log d + 2 log log d), use the O(1/t) bound. The sum costs O(log log d / log d), which tends to zero. The cutoffs are rounded to whole ticks and used for sufficiently large d.
- Late ticks. Beyond T₊ the entire checkerboard tail costs O(1/(log d)²). Only the smooth weights contribute to the remaining sum in the limit.

Up through T₊ the free pulse therefore supplies d + o(1). The walls cost o(1) in this early sum too. Reflected images give the box weights exactly. The lost absolute mass is bounded by twice the free absolute mass on or beyond a wall. A second-moment bound on the smooth component and a fourth-moment bound on the checkerboard component make the accumulated loss tend to zero. The late ticks are where the boundary leaves a finite contribution.

## What the walls leave in the answer

Measure space in units of d and time in units of d²/(1 − h). The walls now sit at ±1. Let p_{s} be the heat kernel from the center in this box, absorbed at the walls, with variance a_{i} per unit time on axis i. Write H(s) for the integral over the box of |∂p_{s}/∂s|. This is the smooth pulse’s total absolute rate of change at scaled time s. On all of space its value is α_{n}/s. Subtract that term up through s = 1. The difference near zero is exponentially small because so little heat has reached a wall. For large s the absorbed pulse decays exponentially. This gives a convergent integral for the offset, with S denoting the diagonal matrix of the axis probabilities.

β_{S} = α_{n} log 2

+ ∫₀¹ [H(s) − α_{n}/s] ds + ∫₁^{∞} H(s) ds.

The late lattice sum differs by o(1) from (1 − h)⁻¹ times the integral of H(s) from (1 − h)T₊/d² to infinity. The spatial and temporal quadrature errors tend to zero. Putting the early and late contributions back together gives, with natural logarithms and d tending to infinity,

C(d,1/d) − d = α_{n}(log d − log log d) + β_{S} + o(1).

The two logarithms have the same coefficient. On the line α₁ = 2/√(2πe) ≈ 0.48394, and on a square α₂ = 2/e ≈ 0.73576. Changing the axis preferences changes the boundary integral. On the line, numerical quadrature gives β ≈ 0.49554.

## What another doubling costs

Let R(d) = C(d,1/d) − d, the new column in the [finite-grid table](https://refactor.press/refactors/shrinking-hold). Double the wall distance and halve the holding probability with it. The boundary offset cancels in R(2d) − R(d), and the change in log log d tends to zero. Beyond the extra linear allowance of d, a doubling therefore adds a definite amount to the error factor.

R(2d) − R(d) → α_{n} log 2.

On the line that limit is about 0.33544. Direct backward iteration gives R(1024) ≈ 2.71282 and R(2048) ≈ 3.01252, an increment of about 0.29970. The approach is slow enough to see even on these grids. On a square the limiting increment is about 0.50999. Multiplying either figure by the local error tolerance gives the corresponding extra thermometer allowance after the linear part has been accounted for.

The four-page proof gives the uniform estimates for the sign disagreements and evaluates the boundary term. [Download What remains after the linear error? (PDF)](https://refactor.press/pdfs/shrinking-hold-remainder.pdf).

Why does the doubling from 1,024 to 2,048 still fall about 10.7% short of the line’s limit? Follow the same smooth amplitude on both grids and measure the extra time it takes to overtake the checkerboard. [How quickly does the residual doubling cost settle?](https://refactor.press/refactors/residual-doubling-rate)
