The second post of this series posts will focus on quadratic forms over some particular fields, like the rational numbers, the real numbers, and the $p$-adic numbers.

First of all, perhaps we give some introductory materials on $p$-adic fields, here $p$ is a prime integer in $\mathbb{N}$. We define $\mathbb{Q}_p=\{\sum_{n>N}a_np^n|a_n=0,1,...,p-1, N\in\mathbb{Z}\}$. For its any two elements $a=\sum a_np^n, b=\sum b_np^n$, we define a similarity function $s(a,b)=\sup\{n\in\mathbb{Z}|a_m=b_m,\forall m\leq n\}$(for convention, for the zero element $0=\sum 0p^n$, we set $s(0,0)=+\infty$). It is a symmetric function $s:\mathbb{Q}_p\times \mathbb{Q}_p\rightarrow \mathbb{N}\bigcup\{+\infty\}$. What is more, it is easy to verify that for any $a,b,c\in\mathbb{Q}_p$, we have that $s(a,b)\geq min\{s(a,c),s(c,b)\}$, which means that $-s$ is a distance function from $\mathbb{Q}_p$ to the tropical geometry $-\mathbb{N}\bigcup\{-\infty\}$. So, we can define a distance into the real world, that is $d(a,b)=e^{-s(a,b)}$, which thus satisfies that $d(a,b)\leq \max{d(a,c),d(c,b)}\leq d(a,c)+d(c,b)$, showing that this distance defines an ultra-metric on $\mathbb{Q}_p$. Now we say something about the topology defined by this metric. First we consider a subspace of $\mathbb{Q}_p$, that is the integer ring of it, $\mathbb{Z}_p=\{a\in\mathbb{Q}_p|s(a,0)\geq0\}$. It is easy to see that $\mathbb{Z}_p=\{0,1,2,...,p-1\}^{\mathbb{N}}=F_p^{\mathbb{N}}$. What is more, for every inclusion $i_k:F_p\rightarrow\mathbb{Z}_p, x\mapsto xp^k$, the image $i_k(F_p)$ is a finite set, thus is compact, so $\mathbb{Z}_p$ is compact(using the theorem of Tychonoff). What is more, for any non negative rational number $0\leq x\in\mathbb{Z}[\frac{1}{p}]$, there is a unique $p$-expansion, $x=\sum x_np^n$, thus we have an injection, $i:\mathbb{Z}[\frac{1}{p}]_{\geq0}\rightarrow \mathbb{Q}_p$. So if we write $0\neq x=p^us\in\mathbb{Z}[\frac{1}{p}]_{\geq0}(u\in\mathbb{Z},s\in\mathbb{Z}_{>0},gcd(s,p)=1)$, then we have that $d(x,0)=e^{-u}$. Viewed as a subspace of $\mathbb{Q}_p$, we find that $\mathbb{Z}[\frac{1}{p}]_{\geq0}$ is dense in $\mathbb{Q}_p$. It is not hard to see. In deed, for any $a=\sum_{n\geq N}a_np^n\in\mathbb{Q}_p$, we define $A_M=\sum_{N\leq n\leq M}a^np^n\in \mathbb{Q}_{\geq0}$. And we find that $s(a,A_M)\geq M$, thus $d(a,A_M)\leq e^{-M}\rightarrow 0(M\rightarrow +\infty)$. What is more, suppose that $a(n)\in\mathbb{Q}_p$ is a Cauchy sequence, then for any $e^{-M}$, there exists an integer $N$, such that for any $n,m\geq N$, there is $d(a(n),a(m))\leq e^{-M}$, which is the same as $s(a(n),a(m))\geq M$, that is to say, for the terms $a(n)_k,a(m)_k(k\leq M)$, they are all equal when $n,m\geq N$. This means that for any fixed $k$, the sequence $a(n)_k$ is stationary. Hence we can define $a_k=\lim_n a(n)_k\in F_p$(for those $k$ too negative, $a_k=0$ because the sequence $a(n)$ is Cauchy, thus bounded). And the element $a=\sum_{n}a_np^n$ lies in $\mathbb{Q}_p$, which shows that $\mathbb{Q}_p$ is complete with respect to this metric. Thus we can view $\mathbb{Q}_p$ as a completion of $\mathbb{Z}[\frac{1}{p}]_{\geq0}$ under this metric. Now we want to define some operations on $\mathbb{Q}_p$. For example, the addition, the negation, the multiplication. We define $Add:\mathbb{Z}[\frac{1}{p}]_{\geq0}\times \mathbb{Z}[\frac{1}{p}]_{\geq0}\rightarrow\mathbb{Z}[\frac{1}{p}]_{\geq0}, (x,y)\mapsto x+y$. Equipping $\mathbb{Z}[\frac{1}{p}]_{\geq0}^2$ with the product metric $D=d\times d$, we have that $d(x+y,x'+y')\leq\max{d(x+y,y+x'),d(y+x',x'+y')}$ $=\max{d(x,x'),d(y,y')}\leq D((x,y),(x',y'))=d(x,x')+d(y,y')$. So this application $Add$ is a continuous function on a dense subset of $\mathbb{Q}_p^2$. Thus, we can extend $Add$ to all of $\mathbb{Q}_p^2$, and we call this $Add$ the addition operation on $\mathbb{Q}_p^2$. Now for positive rational numbers $x=p^us,x'=p^{u'}s',y=p^vt(s,s',t \text{positive integers prime to} p)$, we have that $d(xy,x'y)=d(p^{u+v}st,p^{u'+v}s't)=e^{-\min{u+v,u'+v}}=d(y,0)d(x,x')$. So if we define $Mul:\mathbb{Z}[\frac{1}{p}]_{\geq0}\times\mathbb{Z}[\frac{1}{p}]_{\geq0}\rightarrow\mathbb{Z}[\frac{1}{p}]_{\geq0},(x,y)\mapsto xy$, then we see that $d(xy,x'y')\leq \max{d(xy,x'y),d(x'y,x'y')}=\max{d(y,0)d(x,x'),d(x',0)d(y,y')}$ $\leq (d(y,0)+d(x',0))D((x,y),(x',y'))$, thus showing that $Mul$ is continuous on a dense subset of $\mathbb{Q}_p^2$, hence we can extend $Mul$ to all of $\mathbb{Q}_p^2$, which is again continuous, and we call this operation the multiplication on $\mathbb{Q}_p$. For the present, we see that $(\mathbb{Q}_p,Add)$ is a semi-group. One way to find the negative of an element $a\in\mathbb{Q}_p$ is to go back to $\mathbb{Z}[{\frac{1}{p}}]_{\geq0}$. But this is also a semi-group with respect to the addition operation. But let’s have a try. We know that the number $1\in\mathbb{Q}$ in $\mathbb{Q}_p$ is still $1$. Then which element in $\mathbb{Q}_p$ corresponds to the negation of $1$? Suppose this element writes as $a=\sum_{n\geq N}a_np^n$ with a sequence of rational numbers approximating it $A_M=\sum_{N\leq n\leq M}a_np^n$. We have to guarantee that $d(A_M+1,0)\rightarrow d(0,0)=0(M\rightarrow +\infty)$. A simple calculation shows that $s(a,0)=0$, and $A_M=\sum_{0\leq n\leq M}(p-1)p^n$. So we obtain that $a=\sum_{n\geq 0}(p-1)p^n$, which is the negation of $1$, and we can write $-1=\sum_{n\geq0}(p-1)p^n$.The semi-group structure of $(\mathbb{Q}_p-\{0\},Mul)$ inherits from  that of $(\mathbb{Z}[\frac{1}{p}]_{\geq0},Mul)$. And we want to find an inverse for each element in it.  For example, an non-zero element writes $a=p^ux$ where $x_0\in F_p-\{0\}$. So if we can find an inverse for $x$, say $y$ such that $xy=1$, then it is wasy to see that $p^{-u}y$ is the inverse of $a=p^ux$. So we can just suppose that $a\in\mathbb{Z}_p(a_0\neq0)$.The method is to go back to the $\mathbb{Z}_{\geq0}$ world, and then take limits. Specifically, suppose that $a\in\mathbb{Z}_p$ with $s(a,0)=0$, then using again the approximation sequence $A_M=\sum_{0\leq n\leq M}a_np^n$. If we can find the inverse $B_M$of $A_M$ for each $M$, then since $A_M$ is a Cauchy sequence, so is $B_M$(because $d(A_M,0)d(B_M,0)=d(A_MB_M,0)=d(1,0)=1$, and $d(A_M,0)$ converge to a non-zero number). So things are reduced to find these $B_M$, or more generally, find the inverse of any positive integer $A$ prime to $p$. Suppose the inverse of $A$ is $b=\sum_{n\geq0}b_np^n$(if it exists). Then consider the approximating sequence $B_N$ to $b$. In order that $d(AB_N,0)\rightarrow d(Ab,0)=1$.For $N=0$, since $gcd(A,p)=1$, there is an integer $b_0\in F_p$ such that $Ab_0=1(\text{mod}p)$. So, we have that $d(Ab_0-1,0)\leq e^{-1}$. For $N=2$, since again $gcd(A,p^2)=1$, there is $b_1\in F_p$ such that $A(b_0+b_1p)=1(\text{mod}p^2)$. Similarly, we have that $d(A(b_0+b_1p)-1,0)\leq e^{-2}$. In fact, $(b_0,b_1)$ is the only element in $F_p^2$ such that $Ab_0=1(\text{mod}p),A(b_0+b_1p)=1(\text{mod}p^2)$. We can continue this process to any $N$ and until infinity. So, in this way, we find an element $b=\sum b_np^n\in\mathbb{Z}_p$ such that $d(Ab-1,0)=0$, which means that $Ab=1$. Thus we find an inverse for each non-zero element in $\mathbb{Q}_p$. Now combining the above results, for any positive rational number, we can write it as $a=p^u\frac{A}{B}$ where $A,B$ are coprime positive integers prime to $p$. Since $B$ is invertible in $\mathbb{Q}_p$, thus we can define $i(a)=p^uAi(B)^{-1}$, for a negative number $-a\in\mathbb{Q}$, $i(-a)=(-1)i(a)=\sum_{n\geq0}(p-1)p^n\times i(a)$. So we get a larger inclusion, $i: \mathbb{Q}\rightarrow\mathbb{Q}_p$. From now on, we will mix these two notations $-1$ and $\sum_{n\geq0}(p-1)p^n$. And for any element $a\in\mathbb{Q}_p$, we set $-a=(-1)\times a$. It is easy to verify that the addition and multiplication thus defined are compatible, that is multiplication is distributive to addition. Hence we give $\mathbb{Q}_p$ a field structure. Now some words on $\mathbb{Z}_p$. Using the fact that $d(xy,0)=d(x,0)d(y,0)$, we see that $\mathbb{Z}_p$ is closed under multiplication. What is more, $-1$ clearly belongs to $\mathbb{Z}_p$. In addition, it is not hard to see that $\mathbb{Z}_p$ is closed under addition and subtraction, thus this space has a ring structure. Then perhaps we would wonder what are the units in this ring? Clearly,if $a\in\mathbb{Z}_p$ has that $s(a,0)>0$, then $s(ab,0)>0(b\in\mathbb{Z}_p)$, thus $ab\neq 1$,so $a\not\in \mathbb{Z}_p^*$. So we have to consider those $a$ with $s(a,0)=0$. In fact, these are exactly the units. That is to say,

The set of invertible elements of $\mathbb{Z}_p$ is $\{a\in\mathbb{Z}_p|s(a,0)=0\}$

The proof utilizes the same method as above, and we omit it. We can say some more about this result. Note that an element in $\mathbb{Z}_p^*$ is always of the form, $a=a_0+pa'(a'\in\mathbb{Z}_p)$ with $a_0\in F_p-\{0\}$. So we have that $\mathbb{Z}_p^*=(F_p-0)\times \mathbb{Z}_p$. Inversely, for any $a\in\mathbb{Q}_p$, we have seen that we can write $a=p^{s(a,0)}s$, then we surely would have that $s_{s(s,0)}\in F_p-0$. So there is $\mathbb{Q}_p=\mathbb{Z}\times \mathbb{Z}_p^*$, this is a group homomorphism.

The above serves as a simple explanation of the $p$-adic fields.

Quadratic forms arise naturally from the Euclidean spaces. In Euclidean spaces, we have inner products, we is commonly known also as quadratic forms. In this post, we will consider these forms over some $p$-adic fields. For that, we need the Hilbert symbol.

Suppose that $k$ is a field(here $k$ will be $\mathbb{R},\mathbb{Q}_p$, or $\mathbb{Q}$), and two non-zero elements $a,b\in k^*$. The Hilbert symbol considers if the equation $ax^2+by^2=z^2$ has non-trivial solutions(different from the solution $(x,y,z)=(0,0,0)$) in $k^3$. If this homogeneous equation has non-trivial solutions, then we define $[a,b]=1$, otherwise we set $[a,b]=-1$. Why do we consider just those non-zero $a,b$? For example, when $a=0$, then the existence of non-trivial solutions can be completely characterized by whether $b$ is a square or not. It is clear that the Hilbert symbol $[,]:k^*\times k^*\rightarrow \{1,-1\}=\mathbb{F}_2=\mathbb{Z}/2\mathbb{Z}$ is symmetric. We will show that it is in fact multiplicative in the first variable(hence also in the second variable), that is to say $[aa',b]=[a,b][a',b]$, and it is not degenerate, that is to say, for any $a\in (k^*)^2$ not a square, we can find a $b\in (k^*)^2$ such that $[a,b]=-1$.

To prove these properties, we need some preliminaries. First we want to characterize the Hilbert symbol $[a,b]$ using the field $k(\sqrt{b})$. In fact, observing the equation $ax^2=z^2-by^2$. If $b'=\sqrt{b}\in \overline{k}$, then if $x\neq 0$, we have that $a=(z/x-b'y/x)(z/x+b'y/x)$. So, if $b$ is not a square in $k$, then $[a,b]=1$ implies that $a$ is a norm in $k(\sqrt{b})$. If $[a,b]=-1$, this implies that $a$ is not a norm in $k(\sqrt{b})$. For the case where $b$ is a square, we always have $[a,b]=1$, and $k(\sqrt{b})=k$, thus $a$ is always a norm in $k(\sqrt{b})$. So we have that $[a,b]=1$ if and only if $a$ is a norm in $k(\sqrt{b})$. Moreover, it is not hard to see, that for $a,b\in k^*$, we have $[a,b^2]=1,[a,-a]=1,[a,1-a]=1, [a,c^2b]=[a,b]$. If $[c,b]=1$, then $c$ is a norm in $k(\sqrt{b})$, using the multiplicative property of the norm function, we have that $ac$ is a norm of $k(\sqrt{b})$ if and only if $a$ is a norm of this field. So we have that $[ac,b]=[a,b]$.

Now we are ready to prove the following result:

If $k=\mathbb{R}$, then $[a,b]=1$ if and only if at least one of them is positive. If $k=\mathbb{Q}_p$, then we can write $a=p^ux,b=p^vy(x,y\in\mathbb{Z}_p^*)$, for $p>2$, there is $[a,b]=(-1)^{uv\frac{p-1}{2}}(\frac{x}{p})^v(\frac{y}{p})^u$; for $p=2$, there is $[a,b]=(-1)^{\frac{x-1}{2}\frac{y-1}{2}+v\frac{x^2-1}{8}+u\frac{y^2-1}{8}}$.(the symbol $(\frac{x}{p})$ is the Legendre symbol extended to $\mathbb{Z}_p$ by $(\frac{x}{p})=(\frac{x_0}{p})$. For $\frac{y-1}{2}$, it is just $y_1(\text{mod}2)$, and for $\frac{y^2-1}{8}$, it is just $y_1(y_1+1)/2+y_2$).

The case that $k=\mathbb{R}$ is trivial, and we omit the proof. As for the case $k=\mathbb{Q}_p(p>2)$. We proceed as follows. Note that the identity depends only on the mod $2$ values of $u,v$ and the values of $x,y$. We will consider these cases separately. Note that the extended Legendre symbol is still multiplicative, what is more, $(\frac{-1}{p})=(-1)^{(p-1)/2}$ even when $-1$ is an element in $\mathbb{Z}_p$.

(1)The case $u=0,v=0$. Then the right hand side is just $1$. What is more, note that since $u,v$ are even numbers, we have $[a,b]=[x,y]$. So we have to show that $[x,y]=1$, that is to show there exists always a non-trivial solution to the equation $xr^2+ys^2=t^2$ with variables $r,s,t$. We use again the method of going back to the world $\mathbb{Z}$, or rather $\mathbb{Z}/p^n\mathbb{Z}$. We define the result of $a\in\mathbb{Z}_p$ modulo $p^n$ to be the number $P_n(a)=\sum_{0\leq m\leq n}s_mp^m$. Clearly the sequence $P_n(a)$ approximates $a$. For $n=0$, we consider $P_0(x)r^2+P_0(y)s^2=t^2(\text{mod}p)$(For simplicity, we will write this as $xr^2+ys^2=t^2(p)$ when there is no confusion). Using the Legendre symbol, we can show easily that this equation always has non-trivial solutions as long as $P_0(x),P_0(y)\neq 0(p)$ which is the case. So, we have a first-order approximation non-trivial solution $(r_0,s_0,t_0)\in F_p^3$. Now suppose that we have found an $(n-1)$-th order approximation non-trivial solution $(r_{n-1},s_{n-1},t_{n-1})\in F_{p^n}^3$($P_n(x)r_{n-1}^2+P_n(y)s_{n-1}^2-t_{n-1}^2=zp^n$). We set $x(r_{n-1}+rp^n)^2+y(s_{n-1}+sp^n)^2=(t_{n-1}+tp^n)^2(p^{n+1})$. After expansion, we get that $zp^n+2p^n(xr_{n-1}r+ys_{n-1}s-t_{n-1}t)=0(p^{n+1})$. It is the same as $z+2(xr_{n-1}r+ys_{n-1}s-t_{n-1}t)=0(p)$. Note that $(r_{n-1},s_{n-1},t_{n-1})\neq(0,0,0)(p)$, so is $(2xr_{n-1},2ys_{n-1},-t_{n-1})$, which means that this equation always has a non-trivial solution $(r,s,t)\in F_p^3$. So the triple $(r_{n-1}+rp^n,s_{n-1}+sp^n,t_{n-1}+tp^n)$ is an $n$-th order approximation non-trivial solution to the original equation. We can continue in this way to infinity, and moreover each sequence $r_n$($s_n,t_n$ respectively) converges to some element $r$($s,t$ respectively) in $\mathbb{Z}_p$. Thus this non-zero triple $(r,s,t)$ solves the equation $xs^2+ys^2=t^2$.

(2)The case $u=1,v=0$. For the same reason, we have to show that $[px,y]=(\frac{y}{p})$. Suppose that $(\frac{y}{p})=1$, then $y_0$ is a non-zero square in $F_p$(that is $y_0=z_0^2(\text{mod}p)$). Like what we have done in the above, the equation $y=z^2$(in $\mathbb{Z}_p$) can be obtained by lifting the first-order approximation $z_0$. And thus we get a $0\neq z\in\mathbb{Z}_p$ such that $y=z^2$(we used somewhere the fact that $p\neq 2$). So one non-trivial solution to the equation $pxr^2+ys^2=t^2$, that is $(0,1,z)$. Conversely, if $(r,s,t)$ is one such non-trivial solution, we can subtract all their common $p$-factors to suppose that at least one of them is a unit. Now modulo $p$, we get that $px_0r_0^2+y_0s_0^2=t_0^2(p)$. That is to say, $y_0s_0^2=t_0^2(p)$. If $s_0=0$, then there is $t_0=0$ too.Now modulo $p^2$, we get that $pxr^2=0(p^2)$. Since $x$ is a unit, thus $r_0=0$. But this contradicts the assumption that at least one of $r,s,t$ is unit. Hence we must have that $y_0=(t_0/s_0)^2(p)$. So $y$ is a square in $F_p$, $(\frac{y}{p})=1$.

(3)The case $u=1,v=1$. Again the same reasoning as above leads to the identity $[px,py]=(-1)^{\frac{p-1}{2}}(\frac{x}{p})(\frac{y}{p})$. But note that $[px,-px]=1$, thus $[px,py]=[px,-pxpy]=[px,-xy]$. And according to the preceding paragraph, we have $[px,-xy]=(\frac{-xy}{p})$, which is exactly the same as $(-1)^{(p-1)/2}(\frac{x}{p})(\frac{y}{p})$.

For the case $p=2$, the proof is not exactly the same but very similar and not very hard, and we will not prove it here. The only difficulty is that the above lifting strategy has to be carefully dealt with. The fact is that $x\in\mathbb{Z}_p^*$ is a square if and only if $x$ is a square modulo $8$, not $2$ or $4$. This is due to the factor $2$ in the square. One simple example is that $5$ is not a square modulo $8$ even though it is a square modulo $2$ or $4$.

The above result clearly shows that the Hilbert symbol is multiplicative in one variable since the term on the right hand side is always multiplicative in one variable. What s more, the Hilbert symbol is not degenerate. That is

For any $a\in k^*$ non square, there is a $b\in k^*$ such that $[a,b]=-1$.

In $k=\mathbb{R}$, $a$ is not a square means that $a<0$. So take $b<0$ and this gives $[a,b]=-1$.

In the case $k=\mathbb{Q}_p(p>2)$. When is $a=p^ux(x\in\mathbb{Z}_p^*)$ not a square? So when is $a$ a square? Suppose $a=(p^vy)^2(y\in\mathbb{Z}_p^*)$, then we must have that $u=2v, x=y^2$. Conversely, if these two conditions were satisfied, then $a$ is a square. So there are three cases where $a$ is not a square, that is $a=p^{2u+1}x$,or $p^{2u}x$(with $(\frac{x}{p})=-1$) or at last $p^{2u+1}x$ with $(\frac{x}{p})=-1$. For the first case, we can set $b=y$ with $(\frac{y}{p})=-1$. For the second case, we set $b=p$, and for the last case we set $b=y$ which is not a square.

In the case $k=\mathbb{Q}_2$. The situation is similar, just a little more complex. Write again $a=2^ux$. $a$ is a square if and only if $u$ is an even number and $x$ is a square modulo $8$(which is the same as $x=1(8)$). So if $a=2^{2u}x$(with $x=3(8)$), we can set $b=7$, with $x=5$, we define $b=2$, with $x=7$, we define $b=7$. If $a=2^{2u+1}x$, we can set $b=5$. These can be verified very easily, and we omit it.

The next paragraph concerns with the product formula of the Hilbert symbol. As we have seen above, there is an inclusion $\mathbb{Q}\subset\mathbb{Q}_p$ for all primes $p$. If we define $P=\{p \text{is a prime number or is }\infty\}$. And we set $\mathbb{Q}_{\infty}=\mathbb{R}$. These fields $\mathbb{Q}_p$($p\in P$) are called local fields, the topological completion of the global field $\mathbb{Q}$. So for any two non-zero $a,b\in\mathbb{Q}$, we define $[a,b]_p$ to be the Hilbert symbol of $a,b$ in the field $\mathbb{Q}_p$($p\in P$). An interesting result is that

If $a,b\in\mathbb{Q}^*$, then for almost all $p\in P$, $[a,b]_p=1$. What is more, we have the product formula of Hilbert symbol: $\prod_{p\in P}[a,b]_p=1$.

The product makes sense since there are only finite many terms not equal to $1$ according to the first part of the result. A simple observation goes first: since each $[a,b]_p$ is multiplicative in one variable, so we can prove the result only for the case $a,b=-1,q$($q$ is a prime integer).

If $a=-1,b=-1$, then $[-1,-1]_{\infty}=-1$, and if $p>2$, there is $[-1,-1]_p=1$. And $[a,b]_2=(-1)^{\frac{-1-1}{2}\frac{-1-1}{2}}=-1$. So $\prod_p [-1,-1]_p=1$.

If $a=-1,b=q$ with $0 a prime number. Then $[-1,q]_{\infty}=1$. If $q=2$, then for $p>2$, $[-1,2]_p=1$, while $[-1,2]_2=(-1)^{\frac{-1-1}{2}\frac{1-1}{2}+0+\frac{1^2-1}{8}}=1$, so $\prod_p[-1,2]=1$. If $q>2$, then $[-1,q]_2=(-1)^{\frac{-1-1}{2}\frac{q-1}{2}}=(-1)^{\frac{q-1}{2}}$. For $p\neq q$, $[-1,q]_p=1$, while $[-1,q]_q=(\frac{-1}{q})=(-1)^{\frac{q-1}{2}}$. So we have that $\prod_p [-1,q]_p=1$.

If $a=q,b=q'$ two primes such that $q\neq q'$. Then we have that $[q,q']_{\infty}=1$. And suppose neither of them is $2$,then $[q,q']_2=(-1)^{\frac{q-1}{2}\frac{q'-1}{2}}$. $[q,q']_q=(\frac{q'}{q})$, $[q,q']_{q'}=(\frac{q}{q'})$, for other $p$, $[q,q']_p=1$. So we have that $\prod_p[q,q']=1$ due to quadratic reciprocity law. If $q'=2$, then $[q,2]_2=(-1)^{0+\frac{q^2-1}{8}}$, $[q,2]_q=(\frac{2}{p})=(-1)^{\frac{q^2-1}{8}}$. For other $p$, $[q,2]_p=1$ So, we have that $\prod_p[q,2]_p=1$.

If $a=q,b=q$. It is clear that $[q,q]_{\infty}=1$. If $q=2$, then $[2,2]_2=1$, $[2,2]_p=1$, so $\prod_p[2,2]_p=1$. If $q>2$, then $[q,q]_2=(-1)^{\frac{q-1}{2}\frac{q-1}{2}}$, $[q,q]_q=(-1)^{\frac{q-1}{2}}$, for other $p$, there is $[q,q]_p=1$, thus we have that $\prod_p[q,q]_p=1$.

Thus we proved the product formula of Hilbert symbols. Note that in the proof we have used the quadratic reciprocity law in an essential way. In fact, this proof means that the quadratic reciprocity law implies the product formula. Whereas inversely, take any two distinct primes, the product formula gives an immediate proof of the quadratic reciprocity law. And thus the product formula is also sometimes called Hilbert’s reciprocity law.

The importance of Hilbert reciprocity law is that it can be generalized naturally to other algebraic number fields. We will talk about this later.