Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The vanishing list of the semi-magic counting polynomial

Proved
MagicSquares.semi_magic_vanishing

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

combinatoricsehrhartenumerative-combinatoricsmagic-squares

The vanishing list. Let n≥1n\ge 1n≥1 and let p∈Q[X]p\in\mathbb{Q}[X]p∈Q[X] agree with HnH_{n}Hn​ on the nonnegative integers. Then ppp vanishes at the negative integers −1,−2,…,−(n−1)-1,-2,\dots,-(n-1)−1,−2,…,−(n−1): for every integer kkk with 1≤k≤n−11\le k\le n-11≤k≤n−1 we have p(−k)=0p(-k)=0p(−k)=0. This is the statement that the polytope has no interior lattice points on the relevant dilates, and it is the second identity of the goal. At n=1n=1n=1 the condition is vacuous.

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

theorem semi_magic_vanishing (n : ℕ) (hn : 1 ≤ n) (p : Polynomial ℚ)
    (hp : ∀ t : ℕ, p.eval (t : ℚ) = (semiMagicCount n t : ℚ)) :
    ∀ k : ℤ, 1 ≤ k → k ≤ (n : ℤ) - 1 → p.eval (-(k : ℚ)) = 0 := by
  sorry

end MagicSquares
Source
M. Beck, M. Cohen, J. Cuomo and P. Gribelyuk, The number of "magic" squares, cubes and hypercubes, Amer. Math. Monthly 110 (2003), 707--717 (arXiv:math/0201013); E. Ehrhart (1973); R. P. Stanley, Duke Math. J. 40 (1973) 607--632; J. Spencer, Amer. Math. Monthly 87 (1980) 397--399; M. Beck and D. Paxton, The Ehrhart polynomial of the Birkhoff polytope (arXiv:math.CO/0202267).
Read-back

What the Lean code literally says, in plain math · deepseek-v4.1-flash (WorkBuddy blind sub-agent)

Let nnn be a natural number with 1≤n1\le n1≤n, and let p∈Q[X]p\in\mathbb{Q}[X]p∈Q[X] be any polynomial satisfying p(t)=semiMagicCount⁡(n,t)p(t)=\operatorname{semiMagicCount}(n,t)p(t)=semiMagicCount(n,t) in Q\mathbb{Q}Q for every natural number ttt. Then for every integer kkk, the implication

1≤kandk≤n−1  ⟹  p(−k)=01\le k \quad\text{and}\quad k\le n-1 \;\Longrightarrow\; p(-k)=01≤kandk≤n−1⟹p(−k)=0

holds, where n−1n-1n−1 in the upper bound is the integer subtraction (the natural nnn coerced to Z\mathbb{Z}Z, then decremented by 111). In other words, ppp vanishes at the negative integers −k-k−k for each integer kkk satisfying 1≤k≤n−11\le k\le n-11≤k≤n−1. Edge case: when n=1n=1n=1, the upper bound becomes k≤0k\le 0k≤0, which together with 1≤k1\le k1≤k is impossible, so the implication is vacuously true for every ppp and asserts no actual vanishing.

Human review
  • Endorsed by Shuze Chen · Sep 19, 2026

  • Endorsed by Yuxuan Xu · Sep 19, 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