Every panmagic square is magic
ProvedMagicSquares.panmagic_is_magiccombinatoricsmagic-squares
A panmagic (pandiagonal) square is in particular a magic square.
By definition IsPanMagic M s requires every row and every column to sum to
(the semi-magic condition) and, in addition, every broken diagonal in both
directions to sum to . The two main diagonals are the broken diagonals of
offset , so both main diagonal sums equal , which is exactly the extra
content of IsMagic M s over IsSemiMagic M s.
Formalization Note brokenDiagSum M k is with the column
index read modulo , so brokenDiagSum M 0 = diagSum M. For the anti-diagonal one
uses brokenAntiDiagSum M 0, i.e. , which is
antiDiagSum M. Only is needed so that Fin n carries the additive
structure used to speak of offsets.
Preamble
import Mathlib import Definitions.Def_MagicSquares open MagicSquares
Formal statement
namespace MagicSquares
theorem panmagic_is_magic {n : ℕ} [NeZero n]
(M : Square n ℕ) (s : ℕ) (hP : IsPanMagic M s) :
IsMagic M s := by sorry
end MagicSquaresSource
Beck, Cohen, Cuomo & Gribelyuk, The number of ``magic'' squares, cubes and hypercubes, Amer. Math. Monthly 110 (2003), 707--717; arXiv:math/0201013v3., Section 1 (definitions of versus ).