Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Adjugate

Adjugate circuits from determinant circuits #

The partial derivative of the generic determinant along the entry (a, b) is the cofactor adjugate (genericMatrix K n) b a (Cslib.Circuits.Arithmetic.pderiv_det_genericMatrix). This follows from Laplace expansion along row a: the cofactors of row a do not involve the variables of that row. Reverse-mode differentiation [BS83] therefore turns a circuit with s gates computing the determinant into one with at most 5 s + 2 gates and three times the multiplications computing all n² entries of the adjugate (Cslib.Circuits.Arithmetic.exists_circuit_adjugate_of_det). With Bird's division-free determinant circuits this gives adjugate circuits with at most 15 n⁴ + 22 gates over every commutative ring (Cslib.Circuits.Arithmetic.exists_circuit_adjugate).

Over a field, the inverse of a matrix is its adjugate divided by its determinant. Baur and Strassen draw from this that inverting a matrix is no harder than computing its determinant, up to a constant factor. The circuits here have no division gate, so only the adjugate is formalized.

Main results #

References #

The partial derivative of the generic determinant along the variable of entry (a, b) is the cofactor adjugate (genericMatrix K n) b a.

theorem Cslib.Circuits.Arithmetic.exists_circuit_adjugate_of_det {K : Type u_1} [CommRing K] {n m : ℕ} (c : Circuit (arithSignature K) (n * n) m) (j : Fin m) (hc : c.polynomial j = (genericMatrix K n).det) :

Adjugates from determinants [BS83]: if a circuit with s gates computes the generic n × n determinant, then a circuit with at most 5 s + 2 gates and three times the multiplications computes every entry of the adjugate; output n * a + b is entry (a, b).

theorem Cslib.Circuits.Arithmetic.exists_circuit_adjugate {K : Type u_1} [CommRing K] (n : ℕ) :
∃ (d : Circuit (arithSignature K) (n * n) (n * n)), d.size ≤ 15 * n ^ 4 + 22 ∧ ∀ (a b : Fin n), d.polynomial (finProdFinEquiv (a, b)) = (genericMatrix K n).adjugate a b

The adjugate of the generic n × n matrix has circuits with at most 15 n⁴ + 22 gates over every commutative ring.