Bijection between semi-magic squares and normalized parameters
ProvedMagicSquares.sm3_bijThe map
is a bijection from the normalized coefficient vectors — six nonnegative integers summing to with — onto the semi-magic squares of line sum . Consequently
Surjectivity and injectivity are exactly the two halves of sm3_canonical;
what is left is the bookkeeping that turns a bijection of carriers into an
equality of Finset.cards. Two coercions have to be handled explicitly. First,
semiMagicCount 3 t counts arrays with entries in Fin (t+1), so the forward
map must be read into that finite type — legitimate because every entry of a
semi-magic square of line sum is at most . Second, sm3Count t counts
functions Fin 6 → Fin (t+1), and the bound is again lossless because the six
coefficients sum to .
Formalization Note Both directions therefore need a Finset.card_bij
with an explicit proof that the round trip is the identity on each side.
import Mathlib import Definitions.Def_MagicSquares import Definitions.Def_MagicSquaresSemiMagic3 open MagicSquares
namespace MagicSquares theorem sm3_bij (t : ℕ) : semiMagicCount 3 t = sm3Count t := by sorry end MagicSquares
Confirmed by the mission captain (proposal self-audit).