Documentation

CslibFrontier.Computability.Circuit.Decomposable.Peeling

Peeling large rectangles from deterministic decomposable DAGs #

A decomposable DAG is deterministic (DecomposableDAG.IsDeterministic) when no input is accepted by two distinct children of a union node. Over Bool with literal leaves, these are the deterministic DNNFs (d-DNNFs) of knowledge compilation [Dar01].

In any decomposable DAG (even without smoothness), the inputs for which a node v occurs on an accepting certificate form the rectangle of its accepted assignments and its contexts (DecomposableDAG.occurs_eq_rectangle). When unions are disjoint (DecomposableDAG.IsDeterministic), every accepted input has a unique accepting certificate, so replacing v by an empty leaf (DecomposableDAG.eraseNode) removes precisely that rectangle from the accepted set and no other inputs (DecomposableDAG.accepted_eraseNode), even when v is shared across many branches that partition the coordinates in incompatible ways.

Peeling (DecomposableDAG.abs_signedCount_accepted_le). Let S have bias at most b ≥ 0 on rectangles with both sides of size at least K (RectangleBias). For a smooth deterministic decomposable DAG (DecomposableDAG.IsSmooth and DecomposableDAG.IsDeterministic), while some occurring node v has at least K accepted assignments and at least K contexts, its occurring inputs form such a rectangle, and deleting v peels that rectangle cleanly without increasing the number of union edges or products. Once no such node remains, every node has a side smaller than K, so threshold counting (DecomposableDAG.ncard_accepted_le_of_smallSides) bounds the remaining accepted inputs by (K - 1) ^ 2 · #(union edges) + (K - 1) ^ 3 · #(products) when at least K remain, and by K - 1 otherwise (covering the single-leaf case where unionEdges = products = 0). Combining both phases extends Sam McGuire's branching-program peeling lemma to smooth deterministic decomposable DAGs:

|signedCount S accepted| ≤ 2 b |accepted| + (K - 1) ^ 2 · #(union edges) + (K - 1) ^ 3 · #(products) + (K - 1).

These node-deletion and RectangleBias peeling theorems on DecomposableDAG are original to this library, adapting the d-DNNF determinism condition of [Dar01] and rectangle decomposition of [BCMS16] to Sam McGuire's peeling method in CslibFrontier.Computability.Circuit.Frontier.AverageCase.

Main definitions #

Main results #

References #

Deleting a node #

noncomputable def Cslib.Circuits.DecomposableDAG.eraseNode {ι : Type u_1} {U : Type u_2} {N : Type u_3} (P : DecomposableDAG ι U N) (v₀ : N) :

The decomposable DAG obtained by replacing the node v₀ with an empty leaf and recomputing acceptance bottom-up along the rank order.

@[simp]
theorem Cslib.Circuits.DecomposableDAG.eraseNode_scope {ι : Type u_1} {U : Type u_2} {N : Type u_3} (P : DecomposableDAG ι U N) (v₀ : N) :
(P.eraseNode v₀).scope = P.scope
@[simp]
theorem Cslib.Circuits.DecomposableDAG.eraseNode_root {ι : Type u_1} {U : Type u_2} {N : Type u_3} (P : DecomposableDAG ι U N) (v₀ : N) :
(P.eraseNode v₀).root = P.root
@[simp]
theorem Cslib.Circuits.DecomposableDAG.eraseNode_rank {ι : Type u_1} {U : Type u_2} {N : Type u_3} (P : DecomposableDAG ι U N) (v₀ : N) :
(P.eraseNode v₀).rank = P.rank
theorem Cslib.Circuits.DecomposableDAG.unionEdges_eraseNode_le {ι : Type u_1} {U : Type u_2} {N : Type u_3} (P : DecomposableDAG ι U N) [Fintype N] (v₀ : N) :

Deleting a node does not increase the number of union edges.

theorem Cslib.Circuits.DecomposableDAG.products_eraseNode_le {ι : Type u_1} {U : Type u_2} {N : Type u_3} (P : DecomposableDAG ι U N) [Fintype N] (v₀ : N) :

Deleting a node does not increase the number of products.

theorem Cslib.Circuits.DecomposableDAG.size_eraseNode_le {ι : Type u_1} {U : Type u_2} {N : Type u_3} (P : DecomposableDAG ι U N) [Fintype N] (v₀ : N) :
(P.eraseNode v₀).size ≤ P.size

Deleting a node does not increase size.

Top-down sub-certificates #

theorem Cslib.Circuits.DecomposableDAG.IsSmooth.eraseNode {ι : Type u_1} {U : Type u_2} {N : Type u_3} {P : DecomposableDAG ι U N} (hs : P.IsSmooth) (v₀ : N) :

Deleting a node preserves IsSmooth.

theorem Cslib.Circuits.DecomposableDAG.IsDeterministic.eraseNode {ι : Type u_1} {U : Type u_2} {N : Type u_3} {P : DecomposableDAG ι U N} (hP : P.IsDeterministic) (v₀ : N) :

Deleting a node preserves IsDeterministic.

theorem Cslib.Circuits.DecomposableDAG.accepted_eraseNode {ι : Type u_1} {U : Type u_2} {N : Type u_3} {P : DecomposableDAG ι U N} (hP : P.IsDeterministic) (v₀ : N) :
(P.eraseNode v₀).accepted = P.accepted \ {x : ι → U | P.Occurs x v₀}

Exact rectangle deletion. In a deterministic decomposable DAG (not necessarily smooth), replacing a node v₀ by an empty leaf removes precisely the inputs for which v₀ occurs.

McGuire peeling #

theorem Cslib.Circuits.DecomposableDAG.abs_signedCount_accepted_le {ι : Type u_1} {U : Type u_2} {N : Type u_3} [Finite ι] [Finite U] [Fintype N] (P : DecomposableDAG ι U N) (hs : P.IsSmooth) (hP : P.IsDeterministic) {S : Set (ι → U)} {K : ℕ} {b : ℝ} (hb : 0 ≤ b) (hS : Frontier.RectangleBias S K b) :
|Frontier.signedCount S P.accepted| ≤ 2 * b * ↑P.accepted.ncard + ↑((K - 1) ^ 2 * P.unionEdges + (K - 1) ^ 3 * P.products + (K - 1))

Peeling for smooth deterministic decomposable DAGs. Let S have bias at most b ≥ 0 on rectangles with both sides of size at least K. For any smooth deterministic decomposable DAG P, the accepted inputs in S and those outside S differ in number by at most

2 b |accepted| + (K - 1) ^ 2 · #(union edges) + (K - 1) ^ 3 · #(products) + (K - 1).

The final +(K - 1) term accounts for the base case where fewer than K accepted inputs remain (such as a single leaf DAG with unionEdges = products = 0).

theorem Cslib.Circuits.DecomposableDAG.abs_signedCount_accepted_le_size {ι : Type u_1} {U : Type u_2} {N : Type u_3} [Finite ι] [Finite U] [Fintype N] (P : DecomposableDAG ι U N) (hs : P.IsSmooth) (hP : P.IsDeterministic) {S : Set (ι → U)} {K : ℕ} {b : ℝ} (hb : 0 ≤ b) (hS : Frontier.RectangleBias S K b) :
|Frontier.signedCount S P.accepted| ≤ 2 * b * ↑P.accepted.ncard + ↑((K - 1) ^ 3 * P.size + (K - 1))

Peeling by size. Under the hypotheses of abs_signedCount_accepted_le, |signedCount S accepted| ≤ 2 b |accepted| + (K - 1) ^ 3 · size + (K - 1).