arrangement3_sum_entries
lemmaverified
The sum of all entries in any 3 × 3 arrangement of the integers 1 through 9 (without repetition) is 45.
Statement
lemma arrangement3_sum_entries (S : Fin 3 × Fin 3 ≃ Fin 9) :
∑ i : Fin 3, ∑ j : Fin 3, ((S (i, j)).val + 1 : ℤ) = 45- Source
- arXiv:2610.38386, Section 5.1
- Verified
- 01 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Used by 1
- arrangement3_e4_zero_iff_is_magicAn arrangement of order 3 satisfies the four-term line-sum energy zero condition $E_4(S) = 0$ if and only if it is a magic square.
Read back from the Lean
For every bijection (equivalence) $S : \text{Fin } 3 \times \text{Fin } 3 \simeq \text{Fin } 9$, the double sum over all $i \in \text{Fin } 3$ and $j \in \text{Fin } 3$ of $(S(i, j).\text{val} + 1)$ (evaluated in the integers $\mathbb{Z}$) equals $45$.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- The sum of all entries of an order 3 arrangement S is 45. -/ lemma arrangement3_sum_entries (S : Fin 3 × Fin 3 ≃ Fin 9) : ∑ i : Fin 3, ∑ j : Fin 3, ((S (i, j)).val + 1 : ℤ) = 45 := by rw [← Fintype.sum_prod_type (fun p : Fin 3 × Fin 3 => ((S p).val + 1 : ℤ))] rw [Equiv.sum_comp S (fun k : Fin 9 => ((k : ℤ) + 1))] rfl