MacMahon parametrization: 3x3 magic squares vs admissible pairs
ProvedMagicSquares.magic_three_param_bijThe map
is a bijection from the magic squares with nonnegative entries and line sum onto the admissible parameter pairs
Consequently the two counting functions agree: .
Injectivity. MacMahon's centre identity gives ; then the diagonal and anti-diagonal identities give and , the row and column identities fill in , , , , and , by definition. So determines completely.
Surjectivity. Given an admissible pair, the array mkMagic3 e a c has
nonnegative entries (that is exactly what admissibility says, together with the
implied bounds ) and its three rows, three columns and two diagonals
all sum to ; each entry is at most , so it lies in the search space
used by magicCount.
Formalization Note magicCount 3 (3*e) counts arrays with entries in
Fin (3*e+1); paramCount e counts the finset paramSet e. The bijection is
expressed as an equality of cardinalities.
import Mathlib import Definitions.Def_MagicSquares import Definitions.Def_MagicSquaresParam3 open MagicSquares
namespace MagicSquares
theorem magic_three_param_bij (e : ℕ) :
magicCount 3 (3 * e) = paramCount e := by sorry
end MagicSquares
Confirmed by the mission captain (proposal self-audit).