Documentation

CslibFrontier.Computability.Complexity.Problems.Permanent.Basic

Permanents of tables as counting problems #

A table A : List (List R) is read as the square matrix tableMatrix A with one row and one column per row of A: entry (i, j) is entry j of row i, and missing entries are 0. Every table is therefore an instance, and the matrix size is the number of rows. The counting problems of Valiant's theorem Valiant are the permanents of such tables: IntPermanent for integer tables and ZeroOnePermanent for Boolean tables, read as 0/1 matrices. zeroOnePermanent_eq_card counts the permutations supported on the true entries, that is the perfect matchings of the bipartite graph whose biadjacency matrix is the table.

Tables are encoded row by row (encIntTable, encBoolTable), so the encoded length of an n × n table is at least n²: a dense matrix encoding, as in the books.

Main definitions #

Main results #

References #

@[reducible, inline]

Integer tables, densely: the framed list of rows, each row the framed list of its entries in binary sign-magnitude (encIntBin).

@[reducible, inline]

Boolean tables, densely: the framed list of rows, each row the framed list of its bits.

def Cslib.Complexity.tableMatrix {R : Type u_1} [Zero R] (A : List (List R)) :

The square matrix of a table: entry (i, j) is entry j of row i, missing entries are 0, and the size is the number of rows.

The 0/1 matrix of a Boolean table: entry (i, j) is 1 exactly when entry j of row i is true; missing entries are 0, and the size is the number of rows.

The permanent of an integer table.

The permanent of a Boolean table, read as a 0/1 matrix.

theorem Cslib.Complexity.tableMatrix_apply {R : Type u_1} [Zero R] (A : List (List R)) (i j : Fin A.length) :
tableMatrix A i j = A[i].getD (↑j) 0

The 0/1 permanent counts perfect matchings: the permutations σ whose entries (i, σ i) are all true.