Documentation

CslibFrontier.Computability.Circuit.Frontier.Arborescence

Arborescence 2-SAT frontier bounds for fan-in-two U₂ circuits #

When a Boolean circuit c has fan-in at most 2, removing the depth-one determined wires c.program.depthOneDetermined W from any wire set W leaves every remaining wire w ∈ R (R ⊆ W \ c.program.depthOneDetermined W) with at most one incoming ClauseEdge in R: if two distinct wires u₁, u₂ ∈ R fed w = .gate g, their argument slots a₁ ≠ a₂ would exhaust all ≤ 2 slots of g, placing w in depthOneDetermined W (clauseEdge_subsingleton_of_sdiff_depthOneDetermined).

Consequently, clauseDigraph c.program I R is a branching (isBranching_clauseDigraph_of_sdiff_depthOneDetermined), its underlying simple graph u2ClauseGraph c.program I R is unconditionally an acyclic forest (isAcyclic_u2ClauseGraph_of_sdiff_depthOneDetermined), and SimpleGraph.logb_indepSetCount_fromRel_le_capped bounds the number of distinct frontier states at every layout step t by

Real.logb 2 |States_t| ≤ |W_t| - |D| - (53 / 200) * cappedEdges - (33 / 1000) * |activeRoots|

for any D₀(W_t) ⊆ D ⊆ D*(W_t) (logb_ncard_frontierValues_le_arborescence). Amortizing each wire of D₀(W_t) against its ≤ 2 incoming and ≤ 2 two-capped outgoing clauses (twoCappedClauseEdges_le_add_four_mul) yields the clean D₀-free 1 / 4-per-clause bound on the unreduced cut W_t (logb_ncard_frontierValues_le_quarter_sub). These results are original to this library.

Main definitions #

Main results #

def Cslib.Circuits.Frontier.clauseDigraph {σ : Signature} {n s : ℕ} (p : Program σ n s) (I : Interpretation σ Bool) (R : Set (Wire n s)) :
Digraph ↑R

Directed ClauseEdge graph on a wire subset R : Set (Wire n s).

@[simp]
theorem Cslib.Circuits.Frontier.clauseDigraph_adj {σ : Signature} {n s : ℕ} (p : Program σ n s) (I : Interpretation σ Bool) (R : Set (Wire n s)) (u w : ↑R) :
(clauseDigraph p I R).Adj u w ↔ ClauseEdge p I ↑u ↑w

u2ClauseGraph p I R is SimpleGraph.fromRel of (clauseDigraph p I R).Adj.

theorem Cslib.Circuits.Frontier.clauseEdge_subsingleton_of_sdiff_depthOneDetermined {σ : Signature} {n s : ℕ} {p : Program σ n s} (hfan : p.FanInAtMost 2) (I : Interpretation σ Bool) {W R : Set (Wire n s)} (hR : R ⊆ W \ p.depthOneDetermined W) (w : ↑R) :
{u : ↑R | ClauseEdge p I ↑u ↑w}.Subsingleton

At most one cut input (d_in ≤ 1). In a fan-in-at-most-2 program p, removing p.depthOneDetermined W ensures every wire in any subset R ⊆ W \ p.depthOneDetermined W has at most one incoming ClauseEdge from R.

Branching property of clauseDigraph. For any fan-in-at-most-2 program p and any R ⊆ W \ p.depthOneDetermined W, clauseDigraph p I R is a branching.

Out-forest acyclicity of u2ClauseGraph. For any fan-in-at-most-2 program p and any R ⊆ W \ p.depthOneDetermined W, u2ClauseGraph p I R is an acyclic forest.

Reduced u2ClauseGraph on cutWires c P \ D is acyclic whenever c.program.depthOneDetermined (cutWires c P) ⊆ D (including both D = D₀ and D = D*).

Exact rational Tree-DP frontier bounds (α = 53 / 200, δ_root = 33 / 1000) #

def Cslib.Circuits.Frontier.clauseActiveRoots {σ : Signature} {n s : ℕ} (p : Program σ n s) (I : Interpretation σ Bool) (R : Set (Wire n s)) :
Set ↑R

