Interactive theorem view

Line-indicator covariance energy

Magic squares are exactly the zero set of a covariance energy built from row, column, and diagonal indicators. This page shows the same object as line stress, an energy barcode, mode spectra, residual geometry, and a swap landscape.

Magic? -
Complete energy -
Low-mode energy -
Max line residual -

Line stress overlay

Square

Bands are signed line residuals ρ_L = Σ_{(i,j) in L} Z_ij. A magic square makes every constrained band neutral.

Energy barcode

Indicator covariance terms

Each bar is Cov(I_L,Z)^2. The displayed row and column bars include redundant final lines; the theorem omits one of each.

Mode-energy decomposition

Residual spectra

Row and column residual vectors are decomposed into DCT modes. The first mode is the covariance-like low mode; higher modes explain why low-mode balance can fail to be magic.

Residual geometry

Projection into mode space

Random arrangements form the background cloud. The selected square’s row and column residuals are projected onto the first two residual modes.

Swap landscape

Energy after one swap

Cell pair (a,b) is colored by E_full(swap(a,b)). Magic squares appear as isolated zero-energy states surrounded by positive energy.