feat(circuits): tighten iterated switching union bound to gate count - #27
Open
SamuelSchlesinger wants to merge 1 commit into
Open
feat(circuits): tighten iterated switching union bound to gate count#27SamuelSchlesinger wants to merge 1 commit into
SamuelSchlesinger wants to merge 1 commit into
Conversation
Only AND/OR nodes can fail to switch, so the union bound in the iterated switching theorem needs one advice slot per gate, not one per syntax-tree node. Add AC0Formula.gateCount / forestGateCount (leaves cost zero, every gate costs one) with gateCount_le_size, and strengthen stageEventCount_stagedBad_mul_pow_le, exists_shallow_stagedDecisionTree_of_counting, and parity_counting_obstruction to charge gateCount instead of size. The size-based forms remain derivable via gateCount_le_size.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only AND/OR nodes can fail to switch, so the union bound in the iterated switching theorem needs one advice slot per gate, not one per syntax-tree node. Leaves (constants and literals) compile to depth-≤1 decision trees and provably contribute no bad events, yet
sizecharged them anyway — for a width-wbottom gate the old bound overcharged by roughly a factor ofw.Changes
AC0Formula.gateCount/forestGateCount(leaves cost zero, every gate costs one) withgateCount_le_size, andforestGateCount_ofList_internal.stageEventCount_stagedBad_mul_pow_le,exists_shallow_stagedDecisionTree_of_counting, andparity_counting_obstructionto chargegateCountinstead ofsize. The internal induction is unchanged in structure: the1 +pays for the top gate's switching event and the forest sum covers the children.gateCount_le_size.Verification
lake build --wfailplus both Validation executablespython3 scripts/lint_style.pycleanlake exe runLinter Complexitylibcleanlake env lean scripts/AxiomGuard.lean: 42,920 declarations (31,285 theorems) on standard axioms onlyDownstream note:
circuit-nondetpins this commit and restates itsiterated_switching_count,sensitivity_depth_reduction, andavgSensitivity_le_of_switching_budgetwith the tightened measure.