# For magic squares prove $id_v+r^2=2c$

I've been presented with the following problem:

Let $V$ be the vector space of all $3\times3$ magic squares. Let $r:V\rightarrow V$ be the linear image which rotates a magic square $90^\circ$. Let $c:V\rightarrow V$ be the linear image which sends a magic square $M$ to a square in which all numbers are equal to the middle number of $M$. Show that $$id_{V}+r^{2}=2c$$

In which I assume that $r^2$ means a net rotation of $180^\circ$. This is all information given.

I can show this to be the case by using three basic magic squares which through linear addition can form any $3\times3$ magic square.

If $a$ is a number on the outer ring of the square, and $b$ is the number opposite it, and $d$ is the centre number. Then for all these three squares. $$a+b=2d$$ This is closed under "square addition" and scalar multiplication. Knowing that, the rest of the proof is a cake walk.

I'm a bit concerned if I'm allowed to do this so indirectly though, but I've been having trouble proving it directly. As well as having trouble putting the whole thing in formal language.

I know that a $3\times3$ magic square is dependent on the equation above but don't see how to prove it directly other than that $a+b=constant$. Nor prove that a square which doesn't follow this rule isn't a magic square. I have the feeling I'm overlooking something very obvious.

If you've got a proof that the three "basic" squares really DO generate any magic square (through linear combinations), then because every operation you're using is linear, your proof is fine.

It's the standard idea: you want to show linear functions $S, T : V \to W$ are identical. To do so, you take a set $b_1, \ldots, b_k$ that spans $V$, and show that $S(b_i) = T(b_i)$ for every $i$. Usually, for simplicity, you choose the b's to be a basis, but spanning is all that's needed.

As it turns out there was indeed a direct answer.

Let the magic number be $n$

Consider the four straight lines throught the center of the magic square: $\{1,2\}\dashrightarrow\{3,2\}, \{2,1\}\dashrightarrow\{2,3\},\{1,1\}\dashrightarrow\{3,3\} \{1,3\}\dashrightarrow\{3,1\}$

De sum of the four lines is $4n$

$4n$ is then equal to the sum of all the number, plus three times the center value $d$:

$$4n=3n+3a\rightarrow n=3d$$

From this it follows that:

$$n=3d\rightarrow a+b=2d\blacksquare$$