There is a theorem that states that two quadratic forms over $\mathbb{Q}_p$ are equivalent iff they have the same rank, discriminant and the same $\epsilon$ invariant.

(The last is defined as follows: if $f = \sum_{i=1}^n a_ix_i^2$ then $\epsilon(f) = \prod_{1\le i < j \le n} (a_i,a_j)$, where $(\cdot,\cdot)$ is the Hilbert symbol over $\mathbb{Q}_p$.)

The proof (from Serre's Arithmetic) is based on a previous theorem, which relates these invariants to the elements the forms represent.

However, I do not know how I can show that two particular forms are equivalent (with the same invariants of course). So fix some prime $p$ and consider the following two forms over $\mathbb{Q}_p$:

$$f(x) = x_1^2 + x_2^2 + x_3^2 + x_4^2 - (x_5^2 + x_6^2 + x_7^2) \nonumber$$ and
g(x) = -(x_1^2 + x_2^2 + x_3^2 + x_4^2 + x_5^2 + x_6^2 + x_7^2) \nonumber

How can I show in particular that these two are equivalent (without using the classification theorem above)? Thanks.

-
Have you tried the book by O'Meara? –  Geoff Robinson Mar 20 '12 at 16:30
No, does it have such examples? –  milcak Mar 20 '12 at 16:52
They are not equivalent when $p = \infty$ –  Will Jagy Mar 20 '12 at 17:01
Yes of course not, but when $p$ is a "finite" prime they are (or should be) –  milcak Mar 20 '12 at 17:04
The book "Introduction to Quadratic Forms " by Timothy O'Meara is considered a classic text. I hve not read it for some years, but it is very comprehensive. –  Geoff Robinson Mar 20 '12 at 18:35
show 1 more comment

I think what you probably want from us is this: on pages 43 to 44 of Rational Quadratic Forms by J. W. S. Cassels, CASSELS we find tables of $(a,b)_p$ for odd primes $p,$ then for $p=2,$ finally $p=\infty$ on page 44.

For odd primes $p,$ $$(1,1)_p = (1,-1)_p = (-1,-1)_p = 1,$$ as we only begin to get $-1$ as an outcome if at least one argument $n$ has $p^{2k - 1} \parallel n.$ So your two forms have the same invariant $\varepsilon$ as in Serre, defined page 35, then used page 39, Theorem 7. As they have the same rank $7$ and discriminant $-1,$ your two forms agree in $\mathbb Q_p$ for odd finite $p.$

We get a slightly different picture for $p=2$ that is $$(1,1)_2 = (1,-1)_2 = 1, \; \; \; (-1,-1)_2 = -1.$$ For your first form, we get index pairs $56, 57, 67$ giving a factor of $-1$ each, result is $-1.$ For your second form, all $21$ ordered pairs give $-1,$ once again $-1$ and the two forms are equivalent in $\mathbb Q_2$ as well. Anyway, $$\left( \begin{array}{c} 3 \\ 2 \end{array} \right) = 3, \; \; \; \left( \begin{array}{c} 7 \\ 2 \end{array} \right) = 21$$ are both odd, which is what does it. Given that all your coefficients are $\pm 1,$ this amounts to the fact that $3 \equiv 7 \pmod 4.$

The case of $p = \infty$ is different. Serre does that on page 40. If you just look at discriminant, rank, and invariant, they are the same. It seems he leaves the statement that the signature is an invariant to the next page, 41. Sylvester's law of inertia is the fact that, over the reals, rank and signature are a complete set of invariants.

-
Since this is only about $p$-adics, an elementary argument that comes to mind would be as follows (unless I totally missed something).
If $p\equiv 1\pmod4$, then $-1=a^2$ for some $a\in\mathbf{Z}_p^*$. Therefore $x^2$ and $(ax)^2=-x^2$ are equivalent.
If $p\equiv -1\pmod4$, then $-1=a^2+b^2$ for some integers $a,b\in\mathbf{Z}_p^*$. In this case $x^2+y^2$ is equivalent to $$(ax+by)^2+(bx-ay)^2=(a^2+b^2)(x^2+y^2)=-(x^2+y^2).$$ Two or four such equivalences convert your $f$ to $g$.
And let's not forget the prime $p=2$. Taking norms of the product of quaternions $$(2+i+j+k)(x_1+x_2i+x_3j+x_4k)$$ tells us that \begin{aligned} 7(x_1^2+x_2^2+x_3^2+x_4^2)&=(2x_1-x_2-x_3-x_4)^2+(x_1+2x_2-x_3+x_4)^2\\ &+(x_1+x_2+2x_3-x_4)^2+(x_1-x_2+x_3+2x_4)^2. \end{aligned} Combining this with the fact that $\sqrt{-7}\in\mathbf{Q}_2$ allows you to turn the sum of four squares to its negative by an equivalence transformation.