Active roots of the ClauseEdge out-forest on R: wires in R with no incoming ClauseEdge from R and at least one outgoing ClauseEdge into R.

noncomputable def Cslib.Circuits.Frontier.clauseCappedEdges {σ : Signature} {n s : ℕ} (p : Program σ n s) (I : Interpretation σ Bool) (R : Set (Wire n s)) :

Total outgoing ClauseEdges in R after capping non-roots at 2 and roots at 3.

theorem Cslib.Circuits.Frontier.logb_indepSetCount_u2ClauseGraph_le_capped {σ : Signature} {n s : ℕ} {p : Program σ n s} (hfan : p.FanInAtMost 2) (I : Interpretation σ Bool) {W R : Set (Wire n s)} (hR : R ⊆ W \ p.depthOneDetermined W) :
Real.logb 2 ↑(u2ClauseGraph p I R).indepSetCount ≤ ↑R.ncard - 53 / 200 * ↑(clauseCappedEdges p I R) - 33 / 1000 * ↑(clauseActiveRoots p I R).ncard

Arborescence indepSetCount bound on u2ClauseGraph (arbitrary out-degrees).

theorem Cslib.Circuits.Frontier.logb_indepSetCount_u2ClauseGraph_le {σ : Signature} {n s : ℕ} {p : Program σ n s} (hfan : p.FanInAtMost 2) (I : Interpretation σ Bool) {W R : Set (Wire n s)} (hR : R ⊆ W \ p.depthOneDetermined W) (hout_int : ∀ (w : ↑R), (∃ (u : ↑R), ClauseEdge p I ↑u ↑w) → {v : ↑R | ClauseEdge p I ↑w ↑v}.ncard ≤ 2) (hout_root : ∀ (r : ↑R), (¬∃ (u : ↑R), ClauseEdge p I ↑u ↑r) → {v : ↑R | ClauseEdge p I ↑r ↑v}.ncard ≤ 3) :
Real.logb 2 ↑(u2ClauseGraph p I R).indepSetCount ≤ ↑R.ncard - 53 / 200 * ↑(u2ClauseGraph p I R).edgeSet.ncard - 33 / 1000 * ↑(clauseActiveRoots p I R).ncard

Arborescence indepSetCount bound on u2ClauseGraph (bounded out-degrees). When internal wires in R have at most 2 outgoing clauses in R and roots in R have at most 3, clauseCappedEdges equals (u2ClauseGraph p I R).edgeSet.ncard.

theorem Cslib.Circuits.Frontier.logb_ncard_frontierValues_le_arborescence {σ : Signature} {n m : ℕ} {c : Circuit σ n m} (hfan : c.FanInAtMost 2) (I : Interpretation σ Bool) (Acc : Fin m → Set Bool) (π : Layout (Compiler.Vertex c)) (t : ℕ) {D : Set (Wire n c.size)} (hD₀ : c.program.depthOneDetermined (cutWires c (π.initial t)) ⊆ D) (hD : D ⊆ c.program.forwardDetermined (cutWires c (π.initial t))) (X : Set (Fin n → Bool)) :
Real.logb 2 ↑((fun (x : Fin n → Bool) => (Compiler.network c I Acc).frontierValues π t fun (e : Compiler.Edge c) => c.program.trace I x ↑e.signal) '' X).ncard ≤ ↑(cutWires c (π.initial t)).ncard - ↑D.ncard - 53 / 200 * ↑(clauseCappedEdges c.program I (cutWires c (π.initial t) \ D)) - 33 / 1000 * ↑(clauseActiveRoots c.program I (cutWires c (π.initial t) \ D)).ncard

Combined D*(∂) + Arborescence frontier state bound. Along any layout π of a fan-in-2 Boolean circuit c, for any D with D₀(W_t) ⊆ D ⊆ D*(W_t) (W_t = cutWires c (π.initial t)), the base-2 log of the number of distinct frontier states at step t is at most |W_t| - |D| - (53 / 200) * clauseCappedEdges - (33 / 1000) * |clauseActiveRoots|.

