Skip to content

refactor(Circuit): bundle gate count in circuits - #949

Open
SamuelSchlesinger wants to merge 1 commit into
mainfrom
samschles/circuit-gate-count
Open

SamuelSchlesinger wants to merge 1 commit into
mainfrom
samschles/circuit-gate-count

Conversation

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Summary

  • Store the internal gate count as the implicit Circuit.size field, leaving input and output counts as circuit type parameters.
  • Enumerate fixed-size Program × Wire pairs for the counting bounds while stating computability and irredundancy membership through circuits.
  • Adapt normalization, synthesis, Shannon and Lupanov statements, and tests to the bundled representation. The fixed-size Circuit finiteness 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 --iofail
  • lake exe mk_all --check
  • lake test
  • lake lint
  • lake exe lint-style

Codex assisted with splitting #943 into three focused PRs, restacking the gate-count changes, and running these local checks.

@SamuelSchlesinger
SamuelSchlesinger force-pushed the samschles/circuit-gate-count branch from 980a8e1 to 89d64f0 Compare September 24, 2026 12:48
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.
@SamuelSchlesinger
SamuelSchlesinger added this pull request to stack #953 September 25, 2026 03:01
Base automatically changed from samschles/circuit-outputs to main September 25, 2026 08:02
@fmontesi
fmontesi force-pushed the samschles/circuit-gate-count branch from 89d64f0 to 686bd39 Compare September 25, 2026 08:02
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant