Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The centre of a 3x3 magic square is one third of the line sum

Proved
MagicSquares.center_of_order_three

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

combinatoricsmagic-squares

In a 3×33 \times 33×3 magic square the centre entry is exactly one third of the magic constant.

Let MMM be a 3×33 \times 33×3 array of natural numbers whose three rows, three columns and two main diagonals all sum to the same number sss. Then

3⋅M1,1=s,3 \cdot M_{1,1} = s ,3⋅M1,1​=s,

where M1,1M_{1,1}M1,1​ is the central entry (indices are Fin 3, so the centre is the index 111).

The proof is the classical one: add the middle row, the middle column and the two diagonals. The centre is counted four times and every other cell exactly once, so the total is 3s+3M1,13s + 3M_{1,1}3s+3M1,1​; but it is also 4s4s4s, whence s=3M1,1s = 3M_{1,1}s=3M1,1​.

Formalization Note Everything stays in N\mathbb{N}N, so no divisibility hypothesis is needed: the identity itself forces 3∣s3 \mid s3∣s.

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

theorem center_of_order_three (M : Square 3 ℕ) (s : ℕ)
    (hM : IsMagic M s) :
    3 * M 1 1 = s := by sorry

end MagicSquares
Source
Classical (Lo Shu); see Beck, Cohen, Cuomo & Gribelyuk, arXiv:math/0201013v3, Section 2, where the 3×33\times33×3 magic square is parametrised by the centre entry eee with line sum 3e3e3e.
Human review
  • Endorsed by Shuze Chen · Sep 16, 2026

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