theorem Cslib.Circuits.Frontier.ncard_frontierValues_le_rpow_arborescence {σ : Signature} {n m : ℕ} {c : Circuit σ n m} (hfan : c.FanInAtMost 2) (I : Interpretation σ Bool) (Acc : Fin m → Set Bool) (π : Layout (Compiler.Vertex c)) (t : ℕ) {D : Set (Wire n c.size)} (hD₀ : c.program.depthOneDetermined (cutWires c (π.initial t)) ⊆ D) (hD : D ⊆ c.program.forwardDetermined (cutWires c (π.initial t))) (X : Set (Fin n → Bool)) :
↑((fun (x : Fin n → Bool) => (Compiler.network c I Acc).frontierValues π t fun (e : Compiler.Edge c) => c.program.trace I x ↑e.signal) '' X).ncard ≤ 2 ^ (↑(cutWires c (π.initial t)).ncard - ↑D.ncard - 53 / 200 * ↑(clauseCappedEdges c.program I (cutWires c (π.initial t) \ D)) - 33 / 1000 * ↑(clauseActiveRoots c.program I (cutWires c (π.initial t) \ D)).ncard)

Exponential (2 ^ ·) companion to logb_ncard_frontierValues_le_arborescence.

theorem Cslib.Circuits.Frontier.logb_ncard_frontierValues_le_arborescence_depthOne {σ : Signature} {n m : ℕ} {c : Circuit σ n m} (hfan : c.FanInAtMost 2) (I : Interpretation σ Bool) (Acc : Fin m → Set Bool) (π : Layout (Compiler.Vertex c)) (t : ℕ) (X : Set (Fin n → Bool)) :
Real.logb 2 ↑((fun (x : Fin n → Bool) => (Compiler.network c I Acc).frontierValues π t fun (e : Compiler.Edge c) => c.program.trace I x ↑e.signal) '' X).ncard ≤ ↑(cutWires c (π.initial t)).ncard - ↑(c.program.depthOneDetermined (cutWires c (π.initial t))).ncard - 53 / 200 * ↑(clauseCappedEdges c.program I (cutWires c (π.initial t) \ c.program.depthOneDetermined (cutWires c (π.initial t)))) - 33 / 1000 * ↑(clauseActiveRoots c.program I (cutWires c (π.initial t) \ c.program.depthOneDetermined (cutWires c (π.initial t)))).ncard

Specialization of logb_ncard_frontierValues_le_arborescence to D = c.program.depthOneDetermined (cutWires c (π.initial t)).

Amortized 1 / 4-per-clause D₀-free bound #

noncomputable def Cslib.Circuits.Frontier.twoCappedClauseEdges {σ : Signature} {n s : ℕ} (p : Program σ n s) (I : Interpretation σ Bool) (W : Set (Wire n s)) :

Total outgoing ClauseEdges on W capped at 2 per source wire.

Removing D₀ = p.depthOneDetermined W reduces twoCappedClauseEdges by at most 4 * |D₀|: at most 2 * |D₀| from sources u ∈ D₀ and at most 2 * |D₀| from targets w ∈ D₀.

theorem Cslib.Circuits.Frontier.logb_ncard_frontierValues_le_quarter_sub {σ : Signature} {n m : ℕ} {c : Circuit σ n m} (hfan : c.FanInAtMost 2) (I : Interpretation σ Bool) (Acc : Fin m → Set Bool) (π : Layout (Compiler.Vertex c)) (t : ℕ) (X : Set (Fin n → Bool)) :
Real.logb 2 ↑((fun (x : Fin n → Bool) => (Compiler.network c I Acc).frontierValues π t fun (e : Compiler.Edge c) => c.program.trace I x ↑e.signal) '' X).ncard ≤ ↑(cutWires c (π.initial t)).ncard - 1 / 4 * ↑(twoCappedClauseEdges c.program I (cutWires c (π.initial t)))

D₀-free amortized 1 / 4-per-clause frontier state bound. Along any layout π of a fan-in-at-most-2 Boolean circuit c, each wire in D₀ touches at most 4 two-capped clauses (2 in + 2 out), so 53 / 200 ≥ 1 / 4 amortizes D₀ completely: Real.logb 2 |States_t| ≤ |cutWires| - (1 / 4) * twoCappedClauseEdges.