Solving linear system over finite field

2.2k Views Asked by At

Suppose I want to solve a linear system $Ax=b$ over some finite field $GF(p)$ where $p$ is prime.

If I know the correct solution $x$ for $Ax=b$ over $\mathbb R$, is it true that the answer to the original question is to take each element of $x$ and replace it with its remainder with $p$?

This seems to be true, for example:

$A= \begin{pmatrix} 1 & 5 \\ 0 & 7\end{pmatrix}$ and $b= \begin{pmatrix}69 \\ 84\end{pmatrix}$. The solution for $Ax=b$ over $\mathbb R$ is $x=\begin{pmatrix}9 \\ 12 \end{pmatrix}$.

Now suppose I want the solution to the system over $GF(3)$. then $A_3= \begin{pmatrix}1 & 2 \\ 0 & 1\end{pmatrix}$, $x_3 = \begin{pmatrix}0 \\ 0\end{pmatrix}$ and $b_3=\begin{pmatrix} 0 \\ 0\end{pmatrix}$, again indeed $A_3x_3=b_3$.

This is again correct over $GF(2)$ and $GF(5)$. Is it generally true? If so why? if not - can you find a counter example? Logic dictates it should be true since the modulo operator is linear (IE $a+b \bmod{p} = a \bmod{p} + b \bmod{p}$) and a linear system is, surprise surprise, linear. So it shouldn't make a difference. That is however not a proof, simply intuition.

1

There are 1 best solutions below

1
On BEST ANSWER

If all matrix entries are integers and the solution over $\Bbb R$ is also integer than it is clear that the equations that express the fact that this is a solution remain true when reducing modulo some $p$. In a suitable sense this is even true for rational solutions (with denominator not a multiple of $p$). However, there may be additional solutions if $\det A$ is a multiple of $p$. Consider your example modulo $7$: $A_7=\begin{pmatrix}1&5\\0&0\end{pmatrix}$, $b_7=\begin{pmatrix}6\\0\end{pmatrix}$ has as solutions $x_7=\begin{pmatrix}2\\t\end{pmatrix}$ with arbitrary $t$ (among which just one possibility is $t=5$).