# Moire local limit - 2026-10-02 [Proved] For every `dim 2` code and integer gap `h >= 1`, the difference overlay of the level-1 designs at sides `N` and `N + h` on the unit square has local limit `Phi(hu, hv)`, `Phi(s, t) = (1 - w_0^2 - w_1^2 Lambda(s) - w_2^2 Lambda(t) - w_12^2 Lambda(s) Lambda(t))/2`, `Lambda(s) = 1 - 2 dist(s, 2Z)`, `w` the Walsh coefficients of the code's sign on the corners; for `N >= 2h` every box with sides at least `l` has box mean within `(36/l + 20h)/N` of the limit's. Witness: stack.md, The local moire limit. - 2026-10-02 [Proved] The 16 codes of `dim 2` give five local limits: `0` for codes 0 and 15, `(1 - (1 + Lambda(s))(1 + Lambda(t))/4)/2` for codes 1, 2, 4, 7, 8, 11, 13, 14, `(1 - Lambda(s))/2` for codes 3 and 12, `(1 - Lambda(t))/2` for codes 5 and 10, `(1 - Lambda(s) Lambda(t))/2` for codes 6 and 9, checked exactly at gaps 1, 2, 3, 4, 6 on 169 points and by an unfactorised raster at sides 21 and 23. Witness: stack.md, The local moire limit; lab/py/moire-local-limit. - 2026-10-02 [Proved] At code 7 and gap 2 the local limit is `H(u, v) = (1 - abs(1 - 2u) abs(1 - 2v))/2`, mean `3/8`, independent of `N`, so `2323` over `2321` looks like `23` over `21` only finer; at gap `2k` it is `H` tiled `k` by `k`, and at gap 1 it is `(1 - (1 - u)(1 - v))/2`. Witness: stack.md, The local moire limit. - 2026-10-02 [Verified] The worst 32 by 32 window error of code 7 at gap 2 against `H` reads `5.396e-01`, `1.227e-01`, `4.232e-03`, `4.170e-05`, `7.516e-06` at `21/23`, `101/103`, `2321/2323`, `23231/23233`, `232321/232323`, and `4.845e-03`, `5.080e-03`, `4.117e-03`, `4.091e-03` against the gap limit at `2320/2322`, `2321/2322`, `2321/2325`, `2319/2325`. Witness: lab/py/moire-local-limit. - 2026-10-02 [Proved] For `0 < c < 1/2` the level set `H = c` is the four arcs `abs(XY) = 1 - 2c` in the centred coordinates `X = 1 - 2u`, `Y = 1 - 2v`, so no level set of `H` is a polygon, and the region `H >= c` is the unit square with its four corners cut along those arcs; its eight vertices form a regular octagon exactly at `c = 1 - 1/sqrt 2 = 0.292893`, where each arc bows inward from its chord by `0.089820`, which is `0.108423` of the chord. Witness: stack.md, The local moire limit. - 2026-10-02 [Verified] At `232321/232323` on windows of side `1/1024` on the diagonal, the window at the chord midpoint `u = 0.146447` reads `0.249744`, where a regular octagon at the level `0.292893` would put its side, and the window at the arc point `u = 0.178203` reads `0.292906`. Witness: lab/py/moire-local-limit. - 2026-10-02 [Proved] The local correlation of the two parities tends to `Lambda(hu)` and covers `[-1, 1]`, while `int_0^1 Lambda(hu) du = 0` for every integer gap, so the limit's global mean is `2 fill (1 - fill)` for every code and gap; at code 7 the local joint ink `1/2 + abs(1 - 2u) abs(1 - 2v)/4` averages to `9/16`, the product of the fills, which is why the global mean `3/8` is the independent value. Witness: stack.md, The local moire limit. - 2026-10-02 [Verified] At `2321/2323` the 32 window correlations run from `-0.9367` to `0.9376`, the exact global covariance of the two parities is `0` and the exact global overlay mean is `10895080998961/29070245572489`, the independent value; the exact covariance is also `0` at `2320/2322`, `2321/2322`, `2321/2325` and `2/5391675` at `2319/2325`. Witness: lab/py/moire-local-limit. - 2026-10-02 [Refuted] The naive level-2 product formula `9/16 - (9/32) abs(1 - 2u) abs(1 - 2v)` for code 7 at gap 2, which lets the second level decorrelate on its own: it misses the level-2 limit by at least `0.037617` at odd sides and `0.005552` at even sides, its largest misses on the `1/256` grid, and the direct window error against it reads `3.796e-02` at `1001/1003`. Witness: lab/py/moire-local-limit. - 2026-10-02 [Proved] For the level-2 design of code 7 at gap 2, with `f = {Nx}`, the second parities at sides `N` and `N + 2` are `p(Nf)` and `p(Nf + lambda)`, `lambda = 4f + 4x + (N mod 2) floor(f + 2x)`, exactly, and the two-scale law is `H2 = 5/8 - alpha(u) alpha(v) - gamma(u) gamma(v) - 2 beta(u) beta(v)`, `alpha = abs(1 - 2u)/2`, `beta = (abs(1 - 2u) + w)/8`, `gamma = 1/4` at even `N`, `(1 + 2w)/4` at odd `N`, `w(u) = -2u(1 - 4u)` on `[0, 1/4]`, `(4u - 1)(1 - 2u)` on `[1/4, 1/2]`, `w(1 - u) = w(u)`. Witness: stack.md, The local moire limit. - 2026-10-02 [Proved] For `N >= 24` every box with sides at least `l` has level-2 overlay mean of code 7 at gap 2 within `(146 + 16/l + 64/(N l))/N` of the box mean of `H2` of the same parity as `N`, by freezing the second lag on each second-level period and then `x` on each top period. Witness: stack.md, The local moire limit. - 2026-10-02 [Verified] The direct level-2 window error against `H2` reads `1.692e-02`, `4.307e-03`, `2.188e-03` at `201`, `1001`, `2001` and `1.621e-02`, `4.505e-03`, `2.064e-03` at `200`, `1000`, `2000`, against `0.032` to `0.040` from the other parity's formula, and the closed form equals the two-scale law at 169 points at both parities. Witness: lab/py/moire-local-limit. - 2026-10-02 [Proved] The level-2 overlay of code 7 at gap 2 has no single local limit: odd and even sides converge to two images differing by `(w(u) + w(v) + 2 w(u) w(v))/8`, at most `9/256 = 0.035156`, attained at `u = v = 3/8`. Witness: stack.md, The local moire limit. - 2026-10-02 [Proved] The level-2 limit kernel has rank exactly 3, spanned by `1`, `abs(1 - 2u)` and `w`, its 3 by 3 minor at `u, v` in `0, 1/8, 1/4` being `99/524288` at odd and `9/524288` at even sides, so no formula `a + F(u) G(v)` exists, and it is not a function of `abs(1 - 2u) abs(1 - 2v)`, reading `121/256` at `(0, 3/8)` and `63/128` at `(1/4, 1/4)` at odd sides. Witness: stack.md, The local moire limit; lab/py/moire-local-limit. - 2026-10-02 [Verified] The global law of the four level-2 parities is uniform at both parities and the global mean of `H2` is `63/128 = 2 (9/16)(7/16)`, the independent value. Witness: lab/py/moire-local-limit. - 2026-10-02 [Verified] The indicial equations model of Amidror and Hersch puts the centrelines of the `(1,-1)`-moire of two parallel gratings of periods `T_1, T_2` at `x (T_2 - T_1) = T_1 T_2 p`, a band period `T_1 T_2/abs(T_2 - T_1)`, which is `2/h` for the parities at sides `N` and `N + h`, read at source in section 2. Witness: Amidror Hersch 2010.