Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The normal members of MacMahon's order-three family

Proved
MagicSquares.magic_three_normal_classify

by Yuxuan Xu · Sep 17, 2026 · Mathlib 0df444a (Lean v4.33.1)

combinatoricsenumerative-combinatoricsmagic-squares

Characterization of the normal squares inside MacMahon's order-three family.

For (a,c)∈paramSet 5(a,c)\in\mathrm{paramSet}\ 5(a,c)∈paramSet 5,

mkMagic3(5,a,c) is normal  ⟺  (a,c)∈{(2,4),(2,6),(4,2),(4,8),(6,2),(6,8),(8,4),(8,6)}.\mathrm{mkMagic3}(5,a,c)\ \text{is normal}\iff (a,c)\in\{(2,4),(2,6),(4,2),(4,8),(6,2),(6,8),(8,4),(8,6)\}.mkMagic3(5,a,c) is normal⟺(a,c)∈{(2,4),(2,6),(4,2),(4,8),(6,2),(6,8),(8,4),(8,6)}.

Here normal means the nine entries lie in [1,9][1,9][1,9] and are pairwise distinct, i.e. they are a permutation of 1,…,91,\dots,91,…,9; and

mkMagic3(5,a,c)=(a15−a−cc5+c−a55+a−c10−ca+c−510−a).\mathrm{mkMagic3}(5,a,c)= \begin{pmatrix} a & 15-a-c & c\\ 5+c-a & 5 & 5+a-c\\ 10-c & a+c-5 & 10-a \end{pmatrix}.mkMagic3(5,a,c)=​a5+c−a10−c​15−a−c5a+c−5​c5+a−c10−a​​.

Proof. Normality forces 1≤a≤91\le a\le 91≤a≤9 and 1≤c≤91\le c\le 91≤c≤9, since a=M00a=M_{00}a=M00​ and c=M02c=M_{02}c=M02​ are entries. This leaves 818181 pairs, each of which is a ground instance and is settled by evaluation. The eight surviving pairs are exactly those for which the corner entries aaa and ccc are distinct members of {2,4,6,8}\{2,4,6,8\}{2,4,6,8} with a+c≠10a+c\ne 10a+c=10; the pairs with a+c=10a+c=10a+c=10 are excluded because then M21=a+c−5=5M_{21}=a+c-5=5M21​=a+c−5=5 coincides with the centre.

Formalization Note IsNormal is stated with a Function.Injective, which is not decidable as given, so it is first rewritten into an explicit conjunction of entrywise bounds over Fin 3 and pairwise-distinctness of the nine positions. The quantifiers over Fin 3 are then unfolded with Fin.forall_fin_succ before norm_num decides the resulting ground instances. Because the parametrization is over N\mathbb{N}N, entries such as a+c−5a+c-5a+c−5 and 15−a−c15-a-c15−a−c truncate at zero, and each instance is evaluated with the truncation in place.

Preamble
import Mathlib
import Definitions.Def_MagicSquares
import Definitions.Def_MagicSquaresParam3
open MagicSquares
Formal statement
namespace MagicSquares

theorem magic_three_normal_classify (a c : ℕ) (hac : (a, c) ∈ paramSet 5) :
    IsNormal (mkMagic3 5 a c) ↔
      (a = 2 ∧ c = 4) ∨ (a = 2 ∧ c = 6) ∨ (a = 4 ∧ c = 2) ∨ (a = 4 ∧ c = 8) ∨
        (a = 6 ∧ c = 2) ∨ (a = 6 ∧ c = 8) ∨ (a = 8 ∧ c = 4) ∨ (a = 8 ∧ c = 6) := by sorry

end MagicSquares
Source
P. A. MacMahon, Combinatory Analysis (1916); W. S. Andrews, Magic Squares and Cubes, 2nd ed., Dover, 1960; M. Beck, T. Cohen, J. Cuomo, P. Gribelyuk, Amer. Math. Monthly 110 (2003), 707-717; arXiv:math/0201013v3.
Human review
  • Endorsed by Shuze Chen · Sep 17, 2026

  • Endorsed by Yuxuan Xu · Sep 17, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, licensed under Apache 2.0.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTermsJoin SlackJoin Zulip© 2026 Prove2Me