Documentation

CslibFrontier.Computability.PolyTime.LinearAlgebra.RationalElimination

Polynomial-time Bareiss–Jordan rational linear algebra #

Multi-tape Turing machine polynomial-time computability (Turing.MultiTapeTM.ComputableInPolyTime) for exact rational elimination (rationalElim, ratRref, ratRank, ratRowBasis, ratKernelBasis) and linear system solving (ratSolve).

Encodings and local adaptations #

Main definitions #

Main results #

Structured binary encodings (#4391) #

theorem Cslib.LinearAlgebra.IntTable.enc_numRows_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RowTable ℤ} :

Binary encoding of an IntTable with unary matrix dimensions and framed signed-binary rows.

@[reducible, inline]

The tuple of the fields of enc.

theorem Cslib.LinearAlgebra.IntTable.enc_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 x1 T1 S1 : γ → ℕ} {x2 : γ → List (List ℤ)} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encUnary T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (Turing.MultiTapeTM.encList (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encIntBin)) T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { numRows := x0 x, numCols := x1 x, rows := x2 x }) encIn enc (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
theorem Cslib.LinearAlgebra.IntTable.enc_rows_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RowTable ℤ} :
theorem Cslib.LinearAlgebra.IntTable.enc_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : ℕ × ℕ × List (List ℤ)) => { numRows := p.1, numCols := p.2.1, rows := p.2.2 }) encFields enc 1 1
theorem Cslib.LinearAlgebra.IntTable.enc_numCols_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RowTable ℤ} :
theorem Cslib.LinearAlgebra.IntTable.enc_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 x1 : γ → ℕ} {x2 : γ → List (List ℤ)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encUnary budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn (Turing.MultiTapeTM.encList (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encIntBin)) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { numRows := x0 x, numCols := x1 x, rows := x2 x }) encIn enc budget
theorem Cslib.LinearAlgebra.RatTable.enc_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 x1 T1 S1 : γ → ℕ} {x2 : γ → List (List ℚ)} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encUnary T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (Turing.MultiTapeTM.encList (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encRat)) T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { numRows := x0 x, numCols := x1 x, rows := x2 x }) encIn enc (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
@[reducible, inline]

The tuple of the fields of enc.

theorem Cslib.LinearAlgebra.RatTable.enc_numCols_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RowTable ℚ} :
theorem Cslib.LinearAlgebra.RatTable.enc_numRows_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RowTable ℚ} :
theorem Cslib.LinearAlgebra.RatTable.enc_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 x1 : γ → ℕ} {x2 : γ → List (List ℚ)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encUnary budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn (Turing.MultiTapeTM.encList (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encRat)) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { numRows := x0 x, numCols := x1 x, rows := x2 x }) encIn enc budget
theorem Cslib.LinearAlgebra.RatTable.enc_rows_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RowTable ℚ} :

Binary encoding of a RatTable with unary matrix dimensions and framed rational rows.

theorem Cslib.LinearAlgebra.RatTable.enc_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : ℕ × ℕ × List (List ℚ)) => { numRows := p.1, numCols := p.2.1, rows := p.2.2 }) encFields enc 1 1
theorem Cslib.LinearAlgebra.BareissState.enc_pivotCols_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → BareissState} :
theorem Cslib.LinearAlgebra.BareissState.enc_table_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → BareissState} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ enc S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).table) encIn✝ IntTable.enc S✝
theorem Cslib.LinearAlgebra.BareissState.enc_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → RowTable ℤ} {T0 S0 : γ → ℕ} {x1 : γ → ℤ} {T1 S1 : γ → ℕ} {x2 : γ → List ℕ} {T2 S2 : γ → ℕ} {x3 : γ → List ℕ} {T3 S3 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn IntTable.enc T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encIntBin T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) T3 S3) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { table := x0 x, pivotDet := x1 x, pivotRows := x2 x, pivotCols := x3 x }) encIn enc (fun (x : γ) => T0 x + (T1 x + (T2 x + T3 x))) fun (x : γ) => S0 x + (S1 x + (S2 x + S3 x))
theorem Cslib.LinearAlgebra.BareissState.enc_pivotDet_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → BareissState} :
theorem Cslib.LinearAlgebra.BareissState.enc_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → RowTable ℤ} {x1 : γ → ℤ} {x2 x3 : γ → List ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn IntTable.enc budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encIntBin budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { table := x0 x, pivotDet := x1 x, pivotRows := x2 x, pivotCols := x3 x }) encIn enc budget
theorem Cslib.LinearAlgebra.BareissState.enc_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : RowTable ℤ × ℤ × List ℕ × List ℕ) => { table := p.1, pivotDet := p.2.1, pivotRows := p.2.2.1, pivotCols := p.2.2.2 }) encFields enc 1 1
@[reducible, inline]

