Skip to content

refactor(Circuit,Promise): reuse computes_single_iff across single-output circuits (#884) - #903

Closed
SamuelSchlesinger wants to merge 1 commit into
mainfrom
refactor/circuit-computes-single-iff-884
Closed

SamuelSchlesinger wants to merge 1 commit into
mainfrom
refactor/circuit-computes-single-iff-884

Conversation

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Summary

Implements Item 9 (computes_single_iff reuse) of the metacomplexity quality audit (#884), addressing the F9 note across single-output circuit evaluation sites:

  • Complexity/Computability/Circuit/Frontier/Reduction.lean:
    • In Circuit.Computes.decides, replaced manual congrFun (h x) 0 and single_apply with Circuit.computes_single_iff.1 h x.
    • Added proof-only import Complexity.Computability.Circuit.Complexity.
  • Complexity/Computability/Circuit/Boolean/Correction.lean:
    • In complexityOn_pi_le, replaced (congrFun (hc i hx) 0).symm with (Circuit.computesOn_single_iff.1 (hc i) x hx).symm.
    • Replaced manual fun x => funext fun j => ... Fin.fin_one_eq_zero j with Circuit.computes_single_iff.2 fun _ => rfl.
  • Complexity/Computability/Circuit/Boolean/SparseSynthesis.lean:
    • In shatters_circuitSets, replaced fun x => funext j ... with Circuit.computes_single_iff.2 fun x => by simp [u].
    • Replaced simpa [hc ...] with Circuit.computesOn_single_iff.1 hc x ....
  • Complexity/Computability/Complexity/Classes/Promise/Circuit.lean:
    • In eval_eq_true_iff, replaced rw [hC, single_apply, ...] with rw [Circuit.computes_single_iff.1 (hC w.length), ...].
    • In computes_familyLanguage, replaced fun x => funext i ... single_apply with Circuit.computes_single_iff.2 fun _ => by rw [familyLanguage, Language.slice_ofSlices].

abstracts/catalogue.json Impact Assessment

Internal proof-only refactoring. Does not affect any definitions or theorems referenced in abstracts/catalogue.json.

Validation

  • ./scripts/check.sh:
    • ok build --wfail --iofail
    • ok mk_all --check
    • ok test --wfail --iofail
    • ok lint
    • ok lint-style
    • ok checkInitImports
  • python3 -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.
  • ./scripts/guide.sh --check: Guide written to guide/.lake/build/site/html-multi.

Refs #884

Authored by worker-jetski-20261024 under delegation from coordinator-claude-c4b0c164-20261023.

…tput circuits (#884)

Replaces ad-hoc single-output evaluation unfolding (funext/single_apply/congrFun)
with Circuit.computes_single_iff and Circuit.computesOn_single_iff across
Promise/Circuit.lean, Boolean/SparseSynthesis.lean, Boolean/Correction.lean,
and Frontier/Reduction.lean.

Refs #884 (Item 9, F9 note)
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Closing duplicate PR in favor of #902.

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