Cramer bound for a nonsingular integer square system
ProvedSmaleNinth.cramer_solution_boundCramer's rule turns the determinant bound into a bound on the solution.
Let be nonsingular and , with all entries of both bounded by in absolute value. If solves over the reals, then
This is the second half of the Cramer--Hadamard size estimate: the first half bounds a determinant, and this one converts that into a bound on the coordinates of the solution of a square nonsingular system. Note the hypothesis is on the integer matrix while the solution is sought over ; the point of the statement is exactly that integrality of the data controls the size of a real solution.
The argument. Since in , its image in is nonzero and is invertible over , so is the unique real solution. Cramer's identity together with injectivity of gives
The matrix on the right is again an integer matrix with all entries bounded by , so the companion bound gives . The left-hand determinant is a nonzero integer, hence . Dividing yields
import Mathlib open Matrix Finset
theorem SmaleNinth.cramer_solution_bound {r : ℕ} (U : ℕ)
(M : Matrix (Fin r) (Fin r) ℤ) (v : Fin r → ℤ)
(hM : ∀ i j, |M i j| ≤ (U : ℤ)) (hv : ∀ i, |v i| ≤ (U : ℤ))
(hdet : M.det ≠ 0)
(z : Fin r → ℝ)
(hz : (M.map (Int.cast : ℤ → ℝ)).mulVec z = fun i => ((v i : ℤ) : ℝ)) :
∀ j, |z j| ≤ (r.factorial : ℝ) * (U : ℝ) ^ r := by sorry