Documentation

Complexity.Computability.Circuit.Boolean.Iteration.LabelCircuit

Circuits for canonical cycle labels #

Let c be a circuit of size s computing f on n-bit states. Some circuit of size at most 60000 * powerBudget n s (2 ^ n) L computes the canonical label of every state: the lexicographically least state of its eventual cycle, the cycle length and its phase (cycle_label_circuit), for every 0 < L ≤ 2 ^ n; with the balanced parameter the size is at most 180000 * optimizedBudget n s (2 ^ n) (cycle_labels_optimized).

The construction first applies f^[(2 ^ n)!] with a fixed-power circuit. This moves every state onto its cycle without changing its label. On a periodic state, choose checkpoints as for fixed powers and hardwire the label of each. The first 2 L + 1 states of the orbit are looked up in one shared dictionary (lookupOr); a checkpoint hit at time j gives the label after shifting its phase back by j (correctLabel_canonicalLabel). Without a hit the orbit repeats within L steps, so its cycle is short and is read off the orbit prefix (shortLabel_eq_canonicalLabel).

The circuits are native De Morgan circuits: every NOT, AND and OR gate and every constant is charged, while wiring and fanout are free. The checkpoints and their labels are chosen nonconstructively, so the circuits exist for each L; nothing here bounds the time to construct them.

Main definitions #

Main results #

References #

The gate count of the label construction from M checkpoints with parameter L: constants, the orbit prefix, the shared dictionary, one label correction per prefix state, the short-cycle label and the final selection.

Instances For
    theorem Cslib.Circuits.Boolean.Iteration.cyclic_labels_from_checkpoints {n M : ℕ} (c : Circuit signature n n) (L : ℕ) (hL : 0 < L) (hLN : L ≤ 2 ^ n) (cp : Fin M → BitString n) (hcp : Function.Injective cp) (hcover : ∀ (x : Fin n → Bool), FunctionalGraph.Repeats (c.eval interpretation) x L ∨ ∃ t < 2 * L, ∃ (j : Fin M), (c.eval interpretation)^[t] x = cp j) :

    Labels from checkpoints. Let cp be injective checkpoints such that every orbit repeats among its first L states or reaches a checkpoint in fewer than 2 L steps. Then some circuit of size at most labelCost n c.size M L computes the canonical label of every periodic state.

    theorem Cslib.Circuits.Boolean.Iteration.labelCost_le (n s M L : ℕ) (hL : 0 < L) (hLN : L ≤ 2 ^ n) (hM : M ≤ 2 ^ n / L) :
    labelCost n s M L ≤ 20000 * powerBudget n s (2 ^ n) L

    The label construction is within 20000 times the fixed-power tradeoff.

    theorem Cslib.Circuits.Boolean.Iteration.cyclic_label_circuit {n : ℕ} (c : Circuit signature n n) (L : ℕ) (hL : 0 < L) (hLN : L ≤ 2 ^ n) :

    Labels of periodic states. For every 0 < L ≤ 2 ^ n, some circuit of size at most 20000 * powerBudget n c.size (2 ^ n) L computes the canonical label of every periodic state.

    Moving a state onto its cycle with f^[(2 ^ n)!] does not change its label.

    theorem Cslib.Circuits.Boolean.Iteration.cycle_label_circuit {n : ℕ} (c : Circuit signature n n) (L : ℕ) (hL : 0 < L) (hLN : L ≤ 2 ^ n) :

    Cycle labels. For every 0 < L ≤ 2 ^ n, some circuit of size at most 60000 * powerBudget n c.size (2 ^ n) L computes the canonical label of every state: the lexicographically least state of its eventual cycle, the cycle length and its phase.

    Square-root cycle labels. Some circuit of size at most 180000 * optimizedBudget n c.size (2 ^ n) computes the canonical label of every state.