Positive Ehrhart-Macdonald reciprocity for n at least five
OpenMagicSquares.interior_reciprocity_pos_ge_fiveLet and let be a rational polynomial agreeing with the semi-magic counting function at every natural number. Then for every natural , the value of at equals, up to the sign , the number of positive semi-magic squares of line sum .
Here counts arrays of nonnegative integers with all row and column sums equal to , and counts those with every entry at least one. Geometrically, is the number of interior lattice points of the -fold dilation of the Birkhoff polytope , so this is the Ehrhart-Macdonald reciprocity law for evaluated at positive dilations, specialized to orders . Combined with the elementary shift bijection it yields the functional equation for every natural .
Formalization Note Lean counts via semiMagicCount and positiveInteriorCount over arrays with entries in Fin (t+1), and evaluates at rationals via casts; the hypothesis is rather than .
import Mathlib import Definitions.Def_MagicSquares import Definitions.Def_MagicSquares_positiveInteriorCount open MagicSquares
namespace MagicSquares theorem interior_reciprocity_pos_ge_five (n : Nat) (hn : 5 <= n) (p : Polynomial Rat) (hp : forall t : Nat, p.eval (t : Rat) = (semiMagicCount n t : Rat)) : forall s : Nat, n <= s -> p.eval (-(s : Rat)) = (-1 : Rat) ^ ((n - 1) ^ 2) * (positiveInteriorCount n s : Rat) := by sorry end MagicSquares