Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Cramer bound for a nonsingular integer square system

Proved
SmaleNinth.cramer_solution_bound

by carlok · Sep 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

computational-complexitylinear-algebralinear-optimization

Cramer's rule turns the determinant bound into a bound on the solution.

Let M∈Zr×rM\in\mathbb{Z}^{r\times r}M∈Zr×r be nonsingular and v∈Zrv\in\mathbb{Z}^{r}v∈Zr, with all entries of both bounded by UUU in absolute value. If z∈Rrz\in\mathbb{R}^{r}z∈Rr solves Mz=vMz=vMz=v over the reals, then

∣zj∣  ≤  r! Urfor every j.|z_j|\;\le\; r!\,U^{r}\qquad\text{for every }j.∣zj​∣≤r!Urfor every j.

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 R\mathbb{R}R; the point of the statement is exactly that integrality of the data controls the size of a real solution.

The argument. Since det⁡M≠0\det M\ne0detM=0 in Z\mathbb{Z}Z, its image in R\mathbb{R}R is nonzero and MMM is invertible over R\mathbb{R}R, so zzz is the unique real solution. Cramer's identity M (cramer⁡M v)=(det⁡M) vM\,(\operatorname{cramer}M\,v)=(\det M)\,vM(cramerMv)=(detM)v together with injectivity of x↦Mxx\mapsto Mxx↦Mx gives

(det⁡M) z=cramer⁡M v,that is(det⁡M) zj=det⁡(M with column j replaced by v).(\det M)\,z=\operatorname{cramer}M\,v,\qquad\text{that is}\qquad (\det M)\,z_j=\det\big(M\text{ with column }j\text{ replaced by }v\big).(detM)z=cramerMv,that is(detM)zj​=det(M with column j replaced by v).

The matrix on the right is again an integer matrix with all entries bounded by UUU, so the companion bound gives ∣det⁡(⋅)∣≤r! Ur|\det(\cdot)|\le r!\,U^{r}∣det(⋅)∣≤r!Ur. The left-hand determinant is a nonzero integer, hence ∣det⁡M∣≥1|\det M|\ge 1∣detM∣≥1. Dividing yields

∣zj∣  ≤  ∣det⁡M∣ ∣zj∣  ≤  r! Ur.|z_j|\;\le\;|\det M|\,|z_j|\;\le\; r!\,U^{r}.∣zj​∣≤∣detM∣∣zj​∣≤r!Ur.
Preamble
import Mathlib

open Matrix Finset
Formal statement
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
Source
B. Korte, J. Vygen, Combinatorial Optimization: Theory and Algorithms, 6th ed., Springer 2018, Section 4.1 (Size of Vertices and Faces), proof of Theorem 4.4; A. Schrijver, Theory of Linear and Integer Programming, Wiley 1986, Section 3.2 (sizes and good characterizations).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me