The tuple of the fields of enc.

theorem Cslib.LinearAlgebra.BareissState.enc_pivotRows_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → BareissState} :

Binary encoding of a BareissState with unary pivot row/column index lists.

theorem Cslib.LinearAlgebra.BareissState.enc_table_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → BareissState} :
theorem Cslib.LinearAlgebra.RationalElimResult.enc_rank_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RationalElimResult} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ enc S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).rank) encIn✝ Turing.MultiTapeTM.encUnary S✝
theorem Cslib.LinearAlgebra.RationalElimResult.enc_rref_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RationalElimResult} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ enc S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).rref) encIn✝ RatTable.enc S✝
theorem Cslib.LinearAlgebra.RationalElimResult.enc_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : RowTable ℚ × ℕ × List ℕ × List ℕ × List ℕ × List (List ℚ)) => { rref := p.1, rank := p.2.1, pivotRows := p.2.2.1, pivotCols := p.2.2.2.1, nonPivotCols := p.2.2.2.2.1, kernelBasis := p.2.2.2.2.2 }) encFields enc 1 1
theorem Cslib.LinearAlgebra.RationalElimResult.enc_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → RowTable ℚ} {T0 S0 x1 T1 S1 : γ → ℕ} {x2 : γ → List ℕ} {T2 S2 : γ → ℕ} {x3 : γ → List ℕ} {T3 S3 : γ → ℕ} {x4 : γ → List ℕ} {T4 S4 : γ → ℕ} {x5 : γ → List (List ℚ)} {T5 S5 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn RatTable.enc T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encUnary T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) T4 S4) (h5 : Turing.MultiTapeTM.ComputableInO x5 encIn (Turing.MultiTapeTM.encList (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encRat)) T5 S5) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { rref := x0 x, rank := x1 x, pivotRows := x2 x, pivotCols := x3 x, nonPivotCols := x4 x, kernelBasis := x5 x }) encIn enc (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + (T4 x + T5 x))))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + (S4 x + S5 x))))
theorem Cslib.LinearAlgebra.RationalElimResult.enc_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → RowTable ℚ} {x1 : γ → ℕ} {x2 x3 x4 : γ → List ℕ} {x5 : γ → List (List ℚ)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn RatTable.enc budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encUnary budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) budget) (h4 : Turing.MultiTapeTM.ComputableInSpace x4 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) budget) (h5 : Turing.MultiTapeTM.ComputableInSpace x5 encIn (Turing.MultiTapeTM.encList (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encRat)) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { rref := x0 x, rank := x1 x, pivotRows := x2 x, pivotCols := x3 x, nonPivotCols := x4 x, kernelBasis := x5 x }) encIn enc budget
@[reducible, inline]

The tuple of the fields of enc.

theorem Cslib.LinearAlgebra.LinearSystemInput.enc_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → RowTable ℚ} {x1 : γ → List ℚ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn RatTable.enc budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encRat) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { matrix := x0 x, rhs := x1 x }) encIn enc budget
theorem Cslib.LinearAlgebra.LinearSystemInput.enc_rhs_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → LinearSystemInput} :
theorem Cslib.LinearAlgebra.LinearSystemInput.enc_matrix_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → LinearSystemInput} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ enc S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).matrix) encIn✝ RatTable.enc S✝
theorem Cslib.LinearAlgebra.LinearSystemInput.enc_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → RowTable ℚ} {T0 S0 : γ → ℕ} {x1 : γ → List ℚ} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn RatTable.enc T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encRat) T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { matrix := x0 x, rhs := x1 x }) encIn enc (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
theorem Cslib.LinearAlgebra.LinearSolveResult.enc_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : Option (List ℚ) × List ℕ × List ℕ) => { solution := p.1, pivotRows := p.2.1, pivotCols := p.2.2 }) encFields enc 1 1
@[reducible, inline]

The tuple of the fields of enc.

theorem Cslib.LinearAlgebra.LinearSolveResult.enc_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Option (List ℚ)} {T0 S0 : γ → ℕ} {x1 : γ → List ℕ} {T1 S1 : γ → ℕ} {x2 : γ → List ℕ} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (Turing.MultiTapeTM.encOption (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encRat)) T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { solution := x0 x, pivotRows := x1 x, pivotCols := x2 x }) encIn enc (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)

Encoding length and coefficient magnitude bounds #

Polynomial-time component certificates and public theorems #

ratRref is computable in polynomial time on multi-tape Turing machines.