Mathematical workbench

Square laboratory

Control an arbitrary square through E, x, and y, or obtain these coordinates from a parametric family.

Blue 4/9

ABDF

E720x−320y−256
Matrix 3 × 3 · valuesΣ = 2 160
A400
B784
C976
D1 296
E720
F144
G464
H656
J1 040

a brick-red frame marks a value that is a perfect square

Magic invariantall 8 line sums agree
Declared maskABDF · confirmed
Actual result4/9 squares
Nondegeneracy9 pairwise-distinct entries

Family ABDF

Theorem and complete proof

General theory of the 4/9 and 5/9 orbits

Statement

Under the assumptions below, the formulas define an integral magic square of order 3 in which at least all 4 cells of the ABDF mask are squares of integers. Other cells are allowed to be squares as well.

{A,B,D,F}{P:MP(E,x,y)=rP2}\{A,B,D,F\}\subseteq\{P:\mathcal M_P(E,x,y)=r_P^2\}

The parameters a, b, c, and d are integers. The theorem requires neither positivity nor distinctness: it asserts that at least the four declared cells are perfect squares.

Initial system and elimination of E, x, y

For every marked cell, introduce an integral root and substitute the corresponding Magic3 linear form. This gives the system:

{E+x=qA2,Ex+y=qB2,Exy=qD2,E+x+y=qF2.\left\{\begin{aligned}E+x&=q_A^2,\\E-x+y&=q_B^2,\\E-x-y&=q_D^2,\\E+x+y&=q_F^2.\end{aligned}\right.

The coefficient matrix of E, x, and y has rank 3. Eliminating them therefore leaves 1 independent homogeneous quadratic equation in the roots. The equations are derived and parametrized below.

Derivation of the root parametrization

Introduce the following auxiliary integers:

(k1,k2,k3,k4)=(2,1,1,2),k1+k2+k3+k4=0(k_1,k_2,k_3,k_4)=(2,1,-1,-2),\qquad k_1+k_2+k_3+k_4=0D=k1a2+k2b2+k3c2,L=k1a+k2b+k3cD=k_1a^2+k_2b^2+k_3c^2,\qquad L=k_1a+k_2b+k_3c(qA,qB,qD,qF)=4d(D2La,D2Lb,D2Lc,D)(q_A,q_B,q_D,q_F)=4d\,(D-2La,\,D-2Lb,\,D-2Lc,\,D)

Define the declared cell values as the following explicit squares:

(A,B,D,F)=(qA2,qB2,qD2,qF2)(A,B,D,F)=(q_A^2,q_B^2,q_D^2,q_F^2)

This is projection of the diagonal quadric from the rational point (1,1,1,1). Substitution cancels identically: the D² term vanishes because the coefficients sum to zero, the mixed term is −4DL², and the quadratic term is +4L²D.

2qA2+qB2=qD2+2qF22q_A^2+q_B^2=q_D^2+2q_F^2

For completeness, use the four rows ε of the Hadamard matrix H from the general lemma and the homogeneous signed formula qᵢ=Dεᵢ−2Lεuᵢ. Every kᵢ is nonzero here. For a nonzero rational point q*, the vector (kᵢqᵢ*) is nonzero; since det H=−16, at least one row has Lε(q*)≠0. Setting u=q* gives D=0 and the new root vector −2Lε(q*)q*, the same projective point. The displayed generator is the affine chart ε=(1,1,1,1), u₄=0; the other three signed charts cover its exceptional rulings. A common factor d clears denominators.

Reconstruction of the magic square

Use the standard three-coordinate form:

M(E,x,y)=(E+xEx+yEyExyEE+x+yE+yE+xyEx)\mathcal M(E,x,y)=\begin{pmatrix} E+x & E-x+y & E-y\\ E-x-y & E & E+x+y\\ E+y & E+x-y & E-x \end{pmatrix}

Set the coordinates equal to the following linear combination of the square values already constructed:

(E,x,y)=(2A+B+D4,,2ABD4,,BD2)(E,x,y)=\left(\frac{2A+B+D}{4},,\frac{2A-B-D}{4},,\frac{B-D}{2}\right)

The factor δ=4 is the absolute value of a nonzero minor of the selected cell-form matrix. Multiplying every root by δ multiplies every cell value by δ², so Cramer's formulas for E, x, and y become integral.

The general linear lemma is applied directly: when the selected cell-form matrix has rank 3, its value vector lies in the image exactly when every vector in the left kernel annihilates it. The left kernel has dimension one for four cells and two for five cells. The colored identities above form precisely such a basis, while the displayed formulas for E, x, and y give the unique preimage.

LS(E,x,y)T=(qP2)PS,kerLST=R1,,R1L_S(E,x,y)^T=(q_P^2)_{P\in S},\qquad \ker L_S^T=\langle R_1,\ldots,R_{1}\rangle

Now substitute the coordinates into the nine Magic3 linear forms. Therefore

πABDF ⁣(M(E,x,y))=(A,B,D,F){n2:nZ}4\pi_{ABDF}\!\left(\mathcal M(E,x,y)\right)=(A,B,D,F)\in\{n^2:n\in\mathbb Z\}^{4}

By the Magic3 form itself, every row, every column, and both diagonals sum to 3E. We have therefore obtained the required family of magic squares with square-valued mask ABDF. This proves the claim.

Color lemmas used in this proof

Blue x² + 2y² norm

2A+B=D+2F2A+B=D+2F

A blue four-cell support encodes a weighted equality of squares obtained by composing the norm u² + 2v².

u=ac+2bd,v=adbc,w=ac2bd,z=ad+bcu=ac+2bd,\quad v=ad-bc,\quad w=ac-2bd,\quad z=ad+bcu2+2v2=w2+2z2=(a2+2b2)(c2+2d2)u^2+2v^2=w^2+2z^2=(a^2+2b^2)(c^2+2d^2)(U,V,W,Z)=(u2,v2,w2,z2)U+2V=W+2Z(U,V,W,Z)=(u^2,v^2,w^2,z^2)\Longrightarrow U+2V=W+2Z

In this mask, the lemma variables are replaced by cells A, B, D, F; its conclusion is exactly the cell relation displayed above.

General statement and proof

Coverage completeness

Status: complete coverage. Completeness here refers to rational root vectors; integral representatives are obtained by clearing denominators and applying a common scale.

Broadest guaranteed subset

Every rational solution of the single quadric for this mask, including the zero solution. After clearing denominators, this means every integral projective class up to root signs, common scale, common gcd, and D₄ symmetries.

(qP)PSVS(Q),RS(q)=0(q_P)_{P\in S}\in V_S(\mathbb Q),\qquad R_S(q)=0

Inverse construction

The four signed charts are the rows of the Hadamard matrix. For every nonzero root vector at least one pairing Lε is nonzero because det H=−16; that chart returns the same projective point.

What remains outside the guarantee

The union of the charts has no exceptional locus. An exceptional ruling of one affine chart is covered by one of the other three signed charts.

Exc(ΦS)=\operatorname{Exc}(\Phi_S)=\varnothing

The parametrization is complete over rational points and algorithmically complete after denominators are cleared.

The formulas are checked by an exact integral certificate in the browser generator; migration to proof-core is not complete yet.four_of_nine_abdf_orbit