The three-parameter array is a magic square of line sum 3e
ProvedMagicSquares.magic_three_param_sufficientThe parametrization is sound. Let be nonnegative integers satisfying the admissibility inequalities
and let be the array
Then is a magic square of line sum : all three rows, all three columns, and both main diagonals sum to .
The inequalities are exactly what makes the truncations in harmless. Row needs so that is not truncated; row needs and for the same reason on and ; row needs , and , and the bounds follow from the hypotheses by adding to (giving ) and symmetrically. The columns and diagonals are then pure cancellation.
Together with the companion necessary direction this shows that the map is a parametrization of the order-three magic squares of line sum .
Formalization Note mkMagic3 is defined over with truncated
subtraction, so every line identity is proved by omega after discharging the
relevant non-truncation side condition. The statement is otherwise unconditional
apart from admissibility.
import Mathlib import Definitions.Def_MagicSquares import Definitions.Def_MagicSquaresParam3
namespace MagicSquares
theorem magic_three_param_sufficient (e a c : ℕ) (h : IsParam3 e a c) :
IsMagic (mkMagic3 e a c) (3 * e) := by sorry
end MagicSquares
Confirmed by the mission captain (proposal self-audit).