Documentation

Complexitylib.Circuits.SparseSynthesis.Internal.Matrix

Shared pattern tables #

A Boolean matrix is synthesized by sharing its column patterns across rows. The leading cost is one OR per selected pattern; input tests and the pattern bank are built only once. This is the elementary table construction used in the sparse and partial-function specializations of local coding.

Binary numbering of all assignments to width input bits.

Equations
Instances For

    Column index selected by the first k input bits.

    Equations
    Instances For

      Row index selected by the remaining l input bits.

      Equations
      Instances For
        def Complexity.CircuitSparseSynthesis.Internal.matrixInput {k l : ℕ} (row : Fin (2 ^ l)) (column : Fin (2 ^ k)) :
        Fin (k + l) → Bool

        Reconstruct an input from its row and column indices.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[simp]

          The truth-table indexing equivalence used to sum support sizes over rows.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Complexity.CircuitSparseSynthesis.Internal.rowDomain {k l : ℕ} (domain : Finset (Fin (k + l) → Bool)) (r : Fin (2 ^ l)) :
            Finset (Fin (2 ^ k))

            Columns of one row whose corresponding inputs belong to the domain.

            Equations
            Instances For
              theorem Complexity.CircuitSparseSynthesis.Internal.sum_rowDomain_card {k l : ℕ} (domain : Finset (Fin (k + l) → Bool)) :
              ∑ r : Fin (2 ^ l), (rowDomain domain r).card = domain.card
              theorem Complexity.CircuitSparseSynthesis.Internal.matrix_synthesis {k l : ℕ} {B : Type} [Fintype B] (patterns : B → Fin (2 ^ k) → Bool) (patternSize : ℕ) (small : ∀ (b : B), {c : Fin (2 ^ k) | patterns b c = true}.card ≤ patternSize) (count : Fin (2 ^ l) → ℕ) (chosen : (row : Fin (2 ^ l)) → Fin (count row) → B) :
              Cslib.Circuits.Synthesis Cslib.Circuits.Boolean.interpretation (Cslib.Circuits.inputs (k + l)) {fun (x : Fin (k + l) → Bool) => decide (∃ (j : Fin (count (rowAt x))), patterns (chosen (rowAt x) j) (columnAt x) = true)} ((2 ^ k + 2 ^ l) * (2 * (k + l) + 1) + Fintype.card B * (patternSize + 1) + ∑ row : Fin (2 ^ l), count row + 3 * 2 ^ l + 1)