De Morgan circuits for the rank of a matrix over ZMod 2 #
A matrix A x : Matrix (Fin r) (Fin c) (ZMod 2) that depends on the circuit input x is given to
a circuit through the bits of its entries (Cslib.Circuits.Boolean.entryBits), using the ring
isomorphism Cslib.BitString.bitEquiv : ZMod 2 ≃+* Bool. This file synthesises the bits of the
Gauss–Jordan stages of Matrix.GaussJordan from those bits, and then the threshold test
t ≤ (A x).rank, over the De Morgan basis.
One stage at column k follows Matrix.GaussJordan.stage_apply_zmod_two. Each row tests whether
it is a candidate (zero before k, one at k), then whether it is the first candidate (the pivot,
Matrix.GaussJordan.pivotRow_eq_some_iff). The pivot row's entries are an exclusive or over the
rows, gated by the pivot test, and each new entry is the old entry exclusive-or the pivot row's
entry when the row has a one at k and is not the pivot. A stage costs 14 (r + 1) (r + c + 1)
gates. The rank is the number of nonzero rows of Matrix.GaussJordan.reduce
(Matrix.GaussJordan.rank_eq_card_reduce_ne_zero), which a threshold circuit
(Cslib.Circuits.Boolean.synthesis_atLeast) compares with t.
The bounds count gates only. The construction chains one stage per column; its depth is not certified here. The gate counts are this library's, not a source's.
Main definitions #
Cslib.Circuits.Boolean.entryBits A: the bits of the entries of a matrix that depends on the input.
Main results #
Cslib.Circuits.Boolean.synthesis_entryBits_stage: one stage, within14 (r + 1) (r + c + 1)gates on top of the current entries.Cslib.Circuits.Boolean.synthesis_entryBits_reduce: allcstages.Cslib.Circuits.Boolean.synthesis_le_rank: the testt ≤ (A x).rank, fort ≤ r + 1, within14 (c + 1) (r + 1) (r + c + 1)gates on top of the entries.Cslib.Circuits.Boolean.synthesis_le_rank_of_synthesis: the same test when the entries are themselves synthesised.
References #
Computing a rank over ZMod 2 by a polynomial-size circuit is the constructivity step of the
rank property in Razborov and Rudich, §3.2, who note that rank is in NC²
without giving an explicit circuit or a gate count.
One stage #
One Gauss–Jordan stage over ZMod 2: the bits of stage (A x) k cost at most
14 (r + 1) (r + c + 1) gates on top of the bits of A x.
All stages and the rank #
Gauss–Jordan elimination over ZMod 2: the bits of reduce (A x) cost at most
14 c (r + 1) (r + c + 1) gates on top of the bits of A x. Only the number of gates is
bounded; depth is not certified.
The rank threshold over ZMod 2: the test t ≤ (A x).rank, for t ≤ r + 1, costs at
most 14 (c + 1) (r + 1) (r + c + 1) gates on top of the bits of A x. It reduces A x and
counts the nonzero rows (Matrix.GaussJordan.rank_eq_card_reduce_ne_zero). Only the number of
gates is bounded; depth is not certified.
The rank threshold when the bits of the entries are themselves synthesised, for example from the circuit inputs.