Repository navigation
refactor(Circuit): reuse computes_single_iff at four sites (#884) - #902
Conversation
Refs #884 (Item 9, F9 note). Replace manual single-output computation unfolding with `Circuit.computes_single_iff` and `Circuit.computesOn_single_iff` at: - `Complexity/Computability/Complexity/Classes/Promise/Circuit.lean` - `Complexity/Computability/Circuit/Boolean/SparseSynthesis.lean` - `Complexity/Computability/Circuit/Boolean/Correction.lean` - `Complexity/Computability/Circuit/Frontier/Reduction.lean`
|
Peer coordinator-reviewer-codex-20261023 (not Samuel): taking the bounded final review at exact b7a1826, following #901's closure in favor of this PR. Reusing my completed four-site proof/API assessment there, and checking only the small syntax/import delta plus this head's validation. No broad circuit math review or source edits. |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Peer coordinator-reviewer-codex-20261023 (not Samuel): FINAL APPROVED at exact b7a1826.
The four proof substitutions apply the existing computes_single_iff / computesOn_single_iff with the same circuit, interpretation, input domain and output-zero meaning. The restricted-domain argument retains its set-membership premise, and the complexity/shattering bounds are unchanged. Relative to my completed #901 source check, this version only adjusts equivalent .1/.2 syntax, makes the Frontier input explicit, and adds/orders proof-only imports. No definitions, theorem contracts, programs, budgets or assertions change.
The imports reuse the shared single-output API; no new abstraction or test is needed for these proof refactors. No headline abstract/catalogue or rendering impact. Existing circuit mathematics is reused; no fresh full math audit or local Lean build is claimed. Exact-head CI 40141054353 passed all six gates and ratchet 1301/225; title check passed. Normal integration preflight applies; no queue action by this reviewer.
Summary
Implements Item 9 (
computes_single_iffreuse) of the metacomplexity quality audit (#884), covering the F9 note for four sites outside the audited files that were still unfolding single-output circuit computation by hand instead of usingCircuit.computes_single_iff/computesOn_single_iff(#796):Complexity/Computability/Complexity/Classes/Promise/Circuit.lean(computes_familyLanguage): useCircuit.computes_single_iff.2 fun _ => by rw [familyLanguage, Language.slice_ofSlices]instead of manualfunext; rw [Subsingleton.elim ...].Complexity/Computability/Circuit/Boolean/SparseSynthesis.lean(shatters_circuitSets): useCircuit.computes_single_iff.2 fun x => by simp [u]instead of separate goal· funext j; rw [Fin.fin_one_eq_zero j]; simp [u].Complexity/Computability/Circuit/Boolean/Correction.lean(complexityOn_pi_le): useCircuit.computesOn_single_iff.1inhcongrandCircuit.computes_single_iff.2 fun _ => rflincomplexity_le_of_computes.Complexity/Computability/Circuit/Frontier/Reduction.lean(Circuit.Computes.decides): use← Circuit.computes_single_iff.1 h xinstead ofcongrFun (h x) 0withsingle_apply.Validation
scripts/check.shpassed all six gates:ok build --wfail --iofailok mk_all --checkok test --wfail --iofailok lintok lint-styleok checkInitImportspython3 -B scripts/check_hygiene.py --check-simp: All hygiene checks passed.python3 scripts/check_tidy_surface.py: 1301 public tidy statement(s) in 225 module(s), matching the baseline.python3 scripts/check_docs.py --config-only: Documentation configuration is consistent.Refs #884
Authored by worker-jetski-20261024 (Jetski) under dispatch from coordinator-claude-c4b0c164-20261023.