Spine decomposition and segment tree construction on prefix DAGs #
Left-spine decomposition (spine_decomposition), interval-tree extraction
(exists_wireIntervalTree), and unfolded segment distribution trees (buildSegTree) with
uniqueness of firstInput paths (countWireInSeg_le_one, buildSegTree_counts) and fanout budget
accounting (seg_fanout_bound, seg_root_fanout_bound) [Ser25a].
Main definitions #
Cslib.Circuits.Prefix.segActive,Cslib.Circuits.Prefix.segChildren: active wires andfirstInputchildren for a principal-chain segment[a, b).Cslib.Circuits.Prefix.ReachesInSeg,Cslib.Circuits.Prefix.countWireInSeg: segment path reachability and multiplicity counter.
Main results #
Cslib.Circuits.Prefix.ReachesInSeg.top_inversion,Cslib.Circuits.Prefix.countWireInSeg_le_one: path unpacking and at-most-one multiplicity along activefirstInputtrees.Cslib.Circuits.Prefix.seg_fanout_bound,Cslib.Circuits.Prefix.seg_root_fanout_bound: wire-fanout bounds at interior segment wires and at the segment root.
References #
Nonempty contiguous integer ranges List.range' coincide iff their starts and lengths do.
First input wire wires 0 read by a {mul, id} gate line.
Every gate has depth strictly greater than its firstInput wire.
Whether wire w is designated as an external output for some index in [a, b).
Whether wire w reaches an external output in [a, b) along non-root firstInput edges.
Active non-root gates whose firstInput is w.
Membership characterization of segChildren c a b root w.
A wire is segActive iff it carries a segment output or has an active segment child.
Every gate in segChildren c a b root w has rank strictly greater than w.rank.
Reachability along segChildren edges inside a principal-chain segment.
- refl {N : ℕ} {c : PrefixCircuit N} {a b : ℕ} {root : Wire N c.size} (u : Wire N c.size) : ReachesInSeg c a b root u u
- step {N : ℕ} {c : PrefixCircuit N} {a b : ℕ} {root z p : Wire N c.size} {g : Fin c.size} : g ∈ segChildren c a b root p → ReachesInSeg c a b root z p → ReachesInSeg c a b root z (Wire.gate g)
Unpacks a ReachesInSeg path from w into u = w or a step through segChildren.
segActive propagates forward along ReachesInSeg.
Multiplicity with which target is visited in the unfolded tree from w.
Any wire reachable from w via ReachesInSeg has multiplicity 1 in countWireInSeg.
Nonzero multiplicity in countWireInSeg implies ReachesInSeg.
Every wire has multiplicity at most 1 in countWireInSeg.
Active segment children plus segment output indicator at w do not exceed wireFanout.
At the segment root, reserving the next principal-chain gate sg leaves budget ≤ k - 1.