Threshold programs as block decompositions #
Program.evalFrom_eq_eval: overriding gates by their true values and feeding the other gates their true weighted input sums recovers the ordinary evaluation.Program.piecesAtMost_evalFrom_internal(Lemma 2): if every unfixed gatejreceives the input contributionslope j * t, the gate values have at most2 ^ rpieces as functions oft, wherercounts the unfixed gates withslope j ≠ 0. Induction over the gates: on each piece of the earlier gates, the next gate is[slope * t + c ≥ 0]for one constantc, which is monotone intand splits the piece into at most two intervals; a gate with zero slope or a fixed gate is constant on each piece.Program.DirectionRuns.toBlockDecomposition: a split of the gates into runs along single directions gives a block decomposition whosei-th block changes at most2 ^ rᵢ - 1times,rᵢbeing the number of input-reading gates of the run.
theorem
Algebraic.Threshold.Program.evalFrom_eq_eval
{n s : ℕ}
(C : Program n s)
{fixed : Finset (Fin s)}
{η : Fin s → Bool}
{z : Fin s → ℝ}
{x : Fin n → Bool}
(j : Fin s)
(hfix : ∀ k ≤ j, k ∈ fixed → η k = C.eval x k)
(hz : ∀ k ≤ j, k ∉ fixed → z k = weightedSum (C.inputWeight k) x)
:
Overriding gates by their true values and feeding the other gates their true weighted input sums recovers the ordinary evaluation, gate by gate.
theorem
Algebraic.Threshold.Program.piecesAtMost_evalFrom_internal
{n s : ℕ}
(C : Program n s)
(fixed : Finset (Fin s))
(η : Fin s → Bool)
(slope : Fin s → ℝ)
:
Lemma 2 (pieces of a run). If every gate outside fixed receives the input contribution
slope j * t, the gate values have at most 2 ^ r pieces as functions of t, where r counts
the gates outside fixed with a nonzero slope.
noncomputable def
Algebraic.Threshold.Program.DirectionRuns.slope
{n s : ℕ}
{C : Program n s}
{B : ℕ}
(R : C.DirectionRuns B)
(i : ℕ)
(j : Fin s)
:
The slope of a gate of run i along the direction of the run, and zero elsewhere.
Instances For
noncomputable def
Algebraic.Threshold.Program.DirectionRuns.toBlockDecomposition
{n s : ℕ}
{C : Program n s}
{B : ℕ}
{f : Cslib.BooleanFunction n}
(R : C.DirectionRuns B)
(hC : C.Computes f)
:
BlockDecomposition f (Fin s → Bool)
The block decomposition of a program along a split into direction runs: the history after
i blocks holds the values of the gates of the first i runs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Algebraic.Threshold.Program.DirectionRuns.toBlockDecomposition_cost
{n s : ℕ}
{C : Program n s}
{B : ℕ}
{f : Cslib.BooleanFunction n}
(R : C.DirectionRuns B)
(hC : C.Computes f)
: