TITLE: How to obtain the rational solution of a linear system efficiently?
QUESTION [8 upvotes]: Suppose that I have a linear system $AX=b$ with $A\in\mathbb{Z}^{n\times m}$ and $b\in\mathbb{Z}^{n}$. Assume that $AX=b$ has exactly one rational solution. Then how can I obtain this solution efficiently?
I know LU decomposition is a choice for this purpose. But it seems that the denominators may expand in the process of computing a LU decomposition, which I hope to avoid if the rational solution has small denominators.
If I already have a numerical solution of $AX=b$, does it help?

REPLY [4 votes]: This is standard and can be done using $p$-adic lifting, see for example the following article:

J.D. Dixon, Exact solution of linear equations using $P$-adic expansions, Numer. Math. 40 (1982) pp. 137–141, doi:10.1007/BF01459082.

This also exploits that there is a unique solution.