Let $B$ and $C$ be abelian groups (in additive notation). We call a function $f:B\rightarrow C$ a quadratic form if for all $x,y,z \in B$, the function $f$ satisfies the relation $$f(x+y+z)-f(x+y)-f(y+z)-f(x+z)+f(x)+f(y)+f(z)=0.$$

Is there some reference which says that it satisfies the parallelogram law $f(x+y)+f(x-y)=2f(x)+2f(y)$ and that for $B=\mathbb{Z}^n$ we can write $$f(\displaystyle\sum_{i=1}^{n} a_i e_i)=\displaystyle\sum_{i=1}^n\big(2a_i^2+\displaystyle\sum_{j=1}^n a_ia_j \big) f(e_i)+ \displaystyle\sum_{1\leq i<j\leq n}a_ia_jf(e_i+e_j),$$ where $e_i$ denote the standard basis vectors of $\mathbb{Z}^n$.

Thank you!

-
Do you specifically need a reference? How about just a proof? – Scaramouche Jan 13 '12 at 22:20
Do you have one? I do not see how to do it. – Nadori Jan 13 '12 at 23:48

The parallelogram law can be proven from your relation by substituting $x=y=z=0$ to get that $f(0) = 0$; then substituting $z=-x$ to get that $$f(y) - f(x+y) - f(y-x) + f(x) + f(y) + f(-x) =0$$ or $$2 f(y) + f(x) + f(-x) = f(x+y) + f(y-x).$$ It clearly only remains to show that $f$ is even.
The second statement, your large sum expansion, follows from the first, since the parallelogram law implies the existence of an inner product defined as $$\langle x, y \rangle := \dfrac{f(x+y) - f(x-y)}4 \text{ such that } \langle x, x \rangle = f(x).$$ (aka the polarization identity.) Thus, using this inner product and its consequential symmetry and bilinearity, the second statement immediately follows.
Sorry, I don't think I can show that $f$ must be even. I guess I'll leave that for you to figure out, then. – Scaramouche Jan 16 '12 at 16:13