refactor(Circuit): bundle gate count in circuits - #949
Open
SamuelSchlesinger wants to merge 1 commit into
Open
SamuelSchlesinger wants to merge 1 commit into
SamuelSchlesinger wants to merge 1 commit into
Conversation
SamuelSchlesinger
requested review from
arademaker,
chenson2018,
fmontesi,
kim-em and
sorrachai
as code owners
September 24, 2026 00:47
This was referenced Sep 24, 2026
SamuelSchlesinger
force-pushed
the
samschles/circuit-gate-count
branch
from
September 24, 2026 12:48
980a8e1 to
89d64f0
Compare
barni120400
pushed a commit
to barni120400/cslib
that referenced
this pull request
Sep 24, 2026
…r#947) ## Summary - Define `Cslib.BitString` and `Cslib.BooleanFunction` in Foundations. - Update Boolean circuits to import and use the shared definitions, so other Boolean complexity developments can use these types without a circuit dependency. This is the first part of the split of leanprover#943. The stack continues in leanprover#948 and leanprover#949. ## Validation - `lake build --wfail --iofail` - `lake exe mk_all --check` - `lake test` - `lake lint` - `lake exe lint-style` Codex assisted with splitting leanprover#943 into three focused PRs and running these local checks.
This was referenced Sep 25, 2026
SamuelSchlesinger
added this pull request to stack #953
September 25, 2026 03:01
fmontesi
force-pushed
the
samschles/circuit-gate-count
branch
from
September 25, 2026 08:02
89d64f0 to
686bd39
Compare
pepamontero
pushed a commit
to pepamontero/cslib
that referenced
this pull request
Sep 25, 2026
## Summary - Generalize `Circuit.Computes` to specify all designated outputs as a function returning an output tuple. - Add zero-gate `Circuit.wiring` for selecting, permuting, and duplicating inputs, with size, depth, evaluation, and computation lemmas. - Rename synthesis extraction to `Synthesis.exists_circuit_outputs` and adapt scalar counting, Shannon, Lupanov, and tests to the tuple-valued API. This is the second part of the split of leanprover#943. It builds on leanprover#947 and retains the explicit gate-count index; leanprover#949 changes that representation. ## Validation - `lake build --wfail --iofail` - `lake exe mk_all --check` - `lake test` - `lake lint` - `lake exe lint-style` Codex assisted with splitting leanprover#943 into three focused PRs, adapting this output change to the explicit gate-count representation, and running these local checks.
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.
Summary
Circuit.sizefield, leaving input and output counts as circuit type parameters.Program × Wirepairs for the counting bounds while stating computability and irredundancy membership through circuits.Circuitfiniteness and cardinality API is removed with its old type index.This is the final part of the split of #943 and builds on #948. The resulting circuit source and tests match the final code of #943 on the updated main branch.
Validation
lake build --wfail --iofaillake exe mk_all --checklake testlake lintlake exe lint-styleCodex assisted with splitting #943 into three focused PRs, restacking the gate-count changes, and running these local checks.